From 8e9eff800601d6e1b7e7e78cbf5171b218d88edc Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 16 Oct 2026 02:02:37 +0000 Subject: [PATCH] feat: Updated OpenAPI spec --- ...deogram.Account.JsonSerializerContext.g.cs | 95 +- ...ccountClient.AccountGetAccountApiKeys.g.cs | 501 + ...countClient.AccountGetAccountInvoices.g.cs | 499 + ....AccountClient.AccountGetAccountUsage.g.cs | 649 + ...ogram.AccountClient.GetAccountApiKeys.g.cs | 491 - ...gram.AccountClient.GetAccountInvoices.g.cs | 489 - ...deogram.AccountClient.GetAccountUsage.g.cs | 629 - ...tReferenceUsage.JsonSerializerContext.g.cs | 189 - ...enceUsageClient.Authorizations.Bearer.g.cs | 35 - ...erenceUsageClient.Constructors.Bearer.g.cs | 31 - ...nceUsageClient.GetAssetReferenceUsage.g.cs | 583 - .../Ideogram.AssetReferenceUsageClient.g.cs | 143 - ...ogram.AutoModel.JsonSerializerContext.g.cs | 136 +- ...ient.AutoModelPostGenerateImageV2Auto.g.cs | 938 + ...utoModelClient.AutoModelPostToolRemix.g.cs | 2924 + ...toModelClient.PostGenerateImageV2Auto.g.cs | 961 - ...deogram.AutoModelClient.PostToolRemix.g.cs | 1102 - .../Generated/Ideogram.AutoModelClient.g.cs | 3 - .../Ideogram.Batch.JsonSerializerContext.g.cs | 272 - ...ram.BatchClient.Authorizations.Bearer.g.cs | 35 - ...ogram.BatchClient.Constructors.Bearer.g.cs | 31 - ...gram.BatchClient.GetMaybeBatchResults.g.cs | 554 - .../Ideogram.BatchClient.PostBatch.g.cs | 605 - .../Generated/Ideogram.BatchClient.g.cs | 143 - ...eogram.Datasets.JsonSerializerContext.g.cs | 205 - ....DatasetsClient.Authorizations.Bearer.g.cs | 35 - ...am.DatasetsClient.Constructors.Bearer.g.cs | 31 - ...Ideogram.DatasetsClient.CreateDataset.g.cs | 526 - .../Ideogram.DatasetsClient.GetDataset.g.cs | 490 - .../Ideogram.DatasetsClient.ListDatasets.g.cs | 461 - ...gram.DatasetsClient.TrainDatasetModel.g.cs | 571 - ...am.DatasetsClient.UploadDatasetAssets.g.cs | 1619 - .../Generated/Ideogram.DatasetsClient.g.cs | 144 - ...Ideogram.Design.JsonSerializerContext.g.cs | 106 +- ...nt.DesignPostLayerizeDesignIdeogramV3.g.cs | 2602 + ...gnClient.PostLayerizeDesignIdeogramV3.g.cs | 935 - ...am.EditWorkflow.JsonSerializerContext.g.cs | 601 +- ...lowClient.EditWorkflowPostAdLocalizer.g.cs | 2476 + ...kflowClient.EditWorkflowPostAdResizer.g.cs | 2491 + ...owClient.EditWorkflowPostAdVariations.g.cs | 2371 + ...kflowClient.EditWorkflowPostColorways.g.cs | 2296 + ...Client.EditWorkflowPostGhostMannequin.g.cs | 1316 + ...owClient.EditWorkflowPostMaterialSwap.g.cs | 2413 + ...ent.EditWorkflowPostModelPoseVariants.g.cs | 2401 + ...Client.EditWorkflowPostSketchToRender.g.cs | 2395 + ...am.EditWorkflowClient.PostAdLocalizer.g.cs | 922 - ...gram.EditWorkflowClient.PostAdResizer.g.cs | 926 - ...m.EditWorkflowClient.PostAdVariations.g.cs | 865 - ...gram.EditWorkflowClient.PostColorways.g.cs | 867 - ...EditWorkflowClient.PostGhostMannequin.g.cs | 1414 - ...ogram.EditWorkflowClient.PostLookbook.g.cs | 681 - ...m.EditWorkflowClient.PostMaterialSwap.g.cs | 899 - ...tWorkflowClient.PostModelPoseVariants.g.cs | 889 - ...gram.EditWorkflowClient.PostModelSwap.g.cs | 881 - ...gram.EditWorkflowClient.PostPackshots.g.cs | 700 - ...tWorkflowClient.PostPreciseMaskedEdit.g.cs | 930 - ...tWorkflowClient.PostSkechersStyleEdit.g.cs | 772 - ...EditWorkflowClient.PostSketchToRender.g.cs | 873 - ...ogram.EditWorkflowClient.PostSoleSwap.g.cs | 766 - ...ditWorkflowClient.PostSwanSLogoDesign.g.cs | 720 - ...itWorkflowClient.PostSwanSLogoInstall.g.cs | 712 - ...am.EditWorkflowClient.PostSwapProduct.g.cs | 751 - ....EditWorkflowClient.PostTextLayerizer.g.cs | 886 - ...ram.EditWorkflowClient.PostVectorizer.g.cs | 852 - ...m.EditWorkflowClient.PostVirtualTryOn.g.cs | 836 - .../Ideogram.EditWorkflowClient.g.cs | 1 - ...eogram.Generate.JsonSerializerContext.g.cs | 1237 - ....GenerateClient.Authorizations.Bearer.g.cs | 35 - ...am.GenerateClient.Constructors.Bearer.g.cs | 31 - ...Ideogram.GenerateClient.GetGeneration.g.cs | 554 - ...Ideogram.GenerateClient.PostEditImage.g.cs | 2159 - ...m.GenerateClient.PostGenerateDesignV3.g.cs | 1094 - ...m.GenerateClient.PostGenerateDesignV4.g.cs | 759 - ...ateClient.PostGenerateDesignV4AsBytes.g.cs | 1307 - ...rateClient.PostGenerateDesignV4AsText.g.cs | 755 - ...erateClient.PostGenerateDesignV4Async.g.cs | 800 - ...gram.GenerateClient.PostGenerateImage.g.cs | 598 - ...GenerateClient.PostGenerateImageErnie.g.cs | 715 - ...ateClient.PostGenerateImageErnieAsync.g.cs | 763 - ...ateClient.PostGenerateImageFlux2Klein.g.cs | 715 - ...ient.PostGenerateImageFlux2KleinAsync.g.cs | 760 - ...lient.PostGenerateImageFlux2KleinBase.g.cs | 715 - ....PostGenerateImageFlux2KleinBaseAsync.g.cs | 760 - ...ateClient.PostGenerateImagePImageHigh.g.cs | 687 - ...lient.PostGenerateImagePImageIdeogram.g.cs | 738 - ....PostGenerateImagePImageIdeogramAsync.g.cs | 792 - ...rateClient.PostGenerateImagePImageLow.g.cs | 687 - ...eClient.PostGenerateImagePImageMedium.g.cs | 687 - ...Client.PostGenerateImagePImageVeryLow.g.cs | 687 - ...am.GenerateClient.PostGenerateImageV3.g.cs | 870 - ...Client.PostGenerateImageV3Transparent.g.cs | 762 - ...am.GenerateClient.PostGenerateImageV4.g.cs | 710 - ...m.GenerateClient.PostGenerateImageV45.g.cs | 710 - ...erateClient.PostGenerateImageV45Async.g.cs | 764 - ...nerateClient.PostGenerateImageV4Async.g.cs | 767 - ...lient.PostGenerateImageV4CfgDistilled.g.cs | 698 - ....PostGenerateImageV4CfgDistilledAsync.g.cs | 752 - ...GenerateClient.PostGenerateImageV4Fp8.g.cs | 701 - ...nerateClient.PostGenerateImageV4Im2Im.g.cs | 2171 - ...eClient.PostGenerateImageV4Im2ImAsync.g.cs | 2255 - ...erateClient.PostGenerateImageV4Stable.g.cs | 678 - ...Client.PostGenerateImageV4Transparent.g.cs | 744 - ...t.PostGenerateImageV4TransparentAsync.g.cs | 783 - ...enerateClient.PostGenerateImageZImage.g.cs | 715 - ...teClient.PostGenerateImageZImageAsync.g.cs | 760 - ...ram.GenerateClient.PostInpaintImageV3.g.cs | 2762 - ...m.GenerateClient.PostLayerizeDesignV3.g.cs | 2637 - ...gram.GenerateClient.PostLayerizeLogos.g.cs | 1668 - ...ram.GenerateClient.PostLayerizeTextV3.g.cs | 1854 - ...ogram.GenerateClient.PostReframeImage.g.cs | 1922 - ...ram.GenerateClient.PostReframeImageV3.g.cs | 2153 - ...deogram.GenerateClient.PostRemixImage.g.cs | 1770 - ...ogram.GenerateClient.PostRemixImageV3.g.cs | 2784 - ...ogram.GenerateClient.PostRemixImageV4.g.cs | 1953 - ....GenerateClient.PostRemixImageV4Async.g.cs | 2032 - ...m.GenerateClient.PostRemoveBackground.g.cs | 1745 - ...ogram.GenerateClient.PostRemoveObject.g.cs | 2033 - ...enerateClient.PostReplaceBackgroundV3.g.cs | 2244 - ...m.GenerateClient.PostResizeImageAsync.g.cs | 864 - .../Ideogram.GenerateClient.PostSnapMask.g.cs | 2745 - .../Ideogram.GenerateClient.PostTryOnV3.g.cs | 2215 - ...ogram.GenerateClient.PostUpscaleImage.g.cs | 1762 - ...eogram.GenerateClient.PostV1EditImage.g.cs | 806 - ...am.GenerateClient.PostV1EditLiteImage.g.cs | 2406 - .../Generated/Ideogram.GenerateClient.g.cs | 144 - ...ram.Generations.JsonSerializerContext.g.cs | 260 +- ...ionsClient.GenerationsGetGenerationV2.g.cs | 598 + ...ram.GenerationsClient.GetGenerationV2.g.cs | 578 - ...ccountClient.AccountGetAccountApiKeys.g.cs | 38 + ...countClient.AccountGetAccountInvoices.g.cs | 36 + ...IAccountClient.AccountGetAccountUsage.g.cs | 86 + ...gram.IAccountClient.GetAccountApiKeys.g.cs | 38 - ...ram.IAccountClient.GetAccountInvoices.g.cs | 36 - ...eogram.IAccountClient.GetAccountUsage.g.cs | 86 - ...enceUsageClient.Authorizations.Bearer.g.cs | 16 - ...nceUsageClient.GetAssetReferenceUsage.g.cs | 60 - .../Ideogram.IAssetReferenceUsageClient.g.cs | 48 - ...ient.AutoModelPostGenerateImageV2Auto.g.cs | 116 + ...utoModelClient.AutoModelPostToolRemix.g.cs | 357 + ...toModelClient.PostGenerateImageV2Auto.g.cs | 133 - ...eogram.IAutoModelClient.PostToolRemix.g.cs | 177 - .../Generated/Ideogram.IAutoModelClient.g.cs | 3 - ...am.IBatchClient.Authorizations.Bearer.g.cs | 16 - ...ram.IBatchClient.GetMaybeBatchResults.g.cs | 32 - .../Ideogram.IBatchClient.PostBatch.g.cs | 61 - .../Generated/Ideogram.IBatchClient.g.cs | 48 - ...IDatasetsClient.Authorizations.Bearer.g.cs | 16 - ...deogram.IDatasetsClient.CreateDataset.g.cs | 48 - .../Ideogram.IDatasetsClient.GetDataset.g.cs | 32 - ...Ideogram.IDatasetsClient.ListDatasets.g.cs | 32 - ...ram.IDatasetsClient.TrainDatasetModel.g.cs | 55 - ...m.IDatasetsClient.UploadDatasetAssets.g.cs | 95 - .../Generated/Ideogram.IDatasetsClient.g.cs | 49 - ...nt.DesignPostLayerizeDesignIdeogramV3.g.cs | 226 + ...gnClient.PostLayerizeDesignIdeogramV3.g.cs | 122 - ...lowClient.EditWorkflowPostAdLocalizer.g.cs | 263 + ...kflowClient.EditWorkflowPostAdResizer.g.cs | 305 + ...owClient.EditWorkflowPostAdVariations.g.cs | 231 + ...kflowClient.EditWorkflowPostColorways.g.cs | 265 + ...Client.EditWorkflowPostGhostMannequin.g.cs | 204 + ...owClient.EditWorkflowPostMaterialSwap.g.cs | 276 + ...ent.EditWorkflowPostModelPoseVariants.g.cs | 234 + ...Client.EditWorkflowPostSketchToRender.g.cs | 228 + ...m.IEditWorkflowClient.PostAdLocalizer.g.cs | 137 - ...ram.IEditWorkflowClient.PostAdResizer.g.cs | 150 - ....IEditWorkflowClient.PostAdVariations.g.cs | 116 - ...ram.IEditWorkflowClient.PostColorways.g.cs | 145 - ...EditWorkflowClient.PostGhostMannequin.g.cs | 251 - ...gram.IEditWorkflowClient.PostLookbook.g.cs | 92 - ....IEditWorkflowClient.PostMaterialSwap.g.cs | 154 - ...tWorkflowClient.PostModelPoseVariants.g.cs | 122 - ...ram.IEditWorkflowClient.PostModelSwap.g.cs | 114 - ...ram.IEditWorkflowClient.PostPackshots.g.cs | 109 - ...tWorkflowClient.PostPreciseMaskedEdit.g.cs | 136 - ...tWorkflowClient.PostSkechersStyleEdit.g.cs | 114 - ...EditWorkflowClient.PostSketchToRender.g.cs | 115 - ...gram.IEditWorkflowClient.PostSoleSwap.g.cs | 109 - ...ditWorkflowClient.PostSwanSLogoDesign.g.cs | 95 - ...itWorkflowClient.PostSwanSLogoInstall.g.cs | 88 - ...m.IEditWorkflowClient.PostSwapProduct.g.cs | 95 - ...IEditWorkflowClient.PostTextLayerizer.g.cs | 114 - ...am.IEditWorkflowClient.PostVectorizer.g.cs | 99 - ....IEditWorkflowClient.PostVirtualTryOn.g.cs | 137 - .../Ideogram.IEditWorkflowClient.g.cs | 1 - ...IGenerateClient.Authorizations.Bearer.g.cs | 16 - ...deogram.IGenerateClient.GetGeneration.g.cs | 32 - ...deogram.IGenerateClient.PostEditImage.g.cs | 233 - ....IGenerateClient.PostGenerateDesignV3.g.cs | 177 - ....IGenerateClient.PostGenerateDesignV4.g.cs | 105 - ...ateClient.PostGenerateDesignV4AsBytes.g.cs | 120 - ...rateClient.PostGenerateDesignV4AsText.g.cs | 105 - ...erateClient.PostGenerateDesignV4Async.g.cs | 141 - ...ram.IGenerateClient.PostGenerateImage.g.cs | 51 - ...GenerateClient.PostGenerateImageErnie.g.cs | 102 - ...ateClient.PostGenerateImageErnieAsync.g.cs | 141 - ...ateClient.PostGenerateImageFlux2Klein.g.cs | 102 - ...ient.PostGenerateImageFlux2KleinAsync.g.cs | 138 - ...lient.PostGenerateImageFlux2KleinBase.g.cs | 102 - ....PostGenerateImageFlux2KleinBaseAsync.g.cs | 138 - ...ateClient.PostGenerateImagePImageHigh.g.cs | 92 - ...lient.PostGenerateImagePImageIdeogram.g.cs | 107 - ....PostGenerateImagePImageIdeogramAsync.g.cs | 152 - ...rateClient.PostGenerateImagePImageLow.g.cs | 92 - ...eClient.PostGenerateImagePImageMedium.g.cs | 92 - ...Client.PostGenerateImagePImageVeryLow.g.cs | 92 - ...m.IGenerateClient.PostGenerateImageV3.g.cs | 137 - ...Client.PostGenerateImageV3Transparent.g.cs | 122 - ...m.IGenerateClient.PostGenerateImageV4.g.cs | 93 - ....IGenerateClient.PostGenerateImageV45.g.cs | 93 - ...erateClient.PostGenerateImageV45Async.g.cs | 138 - ...nerateClient.PostGenerateImageV4Async.g.cs | 141 - ...lient.PostGenerateImageV4CfgDistilled.g.cs | 90 - ....PostGenerateImageV4CfgDistilledAsync.g.cs | 135 - ...GenerateClient.PostGenerateImageV4Fp8.g.cs | 93 - ...nerateClient.PostGenerateImageV4Im2Im.g.cs | 222 - ...eClient.PostGenerateImageV4Im2ImAsync.g.cs | 287 - ...erateClient.PostGenerateImageV4Stable.g.cs | 88 - ...Client.PostGenerateImageV4Transparent.g.cs | 127 - ...t.PostGenerateImageV4TransparentAsync.g.cs | 157 - ...enerateClient.PostGenerateImageZImage.g.cs | 102 - ...teClient.PostGenerateImageZImageAsync.g.cs | 138 - ...am.IGenerateClient.PostInpaintImageV3.g.cs | 353 - ....IGenerateClient.PostLayerizeDesignV3.g.cs | 298 - ...ram.IGenerateClient.PostLayerizeLogos.g.cs | 128 - ...am.IGenerateClient.PostLayerizeTextV3.g.cs | 151 - ...gram.IGenerateClient.PostReframeImage.g.cs | 172 - ...am.IGenerateClient.PostReframeImageV3.g.cs | 216 - ...eogram.IGenerateClient.PostRemixImage.g.cs | 119 - ...gram.IGenerateClient.PostRemixImageV3.g.cs | 389 - ...gram.IGenerateClient.PostRemixImageV4.g.cs | 191 - ...IGenerateClient.PostRemixImageV4Async.g.cs | 251 - ....IGenerateClient.PostRemoveBackground.g.cs | 109 - ...gram.IGenerateClient.PostRemoveObject.g.cs | 164 - ...enerateClient.PostReplaceBackgroundV3.g.cs | 253 - ....IGenerateClient.PostResizeImageAsync.g.cs | 157 - ...Ideogram.IGenerateClient.PostSnapMask.g.cs | 152 - .../Ideogram.IGenerateClient.PostTryOnV3.g.cs | 252 - ...gram.IGenerateClient.PostUpscaleImage.g.cs | 111 - ...ogram.IGenerateClient.PostV1EditImage.g.cs | 101 - ...m.IGenerateClient.PostV1EditLiteImage.g.cs | 277 - .../Generated/Ideogram.IGenerateClient.g.cs | 49 - ...ionsClient.GenerationsGetGenerationV2.g.cs | 56 + ...am.IGenerationsClient.GetGenerationV2.g.cs | 56 - .../Generated/Ideogram.IIdeogramClient.g.cs | 89 +- ...geDescribePostDescribeImageIdeogramV3.g.cs | 104 + ...geDescribePostDescribeImageIdeogramV4.g.cs | 154 + ...ibeClient.PostDescribeImageIdeogramV3.g.cs | 66 - ...ibeClient.PostDescribeImageIdeogramV4.g.cs | 84 - ...sGeneratePostGenerateImageV2GptImage2.g.cs | 114 + ...atePostGenerateImageV2GptImage25Flare.g.cs | 132 + ...PostGenerateImageV2GptImage25Sunburst.g.cs | 135 + ...GeneratePostGenerateImageV2Ideogram45.g.cs | 154 + ...GeneratePostGenerateImageV2IdeogramV2.g.cs | 120 + ...eneratePostGenerateImageV2IdeogramV2A.g.cs | 119 + ...GeneratePostGenerateImageV2IdeogramV3.g.cs | 147 + ...ostGenerateImageV2IdeogramV3Character.g.cs | 358 + ...tGenerateImageV2IdeogramV3CustomModel.g.cs | 147 + ...tGenerateImageV2IdeogramV3Transparent.g.cs | 124 + ...GeneratePostGenerateImageV2IdeogramV4.g.cs | 120 + ...tGenerateImageV2IdeogramV4CustomModel.g.cs | 128 + ...tGenerateImageV2IdeogramV4Transparent.g.cs | 130 + ...eneratePostGenerateImageV2NanoBanana2.g.cs | 111 + ...neratePostGenerateImageV2NanoBanana21.g.cs | 111 + ...eratePostGenerateImageV2NanoBananaPro.g.cs | 111 + ...ratePostGenerateImageV2PImageIdeogram.g.cs | 134 + ...agesGeneratePostGenerateImageV2ZImage.g.cs | 100 + ...teClient.PostGenerateImageV2GptImage2.g.cs | 128 - ...nt.PostGenerateImageV2GptImage25Flare.g.cs | 150 - ...PostGenerateImageV2GptImage25Sunburst.g.cs | 153 - ...eClient.PostGenerateImageV2Ideogram45.g.cs | 173 - ...eClient.PostGenerateImageV2IdeogramV2.g.cs | 131 - ...Client.PostGenerateImageV2IdeogramV2A.g.cs | 130 - ...eClient.PostGenerateImageV2IdeogramV3.g.cs | 172 - ...ostGenerateImageV2IdeogramV3Character.g.cs | 186 - ...tGenerateImageV2IdeogramV3CustomModel.g.cs | 164 - ...tGenerateImageV2IdeogramV3Transparent.g.cs | 134 - ...eClient.PostGenerateImageV2IdeogramV4.g.cs | 130 - ...tGenerateImageV2IdeogramV4CustomModel.g.cs | 144 - ...tGenerateImageV2IdeogramV4Transparent.g.cs | 140 - ...Client.PostGenerateImageV2NanoBanana2.g.cs | 125 - ...lient.PostGenerateImageV2NanoBanana21.g.cs | 125 - ...ient.PostGenerateImageV2NanoBananaPro.g.cs | 125 - ...ent.PostGenerateImageV2PImageIdeogram.g.cs | 144 - ...erateClient.PostGenerateImageV2ZImage.g.cs | 113 - .../Ideogram.IImagesGenerateClient.g.cs | 4 - ...esInpaintPostInpaintImageV2IdeogramV3.g.cs | 346 + ...PostInpaintImageV2IdeogramV3Character.g.cs | 383 + ...stInpaintImageV2IdeogramV3CustomModel.g.cs | 302 + ...ntClient.PostInpaintImageV2IdeogramV3.g.cs | 181 - ...PostInpaintImageV2IdeogramV3Character.g.cs | 207 - ...stInpaintImageV2IdeogramV3CustomModel.g.cs | 162 - .../Ideogram.IImagesInpaintClient.g.cs | 1 - ...eEditPostPreciseEditImageV2Ideogram45.g.cs | 345 + ...ient.PostPreciseEditImageV2Ideogram45.g.cs | 174 - .../Ideogram.IImagesPreciseEditClient.g.cs | 1 - ...esReframeClient.Authorizations.Bearer.g.cs | 16 - .../Ideogram.IImagesReframeClient.Auto.g.cs | 112 - ...ogram.IImagesReframeClient.BriaExpand.g.cs | 107 - ....IImagesReframeClient.GptImage25Flare.g.cs | 114 - ...ogram.IImagesReframeClient.IdeogramV3.g.cs | 127 - ...gram.IImagesReframeClient.NanoBanana2.g.cs | 99 - ...am.IImagesReframeClient.NanoBananaPro.g.cs | 113 - .../Ideogram.IImagesReframeClient.g.cs | 50 - ...ImagesRemixPostRemixImageV2IdeogramV3.g.cs | 377 + ...ixPostRemixImageV2IdeogramV3Character.g.cs | 395 + ...PostRemixImageV2IdeogramV3CustomModel.g.cs | 376 + ...ImagesRemixPostRemixImageV2IdeogramV4.g.cs | 264 + ...emixClient.PostRemixImageV2IdeogramV3.g.cs | 185 - ...t.PostRemixImageV2IdeogramV3Character.g.cs | 205 - ...PostRemixImageV2IdeogramV3CustomModel.g.cs | 178 - ...emixClient.PostRemixImageV2IdeogramV4.g.cs | 134 - .../Ideogram.IImagesRemixClient.g.cs | 1 - ...sUpscalePostUpscaleImageNanoBananaPro.g.cs | 221 + ...gesUpscalePostUpscaleImageTopazBloom2.g.cs | 251 + ...sUpscalePostUpscaleImageTopazRedefine.g.cs | 365 + ...pscalePostUpscaleImageTopazStandardV2.g.cs | 288 + ...pscalePostUpscaleImageTopazTextRefine.g.cs | 300 + ...sUpscalePostUpscaleImageTopazWonder35.g.cs | 224 + ...eClient.PostUpscaleImageNanoBananaPro.g.cs | 123 - ...aleClient.PostUpscaleImageTopazBloom2.g.cs | 133 - ...eClient.PostUpscaleImageTopazRedefine.g.cs | 171 - ...lient.PostUpscaleImageTopazStandardV2.g.cs | 143 - ...lient.PostUpscaleImageTopazTextRefine.g.cs | 148 - ...eClient.PostUpscaleImageTopazWonder35.g.cs | 124 - ...egrationsClient.Authorizations.Bearer.g.cs | 16 - ...onsClient.GetIntegrationAssetDelivery.g.cs | 44 - ...m.IIntegrationsClient.GetIntegrations.g.cs | 28 - ...onsClient.PostIntegrationAssetsSearch.g.cs | 61 - .../Ideogram.IIntegrationsClient.g.cs | 49 - ...alTestingClient.Authorizations.Bearer.g.cs | 16 - ...rnalTestingClient.PostInternalTesting.g.cs | 92 - .../Ideogram.IInternalTestingClient.g.cs | 49 - ....IManageClient.AddOrganizationMembers.g.cs | 52 - ...m.IManageClient.Authorizations.Bearer.g.cs | 16 - ...ManageClient.CancelOrganizationInvite.g.cs | 51 - .../Ideogram.IManageClient.CreateApiKey.g.cs | 45 - ...Ideogram.IManageClient.CreateApiKeyV2.g.cs | 51 - ...eogram.IManageClient.CreateApiPayment.g.cs | 44 - ...geClient.DeactivateOrganizationApiKey.g.cs | 30 - ...gram.IManageClient.DeleteSingleApiKey.g.cs | 30 - ...ManageClient.DemoteOrganizationAdmins.g.cs | 52 - ...ram.IManageClient.GetApiCreditSummary.g.cs | 36 - .../Ideogram.IManageClient.GetApiKeys.g.cs | 26 - .../Ideogram.IManageClient.GetApiKeysV2.g.cs | 30 - ...ent.GetApiOrganizationUserSuggestions.g.cs | 42 - ...Ideogram.IManageClient.GetApiProfiles.g.cs | 26 - ...ManageClient.GetApiStripeSubscription.g.cs | 34 - ...gram.IManageClient.GetApiSubscription.g.cs | 30 - .../Ideogram.IManageClient.GetApiTerms.g.cs | 26 - ...geClient.GetOrganizationBillingPortal.g.cs | 30 - ....IManageClient.GetOrganizationMembers.g.cs | 32 - .../Ideogram.IManageClient.GetUsageInfo.g.cs | 90 - ...Ideogram.IManageClient.GetUserCredits.g.cs | 38 - ....IManageClient.GetUserSpendCommitInfo.g.cs | 34 - ...ManageClient.ListOrganizationInvoices.g.cs | 30 - ...am.IManageClient.PostAddCreditsForApi.g.cs | 52 - ...ram.IManageClient.PostApiSubscription.g.cs | 56 - .../Ideogram.IManageClient.PostApiTerms.g.cs | 46 - ...anageClient.PromoteOrganizationAdmins.g.cs | 52 - ...anageClient.RemoveOrganizationMembers.g.cs | 52 - ...ManageClient.ResendOrganizationInvite.g.cs | 51 - ...lient.UpdateOrganizationApiProperties.g.cs | 60 - ...gram.IManageClient.UpdateSingleApiKey.g.cs | 52 - .../Generated/Ideogram.IManageClient.g.cs | 49 - ...IMiniAppsClient.Authorizations.Bearer.g.cs | 16 - ...sClient.GetMiniAppMarketingProjection.g.cs | 28 - ...iniAppsClient.GetStalePreviewMiniApps.g.cs | 32 - ...eogram.IMiniAppsClient.PublishMiniApp.g.cs | 84 - ...IMiniAppsClient.PublishPreviewMiniApp.g.cs | 88 - ...gram.IMiniAppsClient.UnpublishMiniApp.g.cs | 36 - ...iniAppsClient.UnpublishPreviewMiniApp.g.cs | 36 - .../Generated/Ideogram.IMiniAppsClient.g.cs | 49 - ...m.IModelsClient.Authorizations.Bearer.g.cs | 16 - ...Ideogram.IModelsClient.GetCustomModel.g.cs | 32 - ...eogram.IModelsClient.ListCustomModels.g.cs | 36 - .../Ideogram.IModelsClient.TrainModelV3.g.cs | 54 - ...am.IModelsClient.TrainModelV3Advanced.g.cs | 74 - .../Ideogram.IModelsClient.TrainModelV4.g.cs | 54 - ...am.IModelsClient.TrainModelV4Advanced.g.cs | 89 - .../Generated/Ideogram.IModelsClient.g.cs | 49 - ...ctRemovalPostRemoveObjectFromV2Assets.g.cs | 160 + ...alClient.PostRemoveObjectFromV2Assets.g.cs | 106 - .../Ideogram.IObjectRemovalClient.g.cs | 2 - ...m.IPromptClient.Authorizations.Bearer.g.cs | 16 - ...deogram.IPromptClient.PostMagicPrompt.g.cs | 143 - ...ogram.IPromptClient.PostMagicPromptV4.g.cs | 65 - .../Generated/Ideogram.IPromptClient.g.cs | 48 - ...rovenanceClient.Authorizations.Bearer.g.cs | 16 - ...ProvenanceClient.PostProvenanceVerify.g.cs | 119 - .../Generated/Ideogram.IProvenanceClient.g.cs | 48 - ....IReframeClient.Authorizations.Bearer.g.cs | 16 + ...gram.IReframeClient.ReframeIdeogramV3.g.cs | 251 + ...ram.IReframeClient.ReframeNanoBanana2.g.cs | 184 + .../Generated/Ideogram.IReframeClient.g.cs | 48 + ...Ideogram.IToolClient.RemoveBackground.g.cs | 93 - ...deogram.IToolClient.ReplaceBackground.g.cs | 114 - ...oolClient.ReplaceBackgroundIdeogram45.g.cs | 131 - ...oolClient.ReplaceBackgroundIdeogramV3.g.cs | 118 - ...gram.IToolClient.ToolRemoveBackground.g.cs | 157 + ...ram.IToolClient.ToolReplaceBackground.g.cs | 225 + ...lient.ToolReplaceBackgroundIdeogram45.g.cs | 257 + ...lient.ToolReplaceBackgroundIdeogramV3.g.cs | 237 + .../Generated/Ideogram.IToolClient.g.cs | 1 - .../Ideogram.IToolsClient.PostUpscale.g.cs | 124 - ...deogram.IToolsClient.ToolsPostUpscale.g.cs | 209 + ...ostEditVideoMinimaxH3ReferenceToVideo.g.cs | 135 - ...deoEditClient.PostEditVideoSeedDance2.g.cs | 200 - ...ostEditVideoMinimaxH3ReferenceToVideo.g.cs | 116 + ...erateVideoKlingV3StandardImageToVideo.g.cs | 145 - ...nerateVideoKlingV3StandardTextToVideo.g.cs | 120 - ...ostGenerateVideoMinimaxH3ImageToVideo.g.cs | 131 - ...PostGenerateVideoMinimaxH3TextToVideo.g.cs | 106 - ...tGenerateVideoSeedDance25ImageToVideo.g.cs | 134 - ...erateVideoSeedDance25ReferenceToVideo.g.cs | 132 - ...stGenerateVideoSeedDance25TextToVideo.g.cs | 110 - ...stGenerateVideoSeedDance2ImageToVideo.g.cs | 140 - ...nerateVideoSeedDance2ReferenceToVideo.g.cs | 132 - ...ostGenerateVideoSeedDance2TextToVideo.g.cs | 110 - ....IVideoGenerateClient.PostLivingImage.g.cs | 79 - ...deoGenerateClient.PostProduct360Video.g.cs | 87 - ...erateVideoKlingV3StandardImageToVideo.g.cs | 276 + ...nerateVideoKlingV3StandardTextToVideo.g.cs | 108 + ...ostGenerateVideoMinimaxH3ImageToVideo.g.cs | 237 + ...PostGenerateVideoMinimaxH3TextToVideo.g.cs | 95 + ...tGenerateVideoSeedDance25ImageToVideo.g.cs | 246 + ...erateVideoSeedDance25ReferenceToVideo.g.cs | 113 + ...stGenerateVideoSeedDance25TextToVideo.g.cs | 99 + ...stGenerateVideoSeedDance2ImageToVideo.g.cs | 264 + ...nerateVideoSeedDance2ReferenceToVideo.g.cs | 113 + ...ostGenerateVideoSeedDance2TextToVideo.g.cs | 99 + ...m.IVisionClient.Authorizations.Bearer.g.cs | 16 - .../Ideogram.IVisionClient.PostDescribe.g.cs | 109 - ...Ideogram.IVisionClient.PostDescribeV4.g.cs | 181 - .../Generated/Ideogram.IVisionClient.g.cs | 49 - ...IWebhooksClient.Authorizations.Bearer.g.cs | 16 - ...IWebhooksClient.GetWebhookSigningJwks.g.cs | 46 - .../Generated/Ideogram.IWebhooksClient.g.cs | 51 - .../Generated/Ideogram.IdeogramClient.g.cs | 141 +- ...m.ImageDescribe.JsonSerializerContext.g.cs | 96 +- ...geDescribePostDescribeImageIdeogramV3.g.cs | 2229 + ...geDescribePostDescribeImageIdeogramV4.g.cs | 2363 + ...ibeClient.PostDescribeImageIdeogramV3.g.cs | 802 - ...ibeClient.PostDescribeImageIdeogramV4.g.cs | 847 - ....ImagesGenerate.JsonSerializerContext.g.cs | 673 +- ...sGeneratePostGenerateImageV2GptImage2.g.cs | 872 + ...atePostGenerateImageV2GptImage25Flare.g.cs | 952 + ...PostGenerateImageV2GptImage25Sunburst.g.cs | 955 + ...GeneratePostGenerateImageV2Ideogram45.g.cs | 983 + ...GeneratePostGenerateImageV2IdeogramV2.g.cs | 812 + ...eneratePostGenerateImageV2IdeogramV2A.g.cs | 810 + ...GeneratePostGenerateImageV2IdeogramV3.g.cs | 1014 + ...ostGenerateImageV2IdeogramV3Character.g.cs | 3059 + ...tGenerateImageV2IdeogramV3CustomModel.g.cs | 1056 + ...tGenerateImageV2IdeogramV3Transparent.g.cs | 816 + ...GeneratePostGenerateImageV2IdeogramV4.g.cs | 810 + ...tGenerateImageV2IdeogramV4CustomModel.g.cs | 857 + ...tGenerateImageV2IdeogramV4Transparent.g.cs | 821 + ...eneratePostGenerateImageV2NanoBanana2.g.cs | 869 + ...neratePostGenerateImageV2NanoBanana21.g.cs | 869 + ...eratePostGenerateImageV2NanoBananaPro.g.cs | 869 + ...ratePostGenerateImageV2PImageIdeogram.g.cs | 827 + ...agesGeneratePostGenerateImageV2ZImage.g.cs | 788 + ...teClient.PostGenerateImageV2GptImage2.g.cs | 888 - ...nt.PostGenerateImageV2GptImage25Flare.g.cs | 981 - ...PostGenerateImageV2GptImage25Sunburst.g.cs | 984 - ...eClient.PostGenerateImageV2Ideogram45.g.cs | 1013 - ...eClient.PostGenerateImageV2IdeogramV2.g.cs | 800 - ...Client.PostGenerateImageV2IdeogramV2A.g.cs | 798 - ...eClient.PostGenerateImageV2IdeogramV3.g.cs | 1054 - ...ostGenerateImageV2IdeogramV3Character.g.cs | 1140 - ...tGenerateImageV2IdeogramV3CustomModel.g.cs | 1065 - ...tGenerateImageV2IdeogramV3Transparent.g.cs | 803 - ...eClient.PostGenerateImageV2IdeogramV4.g.cs | 797 - ...tGenerateImageV2IdeogramV4CustomModel.g.cs | 846 - ...tGenerateImageV2IdeogramV4Transparent.g.cs | 808 - ...Client.PostGenerateImageV2NanoBanana2.g.cs | 885 - ...lient.PostGenerateImageV2NanoBanana21.g.cs | 885 - ...ient.PostGenerateImageV2NanoBananaPro.g.cs | 885 - ...ent.PostGenerateImageV2PImageIdeogram.g.cs | 814 - ...erateClient.PostGenerateImageV2ZImage.g.cs | 778 - .../Ideogram.ImagesGenerateClient.g.cs | 4 - ...m.ImagesInpaint.JsonSerializerContext.g.cs | 160 +- ...esInpaintPostInpaintImageV2IdeogramV3.g.cs | 3021 + ...PostInpaintImageV2IdeogramV3Character.g.cs | 3274 ++ ...stInpaintImageV2IdeogramV3CustomModel.g.cs | 3049 + ...ntClient.PostInpaintImageV2IdeogramV3.g.cs | 1133 - ...PostInpaintImageV2IdeogramV3Character.g.cs | 1249 - ...stInpaintImageV2IdeogramV3CustomModel.g.cs | 1133 - .../Ideogram.ImagesInpaintClient.g.cs | 1 - ...agesPreciseEdit.JsonSerializerContext.g.cs | 96 +- ...eEditPostPreciseEditImageV2Ideogram45.g.cs | 2838 + ...ient.PostPreciseEditImageV2Ideogram45.g.cs | 1049 - .../Ideogram.ImagesPreciseEditClient.g.cs | 1 - ...m.ImagesReframe.JsonSerializerContext.g.cs | 353 - ...esReframeClient.Authorizations.Bearer.g.cs | 35 - .../Ideogram.ImagesReframeClient.Auto.g.cs | 852 - ...eogram.ImagesReframeClient.BriaExpand.g.cs | 838 - ...agesReframeClient.Constructors.Bearer.g.cs | 31 - ...m.ImagesReframeClient.GptImage25Flare.g.cs | 863 - ...eogram.ImagesReframeClient.IdeogramV3.g.cs | 931 - ...ogram.ImagesReframeClient.NanoBanana2.g.cs | 839 - ...ram.ImagesReframeClient.NanoBananaPro.g.cs | 862 - .../Ideogram.ImagesReframeClient.g.cs | 145 - ...ram.ImagesRemix.JsonSerializerContext.g.cs | 256 +- ...ImagesRemixPostRemixImageV2IdeogramV3.g.cs | 3065 + ...ixPostRemixImageV2IdeogramV3Character.g.cs | 3245 ++ ...PostRemixImageV2IdeogramV3CustomModel.g.cs | 3163 + ...ImagesRemixPostRemixImageV2IdeogramV4.g.cs | 2615 + ...emixClient.PostRemixImageV2IdeogramV3.g.cs | 1129 - ...t.PostRemixImageV2IdeogramV3Character.g.cs | 1221 - ...PostRemixImageV2IdeogramV3CustomModel.g.cs | 1132 - ...emixClient.PostRemixImageV2IdeogramV4.g.cs | 960 - .../Generated/Ideogram.ImagesRemixClient.g.cs | 1 - ...m.ImagesUpscale.JsonSerializerContext.g.cs | 224 +- ...sUpscalePostUpscaleImageNanoBananaPro.g.cs | 2503 + ...gesUpscalePostUpscaleImageTopazBloom2.g.cs | 2587 + ...sUpscalePostUpscaleImageTopazRedefine.g.cs | 2944 + ...pscalePostUpscaleImageTopazStandardV2.g.cs | 2621 + ...pscalePostUpscaleImageTopazTextRefine.g.cs | 2660 + ...sUpscalePostUpscaleImageTopazWonder35.g.cs | 2395 + ...eClient.PostUpscaleImageNanoBananaPro.g.cs | 926 - ...aleClient.PostUpscaleImageTopazBloom2.g.cs | 954 - ...eClient.PostUpscaleImageTopazRedefine.g.cs | 1073 - ...lient.PostUpscaleImageTopazStandardV2.g.cs | 968 - ...lient.PostUpscaleImageTopazTextRefine.g.cs | 982 - ...eClient.PostUpscaleImageTopazWonder35.g.cs | 895 - ...am.Integrations.JsonSerializerContext.g.cs | 188 - ...egrationsClient.Authorizations.Bearer.g.cs | 35 - ...ntegrationsClient.Constructors.Bearer.g.cs | 31 - ...onsClient.GetIntegrationAssetDelivery.g.cs | 955 - ...am.IntegrationsClient.GetIntegrations.g.cs | 486 - ...onsClient.PostIntegrationAssetsSearch.g.cs | 662 - .../Ideogram.IntegrationsClient.g.cs | 144 - ...InternalTesting.JsonSerializerContext.g.cs | 168 - ...alTestingClient.Authorizations.Bearer.g.cs | 35 - ...rnalTestingClient.Constructors.Bearer.g.cs | 31 - ...rnalTestingClient.PostInternalTesting.g.cs | 700 - .../Ideogram.InternalTestingClient.g.cs | 144 - ...Converters.AdLocalizerRequestLanguage.g.cs | 53 - ...rs.AdLocalizerRequestLanguageNullable.g.cs | 60 - ...onConverters.AdResizerRequestPlatform.g.cs | 53 - ...ters.AdResizerRequestPlatformNullable.g.cs | 60 - ...Converters.AdResizerRequestResolution.g.cs | 53 - ...rs.AdResizerRequestResolutionNullable.g.cs | 60 - ...ters.AdVariationsRequestVariationType.g.cs | 53 - ...ariationsRequestVariationTypeNullable.g.cs | 60 - .../Ideogram.JsonConverters.ApiKeyStatus.g.cs | 53 - ...m.JsonConverters.ApiKeyStatusNullable.g.cs | 60 - ...deogram.JsonConverters.ApiProfileRole.g.cs | 53 - ...JsonConverters.ApiProfileRoleNullable.g.cs | 60 - ...deogram.JsonConverters.ApiProfileType.g.cs | 53 - ...JsonConverters.ApiProfileTypeNullable.g.cs | 60 - .../Ideogram.JsonConverters.AspectRatio.g.cs | 53 - ...am.JsonConverters.AspectRatioEditLite.g.cs | 53 - ...onverters.AspectRatioEditLiteNullable.g.cs | 60 - ...am.JsonConverters.AspectRatioNullable.g.cs | 60 - ...Ideogram.JsonConverters.AspectRatioV4.g.cs | 53 - ....JsonConverters.AspectRatioV4Nullable.g.cs | 60 - ...ram.JsonConverters.AttributeValueType.g.cs | 53 - ...Converters.AttributeValueTypeNullable.g.cs | 60 - ...JsonConverters.ColorPalettePresetName.g.cs | 53 - ...erters.ColorPalettePresetNameNullable.g.cs | 60 - ...s.ColorPaletteWithPresetNameOrMembers.g.cs | 141 - ...nConverters.DatasetAssetFailureReason.g.cs | 53 - ...ers.DatasetAssetFailureReasonNullable.g.cs | 60 - ...onverters.DatasetCoverAssetIdentifier.g.cs | 74 - ...m.JsonConverters.DescribeModelVersion.g.cs | 53 - ...nverters.DescribeModelVersionNullable.g.cs | 60 - ...rters.DetectedTextBlockFormattingItem.g.cs | 53 - ...tectedTextBlockFormattingItemNullable.g.cs | 60 - ...ters.DetectedTextBlockFormattingItems.g.cs | 53 + ...ectedTextBlockFormattingItemsNullable.g.cs | 60 + ...esignRequestV4ArtifactGenerationModel.g.cs | 53 - ...uestV4ArtifactGenerationModelNullable.g.cs | 60 - ...ignRequestV4InspirationReferenceModel.g.cs | 53 - ...stV4InspirationReferenceModelNullable.g.cs | 60 - ...ateDesignRequestV4Layout2imageVariant.g.cs | 53 - ...nRequestV4Layout2imageVariantNullable.g.cs | 60 - ...s.GenerateDesignRequestV4ResponseType.g.cs | 53 - ...teDesignRequestV4ResponseTypeNullable.g.cs | 60 - ...ImageGptImage25FlareRequestBackground.g.cs | 53 - ...Image25FlareRequestBackgroundNullable.g.cs | 60 - ...ateImageGptImage25FlareRequestQuality.g.cs | 53 - ...GptImage25FlareRequestQualityNullable.g.cs | 60 - ...geGptImage25SunburstRequestBackground.g.cs | 53 - ...ge25SunburstRequestBackgroundNullable.g.cs | 60 - ...ImageGptImage25SunburstRequestQuality.g.cs | 53 - ...Image25SunburstRequestQualityNullable.g.cs | 60 - ...erateImageIdeogram45RequestBackground.g.cs | 53 - ...geIdeogram45RequestBackgroundNullable.g.cs | 60 - ...GenerateImageIdeogram45RequestQuality.g.cs | 53 - ...ImageIdeogram45RequestQualityNullable.g.cs | 60 - ...ogramV3CharacterRequestRenderingSpeed.g.cs | 53 - ...haracterRequestRenderingSpeedNullable.g.cs | 60 - ...geIdeogramV3CharacterRequestStyleType.g.cs | 53 - ...amV3CharacterRequestStyleTypeNullable.g.cs | 60 - ...ramV3CustomModelRequestRenderingSpeed.g.cs | 53 - ...tomModelRequestRenderingSpeedNullable.g.cs | 60 - ...eImageIdeogramV3RequestRenderingSpeed.g.cs | 53 - ...eogramV3RequestRenderingSpeedNullable.g.cs | 60 - ...mageNanoBanana21RequestResolutionTier.g.cs | 53 - ...Banana21RequestResolutionTierNullable.g.cs | 60 - ...ImageNanoBanana2RequestResolutionTier.g.cs | 53 - ...oBanana2RequestResolutionTierNullable.g.cs | 60 - ...ageNanoBananaProRequestResolutionTier.g.cs | 53 - ...ananaProRequestResolutionTierNullable.g.cs | 60 - ...s.GenerateImageRequestV4StableVersion.g.cs | 53 - ...teImageRequestV4StableVersionNullable.g.cs | 60 - ...erateImageV2AutoRequestResolutionTier.g.cs | 53 - ...geV2AutoRequestResolutionTierNullable.g.cs | 60 - ...onverters.GenerationResponseDataInner.g.cs | 60 +- ...riminatorMappingSvgGenerationMimeType.g.cs | 53 + ...rMappingSvgGenerationMimeTypeNullable.g.cs | 60 + ...onResponseDataInnerVariant1ObjectType.g.cs | 53 + ...seDataInnerVariant1ObjectTypeNullable.g.cs | 60 + ...onResponseDataInnerVariant2ObjectType.g.cs | 53 + ...seDataInnerVariant2ObjectTypeNullable.g.cs | 60 + ...onResponseDataInnerVariant3ObjectType.g.cs | 53 + ...seDataInnerVariant3ObjectTypeNullable.g.cs | 60 + ...onResponseDataInnerVariant4ObjectType.g.cs | 53 + ...seDataInnerVariant4ObjectTypeNullable.g.cs | 60 + ...onResponseDataInnerVariant5ObjectType.g.cs | 53 + ...seDataInnerVariant5ObjectTypeNullable.g.cs | 60 + ...onResponseDataInnerVariant6ObjectType.g.cs | 53 + ...seDataInnerVariant6ObjectTypeNullable.g.cs | 60 + ...Converters.GetAccountUsageBucketWidth.g.cs | 53 - ...rs.GetAccountUsageBucketWidthNullable.g.cs | 60 - ....JsonConverters.GetAccountUsageSource.g.cs | 53 - ...verters.GetAccountUsageSourceNullable.g.cs | 60 - ...nConverters.GhostMannequinRequestView.g.cs | 53 - ...ers.GhostMannequinRequestViewNullable.g.cs | 60 - ...rters.ImageGenerationObjectObjectType.g.cs | 53 - ...ageGenerationObjectObjectTypeNullable.g.cs | 60 - ...ionResponseV4ImageToImageResponseType.g.cs | 53 - ...nseV4ImageToImageResponseTypeNullable.g.cs | 60 - ...enerationResponseV4LayoutResponseType.g.cs | 53 - ...nResponseV4LayoutResponseTypeNullable.g.cs | 60 - ...ImageGenerationResponseV4ResponseType.g.cs | 53 - ...erationResponseV4ResponseTypeNullable.g.cs | 60 - ...geObjectWithoutPromptOrSeedObjectType.g.cs | 53 - ...WithoutPromptOrSeedObjectTypeNullable.g.cs | 60 - ...ogramV3CharacterRequestRenderingSpeed.g.cs | 53 - ...haracterRequestRenderingSpeedNullable.g.cs | 60 - ...geIdeogramV3CharacterRequestStyleType.g.cs | 53 - ...amV3CharacterRequestStyleTypeNullable.g.cs | 60 - ...ramV3CustomModelRequestRenderingSpeed.g.cs | 53 - ...tomModelRequestRenderingSpeedNullable.g.cs | 60 - ...tImageIdeogramV3RequestRenderingSpeed.g.cs | 53 - ...eogramV3RequestRenderingSpeedNullable.g.cs | 60 - ...verters.IntegrationErrorResponseError.g.cs | 53 - ...IntegrationErrorResponseErrorNullable.g.cs | 60 - ...eogram.JsonConverters.IntegrationType.g.cs | 53 - ...sonConverters.IntegrationTypeNullable.g.cs | 60 - ...onConverters.InternalTestingEnumField.g.cs | 53 - ...ters.InternalTestingEnumFieldNullable.g.cs | 60 - ...Ideogram.JsonConverters.InvoiceStatus.g.cs | 53 - ....JsonConverters.InvoiceStatusNullable.g.cs | 60 - ...ImageGenerationResponseV3ResponseType.g.cs | 53 - ...erationResponseV3ResponseTypeNullable.g.cs | 60 - ...erters.LayerizedImageObjectObjectType.g.cs | 53 - ...ayerizedImageObjectObjectTypeNullable.g.cs | 60 - ...ram.JsonConverters.LayerizedTextBlock.g.cs | 108 - ...onverters.LayerizedTextBlockAlignment.g.cs | 53 + ...s.LayerizedTextBlockAlignmentNullable.g.cs | 60 + ...ers.LayerizedTextBlockFormattingItems.g.cs | 53 + ...rizedTextBlockFormattingItemsNullable.g.cs | 60 + ...JsonConverters.LayerizedTextBlockRole.g.cs | 53 + ...erters.LayerizedTextBlockRoleNullable.g.cs | 60 + ....JsonConverters.ListCustomModelsScope.g.cs | 53 - ...verters.ListCustomModelsScopeNullable.g.cs | 60 - ...ram.JsonConverters.LivingImageQuality.g.cs | 53 - ...Converters.LivingImageQualityNullable.g.cs | 60 - ...sonConverters.LookbookRequestCategory.g.cs | 53 - ...rters.LookbookRequestCategoryNullable.g.cs | 60 - ...gram.JsonConverters.MagicPromptOption.g.cs | 53 - ...nConverters.MagicPromptOptionNullable.g.cs | 60 - ...s.MagicPromptRequestMessagesInnerRole.g.cs | 53 - ...romptRequestMessagesInnerRoleNullable.g.cs | 60 - ...JsonConverters.MagicPromptVersionEnum.g.cs | 53 - ...erters.MagicPromptVersionEnumNullable.g.cs | 60 - ....MiniAppMarketingProjectionEntryEmbed.g.cs | 53 - ...MarketingProjectionEntryEmbedNullable.g.cs | 60 - .../Ideogram.JsonConverters.ModelEnum.g.cs | 53 - ...gram.JsonConverters.ModelEnumNullable.g.cs | 60 - .../Ideogram.JsonConverters.ModelStatus.g.cs | 53 - ...am.JsonConverters.ModelStatusNullable.g.cs | 60 - ...ogram.JsonConverters.ModelSwapQuality.g.cs | 53 - ...onConverters.ModelSwapQualityNullable.g.cs | 60 - .../Ideogram.JsonConverters.ModelVersion.g.cs | 53 - ...m.JsonConverters.ModelVersionNullable.g.cs | 60 - ...rters.NanoBananaProReframeAspectRatio.g.cs | 53 - ...noBananaProReframeAspectRatioNullable.g.cs | 60 - ...ogram.JsonConverters.OutputResolution.g.cs | 53 - ...onConverters.OutputResolutionNullable.g.cs | 60 - ...ogram.JsonConverters.PImageResolution.g.cs | 53 - ...onConverters.PImageResolutionNullable.g.cs | 60 - .../Ideogram.JsonConverters.PackshotView.g.cs | 53 - ...m.JsonConverters.PackshotViewNullable.g.cs | 60 - ...ogram.JsonConverters.PackshotsQuality.g.cs | 53 - ...onConverters.PackshotsQualityNullable.g.cs | 60 - ...rters.PostGenerateDesignV4200Response.g.cs | 72 - ...4200ResponseDiscriminatorResponseType.g.cs | 53 - ...onseDiscriminatorResponseTypeNullable.g.cs | 60 - ...ciseEditImageIdeogram45RequestQuality.g.cs | 53 - ...ImageIdeogram45RequestQualityNullable.g.cs | 60 - ...JsonConverters.PreciseMaskedEditModel.g.cs | 53 - ...erters.PreciseMaskedEditModelNullable.g.cs | 60 - ...onConverters.PreciseMaskedEditQuality.g.cs | 53 - ...ters.PreciseMaskedEditQualityNullable.g.cs | 60 - ...deogram.JsonConverters.PriceQualifier.g.cs | 53 - ...JsonConverters.PriceQualifierNullable.g.cs | 60 - ...ogram.JsonConverters.PriceQuoteObject.g.cs | 53 - ...onConverters.PriceQuoteObjectNullable.g.cs | 60 - ...onConverters.Product360VideoDirection.g.cs | 53 - ...ters.Product360VideoDirectionNullable.g.cs | 60 - ...ovenanceVerifyResponseValidationState.g.cs | 53 - ...VerifyResponseValidationStateNullable.g.cs | 60 - ...ers.PublishMiniAppPreviewRequestEmbed.g.cs | 53 - ...ishMiniAppPreviewRequestEmbedNullable.g.cs | 60 - ...Converters.PublishMiniAppRequestEmbed.g.cs | 53 - ...rs.PublishMiniAppRequestEmbedNullable.g.cs | 60 - .../Ideogram.JsonConverters.Quality.g.cs | 53 - ...eogram.JsonConverters.QualityNullable.g.cs | 60 - ...ameImageGptImage25FlareRequestQuality.g.cs | 53 - ...GptImage25FlareRequestQualityNullable.g.cs | 60 - ...eImageIdeogramV3RequestRenderingSpeed.g.cs | 53 - ...eogramV3RequestRenderingSpeedNullable.g.cs | 60 - ...ageNanoBananaProRequestResolutionTier.g.cs | 53 - ...ananaProRequestResolutionTierNullable.g.cs | 60 - ...ogramV3CharacterRequestRenderingSpeed.g.cs | 53 - ...haracterRequestRenderingSpeedNullable.g.cs | 60 - ...geIdeogramV3CharacterRequestStyleType.g.cs | 53 - ...amV3CharacterRequestStyleTypeNullable.g.cs | 60 - ...ramV3CustomModelRequestRenderingSpeed.g.cs | 53 - ...tomModelRequestRenderingSpeedNullable.g.cs | 60 - ...xImageIdeogramV3RequestRenderingSpeed.g.cs | 53 - ...eogramV3RequestRenderingSpeedNullable.g.cs | 60 - ...xImageIdeogramV4RequestRenderingSpeed.g.cs | 53 - ...eogramV4RequestRenderingSpeedNullable.g.cs | 60 - ...deogram.JsonConverters.RenderingSpeed.g.cs | 53 - ...JsonConverters.RenderingSpeedNullable.g.cs | 60 - ...ogram.JsonConverters.RenderingSpeedV4.g.cs | 53 - ...onConverters.RenderingSpeedV4Nullable.g.cs | 60 - ...groundIdeogramV3RequestRenderingSpeed.g.cs | 53 - ...eogramV3RequestRenderingSpeedNullable.g.cs | 60 - ...m.JsonConverters.ResizeAdImageQuality.g.cs | 53 - ...nverters.ResizeAdImageQualityNullable.g.cs | 60 - ...erters.ResizeAdImageRequestResolution.g.cs | 53 - ...esizeAdImageRequestResolutionNullable.g.cs | 60 - .../Ideogram.JsonConverters.Resolution.g.cs | 53 - ...ram.JsonConverters.ResolutionNullable.g.cs | 60 - ...onConverters.ResolutionV4ImageToImage.g.cs | 53 - ...ters.ResolutionV4ImageToImageNullable.g.cs | 60 - ...ram.JsonConverters.ResolutionV4Layout.g.cs | 53 - ...Converters.ResolutionV4LayoutNullable.g.cs | 60 - .../Ideogram.JsonConverters.SegmentBy.g.cs | 53 - ...gram.JsonConverters.SegmentByNullable.g.cs | 60 - ...onConverters.SkechersStyleEditQuality.g.cs | 53 - ...ters.SkechersStyleEditQualityNullable.g.cs | 60 - ...s.SkechersStyleEditRequestAspectRatio.g.cs | 53 - ...rsStyleEditRequestAspectRatioNullable.g.cs | 60 - ...ersStyleEditRequestBaseGenerationSize.g.cs | 53 - ...EditRequestBaseGenerationSizeNullable.g.cs | 60 - ...eogram.JsonConverters.SoleSwapQuality.g.cs | 53 - ...sonConverters.SoleSwapQualityNullable.g.cs | 60 - ...ers.SoleSwapRequestBaseGenerationSize.g.cs | 53 - ...SwapRequestBaseGenerationSizeNullable.g.cs | 60 - ...Ideogram.JsonConverters.StylePresetV3.g.cs | 53 - ....JsonConverters.StylePresetV3Nullable.g.cs | 60 - .../Ideogram.JsonConverters.StyleType.g.cs | 53 - ...gram.JsonConverters.StyleTypeNullable.g.cs | 60 - .../Ideogram.JsonConverters.StyleTypeV3.g.cs | 53 - ...am.JsonConverters.StyleTypeV3Nullable.g.cs | 60 - ...onverters.SvgGenerationObjectMimeType.g.cs | 53 - ...s.SvgGenerationObjectMimeTypeNullable.g.cs | 60 - ...verters.SvgGenerationObjectObjectType.g.cs | 53 - ...SvgGenerationObjectObjectTypeNullable.g.cs | 60 - ...s.SwanSLogoDesignRequestDesignVariant.g.cs | 53 - ...ogoDesignRequestDesignVariantNullable.g.cs | 60 - ...rters.SwanSLogoDesignRequestLogoStyle.g.cs | 53 - ...anSLogoDesignRequestLogoStyleNullable.g.cs | 60 - ...ters.SwanSLogoDesignRequestSourceMode.g.cs | 53 - ...nSLogoDesignRequestSourceModeNullable.g.cs | 60 - ...ters.SwanSLogoInstallRequestLogoStyle.g.cs | 53 - ...nSLogoInstallRequestLogoStyleNullable.g.cs | 60 - ...ogram.JsonConverters.SwanSLogoQuality.g.cs | 53 - ...onConverters.SwanSLogoQualityNullable.g.cs | 60 - ...eogram.JsonConverters.SwapProductMode.g.cs | 53 - ...sonConverters.SwapProductModeNullable.g.cs | 60 - ...ram.JsonConverters.SwapProductQuality.g.cs | 53 - ...Converters.SwapProductQualityNullable.g.cs | 60 - ...am.JsonConverters.TextItemV3Alignment.g.cs | 53 - ...onverters.TextItemV3AlignmentNullable.g.cs | 60 - ...am.JsonConverters.TextItemV3GlyphType.g.cs | 53 - ...onverters.TextItemV3GlyphTypeNullable.g.cs | 60 - ...m.JsonConverters.TextItemV3StyleClass.g.cs | 53 - ...nverters.TextItemV3StyleClassNullable.g.cs | 60 - ...sonConverters.TextItemV3TextTransform.g.cs | 53 - ...rters.TextItemV3TextTransformNullable.g.cs | 60 - ...onverters.TextItemV3VerticalAlignment.g.cs | 53 - ...s.TextItemV3VerticalAlignmentNullable.g.cs | 60 - ...s.TextLayerizerResultObjectObjectType.g.cs | 53 - ...yerizerResultObjectObjectTypeNullable.g.cs | 60 - ...m.JsonConverters.TextSpanV3FontFxItem.g.cs | 53 - ...nverters.TextSpanV3FontFxItemNullable.g.cs | 60 - ...erters.ToolRemixRequestResolutionTier.g.cs | 53 - ...oolRemixRequestResolutionTierNullable.g.cs | 60 - .../Ideogram.JsonConverters.ToolType.g.cs | 53 - ...ogram.JsonConverters.ToolTypeNullable.g.cs | 60 - ...gram.JsonConverters.TrainingRunStatus.g.cs | 53 - ...nConverters.TrainingRunStatusNullable.g.cs | 60 - ...ram.JsonConverters.TransparencyOption.g.cs | 53 - ...Converters.TransparencyOptionNullable.g.cs | 60 - ...Ideogram.JsonConverters.UpscaleFactor.g.cs | 53 - ....JsonConverters.UpscaleFactorNullable.g.cs | 60 - ...ageNanoBananaProRequestResolutionTier.g.cs | 53 - ...ananaProRequestResolutionTierNullable.g.cs | 60 - ...eImageTopazBloom2RequestUpscaleFactor.g.cs | 53 - ...pazBloom2RequestUpscaleFactorNullable.g.cs | 60 - ...eTopazRedefineRequestSubjectDetection.g.cs | 53 - ...defineRequestSubjectDetectionNullable.g.cs | 60 - ...mageTopazRedefineRequestUpscaleFactor.g.cs | 53 - ...zRedefineRequestUpscaleFactorNullable.g.cs | 60 - ...opazStandardV2RequestSubjectDetection.g.cs | 53 - ...dardV2RequestSubjectDetectionNullable.g.cs | 60 - ...geTopazStandardV2RequestUpscaleFactor.g.cs | 53 - ...tandardV2RequestUpscaleFactorNullable.g.cs | 60 - ...opazTextRefineRequestSubjectDetection.g.cs | 53 - ...RefineRequestSubjectDetectionNullable.g.cs | 60 - ...geTopazTextRefineRequestUpscaleFactor.g.cs | 53 - ...extRefineRequestUpscaleFactorNullable.g.cs | 60 - ...pazWonder35RequestEnhancementStrength.g.cs | 53 - ...r35RequestEnhancementStrengthNullable.g.cs | 60 - ...mageTopazWonder35RequestUpscaleFactor.g.cs | 53 - ...zWonder35RequestUpscaleFactorNullable.g.cs | 60 - ...rters.UpscaleToolRequestUpscaleFactor.g.cs | 53 - ...scaleToolRequestUpscaleFactorNullable.g.cs | 60 - .../Ideogram.JsonConverters.UsageSource.g.cs | 53 - ...am.JsonConverters.UsageSourceNullable.g.cs | 60 - ...2AccountUsageGetParametersBucketWidth.g.cs | 53 + ...UsageGetParametersBucketWidthNullable.g.cs | 60 + ...tUsageGetParametersSourcesSchemaItems.g.cs | 53 + ...tParametersSourcesSchemaItemsNullable.g.cs | 60 + ...MultipartFormDataSchemaResolutionTier.g.cs | 53 + ...tFormDataSchemaResolutionTierNullable.g.cs | 60 + ...tentMultipartFormDataSchemaBackground.g.cs | 53 + ...ipartFormDataSchemaBackgroundNullable.g.cs | 60 + ...ContentMultipartFormDataSchemaQuality.g.cs | 53 + ...ultipartFormDataSchemaQualityNullable.g.cs | 60 + ...tentMultipartFormDataSchemaBackground.g.cs | 53 + ...ipartFormDataSchemaBackgroundNullable.g.cs | 60 + ...ContentMultipartFormDataSchemaQuality.g.cs | 53 + ...ultipartFormDataSchemaQualityNullable.g.cs | 60 + ...MultipartFormDataSchemaRenderingSpeed.g.cs | 53 + ...tFormDataSchemaRenderingSpeedNullable.g.cs | 60 + ...ntentMultipartFormDataSchemaStyleType.g.cs | 53 + ...tipartFormDataSchemaStyleTypeNullable.g.cs | 60 + ...MultipartFormDataSchemaRenderingSpeed.g.cs | 53 + ...tFormDataSchemaRenderingSpeedNullable.g.cs | 60 + ...MultipartFormDataSchemaRenderingSpeed.g.cs | 53 + ...tFormDataSchemaRenderingSpeedNullable.g.cs | 60 + ...tentMultipartFormDataSchemaBackground.g.cs | 53 + ...ipartFormDataSchemaBackgroundNullable.g.cs | 60 + ...ContentMultipartFormDataSchemaQuality.g.cs | 53 + ...ultipartFormDataSchemaQualityNullable.g.cs | 60 + ...MultipartFormDataSchemaResolutionTier.g.cs | 53 + ...tFormDataSchemaResolutionTierNullable.g.cs | 60 + ...MultipartFormDataSchemaResolutionTier.g.cs | 53 + ...tFormDataSchemaResolutionTierNullable.g.cs | 60 + ...MultipartFormDataSchemaResolutionTier.g.cs | 53 + ...tFormDataSchemaResolutionTierNullable.g.cs | 60 + ...MultipartFormDataSchemaRenderingSpeed.g.cs | 53 + ...tFormDataSchemaRenderingSpeedNullable.g.cs | 60 + ...ntentMultipartFormDataSchemaStyleType.g.cs | 53 + ...tipartFormDataSchemaStyleTypeNullable.g.cs | 60 + ...MultipartFormDataSchemaRenderingSpeed.g.cs | 53 + ...tFormDataSchemaRenderingSpeedNullable.g.cs | 60 + ...MultipartFormDataSchemaRenderingSpeed.g.cs | 53 + ...tFormDataSchemaRenderingSpeedNullable.g.cs | 60 + ...ContentMultipartFormDataSchemaQuality.g.cs | 53 + ...ultipartFormDataSchemaQualityNullable.g.cs | 60 + ...MultipartFormDataSchemaRenderingSpeed.g.cs | 53 + ...tFormDataSchemaRenderingSpeedNullable.g.cs | 60 + ...MultipartFormDataSchemaResolutionTier.g.cs | 53 + ...tFormDataSchemaResolutionTierNullable.g.cs | 60 + ...MultipartFormDataSchemaRenderingSpeed.g.cs | 53 + ...tFormDataSchemaRenderingSpeedNullable.g.cs | 60 + ...ntentMultipartFormDataSchemaStyleType.g.cs | 53 + ...tipartFormDataSchemaStyleTypeNullable.g.cs | 60 + ...MultipartFormDataSchemaRenderingSpeed.g.cs | 53 + ...tFormDataSchemaRenderingSpeedNullable.g.cs | 60 + ...MultipartFormDataSchemaRenderingSpeed.g.cs | 53 + ...tFormDataSchemaRenderingSpeedNullable.g.cs | 60 + ...MultipartFormDataSchemaRenderingSpeed.g.cs | 53 + ...tFormDataSchemaRenderingSpeedNullable.g.cs | 60 + ...MultipartFormDataSchemaRenderingSpeed.g.cs | 53 + ...tFormDataSchemaRenderingSpeedNullable.g.cs | 60 + ...tMultipartFormDataSchemaUpscaleFactor.g.cs | 53 + ...rtFormDataSchemaUpscaleFactorNullable.g.cs | 60 + ...MultipartFormDataSchemaResolutionTier.g.cs | 53 + ...tFormDataSchemaResolutionTierNullable.g.cs | 60 + ...tMultipartFormDataSchemaUpscaleFactor.g.cs | 53 + ...rtFormDataSchemaUpscaleFactorNullable.g.cs | 60 + ...ltipartFormDataSchemaSubjectDetection.g.cs | 53 + ...ormDataSchemaSubjectDetectionNullable.g.cs | 60 + ...tMultipartFormDataSchemaUpscaleFactor.g.cs | 53 + ...rtFormDataSchemaUpscaleFactorNullable.g.cs | 60 + ...ltipartFormDataSchemaSubjectDetection.g.cs | 53 + ...ormDataSchemaSubjectDetectionNullable.g.cs | 60 + ...tMultipartFormDataSchemaUpscaleFactor.g.cs | 53 + ...rtFormDataSchemaUpscaleFactorNullable.g.cs | 60 + ...ltipartFormDataSchemaSubjectDetection.g.cs | 53 + ...ormDataSchemaSubjectDetectionNullable.g.cs | 60 + ...tMultipartFormDataSchemaUpscaleFactor.g.cs | 53 + ...rtFormDataSchemaUpscaleFactorNullable.g.cs | 60 + ...partFormDataSchemaEnhancementStrength.g.cs | 53 + ...DataSchemaEnhancementStrengthNullable.g.cs | 60 + ...tMultipartFormDataSchemaUpscaleFactor.g.cs | 53 + ...rtFormDataSchemaUpscaleFactorNullable.g.cs | 60 + ...ontentMultipartFormDataSchemaLanguage.g.cs | 53 + ...ltipartFormDataSchemaLanguageNullable.g.cs | 60 + ...ontentMultipartFormDataSchemaPlatform.g.cs | 53 + ...ltipartFormDataSchemaPlatformNullable.g.cs | 60 + ...tentMultipartFormDataSchemaResolution.g.cs | 53 + ...ipartFormDataSchemaResolutionNullable.g.cs | 60 + ...tMultipartFormDataSchemaVariationType.g.cs | 53 + ...rtFormDataSchemaVariationTypeNullable.g.cs | 60 + ...odyContentMultipartFormDataSchemaView.g.cs | 53 + ...ntMultipartFormDataSchemaViewNullable.g.cs | 60 + ...eogram.JsonConverters.V4PromptElement.g.cs | 20 +- ....JsonConverters.VectorizerRequestMode.g.cs | 53 - ...verters.VectorizerRequestModeNullable.g.cs | 60 - ....JsonConverters.VideoObjectObjectType.g.cs | 53 - ...verters.VideoObjectObjectTypeNullable.g.cs | 60 - .../Ideogram.JsonSerializerContext.g.cs | 4150 +- .../Ideogram.JsonSerializerContextTypes.g.cs | 2286 +- ...Ideogram.Manage.JsonSerializerContext.g.cs | 360 - ...m.ManageClient.AddOrganizationMembers.g.cs | 603 - ...am.ManageClient.Authorizations.Bearer.g.cs | 35 - ...ManageClient.CancelOrganizationInvite.g.cs | 602 - ...gram.ManageClient.Constructors.Bearer.g.cs | 31 - .../Ideogram.ManageClient.CreateApiKey.g.cs | 523 - .../Ideogram.ManageClient.CreateApiKeyV2.g.cs | 570 - ...deogram.ManageClient.CreateApiPayment.g.cs | 505 - ...geClient.DeactivateOrganizationApiKey.g.cs | 532 - ...ogram.ManageClient.DeleteSingleApiKey.g.cs | 465 - ...ManageClient.DemoteOrganizationAdmins.g.cs | 603 - ...gram.ManageClient.GetApiCreditSummary.g.cs | 497 - .../Ideogram.ManageClient.GetApiKeys.g.cs | 479 - .../Ideogram.ManageClient.GetApiKeysV2.g.cs | 523 - ...ent.GetApiOrganizationUserSuggestions.g.cs | 547 - .../Ideogram.ManageClient.GetApiProfiles.g.cs | 479 - ...ManageClient.GetApiStripeSubscription.g.cs | 501 - ...ogram.ManageClient.GetApiSubscription.g.cs | 491 - .../Ideogram.ManageClient.GetApiTerms.g.cs | 479 - ...geClient.GetOrganizationBillingPortal.g.cs | 523 - ...m.ManageClient.GetOrganizationMembers.g.cs | 525 - .../Ideogram.ManageClient.GetUsageInfo.g.cs | 599 - .../Ideogram.ManageClient.GetUserCredits.g.cs | 511 - ...m.ManageClient.GetUserSpendCommitInfo.g.cs | 501 - ...ManageClient.ListOrganizationInvoices.g.cs | 523 - ...ram.ManageClient.PostAddCreditsForApi.g.cs | 576 - ...gram.ManageClient.PostApiSubscription.g.cs | 581 - .../Ideogram.ManageClient.PostApiTerms.g.cs | 533 - ...anageClient.PromoteOrganizationAdmins.g.cs | 603 - ...anageClient.RemoveOrganizationMembers.g.cs | 603 - ...ManageClient.ResendOrganizationInvite.g.cs | 602 - ...lient.UpdateOrganizationApiProperties.g.cs | 576 - ...ogram.ManageClient.UpdateSingleApiKey.g.cs | 568 - .../Generated/Ideogram.ManageClient.g.cs | 144 - ...eogram.MiniApps.JsonSerializerContext.g.cs | 204 - ....MiniAppsClient.Authorizations.Bearer.g.cs | 35 - ...am.MiniAppsClient.Constructors.Bearer.g.cs | 31 - ...sClient.GetMiniAppMarketingProjection.g.cs | 513 - ...iniAppsClient.GetStalePreviewMiniApps.g.cs | 557 - ...deogram.MiniAppsClient.PublishMiniApp.g.cs | 635 - ....MiniAppsClient.PublishPreviewMiniApp.g.cs | 640 - ...ogram.MiniAppsClient.UnpublishMiniApp.g.cs | 535 - ...iniAppsClient.UnpublishPreviewMiniApp.g.cs | 526 - .../Generated/Ideogram.MiniAppsClient.g.cs | 144 - .../Ideogram.Models.AccountApiKey.g.cs | 30 +- ...AccountGetAccountApiKeysResponse.Json.g.cs | 141 + ...dels.AccountGetAccountApiKeysResponse.g.cs | 19 + ...ccountGetAccountApiKeysResponse2.Json.g.cs | 141 + ...els.AccountGetAccountApiKeysResponse2.g.cs | 19 + ...ccountGetAccountInvoicesResponse.Json.g.cs | 141 + ...els.AccountGetAccountInvoicesResponse.g.cs | 19 + ...countGetAccountInvoicesResponse2.Json.g.cs | 141 + ...ls.AccountGetAccountInvoicesResponse2.g.cs | 19 + ...s.AccountGetAccountUsageResponse.Json.g.cs | 141 + ...Models.AccountGetAccountUsageResponse.g.cs | 19 + ....AccountGetAccountUsageResponse2.Json.g.cs | 141 + ...odels.AccountGetAccountUsageResponse2.g.cs | 19 + ....AccountGetAccountUsageResponse3.Json.g.cs | 141 + ...odels.AccountGetAccountUsageResponse3.g.cs | 19 + ....AccountGetAccountUsageResponse4.Json.g.cs | 141 + ...odels.AccountGetAccountUsageResponse4.g.cs | 19 + .../Ideogram.Models.AccountInvoice.g.cs | 23 +- ...deogram.Models.AccountInvoiceLineItem.g.cs | 45 +- .../Ideogram.Models.AccountInvoiceStatus.g.cs | 3 +- .../Ideogram.Models.AccountUsageApiKey.g.cs | 24 +- ...eogram.Models.AccountUsageBilledUnits.g.cs | 24 +- .../Ideogram.Models.AccountUsageBucket.g.cs | 2 +- .../Ideogram.Models.AccountUsageLineItem.g.cs | 52 +- ...eogram.Models.AdLocalizerRequest.Json.g.cs | 141 - .../Ideogram.Models.AdLocalizerRequest.g.cs | 209 - ...ram.Models.AdLocalizerRequestLanguage.g.cs | 141 - .../Ideogram.Models.AdLocalizerResponse.g.cs | 3 +- ...Ideogram.Models.AdResizerRequest.Json.g.cs | 141 - .../Ideogram.Models.AdResizerRequest.g.cs | 232 - ...ogram.Models.AdResizerRequestPlatform.g.cs | 95 - ...ram.Models.AdResizerRequestResolution.g.cs | 227 - .../Ideogram.Models.AdResizerResponse.g.cs | 3 +- ...ogram.Models.AdVariationsRequest.Json.g.cs | 141 - .../Ideogram.Models.AdVariationsRequest.g.cs | 181 - ...dels.AdVariationsRequestVariationType.g.cs | 67 - .../Ideogram.Models.AdVariationsResponse.g.cs | 3 +- ...ls.AddOrganizationMembersRequest.Json.g.cs | 141 - ....Models.AddOrganizationMembersRequest.g.cs | 49 - .../Ideogram.Models.ApiKeyStatus.g.cs | 57 - ...ls.ApiOrganizationUserSuggestion.Json.g.cs | 141 - ....Models.ApiOrganizationUserSuggestion.g.cs | 93 - .../Ideogram.Models.ApiProfile.Json.g.cs | 141 - .../Generated/Ideogram.Models.ApiProfile.g.cs | 163 - ...Ideogram.Models.ApiProfileApiKey.Json.g.cs | 141 - .../Ideogram.Models.ApiProfileApiKey.g.cs | 118 - .../Ideogram.Models.ApiProfileRole.g.cs | 58 - .../Ideogram.Models.ApiProfileType.g.cs | 64 - .../Ideogram.Models.ApiTerms.Json.g.cs | 141 - .../Generated/Ideogram.Models.ApiTerms.g.cs | 59 - .../Ideogram.Models.AspectRatio.g.cs | 106 - .../Ideogram.Models.AspectRatioEditLite.g.cs | 101 - .../Ideogram.Models.AspectRatioV4.g.cs | 151 - .../Ideogram.Models.AssetIdentifier.g.cs | 3 +- ...m.Models.AssetReferenceUsageItem.Json.g.cs | 141 - ...eogram.Models.AssetReferenceUsageItem.g.cs | 124 - ...dels.AssetReferenceUsageResponse.Json.g.cs | 141 - ...am.Models.AssetReferenceUsageResponse.g.cs | 54 - ...s.AsyncImageGenerationResponseV4.Json.g.cs | 141 - ...Models.AsyncImageGenerationResponseV4.g.cs | 55 - .../Ideogram.Models.AttributeInfo.Json.g.cs | 141 - .../Ideogram.Models.AttributeInfo.g.cs | 79 - .../Ideogram.Models.AttributeValueType.g.cs | 51 - ...elPostGenerateImageV2AutoRequest.Json.g.cs | 141 + ...toModelPostGenerateImageV2AutoRequest.g.cs | 167 + ...lPostGenerateImageV2AutoResponse.Json.g.cs | 141 + ...oModelPostGenerateImageV2AutoResponse.g.cs | 19 + ...PostGenerateImageV2AutoResponse2.Json.g.cs | 141 + ...ModelPostGenerateImageV2AutoResponse2.g.cs | 19 + ...PostGenerateImageV2AutoResponse3.Json.g.cs | 141 + ...ModelPostGenerateImageV2AutoResponse3.g.cs | 19 + ...PostGenerateImageV2AutoResponse4.Json.g.cs | 141 + ...ModelPostGenerateImageV2AutoResponse4.g.cs | 19 + ...PostGenerateImageV2AutoResponse5.Json.g.cs | 141 + ...ModelPostGenerateImageV2AutoResponse5.g.cs | 19 + ...PostGenerateImageV2AutoResponse6.Json.g.cs | 141 + ...ModelPostGenerateImageV2AutoResponse6.g.cs | 19 + ...ls.AutoModelPostToolRemixRequest.Json.g.cs | 141 + ....Models.AutoModelPostToolRemixRequest.g.cs | 266 + ...s.AutoModelPostToolRemixResponse.Json.g.cs | 141 + ...Models.AutoModelPostToolRemixResponse.g.cs | 19 + ....AutoModelPostToolRemixResponse2.Json.g.cs | 141 + ...odels.AutoModelPostToolRemixResponse2.g.cs | 19 + ....AutoModelPostToolRemixResponse3.Json.g.cs | 141 + ...odels.AutoModelPostToolRemixResponse3.g.cs | 19 + ....AutoModelPostToolRemixResponse4.Json.g.cs | 141 + ...odels.AutoModelPostToolRemixResponse4.g.cs | 19 + ....AutoModelPostToolRemixResponse5.Json.g.cs | 141 + ...odels.AutoModelPostToolRemixResponse5.g.cs | 19 + ....AutoModelPostToolRemixResponse6.Json.g.cs | 141 + ...odels.AutoModelPostToolRemixResponse6.g.cs | 19 + ....CancelOrganizationInviteRequest.Json.g.cs | 141 - ...odels.CancelOrganizationInviteRequest.g.cs | 47 - .../Ideogram.Models.ColorPaletteMember.g.cs | 14 +- ...deogram.Models.ColorPalettePresetName.g.cs | 88 - ...eogram.Models.ColorPaletteWithMembers.g.cs | 7 +- ...odels.ColorPaletteWithPresetName.Json.g.cs | 141 - ...ram.Models.ColorPaletteWithPresetName.g.cs | 51 - ...orPaletteWithPresetNameOrMembers.Json.g.cs | 141 - ...s.ColorPaletteWithPresetNameOrMembers.g.cs | 295 - ...Ideogram.Models.ColorwaysRequest.Json.g.cs | 141 - .../Ideogram.Models.ColorwaysRequest.g.cs | 221 - .../Ideogram.Models.ColorwaysResponse.g.cs | 3 +- ...ogram.Models.CreateApiKeyRequest.Json.g.cs | 141 - .../Ideogram.Models.CreateApiKeyRequest.g.cs | 46 - ...gram.Models.CreateApiKeyResponse.Json.g.cs | 141 - .../Ideogram.Models.CreateApiKeyResponse.g.cs | 80 - ...gram.Models.CreateDatasetRequest.Json.g.cs | 141 - .../Ideogram.Models.CreateDatasetRequest.g.cs | 47 - .../Ideogram.Models.CreditGrant.Json.g.cs | 141 - .../Ideogram.Models.CreditGrant.g.cs | 127 - .../Ideogram.Models.CustomModel.Json.g.cs | 141 - .../Ideogram.Models.CustomModel.g.cs | 162 - .../Ideogram.Models.Dataset.Json.g.cs | 141 - .../Generated/Ideogram.Models.Dataset.g.cs | 98 - ...gram.Models.DatasetAssetFailureReason.g.cs | 87 - ...dels.DatasetCoverAssetIdentifier.Json.g.cs | 141 - ...am.Models.DatasetCoverAssetIdentifier.g.cs | 204 - .../Ideogram.Models.DatasetFile.Json.g.cs | 141 - .../Ideogram.Models.DatasetFile.g.cs | 69 - ....Models.DatasetUploadFailedAsset.Json.g.cs | 141 - ...ogram.Models.DatasetUploadFailedAsset.g.cs | 59 - ...dels.DatasetUploadSucceededAsset.Json.g.cs | 141 - ...am.Models.DatasetUploadSucceededAsset.g.cs | 58 - ....DemoteOrganizationAdminsRequest.Json.g.cs | 141 - ...odels.DemoteOrganizationAdminsRequest.g.cs | 49 - ...s.DescribeImageIdeogramV3Request.Json.g.cs | 141 - ...Models.DescribeImageIdeogramV3Request.g.cs | 72 - ...odels.DescribeImageIdeogramV3Response.g.cs | 3 +- ...s.DescribeImageIdeogramV4Request.Json.g.cs | 141 - ...Models.DescribeImageIdeogramV4Request.g.cs | 111 - ...odels.DescribeImageIdeogramV4Response.g.cs | 10 +- .../Ideogram.Models.DescribeModelVersion.g.cs | 64 - .../Ideogram.Models.DescribeRequest.Json.g.cs | 141 - .../Ideogram.Models.DescribeRequest.g.cs | 73 - ...deogram.Models.DescribeRequestV4.Json.g.cs | 141 - .../Ideogram.Models.DescribeRequestV4.g.cs | 116 - ...Ideogram.Models.DescribeResponse.Json.g.cs | 141 - .../Ideogram.Models.DescribeResponse.g.cs | 47 - ...eogram.Models.DescribeResponseV4.Json.g.cs | 141 - .../Ideogram.Models.DescribeResponseV4.g.cs | 59 - .../Ideogram.Models.Description.Json.g.cs | 141 - .../Ideogram.Models.Description.g.cs | 49 - ...tLayerizeDesignIdeogramV3Request.Json.g.cs | 141 + ...gnPostLayerizeDesignIdeogramV3Request.g.cs | 130 + ...LayerizeDesignIdeogramV3Response.Json.g.cs | 141 + ...nPostLayerizeDesignIdeogramV3Response.g.cs | 19 + ...ayerizeDesignIdeogramV3Response2.Json.g.cs | 141 + ...PostLayerizeDesignIdeogramV3Response2.g.cs | 19 + ...ayerizeDesignIdeogramV3Response3.Json.g.cs | 141 + ...PostLayerizeDesignIdeogramV3Response3.g.cs | 19 + ...ayerizeDesignIdeogramV3Response4.Json.g.cs | 141 + ...PostLayerizeDesignIdeogramV3Response4.g.cs | 19 + ...ayerizeDesignIdeogramV3Response5.Json.g.cs | 141 + ...PostLayerizeDesignIdeogramV3Response5.g.cs | 19 + ...ayerizeDesignIdeogramV3Response6.Json.g.cs | 141 + ...PostLayerizeDesignIdeogramV3Response6.g.cs | 19 + .../Ideogram.Models.DetectedTextBlock.g.cs | 30 +- ...odels.DetectedTextBlockFormattingItem.g.cs | 87 - ...dels.DetectedTextBlockFormattingItems.g.cs | 87 + ...Ideogram.Models.EditImageRequest.Json.g.cs | 141 - .../Ideogram.Models.EditImageRequest.g.cs | 185 - ...eogram.Models.EditImageRequestV3.Json.g.cs | 141 - .../Ideogram.Models.EditImageRequestV3.g.cs | 272 - ...MinimaxH3ReferenceToVideoRequest.Json.g.cs | 141 - ...VideoMinimaxH3ReferenceToVideoRequest.g.cs | 216 - ...odels.EditVideoSeedDance2Request.Json.g.cs | 141 - ...ram.Models.EditVideoSeedDance2Request.g.cs | 210 - ...itWorkflowPostAdLocalizerRequest.Json.g.cs | 141 + ...ls.EditWorkflowPostAdLocalizerRequest.g.cs | 169 + ...tWorkflowPostAdLocalizerResponse.Json.g.cs | 141 + ...s.EditWorkflowPostAdLocalizerResponse.g.cs | 19 + ...WorkflowPostAdLocalizerResponse2.Json.g.cs | 141 + ....EditWorkflowPostAdLocalizerResponse2.g.cs | 19 + ...WorkflowPostAdLocalizerResponse3.Json.g.cs | 141 + ....EditWorkflowPostAdLocalizerResponse3.g.cs | 19 + ...WorkflowPostAdLocalizerResponse4.Json.g.cs | 141 + ....EditWorkflowPostAdLocalizerResponse4.g.cs | 19 + ...WorkflowPostAdLocalizerResponse5.Json.g.cs | 141 + ....EditWorkflowPostAdLocalizerResponse5.g.cs | 19 + ...EditWorkflowPostAdResizerRequest.Json.g.cs | 141 + ...dels.EditWorkflowPostAdResizerRequest.g.cs | 195 + ...ditWorkflowPostAdResizerResponse.Json.g.cs | 141 + ...els.EditWorkflowPostAdResizerResponse.g.cs | 19 + ...itWorkflowPostAdResizerResponse2.Json.g.cs | 141 + ...ls.EditWorkflowPostAdResizerResponse2.g.cs | 19 + ...itWorkflowPostAdResizerResponse3.Json.g.cs | 141 + ...ls.EditWorkflowPostAdResizerResponse3.g.cs | 19 + ...itWorkflowPostAdResizerResponse4.Json.g.cs | 141 + ...ls.EditWorkflowPostAdResizerResponse4.g.cs | 19 + ...itWorkflowPostAdResizerResponse5.Json.g.cs | 141 + ...ls.EditWorkflowPostAdResizerResponse5.g.cs | 19 + ...tWorkflowPostAdVariationsRequest.Json.g.cs | 141 + ...s.EditWorkflowPostAdVariationsRequest.g.cs | 155 + ...WorkflowPostAdVariationsResponse.Json.g.cs | 141 + ....EditWorkflowPostAdVariationsResponse.g.cs | 19 + ...orkflowPostAdVariationsResponse2.Json.g.cs | 141 + ...EditWorkflowPostAdVariationsResponse2.g.cs | 19 + ...orkflowPostAdVariationsResponse3.Json.g.cs | 141 + ...EditWorkflowPostAdVariationsResponse3.g.cs | 19 + ...orkflowPostAdVariationsResponse4.Json.g.cs | 141 + ...EditWorkflowPostAdVariationsResponse4.g.cs | 19 + ...orkflowPostAdVariationsResponse5.Json.g.cs | 141 + ...EditWorkflowPostAdVariationsResponse5.g.cs | 19 + ...EditWorkflowPostColorwaysRequest.Json.g.cs | 141 + ...dels.EditWorkflowPostColorwaysRequest.g.cs | 158 + ...ditWorkflowPostColorwaysResponse.Json.g.cs | 141 + ...els.EditWorkflowPostColorwaysResponse.g.cs | 19 + ...itWorkflowPostColorwaysResponse2.Json.g.cs | 141 + ...ls.EditWorkflowPostColorwaysResponse2.g.cs | 19 + ...itWorkflowPostColorwaysResponse3.Json.g.cs | 141 + ...ls.EditWorkflowPostColorwaysResponse3.g.cs | 19 + ...orkflowPostGhostMannequinRequest.Json.g.cs | 141 + ...EditWorkflowPostGhostMannequinRequest.g.cs | 367 + ...rkflowPostGhostMannequinResponse.Json.g.cs | 141 + ...ditWorkflowPostGhostMannequinResponse.g.cs | 19 + ...kflowPostGhostMannequinResponse2.Json.g.cs | 141 + ...itWorkflowPostGhostMannequinResponse2.g.cs | 19 + ...kflowPostGhostMannequinResponse3.Json.g.cs | 141 + ...itWorkflowPostGhostMannequinResponse3.g.cs | 19 + ...kflowPostGhostMannequinResponse4.Json.g.cs | 141 + ...itWorkflowPostGhostMannequinResponse4.g.cs | 19 + ...kflowPostGhostMannequinResponse5.Json.g.cs | 141 + ...itWorkflowPostGhostMannequinResponse5.g.cs | 19 + ...kflowPostGhostMannequinResponse6.Json.g.cs | 141 + ...itWorkflowPostGhostMannequinResponse6.g.cs | 19 + ...tWorkflowPostMaterialSwapRequest.Json.g.cs | 141 + ...s.EditWorkflowPostMaterialSwapRequest.g.cs | 159 + ...WorkflowPostMaterialSwapResponse.Json.g.cs | 141 + ....EditWorkflowPostMaterialSwapResponse.g.cs | 19 + ...orkflowPostMaterialSwapResponse2.Json.g.cs | 141 + ...EditWorkflowPostMaterialSwapResponse2.g.cs | 19 + ...orkflowPostMaterialSwapResponse3.Json.g.cs | 141 + ...EditWorkflowPostMaterialSwapResponse3.g.cs | 19 + ...flowPostModelPoseVariantsRequest.Json.g.cs | 141 + ...tWorkflowPostModelPoseVariantsRequest.g.cs | 159 + ...lowPostModelPoseVariantsResponse.Json.g.cs | 141 + ...WorkflowPostModelPoseVariantsResponse.g.cs | 19 + ...owPostModelPoseVariantsResponse2.Json.g.cs | 141 + ...orkflowPostModelPoseVariantsResponse2.g.cs | 19 + ...owPostModelPoseVariantsResponse3.Json.g.cs | 141 + ...orkflowPostModelPoseVariantsResponse3.g.cs | 19 + ...owPostModelPoseVariantsResponse4.Json.g.cs | 141 + ...orkflowPostModelPoseVariantsResponse4.g.cs | 19 + ...owPostModelPoseVariantsResponse5.Json.g.cs | 141 + ...orkflowPostModelPoseVariantsResponse5.g.cs | 19 + ...orkflowPostSketchToRenderRequest.Json.g.cs | 141 + ...EditWorkflowPostSketchToRenderRequest.g.cs | 155 + ...rkflowPostSketchToRenderResponse.Json.g.cs | 141 + ...ditWorkflowPostSketchToRenderResponse.g.cs | 19 + ...kflowPostSketchToRenderResponse2.Json.g.cs | 141 + ...itWorkflowPostSketchToRenderResponse2.g.cs | 19 + ...kflowPostSketchToRenderResponse3.Json.g.cs | 141 + ...itWorkflowPostSketchToRenderResponse3.g.cs | 19 + ...kflowPostSketchToRenderResponse4.Json.g.cs | 141 + ...itWorkflowPostSketchToRenderResponse4.g.cs | 19 + ...kflowPostSketchToRenderResponse5.Json.g.cs | 141 + ...itWorkflowPostSketchToRenderResponse5.g.cs | 19 + ...m.Models.GenerateDesignRequestV3.Json.g.cs | 141 - ...eogram.Models.GenerateDesignRequestV3.g.cs | 391 - ...m.Models.GenerateDesignRequestV4.Json.g.cs | 141 - ...eogram.Models.GenerateDesignRequestV4.g.cs | 188 - ...esignRequestV4ArtifactGenerationModel.g.cs | 58 - ...ignRequestV4InspirationReferenceModel.g.cs | 58 - ...ateDesignRequestV4Layout2imageVariant.g.cs | 58 - ...s.GenerateDesignRequestV4ResponseType.g.cs | 67 - ....Models.GenerateGraphicRequestV3.Json.g.cs | 141 - ...ogram.Models.GenerateGraphicRequestV3.g.cs | 412 - ...erateImageGptImage25FlareRequest.Json.g.cs | 141 - ...s.GenerateImageGptImage25FlareRequest.g.cs | 254 - ...ImageGptImage25FlareRequestBackground.g.cs | 58 - ...ateImageGptImage25FlareRequestQuality.g.cs | 64 - ....GenerateImageGptImage25FlareResponse.g.cs | 10 +- ...teImageGptImage25SunburstRequest.Json.g.cs | 141 - ...enerateImageGptImage25SunburstRequest.g.cs | 254 - ...geGptImage25SunburstRequestBackground.g.cs | 58 - ...ImageGptImage25SunburstRequestQuality.g.cs | 64 - ...nerateImageGptImage25SunburstResponse.g.cs | 10 +- ...ls.GenerateImageGptImage2Request.Json.g.cs | 141 - ....Models.GenerateImageGptImage2Request.g.cs | 193 - ...Models.GenerateImageGptImage2Response.g.cs | 10 +- ...s.GenerateImageIdeogram45Request.Json.g.cs | 141 - ...Models.GenerateImageIdeogram45Request.g.cs | 304 - ...erateImageIdeogram45RequestBackground.g.cs | 58 - ...GenerateImageIdeogram45RequestQuality.g.cs | 63 - ...odels.GenerateImageIdeogram45Response.g.cs | 10 +- ...odels.GenerateImageIdeogramV2ARequest.g.cs | 47 +- ...dels.GenerateImageIdeogramV2AResponse.g.cs | 10 +- ...Models.GenerateImageIdeogramV2Request.g.cs | 47 +- ...odels.GenerateImageIdeogramV2Response.g.cs | 10 +- ...eImageIdeogramV3CharacterRequest.Json.g.cs | 141 - ...nerateImageIdeogramV3CharacterRequest.g.cs | 358 - ...ogramV3CharacterRequestRenderingSpeed.g.cs | 58 - ...geIdeogramV3CharacterRequestStyleType.g.cs | 58 - ...erateImageIdeogramV3CharacterResponse.g.cs | 10 +- ...mageIdeogramV3CustomModelRequest.Json.g.cs | 141 - ...rateImageIdeogramV3CustomModelRequest.g.cs | 306 - ...ramV3CustomModelRequestRenderingSpeed.g.cs | 57 - ...ateImageIdeogramV3CustomModelResponse.g.cs | 10 +- ...s.GenerateImageIdeogramV3Request.Json.g.cs | 141 - ...Models.GenerateImageIdeogramV3Request.g.cs | 319 - ...eImageIdeogramV3RequestRenderingSpeed.g.cs | 58 - ...odels.GenerateImageIdeogramV3Response.g.cs | 10 +- ...rateImageIdeogramV3TransparentRequest.g.cs | 40 +- ...ateImageIdeogramV3TransparentResponse.g.cs | 10 +- ...rateImageIdeogramV4CustomModelRequest.g.cs | 61 +- ...ateImageIdeogramV4CustomModelResponse.g.cs | 10 +- ...Models.GenerateImageIdeogramV4Request.g.cs | 40 +- ...odels.GenerateImageIdeogramV4Response.g.cs | 10 +- ...rateImageIdeogramV4TransparentRequest.g.cs | 40 +- ...ateImageIdeogramV4TransparentResponse.g.cs | 10 +- ...GenerateImageNanoBanana21Request.Json.g.cs | 141 - ...dels.GenerateImageNanoBanana21Request.g.cs | 189 - ...mageNanoBanana21RequestResolutionTier.g.cs | 58 - ...els.GenerateImageNanoBanana21Response.g.cs | 10 +- ....GenerateImageNanoBanana2Request.Json.g.cs | 141 - ...odels.GenerateImageNanoBanana2Request.g.cs | 189 - ...ImageNanoBanana2RequestResolutionTier.g.cs | 58 - ...dels.GenerateImageNanoBanana2Response.g.cs | 10 +- ...enerateImageNanoBananaProRequest.Json.g.cs | 141 - ...els.GenerateImageNanoBananaProRequest.g.cs | 189 - ...ageNanoBananaProRequestResolutionTier.g.cs | 58 - ...ls.GenerateImageNanoBananaProResponse.g.cs | 10 +- ...ls.GenerateImagePImageIdeogramRequest.g.cs | 41 +- ...s.GenerateImagePImageIdeogramResponse.g.cs | 10 +- ...gram.Models.GenerateImageRequest.Json.g.cs | 141 - .../Ideogram.Models.GenerateImageRequest.g.cs | 48 - ...Models.GenerateImageRequestErnie.Json.g.cs | 141 - ...gram.Models.GenerateImageRequestErnie.g.cs | 163 - ...s.GenerateImageRequestFlux2Klein.Json.g.cs | 141 - ...Models.GenerateImageRequestFlux2Klein.g.cs | 163 - ...nerateImageRequestFlux2KleinBase.Json.g.cs | 141 - ...ls.GenerateImageRequestFlux2KleinBase.g.cs | 163 - ...odels.GenerateImageRequestPImage.Json.g.cs | 141 - ...ram.Models.GenerateImageRequestPImage.g.cs | 134 - ...nerateImageRequestPImageIdeogram.Json.g.cs | 141 - ...ls.GenerateImageRequestPImageIdeogram.g.cs | 180 - ...am.Models.GenerateImageRequestV3.Json.g.cs | 141 - ...deogram.Models.GenerateImageRequestV3.g.cs | 286 - ...am.Models.GenerateImageRequestV4.Json.g.cs | 141 - ...deogram.Models.GenerateImageRequestV4.g.cs | 159 - ...nerateImageRequestV4CfgDistilled.Json.g.cs | 141 - ...ls.GenerateImageRequestV4CfgDistilled.g.cs | 142 - ...Models.GenerateImageRequestV4Fp8.Json.g.cs | 141 - ...gram.Models.GenerateImageRequestV4Fp8.g.cs | 142 - ...dels.GenerateImageRequestV4Im2Im.Json.g.cs | 141 - ...am.Models.GenerateImageRequestV4Im2Im.g.cs | 169 - ...els.GenerateImageRequestV4Stable.Json.g.cs | 141 - ...m.Models.GenerateImageRequestV4Stable.g.cs | 113 - ...s.GenerateImageRequestV4StableVersion.g.cs | 47 - ...odels.GenerateImageRequestZImage.Json.g.cs | 141 - ...ram.Models.GenerateImageRequestZImage.g.cs | 163 - ...ram.Models.GenerateImageResponse.Json.g.cs | 141 - ...Ideogram.Models.GenerateImageResponse.g.cs | 77 - ....Models.GenerateImageSafetyError.Json.g.cs | 141 - ...ogram.Models.GenerateImageSafetyError.g.cs | 48 - ...odels.GenerateImageV2AutoRequest.Json.g.cs | 141 - ...ram.Models.GenerateImageV2AutoRequest.g.cs | 216 - ...erateImageV2AutoRequestResolutionTier.g.cs | 57 - ...am.Models.GenerateImageV2AutoResponse.g.cs | 10 +- ...ram.Models.GenerateImageZImageRequest.g.cs | 61 +- ...am.Models.GenerateImageZImageResponse.g.cs | 10 +- ...enerateTransparentImageRequestV3.Json.g.cs | 141 - ...els.GenerateTransparentImageRequestV3.g.cs | 199 - ...enerateTransparentImageRequestV4.Json.g.cs | 141 - ...els.GenerateTransparentImageRequestV4.g.cs | 173 - ...m.Models.GenerateVideoKlingV3Response.g.cs | 3 +- ...ingV3StandardImageToVideoRequest.Json.g.cs | 141 - ...deoKlingV3StandardImageToVideoRequest.g.cs | 243 - ...ideoKlingV3StandardTextToVideoRequest.g.cs | 59 +- ...ideoMinimaxH3ImageToVideoRequest.Json.g.cs | 141 - ...rateVideoMinimaxH3ImageToVideoRequest.g.cs | 205 - ...Models.GenerateVideoMinimaxH3Response.g.cs | 3 +- ...erateVideoMinimaxH3TextToVideoRequest.g.cs | 48 +- ...eoSeedDance25ImageToVideoRequest.Json.g.cs | 141 - ...teVideoSeedDance25ImageToVideoRequest.g.cs | 214 - ...edDance25ReferenceToVideoRequest.Json.g.cs | 141 - ...deoSeedDance25ReferenceToVideoRequest.g.cs | 208 - ...dels.GenerateVideoSeedDance25Response.g.cs | 3 +- ...ateVideoSeedDance25TextToVideoRequest.g.cs | 48 +- ...deoSeedDance2ImageToVideoRequest.Json.g.cs | 141 - ...ateVideoSeedDance2ImageToVideoRequest.g.cs | 229 - ...eedDance2ReferenceToVideoRequest.Json.g.cs | 141 - ...ideoSeedDance2ReferenceToVideoRequest.g.cs | 208 - ...odels.GenerateVideoSeedDance2Response.g.cs | 3 +- ...rateVideoSeedDance2TextToVideoRequest.g.cs | 48 +- .../Ideogram.Models.GeneratedDescription.g.cs | 2 +- .../Ideogram.Models.GeneratedImageObject.g.cs | 17 +- ...eogram.Models.GenerationErrorResponse.g.cs | 10 +- .../Ideogram.Models.GenerationResponse.g.cs | 17 +- ...am.Models.GenerationResponseDataInner.g.cs | 176 +- ...riminatorMappingSvgGenerationMimeType.g.cs | 45 + ...erationResponseDataInnerVariant1.Json.g.cs | 141 + ...s.GenerationResponseDataInnerVariant1.g.cs | 82 + ...onResponseDataInnerVariant1ObjectType.g.cs | 45 + ...erationResponseDataInnerVariant2.Json.g.cs | 141 + ...s.GenerationResponseDataInnerVariant2.g.cs | 105 + ...onResponseDataInnerVariant2ObjectType.g.cs | 45 + ...erationResponseDataInnerVariant3.Json.g.cs | 141 + ...s.GenerationResponseDataInnerVariant3.g.cs | 106 + ...onResponseDataInnerVariant3ObjectType.g.cs | 45 + ...erationResponseDataInnerVariant4.Json.g.cs | 141 + ...s.GenerationResponseDataInnerVariant4.g.cs | 117 + ...onResponseDataInnerVariant4ObjectType.g.cs | 45 + ...erationResponseDataInnerVariant5.Json.g.cs | 141 + ...s.GenerationResponseDataInnerVariant5.g.cs | 118 + ...onResponseDataInnerVariant5ObjectType.g.cs | 45 + ...erationResponseDataInnerVariant6.Json.g.cs | 141 + ...s.GenerationResponseDataInnerVariant6.g.cs | 165 + ...onResponseDataInnerVariant6ObjectType.g.cs | 45 + ...nerationsGetGenerationV2Response.Json.g.cs | 141 + ...ls.GenerationsGetGenerationV2Response.g.cs | 19 + ...erationsGetGenerationV2Response2.Json.g.cs | 141 + ...s.GenerationsGetGenerationV2Response2.g.cs | 19 + ...erationsGetGenerationV2Response3.Json.g.cs | 141 + ...s.GenerationsGetGenerationV2Response3.g.cs | 19 + ...erationsGetGenerationV2Response4.Json.g.cs | 141 + ...s.GenerationsGetGenerationV2Response4.g.cs | 19 + ...ram.Models.GetAccountUsageBucketWidth.g.cs | 51 - ...eogram.Models.GetAccountUsageResponse.g.cs | 2 +- ...Ideogram.Models.GetAccountUsageSource.g.cs | 51 - ...eogram.Models.GetApiKeysResponse.Json.g.cs | 141 - .../Ideogram.Models.GetApiKeysResponse.g.cs | 48 - ...gram.Models.GetApiKeysV2Response.Json.g.cs | 141 - .../Ideogram.Models.GetApiKeysV2Response.g.cs | 49 - ...anizationUserSuggestionsResponse.Json.g.cs | 141 - ...piOrganizationUserSuggestionsResponse.g.cs | 49 - ...am.Models.GetApiProfilesResponse.Json.g.cs | 141 - ...deogram.Models.GetApiProfilesResponse.g.cs | 49 - ...ogram.Models.GetApiTermsResponse.Json.g.cs | 141 - .../Ideogram.Models.GetApiTermsResponse.g.cs | 60 - ...eogram.Models.GetDatasetResponse.Json.g.cs | 141 - .../Ideogram.Models.GetDatasetResponse.g.cs | 91 - ...m.Models.GetIntegrationsResponse.Json.g.cs | 141 - ...eogram.Models.GetIntegrationsResponse.g.cs | 47 - ...Ideogram.Models.GetModelResponse.Json.g.cs | 141 - .../Ideogram.Models.GetModelResponse.g.cs | 50 - ...rganizationBillingPortalResponse.Json.g.cs | 141 - ....GetOrganizationBillingPortalResponse.g.cs | 58 - ...s.GetOrganizationMembersResponse.Json.g.cs | 141 - ...Models.GetOrganizationMembersResponse.g.cs | 49 - ....GetStaleMiniAppPreviewsResponse.Json.g.cs | 141 - ...odels.GetStaleMiniAppPreviewsResponse.g.cs | 48 - ...gram.Models.GetUsageInfoResponse.Json.g.cs | 141 - .../Ideogram.Models.GetUsageInfoResponse.g.cs | 47 - ...am.Models.GetUserCreditsResponse.Json.g.cs | 141 - ...deogram.Models.GetUserCreditsResponse.g.cs | 79 - ...ram.Models.GhostMannequinRequest.Json.g.cs | 141 - ...Ideogram.Models.GhostMannequinRequest.g.cs | 499 - ...gram.Models.GhostMannequinRequestView.g.cs | 57 - ...deogram.Models.GhostMannequinResponse.g.cs | 3 +- ...Models.IdeogramColorPalettePresetName.g.cs | 3 +- ...ls.IdeogramColorPaletteWithPresetName.g.cs | 7 +- .../Ideogram.Models.IdeogramV2StyleType.g.cs | 3 +- ...Ideogram.Models.IdeogramV3StylePreset.g.cs | 3 +- .../Ideogram.Models.IdeogramV3StyleType.g.cs | 3 +- ...stDescribeImageIdeogramV3Request.Json.g.cs | 141 + ...ibePostDescribeImageIdeogramV3Request.g.cs | 59 + ...tDescribeImageIdeogramV3Response.Json.g.cs | 141 + ...bePostDescribeImageIdeogramV3Response.g.cs | 19 + ...DescribeImageIdeogramV3Response2.Json.g.cs | 141 + ...ePostDescribeImageIdeogramV3Response2.g.cs | 19 + ...DescribeImageIdeogramV3Response3.Json.g.cs | 141 + ...ePostDescribeImageIdeogramV3Response3.g.cs | 19 + ...DescribeImageIdeogramV3Response4.Json.g.cs | 141 + ...ePostDescribeImageIdeogramV3Response4.g.cs | 19 + ...DescribeImageIdeogramV3Response5.Json.g.cs | 141 + ...ePostDescribeImageIdeogramV3Response5.g.cs | 19 + ...stDescribeImageIdeogramV4Request.Json.g.cs | 141 + ...ibePostDescribeImageIdeogramV4Request.g.cs | 98 + ...tDescribeImageIdeogramV4Response.Json.g.cs | 141 + ...bePostDescribeImageIdeogramV4Response.g.cs | 19 + ...DescribeImageIdeogramV4Response2.Json.g.cs | 141 + ...ePostDescribeImageIdeogramV4Response2.g.cs | 19 + ...DescribeImageIdeogramV4Response3.Json.g.cs | 141 + ...ePostDescribeImageIdeogramV4Response3.g.cs | 19 + ...DescribeImageIdeogramV4Response4.Json.g.cs | 141 + ...ePostDescribeImageIdeogramV4Response4.g.cs | 19 + ...DescribeImageIdeogramV4Response5.Json.g.cs | 141 + ...ePostDescribeImageIdeogramV4Response5.g.cs | 19 + ...ram.Models.ImageGenerationObject.Json.g.cs | 141 - ...Ideogram.Models.ImageGenerationObject.g.cs | 127 - ...odels.ImageGenerationObjectObjectType.g.cs | 45 - ...m.Models.ImageGenerationObjectV3.Json.g.cs | 141 - ...eogram.Models.ImageGenerationObjectV3.g.cs | 138 - ...m.Models.ImageGenerationObjectV4.Json.g.cs | 141 - ...eogram.Models.ImageGenerationObjectV4.g.cs | 109 - ...geGenerationObjectV4ImageToImage.Json.g.cs | 141 - ...s.ImageGenerationObjectV4ImageToImage.g.cs | 104 - ...ls.ImageGenerationObjectV4Layout.Json.g.cs | 141 - ....Models.ImageGenerationObjectV4Layout.g.cs | 104 - ...m.Models.ImageGenerationResponse.Json.g.cs | 141 - ...eogram.Models.ImageGenerationResponse.g.cs | 60 - ...Models.ImageGenerationResponseV3.Json.g.cs | 141 - ...gram.Models.ImageGenerationResponseV3.g.cs | 61 - ...Models.ImageGenerationResponseV4.Json.g.cs | 141 - ...gram.Models.ImageGenerationResponseV4.g.cs | 73 - ...GenerationResponseV4ImageToImage.Json.g.cs | 141 - ...ImageGenerationResponseV4ImageToImage.g.cs | 73 - ...ionResponseV4ImageToImageResponseType.g.cs | 45 - ....ImageGenerationResponseV4Layout.Json.g.cs | 141 - ...odels.ImageGenerationResponseV4Layout.g.cs | 72 - ...enerationResponseV4LayoutResponseType.g.cs | 45 - ...ImageGenerationResponseV4ResponseType.g.cs | 45 - .../Ideogram.Models.ImageLayerV3.Json.g.cs | 141 - .../Ideogram.Models.ImageLayerV3.g.cs | 98 - .../Ideogram.Models.ImageObject.Json.g.cs | 141 - .../Ideogram.Models.ImageObject.g.cs | 135 - ...s.ImageObjectWithoutPromptOrSeed.Json.g.cs | 141 - ...Models.ImageObjectWithoutPromptOrSeed.g.cs | 96 - ...geObjectWithoutPromptOrSeedObjectType.g.cs | 45 - .../Ideogram.Models.ImageRequest.Json.g.cs | 141 - .../Ideogram.Models.ImageRequest.g.cs | 201 - .../Ideogram.Models.ImageSafetyError.g.cs | 9 +- ...ateImageV2GptImage25FlareRequest.Json.g.cs | 141 + ...GenerateImageV2GptImage25FlareRequest.g.cs | 202 + ...teImageV2GptImage25FlareResponse.Json.g.cs | 141 + ...enerateImageV2GptImage25FlareResponse.g.cs | 19 + ...eImageV2GptImage25FlareResponse2.Json.g.cs | 141 + ...nerateImageV2GptImage25FlareResponse2.g.cs | 19 + ...eImageV2GptImage25FlareResponse3.Json.g.cs | 141 + ...nerateImageV2GptImage25FlareResponse3.g.cs | 19 + ...eImageV2GptImage25FlareResponse4.Json.g.cs | 141 + ...nerateImageV2GptImage25FlareResponse4.g.cs | 19 + ...eImageV2GptImage25FlareResponse5.Json.g.cs | 141 + ...nerateImageV2GptImage25FlareResponse5.g.cs | 19 + ...ImageV2GptImage25SunburstRequest.Json.g.cs | 141 + ...erateImageV2GptImage25SunburstRequest.g.cs | 202 + ...mageV2GptImage25SunburstResponse.Json.g.cs | 141 + ...rateImageV2GptImage25SunburstResponse.g.cs | 19 + ...ageV2GptImage25SunburstResponse2.Json.g.cs | 141 + ...ateImageV2GptImage25SunburstResponse2.g.cs | 19 + ...ageV2GptImage25SunburstResponse3.Json.g.cs | 141 + ...ateImageV2GptImage25SunburstResponse3.g.cs | 19 + ...ageV2GptImage25SunburstResponse4.Json.g.cs | 141 + ...ateImageV2GptImage25SunburstResponse4.g.cs | 19 + ...ageV2GptImage25SunburstResponse5.Json.g.cs | 141 + ...ateImageV2GptImage25SunburstResponse5.g.cs | 19 + ...tGenerateImageV2GptImage2Request.Json.g.cs | 141 + ...tePostGenerateImageV2GptImage2Request.g.cs | 152 + ...GenerateImageV2GptImage2Response.Json.g.cs | 141 + ...ePostGenerateImageV2GptImage2Response.g.cs | 19 + ...enerateImageV2GptImage2Response2.Json.g.cs | 141 + ...PostGenerateImageV2GptImage2Response2.g.cs | 19 + ...enerateImageV2GptImage2Response3.Json.g.cs | 141 + ...PostGenerateImageV2GptImage2Response3.g.cs | 19 + ...enerateImageV2GptImage2Response4.Json.g.cs | 141 + ...PostGenerateImageV2GptImage2Response4.g.cs | 19 + ...enerateImageV2GptImage2Response5.Json.g.cs | 141 + ...PostGenerateImageV2GptImage2Response5.g.cs | 19 + ...GenerateImageV2Ideogram45Request.Json.g.cs | 141 + ...ePostGenerateImageV2Ideogram45Request.g.cs | 250 + ...enerateImageV2Ideogram45Response.Json.g.cs | 141 + ...PostGenerateImageV2Ideogram45Response.g.cs | 19 + ...nerateImageV2Ideogram45Response2.Json.g.cs | 141 + ...ostGenerateImageV2Ideogram45Response2.g.cs | 19 + ...nerateImageV2Ideogram45Response3.Json.g.cs | 141 + ...ostGenerateImageV2Ideogram45Response3.g.cs | 19 + ...nerateImageV2Ideogram45Response4.Json.g.cs | 141 + ...ostGenerateImageV2Ideogram45Response4.g.cs | 19 + ...nerateImageV2Ideogram45Response5.Json.g.cs | 141 + ...ostGenerateImageV2Ideogram45Response5.g.cs | 19 + ...nerateImageV2IdeogramV2AResponse.Json.g.cs | 141 + ...ostGenerateImageV2IdeogramV2AResponse.g.cs | 19 + ...erateImageV2IdeogramV2AResponse2.Json.g.cs | 141 + ...stGenerateImageV2IdeogramV2AResponse2.g.cs | 19 + ...erateImageV2IdeogramV2AResponse3.Json.g.cs | 141 + ...stGenerateImageV2IdeogramV2AResponse3.g.cs | 19 + ...erateImageV2IdeogramV2AResponse4.Json.g.cs | 141 + ...stGenerateImageV2IdeogramV2AResponse4.g.cs | 19 + ...erateImageV2IdeogramV2AResponse5.Json.g.cs | 141 + ...stGenerateImageV2IdeogramV2AResponse5.g.cs | 19 + ...enerateImageV2IdeogramV2Response.Json.g.cs | 141 + ...PostGenerateImageV2IdeogramV2Response.g.cs | 19 + ...nerateImageV2IdeogramV2Response2.Json.g.cs | 141 + ...ostGenerateImageV2IdeogramV2Response2.g.cs | 19 + ...nerateImageV2IdeogramV2Response3.Json.g.cs | 141 + ...ostGenerateImageV2IdeogramV2Response3.g.cs | 19 + ...nerateImageV2IdeogramV2Response4.Json.g.cs | 141 + ...ostGenerateImageV2IdeogramV2Response4.g.cs | 19 + ...nerateImageV2IdeogramV2Response5.Json.g.cs | 141 + ...ostGenerateImageV2IdeogramV2Response5.g.cs | 19 + ...mageV2IdeogramV3CharacterRequest.Json.g.cs | 141 + ...rateImageV2IdeogramV3CharacterRequest.g.cs | 248 + ...ageV2IdeogramV3CharacterResponse.Json.g.cs | 141 + ...ateImageV2IdeogramV3CharacterResponse.g.cs | 19 + ...geV2IdeogramV3CharacterResponse2.Json.g.cs | 141 + ...teImageV2IdeogramV3CharacterResponse2.g.cs | 19 + ...geV2IdeogramV3CharacterResponse3.Json.g.cs | 141 + ...teImageV2IdeogramV3CharacterResponse3.g.cs | 19 + ...geV2IdeogramV3CharacterResponse4.Json.g.cs | 141 + ...teImageV2IdeogramV3CharacterResponse4.g.cs | 19 + ...geV2IdeogramV3CharacterResponse5.Json.g.cs | 141 + ...teImageV2IdeogramV3CharacterResponse5.g.cs | 19 + ...geV2IdeogramV3CharacterResponse6.Json.g.cs | 141 + ...teImageV2IdeogramV3CharacterResponse6.g.cs | 19 + ...geV2IdeogramV3CustomModelRequest.Json.g.cs | 141 + ...teImageV2IdeogramV3CustomModelRequest.g.cs | 258 + ...eV2IdeogramV3CustomModelResponse.Json.g.cs | 141 + ...eImageV2IdeogramV3CustomModelResponse.g.cs | 19 + ...V2IdeogramV3CustomModelResponse2.Json.g.cs | 141 + ...ImageV2IdeogramV3CustomModelResponse2.g.cs | 19 + ...V2IdeogramV3CustomModelResponse3.Json.g.cs | 141 + ...ImageV2IdeogramV3CustomModelResponse3.g.cs | 19 + ...V2IdeogramV3CustomModelResponse4.Json.g.cs | 141 + ...ImageV2IdeogramV3CustomModelResponse4.g.cs | 19 + ...V2IdeogramV3CustomModelResponse5.Json.g.cs | 141 + ...ImageV2IdeogramV3CustomModelResponse5.g.cs | 19 + ...V2IdeogramV3CustomModelResponse6.Json.g.cs | 141 + ...ImageV2IdeogramV3CustomModelResponse6.g.cs | 19 + ...V2IdeogramV3CustomModelResponse7.Json.g.cs | 141 + ...ImageV2IdeogramV3CustomModelResponse7.g.cs | 19 + ...GenerateImageV2IdeogramV3Request.Json.g.cs | 141 + ...ePostGenerateImageV2IdeogramV3Request.g.cs | 249 + ...enerateImageV2IdeogramV3Response.Json.g.cs | 141 + ...PostGenerateImageV2IdeogramV3Response.g.cs | 19 + ...nerateImageV2IdeogramV3Response2.Json.g.cs | 141 + ...ostGenerateImageV2IdeogramV3Response2.g.cs | 19 + ...nerateImageV2IdeogramV3Response3.Json.g.cs | 141 + ...ostGenerateImageV2IdeogramV3Response3.g.cs | 19 + ...nerateImageV2IdeogramV3Response4.Json.g.cs | 141 + ...ostGenerateImageV2IdeogramV3Response4.g.cs | 19 + ...nerateImageV2IdeogramV3Response5.Json.g.cs | 141 + ...ostGenerateImageV2IdeogramV3Response5.g.cs | 19 + ...nerateImageV2IdeogramV3Response6.Json.g.cs | 141 + ...ostGenerateImageV2IdeogramV3Response6.g.cs | 19 + ...eV2IdeogramV3TransparentResponse.Json.g.cs | 141 + ...eImageV2IdeogramV3TransparentResponse.g.cs | 19 + ...V2IdeogramV3TransparentResponse2.Json.g.cs | 141 + ...ImageV2IdeogramV3TransparentResponse2.g.cs | 19 + ...V2IdeogramV3TransparentResponse3.Json.g.cs | 141 + ...ImageV2IdeogramV3TransparentResponse3.g.cs | 19 + ...V2IdeogramV3TransparentResponse4.Json.g.cs | 141 + ...ImageV2IdeogramV3TransparentResponse4.g.cs | 19 + ...V2IdeogramV3TransparentResponse5.Json.g.cs | 141 + ...ImageV2IdeogramV3TransparentResponse5.g.cs | 19 + ...eV2IdeogramV4CustomModelResponse.Json.g.cs | 141 + ...eImageV2IdeogramV4CustomModelResponse.g.cs | 19 + ...V2IdeogramV4CustomModelResponse2.Json.g.cs | 141 + ...ImageV2IdeogramV4CustomModelResponse2.g.cs | 19 + ...V2IdeogramV4CustomModelResponse3.Json.g.cs | 141 + ...ImageV2IdeogramV4CustomModelResponse3.g.cs | 19 + ...V2IdeogramV4CustomModelResponse4.Json.g.cs | 141 + ...ImageV2IdeogramV4CustomModelResponse4.g.cs | 19 + ...V2IdeogramV4CustomModelResponse5.Json.g.cs | 141 + ...ImageV2IdeogramV4CustomModelResponse5.g.cs | 19 + ...V2IdeogramV4CustomModelResponse6.Json.g.cs | 141 + ...ImageV2IdeogramV4CustomModelResponse6.g.cs | 19 + ...enerateImageV2IdeogramV4Response.Json.g.cs | 141 + ...PostGenerateImageV2IdeogramV4Response.g.cs | 19 + ...nerateImageV2IdeogramV4Response2.Json.g.cs | 141 + ...ostGenerateImageV2IdeogramV4Response2.g.cs | 19 + ...nerateImageV2IdeogramV4Response3.Json.g.cs | 141 + ...ostGenerateImageV2IdeogramV4Response3.g.cs | 19 + ...nerateImageV2IdeogramV4Response4.Json.g.cs | 141 + ...ostGenerateImageV2IdeogramV4Response4.g.cs | 19 + ...nerateImageV2IdeogramV4Response5.Json.g.cs | 141 + ...ostGenerateImageV2IdeogramV4Response5.g.cs | 19 + ...eV2IdeogramV4TransparentResponse.Json.g.cs | 141 + ...eImageV2IdeogramV4TransparentResponse.g.cs | 19 + ...V2IdeogramV4TransparentResponse2.Json.g.cs | 141 + ...ImageV2IdeogramV4TransparentResponse2.g.cs | 19 + ...V2IdeogramV4TransparentResponse3.Json.g.cs | 141 + ...ImageV2IdeogramV4TransparentResponse3.g.cs | 19 + ...V2IdeogramV4TransparentResponse4.Json.g.cs | 141 + ...ImageV2IdeogramV4TransparentResponse4.g.cs | 19 + ...V2IdeogramV4TransparentResponse5.Json.g.cs | 141 + ...ImageV2IdeogramV4TransparentResponse5.g.cs | 19 + ...nerateImageV2NanoBanana21Request.Json.g.cs | 141 + ...ostGenerateImageV2NanoBanana21Request.g.cs | 148 + ...erateImageV2NanoBanana21Response.Json.g.cs | 141 + ...stGenerateImageV2NanoBanana21Response.g.cs | 19 + ...rateImageV2NanoBanana21Response2.Json.g.cs | 141 + ...tGenerateImageV2NanoBanana21Response2.g.cs | 19 + ...rateImageV2NanoBanana21Response3.Json.g.cs | 141 + ...tGenerateImageV2NanoBanana21Response3.g.cs | 19 + ...rateImageV2NanoBanana21Response4.Json.g.cs | 141 + ...tGenerateImageV2NanoBanana21Response4.g.cs | 19 + ...rateImageV2NanoBanana21Response5.Json.g.cs | 141 + ...tGenerateImageV2NanoBanana21Response5.g.cs | 19 + ...enerateImageV2NanoBanana2Request.Json.g.cs | 141 + ...PostGenerateImageV2NanoBanana2Request.g.cs | 148 + ...nerateImageV2NanoBanana2Response.Json.g.cs | 141 + ...ostGenerateImageV2NanoBanana2Response.g.cs | 19 + ...erateImageV2NanoBanana2Response2.Json.g.cs | 141 + ...stGenerateImageV2NanoBanana2Response2.g.cs | 19 + ...erateImageV2NanoBanana2Response3.Json.g.cs | 141 + ...stGenerateImageV2NanoBanana2Response3.g.cs | 19 + ...erateImageV2NanoBanana2Response4.Json.g.cs | 141 + ...stGenerateImageV2NanoBanana2Response4.g.cs | 19 + ...erateImageV2NanoBanana2Response5.Json.g.cs | 141 + ...stGenerateImageV2NanoBanana2Response5.g.cs | 19 + ...erateImageV2NanoBananaProRequest.Json.g.cs | 141 + ...stGenerateImageV2NanoBananaProRequest.g.cs | 148 + ...rateImageV2NanoBananaProResponse.Json.g.cs | 141 + ...tGenerateImageV2NanoBananaProResponse.g.cs | 19 + ...ateImageV2NanoBananaProResponse2.Json.g.cs | 141 + ...GenerateImageV2NanoBananaProResponse2.g.cs | 19 + ...ateImageV2NanoBananaProResponse3.Json.g.cs | 141 + ...GenerateImageV2NanoBananaProResponse3.g.cs | 19 + ...ateImageV2NanoBananaProResponse4.Json.g.cs | 141 + ...GenerateImageV2NanoBananaProResponse4.g.cs | 19 + ...ateImageV2NanoBananaProResponse5.Json.g.cs | 141 + ...GenerateImageV2NanoBananaProResponse5.g.cs | 19 + ...ateImageV2PImageIdeogramResponse.Json.g.cs | 141 + ...GenerateImageV2PImageIdeogramResponse.g.cs | 19 + ...teImageV2PImageIdeogramResponse2.Json.g.cs | 141 + ...enerateImageV2PImageIdeogramResponse2.g.cs | 19 + ...teImageV2PImageIdeogramResponse3.Json.g.cs | 141 + ...enerateImageV2PImageIdeogramResponse3.g.cs | 19 + ...teImageV2PImageIdeogramResponse4.Json.g.cs | 141 + ...enerateImageV2PImageIdeogramResponse4.g.cs | 19 + ...teImageV2PImageIdeogramResponse5.Json.g.cs | 141 + ...enerateImageV2PImageIdeogramResponse5.g.cs | 19 + ...ostGenerateImageV2ZImageResponse.Json.g.cs | 141 + ...ratePostGenerateImageV2ZImageResponse.g.cs | 19 + ...stGenerateImageV2ZImageResponse2.Json.g.cs | 141 + ...atePostGenerateImageV2ZImageResponse2.g.cs | 19 + ...stGenerateImageV2ZImageResponse3.Json.g.cs | 141 + ...atePostGenerateImageV2ZImageResponse3.g.cs | 19 + ...stGenerateImageV2ZImageResponse4.Json.g.cs | 141 + ...atePostGenerateImageV2ZImageResponse4.g.cs | 19 + ...stGenerateImageV2ZImageResponse5.Json.g.cs | 141 + ...atePostGenerateImageV2ZImageResponse5.g.cs | 19 + ...mageV2IdeogramV3CharacterRequest.Json.g.cs | 141 + ...aintImageV2IdeogramV3CharacterRequest.g.cs | 266 + ...ageV2IdeogramV3CharacterResponse.Json.g.cs | 141 + ...intImageV2IdeogramV3CharacterResponse.g.cs | 19 + ...geV2IdeogramV3CharacterResponse2.Json.g.cs | 141 + ...ntImageV2IdeogramV3CharacterResponse2.g.cs | 19 + ...geV2IdeogramV3CharacterResponse3.Json.g.cs | 141 + ...ntImageV2IdeogramV3CharacterResponse3.g.cs | 19 + ...geV2IdeogramV3CharacterResponse4.Json.g.cs | 141 + ...ntImageV2IdeogramV3CharacterResponse4.g.cs | 19 + ...geV2IdeogramV3CharacterResponse5.Json.g.cs | 141 + ...ntImageV2IdeogramV3CharacterResponse5.g.cs | 19 + ...geV2IdeogramV3CharacterResponse6.Json.g.cs | 141 + ...ntImageV2IdeogramV3CharacterResponse6.g.cs | 19 + ...geV2IdeogramV3CustomModelRequest.Json.g.cs | 141 + ...ntImageV2IdeogramV3CustomModelRequest.g.cs | 215 + ...eV2IdeogramV3CustomModelResponse.Json.g.cs | 141 + ...tImageV2IdeogramV3CustomModelResponse.g.cs | 19 + ...V2IdeogramV3CustomModelResponse2.Json.g.cs | 141 + ...ImageV2IdeogramV3CustomModelResponse2.g.cs | 19 + ...V2IdeogramV3CustomModelResponse3.Json.g.cs | 141 + ...ImageV2IdeogramV3CustomModelResponse3.g.cs | 19 + ...V2IdeogramV3CustomModelResponse4.Json.g.cs | 141 + ...ImageV2IdeogramV3CustomModelResponse4.g.cs | 19 + ...V2IdeogramV3CustomModelResponse5.Json.g.cs | 141 + ...ImageV2IdeogramV3CustomModelResponse5.g.cs | 19 + ...V2IdeogramV3CustomModelResponse6.Json.g.cs | 141 + ...ImageV2IdeogramV3CustomModelResponse6.g.cs | 19 + ...V2IdeogramV3CustomModelResponse7.Json.g.cs | 141 + ...ImageV2IdeogramV3CustomModelResponse7.g.cs | 19 + ...tInpaintImageV2IdeogramV3Request.Json.g.cs | 141 + ...ntPostInpaintImageV2IdeogramV3Request.g.cs | 244 + ...InpaintImageV2IdeogramV3Response.Json.g.cs | 141 + ...tPostInpaintImageV2IdeogramV3Response.g.cs | 19 + ...npaintImageV2IdeogramV3Response2.Json.g.cs | 141 + ...PostInpaintImageV2IdeogramV3Response2.g.cs | 19 + ...npaintImageV2IdeogramV3Response3.Json.g.cs | 141 + ...PostInpaintImageV2IdeogramV3Response3.g.cs | 19 + ...npaintImageV2IdeogramV3Response4.Json.g.cs | 141 + ...PostInpaintImageV2IdeogramV3Response4.g.cs | 19 + ...npaintImageV2IdeogramV3Response5.Json.g.cs | 141 + ...PostInpaintImageV2IdeogramV3Response5.g.cs | 19 + ...npaintImageV2IdeogramV3Response6.Json.g.cs | 141 + ...PostInpaintImageV2IdeogramV3Response6.g.cs | 19 + ...ciseEditImageV2Ideogram45Request.Json.g.cs | 141 + ...stPreciseEditImageV2Ideogram45Request.g.cs | 216 + ...iseEditImageV2Ideogram45Response.Json.g.cs | 141 + ...tPreciseEditImageV2Ideogram45Response.g.cs | 19 + ...seEditImageV2Ideogram45Response2.Json.g.cs | 141 + ...PreciseEditImageV2Ideogram45Response2.g.cs | 19 + ...seEditImageV2Ideogram45Response3.Json.g.cs | 141 + ...PreciseEditImageV2Ideogram45Response3.g.cs | 19 + ...seEditImageV2Ideogram45Response4.Json.g.cs | 141 + ...PreciseEditImageV2Ideogram45Response4.g.cs | 19 + ...seEditImageV2Ideogram45Response5.Json.g.cs | 141 + ...PreciseEditImageV2Ideogram45Response5.g.cs | 19 + ...mageV2IdeogramV3CharacterRequest.Json.g.cs | 141 + ...emixImageV2IdeogramV3CharacterRequest.g.cs | 277 + ...ageV2IdeogramV3CharacterResponse.Json.g.cs | 141 + ...mixImageV2IdeogramV3CharacterResponse.g.cs | 19 + ...geV2IdeogramV3CharacterResponse2.Json.g.cs | 141 + ...ixImageV2IdeogramV3CharacterResponse2.g.cs | 19 + ...geV2IdeogramV3CharacterResponse3.Json.g.cs | 141 + ...ixImageV2IdeogramV3CharacterResponse3.g.cs | 19 + ...geV2IdeogramV3CharacterResponse4.Json.g.cs | 141 + ...ixImageV2IdeogramV3CharacterResponse4.g.cs | 19 + ...geV2IdeogramV3CharacterResponse5.Json.g.cs | 141 + ...ixImageV2IdeogramV3CharacterResponse5.g.cs | 19 + ...geV2IdeogramV3CharacterResponse6.Json.g.cs | 141 + ...ixImageV2IdeogramV3CharacterResponse6.g.cs | 19 + ...geV2IdeogramV3CustomModelRequest.Json.g.cs | 141 + ...ixImageV2IdeogramV3CustomModelRequest.g.cs | 274 + ...eV2IdeogramV3CustomModelResponse.Json.g.cs | 141 + ...xImageV2IdeogramV3CustomModelResponse.g.cs | 19 + ...V2IdeogramV3CustomModelResponse2.Json.g.cs | 141 + ...ImageV2IdeogramV3CustomModelResponse2.g.cs | 19 + ...V2IdeogramV3CustomModelResponse3.Json.g.cs | 141 + ...ImageV2IdeogramV3CustomModelResponse3.g.cs | 19 + ...V2IdeogramV3CustomModelResponse4.Json.g.cs | 141 + ...ImageV2IdeogramV3CustomModelResponse4.g.cs | 19 + ...V2IdeogramV3CustomModelResponse5.Json.g.cs | 141 + ...ImageV2IdeogramV3CustomModelResponse5.g.cs | 19 + ...V2IdeogramV3CustomModelResponse6.Json.g.cs | 141 + ...ImageV2IdeogramV3CustomModelResponse6.g.cs | 19 + ...V2IdeogramV3CustomModelResponse7.Json.g.cs | 141 + ...ImageV2IdeogramV3CustomModelResponse7.g.cs | 19 + ...ostRemixImageV2IdeogramV3Request.Json.g.cs | 141 + ...emixPostRemixImageV2IdeogramV3Request.g.cs | 278 + ...stRemixImageV2IdeogramV3Response.Json.g.cs | 141 + ...mixPostRemixImageV2IdeogramV3Response.g.cs | 19 + ...tRemixImageV2IdeogramV3Response2.Json.g.cs | 141 + ...ixPostRemixImageV2IdeogramV3Response2.g.cs | 19 + ...tRemixImageV2IdeogramV3Response3.Json.g.cs | 141 + ...ixPostRemixImageV2IdeogramV3Response3.g.cs | 19 + ...tRemixImageV2IdeogramV3Response4.Json.g.cs | 141 + ...ixPostRemixImageV2IdeogramV3Response4.g.cs | 19 + ...tRemixImageV2IdeogramV3Response5.Json.g.cs | 141 + ...ixPostRemixImageV2IdeogramV3Response5.g.cs | 19 + ...tRemixImageV2IdeogramV3Response6.Json.g.cs | 141 + ...ixPostRemixImageV2IdeogramV3Response6.g.cs | 19 + ...ostRemixImageV2IdeogramV4Request.Json.g.cs | 141 + ...emixPostRemixImageV2IdeogramV4Request.g.cs | 176 + ...stRemixImageV2IdeogramV4Response.Json.g.cs | 141 + ...mixPostRemixImageV2IdeogramV4Response.g.cs | 19 + ...tRemixImageV2IdeogramV4Response2.Json.g.cs | 141 + ...ixPostRemixImageV2IdeogramV4Response2.g.cs | 19 + ...tRemixImageV2IdeogramV4Response3.Json.g.cs | 141 + ...ixPostRemixImageV2IdeogramV4Response3.g.cs | 19 + ...tRemixImageV2IdeogramV4Response4.Json.g.cs | 141 + ...ixPostRemixImageV2IdeogramV4Response4.g.cs | 19 + ...tRemixImageV2IdeogramV4Response5.Json.g.cs | 141 + ...ixPostRemixImageV2IdeogramV4Response5.g.cs | 19 + ...tRemixImageV2IdeogramV4Response6.Json.g.cs | 141 + ...ixPostRemixImageV2IdeogramV4Response6.g.cs | 19 + ...UpscaleImageNanoBananaProRequest.Json.g.cs | 141 + ...ePostUpscaleImageNanoBananaProRequest.g.cs | 133 + ...pscaleImageNanoBananaProResponse.Json.g.cs | 141 + ...PostUpscaleImageNanoBananaProResponse.g.cs | 19 + ...scaleImageNanoBananaProResponse2.Json.g.cs | 141 + ...ostUpscaleImageNanoBananaProResponse2.g.cs | 19 + ...scaleImageNanoBananaProResponse3.Json.g.cs | 141 + ...ostUpscaleImageNanoBananaProResponse3.g.cs | 19 + ...scaleImageNanoBananaProResponse4.Json.g.cs | 141 + ...ostUpscaleImageNanoBananaProResponse4.g.cs | 19 + ...scaleImageNanoBananaProResponse5.Json.g.cs | 141 + ...ostUpscaleImageNanoBananaProResponse5.g.cs | 19 + ...scaleImageNanoBananaProResponse6.Json.g.cs | 141 + ...ostUpscaleImageNanoBananaProResponse6.g.cs | 19 + ...stUpscaleImageTopazBloom2Request.Json.g.cs | 141 + ...alePostUpscaleImageTopazBloom2Request.g.cs | 159 + ...tUpscaleImageTopazBloom2Response.Json.g.cs | 141 + ...lePostUpscaleImageTopazBloom2Response.g.cs | 19 + ...UpscaleImageTopazBloom2Response2.Json.g.cs | 141 + ...ePostUpscaleImageTopazBloom2Response2.g.cs | 19 + ...UpscaleImageTopazBloom2Response3.Json.g.cs | 141 + ...ePostUpscaleImageTopazBloom2Response3.g.cs | 19 + ...UpscaleImageTopazBloom2Response4.Json.g.cs | 141 + ...ePostUpscaleImageTopazBloom2Response4.g.cs | 19 + ...UpscaleImageTopazBloom2Response5.Json.g.cs | 141 + ...ePostUpscaleImageTopazBloom2Response5.g.cs | 19 + ...UpscaleImageTopazBloom2Response6.Json.g.cs | 141 + ...ePostUpscaleImageTopazBloom2Response6.g.cs | 19 + ...UpscaleImageTopazRedefineRequest.Json.g.cs | 141 + ...ePostUpscaleImageTopazRedefineRequest.g.cs | 263 + ...pscaleImageTopazRedefineResponse.Json.g.cs | 141 + ...PostUpscaleImageTopazRedefineResponse.g.cs | 19 + ...scaleImageTopazRedefineResponse2.Json.g.cs | 141 + ...ostUpscaleImageTopazRedefineResponse2.g.cs | 19 + ...scaleImageTopazRedefineResponse3.Json.g.cs | 141 + ...ostUpscaleImageTopazRedefineResponse3.g.cs | 19 + ...scaleImageTopazRedefineResponse4.Json.g.cs | 141 + ...ostUpscaleImageTopazRedefineResponse4.g.cs | 19 + ...scaleImageTopazRedefineResponse5.Json.g.cs | 141 + ...ostUpscaleImageTopazRedefineResponse5.g.cs | 19 + ...scaleImageTopazRedefineResponse6.Json.g.cs | 141 + ...ostUpscaleImageTopazRedefineResponse6.g.cs | 19 + ...scaleImageTopazStandardV2Request.Json.g.cs | 141 + ...ostUpscaleImageTopazStandardV2Request.g.cs | 200 + ...caleImageTopazStandardV2Response.Json.g.cs | 141 + ...stUpscaleImageTopazStandardV2Response.g.cs | 19 + ...aleImageTopazStandardV2Response2.Json.g.cs | 141 + ...tUpscaleImageTopazStandardV2Response2.g.cs | 19 + ...aleImageTopazStandardV2Response3.Json.g.cs | 141 + ...tUpscaleImageTopazStandardV2Response3.g.cs | 19 + ...aleImageTopazStandardV2Response4.Json.g.cs | 141 + ...tUpscaleImageTopazStandardV2Response4.g.cs | 19 + ...aleImageTopazStandardV2Response5.Json.g.cs | 141 + ...tUpscaleImageTopazStandardV2Response5.g.cs | 19 + ...scaleImageTopazTextRefineRequest.Json.g.cs | 141 + ...ostUpscaleImageTopazTextRefineRequest.g.cs | 211 + ...caleImageTopazTextRefineResponse.Json.g.cs | 141 + ...stUpscaleImageTopazTextRefineResponse.g.cs | 19 + ...aleImageTopazTextRefineResponse2.Json.g.cs | 141 + ...tUpscaleImageTopazTextRefineResponse2.g.cs | 19 + ...aleImageTopazTextRefineResponse3.Json.g.cs | 141 + ...tUpscaleImageTopazTextRefineResponse3.g.cs | 19 + ...aleImageTopazTextRefineResponse4.Json.g.cs | 141 + ...tUpscaleImageTopazTextRefineResponse4.g.cs | 19 + ...aleImageTopazTextRefineResponse5.Json.g.cs | 141 + ...tUpscaleImageTopazTextRefineResponse5.g.cs | 19 + ...UpscaleImageTopazWonder35Request.Json.g.cs | 141 + ...ePostUpscaleImageTopazWonder35Request.g.cs | 136 + ...pscaleImageTopazWonder35Response.Json.g.cs | 141 + ...PostUpscaleImageTopazWonder35Response.g.cs | 19 + ...scaleImageTopazWonder35Response2.Json.g.cs | 141 + ...ostUpscaleImageTopazWonder35Response2.g.cs | 19 + ...scaleImageTopazWonder35Response3.Json.g.cs | 141 + ...ostUpscaleImageTopazWonder35Response3.g.cs | 19 + ...scaleImageTopazWonder35Response4.Json.g.cs | 141 + ...ostUpscaleImageTopazWonder35Response4.g.cs | 19 + ...scaleImageTopazWonder35Response5.Json.g.cs | 141 + ...ostUpscaleImageTopazWonder35Response5.g.cs | 19 + ...ogram.Models.InitialImageRequest.Json.g.cs | 141 - .../Ideogram.Models.InitialImageRequest.g.cs | 50 - ...tImageIdeogramV3CharacterRequest.Json.g.cs | 141 - ...npaintImageIdeogramV3CharacterRequest.g.cs | 399 - ...ogramV3CharacterRequestRenderingSpeed.g.cs | 58 - ...geIdeogramV3CharacterRequestStyleType.g.cs | 58 - ...paintImageIdeogramV3CharacterResponse.g.cs | 10 +- ...mageIdeogramV3CustomModelRequest.Json.g.cs | 141 - ...aintImageIdeogramV3CustomModelRequest.g.cs | 298 - ...ramV3CustomModelRequestRenderingSpeed.g.cs | 57 - ...intImageIdeogramV3CustomModelResponse.g.cs | 10 +- ...ls.InpaintImageIdeogramV3Request.Json.g.cs | 141 - ....Models.InpaintImageIdeogramV3Request.g.cs | 336 - ...tImageIdeogramV3RequestRenderingSpeed.g.cs | 58 - ...Models.InpaintImageIdeogramV3Response.g.cs | 10 +- .../Ideogram.Models.InpaintedImageObject.g.cs | 17 +- ...Ideogram.Models.IntegrationAsset.Json.g.cs | 141 - .../Ideogram.Models.IntegrationAsset.g.cs | 116 - ....Models.IntegrationAssetDelivery.Json.g.cs | 141 - ...ogram.Models.IntegrationAssetDelivery.g.cs | 59 - ....Models.IntegrationAssetMetadata.Json.g.cs | 141 - ...ogram.Models.IntegrationAssetMetadata.g.cs | 19 - ...ls.IntegrationAssetSearchRequest.Json.g.cs | 141 - ....Models.IntegrationAssetSearchRequest.g.cs | 58 - ...s.IntegrationAssetSearchResponse.Json.g.cs | 141 - ...Models.IntegrationAssetSearchResponse.g.cs | 45 - ....Models.IntegrationErrorResponse.Json.g.cs | 141 - ...ogram.Models.IntegrationErrorResponse.g.cs | 82 - ....Models.IntegrationErrorResponseError.g.cs | 81 - .../Ideogram.Models.IntegrationType.g.cs | 45 - ...gram.Models.InternalBatchRequest.Json.g.cs | 141 - .../Ideogram.Models.InternalBatchRequest.g.cs | 77 - ...ram.Models.InternalBatchResponse.Json.g.cs | 141 - ...Ideogram.Models.InternalBatchResponse.g.cs | 48 - ...els.InternalBatchResultsResponse.Json.g.cs | 141 - ...m.Models.InternalBatchResultsResponse.g.cs | 62 - ...BatchResultsResponseResultsInner.Json.g.cs | 141 - ...ernalBatchResultsResponseResultsInner.g.cs | 62 - ...ogram.Models.InternalTestingEnumField.g.cs | 57 - ...dels.InternalTestingNestedObject.Json.g.cs | 141 - ...am.Models.InternalTestingNestedObject.g.cs | 53 - ...estingNestedObjectRequiredFields.Json.g.cs | 141 - ...rnalTestingNestedObjectRequiredFields.g.cs | 55 - ...am.Models.InternalTestingRequest.Json.g.cs | 141 - ...deogram.Models.InternalTestingRequest.g.cs | 171 - .../Ideogram.Models.Invoice.Json.g.cs | 141 - .../Generated/Ideogram.Models.Invoice.g.cs | 152 - .../Ideogram.Models.InvoiceLineItem.Json.g.cs | 141 - .../Ideogram.Models.InvoiceLineItem.g.cs | 106 - .../Ideogram.Models.InvoiceStatus.g.cs | 64 - ...Ideogram.Models.JsonSerializerContext.g.cs | 210 - ...am.Models.LayeredAssetTextShadow.Json.g.cs | 141 - ...deogram.Models.LayeredAssetTextShadow.g.cs | 95 - ...s.LayeredImageGenerationObjectV3.Json.g.cs | 141 - ...Models.LayeredImageGenerationObjectV3.g.cs | 77 - ...LayeredImageGenerationResponseV3.Json.g.cs | 141 - ...dels.LayeredImageGenerationResponseV3.g.cs | 73 - ...ImageGenerationResponseV3ResponseType.g.cs | 45 - ....LayerizeDesignIdeogramV3Request.Json.g.cs | 141 - ...odels.LayerizeDesignIdeogramV3Request.g.cs | 171 - ...dels.LayerizeDesignIdeogramV3Response.g.cs | 10 +- ...m.Models.LayerizeDesignRequestV3.Json.g.cs | 141 - ...eogram.Models.LayerizeDesignRequestV3.g.cs | 230 - ...gram.Models.LayerizeLogosRequest.Json.g.cs | 141 - .../Ideogram.Models.LayerizeLogosRequest.g.cs | 77 - ...ram.Models.LayerizeLogosResponse.Json.g.cs | 141 - ...Ideogram.Models.LayerizeLogosResponse.g.cs | 65 - ...ogram.Models.LayerizeTextRequest.Json.g.cs | 141 - .../Ideogram.Models.LayerizeTextRequest.g.cs | 95 - ...gram.Models.LayerizeTextResponse.Json.g.cs | 141 - .../Ideogram.Models.LayerizeTextResponse.g.cs | 87 - .../Ideogram.Models.LayerizedImageObject.g.cs | 29 +- ...Models.LayerizedImageObjectObjectType.g.cs | 45 - ...eogram.Models.LayerizedTextBlock.Json.g.cs | 6 +- .../Ideogram.Models.LayerizedTextBlock.g.cs | 382 +- ...am.Models.LayerizedTextBlockAlignment.g.cs | 57 + ...els.LayerizedTextBlockFormattingItems.g.cs | 87 + ...deogram.Models.LayerizedTextBlockRole.g.cs | 63 + ...odels.LayerizedTextBlockVariant2.Json.g.cs | 141 - ...ram.Models.LayerizedTextBlockVariant2.g.cs | 65 - ...ram.Models.ListAccountApiKeysResponse.g.cs | 2 +- ...am.Models.ListAccountInvoicesResponse.g.cs | 2 +- ...Ideogram.Models.ListCustomModelsScope.g.cs | 51 - ...gram.Models.ListDatasetsResponse.Json.g.cs | 141 - .../Ideogram.Models.ListDatasetsResponse.g.cs | 49 - ...eogram.Models.ListModelsResponse.Json.g.cs | 141 - .../Ideogram.Models.ListModelsResponse.g.cs | 49 - ...ListOrganizationInvoicesResponse.Json.g.cs | 141 - ...dels.ListOrganizationInvoicesResponse.g.cs | 61 - ...am.Models.LiteOrganizationMember.Json.g.cs | 141 - ...deogram.Models.LiteOrganizationMember.g.cs | 78 - .../Ideogram.Models.LivingImageQuality.g.cs | 52 - ...eogram.Models.LivingImageRequest.Json.g.cs | 141 - .../Ideogram.Models.LivingImageRequest.g.cs | 91 - ...ogram.Models.LivingImageResponse.Json.g.cs | 141 - .../Ideogram.Models.LivingImageResponse.g.cs | 62 - .../Ideogram.Models.LookbookRequest.Json.g.cs | 141 - .../Ideogram.Models.LookbookRequest.g.cs | 123 - ...eogram.Models.LookbookRequestCategory.g.cs | 63 - ...Ideogram.Models.LookbookResponse.Json.g.cs | 141 - .../Ideogram.Models.LookbookResponse.g.cs | 49 - .../Ideogram.Models.MagicPromptMode.g.cs | 3 +- .../Ideogram.Models.MagicPromptOption.g.cs | 58 - ...eogram.Models.MagicPromptRequest.Json.g.cs | 141 - .../Ideogram.Models.MagicPromptRequest.g.cs | 299 - ....MagicPromptRequestMessagesInner.Json.g.cs | 141 - ...odels.MagicPromptRequestMessagesInner.g.cs | 56 - ...s.MagicPromptRequestMessagesInnerRole.g.cs | 57 - ...ogram.Models.MagicPromptResponse.Json.g.cs | 141 - .../Ideogram.Models.MagicPromptResponse.g.cs | 77 - ...gram.Models.MagicPromptV4Request.Json.g.cs | 141 - .../Ideogram.Models.MagicPromptV4Request.g.cs | 69 - ...ram.Models.MagicPromptV4Response.Json.g.cs | 141 - ...Ideogram.Models.MagicPromptV4Response.g.cs | 69 - ...deogram.Models.MagicPromptVersionEnum.g.cs | 232 - ...s.ManageApiCreditSummaryResponse.Json.g.cs | 141 - ...Models.ManageApiCreditSummaryResponse.g.cs | 92 - ....Models.ManageApiPaymentResponse.Json.g.cs | 141 - ...ogram.Models.ManageApiPaymentResponse.g.cs | 47 - ...ageApiStripeSubscriptionResponse.Json.g.cs | 141 - ...s.ManageApiStripeSubscriptionResponse.g.cs | 66 - ...ls.ManageApiSubscriptionResponse.Json.g.cs | 141 - ....Models.ManageApiSubscriptionResponse.g.cs | 125 - ...ogram.Models.MaterialSwapRequest.Json.g.cs | 141 - .../Ideogram.Models.MaterialSwapRequest.g.cs | 241 - .../Ideogram.Models.MaterialSwapResponse.g.cs | 3 +- .../Ideogram.Models.MetronomeLinks.Json.g.cs | 141 - .../Ideogram.Models.MetronomeLinks.g.cs | 101 - .../Ideogram.Models.MiniAppArtwork.Json.g.cs | 141 - .../Ideogram.Models.MiniAppArtwork.g.cs | 68 - ....MiniAppMarketingProjectionEntry.Json.g.cs | 141 - ...odels.MiniAppMarketingProjectionEntry.g.cs | 185 - ....MiniAppMarketingProjectionEntryEmbed.g.cs | 51 - ...pMarketingProjectionEntryWebsite.Json.g.cs | 141 - ...iniAppMarketingProjectionEntryWebsite.g.cs | 19 - .../Generated/Ideogram.Models.ModelEnum.g.cs | 89 - ....Models.ModelPoseVariantsRequest.Json.g.cs | 141 - ...ogram.Models.ModelPoseVariantsRequest.g.cs | 199 - ...gram.Models.ModelPoseVariantsResponse.g.cs | 3 +- .../Ideogram.Models.ModelStatus.g.cs | 75 - .../Ideogram.Models.ModelSwapQuality.g.cs | 58 - ...Ideogram.Models.ModelSwapRequest.Json.g.cs | 141 - .../Ideogram.Models.ModelSwapRequest.g.cs | 182 - ...deogram.Models.ModelSwapResponse.Json.g.cs | 141 - .../Ideogram.Models.ModelSwapResponse.g.cs | 49 - .../Ideogram.Models.ModelVersion.g.cs | 146 - ...odels.NanoBananaProReframeAspectRatio.g.cs | 99 - ...tRemoveObjectFromV2AssetsRequest.Json.g.cs | 141 + ...alPostRemoveObjectFromV2AssetsRequest.g.cs | 94 + ...RemoveObjectFromV2AssetsResponse.Json.g.cs | 141 + ...lPostRemoveObjectFromV2AssetsResponse.g.cs | 19 + ...emoveObjectFromV2AssetsResponse2.Json.g.cs | 141 + ...PostRemoveObjectFromV2AssetsResponse2.g.cs | 19 + ...emoveObjectFromV2AssetsResponse3.Json.g.cs | 141 + ...PostRemoveObjectFromV2AssetsResponse3.g.cs | 19 + ...emoveObjectFromV2AssetsResponse4.Json.g.cs | 141 + ...PostRemoveObjectFromV2AssetsResponse4.g.cs | 19 + ...emoveObjectFromV2AssetsResponse5.Json.g.cs | 141 + ...PostRemoveObjectFromV2AssetsResponse5.g.cs | 19 + ...emoveObjectFromV2AssetsResponse6.Json.g.cs | 141 + ...PostRemoveObjectFromV2AssetsResponse6.g.cs | 19 + ...eogram.Models.OrganizationMember.Json.g.cs | 141 - .../Ideogram.Models.OrganizationMember.g.cs | 155 - ...anizationMemberOperationResponse.Json.g.cs | 141 - ...s.OrganizationMemberOperationResponse.g.cs | 47 - ...rganizationMemberOperationResult.Json.g.cs | 141 - ...els.OrganizationMemberOperationResult.g.cs | 58 - .../Ideogram.Models.OutputResolution.g.cs | 68 - .../Ideogram.Models.PImageResolution.g.cs | 51 - .../Ideogram.Models.PackshotView.g.cs | 63 - .../Ideogram.Models.PackshotsQuality.g.cs | 58 - ...Ideogram.Models.PackshotsRequest.Json.g.cs | 141 - .../Ideogram.Models.PackshotsRequest.g.cs | 159 - ...deogram.Models.PackshotsResponse.Json.g.cs | 141 - .../Ideogram.Models.PackshotsResponse.g.cs | 49 - ...eogram.Models.PatchApiKeyRequest.Json.g.cs | 141 - .../Ideogram.Models.PatchApiKeyRequest.g.cs | 49 - ...ogram.Models.PostAddCreditsError.Json.g.cs | 141 - .../Ideogram.Models.PostAddCreditsError.g.cs | 47 - ...ram.Models.PostAddCreditsRequest.Json.g.cs | 141 - ...Ideogram.Models.PostAddCreditsRequest.g.cs | 50 - ...am.Models.PostAddCreditsResponse.Json.g.cs | 141 - ...deogram.Models.PostAddCreditsResponse.g.cs | 50 - ...eogram.Models.PostApiKeyResponse.Json.g.cs | 141 - .../Ideogram.Models.PostApiKeyResponse.g.cs | 65 - ....Models.PostApiSubscriptionError.Json.g.cs | 141 - ...ogram.Models.PostApiSubscriptionError.g.cs | 47 - ...odels.PostApiSubscriptionRequest.Json.g.cs | 141 - ...ram.Models.PostApiSubscriptionRequest.g.cs | 61 - ...dels.PostApiSubscriptionResponse.Json.g.cs | 141 - ...am.Models.PostApiSubscriptionResponse.g.cs | 48 - ...ogram.Models.PostApiTermsRequest.Json.g.cs | 141 - .../Ideogram.Models.PostApiTermsRequest.g.cs | 50 - ....PostGenerateDesignV4200Response.Json.g.cs | 141 - ...odels.PostGenerateDesignV4200Response.g.cs | 306 - ...DesignV4200ResponseDiscriminator.Json.g.cs | 141 - ...erateDesignV4200ResponseDiscriminator.g.cs | 45 - ...4200ResponseDiscriminatorResponseType.g.cs | 51 - ...s.PostInternalTesting200Response.Json.g.cs | 141 - ...Models.PostInternalTesting200Response.g.cs | 44 - ...reciseEditImageIdeogram45Request.Json.g.cs | 141 - ...els.PreciseEditImageIdeogram45Request.g.cs | 277 - ...ciseEditImageIdeogram45RequestQuality.g.cs | 64 - ...ls.PreciseEditImageIdeogram45Response.g.cs | 3 +- ...deogram.Models.PreciseMaskedEditModel.g.cs | 52 - ...ogram.Models.PreciseMaskedEditQuality.g.cs | 58 - ....Models.PreciseMaskedEditRequest.Json.g.cs | 141 - ...ogram.Models.PreciseMaskedEditRequest.g.cs | 225 - ...Models.PreciseMaskedEditResponse.Json.g.cs | 141 - ...gram.Models.PreciseMaskedEditResponse.g.cs | 48 - .../Generated/Ideogram.Models.Price.Json.g.cs | 141 - .../Generated/Ideogram.Models.Price.g.cs | 66 - .../Ideogram.Models.PriceQualifier.g.cs | 53 - .../Ideogram.Models.PriceQuote.Json.g.cs | 141 - .../Generated/Ideogram.Models.PriceQuote.g.cs | 146 - .../Ideogram.Models.PriceQuoteObject.g.cs | 45 - ...ogram.Models.Product360VideoDirection.g.cs | 51 - ...am.Models.Product360VideoRequest.Json.g.cs | 141 - ...deogram.Models.Product360VideoRequest.g.cs | 115 - ...PromoteOrganizationAdminsRequest.Json.g.cs | 141 - ...dels.PromoteOrganizationAdminsRequest.g.cs | 49 - ...m.Models.ProvenanceVerifyRequest.Json.g.cs | 141 - ...eogram.Models.ProvenanceVerifyRequest.g.cs | 59 - ....Models.ProvenanceVerifyResponse.Json.g.cs | 141 - ...ogram.Models.ProvenanceVerifyResponse.g.cs | 107 - ...ovenanceVerifyResponseValidationState.g.cs | 59 - ...els.PublishMiniAppPreviewRequest.Json.g.cs | 141 - ...m.Models.PublishMiniAppPreviewRequest.g.cs | 162 - ...els.PublishMiniAppPreviewRequestEmbed.g.cs | 45 - ...lishMiniAppPreviewRequestWebsite.Json.g.cs | 141 - ...s.PublishMiniAppPreviewRequestWebsite.g.cs | 19 - ...ls.PublishMiniAppPreviewResponse.Json.g.cs | 141 - ....Models.PublishMiniAppPreviewResponse.g.cs | 48 - ...ram.Models.PublishMiniAppRequest.Json.g.cs | 141 - ...Ideogram.Models.PublishMiniAppRequest.g.cs | 150 - ...ram.Models.PublishMiniAppRequestEmbed.g.cs | 45 - ...els.PublishMiniAppRequestWebsite.Json.g.cs | 141 - ...m.Models.PublishMiniAppRequestWebsite.g.cs | 19 - ...am.Models.PublishMiniAppResponse.Json.g.cs | 141 - ...deogram.Models.PublishMiniAppResponse.g.cs | 84 - .../Generated/Ideogram.Models.Quality.g.cs | 71 - ...Ideogram.Models.RechargeSettings.Json.g.cs | 141 - .../Ideogram.Models.RechargeSettings.g.cs | 66 - ....Models.RechargeSettingsResponse.Json.g.cs | 141 - ...ogram.Models.RechargeSettingsResponse.g.cs | 47 - .../Ideogram.Models.RedactedApiKey.Json.g.cs | 141 - .../Ideogram.Models.RedactedApiKey.g.cs | 78 - ....Models.ReframeIdeogramV3Request.Json.g.cs | 141 + ...ogram.Models.ReframeIdeogramV3Request.g.cs | 167 + ...Models.ReframeIdeogramV3Response.Json.g.cs | 141 + ...gram.Models.ReframeIdeogramV3Response.g.cs | 19 + ...odels.ReframeIdeogramV3Response2.Json.g.cs | 141 + ...ram.Models.ReframeIdeogramV3Response2.g.cs | 19 + ...odels.ReframeIdeogramV3Response3.Json.g.cs | 141 + ...ram.Models.ReframeIdeogramV3Response3.g.cs | 19 + ...odels.ReframeIdeogramV3Response4.Json.g.cs | 141 + ...ram.Models.ReframeIdeogramV3Response4.g.cs | 19 + ...odels.ReframeIdeogramV3Response5.Json.g.cs | 141 + ...ram.Models.ReframeIdeogramV3Response5.g.cs | 19 + ...m.Models.ReframeImageAutoRequest.Json.g.cs | 141 - ...eogram.Models.ReframeImageAutoRequest.g.cs | 132 - ....Models.ReframeImageAutoResponse.Json.g.cs | 141 - ...ogram.Models.ReframeImageAutoResponse.g.cs | 91 - ...ls.ReframeImageBriaExpandRequest.Json.g.cs | 141 - ....Models.ReframeImageBriaExpandRequest.g.cs | 119 - ...s.ReframeImageBriaExpandResponse.Json.g.cs | 141 - ...Models.ReframeImageBriaExpandResponse.g.cs | 91 - ...frameImageGptImage25FlareRequest.Json.g.cs | 141 - ...ls.ReframeImageGptImage25FlareRequest.g.cs | 146 - ...ameImageGptImage25FlareRequestQuality.g.cs | 64 - ...rameImageGptImage25FlareResponse.Json.g.cs | 141 - ...s.ReframeImageGptImage25FlareResponse.g.cs | 91 - ...ls.ReframeImageIdeogramV3Request.Json.g.cs | 141 - ....Models.ReframeImageIdeogramV3Request.g.cs | 204 - ...eImageIdeogramV3RequestRenderingSpeed.g.cs | 57 - ...Models.ReframeImageIdeogramV3Response.g.cs | 10 +- ...s.ReframeImageNanoBanana2Request.Json.g.cs | 141 - ...Models.ReframeImageNanoBanana2Request.g.cs | 129 - ...odels.ReframeImageNanoBanana2Response.g.cs | 10 +- ...ReframeImageNanoBananaProRequest.Json.g.cs | 141 - ...dels.ReframeImageNanoBananaProRequest.g.cs | 144 - ...ageNanoBananaProRequestResolutionTier.g.cs | 58 - ...eframeImageNanoBananaProResponse.Json.g.cs | 141 - ...els.ReframeImageNanoBananaProResponse.g.cs | 91 - ...ogram.Models.ReframeImageRequest.Json.g.cs | 141 - .../Ideogram.Models.ReframeImageRequest.g.cs | 136 - ...ram.Models.ReframeImageRequestV3.Json.g.cs | 141 - ...Ideogram.Models.ReframeImageRequestV3.g.cs | 168 - ...Models.ReframeNanoBanana2Request.Json.g.cs | 141 + ...gram.Models.ReframeNanoBanana2Request.g.cs | 113 + ...odels.ReframeNanoBanana2Response.Json.g.cs | 141 + ...ram.Models.ReframeNanoBanana2Response.g.cs | 19 + ...dels.ReframeNanoBanana2Response2.Json.g.cs | 141 + ...am.Models.ReframeNanoBanana2Response2.g.cs | 19 + ...dels.ReframeNanoBanana2Response3.Json.g.cs | 141 + ...am.Models.ReframeNanoBanana2Response3.g.cs | 19 + ...dels.ReframeNanoBanana2Response4.Json.g.cs | 141 + ...am.Models.ReframeNanoBanana2Response4.g.cs | 19 + ...dels.ReframeNanoBanana2Response5.Json.g.cs | 141 + ...am.Models.ReframeNanoBanana2Response5.g.cs | 19 + ...xImageIdeogramV3CharacterRequest.Json.g.cs | 141 - ....RemixImageIdeogramV3CharacterRequest.g.cs | 394 - ...ogramV3CharacterRequestRenderingSpeed.g.cs | 58 - ...geIdeogramV3CharacterRequestStyleType.g.cs | 58 - ...RemixImageIdeogramV3CharacterResponse.g.cs | 10 +- ...mageIdeogramV3CustomModelRequest.Json.g.cs | 141 - ...emixImageIdeogramV3CustomModelRequest.g.cs | 331 - ...ramV3CustomModelRequestRenderingSpeed.g.cs | 57 - ...mixImageIdeogramV3CustomModelResponse.g.cs | 10 +- ...dels.RemixImageIdeogramV3Request.Json.g.cs | 141 - ...am.Models.RemixImageIdeogramV3Request.g.cs | 357 - ...xImageIdeogramV3RequestRenderingSpeed.g.cs | 58 - ...m.Models.RemixImageIdeogramV3Response.g.cs | 10 +- ...dels.RemixImageIdeogramV4Request.Json.g.cs | 141 - ...am.Models.RemixImageIdeogramV4Request.g.cs | 211 - ...xImageIdeogramV4RequestRenderingSpeed.g.cs | 58 - ...m.Models.RemixImageIdeogramV4Response.g.cs | 10 +- ...deogram.Models.RemixImageRequest.Json.g.cs | 141 - .../Ideogram.Models.RemixImageRequest.g.cs | 74 - ...ogram.Models.RemixImageRequestV3.Json.g.cs | 141 - .../Ideogram.Models.RemixImageRequestV3.g.cs | 305 - ...ogram.Models.RemixImageRequestV4.Json.g.cs | 141 - .../Ideogram.Models.RemixImageRequestV4.g.cs | 135 - .../Ideogram.Models.RemixedImageObject.g.cs | 17 +- ...dels.RemoveBackgroundImageObject.Json.g.cs | 141 - ...am.Models.RemoveBackgroundImageObject.g.cs | 61 - ...m.Models.RemoveBackgroundRequest.Json.g.cs | 141 - ...eogram.Models.RemoveBackgroundRequest.g.cs | 59 - ....Models.RemoveBackgroundResponse.Json.g.cs | 141 - ...ogram.Models.RemoveBackgroundResponse.g.cs | 61 - ...s.RemoveBackgroundV2AssetRequest.Json.g.cs | 141 - ...Models.RemoveBackgroundV2AssetRequest.g.cs | 85 - ...Models.RemoveBackgroundV2Request.Json.g.cs | 141 - ...gram.Models.RemoveBackgroundV2Request.g.cs | 110 - ...ram.Models.RemoveBackgroundV2Response.g.cs | 3 +- ....RemoveObjectFromV2AssetsRequest.Json.g.cs | 141 - ...odels.RemoveObjectFromV2AssetsRequest.g.cs | 147 - ...dels.RemoveObjectFromV2AssetsResponse.g.cs | 3 +- ...m.Models.RemoveObjectImageObject.Json.g.cs | 141 - ...eogram.Models.RemoveObjectImageObject.g.cs | 61 - ...ogram.Models.RemoveObjectRequest.Json.g.cs | 141 - .../Ideogram.Models.RemoveObjectRequest.g.cs | 130 - ...gram.Models.RemoveObjectResponse.Json.g.cs | 141 - .../Ideogram.Models.RemoveObjectResponse.g.cs | 61 - ...RemoveOrganizationMembersRequest.Json.g.cs | 141 - ...dels.RemoveOrganizationMembersRequest.g.cs | 49 - .../Ideogram.Models.RenderingSpeed.g.cs | 70 - .../Ideogram.Models.RenderingSpeedV4.g.cs | 58 - ...placeBackgroundIdeogram45Request.Json.g.cs | 141 - ...ls.ReplaceBackgroundIdeogram45Request.g.cs | 186 - ...placeBackgroundIdeogramV3Request.Json.g.cs | 141 - ...ls.ReplaceBackgroundIdeogramV3Request.g.cs | 165 - ...groundIdeogramV3RequestRenderingSpeed.g.cs | 58 - ....Models.ReplaceBackgroundRequest.Json.g.cs | 141 - ...ogram.Models.ReplaceBackgroundRequest.g.cs | 157 - ...odels.ReplaceBackgroundRequestV3.Json.g.cs | 141 - ...ram.Models.ReplaceBackgroundRequestV3.g.cs | 193 - ...gram.Models.ReplaceBackgroundResponse.g.cs | 3 +- ....ResendOrganizationInviteRequest.Json.g.cs | 141 - ...odels.ResendOrganizationInviteRequest.g.cs | 47 - .../Ideogram.Models.ResizeAdImageQuality.g.cs | 57 - ...gram.Models.ResizeAdImageRequest.Json.g.cs | 141 - .../Ideogram.Models.ResizeAdImageRequest.g.cs | 139 - ...Models.ResizeAdImageRequestResolution.g.cs | 228 - .../Generated/Ideogram.Models.Resolution.g.cs | 508 - .../Ideogram.Models.ResolutionV3.g.cs | 3 +- .../Ideogram.Models.ResolutionV4.g.cs | 3 +- ...ogram.Models.ResolutionV4ImageToImage.g.cs | 274 - .../Ideogram.Models.ResolutionV4Layout.g.cs | 118 - ...ram.Models.SamplingRequestParams.Json.g.cs | 141 - ...Ideogram.Models.SamplingRequestParams.g.cs | 191 - .../Generated/Ideogram.Models.SegmentBy.g.cs | 52 - ...ogram.Models.SkechersStyleEditQuality.g.cs | 58 - ....Models.SkechersStyleEditRequest.Json.g.cs | 141 - ...ogram.Models.SkechersStyleEditRequest.g.cs | 184 - ...s.SkechersStyleEditRequestAspectRatio.g.cs | 69 - ...ersStyleEditRequestBaseGenerationSize.g.cs | 58 - ...Models.SkechersStyleEditResponse.Json.g.cs | 141 - ...gram.Models.SkechersStyleEditResponse.g.cs | 47 - ...ram.Models.SketchToRenderRequest.Json.g.cs | 141 - ...Ideogram.Models.SketchToRenderRequest.g.cs | 182 - ...deogram.Models.SketchToRenderResponse.g.cs | 3 +- .../Ideogram.Models.SnapMaskRequest.Json.g.cs | 141 - .../Ideogram.Models.SnapMaskRequest.g.cs | 83 - .../Ideogram.Models.SoleSwapQuality.g.cs | 58 - .../Ideogram.Models.SoleSwapRequest.Json.g.cs | 141 - .../Ideogram.Models.SoleSwapRequest.g.cs | 178 - ...els.SoleSwapRequestBaseGenerationSize.g.cs | 58 - ...Ideogram.Models.SoleSwapResponse.Json.g.cs | 141 - .../Ideogram.Models.SoleSwapResponse.g.cs | 48 - .../Ideogram.Models.SpendCommitInfo.Json.g.cs | 141 - .../Ideogram.Models.SpendCommitInfo.g.cs | 101 - ...m.Models.SpendCommitInfoResponse.Json.g.cs | 141 - ...eogram.Models.SpendCommitInfoResponse.g.cs | 47 - ...eogram.Models.StackedCustomModel.Json.g.cs | 141 - .../Ideogram.Models.StackedCustomModel.g.cs | 66 - .../Ideogram.Models.StylePresetV3.g.cs | 412 - .../Generated/Ideogram.Models.StyleType.g.cs | 94 - .../Ideogram.Models.StyleTypeV3.g.cs | 83 - ...ogram.Models.SvgGenerationObject.Json.g.cs | 141 - .../Ideogram.Models.SvgGenerationObject.g.cs | 103 - ...am.Models.SvgGenerationObjectMimeType.g.cs | 45 - ....Models.SvgGenerationObjectObjectType.g.cs | 45 - ...am.Models.SwanSLogoDesignRequest.Json.g.cs | 141 - ...deogram.Models.SwanSLogoDesignRequest.g.cs | 181 - ...s.SwanSLogoDesignRequestDesignVariant.g.cs | 51 - ...odels.SwanSLogoDesignRequestLogoStyle.g.cs | 51 - ...dels.SwanSLogoDesignRequestSourceMode.g.cs | 51 - ...m.Models.SwanSLogoDesignResponse.Json.g.cs | 141 - ...eogram.Models.SwanSLogoDesignResponse.g.cs | 47 - ...m.Models.SwanSLogoInstallRequest.Json.g.cs | 141 - ...eogram.Models.SwanSLogoInstallRequest.g.cs | 163 - ...dels.SwanSLogoInstallRequestLogoStyle.g.cs | 51 - ....Models.SwanSLogoInstallResponse.Json.g.cs | 141 - ...ogram.Models.SwanSLogoInstallResponse.g.cs | 47 - .../Ideogram.Models.SwanSLogoQuality.g.cs | 58 - .../Ideogram.Models.SwapProductMode.g.cs | 51 - .../Ideogram.Models.SwapProductQuality.g.cs | 58 - ...eogram.Models.SwapProductRequest.Json.g.cs | 141 - .../Ideogram.Models.SwapProductRequest.g.cs | 165 - ...ogram.Models.SwapProductResponse.Json.g.cs | 141 - .../Ideogram.Models.SwapProductResponse.g.cs | 47 - .../Ideogram.Models.TextColorSpan.g.cs | 14 +- .../Ideogram.Models.TextContainerV3.Json.g.cs | 141 - .../Ideogram.Models.TextContainerV3.g.cs | 60 - .../Ideogram.Models.TextItemV3.Json.g.cs | 141 - .../Generated/Ideogram.Models.TextItemV3.g.cs | 253 - .../Ideogram.Models.TextItemV3Alignment.g.cs | 58 - .../Ideogram.Models.TextItemV3GlyphType.g.cs | 64 - .../Ideogram.Models.TextItemV3StyleClass.g.cs | 64 - ...eogram.Models.TextItemV3TextTransform.g.cs | 57 - ...am.Models.TextItemV3VerticalAlignment.g.cs | 59 - ...gram.Models.TextLayerizerRequest.Json.g.cs | 141 - .../Ideogram.Models.TextLayerizerRequest.g.cs | 158 - ...ram.Models.TextLayerizerResponse.Json.g.cs | 141 - ...Ideogram.Models.TextLayerizerResponse.g.cs | 47 - ...Models.TextLayerizerResultObject.Json.g.cs | 141 - ...gram.Models.TextLayerizerResultObject.g.cs | 169 - ...s.TextLayerizerResultObjectObjectType.g.cs | 45 - .../Ideogram.Models.TextSpanV3.Json.g.cs | 141 - .../Generated/Ideogram.Models.TextSpanV3.g.cs | 80 - .../Ideogram.Models.TextSpanV3FontFxItem.g.cs | 87 - ...Ideogram.Models.ToolRemixRequest.Json.g.cs | 141 - .../Ideogram.Models.ToolRemixRequest.g.cs | 335 - ...Models.ToolRemixRequestResolutionTier.g.cs | 51 - .../Ideogram.Models.ToolRemixResponse.g.cs | 3 +- ...dels.ToolRemoveBackgroundRequest.Json.g.cs | 141 + ...am.Models.ToolRemoveBackgroundRequest.g.cs | 87 + ...els.ToolRemoveBackgroundResponse.Json.g.cs | 141 + ...m.Models.ToolRemoveBackgroundResponse.g.cs | 19 + ...ls.ToolRemoveBackgroundResponse2.Json.g.cs | 141 + ....Models.ToolRemoveBackgroundResponse2.g.cs | 19 + ...ls.ToolRemoveBackgroundResponse3.Json.g.cs | 141 + ....Models.ToolRemoveBackgroundResponse3.g.cs | 19 + ...ls.ToolRemoveBackgroundResponse4.Json.g.cs | 141 + ....Models.ToolRemoveBackgroundResponse4.g.cs | 19 + ...ls.ToolRemoveBackgroundResponse5.Json.g.cs | 141 + ....Models.ToolRemoveBackgroundResponse5.g.cs | 19 + ...ls.ToolRemoveBackgroundResponse6.Json.g.cs | 141 + ....Models.ToolRemoveBackgroundResponse6.g.cs | 19 + ...placeBackgroundIdeogram45Request.Json.g.cs | 141 + ...oolReplaceBackgroundIdeogram45Request.g.cs | 158 + ...laceBackgroundIdeogram45Response.Json.g.cs | 141 + ...olReplaceBackgroundIdeogram45Response.g.cs | 19 + ...aceBackgroundIdeogram45Response2.Json.g.cs | 141 + ...lReplaceBackgroundIdeogram45Response2.g.cs | 19 + ...aceBackgroundIdeogram45Response3.Json.g.cs | 141 + ...lReplaceBackgroundIdeogram45Response3.g.cs | 19 + ...aceBackgroundIdeogram45Response4.Json.g.cs | 141 + ...lReplaceBackgroundIdeogram45Response4.g.cs | 19 + ...aceBackgroundIdeogram45Response5.Json.g.cs | 141 + ...lReplaceBackgroundIdeogram45Response5.g.cs | 19 + ...placeBackgroundIdeogramV3Request.Json.g.cs | 141 + ...oolReplaceBackgroundIdeogramV3Request.g.cs | 148 + ...laceBackgroundIdeogramV3Response.Json.g.cs | 141 + ...olReplaceBackgroundIdeogramV3Response.g.cs | 19 + ...aceBackgroundIdeogramV3Response2.Json.g.cs | 141 + ...lReplaceBackgroundIdeogramV3Response2.g.cs | 19 + ...aceBackgroundIdeogramV3Response3.Json.g.cs | 141 + ...lReplaceBackgroundIdeogramV3Response3.g.cs | 19 + ...aceBackgroundIdeogramV3Response4.Json.g.cs | 141 + ...lReplaceBackgroundIdeogramV3Response4.g.cs | 19 + ...aceBackgroundIdeogramV3Response5.Json.g.cs | 141 + ...lReplaceBackgroundIdeogramV3Response5.g.cs | 19 + ...aceBackgroundIdeogramV3Response6.Json.g.cs | 141 + ...lReplaceBackgroundIdeogramV3Response6.g.cs | 19 + ...els.ToolReplaceBackgroundRequest.Json.g.cs | 141 + ...m.Models.ToolReplaceBackgroundRequest.g.cs | 140 + ...ls.ToolReplaceBackgroundResponse.Json.g.cs | 141 + ....Models.ToolReplaceBackgroundResponse.g.cs | 19 + ...s.ToolReplaceBackgroundResponse2.Json.g.cs | 141 + ...Models.ToolReplaceBackgroundResponse2.g.cs | 19 + ...s.ToolReplaceBackgroundResponse3.Json.g.cs | 141 + ...Models.ToolReplaceBackgroundResponse3.g.cs | 19 + ...s.ToolReplaceBackgroundResponse4.Json.g.cs | 141 + ...Models.ToolReplaceBackgroundResponse4.g.cs | 19 + ...s.ToolReplaceBackgroundResponse5.Json.g.cs | 141 + ...Models.ToolReplaceBackgroundResponse5.g.cs | 19 + ...s.ToolReplaceBackgroundResponse6.Json.g.cs | 141 + ...Models.ToolReplaceBackgroundResponse6.g.cs | 19 + .../Generated/Ideogram.Models.ToolType.g.cs | 76 - .../Ideogram.Models.ToolUsage.Json.g.cs | 141 - .../Generated/Ideogram.Models.ToolUsage.g.cs | 144 - ...m.Models.ToolsPostUpscaleRequest.Json.g.cs | 141 + ...eogram.Models.ToolsPostUpscaleRequest.g.cs | 122 + ....Models.ToolsPostUpscaleResponse.Json.g.cs | 141 + ...ogram.Models.ToolsPostUpscaleResponse.g.cs | 19 + ...Models.ToolsPostUpscaleResponse2.Json.g.cs | 141 + ...gram.Models.ToolsPostUpscaleResponse2.g.cs | 19 + ...Models.ToolsPostUpscaleResponse3.Json.g.cs | 141 + ...gram.Models.ToolsPostUpscaleResponse3.g.cs | 19 + ...Models.ToolsPostUpscaleResponse4.Json.g.cs | 141 + ...gram.Models.ToolsPostUpscaleResponse4.g.cs | 19 + ...Models.ToolsPostUpscaleResponse5.Json.g.cs | 141 + ...gram.Models.ToolsPostUpscaleResponse5.g.cs | 19 + ...Models.ToolsPostUpscaleResponse6.Json.g.cs | 141 + ...gram.Models.ToolsPostUpscaleResponse6.g.cs | 19 + ....Models.TrainDatasetModelRequest.Json.g.cs | 141 - ...ogram.Models.TrainDatasetModelRequest.g.cs | 51 - ...Models.TrainDatasetModelResponse.Json.g.cs | 141 - ...gram.Models.TrainDatasetModelResponse.g.cs | 83 - ...dels.TrainModelV3AdvancedRequest.Json.g.cs | 141 - ...am.Models.TrainModelV3AdvancedRequest.g.cs | 122 - ...ogram.Models.TrainModelV3Request.Json.g.cs | 141 - .../Ideogram.Models.TrainModelV3Request.g.cs | 66 - ...dels.TrainModelV4AdvancedRequest.Json.g.cs | 141 - ...am.Models.TrainModelV4AdvancedRequest.g.cs | 164 - ...ogram.Models.TrainModelV4Request.Json.g.cs | 141 - .../Ideogram.Models.TrainModelV4Request.g.cs | 66 - .../Ideogram.Models.TrainingRun.Json.g.cs | 141 - .../Ideogram.Models.TrainingRun.g.cs | 139 - .../Ideogram.Models.TrainingRunStatus.g.cs | 75 - .../Ideogram.Models.TransparencyOption.g.cs | 64 - .../Ideogram.Models.TryOnRequestV3.Json.g.cs | 141 - .../Ideogram.Models.TryOnRequestV3.g.cs | 186 - ....UnpublishMiniAppPreviewResponse.Json.g.cs | 141 - ...odels.UnpublishMiniAppPreviewResponse.g.cs | 48 - ...OrganizationApiPropertiesRequest.Json.g.cs | 141 - ...pdateOrganizationApiPropertiesRequest.g.cs | 47 - ...rganizationApiPropertiesResponse.Json.g.cs | 141 - ...dateOrganizationApiPropertiesResponse.g.cs | 47 - ...odels.UploadDatasetAssetsRequest.Json.g.cs | 141 - ...ram.Models.UploadDatasetAssetsRequest.g.cs | 47 - ...dels.UploadDatasetAssetsResponse.Json.g.cs | 141 - ...am.Models.UploadDatasetAssetsResponse.g.cs | 97 - .../Ideogram.Models.UpscaleFactor.g.cs | 59 - ...UpscaleImageNanoBananaProRequest.Json.g.cs | 141 - ...dels.UpscaleImageNanoBananaProRequest.g.cs | 173 - ...ageNanoBananaProRequestResolutionTier.g.cs | 58 - ...els.UpscaleImageNanoBananaProResponse.g.cs | 10 +- .../Ideogram.Models.UpscaleImageObject.g.cs | 17 +- ...ogram.Models.UpscaleImageRequest.Json.g.cs | 141 - .../Ideogram.Models.UpscaleImageRequest.g.cs | 71 - ...s.UpscaleImageTopazBloom2Request.Json.g.cs | 141 - ...Models.UpscaleImageTopazBloom2Request.g.cs | 199 - ...eImageTopazBloom2RequestUpscaleFactor.g.cs | 58 - ...odels.UpscaleImageTopazBloom2Response.g.cs | 10 +- ...UpscaleImageTopazRedefineRequest.Json.g.cs | 141 - ...dels.UpscaleImageTopazRedefineRequest.g.cs | 303 - ...eTopazRedefineRequestSubjectDetection.g.cs | 57 - ...mageTopazRedefineRequestUpscaleFactor.g.cs | 58 - ...els.UpscaleImageTopazRedefineResponse.g.cs | 10 +- ...scaleImageTopazStandardV2Request.Json.g.cs | 141 - ...ls.UpscaleImageTopazStandardV2Request.g.cs | 237 - ...opazStandardV2RequestSubjectDetection.g.cs | 57 - ...geTopazStandardV2RequestUpscaleFactor.g.cs | 58 - ...s.UpscaleImageTopazStandardV2Response.g.cs | 10 +- ...scaleImageTopazTextRefineRequest.Json.g.cs | 141 - ...ls.UpscaleImageTopazTextRefineRequest.g.cs | 251 - ...opazTextRefineRequestSubjectDetection.g.cs | 57 - ...geTopazTextRefineRequestUpscaleFactor.g.cs | 58 - ...s.UpscaleImageTopazTextRefineResponse.g.cs | 10 +- ...UpscaleImageTopazWonder35Request.Json.g.cs | 141 - ...dels.UpscaleImageTopazWonder35Request.g.cs | 176 - ...pazWonder35RequestEnhancementStrength.g.cs | 58 - ...mageTopazWonder35RequestUpscaleFactor.g.cs | 58 - ...els.UpscaleImageTopazWonder35Response.g.cs | 10 +- ...odels.UpscaleInitialImageRequest.Json.g.cs | 141 - ...ram.Models.UpscaleInitialImageRequest.g.cs | 140 - ...eogram.Models.UpscaleToolRequest.Json.g.cs | 141 - .../Ideogram.Models.UpscaleToolRequest.g.cs | 175 - ...odels.UpscaleToolRequestUpscaleFactor.g.cs | 58 - .../Ideogram.Models.UpscaleToolResponse.g.cs | 10 +- .../Ideogram.Models.UsageSegment.Json.g.cs | 141 - .../Ideogram.Models.UsageSegment.g.cs | 77 - .../Ideogram.Models.UsageSource.g.cs | 52 - ...deogram.Models.V1EditImageObject.Json.g.cs | 141 - .../Ideogram.Models.V1EditImageObject.g.cs | 137 - ...ogram.Models.V1EditImagesRequest.Json.g.cs | 141 - .../Ideogram.Models.V1EditImagesRequest.g.cs | 169 - ...gram.Models.V1EditImagesResponse.Json.g.cs | 141 - .../Ideogram.Models.V1EditImagesResponse.g.cs | 61 - ...m.Models.V1EditLiteImagesRequest.Json.g.cs | 141 - ...eogram.Models.V1EditLiteImagesRequest.g.cs | 185 - ...2AccountUsageGetParametersBucketWidth.g.cs | 51 + ...tUsageGetParametersSourcesSchemaItems.g.cs | 51 + ...MultipartFormDataSchemaResolutionTier.g.cs | 57 + ...tentMultipartFormDataSchemaBackground.g.cs | 58 + ...ContentMultipartFormDataSchemaQuality.g.cs | 64 + ...tentMultipartFormDataSchemaBackground.g.cs | 58 + ...ContentMultipartFormDataSchemaQuality.g.cs | 64 + ...MultipartFormDataSchemaRenderingSpeed.g.cs | 58 + ...ntentMultipartFormDataSchemaStyleType.g.cs | 58 + ...MultipartFormDataSchemaRenderingSpeed.g.cs | 57 + ...MultipartFormDataSchemaRenderingSpeed.g.cs | 58 + ...tentMultipartFormDataSchemaBackground.g.cs | 58 + ...ContentMultipartFormDataSchemaQuality.g.cs | 63 + ...MultipartFormDataSchemaResolutionTier.g.cs | 58 + ...MultipartFormDataSchemaResolutionTier.g.cs | 58 + ...MultipartFormDataSchemaResolutionTier.g.cs | 58 + ...MultipartFormDataSchemaRenderingSpeed.g.cs | 58 + ...ntentMultipartFormDataSchemaStyleType.g.cs | 58 + ...MultipartFormDataSchemaRenderingSpeed.g.cs | 57 + ...MultipartFormDataSchemaRenderingSpeed.g.cs | 58 + ...ContentMultipartFormDataSchemaQuality.g.cs | 64 + ...MultipartFormDataSchemaRenderingSpeed.g.cs | 57 + ...MultipartFormDataSchemaResolutionTier.g.cs | 51 + ...MultipartFormDataSchemaRenderingSpeed.g.cs | 58 + ...ntentMultipartFormDataSchemaStyleType.g.cs | 58 + ...MultipartFormDataSchemaRenderingSpeed.g.cs | 57 + ...MultipartFormDataSchemaRenderingSpeed.g.cs | 58 + ...MultipartFormDataSchemaRenderingSpeed.g.cs | 58 + ...MultipartFormDataSchemaRenderingSpeed.g.cs | 58 + ...tMultipartFormDataSchemaUpscaleFactor.g.cs | 58 + ...MultipartFormDataSchemaResolutionTier.g.cs | 58 + ...tMultipartFormDataSchemaUpscaleFactor.g.cs | 58 + ...ltipartFormDataSchemaSubjectDetection.g.cs | 57 + ...tMultipartFormDataSchemaUpscaleFactor.g.cs | 58 + ...ltipartFormDataSchemaSubjectDetection.g.cs | 57 + ...tMultipartFormDataSchemaUpscaleFactor.g.cs | 58 + ...ltipartFormDataSchemaSubjectDetection.g.cs | 57 + ...tMultipartFormDataSchemaUpscaleFactor.g.cs | 58 + ...partFormDataSchemaEnhancementStrength.g.cs | 58 + ...tMultipartFormDataSchemaUpscaleFactor.g.cs | 58 + ...ontentMultipartFormDataSchemaLanguage.g.cs | 141 + ...ontentMultipartFormDataSchemaPlatform.g.cs | 95 + ...tentMultipartFormDataSchemaResolution.g.cs | 227 + ...tMultipartFormDataSchemaVariationType.g.cs | 67 + ...odyContentMultipartFormDataSchemaView.g.cs | 57 + ....Models.V4CompositionalDeconstruction.g.cs | 3 +- .../Ideogram.Models.V4JsonPrompt.g.cs | 32 +- ...eogram.Models.V4ObjPromptElement.Json.g.cs | 141 - .../Ideogram.Models.V4ObjPromptElement.g.cs | 95 - .../Ideogram.Models.V4PromptElement.g.cs | 59 +- ...m.Models.V4PromptElementVariant1.Json.g.cs | 141 + ...eogram.Models.V4PromptElementVariant1.g.cs | 91 + ...m.Models.V4PromptElementVariant2.Json.g.cs | 141 + ...eogram.Models.V4PromptElementVariant2.g.cs | 103 + .../Ideogram.Models.V4StyleDescription.g.cs | 3 +- ...ogram.Models.V4TextPromptElement.Json.g.cs | 141 - .../Ideogram.Models.V4TextPromptElement.g.cs | 106 - ...deogram.Models.VectorizerRequest.Json.g.cs | 141 - .../Ideogram.Models.VectorizerRequest.g.cs | 148 - ...Ideogram.Models.VectorizerRequestMode.g.cs | 52 - ...eogram.Models.VectorizerResponse.Json.g.cs | 141 - .../Ideogram.Models.VectorizerResponse.g.cs | 47 - ...MinimaxH3ReferenceToVideoRequest.Json.g.cs | 141 + ...VideoMinimaxH3ReferenceToVideoRequest.g.cs | 159 + ...inimaxH3ReferenceToVideoResponse.Json.g.cs | 141 + ...ideoMinimaxH3ReferenceToVideoResponse.g.cs | 19 + ...nimaxH3ReferenceToVideoResponse2.Json.g.cs | 141 + ...deoMinimaxH3ReferenceToVideoResponse2.g.cs | 19 + ...nimaxH3ReferenceToVideoResponse3.Json.g.cs | 141 + ...deoMinimaxH3ReferenceToVideoResponse3.g.cs | 19 + ...nimaxH3ReferenceToVideoResponse4.Json.g.cs | 141 + ...deoMinimaxH3ReferenceToVideoResponse4.g.cs | 19 + ...nimaxH3ReferenceToVideoResponse5.Json.g.cs | 141 + ...deoMinimaxH3ReferenceToVideoResponse5.g.cs | 19 + ...nimaxH3ReferenceToVideoResponse6.Json.g.cs | 141 + ...deoMinimaxH3ReferenceToVideoResponse6.g.cs | 19 + ...nimaxH3ReferenceToVideoResponse7.Json.g.cs | 141 + ...deoMinimaxH3ReferenceToVideoResponse7.g.cs | 19 + ...ingV3StandardImageToVideoRequest.Json.g.cs | 141 + ...deoKlingV3StandardImageToVideoRequest.g.cs | 186 + ...ngV3StandardImageToVideoResponse.Json.g.cs | 141 + ...eoKlingV3StandardImageToVideoResponse.g.cs | 19 + ...gV3StandardImageToVideoResponse2.Json.g.cs | 141 + ...oKlingV3StandardImageToVideoResponse2.g.cs | 19 + ...gV3StandardImageToVideoResponse3.Json.g.cs | 141 + ...oKlingV3StandardImageToVideoResponse3.g.cs | 19 + ...gV3StandardImageToVideoResponse4.Json.g.cs | 141 + ...oKlingV3StandardImageToVideoResponse4.g.cs | 19 + ...gV3StandardImageToVideoResponse5.Json.g.cs | 141 + ...oKlingV3StandardImageToVideoResponse5.g.cs | 19 + ...gV3StandardImageToVideoResponse6.Json.g.cs | 141 + ...oKlingV3StandardImageToVideoResponse6.g.cs | 19 + ...gV3StandardImageToVideoResponse7.Json.g.cs | 141 + ...oKlingV3StandardImageToVideoResponse7.g.cs | 19 + ...ingV3StandardTextToVideoResponse.Json.g.cs | 141 + ...deoKlingV3StandardTextToVideoResponse.g.cs | 19 + ...ngV3StandardTextToVideoResponse2.Json.g.cs | 141 + ...eoKlingV3StandardTextToVideoResponse2.g.cs | 19 + ...ngV3StandardTextToVideoResponse3.Json.g.cs | 141 + ...eoKlingV3StandardTextToVideoResponse3.g.cs | 19 + ...ngV3StandardTextToVideoResponse4.Json.g.cs | 141 + ...eoKlingV3StandardTextToVideoResponse4.g.cs | 19 + ...ngV3StandardTextToVideoResponse5.Json.g.cs | 141 + ...eoKlingV3StandardTextToVideoResponse5.g.cs | 19 + ...ngV3StandardTextToVideoResponse6.Json.g.cs | 141 + ...eoKlingV3StandardTextToVideoResponse6.g.cs | 19 + ...ideoMinimaxH3ImageToVideoRequest.Json.g.cs | 141 + ...rateVideoMinimaxH3ImageToVideoRequest.g.cs | 151 + ...deoMinimaxH3ImageToVideoResponse.Json.g.cs | 141 + ...ateVideoMinimaxH3ImageToVideoResponse.g.cs | 19 + ...eoMinimaxH3ImageToVideoResponse2.Json.g.cs | 141 + ...teVideoMinimaxH3ImageToVideoResponse2.g.cs | 19 + ...eoMinimaxH3ImageToVideoResponse3.Json.g.cs | 141 + ...teVideoMinimaxH3ImageToVideoResponse3.g.cs | 19 + ...eoMinimaxH3ImageToVideoResponse4.Json.g.cs | 141 + ...teVideoMinimaxH3ImageToVideoResponse4.g.cs | 19 + ...eoMinimaxH3ImageToVideoResponse5.Json.g.cs | 141 + ...teVideoMinimaxH3ImageToVideoResponse5.g.cs | 19 + ...eoMinimaxH3ImageToVideoResponse6.Json.g.cs | 141 + ...teVideoMinimaxH3ImageToVideoResponse6.g.cs | 19 + ...eoMinimaxH3ImageToVideoResponse7.Json.g.cs | 141 + ...teVideoMinimaxH3ImageToVideoResponse7.g.cs | 19 + ...ideoMinimaxH3TextToVideoResponse.Json.g.cs | 141 + ...rateVideoMinimaxH3TextToVideoResponse.g.cs | 19 + ...deoMinimaxH3TextToVideoResponse2.Json.g.cs | 141 + ...ateVideoMinimaxH3TextToVideoResponse2.g.cs | 19 + ...deoMinimaxH3TextToVideoResponse3.Json.g.cs | 141 + ...ateVideoMinimaxH3TextToVideoResponse3.g.cs | 19 + ...deoMinimaxH3TextToVideoResponse4.Json.g.cs | 141 + ...ateVideoMinimaxH3TextToVideoResponse4.g.cs | 19 + ...deoMinimaxH3TextToVideoResponse5.Json.g.cs | 141 + ...ateVideoMinimaxH3TextToVideoResponse5.g.cs | 19 + ...deoMinimaxH3TextToVideoResponse6.Json.g.cs | 141 + ...ateVideoMinimaxH3TextToVideoResponse6.g.cs | 19 + ...eoSeedDance25ImageToVideoRequest.Json.g.cs | 141 + ...teVideoSeedDance25ImageToVideoRequest.g.cs | 160 + ...oSeedDance25ImageToVideoResponse.Json.g.cs | 141 + ...eVideoSeedDance25ImageToVideoResponse.g.cs | 19 + ...SeedDance25ImageToVideoResponse2.Json.g.cs | 141 + ...VideoSeedDance25ImageToVideoResponse2.g.cs | 19 + ...SeedDance25ImageToVideoResponse3.Json.g.cs | 141 + ...VideoSeedDance25ImageToVideoResponse3.g.cs | 19 + ...SeedDance25ImageToVideoResponse4.Json.g.cs | 141 + ...VideoSeedDance25ImageToVideoResponse4.g.cs | 19 + ...SeedDance25ImageToVideoResponse5.Json.g.cs | 141 + ...VideoSeedDance25ImageToVideoResponse5.g.cs | 19 + ...SeedDance25ImageToVideoResponse6.Json.g.cs | 141 + ...VideoSeedDance25ImageToVideoResponse6.g.cs | 19 + ...SeedDance25ImageToVideoResponse7.Json.g.cs | 141 + ...VideoSeedDance25ImageToVideoResponse7.g.cs | 19 + ...edDance25ReferenceToVideoRequest.Json.g.cs | 141 + ...deoSeedDance25ReferenceToVideoRequest.g.cs | 152 + ...dDance25ReferenceToVideoResponse.Json.g.cs | 141 + ...eoSeedDance25ReferenceToVideoResponse.g.cs | 19 + ...Dance25ReferenceToVideoResponse2.Json.g.cs | 141 + ...oSeedDance25ReferenceToVideoResponse2.g.cs | 19 + ...Dance25ReferenceToVideoResponse3.Json.g.cs | 141 + ...oSeedDance25ReferenceToVideoResponse3.g.cs | 19 + ...Dance25ReferenceToVideoResponse4.Json.g.cs | 141 + ...oSeedDance25ReferenceToVideoResponse4.g.cs | 19 + ...Dance25ReferenceToVideoResponse5.Json.g.cs | 141 + ...oSeedDance25ReferenceToVideoResponse5.g.cs | 19 + ...Dance25ReferenceToVideoResponse6.Json.g.cs | 141 + ...oSeedDance25ReferenceToVideoResponse6.g.cs | 19 + ...Dance25ReferenceToVideoResponse7.Json.g.cs | 141 + ...oSeedDance25ReferenceToVideoResponse7.g.cs | 19 + ...eoSeedDance25TextToVideoResponse.Json.g.cs | 141 + ...teVideoSeedDance25TextToVideoResponse.g.cs | 19 + ...oSeedDance25TextToVideoResponse2.Json.g.cs | 141 + ...eVideoSeedDance25TextToVideoResponse2.g.cs | 19 + ...oSeedDance25TextToVideoResponse3.Json.g.cs | 141 + ...eVideoSeedDance25TextToVideoResponse3.g.cs | 19 + ...oSeedDance25TextToVideoResponse4.Json.g.cs | 141 + ...eVideoSeedDance25TextToVideoResponse4.g.cs | 19 + ...oSeedDance25TextToVideoResponse5.Json.g.cs | 141 + ...eVideoSeedDance25TextToVideoResponse5.g.cs | 19 + ...oSeedDance25TextToVideoResponse6.Json.g.cs | 141 + ...eVideoSeedDance25TextToVideoResponse6.g.cs | 19 + ...deoSeedDance2ImageToVideoRequest.Json.g.cs | 141 + ...ateVideoSeedDance2ImageToVideoRequest.g.cs | 176 + ...eoSeedDance2ImageToVideoResponse.Json.g.cs | 141 + ...teVideoSeedDance2ImageToVideoResponse.g.cs | 19 + ...oSeedDance2ImageToVideoResponse2.Json.g.cs | 141 + ...eVideoSeedDance2ImageToVideoResponse2.g.cs | 19 + ...oSeedDance2ImageToVideoResponse3.Json.g.cs | 141 + ...eVideoSeedDance2ImageToVideoResponse3.g.cs | 19 + ...oSeedDance2ImageToVideoResponse4.Json.g.cs | 141 + ...eVideoSeedDance2ImageToVideoResponse4.g.cs | 19 + ...oSeedDance2ImageToVideoResponse5.Json.g.cs | 141 + ...eVideoSeedDance2ImageToVideoResponse5.g.cs | 19 + ...oSeedDance2ImageToVideoResponse6.Json.g.cs | 141 + ...eVideoSeedDance2ImageToVideoResponse6.g.cs | 19 + ...oSeedDance2ImageToVideoResponse7.Json.g.cs | 141 + ...eVideoSeedDance2ImageToVideoResponse7.g.cs | 19 + ...eedDance2ReferenceToVideoRequest.Json.g.cs | 141 + ...ideoSeedDance2ReferenceToVideoRequest.g.cs | 152 + ...edDance2ReferenceToVideoResponse.Json.g.cs | 141 + ...deoSeedDance2ReferenceToVideoResponse.g.cs | 19 + ...dDance2ReferenceToVideoResponse2.Json.g.cs | 141 + ...eoSeedDance2ReferenceToVideoResponse2.g.cs | 19 + ...dDance2ReferenceToVideoResponse3.Json.g.cs | 141 + ...eoSeedDance2ReferenceToVideoResponse3.g.cs | 19 + ...dDance2ReferenceToVideoResponse4.Json.g.cs | 141 + ...eoSeedDance2ReferenceToVideoResponse4.g.cs | 19 + ...dDance2ReferenceToVideoResponse5.Json.g.cs | 141 + ...eoSeedDance2ReferenceToVideoResponse5.g.cs | 19 + ...dDance2ReferenceToVideoResponse6.Json.g.cs | 141 + ...eoSeedDance2ReferenceToVideoResponse6.g.cs | 19 + ...dDance2ReferenceToVideoResponse7.Json.g.cs | 141 + ...eoSeedDance2ReferenceToVideoResponse7.g.cs | 19 + ...deoSeedDance2TextToVideoResponse.Json.g.cs | 141 + ...ateVideoSeedDance2TextToVideoResponse.g.cs | 19 + ...eoSeedDance2TextToVideoResponse2.Json.g.cs | 141 + ...teVideoSeedDance2TextToVideoResponse2.g.cs | 19 + ...eoSeedDance2TextToVideoResponse3.Json.g.cs | 141 + ...teVideoSeedDance2TextToVideoResponse3.g.cs | 19 + ...eoSeedDance2TextToVideoResponse4.Json.g.cs | 141 + ...teVideoSeedDance2TextToVideoResponse4.g.cs | 19 + ...eoSeedDance2TextToVideoResponse5.Json.g.cs | 141 + ...teVideoSeedDance2TextToVideoResponse5.g.cs | 19 + ...eoSeedDance2TextToVideoResponse6.Json.g.cs | 141 + ...teVideoSeedDance2TextToVideoResponse6.g.cs | 19 + .../Ideogram.Models.VideoObject.Json.g.cs | 141 - .../Ideogram.Models.VideoObject.g.cs | 129 - ...Ideogram.Models.VideoObjectObjectType.g.cs | 45 - ...ogram.Models.VirtualTryOnRequest.Json.g.cs | 141 - .../Ideogram.Models.VirtualTryOnRequest.g.cs | 187 - ...gram.Models.VirtualTryOnResponse.Json.g.cs | 141 - .../Ideogram.Models.VirtualTryOnResponse.g.cs | 49 - ...deogram.Models.WebhookSigningJwk.Json.g.cs | 141 - .../Ideogram.Models.WebhookSigningJwk.g.cs | 130 - ...eogram.Models.WebhookSigningJwks.Json.g.cs | 141 - .../Ideogram.Models.WebhookSigningJwks.g.cs | 51 - ...am.ModelsClient.Authorizations.Bearer.g.cs | 35 - ...gram.ModelsClient.Constructors.Bearer.g.cs | 31 - .../Ideogram.ModelsClient.GetCustomModel.g.cs | 490 - ...deogram.ModelsClient.ListCustomModels.g.cs | 471 - .../Ideogram.ModelsClient.TrainModelV3.g.cs | 565 - ...ram.ModelsClient.TrainModelV3Advanced.g.cs | 589 - .../Ideogram.ModelsClient.TrainModelV4.g.cs | 565 - ...ram.ModelsClient.TrainModelV4Advanced.g.cs | 607 - .../Generated/Ideogram.ModelsClient.g.cs | 144 - ...m.ObjectRemoval.JsonSerializerContext.g.cs | 42 +- ...ctRemovalPostRemoveObjectFromV2Assets.g.cs | 2456 + ...alClient.PostRemoveObjectFromV2Assets.g.cs | 926 - .../Ideogram.ObjectRemovalClient.g.cs | 2 - ...Ideogram.Prompt.JsonSerializerContext.g.cs | 298 - ...am.PromptClient.Authorizations.Bearer.g.cs | 35 - ...gram.PromptClient.Constructors.Bearer.g.cs | 31 - ...Ideogram.PromptClient.PostMagicPrompt.g.cs | 847 - ...eogram.PromptClient.PostMagicPromptV4.g.cs | 608 - .../Generated/Ideogram.PromptClient.g.cs | 143 - ...gram.Provenance.JsonSerializerContext.g.cs | 160 - ...rovenanceClient.Authorizations.Bearer.g.cs | 35 - ....ProvenanceClient.Constructors.Bearer.g.cs | 31 - ...ProvenanceClient.PostProvenanceVerify.g.cs | 1644 - .../Generated/Ideogram.ProvenanceClient.g.cs | 143 - ...deogram.Reframe.JsonSerializerContext.g.cs | 279 + ...m.ReframeClient.Authorizations.Bearer.g.cs | 35 + ...ram.ReframeClient.Constructors.Bearer.g.cs | 31 + ...ogram.ReframeClient.ReframeIdeogramV3.g.cs | 2612 + ...gram.ReframeClient.ReframeNanoBanana2.g.cs | 2316 + .../Generated/Ideogram.ReframeClient.g.cs | 143 + .../Generated/Ideogram.ResponseStream.g.cs | 117 - .../Ideogram.Tool.JsonSerializerContext.g.cs | 65 +- .../Ideogram.ToolClient.RemoveBackground.g.cs | 860 - ...Ideogram.ToolClient.ReplaceBackground.g.cs | 895 - ...oolClient.ReplaceBackgroundIdeogram45.g.cs | 919 - ...oolClient.ReplaceBackgroundIdeogramV3.g.cs | 899 - ...ogram.ToolClient.ToolRemoveBackground.g.cs | 2358 + ...gram.ToolClient.ToolReplaceBackground.g.cs | 2495 + ...lient.ToolReplaceBackgroundIdeogram45.g.cs | 2496 + ...lient.ToolReplaceBackgroundIdeogramV3.g.cs | 2507 + .../Generated/Ideogram.ToolClient.g.cs | 1 - .../Ideogram.Tools.JsonSerializerContext.g.cs | 60 +- .../Ideogram.ToolsClient.PostUpscale.g.cs | 927 - ...Ideogram.ToolsClient.ToolsPostUpscale.g.cs | 2464 + ...ogram.VideoEdit.JsonSerializerContext.g.cs | 86 +- ...ostEditVideoMinimaxH3ReferenceToVideo.g.cs | 978 - ...deoEditClient.PostEditVideoSeedDance2.g.cs | 932 - ...ostEditVideoMinimaxH3ReferenceToVideo.g.cs | 958 + ...m.VideoGenerate.JsonSerializerContext.g.cs | 207 +- ...erateVideoKlingV3StandardImageToVideo.g.cs | 1047 - ...nerateVideoKlingV3StandardTextToVideo.g.cs | 818 - ...ostGenerateVideoMinimaxH3ImageToVideo.g.cs | 1006 - ...PostGenerateVideoMinimaxH3TextToVideo.g.cs | 801 - ...tGenerateVideoSeedDance25ImageToVideo.g.cs | 1018 - ...erateVideoSeedDance25ReferenceToVideo.g.cs | 975 - ...stGenerateVideoSeedDance25TextToVideo.g.cs | 806 - ...stGenerateVideoSeedDance2ImageToVideo.g.cs | 1033 - ...nerateVideoSeedDance2ReferenceToVideo.g.cs | 975 - ...ostGenerateVideoSeedDance2TextToVideo.g.cs | 806 - ...m.VideoGenerateClient.PostLivingImage.g.cs | 739 - ...deoGenerateClient.PostProduct360Video.g.cs | 781 - ...erateVideoKlingV3StandardImageToVideo.g.cs | 2843 + ...nerateVideoKlingV3StandardTextToVideo.g.cs | 834 + ...ostGenerateVideoMinimaxH3ImageToVideo.g.cs | 2723 + ...PostGenerateVideoMinimaxH3TextToVideo.g.cs | 818 + ...tGenerateVideoSeedDance25ImageToVideo.g.cs | 2759 + ...erateVideoSeedDance25ReferenceToVideo.g.cs | 955 + ...stGenerateVideoSeedDance25TextToVideo.g.cs | 823 + ...stGenerateVideoSeedDance2ImageToVideo.g.cs | 2804 + ...nerateVideoSeedDance2ReferenceToVideo.g.cs | 955 + ...ostGenerateVideoSeedDance2TextToVideo.g.cs | 823 + ...Ideogram.Vision.JsonSerializerContext.g.cs | 231 - ...am.VisionClient.Authorizations.Bearer.g.cs | 35 - ...gram.VisionClient.Constructors.Bearer.g.cs | 31 - .../Ideogram.VisionClient.PostDescribe.g.cs | 1679 - .../Ideogram.VisionClient.PostDescribeV4.g.cs | 1901 - .../Generated/Ideogram.VisionClient.g.cs | 144 - ...eogram.Webhooks.JsonSerializerContext.g.cs | 128 - ....WebhooksClient.Authorizations.Bearer.g.cs | 35 - ...am.WebhooksClient.Constructors.Bearer.g.cs | 31 - ....WebhooksClient.GetWebhookSigningJwks.g.cs | 435 - .../Generated/Ideogram.WebhooksClient.g.cs | 146 - .../Generated/autosdk.generated-examples.json | 2160 - src/libs/Ideogram/openapi.json | 47828 ++++------------ 2807 files changed, 243826 insertions(+), 367515 deletions(-) create mode 100644 src/libs/Ideogram/Generated/Ideogram.AccountClient.AccountGetAccountApiKeys.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.AccountClient.AccountGetAccountInvoices.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.AccountClient.AccountGetAccountUsage.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.AccountClient.GetAccountApiKeys.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.AccountClient.GetAccountInvoices.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.AccountClient.GetAccountUsage.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.AssetReferenceUsage.JsonSerializerContext.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.AssetReferenceUsageClient.Authorizations.Bearer.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.AssetReferenceUsageClient.Constructors.Bearer.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.AssetReferenceUsageClient.GetAssetReferenceUsage.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.AssetReferenceUsageClient.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.AutoModelClient.AutoModelPostGenerateImageV2Auto.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.AutoModelClient.AutoModelPostToolRemix.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.AutoModelClient.PostGenerateImageV2Auto.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.AutoModelClient.PostToolRemix.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Batch.JsonSerializerContext.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.BatchClient.Authorizations.Bearer.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.BatchClient.Constructors.Bearer.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.BatchClient.GetMaybeBatchResults.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.BatchClient.PostBatch.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.BatchClient.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Datasets.JsonSerializerContext.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.DatasetsClient.Authorizations.Bearer.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.DatasetsClient.Constructors.Bearer.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.DatasetsClient.CreateDataset.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.DatasetsClient.GetDataset.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.DatasetsClient.ListDatasets.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.DatasetsClient.TrainDatasetModel.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.DatasetsClient.UploadDatasetAssets.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.DatasetsClient.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.DesignClient.DesignPostLayerizeDesignIdeogramV3.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.DesignClient.PostLayerizeDesignIdeogramV3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.EditWorkflowPostAdLocalizer.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.EditWorkflowPostAdResizer.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.EditWorkflowPostAdVariations.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.EditWorkflowPostColorways.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.EditWorkflowPostGhostMannequin.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.EditWorkflowPostMaterialSwap.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.EditWorkflowPostModelPoseVariants.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.EditWorkflowPostSketchToRender.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostAdLocalizer.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostAdResizer.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostAdVariations.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostColorways.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostGhostMannequin.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostLookbook.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostMaterialSwap.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostModelPoseVariants.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostModelSwap.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostPackshots.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostPreciseMaskedEdit.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostSkechersStyleEdit.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostSketchToRender.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostSoleSwap.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostSwanSLogoDesign.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostSwanSLogoInstall.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostSwapProduct.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostTextLayerizer.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostVectorizer.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostVirtualTryOn.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Generate.JsonSerializerContext.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.GenerateClient.Authorizations.Bearer.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.GenerateClient.Constructors.Bearer.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.GenerateClient.GetGeneration.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostEditImage.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateDesignV3.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateDesignV4.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateDesignV4AsBytes.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateDesignV4AsText.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateDesignV4Async.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImage.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageErnie.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageErnieAsync.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageFlux2Klein.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageFlux2KleinAsync.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageFlux2KleinBase.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageFlux2KleinBaseAsync.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImagePImageHigh.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImagePImageIdeogram.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImagePImageIdeogramAsync.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImagePImageLow.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImagePImageMedium.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImagePImageVeryLow.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageV3.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageV3Transparent.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageV4.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageV45.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageV45Async.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageV4Async.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageV4CfgDistilled.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageV4CfgDistilledAsync.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageV4Fp8.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageV4Im2Im.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageV4Im2ImAsync.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageV4Stable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageV4Transparent.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageV4TransparentAsync.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageZImage.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageZImageAsync.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostInpaintImageV3.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostLayerizeDesignV3.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostLayerizeLogos.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostLayerizeTextV3.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostReframeImage.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostReframeImageV3.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostRemixImage.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostRemixImageV3.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostRemixImageV4.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostRemixImageV4Async.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostRemoveBackground.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostRemoveObject.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostReplaceBackgroundV3.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostResizeImageAsync.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostSnapMask.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostTryOnV3.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostUpscaleImage.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostV1EditImage.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostV1EditLiteImage.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.GenerateClient.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.GenerationsClient.GenerationsGetGenerationV2.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.GenerationsClient.GetGenerationV2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IAccountClient.AccountGetAccountApiKeys.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IAccountClient.AccountGetAccountInvoices.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IAccountClient.AccountGetAccountUsage.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IAccountClient.GetAccountApiKeys.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IAccountClient.GetAccountInvoices.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IAccountClient.GetAccountUsage.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IAssetReferenceUsageClient.Authorizations.Bearer.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IAssetReferenceUsageClient.GetAssetReferenceUsage.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IAssetReferenceUsageClient.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IAutoModelClient.AutoModelPostGenerateImageV2Auto.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IAutoModelClient.AutoModelPostToolRemix.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IAutoModelClient.PostGenerateImageV2Auto.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IAutoModelClient.PostToolRemix.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IBatchClient.Authorizations.Bearer.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IBatchClient.GetMaybeBatchResults.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IBatchClient.PostBatch.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IBatchClient.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IDatasetsClient.Authorizations.Bearer.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IDatasetsClient.CreateDataset.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IDatasetsClient.GetDataset.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IDatasetsClient.ListDatasets.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IDatasetsClient.TrainDatasetModel.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IDatasetsClient.UploadDatasetAssets.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IDatasetsClient.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IDesignClient.DesignPostLayerizeDesignIdeogramV3.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IDesignClient.PostLayerizeDesignIdeogramV3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.EditWorkflowPostAdLocalizer.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.EditWorkflowPostAdResizer.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.EditWorkflowPostAdVariations.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.EditWorkflowPostColorways.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.EditWorkflowPostGhostMannequin.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.EditWorkflowPostMaterialSwap.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.EditWorkflowPostModelPoseVariants.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.EditWorkflowPostSketchToRender.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostAdLocalizer.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostAdResizer.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostAdVariations.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostColorways.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostGhostMannequin.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostLookbook.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostMaterialSwap.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostModelPoseVariants.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostModelSwap.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostPackshots.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostPreciseMaskedEdit.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostSkechersStyleEdit.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostSketchToRender.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostSoleSwap.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostSwanSLogoDesign.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostSwanSLogoInstall.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostSwapProduct.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostTextLayerizer.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostVectorizer.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostVirtualTryOn.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IGenerateClient.Authorizations.Bearer.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IGenerateClient.GetGeneration.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostEditImage.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateDesignV3.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateDesignV4.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateDesignV4AsBytes.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateDesignV4AsText.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateDesignV4Async.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImage.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageErnie.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageErnieAsync.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageFlux2Klein.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageFlux2KleinAsync.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageFlux2KleinBase.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageFlux2KleinBaseAsync.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImagePImageHigh.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImagePImageIdeogram.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImagePImageIdeogramAsync.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImagePImageLow.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImagePImageMedium.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImagePImageVeryLow.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageV3.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageV3Transparent.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageV4.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageV45.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageV45Async.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageV4Async.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageV4CfgDistilled.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageV4CfgDistilledAsync.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageV4Fp8.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageV4Im2Im.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageV4Im2ImAsync.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageV4Stable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageV4Transparent.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageV4TransparentAsync.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageZImage.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageZImageAsync.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostInpaintImageV3.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostLayerizeDesignV3.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostLayerizeLogos.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostLayerizeTextV3.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostReframeImage.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostReframeImageV3.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostRemixImage.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostRemixImageV3.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostRemixImageV4.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostRemixImageV4Async.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostRemoveBackground.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostRemoveObject.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostReplaceBackgroundV3.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostResizeImageAsync.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostSnapMask.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostTryOnV3.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostUpscaleImage.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostV1EditImage.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostV1EditLiteImage.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IGenerateClient.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IGenerationsClient.GenerationsGetGenerationV2.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IGenerationsClient.GetGenerationV2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IImageDescribeClient.ImageDescribePostDescribeImageIdeogramV3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IImageDescribeClient.ImageDescribePostDescribeImageIdeogramV4.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IImageDescribeClient.PostDescribeImageIdeogramV3.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IImageDescribeClient.PostDescribeImageIdeogramV4.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2GptImage2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2GptImage25Flare.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2GptImage25Sunburst.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2Ideogram45.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV2A.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV3Character.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModel.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV3Transparent.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV4.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModel.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV4Transparent.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2NanoBanana2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2NanoBanana21.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2NanoBananaPro.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2PImageIdeogram.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2ZImage.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2GptImage2.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2GptImage25Flare.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2GptImage25Sunburst.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2Ideogram45.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2IdeogramV2.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2IdeogramV2A.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2IdeogramV3.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2IdeogramV3Character.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2IdeogramV3CustomModel.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2IdeogramV3Transparent.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2IdeogramV4.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2IdeogramV4CustomModel.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2IdeogramV4Transparent.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2NanoBanana2.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2NanoBanana21.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2NanoBananaPro.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2PImageIdeogram.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2ZImage.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesInpaintClient.ImagesInpaintPostInpaintImageV2IdeogramV3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesInpaintClient.ImagesInpaintPostInpaintImageV2IdeogramV3Character.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesInpaintClient.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModel.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesInpaintClient.PostInpaintImageV2IdeogramV3.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesInpaintClient.PostInpaintImageV2IdeogramV3Character.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesInpaintClient.PostInpaintImageV2IdeogramV3CustomModel.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesPreciseEditClient.ImagesPreciseEditPostPreciseEditImageV2Ideogram45.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesPreciseEditClient.PostPreciseEditImageV2Ideogram45.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesReframeClient.Authorizations.Bearer.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesReframeClient.Auto.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesReframeClient.BriaExpand.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesReframeClient.GptImage25Flare.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesReframeClient.IdeogramV3.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesReframeClient.NanoBanana2.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesReframeClient.NanoBananaPro.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesReframeClient.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesRemixClient.ImagesRemixPostRemixImageV2IdeogramV3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesRemixClient.ImagesRemixPostRemixImageV2IdeogramV3Character.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesRemixClient.ImagesRemixPostRemixImageV2IdeogramV3CustomModel.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesRemixClient.ImagesRemixPostRemixImageV2IdeogramV4.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesRemixClient.PostRemixImageV2IdeogramV3.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesRemixClient.PostRemixImageV2IdeogramV3Character.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesRemixClient.PostRemixImageV2IdeogramV3CustomModel.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesRemixClient.PostRemixImageV2IdeogramV4.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesUpscaleClient.ImagesUpscalePostUpscaleImageNanoBananaPro.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesUpscaleClient.ImagesUpscalePostUpscaleImageTopazBloom2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesUpscaleClient.ImagesUpscalePostUpscaleImageTopazRedefine.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesUpscaleClient.ImagesUpscalePostUpscaleImageTopazStandardV2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesUpscaleClient.ImagesUpscalePostUpscaleImageTopazTextRefine.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesUpscaleClient.ImagesUpscalePostUpscaleImageTopazWonder35.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesUpscaleClient.PostUpscaleImageNanoBananaPro.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesUpscaleClient.PostUpscaleImageTopazBloom2.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesUpscaleClient.PostUpscaleImageTopazRedefine.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesUpscaleClient.PostUpscaleImageTopazStandardV2.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesUpscaleClient.PostUpscaleImageTopazTextRefine.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IImagesUpscaleClient.PostUpscaleImageTopazWonder35.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IIntegrationsClient.Authorizations.Bearer.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IIntegrationsClient.GetIntegrationAssetDelivery.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IIntegrationsClient.GetIntegrations.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IIntegrationsClient.PostIntegrationAssetsSearch.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IIntegrationsClient.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IInternalTestingClient.Authorizations.Bearer.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IInternalTestingClient.PostInternalTesting.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IInternalTestingClient.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IManageClient.AddOrganizationMembers.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IManageClient.Authorizations.Bearer.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IManageClient.CancelOrganizationInvite.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IManageClient.CreateApiKey.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IManageClient.CreateApiKeyV2.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IManageClient.CreateApiPayment.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IManageClient.DeactivateOrganizationApiKey.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IManageClient.DeleteSingleApiKey.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IManageClient.DemoteOrganizationAdmins.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IManageClient.GetApiCreditSummary.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IManageClient.GetApiKeys.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IManageClient.GetApiKeysV2.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IManageClient.GetApiOrganizationUserSuggestions.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IManageClient.GetApiProfiles.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IManageClient.GetApiStripeSubscription.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IManageClient.GetApiSubscription.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IManageClient.GetApiTerms.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IManageClient.GetOrganizationBillingPortal.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IManageClient.GetOrganizationMembers.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IManageClient.GetUsageInfo.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IManageClient.GetUserCredits.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IManageClient.GetUserSpendCommitInfo.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IManageClient.ListOrganizationInvoices.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IManageClient.PostAddCreditsForApi.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IManageClient.PostApiSubscription.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IManageClient.PostApiTerms.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IManageClient.PromoteOrganizationAdmins.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IManageClient.RemoveOrganizationMembers.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IManageClient.ResendOrganizationInvite.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IManageClient.UpdateOrganizationApiProperties.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IManageClient.UpdateSingleApiKey.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IManageClient.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IMiniAppsClient.Authorizations.Bearer.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IMiniAppsClient.GetMiniAppMarketingProjection.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IMiniAppsClient.GetStalePreviewMiniApps.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IMiniAppsClient.PublishMiniApp.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IMiniAppsClient.PublishPreviewMiniApp.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IMiniAppsClient.UnpublishMiniApp.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IMiniAppsClient.UnpublishPreviewMiniApp.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IMiniAppsClient.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IModelsClient.Authorizations.Bearer.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IModelsClient.GetCustomModel.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IModelsClient.ListCustomModels.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IModelsClient.TrainModelV3.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IModelsClient.TrainModelV3Advanced.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IModelsClient.TrainModelV4.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IModelsClient.TrainModelV4Advanced.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IModelsClient.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IObjectRemovalClient.ObjectRemovalPostRemoveObjectFromV2Assets.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IObjectRemovalClient.PostRemoveObjectFromV2Assets.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IPromptClient.Authorizations.Bearer.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IPromptClient.PostMagicPrompt.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IPromptClient.PostMagicPromptV4.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IPromptClient.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IProvenanceClient.Authorizations.Bearer.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IProvenanceClient.PostProvenanceVerify.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IProvenanceClient.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IReframeClient.Authorizations.Bearer.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IReframeClient.ReframeIdeogramV3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IReframeClient.ReframeNanoBanana2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IReframeClient.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IToolClient.RemoveBackground.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IToolClient.ReplaceBackground.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IToolClient.ReplaceBackgroundIdeogram45.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IToolClient.ReplaceBackgroundIdeogramV3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IToolClient.ToolRemoveBackground.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IToolClient.ToolReplaceBackground.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IToolClient.ToolReplaceBackgroundIdeogram45.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IToolClient.ToolReplaceBackgroundIdeogramV3.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IToolsClient.PostUpscale.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IToolsClient.ToolsPostUpscale.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IVideoEditClient.PostEditVideoMinimaxH3ReferenceToVideo.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IVideoEditClient.PostEditVideoSeedDance2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IVideoEditClient.VideoEditPostEditVideoMinimaxH3ReferenceToVideo.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.PostGenerateVideoKlingV3StandardImageToVideo.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.PostGenerateVideoKlingV3StandardTextToVideo.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.PostGenerateVideoMinimaxH3ImageToVideo.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.PostGenerateVideoMinimaxH3TextToVideo.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.PostGenerateVideoSeedDance25ImageToVideo.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.PostGenerateVideoSeedDance25ReferenceToVideo.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.PostGenerateVideoSeedDance25TextToVideo.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.PostGenerateVideoSeedDance2ImageToVideo.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.PostGenerateVideoSeedDance2ReferenceToVideo.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.PostGenerateVideoSeedDance2TextToVideo.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.PostLivingImage.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.PostProduct360Video.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideo.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideo.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideo.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.VideoGeneratePostGenerateVideoMinimaxH3TextToVideo.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.VideoGeneratePostGenerateVideoSeedDance25ImageToVideo.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideo.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.VideoGeneratePostGenerateVideoSeedDance25TextToVideo.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.VideoGeneratePostGenerateVideoSeedDance2ImageToVideo.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideo.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.VideoGeneratePostGenerateVideoSeedDance2TextToVideo.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IVisionClient.Authorizations.Bearer.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IVisionClient.PostDescribe.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IVisionClient.PostDescribeV4.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IVisionClient.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IWebhooksClient.Authorizations.Bearer.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IWebhooksClient.GetWebhookSigningJwks.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IWebhooksClient.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.ImageDescribeClient.ImageDescribePostDescribeImageIdeogramV3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.ImageDescribeClient.ImageDescribePostDescribeImageIdeogramV4.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ImageDescribeClient.PostDescribeImageIdeogramV3.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ImageDescribeClient.PostDescribeImageIdeogramV4.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2GptImage2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2GptImage25Flare.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2GptImage25Sunburst.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2Ideogram45.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV2A.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV3Character.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModel.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV3Transparent.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV4.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModel.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV4Transparent.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2NanoBanana2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2NanoBanana21.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2NanoBananaPro.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2PImageIdeogram.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2ZImage.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2GptImage2.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2GptImage25Flare.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2GptImage25Sunburst.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2Ideogram45.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2IdeogramV2.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2IdeogramV2A.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2IdeogramV3.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2IdeogramV3Character.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2IdeogramV3CustomModel.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2IdeogramV3Transparent.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2IdeogramV4.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2IdeogramV4CustomModel.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2IdeogramV4Transparent.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2NanoBanana2.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2NanoBanana21.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2NanoBananaPro.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2PImageIdeogram.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2ZImage.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesInpaintClient.ImagesInpaintPostInpaintImageV2IdeogramV3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesInpaintClient.ImagesInpaintPostInpaintImageV2IdeogramV3Character.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesInpaintClient.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModel.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesInpaintClient.PostInpaintImageV2IdeogramV3.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesInpaintClient.PostInpaintImageV2IdeogramV3Character.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesInpaintClient.PostInpaintImageV2IdeogramV3CustomModel.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesPreciseEditClient.ImagesPreciseEditPostPreciseEditImageV2Ideogram45.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesPreciseEditClient.PostPreciseEditImageV2Ideogram45.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesReframe.JsonSerializerContext.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesReframeClient.Authorizations.Bearer.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesReframeClient.Auto.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesReframeClient.BriaExpand.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesReframeClient.Constructors.Bearer.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesReframeClient.GptImage25Flare.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesReframeClient.IdeogramV3.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesReframeClient.NanoBanana2.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesReframeClient.NanoBananaPro.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesReframeClient.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesRemixClient.ImagesRemixPostRemixImageV2IdeogramV3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesRemixClient.ImagesRemixPostRemixImageV2IdeogramV3Character.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesRemixClient.ImagesRemixPostRemixImageV2IdeogramV3CustomModel.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesRemixClient.ImagesRemixPostRemixImageV2IdeogramV4.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesRemixClient.PostRemixImageV2IdeogramV3.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesRemixClient.PostRemixImageV2IdeogramV3Character.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesRemixClient.PostRemixImageV2IdeogramV3CustomModel.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesRemixClient.PostRemixImageV2IdeogramV4.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesUpscaleClient.ImagesUpscalePostUpscaleImageNanoBananaPro.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesUpscaleClient.ImagesUpscalePostUpscaleImageTopazBloom2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesUpscaleClient.ImagesUpscalePostUpscaleImageTopazRedefine.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesUpscaleClient.ImagesUpscalePostUpscaleImageTopazStandardV2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesUpscaleClient.ImagesUpscalePostUpscaleImageTopazTextRefine.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesUpscaleClient.ImagesUpscalePostUpscaleImageTopazWonder35.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesUpscaleClient.PostUpscaleImageNanoBananaPro.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesUpscaleClient.PostUpscaleImageTopazBloom2.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesUpscaleClient.PostUpscaleImageTopazRedefine.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesUpscaleClient.PostUpscaleImageTopazStandardV2.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesUpscaleClient.PostUpscaleImageTopazTextRefine.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ImagesUpscaleClient.PostUpscaleImageTopazWonder35.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Integrations.JsonSerializerContext.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IntegrationsClient.Authorizations.Bearer.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IntegrationsClient.Constructors.Bearer.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IntegrationsClient.GetIntegrationAssetDelivery.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IntegrationsClient.GetIntegrations.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IntegrationsClient.PostIntegrationAssetsSearch.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.IntegrationsClient.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.InternalTesting.JsonSerializerContext.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.InternalTestingClient.Authorizations.Bearer.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.InternalTestingClient.Constructors.Bearer.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.InternalTestingClient.PostInternalTesting.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.InternalTestingClient.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.AdLocalizerRequestLanguage.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.AdLocalizerRequestLanguageNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.AdResizerRequestPlatform.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.AdResizerRequestPlatformNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.AdResizerRequestResolution.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.AdResizerRequestResolutionNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.AdVariationsRequestVariationType.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.AdVariationsRequestVariationTypeNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.ApiKeyStatus.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.ApiKeyStatusNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.ApiProfileRole.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.ApiProfileRoleNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.ApiProfileType.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.ApiProfileTypeNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.AspectRatio.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.AspectRatioEditLite.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.AspectRatioEditLiteNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.AspectRatioNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.AspectRatioV4.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.AspectRatioV4Nullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.AttributeValueType.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.AttributeValueTypeNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.ColorPalettePresetName.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.ColorPalettePresetNameNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.ColorPaletteWithPresetNameOrMembers.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.DatasetAssetFailureReason.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.DatasetAssetFailureReasonNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.DatasetCoverAssetIdentifier.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.DescribeModelVersion.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.DescribeModelVersionNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.DetectedTextBlockFormattingItem.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.DetectedTextBlockFormattingItemNullable.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.DetectedTextBlockFormattingItems.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.DetectedTextBlockFormattingItemsNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateDesignRequestV4ArtifactGenerationModel.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateDesignRequestV4ArtifactGenerationModelNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateDesignRequestV4InspirationReferenceModel.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateDesignRequestV4InspirationReferenceModelNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateDesignRequestV4Layout2imageVariant.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateDesignRequestV4Layout2imageVariantNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateDesignRequestV4ResponseType.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateDesignRequestV4ResponseTypeNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageGptImage25FlareRequestBackground.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageGptImage25FlareRequestBackgroundNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageGptImage25FlareRequestQuality.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageGptImage25FlareRequestQualityNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageGptImage25SunburstRequestBackground.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageGptImage25SunburstRequestBackgroundNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageGptImage25SunburstRequestQuality.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageGptImage25SunburstRequestQualityNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageIdeogram45RequestBackground.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageIdeogram45RequestBackgroundNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageIdeogram45RequestQuality.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageIdeogram45RequestQualityNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageIdeogramV3CharacterRequestRenderingSpeed.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageIdeogramV3CharacterRequestRenderingSpeedNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageIdeogramV3CharacterRequestStyleType.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageIdeogramV3CharacterRequestStyleTypeNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageIdeogramV3CustomModelRequestRenderingSpeed.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageIdeogramV3CustomModelRequestRenderingSpeedNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageIdeogramV3RequestRenderingSpeed.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageIdeogramV3RequestRenderingSpeedNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageNanoBanana21RequestResolutionTier.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageNanoBanana21RequestResolutionTierNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageNanoBanana2RequestResolutionTier.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageNanoBanana2RequestResolutionTierNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageNanoBananaProRequestResolutionTier.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageNanoBananaProRequestResolutionTierNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageRequestV4StableVersion.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageRequestV4StableVersionNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageV2AutoRequestResolutionTier.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageV2AutoRequestResolutionTierNullable.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerationResponseDataInnerDiscriminatorMappingSvgGenerationMimeType.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerationResponseDataInnerDiscriminatorMappingSvgGenerationMimeTypeNullable.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerationResponseDataInnerVariant1ObjectType.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerationResponseDataInnerVariant1ObjectTypeNullable.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerationResponseDataInnerVariant2ObjectType.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerationResponseDataInnerVariant2ObjectTypeNullable.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerationResponseDataInnerVariant3ObjectType.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerationResponseDataInnerVariant3ObjectTypeNullable.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerationResponseDataInnerVariant4ObjectType.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerationResponseDataInnerVariant4ObjectTypeNullable.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerationResponseDataInnerVariant5ObjectType.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerationResponseDataInnerVariant5ObjectTypeNullable.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerationResponseDataInnerVariant6ObjectType.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerationResponseDataInnerVariant6ObjectTypeNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.GetAccountUsageBucketWidth.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.GetAccountUsageBucketWidthNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.GetAccountUsageSource.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.GetAccountUsageSourceNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.GhostMannequinRequestView.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.GhostMannequinRequestViewNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.ImageGenerationObjectObjectType.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.ImageGenerationObjectObjectTypeNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.ImageGenerationResponseV4ImageToImageResponseType.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.ImageGenerationResponseV4ImageToImageResponseTypeNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.ImageGenerationResponseV4LayoutResponseType.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.ImageGenerationResponseV4LayoutResponseTypeNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.ImageGenerationResponseV4ResponseType.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.ImageGenerationResponseV4ResponseTypeNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.ImageObjectWithoutPromptOrSeedObjectType.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.ImageObjectWithoutPromptOrSeedObjectTypeNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.InpaintImageIdeogramV3CharacterRequestRenderingSpeed.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.InpaintImageIdeogramV3CharacterRequestRenderingSpeedNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.InpaintImageIdeogramV3CharacterRequestStyleType.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.InpaintImageIdeogramV3CharacterRequestStyleTypeNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.InpaintImageIdeogramV3CustomModelRequestRenderingSpeed.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.InpaintImageIdeogramV3CustomModelRequestRenderingSpeedNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.InpaintImageIdeogramV3RequestRenderingSpeed.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.InpaintImageIdeogramV3RequestRenderingSpeedNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.IntegrationErrorResponseError.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.IntegrationErrorResponseErrorNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.IntegrationType.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.IntegrationTypeNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.InternalTestingEnumField.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.InternalTestingEnumFieldNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.InvoiceStatus.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.InvoiceStatusNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.LayeredImageGenerationResponseV3ResponseType.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.LayeredImageGenerationResponseV3ResponseTypeNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.LayerizedImageObjectObjectType.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.LayerizedImageObjectObjectTypeNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.LayerizedTextBlock.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.LayerizedTextBlockAlignment.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.LayerizedTextBlockAlignmentNullable.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.LayerizedTextBlockFormattingItems.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.LayerizedTextBlockFormattingItemsNullable.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.LayerizedTextBlockRole.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.LayerizedTextBlockRoleNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.ListCustomModelsScope.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.ListCustomModelsScopeNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.LivingImageQuality.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.LivingImageQualityNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.LookbookRequestCategory.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.LookbookRequestCategoryNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.MagicPromptOption.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.MagicPromptOptionNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.MagicPromptRequestMessagesInnerRole.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.MagicPromptRequestMessagesInnerRoleNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.MagicPromptVersionEnum.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.MagicPromptVersionEnumNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.MiniAppMarketingProjectionEntryEmbed.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.MiniAppMarketingProjectionEntryEmbedNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.ModelEnum.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.ModelEnumNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.ModelStatus.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.ModelStatusNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.ModelSwapQuality.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.ModelSwapQualityNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.ModelVersion.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.ModelVersionNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.NanoBananaProReframeAspectRatio.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.NanoBananaProReframeAspectRatioNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.OutputResolution.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.OutputResolutionNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.PImageResolution.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.PImageResolutionNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.PackshotView.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.PackshotViewNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.PackshotsQuality.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.PackshotsQualityNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.PostGenerateDesignV4200Response.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.PostGenerateDesignV4200ResponseDiscriminatorResponseType.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.PostGenerateDesignV4200ResponseDiscriminatorResponseTypeNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.PreciseEditImageIdeogram45RequestQuality.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.PreciseEditImageIdeogram45RequestQualityNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.PreciseMaskedEditModel.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.PreciseMaskedEditModelNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.PreciseMaskedEditQuality.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.PreciseMaskedEditQualityNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.PriceQualifier.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.PriceQualifierNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.PriceQuoteObject.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.PriceQuoteObjectNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.Product360VideoDirection.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.Product360VideoDirectionNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.ProvenanceVerifyResponseValidationState.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.ProvenanceVerifyResponseValidationStateNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.PublishMiniAppPreviewRequestEmbed.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.PublishMiniAppPreviewRequestEmbedNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.PublishMiniAppRequestEmbed.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.PublishMiniAppRequestEmbedNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.Quality.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.QualityNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.ReframeImageGptImage25FlareRequestQuality.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.ReframeImageGptImage25FlareRequestQualityNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.ReframeImageIdeogramV3RequestRenderingSpeed.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.ReframeImageIdeogramV3RequestRenderingSpeedNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.ReframeImageNanoBananaProRequestResolutionTier.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.ReframeImageNanoBananaProRequestResolutionTierNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.RemixImageIdeogramV3CharacterRequestRenderingSpeed.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.RemixImageIdeogramV3CharacterRequestRenderingSpeedNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.RemixImageIdeogramV3CharacterRequestStyleType.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.RemixImageIdeogramV3CharacterRequestStyleTypeNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.RemixImageIdeogramV3CustomModelRequestRenderingSpeed.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.RemixImageIdeogramV3CustomModelRequestRenderingSpeedNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.RemixImageIdeogramV3RequestRenderingSpeed.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.RemixImageIdeogramV3RequestRenderingSpeedNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.RemixImageIdeogramV4RequestRenderingSpeed.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.RemixImageIdeogramV4RequestRenderingSpeedNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.RenderingSpeed.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.RenderingSpeedNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.RenderingSpeedV4.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.RenderingSpeedV4Nullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.ReplaceBackgroundIdeogramV3RequestRenderingSpeed.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.ReplaceBackgroundIdeogramV3RequestRenderingSpeedNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.ResizeAdImageQuality.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.ResizeAdImageQualityNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.ResizeAdImageRequestResolution.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.ResizeAdImageRequestResolutionNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.Resolution.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.ResolutionNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.ResolutionV4ImageToImage.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.ResolutionV4ImageToImageNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.ResolutionV4Layout.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.ResolutionV4LayoutNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.SegmentBy.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.SegmentByNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.SkechersStyleEditQuality.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.SkechersStyleEditQualityNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.SkechersStyleEditRequestAspectRatio.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.SkechersStyleEditRequestAspectRatioNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.SkechersStyleEditRequestBaseGenerationSize.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.SkechersStyleEditRequestBaseGenerationSizeNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.SoleSwapQuality.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.SoleSwapQualityNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.SoleSwapRequestBaseGenerationSize.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.SoleSwapRequestBaseGenerationSizeNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.StylePresetV3.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.StylePresetV3Nullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.StyleType.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.StyleTypeNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.StyleTypeV3.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.StyleTypeV3Nullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.SvgGenerationObjectMimeType.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.SvgGenerationObjectMimeTypeNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.SvgGenerationObjectObjectType.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.SvgGenerationObjectObjectTypeNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.SwanSLogoDesignRequestDesignVariant.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.SwanSLogoDesignRequestDesignVariantNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.SwanSLogoDesignRequestLogoStyle.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.SwanSLogoDesignRequestLogoStyleNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.SwanSLogoDesignRequestSourceMode.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.SwanSLogoDesignRequestSourceModeNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.SwanSLogoInstallRequestLogoStyle.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.SwanSLogoInstallRequestLogoStyleNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.SwanSLogoQuality.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.SwanSLogoQualityNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.SwapProductMode.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.SwapProductModeNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.SwapProductQuality.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.SwapProductQualityNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.TextItemV3Alignment.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.TextItemV3AlignmentNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.TextItemV3GlyphType.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.TextItemV3GlyphTypeNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.TextItemV3StyleClass.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.TextItemV3StyleClassNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.TextItemV3TextTransform.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.TextItemV3TextTransformNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.TextItemV3VerticalAlignment.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.TextItemV3VerticalAlignmentNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.TextLayerizerResultObjectObjectType.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.TextLayerizerResultObjectObjectTypeNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.TextSpanV3FontFxItem.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.TextSpanV3FontFxItemNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.ToolRemixRequestResolutionTier.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.ToolRemixRequestResolutionTierNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.ToolType.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.ToolTypeNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.TrainingRunStatus.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.TrainingRunStatusNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.TransparencyOption.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.TransparencyOptionNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleFactor.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleFactorNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageNanoBananaProRequestResolutionTier.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageNanoBananaProRequestResolutionTierNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazBloom2RequestUpscaleFactor.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazBloom2RequestUpscaleFactorNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazRedefineRequestSubjectDetection.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazRedefineRequestSubjectDetectionNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazRedefineRequestUpscaleFactor.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazRedefineRequestUpscaleFactorNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazStandardV2RequestSubjectDetection.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazStandardV2RequestSubjectDetectionNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazStandardV2RequestUpscaleFactor.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazStandardV2RequestUpscaleFactorNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazTextRefineRequestSubjectDetection.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazTextRefineRequestSubjectDetectionNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazTextRefineRequestUpscaleFactor.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazTextRefineRequestUpscaleFactorNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazWonder35RequestEnhancementStrength.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazWonder35RequestEnhancementStrengthNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazWonder35RequestUpscaleFactor.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazWonder35RequestUpscaleFactorNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleToolRequestUpscaleFactor.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleToolRequestUpscaleFactorNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.UsageSource.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.UsageSourceNullable.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2AccountUsageGetParametersBucketWidth.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2AccountUsageGetParametersBucketWidthNullable.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2AccountUsageGetParametersSourcesSchemaItems.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2AccountUsageGetParametersSourcesSchemaItemsNullable.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTierNullable.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaBackground.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaBackgroundNullable.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaQuality.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaQualityNullable.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaBackground.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaBackgroundNullable.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaQuality.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaQualityNullable.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullable.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleTypeNullable.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullable.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullable.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaBackground.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaBackgroundNullable.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaQualityNullable.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateNanoBanana21PostRequestBodyContentMultipartFormDataSchemaResolutionTier.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateNanoBanana21PostRequestBodyContentMultipartFormDataSchemaResolutionTierNullable.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateNanoBanana2PostRequestBodyContentMultipartFormDataSchemaResolutionTier.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateNanoBanana2PostRequestBodyContentMultipartFormDataSchemaResolutionTierNullable.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTierNullable.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullable.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleTypeNullable.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageInpaintIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageInpaintIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullable.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageInpaintIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageInpaintIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullable.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImagePreciseEditIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImagePreciseEditIdeogram45PostRequestBodyContentMultipartFormDataSchemaQualityNullable.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageReframeIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageReframeIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullable.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageRemixAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageRemixAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTierNullable.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullable.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleTypeNullable.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageRemixIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageRemixIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullable.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageRemixIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageRemixIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullable.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageRemixIdeogram4PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageRemixIdeogram4PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullable.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageReplaceBackgroundIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageReplaceBackgroundIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullable.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleAutoPostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleAutoPostRequestBodyContentMultipartFormDataSchemaUpscaleFactorNullable.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTierNullable.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazBloom2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazBloom2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactorNullable.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetectionNullable.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactorNullable.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaSubjectDetection.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaSubjectDetectionNullable.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactorNullable.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetectionNullable.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactorNullable.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaEnhancementStrength.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaEnhancementStrengthNullable.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaUpscaleFactorNullable.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguageNullable.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaPlatform.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaPlatformNullable.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolutionNullable.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ToolAdVariationsPostRequestBodyContentMultipartFormDataSchemaVariationType.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ToolAdVariationsPostRequestBodyContentMultipartFormDataSchemaVariationTypeNullable.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ToolGhostMannequinPostRequestBodyContentMultipartFormDataSchemaView.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ToolGhostMannequinPostRequestBodyContentMultipartFormDataSchemaViewNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.VectorizerRequestMode.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.VectorizerRequestModeNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.VideoObjectObjectType.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.JsonConverters.VideoObjectObjectTypeNullable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Manage.JsonSerializerContext.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ManageClient.AddOrganizationMembers.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ManageClient.Authorizations.Bearer.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ManageClient.CancelOrganizationInvite.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ManageClient.Constructors.Bearer.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ManageClient.CreateApiKey.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ManageClient.CreateApiKeyV2.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ManageClient.CreateApiPayment.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ManageClient.DeactivateOrganizationApiKey.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ManageClient.DeleteSingleApiKey.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ManageClient.DemoteOrganizationAdmins.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ManageClient.GetApiCreditSummary.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ManageClient.GetApiKeys.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ManageClient.GetApiKeysV2.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ManageClient.GetApiOrganizationUserSuggestions.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ManageClient.GetApiProfiles.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ManageClient.GetApiStripeSubscription.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ManageClient.GetApiSubscription.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ManageClient.GetApiTerms.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ManageClient.GetOrganizationBillingPortal.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ManageClient.GetOrganizationMembers.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ManageClient.GetUsageInfo.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ManageClient.GetUserCredits.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ManageClient.GetUserSpendCommitInfo.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ManageClient.ListOrganizationInvoices.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ManageClient.PostAddCreditsForApi.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ManageClient.PostApiSubscription.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ManageClient.PostApiTerms.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ManageClient.PromoteOrganizationAdmins.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ManageClient.RemoveOrganizationMembers.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ManageClient.ResendOrganizationInvite.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ManageClient.UpdateOrganizationApiProperties.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ManageClient.UpdateSingleApiKey.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ManageClient.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.MiniApps.JsonSerializerContext.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.MiniAppsClient.Authorizations.Bearer.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.MiniAppsClient.Constructors.Bearer.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.MiniAppsClient.GetMiniAppMarketingProjection.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.MiniAppsClient.GetStalePreviewMiniApps.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.MiniAppsClient.PublishMiniApp.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.MiniAppsClient.PublishPreviewMiniApp.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.MiniAppsClient.UnpublishMiniApp.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.MiniAppsClient.UnpublishPreviewMiniApp.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.MiniAppsClient.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.AccountGetAccountApiKeysResponse.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.AccountGetAccountApiKeysResponse.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.AccountGetAccountApiKeysResponse2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.AccountGetAccountApiKeysResponse2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.AccountGetAccountInvoicesResponse.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.AccountGetAccountInvoicesResponse.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.AccountGetAccountInvoicesResponse2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.AccountGetAccountInvoicesResponse2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.AccountGetAccountUsageResponse.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.AccountGetAccountUsageResponse.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.AccountGetAccountUsageResponse2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.AccountGetAccountUsageResponse2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.AccountGetAccountUsageResponse3.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.AccountGetAccountUsageResponse3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.AccountGetAccountUsageResponse4.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.AccountGetAccountUsageResponse4.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.AdLocalizerRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.AdLocalizerRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.AdLocalizerRequestLanguage.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.AdResizerRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.AdResizerRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.AdResizerRequestPlatform.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.AdResizerRequestResolution.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.AdVariationsRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.AdVariationsRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.AdVariationsRequestVariationType.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.AddOrganizationMembersRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.AddOrganizationMembersRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ApiKeyStatus.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ApiOrganizationUserSuggestion.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ApiOrganizationUserSuggestion.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ApiProfile.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ApiProfile.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ApiProfileApiKey.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ApiProfileApiKey.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ApiProfileRole.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ApiProfileType.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ApiTerms.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ApiTerms.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.AspectRatio.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.AspectRatioEditLite.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.AspectRatioV4.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.AssetReferenceUsageItem.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.AssetReferenceUsageItem.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.AssetReferenceUsageResponse.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.AssetReferenceUsageResponse.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.AsyncImageGenerationResponseV4.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.AsyncImageGenerationResponseV4.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.AttributeInfo.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.AttributeInfo.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.AttributeValueType.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostGenerateImageV2AutoRequest.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostGenerateImageV2AutoRequest.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostGenerateImageV2AutoResponse.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostGenerateImageV2AutoResponse.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostGenerateImageV2AutoResponse2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostGenerateImageV2AutoResponse2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostGenerateImageV2AutoResponse3.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostGenerateImageV2AutoResponse3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostGenerateImageV2AutoResponse4.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostGenerateImageV2AutoResponse4.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostGenerateImageV2AutoResponse5.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostGenerateImageV2AutoResponse5.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostGenerateImageV2AutoResponse6.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostGenerateImageV2AutoResponse6.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostToolRemixRequest.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostToolRemixRequest.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostToolRemixResponse.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostToolRemixResponse.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostToolRemixResponse2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostToolRemixResponse2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostToolRemixResponse3.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostToolRemixResponse3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostToolRemixResponse4.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostToolRemixResponse4.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostToolRemixResponse5.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostToolRemixResponse5.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostToolRemixResponse6.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostToolRemixResponse6.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.CancelOrganizationInviteRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.CancelOrganizationInviteRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ColorPalettePresetName.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ColorPaletteWithPresetName.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ColorPaletteWithPresetName.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ColorPaletteWithPresetNameOrMembers.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ColorPaletteWithPresetNameOrMembers.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ColorwaysRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ColorwaysRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.CreateApiKeyRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.CreateApiKeyRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.CreateApiKeyResponse.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.CreateApiKeyResponse.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.CreateDatasetRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.CreateDatasetRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.CreditGrant.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.CreditGrant.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.CustomModel.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.CustomModel.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.Dataset.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.Dataset.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.DatasetAssetFailureReason.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.DatasetCoverAssetIdentifier.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.DatasetCoverAssetIdentifier.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.DatasetFile.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.DatasetFile.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.DatasetUploadFailedAsset.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.DatasetUploadFailedAsset.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.DatasetUploadSucceededAsset.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.DatasetUploadSucceededAsset.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.DemoteOrganizationAdminsRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.DemoteOrganizationAdminsRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.DescribeImageIdeogramV3Request.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.DescribeImageIdeogramV3Request.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.DescribeImageIdeogramV4Request.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.DescribeImageIdeogramV4Request.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.DescribeModelVersion.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.DescribeRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.DescribeRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.DescribeRequestV4.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.DescribeRequestV4.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.DescribeResponse.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.DescribeResponse.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.DescribeResponseV4.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.DescribeResponseV4.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.Description.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.Description.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.DesignPostLayerizeDesignIdeogramV3Request.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.DesignPostLayerizeDesignIdeogramV3Request.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.DesignPostLayerizeDesignIdeogramV3Response.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.DesignPostLayerizeDesignIdeogramV3Response.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.DesignPostLayerizeDesignIdeogramV3Response2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.DesignPostLayerizeDesignIdeogramV3Response2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.DesignPostLayerizeDesignIdeogramV3Response3.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.DesignPostLayerizeDesignIdeogramV3Response3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.DesignPostLayerizeDesignIdeogramV3Response4.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.DesignPostLayerizeDesignIdeogramV3Response4.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.DesignPostLayerizeDesignIdeogramV3Response5.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.DesignPostLayerizeDesignIdeogramV3Response5.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.DesignPostLayerizeDesignIdeogramV3Response6.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.DesignPostLayerizeDesignIdeogramV3Response6.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.DetectedTextBlockFormattingItem.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.DetectedTextBlockFormattingItems.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditImageRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditImageRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditImageRequestV3.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditImageRequestV3.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditVideoMinimaxH3ReferenceToVideoRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditVideoMinimaxH3ReferenceToVideoRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditVideoSeedDance2Request.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditVideoSeedDance2Request.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdLocalizerRequest.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdLocalizerRequest.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdLocalizerResponse.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdLocalizerResponse.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdLocalizerResponse2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdLocalizerResponse2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdLocalizerResponse3.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdLocalizerResponse3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdLocalizerResponse4.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdLocalizerResponse4.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdLocalizerResponse5.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdLocalizerResponse5.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdResizerRequest.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdResizerRequest.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdResizerResponse.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdResizerResponse.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdResizerResponse2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdResizerResponse2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdResizerResponse3.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdResizerResponse3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdResizerResponse4.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdResizerResponse4.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdResizerResponse5.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdResizerResponse5.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdVariationsRequest.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdVariationsRequest.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdVariationsResponse.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdVariationsResponse.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdVariationsResponse2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdVariationsResponse2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdVariationsResponse3.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdVariationsResponse3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdVariationsResponse4.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdVariationsResponse4.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdVariationsResponse5.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdVariationsResponse5.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostColorwaysRequest.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostColorwaysRequest.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostColorwaysResponse.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostColorwaysResponse.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostColorwaysResponse2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostColorwaysResponse2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostColorwaysResponse3.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostColorwaysResponse3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostGhostMannequinRequest.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostGhostMannequinRequest.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostGhostMannequinResponse.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostGhostMannequinResponse.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostGhostMannequinResponse2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostGhostMannequinResponse2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostGhostMannequinResponse3.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostGhostMannequinResponse3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostGhostMannequinResponse4.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostGhostMannequinResponse4.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostGhostMannequinResponse5.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostGhostMannequinResponse5.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostGhostMannequinResponse6.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostGhostMannequinResponse6.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostMaterialSwapRequest.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostMaterialSwapRequest.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostMaterialSwapResponse.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostMaterialSwapResponse.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostMaterialSwapResponse2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostMaterialSwapResponse2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostMaterialSwapResponse3.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostMaterialSwapResponse3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostModelPoseVariantsRequest.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostModelPoseVariantsRequest.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostModelPoseVariantsResponse.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostModelPoseVariantsResponse.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostModelPoseVariantsResponse2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostModelPoseVariantsResponse2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostModelPoseVariantsResponse3.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostModelPoseVariantsResponse3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostModelPoseVariantsResponse4.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostModelPoseVariantsResponse4.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostModelPoseVariantsResponse5.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostModelPoseVariantsResponse5.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostSketchToRenderRequest.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostSketchToRenderRequest.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostSketchToRenderResponse.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostSketchToRenderResponse.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostSketchToRenderResponse2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostSketchToRenderResponse2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostSketchToRenderResponse3.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostSketchToRenderResponse3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostSketchToRenderResponse4.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostSketchToRenderResponse4.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostSketchToRenderResponse5.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostSketchToRenderResponse5.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateDesignRequestV3.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateDesignRequestV3.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateDesignRequestV4.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateDesignRequestV4.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateDesignRequestV4ArtifactGenerationModel.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateDesignRequestV4InspirationReferenceModel.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateDesignRequestV4Layout2imageVariant.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateDesignRequestV4ResponseType.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateGraphicRequestV3.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateGraphicRequestV3.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageGptImage25FlareRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageGptImage25FlareRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageGptImage25FlareRequestBackground.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageGptImage25FlareRequestQuality.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageGptImage25SunburstRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageGptImage25SunburstRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageGptImage25SunburstRequestBackground.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageGptImage25SunburstRequestQuality.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageGptImage2Request.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageGptImage2Request.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogram45Request.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogram45Request.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogram45RequestBackground.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogram45RequestQuality.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV3CharacterRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV3CharacterRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV3CharacterRequestRenderingSpeed.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV3CharacterRequestStyleType.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV3CustomModelRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV3CustomModelRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV3CustomModelRequestRenderingSpeed.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV3Request.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV3Request.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV3RequestRenderingSpeed.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageNanoBanana21Request.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageNanoBanana21Request.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageNanoBanana21RequestResolutionTier.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageNanoBanana2Request.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageNanoBanana2Request.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageNanoBanana2RequestResolutionTier.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageNanoBananaProRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageNanoBananaProRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageNanoBananaProRequestResolutionTier.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestErnie.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestErnie.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestFlux2Klein.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestFlux2Klein.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestFlux2KleinBase.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestFlux2KleinBase.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestPImage.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestPImage.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestPImageIdeogram.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestPImageIdeogram.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestV3.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestV3.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestV4.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestV4.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestV4CfgDistilled.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestV4CfgDistilled.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestV4Fp8.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestV4Fp8.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestV4Im2Im.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestV4Im2Im.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestV4Stable.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestV4Stable.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestV4StableVersion.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestZImage.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestZImage.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageResponse.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageResponse.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageSafetyError.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageSafetyError.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageV2AutoRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageV2AutoRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageV2AutoRequestResolutionTier.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateTransparentImageRequestV3.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateTransparentImageRequestV3.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateTransparentImageRequestV4.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateTransparentImageRequestV4.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoKlingV3StandardImageToVideoRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoKlingV3StandardImageToVideoRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoMinimaxH3ImageToVideoRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoMinimaxH3ImageToVideoRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoSeedDance25ImageToVideoRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoSeedDance25ImageToVideoRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoSeedDance25ReferenceToVideoRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoSeedDance25ReferenceToVideoRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoSeedDance2ImageToVideoRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoSeedDance2ImageToVideoRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoSeedDance2ReferenceToVideoRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoSeedDance2ReferenceToVideoRequest.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerDiscriminatorMappingSvgGenerationMimeType.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant1.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant1.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant1ObjectType.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant2ObjectType.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant3.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant3ObjectType.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant4.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant4.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant4ObjectType.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant5.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant5.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant5ObjectType.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant6.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant6.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant6ObjectType.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerationsGetGenerationV2Response.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerationsGetGenerationV2Response.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerationsGetGenerationV2Response2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerationsGetGenerationV2Response2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerationsGetGenerationV2Response3.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerationsGetGenerationV2Response3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerationsGetGenerationV2Response4.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GenerationsGetGenerationV2Response4.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GetAccountUsageBucketWidth.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GetAccountUsageSource.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GetApiKeysResponse.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GetApiKeysResponse.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GetApiKeysV2Response.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GetApiKeysV2Response.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GetApiOrganizationUserSuggestionsResponse.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GetApiOrganizationUserSuggestionsResponse.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GetApiProfilesResponse.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GetApiProfilesResponse.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GetApiTermsResponse.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GetApiTermsResponse.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GetDatasetResponse.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GetDatasetResponse.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GetIntegrationsResponse.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GetIntegrationsResponse.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GetModelResponse.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GetModelResponse.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GetOrganizationBillingPortalResponse.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GetOrganizationBillingPortalResponse.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GetOrganizationMembersResponse.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GetOrganizationMembersResponse.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GetStaleMiniAppPreviewsResponse.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GetStaleMiniAppPreviewsResponse.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GetUsageInfoResponse.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GetUsageInfoResponse.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GetUserCreditsResponse.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GetUserCreditsResponse.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GhostMannequinRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GhostMannequinRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.GhostMannequinRequestView.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV3Request.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV3Request.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV3Response.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV3Response.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV3Response2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV3Response2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV3Response3.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV3Response3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV3Response4.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV3Response4.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV3Response5.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV3Response5.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV4Request.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV4Request.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV4Response.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV4Response.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV4Response2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV4Response2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV4Response3.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV4Response3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV4Response4.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV4Response4.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV4Response5.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV4Response5.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationObject.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationObject.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationObjectObjectType.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationObjectV3.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationObjectV3.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationObjectV4.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationObjectV4.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationObjectV4ImageToImage.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationObjectV4ImageToImage.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationObjectV4Layout.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationObjectV4Layout.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationResponse.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationResponse.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationResponseV3.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationResponseV3.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationResponseV4.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationResponseV4.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationResponseV4ImageToImage.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationResponseV4ImageToImage.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationResponseV4ImageToImageResponseType.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationResponseV4Layout.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationResponseV4Layout.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationResponseV4LayoutResponseType.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationResponseV4ResponseType.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImageLayerV3.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImageLayerV3.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImageObject.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImageObject.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImageObjectWithoutPromptOrSeed.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImageObjectWithoutPromptOrSeed.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImageObjectWithoutPromptOrSeedObjectType.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImageRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImageRequest.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25FlareRequest.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25FlareRequest.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse3.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse4.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse4.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse5.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse5.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25SunburstRequest.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25SunburstRequest.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse3.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse4.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse4.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse5.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse5.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage2Request.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage2Request.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage2Response.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage2Response.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage2Response2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage2Response2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage2Response3.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage2Response3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage2Response4.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage2Response4.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage2Response5.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage2Response5.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2Ideogram45Request.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2Ideogram45Request.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2Ideogram45Response.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2Ideogram45Response.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2Ideogram45Response2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2Ideogram45Response2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2Ideogram45Response3.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2Ideogram45Response3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2Ideogram45Response4.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2Ideogram45Response4.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2Ideogram45Response5.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2Ideogram45Response5.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse3.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse4.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse4.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse5.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse5.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2Response.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2Response.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2Response2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2Response2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2Response3.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2Response3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2Response4.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2Response4.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2Response5.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2Response5.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterRequest.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterRequest.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse3.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse4.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse4.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse5.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse5.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse6.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse6.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelRequest.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelRequest.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse3.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse4.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse4.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse5.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse5.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse6.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse6.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse7.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse7.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3Request.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3Request.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3Response.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3Response.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3Response2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3Response2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3Response3.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3Response3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3Response4.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3Response4.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3Response5.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3Response5.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3Response6.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3Response6.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse3.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse4.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse4.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse5.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse5.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse3.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse4.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse4.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse5.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse5.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse6.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse6.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4Response.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4Response.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4Response2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4Response2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4Response3.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4Response3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4Response4.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4Response4.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4Response5.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4Response5.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse3.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse4.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse4.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse5.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse5.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana21Request.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana21Request.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana21Response.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana21Response.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana21Response2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana21Response2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana21Response3.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana21Response3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana21Response4.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana21Response4.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana21Response5.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana21Response5.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana2Request.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana2Request.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana2Response.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana2Response.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana2Response2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana2Response2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana2Response3.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana2Response3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana2Response4.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana2Response4.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana2Response5.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana2Response5.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBananaProRequest.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBananaProRequest.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBananaProResponse.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBananaProResponse.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBananaProResponse2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBananaProResponse2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBananaProResponse3.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBananaProResponse3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBananaProResponse4.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBananaProResponse4.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBananaProResponse5.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBananaProResponse5.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse3.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse4.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse4.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse5.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse5.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2ZImageResponse.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2ZImageResponse.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2ZImageResponse2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2ZImageResponse2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2ZImageResponse3.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2ZImageResponse3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2ZImageResponse4.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2ZImageResponse4.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2ZImageResponse5.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2ZImageResponse5.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterRequest.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterRequest.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse3.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse4.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse4.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse5.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse5.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse6.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse6.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelRequest.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelRequest.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse3.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse4.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse4.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse5.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse5.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse6.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse6.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse7.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse7.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3Request.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3Request.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3Response.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3Response.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3Response2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3Response2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3Response3.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3Response3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3Response4.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3Response4.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3Response5.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3Response5.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3Response6.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3Response6.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Request.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Request.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response3.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response4.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response4.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response5.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response5.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CharacterRequest.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CharacterRequest.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse3.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse4.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse4.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse5.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse5.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse6.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse6.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CustomModelRequest.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CustomModelRequest.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse3.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse4.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse4.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse5.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse5.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse6.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse6.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse7.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse7.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3Request.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3Request.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3Response.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3Response.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3Response2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3Response2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3Response3.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3Response3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3Response4.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3Response4.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3Response5.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3Response5.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3Response6.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3Response6.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV4Request.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV4Request.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV4Response.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV4Response.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV4Response2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV4Response2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV4Response3.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV4Response3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV4Response4.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV4Response4.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV4Response5.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV4Response5.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV4Response6.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV4Response6.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageNanoBananaProRequest.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageNanoBananaProRequest.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageNanoBananaProResponse.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageNanoBananaProResponse.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageNanoBananaProResponse2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageNanoBananaProResponse2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageNanoBananaProResponse3.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageNanoBananaProResponse3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageNanoBananaProResponse4.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageNanoBananaProResponse4.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageNanoBananaProResponse5.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageNanoBananaProResponse5.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageNanoBananaProResponse6.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageNanoBananaProResponse6.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazBloom2Request.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazBloom2Request.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazBloom2Response.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazBloom2Response.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazBloom2Response2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazBloom2Response2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazBloom2Response3.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazBloom2Response3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazBloom2Response4.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazBloom2Response4.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazBloom2Response5.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazBloom2Response5.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazBloom2Response6.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazBloom2Response6.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazRedefineRequest.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazRedefineRequest.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazRedefineResponse.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazRedefineResponse.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazRedefineResponse2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazRedefineResponse2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazRedefineResponse3.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazRedefineResponse3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazRedefineResponse4.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazRedefineResponse4.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazRedefineResponse5.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazRedefineResponse5.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazRedefineResponse6.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazRedefineResponse6.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazStandardV2Request.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazStandardV2Request.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazStandardV2Response.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazStandardV2Response.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazStandardV2Response2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazStandardV2Response2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazStandardV2Response3.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazStandardV2Response3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazStandardV2Response4.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazStandardV2Response4.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazStandardV2Response5.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazStandardV2Response5.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazTextRefineRequest.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazTextRefineRequest.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazTextRefineResponse.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazTextRefineResponse.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazTextRefineResponse2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazTextRefineResponse2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazTextRefineResponse3.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazTextRefineResponse3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazTextRefineResponse4.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazTextRefineResponse4.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazTextRefineResponse5.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazTextRefineResponse5.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazWonder35Request.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazWonder35Request.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazWonder35Response.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazWonder35Response.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazWonder35Response2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazWonder35Response2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazWonder35Response3.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazWonder35Response3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazWonder35Response4.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazWonder35Response4.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazWonder35Response5.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazWonder35Response5.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.InitialImageRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.InitialImageRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.InpaintImageIdeogramV3CharacterRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.InpaintImageIdeogramV3CharacterRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.InpaintImageIdeogramV3CharacterRequestRenderingSpeed.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.InpaintImageIdeogramV3CharacterRequestStyleType.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.InpaintImageIdeogramV3CustomModelRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.InpaintImageIdeogramV3CustomModelRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.InpaintImageIdeogramV3CustomModelRequestRenderingSpeed.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.InpaintImageIdeogramV3Request.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.InpaintImageIdeogramV3Request.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.InpaintImageIdeogramV3RequestRenderingSpeed.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.IntegrationAsset.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.IntegrationAsset.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.IntegrationAssetDelivery.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.IntegrationAssetDelivery.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.IntegrationAssetMetadata.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.IntegrationAssetMetadata.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.IntegrationAssetSearchRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.IntegrationAssetSearchRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.IntegrationAssetSearchResponse.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.IntegrationAssetSearchResponse.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.IntegrationErrorResponse.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.IntegrationErrorResponse.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.IntegrationErrorResponseError.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.IntegrationType.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.InternalBatchRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.InternalBatchRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.InternalBatchResponse.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.InternalBatchResponse.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.InternalBatchResultsResponse.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.InternalBatchResultsResponse.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.InternalBatchResultsResponseResultsInner.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.InternalBatchResultsResponseResultsInner.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.InternalTestingEnumField.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.InternalTestingNestedObject.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.InternalTestingNestedObject.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.InternalTestingNestedObjectRequiredFields.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.InternalTestingNestedObjectRequiredFields.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.InternalTestingRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.InternalTestingRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.Invoice.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.Invoice.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.InvoiceLineItem.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.InvoiceLineItem.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.InvoiceStatus.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.JsonSerializerContext.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.LayeredAssetTextShadow.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.LayeredAssetTextShadow.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.LayeredImageGenerationObjectV3.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.LayeredImageGenerationObjectV3.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.LayeredImageGenerationResponseV3.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.LayeredImageGenerationResponseV3.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.LayeredImageGenerationResponseV3ResponseType.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.LayerizeDesignIdeogramV3Request.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.LayerizeDesignIdeogramV3Request.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.LayerizeDesignRequestV3.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.LayerizeDesignRequestV3.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.LayerizeLogosRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.LayerizeLogosRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.LayerizeLogosResponse.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.LayerizeLogosResponse.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.LayerizeTextRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.LayerizeTextRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.LayerizeTextResponse.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.LayerizeTextResponse.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.LayerizedImageObjectObjectType.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.LayerizedTextBlockAlignment.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.LayerizedTextBlockFormattingItems.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.LayerizedTextBlockRole.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.LayerizedTextBlockVariant2.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.LayerizedTextBlockVariant2.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ListCustomModelsScope.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ListDatasetsResponse.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ListDatasetsResponse.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ListModelsResponse.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ListModelsResponse.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ListOrganizationInvoicesResponse.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ListOrganizationInvoicesResponse.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.LiteOrganizationMember.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.LiteOrganizationMember.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.LivingImageQuality.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.LivingImageRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.LivingImageRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.LivingImageResponse.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.LivingImageResponse.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.LookbookRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.LookbookRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.LookbookRequestCategory.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.LookbookResponse.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.LookbookResponse.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.MagicPromptOption.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.MagicPromptRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.MagicPromptRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.MagicPromptRequestMessagesInner.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.MagicPromptRequestMessagesInner.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.MagicPromptRequestMessagesInnerRole.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.MagicPromptResponse.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.MagicPromptResponse.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.MagicPromptV4Request.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.MagicPromptV4Request.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.MagicPromptV4Response.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.MagicPromptV4Response.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.MagicPromptVersionEnum.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ManageApiCreditSummaryResponse.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ManageApiCreditSummaryResponse.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ManageApiPaymentResponse.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ManageApiPaymentResponse.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ManageApiStripeSubscriptionResponse.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ManageApiStripeSubscriptionResponse.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ManageApiSubscriptionResponse.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ManageApiSubscriptionResponse.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.MaterialSwapRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.MaterialSwapRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.MetronomeLinks.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.MetronomeLinks.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.MiniAppArtwork.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.MiniAppArtwork.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.MiniAppMarketingProjectionEntry.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.MiniAppMarketingProjectionEntry.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.MiniAppMarketingProjectionEntryEmbed.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.MiniAppMarketingProjectionEntryWebsite.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.MiniAppMarketingProjectionEntryWebsite.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ModelEnum.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ModelPoseVariantsRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ModelPoseVariantsRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ModelStatus.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ModelSwapQuality.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ModelSwapRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ModelSwapRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ModelSwapResponse.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ModelSwapResponse.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ModelVersion.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.NanoBananaProReframeAspectRatio.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ObjectRemovalPostRemoveObjectFromV2AssetsRequest.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ObjectRemovalPostRemoveObjectFromV2AssetsRequest.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ObjectRemovalPostRemoveObjectFromV2AssetsResponse.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ObjectRemovalPostRemoveObjectFromV2AssetsResponse.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ObjectRemovalPostRemoveObjectFromV2AssetsResponse2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ObjectRemovalPostRemoveObjectFromV2AssetsResponse2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ObjectRemovalPostRemoveObjectFromV2AssetsResponse3.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ObjectRemovalPostRemoveObjectFromV2AssetsResponse3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ObjectRemovalPostRemoveObjectFromV2AssetsResponse4.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ObjectRemovalPostRemoveObjectFromV2AssetsResponse4.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ObjectRemovalPostRemoveObjectFromV2AssetsResponse5.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ObjectRemovalPostRemoveObjectFromV2AssetsResponse5.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ObjectRemovalPostRemoveObjectFromV2AssetsResponse6.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ObjectRemovalPostRemoveObjectFromV2AssetsResponse6.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.OrganizationMember.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.OrganizationMember.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.OrganizationMemberOperationResponse.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.OrganizationMemberOperationResponse.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.OrganizationMemberOperationResult.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.OrganizationMemberOperationResult.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.OutputResolution.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.PImageResolution.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.PackshotView.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.PackshotsQuality.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.PackshotsRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.PackshotsRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.PackshotsResponse.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.PackshotsResponse.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.PatchApiKeyRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.PatchApiKeyRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.PostAddCreditsError.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.PostAddCreditsError.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.PostAddCreditsRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.PostAddCreditsRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.PostAddCreditsResponse.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.PostAddCreditsResponse.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.PostApiKeyResponse.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.PostApiKeyResponse.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.PostApiSubscriptionError.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.PostApiSubscriptionError.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.PostApiSubscriptionRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.PostApiSubscriptionRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.PostApiSubscriptionResponse.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.PostApiSubscriptionResponse.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.PostApiTermsRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.PostApiTermsRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.PostGenerateDesignV4200Response.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.PostGenerateDesignV4200Response.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.PostGenerateDesignV4200ResponseDiscriminator.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.PostGenerateDesignV4200ResponseDiscriminator.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.PostGenerateDesignV4200ResponseDiscriminatorResponseType.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.PostInternalTesting200Response.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.PostInternalTesting200Response.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.PreciseEditImageIdeogram45Request.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.PreciseEditImageIdeogram45Request.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.PreciseEditImageIdeogram45RequestQuality.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.PreciseMaskedEditModel.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.PreciseMaskedEditQuality.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.PreciseMaskedEditRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.PreciseMaskedEditRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.PreciseMaskedEditResponse.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.PreciseMaskedEditResponse.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.Price.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.Price.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.PriceQualifier.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.PriceQuote.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.PriceQuote.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.PriceQuoteObject.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.Product360VideoDirection.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.Product360VideoRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.Product360VideoRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.PromoteOrganizationAdminsRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.PromoteOrganizationAdminsRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ProvenanceVerifyRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ProvenanceVerifyRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ProvenanceVerifyResponse.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ProvenanceVerifyResponse.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ProvenanceVerifyResponseValidationState.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.PublishMiniAppPreviewRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.PublishMiniAppPreviewRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.PublishMiniAppPreviewRequestEmbed.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.PublishMiniAppPreviewRequestWebsite.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.PublishMiniAppPreviewRequestWebsite.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.PublishMiniAppPreviewResponse.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.PublishMiniAppPreviewResponse.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.PublishMiniAppRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.PublishMiniAppRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.PublishMiniAppRequestEmbed.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.PublishMiniAppRequestWebsite.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.PublishMiniAppRequestWebsite.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.PublishMiniAppResponse.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.PublishMiniAppResponse.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.Quality.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.RechargeSettings.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.RechargeSettings.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.RechargeSettingsResponse.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.RechargeSettingsResponse.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.RedactedApiKey.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.RedactedApiKey.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ReframeIdeogramV3Request.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ReframeIdeogramV3Request.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ReframeIdeogramV3Response.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ReframeIdeogramV3Response.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ReframeIdeogramV3Response2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ReframeIdeogramV3Response2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ReframeIdeogramV3Response3.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ReframeIdeogramV3Response3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ReframeIdeogramV3Response4.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ReframeIdeogramV3Response4.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ReframeIdeogramV3Response5.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ReframeIdeogramV3Response5.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageAutoRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageAutoRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageAutoResponse.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageAutoResponse.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageBriaExpandRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageBriaExpandRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageBriaExpandResponse.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageBriaExpandResponse.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageGptImage25FlareRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageGptImage25FlareRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageGptImage25FlareRequestQuality.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageGptImage25FlareResponse.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageGptImage25FlareResponse.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageIdeogramV3Request.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageIdeogramV3Request.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageIdeogramV3RequestRenderingSpeed.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageNanoBanana2Request.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageNanoBanana2Request.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageNanoBananaProRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageNanoBananaProRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageNanoBananaProRequestResolutionTier.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageNanoBananaProResponse.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageNanoBananaProResponse.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageRequestV3.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageRequestV3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ReframeNanoBanana2Request.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ReframeNanoBanana2Request.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ReframeNanoBanana2Response.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ReframeNanoBanana2Response.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ReframeNanoBanana2Response2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ReframeNanoBanana2Response2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ReframeNanoBanana2Response3.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ReframeNanoBanana2Response3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ReframeNanoBanana2Response4.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ReframeNanoBanana2Response4.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ReframeNanoBanana2Response5.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ReframeNanoBanana2Response5.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.RemixImageIdeogramV3CharacterRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.RemixImageIdeogramV3CharacterRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.RemixImageIdeogramV3CharacterRequestRenderingSpeed.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.RemixImageIdeogramV3CharacterRequestStyleType.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.RemixImageIdeogramV3CustomModelRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.RemixImageIdeogramV3CustomModelRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.RemixImageIdeogramV3CustomModelRequestRenderingSpeed.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.RemixImageIdeogramV3Request.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.RemixImageIdeogramV3Request.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.RemixImageIdeogramV3RequestRenderingSpeed.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.RemixImageIdeogramV4Request.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.RemixImageIdeogramV4Request.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.RemixImageIdeogramV4RequestRenderingSpeed.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.RemixImageRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.RemixImageRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.RemixImageRequestV3.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.RemixImageRequestV3.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.RemixImageRequestV4.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.RemixImageRequestV4.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.RemoveBackgroundImageObject.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.RemoveBackgroundImageObject.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.RemoveBackgroundRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.RemoveBackgroundRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.RemoveBackgroundResponse.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.RemoveBackgroundResponse.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.RemoveBackgroundV2AssetRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.RemoveBackgroundV2AssetRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.RemoveBackgroundV2Request.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.RemoveBackgroundV2Request.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.RemoveObjectFromV2AssetsRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.RemoveObjectFromV2AssetsRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.RemoveObjectImageObject.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.RemoveObjectImageObject.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.RemoveObjectRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.RemoveObjectRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.RemoveObjectResponse.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.RemoveObjectResponse.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.RemoveOrganizationMembersRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.RemoveOrganizationMembersRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.RenderingSpeed.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.RenderingSpeedV4.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ReplaceBackgroundIdeogram45Request.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ReplaceBackgroundIdeogram45Request.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ReplaceBackgroundIdeogramV3Request.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ReplaceBackgroundIdeogramV3Request.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ReplaceBackgroundIdeogramV3RequestRenderingSpeed.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ReplaceBackgroundRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ReplaceBackgroundRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ReplaceBackgroundRequestV3.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ReplaceBackgroundRequestV3.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ResendOrganizationInviteRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ResendOrganizationInviteRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ResizeAdImageQuality.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ResizeAdImageRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ResizeAdImageRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ResizeAdImageRequestResolution.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.Resolution.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ResolutionV4ImageToImage.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ResolutionV4Layout.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.SamplingRequestParams.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.SamplingRequestParams.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.SegmentBy.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.SkechersStyleEditQuality.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.SkechersStyleEditRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.SkechersStyleEditRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.SkechersStyleEditRequestAspectRatio.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.SkechersStyleEditRequestBaseGenerationSize.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.SkechersStyleEditResponse.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.SkechersStyleEditResponse.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.SketchToRenderRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.SketchToRenderRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.SnapMaskRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.SnapMaskRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.SoleSwapQuality.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.SoleSwapRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.SoleSwapRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.SoleSwapRequestBaseGenerationSize.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.SoleSwapResponse.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.SoleSwapResponse.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.SpendCommitInfo.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.SpendCommitInfo.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.SpendCommitInfoResponse.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.SpendCommitInfoResponse.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.StackedCustomModel.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.StackedCustomModel.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.StylePresetV3.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.StyleType.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.StyleTypeV3.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.SvgGenerationObject.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.SvgGenerationObject.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.SvgGenerationObjectMimeType.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.SvgGenerationObjectObjectType.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.SwanSLogoDesignRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.SwanSLogoDesignRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.SwanSLogoDesignRequestDesignVariant.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.SwanSLogoDesignRequestLogoStyle.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.SwanSLogoDesignRequestSourceMode.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.SwanSLogoDesignResponse.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.SwanSLogoDesignResponse.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.SwanSLogoInstallRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.SwanSLogoInstallRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.SwanSLogoInstallRequestLogoStyle.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.SwanSLogoInstallResponse.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.SwanSLogoInstallResponse.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.SwanSLogoQuality.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.SwapProductMode.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.SwapProductQuality.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.SwapProductRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.SwapProductRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.SwapProductResponse.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.SwapProductResponse.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.TextContainerV3.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.TextContainerV3.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.TextItemV3.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.TextItemV3.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.TextItemV3Alignment.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.TextItemV3GlyphType.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.TextItemV3StyleClass.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.TextItemV3TextTransform.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.TextItemV3VerticalAlignment.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.TextLayerizerRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.TextLayerizerRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.TextLayerizerResponse.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.TextLayerizerResponse.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.TextLayerizerResultObject.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.TextLayerizerResultObject.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.TextLayerizerResultObjectObjectType.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.TextSpanV3.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.TextSpanV3.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.TextSpanV3FontFxItem.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolRemixRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolRemixRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolRemixRequestResolutionTier.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolRemoveBackgroundRequest.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolRemoveBackgroundRequest.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolRemoveBackgroundResponse.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolRemoveBackgroundResponse.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolRemoveBackgroundResponse2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolRemoveBackgroundResponse2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolRemoveBackgroundResponse3.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolRemoveBackgroundResponse3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolRemoveBackgroundResponse4.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolRemoveBackgroundResponse4.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolRemoveBackgroundResponse5.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolRemoveBackgroundResponse5.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolRemoveBackgroundResponse6.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolRemoveBackgroundResponse6.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogram45Request.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogram45Request.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogram45Response.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogram45Response.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogram45Response2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogram45Response2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogram45Response3.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogram45Response3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogram45Response4.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogram45Response4.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogram45Response5.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogram45Response5.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogramV3Request.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogramV3Request.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogramV3Response.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogramV3Response.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogramV3Response2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogramV3Response2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogramV3Response3.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogramV3Response3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogramV3Response4.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogramV3Response4.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogramV3Response5.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogramV3Response5.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogramV3Response6.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogramV3Response6.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundRequest.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundRequest.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundResponse.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundResponse.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundResponse2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundResponse2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundResponse3.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundResponse3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundResponse4.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundResponse4.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundResponse5.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundResponse5.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundResponse6.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundResponse6.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolType.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolUsage.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolUsage.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolsPostUpscaleRequest.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolsPostUpscaleRequest.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolsPostUpscaleResponse.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolsPostUpscaleResponse.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolsPostUpscaleResponse2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolsPostUpscaleResponse2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolsPostUpscaleResponse3.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolsPostUpscaleResponse3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolsPostUpscaleResponse4.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolsPostUpscaleResponse4.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolsPostUpscaleResponse5.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolsPostUpscaleResponse5.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolsPostUpscaleResponse6.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.ToolsPostUpscaleResponse6.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.TrainDatasetModelRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.TrainDatasetModelRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.TrainDatasetModelResponse.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.TrainDatasetModelResponse.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.TrainModelV3AdvancedRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.TrainModelV3AdvancedRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.TrainModelV3Request.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.TrainModelV3Request.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.TrainModelV4AdvancedRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.TrainModelV4AdvancedRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.TrainModelV4Request.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.TrainModelV4Request.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.TrainingRun.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.TrainingRun.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.TrainingRunStatus.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.TransparencyOption.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.TryOnRequestV3.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.TryOnRequestV3.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.UnpublishMiniAppPreviewResponse.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.UnpublishMiniAppPreviewResponse.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.UpdateOrganizationApiPropertiesRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.UpdateOrganizationApiPropertiesRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.UpdateOrganizationApiPropertiesResponse.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.UpdateOrganizationApiPropertiesResponse.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.UploadDatasetAssetsRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.UploadDatasetAssetsRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.UploadDatasetAssetsResponse.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.UploadDatasetAssetsResponse.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.UpscaleFactor.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageNanoBananaProRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageNanoBananaProRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageNanoBananaProRequestResolutionTier.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazBloom2Request.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazBloom2Request.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazBloom2RequestUpscaleFactor.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazRedefineRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazRedefineRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazRedefineRequestSubjectDetection.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazRedefineRequestUpscaleFactor.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazStandardV2Request.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazStandardV2Request.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazStandardV2RequestSubjectDetection.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazStandardV2RequestUpscaleFactor.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazTextRefineRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazTextRefineRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazTextRefineRequestSubjectDetection.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazTextRefineRequestUpscaleFactor.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazWonder35Request.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazWonder35Request.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazWonder35RequestEnhancementStrength.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazWonder35RequestUpscaleFactor.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.UpscaleInitialImageRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.UpscaleInitialImageRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.UpscaleToolRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.UpscaleToolRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.UpscaleToolRequestUpscaleFactor.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.UsageSegment.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.UsageSegment.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.UsageSource.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.V1EditImageObject.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.V1EditImageObject.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.V1EditImagesRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.V1EditImagesRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.V1EditImagesResponse.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.V1EditImagesResponse.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.V1EditLiteImagesRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.V1EditLiteImagesRequest.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.V2AccountUsageGetParametersBucketWidth.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.V2AccountUsageGetParametersSourcesSchemaItems.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.V2ImageGenerateAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaBackground.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaQuality.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaBackground.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaQuality.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.V2ImageGenerateIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.V2ImageGenerateIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaBackground.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.V2ImageGenerateNanoBanana21PostRequestBodyContentMultipartFormDataSchemaResolutionTier.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.V2ImageGenerateNanoBanana2PostRequestBodyContentMultipartFormDataSchemaResolutionTier.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.V2ImageGenerateNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.V2ImageInpaintIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.V2ImageInpaintIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.V2ImagePreciseEditIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.V2ImageReframeIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.V2ImageRemixAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.V2ImageRemixIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.V2ImageRemixIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.V2ImageRemixIdeogram4PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.V2ImageReplaceBackgroundIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.V2ImageUpscaleAutoPostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.V2ImageUpscaleNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.V2ImageUpscaleTopazBloom2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaSubjectDetection.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaEnhancementStrength.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaPlatform.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.V2ToolAdVariationsPostRequestBodyContentMultipartFormDataSchemaVariationType.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.V2ToolGhostMannequinPostRequestBodyContentMultipartFormDataSchemaView.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.V4ObjPromptElement.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.V4ObjPromptElement.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.V4PromptElementVariant1.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.V4PromptElementVariant1.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.V4PromptElementVariant2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.V4PromptElementVariant2.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.V4TextPromptElement.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.V4TextPromptElement.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VectorizerRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VectorizerRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VectorizerRequestMode.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VectorizerResponse.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VectorizerResponse.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoEditPostEditVideoMinimaxH3ReferenceToVideoRequest.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoEditPostEditVideoMinimaxH3ReferenceToVideoRequest.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse3.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse4.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse4.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse5.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse5.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse6.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse6.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse7.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse7.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoRequest.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoRequest.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse3.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse4.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse4.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse5.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse5.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse6.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse6.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse7.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse7.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse3.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse4.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse4.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse5.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse5.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse6.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse6.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoRequest.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoRequest.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse3.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse4.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse4.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse5.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse5.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse6.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse6.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse7.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse7.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse3.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse4.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse4.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse5.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse5.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse6.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse6.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoRequest.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoRequest.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse3.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse4.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse4.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse5.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse5.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse6.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse6.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse7.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse7.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoRequest.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoRequest.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse3.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse4.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse4.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse5.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse5.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse6.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse6.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse7.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse7.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse3.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse4.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse4.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse5.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse5.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse6.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse6.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoRequest.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoRequest.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse3.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse4.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse4.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse5.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse5.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse6.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse6.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse7.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse7.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoRequest.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoRequest.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse3.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse4.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse4.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse5.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse5.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse6.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse6.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse7.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse7.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse2.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse3.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse4.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse4.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse5.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse5.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse6.Json.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse6.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoObject.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoObject.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VideoObjectObjectType.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VirtualTryOnRequest.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VirtualTryOnRequest.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VirtualTryOnResponse.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.VirtualTryOnResponse.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.WebhookSigningJwk.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.WebhookSigningJwk.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.WebhookSigningJwks.Json.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Models.WebhookSigningJwks.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ModelsClient.Authorizations.Bearer.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ModelsClient.Constructors.Bearer.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ModelsClient.GetCustomModel.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ModelsClient.ListCustomModels.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ModelsClient.TrainModelV3.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ModelsClient.TrainModelV3Advanced.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ModelsClient.TrainModelV4.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ModelsClient.TrainModelV4Advanced.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ModelsClient.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.ObjectRemovalClient.ObjectRemovalPostRemoveObjectFromV2Assets.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ObjectRemovalClient.PostRemoveObjectFromV2Assets.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Prompt.JsonSerializerContext.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.PromptClient.Authorizations.Bearer.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.PromptClient.Constructors.Bearer.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.PromptClient.PostMagicPrompt.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.PromptClient.PostMagicPromptV4.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.PromptClient.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Provenance.JsonSerializerContext.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ProvenanceClient.Authorizations.Bearer.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ProvenanceClient.Constructors.Bearer.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ProvenanceClient.PostProvenanceVerify.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ProvenanceClient.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.Reframe.JsonSerializerContext.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.ReframeClient.Authorizations.Bearer.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.ReframeClient.Constructors.Bearer.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.ReframeClient.ReframeIdeogramV3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.ReframeClient.ReframeNanoBanana2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.ReframeClient.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ResponseStream.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ToolClient.RemoveBackground.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ToolClient.ReplaceBackground.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ToolClient.ReplaceBackgroundIdeogram45.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ToolClient.ReplaceBackgroundIdeogramV3.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.ToolClient.ToolRemoveBackground.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.ToolClient.ToolReplaceBackground.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.ToolClient.ToolReplaceBackgroundIdeogram45.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.ToolClient.ToolReplaceBackgroundIdeogramV3.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.ToolsClient.PostUpscale.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.ToolsClient.ToolsPostUpscale.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.VideoEditClient.PostEditVideoMinimaxH3ReferenceToVideo.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.VideoEditClient.PostEditVideoSeedDance2.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.VideoEditClient.VideoEditPostEditVideoMinimaxH3ReferenceToVideo.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.PostGenerateVideoKlingV3StandardImageToVideo.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.PostGenerateVideoKlingV3StandardTextToVideo.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.PostGenerateVideoMinimaxH3ImageToVideo.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.PostGenerateVideoMinimaxH3TextToVideo.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.PostGenerateVideoSeedDance25ImageToVideo.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.PostGenerateVideoSeedDance25ReferenceToVideo.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.PostGenerateVideoSeedDance25TextToVideo.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.PostGenerateVideoSeedDance2ImageToVideo.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.PostGenerateVideoSeedDance2ReferenceToVideo.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.PostGenerateVideoSeedDance2TextToVideo.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.PostLivingImage.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.PostProduct360Video.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideo.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideo.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideo.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.VideoGeneratePostGenerateVideoMinimaxH3TextToVideo.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.VideoGeneratePostGenerateVideoSeedDance25ImageToVideo.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideo.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.VideoGeneratePostGenerateVideoSeedDance25TextToVideo.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.VideoGeneratePostGenerateVideoSeedDance2ImageToVideo.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideo.g.cs create mode 100644 src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.VideoGeneratePostGenerateVideoSeedDance2TextToVideo.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Vision.JsonSerializerContext.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.VisionClient.Authorizations.Bearer.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.VisionClient.Constructors.Bearer.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.VisionClient.PostDescribe.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.VisionClient.PostDescribeV4.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.VisionClient.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.Webhooks.JsonSerializerContext.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.WebhooksClient.Authorizations.Bearer.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.WebhooksClient.Constructors.Bearer.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.WebhooksClient.GetWebhookSigningJwks.g.cs delete mode 100644 src/libs/Ideogram/Generated/Ideogram.WebhooksClient.g.cs delete mode 100644 src/libs/Ideogram/Generated/autosdk.generated-examples.json diff --git a/src/libs/Ideogram/Generated/Ideogram.Account.JsonSerializerContext.g.cs b/src/libs/Ideogram/Generated/Ideogram.Account.JsonSerializerContext.g.cs index 941fcac2..136e6193 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Account.JsonSerializerContext.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Account.JsonSerializerContext.g.cs @@ -14,40 +14,41 @@ namespace Ideogram [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AccountApiKeyStatus), TypeInfoPropertyName = "AccountApiKeyStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AccountApiKey))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ListAccountApiKeysResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AccountApiKey))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AccountApiKeyStatus), TypeInfoPropertyName = "AccountApiKeyStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GetAccountUsageResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AccountUsageBucket))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AccountUsageLineItem))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AccountUsageLineItemSource), TypeInfoPropertyName = "AccountUsageLineItemSource2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AccountInvoiceStatus), TypeInfoPropertyName = "AccountInvoiceStatus2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AccountUsageApiKey))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AccountUsageBilledUnits))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ListAccountInvoicesResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AccountInvoiceLineItem))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AccountInvoice))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AccountInvoiceStatus), TypeInfoPropertyName = "AccountInvoiceStatus2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AccountInvoiceLineItem))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GetAccountUsageBucketWidth), TypeInfoPropertyName = "GetAccountUsageBucketWidth2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GetAccountUsageSource), TypeInfoPropertyName = "GetAccountUsageSource2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ListAccountInvoicesResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2AccountUsageGetParametersBucketWidth), TypeInfoPropertyName = "V2AccountUsageGetParametersBucketWidth2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2AccountUsageGetParametersSourcesSchemaItems), TypeInfoPropertyName = "V2AccountUsageGetParametersSourcesSchemaItems2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AccountUsageLineItemSource), TypeInfoPropertyName = "AccountUsageLineItemSource2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AccountUsageBilledUnits))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AccountUsageLineItem))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AccountUsageBucket))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GetAccountUsageResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime?))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AccountApiKeyStatus?), TypeInfoPropertyName = "NullableAccountApiKeyStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AccountUsageLineItemSource?), TypeInfoPropertyName = "NullableAccountUsageLineItemSource2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AccountInvoiceStatus?), TypeInfoPropertyName = "NullableAccountInvoiceStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GetAccountUsageBucketWidth?), TypeInfoPropertyName = "NullableGetAccountUsageBucketWidth2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GetAccountUsageSource?), TypeInfoPropertyName = "NullableGetAccountUsageSource2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2AccountUsageGetParametersBucketWidth?), TypeInfoPropertyName = "NullableV2AccountUsageGetParametersBucketWidth2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2AccountUsageGetParametersSourcesSchemaItems?), TypeInfoPropertyName = "NullableV2AccountUsageGetParametersSourcesSchemaItems2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AccountUsageLineItemSource?), TypeInfoPropertyName = "NullableAccountUsageLineItemSource2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] internal sealed partial class AccountSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext { } @@ -121,21 +122,21 @@ public override bool CanConvert(global::System.Type typeToConvert) || typeToConvert == typeof(global::Ideogram.AccountApiKeyStatus?) - || typeToConvert == typeof(global::Ideogram.AccountUsageLineItemSource) - - || typeToConvert == typeof(global::Ideogram.AccountUsageLineItemSource?) - || typeToConvert == typeof(global::Ideogram.AccountInvoiceStatus) || typeToConvert == typeof(global::Ideogram.AccountInvoiceStatus?) - || typeToConvert == typeof(global::Ideogram.GetAccountUsageBucketWidth) + || typeToConvert == typeof(global::Ideogram.V2AccountUsageGetParametersBucketWidth) - || typeToConvert == typeof(global::Ideogram.GetAccountUsageBucketWidth?) + || typeToConvert == typeof(global::Ideogram.V2AccountUsageGetParametersBucketWidth?) - || typeToConvert == typeof(global::Ideogram.GetAccountUsageSource) + || typeToConvert == typeof(global::Ideogram.V2AccountUsageGetParametersSourcesSchemaItems) - || typeToConvert == typeof(global::Ideogram.GetAccountUsageSource?); + || typeToConvert == typeof(global::Ideogram.V2AccountUsageGetParametersSourcesSchemaItems?) + + || typeToConvert == typeof(global::Ideogram.AccountUsageLineItemSource) + + || typeToConvert == typeof(global::Ideogram.AccountUsageLineItemSource?); } public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( @@ -152,44 +153,44 @@ public override bool CanConvert(global::System.Type typeToConvert) return new global::Ideogram.JsonConverters.AccountApiKeyStatusNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.AccountUsageLineItemSource)) + if (typeToConvert == typeof(global::Ideogram.AccountInvoiceStatus)) { - return new global::Ideogram.JsonConverters.AccountUsageLineItemSourceJsonConverter(); + return new global::Ideogram.JsonConverters.AccountInvoiceStatusJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.AccountUsageLineItemSource?)) + if (typeToConvert == typeof(global::Ideogram.AccountInvoiceStatus?)) { - return new global::Ideogram.JsonConverters.AccountUsageLineItemSourceNullableJsonConverter(); + return new global::Ideogram.JsonConverters.AccountInvoiceStatusNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.AccountInvoiceStatus)) + if (typeToConvert == typeof(global::Ideogram.V2AccountUsageGetParametersBucketWidth)) { - return new global::Ideogram.JsonConverters.AccountInvoiceStatusJsonConverter(); + return new global::Ideogram.JsonConverters.V2AccountUsageGetParametersBucketWidthJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.AccountInvoiceStatus?)) + if (typeToConvert == typeof(global::Ideogram.V2AccountUsageGetParametersBucketWidth?)) { - return new global::Ideogram.JsonConverters.AccountInvoiceStatusNullableJsonConverter(); + return new global::Ideogram.JsonConverters.V2AccountUsageGetParametersBucketWidthNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.GetAccountUsageBucketWidth)) + if (typeToConvert == typeof(global::Ideogram.V2AccountUsageGetParametersSourcesSchemaItems)) { - return new global::Ideogram.JsonConverters.GetAccountUsageBucketWidthJsonConverter(); + return new global::Ideogram.JsonConverters.V2AccountUsageGetParametersSourcesSchemaItemsJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.GetAccountUsageBucketWidth?)) + if (typeToConvert == typeof(global::Ideogram.V2AccountUsageGetParametersSourcesSchemaItems?)) { - return new global::Ideogram.JsonConverters.GetAccountUsageBucketWidthNullableJsonConverter(); + return new global::Ideogram.JsonConverters.V2AccountUsageGetParametersSourcesSchemaItemsNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.GetAccountUsageSource)) + if (typeToConvert == typeof(global::Ideogram.AccountUsageLineItemSource)) { - return new global::Ideogram.JsonConverters.GetAccountUsageSourceJsonConverter(); + return new global::Ideogram.JsonConverters.AccountUsageLineItemSourceJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.GetAccountUsageSource?)) + if (typeToConvert == typeof(global::Ideogram.AccountUsageLineItemSource?)) { - return new global::Ideogram.JsonConverters.GetAccountUsageSourceNullableJsonConverter(); + return new global::Ideogram.JsonConverters.AccountUsageLineItemSourceNullableJsonConverter(); } throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); } diff --git a/src/libs/Ideogram/Generated/Ideogram.AccountClient.AccountGetAccountApiKeys.g.cs b/src/libs/Ideogram/Generated/Ideogram.AccountClient.AccountGetAccountApiKeys.g.cs new file mode 100644 index 00000000..2ae0a68e --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.AccountClient.AccountGetAccountApiKeys.g.cs @@ -0,0 +1,501 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class AccountClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_AccountGetAccountApiKeysSecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_AccountGetAccountApiKeysSecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_AccountGetAccountApiKeysSecurityRequirement0, + }; + partial void PrepareAccountGetAccountApiKeysArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareAccountGetAccountApiKeysRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessAccountGetAccountApiKeysResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessAccountGetAccountApiKeysResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// List API keys
+ /// Lists the API keys in your organization. Key material is redacted —
+ /// the full key is only shown once, when it is created. Disabled and
+ /// archived keys are included (see each key's `status`) so historical
+ /// usage can always be matched to the key that generated it.
+ /// Requires an API key whose owner is an organization admin. Keys owned
+ /// by other members receive a 404. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task AccountGetAccountApiKeysAsync( + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AccountGetAccountApiKeysAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List API keys
+ /// Lists the API keys in your organization. Key material is redacted —
+ /// the full key is only shown once, when it is created. Disabled and
+ /// archived keys are included (see each key's `status`) so historical
+ /// usage can always be matched to the key that generated it.
+ /// Requires an API key whose owner is an organization admin. Keys owned
+ /// by other members receive a 404. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> AccountGetAccountApiKeysAsResponseAsync( + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareAccountGetAccountApiKeysArguments( + httpClient: HttpClient); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_AccountGetAccountApiKeysSecurityRequirements, + operationName: "AccountGetAccountApiKeysAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/account/api-keys", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareAccountGetAccountApiKeysRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AccountGetAccountApiKeys", + methodName: "AccountGetAccountApiKeysAsync", + pathTemplate: "\"/v2/account/api-keys\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AccountGetAccountApiKeys", + methodName: "AccountGetAccountApiKeysAsync", + pathTemplate: "\"/v2/account/api-keys\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AccountGetAccountApiKeys", + methodName: "AccountGetAccountApiKeysAsync", + pathTemplate: "\"/v2/account/api-keys\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessAccountGetAccountApiKeysResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AccountGetAccountApiKeys", + methodName: "AccountGetAccountApiKeysAsync", + pathTemplate: "\"/v2/account/api-keys\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AccountGetAccountApiKeys", + methodName: "AccountGetAccountApiKeysAsync", + pathTemplate: "\"/v2/account/api-keys\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // No organization with billing access was found for this credential. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessAccountGetAccountApiKeysResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.ListAccountApiKeysResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.ListAccountApiKeysResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.AccountClient.AccountGetAccountInvoices.g.cs b/src/libs/Ideogram/Generated/Ideogram.AccountClient.AccountGetAccountInvoices.g.cs new file mode 100644 index 00000000..8c5a1106 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.AccountClient.AccountGetAccountInvoices.g.cs @@ -0,0 +1,499 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class AccountClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_AccountGetAccountInvoicesSecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_AccountGetAccountInvoicesSecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_AccountGetAccountInvoicesSecurityRequirement0, + }; + partial void PrepareAccountGetAccountInvoicesArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareAccountGetAccountInvoicesRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessAccountGetAccountInvoicesResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessAccountGetAccountInvoicesResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// List invoices
+ /// Returns your organization's invoices with their line items — the
+ /// billing record your usage reports reconcile against. Amounts are
+ /// decimal strings in the invoice's currency.
+ /// Requires an API key whose owner is an organization admin. Keys owned
+ /// by other members receive a 404. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task AccountGetAccountInvoicesAsync( + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AccountGetAccountInvoicesAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List invoices
+ /// Returns your organization's invoices with their line items — the
+ /// billing record your usage reports reconcile against. Amounts are
+ /// decimal strings in the invoice's currency.
+ /// Requires an API key whose owner is an organization admin. Keys owned
+ /// by other members receive a 404. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> AccountGetAccountInvoicesAsResponseAsync( + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareAccountGetAccountInvoicesArguments( + httpClient: HttpClient); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_AccountGetAccountInvoicesSecurityRequirements, + operationName: "AccountGetAccountInvoicesAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/account/invoices", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareAccountGetAccountInvoicesRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AccountGetAccountInvoices", + methodName: "AccountGetAccountInvoicesAsync", + pathTemplate: "\"/v2/account/invoices\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AccountGetAccountInvoices", + methodName: "AccountGetAccountInvoicesAsync", + pathTemplate: "\"/v2/account/invoices\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AccountGetAccountInvoices", + methodName: "AccountGetAccountInvoicesAsync", + pathTemplate: "\"/v2/account/invoices\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessAccountGetAccountInvoicesResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AccountGetAccountInvoices", + methodName: "AccountGetAccountInvoicesAsync", + pathTemplate: "\"/v2/account/invoices\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AccountGetAccountInvoices", + methodName: "AccountGetAccountInvoicesAsync", + pathTemplate: "\"/v2/account/invoices\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // No organization with billing access was found for this credential. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessAccountGetAccountInvoicesResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.ListAccountInvoicesResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.ListAccountInvoicesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.AccountClient.AccountGetAccountUsage.g.cs b/src/libs/Ideogram/Generated/Ideogram.AccountClient.AccountGetAccountUsage.g.cs new file mode 100644 index 00000000..e39566ad --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.AccountClient.AccountGetAccountUsage.g.cs @@ -0,0 +1,649 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class AccountClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_AccountGetAccountUsageSecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_AccountGetAccountUsageSecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_AccountGetAccountUsageSecurityRequirement0, + }; + partial void PrepareAccountGetAccountUsageArguments( + global::System.Net.Http.HttpClient httpClient, + ref global::System.DateTime startTime, + ref global::System.DateTime? endTime, + ref global::Ideogram.V2AccountUsageGetParametersBucketWidth? bucketWidth, + global::System.Collections.Generic.IList? sources); + partial void PrepareAccountGetAccountUsageRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + global::System.DateTime startTime, + global::System.DateTime? endTime, + global::Ideogram.V2AccountUsageGetParametersBucketWidth? bucketWidth, + global::System.Collections.Generic.IList? sources); + partial void ProcessAccountGetAccountUsageResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessAccountGetAccountUsageResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get usage and spend
+ /// Returns your organization's billed API usage as dense time buckets of
+ /// line items. Every line item carries the billed dollar amount; products
+ /// billed per item also carry `billed_units` (unit, quantity, and unit
+ /// price, where `quantity × unit_price = cost_total`). Usage-priced
+ /// products (billed by metered provider usage) report `cost_total` only.
+ /// Buckets cover the requested range completely — a bucket with no line
+ /// items means no billed usage in that window. Line items are unique per
+ /// bucket on (`product`, `dimensions`, `api_key.id`, unit price). Usage
+ /// billed without an API key (requests authenticated as a user session)
+ /// is included with `api_key` absent, so totals always reconcile with
+ /// your invoices.
+ /// `product` and `endpoint` are stable identifiers safe to aggregate on;
+ /// `description` is display text and may be reworded at any time.
+ /// Usage data may lag live traffic by a few minutes, and responses may be
+ /// cached briefly, so this endpoint is for reporting rather than
+ /// real-time monitoring.
+ /// Requires an API key whose owner is an organization admin. Keys owned
+ /// by other members receive a 404. + ///
+ /// + /// + /// + /// Default Value: 1d + /// + /// + /// Default Value: [api, app] + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task AccountGetAccountUsageAsync( + global::System.DateTime startTime, + global::System.DateTime? endTime = default, + global::Ideogram.V2AccountUsageGetParametersBucketWidth? bucketWidth = default, + global::System.Collections.Generic.IList? sources = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AccountGetAccountUsageAsResponseAsync( + startTime: startTime, + endTime: endTime, + bucketWidth: bucketWidth, + sources: sources, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get usage and spend
+ /// Returns your organization's billed API usage as dense time buckets of
+ /// line items. Every line item carries the billed dollar amount; products
+ /// billed per item also carry `billed_units` (unit, quantity, and unit
+ /// price, where `quantity × unit_price = cost_total`). Usage-priced
+ /// products (billed by metered provider usage) report `cost_total` only.
+ /// Buckets cover the requested range completely — a bucket with no line
+ /// items means no billed usage in that window. Line items are unique per
+ /// bucket on (`product`, `dimensions`, `api_key.id`, unit price). Usage
+ /// billed without an API key (requests authenticated as a user session)
+ /// is included with `api_key` absent, so totals always reconcile with
+ /// your invoices.
+ /// `product` and `endpoint` are stable identifiers safe to aggregate on;
+ /// `description` is display text and may be reworded at any time.
+ /// Usage data may lag live traffic by a few minutes, and responses may be
+ /// cached briefly, so this endpoint is for reporting rather than
+ /// real-time monitoring.
+ /// Requires an API key whose owner is an organization admin. Keys owned
+ /// by other members receive a 404. + ///
+ /// + /// + /// + /// Default Value: 1d + /// + /// + /// Default Value: [api, app] + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> AccountGetAccountUsageAsResponseAsync( + global::System.DateTime startTime, + global::System.DateTime? endTime = default, + global::Ideogram.V2AccountUsageGetParametersBucketWidth? bucketWidth = default, + global::System.Collections.Generic.IList? sources = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareAccountGetAccountUsageArguments( + httpClient: HttpClient, + startTime: ref startTime, + endTime: ref endTime, + bucketWidth: ref bucketWidth, + sources: sources); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_AccountGetAccountUsageSecurityRequirements, + operationName: "AccountGetAccountUsageAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/account/usage", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddRequiredParameter("start_time", startTime.ToString("yyyy-MM-ddTHH:mm:ssZ")) + .AddOptionalParameter("end_time", endTime?.ToString("yyyy-MM-ddTHH:mm:ssZ")) + .AddOptionalParameter("bucket_width", bucketWidth?.ToValueString()) + .AddOptionalParameter("sources", sources, selector: static x => x.ToValueString(), delimiter: ",", explode: true) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareAccountGetAccountUsageRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + startTime: startTime, + endTime: endTime, + bucketWidth: bucketWidth, + sources: sources); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AccountGetAccountUsage", + methodName: "AccountGetAccountUsageAsync", + pathTemplate: "\"/v2/account/usage\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AccountGetAccountUsage", + methodName: "AccountGetAccountUsageAsync", + pathTemplate: "\"/v2/account/usage\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AccountGetAccountUsage", + methodName: "AccountGetAccountUsageAsync", + pathTemplate: "\"/v2/account/usage\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessAccountGetAccountUsageResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AccountGetAccountUsage", + methodName: "AccountGetAccountUsageAsync", + pathTemplate: "\"/v2/account/usage\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AccountGetAccountUsage", + methodName: "AccountGetAccountUsageAsync", + pathTemplate: "\"/v2/account/usage\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid time range, bucket width, or filters. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // No organization with billing access was found for this credential. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + string? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_429, typeof(string), JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_429, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessAccountGetAccountUsageResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.GetAccountUsageResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.GetAccountUsageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.AccountClient.GetAccountApiKeys.g.cs b/src/libs/Ideogram/Generated/Ideogram.AccountClient.GetAccountApiKeys.g.cs deleted file mode 100644 index 931f57a5..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.AccountClient.GetAccountApiKeys.g.cs +++ /dev/null @@ -1,491 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class AccountClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_GetAccountApiKeysSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_GetAccountApiKeysSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_GetAccountApiKeysSecurityRequirement0, - }; - partial void PrepareGetAccountApiKeysArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareGetAccountApiKeysRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessGetAccountApiKeysResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessGetAccountApiKeysResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// List API keys
- /// Lists the API keys in your organization. Key material is redacted —
- /// the full key is only shown once, when it is created. Disabled and
- /// archived keys are included (see each key's `status`) so historical
- /// usage can always be matched to the key that generated it.
- /// Requires an API key whose owner is an organization admin. Keys owned
- /// by other members receive a 404. - ///
- /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task GetAccountApiKeysAsync( - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await GetAccountApiKeysAsResponseAsync( - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// List API keys
- /// Lists the API keys in your organization. Key material is redacted —
- /// the full key is only shown once, when it is created. Disabled and
- /// archived keys are included (see each key's `status`) so historical
- /// usage can always be matched to the key that generated it.
- /// Requires an API key whose owner is an organization admin. Keys owned
- /// by other members receive a 404. - ///
- /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> GetAccountApiKeysAsResponseAsync( - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareGetAccountApiKeysArguments( - httpClient: HttpClient); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_GetAccountApiKeysSecurityRequirements, - operationName: "GetAccountApiKeysAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/account/api-keys", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetAccountApiKeysRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetAccountApiKeys", - methodName: "GetAccountApiKeysAsync", - pathTemplate: "\"/v2/account/api-keys\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetAccountApiKeys", - methodName: "GetAccountApiKeysAsync", - pathTemplate: "\"/v2/account/api-keys\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetAccountApiKeys", - methodName: "GetAccountApiKeysAsync", - pathTemplate: "\"/v2/account/api-keys\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetAccountApiKeysResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetAccountApiKeys", - methodName: "GetAccountApiKeysAsync", - pathTemplate: "\"/v2/account/api-keys\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetAccountApiKeys", - methodName: "GetAccountApiKeysAsync", - pathTemplate: "\"/v2/account/api-keys\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetAccountApiKeysResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.ListAccountApiKeysResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.ListAccountApiKeysResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.AccountClient.GetAccountInvoices.g.cs b/src/libs/Ideogram/Generated/Ideogram.AccountClient.GetAccountInvoices.g.cs deleted file mode 100644 index a28dd8a3..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.AccountClient.GetAccountInvoices.g.cs +++ /dev/null @@ -1,489 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class AccountClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_GetAccountInvoicesSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_GetAccountInvoicesSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_GetAccountInvoicesSecurityRequirement0, - }; - partial void PrepareGetAccountInvoicesArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareGetAccountInvoicesRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessGetAccountInvoicesResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessGetAccountInvoicesResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// List invoices
- /// Returns your organization's invoices with their line items — the
- /// billing record your usage reports reconcile against. Amounts are
- /// decimal strings in the invoice's currency.
- /// Requires an API key whose owner is an organization admin. Keys owned
- /// by other members receive a 404. - ///
- /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task GetAccountInvoicesAsync( - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await GetAccountInvoicesAsResponseAsync( - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// List invoices
- /// Returns your organization's invoices with their line items — the
- /// billing record your usage reports reconcile against. Amounts are
- /// decimal strings in the invoice's currency.
- /// Requires an API key whose owner is an organization admin. Keys owned
- /// by other members receive a 404. - ///
- /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> GetAccountInvoicesAsResponseAsync( - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareGetAccountInvoicesArguments( - httpClient: HttpClient); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_GetAccountInvoicesSecurityRequirements, - operationName: "GetAccountInvoicesAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/account/invoices", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetAccountInvoicesRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetAccountInvoices", - methodName: "GetAccountInvoicesAsync", - pathTemplate: "\"/v2/account/invoices\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetAccountInvoices", - methodName: "GetAccountInvoicesAsync", - pathTemplate: "\"/v2/account/invoices\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetAccountInvoices", - methodName: "GetAccountInvoicesAsync", - pathTemplate: "\"/v2/account/invoices\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetAccountInvoicesResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetAccountInvoices", - methodName: "GetAccountInvoicesAsync", - pathTemplate: "\"/v2/account/invoices\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetAccountInvoices", - methodName: "GetAccountInvoicesAsync", - pathTemplate: "\"/v2/account/invoices\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetAccountInvoicesResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.ListAccountInvoicesResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.ListAccountInvoicesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.AccountClient.GetAccountUsage.g.cs b/src/libs/Ideogram/Generated/Ideogram.AccountClient.GetAccountUsage.g.cs deleted file mode 100644 index d4d8628e..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.AccountClient.GetAccountUsage.g.cs +++ /dev/null @@ -1,629 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class AccountClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_GetAccountUsageSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_GetAccountUsageSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_GetAccountUsageSecurityRequirement0, - }; - partial void PrepareGetAccountUsageArguments( - global::System.Net.Http.HttpClient httpClient, - ref global::System.DateTime startTime, - ref global::System.DateTime? endTime, - ref global::Ideogram.GetAccountUsageBucketWidth? bucketWidth, - global::System.Collections.Generic.IList? sources); - partial void PrepareGetAccountUsageRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::System.DateTime startTime, - global::System.DateTime? endTime, - global::Ideogram.GetAccountUsageBucketWidth? bucketWidth, - global::System.Collections.Generic.IList? sources); - partial void ProcessGetAccountUsageResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessGetAccountUsageResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Get usage and spend
- /// Returns your organization's billed API usage as dense time buckets of
- /// line items. Every line item carries the billed dollar amount; products
- /// billed per item also carry `billed_units` (unit, quantity, and unit
- /// price, where `quantity × unit_price = cost_total`). Usage-priced
- /// products (billed by metered provider usage) report `cost_total` only.
- /// Buckets cover the requested range completely — a bucket with no line
- /// items means no billed usage in that window. Line items are unique per
- /// bucket on (`product`, `dimensions`, `api_key.id`, unit price). Usage
- /// billed without an API key (requests authenticated as a user session)
- /// is included with `api_key` absent, so totals always reconcile with
- /// your invoices.
- /// `product` and `endpoint` are stable identifiers safe to aggregate on;
- /// `description` is display text and may be reworded at any time.
- /// Usage data may lag live traffic by a few minutes, and responses may be
- /// cached briefly, so this endpoint is for reporting rather than
- /// real-time monitoring.
- /// Requires an API key whose owner is an organization admin. Keys owned
- /// by other members receive a 404. - ///
- /// - /// - /// - /// Default Value: 1d - /// - /// - /// Default Value: [api, app] - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task GetAccountUsageAsync( - global::System.DateTime startTime, - global::System.DateTime? endTime = default, - global::Ideogram.GetAccountUsageBucketWidth? bucketWidth = default, - global::System.Collections.Generic.IList? sources = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await GetAccountUsageAsResponseAsync( - startTime: startTime, - endTime: endTime, - bucketWidth: bucketWidth, - sources: sources, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Get usage and spend
- /// Returns your organization's billed API usage as dense time buckets of
- /// line items. Every line item carries the billed dollar amount; products
- /// billed per item also carry `billed_units` (unit, quantity, and unit
- /// price, where `quantity × unit_price = cost_total`). Usage-priced
- /// products (billed by metered provider usage) report `cost_total` only.
- /// Buckets cover the requested range completely — a bucket with no line
- /// items means no billed usage in that window. Line items are unique per
- /// bucket on (`product`, `dimensions`, `api_key.id`, unit price). Usage
- /// billed without an API key (requests authenticated as a user session)
- /// is included with `api_key` absent, so totals always reconcile with
- /// your invoices.
- /// `product` and `endpoint` are stable identifiers safe to aggregate on;
- /// `description` is display text and may be reworded at any time.
- /// Usage data may lag live traffic by a few minutes, and responses may be
- /// cached briefly, so this endpoint is for reporting rather than
- /// real-time monitoring.
- /// Requires an API key whose owner is an organization admin. Keys owned
- /// by other members receive a 404. - ///
- /// - /// - /// - /// Default Value: 1d - /// - /// - /// Default Value: [api, app] - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> GetAccountUsageAsResponseAsync( - global::System.DateTime startTime, - global::System.DateTime? endTime = default, - global::Ideogram.GetAccountUsageBucketWidth? bucketWidth = default, - global::System.Collections.Generic.IList? sources = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareGetAccountUsageArguments( - httpClient: HttpClient, - startTime: ref startTime, - endTime: ref endTime, - bucketWidth: ref bucketWidth, - sources: sources); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_GetAccountUsageSecurityRequirements, - operationName: "GetAccountUsageAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/account/usage", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("start_time", startTime.ToString("yyyy-MM-ddTHH:mm:ssZ")) - .AddOptionalParameter("end_time", endTime?.ToString("yyyy-MM-ddTHH:mm:ssZ")) - .AddOptionalParameter("bucket_width", bucketWidth?.ToValueString()) - .AddOptionalParameter("sources", sources, selector: static x => x.ToValueString(), delimiter: ",", explode: true) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetAccountUsageRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - startTime: startTime, - endTime: endTime, - bucketWidth: bucketWidth, - sources: sources); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetAccountUsage", - methodName: "GetAccountUsageAsync", - pathTemplate: "\"/v2/account/usage\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetAccountUsage", - methodName: "GetAccountUsageAsync", - pathTemplate: "\"/v2/account/usage\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetAccountUsage", - methodName: "GetAccountUsageAsync", - pathTemplate: "\"/v2/account/usage\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetAccountUsageResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetAccountUsage", - methodName: "GetAccountUsageAsync", - pathTemplate: "\"/v2/account/usage\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetAccountUsage", - methodName: "GetAccountUsageAsync", - pathTemplate: "\"/v2/account/usage\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetAccountUsageResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.GetAccountUsageResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.GetAccountUsageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.AssetReferenceUsage.JsonSerializerContext.g.cs b/src/libs/Ideogram/Generated/Ideogram.AssetReferenceUsage.JsonSerializerContext.g.cs deleted file mode 100644 index 8fbe33b9..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.AssetReferenceUsage.JsonSerializerContext.g.cs +++ /dev/null @@ -1,189 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull - )] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(long))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AssetReferenceUsageResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AssetReferenceUsageItem))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AssetIdentifier))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AttributeInfo))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AssetType), TypeInfoPropertyName = "AssetType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AttributeValueType), TypeInfoPropertyName = "AttributeValueType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(long?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AssetType?), TypeInfoPropertyName = "NullableAssetType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AttributeValueType?), TypeInfoPropertyName = "NullableAttributeValueType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - internal sealed partial class AssetReferenceUsageSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext - { - } - /// - /// - /// - public sealed partial class AssetReferenceUsageSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext - { - private static readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver Resolver = new LazyChunkResolver(); - - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - internal static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver TypeInfoResolver => Resolver; - - - private static readonly global::System.Text.Json.JsonSerializerOptions DefaultOptions = CreateDefaultOptions(); - - /// - /// - /// - public static AssetReferenceUsageSourceGenerationContext Default { get; } = new(DefaultOptions); - - private AssetReferenceUsageSourceGenerationContext(global::System.Text.Json.JsonSerializerOptions options) - : base(options) - { - } - - /// - protected override global::System.Text.Json.JsonSerializerOptions? GeneratedSerializerOptions => DefaultOptions; - - /// - public override global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo(global::System.Type type) - { - return Resolver.GetTypeInfo(type, Options); - } - - /// - /// Adds this package's converters to . - /// - /// - /// A converter has to be on the options a chained resolver builds its JsonTypeInfo against, - /// and a context resolves types from every package below it. Each package contributes only - /// what it owns and calls down the chain for the rest, so the family's converter table is - /// written once rather than copied into all of them. - /// - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) - { - options.Converters.Add(new global::Ideogram.JsonConverters.UnixTimestampJsonConverter()); - options.Converters.Add(new LazyEnumJsonConverterFactory()); - } - - private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() - { - var options = new global::System.Text.Json.JsonSerializerOptions - { - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, - TypeInfoResolver = Resolver, - }; - AddConverters(options); - - return options; - } - - - private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory - { - public override bool CanConvert(global::System.Type typeToConvert) - { - return - typeToConvert == typeof(global::Ideogram.AssetType) - - || typeToConvert == typeof(global::Ideogram.AssetType?) - - || typeToConvert == typeof(global::Ideogram.AttributeValueType) - - || typeToConvert == typeof(global::Ideogram.AttributeValueType?); - } - - public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - if (typeToConvert == typeof(global::Ideogram.AssetType)) - { - return new global::Ideogram.JsonConverters.AssetTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.AssetType?)) - { - return new global::Ideogram.JsonConverters.AssetTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.AttributeValueType)) - { - return new global::Ideogram.JsonConverters.AttributeValueTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.AttributeValueType?)) - { - return new global::Ideogram.JsonConverters.AttributeValueTypeNullableJsonConverter(); - } - throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); - } - } - - private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver - { - private readonly object _gate = new(); - private readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[] _resolvers = new global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[1]; - - public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo( - global::System.Type type, - global::System.Text.Json.JsonSerializerOptions options) - { - for (var index = 0; index < _resolvers.Length; index++) - { - var typeInfo = GetResolver(index).GetTypeInfo(type, options); - if (typeInfo is not null) - { - return typeInfo; - } - } - - return null; - } - - private global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver GetResolver(int index) - { - var resolver = global::System.Threading.Volatile.Read(ref _resolvers[index]); - if (resolver is not null) - { - return resolver; - } - - lock (_gate) - { - return _resolvers[index] ??= CreateResolver(index); - } - } - - private static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver CreateResolver(int index) - { - return index switch - { - 0 => new AssetReferenceUsageSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), - _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), - }; - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.AssetReferenceUsageClient.Authorizations.Bearer.g.cs b/src/libs/Ideogram/Generated/Ideogram.AssetReferenceUsageClient.Authorizations.Bearer.g.cs deleted file mode 100644 index d5eb8c46..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.AssetReferenceUsageClient.Authorizations.Bearer.g.cs +++ /dev/null @@ -1,35 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public sealed partial class AssetReferenceUsageClient - { - - /// - public void AuthorizeUsingBearer( - string apiKey) - { - apiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey)); - - for (var i = Authorizations.Count - 1; i >= 0; i--) - { - var __authorization = Authorizations[i]; - if (__authorization.Type == "Http" && - __authorization.Name == "Bearer") - { - Authorizations.RemoveAt(i); - } - } - - Authorizations.Add(new global::Ideogram.EndPointAuthorization - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - Value = apiKey, - }); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.AssetReferenceUsageClient.Constructors.Bearer.g.cs b/src/libs/Ideogram/Generated/Ideogram.AssetReferenceUsageClient.Constructors.Bearer.g.cs deleted file mode 100644 index de1178f5..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.AssetReferenceUsageClient.Constructors.Bearer.g.cs +++ /dev/null @@ -1,31 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public sealed partial class AssetReferenceUsageClient - { - /// - - public AssetReferenceUsageClient( - string apiKey, - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - bool disposeHttpClient = true) : this(httpClient, baseUri, authorizations, disposeHttpClient) - { - Authorizing(HttpClient, ref apiKey); - - AuthorizeUsingBearer(apiKey); - - Authorized(HttpClient); - } - - partial void Authorizing( - global::System.Net.Http.HttpClient client, - ref string apiKey); - partial void Authorized( - global::System.Net.Http.HttpClient client); - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.AssetReferenceUsageClient.GetAssetReferenceUsage.g.cs b/src/libs/Ideogram/Generated/Ideogram.AssetReferenceUsageClient.GetAssetReferenceUsage.g.cs deleted file mode 100644 index a41aa0ed..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.AssetReferenceUsageClient.GetAssetReferenceUsage.g.cs +++ /dev/null @@ -1,583 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class AssetReferenceUsageClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_GetAssetReferenceUsageSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_GetAssetReferenceUsageSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_GetAssetReferenceUsageSecurityRequirement0, - }; - partial void PrepareGetAssetReferenceUsageArguments( - global::System.Net.Http.HttpClient httpClient, - ref int? limit, - global::System.Collections.Generic.IList? collectionIds, - ref bool? includeCollections, - ref global::System.DateTime startDate, - ref global::System.DateTime endDate, - ref string? cursor); - partial void PrepareGetAssetReferenceUsageRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - int? limit, - global::System.Collections.Generic.IList? collectionIds, - bool? includeCollections, - global::System.DateTime startDate, - global::System.DateTime endDate, - string? cursor); - partial void ProcessGetAssetReferenceUsageResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessGetAssetReferenceUsageResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Rank edit reference assets used by organization requests
- /// Counts completed requests made by the authenticated organization that used each existing asset as an edit input during the UTC date range. Direct file uploads without saved asset identifiers are excluded. Results are independent of current asset ownership, collection membership, and sharing. Returning an identifier does not grant access to its image. Tracking begins when enabled; earlier history is not included. Returns 50 assets per page by default, up to 100 with limit. Rankings may change between pages when daily counts are updated; cursors do not pin a historical snapshot. - ///
- /// - /// Default Value: 50 - /// - /// - /// - /// Default Value: false - /// - /// - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task GetAssetReferenceUsageAsync( - global::System.DateTime startDate, - global::System.DateTime endDate, - int? limit = default, - global::System.Collections.Generic.IList? collectionIds = default, - bool? includeCollections = default, - string? cursor = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await GetAssetReferenceUsageAsResponseAsync( - startDate: startDate, - endDate: endDate, - limit: limit, - collectionIds: collectionIds, - includeCollections: includeCollections, - cursor: cursor, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Rank edit reference assets used by organization requests
- /// Counts completed requests made by the authenticated organization that used each existing asset as an edit input during the UTC date range. Direct file uploads without saved asset identifiers are excluded. Results are independent of current asset ownership, collection membership, and sharing. Returning an identifier does not grant access to its image. Tracking begins when enabled; earlier history is not included. Returns 50 assets per page by default, up to 100 with limit. Rankings may change between pages when daily counts are updated; cursors do not pin a historical snapshot. - ///
- /// - /// Default Value: 50 - /// - /// - /// - /// Default Value: false - /// - /// - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> GetAssetReferenceUsageAsResponseAsync( - global::System.DateTime startDate, - global::System.DateTime endDate, - int? limit = default, - global::System.Collections.Generic.IList? collectionIds = default, - bool? includeCollections = default, - string? cursor = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareGetAssetReferenceUsageArguments( - httpClient: HttpClient, - limit: ref limit, - collectionIds: collectionIds, - includeCollections: ref includeCollections, - startDate: ref startDate, - endDate: ref endDate, - cursor: ref cursor); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_GetAssetReferenceUsageSecurityRequirements, - operationName: "GetAssetReferenceUsageAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/assets/reference-usage", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("limit", limit?.ToString()) - .AddOptionalParameter("collection_ids", collectionIds, delimiter: ",", explode: true) - .AddOptionalParameter("include_collections", includeCollections?.ToString().ToLowerInvariant()) - .AddRequiredParameter("start_date", startDate.ToString("yyyy-MM-dd")) - .AddRequiredParameter("end_date", endDate.ToString("yyyy-MM-dd")) - .AddOptionalParameter("cursor", cursor) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetAssetReferenceUsageRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - limit: limit, - collectionIds: collectionIds, - includeCollections: includeCollections, - startDate: startDate, - endDate: endDate, - cursor: cursor); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetAssetReferenceUsage", - methodName: "GetAssetReferenceUsageAsync", - pathTemplate: "\"/v2/assets/reference-usage\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetAssetReferenceUsage", - methodName: "GetAssetReferenceUsageAsync", - pathTemplate: "\"/v2/assets/reference-usage\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetAssetReferenceUsage", - methodName: "GetAssetReferenceUsageAsync", - pathTemplate: "\"/v2/assets/reference-usage\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetAssetReferenceUsageResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetAssetReferenceUsage", - methodName: "GetAssetReferenceUsageAsync", - pathTemplate: "\"/v2/assets/reference-usage\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetAssetReferenceUsage", - methodName: "GetAssetReferenceUsageAsync", - pathTemplate: "\"/v2/assets/reference-usage\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetAssetReferenceUsageResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.AssetReferenceUsageResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.AssetReferenceUsageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.AssetReferenceUsageClient.g.cs b/src/libs/Ideogram/Generated/Ideogram.AssetReferenceUsageClient.g.cs deleted file mode 100644 index 08e116db..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.AssetReferenceUsageClient.g.cs +++ /dev/null @@ -1,143 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// If no httpClient is provided, a new one will be created.
- /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. - ///
- public sealed partial class AssetReferenceUsageClient : global::Ideogram.IAssetReferenceUsageClient, global::System.IDisposable - { - /// - /// - /// - public const string DefaultBaseUrl = "https://api.ideogram.ai/"; - - private bool _disposeHttpClient = true; - - /// - public global::System.Net.Http.HttpClient HttpClient { get; } - - /// - public System.Uri? BaseUri => HttpClient.BaseAddress; - - /// - public global::System.Collections.Generic.List Authorizations { get; } - - /// - public bool ReadResponseAsString { get; set; } -#if DEBUG - = true; -#endif - - /// - public global::Ideogram.AutoSDKClientOptions Options { get; } - - internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::Ideogram.AssetReferenceUsageSourceGenerationContext.Default); - - /// - /// - /// - public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext - { - get => JsonSerializerContextProvider.Value; - set => JsonSerializerContextProvider = new(() => value); - } - - - /// - /// Creates a new instance of the AssetReferenceUsageClient. - /// If no httpClient is provided, a new one will be created. - /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. - /// - /// The HttpClient instance. If not provided, a new one will be created. - /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. - /// The authorizations to use for the requests. - /// Dispose the HttpClient when the instance is disposed. True by default. - public AssetReferenceUsageClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - bool disposeHttpClient = true) : this( - httpClient, - baseUri, - authorizations, - options: null, - disposeHttpClient: disposeHttpClient) - { - } - - /// - /// Creates a new instance of the AssetReferenceUsageClient with explicit options but no base URL override. - /// Skips passing baseUri so the default base URL from the OpenAPI spec applies. - /// - /// The HttpClient instance. If not provided, a new one will be created. - /// The authorizations to use for the requests. - /// Client-wide request defaults such as headers, query parameters, retries, and timeout. - /// Dispose the HttpClient when the instance is disposed. True by default. - public AssetReferenceUsageClient( - global::System.Net.Http.HttpClient? httpClient, - global::System.Collections.Generic.List? authorizations, - global::Ideogram.AutoSDKClientOptions? options, - bool disposeHttpClient = true) : this( - httpClient, - baseUri: null, - authorizations, - options, - disposeHttpClient: disposeHttpClient) - { - } - - /// - /// Creates a new instance of the AssetReferenceUsageClient. - /// If no httpClient is provided, a new one will be created. - /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. - /// - /// The HttpClient instance. If not provided, a new one will be created. - /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. - /// The authorizations to use for the requests. - /// Client-wide request defaults such as headers, query parameters, retries, and timeout. - /// Dispose the HttpClient when the instance is disposed. True by default. - public AssetReferenceUsageClient( - global::System.Net.Http.HttpClient? httpClient, - global::System.Uri? baseUri, - global::System.Collections.Generic.List? authorizations, - global::Ideogram.AutoSDKClientOptions? options, - bool disposeHttpClient = true) - { - - HttpClient = httpClient ?? new global::System.Net.Http.HttpClient(); - HttpClient.BaseAddress ??= baseUri ?? new global::System.Uri(DefaultBaseUrl); - Authorizations = authorizations ?? new global::System.Collections.Generic.List(); - Options = options ?? new global::Ideogram.AutoSDKClientOptions(); - _disposeHttpClient = disposeHttpClient; - - Initialized(HttpClient); - } - - /// - public void Dispose() - { - if (_disposeHttpClient) - { - HttpClient.Dispose(); - } - } - - partial void Initialized( - global::System.Net.Http.HttpClient client); - partial void PrepareArguments( - global::System.Net.Http.HttpClient client); - partial void PrepareRequest( - global::System.Net.Http.HttpClient client, - global::System.Net.Http.HttpRequestMessage request); - partial void ProcessResponse( - global::System.Net.Http.HttpClient client, - global::System.Net.Http.HttpResponseMessage response); - partial void ProcessResponseContent( - global::System.Net.Http.HttpClient client, - global::System.Net.Http.HttpResponseMessage response, - ref string content); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.AutoModel.JsonSerializerContext.g.cs b/src/libs/Ideogram/Generated/Ideogram.AutoModel.JsonSerializerContext.g.cs index 07754253..20ddc147 100644 --- a/src/libs/Ideogram/Generated/Ideogram.AutoModel.JsonSerializerContext.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.AutoModel.JsonSerializerContext.g.cs @@ -13,56 +13,52 @@ namespace Ideogram [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GeneratedImageObject))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(byte[]))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AssetIdentifier))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationErrorResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationRejectReason), TypeInfoPropertyName = "GenerationRejectReason2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed), TypeInfoPropertyName = "GenerationErrorResponseTaskCompletionSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GeneratedImageObject))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationErrorResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageGenerateAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier), TypeInfoPropertyName = "V2ImageGenerateAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MagicPromptMode), TypeInfoPropertyName = "MagicPromptMode2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageV2AutoResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramV4AspectRatio), TypeInfoPropertyName = "IdeogramV4AspectRatio2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramColorPalettePresetName), TypeInfoPropertyName = "IdeogramColorPalettePresetName2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramColorPaletteWithPresetName))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ColorPaletteMember))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ColorPaletteWithMembers))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramColorPalette), TypeInfoPropertyName = "IdeogramColorPalette2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramV3StyleType), TypeInfoPropertyName = "IdeogramV3StyleType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramV3StylePreset), TypeInfoPropertyName = "IdeogramV3StylePreset2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramV4AspectRatio), TypeInfoPropertyName = "IdeogramV4AspectRatio2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageV2AutoResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageV2AutoRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageV2AutoRequestResolutionTier), TypeInfoPropertyName = "GenerateImageV2AutoRequestResolutionTier2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageRemixAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier), TypeInfoPropertyName = "V2ImageRemixAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ToolRemixResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ToolRemixRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ToolRemixRequestResolutionTier), TypeInfoPropertyName = "ToolRemixRequestResolutionTier2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ColorPaletteWithMembers))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ColorPaletteMember))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AssetType), TypeInfoPropertyName = "AssetType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramColorPaletteWithPresetName))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramColorPalettePresetName), TypeInfoPropertyName = "IdeogramColorPalettePresetName2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(byte[]))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AutoModelPostGenerateImageV2AutoRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AutoModelPostToolRemixRequest))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationRejectReason?), TypeInfoPropertyName = "NullableGenerationRejectReason2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?), TypeInfoPropertyName = "NullableGenerationErrorResponseTaskCompletionSpeed2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageGenerateAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier?), TypeInfoPropertyName = "NullableV2ImageGenerateAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MagicPromptMode?), TypeInfoPropertyName = "NullableMagicPromptMode2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramV4AspectRatio?), TypeInfoPropertyName = "NullableIdeogramV4AspectRatio2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramColorPalettePresetName?), TypeInfoPropertyName = "NullableIdeogramColorPalettePresetName2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(double?))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramColorPalette?), TypeInfoPropertyName = "NullableIdeogramColorPalette2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramV3StyleType?), TypeInfoPropertyName = "NullableIdeogramV3StyleType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramV3StylePreset?), TypeInfoPropertyName = "NullableIdeogramV3StylePreset2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(double?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramV4AspectRatio?), TypeInfoPropertyName = "NullableIdeogramV4AspectRatio2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageV2AutoRequestResolutionTier?), TypeInfoPropertyName = "NullableGenerateImageV2AutoRequestResolutionTier2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ToolRemixRequestResolutionTier?), TypeInfoPropertyName = "NullableToolRemixRequestResolutionTier2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AssetType?), TypeInfoPropertyName = "NullableAssetType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramColorPalettePresetName?), TypeInfoPropertyName = "NullableIdeogramColorPalettePresetName2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageRemixAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier?), TypeInfoPropertyName = "NullableV2ImageRemixAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] internal sealed partial class AutoModelSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext { } @@ -133,30 +129,26 @@ private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Ser public override bool CanConvert(global::System.Type typeToConvert) { return - typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed) - - || typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?) - - || typeToConvert == typeof(global::Ideogram.GenerationRejectReason) + typeToConvert == typeof(global::Ideogram.GenerationRejectReason) || typeToConvert == typeof(global::Ideogram.GenerationRejectReason?) - || typeToConvert == typeof(global::Ideogram.GenerateImageV2AutoRequestResolutionTier) - - || typeToConvert == typeof(global::Ideogram.GenerateImageV2AutoRequestResolutionTier?) - - || typeToConvert == typeof(global::Ideogram.ToolRemixRequestResolutionTier) + || typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed) - || typeToConvert == typeof(global::Ideogram.ToolRemixRequestResolutionTier?) + || typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?) - || typeToConvert == typeof(global::Ideogram.AssetType) + || typeToConvert == typeof(global::Ideogram.V2ImageGenerateAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier) - || typeToConvert == typeof(global::Ideogram.AssetType?) + || typeToConvert == typeof(global::Ideogram.V2ImageGenerateAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier?) || typeToConvert == typeof(global::Ideogram.MagicPromptMode) || typeToConvert == typeof(global::Ideogram.MagicPromptMode?) + || typeToConvert == typeof(global::Ideogram.IdeogramV4AspectRatio) + + || typeToConvert == typeof(global::Ideogram.IdeogramV4AspectRatio?) + || typeToConvert == typeof(global::Ideogram.IdeogramColorPalettePresetName) || typeToConvert == typeof(global::Ideogram.IdeogramColorPalettePresetName?) @@ -169,25 +161,15 @@ public override bool CanConvert(global::System.Type typeToConvert) || typeToConvert == typeof(global::Ideogram.IdeogramV3StylePreset?) - || typeToConvert == typeof(global::Ideogram.IdeogramV4AspectRatio) + || typeToConvert == typeof(global::Ideogram.V2ImageRemixAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier) - || typeToConvert == typeof(global::Ideogram.IdeogramV4AspectRatio?); + || typeToConvert == typeof(global::Ideogram.V2ImageRemixAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier?); } public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) { - if (typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed)) - { - return new global::Ideogram.JsonConverters.GenerationErrorResponseTaskCompletionSpeedJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?)) - { - return new global::Ideogram.JsonConverters.GenerationErrorResponseTaskCompletionSpeedNullableJsonConverter(); - } - if (typeToConvert == typeof(global::Ideogram.GenerationRejectReason)) { return new global::Ideogram.JsonConverters.GenerationRejectReasonJsonConverter(); @@ -198,44 +180,44 @@ public override bool CanConvert(global::System.Type typeToConvert) return new global::Ideogram.JsonConverters.GenerationRejectReasonNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.GenerateImageV2AutoRequestResolutionTier)) + if (typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed)) { - return new global::Ideogram.JsonConverters.GenerateImageV2AutoRequestResolutionTierJsonConverter(); + return new global::Ideogram.JsonConverters.GenerationErrorResponseTaskCompletionSpeedJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.GenerateImageV2AutoRequestResolutionTier?)) + if (typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?)) { - return new global::Ideogram.JsonConverters.GenerateImageV2AutoRequestResolutionTierNullableJsonConverter(); + return new global::Ideogram.JsonConverters.GenerationErrorResponseTaskCompletionSpeedNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.ToolRemixRequestResolutionTier)) + if (typeToConvert == typeof(global::Ideogram.V2ImageGenerateAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier)) { - return new global::Ideogram.JsonConverters.ToolRemixRequestResolutionTierJsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageGenerateAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTierJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.ToolRemixRequestResolutionTier?)) + if (typeToConvert == typeof(global::Ideogram.V2ImageGenerateAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier?)) { - return new global::Ideogram.JsonConverters.ToolRemixRequestResolutionTierNullableJsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageGenerateAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTierNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.AssetType)) + if (typeToConvert == typeof(global::Ideogram.MagicPromptMode)) { - return new global::Ideogram.JsonConverters.AssetTypeJsonConverter(); + return new global::Ideogram.JsonConverters.MagicPromptModeJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.AssetType?)) + if (typeToConvert == typeof(global::Ideogram.MagicPromptMode?)) { - return new global::Ideogram.JsonConverters.AssetTypeNullableJsonConverter(); + return new global::Ideogram.JsonConverters.MagicPromptModeNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.MagicPromptMode)) + if (typeToConvert == typeof(global::Ideogram.IdeogramV4AspectRatio)) { - return new global::Ideogram.JsonConverters.MagicPromptModeJsonConverter(); + return new global::Ideogram.JsonConverters.IdeogramV4AspectRatioJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.MagicPromptMode?)) + if (typeToConvert == typeof(global::Ideogram.IdeogramV4AspectRatio?)) { - return new global::Ideogram.JsonConverters.MagicPromptModeNullableJsonConverter(); + return new global::Ideogram.JsonConverters.IdeogramV4AspectRatioNullableJsonConverter(); } if (typeToConvert == typeof(global::Ideogram.IdeogramColorPalettePresetName)) @@ -268,14 +250,14 @@ public override bool CanConvert(global::System.Type typeToConvert) return new global::Ideogram.JsonConverters.IdeogramV3StylePresetNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.IdeogramV4AspectRatio)) + if (typeToConvert == typeof(global::Ideogram.V2ImageRemixAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier)) { - return new global::Ideogram.JsonConverters.IdeogramV4AspectRatioJsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageRemixAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTierJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.IdeogramV4AspectRatio?)) + if (typeToConvert == typeof(global::Ideogram.V2ImageRemixAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier?)) { - return new global::Ideogram.JsonConverters.IdeogramV4AspectRatioNullableJsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageRemixAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTierNullableJsonConverter(); } throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); } diff --git a/src/libs/Ideogram/Generated/Ideogram.AutoModelClient.AutoModelPostGenerateImageV2Auto.g.cs b/src/libs/Ideogram/Generated/Ideogram.AutoModelClient.AutoModelPostGenerateImageV2Auto.g.cs new file mode 100644 index 00000000..4a27bc18 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.AutoModelClient.AutoModelPostGenerateImageV2Auto.g.cs @@ -0,0 +1,938 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class AutoModelClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_AutoModelPostGenerateImageV2AutoSecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_AutoModelPostGenerateImageV2AutoSecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_AutoModelPostGenerateImageV2AutoSecurityRequirement0, + }; + partial void PrepareAutoModelPostGenerateImageV2AutoArguments( + global::System.Net.Http.HttpClient httpClient, + ref bool? dryRun, + global::Ideogram.AutoModelPostGenerateImageV2AutoRequest request); + partial void PrepareAutoModelPostGenerateImageV2AutoRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + bool? dryRun, + global::Ideogram.AutoModelPostGenerateImageV2AutoRequest request); + partial void ProcessAutoModelPostGenerateImageV2AutoResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessAutoModelPostGenerateImageV2AutoResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Generate with automatic model selection
+ /// Generate images with the model Ideogram picks as best suited to each
+ /// request. Optionally upload source images as `images` using
+ /// `multipart/form-data` to edit them with the prompt. Returns results
+ /// directly by default; set `async` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task AutoModelPostGenerateImageV2AutoAsync( + + global::Ideogram.AutoModelPostGenerateImageV2AutoRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AutoModelPostGenerateImageV2AutoAsResponseAsync( + + request: request, + dryRun: dryRun, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Generate with automatic model selection
+ /// Generate images with the model Ideogram picks as best suited to each
+ /// request. Optionally upload source images as `images` using
+ /// `multipart/form-data` to edit them with the prompt. Returns results
+ /// directly by default; set `async` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> AutoModelPostGenerateImageV2AutoAsResponseAsync( + + global::Ideogram.AutoModelPostGenerateImageV2AutoRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareAutoModelPostGenerateImageV2AutoArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_AutoModelPostGenerateImageV2AutoSecurityRequirements, + operationName: "AutoModelPostGenerateImageV2AutoAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/generate/auto", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + if (request.Images != default) + { + + for (var __iImages = 0; __iImages < request.Images.Count; __iImages++) + { + var __contentImages = new global::System.Net.Http.ByteArrayContent(request.Images[__iImages]); + __contentImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); + __httpRequestContent.Add( + content: __contentImages, + name: "\"images\"", + fileName: $"\"file{__iImages}.bin\""); + if (__contentImages.Headers.ContentDisposition != null) + { + __contentImages.Headers.ContentDisposition.FileNameStar = null; + } + } + + } + if (request.NegativePrompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.NegativePrompt ?? string.Empty), + name: "\"negative_prompt\""); + + } + if (request.AspectRatio != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.AspectRatio ?? string.Empty), + name: "\"aspect_ratio\""); + + } + if (request.Resolution != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Resolution ?? string.Empty), + name: "\"resolution\""); + + } + if (request.ResolutionTier != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.ResolutionTier).HasValue ? (request.ResolutionTier).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"resolution_tier\""); + + } + if (request.MagicPrompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.MagicPrompt).HasValue ? (request.MagicPrompt).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"magic_prompt\""); + + } + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (request.Private != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"private\""); + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareAutoModelPostGenerateImageV2AutoRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AutoModelPostGenerateImageV2Auto", + methodName: "AutoModelPostGenerateImageV2AutoAsync", + pathTemplate: "\"/v2/image/generate/auto\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AutoModelPostGenerateImageV2Auto", + methodName: "AutoModelPostGenerateImageV2AutoAsync", + pathTemplate: "\"/v2/image/generate/auto\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AutoModelPostGenerateImageV2Auto", + methodName: "AutoModelPostGenerateImageV2AutoAsync", + pathTemplate: "\"/v2/image/generate/auto\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessAutoModelPostGenerateImageV2AutoResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AutoModelPostGenerateImageV2Auto", + methodName: "AutoModelPostGenerateImageV2AutoAsync", + pathTemplate: "\"/v2/image/generate/auto\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AutoModelPostGenerateImageV2Auto", + methodName: "AutoModelPostGenerateImageV2AutoAsync", + pathTemplate: "\"/v2/image/generate/auto\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // A source image was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks, or the request combined source images with text-to-image-only fields. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessAutoModelPostGenerateImageV2AutoResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.GenerateImageV2AutoResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.GenerateImageV2AutoResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Generate with automatic model selection
+ /// Generate images with the model Ideogram picks as best suited to each
+ /// request. Optionally upload source images as `images` using
+ /// `multipart/form-data` to edit them with the prompt. Returns results
+ /// directly by default; set `async` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt to generate images from or, when source images are supplied, the change to make to them. + /// + /// + /// Optional source images to edit (max 10, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only. + /// + /// + /// Description of what to exclude from the images. The prompt takes precedence over the negative prompt. Not every model uses it. Cannot be combined with source images. + /// + /// + /// The output aspect ratio. `auto` (the default) picks the most suitable ratio for the request. Without source images the value must be a supported ratio (for example "16x9" or "1x1"); with source images any "WIDTHxHEIGHT" value is accepted and the output uses the closest supported shape. Omit `resolution` when supplying a non-`auto` value.
+ /// Default Value: auto + /// + /// + /// The requested output resolution, formatted as "WIDTHxHEIGHT" (for example "1280x800"). The output is served at the closest resolution the selected model supports. Omit `aspect_ratio` (or leave it `auto`) when supplying a resolution. + /// + /// + /// The output resolution tier. Affects which model serves the request, since not every model offers every tier. When omitted, the selected model's default tier is used. + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// Whether the generated images should be kept private. When omitted, the default follows the caller's plan; some plans always generate privately. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task AutoModelPostGenerateImageV2AutoAsync( + string prompt, + bool? dryRun = default, + global::System.Collections.Generic.IList? images = default, + string? negativePrompt = default, + string? aspectRatio = default, + string? resolution = default, + global::Ideogram.V2ImageGenerateAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier? resolutionTier = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + int? numImages = default, + int? seed = default, + bool? @private = default, + bool? async = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Ideogram.AutoModelPostGenerateImageV2AutoRequest + { + Prompt = prompt, + Images = images, + NegativePrompt = negativePrompt, + AspectRatio = aspectRatio, + Resolution = resolution, + ResolutionTier = resolutionTier, + MagicPrompt = magicPrompt, + NumImages = numImages, + Seed = seed, + Private = @private, + Async = async, + }; + + return await AutoModelPostGenerateImageV2AutoAsync( + dryRun: dryRun, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.AutoModelClient.AutoModelPostToolRemix.g.cs b/src/libs/Ideogram/Generated/Ideogram.AutoModelClient.AutoModelPostToolRemix.g.cs new file mode 100644 index 00000000..67eefe8c --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.AutoModelClient.AutoModelPostToolRemix.g.cs @@ -0,0 +1,2924 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class AutoModelClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_AutoModelPostToolRemixSecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_AutoModelPostToolRemixSecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_AutoModelPostToolRemixSecurityRequirement0, + }; + partial void PrepareAutoModelPostToolRemixArguments( + global::System.Net.Http.HttpClient httpClient, + ref bool? dryRun, + global::Ideogram.AutoModelPostToolRemixRequest request); + partial void PrepareAutoModelPostToolRemixRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + bool? dryRun, + global::Ideogram.AutoModelPostToolRemixRequest request); + partial void ProcessAutoModelPostToolRemixResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessAutoModelPostToolRemixResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Remix with automatic model selection
+ /// Remix an image guided by a text prompt, with Ideogram choosing the
+ /// model. Upload the source image as `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task AutoModelPostToolRemixAsync( + + global::Ideogram.AutoModelPostToolRemixRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AutoModelPostToolRemixAsResponseAsync( + + request: request, + dryRun: dryRun, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Remix with automatic model selection
+ /// Remix an image guided by a text prompt, with Ideogram choosing the
+ /// model. Upload the source image as `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> AutoModelPostToolRemixAsResponseAsync( + + global::Ideogram.AutoModelPostToolRemixRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareAutoModelPostToolRemixArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_AutoModelPostToolRemixSecurityRequirements, + operationName: "AutoModelPostToolRemixAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/remix/auto", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.ImageWeight != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.ImageWeight, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"image_weight\""); + + } + if (request.NegativePrompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.NegativePrompt ?? string.Empty), + name: "\"negative_prompt\""); + + } + if (request.Resolution != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Resolution ?? string.Empty), + name: "\"resolution\""); + + } + if (request.AspectRatio != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.AspectRatio).HasValue ? (request.AspectRatio).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"aspect_ratio\""); + + } + if (request.ResolutionTier != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.ResolutionTier).HasValue ? (request.ResolutionTier).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"resolution_tier\""); + + } + if (request.MagicPrompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.MagicPrompt).HasValue ? (request.MagicPrompt).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"magic_prompt\""); + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (request.StylePreset != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.StylePreset).HasValue ? (request.StylePreset).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"style_preset\""); + + } + if (request.ColorPalette != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.ColorPalette.ToString() ?? string.Empty), + name: "\"color_palette\""); + + } + if (request.StyleCodes != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.StyleCodes!, x => x))}]"), + name: "\"style_codes\""); + + } + if (request.StyleType != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.StyleType).HasValue ? (request.StyleType).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"style_type\""); + + } + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.EnableCopyrightDetection != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"enable_copyright_detection\""); + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareAutoModelPostToolRemixRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AutoModelPostToolRemix", + methodName: "AutoModelPostToolRemixAsync", + pathTemplate: "\"/v2/image/remix/auto\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AutoModelPostToolRemix", + methodName: "AutoModelPostToolRemixAsync", + pathTemplate: "\"/v2/image/remix/auto\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AutoModelPostToolRemix", + methodName: "AutoModelPostToolRemixAsync", + pathTemplate: "\"/v2/image/remix/auto\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessAutoModelPostToolRemixResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AutoModelPostToolRemix", + methodName: "AutoModelPostToolRemixAsync", + pathTemplate: "\"/v2/image/remix/auto\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AutoModelPostToolRemix", + methodName: "AutoModelPostToolRemixAsync", + pathTemplate: "\"/v2/image/remix/auto\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // A referenced resource was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessAutoModelPostToolRemixResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.ToolRemixResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.ToolRemixResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Remix with automatic model selection
+ /// Remix an image guided by a text prompt, with Ideogram choosing the
+ /// model. Upload the source image as `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt that guides the remix. + /// + /// + /// The image to remix (max 50MB; JPEG, PNG, or WEBP). Multipart requests only. The image is used only for this request and is not saved to your account. + /// + /// + /// The image to remix (max 50MB; JPEG, PNG, or WEBP). Multipart requests only. The image is used only for this request and is not saved to your account. + /// + /// + /// Optional. How closely the result should follow the source image, from 1 to 100. When omitted the selected model chooses its usual strength. Combining a weight with a `resolution` or `aspect_ratio` that changes the source's aspect ratio crops the source to the new shape; this is only available at the 1K tier and is rejected at 2K. + /// + /// + /// Description of what to exclude from the images. The prompt takes precedence over the negative prompt. Not every model uses it. + /// + /// + /// The requested output resolution, formatted as "WIDTHxHEIGHT" (for example "1280x800"). The output uses the closest supported resolution in the matching 1K or 2K tier. Omit `aspect_ratio` when supplying a resolution. If `resolution_tier` is also supplied, it must match the tier these dimensions fall in. Combining a shape-changing value with `image_weight` requires the 1K tier. + /// + /// + /// The requested output aspect ratio. Omit it to keep the source image's shape. `auto` also keeps the source shape. Omit `resolution` when supplying a concrete value. Combining a shape-changing value with `image_weight` requires the 1K tier.
+ /// Default Value: auto + /// + /// + /// The output resolution tier. When omitted, the tier is inferred from `resolution`, or defaults to 1k. A color palette, style codes, style preset, or non-`auto` style type are only supported at 1k. + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`. The selected model decides how to interpret it.
+ /// Default Value: auto + /// + /// + /// Optional. Only honored when the request uses a model that supports reproducible remixes; results from the default model are not reproducible. The response reports the seed used. + /// + /// + /// A predefined style preset to apply. Limits the request to a model that supports it and requires the 1K resolution tier. Cannot be combined with style codes. + /// + /// + /// A color palette to apply. Limits the request to a model that supports palettes and requires the 1K resolution tier. + /// + /// + /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images. + /// + /// + /// The style type to generate with. A value other than `auto` limits the request to a model that supports it and requires the 1K resolution tier.
+ /// Default Value: general + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task AutoModelPostToolRemixAsync( + string prompt, + byte[] image, + string imagename, + bool? dryRun = default, + int? imageWeight = default, + string? negativePrompt = default, + string? resolution = default, + global::Ideogram.IdeogramV4AspectRatio? aspectRatio = default, + global::Ideogram.V2ImageRemixAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier? resolutionTier = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + int? seed = default, + global::Ideogram.IdeogramV3StylePreset? stylePreset = default, + global::Ideogram.IdeogramColorPalette? colorPalette = default, + global::System.Collections.Generic.IList? styleCodes = default, + global::Ideogram.IdeogramV3StyleType? styleType = default, + int? numImages = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Ideogram.AutoModelPostToolRemixRequest + { + Prompt = prompt, + Image = image, + Imagename = imagename, + ImageWeight = imageWeight, + NegativePrompt = negativePrompt, + Resolution = resolution, + AspectRatio = aspectRatio, + ResolutionTier = resolutionTier, + MagicPrompt = magicPrompt, + Seed = seed, + StylePreset = stylePreset, + ColorPalette = colorPalette, + StyleCodes = styleCodes, + StyleType = styleType, + NumImages = numImages, + EnableCopyrightDetection = enableCopyrightDetection, + Async = async, + WebhookUrl = webhookUrl, + }; + + return await AutoModelPostToolRemixAsync( + dryRun: dryRun, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// Remix with automatic model selection
+ /// Remix an image guided by a text prompt, with Ideogram choosing the
+ /// model. Upload the source image as `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt that guides the remix. + /// + /// + /// The image to remix (max 50MB; JPEG, PNG, or WEBP). Multipart requests only. The image is used only for this request and is not saved to your account. + /// + /// + /// The image to remix (max 50MB; JPEG, PNG, or WEBP). Multipart requests only. The image is used only for this request and is not saved to your account. + /// + /// + /// Optional. How closely the result should follow the source image, from 1 to 100. When omitted the selected model chooses its usual strength. Combining a weight with a `resolution` or `aspect_ratio` that changes the source's aspect ratio crops the source to the new shape; this is only available at the 1K tier and is rejected at 2K. + /// + /// + /// Description of what to exclude from the images. The prompt takes precedence over the negative prompt. Not every model uses it. + /// + /// + /// The requested output resolution, formatted as "WIDTHxHEIGHT" (for example "1280x800"). The output uses the closest supported resolution in the matching 1K or 2K tier. Omit `aspect_ratio` when supplying a resolution. If `resolution_tier` is also supplied, it must match the tier these dimensions fall in. Combining a shape-changing value with `image_weight` requires the 1K tier. + /// + /// + /// The requested output aspect ratio. Omit it to keep the source image's shape. `auto` also keeps the source shape. Omit `resolution` when supplying a concrete value. Combining a shape-changing value with `image_weight` requires the 1K tier.
+ /// Default Value: auto + /// + /// + /// The output resolution tier. When omitted, the tier is inferred from `resolution`, or defaults to 1k. A color palette, style codes, style preset, or non-`auto` style type are only supported at 1k. + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`. The selected model decides how to interpret it.
+ /// Default Value: auto + /// + /// + /// Optional. Only honored when the request uses a model that supports reproducible remixes; results from the default model are not reproducible. The response reports the seed used. + /// + /// + /// A predefined style preset to apply. Limits the request to a model that supports it and requires the 1K resolution tier. Cannot be combined with style codes. + /// + /// + /// A color palette to apply. Limits the request to a model that supports palettes and requires the 1K resolution tier. + /// + /// + /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images. + /// + /// + /// The style type to generate with. A value other than `auto` limits the request to a model that supports it and requires the 1K resolution tier.
+ /// Default Value: general + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task AutoModelPostToolRemixAsync( + string prompt, + global::System.IO.Stream image, + string imagename, + bool? dryRun = default, + int? imageWeight = default, + string? negativePrompt = default, + string? resolution = default, + global::Ideogram.IdeogramV4AspectRatio? aspectRatio = default, + global::Ideogram.V2ImageRemixAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier? resolutionTier = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + int? seed = default, + global::Ideogram.IdeogramV3StylePreset? stylePreset = default, + global::Ideogram.IdeogramColorPalette? colorPalette = default, + global::System.Collections.Generic.IList? styleCodes = default, + global::Ideogram.IdeogramV3StyleType? styleType = default, + int? numImages = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + var request = new global::Ideogram.AutoModelPostToolRemixRequest + { + Prompt = prompt, + Image = global::System.Array.Empty(), + Imagename = imagename, + ImageWeight = imageWeight, + NegativePrompt = negativePrompt, + Resolution = resolution, + AspectRatio = aspectRatio, + ResolutionTier = resolutionTier, + MagicPrompt = magicPrompt, + Seed = seed, + StylePreset = stylePreset, + ColorPalette = colorPalette, + StyleCodes = styleCodes, + StyleType = styleType, + NumImages = numImages, + EnableCopyrightDetection = enableCopyrightDetection, + Async = async, + WebhookUrl = webhookUrl, + }; + PrepareArguments( + client: HttpClient); + PrepareAutoModelPostToolRemixArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_AutoModelPostToolRemixSecurityRequirements, + operationName: "AutoModelPostToolRemixAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/remix/auto", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.ImageWeight != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.ImageWeight, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"image_weight\""); + + } + if (request.NegativePrompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.NegativePrompt ?? string.Empty), + name: "\"negative_prompt\""); + + } + if (request.Resolution != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Resolution ?? string.Empty), + name: "\"resolution\""); + + } + if (request.AspectRatio != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.AspectRatio).HasValue ? (request.AspectRatio).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"aspect_ratio\""); + + } + if (request.ResolutionTier != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.ResolutionTier).HasValue ? (request.ResolutionTier).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"resolution_tier\""); + + } + if (request.MagicPrompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.MagicPrompt).HasValue ? (request.MagicPrompt).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"magic_prompt\""); + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (request.StylePreset != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.StylePreset).HasValue ? (request.StylePreset).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"style_preset\""); + + } + if (request.ColorPalette != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.ColorPalette.ToString() ?? string.Empty), + name: "\"color_palette\""); + + } + if (request.StyleCodes != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.StyleCodes!, x => x))}]"), + name: "\"style_codes\""); + + } + if (request.StyleType != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.StyleType).HasValue ? (request.StyleType).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"style_type\""); + + } + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.EnableCopyrightDetection != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"enable_copyright_detection\""); + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareAutoModelPostToolRemixRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AutoModelPostToolRemix", + methodName: "AutoModelPostToolRemixAsync", + pathTemplate: "\"/v2/image/remix/auto\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AutoModelPostToolRemix", + methodName: "AutoModelPostToolRemixAsync", + pathTemplate: "\"/v2/image/remix/auto\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AutoModelPostToolRemix", + methodName: "AutoModelPostToolRemixAsync", + pathTemplate: "\"/v2/image/remix/auto\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessAutoModelPostToolRemixResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AutoModelPostToolRemix", + methodName: "AutoModelPostToolRemixAsync", + pathTemplate: "\"/v2/image/remix/auto\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AutoModelPostToolRemix", + methodName: "AutoModelPostToolRemixAsync", + pathTemplate: "\"/v2/image/remix/auto\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // A referenced resource was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessAutoModelPostToolRemixResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::Ideogram.ToolRemixResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::Ideogram.ToolRemixResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Remix with automatic model selection
+ /// Remix an image guided by a text prompt, with Ideogram choosing the
+ /// model. Upload the source image as `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt that guides the remix. + /// + /// + /// The image to remix (max 50MB; JPEG, PNG, or WEBP). Multipart requests only. The image is used only for this request and is not saved to your account. + /// + /// + /// The image to remix (max 50MB; JPEG, PNG, or WEBP). Multipart requests only. The image is used only for this request and is not saved to your account. + /// + /// + /// Optional. How closely the result should follow the source image, from 1 to 100. When omitted the selected model chooses its usual strength. Combining a weight with a `resolution` or `aspect_ratio` that changes the source's aspect ratio crops the source to the new shape; this is only available at the 1K tier and is rejected at 2K. + /// + /// + /// Description of what to exclude from the images. The prompt takes precedence over the negative prompt. Not every model uses it. + /// + /// + /// The requested output resolution, formatted as "WIDTHxHEIGHT" (for example "1280x800"). The output uses the closest supported resolution in the matching 1K or 2K tier. Omit `aspect_ratio` when supplying a resolution. If `resolution_tier` is also supplied, it must match the tier these dimensions fall in. Combining a shape-changing value with `image_weight` requires the 1K tier. + /// + /// + /// The requested output aspect ratio. Omit it to keep the source image's shape. `auto` also keeps the source shape. Omit `resolution` when supplying a concrete value. Combining a shape-changing value with `image_weight` requires the 1K tier.
+ /// Default Value: auto + /// + /// + /// The output resolution tier. When omitted, the tier is inferred from `resolution`, or defaults to 1k. A color palette, style codes, style preset, or non-`auto` style type are only supported at 1k. + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`. The selected model decides how to interpret it.
+ /// Default Value: auto + /// + /// + /// Optional. Only honored when the request uses a model that supports reproducible remixes; results from the default model are not reproducible. The response reports the seed used. + /// + /// + /// A predefined style preset to apply. Limits the request to a model that supports it and requires the 1K resolution tier. Cannot be combined with style codes. + /// + /// + /// A color palette to apply. Limits the request to a model that supports palettes and requires the 1K resolution tier. + /// + /// + /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images. + /// + /// + /// The style type to generate with. A value other than `auto` limits the request to a model that supports it and requires the 1K resolution tier.
+ /// Default Value: general + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> AutoModelPostToolRemixAsResponseAsync( + string prompt, + global::System.IO.Stream image, + string imagename, + bool? dryRun = default, + int? imageWeight = default, + string? negativePrompt = default, + string? resolution = default, + global::Ideogram.IdeogramV4AspectRatio? aspectRatio = default, + global::Ideogram.V2ImageRemixAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier? resolutionTier = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + int? seed = default, + global::Ideogram.IdeogramV3StylePreset? stylePreset = default, + global::Ideogram.IdeogramColorPalette? colorPalette = default, + global::System.Collections.Generic.IList? styleCodes = default, + global::Ideogram.IdeogramV3StyleType? styleType = default, + int? numImages = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + var request = new global::Ideogram.AutoModelPostToolRemixRequest + { + Prompt = prompt, + Image = global::System.Array.Empty(), + Imagename = imagename, + ImageWeight = imageWeight, + NegativePrompt = negativePrompt, + Resolution = resolution, + AspectRatio = aspectRatio, + ResolutionTier = resolutionTier, + MagicPrompt = magicPrompt, + Seed = seed, + StylePreset = stylePreset, + ColorPalette = colorPalette, + StyleCodes = styleCodes, + StyleType = styleType, + NumImages = numImages, + EnableCopyrightDetection = enableCopyrightDetection, + Async = async, + WebhookUrl = webhookUrl, + }; + PrepareArguments( + client: HttpClient); + PrepareAutoModelPostToolRemixArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_AutoModelPostToolRemixSecurityRequirements, + operationName: "AutoModelPostToolRemixAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/remix/auto", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.ImageWeight != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.ImageWeight, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"image_weight\""); + + } + if (request.NegativePrompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.NegativePrompt ?? string.Empty), + name: "\"negative_prompt\""); + + } + if (request.Resolution != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Resolution ?? string.Empty), + name: "\"resolution\""); + + } + if (request.AspectRatio != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.AspectRatio).HasValue ? (request.AspectRatio).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"aspect_ratio\""); + + } + if (request.ResolutionTier != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.ResolutionTier).HasValue ? (request.ResolutionTier).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"resolution_tier\""); + + } + if (request.MagicPrompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.MagicPrompt).HasValue ? (request.MagicPrompt).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"magic_prompt\""); + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (request.StylePreset != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.StylePreset).HasValue ? (request.StylePreset).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"style_preset\""); + + } + if (request.ColorPalette != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.ColorPalette.ToString() ?? string.Empty), + name: "\"color_palette\""); + + } + if (request.StyleCodes != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.StyleCodes!, x => x))}]"), + name: "\"style_codes\""); + + } + if (request.StyleType != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.StyleType).HasValue ? (request.StyleType).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"style_type\""); + + } + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.EnableCopyrightDetection != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"enable_copyright_detection\""); + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareAutoModelPostToolRemixRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AutoModelPostToolRemix", + methodName: "AutoModelPostToolRemixAsync", + pathTemplate: "\"/v2/image/remix/auto\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AutoModelPostToolRemix", + methodName: "AutoModelPostToolRemixAsync", + pathTemplate: "\"/v2/image/remix/auto\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AutoModelPostToolRemix", + methodName: "AutoModelPostToolRemixAsync", + pathTemplate: "\"/v2/image/remix/auto\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessAutoModelPostToolRemixResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AutoModelPostToolRemix", + methodName: "AutoModelPostToolRemixAsync", + pathTemplate: "\"/v2/image/remix/auto\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AutoModelPostToolRemix", + methodName: "AutoModelPostToolRemixAsync", + pathTemplate: "\"/v2/image/remix/auto\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // A referenced resource was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessAutoModelPostToolRemixResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.ToolRemixResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.ToolRemixResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.AutoModelClient.PostGenerateImageV2Auto.g.cs b/src/libs/Ideogram/Generated/Ideogram.AutoModelClient.PostGenerateImageV2Auto.g.cs deleted file mode 100644 index 09016c19..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.AutoModelClient.PostGenerateImageV2Auto.g.cs +++ /dev/null @@ -1,961 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class AutoModelClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostGenerateImageV2AutoSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostGenerateImageV2AutoSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostGenerateImageV2AutoSecurityRequirement0, - }; - partial void PreparePostGenerateImageV2AutoArguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? dryRun, - global::Ideogram.GenerateImageV2AutoRequest request); - partial void PreparePostGenerateImageV2AutoRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? dryRun, - global::Ideogram.GenerateImageV2AutoRequest request); - partial void ProcessPostGenerateImageV2AutoResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostGenerateImageV2AutoResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Generate with automatic model selection
- /// Generate images with the model Ideogram picks as best suited to each
- /// request. Optionally upload source images as `images` using
- /// `multipart/form-data` to edit them with the prompt. Returns results
- /// directly by default; set `async` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageV2AutoAsync( - - global::Ideogram.GenerateImageV2AutoRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostGenerateImageV2AutoAsResponseAsync( - - request: request, - dryRun: dryRun, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Generate with automatic model selection
- /// Generate images with the model Ideogram picks as best suited to each
- /// request. Optionally upload source images as `images` using
- /// `multipart/form-data` to edit them with the prompt. Returns results
- /// directly by default; set `async` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostGenerateImageV2AutoAsResponseAsync( - - global::Ideogram.GenerateImageV2AutoRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostGenerateImageV2AutoArguments( - httpClient: HttpClient, - dryRun: ref dryRun, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostGenerateImageV2AutoSecurityRequirements, - operationName: "PostGenerateImageV2AutoAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/image/generate/auto", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - if (request.ImageAssetIdentifiers != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.ImageAssetIdentifiers!, x => x.ToJson(JsonSerializerContext)))}]"), - name: "\"image_asset_identifiers\""); - - } - if (request.Images != default) - { - - for (var __iImages = 0; __iImages < request.Images.Count; __iImages++) - { - var __contentImages = new global::System.Net.Http.ByteArrayContent(request.Images[__iImages]); - __contentImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); - __httpRequestContent.Add( - content: __contentImages, - name: "\"images\"", - fileName: $"\"file{__iImages}.bin\""); - if (__contentImages.Headers.ContentDisposition != null) - { - __contentImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - if (request.NegativePrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.NegativePrompt ?? string.Empty), - name: "\"negative_prompt\""); - - } - if (request.StyleReferenceAssetIdentifiers != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.StyleReferenceAssetIdentifiers!, x => x.ToJson(JsonSerializerContext)))}]"), - name: "\"style_reference_asset_identifiers\""); - - } - if (request.AspectRatio != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.AspectRatio ?? string.Empty), - name: "\"aspect_ratio\""); - - } - if (request.Resolution != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Resolution ?? string.Empty), - name: "\"resolution\""); - - } - if (request.ResolutionTier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.ResolutionTier).HasValue ? (request.ResolutionTier).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"resolution_tier\""); - - } - if (request.MagicPrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.MagicPrompt).HasValue ? (request.MagicPrompt).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"magic_prompt\""); - - } - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.Private != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"private\""); - - } - if (request.TargetCollectionId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.TargetCollectionId ?? string.Empty), - name: "\"target_collection_id\""); - - } - if (request.CategoryId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.CategoryId ?? string.Empty), - name: "\"category_id\""); - - } - if (request.Async != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"async\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostGenerateImageV2AutoRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - dryRun: dryRun, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2Auto", - methodName: "PostGenerateImageV2AutoAsync", - pathTemplate: "\"/v2/image/generate/auto\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2Auto", - methodName: "PostGenerateImageV2AutoAsync", - pathTemplate: "\"/v2/image/generate/auto\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2Auto", - methodName: "PostGenerateImageV2AutoAsync", - pathTemplate: "\"/v2/image/generate/auto\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostGenerateImageV2AutoResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2Auto", - methodName: "PostGenerateImageV2AutoAsync", - pathTemplate: "\"/v2/image/generate/auto\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2Auto", - methodName: "PostGenerateImageV2AutoAsync", - pathTemplate: "\"/v2/image/generate/auto\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 500) - { - string? __content_500 = null; - global::System.Exception? __exception_500 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_500 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_500, - responseBody: __content_500, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostGenerateImageV2AutoResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.GenerateImageV2AutoResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.GenerateImageV2AutoResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Generate with automatic model selection
- /// Generate images with the model Ideogram picks as best suited to each
- /// request. Optionally upload source images as `images` using
- /// `multipart/form-data` to edit them with the prompt. Returns results
- /// directly by default; set `async` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// The prompt to generate images from or, when source images are supplied, the change to make to them. - /// - /// - /// Existing upload or generated image assets to transform, by reference. Takes priority over `images` if both are supplied. Supplying sources turns the request into a transform. - /// - /// - /// Optional source images to edit (max 10, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only. - /// - /// - /// Description of what to exclude from the images. The prompt takes precedence over the negative prompt. Not every model uses it. Cannot be combined with source images. - /// - /// - /// Existing upload or generated image assets whose style should guide the generation, by reference. Cannot be combined with source images. - /// - /// - /// The output aspect ratio. `auto` (the default) picks the most suitable ratio for the request. Without source images the value must be a supported ratio (for example "16x9" or "1x1"); with source images any "WIDTHxHEIGHT" value is accepted and the output uses the closest supported shape. Omit `resolution` when supplying a non-`auto` value.
- /// Default Value: auto - /// - /// - /// The requested output resolution, formatted as "WIDTHxHEIGHT" (for example "1280x800"). The output is served at the closest resolution the selected model supports. Omit `aspect_ratio` (or leave it `auto`) when supplying a resolution. - /// - /// - /// The output resolution tier. Affects which model serves the request, since not every model offers every tier. When omitted, the selected model's default tier is used. - /// - /// - /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
- /// Default Value: auto - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// Whether the generated images should be kept private. When omitted, the default follows the caller's plan; some plans always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - /// - /// The internal generation category to attribute to the output, as a URL-safe base64 UUID without padding. Only applies when source images are supplied. - /// - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageV2AutoAsync( - string prompt, - bool? dryRun = default, - global::System.Collections.Generic.IList? imageAssetIdentifiers = default, - global::System.Collections.Generic.IList? images = default, - string? negativePrompt = default, - global::System.Collections.Generic.IList? styleReferenceAssetIdentifiers = default, - string? aspectRatio = default, - string? resolution = default, - global::Ideogram.GenerateImageV2AutoRequestResolutionTier? resolutionTier = default, - global::Ideogram.MagicPromptMode? magicPrompt = default, - int? numImages = default, - int? seed = default, - bool? @private = default, - string? targetCollectionId = default, - string? categoryId = default, - bool? async = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.GenerateImageV2AutoRequest - { - Prompt = prompt, - ImageAssetIdentifiers = imageAssetIdentifiers, - Images = images, - NegativePrompt = negativePrompt, - StyleReferenceAssetIdentifiers = styleReferenceAssetIdentifiers, - AspectRatio = aspectRatio, - Resolution = resolution, - ResolutionTier = resolutionTier, - MagicPrompt = magicPrompt, - NumImages = numImages, - Seed = seed, - Private = @private, - TargetCollectionId = targetCollectionId, - CategoryId = categoryId, - Async = async, - }; - - return await PostGenerateImageV2AutoAsync( - dryRun: dryRun, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.AutoModelClient.PostToolRemix.g.cs b/src/libs/Ideogram/Generated/Ideogram.AutoModelClient.PostToolRemix.g.cs deleted file mode 100644 index 2ad688bf..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.AutoModelClient.PostToolRemix.g.cs +++ /dev/null @@ -1,1102 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class AutoModelClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostToolRemixSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostToolRemixSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostToolRemixSecurityRequirement0, - }; - partial void PreparePostToolRemixArguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? dryRun, - global::Ideogram.ToolRemixRequest request); - partial void PreparePostToolRemixRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? dryRun, - global::Ideogram.ToolRemixRequest request); - partial void ProcessPostToolRemixResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostToolRemixResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Remix with automatic model selection
- /// Remix an image guided by a text prompt, with Ideogram choosing the
- /// model. Upload the source image as `image` using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostToolRemixAsync( - - global::Ideogram.ToolRemixRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostToolRemixAsResponseAsync( - - request: request, - dryRun: dryRun, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Remix with automatic model selection
- /// Remix an image guided by a text prompt, with Ideogram choosing the
- /// model. Upload the source image as `image` using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostToolRemixAsResponseAsync( - - global::Ideogram.ToolRemixRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostToolRemixArguments( - httpClient: HttpClient, - dryRun: ref dryRun, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostToolRemixSecurityRequirements, - operationName: "PostToolRemixAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/image/remix/auto", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - if (request.ImageAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ImageAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"image_asset_identifier\""); - - } - if (request.Image != default) - { - - var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.ImageWeight != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.ImageWeight, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"image_weight\""); - - } - if (request.NegativePrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.NegativePrompt ?? string.Empty), - name: "\"negative_prompt\""); - - } - if (request.Resolution != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Resolution ?? string.Empty), - name: "\"resolution\""); - - } - if (request.AspectRatio != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.AspectRatio).HasValue ? (request.AspectRatio).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"aspect_ratio\""); - - } - if (request.ResolutionTier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.ResolutionTier).HasValue ? (request.ResolutionTier).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"resolution_tier\""); - - } - if (request.MagicPrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.MagicPrompt).HasValue ? (request.MagicPrompt).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"magic_prompt\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.StyleReferenceAssetIdentifiers != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.StyleReferenceAssetIdentifiers!, x => x.ToJson(JsonSerializerContext)))}]"), - name: "\"style_reference_asset_identifiers\""); - - } - if (request.StyleReferenceCollectionId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.StyleReferenceCollectionId ?? string.Empty), - name: "\"style_reference_collection_id\""); - - } - if (request.StyleReferenceCollectionVersionId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.StyleReferenceCollectionVersionId ?? string.Empty), - name: "\"style_reference_collection_version_id\""); - - } - if (request.StylePreset != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.StylePreset).HasValue ? (request.StylePreset).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"style_preset\""); - - } - if (request.ColorPalette != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ColorPalette.ToString() ?? string.Empty), - name: "\"color_palette\""); - - } - if (request.StyleCodes != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.StyleCodes!, x => x))}]"), - name: "\"style_codes\""); - - } - if (request.StyleType != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.StyleType).HasValue ? (request.StyleType).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"style_type\""); - - } - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.EnableCopyrightDetection != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"enable_copyright_detection\""); - - } - if (request.Async != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"async\""); - - } - if (request.WebhookUrl != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), - name: "\"webhook_url\""); - - } - if (request.Private != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"private\""); - - } - if (request.TargetCollectionId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.TargetCollectionId ?? string.Empty), - name: "\"target_collection_id\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostToolRemixRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - dryRun: dryRun, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostToolRemix", - methodName: "PostToolRemixAsync", - pathTemplate: "\"/v2/image/remix/auto\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostToolRemix", - methodName: "PostToolRemixAsync", - pathTemplate: "\"/v2/image/remix/auto\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostToolRemix", - methodName: "PostToolRemixAsync", - pathTemplate: "\"/v2/image/remix/auto\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostToolRemixResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostToolRemix", - methodName: "PostToolRemixAsync", - pathTemplate: "\"/v2/image/remix/auto\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostToolRemix", - methodName: "PostToolRemixAsync", - pathTemplate: "\"/v2/image/remix/auto\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 500) - { - string? __content_500 = null; - global::System.Exception? __exception_500 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_500 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_500, - responseBody: __content_500, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostToolRemixResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.ToolRemixResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.ToolRemixResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Remix with automatic model selection
- /// Remix an image guided by a text prompt, with Ideogram choosing the
- /// model. Upload the source image as `image` using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// The prompt that guides the remix. - /// - /// - /// The existing upload or generated image to transform. Supply this or `image`, never both. Omit `resolution` and `aspect_ratio` to keep its shape. - /// - /// - /// The image to remix (max 50MB; JPEG, PNG, or WEBP). Multipart requests only. The image is used only for this request and is not saved to your account. - /// - /// - /// The image to remix (max 50MB; JPEG, PNG, or WEBP). Multipart requests only. The image is used only for this request and is not saved to your account. - /// - /// - /// Optional. How closely the result should follow the source image, from 1 to 100. When omitted the selected model chooses its usual strength. Combining a weight with a `resolution` or `aspect_ratio` that changes the source's aspect ratio crops the source to the new shape; this is only available at the 1K tier and is rejected at 2K. - /// - /// - /// Description of what to exclude from the images. The prompt takes precedence over the negative prompt. Not every model uses it. - /// - /// - /// The requested output resolution, formatted as "WIDTHxHEIGHT" (for example "1280x800"). The output uses the closest supported resolution in the matching 1K or 2K tier. Omit `aspect_ratio` when supplying a resolution. If `resolution_tier` is also supplied, it must match the tier these dimensions fall in. Combining a shape-changing value with `image_weight` requires the 1K tier. - /// - /// - /// The requested output aspect ratio. Omit it to keep the source image's shape. `auto` also keeps the source shape. Omit `resolution` when supplying a concrete value. Combining a shape-changing value with `image_weight` requires the 1K tier. - /// - /// - /// The output resolution tier. When omitted, the tier is inferred from `resolution`, or defaults to 1k. A color palette, style codes, style preset, or non-`auto` style type are only supported at 1k. - /// - /// - /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`. The selected model decides how to interpret it.
- /// Default Value: auto - /// - /// - /// Optional. Only honored when the request uses a model that supports reproducible remixes; results from the default model are not reproducible. The response reports the seed used.
- /// Example: 12345 - /// - /// - /// Existing upload or generated image assets whose style should guide the remix, by reference. Supplying style references restricts the server to a model that supports them and requires the 1K resolution tier. Ignored if `style_reference_collection_id` is also supplied. - /// - /// - /// A saved style to apply, by its URL-safe base64 collection id. Limits the request to a model that supports style references and requires the 1K resolution tier. - /// - /// - /// Optional URL-safe base64 version id of the saved style in `style_reference_collection_id`. Ignored without it. - /// - /// - /// A predefined style preset to apply. Limits the request to a model that supports it and requires the 1K resolution tier. Cannot be combined with style codes. - /// - /// - /// A color palette to apply. Limits the request to a model that supports palettes and requires the 1K resolution tier. - /// - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - /// - /// - /// The style type to generate with. A value other than `auto` limits the request to a model that supports it and requires the 1K resolution tier. - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. - /// - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// Whether the generated images should be kept private. Omitted or true keeps them private. False publishes them unless the caller's plan always generates privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostToolRemixAsync( - string prompt, - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - int? imageWeight = default, - string? negativePrompt = default, - string? resolution = default, - global::Ideogram.IdeogramV4AspectRatio? aspectRatio = default, - global::Ideogram.ToolRemixRequestResolutionTier? resolutionTier = default, - global::Ideogram.MagicPromptMode? magicPrompt = default, - int? seed = default, - global::System.Collections.Generic.IList? styleReferenceAssetIdentifiers = default, - string? styleReferenceCollectionId = default, - string? styleReferenceCollectionVersionId = default, - global::Ideogram.IdeogramV3StylePreset? stylePreset = default, - global::Ideogram.IdeogramColorPalette? colorPalette = default, - global::System.Collections.Generic.IList? styleCodes = default, - global::Ideogram.IdeogramV3StyleType? styleType = default, - int? numImages = default, - bool? enableCopyrightDetection = default, - bool? async = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.ToolRemixRequest - { - Prompt = prompt, - ImageAssetIdentifier = imageAssetIdentifier, - Image = image, - Imagename = imagename, - ImageWeight = imageWeight, - NegativePrompt = negativePrompt, - Resolution = resolution, - AspectRatio = aspectRatio, - ResolutionTier = resolutionTier, - MagicPrompt = magicPrompt, - Seed = seed, - StyleReferenceAssetIdentifiers = styleReferenceAssetIdentifiers, - StyleReferenceCollectionId = styleReferenceCollectionId, - StyleReferenceCollectionVersionId = styleReferenceCollectionVersionId, - StylePreset = stylePreset, - ColorPalette = colorPalette, - StyleCodes = styleCodes, - StyleType = styleType, - NumImages = numImages, - EnableCopyrightDetection = enableCopyrightDetection, - Async = async, - WebhookUrl = webhookUrl, - Private = @private, - TargetCollectionId = targetCollectionId, - }; - - return await PostToolRemixAsync( - dryRun: dryRun, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.AutoModelClient.g.cs b/src/libs/Ideogram/Generated/Ideogram.AutoModelClient.g.cs index b26d720d..ce7a92f4 100644 --- a/src/libs/Ideogram/Generated/Ideogram.AutoModelClient.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.AutoModelClient.g.cs @@ -4,9 +4,6 @@ namespace Ideogram { /// - /// Model-agnostic endpoints where the server selects the model for each
- /// request. Requests are JSON and return a generation id that can be
- /// polled via `GET /v2/generations/{generation_id}`.
/// If no httpClient is provided, a new one will be created.
/// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. ///
diff --git a/src/libs/Ideogram/Generated/Ideogram.Batch.JsonSerializerContext.g.cs b/src/libs/Ideogram/Generated/Ideogram.Batch.JsonSerializerContext.g.cs deleted file mode 100644 index 006a2868..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Batch.JsonSerializerContext.g.cs +++ /dev/null @@ -1,272 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull - )] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MagicPromptOption), TypeInfoPropertyName = "MagicPromptOption2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AspectRatioV3), TypeInfoPropertyName = "AspectRatioV32")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ModelEnum), TypeInfoPropertyName = "ModelEnum2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ResolutionV3), TypeInfoPropertyName = "ResolutionV32")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ColorPaletteWithPresetNameOrMembers), TypeInfoPropertyName = "ColorPaletteWithPresetNameOrMembers2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.StyleTypeV3), TypeInfoPropertyName = "StyleTypeV32")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MagicPromptVersionEnum), TypeInfoPropertyName = "MagicPromptVersionEnum2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.InternalBatchRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SamplingRequestParams))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.InternalBatchResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.InternalBatchResultsResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.InternalBatchResultsResponseResultsInner))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ColorPaletteWithPresetName))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ColorPaletteWithMembers))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ColorPalettePresetName), TypeInfoPropertyName = "ColorPalettePresetName2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ColorPaletteMember))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MagicPromptOption?), TypeInfoPropertyName = "NullableMagicPromptOption2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AspectRatioV3?), TypeInfoPropertyName = "NullableAspectRatioV32")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ModelEnum?), TypeInfoPropertyName = "NullableModelEnum2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ResolutionV3?), TypeInfoPropertyName = "NullableResolutionV32")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ColorPaletteWithPresetNameOrMembers?), TypeInfoPropertyName = "NullableColorPaletteWithPresetNameOrMembers2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.StyleTypeV3?), TypeInfoPropertyName = "NullableStyleTypeV32")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MagicPromptVersionEnum?), TypeInfoPropertyName = "NullableMagicPromptVersionEnum2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(double?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ColorPalettePresetName?), TypeInfoPropertyName = "NullableColorPalettePresetName2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - internal sealed partial class BatchSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext - { - } - /// - /// - /// - public sealed partial class BatchSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext - { - private static readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver Resolver = new LazyChunkResolver(); - - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - internal static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver TypeInfoResolver => Resolver; - - - private static readonly global::System.Text.Json.JsonSerializerOptions DefaultOptions = CreateDefaultOptions(); - - /// - /// - /// - public static BatchSourceGenerationContext Default { get; } = new(DefaultOptions); - - private BatchSourceGenerationContext(global::System.Text.Json.JsonSerializerOptions options) - : base(options) - { - } - - /// - protected override global::System.Text.Json.JsonSerializerOptions? GeneratedSerializerOptions => DefaultOptions; - - /// - public override global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo(global::System.Type type) - { - return Resolver.GetTypeInfo(type, Options); - } - - /// - /// Adds this package's converters to . - /// - /// - /// A converter has to be on the options a chained resolver builds its JsonTypeInfo against, - /// and a context resolves types from every package below it. Each package contributes only - /// what it owns and calls down the chain for the rest, so the family's converter table is - /// written once rather than copied into all of them. - /// - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) - { - options.Converters.Add(new global::Ideogram.JsonConverters.ColorPaletteWithPresetNameOrMembersJsonConverter()); - options.Converters.Add(new global::Ideogram.JsonConverters.UnixTimestampJsonConverter()); - options.Converters.Add(new LazyEnumJsonConverterFactory()); - } - - private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() - { - var options = new global::System.Text.Json.JsonSerializerOptions - { - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, - TypeInfoResolver = Resolver, - }; - AddConverters(options); - - return options; - } - - - private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory - { - public override bool CanConvert(global::System.Type typeToConvert) - { - return - typeToConvert == typeof(global::Ideogram.ModelEnum) - - || typeToConvert == typeof(global::Ideogram.ModelEnum?) - - || typeToConvert == typeof(global::Ideogram.MagicPromptOption) - - || typeToConvert == typeof(global::Ideogram.MagicPromptOption?) - - || typeToConvert == typeof(global::Ideogram.AspectRatioV3) - - || typeToConvert == typeof(global::Ideogram.AspectRatioV3?) - - || typeToConvert == typeof(global::Ideogram.ResolutionV3) - - || typeToConvert == typeof(global::Ideogram.ResolutionV3?) - - || typeToConvert == typeof(global::Ideogram.ColorPalettePresetName) - - || typeToConvert == typeof(global::Ideogram.ColorPalettePresetName?) - - || typeToConvert == typeof(global::Ideogram.StyleTypeV3) - - || typeToConvert == typeof(global::Ideogram.StyleTypeV3?) - - || typeToConvert == typeof(global::Ideogram.MagicPromptVersionEnum) - - || typeToConvert == typeof(global::Ideogram.MagicPromptVersionEnum?); - } - - public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - if (typeToConvert == typeof(global::Ideogram.ModelEnum)) - { - return new global::Ideogram.JsonConverters.ModelEnumJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ModelEnum?)) - { - return new global::Ideogram.JsonConverters.ModelEnumNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.MagicPromptOption)) - { - return new global::Ideogram.JsonConverters.MagicPromptOptionJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.MagicPromptOption?)) - { - return new global::Ideogram.JsonConverters.MagicPromptOptionNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.AspectRatioV3)) - { - return new global::Ideogram.JsonConverters.AspectRatioV3JsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.AspectRatioV3?)) - { - return new global::Ideogram.JsonConverters.AspectRatioV3NullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ResolutionV3)) - { - return new global::Ideogram.JsonConverters.ResolutionV3JsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ResolutionV3?)) - { - return new global::Ideogram.JsonConverters.ResolutionV3NullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ColorPalettePresetName)) - { - return new global::Ideogram.JsonConverters.ColorPalettePresetNameJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ColorPalettePresetName?)) - { - return new global::Ideogram.JsonConverters.ColorPalettePresetNameNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.StyleTypeV3)) - { - return new global::Ideogram.JsonConverters.StyleTypeV3JsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.StyleTypeV3?)) - { - return new global::Ideogram.JsonConverters.StyleTypeV3NullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.MagicPromptVersionEnum)) - { - return new global::Ideogram.JsonConverters.MagicPromptVersionEnumJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.MagicPromptVersionEnum?)) - { - return new global::Ideogram.JsonConverters.MagicPromptVersionEnumNullableJsonConverter(); - } - throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); - } - } - - private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver - { - private readonly object _gate = new(); - private readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[] _resolvers = new global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[1]; - - public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo( - global::System.Type type, - global::System.Text.Json.JsonSerializerOptions options) - { - for (var index = 0; index < _resolvers.Length; index++) - { - var typeInfo = GetResolver(index).GetTypeInfo(type, options); - if (typeInfo is not null) - { - return typeInfo; - } - } - - return null; - } - - private global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver GetResolver(int index) - { - var resolver = global::System.Threading.Volatile.Read(ref _resolvers[index]); - if (resolver is not null) - { - return resolver; - } - - lock (_gate) - { - return _resolvers[index] ??= CreateResolver(index); - } - } - - private static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver CreateResolver(int index) - { - return index switch - { - 0 => new BatchSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), - _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), - }; - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.BatchClient.Authorizations.Bearer.g.cs b/src/libs/Ideogram/Generated/Ideogram.BatchClient.Authorizations.Bearer.g.cs deleted file mode 100644 index 87af6310..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.BatchClient.Authorizations.Bearer.g.cs +++ /dev/null @@ -1,35 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public sealed partial class BatchClient - { - - /// - public void AuthorizeUsingBearer( - string apiKey) - { - apiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey)); - - for (var i = Authorizations.Count - 1; i >= 0; i--) - { - var __authorization = Authorizations[i]; - if (__authorization.Type == "Http" && - __authorization.Name == "Bearer") - { - Authorizations.RemoveAt(i); - } - } - - Authorizations.Add(new global::Ideogram.EndPointAuthorization - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - Value = apiKey, - }); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.BatchClient.Constructors.Bearer.g.cs b/src/libs/Ideogram/Generated/Ideogram.BatchClient.Constructors.Bearer.g.cs deleted file mode 100644 index 341acbfc..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.BatchClient.Constructors.Bearer.g.cs +++ /dev/null @@ -1,31 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public sealed partial class BatchClient - { - /// - - public BatchClient( - string apiKey, - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - bool disposeHttpClient = true) : this(httpClient, baseUri, authorizations, disposeHttpClient) - { - Authorizing(HttpClient, ref apiKey); - - AuthorizeUsingBearer(apiKey); - - Authorized(HttpClient); - } - - partial void Authorizing( - global::System.Net.Http.HttpClient client, - ref string apiKey); - partial void Authorized( - global::System.Net.Http.HttpClient client); - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.BatchClient.GetMaybeBatchResults.g.cs b/src/libs/Ideogram/Generated/Ideogram.BatchClient.GetMaybeBatchResults.g.cs deleted file mode 100644 index 28fc99ca..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.BatchClient.GetMaybeBatchResults.g.cs +++ /dev/null @@ -1,554 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class BatchClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_GetMaybeBatchResultsSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_GetMaybeBatchResultsSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_GetMaybeBatchResultsSecurityRequirement0, - }; - partial void PrepareGetMaybeBatchResultsArguments( - global::System.Net.Http.HttpClient httpClient, - ref string jobId); - partial void PrepareGetMaybeBatchResultsRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string jobId); - partial void ProcessGetMaybeBatchResultsResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessGetMaybeBatchResultsResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Get Batch Magic Prompt Job Results if available.
- /// Gets the results of a batch magic prompt job if available. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task GetMaybeBatchResultsAsync( - string jobId, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await GetMaybeBatchResultsAsResponseAsync( - jobId: jobId, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Get Batch Magic Prompt Job Results if available.
- /// Gets the results of a batch magic prompt job if available. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> GetMaybeBatchResultsAsResponseAsync( - string jobId, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareGetMaybeBatchResultsArguments( - httpClient: HttpClient, - jobId: ref jobId); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_GetMaybeBatchResultsSecurityRequirements, - operationName: "GetMaybeBatchResultsAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: $"/internal/batch/get-maybe-batch-results/{jobId}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetMaybeBatchResultsRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - jobId: jobId); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetMaybeBatchResults", - methodName: "GetMaybeBatchResultsAsync", - pathTemplate: "$\"/internal/batch/get-maybe-batch-results/{jobId}\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetMaybeBatchResults", - methodName: "GetMaybeBatchResultsAsync", - pathTemplate: "$\"/internal/batch/get-maybe-batch-results/{jobId}\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetMaybeBatchResults", - methodName: "GetMaybeBatchResultsAsync", - pathTemplate: "$\"/internal/batch/get-maybe-batch-results/{jobId}\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetMaybeBatchResultsResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetMaybeBatchResults", - methodName: "GetMaybeBatchResultsAsync", - pathTemplate: "$\"/internal/batch/get-maybe-batch-results/{jobId}\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetMaybeBatchResults", - methodName: "GetMaybeBatchResultsAsync", - pathTemplate: "$\"/internal/batch/get-maybe-batch-results/{jobId}\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 500) - { - string? __content_500 = null; - global::System.Exception? __exception_500 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_500 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_500, - responseBody: __content_500, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetMaybeBatchResultsResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.InternalBatchResultsResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.InternalBatchResultsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.BatchClient.PostBatch.g.cs b/src/libs/Ideogram/Generated/Ideogram.BatchClient.PostBatch.g.cs deleted file mode 100644 index 03620020..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.BatchClient.PostBatch.g.cs +++ /dev/null @@ -1,605 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class BatchClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostBatchSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostBatchSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostBatchSecurityRequirement0, - }; - partial void PreparePostBatchArguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.InternalBatchRequest request); - partial void PreparePostBatchRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.InternalBatchRequest request); - partial void ProcessPostBatchResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostBatchResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Initiate Batch Magic Prompt Evalution
- /// Runs automated evaluation of multiple LLM models and system prompts for magic prompt generation.
- /// Generates images using large batches of user prompt inputs. Internal use only (feature flagged). - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostBatchAsync( - - global::Ideogram.InternalBatchRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostBatchAsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Initiate Batch Magic Prompt Evalution
- /// Runs automated evaluation of multiple LLM models and system prompts for magic prompt generation.
- /// Generates images using large batches of user prompt inputs. Internal use only (feature flagged). - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostBatchAsResponseAsync( - - global::Ideogram.InternalBatchRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostBatchArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostBatchSecurityRequirements, - operationName: "PostBatchAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/internal/batch", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostBatchRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostBatch", - methodName: "PostBatchAsync", - pathTemplate: "\"/internal/batch\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostBatch", - methodName: "PostBatchAsync", - pathTemplate: "\"/internal/batch\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostBatch", - methodName: "PostBatchAsync", - pathTemplate: "\"/internal/batch\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostBatchResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostBatch", - methodName: "PostBatchAsync", - pathTemplate: "\"/internal/batch\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostBatch", - methodName: "PostBatchAsync", - pathTemplate: "\"/internal/batch\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 500) - { - string? __content_500 = null; - global::System.Exception? __exception_500 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_500 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_500, - responseBody: __content_500, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostBatchResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.InternalBatchResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.InternalBatchResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Initiate Batch Magic Prompt Evalution
- /// Runs automated evaluation of multiple LLM models and system prompts for magic prompt generation.
- /// Generates images using large batches of user prompt inputs. Internal use only (feature flagged). - ///
- /// - /// The prompts to enhance with a magic prompt.
- /// Example: [a cat, a dog] - /// - /// - /// The experiment variant used for template selection for the magic prompts.
- /// Example: MAGIC_PROMPT_NO_TEXT - /// - /// - /// Example: {"magic_prompt_system_prompt_config_id":"magic_prompt_system_prompt_config_id","aspect_ratio":"1x1","style_type":"GENERAL","magic_prompt_version":"V_0","seed":12345,"negative_prompt":"brush strokes, painting","magic_prompt_option":"ON","model":"V_2_TURBO","resolution":"1280x800","num_images":1,"color_palette":{"name":"PASTEL"}} - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostBatchAsync( - global::System.Collections.Generic.IList userPrompts, - string? experimentVariant = default, - global::Ideogram.SamplingRequestParams? samplingRequestParams = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.InternalBatchRequest - { - UserPrompts = userPrompts, - ExperimentVariant = experimentVariant, - SamplingRequestParams = samplingRequestParams, - }; - - return await PostBatchAsync( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.BatchClient.g.cs b/src/libs/Ideogram/Generated/Ideogram.BatchClient.g.cs deleted file mode 100644 index 9063d947..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.BatchClient.g.cs +++ /dev/null @@ -1,143 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// If no httpClient is provided, a new one will be created.
- /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. - ///
- public sealed partial class BatchClient : global::Ideogram.IBatchClient, global::System.IDisposable - { - /// - /// - /// - public const string DefaultBaseUrl = "https://api.ideogram.ai/"; - - private bool _disposeHttpClient = true; - - /// - public global::System.Net.Http.HttpClient HttpClient { get; } - - /// - public System.Uri? BaseUri => HttpClient.BaseAddress; - - /// - public global::System.Collections.Generic.List Authorizations { get; } - - /// - public bool ReadResponseAsString { get; set; } -#if DEBUG - = true; -#endif - - /// - public global::Ideogram.AutoSDKClientOptions Options { get; } - - internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::Ideogram.BatchSourceGenerationContext.Default); - - /// - /// - /// - public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext - { - get => JsonSerializerContextProvider.Value; - set => JsonSerializerContextProvider = new(() => value); - } - - - /// - /// Creates a new instance of the BatchClient. - /// If no httpClient is provided, a new one will be created. - /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. - /// - /// The HttpClient instance. If not provided, a new one will be created. - /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. - /// The authorizations to use for the requests. - /// Dispose the HttpClient when the instance is disposed. True by default. - public BatchClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - bool disposeHttpClient = true) : this( - httpClient, - baseUri, - authorizations, - options: null, - disposeHttpClient: disposeHttpClient) - { - } - - /// - /// Creates a new instance of the BatchClient with explicit options but no base URL override. - /// Skips passing baseUri so the default base URL from the OpenAPI spec applies. - /// - /// The HttpClient instance. If not provided, a new one will be created. - /// The authorizations to use for the requests. - /// Client-wide request defaults such as headers, query parameters, retries, and timeout. - /// Dispose the HttpClient when the instance is disposed. True by default. - public BatchClient( - global::System.Net.Http.HttpClient? httpClient, - global::System.Collections.Generic.List? authorizations, - global::Ideogram.AutoSDKClientOptions? options, - bool disposeHttpClient = true) : this( - httpClient, - baseUri: null, - authorizations, - options, - disposeHttpClient: disposeHttpClient) - { - } - - /// - /// Creates a new instance of the BatchClient. - /// If no httpClient is provided, a new one will be created. - /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. - /// - /// The HttpClient instance. If not provided, a new one will be created. - /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. - /// The authorizations to use for the requests. - /// Client-wide request defaults such as headers, query parameters, retries, and timeout. - /// Dispose the HttpClient when the instance is disposed. True by default. - public BatchClient( - global::System.Net.Http.HttpClient? httpClient, - global::System.Uri? baseUri, - global::System.Collections.Generic.List? authorizations, - global::Ideogram.AutoSDKClientOptions? options, - bool disposeHttpClient = true) - { - - HttpClient = httpClient ?? new global::System.Net.Http.HttpClient(); - HttpClient.BaseAddress ??= baseUri ?? new global::System.Uri(DefaultBaseUrl); - Authorizations = authorizations ?? new global::System.Collections.Generic.List(); - Options = options ?? new global::Ideogram.AutoSDKClientOptions(); - _disposeHttpClient = disposeHttpClient; - - Initialized(HttpClient); - } - - /// - public void Dispose() - { - if (_disposeHttpClient) - { - HttpClient.Dispose(); - } - } - - partial void Initialized( - global::System.Net.Http.HttpClient client); - partial void PrepareArguments( - global::System.Net.Http.HttpClient client); - partial void PrepareRequest( - global::System.Net.Http.HttpClient client, - global::System.Net.Http.HttpRequestMessage request); - partial void ProcessResponse( - global::System.Net.Http.HttpClient client, - global::System.Net.Http.HttpResponseMessage response); - partial void ProcessResponseContent( - global::System.Net.Http.HttpClient client, - global::System.Net.Http.HttpResponseMessage response, - ref string content); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Datasets.JsonSerializerContext.g.cs b/src/libs/Ideogram/Generated/Ideogram.Datasets.JsonSerializerContext.g.cs deleted file mode 100644 index b6a08c9c..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Datasets.JsonSerializerContext.g.cs +++ /dev/null @@ -1,205 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull - )] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(long))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(byte[]))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AssetIdentifier))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ListDatasetsResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.Dataset))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.CreateDatasetRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GetDatasetResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DatasetFile))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UploadDatasetAssetsResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DatasetUploadSucceededAsset))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DatasetUploadFailedAsset))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DatasetAssetFailureReason), TypeInfoPropertyName = "DatasetAssetFailureReason2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UploadDatasetAssetsRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TrainDatasetModelResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TrainDatasetModelRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AssetType), TypeInfoPropertyName = "AssetType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DatasetCoverAssetIdentifier), TypeInfoPropertyName = "DatasetCoverAssetIdentifier2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(long?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DatasetAssetFailureReason?), TypeInfoPropertyName = "NullableDatasetAssetFailureReason2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AssetType?), TypeInfoPropertyName = "NullableAssetType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DatasetCoverAssetIdentifier?), TypeInfoPropertyName = "NullableDatasetCoverAssetIdentifier2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - internal sealed partial class DatasetsSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext - { - } - /// - /// - /// - public sealed partial class DatasetsSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext - { - private static readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver Resolver = new LazyChunkResolver(); - - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - internal static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver TypeInfoResolver => Resolver; - - - private static readonly global::System.Text.Json.JsonSerializerOptions DefaultOptions = CreateDefaultOptions(); - - /// - /// - /// - public static DatasetsSourceGenerationContext Default { get; } = new(DefaultOptions); - - private DatasetsSourceGenerationContext(global::System.Text.Json.JsonSerializerOptions options) - : base(options) - { - } - - /// - protected override global::System.Text.Json.JsonSerializerOptions? GeneratedSerializerOptions => DefaultOptions; - - /// - public override global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo(global::System.Type type) - { - return Resolver.GetTypeInfo(type, Options); - } - - /// - /// Adds this package's converters to . - /// - /// - /// A converter has to be on the options a chained resolver builds its JsonTypeInfo against, - /// and a context resolves types from every package below it. Each package contributes only - /// what it owns and calls down the chain for the rest, so the family's converter table is - /// written once rather than copied into all of them. - /// - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) - { - options.Converters.Add(new global::Ideogram.JsonConverters.DatasetCoverAssetIdentifierJsonConverter()); - options.Converters.Add(new global::Ideogram.JsonConverters.UnixTimestampJsonConverter()); - options.Converters.Add(new LazyEnumJsonConverterFactory()); - } - - private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() - { - var options = new global::System.Text.Json.JsonSerializerOptions - { - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, - TypeInfoResolver = Resolver, - }; - AddConverters(options); - - return options; - } - - - private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory - { - public override bool CanConvert(global::System.Type typeToConvert) - { - return - typeToConvert == typeof(global::Ideogram.DatasetAssetFailureReason) - - || typeToConvert == typeof(global::Ideogram.DatasetAssetFailureReason?) - - || typeToConvert == typeof(global::Ideogram.AssetType) - - || typeToConvert == typeof(global::Ideogram.AssetType?); - } - - public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - if (typeToConvert == typeof(global::Ideogram.DatasetAssetFailureReason)) - { - return new global::Ideogram.JsonConverters.DatasetAssetFailureReasonJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.DatasetAssetFailureReason?)) - { - return new global::Ideogram.JsonConverters.DatasetAssetFailureReasonNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.AssetType)) - { - return new global::Ideogram.JsonConverters.AssetTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.AssetType?)) - { - return new global::Ideogram.JsonConverters.AssetTypeNullableJsonConverter(); - } - throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); - } - } - - private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver - { - private readonly object _gate = new(); - private readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[] _resolvers = new global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[1]; - - public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo( - global::System.Type type, - global::System.Text.Json.JsonSerializerOptions options) - { - for (var index = 0; index < _resolvers.Length; index++) - { - var typeInfo = GetResolver(index).GetTypeInfo(type, options); - if (typeInfo is not null) - { - return typeInfo; - } - } - - return null; - } - - private global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver GetResolver(int index) - { - var resolver = global::System.Threading.Volatile.Read(ref _resolvers[index]); - if (resolver is not null) - { - return resolver; - } - - lock (_gate) - { - return _resolvers[index] ??= CreateResolver(index); - } - } - - private static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver CreateResolver(int index) - { - return index switch - { - 0 => new DatasetsSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), - _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), - }; - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.DatasetsClient.Authorizations.Bearer.g.cs b/src/libs/Ideogram/Generated/Ideogram.DatasetsClient.Authorizations.Bearer.g.cs deleted file mode 100644 index 4c5e1042..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.DatasetsClient.Authorizations.Bearer.g.cs +++ /dev/null @@ -1,35 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public sealed partial class DatasetsClient - { - - /// - public void AuthorizeUsingBearer( - string apiKey) - { - apiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey)); - - for (var i = Authorizations.Count - 1; i >= 0; i--) - { - var __authorization = Authorizations[i]; - if (__authorization.Type == "Http" && - __authorization.Name == "Bearer") - { - Authorizations.RemoveAt(i); - } - } - - Authorizations.Add(new global::Ideogram.EndPointAuthorization - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - Value = apiKey, - }); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.DatasetsClient.Constructors.Bearer.g.cs b/src/libs/Ideogram/Generated/Ideogram.DatasetsClient.Constructors.Bearer.g.cs deleted file mode 100644 index 49f219ca..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.DatasetsClient.Constructors.Bearer.g.cs +++ /dev/null @@ -1,31 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public sealed partial class DatasetsClient - { - /// - - public DatasetsClient( - string apiKey, - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - bool disposeHttpClient = true) : this(httpClient, baseUri, authorizations, disposeHttpClient) - { - Authorizing(HttpClient, ref apiKey); - - AuthorizeUsingBearer(apiKey); - - Authorized(HttpClient); - } - - partial void Authorizing( - global::System.Net.Http.HttpClient client, - ref string apiKey); - partial void Authorized( - global::System.Net.Http.HttpClient client); - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.DatasetsClient.CreateDataset.g.cs b/src/libs/Ideogram/Generated/Ideogram.DatasetsClient.CreateDataset.g.cs deleted file mode 100644 index 00a1a27f..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.DatasetsClient.CreateDataset.g.cs +++ /dev/null @@ -1,526 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class DatasetsClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_CreateDatasetSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_CreateDatasetSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_CreateDatasetSecurityRequirement0, - }; - partial void PrepareCreateDatasetArguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.CreateDatasetRequest request); - partial void PrepareCreateDatasetRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.CreateDatasetRequest request); - partial void ProcessCreateDatasetResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessCreateDatasetResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Create a new dataset
- /// Creates a new dataset - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task CreateDatasetAsync( - - global::Ideogram.CreateDatasetRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await CreateDatasetAsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Create a new dataset
- /// Creates a new dataset - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> CreateDatasetAsResponseAsync( - - global::Ideogram.CreateDatasetRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareCreateDatasetArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_CreateDatasetSecurityRequirements, - operationName: "CreateDatasetAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/datasets", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareCreateDatasetRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "CreateDataset", - methodName: "CreateDatasetAsync", - pathTemplate: "\"/datasets\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "CreateDataset", - methodName: "CreateDatasetAsync", - pathTemplate: "\"/datasets\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "CreateDataset", - methodName: "CreateDatasetAsync", - pathTemplate: "\"/datasets\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessCreateDatasetResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "CreateDataset", - methodName: "CreateDatasetAsync", - pathTemplate: "\"/datasets\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "CreateDataset", - methodName: "CreateDatasetAsync", - pathTemplate: "\"/datasets\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessCreateDatasetResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.Dataset.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.Dataset.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Create a new dataset
- /// Creates a new dataset - ///
- /// - /// Name of the dataset. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task CreateDatasetAsync( - string name, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.CreateDatasetRequest - { - Name = name, - }; - - return await CreateDatasetAsync( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.DatasetsClient.GetDataset.g.cs b/src/libs/Ideogram/Generated/Ideogram.DatasetsClient.GetDataset.g.cs deleted file mode 100644 index 2810dc41..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.DatasetsClient.GetDataset.g.cs +++ /dev/null @@ -1,490 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class DatasetsClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_GetDatasetSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_GetDatasetSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_GetDatasetSecurityRequirement0, - }; - partial void PrepareGetDatasetArguments( - global::System.Net.Http.HttpClient httpClient, - ref string datasetId); - partial void PrepareGetDatasetRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string datasetId); - partial void ProcessGetDatasetResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessGetDatasetResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Get a dataset
- /// Returns a dataset by ID, including the total number of files and a list of each file's name and size in bytes. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task GetDatasetAsync( - string datasetId, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await GetDatasetAsResponseAsync( - datasetId: datasetId, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Get a dataset
- /// Returns a dataset by ID, including the total number of files and a list of each file's name and size in bytes. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> GetDatasetAsResponseAsync( - string datasetId, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareGetDatasetArguments( - httpClient: HttpClient, - datasetId: ref datasetId); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_GetDatasetSecurityRequirements, - operationName: "GetDatasetAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: $"/datasets/{datasetId}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetDatasetRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - datasetId: datasetId); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetDataset", - methodName: "GetDatasetAsync", - pathTemplate: "$\"/datasets/{datasetId}\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetDataset", - methodName: "GetDatasetAsync", - pathTemplate: "$\"/datasets/{datasetId}\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetDataset", - methodName: "GetDatasetAsync", - pathTemplate: "$\"/datasets/{datasetId}\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetDatasetResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetDataset", - methodName: "GetDatasetAsync", - pathTemplate: "$\"/datasets/{datasetId}\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetDataset", - methodName: "GetDatasetAsync", - pathTemplate: "$\"/datasets/{datasetId}\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetDatasetResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.GetDatasetResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.GetDatasetResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.DatasetsClient.ListDatasets.g.cs b/src/libs/Ideogram/Generated/Ideogram.DatasetsClient.ListDatasets.g.cs deleted file mode 100644 index ea15f97a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.DatasetsClient.ListDatasets.g.cs +++ /dev/null @@ -1,461 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class DatasetsClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_ListDatasetsSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_ListDatasetsSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_ListDatasetsSecurityRequirement0, - }; - partial void PrepareListDatasetsArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? search); - partial void PrepareListDatasetsRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? search); - partial void ProcessListDatasetsResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessListDatasetsResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// List datasets
- /// Lists datasets for the authenticated user, most recently updated first. Supports an optional case-insensitive name search. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task ListDatasetsAsync( - string? search = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await ListDatasetsAsResponseAsync( - search: search, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// List datasets
- /// Lists datasets for the authenticated user, most recently updated first. Supports an optional case-insensitive name search. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> ListDatasetsAsResponseAsync( - string? search = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareListDatasetsArguments( - httpClient: HttpClient, - search: ref search); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_ListDatasetsSecurityRequirements, - operationName: "ListDatasetsAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/datasets", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("search", search) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareListDatasetsRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - search: search); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "ListDatasets", - methodName: "ListDatasetsAsync", - pathTemplate: "\"/datasets\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "ListDatasets", - methodName: "ListDatasetsAsync", - pathTemplate: "\"/datasets\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "ListDatasets", - methodName: "ListDatasetsAsync", - pathTemplate: "\"/datasets\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessListDatasetsResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "ListDatasets", - methodName: "ListDatasetsAsync", - pathTemplate: "\"/datasets\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "ListDatasets", - methodName: "ListDatasetsAsync", - pathTemplate: "\"/datasets\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessListDatasetsResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.ListDatasetsResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.ListDatasetsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.DatasetsClient.TrainDatasetModel.g.cs b/src/libs/Ideogram/Generated/Ideogram.DatasetsClient.TrainDatasetModel.g.cs deleted file mode 100644 index dda622cb..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.DatasetsClient.TrainDatasetModel.g.cs +++ /dev/null @@ -1,571 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class DatasetsClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_TrainDatasetModelSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_TrainDatasetModelSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_TrainDatasetModelSecurityRequirement0, - }; - partial void PrepareTrainDatasetModelArguments( - global::System.Net.Http.HttpClient httpClient, - ref string datasetId, - global::Ideogram.TrainDatasetModelRequest request); - partial void PrepareTrainDatasetModelRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string datasetId, - global::Ideogram.TrainDatasetModelRequest request); - partial void ProcessTrainDatasetModelResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessTrainDatasetModelResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Train a model from a dataset
- /// Start training a custom model from a dataset. The dataset must contain at least 15 images and a maximum of 100 images. Returns the model ID and training status. - ///
- /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task TrainDatasetModelAsync( - string datasetId, - - global::Ideogram.TrainDatasetModelRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await TrainDatasetModelAsResponseAsync( - datasetId: datasetId, - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Train a model from a dataset
- /// Start training a custom model from a dataset. The dataset must contain at least 15 images and a maximum of 100 images. Returns the model ID and training status. - ///
- /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> TrainDatasetModelAsResponseAsync( - string datasetId, - - global::Ideogram.TrainDatasetModelRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareTrainDatasetModelArguments( - httpClient: HttpClient, - datasetId: ref datasetId, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_TrainDatasetModelSecurityRequirements, - operationName: "TrainDatasetModelAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: $"/datasets/{datasetId}/train_model", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareTrainDatasetModelRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - datasetId: datasetId, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "TrainDatasetModel", - methodName: "TrainDatasetModelAsync", - pathTemplate: "$\"/datasets/{datasetId}/train_model\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "TrainDatasetModel", - methodName: "TrainDatasetModelAsync", - pathTemplate: "$\"/datasets/{datasetId}/train_model\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "TrainDatasetModel", - methodName: "TrainDatasetModelAsync", - pathTemplate: "$\"/datasets/{datasetId}/train_model\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessTrainDatasetModelResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "TrainDatasetModel", - methodName: "TrainDatasetModelAsync", - pathTemplate: "$\"/datasets/{datasetId}/train_model\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "TrainDatasetModel", - methodName: "TrainDatasetModelAsync", - pathTemplate: "$\"/datasets/{datasetId}/train_model\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessTrainDatasetModelResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.TrainDatasetModelResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.TrainDatasetModelResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Train a model from a dataset
- /// Start training a custom model from a dataset. The dataset must contain at least 15 images and a maximum of 100 images. Returns the model ID and training status. - ///
- /// - /// - /// Name after trimming surrounding whitespace: 5–30 Unicode letters, numbers, spaces, underscores, parentheses, periods, or hyphens.
- /// Example: my-custom-model - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task TrainDatasetModelAsync( - string datasetId, - string modelName, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.TrainDatasetModelRequest - { - ModelName = modelName, - }; - - return await TrainDatasetModelAsync( - datasetId: datasetId, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.DatasetsClient.UploadDatasetAssets.g.cs b/src/libs/Ideogram/Generated/Ideogram.DatasetsClient.UploadDatasetAssets.g.cs deleted file mode 100644 index 6621584b..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.DatasetsClient.UploadDatasetAssets.g.cs +++ /dev/null @@ -1,1619 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class DatasetsClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_UploadDatasetAssetsSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_UploadDatasetAssetsSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_UploadDatasetAssetsSecurityRequirement0, - }; - partial void PrepareUploadDatasetAssetsArguments( - global::System.Net.Http.HttpClient httpClient, - ref string datasetId, - global::Ideogram.UploadDatasetAssetsRequest request); - partial void PrepareUploadDatasetAssetsRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string datasetId, - global::Ideogram.UploadDatasetAssetsRequest request); - partial void ProcessUploadDatasetAssetsResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessUploadDatasetAssetsResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Upload assets to a dataset
- /// Upload image assets to a dataset for model training. Accepts individual images (JPEG, PNG, WebP), optional .txt caption sidecar files, and/or ZIP archives containing images and captions. A dataset can contain up to 100 images. - ///
- /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task UploadDatasetAssetsAsync( - string datasetId, - - global::Ideogram.UploadDatasetAssetsRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await UploadDatasetAssetsAsResponseAsync( - datasetId: datasetId, - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Upload assets to a dataset
- /// Upload image assets to a dataset for model training. Accepts individual images (JPEG, PNG, WebP), optional .txt caption sidecar files, and/or ZIP archives containing images and captions. A dataset can contain up to 100 images. - ///
- /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> UploadDatasetAssetsAsResponseAsync( - string datasetId, - - global::Ideogram.UploadDatasetAssetsRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareUploadDatasetAssetsArguments( - httpClient: HttpClient, - datasetId: ref datasetId, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_UploadDatasetAssetsSecurityRequirements, - operationName: "UploadDatasetAssetsAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: $"/datasets/{datasetId}/upload_assets", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - for (var __iFiles = 0; __iFiles < request.Files.Count; __iFiles++) - { - var __contentFiles = new global::System.Net.Http.ByteArrayContent(request.Files[__iFiles]); - __contentFiles.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); - __httpRequestContent.Add( - content: __contentFiles, - name: "\"files\"", - fileName: $"\"file{__iFiles}.bin\""); - if (__contentFiles.Headers.ContentDisposition != null) - { - __contentFiles.Headers.ContentDisposition.FileNameStar = null; - } - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareUploadDatasetAssetsRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - datasetId: datasetId, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "UploadDatasetAssets", - methodName: "UploadDatasetAssetsAsync", - pathTemplate: "$\"/datasets/{datasetId}/upload_assets\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "UploadDatasetAssets", - methodName: "UploadDatasetAssetsAsync", - pathTemplate: "$\"/datasets/{datasetId}/upload_assets\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "UploadDatasetAssets", - methodName: "UploadDatasetAssetsAsync", - pathTemplate: "$\"/datasets/{datasetId}/upload_assets\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessUploadDatasetAssetsResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "UploadDatasetAssets", - methodName: "UploadDatasetAssetsAsync", - pathTemplate: "$\"/datasets/{datasetId}/upload_assets\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "UploadDatasetAssets", - methodName: "UploadDatasetAssetsAsync", - pathTemplate: "$\"/datasets/{datasetId}/upload_assets\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessUploadDatasetAssetsResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.UploadDatasetAssetsResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.UploadDatasetAssetsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Upload assets to a dataset
- /// Upload image assets to a dataset for model training. Accepts individual images (JPEG, PNG, WebP), optional .txt caption sidecar files, and/or ZIP archives containing images and captions. A dataset can contain up to 100 images. - ///
- /// - /// - /// Image files (JPEG, PNG, WebP), .txt caption sidecar files, and/or ZIP archives containing images and captions. Caption .txt files are matched to images by filename stem (e.g. sunset.txt provides the caption for sunset.jpg). Captions are optional! - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task UploadDatasetAssetsAsync( - string datasetId, - global::System.Collections.Generic.IList files, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.UploadDatasetAssetsRequest - { - Files = files, - }; - - return await UploadDatasetAssetsAsync( - datasetId: datasetId, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - - /// - /// Upload assets to a dataset
- /// Upload image assets to a dataset for model training. Accepts individual images (JPEG, PNG, WebP), optional .txt caption sidecar files, and/or ZIP archives containing images and captions. A dataset can contain up to 100 images. - ///
- /// - /// - /// Image files (JPEG, PNG, WebP), .txt caption sidecar files, and/or ZIP archives containing images and captions. Caption .txt files are matched to images by filename stem (e.g. sunset.txt provides the caption for sunset.jpg). Captions are optional! - /// - /// - /// Optional file names to use for the multipart 'files' file parts. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task UploadDatasetAssetsAsync( - string datasetId, - global::System.Collections.Generic.IReadOnlyList files, - global::System.Collections.Generic.IReadOnlyList? filesFileNames = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - - files = files ?? throw new global::System.ArgumentNullException(nameof(files)); - var request = new global::Ideogram.UploadDatasetAssetsRequest - { - Files = new global::System.Collections.Generic.List(), - }; - PrepareArguments( - client: HttpClient); - PrepareUploadDatasetAssetsArguments( - httpClient: HttpClient, - datasetId: ref datasetId, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_UploadDatasetAssetsSecurityRequirements, - operationName: "UploadDatasetAssetsAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: $"/datasets/{datasetId}/upload_assets", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - for (var __iFiles = 0; __iFiles < files.Count; __iFiles++) - { - var __fileNameFiles = filesFileNames != null && - __iFiles < filesFileNames.Count && - filesFileNames[__iFiles] != null - ? filesFileNames[__iFiles] - : $"file{__iFiles}.bin"; - var __contentFiles = new global::System.Net.Http.StreamContent(files[__iFiles]); - __contentFiles.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - __fileNameFiles is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(__fileNameFiles) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentFiles, - name: "\"files\"", - fileName: $"\"{__fileNameFiles}\""); - if (__contentFiles.Headers.ContentDisposition != null) - { - __contentFiles.Headers.ContentDisposition.FileNameStar = null; - } - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareUploadDatasetAssetsRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - datasetId: datasetId, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "UploadDatasetAssets", - methodName: "UploadDatasetAssetsAsync", - pathTemplate: "$\"/datasets/{datasetId}/upload_assets\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "UploadDatasetAssets", - methodName: "UploadDatasetAssetsAsync", - pathTemplate: "$\"/datasets/{datasetId}/upload_assets\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "UploadDatasetAssets", - methodName: "UploadDatasetAssetsAsync", - pathTemplate: "$\"/datasets/{datasetId}/upload_assets\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessUploadDatasetAssetsResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "UploadDatasetAssets", - methodName: "UploadDatasetAssetsAsync", - pathTemplate: "$\"/datasets/{datasetId}/upload_assets\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "UploadDatasetAssets", - methodName: "UploadDatasetAssetsAsync", - pathTemplate: "$\"/datasets/{datasetId}/upload_assets\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessUploadDatasetAssetsResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::Ideogram.UploadDatasetAssetsResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - return - await global::Ideogram.UploadDatasetAssetsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Upload assets to a dataset
- /// Upload image assets to a dataset for model training. Accepts individual images (JPEG, PNG, WebP), optional .txt caption sidecar files, and/or ZIP archives containing images and captions. A dataset can contain up to 100 images. - ///
- /// - /// - /// Image files (JPEG, PNG, WebP), .txt caption sidecar files, and/or ZIP archives containing images and captions. Caption .txt files are matched to images by filename stem (e.g. sunset.txt provides the caption for sunset.jpg). Captions are optional! - /// - /// - /// Optional file names to use for the multipart 'files' file parts. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> UploadDatasetAssetsAsResponseAsync( - string datasetId, - global::System.Collections.Generic.IReadOnlyList files, - global::System.Collections.Generic.IReadOnlyList? filesFileNames = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - - files = files ?? throw new global::System.ArgumentNullException(nameof(files)); - var request = new global::Ideogram.UploadDatasetAssetsRequest - { - Files = new global::System.Collections.Generic.List(), - }; - PrepareArguments( - client: HttpClient); - PrepareUploadDatasetAssetsArguments( - httpClient: HttpClient, - datasetId: ref datasetId, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_UploadDatasetAssetsSecurityRequirements, - operationName: "UploadDatasetAssetsAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: $"/datasets/{datasetId}/upload_assets", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - for (var __iFiles = 0; __iFiles < files.Count; __iFiles++) - { - var __fileNameFiles = filesFileNames != null && - __iFiles < filesFileNames.Count && - filesFileNames[__iFiles] != null - ? filesFileNames[__iFiles] - : $"file{__iFiles}.bin"; - var __contentFiles = new global::System.Net.Http.StreamContent(files[__iFiles]); - __contentFiles.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - __fileNameFiles is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(__fileNameFiles) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentFiles, - name: "\"files\"", - fileName: $"\"{__fileNameFiles}\""); - if (__contentFiles.Headers.ContentDisposition != null) - { - __contentFiles.Headers.ContentDisposition.FileNameStar = null; - } - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareUploadDatasetAssetsRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - datasetId: datasetId, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "UploadDatasetAssets", - methodName: "UploadDatasetAssetsAsync", - pathTemplate: "$\"/datasets/{datasetId}/upload_assets\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "UploadDatasetAssets", - methodName: "UploadDatasetAssetsAsync", - pathTemplate: "$\"/datasets/{datasetId}/upload_assets\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "UploadDatasetAssets", - methodName: "UploadDatasetAssetsAsync", - pathTemplate: "$\"/datasets/{datasetId}/upload_assets\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessUploadDatasetAssetsResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "UploadDatasetAssets", - methodName: "UploadDatasetAssetsAsync", - pathTemplate: "$\"/datasets/{datasetId}/upload_assets\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "UploadDatasetAssets", - methodName: "UploadDatasetAssetsAsync", - pathTemplate: "$\"/datasets/{datasetId}/upload_assets\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessUploadDatasetAssetsResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.UploadDatasetAssetsResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.UploadDatasetAssetsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.DatasetsClient.g.cs b/src/libs/Ideogram/Generated/Ideogram.DatasetsClient.g.cs deleted file mode 100644 index 3a46230b..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.DatasetsClient.g.cs +++ /dev/null @@ -1,144 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Operations related to managing datasets
- /// If no httpClient is provided, a new one will be created.
- /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. - ///
- public sealed partial class DatasetsClient : global::Ideogram.IDatasetsClient, global::System.IDisposable - { - /// - /// - /// - public const string DefaultBaseUrl = "https://api.ideogram.ai/"; - - private bool _disposeHttpClient = true; - - /// - public global::System.Net.Http.HttpClient HttpClient { get; } - - /// - public System.Uri? BaseUri => HttpClient.BaseAddress; - - /// - public global::System.Collections.Generic.List Authorizations { get; } - - /// - public bool ReadResponseAsString { get; set; } -#if DEBUG - = true; -#endif - - /// - public global::Ideogram.AutoSDKClientOptions Options { get; } - - internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::Ideogram.DatasetsSourceGenerationContext.Default); - - /// - /// - /// - public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext - { - get => JsonSerializerContextProvider.Value; - set => JsonSerializerContextProvider = new(() => value); - } - - - /// - /// Creates a new instance of the DatasetsClient. - /// If no httpClient is provided, a new one will be created. - /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. - /// - /// The HttpClient instance. If not provided, a new one will be created. - /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. - /// The authorizations to use for the requests. - /// Dispose the HttpClient when the instance is disposed. True by default. - public DatasetsClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - bool disposeHttpClient = true) : this( - httpClient, - baseUri, - authorizations, - options: null, - disposeHttpClient: disposeHttpClient) - { - } - - /// - /// Creates a new instance of the DatasetsClient with explicit options but no base URL override. - /// Skips passing baseUri so the default base URL from the OpenAPI spec applies. - /// - /// The HttpClient instance. If not provided, a new one will be created. - /// The authorizations to use for the requests. - /// Client-wide request defaults such as headers, query parameters, retries, and timeout. - /// Dispose the HttpClient when the instance is disposed. True by default. - public DatasetsClient( - global::System.Net.Http.HttpClient? httpClient, - global::System.Collections.Generic.List? authorizations, - global::Ideogram.AutoSDKClientOptions? options, - bool disposeHttpClient = true) : this( - httpClient, - baseUri: null, - authorizations, - options, - disposeHttpClient: disposeHttpClient) - { - } - - /// - /// Creates a new instance of the DatasetsClient. - /// If no httpClient is provided, a new one will be created. - /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. - /// - /// The HttpClient instance. If not provided, a new one will be created. - /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. - /// The authorizations to use for the requests. - /// Client-wide request defaults such as headers, query parameters, retries, and timeout. - /// Dispose the HttpClient when the instance is disposed. True by default. - public DatasetsClient( - global::System.Net.Http.HttpClient? httpClient, - global::System.Uri? baseUri, - global::System.Collections.Generic.List? authorizations, - global::Ideogram.AutoSDKClientOptions? options, - bool disposeHttpClient = true) - { - - HttpClient = httpClient ?? new global::System.Net.Http.HttpClient(); - HttpClient.BaseAddress ??= baseUri ?? new global::System.Uri(DefaultBaseUrl); - Authorizations = authorizations ?? new global::System.Collections.Generic.List(); - Options = options ?? new global::Ideogram.AutoSDKClientOptions(); - _disposeHttpClient = disposeHttpClient; - - Initialized(HttpClient); - } - - /// - public void Dispose() - { - if (_disposeHttpClient) - { - HttpClient.Dispose(); - } - } - - partial void Initialized( - global::System.Net.Http.HttpClient client); - partial void PrepareArguments( - global::System.Net.Http.HttpClient client); - partial void PrepareRequest( - global::System.Net.Http.HttpClient client, - global::System.Net.Http.HttpRequestMessage request); - partial void ProcessResponse( - global::System.Net.Http.HttpClient client, - global::System.Net.Http.HttpResponseMessage response); - partial void ProcessResponseContent( - global::System.Net.Http.HttpClient client, - global::System.Net.Http.HttpResponseMessage response, - ref string content); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Design.JsonSerializerContext.g.cs b/src/libs/Ideogram/Generated/Ideogram.Design.JsonSerializerContext.g.cs index 37713dcb..f3793c39 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Design.JsonSerializerContext.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Design.JsonSerializerContext.g.cs @@ -14,50 +14,37 @@ namespace Ideogram [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DetectedTextBlock))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(byte[]))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(float))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponseDataInner), TypeInfoPropertyName = "GenerationResponseDataInner2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImageObjectWithoutPromptOrSeed))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImageGenerationObject))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AssetIdentifier))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationErrorResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationRejectReason), TypeInfoPropertyName = "GenerationRejectReason2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed), TypeInfoPropertyName = "GenerationErrorResponseTaskCompletionSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LayerizeDesignIdeogramV3Response))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LayerizedImageObject))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LayerizedImageObjectObjectType), TypeInfoPropertyName = "LayerizedImageObjectObjectType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LayerizeDesignIdeogramV3Request))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SvgGenerationObject))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.VideoObject))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TextLayerizerResultObject))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationErrorResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DetectedTextBlockAlignment), TypeInfoPropertyName = "DetectedTextBlockAlignment2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DetectedTextBlockFormattingItem), TypeInfoPropertyName = "DetectedTextBlockFormattingItem2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DetectedTextBlockFormattingItems), TypeInfoPropertyName = "DetectedTextBlockFormattingItems2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DetectedTextBlockRole), TypeInfoPropertyName = "DetectedTextBlockRole2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AssetType), TypeInfoPropertyName = "AssetType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DetectedTextBlock))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LayerizedImageObject))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LayerizeDesignIdeogramV3Response))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(byte[]))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DesignPostLayerizeDesignIdeogramV3Request))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(float?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponseDataInner?), TypeInfoPropertyName = "NullableGenerationResponseDataInner2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationRejectReason?), TypeInfoPropertyName = "NullableGenerationRejectReason2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?), TypeInfoPropertyName = "NullableGenerationErrorResponseTaskCompletionSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LayerizedImageObjectObjectType?), TypeInfoPropertyName = "NullableLayerizedImageObjectObjectType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DetectedTextBlockAlignment?), TypeInfoPropertyName = "NullableDetectedTextBlockAlignment2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DetectedTextBlockFormattingItem?), TypeInfoPropertyName = "NullableDetectedTextBlockFormattingItem2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DetectedTextBlockFormattingItems?), TypeInfoPropertyName = "NullableDetectedTextBlockFormattingItems2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DetectedTextBlockRole?), TypeInfoPropertyName = "NullableDetectedTextBlockRole2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AssetType?), TypeInfoPropertyName = "NullableAssetType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] internal sealed partial class DesignSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext { } @@ -105,7 +92,6 @@ private DesignSourceGenerationContext(global::System.Text.Json.JsonSerializerOpt [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) { - options.Converters.Add(new global::Ideogram.JsonConverters.GenerationResponseDataInnerJsonConverter()); options.Converters.Add(new global::Ideogram.JsonConverters.UnixTimestampJsonConverter()); options.Converters.Add(new LazyEnumJsonConverterFactory()); } @@ -128,49 +114,31 @@ private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Ser public override bool CanConvert(global::System.Type typeToConvert) { return - typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed) - - || typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?) - - || typeToConvert == typeof(global::Ideogram.GenerationRejectReason) + typeToConvert == typeof(global::Ideogram.GenerationRejectReason) || typeToConvert == typeof(global::Ideogram.GenerationRejectReason?) - || typeToConvert == typeof(global::Ideogram.LayerizedImageObjectObjectType) + || typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed) - || typeToConvert == typeof(global::Ideogram.LayerizedImageObjectObjectType?) + || typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?) || typeToConvert == typeof(global::Ideogram.DetectedTextBlockAlignment) || typeToConvert == typeof(global::Ideogram.DetectedTextBlockAlignment?) - || typeToConvert == typeof(global::Ideogram.DetectedTextBlockFormattingItem) + || typeToConvert == typeof(global::Ideogram.DetectedTextBlockFormattingItems) - || typeToConvert == typeof(global::Ideogram.DetectedTextBlockFormattingItem?) + || typeToConvert == typeof(global::Ideogram.DetectedTextBlockFormattingItems?) || typeToConvert == typeof(global::Ideogram.DetectedTextBlockRole) - || typeToConvert == typeof(global::Ideogram.DetectedTextBlockRole?) - - || typeToConvert == typeof(global::Ideogram.AssetType) - - || typeToConvert == typeof(global::Ideogram.AssetType?); + || typeToConvert == typeof(global::Ideogram.DetectedTextBlockRole?); } public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) { - if (typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed)) - { - return new global::Ideogram.JsonConverters.GenerationErrorResponseTaskCompletionSpeedJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?)) - { - return new global::Ideogram.JsonConverters.GenerationErrorResponseTaskCompletionSpeedNullableJsonConverter(); - } - if (typeToConvert == typeof(global::Ideogram.GenerationRejectReason)) { return new global::Ideogram.JsonConverters.GenerationRejectReasonJsonConverter(); @@ -181,14 +149,14 @@ public override bool CanConvert(global::System.Type typeToConvert) return new global::Ideogram.JsonConverters.GenerationRejectReasonNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.LayerizedImageObjectObjectType)) + if (typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed)) { - return new global::Ideogram.JsonConverters.LayerizedImageObjectObjectTypeJsonConverter(); + return new global::Ideogram.JsonConverters.GenerationErrorResponseTaskCompletionSpeedJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.LayerizedImageObjectObjectType?)) + if (typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?)) { - return new global::Ideogram.JsonConverters.LayerizedImageObjectObjectTypeNullableJsonConverter(); + return new global::Ideogram.JsonConverters.GenerationErrorResponseTaskCompletionSpeedNullableJsonConverter(); } if (typeToConvert == typeof(global::Ideogram.DetectedTextBlockAlignment)) @@ -201,14 +169,14 @@ public override bool CanConvert(global::System.Type typeToConvert) return new global::Ideogram.JsonConverters.DetectedTextBlockAlignmentNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.DetectedTextBlockFormattingItem)) + if (typeToConvert == typeof(global::Ideogram.DetectedTextBlockFormattingItems)) { - return new global::Ideogram.JsonConverters.DetectedTextBlockFormattingItemJsonConverter(); + return new global::Ideogram.JsonConverters.DetectedTextBlockFormattingItemsJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.DetectedTextBlockFormattingItem?)) + if (typeToConvert == typeof(global::Ideogram.DetectedTextBlockFormattingItems?)) { - return new global::Ideogram.JsonConverters.DetectedTextBlockFormattingItemNullableJsonConverter(); + return new global::Ideogram.JsonConverters.DetectedTextBlockFormattingItemsNullableJsonConverter(); } if (typeToConvert == typeof(global::Ideogram.DetectedTextBlockRole)) @@ -220,16 +188,6 @@ public override bool CanConvert(global::System.Type typeToConvert) { return new global::Ideogram.JsonConverters.DetectedTextBlockRoleNullableJsonConverter(); } - - if (typeToConvert == typeof(global::Ideogram.AssetType)) - { - return new global::Ideogram.JsonConverters.AssetTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.AssetType?)) - { - return new global::Ideogram.JsonConverters.AssetTypeNullableJsonConverter(); - } throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); } } diff --git a/src/libs/Ideogram/Generated/Ideogram.DesignClient.DesignPostLayerizeDesignIdeogramV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.DesignClient.DesignPostLayerizeDesignIdeogramV3.g.cs new file mode 100644 index 00000000..8d93eb36 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.DesignClient.DesignPostLayerizeDesignIdeogramV3.g.cs @@ -0,0 +1,2602 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class DesignClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_DesignPostLayerizeDesignIdeogramV3SecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_DesignPostLayerizeDesignIdeogramV3SecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_DesignPostLayerizeDesignIdeogramV3SecurityRequirement0, + }; + partial void PrepareDesignPostLayerizeDesignIdeogramV3Arguments( + global::System.Net.Http.HttpClient httpClient, + ref bool? dryRun, + global::Ideogram.DesignPostLayerizeDesignIdeogramV3Request request); + partial void PrepareDesignPostLayerizeDesignIdeogramV3Request( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + bool? dryRun, + global::Ideogram.DesignPostLayerizeDesignIdeogramV3Request request); + partial void ProcessDesignPostLayerizeDesignIdeogramV3Response( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessDesignPostLayerizeDesignIdeogramV3ResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Layerize text with Ideogram 3.0
+ /// Turn a flat image into an editable design: detected text is returned as
+ /// positioned text blocks with matched fonts, sizes, and colors, alongside
+ /// a text-free base image. Upload the image as `image` using
+ /// `multipart/form-data`. Returns results directly by default; set `async`
+ /// or supply a `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task DesignPostLayerizeDesignIdeogramV3Async( + + global::Ideogram.DesignPostLayerizeDesignIdeogramV3Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DesignPostLayerizeDesignIdeogramV3AsResponseAsync( + + request: request, + dryRun: dryRun, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Layerize text with Ideogram 3.0
+ /// Turn a flat image into an editable design: detected text is returned as
+ /// positioned text blocks with matched fonts, sizes, and colors, alongside
+ /// a text-free base image. Upload the image as `image` using
+ /// `multipart/form-data`. Returns results directly by default; set `async`
+ /// or supply a `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DesignPostLayerizeDesignIdeogramV3AsResponseAsync( + + global::Ideogram.DesignPostLayerizeDesignIdeogramV3Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareDesignPostLayerizeDesignIdeogramV3Arguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_DesignPostLayerizeDesignIdeogramV3SecurityRequirements, + operationName: "DesignPostLayerizeDesignIdeogramV3Async"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/design/layerize/ideogram-3", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.Prompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (request.FontCandidateFiles != default) + { + + for (var __iFontCandidateFiles = 0; __iFontCandidateFiles < request.FontCandidateFiles.Count; __iFontCandidateFiles++) + { + var __contentFontCandidateFiles = new global::System.Net.Http.ByteArrayContent(request.FontCandidateFiles[__iFontCandidateFiles]); + __contentFontCandidateFiles.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); + __httpRequestContent.Add( + content: __contentFontCandidateFiles, + name: "\"font_candidate_files\"", + fileName: $"\"file{__iFontCandidateFiles}.bin\""); + if (__contentFontCandidateFiles.Headers.ContentDisposition != null) + { + __contentFontCandidateFiles.Headers.ContentDisposition.FileNameStar = null; + } + } + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareDesignPostLayerizeDesignIdeogramV3Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DesignPostLayerizeDesignIdeogramV3", + methodName: "DesignPostLayerizeDesignIdeogramV3Async", + pathTemplate: "\"/v2/design/layerize/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DesignPostLayerizeDesignIdeogramV3", + methodName: "DesignPostLayerizeDesignIdeogramV3Async", + pathTemplate: "\"/v2/design/layerize/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DesignPostLayerizeDesignIdeogramV3", + methodName: "DesignPostLayerizeDesignIdeogramV3Async", + pathTemplate: "\"/v2/design/layerize/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessDesignPostLayerizeDesignIdeogramV3Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DesignPostLayerizeDesignIdeogramV3", + methodName: "DesignPostLayerizeDesignIdeogramV3Async", + pathTemplate: "\"/v2/design/layerize/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DesignPostLayerizeDesignIdeogramV3", + methodName: "DesignPostLayerizeDesignIdeogramV3Async", + pathTemplate: "\"/v2/design/layerize/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not authorized to layerize images. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The source image was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessDesignPostLayerizeDesignIdeogramV3ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.LayerizeDesignIdeogramV3Response.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.LayerizeDesignIdeogramV3Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Layerize text with Ideogram 3.0
+ /// Turn a flat image into an editable design: detected text is returned as
+ /// positioned text blocks with matched fonts, sizes, and colors, alongside
+ /// a text-free base image. Upload the image as `image` using
+ /// `multipart/form-data`. Returns results directly by default; set `async`
+ /// or supply a `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image to layerize (max 50MB). Common image formats such as JPEG, PNG, and WEBP are supported. Multipart requests only. + /// + /// + /// The source image to layerize (max 50MB). Common image formats such as JPEG, PNG, and WEBP are supported. Multipart requests only. + /// + /// + /// A description of the image, used to guide text detection. When omitted, detection runs on the image alone. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// Candidate font files to make available for text style matching. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB each, maximum 5 files). Multipart requests only. + /// + /// + /// When false (the default), the request waits until layerization is complete and returns the result in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task DesignPostLayerizeDesignIdeogramV3Async( + byte[] image, + string imagename, + bool? dryRun = default, + string? prompt = default, + int? seed = default, + global::System.Collections.Generic.IList? fontCandidateFiles = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Ideogram.DesignPostLayerizeDesignIdeogramV3Request + { + Image = image, + Imagename = imagename, + Prompt = prompt, + Seed = seed, + FontCandidateFiles = fontCandidateFiles, + Async = async, + WebhookUrl = webhookUrl, + }; + + return await DesignPostLayerizeDesignIdeogramV3Async( + dryRun: dryRun, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// Layerize text with Ideogram 3.0
+ /// Turn a flat image into an editable design: detected text is returned as
+ /// positioned text blocks with matched fonts, sizes, and colors, alongside
+ /// a text-free base image. Upload the image as `image` using
+ /// `multipart/form-data`. Returns results directly by default; set `async`
+ /// or supply a `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image to layerize (max 50MB). Common image formats such as JPEG, PNG, and WEBP are supported. Multipart requests only. + /// + /// + /// The source image to layerize (max 50MB). Common image formats such as JPEG, PNG, and WEBP are supported. Multipart requests only. + /// + /// + /// A description of the image, used to guide text detection. When omitted, detection runs on the image alone. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// Candidate font files to make available for text style matching. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB each, maximum 5 files). Multipart requests only. + /// + /// + /// Optional file names to use for the multipart 'font_candidate_files' file parts. + /// + /// + /// When false (the default), the request waits until layerization is complete and returns the result in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task DesignPostLayerizeDesignIdeogramV3Async( + global::System.IO.Stream image, + string imagename, + bool? dryRun = default, + string? prompt = default, + int? seed = default, + global::System.Collections.Generic.IReadOnlyList? fontCandidateFiles = default, + global::System.Collections.Generic.IReadOnlyList? fontCandidateFilesFileNames = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + var request = new global::Ideogram.DesignPostLayerizeDesignIdeogramV3Request + { + Image = global::System.Array.Empty(), + Imagename = imagename, + Prompt = prompt, + Seed = seed, + FontCandidateFiles = new global::System.Collections.Generic.List(), + Async = async, + WebhookUrl = webhookUrl, + }; + PrepareArguments( + client: HttpClient); + PrepareDesignPostLayerizeDesignIdeogramV3Arguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_DesignPostLayerizeDesignIdeogramV3SecurityRequirements, + operationName: "DesignPostLayerizeDesignIdeogramV3Async"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/design/layerize/ideogram-3", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.Prompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (fontCandidateFiles != default) + { + + for (var __iFontCandidateFiles = 0; __iFontCandidateFiles < fontCandidateFiles.Count; __iFontCandidateFiles++) + { + var __fileNameFontCandidateFiles = fontCandidateFilesFileNames != null && + __iFontCandidateFiles < fontCandidateFilesFileNames.Count && + fontCandidateFilesFileNames[__iFontCandidateFiles] != null + ? fontCandidateFilesFileNames[__iFontCandidateFiles] + : $"file{__iFontCandidateFiles}.bin"; + var __contentFontCandidateFiles = new global::System.Net.Http.StreamContent(fontCandidateFiles[__iFontCandidateFiles]); + __contentFontCandidateFiles.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + __fileNameFontCandidateFiles is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(__fileNameFontCandidateFiles) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFontCandidateFiles, + name: "\"font_candidate_files\"", + fileName: $"\"{__fileNameFontCandidateFiles}\""); + if (__contentFontCandidateFiles.Headers.ContentDisposition != null) + { + __contentFontCandidateFiles.Headers.ContentDisposition.FileNameStar = null; + } + } + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareDesignPostLayerizeDesignIdeogramV3Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DesignPostLayerizeDesignIdeogramV3", + methodName: "DesignPostLayerizeDesignIdeogramV3Async", + pathTemplate: "\"/v2/design/layerize/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DesignPostLayerizeDesignIdeogramV3", + methodName: "DesignPostLayerizeDesignIdeogramV3Async", + pathTemplate: "\"/v2/design/layerize/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DesignPostLayerizeDesignIdeogramV3", + methodName: "DesignPostLayerizeDesignIdeogramV3Async", + pathTemplate: "\"/v2/design/layerize/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessDesignPostLayerizeDesignIdeogramV3Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DesignPostLayerizeDesignIdeogramV3", + methodName: "DesignPostLayerizeDesignIdeogramV3Async", + pathTemplate: "\"/v2/design/layerize/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DesignPostLayerizeDesignIdeogramV3", + methodName: "DesignPostLayerizeDesignIdeogramV3Async", + pathTemplate: "\"/v2/design/layerize/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not authorized to layerize images. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The source image was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessDesignPostLayerizeDesignIdeogramV3ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::Ideogram.LayerizeDesignIdeogramV3Response.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::Ideogram.LayerizeDesignIdeogramV3Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Layerize text with Ideogram 3.0
+ /// Turn a flat image into an editable design: detected text is returned as
+ /// positioned text blocks with matched fonts, sizes, and colors, alongside
+ /// a text-free base image. Upload the image as `image` using
+ /// `multipart/form-data`. Returns results directly by default; set `async`
+ /// or supply a `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image to layerize (max 50MB). Common image formats such as JPEG, PNG, and WEBP are supported. Multipart requests only. + /// + /// + /// The source image to layerize (max 50MB). Common image formats such as JPEG, PNG, and WEBP are supported. Multipart requests only. + /// + /// + /// A description of the image, used to guide text detection. When omitted, detection runs on the image alone. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// Candidate font files to make available for text style matching. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB each, maximum 5 files). Multipart requests only. + /// + /// + /// Optional file names to use for the multipart 'font_candidate_files' file parts. + /// + /// + /// When false (the default), the request waits until layerization is complete and returns the result in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DesignPostLayerizeDesignIdeogramV3AsResponseAsync( + global::System.IO.Stream image, + string imagename, + bool? dryRun = default, + string? prompt = default, + int? seed = default, + global::System.Collections.Generic.IReadOnlyList? fontCandidateFiles = default, + global::System.Collections.Generic.IReadOnlyList? fontCandidateFilesFileNames = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + var request = new global::Ideogram.DesignPostLayerizeDesignIdeogramV3Request + { + Image = global::System.Array.Empty(), + Imagename = imagename, + Prompt = prompt, + Seed = seed, + FontCandidateFiles = new global::System.Collections.Generic.List(), + Async = async, + WebhookUrl = webhookUrl, + }; + PrepareArguments( + client: HttpClient); + PrepareDesignPostLayerizeDesignIdeogramV3Arguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_DesignPostLayerizeDesignIdeogramV3SecurityRequirements, + operationName: "DesignPostLayerizeDesignIdeogramV3Async"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/design/layerize/ideogram-3", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.Prompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (fontCandidateFiles != default) + { + + for (var __iFontCandidateFiles = 0; __iFontCandidateFiles < fontCandidateFiles.Count; __iFontCandidateFiles++) + { + var __fileNameFontCandidateFiles = fontCandidateFilesFileNames != null && + __iFontCandidateFiles < fontCandidateFilesFileNames.Count && + fontCandidateFilesFileNames[__iFontCandidateFiles] != null + ? fontCandidateFilesFileNames[__iFontCandidateFiles] + : $"file{__iFontCandidateFiles}.bin"; + var __contentFontCandidateFiles = new global::System.Net.Http.StreamContent(fontCandidateFiles[__iFontCandidateFiles]); + __contentFontCandidateFiles.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + __fileNameFontCandidateFiles is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(__fileNameFontCandidateFiles) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFontCandidateFiles, + name: "\"font_candidate_files\"", + fileName: $"\"{__fileNameFontCandidateFiles}\""); + if (__contentFontCandidateFiles.Headers.ContentDisposition != null) + { + __contentFontCandidateFiles.Headers.ContentDisposition.FileNameStar = null; + } + } + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareDesignPostLayerizeDesignIdeogramV3Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DesignPostLayerizeDesignIdeogramV3", + methodName: "DesignPostLayerizeDesignIdeogramV3Async", + pathTemplate: "\"/v2/design/layerize/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DesignPostLayerizeDesignIdeogramV3", + methodName: "DesignPostLayerizeDesignIdeogramV3Async", + pathTemplate: "\"/v2/design/layerize/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DesignPostLayerizeDesignIdeogramV3", + methodName: "DesignPostLayerizeDesignIdeogramV3Async", + pathTemplate: "\"/v2/design/layerize/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessDesignPostLayerizeDesignIdeogramV3Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DesignPostLayerizeDesignIdeogramV3", + methodName: "DesignPostLayerizeDesignIdeogramV3Async", + pathTemplate: "\"/v2/design/layerize/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DesignPostLayerizeDesignIdeogramV3", + methodName: "DesignPostLayerizeDesignIdeogramV3Async", + pathTemplate: "\"/v2/design/layerize/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not authorized to layerize images. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The source image was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessDesignPostLayerizeDesignIdeogramV3ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.LayerizeDesignIdeogramV3Response.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.LayerizeDesignIdeogramV3Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.DesignClient.PostLayerizeDesignIdeogramV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.DesignClient.PostLayerizeDesignIdeogramV3.g.cs deleted file mode 100644 index 055252de..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.DesignClient.PostLayerizeDesignIdeogramV3.g.cs +++ /dev/null @@ -1,935 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class DesignClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostLayerizeDesignIdeogramV3SecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostLayerizeDesignIdeogramV3SecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostLayerizeDesignIdeogramV3SecurityRequirement0, - }; - partial void PreparePostLayerizeDesignIdeogramV3Arguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? dryRun, - global::Ideogram.LayerizeDesignIdeogramV3Request request); - partial void PreparePostLayerizeDesignIdeogramV3Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? dryRun, - global::Ideogram.LayerizeDesignIdeogramV3Request request); - partial void ProcessPostLayerizeDesignIdeogramV3Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostLayerizeDesignIdeogramV3ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Layerize text with Ideogram 3.0
- /// Turn a flat image into an editable design: detected text is returned as
- /// positioned text blocks with matched fonts, sizes, and colors, alongside
- /// a text-free base image. Upload the image as `image` using
- /// `multipart/form-data`. Returns results directly by default; set `async`
- /// or supply a `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostLayerizeDesignIdeogramV3Async( - - global::Ideogram.LayerizeDesignIdeogramV3Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostLayerizeDesignIdeogramV3AsResponseAsync( - - request: request, - dryRun: dryRun, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Layerize text with Ideogram 3.0
- /// Turn a flat image into an editable design: detected text is returned as
- /// positioned text blocks with matched fonts, sizes, and colors, alongside
- /// a text-free base image. Upload the image as `image` using
- /// `multipart/form-data`. Returns results directly by default; set `async`
- /// or supply a `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostLayerizeDesignIdeogramV3AsResponseAsync( - - global::Ideogram.LayerizeDesignIdeogramV3Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostLayerizeDesignIdeogramV3Arguments( - httpClient: HttpClient, - dryRun: ref dryRun, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostLayerizeDesignIdeogramV3SecurityRequirements, - operationName: "PostLayerizeDesignIdeogramV3Async"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/design/layerize/ideogram-3", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (request.ImageAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ImageAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"image_asset_identifier\""); - - } - if (request.Image != default) - { - - var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.Prompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.FontCandidateFiles != default) - { - - for (var __iFontCandidateFiles = 0; __iFontCandidateFiles < request.FontCandidateFiles.Count; __iFontCandidateFiles++) - { - var __contentFontCandidateFiles = new global::System.Net.Http.ByteArrayContent(request.FontCandidateFiles[__iFontCandidateFiles]); - __contentFontCandidateFiles.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); - __httpRequestContent.Add( - content: __contentFontCandidateFiles, - name: "\"font_candidate_files\"", - fileName: $"\"file{__iFontCandidateFiles}.bin\""); - if (__contentFontCandidateFiles.Headers.ContentDisposition != null) - { - __contentFontCandidateFiles.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - if (request.Async != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"async\""); - - } - if (request.WebhookUrl != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), - name: "\"webhook_url\""); - - } - if (request.Private != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"private\""); - - } - if (request.TargetCollectionId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.TargetCollectionId ?? string.Empty), - name: "\"target_collection_id\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostLayerizeDesignIdeogramV3Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - dryRun: dryRun, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostLayerizeDesignIdeogramV3", - methodName: "PostLayerizeDesignIdeogramV3Async", - pathTemplate: "\"/v2/design/layerize/ideogram-3\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostLayerizeDesignIdeogramV3", - methodName: "PostLayerizeDesignIdeogramV3Async", - pathTemplate: "\"/v2/design/layerize/ideogram-3\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostLayerizeDesignIdeogramV3", - methodName: "PostLayerizeDesignIdeogramV3Async", - pathTemplate: "\"/v2/design/layerize/ideogram-3\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostLayerizeDesignIdeogramV3Response( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostLayerizeDesignIdeogramV3", - methodName: "PostLayerizeDesignIdeogramV3Async", - pathTemplate: "\"/v2/design/layerize/ideogram-3\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostLayerizeDesignIdeogramV3", - methodName: "PostLayerizeDesignIdeogramV3Async", - pathTemplate: "\"/v2/design/layerize/ideogram-3\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 500) - { - string? __content_500 = null; - global::System.Exception? __exception_500 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_500 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_500, - responseBody: __content_500, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostLayerizeDesignIdeogramV3ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.LayerizeDesignIdeogramV3Response.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.LayerizeDesignIdeogramV3Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Layerize text with Ideogram 3.0
- /// Turn a flat image into an editable design: detected text is returned as
- /// positioned text blocks with matched fonts, sizes, and colors, alongside
- /// a text-free base image. Upload the image as `image` using
- /// `multipart/form-data`. Returns results directly by default; set `async`
- /// or supply a `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The source image to layerize (max 50MB). Common image formats such as JPEG, PNG, and WEBP are supported. Multipart requests only. - /// - /// - /// The source image to layerize (max 50MB). Common image formats such as JPEG, PNG, and WEBP are supported. Multipart requests only. - /// - /// - /// A description of the image, used to guide text detection. When omitted, detection runs on the image alone. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// Candidate font files to make available for text style matching. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB each, maximum 5 files). Multipart requests only. - /// - /// - /// When false (the default), the request waits until layerization is complete and returns the result in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output is added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostLayerizeDesignIdeogramV3Async( - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - string? prompt = default, - int? seed = default, - global::System.Collections.Generic.IList? fontCandidateFiles = default, - bool? async = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.LayerizeDesignIdeogramV3Request - { - ImageAssetIdentifier = imageAssetIdentifier, - Image = image, - Imagename = imagename, - Prompt = prompt, - Seed = seed, - FontCandidateFiles = fontCandidateFiles, - Async = async, - WebhookUrl = webhookUrl, - Private = @private, - TargetCollectionId = targetCollectionId, - }; - - return await PostLayerizeDesignIdeogramV3Async( - dryRun: dryRun, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.EditWorkflow.JsonSerializerContext.g.cs b/src/libs/Ideogram/Generated/Ideogram.EditWorkflow.JsonSerializerContext.g.cs index bfee9207..e104be3e 100644 --- a/src/libs/Ideogram/Generated/Ideogram.EditWorkflow.JsonSerializerContext.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.EditWorkflow.JsonSerializerContext.g.cs @@ -14,137 +14,66 @@ namespace Ideogram [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(byte[]))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AssetIdentifier))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationErrorResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationRejectReason), TypeInfoPropertyName = "GenerationRejectReason2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed), TypeInfoPropertyName = "GenerationErrorResponseTaskCompletionSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReplaceBackgroundResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReplaceBackgroundRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReplaceBackgroundQuality), TypeInfoPropertyName = "ReplaceBackgroundQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReplaceBackgroundIdeogramV3Request))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReplaceBackgroundIdeogramV3RequestRenderingSpeed), TypeInfoPropertyName = "ReplaceBackgroundIdeogramV3RequestRenderingSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReplaceBackgroundIdeogram45Request))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LookbookResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LookbookRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LookbookRequestCategory), TypeInfoPropertyName = "LookbookRequestCategory2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ModelPoseVariantsResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ModelPoseVariantsRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ModelPoseVariantsQuality), TypeInfoPropertyName = "ModelPoseVariantsQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PackshotsResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PackshotsRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PackshotView), TypeInfoPropertyName = "PackshotView2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PackshotsQuality), TypeInfoPropertyName = "PackshotsQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GhostMannequinResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GhostMannequinRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GhostMannequinRequestView), TypeInfoPropertyName = "GhostMannequinRequestView2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GhostMannequinQuality), TypeInfoPropertyName = "GhostMannequinQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PreciseMaskedEditResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PreciseMaskedEditRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PreciseMaskedEditModel), TypeInfoPropertyName = "PreciseMaskedEditModel2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PreciseMaskedEditQuality), TypeInfoPropertyName = "PreciseMaskedEditQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.VirtualTryOnResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.VirtualTryOnRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ColorwaysResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ColorwaysRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ColorwaysQuality), TypeInfoPropertyName = "ColorwaysQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AdLocalizerResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AdLocalizerRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AdLocalizerRequestLanguage), TypeInfoPropertyName = "AdLocalizerRequestLanguage2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationErrorResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage), TypeInfoPropertyName = "V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AdLocalizerQuality), TypeInfoPropertyName = "AdLocalizerQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.VectorizerResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.VectorizerRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.VectorizerRequestMode), TypeInfoPropertyName = "VectorizerRequestMode2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TextLayerizerResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TextLayerizerRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AdResizerResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AdResizerRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AdResizerRequestResolution), TypeInfoPropertyName = "AdResizerRequestResolution2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AdResizerRequestPlatform), TypeInfoPropertyName = "AdResizerRequestPlatform2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AdLocalizerResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution), TypeInfoPropertyName = "V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaPlatform), TypeInfoPropertyName = "V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaPlatform2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AdResizerQuality), TypeInfoPropertyName = "AdResizerQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AdVariationsResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AdVariationsRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AdVariationsRequestVariationType), TypeInfoPropertyName = "AdVariationsRequestVariationType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AdResizerResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ToolAdVariationsPostRequestBodyContentMultipartFormDataSchemaVariationType), TypeInfoPropertyName = "V2ToolAdVariationsPostRequestBodyContentMultipartFormDataSchemaVariationType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AdVariationsQuality), TypeInfoPropertyName = "AdVariationsQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SketchToRenderResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SketchToRenderRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SketchToRenderQuality), TypeInfoPropertyName = "SketchToRenderQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SoleSwapResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SoleSwapRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SoleSwapRequestBaseGenerationSize), TypeInfoPropertyName = "SoleSwapRequestBaseGenerationSize2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SoleSwapQuality), TypeInfoPropertyName = "SoleSwapQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SwapProductResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SwapProductRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SwapProductMode), TypeInfoPropertyName = "SwapProductMode2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SwapProductQuality), TypeInfoPropertyName = "SwapProductQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SkechersStyleEditResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SkechersStyleEditRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SkechersStyleEditRequestAspectRatio), TypeInfoPropertyName = "SkechersStyleEditRequestAspectRatio2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SkechersStyleEditRequestBaseGenerationSize), TypeInfoPropertyName = "SkechersStyleEditRequestBaseGenerationSize2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SkechersStyleEditQuality), TypeInfoPropertyName = "SkechersStyleEditQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SwanSLogoDesignResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SwanSLogoDesignRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SwanSLogoDesignRequestLogoStyle), TypeInfoPropertyName = "SwanSLogoDesignRequestLogoStyle2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SwanSLogoDesignRequestSourceMode), TypeInfoPropertyName = "SwanSLogoDesignRequestSourceMode2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SwanSLogoDesignRequestDesignVariant), TypeInfoPropertyName = "SwanSLogoDesignRequestDesignVariant2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SwanSLogoQuality), TypeInfoPropertyName = "SwanSLogoQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SwanSLogoInstallResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SwanSLogoInstallRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SwanSLogoInstallRequestLogoStyle), TypeInfoPropertyName = "SwanSLogoInstallRequestLogoStyle2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ModelSwapResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ModelSwapRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ModelSwapQuality), TypeInfoPropertyName = "ModelSwapQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MaterialSwapResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MaterialSwapRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MaterialSwapQuality), TypeInfoPropertyName = "MaterialSwapQuality2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AdVariationsResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ColorwaysQuality), TypeInfoPropertyName = "ColorwaysQuality2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ColorwaysResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AssetType), TypeInfoPropertyName = "AssetType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AssetIdentifier))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ToolGhostMannequinPostRequestBodyContentMultipartFormDataSchemaView), TypeInfoPropertyName = "V2ToolGhostMannequinPostRequestBodyContentMultipartFormDataSchemaView2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GhostMannequinQuality), TypeInfoPropertyName = "GhostMannequinQuality2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GhostMannequinResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MaterialSwapQuality), TypeInfoPropertyName = "MaterialSwapQuality2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MaterialSwapResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ModelPoseVariantsQuality), TypeInfoPropertyName = "ModelPoseVariantsQuality2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ModelPoseVariantsResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SketchToRenderQuality), TypeInfoPropertyName = "SketchToRenderQuality2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SketchToRenderResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(byte[]))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.EditWorkflowPostAdLocalizerRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.EditWorkflowPostAdResizerRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.EditWorkflowPostAdVariationsRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.EditWorkflowPostColorwaysRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.EditWorkflowPostGhostMannequinRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.EditWorkflowPostMaterialSwapRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.EditWorkflowPostModelPoseVariantsRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.EditWorkflowPostSketchToRenderRequest))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationRejectReason?), TypeInfoPropertyName = "NullableGenerationRejectReason2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?), TypeInfoPropertyName = "NullableGenerationErrorResponseTaskCompletionSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReplaceBackgroundQuality?), TypeInfoPropertyName = "NullableReplaceBackgroundQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReplaceBackgroundIdeogramV3RequestRenderingSpeed?), TypeInfoPropertyName = "NullableReplaceBackgroundIdeogramV3RequestRenderingSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LookbookRequestCategory?), TypeInfoPropertyName = "NullableLookbookRequestCategory2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ModelPoseVariantsQuality?), TypeInfoPropertyName = "NullableModelPoseVariantsQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PackshotView?), TypeInfoPropertyName = "NullablePackshotView2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PackshotsQuality?), TypeInfoPropertyName = "NullablePackshotsQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GhostMannequinRequestView?), TypeInfoPropertyName = "NullableGhostMannequinRequestView2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GhostMannequinQuality?), TypeInfoPropertyName = "NullableGhostMannequinQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PreciseMaskedEditModel?), TypeInfoPropertyName = "NullablePreciseMaskedEditModel2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PreciseMaskedEditQuality?), TypeInfoPropertyName = "NullablePreciseMaskedEditQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ColorwaysQuality?), TypeInfoPropertyName = "NullableColorwaysQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AdLocalizerRequestLanguage?), TypeInfoPropertyName = "NullableAdLocalizerRequestLanguage2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage?), TypeInfoPropertyName = "NullableV2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AdLocalizerQuality?), TypeInfoPropertyName = "NullableAdLocalizerQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.VectorizerRequestMode?), TypeInfoPropertyName = "NullableVectorizerRequestMode2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AdResizerRequestResolution?), TypeInfoPropertyName = "NullableAdResizerRequestResolution2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AdResizerRequestPlatform?), TypeInfoPropertyName = "NullableAdResizerRequestPlatform2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution?), TypeInfoPropertyName = "NullableV2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaPlatform?), TypeInfoPropertyName = "NullableV2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaPlatform2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AdResizerQuality?), TypeInfoPropertyName = "NullableAdResizerQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AdVariationsRequestVariationType?), TypeInfoPropertyName = "NullableAdVariationsRequestVariationType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ToolAdVariationsPostRequestBodyContentMultipartFormDataSchemaVariationType?), TypeInfoPropertyName = "NullableV2ToolAdVariationsPostRequestBodyContentMultipartFormDataSchemaVariationType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AdVariationsQuality?), TypeInfoPropertyName = "NullableAdVariationsQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SketchToRenderQuality?), TypeInfoPropertyName = "NullableSketchToRenderQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SoleSwapRequestBaseGenerationSize?), TypeInfoPropertyName = "NullableSoleSwapRequestBaseGenerationSize2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SoleSwapQuality?), TypeInfoPropertyName = "NullableSoleSwapQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SwapProductMode?), TypeInfoPropertyName = "NullableSwapProductMode2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SwapProductQuality?), TypeInfoPropertyName = "NullableSwapProductQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SkechersStyleEditRequestAspectRatio?), TypeInfoPropertyName = "NullableSkechersStyleEditRequestAspectRatio2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SkechersStyleEditRequestBaseGenerationSize?), TypeInfoPropertyName = "NullableSkechersStyleEditRequestBaseGenerationSize2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SkechersStyleEditQuality?), TypeInfoPropertyName = "NullableSkechersStyleEditQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SwanSLogoDesignRequestLogoStyle?), TypeInfoPropertyName = "NullableSwanSLogoDesignRequestLogoStyle2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SwanSLogoDesignRequestSourceMode?), TypeInfoPropertyName = "NullableSwanSLogoDesignRequestSourceMode2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SwanSLogoDesignRequestDesignVariant?), TypeInfoPropertyName = "NullableSwanSLogoDesignRequestDesignVariant2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SwanSLogoQuality?), TypeInfoPropertyName = "NullableSwanSLogoQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SwanSLogoInstallRequestLogoStyle?), TypeInfoPropertyName = "NullableSwanSLogoInstallRequestLogoStyle2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ModelSwapQuality?), TypeInfoPropertyName = "NullableModelSwapQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MaterialSwapQuality?), TypeInfoPropertyName = "NullableMaterialSwapQuality2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ColorwaysQuality?), TypeInfoPropertyName = "NullableColorwaysQuality2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AssetType?), TypeInfoPropertyName = "NullableAssetType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ToolGhostMannequinPostRequestBodyContentMultipartFormDataSchemaView?), TypeInfoPropertyName = "NullableV2ToolGhostMannequinPostRequestBodyContentMultipartFormDataSchemaView2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GhostMannequinQuality?), TypeInfoPropertyName = "NullableGhostMannequinQuality2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MaterialSwapQuality?), TypeInfoPropertyName = "NullableMaterialSwapQuality2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ModelPoseVariantsQuality?), TypeInfoPropertyName = "NullableModelPoseVariantsQuality2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SketchToRenderQuality?), TypeInfoPropertyName = "NullableSketchToRenderQuality2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] internal sealed partial class EditWorkflowSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext { } @@ -214,169 +143,75 @@ private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Ser public override bool CanConvert(global::System.Type typeToConvert) { return - typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed) - - || typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?) - - || typeToConvert == typeof(global::Ideogram.GenerationRejectReason) + typeToConvert == typeof(global::Ideogram.GenerationRejectReason) || typeToConvert == typeof(global::Ideogram.GenerationRejectReason?) - || typeToConvert == typeof(global::Ideogram.ReplaceBackgroundQuality) - - || typeToConvert == typeof(global::Ideogram.ReplaceBackgroundQuality?) - - || typeToConvert == typeof(global::Ideogram.ReplaceBackgroundIdeogramV3RequestRenderingSpeed) - - || typeToConvert == typeof(global::Ideogram.ReplaceBackgroundIdeogramV3RequestRenderingSpeed?) - - || typeToConvert == typeof(global::Ideogram.LookbookRequestCategory) - - || typeToConvert == typeof(global::Ideogram.LookbookRequestCategory?) - - || typeToConvert == typeof(global::Ideogram.ModelPoseVariantsQuality) - - || typeToConvert == typeof(global::Ideogram.ModelPoseVariantsQuality?) - - || typeToConvert == typeof(global::Ideogram.PackshotView) - - || typeToConvert == typeof(global::Ideogram.PackshotView?) - - || typeToConvert == typeof(global::Ideogram.PackshotsQuality) - - || typeToConvert == typeof(global::Ideogram.PackshotsQuality?) - - || typeToConvert == typeof(global::Ideogram.GhostMannequinRequestView) - - || typeToConvert == typeof(global::Ideogram.GhostMannequinRequestView?) - - || typeToConvert == typeof(global::Ideogram.GhostMannequinQuality) - - || typeToConvert == typeof(global::Ideogram.GhostMannequinQuality?) - - || typeToConvert == typeof(global::Ideogram.PreciseMaskedEditModel) + || typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed) - || typeToConvert == typeof(global::Ideogram.PreciseMaskedEditModel?) - - || typeToConvert == typeof(global::Ideogram.PreciseMaskedEditQuality) - - || typeToConvert == typeof(global::Ideogram.PreciseMaskedEditQuality?) - - || typeToConvert == typeof(global::Ideogram.ColorwaysQuality) - - || typeToConvert == typeof(global::Ideogram.ColorwaysQuality?) + || typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?) - || typeToConvert == typeof(global::Ideogram.AdLocalizerRequestLanguage) + || typeToConvert == typeof(global::Ideogram.V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage) - || typeToConvert == typeof(global::Ideogram.AdLocalizerRequestLanguage?) + || typeToConvert == typeof(global::Ideogram.V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage?) || typeToConvert == typeof(global::Ideogram.AdLocalizerQuality) || typeToConvert == typeof(global::Ideogram.AdLocalizerQuality?) - || typeToConvert == typeof(global::Ideogram.VectorizerRequestMode) - - || typeToConvert == typeof(global::Ideogram.VectorizerRequestMode?) + || typeToConvert == typeof(global::Ideogram.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution) - || typeToConvert == typeof(global::Ideogram.AdResizerRequestResolution) + || typeToConvert == typeof(global::Ideogram.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution?) - || typeToConvert == typeof(global::Ideogram.AdResizerRequestResolution?) + || typeToConvert == typeof(global::Ideogram.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaPlatform) - || typeToConvert == typeof(global::Ideogram.AdResizerRequestPlatform) - - || typeToConvert == typeof(global::Ideogram.AdResizerRequestPlatform?) + || typeToConvert == typeof(global::Ideogram.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaPlatform?) || typeToConvert == typeof(global::Ideogram.AdResizerQuality) || typeToConvert == typeof(global::Ideogram.AdResizerQuality?) - || typeToConvert == typeof(global::Ideogram.AdVariationsRequestVariationType) + || typeToConvert == typeof(global::Ideogram.V2ToolAdVariationsPostRequestBodyContentMultipartFormDataSchemaVariationType) - || typeToConvert == typeof(global::Ideogram.AdVariationsRequestVariationType?) + || typeToConvert == typeof(global::Ideogram.V2ToolAdVariationsPostRequestBodyContentMultipartFormDataSchemaVariationType?) || typeToConvert == typeof(global::Ideogram.AdVariationsQuality) || typeToConvert == typeof(global::Ideogram.AdVariationsQuality?) - || typeToConvert == typeof(global::Ideogram.SketchToRenderQuality) - - || typeToConvert == typeof(global::Ideogram.SketchToRenderQuality?) - - || typeToConvert == typeof(global::Ideogram.SoleSwapRequestBaseGenerationSize) - - || typeToConvert == typeof(global::Ideogram.SoleSwapRequestBaseGenerationSize?) - - || typeToConvert == typeof(global::Ideogram.SoleSwapQuality) - - || typeToConvert == typeof(global::Ideogram.SoleSwapQuality?) - - || typeToConvert == typeof(global::Ideogram.SwapProductMode) - - || typeToConvert == typeof(global::Ideogram.SwapProductMode?) - - || typeToConvert == typeof(global::Ideogram.SwapProductQuality) - - || typeToConvert == typeof(global::Ideogram.SwapProductQuality?) - - || typeToConvert == typeof(global::Ideogram.SkechersStyleEditRequestAspectRatio) - - || typeToConvert == typeof(global::Ideogram.SkechersStyleEditRequestAspectRatio?) - - || typeToConvert == typeof(global::Ideogram.SkechersStyleEditRequestBaseGenerationSize) - - || typeToConvert == typeof(global::Ideogram.SkechersStyleEditRequestBaseGenerationSize?) - - || typeToConvert == typeof(global::Ideogram.SkechersStyleEditQuality) - - || typeToConvert == typeof(global::Ideogram.SkechersStyleEditQuality?) - - || typeToConvert == typeof(global::Ideogram.SwanSLogoDesignRequestLogoStyle) - - || typeToConvert == typeof(global::Ideogram.SwanSLogoDesignRequestLogoStyle?) - - || typeToConvert == typeof(global::Ideogram.SwanSLogoDesignRequestSourceMode) - - || typeToConvert == typeof(global::Ideogram.SwanSLogoDesignRequestSourceMode?) - - || typeToConvert == typeof(global::Ideogram.SwanSLogoDesignRequestDesignVariant) + || typeToConvert == typeof(global::Ideogram.ColorwaysQuality) - || typeToConvert == typeof(global::Ideogram.SwanSLogoDesignRequestDesignVariant?) + || typeToConvert == typeof(global::Ideogram.ColorwaysQuality?) - || typeToConvert == typeof(global::Ideogram.SwanSLogoQuality) + || typeToConvert == typeof(global::Ideogram.AssetType) - || typeToConvert == typeof(global::Ideogram.SwanSLogoQuality?) + || typeToConvert == typeof(global::Ideogram.AssetType?) - || typeToConvert == typeof(global::Ideogram.SwanSLogoInstallRequestLogoStyle) + || typeToConvert == typeof(global::Ideogram.V2ToolGhostMannequinPostRequestBodyContentMultipartFormDataSchemaView) - || typeToConvert == typeof(global::Ideogram.SwanSLogoInstallRequestLogoStyle?) + || typeToConvert == typeof(global::Ideogram.V2ToolGhostMannequinPostRequestBodyContentMultipartFormDataSchemaView?) - || typeToConvert == typeof(global::Ideogram.ModelSwapQuality) + || typeToConvert == typeof(global::Ideogram.GhostMannequinQuality) - || typeToConvert == typeof(global::Ideogram.ModelSwapQuality?) + || typeToConvert == typeof(global::Ideogram.GhostMannequinQuality?) || typeToConvert == typeof(global::Ideogram.MaterialSwapQuality) || typeToConvert == typeof(global::Ideogram.MaterialSwapQuality?) - || typeToConvert == typeof(global::Ideogram.AssetType) + || typeToConvert == typeof(global::Ideogram.ModelPoseVariantsQuality) - || typeToConvert == typeof(global::Ideogram.AssetType?); + || typeToConvert == typeof(global::Ideogram.ModelPoseVariantsQuality?) + + || typeToConvert == typeof(global::Ideogram.SketchToRenderQuality) + + || typeToConvert == typeof(global::Ideogram.SketchToRenderQuality?); } public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) { - if (typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed)) - { - return new global::Ideogram.JsonConverters.GenerationErrorResponseTaskCompletionSpeedJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?)) - { - return new global::Ideogram.JsonConverters.GenerationErrorResponseTaskCompletionSpeedNullableJsonConverter(); - } - if (typeToConvert == typeof(global::Ideogram.GenerationRejectReason)) { return new global::Ideogram.JsonConverters.GenerationRejectReasonJsonConverter(); @@ -387,124 +222,24 @@ public override bool CanConvert(global::System.Type typeToConvert) return new global::Ideogram.JsonConverters.GenerationRejectReasonNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.ReplaceBackgroundQuality)) - { - return new global::Ideogram.JsonConverters.ReplaceBackgroundQualityJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ReplaceBackgroundQuality?)) - { - return new global::Ideogram.JsonConverters.ReplaceBackgroundQualityNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ReplaceBackgroundIdeogramV3RequestRenderingSpeed)) - { - return new global::Ideogram.JsonConverters.ReplaceBackgroundIdeogramV3RequestRenderingSpeedJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ReplaceBackgroundIdeogramV3RequestRenderingSpeed?)) - { - return new global::Ideogram.JsonConverters.ReplaceBackgroundIdeogramV3RequestRenderingSpeedNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.LookbookRequestCategory)) - { - return new global::Ideogram.JsonConverters.LookbookRequestCategoryJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.LookbookRequestCategory?)) - { - return new global::Ideogram.JsonConverters.LookbookRequestCategoryNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ModelPoseVariantsQuality)) - { - return new global::Ideogram.JsonConverters.ModelPoseVariantsQualityJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ModelPoseVariantsQuality?)) - { - return new global::Ideogram.JsonConverters.ModelPoseVariantsQualityNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.PackshotView)) - { - return new global::Ideogram.JsonConverters.PackshotViewJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.PackshotView?)) - { - return new global::Ideogram.JsonConverters.PackshotViewNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.PackshotsQuality)) - { - return new global::Ideogram.JsonConverters.PackshotsQualityJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.PackshotsQuality?)) - { - return new global::Ideogram.JsonConverters.PackshotsQualityNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GhostMannequinRequestView)) - { - return new global::Ideogram.JsonConverters.GhostMannequinRequestViewJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GhostMannequinRequestView?)) - { - return new global::Ideogram.JsonConverters.GhostMannequinRequestViewNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GhostMannequinQuality)) - { - return new global::Ideogram.JsonConverters.GhostMannequinQualityJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GhostMannequinQuality?)) - { - return new global::Ideogram.JsonConverters.GhostMannequinQualityNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.PreciseMaskedEditModel)) - { - return new global::Ideogram.JsonConverters.PreciseMaskedEditModelJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.PreciseMaskedEditModel?)) - { - return new global::Ideogram.JsonConverters.PreciseMaskedEditModelNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.PreciseMaskedEditQuality)) - { - return new global::Ideogram.JsonConverters.PreciseMaskedEditQualityJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.PreciseMaskedEditQuality?)) - { - return new global::Ideogram.JsonConverters.PreciseMaskedEditQualityNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ColorwaysQuality)) + if (typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed)) { - return new global::Ideogram.JsonConverters.ColorwaysQualityJsonConverter(); + return new global::Ideogram.JsonConverters.GenerationErrorResponseTaskCompletionSpeedJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.ColorwaysQuality?)) + if (typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?)) { - return new global::Ideogram.JsonConverters.ColorwaysQualityNullableJsonConverter(); + return new global::Ideogram.JsonConverters.GenerationErrorResponseTaskCompletionSpeedNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.AdLocalizerRequestLanguage)) + if (typeToConvert == typeof(global::Ideogram.V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage)) { - return new global::Ideogram.JsonConverters.AdLocalizerRequestLanguageJsonConverter(); + return new global::Ideogram.JsonConverters.V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguageJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.AdLocalizerRequestLanguage?)) + if (typeToConvert == typeof(global::Ideogram.V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage?)) { - return new global::Ideogram.JsonConverters.AdLocalizerRequestLanguageNullableJsonConverter(); + return new global::Ideogram.JsonConverters.V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguageNullableJsonConverter(); } if (typeToConvert == typeof(global::Ideogram.AdLocalizerQuality)) @@ -517,34 +252,24 @@ public override bool CanConvert(global::System.Type typeToConvert) return new global::Ideogram.JsonConverters.AdLocalizerQualityNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.VectorizerRequestMode)) + if (typeToConvert == typeof(global::Ideogram.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution)) { - return new global::Ideogram.JsonConverters.VectorizerRequestModeJsonConverter(); + return new global::Ideogram.JsonConverters.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolutionJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.VectorizerRequestMode?)) + if (typeToConvert == typeof(global::Ideogram.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution?)) { - return new global::Ideogram.JsonConverters.VectorizerRequestModeNullableJsonConverter(); + return new global::Ideogram.JsonConverters.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolutionNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.AdResizerRequestResolution)) + if (typeToConvert == typeof(global::Ideogram.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaPlatform)) { - return new global::Ideogram.JsonConverters.AdResizerRequestResolutionJsonConverter(); + return new global::Ideogram.JsonConverters.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaPlatformJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.AdResizerRequestResolution?)) + if (typeToConvert == typeof(global::Ideogram.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaPlatform?)) { - return new global::Ideogram.JsonConverters.AdResizerRequestResolutionNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.AdResizerRequestPlatform)) - { - return new global::Ideogram.JsonConverters.AdResizerRequestPlatformJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.AdResizerRequestPlatform?)) - { - return new global::Ideogram.JsonConverters.AdResizerRequestPlatformNullableJsonConverter(); + return new global::Ideogram.JsonConverters.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaPlatformNullableJsonConverter(); } if (typeToConvert == typeof(global::Ideogram.AdResizerQuality)) @@ -557,14 +282,14 @@ public override bool CanConvert(global::System.Type typeToConvert) return new global::Ideogram.JsonConverters.AdResizerQualityNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.AdVariationsRequestVariationType)) + if (typeToConvert == typeof(global::Ideogram.V2ToolAdVariationsPostRequestBodyContentMultipartFormDataSchemaVariationType)) { - return new global::Ideogram.JsonConverters.AdVariationsRequestVariationTypeJsonConverter(); + return new global::Ideogram.JsonConverters.V2ToolAdVariationsPostRequestBodyContentMultipartFormDataSchemaVariationTypeJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.AdVariationsRequestVariationType?)) + if (typeToConvert == typeof(global::Ideogram.V2ToolAdVariationsPostRequestBodyContentMultipartFormDataSchemaVariationType?)) { - return new global::Ideogram.JsonConverters.AdVariationsRequestVariationTypeNullableJsonConverter(); + return new global::Ideogram.JsonConverters.V2ToolAdVariationsPostRequestBodyContentMultipartFormDataSchemaVariationTypeNullableJsonConverter(); } if (typeToConvert == typeof(global::Ideogram.AdVariationsQuality)) @@ -577,164 +302,74 @@ public override bool CanConvert(global::System.Type typeToConvert) return new global::Ideogram.JsonConverters.AdVariationsQualityNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.SketchToRenderQuality)) - { - return new global::Ideogram.JsonConverters.SketchToRenderQualityJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.SketchToRenderQuality?)) - { - return new global::Ideogram.JsonConverters.SketchToRenderQualityNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.SoleSwapRequestBaseGenerationSize)) - { - return new global::Ideogram.JsonConverters.SoleSwapRequestBaseGenerationSizeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.SoleSwapRequestBaseGenerationSize?)) - { - return new global::Ideogram.JsonConverters.SoleSwapRequestBaseGenerationSizeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.SoleSwapQuality)) - { - return new global::Ideogram.JsonConverters.SoleSwapQualityJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.SoleSwapQuality?)) - { - return new global::Ideogram.JsonConverters.SoleSwapQualityNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.SwapProductMode)) - { - return new global::Ideogram.JsonConverters.SwapProductModeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.SwapProductMode?)) - { - return new global::Ideogram.JsonConverters.SwapProductModeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.SwapProductQuality)) - { - return new global::Ideogram.JsonConverters.SwapProductQualityJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.SwapProductQuality?)) - { - return new global::Ideogram.JsonConverters.SwapProductQualityNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.SkechersStyleEditRequestAspectRatio)) - { - return new global::Ideogram.JsonConverters.SkechersStyleEditRequestAspectRatioJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.SkechersStyleEditRequestAspectRatio?)) - { - return new global::Ideogram.JsonConverters.SkechersStyleEditRequestAspectRatioNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.SkechersStyleEditRequestBaseGenerationSize)) - { - return new global::Ideogram.JsonConverters.SkechersStyleEditRequestBaseGenerationSizeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.SkechersStyleEditRequestBaseGenerationSize?)) - { - return new global::Ideogram.JsonConverters.SkechersStyleEditRequestBaseGenerationSizeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.SkechersStyleEditQuality)) - { - return new global::Ideogram.JsonConverters.SkechersStyleEditQualityJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.SkechersStyleEditQuality?)) - { - return new global::Ideogram.JsonConverters.SkechersStyleEditQualityNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.SwanSLogoDesignRequestLogoStyle)) - { - return new global::Ideogram.JsonConverters.SwanSLogoDesignRequestLogoStyleJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.SwanSLogoDesignRequestLogoStyle?)) - { - return new global::Ideogram.JsonConverters.SwanSLogoDesignRequestLogoStyleNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.SwanSLogoDesignRequestSourceMode)) + if (typeToConvert == typeof(global::Ideogram.ColorwaysQuality)) { - return new global::Ideogram.JsonConverters.SwanSLogoDesignRequestSourceModeJsonConverter(); + return new global::Ideogram.JsonConverters.ColorwaysQualityJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.SwanSLogoDesignRequestSourceMode?)) + if (typeToConvert == typeof(global::Ideogram.ColorwaysQuality?)) { - return new global::Ideogram.JsonConverters.SwanSLogoDesignRequestSourceModeNullableJsonConverter(); + return new global::Ideogram.JsonConverters.ColorwaysQualityNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.SwanSLogoDesignRequestDesignVariant)) + if (typeToConvert == typeof(global::Ideogram.AssetType)) { - return new global::Ideogram.JsonConverters.SwanSLogoDesignRequestDesignVariantJsonConverter(); + return new global::Ideogram.JsonConverters.AssetTypeJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.SwanSLogoDesignRequestDesignVariant?)) + if (typeToConvert == typeof(global::Ideogram.AssetType?)) { - return new global::Ideogram.JsonConverters.SwanSLogoDesignRequestDesignVariantNullableJsonConverter(); + return new global::Ideogram.JsonConverters.AssetTypeNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.SwanSLogoQuality)) + if (typeToConvert == typeof(global::Ideogram.V2ToolGhostMannequinPostRequestBodyContentMultipartFormDataSchemaView)) { - return new global::Ideogram.JsonConverters.SwanSLogoQualityJsonConverter(); + return new global::Ideogram.JsonConverters.V2ToolGhostMannequinPostRequestBodyContentMultipartFormDataSchemaViewJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.SwanSLogoQuality?)) + if (typeToConvert == typeof(global::Ideogram.V2ToolGhostMannequinPostRequestBodyContentMultipartFormDataSchemaView?)) { - return new global::Ideogram.JsonConverters.SwanSLogoQualityNullableJsonConverter(); + return new global::Ideogram.JsonConverters.V2ToolGhostMannequinPostRequestBodyContentMultipartFormDataSchemaViewNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.SwanSLogoInstallRequestLogoStyle)) + if (typeToConvert == typeof(global::Ideogram.GhostMannequinQuality)) { - return new global::Ideogram.JsonConverters.SwanSLogoInstallRequestLogoStyleJsonConverter(); + return new global::Ideogram.JsonConverters.GhostMannequinQualityJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.SwanSLogoInstallRequestLogoStyle?)) + if (typeToConvert == typeof(global::Ideogram.GhostMannequinQuality?)) { - return new global::Ideogram.JsonConverters.SwanSLogoInstallRequestLogoStyleNullableJsonConverter(); + return new global::Ideogram.JsonConverters.GhostMannequinQualityNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.ModelSwapQuality)) + if (typeToConvert == typeof(global::Ideogram.MaterialSwapQuality)) { - return new global::Ideogram.JsonConverters.ModelSwapQualityJsonConverter(); + return new global::Ideogram.JsonConverters.MaterialSwapQualityJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.ModelSwapQuality?)) + if (typeToConvert == typeof(global::Ideogram.MaterialSwapQuality?)) { - return new global::Ideogram.JsonConverters.ModelSwapQualityNullableJsonConverter(); + return new global::Ideogram.JsonConverters.MaterialSwapQualityNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.MaterialSwapQuality)) + if (typeToConvert == typeof(global::Ideogram.ModelPoseVariantsQuality)) { - return new global::Ideogram.JsonConverters.MaterialSwapQualityJsonConverter(); + return new global::Ideogram.JsonConverters.ModelPoseVariantsQualityJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.MaterialSwapQuality?)) + if (typeToConvert == typeof(global::Ideogram.ModelPoseVariantsQuality?)) { - return new global::Ideogram.JsonConverters.MaterialSwapQualityNullableJsonConverter(); + return new global::Ideogram.JsonConverters.ModelPoseVariantsQualityNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.AssetType)) + if (typeToConvert == typeof(global::Ideogram.SketchToRenderQuality)) { - return new global::Ideogram.JsonConverters.AssetTypeJsonConverter(); + return new global::Ideogram.JsonConverters.SketchToRenderQualityJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.AssetType?)) + if (typeToConvert == typeof(global::Ideogram.SketchToRenderQuality?)) { - return new global::Ideogram.JsonConverters.AssetTypeNullableJsonConverter(); + return new global::Ideogram.JsonConverters.SketchToRenderQualityNullableJsonConverter(); } throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); } diff --git a/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.EditWorkflowPostAdLocalizer.g.cs b/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.EditWorkflowPostAdLocalizer.g.cs new file mode 100644 index 00000000..f15d7ba3 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.EditWorkflowPostAdLocalizer.g.cs @@ -0,0 +1,2476 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class EditWorkflowClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_EditWorkflowPostAdLocalizerSecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_EditWorkflowPostAdLocalizerSecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_EditWorkflowPostAdLocalizerSecurityRequirement0, + }; + partial void PrepareEditWorkflowPostAdLocalizerArguments( + global::System.Net.Http.HttpClient httpClient, + ref bool? dryRun, + global::Ideogram.EditWorkflowPostAdLocalizerRequest request); + partial void PrepareEditWorkflowPostAdLocalizerRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + bool? dryRun, + global::Ideogram.EditWorkflowPostAdLocalizerRequest request); + partial void ProcessEditWorkflowPostAdLocalizerResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessEditWorkflowPostAdLocalizerResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Ad Localizer
+ /// Rebuilds an ad in one target language, preserving its layout, logos,
+ /// brand type, and product so only the visible marketing copy changes.
+ /// Upload the source ad as `image` using `multipart/form-data`; the copy
+ /// is translated unless you supply `exact_copy`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task EditWorkflowPostAdLocalizerAsync( + + global::Ideogram.EditWorkflowPostAdLocalizerRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await EditWorkflowPostAdLocalizerAsResponseAsync( + + request: request, + dryRun: dryRun, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Ad Localizer
+ /// Rebuilds an ad in one target language, preserving its layout, logos,
+ /// brand type, and product so only the visible marketing copy changes.
+ /// Upload the source ad as `image` using `multipart/form-data`; the copy
+ /// is translated unless you supply `exact_copy`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> EditWorkflowPostAdLocalizerAsResponseAsync( + + global::Ideogram.EditWorkflowPostAdLocalizerRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareEditWorkflowPostAdLocalizerArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_EditWorkflowPostAdLocalizerSecurityRequirements, + operationName: "EditWorkflowPostAdLocalizerAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/tool/ad-localizer", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Language.ToValueString()), + name: "\"language\""); + + if (request.ExactCopy != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.ExactCopy ?? string.Empty), + name: "\"exact_copy\""); + + } + if (request.Prompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + } + if (request.Quality != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Quality).HasValue ? (request.Quality).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"quality\""); + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareEditWorkflowPostAdLocalizerRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostAdLocalizer", + methodName: "EditWorkflowPostAdLocalizerAsync", + pathTemplate: "\"/v2/tool/ad-localizer\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostAdLocalizer", + methodName: "EditWorkflowPostAdLocalizerAsync", + pathTemplate: "\"/v2/tool/ad-localizer\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostAdLocalizer", + methodName: "EditWorkflowPostAdLocalizerAsync", + pathTemplate: "\"/v2/tool/ad-localizer\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessEditWorkflowPostAdLocalizerResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostAdLocalizer", + methodName: "EditWorkflowPostAdLocalizerAsync", + pathTemplate: "\"/v2/tool/ad-localizer\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostAdLocalizer", + methodName: "EditWorkflowPostAdLocalizerAsync", + pathTemplate: "\"/v2/tool/ad-localizer\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not authorized to use Ad Localizer. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // An input asset was not found or is not readable. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The instruction did not pass prompt safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessEditWorkflowPostAdLocalizerResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.AdLocalizerResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.AdLocalizerResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Ad Localizer
+ /// Rebuilds an ad in one target language, preserving its layout, logos,
+ /// brand type, and product so only the visible marketing copy changes.
+ /// Upload the source ad as `image` using `multipart/form-data`; the copy
+ /// is translated unless you supply `exact_copy`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source ad to localize (max size 25MB). Its layout, logos, brand
+ /// type, and product are preserved, and the output keeps its shape, so
+ /// no size or aspect ratio is needed. JPEG, PNG, and WEBP formats are
+ /// supported. Multipart requests only. + /// + /// + /// The source ad to localize (max size 25MB). Its layout, logos, brand
+ /// type, and product are preserved, and the output keeps its shape, so
+ /// no size or aspect ratio is needed. JPEG, PNG, and WEBP formats are
+ /// supported. Multipart requests only. + /// + /// + /// The target language for the copy. Arabic is rendered right-to-left. Each request covers one language; send one request per language. + /// + /// + /// Pre-approved wording, one `original => replacement` mapping per line. Each mapping names the text element showing `original` and sets it to `replacement`, placed character for character rather than translated. Any text element not listed is left as it is in the source. When omitted, all visible marketing copy is translated. + /// + /// + /// Optional additional direction for the localization, for example "keep the badge in English". Anything it explicitly asks to change takes priority over the preservation rules. + /// + /// + /// The quality tier for the edit. Higher tiers may improve detail and
+ /// take longer to complete. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// Number of localized variations to create for this language.
+ /// Default Value: 1 + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task EditWorkflowPostAdLocalizerAsync( + byte[] image, + string imagename, + global::Ideogram.V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage language, + bool? dryRun = default, + string? exactCopy = default, + string? prompt = default, + global::Ideogram.AdLocalizerQuality? quality = default, + int? seed = default, + int? numImages = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Ideogram.EditWorkflowPostAdLocalizerRequest + { + Image = image, + Imagename = imagename, + Language = language, + ExactCopy = exactCopy, + Prompt = prompt, + Quality = quality, + Seed = seed, + NumImages = numImages, + WebhookUrl = webhookUrl, + }; + + return await EditWorkflowPostAdLocalizerAsync( + dryRun: dryRun, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// Ad Localizer
+ /// Rebuilds an ad in one target language, preserving its layout, logos,
+ /// brand type, and product so only the visible marketing copy changes.
+ /// Upload the source ad as `image` using `multipart/form-data`; the copy
+ /// is translated unless you supply `exact_copy`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source ad to localize (max size 25MB). Its layout, logos, brand
+ /// type, and product are preserved, and the output keeps its shape, so
+ /// no size or aspect ratio is needed. JPEG, PNG, and WEBP formats are
+ /// supported. Multipart requests only. + /// + /// + /// The source ad to localize (max size 25MB). Its layout, logos, brand
+ /// type, and product are preserved, and the output keeps its shape, so
+ /// no size or aspect ratio is needed. JPEG, PNG, and WEBP formats are
+ /// supported. Multipart requests only. + /// + /// + /// The target language for the copy. Arabic is rendered right-to-left. Each request covers one language; send one request per language. + /// + /// + /// Pre-approved wording, one `original => replacement` mapping per line. Each mapping names the text element showing `original` and sets it to `replacement`, placed character for character rather than translated. Any text element not listed is left as it is in the source. When omitted, all visible marketing copy is translated. + /// + /// + /// Optional additional direction for the localization, for example "keep the badge in English". Anything it explicitly asks to change takes priority over the preservation rules. + /// + /// + /// The quality tier for the edit. Higher tiers may improve detail and
+ /// take longer to complete. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// Number of localized variations to create for this language.
+ /// Default Value: 1 + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task EditWorkflowPostAdLocalizerAsync( + global::System.IO.Stream image, + string imagename, + global::Ideogram.V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage language, + bool? dryRun = default, + string? exactCopy = default, + string? prompt = default, + global::Ideogram.AdLocalizerQuality? quality = default, + int? seed = default, + int? numImages = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + var request = new global::Ideogram.EditWorkflowPostAdLocalizerRequest + { + Image = global::System.Array.Empty(), + Imagename = imagename, + Language = language, + ExactCopy = exactCopy, + Prompt = prompt, + Quality = quality, + Seed = seed, + NumImages = numImages, + WebhookUrl = webhookUrl, + }; + PrepareArguments( + client: HttpClient); + PrepareEditWorkflowPostAdLocalizerArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_EditWorkflowPostAdLocalizerSecurityRequirements, + operationName: "EditWorkflowPostAdLocalizerAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/tool/ad-localizer", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Language.ToValueString()), + name: "\"language\""); + + if (request.ExactCopy != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.ExactCopy ?? string.Empty), + name: "\"exact_copy\""); + + } + if (request.Prompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + } + if (request.Quality != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Quality).HasValue ? (request.Quality).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"quality\""); + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareEditWorkflowPostAdLocalizerRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostAdLocalizer", + methodName: "EditWorkflowPostAdLocalizerAsync", + pathTemplate: "\"/v2/tool/ad-localizer\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostAdLocalizer", + methodName: "EditWorkflowPostAdLocalizerAsync", + pathTemplate: "\"/v2/tool/ad-localizer\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostAdLocalizer", + methodName: "EditWorkflowPostAdLocalizerAsync", + pathTemplate: "\"/v2/tool/ad-localizer\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessEditWorkflowPostAdLocalizerResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostAdLocalizer", + methodName: "EditWorkflowPostAdLocalizerAsync", + pathTemplate: "\"/v2/tool/ad-localizer\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostAdLocalizer", + methodName: "EditWorkflowPostAdLocalizerAsync", + pathTemplate: "\"/v2/tool/ad-localizer\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not authorized to use Ad Localizer. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // An input asset was not found or is not readable. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The instruction did not pass prompt safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessEditWorkflowPostAdLocalizerResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::Ideogram.AdLocalizerResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::Ideogram.AdLocalizerResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Ad Localizer
+ /// Rebuilds an ad in one target language, preserving its layout, logos,
+ /// brand type, and product so only the visible marketing copy changes.
+ /// Upload the source ad as `image` using `multipart/form-data`; the copy
+ /// is translated unless you supply `exact_copy`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source ad to localize (max size 25MB). Its layout, logos, brand
+ /// type, and product are preserved, and the output keeps its shape, so
+ /// no size or aspect ratio is needed. JPEG, PNG, and WEBP formats are
+ /// supported. Multipart requests only. + /// + /// + /// The source ad to localize (max size 25MB). Its layout, logos, brand
+ /// type, and product are preserved, and the output keeps its shape, so
+ /// no size or aspect ratio is needed. JPEG, PNG, and WEBP formats are
+ /// supported. Multipart requests only. + /// + /// + /// The target language for the copy. Arabic is rendered right-to-left. Each request covers one language; send one request per language. + /// + /// + /// Pre-approved wording, one `original => replacement` mapping per line. Each mapping names the text element showing `original` and sets it to `replacement`, placed character for character rather than translated. Any text element not listed is left as it is in the source. When omitted, all visible marketing copy is translated. + /// + /// + /// Optional additional direction for the localization, for example "keep the badge in English". Anything it explicitly asks to change takes priority over the preservation rules. + /// + /// + /// The quality tier for the edit. Higher tiers may improve detail and
+ /// take longer to complete. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// Number of localized variations to create for this language.
+ /// Default Value: 1 + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> EditWorkflowPostAdLocalizerAsResponseAsync( + global::System.IO.Stream image, + string imagename, + global::Ideogram.V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage language, + bool? dryRun = default, + string? exactCopy = default, + string? prompt = default, + global::Ideogram.AdLocalizerQuality? quality = default, + int? seed = default, + int? numImages = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + var request = new global::Ideogram.EditWorkflowPostAdLocalizerRequest + { + Image = global::System.Array.Empty(), + Imagename = imagename, + Language = language, + ExactCopy = exactCopy, + Prompt = prompt, + Quality = quality, + Seed = seed, + NumImages = numImages, + WebhookUrl = webhookUrl, + }; + PrepareArguments( + client: HttpClient); + PrepareEditWorkflowPostAdLocalizerArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_EditWorkflowPostAdLocalizerSecurityRequirements, + operationName: "EditWorkflowPostAdLocalizerAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/tool/ad-localizer", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Language.ToValueString()), + name: "\"language\""); + + if (request.ExactCopy != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.ExactCopy ?? string.Empty), + name: "\"exact_copy\""); + + } + if (request.Prompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + } + if (request.Quality != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Quality).HasValue ? (request.Quality).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"quality\""); + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareEditWorkflowPostAdLocalizerRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostAdLocalizer", + methodName: "EditWorkflowPostAdLocalizerAsync", + pathTemplate: "\"/v2/tool/ad-localizer\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostAdLocalizer", + methodName: "EditWorkflowPostAdLocalizerAsync", + pathTemplate: "\"/v2/tool/ad-localizer\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostAdLocalizer", + methodName: "EditWorkflowPostAdLocalizerAsync", + pathTemplate: "\"/v2/tool/ad-localizer\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessEditWorkflowPostAdLocalizerResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostAdLocalizer", + methodName: "EditWorkflowPostAdLocalizerAsync", + pathTemplate: "\"/v2/tool/ad-localizer\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostAdLocalizer", + methodName: "EditWorkflowPostAdLocalizerAsync", + pathTemplate: "\"/v2/tool/ad-localizer\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not authorized to use Ad Localizer. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // An input asset was not found or is not readable. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The instruction did not pass prompt safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessEditWorkflowPostAdLocalizerResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.AdLocalizerResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.AdLocalizerResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.EditWorkflowPostAdResizer.g.cs b/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.EditWorkflowPostAdResizer.g.cs new file mode 100644 index 00000000..a758ac80 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.EditWorkflowPostAdResizer.g.cs @@ -0,0 +1,2491 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class EditWorkflowClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_EditWorkflowPostAdResizerSecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_EditWorkflowPostAdResizerSecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_EditWorkflowPostAdResizerSecurityRequirement0, + }; + partial void PrepareEditWorkflowPostAdResizerArguments( + global::System.Net.Http.HttpClient httpClient, + ref bool? dryRun, + global::Ideogram.EditWorkflowPostAdResizerRequest request); + partial void PrepareEditWorkflowPostAdResizerRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + bool? dryRun, + global::Ideogram.EditWorkflowPostAdResizerRequest request); + partial void ProcessEditWorkflowPostAdResizerResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessEditWorkflowPostAdResizerResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Ad Resizer
+ /// Reframes an ad creative to an exact ad resolution, regenerating the
+ /// layout so text and key elements stay legible at the new size. Upload
+ /// the source creative as `image` using `multipart/form-data`, and supply
+ /// `platform` to keep the ad inside that platform's safe zone.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task EditWorkflowPostAdResizerAsync( + + global::Ideogram.EditWorkflowPostAdResizerRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await EditWorkflowPostAdResizerAsResponseAsync( + + request: request, + dryRun: dryRun, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Ad Resizer
+ /// Reframes an ad creative to an exact ad resolution, regenerating the
+ /// layout so text and key elements stay legible at the new size. Upload
+ /// the source creative as `image` using `multipart/form-data`, and supply
+ /// `platform` to keep the ad inside that platform's safe zone.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> EditWorkflowPostAdResizerAsResponseAsync( + + global::Ideogram.EditWorkflowPostAdResizerRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareEditWorkflowPostAdResizerArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_EditWorkflowPostAdResizerSecurityRequirements, + operationName: "EditWorkflowPostAdResizerAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/tool/ad-resizer", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Resolution.ToValueString()), + name: "\"resolution\""); + + if (request.Platform != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Platform).HasValue ? (request.Platform).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"platform\""); + + } + if (request.Prompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + } + if (request.Quality != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Quality).HasValue ? (request.Quality).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"quality\""); + + } + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareEditWorkflowPostAdResizerRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostAdResizer", + methodName: "EditWorkflowPostAdResizerAsync", + pathTemplate: "\"/v2/tool/ad-resizer\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostAdResizer", + methodName: "EditWorkflowPostAdResizerAsync", + pathTemplate: "\"/v2/tool/ad-resizer\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostAdResizer", + methodName: "EditWorkflowPostAdResizerAsync", + pathTemplate: "\"/v2/tool/ad-resizer\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessEditWorkflowPostAdResizerResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostAdResizer", + methodName: "EditWorkflowPostAdResizerAsync", + pathTemplate: "\"/v2/tool/ad-resizer\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostAdResizer", + methodName: "EditWorkflowPostAdResizerAsync", + pathTemplate: "\"/v2/tool/ad-resizer\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not authorized to resize an ad. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Source asset not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt was rejected by safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessEditWorkflowPostAdResizerResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.AdResizerResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.AdResizerResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Ad Resizer
+ /// Reframes an ad creative to an exact ad resolution, regenerating the
+ /// layout so text and key elements stay legible at the new size. Upload
+ /// the source creative as `image` using `multipart/form-data`, and supply
+ /// `platform` to keep the ad inside that platform's safe zone.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source creative to reframe (max size 25MB). JPEG, PNG, and
+ /// WEBP formats are supported. Multipart requests only. + /// + /// + /// The source creative to reframe (max size 25MB). JPEG, PNG, and
+ /// WEBP formats are supported. Multipart requests only. + /// + /// + /// Target ad resolution, formatted as `WIDTHxHEIGHT`. Any value not in
+ /// the list is rejected with a 400. Each output image has exactly these
+ /// pixel dimensions, with or without a `platform`. + /// + /// + /// The ad platform whose published safe zone the ad must stay inside.
+ /// The ad is generated inside the largest rectangle that fits the
+ /// platform's safe zone for the requested aspect ratio, and the space
+ /// around it is filled in so the output is still exactly the requested
+ /// `resolution`. `google` covers YouTube and Google Ads placements.
+ /// Use `meta_stories` or `meta_reels` for Meta placements; Reels uses
+ /// the largest rectangle inside its notched safe zone. The legacy
+ /// `meta` value is still supported and uses a more conservative safe
+ /// zone. When omitted, the ad fills the whole frame and every
+ /// supported `resolution` is accepted. Any other value is rejected
+ /// with a 400.
+ /// Each platform accepts only the resolutions for which it publishes a
+ /// safe zone; any other `resolution` is rejected with a 400:
+ /// | Platform | Accepted resolutions |
+ /// | --- | --- |
+ /// | `google` | `1920x1080`, `3840x2160`, `1080x1080`, `2400x2400`, `2880x2880`, `1080x1920`, `2160x3840` |
+ /// | `tiktok` | `1920x1080`, `3840x2160`, `1080x1080`, `2400x2400`, `2880x2880`, `1080x1920`, `2160x3840` |
+ /// | `meta_stories` | `1080x1920`, `2160x3840` |
+ /// | `meta_reels` | `1080x1920`, `2160x3840` |
+ /// | `meta` (legacy) | `1080x1920`, `2160x3840` |
+ /// | `snapchat` | `1080x1920`, `2160x3840` | + /// + /// + /// Optional edit instruction to apply while reframing, for example "remove the logo" or "put the price bottom-right". + /// + /// + /// The quality tier for the reframe. Higher tiers may improve detail and
+ /// take longer to complete. + /// + /// + /// The number of reframed variations to generate.
+ /// Default Value: 1 + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task EditWorkflowPostAdResizerAsync( + byte[] image, + string imagename, + global::Ideogram.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution resolution, + bool? dryRun = default, + global::Ideogram.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaPlatform? platform = default, + string? prompt = default, + global::Ideogram.AdResizerQuality? quality = default, + int? numImages = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Ideogram.EditWorkflowPostAdResizerRequest + { + Image = image, + Imagename = imagename, + Resolution = resolution, + Platform = platform, + Prompt = prompt, + Quality = quality, + NumImages = numImages, + WebhookUrl = webhookUrl, + }; + + return await EditWorkflowPostAdResizerAsync( + dryRun: dryRun, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// Ad Resizer
+ /// Reframes an ad creative to an exact ad resolution, regenerating the
+ /// layout so text and key elements stay legible at the new size. Upload
+ /// the source creative as `image` using `multipart/form-data`, and supply
+ /// `platform` to keep the ad inside that platform's safe zone.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source creative to reframe (max size 25MB). JPEG, PNG, and
+ /// WEBP formats are supported. Multipart requests only. + /// + /// + /// The source creative to reframe (max size 25MB). JPEG, PNG, and
+ /// WEBP formats are supported. Multipart requests only. + /// + /// + /// Target ad resolution, formatted as `WIDTHxHEIGHT`. Any value not in
+ /// the list is rejected with a 400. Each output image has exactly these
+ /// pixel dimensions, with or without a `platform`. + /// + /// + /// The ad platform whose published safe zone the ad must stay inside.
+ /// The ad is generated inside the largest rectangle that fits the
+ /// platform's safe zone for the requested aspect ratio, and the space
+ /// around it is filled in so the output is still exactly the requested
+ /// `resolution`. `google` covers YouTube and Google Ads placements.
+ /// Use `meta_stories` or `meta_reels` for Meta placements; Reels uses
+ /// the largest rectangle inside its notched safe zone. The legacy
+ /// `meta` value is still supported and uses a more conservative safe
+ /// zone. When omitted, the ad fills the whole frame and every
+ /// supported `resolution` is accepted. Any other value is rejected
+ /// with a 400.
+ /// Each platform accepts only the resolutions for which it publishes a
+ /// safe zone; any other `resolution` is rejected with a 400:
+ /// | Platform | Accepted resolutions |
+ /// | --- | --- |
+ /// | `google` | `1920x1080`, `3840x2160`, `1080x1080`, `2400x2400`, `2880x2880`, `1080x1920`, `2160x3840` |
+ /// | `tiktok` | `1920x1080`, `3840x2160`, `1080x1080`, `2400x2400`, `2880x2880`, `1080x1920`, `2160x3840` |
+ /// | `meta_stories` | `1080x1920`, `2160x3840` |
+ /// | `meta_reels` | `1080x1920`, `2160x3840` |
+ /// | `meta` (legacy) | `1080x1920`, `2160x3840` |
+ /// | `snapchat` | `1080x1920`, `2160x3840` | + /// + /// + /// Optional edit instruction to apply while reframing, for example "remove the logo" or "put the price bottom-right". + /// + /// + /// The quality tier for the reframe. Higher tiers may improve detail and
+ /// take longer to complete. + /// + /// + /// The number of reframed variations to generate.
+ /// Default Value: 1 + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task EditWorkflowPostAdResizerAsync( + global::System.IO.Stream image, + string imagename, + global::Ideogram.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution resolution, + bool? dryRun = default, + global::Ideogram.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaPlatform? platform = default, + string? prompt = default, + global::Ideogram.AdResizerQuality? quality = default, + int? numImages = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + var request = new global::Ideogram.EditWorkflowPostAdResizerRequest + { + Image = global::System.Array.Empty(), + Imagename = imagename, + Resolution = resolution, + Platform = platform, + Prompt = prompt, + Quality = quality, + NumImages = numImages, + WebhookUrl = webhookUrl, + }; + PrepareArguments( + client: HttpClient); + PrepareEditWorkflowPostAdResizerArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_EditWorkflowPostAdResizerSecurityRequirements, + operationName: "EditWorkflowPostAdResizerAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/tool/ad-resizer", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Resolution.ToValueString()), + name: "\"resolution\""); + + if (request.Platform != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Platform).HasValue ? (request.Platform).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"platform\""); + + } + if (request.Prompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + } + if (request.Quality != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Quality).HasValue ? (request.Quality).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"quality\""); + + } + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareEditWorkflowPostAdResizerRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostAdResizer", + methodName: "EditWorkflowPostAdResizerAsync", + pathTemplate: "\"/v2/tool/ad-resizer\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostAdResizer", + methodName: "EditWorkflowPostAdResizerAsync", + pathTemplate: "\"/v2/tool/ad-resizer\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostAdResizer", + methodName: "EditWorkflowPostAdResizerAsync", + pathTemplate: "\"/v2/tool/ad-resizer\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessEditWorkflowPostAdResizerResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostAdResizer", + methodName: "EditWorkflowPostAdResizerAsync", + pathTemplate: "\"/v2/tool/ad-resizer\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostAdResizer", + methodName: "EditWorkflowPostAdResizerAsync", + pathTemplate: "\"/v2/tool/ad-resizer\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not authorized to resize an ad. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Source asset not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt was rejected by safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessEditWorkflowPostAdResizerResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::Ideogram.AdResizerResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::Ideogram.AdResizerResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Ad Resizer
+ /// Reframes an ad creative to an exact ad resolution, regenerating the
+ /// layout so text and key elements stay legible at the new size. Upload
+ /// the source creative as `image` using `multipart/form-data`, and supply
+ /// `platform` to keep the ad inside that platform's safe zone.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source creative to reframe (max size 25MB). JPEG, PNG, and
+ /// WEBP formats are supported. Multipart requests only. + /// + /// + /// The source creative to reframe (max size 25MB). JPEG, PNG, and
+ /// WEBP formats are supported. Multipart requests only. + /// + /// + /// Target ad resolution, formatted as `WIDTHxHEIGHT`. Any value not in
+ /// the list is rejected with a 400. Each output image has exactly these
+ /// pixel dimensions, with or without a `platform`. + /// + /// + /// The ad platform whose published safe zone the ad must stay inside.
+ /// The ad is generated inside the largest rectangle that fits the
+ /// platform's safe zone for the requested aspect ratio, and the space
+ /// around it is filled in so the output is still exactly the requested
+ /// `resolution`. `google` covers YouTube and Google Ads placements.
+ /// Use `meta_stories` or `meta_reels` for Meta placements; Reels uses
+ /// the largest rectangle inside its notched safe zone. The legacy
+ /// `meta` value is still supported and uses a more conservative safe
+ /// zone. When omitted, the ad fills the whole frame and every
+ /// supported `resolution` is accepted. Any other value is rejected
+ /// with a 400.
+ /// Each platform accepts only the resolutions for which it publishes a
+ /// safe zone; any other `resolution` is rejected with a 400:
+ /// | Platform | Accepted resolutions |
+ /// | --- | --- |
+ /// | `google` | `1920x1080`, `3840x2160`, `1080x1080`, `2400x2400`, `2880x2880`, `1080x1920`, `2160x3840` |
+ /// | `tiktok` | `1920x1080`, `3840x2160`, `1080x1080`, `2400x2400`, `2880x2880`, `1080x1920`, `2160x3840` |
+ /// | `meta_stories` | `1080x1920`, `2160x3840` |
+ /// | `meta_reels` | `1080x1920`, `2160x3840` |
+ /// | `meta` (legacy) | `1080x1920`, `2160x3840` |
+ /// | `snapchat` | `1080x1920`, `2160x3840` | + /// + /// + /// Optional edit instruction to apply while reframing, for example "remove the logo" or "put the price bottom-right". + /// + /// + /// The quality tier for the reframe. Higher tiers may improve detail and
+ /// take longer to complete. + /// + /// + /// The number of reframed variations to generate.
+ /// Default Value: 1 + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> EditWorkflowPostAdResizerAsResponseAsync( + global::System.IO.Stream image, + string imagename, + global::Ideogram.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution resolution, + bool? dryRun = default, + global::Ideogram.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaPlatform? platform = default, + string? prompt = default, + global::Ideogram.AdResizerQuality? quality = default, + int? numImages = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + var request = new global::Ideogram.EditWorkflowPostAdResizerRequest + { + Image = global::System.Array.Empty(), + Imagename = imagename, + Resolution = resolution, + Platform = platform, + Prompt = prompt, + Quality = quality, + NumImages = numImages, + WebhookUrl = webhookUrl, + }; + PrepareArguments( + client: HttpClient); + PrepareEditWorkflowPostAdResizerArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_EditWorkflowPostAdResizerSecurityRequirements, + operationName: "EditWorkflowPostAdResizerAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/tool/ad-resizer", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Resolution.ToValueString()), + name: "\"resolution\""); + + if (request.Platform != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Platform).HasValue ? (request.Platform).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"platform\""); + + } + if (request.Prompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + } + if (request.Quality != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Quality).HasValue ? (request.Quality).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"quality\""); + + } + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareEditWorkflowPostAdResizerRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostAdResizer", + methodName: "EditWorkflowPostAdResizerAsync", + pathTemplate: "\"/v2/tool/ad-resizer\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostAdResizer", + methodName: "EditWorkflowPostAdResizerAsync", + pathTemplate: "\"/v2/tool/ad-resizer\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostAdResizer", + methodName: "EditWorkflowPostAdResizerAsync", + pathTemplate: "\"/v2/tool/ad-resizer\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessEditWorkflowPostAdResizerResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostAdResizer", + methodName: "EditWorkflowPostAdResizerAsync", + pathTemplate: "\"/v2/tool/ad-resizer\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostAdResizer", + methodName: "EditWorkflowPostAdResizerAsync", + pathTemplate: "\"/v2/tool/ad-resizer\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not authorized to resize an ad. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Source asset not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt was rejected by safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessEditWorkflowPostAdResizerResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.AdResizerResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.AdResizerResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.EditWorkflowPostAdVariations.g.cs b/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.EditWorkflowPostAdVariations.g.cs new file mode 100644 index 00000000..9512d767 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.EditWorkflowPostAdVariations.g.cs @@ -0,0 +1,2371 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class EditWorkflowClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_EditWorkflowPostAdVariationsSecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_EditWorkflowPostAdVariationsSecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_EditWorkflowPostAdVariationsSecurityRequirement0, + }; + partial void PrepareEditWorkflowPostAdVariationsArguments( + global::System.Net.Http.HttpClient httpClient, + global::Ideogram.EditWorkflowPostAdVariationsRequest request); + partial void PrepareEditWorkflowPostAdVariationsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + global::Ideogram.EditWorkflowPostAdVariationsRequest request); + partial void ProcessEditWorkflowPostAdVariationsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessEditWorkflowPostAdVariationsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Ad Variations
+ /// Creates on-brand variations of an ad along one axis, preserving logos,
+ /// brand colors, the product, and all on-image text. Upload the source
+ /// creative as `image` using `multipart/form-data` and choose a
+ /// `variation_type`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task EditWorkflowPostAdVariationsAsync( + + global::Ideogram.EditWorkflowPostAdVariationsRequest request, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await EditWorkflowPostAdVariationsAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Ad Variations
+ /// Creates on-brand variations of an ad along one axis, preserving logos,
+ /// brand colors, the product, and all on-image text. Upload the source
+ /// creative as `image` using `multipart/form-data` and choose a
+ /// `variation_type`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> EditWorkflowPostAdVariationsAsResponseAsync( + + global::Ideogram.EditWorkflowPostAdVariationsRequest request, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareEditWorkflowPostAdVariationsArguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_EditWorkflowPostAdVariationsSecurityRequirements, + operationName: "EditWorkflowPostAdVariationsAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/tool/ad-variations", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.VariationType.ToValueString()), + name: "\"variation_type\""); + + if (request.Prompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + } + if (request.Quality != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Quality).HasValue ? (request.Quality).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"quality\""); + + } + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareEditWorkflowPostAdVariationsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostAdVariations", + methodName: "EditWorkflowPostAdVariationsAsync", + pathTemplate: "\"/v2/tool/ad-variations\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostAdVariations", + methodName: "EditWorkflowPostAdVariationsAsync", + pathTemplate: "\"/v2/tool/ad-variations\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostAdVariations", + methodName: "EditWorkflowPostAdVariationsAsync", + pathTemplate: "\"/v2/tool/ad-variations\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessEditWorkflowPostAdVariationsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostAdVariations", + methodName: "EditWorkflowPostAdVariationsAsync", + pathTemplate: "\"/v2/tool/ad-variations\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostAdVariations", + methodName: "EditWorkflowPostAdVariationsAsync", + pathTemplate: "\"/v2/tool/ad-variations\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not authorized to generate ad variations. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Source asset not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt was rejected by safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessEditWorkflowPostAdVariationsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.AdVariationsResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.AdVariationsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Ad Variations
+ /// Creates on-brand variations of an ad along one axis, preserving logos,
+ /// brand colors, the product, and all on-image text. Upload the source
+ /// creative as `image` using `multipart/form-data` and choose a
+ /// `variation_type`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// The source creative to vary (max size 25MB). JPEG, PNG, and WEBP
+ /// formats are supported. Multipart requests only. Each output keeps
+ /// the source's aspect ratio, capped at 3:1 between the long and short
+ /// sides. + /// + /// + /// The source creative to vary (max size 25MB). JPEG, PNG, and WEBP
+ /// formats are supported. Multipart requests only. Each output keeps
+ /// the source's aspect ratio, capped at 3:1 between the long and short
+ /// sides. + /// + /// + /// The axis to vary. `people`
+ /// replaces the people in the ad with different talent. `setting`
+ /// moves the same subject and product to a different environment.
+ /// `group_size` changes how many people appear. `scene` shifts the
+ /// moment or occasion (time of day, season, or activity). + /// + /// + /// Optional direction to steer the variation, for example "set it on a beach" or "make the models older". Anything it explicitly asks to change takes priority over the default preservation rules. + /// + /// + /// The quality tier for the edit. Higher tiers may improve detail and
+ /// take longer to complete. + /// + /// + /// The number of variations to generate along the requested axis.
+ /// Default Value: 1 + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task EditWorkflowPostAdVariationsAsync( + byte[] image, + string imagename, + global::Ideogram.V2ToolAdVariationsPostRequestBodyContentMultipartFormDataSchemaVariationType variationType, + string? prompt = default, + global::Ideogram.AdVariationsQuality? quality = default, + int? numImages = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Ideogram.EditWorkflowPostAdVariationsRequest + { + Image = image, + Imagename = imagename, + VariationType = variationType, + Prompt = prompt, + Quality = quality, + NumImages = numImages, + WebhookUrl = webhookUrl, + }; + + return await EditWorkflowPostAdVariationsAsync( + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// Ad Variations
+ /// Creates on-brand variations of an ad along one axis, preserving logos,
+ /// brand colors, the product, and all on-image text. Upload the source
+ /// creative as `image` using `multipart/form-data` and choose a
+ /// `variation_type`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// The source creative to vary (max size 25MB). JPEG, PNG, and WEBP
+ /// formats are supported. Multipart requests only. Each output keeps
+ /// the source's aspect ratio, capped at 3:1 between the long and short
+ /// sides. + /// + /// + /// The source creative to vary (max size 25MB). JPEG, PNG, and WEBP
+ /// formats are supported. Multipart requests only. Each output keeps
+ /// the source's aspect ratio, capped at 3:1 between the long and short
+ /// sides. + /// + /// + /// The axis to vary. `people`
+ /// replaces the people in the ad with different talent. `setting`
+ /// moves the same subject and product to a different environment.
+ /// `group_size` changes how many people appear. `scene` shifts the
+ /// moment or occasion (time of day, season, or activity). + /// + /// + /// Optional direction to steer the variation, for example "set it on a beach" or "make the models older". Anything it explicitly asks to change takes priority over the default preservation rules. + /// + /// + /// The quality tier for the edit. Higher tiers may improve detail and
+ /// take longer to complete. + /// + /// + /// The number of variations to generate along the requested axis.
+ /// Default Value: 1 + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task EditWorkflowPostAdVariationsAsync( + global::System.IO.Stream image, + string imagename, + global::Ideogram.V2ToolAdVariationsPostRequestBodyContentMultipartFormDataSchemaVariationType variationType, + string? prompt = default, + global::Ideogram.AdVariationsQuality? quality = default, + int? numImages = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + var request = new global::Ideogram.EditWorkflowPostAdVariationsRequest + { + Image = global::System.Array.Empty(), + Imagename = imagename, + VariationType = variationType, + Prompt = prompt, + Quality = quality, + NumImages = numImages, + WebhookUrl = webhookUrl, + }; + PrepareArguments( + client: HttpClient); + PrepareEditWorkflowPostAdVariationsArguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_EditWorkflowPostAdVariationsSecurityRequirements, + operationName: "EditWorkflowPostAdVariationsAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/tool/ad-variations", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.VariationType.ToValueString()), + name: "\"variation_type\""); + + if (request.Prompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + } + if (request.Quality != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Quality).HasValue ? (request.Quality).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"quality\""); + + } + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareEditWorkflowPostAdVariationsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostAdVariations", + methodName: "EditWorkflowPostAdVariationsAsync", + pathTemplate: "\"/v2/tool/ad-variations\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostAdVariations", + methodName: "EditWorkflowPostAdVariationsAsync", + pathTemplate: "\"/v2/tool/ad-variations\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostAdVariations", + methodName: "EditWorkflowPostAdVariationsAsync", + pathTemplate: "\"/v2/tool/ad-variations\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessEditWorkflowPostAdVariationsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostAdVariations", + methodName: "EditWorkflowPostAdVariationsAsync", + pathTemplate: "\"/v2/tool/ad-variations\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostAdVariations", + methodName: "EditWorkflowPostAdVariationsAsync", + pathTemplate: "\"/v2/tool/ad-variations\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not authorized to generate ad variations. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Source asset not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt was rejected by safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessEditWorkflowPostAdVariationsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::Ideogram.AdVariationsResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::Ideogram.AdVariationsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Ad Variations
+ /// Creates on-brand variations of an ad along one axis, preserving logos,
+ /// brand colors, the product, and all on-image text. Upload the source
+ /// creative as `image` using `multipart/form-data` and choose a
+ /// `variation_type`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// The source creative to vary (max size 25MB). JPEG, PNG, and WEBP
+ /// formats are supported. Multipart requests only. Each output keeps
+ /// the source's aspect ratio, capped at 3:1 between the long and short
+ /// sides. + /// + /// + /// The source creative to vary (max size 25MB). JPEG, PNG, and WEBP
+ /// formats are supported. Multipart requests only. Each output keeps
+ /// the source's aspect ratio, capped at 3:1 between the long and short
+ /// sides. + /// + /// + /// The axis to vary. `people`
+ /// replaces the people in the ad with different talent. `setting`
+ /// moves the same subject and product to a different environment.
+ /// `group_size` changes how many people appear. `scene` shifts the
+ /// moment or occasion (time of day, season, or activity). + /// + /// + /// Optional direction to steer the variation, for example "set it on a beach" or "make the models older". Anything it explicitly asks to change takes priority over the default preservation rules. + /// + /// + /// The quality tier for the edit. Higher tiers may improve detail and
+ /// take longer to complete. + /// + /// + /// The number of variations to generate along the requested axis.
+ /// Default Value: 1 + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> EditWorkflowPostAdVariationsAsResponseAsync( + global::System.IO.Stream image, + string imagename, + global::Ideogram.V2ToolAdVariationsPostRequestBodyContentMultipartFormDataSchemaVariationType variationType, + string? prompt = default, + global::Ideogram.AdVariationsQuality? quality = default, + int? numImages = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + var request = new global::Ideogram.EditWorkflowPostAdVariationsRequest + { + Image = global::System.Array.Empty(), + Imagename = imagename, + VariationType = variationType, + Prompt = prompt, + Quality = quality, + NumImages = numImages, + WebhookUrl = webhookUrl, + }; + PrepareArguments( + client: HttpClient); + PrepareEditWorkflowPostAdVariationsArguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_EditWorkflowPostAdVariationsSecurityRequirements, + operationName: "EditWorkflowPostAdVariationsAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/tool/ad-variations", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.VariationType.ToValueString()), + name: "\"variation_type\""); + + if (request.Prompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + } + if (request.Quality != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Quality).HasValue ? (request.Quality).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"quality\""); + + } + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareEditWorkflowPostAdVariationsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostAdVariations", + methodName: "EditWorkflowPostAdVariationsAsync", + pathTemplate: "\"/v2/tool/ad-variations\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostAdVariations", + methodName: "EditWorkflowPostAdVariationsAsync", + pathTemplate: "\"/v2/tool/ad-variations\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostAdVariations", + methodName: "EditWorkflowPostAdVariationsAsync", + pathTemplate: "\"/v2/tool/ad-variations\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessEditWorkflowPostAdVariationsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostAdVariations", + methodName: "EditWorkflowPostAdVariationsAsync", + pathTemplate: "\"/v2/tool/ad-variations\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostAdVariations", + methodName: "EditWorkflowPostAdVariationsAsync", + pathTemplate: "\"/v2/tool/ad-variations\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not authorized to generate ad variations. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Source asset not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt was rejected by safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessEditWorkflowPostAdVariationsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.AdVariationsResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.AdVariationsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.EditWorkflowPostColorways.g.cs b/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.EditWorkflowPostColorways.g.cs new file mode 100644 index 00000000..100f1c03 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.EditWorkflowPostColorways.g.cs @@ -0,0 +1,2296 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class EditWorkflowClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_EditWorkflowPostColorwaysSecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_EditWorkflowPostColorwaysSecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_EditWorkflowPostColorwaysSecurityRequirement0, + }; + partial void PrepareEditWorkflowPostColorwaysArguments( + global::System.Net.Http.HttpClient httpClient, + ref bool? dryRun, + global::Ideogram.EditWorkflowPostColorwaysRequest request); + partial void PrepareEditWorkflowPostColorwaysRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + bool? dryRun, + global::Ideogram.EditWorkflowPostColorwaysRequest request); + partial void ProcessEditWorkflowPostColorwaysResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessEditWorkflowPostColorwaysResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Colorways
+ /// Recolors masked regions of a product photo, each to its own target
+ /// color, preserving the product's geometry, materials, prints, logos, and
+ /// everything outside the masks. Upload the `image` and up to 4 `masks`
+ /// using `multipart/form-data`, with one entry in `colors` per mask.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task EditWorkflowPostColorwaysAsync( + + global::Ideogram.EditWorkflowPostColorwaysRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await EditWorkflowPostColorwaysAsResponseAsync( + + request: request, + dryRun: dryRun, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Colorways
+ /// Recolors masked regions of a product photo, each to its own target
+ /// color, preserving the product's geometry, materials, prints, logos, and
+ /// everything outside the masks. Upload the `image` and up to 4 `masks`
+ /// using `multipart/form-data`, with one entry in `colors` per mask.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> EditWorkflowPostColorwaysAsResponseAsync( + + global::Ideogram.EditWorkflowPostColorwaysRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareEditWorkflowPostColorwaysArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_EditWorkflowPostColorwaysSecurityRequirements, + operationName: "EditWorkflowPostColorwaysAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/tool/colorways", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.Masks != default) + { + + for (var __iMasks = 0; __iMasks < request.Masks.Count; __iMasks++) + { + var __contentMasks = new global::System.Net.Http.ByteArrayContent(request.Masks[__iMasks]); + __contentMasks.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); + __httpRequestContent.Add( + content: __contentMasks, + name: "\"masks\"", + fileName: $"\"file{__iMasks}.bin\""); + if (__contentMasks.Headers.ContentDisposition != null) + { + __contentMasks.Headers.ContentDisposition.FileNameStar = null; + } + } + + } + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.Colors, x => x))}]"), + name: "\"colors\""); + + if (request.AspectRatio != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.AspectRatio ?? string.Empty), + name: "\"aspect_ratio\""); + + } + if (request.Quality != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Quality).HasValue ? (request.Quality).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"quality\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareEditWorkflowPostColorwaysRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostColorways", + methodName: "EditWorkflowPostColorwaysAsync", + pathTemplate: "\"/v2/tool/colorways\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostColorways", + methodName: "EditWorkflowPostColorwaysAsync", + pathTemplate: "\"/v2/tool/colorways\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostColorways", + methodName: "EditWorkflowPostColorwaysAsync", + pathTemplate: "\"/v2/tool/colorways\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessEditWorkflowPostColorwaysResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostColorways", + methodName: "EditWorkflowPostColorwaysAsync", + pathTemplate: "\"/v2/tool/colorways\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostColorways", + methodName: "EditWorkflowPostColorwaysAsync", + pathTemplate: "\"/v2/tool/colorways\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not authorized to create a colorway. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessEditWorkflowPostColorwaysResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.ColorwaysResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.ColorwaysResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Colorways
+ /// Recolors masked regions of a product photo, each to its own target
+ /// color, preserving the product's geometry, materials, prints, logos, and
+ /// everything outside the masks. Upload the `image` and up to 4 `masks`
+ /// using `multipart/form-data`, with one entry in `colors` per mask.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// The product photo to recolor (max size 25MB). JPEG, PNG, and WEBP
+ /// formats are supported. + /// + /// + /// The product photo to recolor (max size 25MB). JPEG, PNG, and WEBP
+ /// formats are supported. + /// + /// + /// Masks marking the regions to recolor (max 4, max size 25MB each),
+ /// paired by position with `colors`. JPEG, PNG, and WEBP formats are
+ /// supported. Every mask must have the same pixel dimensions as the
+ /// product photo. White pixels mark the region to recolor and black
+ /// pixels are preserved; alpha-only masks also work (opaque =
+ /// recolor, transparent = preserve). + /// + /// + /// One target color per mask in `masks`, as six-digit hex codes like
+ /// `#B3202C`, paired by position. The product's shape, construction,
+ /// materials, prints, and logos are always preserved. + /// + /// + /// Output aspect ratio. Defaults to the product photo's aspect ratio,
+ /// which keeps the original framing. A different ratio extends the
+ /// scene to fill the new shape rather than cropping, so part of the
+ /// frame is newly generated. Supported values are `1:1`, `3:4`,
+ /// `4:3`, `16:9`, and `9:16`. + /// + /// + /// The quality tier for the edit. Higher tiers may improve detail and
+ /// take longer to complete. + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task EditWorkflowPostColorwaysAsync( + byte[] image, + string imagename, + global::System.Collections.Generic.IList colors, + bool? dryRun = default, + global::System.Collections.Generic.IList? masks = default, + string? aspectRatio = default, + global::Ideogram.ColorwaysQuality? quality = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Ideogram.EditWorkflowPostColorwaysRequest + { + Image = image, + Imagename = imagename, + Masks = masks, + Colors = colors, + AspectRatio = aspectRatio, + Quality = quality, + WebhookUrl = webhookUrl, + }; + + return await EditWorkflowPostColorwaysAsync( + dryRun: dryRun, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// Colorways
+ /// Recolors masked regions of a product photo, each to its own target
+ /// color, preserving the product's geometry, materials, prints, logos, and
+ /// everything outside the masks. Upload the `image` and up to 4 `masks`
+ /// using `multipart/form-data`, with one entry in `colors` per mask.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// The product photo to recolor (max size 25MB). JPEG, PNG, and WEBP
+ /// formats are supported. + /// + /// + /// The product photo to recolor (max size 25MB). JPEG, PNG, and WEBP
+ /// formats are supported. + /// + /// + /// Masks marking the regions to recolor (max 4, max size 25MB each),
+ /// paired by position with `colors`. JPEG, PNG, and WEBP formats are
+ /// supported. Every mask must have the same pixel dimensions as the
+ /// product photo. White pixels mark the region to recolor and black
+ /// pixels are preserved; alpha-only masks also work (opaque =
+ /// recolor, transparent = preserve). + /// + /// + /// Optional file names to use for the multipart 'masks' file parts. + /// + /// + /// One target color per mask in `masks`, as six-digit hex codes like
+ /// `#B3202C`, paired by position. The product's shape, construction,
+ /// materials, prints, and logos are always preserved. + /// + /// + /// Output aspect ratio. Defaults to the product photo's aspect ratio,
+ /// which keeps the original framing. A different ratio extends the
+ /// scene to fill the new shape rather than cropping, so part of the
+ /// frame is newly generated. Supported values are `1:1`, `3:4`,
+ /// `4:3`, `16:9`, and `9:16`. + /// + /// + /// The quality tier for the edit. Higher tiers may improve detail and
+ /// take longer to complete. + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task EditWorkflowPostColorwaysAsync( + global::System.IO.Stream image, + string imagename, + global::System.Collections.Generic.IList colors, + bool? dryRun = default, + global::System.Collections.Generic.IReadOnlyList? masks = default, + global::System.Collections.Generic.IReadOnlyList? masksFileNames = default, + string? aspectRatio = default, + global::Ideogram.ColorwaysQuality? quality = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + var request = new global::Ideogram.EditWorkflowPostColorwaysRequest + { + Image = global::System.Array.Empty(), + Imagename = imagename, + Masks = new global::System.Collections.Generic.List(), + Colors = colors, + AspectRatio = aspectRatio, + Quality = quality, + WebhookUrl = webhookUrl, + }; + PrepareArguments( + client: HttpClient); + PrepareEditWorkflowPostColorwaysArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_EditWorkflowPostColorwaysSecurityRequirements, + operationName: "EditWorkflowPostColorwaysAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/tool/colorways", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (masks != default) + { + + for (var __iMasks = 0; __iMasks < masks.Count; __iMasks++) + { + var __fileNameMasks = masksFileNames != null && + __iMasks < masksFileNames.Count && + masksFileNames[__iMasks] != null + ? masksFileNames[__iMasks] + : $"file{__iMasks}.bin"; + var __contentMasks = new global::System.Net.Http.StreamContent(masks[__iMasks]); + __contentMasks.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + __fileNameMasks is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(__fileNameMasks) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentMasks, + name: "\"masks\"", + fileName: $"\"{__fileNameMasks}\""); + if (__contentMasks.Headers.ContentDisposition != null) + { + __contentMasks.Headers.ContentDisposition.FileNameStar = null; + } + } + + } + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.Colors, x => x))}]"), + name: "\"colors\""); + + if (request.AspectRatio != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.AspectRatio ?? string.Empty), + name: "\"aspect_ratio\""); + + } + if (request.Quality != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Quality).HasValue ? (request.Quality).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"quality\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareEditWorkflowPostColorwaysRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostColorways", + methodName: "EditWorkflowPostColorwaysAsync", + pathTemplate: "\"/v2/tool/colorways\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostColorways", + methodName: "EditWorkflowPostColorwaysAsync", + pathTemplate: "\"/v2/tool/colorways\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostColorways", + methodName: "EditWorkflowPostColorwaysAsync", + pathTemplate: "\"/v2/tool/colorways\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessEditWorkflowPostColorwaysResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostColorways", + methodName: "EditWorkflowPostColorwaysAsync", + pathTemplate: "\"/v2/tool/colorways\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostColorways", + methodName: "EditWorkflowPostColorwaysAsync", + pathTemplate: "\"/v2/tool/colorways\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not authorized to create a colorway. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessEditWorkflowPostColorwaysResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::Ideogram.ColorwaysResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::Ideogram.ColorwaysResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Colorways
+ /// Recolors masked regions of a product photo, each to its own target
+ /// color, preserving the product's geometry, materials, prints, logos, and
+ /// everything outside the masks. Upload the `image` and up to 4 `masks`
+ /// using `multipart/form-data`, with one entry in `colors` per mask.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// The product photo to recolor (max size 25MB). JPEG, PNG, and WEBP
+ /// formats are supported. + /// + /// + /// The product photo to recolor (max size 25MB). JPEG, PNG, and WEBP
+ /// formats are supported. + /// + /// + /// Masks marking the regions to recolor (max 4, max size 25MB each),
+ /// paired by position with `colors`. JPEG, PNG, and WEBP formats are
+ /// supported. Every mask must have the same pixel dimensions as the
+ /// product photo. White pixels mark the region to recolor and black
+ /// pixels are preserved; alpha-only masks also work (opaque =
+ /// recolor, transparent = preserve). + /// + /// + /// Optional file names to use for the multipart 'masks' file parts. + /// + /// + /// One target color per mask in `masks`, as six-digit hex codes like
+ /// `#B3202C`, paired by position. The product's shape, construction,
+ /// materials, prints, and logos are always preserved. + /// + /// + /// Output aspect ratio. Defaults to the product photo's aspect ratio,
+ /// which keeps the original framing. A different ratio extends the
+ /// scene to fill the new shape rather than cropping, so part of the
+ /// frame is newly generated. Supported values are `1:1`, `3:4`,
+ /// `4:3`, `16:9`, and `9:16`. + /// + /// + /// The quality tier for the edit. Higher tiers may improve detail and
+ /// take longer to complete. + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> EditWorkflowPostColorwaysAsResponseAsync( + global::System.IO.Stream image, + string imagename, + global::System.Collections.Generic.IList colors, + bool? dryRun = default, + global::System.Collections.Generic.IReadOnlyList? masks = default, + global::System.Collections.Generic.IReadOnlyList? masksFileNames = default, + string? aspectRatio = default, + global::Ideogram.ColorwaysQuality? quality = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + var request = new global::Ideogram.EditWorkflowPostColorwaysRequest + { + Image = global::System.Array.Empty(), + Imagename = imagename, + Masks = new global::System.Collections.Generic.List(), + Colors = colors, + AspectRatio = aspectRatio, + Quality = quality, + WebhookUrl = webhookUrl, + }; + PrepareArguments( + client: HttpClient); + PrepareEditWorkflowPostColorwaysArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_EditWorkflowPostColorwaysSecurityRequirements, + operationName: "EditWorkflowPostColorwaysAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/tool/colorways", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (masks != default) + { + + for (var __iMasks = 0; __iMasks < masks.Count; __iMasks++) + { + var __fileNameMasks = masksFileNames != null && + __iMasks < masksFileNames.Count && + masksFileNames[__iMasks] != null + ? masksFileNames[__iMasks] + : $"file{__iMasks}.bin"; + var __contentMasks = new global::System.Net.Http.StreamContent(masks[__iMasks]); + __contentMasks.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + __fileNameMasks is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(__fileNameMasks) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentMasks, + name: "\"masks\"", + fileName: $"\"{__fileNameMasks}\""); + if (__contentMasks.Headers.ContentDisposition != null) + { + __contentMasks.Headers.ContentDisposition.FileNameStar = null; + } + } + + } + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.Colors, x => x))}]"), + name: "\"colors\""); + + if (request.AspectRatio != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.AspectRatio ?? string.Empty), + name: "\"aspect_ratio\""); + + } + if (request.Quality != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Quality).HasValue ? (request.Quality).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"quality\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareEditWorkflowPostColorwaysRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostColorways", + methodName: "EditWorkflowPostColorwaysAsync", + pathTemplate: "\"/v2/tool/colorways\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostColorways", + methodName: "EditWorkflowPostColorwaysAsync", + pathTemplate: "\"/v2/tool/colorways\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostColorways", + methodName: "EditWorkflowPostColorwaysAsync", + pathTemplate: "\"/v2/tool/colorways\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessEditWorkflowPostColorwaysResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostColorways", + methodName: "EditWorkflowPostColorwaysAsync", + pathTemplate: "\"/v2/tool/colorways\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostColorways", + methodName: "EditWorkflowPostColorwaysAsync", + pathTemplate: "\"/v2/tool/colorways\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not authorized to create a colorway. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessEditWorkflowPostColorwaysResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.ColorwaysResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.ColorwaysResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.EditWorkflowPostGhostMannequin.g.cs b/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.EditWorkflowPostGhostMannequin.g.cs new file mode 100644 index 00000000..4a67a342 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.EditWorkflowPostGhostMannequin.g.cs @@ -0,0 +1,1316 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class EditWorkflowClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_EditWorkflowPostGhostMannequinSecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_EditWorkflowPostGhostMannequinSecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_EditWorkflowPostGhostMannequinSecurityRequirement0, + }; + partial void PrepareEditWorkflowPostGhostMannequinArguments( + global::System.Net.Http.HttpClient httpClient, + ref bool? dryRun, + global::Ideogram.EditWorkflowPostGhostMannequinRequest request); + partial void PrepareEditWorkflowPostGhostMannequinRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + bool? dryRun, + global::Ideogram.EditWorkflowPostGhostMannequinRequest request); + partial void ProcessEditWorkflowPostGhostMannequinResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessEditWorkflowPostGhostMannequinResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Ghost Mannequin
+ /// Turns photos of one garment into a ghost-mannequin product image on a
+ /// clean white studio background, removing the person, mannequin, hanger,
+ /// and other clothing. Upload the photos using `multipart/form-data`, in
+ /// the directional fields (such as `front_image`) when the camera
+ /// direction is known and in `garment_images` otherwise.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task EditWorkflowPostGhostMannequinAsync( + + global::Ideogram.EditWorkflowPostGhostMannequinRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await EditWorkflowPostGhostMannequinAsResponseAsync( + + request: request, + dryRun: dryRun, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Ghost Mannequin
+ /// Turns photos of one garment into a ghost-mannequin product image on a
+ /// clean white studio background, removing the person, mannequin, hanger,
+ /// and other clothing. Upload the photos using `multipart/form-data`, in
+ /// the directional fields (such as `front_image`) when the camera
+ /// direction is known and in `garment_images` otherwise.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> EditWorkflowPostGhostMannequinAsResponseAsync( + + global::Ideogram.EditWorkflowPostGhostMannequinRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareEditWorkflowPostGhostMannequinArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_EditWorkflowPostGhostMannequinSecurityRequirements, + operationName: "EditWorkflowPostGhostMannequinAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/tool/ghost-mannequin", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + if (request.GarmentImages != default) + { + + for (var __iGarmentImages = 0; __iGarmentImages < request.GarmentImages.Count; __iGarmentImages++) + { + var __contentGarmentImages = new global::System.Net.Http.ByteArrayContent(request.GarmentImages[__iGarmentImages]); + __contentGarmentImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); + __httpRequestContent.Add( + content: __contentGarmentImages, + name: "\"garment_images\"", + fileName: $"\"file{__iGarmentImages}.bin\""); + if (__contentGarmentImages.Headers.ContentDisposition != null) + { + __contentGarmentImages.Headers.ContentDisposition.FileNameStar = null; + } + } + + } + if (request.FrontImage != default) + { + + var __contentFrontImage = new global::System.Net.Http.ByteArrayContent(request.FrontImage ?? global::System.Array.Empty()); + __contentFrontImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.FrontImagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.FrontImagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFrontImage, + name: "\"front_image\"", + fileName: request.FrontImagename != null ? $"\"{request.FrontImagename}\"" : string.Empty); + if (__contentFrontImage.Headers.ContentDisposition != null) + { + __contentFrontImage.Headers.ContentDisposition.FileNameStar = null; + } + + } + if (request.BackImage != default) + { + + var __contentBackImage = new global::System.Net.Http.ByteArrayContent(request.BackImage ?? global::System.Array.Empty()); + __contentBackImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.BackImagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.BackImagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentBackImage, + name: "\"back_image\"", + fileName: request.BackImagename != null ? $"\"{request.BackImagename}\"" : string.Empty); + if (__contentBackImage.Headers.ContentDisposition != null) + { + __contentBackImage.Headers.ContentDisposition.FileNameStar = null; + } + + } + if (request.LeftImage != default) + { + + var __contentLeftImage = new global::System.Net.Http.ByteArrayContent(request.LeftImage ?? global::System.Array.Empty()); + __contentLeftImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.LeftImagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.LeftImagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentLeftImage, + name: "\"left_image\"", + fileName: request.LeftImagename != null ? $"\"{request.LeftImagename}\"" : string.Empty); + if (__contentLeftImage.Headers.ContentDisposition != null) + { + __contentLeftImage.Headers.ContentDisposition.FileNameStar = null; + } + + } + if (request.RightImage != default) + { + + var __contentRightImage = new global::System.Net.Http.ByteArrayContent(request.RightImage ?? global::System.Array.Empty()); + __contentRightImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.RightImagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.RightImagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentRightImage, + name: "\"right_image\"", + fileName: request.RightImagename != null ? $"\"{request.RightImagename}\"" : string.Empty); + if (__contentRightImage.Headers.ContentDisposition != null) + { + __contentRightImage.Headers.ContentDisposition.FileNameStar = null; + } + + } + if (request.TopImage != default) + { + + var __contentTopImage = new global::System.Net.Http.ByteArrayContent(request.TopImage ?? global::System.Array.Empty()); + __contentTopImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.TopImagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.TopImagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentTopImage, + name: "\"top_image\"", + fileName: request.TopImagename != null ? $"\"{request.TopImagename}\"" : string.Empty); + if (__contentTopImage.Headers.ContentDisposition != null) + { + __contentTopImage.Headers.ContentDisposition.FileNameStar = null; + } + + } + if (request.BottomImage != default) + { + + var __contentBottomImage = new global::System.Net.Http.ByteArrayContent(request.BottomImage ?? global::System.Array.Empty()); + __contentBottomImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.BottomImagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.BottomImagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentBottomImage, + name: "\"bottom_image\"", + fileName: request.BottomImagename != null ? $"\"{request.BottomImagename}\"" : string.Empty); + if (__contentBottomImage.Headers.ContentDisposition != null) + { + __contentBottomImage.Headers.ContentDisposition.FileNameStar = null; + } + + } + if (request.OutputReferenceAssetIdentifier != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.OutputReferenceAssetIdentifier.ToJson(JsonSerializerContext)), + name: "\"output_reference_asset_identifier\""); + + } + if (request.OutputReferenceImage != default) + { + + var __contentOutputReferenceImage = new global::System.Net.Http.ByteArrayContent(request.OutputReferenceImage ?? global::System.Array.Empty()); + __contentOutputReferenceImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.OutputReferenceImagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.OutputReferenceImagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentOutputReferenceImage, + name: "\"output_reference_image\"", + fileName: request.OutputReferenceImagename != null ? $"\"{request.OutputReferenceImagename}\"" : string.Empty); + if (__contentOutputReferenceImage.Headers.ContentDisposition != null) + { + __contentOutputReferenceImage.Headers.ContentDisposition.FileNameStar = null; + } + + } + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.View.ToValueString()), + name: "\"view\""); + + if (request.Instruction != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Instruction ?? string.Empty), + name: "\"instruction\""); + + } + if (request.Metadata != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Metadata ?? string.Empty), + name: "\"metadata\""); + + } + if (request.AspectRatio != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.AspectRatio ?? string.Empty), + name: "\"aspect_ratio\""); + + } + if (request.Quality != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Quality).HasValue ? (request.Quality).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"quality\""); + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareEditWorkflowPostGhostMannequinRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostGhostMannequin", + methodName: "EditWorkflowPostGhostMannequinAsync", + pathTemplate: "\"/v2/tool/ghost-mannequin\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostGhostMannequin", + methodName: "EditWorkflowPostGhostMannequinAsync", + pathTemplate: "\"/v2/tool/ghost-mannequin\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostGhostMannequin", + methodName: "EditWorkflowPostGhostMannequinAsync", + pathTemplate: "\"/v2/tool/ghost-mannequin\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessEditWorkflowPostGhostMannequinResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostGhostMannequin", + methodName: "EditWorkflowPostGhostMannequinAsync", + pathTemplate: "\"/v2/tool/ghost-mannequin\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostGhostMannequin", + methodName: "EditWorkflowPostGhostMannequinAsync", + pathTemplate: "\"/v2/tool/ghost-mannequin\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not authorized to create ghost-mannequin images. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // An input asset was not found or is not readable. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The combined raw image uploads exceed 100 MB. + if ((int)__response.StatusCode == 413) + { + string? __content_413 = null; + global::System.Exception? __exception_413 = null; + string? __value_413 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_413 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_413, typeof(string), JsonSerializerContext); + } + else + { + __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_413 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_413, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_413 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_413 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_413, + responseBody: __content_413, + responseObject: __value_413, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The instruction did not pass prompt safety validation. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessEditWorkflowPostGhostMannequinResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.GhostMannequinResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.GhostMannequinResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Ghost Mannequin
+ /// Turns photos of one garment into a ghost-mannequin product image on a
+ /// clean white studio background, removing the person, mannequin, hanger,
+ /// and other clothing. Upload the photos using `multipart/form-data`, in
+ /// the directional fields (such as `front_image`) when the camera
+ /// direction is known and in `garment_images` otherwise.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Additional photos of the same garment, up to 50 MB each. JPEG,
+ /// PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and MPO are supported.
+ /// Multipart requests only. + /// + /// + /// Optional front-view garment photo, up to 50 MB. Multipart requests
+ /// only. + /// + /// + /// Optional front-view garment photo, up to 50 MB. Multipart requests
+ /// only. + /// + /// + /// Optional back-view garment photo, up to 50 MB. Multipart requests
+ /// only. + /// + /// + /// Optional back-view garment photo, up to 50 MB. Multipart requests
+ /// only. + /// + /// + /// Optional left-view garment photo, up to 50 MB. Multipart requests
+ /// only. + /// + /// + /// Optional left-view garment photo, up to 50 MB. Multipart requests
+ /// only. + /// + /// + /// Optional right-view garment photo, up to 50 MB. Multipart requests
+ /// only. + /// + /// + /// Optional right-view garment photo, up to 50 MB. Multipart requests
+ /// only. + /// + /// + /// Optional top-view garment photo, up to 50 MB. Multipart requests
+ /// only. + /// + /// + /// Optional top-view garment photo, up to 50 MB. Multipart requests
+ /// only. + /// + /// + /// Optional bottom-view garment photo, up to 50 MB. Multipart
+ /// requests only. + /// + /// + /// Optional bottom-view garment photo, up to 50 MB. Multipart
+ /// requests only. + /// + /// + /// An identifier for an ideogram asset. + /// + /// + /// Optional presentation example, up to 50 MB. Multipart requests only.
+ /// Guides pose, framing, and lighting without copying its garment,
+ /// colors, text, or branding. Garment photos remain authoritative for
+ /// product identity; view and aspect_ratio take precedence, and the
+ /// background remains white. Does not replace a required garment photo.
+ /// Mutually exclusive with `output_reference_asset_identifier`. + /// + /// + /// Optional presentation example, up to 50 MB. Multipart requests only.
+ /// Guides pose, framing, and lighting without copying its garment,
+ /// colors, text, or branding. Garment photos remain authoritative for
+ /// product identity; view and aspect_ratio take precedence, and the
+ /// background remains white. Does not replace a required garment photo.
+ /// Mutually exclusive with `output_reference_asset_identifier`. + /// + /// + /// Camera view for the output garment. + /// + /// + /// Optional reconstruction guidance or identity-critical garment
+ /// details to check against the photos. The output always uses a clean
+ /// white studio background. + /// + /// + /// Optional JSON object serialized as a string containing factual
+ /// product context, such as title, brand, category, color, material,
+ /// item code, and exact printed text. Metadata helps disambiguate the
+ /// garment photos but does not add features they do not show. + /// + /// + /// Output aspect ratio. Defaults to `1:1` when omitted. Supported
+ /// values are `1:1`, `3:4`, `4:3`, `16:9`, and `9:16`. + /// + /// + /// The quality tier for the edit. Higher tiers may improve detail and
+ /// take longer to complete. + /// + /// + /// Optional seed for repeatable results. + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task EditWorkflowPostGhostMannequinAsync( + global::Ideogram.V2ToolGhostMannequinPostRequestBodyContentMultipartFormDataSchemaView view, + bool? dryRun = default, + global::System.Collections.Generic.IList? garmentImages = default, + byte[]? frontImage = default, + string? frontImagename = default, + byte[]? backImage = default, + string? backImagename = default, + byte[]? leftImage = default, + string? leftImagename = default, + byte[]? rightImage = default, + string? rightImagename = default, + byte[]? topImage = default, + string? topImagename = default, + byte[]? bottomImage = default, + string? bottomImagename = default, + global::Ideogram.AssetIdentifier? outputReferenceAssetIdentifier = default, + byte[]? outputReferenceImage = default, + string? outputReferenceImagename = default, + string? instruction = default, + string? metadata = default, + string? aspectRatio = default, + global::Ideogram.GhostMannequinQuality? quality = default, + int? seed = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Ideogram.EditWorkflowPostGhostMannequinRequest + { + GarmentImages = garmentImages, + FrontImage = frontImage, + FrontImagename = frontImagename, + BackImage = backImage, + BackImagename = backImagename, + LeftImage = leftImage, + LeftImagename = leftImagename, + RightImage = rightImage, + RightImagename = rightImagename, + TopImage = topImage, + TopImagename = topImagename, + BottomImage = bottomImage, + BottomImagename = bottomImagename, + OutputReferenceAssetIdentifier = outputReferenceAssetIdentifier, + OutputReferenceImage = outputReferenceImage, + OutputReferenceImagename = outputReferenceImagename, + View = view, + Instruction = instruction, + Metadata = metadata, + AspectRatio = aspectRatio, + Quality = quality, + Seed = seed, + WebhookUrl = webhookUrl, + }; + + return await EditWorkflowPostGhostMannequinAsync( + dryRun: dryRun, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.EditWorkflowPostMaterialSwap.g.cs b/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.EditWorkflowPostMaterialSwap.g.cs new file mode 100644 index 00000000..73399f5a --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.EditWorkflowPostMaterialSwap.g.cs @@ -0,0 +1,2413 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class EditWorkflowClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_EditWorkflowPostMaterialSwapSecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_EditWorkflowPostMaterialSwapSecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_EditWorkflowPostMaterialSwapSecurityRequirement0, + }; + partial void PrepareEditWorkflowPostMaterialSwapArguments( + global::System.Net.Http.HttpClient httpClient, + ref bool? dryRun, + global::Ideogram.EditWorkflowPostMaterialSwapRequest request); + partial void PrepareEditWorkflowPostMaterialSwapRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + bool? dryRun, + global::Ideogram.EditWorkflowPostMaterialSwapRequest request); + partial void ProcessEditWorkflowPostMaterialSwapResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessEditWorkflowPostMaterialSwapResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Material Swap
+ /// Re-renders masked regions of a product photo in the materials shown in
+ /// reference images, preserving the product's construction and everything
+ /// outside the masks. Upload the `image`, up to 4 `masks`, and the
+ /// `materials` using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task EditWorkflowPostMaterialSwapAsync( + + global::Ideogram.EditWorkflowPostMaterialSwapRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await EditWorkflowPostMaterialSwapAsResponseAsync( + + request: request, + dryRun: dryRun, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Material Swap
+ /// Re-renders masked regions of a product photo in the materials shown in
+ /// reference images, preserving the product's construction and everything
+ /// outside the masks. Upload the `image`, up to 4 `masks`, and the
+ /// `materials` using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> EditWorkflowPostMaterialSwapAsResponseAsync( + + global::Ideogram.EditWorkflowPostMaterialSwapRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareEditWorkflowPostMaterialSwapArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_EditWorkflowPostMaterialSwapSecurityRequirements, + operationName: "EditWorkflowPostMaterialSwapAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/tool/material-swap", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.Masks != default) + { + + for (var __iMasks = 0; __iMasks < request.Masks.Count; __iMasks++) + { + var __contentMasks = new global::System.Net.Http.ByteArrayContent(request.Masks[__iMasks]); + __contentMasks.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); + __httpRequestContent.Add( + content: __contentMasks, + name: "\"masks\"", + fileName: $"\"file{__iMasks}.bin\""); + if (__contentMasks.Headers.ContentDisposition != null) + { + __contentMasks.Headers.ContentDisposition.FileNameStar = null; + } + } + + } + if (request.Materials != default) + { + + for (var __iMaterials = 0; __iMaterials < request.Materials.Count; __iMaterials++) + { + var __contentMaterials = new global::System.Net.Http.ByteArrayContent(request.Materials[__iMaterials]); + __contentMaterials.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); + __httpRequestContent.Add( + content: __contentMaterials, + name: "\"materials\"", + fileName: $"\"file{__iMaterials}.bin\""); + if (__contentMaterials.Headers.ContentDisposition != null) + { + __contentMaterials.Headers.ContentDisposition.FileNameStar = null; + } + } + + } + if (request.AspectRatio != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.AspectRatio ?? string.Empty), + name: "\"aspect_ratio\""); + + } + if (request.Quality != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Quality).HasValue ? (request.Quality).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"quality\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareEditWorkflowPostMaterialSwapRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostMaterialSwap", + methodName: "EditWorkflowPostMaterialSwapAsync", + pathTemplate: "\"/v2/tool/material-swap\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostMaterialSwap", + methodName: "EditWorkflowPostMaterialSwapAsync", + pathTemplate: "\"/v2/tool/material-swap\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostMaterialSwap", + methodName: "EditWorkflowPostMaterialSwapAsync", + pathTemplate: "\"/v2/tool/material-swap\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessEditWorkflowPostMaterialSwapResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostMaterialSwap", + methodName: "EditWorkflowPostMaterialSwapAsync", + pathTemplate: "\"/v2/tool/material-swap\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostMaterialSwap", + methodName: "EditWorkflowPostMaterialSwapAsync", + pathTemplate: "\"/v2/tool/material-swap\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not authorized to create a material swap. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessEditWorkflowPostMaterialSwapResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.MaterialSwapResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.MaterialSwapResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Material Swap
+ /// Re-renders masked regions of a product photo in the materials shown in
+ /// reference images, preserving the product's construction and everything
+ /// outside the masks. Upload the `image`, up to 4 `masks`, and the
+ /// `materials` using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// The product photo to edit (max size 25MB). JPEG, PNG, and WEBP
+ /// formats are supported. + /// + /// + /// The product photo to edit (max size 25MB). JPEG, PNG, and WEBP
+ /// formats are supported. + /// + /// + /// Masks marking the regions to change (max 4, max size 25MB each).
+ /// JPEG, PNG, and WEBP formats are supported. Every mask must have the
+ /// same pixel dimensions as the product photo. White pixels mark the
+ /// region to change and black pixels are preserved; alpha-only masks
+ /// also work (opaque = change, transparent = preserve). + /// + /// + /// Material reference images (max size 25MB each). JPEG, PNG, and WEBP
+ /// formats are supported. Only their material (color, texture, pattern
+ /// scale, and orientation) is applied to the masked regions. Send one
+ /// material for every mask, or exactly one per mask, paired by
+ /// position. + /// + /// + /// Output aspect ratio. Defaults to the product photo's aspect ratio,
+ /// which keeps the original framing. A different ratio extends the
+ /// scene to fill the new shape rather than cropping, so part of the
+ /// frame is newly generated. Supported values are `1:1`, `3:4`,
+ /// `4:3`, `16:9`, and `9:16`. + /// + /// + /// The quality tier for the edit. Higher tiers may improve detail and
+ /// take longer to complete. + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task EditWorkflowPostMaterialSwapAsync( + byte[] image, + string imagename, + bool? dryRun = default, + global::System.Collections.Generic.IList? masks = default, + global::System.Collections.Generic.IList? materials = default, + string? aspectRatio = default, + global::Ideogram.MaterialSwapQuality? quality = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Ideogram.EditWorkflowPostMaterialSwapRequest + { + Image = image, + Imagename = imagename, + Masks = masks, + Materials = materials, + AspectRatio = aspectRatio, + Quality = quality, + WebhookUrl = webhookUrl, + }; + + return await EditWorkflowPostMaterialSwapAsync( + dryRun: dryRun, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// Material Swap
+ /// Re-renders masked regions of a product photo in the materials shown in
+ /// reference images, preserving the product's construction and everything
+ /// outside the masks. Upload the `image`, up to 4 `masks`, and the
+ /// `materials` using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// The product photo to edit (max size 25MB). JPEG, PNG, and WEBP
+ /// formats are supported. + /// + /// + /// The product photo to edit (max size 25MB). JPEG, PNG, and WEBP
+ /// formats are supported. + /// + /// + /// Masks marking the regions to change (max 4, max size 25MB each).
+ /// JPEG, PNG, and WEBP formats are supported. Every mask must have the
+ /// same pixel dimensions as the product photo. White pixels mark the
+ /// region to change and black pixels are preserved; alpha-only masks
+ /// also work (opaque = change, transparent = preserve). + /// + /// + /// Optional file names to use for the multipart 'masks' file parts. + /// + /// + /// Material reference images (max size 25MB each). JPEG, PNG, and WEBP
+ /// formats are supported. Only their material (color, texture, pattern
+ /// scale, and orientation) is applied to the masked regions. Send one
+ /// material for every mask, or exactly one per mask, paired by
+ /// position. + /// + /// + /// Optional file names to use for the multipart 'materials' file parts. + /// + /// + /// Output aspect ratio. Defaults to the product photo's aspect ratio,
+ /// which keeps the original framing. A different ratio extends the
+ /// scene to fill the new shape rather than cropping, so part of the
+ /// frame is newly generated. Supported values are `1:1`, `3:4`,
+ /// `4:3`, `16:9`, and `9:16`. + /// + /// + /// The quality tier for the edit. Higher tiers may improve detail and
+ /// take longer to complete. + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task EditWorkflowPostMaterialSwapAsync( + global::System.IO.Stream image, + string imagename, + bool? dryRun = default, + global::System.Collections.Generic.IReadOnlyList? masks = default, + global::System.Collections.Generic.IReadOnlyList? masksFileNames = default, + global::System.Collections.Generic.IReadOnlyList? materials = default, + global::System.Collections.Generic.IReadOnlyList? materialsFileNames = default, + string? aspectRatio = default, + global::Ideogram.MaterialSwapQuality? quality = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + var request = new global::Ideogram.EditWorkflowPostMaterialSwapRequest + { + Image = global::System.Array.Empty(), + Imagename = imagename, + Masks = new global::System.Collections.Generic.List(), + Materials = new global::System.Collections.Generic.List(), + AspectRatio = aspectRatio, + Quality = quality, + WebhookUrl = webhookUrl, + }; + PrepareArguments( + client: HttpClient); + PrepareEditWorkflowPostMaterialSwapArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_EditWorkflowPostMaterialSwapSecurityRequirements, + operationName: "EditWorkflowPostMaterialSwapAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/tool/material-swap", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (masks != default) + { + + for (var __iMasks = 0; __iMasks < masks.Count; __iMasks++) + { + var __fileNameMasks = masksFileNames != null && + __iMasks < masksFileNames.Count && + masksFileNames[__iMasks] != null + ? masksFileNames[__iMasks] + : $"file{__iMasks}.bin"; + var __contentMasks = new global::System.Net.Http.StreamContent(masks[__iMasks]); + __contentMasks.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + __fileNameMasks is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(__fileNameMasks) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentMasks, + name: "\"masks\"", + fileName: $"\"{__fileNameMasks}\""); + if (__contentMasks.Headers.ContentDisposition != null) + { + __contentMasks.Headers.ContentDisposition.FileNameStar = null; + } + } + + } + if (materials != default) + { + + for (var __iMaterials = 0; __iMaterials < materials.Count; __iMaterials++) + { + var __fileNameMaterials = materialsFileNames != null && + __iMaterials < materialsFileNames.Count && + materialsFileNames[__iMaterials] != null + ? materialsFileNames[__iMaterials] + : $"file{__iMaterials}.bin"; + var __contentMaterials = new global::System.Net.Http.StreamContent(materials[__iMaterials]); + __contentMaterials.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + __fileNameMaterials is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(__fileNameMaterials) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentMaterials, + name: "\"materials\"", + fileName: $"\"{__fileNameMaterials}\""); + if (__contentMaterials.Headers.ContentDisposition != null) + { + __contentMaterials.Headers.ContentDisposition.FileNameStar = null; + } + } + + } + if (request.AspectRatio != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.AspectRatio ?? string.Empty), + name: "\"aspect_ratio\""); + + } + if (request.Quality != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Quality).HasValue ? (request.Quality).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"quality\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareEditWorkflowPostMaterialSwapRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostMaterialSwap", + methodName: "EditWorkflowPostMaterialSwapAsync", + pathTemplate: "\"/v2/tool/material-swap\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostMaterialSwap", + methodName: "EditWorkflowPostMaterialSwapAsync", + pathTemplate: "\"/v2/tool/material-swap\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostMaterialSwap", + methodName: "EditWorkflowPostMaterialSwapAsync", + pathTemplate: "\"/v2/tool/material-swap\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessEditWorkflowPostMaterialSwapResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostMaterialSwap", + methodName: "EditWorkflowPostMaterialSwapAsync", + pathTemplate: "\"/v2/tool/material-swap\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostMaterialSwap", + methodName: "EditWorkflowPostMaterialSwapAsync", + pathTemplate: "\"/v2/tool/material-swap\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not authorized to create a material swap. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessEditWorkflowPostMaterialSwapResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::Ideogram.MaterialSwapResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::Ideogram.MaterialSwapResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Material Swap
+ /// Re-renders masked regions of a product photo in the materials shown in
+ /// reference images, preserving the product's construction and everything
+ /// outside the masks. Upload the `image`, up to 4 `masks`, and the
+ /// `materials` using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// The product photo to edit (max size 25MB). JPEG, PNG, and WEBP
+ /// formats are supported. + /// + /// + /// The product photo to edit (max size 25MB). JPEG, PNG, and WEBP
+ /// formats are supported. + /// + /// + /// Masks marking the regions to change (max 4, max size 25MB each).
+ /// JPEG, PNG, and WEBP formats are supported. Every mask must have the
+ /// same pixel dimensions as the product photo. White pixels mark the
+ /// region to change and black pixels are preserved; alpha-only masks
+ /// also work (opaque = change, transparent = preserve). + /// + /// + /// Optional file names to use for the multipart 'masks' file parts. + /// + /// + /// Material reference images (max size 25MB each). JPEG, PNG, and WEBP
+ /// formats are supported. Only their material (color, texture, pattern
+ /// scale, and orientation) is applied to the masked regions. Send one
+ /// material for every mask, or exactly one per mask, paired by
+ /// position. + /// + /// + /// Optional file names to use for the multipart 'materials' file parts. + /// + /// + /// Output aspect ratio. Defaults to the product photo's aspect ratio,
+ /// which keeps the original framing. A different ratio extends the
+ /// scene to fill the new shape rather than cropping, so part of the
+ /// frame is newly generated. Supported values are `1:1`, `3:4`,
+ /// `4:3`, `16:9`, and `9:16`. + /// + /// + /// The quality tier for the edit. Higher tiers may improve detail and
+ /// take longer to complete. + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> EditWorkflowPostMaterialSwapAsResponseAsync( + global::System.IO.Stream image, + string imagename, + bool? dryRun = default, + global::System.Collections.Generic.IReadOnlyList? masks = default, + global::System.Collections.Generic.IReadOnlyList? masksFileNames = default, + global::System.Collections.Generic.IReadOnlyList? materials = default, + global::System.Collections.Generic.IReadOnlyList? materialsFileNames = default, + string? aspectRatio = default, + global::Ideogram.MaterialSwapQuality? quality = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + var request = new global::Ideogram.EditWorkflowPostMaterialSwapRequest + { + Image = global::System.Array.Empty(), + Imagename = imagename, + Masks = new global::System.Collections.Generic.List(), + Materials = new global::System.Collections.Generic.List(), + AspectRatio = aspectRatio, + Quality = quality, + WebhookUrl = webhookUrl, + }; + PrepareArguments( + client: HttpClient); + PrepareEditWorkflowPostMaterialSwapArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_EditWorkflowPostMaterialSwapSecurityRequirements, + operationName: "EditWorkflowPostMaterialSwapAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/tool/material-swap", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (masks != default) + { + + for (var __iMasks = 0; __iMasks < masks.Count; __iMasks++) + { + var __fileNameMasks = masksFileNames != null && + __iMasks < masksFileNames.Count && + masksFileNames[__iMasks] != null + ? masksFileNames[__iMasks] + : $"file{__iMasks}.bin"; + var __contentMasks = new global::System.Net.Http.StreamContent(masks[__iMasks]); + __contentMasks.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + __fileNameMasks is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(__fileNameMasks) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentMasks, + name: "\"masks\"", + fileName: $"\"{__fileNameMasks}\""); + if (__contentMasks.Headers.ContentDisposition != null) + { + __contentMasks.Headers.ContentDisposition.FileNameStar = null; + } + } + + } + if (materials != default) + { + + for (var __iMaterials = 0; __iMaterials < materials.Count; __iMaterials++) + { + var __fileNameMaterials = materialsFileNames != null && + __iMaterials < materialsFileNames.Count && + materialsFileNames[__iMaterials] != null + ? materialsFileNames[__iMaterials] + : $"file{__iMaterials}.bin"; + var __contentMaterials = new global::System.Net.Http.StreamContent(materials[__iMaterials]); + __contentMaterials.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + __fileNameMaterials is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(__fileNameMaterials) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentMaterials, + name: "\"materials\"", + fileName: $"\"{__fileNameMaterials}\""); + if (__contentMaterials.Headers.ContentDisposition != null) + { + __contentMaterials.Headers.ContentDisposition.FileNameStar = null; + } + } + + } + if (request.AspectRatio != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.AspectRatio ?? string.Empty), + name: "\"aspect_ratio\""); + + } + if (request.Quality != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Quality).HasValue ? (request.Quality).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"quality\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareEditWorkflowPostMaterialSwapRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostMaterialSwap", + methodName: "EditWorkflowPostMaterialSwapAsync", + pathTemplate: "\"/v2/tool/material-swap\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostMaterialSwap", + methodName: "EditWorkflowPostMaterialSwapAsync", + pathTemplate: "\"/v2/tool/material-swap\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostMaterialSwap", + methodName: "EditWorkflowPostMaterialSwapAsync", + pathTemplate: "\"/v2/tool/material-swap\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessEditWorkflowPostMaterialSwapResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostMaterialSwap", + methodName: "EditWorkflowPostMaterialSwapAsync", + pathTemplate: "\"/v2/tool/material-swap\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostMaterialSwap", + methodName: "EditWorkflowPostMaterialSwapAsync", + pathTemplate: "\"/v2/tool/material-swap\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not authorized to create a material swap. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessEditWorkflowPostMaterialSwapResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.MaterialSwapResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.MaterialSwapResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.EditWorkflowPostModelPoseVariants.g.cs b/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.EditWorkflowPostModelPoseVariants.g.cs new file mode 100644 index 00000000..484d49b0 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.EditWorkflowPostModelPoseVariants.g.cs @@ -0,0 +1,2401 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class EditWorkflowClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_EditWorkflowPostModelPoseVariantsSecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_EditWorkflowPostModelPoseVariantsSecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_EditWorkflowPostModelPoseVariantsSecurityRequirement0, + }; + partial void PrepareEditWorkflowPostModelPoseVariantsArguments( + global::System.Net.Http.HttpClient httpClient, + global::Ideogram.EditWorkflowPostModelPoseVariantsRequest request); + partial void PrepareEditWorkflowPostModelPoseVariantsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + global::Ideogram.EditWorkflowPostModelPoseVariantsRequest request); + partial void ProcessEditWorkflowPostModelPoseVariantsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessEditWorkflowPostModelPoseVariantsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Model Pose Variants
+ /// Changes the model's pose or camera angle in a fashion image while
+ /// preserving the model, garment, styling, and scene. Upload the
+ /// `source_image` using `multipart/form-data` and describe the new pose in
+ /// `instruction`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task EditWorkflowPostModelPoseVariantsAsync( + + global::Ideogram.EditWorkflowPostModelPoseVariantsRequest request, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await EditWorkflowPostModelPoseVariantsAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Model Pose Variants
+ /// Changes the model's pose or camera angle in a fashion image while
+ /// preserving the model, garment, styling, and scene. Upload the
+ /// `source_image` using `multipart/form-data` and describe the new pose in
+ /// `instruction`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> EditWorkflowPostModelPoseVariantsAsResponseAsync( + + global::Ideogram.EditWorkflowPostModelPoseVariantsRequest request, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareEditWorkflowPostModelPoseVariantsArguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_EditWorkflowPostModelPoseVariantsSecurityRequirements, + operationName: "EditWorkflowPostModelPoseVariantsAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/tool/model-pose-variants", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentSourceImage = new global::System.Net.Http.ByteArrayContent(request.SourceImage ?? global::System.Array.Empty()); + __contentSourceImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.SourceImagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.SourceImagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentSourceImage, + name: "\"source_image\"", + fileName: request.SourceImagename != null ? $"\"{request.SourceImagename}\"" : string.Empty); + if (__contentSourceImage.Headers.ContentDisposition != null) + { + __contentSourceImage.Headers.ContentDisposition.FileNameStar = null; + } + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Instruction ?? string.Empty), + name: "\"instruction\""); + + if (request.AspectRatio != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.AspectRatio ?? string.Empty), + name: "\"aspect_ratio\""); + + } + if (request.Quality != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Quality).HasValue ? (request.Quality).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"quality\""); + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareEditWorkflowPostModelPoseVariantsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostModelPoseVariants", + methodName: "EditWorkflowPostModelPoseVariantsAsync", + pathTemplate: "\"/v2/tool/model-pose-variants\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostModelPoseVariants", + methodName: "EditWorkflowPostModelPoseVariantsAsync", + pathTemplate: "\"/v2/tool/model-pose-variants\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostModelPoseVariants", + methodName: "EditWorkflowPostModelPoseVariantsAsync", + pathTemplate: "\"/v2/tool/model-pose-variants\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessEditWorkflowPostModelPoseVariantsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostModelPoseVariants", + methodName: "EditWorkflowPostModelPoseVariantsAsync", + pathTemplate: "\"/v2/tool/model-pose-variants\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostModelPoseVariants", + methodName: "EditWorkflowPostModelPoseVariantsAsync", + pathTemplate: "\"/v2/tool/model-pose-variants\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not authorized to generate pose variants. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // An input asset was not found or is not readable. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The instruction did not pass prompt safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessEditWorkflowPostModelPoseVariantsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.ModelPoseVariantsResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.ModelPoseVariantsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Model Pose Variants
+ /// Changes the model's pose or camera angle in a fashion image while
+ /// preserving the model, garment, styling, and scene. Upload the
+ /// `source_image` using `multipart/form-data` and describe the new pose in
+ /// `instruction`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// Fashion image to edit (max size 50MB). JPEG, PNG, WEBP, HEIF,
+ /// AVIF, GIF, BMP, TIFF, and MPO formats are supported. Multipart
+ /// requests only. + /// + /// + /// Fashion image to edit (max size 50MB). JPEG, PNG, WEBP, HEIF,
+ /// AVIF, GIF, BMP, TIFF, and MPO formats are supported. Multipart
+ /// requests only. + /// + /// + /// Plain-language pose or camera direction, such as a front-facing
+ /// catalog stance or right-facing walking profile. + /// + /// + /// Output aspect ratio. When omitted, the nearest supported ratio is
+ /// derived from the source image. Supported values are `1:1`, `3:4`,
+ /// `4:3`, `16:9`, and `9:16`. + /// + /// + /// The quality tier for the edit. Higher tiers may improve detail and
+ /// take longer to complete. + /// + /// + /// Optional seed for repeatable results. + /// + /// + /// Number of pose variants to create.
+ /// Default Value: 1 + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task EditWorkflowPostModelPoseVariantsAsync( + byte[] sourceImage, + string sourceImagename, + string instruction, + string? aspectRatio = default, + global::Ideogram.ModelPoseVariantsQuality? quality = default, + int? seed = default, + int? numImages = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Ideogram.EditWorkflowPostModelPoseVariantsRequest + { + SourceImage = sourceImage, + SourceImagename = sourceImagename, + Instruction = instruction, + AspectRatio = aspectRatio, + Quality = quality, + Seed = seed, + NumImages = numImages, + WebhookUrl = webhookUrl, + }; + + return await EditWorkflowPostModelPoseVariantsAsync( + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// Model Pose Variants
+ /// Changes the model's pose or camera angle in a fashion image while
+ /// preserving the model, garment, styling, and scene. Upload the
+ /// `source_image` using `multipart/form-data` and describe the new pose in
+ /// `instruction`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// Fashion image to edit (max size 50MB). JPEG, PNG, WEBP, HEIF,
+ /// AVIF, GIF, BMP, TIFF, and MPO formats are supported. Multipart
+ /// requests only. + /// + /// + /// Fashion image to edit (max size 50MB). JPEG, PNG, WEBP, HEIF,
+ /// AVIF, GIF, BMP, TIFF, and MPO formats are supported. Multipart
+ /// requests only. + /// + /// + /// Plain-language pose or camera direction, such as a front-facing
+ /// catalog stance or right-facing walking profile. + /// + /// + /// Output aspect ratio. When omitted, the nearest supported ratio is
+ /// derived from the source image. Supported values are `1:1`, `3:4`,
+ /// `4:3`, `16:9`, and `9:16`. + /// + /// + /// The quality tier for the edit. Higher tiers may improve detail and
+ /// take longer to complete. + /// + /// + /// Optional seed for repeatable results. + /// + /// + /// Number of pose variants to create.
+ /// Default Value: 1 + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task EditWorkflowPostModelPoseVariantsAsync( + global::System.IO.Stream sourceImage, + string sourceImagename, + string instruction, + string? aspectRatio = default, + global::Ideogram.ModelPoseVariantsQuality? quality = default, + int? seed = default, + int? numImages = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + sourceImage = sourceImage ?? throw new global::System.ArgumentNullException(nameof(sourceImage)); + var request = new global::Ideogram.EditWorkflowPostModelPoseVariantsRequest + { + SourceImage = global::System.Array.Empty(), + SourceImagename = sourceImagename, + Instruction = instruction, + AspectRatio = aspectRatio, + Quality = quality, + Seed = seed, + NumImages = numImages, + WebhookUrl = webhookUrl, + }; + PrepareArguments( + client: HttpClient); + PrepareEditWorkflowPostModelPoseVariantsArguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_EditWorkflowPostModelPoseVariantsSecurityRequirements, + operationName: "EditWorkflowPostModelPoseVariantsAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/tool/model-pose-variants", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentSourceImage = new global::System.Net.Http.StreamContent(sourceImage); + __contentSourceImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.SourceImagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.SourceImagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentSourceImage, + name: "\"source_image\"", + fileName: request.SourceImagename != null ? $"\"{request.SourceImagename}\"" : string.Empty); + if (__contentSourceImage.Headers.ContentDisposition != null) + { + __contentSourceImage.Headers.ContentDisposition.FileNameStar = null; + } + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Instruction ?? string.Empty), + name: "\"instruction\""); + + if (request.AspectRatio != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.AspectRatio ?? string.Empty), + name: "\"aspect_ratio\""); + + } + if (request.Quality != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Quality).HasValue ? (request.Quality).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"quality\""); + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareEditWorkflowPostModelPoseVariantsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostModelPoseVariants", + methodName: "EditWorkflowPostModelPoseVariantsAsync", + pathTemplate: "\"/v2/tool/model-pose-variants\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostModelPoseVariants", + methodName: "EditWorkflowPostModelPoseVariantsAsync", + pathTemplate: "\"/v2/tool/model-pose-variants\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostModelPoseVariants", + methodName: "EditWorkflowPostModelPoseVariantsAsync", + pathTemplate: "\"/v2/tool/model-pose-variants\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessEditWorkflowPostModelPoseVariantsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostModelPoseVariants", + methodName: "EditWorkflowPostModelPoseVariantsAsync", + pathTemplate: "\"/v2/tool/model-pose-variants\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostModelPoseVariants", + methodName: "EditWorkflowPostModelPoseVariantsAsync", + pathTemplate: "\"/v2/tool/model-pose-variants\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not authorized to generate pose variants. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // An input asset was not found or is not readable. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The instruction did not pass prompt safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessEditWorkflowPostModelPoseVariantsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::Ideogram.ModelPoseVariantsResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::Ideogram.ModelPoseVariantsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Model Pose Variants
+ /// Changes the model's pose or camera angle in a fashion image while
+ /// preserving the model, garment, styling, and scene. Upload the
+ /// `source_image` using `multipart/form-data` and describe the new pose in
+ /// `instruction`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// Fashion image to edit (max size 50MB). JPEG, PNG, WEBP, HEIF,
+ /// AVIF, GIF, BMP, TIFF, and MPO formats are supported. Multipart
+ /// requests only. + /// + /// + /// Fashion image to edit (max size 50MB). JPEG, PNG, WEBP, HEIF,
+ /// AVIF, GIF, BMP, TIFF, and MPO formats are supported. Multipart
+ /// requests only. + /// + /// + /// Plain-language pose or camera direction, such as a front-facing
+ /// catalog stance or right-facing walking profile. + /// + /// + /// Output aspect ratio. When omitted, the nearest supported ratio is
+ /// derived from the source image. Supported values are `1:1`, `3:4`,
+ /// `4:3`, `16:9`, and `9:16`. + /// + /// + /// The quality tier for the edit. Higher tiers may improve detail and
+ /// take longer to complete. + /// + /// + /// Optional seed for repeatable results. + /// + /// + /// Number of pose variants to create.
+ /// Default Value: 1 + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> EditWorkflowPostModelPoseVariantsAsResponseAsync( + global::System.IO.Stream sourceImage, + string sourceImagename, + string instruction, + string? aspectRatio = default, + global::Ideogram.ModelPoseVariantsQuality? quality = default, + int? seed = default, + int? numImages = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + sourceImage = sourceImage ?? throw new global::System.ArgumentNullException(nameof(sourceImage)); + var request = new global::Ideogram.EditWorkflowPostModelPoseVariantsRequest + { + SourceImage = global::System.Array.Empty(), + SourceImagename = sourceImagename, + Instruction = instruction, + AspectRatio = aspectRatio, + Quality = quality, + Seed = seed, + NumImages = numImages, + WebhookUrl = webhookUrl, + }; + PrepareArguments( + client: HttpClient); + PrepareEditWorkflowPostModelPoseVariantsArguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_EditWorkflowPostModelPoseVariantsSecurityRequirements, + operationName: "EditWorkflowPostModelPoseVariantsAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/tool/model-pose-variants", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentSourceImage = new global::System.Net.Http.StreamContent(sourceImage); + __contentSourceImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.SourceImagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.SourceImagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentSourceImage, + name: "\"source_image\"", + fileName: request.SourceImagename != null ? $"\"{request.SourceImagename}\"" : string.Empty); + if (__contentSourceImage.Headers.ContentDisposition != null) + { + __contentSourceImage.Headers.ContentDisposition.FileNameStar = null; + } + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Instruction ?? string.Empty), + name: "\"instruction\""); + + if (request.AspectRatio != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.AspectRatio ?? string.Empty), + name: "\"aspect_ratio\""); + + } + if (request.Quality != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Quality).HasValue ? (request.Quality).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"quality\""); + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareEditWorkflowPostModelPoseVariantsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostModelPoseVariants", + methodName: "EditWorkflowPostModelPoseVariantsAsync", + pathTemplate: "\"/v2/tool/model-pose-variants\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostModelPoseVariants", + methodName: "EditWorkflowPostModelPoseVariantsAsync", + pathTemplate: "\"/v2/tool/model-pose-variants\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostModelPoseVariants", + methodName: "EditWorkflowPostModelPoseVariantsAsync", + pathTemplate: "\"/v2/tool/model-pose-variants\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessEditWorkflowPostModelPoseVariantsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostModelPoseVariants", + methodName: "EditWorkflowPostModelPoseVariantsAsync", + pathTemplate: "\"/v2/tool/model-pose-variants\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostModelPoseVariants", + methodName: "EditWorkflowPostModelPoseVariantsAsync", + pathTemplate: "\"/v2/tool/model-pose-variants\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not authorized to generate pose variants. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // An input asset was not found or is not readable. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The instruction did not pass prompt safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessEditWorkflowPostModelPoseVariantsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.ModelPoseVariantsResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.ModelPoseVariantsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.EditWorkflowPostSketchToRender.g.cs b/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.EditWorkflowPostSketchToRender.g.cs new file mode 100644 index 00000000..a76eda3c --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.EditWorkflowPostSketchToRender.g.cs @@ -0,0 +1,2395 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class EditWorkflowClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_EditWorkflowPostSketchToRenderSecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_EditWorkflowPostSketchToRenderSecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_EditWorkflowPostSketchToRenderSecurityRequirement0, + }; + partial void PrepareEditWorkflowPostSketchToRenderArguments( + global::System.Net.Http.HttpClient httpClient, + global::Ideogram.EditWorkflowPostSketchToRenderRequest request); + partial void PrepareEditWorkflowPostSketchToRenderRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + global::Ideogram.EditWorkflowPostSketchToRenderRequest request); + partial void ProcessEditWorkflowPostSketchToRenderResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessEditWorkflowPostSketchToRenderResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Sketch to Render
+ /// Turns a fashion sketch into photorealistic garment or product imagery,
+ /// preserving its silhouette, construction, colors, and design details.
+ /// Upload the `sketch_image` using `multipart/form-data` and describe
+ /// materials and rendering in `instruction`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task EditWorkflowPostSketchToRenderAsync( + + global::Ideogram.EditWorkflowPostSketchToRenderRequest request, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await EditWorkflowPostSketchToRenderAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Sketch to Render
+ /// Turns a fashion sketch into photorealistic garment or product imagery,
+ /// preserving its silhouette, construction, colors, and design details.
+ /// Upload the `sketch_image` using `multipart/form-data` and describe
+ /// materials and rendering in `instruction`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> EditWorkflowPostSketchToRenderAsResponseAsync( + + global::Ideogram.EditWorkflowPostSketchToRenderRequest request, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareEditWorkflowPostSketchToRenderArguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_EditWorkflowPostSketchToRenderSecurityRequirements, + operationName: "EditWorkflowPostSketchToRenderAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/tool/sketch-to-render", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentSketchImage = new global::System.Net.Http.ByteArrayContent(request.SketchImage ?? global::System.Array.Empty()); + __contentSketchImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.SketchImagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.SketchImagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentSketchImage, + name: "\"sketch_image\"", + fileName: request.SketchImagename != null ? $"\"{request.SketchImagename}\"" : string.Empty); + if (__contentSketchImage.Headers.ContentDisposition != null) + { + __contentSketchImage.Headers.ContentDisposition.FileNameStar = null; + } + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Instruction ?? string.Empty), + name: "\"instruction\""); + + if (request.AspectRatio != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.AspectRatio ?? string.Empty), + name: "\"aspect_ratio\""); + + } + if (request.Quality != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Quality).HasValue ? (request.Quality).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"quality\""); + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareEditWorkflowPostSketchToRenderRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostSketchToRender", + methodName: "EditWorkflowPostSketchToRenderAsync", + pathTemplate: "\"/v2/tool/sketch-to-render\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostSketchToRender", + methodName: "EditWorkflowPostSketchToRenderAsync", + pathTemplate: "\"/v2/tool/sketch-to-render\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostSketchToRender", + methodName: "EditWorkflowPostSketchToRenderAsync", + pathTemplate: "\"/v2/tool/sketch-to-render\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessEditWorkflowPostSketchToRenderResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostSketchToRender", + methodName: "EditWorkflowPostSketchToRenderAsync", + pathTemplate: "\"/v2/tool/sketch-to-render\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostSketchToRender", + methodName: "EditWorkflowPostSketchToRenderAsync", + pathTemplate: "\"/v2/tool/sketch-to-render\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not authorized to render sketches. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The referenced sketch was not found or is not readable. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The instruction did not pass prompt safety validation. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessEditWorkflowPostSketchToRenderResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.SketchToRenderResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.SketchToRenderResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Sketch to Render
+ /// Turns a fashion sketch into photorealistic garment or product imagery,
+ /// preserving its silhouette, construction, colors, and design details.
+ /// Upload the `sketch_image` using `multipart/form-data` and describe
+ /// materials and rendering in `instruction`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// The fashion sketch to render, up to 50 MB. JPEG, PNG, WEBP, HEIF,
+ /// AVIF, GIF, BMP, TIFF, and MPO are supported. Multipart requests
+ /// only. + /// + /// + /// The fashion sketch to render, up to 50 MB. JPEG, PNG, WEBP, HEIF,
+ /// AVIF, GIF, BMP, TIFF, and MPO are supported. Multipart requests
+ /// only. + /// + /// + /// Material and rendering direction, plus any construction or design
+ /// details that are not legible in the sketch. + /// + /// + /// Aspect ratio of each output image. Defaults to `1:1` when omitted. + /// + /// + /// The quality tier for the edit. Higher tiers may improve detail and
+ /// take longer to complete. + /// + /// + /// Optional seed for repeatable results. + /// + /// + /// Number of product renders to create.
+ /// Default Value: 1 + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task EditWorkflowPostSketchToRenderAsync( + byte[] sketchImage, + string sketchImagename, + string instruction, + string? aspectRatio = default, + global::Ideogram.SketchToRenderQuality? quality = default, + int? seed = default, + int? numImages = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Ideogram.EditWorkflowPostSketchToRenderRequest + { + SketchImage = sketchImage, + SketchImagename = sketchImagename, + Instruction = instruction, + AspectRatio = aspectRatio, + Quality = quality, + Seed = seed, + NumImages = numImages, + WebhookUrl = webhookUrl, + }; + + return await EditWorkflowPostSketchToRenderAsync( + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// Sketch to Render
+ /// Turns a fashion sketch into photorealistic garment or product imagery,
+ /// preserving its silhouette, construction, colors, and design details.
+ /// Upload the `sketch_image` using `multipart/form-data` and describe
+ /// materials and rendering in `instruction`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// The fashion sketch to render, up to 50 MB. JPEG, PNG, WEBP, HEIF,
+ /// AVIF, GIF, BMP, TIFF, and MPO are supported. Multipart requests
+ /// only. + /// + /// + /// The fashion sketch to render, up to 50 MB. JPEG, PNG, WEBP, HEIF,
+ /// AVIF, GIF, BMP, TIFF, and MPO are supported. Multipart requests
+ /// only. + /// + /// + /// Material and rendering direction, plus any construction or design
+ /// details that are not legible in the sketch. + /// + /// + /// Aspect ratio of each output image. Defaults to `1:1` when omitted. + /// + /// + /// The quality tier for the edit. Higher tiers may improve detail and
+ /// take longer to complete. + /// + /// + /// Optional seed for repeatable results. + /// + /// + /// Number of product renders to create.
+ /// Default Value: 1 + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task EditWorkflowPostSketchToRenderAsync( + global::System.IO.Stream sketchImage, + string sketchImagename, + string instruction, + string? aspectRatio = default, + global::Ideogram.SketchToRenderQuality? quality = default, + int? seed = default, + int? numImages = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + sketchImage = sketchImage ?? throw new global::System.ArgumentNullException(nameof(sketchImage)); + var request = new global::Ideogram.EditWorkflowPostSketchToRenderRequest + { + SketchImage = global::System.Array.Empty(), + SketchImagename = sketchImagename, + Instruction = instruction, + AspectRatio = aspectRatio, + Quality = quality, + Seed = seed, + NumImages = numImages, + WebhookUrl = webhookUrl, + }; + PrepareArguments( + client: HttpClient); + PrepareEditWorkflowPostSketchToRenderArguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_EditWorkflowPostSketchToRenderSecurityRequirements, + operationName: "EditWorkflowPostSketchToRenderAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/tool/sketch-to-render", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentSketchImage = new global::System.Net.Http.StreamContent(sketchImage); + __contentSketchImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.SketchImagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.SketchImagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentSketchImage, + name: "\"sketch_image\"", + fileName: request.SketchImagename != null ? $"\"{request.SketchImagename}\"" : string.Empty); + if (__contentSketchImage.Headers.ContentDisposition != null) + { + __contentSketchImage.Headers.ContentDisposition.FileNameStar = null; + } + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Instruction ?? string.Empty), + name: "\"instruction\""); + + if (request.AspectRatio != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.AspectRatio ?? string.Empty), + name: "\"aspect_ratio\""); + + } + if (request.Quality != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Quality).HasValue ? (request.Quality).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"quality\""); + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareEditWorkflowPostSketchToRenderRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostSketchToRender", + methodName: "EditWorkflowPostSketchToRenderAsync", + pathTemplate: "\"/v2/tool/sketch-to-render\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostSketchToRender", + methodName: "EditWorkflowPostSketchToRenderAsync", + pathTemplate: "\"/v2/tool/sketch-to-render\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostSketchToRender", + methodName: "EditWorkflowPostSketchToRenderAsync", + pathTemplate: "\"/v2/tool/sketch-to-render\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessEditWorkflowPostSketchToRenderResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostSketchToRender", + methodName: "EditWorkflowPostSketchToRenderAsync", + pathTemplate: "\"/v2/tool/sketch-to-render\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostSketchToRender", + methodName: "EditWorkflowPostSketchToRenderAsync", + pathTemplate: "\"/v2/tool/sketch-to-render\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not authorized to render sketches. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The referenced sketch was not found or is not readable. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The instruction did not pass prompt safety validation. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessEditWorkflowPostSketchToRenderResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::Ideogram.SketchToRenderResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::Ideogram.SketchToRenderResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Sketch to Render
+ /// Turns a fashion sketch into photorealistic garment or product imagery,
+ /// preserving its silhouette, construction, colors, and design details.
+ /// Upload the `sketch_image` using `multipart/form-data` and describe
+ /// materials and rendering in `instruction`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// The fashion sketch to render, up to 50 MB. JPEG, PNG, WEBP, HEIF,
+ /// AVIF, GIF, BMP, TIFF, and MPO are supported. Multipart requests
+ /// only. + /// + /// + /// The fashion sketch to render, up to 50 MB. JPEG, PNG, WEBP, HEIF,
+ /// AVIF, GIF, BMP, TIFF, and MPO are supported. Multipart requests
+ /// only. + /// + /// + /// Material and rendering direction, plus any construction or design
+ /// details that are not legible in the sketch. + /// + /// + /// Aspect ratio of each output image. Defaults to `1:1` when omitted. + /// + /// + /// The quality tier for the edit. Higher tiers may improve detail and
+ /// take longer to complete. + /// + /// + /// Optional seed for repeatable results. + /// + /// + /// Number of product renders to create.
+ /// Default Value: 1 + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> EditWorkflowPostSketchToRenderAsResponseAsync( + global::System.IO.Stream sketchImage, + string sketchImagename, + string instruction, + string? aspectRatio = default, + global::Ideogram.SketchToRenderQuality? quality = default, + int? seed = default, + int? numImages = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + sketchImage = sketchImage ?? throw new global::System.ArgumentNullException(nameof(sketchImage)); + var request = new global::Ideogram.EditWorkflowPostSketchToRenderRequest + { + SketchImage = global::System.Array.Empty(), + SketchImagename = sketchImagename, + Instruction = instruction, + AspectRatio = aspectRatio, + Quality = quality, + Seed = seed, + NumImages = numImages, + WebhookUrl = webhookUrl, + }; + PrepareArguments( + client: HttpClient); + PrepareEditWorkflowPostSketchToRenderArguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_EditWorkflowPostSketchToRenderSecurityRequirements, + operationName: "EditWorkflowPostSketchToRenderAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/tool/sketch-to-render", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentSketchImage = new global::System.Net.Http.StreamContent(sketchImage); + __contentSketchImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.SketchImagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.SketchImagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentSketchImage, + name: "\"sketch_image\"", + fileName: request.SketchImagename != null ? $"\"{request.SketchImagename}\"" : string.Empty); + if (__contentSketchImage.Headers.ContentDisposition != null) + { + __contentSketchImage.Headers.ContentDisposition.FileNameStar = null; + } + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Instruction ?? string.Empty), + name: "\"instruction\""); + + if (request.AspectRatio != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.AspectRatio ?? string.Empty), + name: "\"aspect_ratio\""); + + } + if (request.Quality != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Quality).HasValue ? (request.Quality).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"quality\""); + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareEditWorkflowPostSketchToRenderRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostSketchToRender", + methodName: "EditWorkflowPostSketchToRenderAsync", + pathTemplate: "\"/v2/tool/sketch-to-render\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostSketchToRender", + methodName: "EditWorkflowPostSketchToRenderAsync", + pathTemplate: "\"/v2/tool/sketch-to-render\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostSketchToRender", + methodName: "EditWorkflowPostSketchToRenderAsync", + pathTemplate: "\"/v2/tool/sketch-to-render\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessEditWorkflowPostSketchToRenderResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostSketchToRender", + methodName: "EditWorkflowPostSketchToRenderAsync", + pathTemplate: "\"/v2/tool/sketch-to-render\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "EditWorkflowPostSketchToRender", + methodName: "EditWorkflowPostSketchToRenderAsync", + pathTemplate: "\"/v2/tool/sketch-to-render\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not authorized to render sketches. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The referenced sketch was not found or is not readable. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The instruction did not pass prompt safety validation. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessEditWorkflowPostSketchToRenderResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.SketchToRenderResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.SketchToRenderResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostAdLocalizer.g.cs b/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostAdLocalizer.g.cs deleted file mode 100644 index 6b8a18b2..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostAdLocalizer.g.cs +++ /dev/null @@ -1,922 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class EditWorkflowClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostAdLocalizerSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostAdLocalizerSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostAdLocalizerSecurityRequirement0, - }; - partial void PreparePostAdLocalizerArguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? dryRun, - global::Ideogram.AdLocalizerRequest request); - partial void PreparePostAdLocalizerRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? dryRun, - global::Ideogram.AdLocalizerRequest request); - partial void ProcessPostAdLocalizerResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostAdLocalizerResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Ad Localizer
- /// Rebuilds an ad in one target language, preserving its layout, logos,
- /// brand type, and product so only the visible marketing copy changes.
- /// Upload the source ad as `image` using `multipart/form-data`; the copy
- /// is translated unless you supply `exact_copy`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
- /// supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostAdLocalizerAsync( - - global::Ideogram.AdLocalizerRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostAdLocalizerAsResponseAsync( - - request: request, - dryRun: dryRun, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Ad Localizer
- /// Rebuilds an ad in one target language, preserving its layout, logos,
- /// brand type, and product so only the visible marketing copy changes.
- /// Upload the source ad as `image` using `multipart/form-data`; the copy
- /// is translated unless you supply `exact_copy`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
- /// supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostAdLocalizerAsResponseAsync( - - global::Ideogram.AdLocalizerRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostAdLocalizerArguments( - httpClient: HttpClient, - dryRun: ref dryRun, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostAdLocalizerSecurityRequirements, - operationName: "PostAdLocalizerAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/tool/ad-localizer", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (request.ImageAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ImageAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"image_asset_identifier\""); - - } - if (request.Image != default) - { - - var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - } - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Language.ToValueString()), - name: "\"language\""); - - if (request.ExactCopy != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ExactCopy ?? string.Empty), - name: "\"exact_copy\""); - - } - if (request.Prompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - } - if (request.Quality != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Quality).HasValue ? (request.Quality).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"quality\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.TargetCollectionId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.TargetCollectionId ?? string.Empty), - name: "\"target_collection_id\""); - - } - if (request.Private != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"private\""); - - } - if (request.WebhookUrl != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), - name: "\"webhook_url\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostAdLocalizerRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - dryRun: dryRun, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostAdLocalizer", - methodName: "PostAdLocalizerAsync", - pathTemplate: "\"/v2/tool/ad-localizer\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostAdLocalizer", - methodName: "PostAdLocalizerAsync", - pathTemplate: "\"/v2/tool/ad-localizer\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostAdLocalizer", - methodName: "PostAdLocalizerAsync", - pathTemplate: "\"/v2/tool/ad-localizer\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostAdLocalizerResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostAdLocalizer", - methodName: "PostAdLocalizerAsync", - pathTemplate: "\"/v2/tool/ad-localizer\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostAdLocalizer", - methodName: "PostAdLocalizerAsync", - pathTemplate: "\"/v2/tool/ad-localizer\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostAdLocalizerResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.AdLocalizerResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.AdLocalizerResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Ad Localizer
- /// Rebuilds an ad in one target language, preserving its layout, logos,
- /// brand type, and product so only the visible marketing copy changes.
- /// Upload the source ad as `image` using `multipart/form-data`; the copy
- /// is translated unless you supply `exact_copy`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
- /// supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The source ad to localize (max size 25MB). Its layout, logos, brand
- /// type, and product are preserved, and the output keeps its shape, so
- /// no size or aspect ratio is needed. JPEG, PNG, and WEBP formats are
- /// supported. Multipart requests only. - /// - /// - /// The source ad to localize (max size 25MB). Its layout, logos, brand
- /// type, and product are preserved, and the output keeps its shape, so
- /// no size or aspect ratio is needed. JPEG, PNG, and WEBP formats are
- /// supported. Multipart requests only. - /// - /// - /// The target language for the copy. Arabic is rendered right-to-left. Each request covers one language; send one request per language. - /// - /// - /// Pre-approved wording, one `original => replacement` mapping per line. Each mapping names the text element showing `original` and sets it to `replacement`, placed character for character rather than translated. Any text element not listed is left as it is in the source. When omitted, all visible marketing copy is translated. - /// - /// - /// Optional additional direction for the localization, for example "keep the badge in English". Anything it explicitly asks to change takes priority over the preservation rules. - /// - /// - /// The quality tier for the edit. Higher tiers may improve detail and
- /// take longer to complete. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// Number of localized variations to create for this language.
- /// Default Value: 1 - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. Completed outputs are added to it automatically. - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostAdLocalizerAsync( - global::Ideogram.AdLocalizerRequestLanguage language, - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - string? exactCopy = default, - string? prompt = default, - global::Ideogram.AdLocalizerQuality? quality = default, - int? seed = default, - int? numImages = default, - string? targetCollectionId = default, - bool? @private = default, - string? webhookUrl = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.AdLocalizerRequest - { - ImageAssetIdentifier = imageAssetIdentifier, - Image = image, - Imagename = imagename, - Language = language, - ExactCopy = exactCopy, - Prompt = prompt, - Quality = quality, - Seed = seed, - NumImages = numImages, - TargetCollectionId = targetCollectionId, - Private = @private, - WebhookUrl = webhookUrl, - }; - - return await PostAdLocalizerAsync( - dryRun: dryRun, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostAdResizer.g.cs b/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostAdResizer.g.cs deleted file mode 100644 index ec6c96f7..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostAdResizer.g.cs +++ /dev/null @@ -1,926 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class EditWorkflowClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostAdResizerSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostAdResizerSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostAdResizerSecurityRequirement0, - }; - partial void PreparePostAdResizerArguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? dryRun, - global::Ideogram.AdResizerRequest request); - partial void PreparePostAdResizerRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? dryRun, - global::Ideogram.AdResizerRequest request); - partial void ProcessPostAdResizerResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostAdResizerResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Ad Resizer
- /// Reframes an ad creative to an exact ad resolution, regenerating the
- /// layout so text and key elements stay legible at the new size. Upload
- /// the source creative as `image` using `multipart/form-data`, and supply
- /// `platform` to keep the ad inside that platform's safe zone.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
- /// supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostAdResizerAsync( - - global::Ideogram.AdResizerRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostAdResizerAsResponseAsync( - - request: request, - dryRun: dryRun, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Ad Resizer
- /// Reframes an ad creative to an exact ad resolution, regenerating the
- /// layout so text and key elements stay legible at the new size. Upload
- /// the source creative as `image` using `multipart/form-data`, and supply
- /// `platform` to keep the ad inside that platform's safe zone.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
- /// supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostAdResizerAsResponseAsync( - - global::Ideogram.AdResizerRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostAdResizerArguments( - httpClient: HttpClient, - dryRun: ref dryRun, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostAdResizerSecurityRequirements, - operationName: "PostAdResizerAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/tool/ad-resizer", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (request.ImageAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ImageAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"image_asset_identifier\""); - - } - if (request.Image != default) - { - - var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - } - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Resolution.ToValueString()), - name: "\"resolution\""); - - if (request.Platform != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Platform).HasValue ? (request.Platform).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"platform\""); - - } - if (request.Prompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - } - if (request.Quality != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Quality).HasValue ? (request.Quality).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"quality\""); - - } - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.TargetCollectionId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.TargetCollectionId ?? string.Empty), - name: "\"target_collection_id\""); - - } - if (request.Private != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"private\""); - - } - if (request.WebhookUrl != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), - name: "\"webhook_url\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostAdResizerRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - dryRun: dryRun, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostAdResizer", - methodName: "PostAdResizerAsync", - pathTemplate: "\"/v2/tool/ad-resizer\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostAdResizer", - methodName: "PostAdResizerAsync", - pathTemplate: "\"/v2/tool/ad-resizer\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostAdResizer", - methodName: "PostAdResizerAsync", - pathTemplate: "\"/v2/tool/ad-resizer\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostAdResizerResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostAdResizer", - methodName: "PostAdResizerAsync", - pathTemplate: "\"/v2/tool/ad-resizer\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostAdResizer", - methodName: "PostAdResizerAsync", - pathTemplate: "\"/v2/tool/ad-resizer\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostAdResizerResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.AdResizerResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.AdResizerResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Ad Resizer
- /// Reframes an ad creative to an exact ad resolution, regenerating the
- /// layout so text and key elements stay legible at the new size. Upload
- /// the source creative as `image` using `multipart/form-data`, and supply
- /// `platform` to keep the ad inside that platform's safe zone.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
- /// supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The source creative to reframe (max size 25MB). JPEG, PNG, and
- /// WEBP formats are supported. Multipart requests only. - /// - /// - /// The source creative to reframe (max size 25MB). JPEG, PNG, and
- /// WEBP formats are supported. Multipart requests only. - /// - /// - /// Target ad resolution, formatted as `WIDTHxHEIGHT`. Any value not in
- /// the list is rejected with a 400. Each output image has exactly these
- /// pixel dimensions, with or without a `platform`. - /// - /// - /// The ad platform whose published safe zone the ad must stay inside.
- /// The ad is generated inside the largest rectangle that fits the
- /// platform's safe zone for the requested aspect ratio, and the space
- /// around it is filled in so the output is still exactly the requested
- /// `resolution`. `google` covers YouTube and Google Ads placements.
- /// Use `meta_stories` or `meta_reels` for Meta placements; Reels uses
- /// the largest rectangle inside its notched safe zone. The legacy
- /// `meta` value is still supported and uses a more conservative safe
- /// zone. When omitted, the ad fills the whole frame and every
- /// supported `resolution` is accepted. Any other value is rejected
- /// with a 400.
- /// Each platform accepts only the resolutions for which it publishes a
- /// safe zone; any other `resolution` is rejected with a 400:
- /// | Platform | Accepted resolutions |
- /// | --- | --- |
- /// | `google` | `1920x1080`, `3840x2160`, `1080x1080`, `2400x2400`, `2880x2880`, `1080x1920`, `2160x3840` |
- /// | `tiktok` | `1920x1080`, `3840x2160`, `1080x1080`, `2400x2400`, `2880x2880`, `1080x1920`, `2160x3840` |
- /// | `meta_stories` | `1080x1920`, `2160x3840` |
- /// | `meta_reels` | `1080x1920`, `2160x3840` |
- /// | `meta` (legacy) | `1080x1920`, `2160x3840` |
- /// | `snapchat` | `1080x1920`, `2160x3840` | - /// - /// - /// Optional edit instruction to apply while reframing, for example "remove the logo" or "put the price bottom-right". - /// - /// - /// The quality tier for the reframe. Higher tiers may improve detail and
- /// take longer to complete. - /// - /// - /// The number of reframed variations to generate.
- /// Default Value: 1 - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. Completed outputs are added to it automatically. - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostAdResizerAsync( - global::Ideogram.AdResizerRequestResolution resolution, - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - global::Ideogram.AdResizerRequestPlatform? platform = default, - string? prompt = default, - global::Ideogram.AdResizerQuality? quality = default, - int? numImages = default, - string? targetCollectionId = default, - bool? @private = default, - string? webhookUrl = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.AdResizerRequest - { - ImageAssetIdentifier = imageAssetIdentifier, - Image = image, - Imagename = imagename, - Resolution = resolution, - Platform = platform, - Prompt = prompt, - Quality = quality, - NumImages = numImages, - TargetCollectionId = targetCollectionId, - Private = @private, - WebhookUrl = webhookUrl, - }; - - return await PostAdResizerAsync( - dryRun: dryRun, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostAdVariations.g.cs b/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostAdVariations.g.cs deleted file mode 100644 index e2601836..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostAdVariations.g.cs +++ /dev/null @@ -1,865 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class EditWorkflowClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostAdVariationsSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostAdVariationsSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostAdVariationsSecurityRequirement0, - }; - partial void PreparePostAdVariationsArguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.AdVariationsRequest request); - partial void PreparePostAdVariationsRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.AdVariationsRequest request); - partial void ProcessPostAdVariationsResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostAdVariationsResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Ad Variations
- /// Creates on-brand variations of an ad along one axis, preserving logos,
- /// brand colors, the product, and all on-image text. Upload the source
- /// creative as `image` using `multipart/form-data` and choose a
- /// `variation_type`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
- /// supply a `webhook_url`. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostAdVariationsAsync( - - global::Ideogram.AdVariationsRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostAdVariationsAsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Ad Variations
- /// Creates on-brand variations of an ad along one axis, preserving logos,
- /// brand colors, the product, and all on-image text. Upload the source
- /// creative as `image` using `multipart/form-data` and choose a
- /// `variation_type`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
- /// supply a `webhook_url`. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostAdVariationsAsResponseAsync( - - global::Ideogram.AdVariationsRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostAdVariationsArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostAdVariationsSecurityRequirements, - operationName: "PostAdVariationsAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/tool/ad-variations", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (request.ImageAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ImageAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"image_asset_identifier\""); - - } - if (request.Image != default) - { - - var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - } - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.VariationType.ToValueString()), - name: "\"variation_type\""); - - if (request.Prompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - } - if (request.Quality != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Quality).HasValue ? (request.Quality).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"quality\""); - - } - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.Private != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"private\""); - - } - if (request.WebhookUrl != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), - name: "\"webhook_url\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostAdVariationsRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostAdVariations", - methodName: "PostAdVariationsAsync", - pathTemplate: "\"/v2/tool/ad-variations\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostAdVariations", - methodName: "PostAdVariationsAsync", - pathTemplate: "\"/v2/tool/ad-variations\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostAdVariations", - methodName: "PostAdVariationsAsync", - pathTemplate: "\"/v2/tool/ad-variations\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostAdVariationsResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostAdVariations", - methodName: "PostAdVariationsAsync", - pathTemplate: "\"/v2/tool/ad-variations\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostAdVariations", - methodName: "PostAdVariationsAsync", - pathTemplate: "\"/v2/tool/ad-variations\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostAdVariationsResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.AdVariationsResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.AdVariationsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Ad Variations
- /// Creates on-brand variations of an ad along one axis, preserving logos,
- /// brand colors, the product, and all on-image text. Upload the source
- /// creative as `image` using `multipart/form-data` and choose a
- /// `variation_type`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
- /// supply a `webhook_url`. - ///
- /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The source creative to vary (max size 25MB). JPEG, PNG, and WEBP
- /// formats are supported. Multipart requests only. Each output keeps
- /// the source's aspect ratio, capped at 3:1 between the long and short
- /// sides. - /// - /// - /// The source creative to vary (max size 25MB). JPEG, PNG, and WEBP
- /// formats are supported. Multipart requests only. Each output keeps
- /// the source's aspect ratio, capped at 3:1 between the long and short
- /// sides. - /// - /// - /// The axis to vary. `people`
- /// replaces the people in the ad with different talent. `setting`
- /// moves the same subject and product to a different environment.
- /// `group_size` changes how many people appear. `scene` shifts the
- /// moment or occasion (time of day, season, or activity). - /// - /// - /// Optional direction to steer the variation, for example "set it on a beach" or "make the models older". Anything it explicitly asks to change takes priority over the default preservation rules. - /// - /// - /// The quality tier for the edit. Higher tiers may improve detail and
- /// take longer to complete. - /// - /// - /// The number of variations to generate along the requested axis.
- /// Default Value: 1 - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostAdVariationsAsync( - global::Ideogram.AdVariationsRequestVariationType variationType, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - string? prompt = default, - global::Ideogram.AdVariationsQuality? quality = default, - int? numImages = default, - bool? @private = default, - string? webhookUrl = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.AdVariationsRequest - { - ImageAssetIdentifier = imageAssetIdentifier, - Image = image, - Imagename = imagename, - VariationType = variationType, - Prompt = prompt, - Quality = quality, - NumImages = numImages, - Private = @private, - WebhookUrl = webhookUrl, - }; - - return await PostAdVariationsAsync( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostColorways.g.cs b/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostColorways.g.cs deleted file mode 100644 index 313e63c8..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostColorways.g.cs +++ /dev/null @@ -1,867 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class EditWorkflowClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostColorwaysSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostColorwaysSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostColorwaysSecurityRequirement0, - }; - partial void PreparePostColorwaysArguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? dryRun, - global::Ideogram.ColorwaysRequest request); - partial void PreparePostColorwaysRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? dryRun, - global::Ideogram.ColorwaysRequest request); - partial void ProcessPostColorwaysResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostColorwaysResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Colorways
- /// Recolors masked regions of a product photo, each to its own target
- /// color, preserving the product's geometry, materials, prints, logos, and
- /// everything outside the masks. Upload the `image` and up to 4 `masks`
- /// using `multipart/form-data`, with one entry in `colors` per mask.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
- /// supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostColorwaysAsync( - - global::Ideogram.ColorwaysRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostColorwaysAsResponseAsync( - - request: request, - dryRun: dryRun, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Colorways
- /// Recolors masked regions of a product photo, each to its own target
- /// color, preserving the product's geometry, materials, prints, logos, and
- /// everything outside the masks. Upload the `image` and up to 4 `masks`
- /// using `multipart/form-data`, with one entry in `colors` per mask.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
- /// supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostColorwaysAsResponseAsync( - - global::Ideogram.ColorwaysRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostColorwaysArguments( - httpClient: HttpClient, - dryRun: ref dryRun, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostColorwaysSecurityRequirements, - operationName: "PostColorwaysAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/tool/colorways", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (request.ImageAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ImageAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"image_asset_identifier\""); - - } - if (request.Image != default) - { - - var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.MaskAssetIdentifiers != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.MaskAssetIdentifiers!, x => x.ToJson(JsonSerializerContext)))}]"), - name: "\"mask_asset_identifiers\""); - - } - if (request.Masks != default) - { - - for (var __iMasks = 0; __iMasks < request.Masks.Count; __iMasks++) - { - var __contentMasks = new global::System.Net.Http.ByteArrayContent(request.Masks[__iMasks]); - __contentMasks.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); - __httpRequestContent.Add( - content: __contentMasks, - name: "\"masks\"", - fileName: $"\"file{__iMasks}.bin\""); - if (__contentMasks.Headers.ContentDisposition != null) - { - __contentMasks.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.Colors, x => x))}]"), - name: "\"colors\""); - - if (request.AspectRatio != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.AspectRatio ?? string.Empty), - name: "\"aspect_ratio\""); - - } - if (request.Quality != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Quality).HasValue ? (request.Quality).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"quality\""); - - } - if (request.TargetCollectionId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.TargetCollectionId ?? string.Empty), - name: "\"target_collection_id\""); - - } - if (request.Private != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"private\""); - - } - if (request.WebhookUrl != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), - name: "\"webhook_url\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostColorwaysRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - dryRun: dryRun, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostColorways", - methodName: "PostColorwaysAsync", - pathTemplate: "\"/v2/tool/colorways\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostColorways", - methodName: "PostColorwaysAsync", - pathTemplate: "\"/v2/tool/colorways\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostColorways", - methodName: "PostColorwaysAsync", - pathTemplate: "\"/v2/tool/colorways\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostColorwaysResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostColorways", - methodName: "PostColorwaysAsync", - pathTemplate: "\"/v2/tool/colorways\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostColorways", - methodName: "PostColorwaysAsync", - pathTemplate: "\"/v2/tool/colorways\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostColorwaysResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.ColorwaysResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.ColorwaysResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Colorways
- /// Recolors masked regions of a product photo, each to its own target
- /// color, preserving the product's geometry, materials, prints, logos, and
- /// everything outside the masks. Upload the `image` and up to 4 `masks`
- /// using `multipart/form-data`, with one entry in `colors` per mask.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
- /// supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// The product photo to recolor, by reference. Everything outside
- /// the masked region is preserved. Provide exactly one of
- /// `image_asset_identifier` or `image`. - /// - /// - /// The product photo to recolor (max size 25MB). JPEG, PNG, and WEBP
- /// formats are supported. - /// - /// - /// The product photo to recolor (max size 25MB). JPEG, PNG, and WEBP
- /// formats are supported. - /// - /// - /// The masks marking the regions of the product photo to recolor, by
- /// reference, paired by position with `colors` (max 4). Every mask
- /// must have the same pixel dimensions as the product photo. White
- /// pixels mark the region to recolor; black pixels are preserved.
- /// Alpha-only masks are also supported: opaque pixels mark the
- /// region to recolor and transparent pixels are preserved. Provide
- /// exactly one of `mask_asset_identifiers` or `masks`. - /// - /// - /// Masks marking the regions to recolor (max 4, max size 25MB each),
- /// paired by position with `colors`. JPEG, PNG, and WEBP formats are
- /// supported. Every mask must have the same pixel dimensions as the
- /// product photo. White pixels mark the region to recolor and black
- /// pixels are preserved; alpha-only masks also work (opaque =
- /// recolor, transparent = preserve). - /// - /// - /// One target color per mask in `masks`, as six-digit hex codes like
- /// `#B3202C`, paired by position. The product's shape, construction,
- /// materials, prints, and logos are always preserved. - /// - /// - /// Output aspect ratio. Defaults to the product photo's aspect ratio,
- /// which keeps the original framing. A different ratio extends the
- /// scene to fill the new shape rather than cropping, so part of the
- /// frame is newly generated. Supported values are `1:1`, `3:4`,
- /// `4:3`, `16:9`, and `9:16`. - /// - /// - /// The quality tier for the edit. Higher tiers may improve detail and
- /// take longer to complete. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. Completed outputs are added to it automatically. - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostColorwaysAsync( - global::System.Collections.Generic.IList colors, - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - global::System.Collections.Generic.IList? maskAssetIdentifiers = default, - global::System.Collections.Generic.IList? masks = default, - string? aspectRatio = default, - global::Ideogram.ColorwaysQuality? quality = default, - string? targetCollectionId = default, - bool? @private = default, - string? webhookUrl = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.ColorwaysRequest - { - ImageAssetIdentifier = imageAssetIdentifier, - Image = image, - Imagename = imagename, - MaskAssetIdentifiers = maskAssetIdentifiers, - Masks = masks, - Colors = colors, - AspectRatio = aspectRatio, - Quality = quality, - TargetCollectionId = targetCollectionId, - Private = @private, - WebhookUrl = webhookUrl, - }; - - return await PostColorwaysAsync( - dryRun: dryRun, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostGhostMannequin.g.cs b/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostGhostMannequin.g.cs deleted file mode 100644 index f136e706..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostGhostMannequin.g.cs +++ /dev/null @@ -1,1414 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class EditWorkflowClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostGhostMannequinSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostGhostMannequinSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostGhostMannequinSecurityRequirement0, - }; - partial void PreparePostGhostMannequinArguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? dryRun, - global::Ideogram.GhostMannequinRequest request); - partial void PreparePostGhostMannequinRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? dryRun, - global::Ideogram.GhostMannequinRequest request); - partial void ProcessPostGhostMannequinResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostGhostMannequinResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Ghost Mannequin
- /// Turns photos of one garment into a ghost-mannequin product image on a
- /// clean white studio background, removing the person, mannequin, hanger,
- /// and other clothing. Upload the photos using `multipart/form-data`, in
- /// the directional fields (such as `front_image`) when the camera
- /// direction is known and in `garment_images` otherwise.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
- /// supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGhostMannequinAsync( - - global::Ideogram.GhostMannequinRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostGhostMannequinAsResponseAsync( - - request: request, - dryRun: dryRun, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Ghost Mannequin
- /// Turns photos of one garment into a ghost-mannequin product image on a
- /// clean white studio background, removing the person, mannequin, hanger,
- /// and other clothing. Upload the photos using `multipart/form-data`, in
- /// the directional fields (such as `front_image`) when the camera
- /// direction is known and in `garment_images` otherwise.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
- /// supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostGhostMannequinAsResponseAsync( - - global::Ideogram.GhostMannequinRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostGhostMannequinArguments( - httpClient: HttpClient, - dryRun: ref dryRun, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostGhostMannequinSecurityRequirements, - operationName: "PostGhostMannequinAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/tool/ghost-mannequin", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (request.GarmentAssetIdentifiers != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.GarmentAssetIdentifiers!, x => x.ToJson(JsonSerializerContext)))}]"), - name: "\"garment_asset_identifiers\""); - - } - if (request.GarmentImages != default) - { - - for (var __iGarmentImages = 0; __iGarmentImages < request.GarmentImages.Count; __iGarmentImages++) - { - var __contentGarmentImages = new global::System.Net.Http.ByteArrayContent(request.GarmentImages[__iGarmentImages]); - __contentGarmentImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); - __httpRequestContent.Add( - content: __contentGarmentImages, - name: "\"garment_images\"", - fileName: $"\"file{__iGarmentImages}.bin\""); - if (__contentGarmentImages.Headers.ContentDisposition != null) - { - __contentGarmentImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - if (request.FrontAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.FrontAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"front_asset_identifier\""); - - } - if (request.FrontImage != default) - { - - var __contentFrontImage = new global::System.Net.Http.ByteArrayContent(request.FrontImage ?? global::System.Array.Empty()); - __contentFrontImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.FrontImagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.FrontImagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentFrontImage, - name: "\"front_image\"", - fileName: request.FrontImagename != null ? $"\"{request.FrontImagename}\"" : string.Empty); - if (__contentFrontImage.Headers.ContentDisposition != null) - { - __contentFrontImage.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.BackAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.BackAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"back_asset_identifier\""); - - } - if (request.BackImage != default) - { - - var __contentBackImage = new global::System.Net.Http.ByteArrayContent(request.BackImage ?? global::System.Array.Empty()); - __contentBackImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.BackImagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.BackImagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentBackImage, - name: "\"back_image\"", - fileName: request.BackImagename != null ? $"\"{request.BackImagename}\"" : string.Empty); - if (__contentBackImage.Headers.ContentDisposition != null) - { - __contentBackImage.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.LeftAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.LeftAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"left_asset_identifier\""); - - } - if (request.LeftImage != default) - { - - var __contentLeftImage = new global::System.Net.Http.ByteArrayContent(request.LeftImage ?? global::System.Array.Empty()); - __contentLeftImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.LeftImagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.LeftImagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentLeftImage, - name: "\"left_image\"", - fileName: request.LeftImagename != null ? $"\"{request.LeftImagename}\"" : string.Empty); - if (__contentLeftImage.Headers.ContentDisposition != null) - { - __contentLeftImage.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.RightAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.RightAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"right_asset_identifier\""); - - } - if (request.RightImage != default) - { - - var __contentRightImage = new global::System.Net.Http.ByteArrayContent(request.RightImage ?? global::System.Array.Empty()); - __contentRightImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.RightImagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.RightImagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentRightImage, - name: "\"right_image\"", - fileName: request.RightImagename != null ? $"\"{request.RightImagename}\"" : string.Empty); - if (__contentRightImage.Headers.ContentDisposition != null) - { - __contentRightImage.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.TopAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.TopAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"top_asset_identifier\""); - - } - if (request.TopImage != default) - { - - var __contentTopImage = new global::System.Net.Http.ByteArrayContent(request.TopImage ?? global::System.Array.Empty()); - __contentTopImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.TopImagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.TopImagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentTopImage, - name: "\"top_image\"", - fileName: request.TopImagename != null ? $"\"{request.TopImagename}\"" : string.Empty); - if (__contentTopImage.Headers.ContentDisposition != null) - { - __contentTopImage.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.BottomAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.BottomAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"bottom_asset_identifier\""); - - } - if (request.BottomImage != default) - { - - var __contentBottomImage = new global::System.Net.Http.ByteArrayContent(request.BottomImage ?? global::System.Array.Empty()); - __contentBottomImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.BottomImagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.BottomImagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentBottomImage, - name: "\"bottom_image\"", - fileName: request.BottomImagename != null ? $"\"{request.BottomImagename}\"" : string.Empty); - if (__contentBottomImage.Headers.ContentDisposition != null) - { - __contentBottomImage.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.OutputReferenceAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.OutputReferenceAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"output_reference_asset_identifier\""); - - } - if (request.OutputReferenceImage != default) - { - - var __contentOutputReferenceImage = new global::System.Net.Http.ByteArrayContent(request.OutputReferenceImage ?? global::System.Array.Empty()); - __contentOutputReferenceImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.OutputReferenceImagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.OutputReferenceImagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentOutputReferenceImage, - name: "\"output_reference_image\"", - fileName: request.OutputReferenceImagename != null ? $"\"{request.OutputReferenceImagename}\"" : string.Empty); - if (__contentOutputReferenceImage.Headers.ContentDisposition != null) - { - __contentOutputReferenceImage.Headers.ContentDisposition.FileNameStar = null; - } - - } - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.View.ToValueString()), - name: "\"view\""); - - if (request.Instruction != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Instruction ?? string.Empty), - name: "\"instruction\""); - - } - if (request.Metadata != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Metadata ?? string.Empty), - name: "\"metadata\""); - - } - if (request.AspectRatio != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.AspectRatio ?? string.Empty), - name: "\"aspect_ratio\""); - - } - if (request.Quality != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Quality).HasValue ? (request.Quality).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"quality\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.TargetCollectionId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.TargetCollectionId ?? string.Empty), - name: "\"target_collection_id\""); - - } - if (request.Private != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"private\""); - - } - if (request.WebhookUrl != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), - name: "\"webhook_url\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostGhostMannequinRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - dryRun: dryRun, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGhostMannequin", - methodName: "PostGhostMannequinAsync", - pathTemplate: "\"/v2/tool/ghost-mannequin\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGhostMannequin", - methodName: "PostGhostMannequinAsync", - pathTemplate: "\"/v2/tool/ghost-mannequin\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGhostMannequin", - methodName: "PostGhostMannequinAsync", - pathTemplate: "\"/v2/tool/ghost-mannequin\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostGhostMannequinResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGhostMannequin", - methodName: "PostGhostMannequinAsync", - pathTemplate: "\"/v2/tool/ghost-mannequin\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGhostMannequin", - methodName: "PostGhostMannequinAsync", - pathTemplate: "\"/v2/tool/ghost-mannequin\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 413) - { - string? __content_413 = null; - global::System.Exception? __exception_413 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_413 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_413 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_413, - responseBody: __content_413, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostGhostMannequinResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.GhostMannequinResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.GhostMannequinResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Ghost Mannequin
- /// Turns photos of one garment into a ghost-mannequin product image on a
- /// clean white studio background, removing the person, mannequin, hanger,
- /// and other clothing. Upload the photos using `multipart/form-data`, in
- /// the directional fields (such as `front_image`) when the camera
- /// direction is known and in `garment_images` otherwise.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
- /// supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Ordered uploaded or generated images of the same garment. Use
- /// multiple angles when available so obscured construction can be
- /// reconstructed conservatively. Mutually exclusive with
- /// `garment_images`. - /// - /// - /// Additional photos of the same garment, up to 50 MB each. JPEG,
- /// PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and MPO are supported.
- /// Multipart requests only. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// Optional front-view garment photo, up to 50 MB. Multipart requests
- /// only. - /// - /// - /// Optional front-view garment photo, up to 50 MB. Multipart requests
- /// only. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// Optional back-view garment photo, up to 50 MB. Multipart requests
- /// only. - /// - /// - /// Optional back-view garment photo, up to 50 MB. Multipart requests
- /// only. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// Optional left-view garment photo, up to 50 MB. Multipart requests
- /// only. - /// - /// - /// Optional left-view garment photo, up to 50 MB. Multipart requests
- /// only. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// Optional right-view garment photo, up to 50 MB. Multipart requests
- /// only. - /// - /// - /// Optional right-view garment photo, up to 50 MB. Multipart requests
- /// only. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// Optional top-view garment photo, up to 50 MB. Multipart requests
- /// only. - /// - /// - /// Optional top-view garment photo, up to 50 MB. Multipart requests
- /// only. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// Optional bottom-view garment photo, up to 50 MB. Multipart
- /// requests only. - /// - /// - /// Optional bottom-view garment photo, up to 50 MB. Multipart
- /// requests only. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// Optional presentation example, up to 50 MB. Multipart requests only.
- /// Guides pose, framing, and lighting without copying its garment,
- /// colors, text, or branding. Garment photos remain authoritative for
- /// product identity; view and aspect_ratio take precedence, and the
- /// background remains white. Does not replace a required garment photo.
- /// Mutually exclusive with `output_reference_asset_identifier`. - /// - /// - /// Optional presentation example, up to 50 MB. Multipart requests only.
- /// Guides pose, framing, and lighting without copying its garment,
- /// colors, text, or branding. Garment photos remain authoritative for
- /// product identity; view and aspect_ratio take precedence, and the
- /// background remains white. Does not replace a required garment photo.
- /// Mutually exclusive with `output_reference_asset_identifier`. - /// - /// - /// Camera view for the output garment. - /// - /// - /// Optional reconstruction guidance or identity-critical garment
- /// details to check against the photos. The output always uses a clean
- /// white studio background. - /// - /// - /// Optional JSON object serialized as a string containing factual
- /// product context, such as title, brand, category, color, material,
- /// item code, and exact printed text. Metadata helps disambiguate the
- /// garment photos but does not add features they do not show. - /// - /// - /// Output aspect ratio. Defaults to `1:1` when omitted. Supported
- /// values are `1:1`, `3:4`, `4:3`, `16:9`, and `9:16`. - /// - /// - /// The quality tier for the edit. Higher tiers may improve detail and
- /// take longer to complete. - /// - /// - /// Optional seed for repeatable results. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. Completed outputs are added to it automatically. - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGhostMannequinAsync( - global::Ideogram.GhostMannequinRequestView view, - bool? dryRun = default, - global::System.Collections.Generic.IList? garmentAssetIdentifiers = default, - global::System.Collections.Generic.IList? garmentImages = default, - global::Ideogram.AssetIdentifier? frontAssetIdentifier = default, - byte[]? frontImage = default, - string? frontImagename = default, - global::Ideogram.AssetIdentifier? backAssetIdentifier = default, - byte[]? backImage = default, - string? backImagename = default, - global::Ideogram.AssetIdentifier? leftAssetIdentifier = default, - byte[]? leftImage = default, - string? leftImagename = default, - global::Ideogram.AssetIdentifier? rightAssetIdentifier = default, - byte[]? rightImage = default, - string? rightImagename = default, - global::Ideogram.AssetIdentifier? topAssetIdentifier = default, - byte[]? topImage = default, - string? topImagename = default, - global::Ideogram.AssetIdentifier? bottomAssetIdentifier = default, - byte[]? bottomImage = default, - string? bottomImagename = default, - global::Ideogram.AssetIdentifier? outputReferenceAssetIdentifier = default, - byte[]? outputReferenceImage = default, - string? outputReferenceImagename = default, - string? instruction = default, - string? metadata = default, - string? aspectRatio = default, - global::Ideogram.GhostMannequinQuality? quality = default, - int? seed = default, - string? targetCollectionId = default, - bool? @private = default, - string? webhookUrl = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.GhostMannequinRequest - { - GarmentAssetIdentifiers = garmentAssetIdentifiers, - GarmentImages = garmentImages, - FrontAssetIdentifier = frontAssetIdentifier, - FrontImage = frontImage, - FrontImagename = frontImagename, - BackAssetIdentifier = backAssetIdentifier, - BackImage = backImage, - BackImagename = backImagename, - LeftAssetIdentifier = leftAssetIdentifier, - LeftImage = leftImage, - LeftImagename = leftImagename, - RightAssetIdentifier = rightAssetIdentifier, - RightImage = rightImage, - RightImagename = rightImagename, - TopAssetIdentifier = topAssetIdentifier, - TopImage = topImage, - TopImagename = topImagename, - BottomAssetIdentifier = bottomAssetIdentifier, - BottomImage = bottomImage, - BottomImagename = bottomImagename, - OutputReferenceAssetIdentifier = outputReferenceAssetIdentifier, - OutputReferenceImage = outputReferenceImage, - OutputReferenceImagename = outputReferenceImagename, - View = view, - Instruction = instruction, - Metadata = metadata, - AspectRatio = aspectRatio, - Quality = quality, - Seed = seed, - TargetCollectionId = targetCollectionId, - Private = @private, - WebhookUrl = webhookUrl, - }; - - return await PostGhostMannequinAsync( - dryRun: dryRun, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostLookbook.g.cs b/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostLookbook.g.cs deleted file mode 100644 index 9186febf..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostLookbook.g.cs +++ /dev/null @@ -1,681 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class EditWorkflowClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostLookbookSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostLookbookSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostLookbookSecurityRequirement0, - }; - partial void PreparePostLookbookArguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.LookbookRequest request); - partial void PreparePostLookbookRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.LookbookRequest request); - partial void ProcessPostLookbookResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostLookbookResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Create a fashion lookbook
- /// Creates polished fashion product imagery from one or more product
- /// references and an aesthetic reference. Each generated shoot is returned
- /// as four individual lookbook images.
- /// The request is processed asynchronously. Poll
- /// `GET /v2/generations/{generation_id}` with the returned `generation_id`
- /// until the generation is completed or failed. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostLookbookAsync( - - global::Ideogram.LookbookRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostLookbookAsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Create a fashion lookbook
- /// Creates polished fashion product imagery from one or more product
- /// references and an aesthetic reference. Each generated shoot is returned
- /// as four individual lookbook images.
- /// The request is processed asynchronously. Poll
- /// `GET /v2/generations/{generation_id}` with the returned `generation_id`
- /// until the generation is completed or failed. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostLookbookAsResponseAsync( - - global::Ideogram.LookbookRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostLookbookArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostLookbookSecurityRequirements, - operationName: "PostLookbookAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/workflow/lookbook", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostLookbookRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostLookbook", - methodName: "PostLookbookAsync", - pathTemplate: "\"/v2/workflow/lookbook\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostLookbook", - methodName: "PostLookbookAsync", - pathTemplate: "\"/v2/workflow/lookbook\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostLookbook", - methodName: "PostLookbookAsync", - pathTemplate: "\"/v2/workflow/lookbook\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostLookbookResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostLookbook", - methodName: "PostLookbookAsync", - pathTemplate: "\"/v2/workflow/lookbook\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostLookbook", - methodName: "PostLookbookAsync", - pathTemplate: "\"/v2/workflow/lookbook\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostLookbookResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.LookbookResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.LookbookResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Create a fashion lookbook
- /// Creates polished fashion product imagery from one or more product
- /// references and an aesthetic reference. Each generated shoot is returned
- /// as four individual lookbook images.
- /// The request is processed asynchronously. Poll
- /// `GET /v2/generations/{generation_id}` with the returned `generation_id`
- /// until the generation is completed or failed. - ///
- /// - /// Product images whose appearance must be preserved in the generated looks. - /// - /// - /// Selects the category-specific Lookbook presentation reference. - /// - /// - /// The aspect ratio of each generated 2x2 composite before it is split into images. Defaults to `1:1` when omitted. Supported values are `1:1`, `3:4`, and `9:16`. - /// - /// - /// Number of four-image lookbook shoots to create.
- /// Default Value: 3 - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostLookbookAsync( - global::System.Collections.Generic.IList productAssetIdentifiers, - global::Ideogram.LookbookRequestCategory category, - string? aspectRatio = default, - int? numShoots = default, - bool? @private = default, - string? webhookUrl = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.LookbookRequest - { - ProductAssetIdentifiers = productAssetIdentifiers, - Category = category, - AspectRatio = aspectRatio, - NumShoots = numShoots, - Private = @private, - WebhookUrl = webhookUrl, - }; - - return await PostLookbookAsync( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostMaterialSwap.g.cs b/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostMaterialSwap.g.cs deleted file mode 100644 index 80544539..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostMaterialSwap.g.cs +++ /dev/null @@ -1,899 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class EditWorkflowClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostMaterialSwapSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostMaterialSwapSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostMaterialSwapSecurityRequirement0, - }; - partial void PreparePostMaterialSwapArguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? dryRun, - global::Ideogram.MaterialSwapRequest request); - partial void PreparePostMaterialSwapRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? dryRun, - global::Ideogram.MaterialSwapRequest request); - partial void ProcessPostMaterialSwapResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostMaterialSwapResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Material Swap
- /// Re-renders masked regions of a product photo in the materials shown in
- /// reference images, preserving the product's construction and everything
- /// outside the masks. Upload the `image`, up to 4 `masks`, and the
- /// `materials` using `multipart/form-data`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
- /// supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostMaterialSwapAsync( - - global::Ideogram.MaterialSwapRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostMaterialSwapAsResponseAsync( - - request: request, - dryRun: dryRun, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Material Swap
- /// Re-renders masked regions of a product photo in the materials shown in
- /// reference images, preserving the product's construction and everything
- /// outside the masks. Upload the `image`, up to 4 `masks`, and the
- /// `materials` using `multipart/form-data`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
- /// supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostMaterialSwapAsResponseAsync( - - global::Ideogram.MaterialSwapRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostMaterialSwapArguments( - httpClient: HttpClient, - dryRun: ref dryRun, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostMaterialSwapSecurityRequirements, - operationName: "PostMaterialSwapAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/tool/material-swap", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (request.ImageAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ImageAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"image_asset_identifier\""); - - } - if (request.Image != default) - { - - var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.MaskAssetIdentifiers != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.MaskAssetIdentifiers!, x => x.ToJson(JsonSerializerContext)))}]"), - name: "\"mask_asset_identifiers\""); - - } - if (request.Masks != default) - { - - for (var __iMasks = 0; __iMasks < request.Masks.Count; __iMasks++) - { - var __contentMasks = new global::System.Net.Http.ByteArrayContent(request.Masks[__iMasks]); - __contentMasks.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); - __httpRequestContent.Add( - content: __contentMasks, - name: "\"masks\"", - fileName: $"\"file{__iMasks}.bin\""); - if (__contentMasks.Headers.ContentDisposition != null) - { - __contentMasks.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - if (request.MaterialAssetIdentifiers != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.MaterialAssetIdentifiers!, x => x.ToJson(JsonSerializerContext)))}]"), - name: "\"material_asset_identifiers\""); - - } - if (request.Materials != default) - { - - for (var __iMaterials = 0; __iMaterials < request.Materials.Count; __iMaterials++) - { - var __contentMaterials = new global::System.Net.Http.ByteArrayContent(request.Materials[__iMaterials]); - __contentMaterials.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); - __httpRequestContent.Add( - content: __contentMaterials, - name: "\"materials\"", - fileName: $"\"file{__iMaterials}.bin\""); - if (__contentMaterials.Headers.ContentDisposition != null) - { - __contentMaterials.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - if (request.AspectRatio != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.AspectRatio ?? string.Empty), - name: "\"aspect_ratio\""); - - } - if (request.Quality != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Quality).HasValue ? (request.Quality).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"quality\""); - - } - if (request.TargetCollectionId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.TargetCollectionId ?? string.Empty), - name: "\"target_collection_id\""); - - } - if (request.Private != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"private\""); - - } - if (request.WebhookUrl != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), - name: "\"webhook_url\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostMaterialSwapRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - dryRun: dryRun, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostMaterialSwap", - methodName: "PostMaterialSwapAsync", - pathTemplate: "\"/v2/tool/material-swap\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostMaterialSwap", - methodName: "PostMaterialSwapAsync", - pathTemplate: "\"/v2/tool/material-swap\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostMaterialSwap", - methodName: "PostMaterialSwapAsync", - pathTemplate: "\"/v2/tool/material-swap\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostMaterialSwapResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostMaterialSwap", - methodName: "PostMaterialSwapAsync", - pathTemplate: "\"/v2/tool/material-swap\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostMaterialSwap", - methodName: "PostMaterialSwapAsync", - pathTemplate: "\"/v2/tool/material-swap\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostMaterialSwapResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.MaterialSwapResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.MaterialSwapResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Material Swap
- /// Re-renders masked regions of a product photo in the materials shown in
- /// reference images, preserving the product's construction and everything
- /// outside the masks. Upload the `image`, up to 4 `masks`, and the
- /// `materials` using `multipart/form-data`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
- /// supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// The product photo to edit, by reference. Everything outside the
- /// masked region is preserved. Provide exactly one of
- /// `image_asset_identifier` or `image`. - /// - /// - /// The product photo to edit (max size 25MB). JPEG, PNG, and WEBP
- /// formats are supported. - /// - /// - /// The product photo to edit (max size 25MB). JPEG, PNG, and WEBP
- /// formats are supported. - /// - /// - /// The masks marking the regions of the product photo to change, by
- /// reference (max 4). Every mask must have the same pixel dimensions
- /// as the product photo. White pixels mark the region to change; black
- /// pixels are preserved. Alpha-only masks are also supported: opaque
- /// pixels mark the region to change and transparent pixels are
- /// preserved. Provide exactly one of `mask_asset_identifiers` or
- /// `masks`. - /// - /// - /// Masks marking the regions to change (max 4, max size 25MB each).
- /// JPEG, PNG, and WEBP formats are supported. Every mask must have the
- /// same pixel dimensions as the product photo. White pixels mark the
- /// region to change and black pixels are preserved; alpha-only masks
- /// also work (opaque = change, transparent = preserve). - /// - /// - /// The material reference images, by reference. Only their material —
- /// color, texture, pattern scale, and orientation — is applied to the
- /// masked regions. Send one material, which every mask takes, or
- /// exactly one per mask paired by position. Provide exactly one of
- /// `material_asset_identifiers` or `materials`. - /// - /// - /// Material reference images (max size 25MB each). JPEG, PNG, and WEBP
- /// formats are supported. Only their material (color, texture, pattern
- /// scale, and orientation) is applied to the masked regions. Send one
- /// material for every mask, or exactly one per mask, paired by
- /// position. - /// - /// - /// Output aspect ratio. Defaults to the product photo's aspect ratio,
- /// which keeps the original framing. A different ratio extends the
- /// scene to fill the new shape rather than cropping, so part of the
- /// frame is newly generated. Supported values are `1:1`, `3:4`,
- /// `4:3`, `16:9`, and `9:16`. - /// - /// - /// The quality tier for the edit. Higher tiers may improve detail and
- /// take longer to complete. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. Completed outputs are added to it automatically. - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostMaterialSwapAsync( - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - global::System.Collections.Generic.IList? maskAssetIdentifiers = default, - global::System.Collections.Generic.IList? masks = default, - global::System.Collections.Generic.IList? materialAssetIdentifiers = default, - global::System.Collections.Generic.IList? materials = default, - string? aspectRatio = default, - global::Ideogram.MaterialSwapQuality? quality = default, - string? targetCollectionId = default, - bool? @private = default, - string? webhookUrl = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.MaterialSwapRequest - { - ImageAssetIdentifier = imageAssetIdentifier, - Image = image, - Imagename = imagename, - MaskAssetIdentifiers = maskAssetIdentifiers, - Masks = masks, - MaterialAssetIdentifiers = materialAssetIdentifiers, - Materials = materials, - AspectRatio = aspectRatio, - Quality = quality, - TargetCollectionId = targetCollectionId, - Private = @private, - WebhookUrl = webhookUrl, - }; - - return await PostMaterialSwapAsync( - dryRun: dryRun, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostModelPoseVariants.g.cs b/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostModelPoseVariants.g.cs deleted file mode 100644 index 6a9d242c..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostModelPoseVariants.g.cs +++ /dev/null @@ -1,889 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class EditWorkflowClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostModelPoseVariantsSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostModelPoseVariantsSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostModelPoseVariantsSecurityRequirement0, - }; - partial void PreparePostModelPoseVariantsArguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.ModelPoseVariantsRequest request); - partial void PreparePostModelPoseVariantsRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.ModelPoseVariantsRequest request); - partial void ProcessPostModelPoseVariantsResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostModelPoseVariantsResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Model Pose Variants
- /// Changes the model's pose or camera angle in a fashion image while
- /// preserving the model, garment, styling, and scene. Upload the
- /// `source_image` using `multipart/form-data` and describe the new pose in
- /// `instruction`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
- /// supply a `webhook_url`. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostModelPoseVariantsAsync( - - global::Ideogram.ModelPoseVariantsRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostModelPoseVariantsAsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Model Pose Variants
- /// Changes the model's pose or camera angle in a fashion image while
- /// preserving the model, garment, styling, and scene. Upload the
- /// `source_image` using `multipart/form-data` and describe the new pose in
- /// `instruction`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
- /// supply a `webhook_url`. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostModelPoseVariantsAsResponseAsync( - - global::Ideogram.ModelPoseVariantsRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostModelPoseVariantsArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostModelPoseVariantsSecurityRequirements, - operationName: "PostModelPoseVariantsAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/tool/model-pose-variants", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (request.SourceAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.SourceAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"source_asset_identifier\""); - - } - if (request.SourceImage != default) - { - - var __contentSourceImage = new global::System.Net.Http.ByteArrayContent(request.SourceImage ?? global::System.Array.Empty()); - __contentSourceImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.SourceImagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.SourceImagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentSourceImage, - name: "\"source_image\"", - fileName: request.SourceImagename != null ? $"\"{request.SourceImagename}\"" : string.Empty); - if (__contentSourceImage.Headers.ContentDisposition != null) - { - __contentSourceImage.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.PoseReferenceAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.PoseReferenceAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"pose_reference_asset_identifier\""); - - } - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Instruction ?? string.Empty), - name: "\"instruction\""); - - if (request.AspectRatio != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.AspectRatio ?? string.Empty), - name: "\"aspect_ratio\""); - - } - if (request.Quality != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Quality).HasValue ? (request.Quality).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"quality\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.Private != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"private\""); - - } - if (request.WebhookUrl != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), - name: "\"webhook_url\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostModelPoseVariantsRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostModelPoseVariants", - methodName: "PostModelPoseVariantsAsync", - pathTemplate: "\"/v2/tool/model-pose-variants\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostModelPoseVariants", - methodName: "PostModelPoseVariantsAsync", - pathTemplate: "\"/v2/tool/model-pose-variants\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostModelPoseVariants", - methodName: "PostModelPoseVariantsAsync", - pathTemplate: "\"/v2/tool/model-pose-variants\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostModelPoseVariantsResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostModelPoseVariants", - methodName: "PostModelPoseVariantsAsync", - pathTemplate: "\"/v2/tool/model-pose-variants\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostModelPoseVariants", - methodName: "PostModelPoseVariantsAsync", - pathTemplate: "\"/v2/tool/model-pose-variants\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostModelPoseVariantsResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.ModelPoseVariantsResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.ModelPoseVariantsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Model Pose Variants
- /// Changes the model's pose or camera angle in a fashion image while
- /// preserving the model, garment, styling, and scene. Upload the
- /// `source_image` using `multipart/form-data` and describe the new pose in
- /// `instruction`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
- /// supply a `webhook_url`. - ///
- /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// Fashion image to edit (max size 50MB). JPEG, PNG, WEBP, HEIF,
- /// AVIF, GIF, BMP, TIFF, and MPO formats are supported. Multipart
- /// requests only. - /// - /// - /// Fashion image to edit (max size 50MB). JPEG, PNG, WEBP, HEIF,
- /// AVIF, GIF, BMP, TIFF, and MPO formats are supported. Multipart
- /// requests only. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// Plain-language pose or camera direction, such as a front-facing
- /// catalog stance or right-facing walking profile. - /// - /// - /// Output aspect ratio. When omitted, the nearest supported ratio is
- /// derived from the source image. Supported values are `1:1`, `3:4`,
- /// `4:3`, `16:9`, and `9:16`. - /// - /// - /// The quality tier for the edit. Higher tiers may improve detail and
- /// take longer to complete. - /// - /// - /// Optional seed for repeatable results. - /// - /// - /// Number of pose variants to create.
- /// Default Value: 1 - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostModelPoseVariantsAsync( - string instruction, - global::Ideogram.AssetIdentifier? sourceAssetIdentifier = default, - byte[]? sourceImage = default, - string? sourceImagename = default, - global::Ideogram.AssetIdentifier? poseReferenceAssetIdentifier = default, - string? aspectRatio = default, - global::Ideogram.ModelPoseVariantsQuality? quality = default, - int? seed = default, - int? numImages = default, - bool? @private = default, - string? webhookUrl = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.ModelPoseVariantsRequest - { - SourceAssetIdentifier = sourceAssetIdentifier, - SourceImage = sourceImage, - SourceImagename = sourceImagename, - PoseReferenceAssetIdentifier = poseReferenceAssetIdentifier, - Instruction = instruction, - AspectRatio = aspectRatio, - Quality = quality, - Seed = seed, - NumImages = numImages, - Private = @private, - WebhookUrl = webhookUrl, - }; - - return await PostModelPoseVariantsAsync( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostModelSwap.g.cs b/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostModelSwap.g.cs deleted file mode 100644 index a13c3519..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostModelSwap.g.cs +++ /dev/null @@ -1,881 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class EditWorkflowClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostModelSwapSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostModelSwapSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostModelSwapSecurityRequirement0, - }; - partial void PreparePostModelSwapArguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.ModelSwapRequest request); - partial void PreparePostModelSwapRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.ModelSwapRequest request); - partial void ProcessPostModelSwapResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostModelSwapResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Model Swap
- /// Replaces the model in a fashion image with the person shown in one to
- /// four target-model references, keeping the product, pose, scene,
- /// lighting, and framing. Upload the working image as `source_image` using
- /// `multipart/form-data`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
- /// supply a `webhook_url`. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostModelSwapAsync( - - global::Ideogram.ModelSwapRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostModelSwapAsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Model Swap
- /// Replaces the model in a fashion image with the person shown in one to
- /// four target-model references, keeping the product, pose, scene,
- /// lighting, and framing. Upload the working image as `source_image` using
- /// `multipart/form-data`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
- /// supply a `webhook_url`. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostModelSwapAsResponseAsync( - - global::Ideogram.ModelSwapRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostModelSwapArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostModelSwapSecurityRequirements, - operationName: "PostModelSwapAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/tool/model-swap", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (request.SourceAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.SourceAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"source_asset_identifier\""); - - } - if (request.SourceImage != default) - { - - var __contentSourceImage = new global::System.Net.Http.ByteArrayContent(request.SourceImage ?? global::System.Array.Empty()); - __contentSourceImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.SourceImagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.SourceImagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentSourceImage, - name: "\"source_image\"", - fileName: request.SourceImagename != null ? $"\"{request.SourceImagename}\"" : string.Empty); - if (__contentSourceImage.Headers.ContentDisposition != null) - { - __contentSourceImage.Headers.ContentDisposition.FileNameStar = null; - } - - } - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.ModelAssetIdentifiers, x => x.ToJson(JsonSerializerContext)))}]"), - name: "\"model_asset_identifiers\""); - - if (request.Instruction != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Instruction ?? string.Empty), - name: "\"instruction\""); - - } - if (request.AspectRatio != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.AspectRatio ?? string.Empty), - name: "\"aspect_ratio\""); - - } - if (request.Quality != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Quality).HasValue ? (request.Quality).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"quality\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.Private != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"private\""); - - } - if (request.WebhookUrl != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), - name: "\"webhook_url\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostModelSwapRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostModelSwap", - methodName: "PostModelSwapAsync", - pathTemplate: "\"/v2/tool/model-swap\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostModelSwap", - methodName: "PostModelSwapAsync", - pathTemplate: "\"/v2/tool/model-swap\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostModelSwap", - methodName: "PostModelSwapAsync", - pathTemplate: "\"/v2/tool/model-swap\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostModelSwapResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostModelSwap", - methodName: "PostModelSwapAsync", - pathTemplate: "\"/v2/tool/model-swap\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostModelSwap", - methodName: "PostModelSwapAsync", - pathTemplate: "\"/v2/tool/model-swap\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostModelSwapResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.ModelSwapResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.ModelSwapResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Model Swap
- /// Replaces the model in a fashion image with the person shown in one to
- /// four target-model references, keeping the product, pose, scene,
- /// lighting, and framing. Upload the working image as `source_image` using
- /// `multipart/form-data`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
- /// supply a `webhook_url`. - ///
- /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The working image whose product, pose, scene, lighting, framing, and camera are preserved. Supported formats and the 50 MB limit match the image upload API. Multipart requests only. - /// - /// - /// The working image whose product, pose, scene, lighting, framing, and camera are preserved. Supported formats and the 50 MB limit match the image upload API. Multipart requests only. - /// - /// - /// Ordered target-model identity and angle references. These images supply only identity, hair, skin tone, and body proportions. - /// - /// - /// Optional identity details that are not visible in the target-model references. This cannot override the source roles described above. - /// - /// - /// Output aspect ratio. When omitted, the closest supported ratio is derived from the working image. - /// - /// - /// The quality tier for the edit. Higher tiers may improve detail and
- /// take longer to complete. - /// - /// - /// Optional seed for repeatable results. - /// - /// - /// Number of model-swap images to create.
- /// Default Value: 1 - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostModelSwapAsync( - global::System.Collections.Generic.IList modelAssetIdentifiers, - global::Ideogram.AssetIdentifier? sourceAssetIdentifier = default, - byte[]? sourceImage = default, - string? sourceImagename = default, - string? instruction = default, - string? aspectRatio = default, - global::Ideogram.ModelSwapQuality? quality = default, - int? seed = default, - int? numImages = default, - bool? @private = default, - string? webhookUrl = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.ModelSwapRequest - { - SourceAssetIdentifier = sourceAssetIdentifier, - SourceImage = sourceImage, - SourceImagename = sourceImagename, - ModelAssetIdentifiers = modelAssetIdentifiers, - Instruction = instruction, - AspectRatio = aspectRatio, - Quality = quality, - Seed = seed, - NumImages = numImages, - Private = @private, - WebhookUrl = webhookUrl, - }; - - return await PostModelSwapAsync( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostPackshots.g.cs b/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostPackshots.g.cs deleted file mode 100644 index e2fd2fce..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostPackshots.g.cs +++ /dev/null @@ -1,700 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class EditWorkflowClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostPackshotsSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostPackshotsSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostPackshotsSecurityRequirement0, - }; - partial void PreparePostPackshotsArguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.PackshotsRequest request); - partial void PreparePostPackshotsRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.PackshotsRequest request); - partial void ProcessPostPackshotsResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostPackshotsResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Packshots
- /// Creates one polished product photograph from one or more ordered product
- /// references. An optional style reference may guide framing, crop,
- /// background, and lighting without changing the product's identity.
- /// The request is processed asynchronously. Poll
- /// `GET /v2/generations/{generation_id}` with the returned `generation_id`
- /// until the generation is completed or failed. Product fidelity is
- /// best-effort and details absent from every reference may be reconstructed. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostPackshotsAsync( - - global::Ideogram.PackshotsRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostPackshotsAsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Packshots
- /// Creates one polished product photograph from one or more ordered product
- /// references. An optional style reference may guide framing, crop,
- /// background, and lighting without changing the product's identity.
- /// The request is processed asynchronously. Poll
- /// `GET /v2/generations/{generation_id}` with the returned `generation_id`
- /// until the generation is completed or failed. Product fidelity is
- /// best-effort and details absent from every reference may be reconstructed. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostPackshotsAsResponseAsync( - - global::Ideogram.PackshotsRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostPackshotsArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostPackshotsSecurityRequirements, - operationName: "PostPackshotsAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/tool/packshots", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostPackshotsRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostPackshots", - methodName: "PostPackshotsAsync", - pathTemplate: "\"/v2/tool/packshots\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostPackshots", - methodName: "PostPackshotsAsync", - pathTemplate: "\"/v2/tool/packshots\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostPackshots", - methodName: "PostPackshotsAsync", - pathTemplate: "\"/v2/tool/packshots\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostPackshotsResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostPackshots", - methodName: "PostPackshotsAsync", - pathTemplate: "\"/v2/tool/packshots\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostPackshots", - methodName: "PostPackshotsAsync", - pathTemplate: "\"/v2/tool/packshots\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostPackshotsResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.PackshotsResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.PackshotsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Packshots
- /// Creates one polished product photograph from one or more ordered product
- /// references. An optional style reference may guide framing, crop,
- /// background, and lighting without changing the product's identity.
- /// The request is processed asynchronously. Poll
- /// `GET /v2/generations/{generation_id}` with the returned `generation_id`
- /// until the generation is completed or failed. Product fidelity is
- /// best-effort and details absent from every reference may be reconstructed. - ///
- /// - /// Ordered uploaded or generated product images. Their product color,
- /// construction, materials, logos, proportions, and distinguishing
- /// details guide every output. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// Product view to generate. - /// - /// - /// Optional art direction for the studio background, lighting,
- /// framing, and presentation. Product fidelity rules always take
- /// precedence. - /// - /// - /// Aspect ratio for every generated image. Supported values are
- /// `1:1`, `3:4`, `4:3`, `16:9`, and `9:16`. - /// - /// - /// The quality tier for the edit. Higher tiers may improve detail and
- /// take longer to complete. - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostPackshotsAsync( - global::System.Collections.Generic.IList productAssetIdentifiers, - global::Ideogram.PackshotView view, - global::Ideogram.AssetIdentifier? styleReferenceAssetIdentifier = default, - string? instruction = default, - string? aspectRatio = default, - global::Ideogram.PackshotsQuality? quality = default, - bool? @private = default, - string? webhookUrl = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.PackshotsRequest - { - ProductAssetIdentifiers = productAssetIdentifiers, - StyleReferenceAssetIdentifier = styleReferenceAssetIdentifier, - View = view, - Instruction = instruction, - AspectRatio = aspectRatio, - Quality = quality, - Private = @private, - WebhookUrl = webhookUrl, - }; - - return await PostPackshotsAsync( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostPreciseMaskedEdit.g.cs b/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostPreciseMaskedEdit.g.cs deleted file mode 100644 index 666d491c..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostPreciseMaskedEdit.g.cs +++ /dev/null @@ -1,930 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class EditWorkflowClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostPreciseMaskedEditSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostPreciseMaskedEditSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostPreciseMaskedEditSecurityRequirement0, - }; - partial void PreparePostPreciseMaskedEditArguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.PreciseMaskedEditRequest request); - partial void PreparePostPreciseMaskedEditRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.PreciseMaskedEditRequest request); - partial void ProcessPostPreciseMaskedEditResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostPreciseMaskedEditResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Edit an image, optionally using a mask
- /// Applies an instruction to an image. When a mask is supplied, it identifies
- /// the primary edit region. Without a mask, the model edits the full image.
- /// Optional reference images can guide the requested appearance. Set
- /// `preserve_unmasked_pixels` to keep decoded pixels outside a supplied mask
- /// unchanged in the final image.
- /// The request runs asynchronously. Poll
- /// `GET /v2/generations/{generation_id}` with the returned `generation_id`
- /// until the generation is completed or failed. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostPreciseMaskedEditAsync( - - global::Ideogram.PreciseMaskedEditRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostPreciseMaskedEditAsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Edit an image, optionally using a mask
- /// Applies an instruction to an image. When a mask is supplied, it identifies
- /// the primary edit region. Without a mask, the model edits the full image.
- /// Optional reference images can guide the requested appearance. Set
- /// `preserve_unmasked_pixels` to keep decoded pixels outside a supplied mask
- /// unchanged in the final image.
- /// The request runs asynchronously. Poll
- /// `GET /v2/generations/{generation_id}` with the returned `generation_id`
- /// until the generation is completed or failed. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostPreciseMaskedEditAsResponseAsync( - - global::Ideogram.PreciseMaskedEditRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostPreciseMaskedEditArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostPreciseMaskedEditSecurityRequirements, - operationName: "PostPreciseMaskedEditAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/workflow/precise-masked-edit", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (request.Model != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Model).HasValue ? (request.Model).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"model\""); - - } - if (request.Quality != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Quality).HasValue ? (request.Quality).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"quality\""); - - } - if (request.SourceAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.SourceAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"source_asset_identifier\""); - - } - if (request.SourceImage != default) - { - - var __contentSourceImage = new global::System.Net.Http.ByteArrayContent(request.SourceImage ?? global::System.Array.Empty()); - __contentSourceImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.SourceImagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.SourceImagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentSourceImage, - name: "\"source_image\"", - fileName: request.SourceImagename != null ? $"\"{request.SourceImagename}\"" : string.Empty); - if (__contentSourceImage.Headers.ContentDisposition != null) - { - __contentSourceImage.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.MaskAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.MaskAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"mask_asset_identifier\""); - - } - if (request.ReferenceAssetIdentifiers != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.ReferenceAssetIdentifiers!, x => x.ToJson(JsonSerializerContext)))}]"), - name: "\"reference_asset_identifiers\""); - - } - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Instruction ?? string.Empty), - name: "\"instruction\""); - - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.TargetCollectionId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.TargetCollectionId ?? string.Empty), - name: "\"target_collection_id\""); - - } - if (request.Private != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"private\""); - - } - if (request.PreserveUnmaskedPixels != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.PreserveUnmaskedPixels, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"preserve_unmasked_pixels\""); - - } - if (request.WebhookUrl != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), - name: "\"webhook_url\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostPreciseMaskedEditRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostPreciseMaskedEdit", - methodName: "PostPreciseMaskedEditAsync", - pathTemplate: "\"/v2/workflow/precise-masked-edit\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostPreciseMaskedEdit", - methodName: "PostPreciseMaskedEditAsync", - pathTemplate: "\"/v2/workflow/precise-masked-edit\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostPreciseMaskedEdit", - methodName: "PostPreciseMaskedEditAsync", - pathTemplate: "\"/v2/workflow/precise-masked-edit\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostPreciseMaskedEditResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostPreciseMaskedEdit", - methodName: "PostPreciseMaskedEditAsync", - pathTemplate: "\"/v2/workflow/precise-masked-edit\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostPreciseMaskedEdit", - methodName: "PostPreciseMaskedEditAsync", - pathTemplate: "\"/v2/workflow/precise-masked-edit\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostPreciseMaskedEditResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.PreciseMaskedEditResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.PreciseMaskedEditResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Edit an image, optionally using a mask
- /// Applies an instruction to an image. When a mask is supplied, it identifies
- /// the primary edit region. Without a mask, the model edits the full image.
- /// Optional reference images can guide the requested appearance. Set
- /// `preserve_unmasked_pixels` to keep decoded pixels outside a supplied mask
- /// unchanged in the final image.
- /// The request runs asynchronously. Poll
- /// `GET /v2/generations/{generation_id}` with the returned `generation_id`
- /// until the generation is completed or failed. - ///
- /// - /// The model used to apply the masked edit. - /// - /// - /// The generation quality level. Defaults to `high`.
- /// Default Value: high - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// Raw source image bytes. Supported formats and the 50 MB limit match the image upload API. Available only with `multipart/form-data`. - /// - /// - /// Raw source image bytes. Supported formats and the 50 MB limit match the image upload API. Available only with `multipart/form-data`. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// Optional assets that show the desired appearance of the edit. GPT Image 2 accepts up to 15. Ideogram 4.5 accepts up to 4 without a mask, or 3 when a mask is supplied. - /// - /// - /// Plain-language description of the desired change. - /// - /// - /// Optional seed for repeatable results. - /// - /// - /// Number of edited images to create.
- /// Default Value: 1 - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. Completed outputs are added to it automatically. - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// When true, decoded pixels outside the mask are copied from the
- /// source image into the final result. Requires `mask_asset_identifier`.
- /// When false, the final result is the model's full edited image.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostPreciseMaskedEditAsync( - string instruction, - global::Ideogram.PreciseMaskedEditModel? model = default, - global::Ideogram.PreciseMaskedEditQuality? quality = default, - global::Ideogram.AssetIdentifier? sourceAssetIdentifier = default, - byte[]? sourceImage = default, - string? sourceImagename = default, - global::Ideogram.AssetIdentifier? maskAssetIdentifier = default, - global::System.Collections.Generic.IList? referenceAssetIdentifiers = default, - int? seed = default, - int? numImages = default, - string? targetCollectionId = default, - bool? @private = default, - bool? preserveUnmaskedPixels = default, - string? webhookUrl = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.PreciseMaskedEditRequest - { - Model = model, - Quality = quality, - SourceAssetIdentifier = sourceAssetIdentifier, - SourceImage = sourceImage, - SourceImagename = sourceImagename, - MaskAssetIdentifier = maskAssetIdentifier, - ReferenceAssetIdentifiers = referenceAssetIdentifiers, - Instruction = instruction, - Seed = seed, - NumImages = numImages, - TargetCollectionId = targetCollectionId, - Private = @private, - PreserveUnmaskedPixels = preserveUnmaskedPixels, - WebhookUrl = webhookUrl, - }; - - return await PostPreciseMaskedEditAsync( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostSkechersStyleEdit.g.cs b/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostSkechersStyleEdit.g.cs deleted file mode 100644 index 1a13b232..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostSkechersStyleEdit.g.cs +++ /dev/null @@ -1,772 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class EditWorkflowClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostSkechersStyleEditSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostSkechersStyleEditSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostSkechersStyleEditSecurityRequirement0, - }; - partial void PreparePostSkechersStyleEditArguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.SkechersStyleEditRequest request); - partial void PreparePostSkechersStyleEditRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.SkechersStyleEditRequest request); - partial void ProcessPostSkechersStyleEditResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostSkechersStyleEditResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Edit a product image using an instruction and ordered references
- /// Edits the base image while preserving details the instruction does not
- /// change. Image 1 is the base; reference images are numbered from image 2
- /// in the supplied order. Resolve image mentions to these numbers before
- /// submitting. Descriptions identify the selected view or reference.
- /// Poll GET /v2/generations/{generation_id} with the returned generation_id
- /// until the workflow completes or fails. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostSkechersStyleEditAsync( - - global::Ideogram.SkechersStyleEditRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostSkechersStyleEditAsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Edit a product image using an instruction and ordered references
- /// Edits the base image while preserving details the instruction does not
- /// change. Image 1 is the base; reference images are numbered from image 2
- /// in the supplied order. Resolve image mentions to these numbers before
- /// submitting. Descriptions identify the selected view or reference.
- /// Poll GET /v2/generations/{generation_id} with the returned generation_id
- /// until the workflow completes or fails. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostSkechersStyleEditAsResponseAsync( - - global::Ideogram.SkechersStyleEditRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostSkechersStyleEditArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostSkechersStyleEditSecurityRequirements, - operationName: "PostSkechersStyleEditAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/tool/skechers-style-editor", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostSkechersStyleEditRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostSkechersStyleEdit", - methodName: "PostSkechersStyleEditAsync", - pathTemplate: "\"/v2/tool/skechers-style-editor\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostSkechersStyleEdit", - methodName: "PostSkechersStyleEditAsync", - pathTemplate: "\"/v2/tool/skechers-style-editor\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostSkechersStyleEdit", - methodName: "PostSkechersStyleEditAsync", - pathTemplate: "\"/v2/tool/skechers-style-editor\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostSkechersStyleEditResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostSkechersStyleEdit", - methodName: "PostSkechersStyleEditAsync", - pathTemplate: "\"/v2/tool/skechers-style-editor\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostSkechersStyleEdit", - methodName: "PostSkechersStyleEditAsync", - pathTemplate: "\"/v2/tool/skechers-style-editor\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostSkechersStyleEditResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.SkechersStyleEditResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.SkechersStyleEditResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Edit a product image using an instruction and ordered references
- /// Edits the base image while preserving details the instruction does not
- /// change. Image 1 is the base; reference images are numbered from image 2
- /// in the supplied order. Resolve image mentions to these numbers before
- /// submitting. Descriptions identify the selected view or reference.
- /// Poll GET /v2/generations/{generation_id} with the returned generation_id
- /// until the workflow completes or fails. - ///
- /// - /// Image to edit, used as image 1 and the output canvas. - /// - /// - /// Ordered reference images, numbered from image 2. - /// - /// - /// Edit instructions with known image mentions resolved to image numbers. - /// - /// - /// Optional description of the selected base image or named view. - /// - /// - /// One nonempty description per reference image, in the same order. - /// - /// - /// Output ratio. When omitted, derive the nearest supported ratio from the base. - /// - /// - /// Output resolution tier; corresponds to the app's low, medium, and high settings.
- /// Default Value: 2k - /// - /// - /// The quality tier for the edit. Higher tiers may improve detail and
- /// take longer to complete. - /// - /// - /// Number of edited images to create.
- /// Default Value: 1 - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostSkechersStyleEditAsync( - global::Ideogram.AssetIdentifier baseAssetIdentifier, - string resolvedInstruction, - global::System.Collections.Generic.IList? referenceAssetIdentifiers = default, - string? baseDescription = default, - global::System.Collections.Generic.IList? referenceDescriptions = default, - global::Ideogram.SkechersStyleEditRequestAspectRatio? aspectRatio = default, - global::Ideogram.SkechersStyleEditRequestBaseGenerationSize? baseGenerationSize = default, - global::Ideogram.SkechersStyleEditQuality? quality = default, - int? numImages = default, - bool? @private = default, - string? webhookUrl = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.SkechersStyleEditRequest - { - BaseAssetIdentifier = baseAssetIdentifier, - ReferenceAssetIdentifiers = referenceAssetIdentifiers, - ResolvedInstruction = resolvedInstruction, - BaseDescription = baseDescription, - ReferenceDescriptions = referenceDescriptions, - AspectRatio = aspectRatio, - BaseGenerationSize = baseGenerationSize, - Quality = quality, - NumImages = numImages, - Private = @private, - WebhookUrl = webhookUrl, - }; - - return await PostSkechersStyleEditAsync( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostSketchToRender.g.cs b/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostSketchToRender.g.cs deleted file mode 100644 index c1d86dde..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostSketchToRender.g.cs +++ /dev/null @@ -1,873 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class EditWorkflowClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostSketchToRenderSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostSketchToRenderSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostSketchToRenderSecurityRequirement0, - }; - partial void PreparePostSketchToRenderArguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.SketchToRenderRequest request); - partial void PreparePostSketchToRenderRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.SketchToRenderRequest request); - partial void ProcessPostSketchToRenderResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostSketchToRenderResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Sketch to Render
- /// Turns a fashion sketch into photorealistic garment or product imagery,
- /// preserving its silhouette, construction, colors, and design details.
- /// Upload the `sketch_image` using `multipart/form-data` and describe
- /// materials and rendering in `instruction`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
- /// supply a `webhook_url`. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostSketchToRenderAsync( - - global::Ideogram.SketchToRenderRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostSketchToRenderAsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Sketch to Render
- /// Turns a fashion sketch into photorealistic garment or product imagery,
- /// preserving its silhouette, construction, colors, and design details.
- /// Upload the `sketch_image` using `multipart/form-data` and describe
- /// materials and rendering in `instruction`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
- /// supply a `webhook_url`. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostSketchToRenderAsResponseAsync( - - global::Ideogram.SketchToRenderRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostSketchToRenderArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostSketchToRenderSecurityRequirements, - operationName: "PostSketchToRenderAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/tool/sketch-to-render", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (request.SketchAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.SketchAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"sketch_asset_identifier\""); - - } - if (request.SketchImage != default) - { - - var __contentSketchImage = new global::System.Net.Http.ByteArrayContent(request.SketchImage ?? global::System.Array.Empty()); - __contentSketchImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.SketchImagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.SketchImagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentSketchImage, - name: "\"sketch_image\"", - fileName: request.SketchImagename != null ? $"\"{request.SketchImagename}\"" : string.Empty); - if (__contentSketchImage.Headers.ContentDisposition != null) - { - __contentSketchImage.Headers.ContentDisposition.FileNameStar = null; - } - - } - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Instruction ?? string.Empty), - name: "\"instruction\""); - - if (request.AspectRatio != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.AspectRatio ?? string.Empty), - name: "\"aspect_ratio\""); - - } - if (request.Quality != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Quality).HasValue ? (request.Quality).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"quality\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.Private != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"private\""); - - } - if (request.WebhookUrl != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), - name: "\"webhook_url\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostSketchToRenderRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostSketchToRender", - methodName: "PostSketchToRenderAsync", - pathTemplate: "\"/v2/tool/sketch-to-render\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostSketchToRender", - methodName: "PostSketchToRenderAsync", - pathTemplate: "\"/v2/tool/sketch-to-render\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostSketchToRender", - methodName: "PostSketchToRenderAsync", - pathTemplate: "\"/v2/tool/sketch-to-render\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostSketchToRenderResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostSketchToRender", - methodName: "PostSketchToRenderAsync", - pathTemplate: "\"/v2/tool/sketch-to-render\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostSketchToRender", - methodName: "PostSketchToRenderAsync", - pathTemplate: "\"/v2/tool/sketch-to-render\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostSketchToRenderResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.SketchToRenderResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.SketchToRenderResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Sketch to Render
- /// Turns a fashion sketch into photorealistic garment or product imagery,
- /// preserving its silhouette, construction, colors, and design details.
- /// Upload the `sketch_image` using `multipart/form-data` and describe
- /// materials and rendering in `instruction`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
- /// supply a `webhook_url`. - ///
- /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The fashion sketch to render, up to 50 MB. JPEG, PNG, WEBP, HEIF,
- /// AVIF, GIF, BMP, TIFF, and MPO are supported. Multipart requests
- /// only. - /// - /// - /// The fashion sketch to render, up to 50 MB. JPEG, PNG, WEBP, HEIF,
- /// AVIF, GIF, BMP, TIFF, and MPO are supported. Multipart requests
- /// only. - /// - /// - /// Material and rendering direction, plus any construction or design
- /// details that are not legible in the sketch. - /// - /// - /// Aspect ratio of each output image. Defaults to `1:1` when omitted. - /// - /// - /// The quality tier for the edit. Higher tiers may improve detail and
- /// take longer to complete. - /// - /// - /// Optional seed for repeatable results. - /// - /// - /// Number of product renders to create.
- /// Default Value: 1 - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostSketchToRenderAsync( - string instruction, - global::Ideogram.AssetIdentifier? sketchAssetIdentifier = default, - byte[]? sketchImage = default, - string? sketchImagename = default, - string? aspectRatio = default, - global::Ideogram.SketchToRenderQuality? quality = default, - int? seed = default, - int? numImages = default, - bool? @private = default, - string? webhookUrl = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.SketchToRenderRequest - { - SketchAssetIdentifier = sketchAssetIdentifier, - SketchImage = sketchImage, - SketchImagename = sketchImagename, - Instruction = instruction, - AspectRatio = aspectRatio, - Quality = quality, - Seed = seed, - NumImages = numImages, - Private = @private, - WebhookUrl = webhookUrl, - }; - - return await PostSketchToRenderAsync( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostSoleSwap.g.cs b/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostSoleSwap.g.cs deleted file mode 100644 index ef37d52c..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostSoleSwap.g.cs +++ /dev/null @@ -1,766 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class EditWorkflowClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostSoleSwapSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostSoleSwapSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostSoleSwapSecurityRequirement0, - }; - partial void PreparePostSoleSwapArguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.SoleSwapRequest request); - partial void PreparePostSoleSwapRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.SoleSwapRequest request); - partial void ProcessPostSoleSwapResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostSoleSwapResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Sole Swap
- /// Uses the sole-donor shoe as the output canvas, preserving its sole, camera,
- /// background, and lighting while transferring the upper from ordered references.
- /// The request is processed asynchronously. Poll
- /// `GET /v2/generations/{generation_id}` with the returned
- /// `generation_id` until the generation is completed or failed. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostSoleSwapAsync( - - global::Ideogram.SoleSwapRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostSoleSwapAsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Sole Swap
- /// Uses the sole-donor shoe as the output canvas, preserving its sole, camera,
- /// background, and lighting while transferring the upper from ordered references.
- /// The request is processed asynchronously. Poll
- /// `GET /v2/generations/{generation_id}` with the returned
- /// `generation_id` until the generation is completed or failed. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostSoleSwapAsResponseAsync( - - global::Ideogram.SoleSwapRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostSoleSwapArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostSoleSwapSecurityRequirements, - operationName: "PostSoleSwapAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/tool/sole-swap", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostSoleSwapRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostSoleSwap", - methodName: "PostSoleSwapAsync", - pathTemplate: "\"/v2/tool/sole-swap\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostSoleSwap", - methodName: "PostSoleSwapAsync", - pathTemplate: "\"/v2/tool/sole-swap\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostSoleSwap", - methodName: "PostSoleSwapAsync", - pathTemplate: "\"/v2/tool/sole-swap\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostSoleSwapResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostSoleSwap", - methodName: "PostSoleSwapAsync", - pathTemplate: "\"/v2/tool/sole-swap\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostSoleSwap", - methodName: "PostSoleSwapAsync", - pathTemplate: "\"/v2/tool/sole-swap\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostSoleSwapResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.SoleSwapResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.SoleSwapResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Sole Swap
- /// Uses the sole-donor shoe as the output canvas, preserving its sole, camera,
- /// background, and lighting while transferring the upper from ordered references.
- /// The request is processed asynchronously. Poll
- /// `GET /v2/generations/{generation_id}` with the returned
- /// `generation_id` until the generation is completed or failed. - ///
- /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// Ordered upper-donor references. Put the primary upper view first, then additional angles of the same upper to transfer. - /// - /// - /// Optional additional direction for the sole swap. - /// - /// - /// Output aspect ratio. When omitted, the closest supported ratio is derived from the sole-donor base image. - /// - /// - /// Output resolution tier. Defaults to 2k.
- /// Default Value: 2k - /// - /// - /// The quality tier for the edit. Higher tiers may improve detail and
- /// take longer to complete. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// Number of sole-swap images to create.
- /// Default Value: 1 - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostSoleSwapAsync( - global::Ideogram.AssetIdentifier baseAssetIdentifier, - global::System.Collections.Generic.IList upperAssetIdentifiers, - string? instruction = default, - string? aspectRatio = default, - global::Ideogram.SoleSwapRequestBaseGenerationSize? baseGenerationSize = default, - global::Ideogram.SoleSwapQuality? quality = default, - int? seed = default, - int? numImages = default, - bool? @private = default, - string? webhookUrl = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.SoleSwapRequest - { - BaseAssetIdentifier = baseAssetIdentifier, - UpperAssetIdentifiers = upperAssetIdentifiers, - Instruction = instruction, - AspectRatio = aspectRatio, - BaseGenerationSize = baseGenerationSize, - Quality = quality, - Seed = seed, - NumImages = numImages, - Private = @private, - WebhookUrl = webhookUrl, - }; - - return await PostSoleSwapAsync( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostSwanSLogoDesign.g.cs b/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostSwanSLogoDesign.g.cs deleted file mode 100644 index 655f8bba..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostSwanSLogoDesign.g.cs +++ /dev/null @@ -1,720 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class EditWorkflowClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostSwanSLogoDesignSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostSwanSLogoDesignSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostSwanSLogoDesignSecurityRequirement0, - }; - partial void PreparePostSwanSLogoDesignArguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.SwanSLogoDesignRequest request); - partial void PreparePostSwanSLogoDesignRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.SwanSLogoDesignRequest request); - partial void ProcessPostSwanSLogoDesignResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostSwanSLogoDesignResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Design one Swan S logo candidate
- /// Creates one isolated logo candidate using either a shoe swatch or a supplied style reference. For 3D reference designs, choose split or full coverage with design_variant. Send a separate request for each candidate; each request completes and is billed independently. Processing is asynchronous. Poll GET /v2/generations/{generation_id} until completed or failed. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostSwanSLogoDesignAsync( - - global::Ideogram.SwanSLogoDesignRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostSwanSLogoDesignAsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Design one Swan S logo candidate
- /// Creates one isolated logo candidate using either a shoe swatch or a supplied style reference. For 3D reference designs, choose split or full coverage with design_variant. Send a separate request for each candidate; each request completes and is billed independently. Processing is asynchronous. Poll GET /v2/generations/{generation_id} until completed or failed. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostSwanSLogoDesignAsResponseAsync( - - global::Ideogram.SwanSLogoDesignRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostSwanSLogoDesignArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostSwanSLogoDesignSecurityRequirements, - operationName: "PostSwanSLogoDesignAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/tool/swan-s-logo-design", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostSwanSLogoDesignRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostSwanSLogoDesign", - methodName: "PostSwanSLogoDesignAsync", - pathTemplate: "\"/v2/tool/swan-s-logo-design\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostSwanSLogoDesign", - methodName: "PostSwanSLogoDesignAsync", - pathTemplate: "\"/v2/tool/swan-s-logo-design\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostSwanSLogoDesign", - methodName: "PostSwanSLogoDesignAsync", - pathTemplate: "\"/v2/tool/swan-s-logo-design\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostSwanSLogoDesignResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostSwanSLogoDesign", - methodName: "PostSwanSLogoDesignAsync", - pathTemplate: "\"/v2/tool/swan-s-logo-design\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostSwanSLogoDesign", - methodName: "PostSwanSLogoDesignAsync", - pathTemplate: "\"/v2/tool/swan-s-logo-design\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostSwanSLogoDesignResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.SwanSLogoDesignResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.SwanSLogoDesignResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Design one Swan S logo candidate
- /// Creates one isolated logo candidate using either a shoe swatch or a supplied style reference. For 3D reference designs, choose split or full coverage with design_variant. Send a separate request for each candidate; each request completes and is billed independently. Processing is asynchronous. Poll GET /v2/generations/{generation_id} until completed or failed. - ///
- /// - /// - /// Use a shoe color swatch or an uploaded logo reference as the style source. - /// - /// - /// Required for 3D user_reference designs. Omit for other designs. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The quality tier for the edit. Higher tiers may improve detail and
- /// take longer to complete. - /// - /// - /// When true or omitted, keep outputs private. Enterprise accounts always generate privately. - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostSwanSLogoDesignAsync( - global::Ideogram.SwanSLogoDesignRequestLogoStyle logoStyle, - global::Ideogram.SwanSLogoDesignRequestSourceMode sourceMode, - global::Ideogram.AssetIdentifier styleSourceAssetIdentifier, - global::Ideogram.SwanSLogoDesignRequestDesignVariant? designVariant = default, - global::Ideogram.AssetIdentifier? geometryHeroAssetIdentifier = default, - global::Ideogram.AssetIdentifier? logoSpecificationAssetIdentifier = default, - global::Ideogram.AssetIdentifier? flatSilhouetteAssetIdentifier = default, - global::Ideogram.SwanSLogoQuality? quality = default, - bool? @private = default, - string? webhookUrl = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.SwanSLogoDesignRequest - { - LogoStyle = logoStyle, - SourceMode = sourceMode, - DesignVariant = designVariant, - StyleSourceAssetIdentifier = styleSourceAssetIdentifier, - GeometryHeroAssetIdentifier = geometryHeroAssetIdentifier, - LogoSpecificationAssetIdentifier = logoSpecificationAssetIdentifier, - FlatSilhouetteAssetIdentifier = flatSilhouetteAssetIdentifier, - Quality = quality, - Private = @private, - WebhookUrl = webhookUrl, - }; - - return await PostSwanSLogoDesignAsync( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostSwanSLogoInstall.g.cs b/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostSwanSLogoInstall.g.cs deleted file mode 100644 index adc058fc..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostSwanSLogoInstall.g.cs +++ /dev/null @@ -1,712 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class EditWorkflowClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostSwanSLogoInstallSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostSwanSLogoInstallSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostSwanSLogoInstallSecurityRequirement0, - }; - partial void PreparePostSwanSLogoInstallArguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.SwanSLogoInstallRequest request); - partial void PreparePostSwanSLogoInstallRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.SwanSLogoInstallRequest request); - partial void ProcessPostSwanSLogoInstallResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostSwanSLogoInstallResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Install a Swan S logo on a shoe
- /// Installs the selected logo onto the ordered shoe views, preserving the shoe and chosen camera framing. Processing is asynchronous. Poll GET /v2/generations/{generation_id} until completed or failed. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostSwanSLogoInstallAsync( - - global::Ideogram.SwanSLogoInstallRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostSwanSLogoInstallAsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Install a Swan S logo on a shoe
- /// Installs the selected logo onto the ordered shoe views, preserving the shoe and chosen camera framing. Processing is asynchronous. Poll GET /v2/generations/{generation_id} until completed or failed. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostSwanSLogoInstallAsResponseAsync( - - global::Ideogram.SwanSLogoInstallRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostSwanSLogoInstallArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostSwanSLogoInstallSecurityRequirements, - operationName: "PostSwanSLogoInstallAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/tool/swan-s-logo-install", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostSwanSLogoInstallRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostSwanSLogoInstall", - methodName: "PostSwanSLogoInstallAsync", - pathTemplate: "\"/v2/tool/swan-s-logo-install\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostSwanSLogoInstall", - methodName: "PostSwanSLogoInstallAsync", - pathTemplate: "\"/v2/tool/swan-s-logo-install\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostSwanSLogoInstall", - methodName: "PostSwanSLogoInstallAsync", - pathTemplate: "\"/v2/tool/swan-s-logo-install\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostSwanSLogoInstallResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostSwanSLogoInstall", - methodName: "PostSwanSLogoInstallAsync", - pathTemplate: "\"/v2/tool/swan-s-logo-install\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostSwanSLogoInstall", - methodName: "PostSwanSLogoInstallAsync", - pathTemplate: "\"/v2/tool/swan-s-logo-install\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostSwanSLogoInstallResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.SwanSLogoInstallResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.SwanSLogoInstallResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Install a Swan S logo on a shoe
- /// Installs the selected logo onto the ordered shoe views, preserving the shoe and chosen camera framing. Processing is asynchronous. Poll GET /v2/generations/{generation_id} until completed or failed. - ///
- /// - /// - /// Ordered shoe views, primary view first. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// - /// Number of images to create.
- /// Default Value: 4 - /// - /// - /// The quality tier for the edit. Higher tiers may improve detail and
- /// take longer to complete. - /// - /// - /// When true or omitted, keep outputs private. Enterprise accounts always generate privately. - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostSwanSLogoInstallAsync( - global::Ideogram.SwanSLogoInstallRequestLogoStyle logoStyle, - global::System.Collections.Generic.IList shoeAssetIdentifiers, - global::Ideogram.AssetIdentifier logoAssetIdentifier, - string aspectRatio, - global::Ideogram.AssetIdentifier? logoSpecificationAssetIdentifier = default, - int? numImages = default, - global::Ideogram.SwanSLogoQuality? quality = default, - bool? @private = default, - string? webhookUrl = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.SwanSLogoInstallRequest - { - LogoStyle = logoStyle, - ShoeAssetIdentifiers = shoeAssetIdentifiers, - LogoAssetIdentifier = logoAssetIdentifier, - LogoSpecificationAssetIdentifier = logoSpecificationAssetIdentifier, - AspectRatio = aspectRatio, - NumImages = numImages, - Quality = quality, - Private = @private, - WebhookUrl = webhookUrl, - }; - - return await PostSwanSLogoInstallAsync( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostSwapProduct.g.cs b/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostSwapProduct.g.cs deleted file mode 100644 index 35dd8695..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostSwapProduct.g.cs +++ /dev/null @@ -1,751 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class EditWorkflowClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostSwapProductSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostSwapProductSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostSwapProductSecurityRequirement0, - }; - partial void PreparePostSwapProductArguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.SwapProductRequest request); - partial void PreparePostSwapProductRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.SwapProductRequest request); - partial void ProcessPostSwapProductResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostSwapProductResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Swap Product
- /// Edits the footwear in a source advertisement using ordered product references.
- /// Poll `GET /v2/generations/{generation_id}` for status and image results. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostSwapProductAsync( - - global::Ideogram.SwapProductRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostSwapProductAsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Swap Product
- /// Edits the footwear in a source advertisement using ordered product references.
- /// Poll `GET /v2/generations/{generation_id}` for status and image results. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostSwapProductAsResponseAsync( - - global::Ideogram.SwapProductRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostSwapProductArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostSwapProductSecurityRequirements, - operationName: "PostSwapProductAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/tool/swap-product", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostSwapProductRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostSwapProduct", - methodName: "PostSwapProductAsync", - pathTemplate: "\"/v2/tool/swap-product\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostSwapProduct", - methodName: "PostSwapProductAsync", - pathTemplate: "\"/v2/tool/swap-product\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostSwapProduct", - methodName: "PostSwapProductAsync", - pathTemplate: "\"/v2/tool/swap-product\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostSwapProductResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostSwapProduct", - methodName: "PostSwapProductAsync", - pathTemplate: "\"/v2/tool/swap-product\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostSwapProduct", - methodName: "PostSwapProductAsync", - pathTemplate: "\"/v2/tool/swap-product\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostSwapProductResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.SwapProductResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.SwapProductResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Swap Product
- /// Edits the footwear in a source advertisement using ordered product references.
- /// Poll `GET /v2/generations/{generation_id}` for status and image results. - ///
- /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// Ordered footwear references, following the source advertisement. - /// - /// - /// Replace the footwear or match its colorway to the references. - /// - /// - /// Optional edits that take precedence over the default preservation guidance. - /// - /// - /// Output aspect ratio. Defaults to the closest supported ratio to the source. - /// - /// - /// Number of images to generate.
- /// Default Value: 1 - /// - /// - /// The quality tier for the edit. Higher tiers may improve detail and
- /// take longer to complete. - /// - /// - /// Results are private by default. Set false to request public results.
- /// Enterprise accounts always generate privately. - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostSwapProductAsync( - global::Ideogram.AssetIdentifier sourceAssetIdentifier, - global::System.Collections.Generic.IList productAssetIdentifiers, - global::Ideogram.SwapProductMode mode, - string? instruction = default, - string? aspectRatio = default, - int? numImages = default, - global::Ideogram.SwapProductQuality? quality = default, - bool? @private = default, - string? webhookUrl = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.SwapProductRequest - { - SourceAssetIdentifier = sourceAssetIdentifier, - ProductAssetIdentifiers = productAssetIdentifiers, - Mode = mode, - Instruction = instruction, - AspectRatio = aspectRatio, - NumImages = numImages, - Quality = quality, - Private = @private, - WebhookUrl = webhookUrl, - }; - - return await PostSwapProductAsync( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostTextLayerizer.g.cs b/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostTextLayerizer.g.cs deleted file mode 100644 index 859aa6bc..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostTextLayerizer.g.cs +++ /dev/null @@ -1,886 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class EditWorkflowClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostTextLayerizerSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostTextLayerizerSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostTextLayerizerSecurityRequirement0, - }; - partial void PreparePostTextLayerizerArguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? dryRun, - global::Ideogram.TextLayerizerRequest request); - partial void PreparePostTextLayerizerRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? dryRun, - global::Ideogram.TextLayerizerRequest request); - partial void ProcessPostTextLayerizerResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostTextLayerizerResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Text Layerizer
- /// Turns a flat image into an editable design asynchronously: detected text
- /// is returned as positioned text blocks with matched fonts, sizes, and
- /// colors, alongside a text-free base image and a standalone HTML page of
- /// the editable design. Returns a `generation_id`; poll
- /// `GET /v2/generations/{generation_id}` or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostTextLayerizerAsync( - - global::Ideogram.TextLayerizerRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostTextLayerizerAsResponseAsync( - - request: request, - dryRun: dryRun, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Text Layerizer
- /// Turns a flat image into an editable design asynchronously: detected text
- /// is returned as positioned text blocks with matched fonts, sizes, and
- /// colors, alongside a text-free base image and a standalone HTML page of
- /// the editable design. Returns a `generation_id`; poll
- /// `GET /v2/generations/{generation_id}` or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostTextLayerizerAsResponseAsync( - - global::Ideogram.TextLayerizerRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostTextLayerizerArguments( - httpClient: HttpClient, - dryRun: ref dryRun, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostTextLayerizerSecurityRequirements, - operationName: "PostTextLayerizerAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/tool/text-layerizer", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (request.Image != default) - { - - var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.ImageAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ImageAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"image_asset_identifier\""); - - } - if (request.Prompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.FontCandidateFiles != default) - { - - for (var __iFontCandidateFiles = 0; __iFontCandidateFiles < request.FontCandidateFiles.Count; __iFontCandidateFiles++) - { - var __contentFontCandidateFiles = new global::System.Net.Http.ByteArrayContent(request.FontCandidateFiles[__iFontCandidateFiles]); - __contentFontCandidateFiles.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); - __httpRequestContent.Add( - content: __contentFontCandidateFiles, - name: "\"font_candidate_files\"", - fileName: $"\"file{__iFontCandidateFiles}.bin\""); - if (__contentFontCandidateFiles.Headers.ContentDisposition != null) - { - __contentFontCandidateFiles.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - if (request.Private != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"private\""); - - } - if (request.TargetCollectionId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.TargetCollectionId ?? string.Empty), - name: "\"target_collection_id\""); - - } - if (request.WebhookUrl != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), - name: "\"webhook_url\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostTextLayerizerRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - dryRun: dryRun, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostTextLayerizer", - methodName: "PostTextLayerizerAsync", - pathTemplate: "\"/v2/tool/text-layerizer\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostTextLayerizer", - methodName: "PostTextLayerizerAsync", - pathTemplate: "\"/v2/tool/text-layerizer\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostTextLayerizer", - methodName: "PostTextLayerizerAsync", - pathTemplate: "\"/v2/tool/text-layerizer\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostTextLayerizerResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostTextLayerizer", - methodName: "PostTextLayerizerAsync", - pathTemplate: "\"/v2/tool/text-layerizer\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostTextLayerizer", - methodName: "PostTextLayerizerAsync", - pathTemplate: "\"/v2/tool/text-layerizer\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostTextLayerizerResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.TextLayerizerResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.TextLayerizerResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Text Layerizer
- /// Turns a flat image into an editable design asynchronously: detected text
- /// is returned as positioned text blocks with matched fonts, sizes, and
- /// colors, alongside a text-free base image and a standalone HTML page of
- /// the editable design. Returns a `generation_id`; poll
- /// `GET /v2/generations/{generation_id}` or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// JPEG, PNG or WEBP source; at most 50 MB. Multipart only. - /// - /// - /// JPEG, PNG or WEBP source; at most 50 MB. Multipart only. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// A description of the image, used to guide text detection. When omitted, detection runs on the image alone. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// Candidate font files to make available for text style matching and to embed in the standalone HTML page. Supported formats .ttf, .otf, .woff, .woff2 (max 5 MB each, at most 5 files). Multipart only. You are responsible for holding the rights to embed and redistribute the fonts you upload. - /// - /// - /// Outputs are private by default. Enterprise outputs are always private. - /// - /// - /// URL-safe base64 ID of a writable destination collection. - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostTextLayerizerAsync( - bool? dryRun = default, - byte[]? image = default, - string? imagename = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - string? prompt = default, - int? seed = default, - global::System.Collections.Generic.IList? fontCandidateFiles = default, - bool? @private = default, - string? targetCollectionId = default, - string? webhookUrl = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.TextLayerizerRequest - { - Image = image, - Imagename = imagename, - ImageAssetIdentifier = imageAssetIdentifier, - Prompt = prompt, - Seed = seed, - FontCandidateFiles = fontCandidateFiles, - Private = @private, - TargetCollectionId = targetCollectionId, - WebhookUrl = webhookUrl, - }; - - return await PostTextLayerizerAsync( - dryRun: dryRun, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostVectorizer.g.cs b/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostVectorizer.g.cs deleted file mode 100644 index c13789f6..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostVectorizer.g.cs +++ /dev/null @@ -1,852 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class EditWorkflowClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostVectorizerSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostVectorizerSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostVectorizerSecurityRequirement0, - }; - partial void PreparePostVectorizerArguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? dryRun, - global::Ideogram.VectorizerRequest request); - partial void PreparePostVectorizerRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? dryRun, - global::Ideogram.VectorizerRequest request); - partial void ProcessPostVectorizerResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostVectorizerResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Vectorizer
- /// Converts an image to SVG asynchronously. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostVectorizerAsync( - - global::Ideogram.VectorizerRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostVectorizerAsResponseAsync( - - request: request, - dryRun: dryRun, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Vectorizer
- /// Converts an image to SVG asynchronously. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostVectorizerAsResponseAsync( - - global::Ideogram.VectorizerRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostVectorizerArguments( - httpClient: HttpClient, - dryRun: ref dryRun, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostVectorizerSecurityRequirements, - operationName: "PostVectorizerAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/tool/vectorizer", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (request.Image != default) - { - - var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.ImageAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ImageAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"image_asset_identifier\""); - - } - if (request.Mode != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Mode).HasValue ? (request.Mode).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"mode\""); - - } - if (request.Group != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Group, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"group\""); - - } - if (request.Private != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"private\""); - - } - if (request.TargetCollectionId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.TargetCollectionId ?? string.Empty), - name: "\"target_collection_id\""); - - } - if (request.WebhookUrl != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), - name: "\"webhook_url\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostVectorizerRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - dryRun: dryRun, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostVectorizer", - methodName: "PostVectorizerAsync", - pathTemplate: "\"/v2/tool/vectorizer\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostVectorizer", - methodName: "PostVectorizerAsync", - pathTemplate: "\"/v2/tool/vectorizer\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostVectorizer", - methodName: "PostVectorizerAsync", - pathTemplate: "\"/v2/tool/vectorizer\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostVectorizerResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostVectorizer", - methodName: "PostVectorizerAsync", - pathTemplate: "\"/v2/tool/vectorizer\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostVectorizer", - methodName: "PostVectorizerAsync", - pathTemplate: "\"/v2/tool/vectorizer\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostVectorizerResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.VectorizerResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.VectorizerResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Vectorizer
- /// Converts an image to SVG asynchronously. - ///
- /// - /// Default Value: false - /// - /// - /// JPEG, PNG or WEBP source; at most 50 MB. Multipart only. - /// - /// - /// JPEG, PNG or WEBP source; at most 50 MB. Multipart only. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// Default draws fewer, simpler shapes; detailed preserves more fine detail.
- /// Default Value: default - /// - /// - /// Request grouping of shapes into layers. Grouping is not yet available.
- /// Default Value: false - /// - /// - /// Outputs are private by default. Enterprise outputs are always private. - /// - /// - /// URL-safe base64 ID of a writable destination collection. - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostVectorizerAsync( - bool? dryRun = default, - byte[]? image = default, - string? imagename = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - global::Ideogram.VectorizerRequestMode? mode = default, - bool? group = default, - bool? @private = default, - string? targetCollectionId = default, - string? webhookUrl = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.VectorizerRequest - { - Image = image, - Imagename = imagename, - ImageAssetIdentifier = imageAssetIdentifier, - Mode = mode, - Group = group, - Private = @private, - TargetCollectionId = targetCollectionId, - WebhookUrl = webhookUrl, - }; - - return await PostVectorizerAsync( - dryRun: dryRun, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostVirtualTryOn.g.cs b/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostVirtualTryOn.g.cs deleted file mode 100644 index 83d07d19..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.PostVirtualTryOn.g.cs +++ /dev/null @@ -1,836 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class EditWorkflowClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostVirtualTryOnSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostVirtualTryOnSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostVirtualTryOnSecurityRequirement0, - }; - partial void PreparePostVirtualTryOnArguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.VirtualTryOnRequest request); - partial void PreparePostVirtualTryOnRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.VirtualTryOnRequest request); - partial void ProcessPostVirtualTryOnResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostVirtualTryOnResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Dress a person in one or more garments
- /// Generates a photorealistic image of the person in the supplied photo
- /// wearing the supplied garments, preserving their face, body, and
- /// background.
- /// The request is processed asynchronously. Poll
- /// `GET /v2/generations/{generation_id}` with the returned `generation_id`
- /// until the generation is completed or failed.
- /// Supply the person as either an `AssetIdentifier` reference
- /// (`person_asset_identifier`) or the raw image bytes directly
- /// (`person_image`, multipart requests only), and likewise the garments as
- /// either `garment_asset_identifiers` or `garment_images`. For each of the
- /// two sources, provide exactly one of the two forms; supplying both, or
- /// neither, is rejected with a 400. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostVirtualTryOnAsync( - - global::Ideogram.VirtualTryOnRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostVirtualTryOnAsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Dress a person in one or more garments
- /// Generates a photorealistic image of the person in the supplied photo
- /// wearing the supplied garments, preserving their face, body, and
- /// background.
- /// The request is processed asynchronously. Poll
- /// `GET /v2/generations/{generation_id}` with the returned `generation_id`
- /// until the generation is completed or failed.
- /// Supply the person as either an `AssetIdentifier` reference
- /// (`person_asset_identifier`) or the raw image bytes directly
- /// (`person_image`, multipart requests only), and likewise the garments as
- /// either `garment_asset_identifiers` or `garment_images`. For each of the
- /// two sources, provide exactly one of the two forms; supplying both, or
- /// neither, is rejected with a 400. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostVirtualTryOnAsResponseAsync( - - global::Ideogram.VirtualTryOnRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostVirtualTryOnArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostVirtualTryOnSecurityRequirements, - operationName: "PostVirtualTryOnAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/workflow/virtual-try-on", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (request.PersonAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.PersonAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"person_asset_identifier\""); - - } - if (request.PersonImage != default) - { - - var __contentPersonImage = new global::System.Net.Http.ByteArrayContent(request.PersonImage ?? global::System.Array.Empty()); - __contentPersonImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.PersonImagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.PersonImagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentPersonImage, - name: "\"person_image\"", - fileName: request.PersonImagename != null ? $"\"{request.PersonImagename}\"" : string.Empty); - if (__contentPersonImage.Headers.ContentDisposition != null) - { - __contentPersonImage.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.GarmentAssetIdentifiers != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.GarmentAssetIdentifiers!, x => x.ToJson(JsonSerializerContext)))}]"), - name: "\"garment_asset_identifiers\""); - - } - if (request.GarmentImages != default) - { - - for (var __iGarmentImages = 0; __iGarmentImages < request.GarmentImages.Count; __iGarmentImages++) - { - var __contentGarmentImages = new global::System.Net.Http.ByteArrayContent(request.GarmentImages[__iGarmentImages]); - __contentGarmentImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); - __httpRequestContent.Add( - content: __contentGarmentImages, - name: "\"garment_images\"", - fileName: $"\"file{__iGarmentImages}.bin\""); - if (__contentGarmentImages.Headers.ContentDisposition != null) - { - __contentGarmentImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - if (request.AspectRatio != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.AspectRatio ?? string.Empty), - name: "\"aspect_ratio\""); - - } - if (request.Instruction != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Instruction ?? string.Empty), - name: "\"instruction\""); - - } - if (request.Private != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"private\""); - - } - if (request.WebhookUrl != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), - name: "\"webhook_url\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostVirtualTryOnRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostVirtualTryOn", - methodName: "PostVirtualTryOnAsync", - pathTemplate: "\"/v2/workflow/virtual-try-on\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostVirtualTryOn", - methodName: "PostVirtualTryOnAsync", - pathTemplate: "\"/v2/workflow/virtual-try-on\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostVirtualTryOn", - methodName: "PostVirtualTryOnAsync", - pathTemplate: "\"/v2/workflow/virtual-try-on\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostVirtualTryOnResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostVirtualTryOn", - methodName: "PostVirtualTryOnAsync", - pathTemplate: "\"/v2/workflow/virtual-try-on\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostVirtualTryOn", - methodName: "PostVirtualTryOnAsync", - pathTemplate: "\"/v2/workflow/virtual-try-on\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostVirtualTryOnResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.VirtualTryOnResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.VirtualTryOnResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Dress a person in one or more garments
- /// Generates a photorealistic image of the person in the supplied photo
- /// wearing the supplied garments, preserving their face, body, and
- /// background.
- /// The request is processed asynchronously. Poll
- /// `GET /v2/generations/{generation_id}` with the returned `generation_id`
- /// until the generation is completed or failed.
- /// Supply the person as either an `AssetIdentifier` reference
- /// (`person_asset_identifier`) or the raw image bytes directly
- /// (`person_image`, multipart requests only), and likewise the garments as
- /// either `garment_asset_identifiers` or `garment_images`. For each of the
- /// two sources, provide exactly one of the two forms; supplying both, or
- /// neither, is rejected with a 400. - ///
- /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// Photo of the person to dress (max size 25MB), as raw bytes; only
- /// JPEG, PNG, and WEBP formats are supported. Multipart requests only.
- /// Provide exactly one of `person_asset_identifier` or `person_image`. - /// - /// - /// Photo of the person to dress (max size 25MB), as raw bytes; only
- /// JPEG, PNG, and WEBP formats are supported. Multipart requests only.
- /// Provide exactly one of `person_asset_identifier` or `person_image`. - /// - /// - /// Photos of the clothing items to put on the person, by reference.
- /// Multiple garments are layered into one coherent outfit. Provide
- /// exactly one of `garment_asset_identifiers` or `garment_images`. - /// - /// - /// Photos of the clothing items to put on the person (max 7, max size
- /// 25MB per image), as raw bytes; only JPEG, PNG, and WEBP formats are
- /// supported. Multipart requests only. Provide exactly one of
- /// `garment_asset_identifiers` or `garment_images`. - /// - /// - /// The aspect ratio of the generated image. Defaults to the aspect
- /// ratio of the person's photo when omitted. Supported values are
- /// `1:1`, `3:4`, `4:3`, `16:9`, and `9:16`. - /// - /// - /// Free-text art direction, for example which garments to name, how to
- /// pose the person, and what background to place them in. The person's
- /// identity and each garment's exact appearance are always preserved,
- /// whatever this says. When omitted, the person keeps the pose and
- /// background from their photo. - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostVirtualTryOnAsync( - global::Ideogram.AssetIdentifier? personAssetIdentifier = default, - byte[]? personImage = default, - string? personImagename = default, - global::System.Collections.Generic.IList? garmentAssetIdentifiers = default, - global::System.Collections.Generic.IList? garmentImages = default, - string? aspectRatio = default, - string? instruction = default, - bool? @private = default, - string? webhookUrl = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.VirtualTryOnRequest - { - PersonAssetIdentifier = personAssetIdentifier, - PersonImage = personImage, - PersonImagename = personImagename, - GarmentAssetIdentifiers = garmentAssetIdentifiers, - GarmentImages = garmentImages, - AspectRatio = aspectRatio, - Instruction = instruction, - Private = @private, - WebhookUrl = webhookUrl, - }; - - return await PostVirtualTryOnAsync( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.g.cs b/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.g.cs index 3f2f2c65..adf0a769 100644 --- a/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.EditWorkflowClient.g.cs @@ -4,7 +4,6 @@ namespace Ideogram { /// - /// Asynchronous image-editing workflows that return results through generation polling.
/// If no httpClient is provided, a new one will be created.
/// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. ///
diff --git a/src/libs/Ideogram/Generated/Ideogram.Generate.JsonSerializerContext.g.cs b/src/libs/Ideogram/Generated/Ideogram.Generate.JsonSerializerContext.g.cs deleted file mode 100644 index db066f12..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Generate.JsonSerializerContext.g.cs +++ /dev/null @@ -1,1237 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull - )] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(long))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LayerizedTextBlock), TypeInfoPropertyName = "LayerizedTextBlock2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DetectedTextBlock))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LayerizedTextBlockVariant2))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TextColorSpan))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageRequestV4))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4JsonPrompt))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ResolutionV4), TypeInfoPropertyName = "ResolutionV42")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RenderingSpeed), TypeInfoPropertyName = "RenderingSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.OutputResolution), TypeInfoPropertyName = "OutputResolution2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RenderingSpeedV4), TypeInfoPropertyName = "RenderingSpeedV42")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateTransparentImageRequestV4))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AspectRatioV4), TypeInfoPropertyName = "AspectRatioV42")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageRequestV4Fp8))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageRequestV4CfgDistilled))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageRequestPImage))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MagicPromptOption), TypeInfoPropertyName = "MagicPromptOption2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PImageResolution), TypeInfoPropertyName = "PImageResolution2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageRequestPImageIdeogram))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.Quality), TypeInfoPropertyName = "Quality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AspectRatioV3), TypeInfoPropertyName = "AspectRatioV32")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageRequestV4Stable))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageRequestV4StableVersion), TypeInfoPropertyName = "GenerateImageRequestV4StableVersion2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageRequestZImage))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageRequestFlux2Klein))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageRequestFlux2KleinBase))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageRequestErnie))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageRequestV4Im2Im))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(byte[]))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ResolutionV4ImageToImage), TypeInfoPropertyName = "ResolutionV4ImageToImage2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemixImageRequestV4))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateDesignRequestV4))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ResolutionV4Layout), TypeInfoPropertyName = "ResolutionV4Layout2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateDesignRequestV4InspirationReferenceModel), TypeInfoPropertyName = "GenerateDesignRequestV4InspirationReferenceModel2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateDesignRequestV4ArtifactGenerationModel), TypeInfoPropertyName = "GenerateDesignRequestV4ArtifactGenerationModel2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateDesignRequestV4Layout2imageVariant), TypeInfoPropertyName = "GenerateDesignRequestV4Layout2imageVariant2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateDesignRequestV4ResponseType), TypeInfoPropertyName = "GenerateDesignRequestV4ResponseType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.EditImageRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ModelEnum), TypeInfoPropertyName = "ModelEnum2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.StyleType), TypeInfoPropertyName = "StyleType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImageRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageRequestV3))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ResolutionV3), TypeInfoPropertyName = "ResolutionV32")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ColorPaletteWithPresetNameOrMembers), TypeInfoPropertyName = "ColorPaletteWithPresetNameOrMembers2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.StyleTypeV3), TypeInfoPropertyName = "StyleTypeV32")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.StylePresetV3), TypeInfoPropertyName = "StylePresetV32")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateGraphicRequestV3))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateDesignRequestV3))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LayerizeDesignRequestV3))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateTransparentImageRequestV3))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleFactor), TypeInfoPropertyName = "UpscaleFactor2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemixImageRequestV3))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.EditImageRequestV3))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V1EditImagesRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TransparencyOption), TypeInfoPropertyName = "TransparencyOption2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AspectRatioEditLite), TypeInfoPropertyName = "AspectRatioEditLite2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V1EditLiteImagesRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TryOnRequestV3))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReframeImageRequestV3))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReplaceBackgroundRequestV3))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemoveBackgroundRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemoveBackgroundResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemoveBackgroundImageObject))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemoveObjectRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(float))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SnapMaskRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemoveObjectResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemoveObjectImageObject))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemixImageRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.InitialImageRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReframeImageRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.Resolution), TypeInfoPropertyName = "Resolution2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleInitialImageRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AspectRatio), TypeInfoPropertyName = "AspectRatio2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MagicPromptVersionEnum), TypeInfoPropertyName = "MagicPromptVersionEnum2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImageObject))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImageGenerationResponseV3))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImageGenerationObjectV3))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V1EditImagesResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V1EditImageObject))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImageGenerationResponseV4))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImageGenerationResponseV4ResponseType), TypeInfoPropertyName = "ImageGenerationResponseV4ResponseType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImageGenerationObjectV4))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AsyncImageGenerationResponseV4))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponseStatus), TypeInfoPropertyName = "GenerationResponseStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponseResponseType), TypeInfoPropertyName = "GenerationResponseResponseType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponseDataInner), TypeInfoPropertyName = "GenerationResponseDataInner2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImageObjectWithoutPromptOrSeed))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImageObjectWithoutPromptOrSeedObjectType), TypeInfoPropertyName = "ImageObjectWithoutPromptOrSeedObjectType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImageGenerationObject))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImageGenerationObjectObjectType), TypeInfoPropertyName = "ImageGenerationObjectObjectType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImageGenerationResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImageGenerationResponseV4ImageToImage))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImageGenerationResponseV4ImageToImageResponseType), TypeInfoPropertyName = "ImageGenerationResponseV4ImageToImageResponseType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImageGenerationObjectV4ImageToImage))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImageGenerationResponseV4Layout))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImageGenerationResponseV4LayoutResponseType), TypeInfoPropertyName = "ImageGenerationResponseV4LayoutResponseType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImageGenerationObjectV4Layout))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LayeredImageGenerationObjectV3))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TextContainerV3))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImageLayerV3))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LayeredImageGenerationResponseV3))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LayeredImageGenerationResponseV3ResponseType), TypeInfoPropertyName = "LayeredImageGenerationResponseV3ResponseType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageSafetyError))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TextSpanV3))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TextSpanV3FontFxItem), TypeInfoPropertyName = "TextSpanV3FontFxItem2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TextItemV3))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TextItemV3Alignment), TypeInfoPropertyName = "TextItemV3Alignment2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TextItemV3StyleClass), TypeInfoPropertyName = "TextItemV3StyleClass2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TextItemV3GlyphType), TypeInfoPropertyName = "TextItemV3GlyphType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TextItemV3TextTransform), TypeInfoPropertyName = "TextItemV3TextTransform2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TextItemV3VerticalAlignment), TypeInfoPropertyName = "TextItemV3VerticalAlignment2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LayeredAssetTextShadow))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LayerizeLogosRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LayerizeLogosResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LayerizeTextRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LayerizeTextResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AssetIdentifier))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LayerizedImageObject))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LayerizedImageObjectObjectType), TypeInfoPropertyName = "LayerizedImageObjectObjectType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ResizeAdImageRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ResizeAdImageRequestResolution), TypeInfoPropertyName = "ResizeAdImageRequestResolution2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ResizeAdImageQuality), TypeInfoPropertyName = "ResizeAdImageQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4StyleDescription))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4CompositionalDeconstruction))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4PromptElement), TypeInfoPropertyName = "V4PromptElement2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4ObjPromptElement))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4TextPromptElement))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4PromptElementDiscriminator))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4PromptElementDiscriminatorType), TypeInfoPropertyName = "V4PromptElementDiscriminatorType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4ObjPromptElementType), TypeInfoPropertyName = "V4ObjPromptElementType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4TextPromptElementType), TypeInfoPropertyName = "V4TextPromptElementType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ColorPaletteWithPresetName))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ColorPaletteWithMembers))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ColorPalettePresetName), TypeInfoPropertyName = "ColorPalettePresetName2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ColorPaletteMember))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SvgGenerationObject))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SvgGenerationObjectObjectType), TypeInfoPropertyName = "SvgGenerationObjectObjectType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SvgGenerationObjectMimeType), TypeInfoPropertyName = "SvgGenerationObjectMimeType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.VideoObject))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.VideoObjectObjectType), TypeInfoPropertyName = "VideoObjectObjectType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TextLayerizerResultObject))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TextLayerizerResultObjectObjectType), TypeInfoPropertyName = "TextLayerizerResultObjectObjectType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DetectedTextBlockAlignment), TypeInfoPropertyName = "DetectedTextBlockAlignment2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DetectedTextBlockFormattingItem), TypeInfoPropertyName = "DetectedTextBlockFormattingItem2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DetectedTextBlockRole), TypeInfoPropertyName = "DetectedTextBlockRole2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AssetType), TypeInfoPropertyName = "AssetType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PostGenerateDesignV4200Response), TypeInfoPropertyName = "PostGenerateDesignV4200Response2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PostGenerateDesignV4200ResponseDiscriminator))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PostGenerateDesignV4200ResponseDiscriminatorResponseType), TypeInfoPropertyName = "PostGenerateDesignV4200ResponseDiscriminatorResponseType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponseDataInnerDiscriminator))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponseDataInnerDiscriminatorObjectType), TypeInfoPropertyName = "GenerationResponseDataInnerDiscriminatorObjectType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(long?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LayerizedTextBlock?), TypeInfoPropertyName = "NullableLayerizedTextBlock2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ResolutionV4?), TypeInfoPropertyName = "NullableResolutionV42")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RenderingSpeed?), TypeInfoPropertyName = "NullableRenderingSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.OutputResolution?), TypeInfoPropertyName = "NullableOutputResolution2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RenderingSpeedV4?), TypeInfoPropertyName = "NullableRenderingSpeedV42")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AspectRatioV4?), TypeInfoPropertyName = "NullableAspectRatioV42")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MagicPromptOption?), TypeInfoPropertyName = "NullableMagicPromptOption2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PImageResolution?), TypeInfoPropertyName = "NullablePImageResolution2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.Quality?), TypeInfoPropertyName = "NullableQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AspectRatioV3?), TypeInfoPropertyName = "NullableAspectRatioV32")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageRequestV4StableVersion?), TypeInfoPropertyName = "NullableGenerateImageRequestV4StableVersion2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ResolutionV4ImageToImage?), TypeInfoPropertyName = "NullableResolutionV4ImageToImage2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ResolutionV4Layout?), TypeInfoPropertyName = "NullableResolutionV4Layout2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateDesignRequestV4InspirationReferenceModel?), TypeInfoPropertyName = "NullableGenerateDesignRequestV4InspirationReferenceModel2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateDesignRequestV4ArtifactGenerationModel?), TypeInfoPropertyName = "NullableGenerateDesignRequestV4ArtifactGenerationModel2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateDesignRequestV4Layout2imageVariant?), TypeInfoPropertyName = "NullableGenerateDesignRequestV4Layout2imageVariant2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateDesignRequestV4ResponseType?), TypeInfoPropertyName = "NullableGenerateDesignRequestV4ResponseType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ModelEnum?), TypeInfoPropertyName = "NullableModelEnum2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.StyleType?), TypeInfoPropertyName = "NullableStyleType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ResolutionV3?), TypeInfoPropertyName = "NullableResolutionV32")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ColorPaletteWithPresetNameOrMembers?), TypeInfoPropertyName = "NullableColorPaletteWithPresetNameOrMembers2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.StyleTypeV3?), TypeInfoPropertyName = "NullableStyleTypeV32")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.StylePresetV3?), TypeInfoPropertyName = "NullableStylePresetV32")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleFactor?), TypeInfoPropertyName = "NullableUpscaleFactor2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TransparencyOption?), TypeInfoPropertyName = "NullableTransparencyOption2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AspectRatioEditLite?), TypeInfoPropertyName = "NullableAspectRatioEditLite2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(float?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.Resolution?), TypeInfoPropertyName = "NullableResolution2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AspectRatio?), TypeInfoPropertyName = "NullableAspectRatio2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MagicPromptVersionEnum?), TypeInfoPropertyName = "NullableMagicPromptVersionEnum2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImageGenerationResponseV4ResponseType?), TypeInfoPropertyName = "NullableImageGenerationResponseV4ResponseType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponseStatus?), TypeInfoPropertyName = "NullableGenerationResponseStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponseResponseType?), TypeInfoPropertyName = "NullableGenerationResponseResponseType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponseDataInner?), TypeInfoPropertyName = "NullableGenerationResponseDataInner2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImageObjectWithoutPromptOrSeedObjectType?), TypeInfoPropertyName = "NullableImageObjectWithoutPromptOrSeedObjectType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImageGenerationObjectObjectType?), TypeInfoPropertyName = "NullableImageGenerationObjectObjectType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImageGenerationResponseV4ImageToImageResponseType?), TypeInfoPropertyName = "NullableImageGenerationResponseV4ImageToImageResponseType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImageGenerationResponseV4LayoutResponseType?), TypeInfoPropertyName = "NullableImageGenerationResponseV4LayoutResponseType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LayeredImageGenerationResponseV3ResponseType?), TypeInfoPropertyName = "NullableLayeredImageGenerationResponseV3ResponseType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TextSpanV3FontFxItem?), TypeInfoPropertyName = "NullableTextSpanV3FontFxItem2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TextItemV3Alignment?), TypeInfoPropertyName = "NullableTextItemV3Alignment2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TextItemV3StyleClass?), TypeInfoPropertyName = "NullableTextItemV3StyleClass2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TextItemV3GlyphType?), TypeInfoPropertyName = "NullableTextItemV3GlyphType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TextItemV3TextTransform?), TypeInfoPropertyName = "NullableTextItemV3TextTransform2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TextItemV3VerticalAlignment?), TypeInfoPropertyName = "NullableTextItemV3VerticalAlignment2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LayerizedImageObjectObjectType?), TypeInfoPropertyName = "NullableLayerizedImageObjectObjectType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(double?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ResizeAdImageRequestResolution?), TypeInfoPropertyName = "NullableResizeAdImageRequestResolution2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ResizeAdImageQuality?), TypeInfoPropertyName = "NullableResizeAdImageQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4PromptElement?), TypeInfoPropertyName = "NullableV4PromptElement2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4PromptElementDiscriminatorType?), TypeInfoPropertyName = "NullableV4PromptElementDiscriminatorType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4ObjPromptElementType?), TypeInfoPropertyName = "NullableV4ObjPromptElementType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4TextPromptElementType?), TypeInfoPropertyName = "NullableV4TextPromptElementType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ColorPalettePresetName?), TypeInfoPropertyName = "NullableColorPalettePresetName2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SvgGenerationObjectObjectType?), TypeInfoPropertyName = "NullableSvgGenerationObjectObjectType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SvgGenerationObjectMimeType?), TypeInfoPropertyName = "NullableSvgGenerationObjectMimeType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.VideoObjectObjectType?), TypeInfoPropertyName = "NullableVideoObjectObjectType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TextLayerizerResultObjectObjectType?), TypeInfoPropertyName = "NullableTextLayerizerResultObjectObjectType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DetectedTextBlockAlignment?), TypeInfoPropertyName = "NullableDetectedTextBlockAlignment2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DetectedTextBlockFormattingItem?), TypeInfoPropertyName = "NullableDetectedTextBlockFormattingItem2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DetectedTextBlockRole?), TypeInfoPropertyName = "NullableDetectedTextBlockRole2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AssetType?), TypeInfoPropertyName = "NullableAssetType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PostGenerateDesignV4200Response?), TypeInfoPropertyName = "NullablePostGenerateDesignV4200Response2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PostGenerateDesignV4200ResponseDiscriminatorResponseType?), TypeInfoPropertyName = "NullablePostGenerateDesignV4200ResponseDiscriminatorResponseType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponseDataInnerDiscriminatorObjectType?), TypeInfoPropertyName = "NullableGenerationResponseDataInnerDiscriminatorObjectType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - internal sealed partial class GenerateSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext - { - } - /// - /// - /// - public sealed partial class GenerateSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext - { - private static readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver Resolver = new LazyChunkResolver(); - - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - internal static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver TypeInfoResolver => Resolver; - - - private static readonly global::System.Text.Json.JsonSerializerOptions DefaultOptions = CreateDefaultOptions(); - - /// - /// - /// - public static GenerateSourceGenerationContext Default { get; } = new(DefaultOptions); - - private GenerateSourceGenerationContext(global::System.Text.Json.JsonSerializerOptions options) - : base(options) - { - } - - /// - protected override global::System.Text.Json.JsonSerializerOptions? GeneratedSerializerOptions => DefaultOptions; - - /// - public override global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo(global::System.Type type) - { - return Resolver.GetTypeInfo(type, Options); - } - - /// - /// Adds this package's converters to . - /// - /// - /// A converter has to be on the options a chained resolver builds its JsonTypeInfo against, - /// and a context resolves types from every package below it. Each package contributes only - /// what it owns and calls down the chain for the rest, so the family's converter table is - /// written once rather than copied into all of them. - /// - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) - { - options.Converters.Add(new global::Ideogram.JsonConverters.LayerizedTextBlockJsonConverter()); - options.Converters.Add(new global::Ideogram.JsonConverters.V4PromptElementJsonConverter()); - options.Converters.Add(new global::Ideogram.JsonConverters.ColorPaletteWithPresetNameOrMembersJsonConverter()); - options.Converters.Add(new global::Ideogram.JsonConverters.PostGenerateDesignV4200ResponseJsonConverter()); - options.Converters.Add(new global::Ideogram.JsonConverters.GenerationResponseDataInnerJsonConverter()); - options.Converters.Add(new global::Ideogram.JsonConverters.UnixTimestampJsonConverter()); - options.Converters.Add(new LazyEnumJsonConverterFactory()); - } - - private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() - { - var options = new global::System.Text.Json.JsonSerializerOptions - { - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, - TypeInfoResolver = Resolver, - }; - AddConverters(options); - - return options; - } - - - private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory - { - public override bool CanConvert(global::System.Type typeToConvert) - { - return - typeToConvert == typeof(global::Ideogram.OutputResolution) - - || typeToConvert == typeof(global::Ideogram.OutputResolution?) - - || typeToConvert == typeof(global::Ideogram.RenderingSpeedV4) - - || typeToConvert == typeof(global::Ideogram.RenderingSpeedV4?) - - || typeToConvert == typeof(global::Ideogram.PImageResolution) - - || typeToConvert == typeof(global::Ideogram.PImageResolution?) - - || typeToConvert == typeof(global::Ideogram.GenerateImageRequestV4StableVersion) - - || typeToConvert == typeof(global::Ideogram.GenerateImageRequestV4StableVersion?) - - || typeToConvert == typeof(global::Ideogram.GenerateDesignRequestV4InspirationReferenceModel) - - || typeToConvert == typeof(global::Ideogram.GenerateDesignRequestV4InspirationReferenceModel?) - - || typeToConvert == typeof(global::Ideogram.GenerateDesignRequestV4ArtifactGenerationModel) - - || typeToConvert == typeof(global::Ideogram.GenerateDesignRequestV4ArtifactGenerationModel?) - - || typeToConvert == typeof(global::Ideogram.GenerateDesignRequestV4Layout2imageVariant) - - || typeToConvert == typeof(global::Ideogram.GenerateDesignRequestV4Layout2imageVariant?) - - || typeToConvert == typeof(global::Ideogram.GenerateDesignRequestV4ResponseType) - - || typeToConvert == typeof(global::Ideogram.GenerateDesignRequestV4ResponseType?) - - || typeToConvert == typeof(global::Ideogram.TransparencyOption) - - || typeToConvert == typeof(global::Ideogram.TransparencyOption?) - - || typeToConvert == typeof(global::Ideogram.AspectRatioEditLite) - - || typeToConvert == typeof(global::Ideogram.AspectRatioEditLite?) - - || typeToConvert == typeof(global::Ideogram.ImageGenerationResponseV4ResponseType) - - || typeToConvert == typeof(global::Ideogram.ImageGenerationResponseV4ResponseType?) - - || typeToConvert == typeof(global::Ideogram.GenerationResponseStatus) - - || typeToConvert == typeof(global::Ideogram.GenerationResponseStatus?) - - || typeToConvert == typeof(global::Ideogram.GenerationResponseResponseType) - - || typeToConvert == typeof(global::Ideogram.GenerationResponseResponseType?) - - || typeToConvert == typeof(global::Ideogram.ImageObjectWithoutPromptOrSeedObjectType) - - || typeToConvert == typeof(global::Ideogram.ImageObjectWithoutPromptOrSeedObjectType?) - - || typeToConvert == typeof(global::Ideogram.ImageGenerationObjectObjectType) - - || typeToConvert == typeof(global::Ideogram.ImageGenerationObjectObjectType?) - - || typeToConvert == typeof(global::Ideogram.ImageGenerationResponseV4ImageToImageResponseType) - - || typeToConvert == typeof(global::Ideogram.ImageGenerationResponseV4ImageToImageResponseType?) - - || typeToConvert == typeof(global::Ideogram.ImageGenerationResponseV4LayoutResponseType) - - || typeToConvert == typeof(global::Ideogram.ImageGenerationResponseV4LayoutResponseType?) - - || typeToConvert == typeof(global::Ideogram.LayeredImageGenerationResponseV3ResponseType) - - || typeToConvert == typeof(global::Ideogram.LayeredImageGenerationResponseV3ResponseType?) - - || typeToConvert == typeof(global::Ideogram.ModelEnum) - - || typeToConvert == typeof(global::Ideogram.ModelEnum?) - - || typeToConvert == typeof(global::Ideogram.TextSpanV3FontFxItem) - - || typeToConvert == typeof(global::Ideogram.TextSpanV3FontFxItem?) - - || typeToConvert == typeof(global::Ideogram.TextItemV3Alignment) - - || typeToConvert == typeof(global::Ideogram.TextItemV3Alignment?) - - || typeToConvert == typeof(global::Ideogram.TextItemV3StyleClass) - - || typeToConvert == typeof(global::Ideogram.TextItemV3StyleClass?) - - || typeToConvert == typeof(global::Ideogram.TextItemV3GlyphType) - - || typeToConvert == typeof(global::Ideogram.TextItemV3GlyphType?) - - || typeToConvert == typeof(global::Ideogram.TextItemV3TextTransform) - - || typeToConvert == typeof(global::Ideogram.TextItemV3TextTransform?) - - || typeToConvert == typeof(global::Ideogram.TextItemV3VerticalAlignment) - - || typeToConvert == typeof(global::Ideogram.TextItemV3VerticalAlignment?) - - || typeToConvert == typeof(global::Ideogram.LayerizedImageObjectObjectType) - - || typeToConvert == typeof(global::Ideogram.LayerizedImageObjectObjectType?) - - || typeToConvert == typeof(global::Ideogram.ResizeAdImageRequestResolution) - - || typeToConvert == typeof(global::Ideogram.ResizeAdImageRequestResolution?) - - || typeToConvert == typeof(global::Ideogram.ResizeAdImageQuality) - - || typeToConvert == typeof(global::Ideogram.ResizeAdImageQuality?) - - || typeToConvert == typeof(global::Ideogram.V4PromptElementDiscriminatorType) - - || typeToConvert == typeof(global::Ideogram.V4PromptElementDiscriminatorType?) - - || typeToConvert == typeof(global::Ideogram.V4ObjPromptElementType) - - || typeToConvert == typeof(global::Ideogram.V4ObjPromptElementType?) - - || typeToConvert == typeof(global::Ideogram.V4TextPromptElementType) - - || typeToConvert == typeof(global::Ideogram.V4TextPromptElementType?) - - || typeToConvert == typeof(global::Ideogram.ResolutionV4) - - || typeToConvert == typeof(global::Ideogram.ResolutionV4?) - - || typeToConvert == typeof(global::Ideogram.RenderingSpeed) - - || typeToConvert == typeof(global::Ideogram.RenderingSpeed?) - - || typeToConvert == typeof(global::Ideogram.AspectRatioV4) - - || typeToConvert == typeof(global::Ideogram.AspectRatioV4?) - - || typeToConvert == typeof(global::Ideogram.MagicPromptOption) - - || typeToConvert == typeof(global::Ideogram.MagicPromptOption?) - - || typeToConvert == typeof(global::Ideogram.Quality) - - || typeToConvert == typeof(global::Ideogram.Quality?) - - || typeToConvert == typeof(global::Ideogram.AspectRatioV3) - - || typeToConvert == typeof(global::Ideogram.AspectRatioV3?) - - || typeToConvert == typeof(global::Ideogram.ResolutionV4ImageToImage) - - || typeToConvert == typeof(global::Ideogram.ResolutionV4ImageToImage?) - - || typeToConvert == typeof(global::Ideogram.ResolutionV4Layout) - - || typeToConvert == typeof(global::Ideogram.ResolutionV4Layout?) - - || typeToConvert == typeof(global::Ideogram.StyleType) - - || typeToConvert == typeof(global::Ideogram.StyleType?) - - || typeToConvert == typeof(global::Ideogram.ResolutionV3) - - || typeToConvert == typeof(global::Ideogram.ResolutionV3?) - - || typeToConvert == typeof(global::Ideogram.ColorPalettePresetName) - - || typeToConvert == typeof(global::Ideogram.ColorPalettePresetName?) - - || typeToConvert == typeof(global::Ideogram.StyleTypeV3) - - || typeToConvert == typeof(global::Ideogram.StyleTypeV3?) - - || typeToConvert == typeof(global::Ideogram.StylePresetV3) - - || typeToConvert == typeof(global::Ideogram.StylePresetV3?) - - || typeToConvert == typeof(global::Ideogram.UpscaleFactor) - - || typeToConvert == typeof(global::Ideogram.UpscaleFactor?) - - || typeToConvert == typeof(global::Ideogram.Resolution) - - || typeToConvert == typeof(global::Ideogram.Resolution?) - - || typeToConvert == typeof(global::Ideogram.AspectRatio) - - || typeToConvert == typeof(global::Ideogram.AspectRatio?) - - || typeToConvert == typeof(global::Ideogram.MagicPromptVersionEnum) - - || typeToConvert == typeof(global::Ideogram.MagicPromptVersionEnum?) - - || typeToConvert == typeof(global::Ideogram.SvgGenerationObjectObjectType) - - || typeToConvert == typeof(global::Ideogram.SvgGenerationObjectObjectType?) - - || typeToConvert == typeof(global::Ideogram.SvgGenerationObjectMimeType) - - || typeToConvert == typeof(global::Ideogram.SvgGenerationObjectMimeType?) - - || typeToConvert == typeof(global::Ideogram.VideoObjectObjectType) - - || typeToConvert == typeof(global::Ideogram.VideoObjectObjectType?) - - || typeToConvert == typeof(global::Ideogram.TextLayerizerResultObjectObjectType) - - || typeToConvert == typeof(global::Ideogram.TextLayerizerResultObjectObjectType?) - - || typeToConvert == typeof(global::Ideogram.DetectedTextBlockAlignment) - - || typeToConvert == typeof(global::Ideogram.DetectedTextBlockAlignment?) - - || typeToConvert == typeof(global::Ideogram.DetectedTextBlockFormattingItem) - - || typeToConvert == typeof(global::Ideogram.DetectedTextBlockFormattingItem?) - - || typeToConvert == typeof(global::Ideogram.DetectedTextBlockRole) - - || typeToConvert == typeof(global::Ideogram.DetectedTextBlockRole?) - - || typeToConvert == typeof(global::Ideogram.AssetType) - - || typeToConvert == typeof(global::Ideogram.AssetType?) - - || typeToConvert == typeof(global::Ideogram.PostGenerateDesignV4200ResponseDiscriminatorResponseType) - - || typeToConvert == typeof(global::Ideogram.PostGenerateDesignV4200ResponseDiscriminatorResponseType?) - - || typeToConvert == typeof(global::Ideogram.GenerationResponseDataInnerDiscriminatorObjectType) - - || typeToConvert == typeof(global::Ideogram.GenerationResponseDataInnerDiscriminatorObjectType?); - } - - public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - if (typeToConvert == typeof(global::Ideogram.OutputResolution)) - { - return new global::Ideogram.JsonConverters.OutputResolutionJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.OutputResolution?)) - { - return new global::Ideogram.JsonConverters.OutputResolutionNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.RenderingSpeedV4)) - { - return new global::Ideogram.JsonConverters.RenderingSpeedV4JsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.RenderingSpeedV4?)) - { - return new global::Ideogram.JsonConverters.RenderingSpeedV4NullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.PImageResolution)) - { - return new global::Ideogram.JsonConverters.PImageResolutionJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.PImageResolution?)) - { - return new global::Ideogram.JsonConverters.PImageResolutionNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerateImageRequestV4StableVersion)) - { - return new global::Ideogram.JsonConverters.GenerateImageRequestV4StableVersionJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerateImageRequestV4StableVersion?)) - { - return new global::Ideogram.JsonConverters.GenerateImageRequestV4StableVersionNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerateDesignRequestV4InspirationReferenceModel)) - { - return new global::Ideogram.JsonConverters.GenerateDesignRequestV4InspirationReferenceModelJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerateDesignRequestV4InspirationReferenceModel?)) - { - return new global::Ideogram.JsonConverters.GenerateDesignRequestV4InspirationReferenceModelNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerateDesignRequestV4ArtifactGenerationModel)) - { - return new global::Ideogram.JsonConverters.GenerateDesignRequestV4ArtifactGenerationModelJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerateDesignRequestV4ArtifactGenerationModel?)) - { - return new global::Ideogram.JsonConverters.GenerateDesignRequestV4ArtifactGenerationModelNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerateDesignRequestV4Layout2imageVariant)) - { - return new global::Ideogram.JsonConverters.GenerateDesignRequestV4Layout2imageVariantJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerateDesignRequestV4Layout2imageVariant?)) - { - return new global::Ideogram.JsonConverters.GenerateDesignRequestV4Layout2imageVariantNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerateDesignRequestV4ResponseType)) - { - return new global::Ideogram.JsonConverters.GenerateDesignRequestV4ResponseTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerateDesignRequestV4ResponseType?)) - { - return new global::Ideogram.JsonConverters.GenerateDesignRequestV4ResponseTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.TransparencyOption)) - { - return new global::Ideogram.JsonConverters.TransparencyOptionJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.TransparencyOption?)) - { - return new global::Ideogram.JsonConverters.TransparencyOptionNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.AspectRatioEditLite)) - { - return new global::Ideogram.JsonConverters.AspectRatioEditLiteJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.AspectRatioEditLite?)) - { - return new global::Ideogram.JsonConverters.AspectRatioEditLiteNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ImageGenerationResponseV4ResponseType)) - { - return new global::Ideogram.JsonConverters.ImageGenerationResponseV4ResponseTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ImageGenerationResponseV4ResponseType?)) - { - return new global::Ideogram.JsonConverters.ImageGenerationResponseV4ResponseTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerationResponseStatus)) - { - return new global::Ideogram.JsonConverters.GenerationResponseStatusJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerationResponseStatus?)) - { - return new global::Ideogram.JsonConverters.GenerationResponseStatusNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerationResponseResponseType)) - { - return new global::Ideogram.JsonConverters.GenerationResponseResponseTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerationResponseResponseType?)) - { - return new global::Ideogram.JsonConverters.GenerationResponseResponseTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ImageObjectWithoutPromptOrSeedObjectType)) - { - return new global::Ideogram.JsonConverters.ImageObjectWithoutPromptOrSeedObjectTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ImageObjectWithoutPromptOrSeedObjectType?)) - { - return new global::Ideogram.JsonConverters.ImageObjectWithoutPromptOrSeedObjectTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ImageGenerationObjectObjectType)) - { - return new global::Ideogram.JsonConverters.ImageGenerationObjectObjectTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ImageGenerationObjectObjectType?)) - { - return new global::Ideogram.JsonConverters.ImageGenerationObjectObjectTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ImageGenerationResponseV4ImageToImageResponseType)) - { - return new global::Ideogram.JsonConverters.ImageGenerationResponseV4ImageToImageResponseTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ImageGenerationResponseV4ImageToImageResponseType?)) - { - return new global::Ideogram.JsonConverters.ImageGenerationResponseV4ImageToImageResponseTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ImageGenerationResponseV4LayoutResponseType)) - { - return new global::Ideogram.JsonConverters.ImageGenerationResponseV4LayoutResponseTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ImageGenerationResponseV4LayoutResponseType?)) - { - return new global::Ideogram.JsonConverters.ImageGenerationResponseV4LayoutResponseTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.LayeredImageGenerationResponseV3ResponseType)) - { - return new global::Ideogram.JsonConverters.LayeredImageGenerationResponseV3ResponseTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.LayeredImageGenerationResponseV3ResponseType?)) - { - return new global::Ideogram.JsonConverters.LayeredImageGenerationResponseV3ResponseTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ModelEnum)) - { - return new global::Ideogram.JsonConverters.ModelEnumJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ModelEnum?)) - { - return new global::Ideogram.JsonConverters.ModelEnumNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.TextSpanV3FontFxItem)) - { - return new global::Ideogram.JsonConverters.TextSpanV3FontFxItemJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.TextSpanV3FontFxItem?)) - { - return new global::Ideogram.JsonConverters.TextSpanV3FontFxItemNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.TextItemV3Alignment)) - { - return new global::Ideogram.JsonConverters.TextItemV3AlignmentJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.TextItemV3Alignment?)) - { - return new global::Ideogram.JsonConverters.TextItemV3AlignmentNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.TextItemV3StyleClass)) - { - return new global::Ideogram.JsonConverters.TextItemV3StyleClassJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.TextItemV3StyleClass?)) - { - return new global::Ideogram.JsonConverters.TextItemV3StyleClassNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.TextItemV3GlyphType)) - { - return new global::Ideogram.JsonConverters.TextItemV3GlyphTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.TextItemV3GlyphType?)) - { - return new global::Ideogram.JsonConverters.TextItemV3GlyphTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.TextItemV3TextTransform)) - { - return new global::Ideogram.JsonConverters.TextItemV3TextTransformJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.TextItemV3TextTransform?)) - { - return new global::Ideogram.JsonConverters.TextItemV3TextTransformNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.TextItemV3VerticalAlignment)) - { - return new global::Ideogram.JsonConverters.TextItemV3VerticalAlignmentJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.TextItemV3VerticalAlignment?)) - { - return new global::Ideogram.JsonConverters.TextItemV3VerticalAlignmentNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.LayerizedImageObjectObjectType)) - { - return new global::Ideogram.JsonConverters.LayerizedImageObjectObjectTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.LayerizedImageObjectObjectType?)) - { - return new global::Ideogram.JsonConverters.LayerizedImageObjectObjectTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ResizeAdImageRequestResolution)) - { - return new global::Ideogram.JsonConverters.ResizeAdImageRequestResolutionJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ResizeAdImageRequestResolution?)) - { - return new global::Ideogram.JsonConverters.ResizeAdImageRequestResolutionNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ResizeAdImageQuality)) - { - return new global::Ideogram.JsonConverters.ResizeAdImageQualityJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ResizeAdImageQuality?)) - { - return new global::Ideogram.JsonConverters.ResizeAdImageQualityNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.V4PromptElementDiscriminatorType)) - { - return new global::Ideogram.JsonConverters.V4PromptElementDiscriminatorTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.V4PromptElementDiscriminatorType?)) - { - return new global::Ideogram.JsonConverters.V4PromptElementDiscriminatorTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.V4ObjPromptElementType)) - { - return new global::Ideogram.JsonConverters.V4ObjPromptElementTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.V4ObjPromptElementType?)) - { - return new global::Ideogram.JsonConverters.V4ObjPromptElementTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.V4TextPromptElementType)) - { - return new global::Ideogram.JsonConverters.V4TextPromptElementTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.V4TextPromptElementType?)) - { - return new global::Ideogram.JsonConverters.V4TextPromptElementTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ResolutionV4)) - { - return new global::Ideogram.JsonConverters.ResolutionV4JsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ResolutionV4?)) - { - return new global::Ideogram.JsonConverters.ResolutionV4NullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.RenderingSpeed)) - { - return new global::Ideogram.JsonConverters.RenderingSpeedJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.RenderingSpeed?)) - { - return new global::Ideogram.JsonConverters.RenderingSpeedNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.AspectRatioV4)) - { - return new global::Ideogram.JsonConverters.AspectRatioV4JsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.AspectRatioV4?)) - { - return new global::Ideogram.JsonConverters.AspectRatioV4NullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.MagicPromptOption)) - { - return new global::Ideogram.JsonConverters.MagicPromptOptionJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.MagicPromptOption?)) - { - return new global::Ideogram.JsonConverters.MagicPromptOptionNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.Quality)) - { - return new global::Ideogram.JsonConverters.QualityJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.Quality?)) - { - return new global::Ideogram.JsonConverters.QualityNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.AspectRatioV3)) - { - return new global::Ideogram.JsonConverters.AspectRatioV3JsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.AspectRatioV3?)) - { - return new global::Ideogram.JsonConverters.AspectRatioV3NullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ResolutionV4ImageToImage)) - { - return new global::Ideogram.JsonConverters.ResolutionV4ImageToImageJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ResolutionV4ImageToImage?)) - { - return new global::Ideogram.JsonConverters.ResolutionV4ImageToImageNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ResolutionV4Layout)) - { - return new global::Ideogram.JsonConverters.ResolutionV4LayoutJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ResolutionV4Layout?)) - { - return new global::Ideogram.JsonConverters.ResolutionV4LayoutNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.StyleType)) - { - return new global::Ideogram.JsonConverters.StyleTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.StyleType?)) - { - return new global::Ideogram.JsonConverters.StyleTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ResolutionV3)) - { - return new global::Ideogram.JsonConverters.ResolutionV3JsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ResolutionV3?)) - { - return new global::Ideogram.JsonConverters.ResolutionV3NullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ColorPalettePresetName)) - { - return new global::Ideogram.JsonConverters.ColorPalettePresetNameJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ColorPalettePresetName?)) - { - return new global::Ideogram.JsonConverters.ColorPalettePresetNameNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.StyleTypeV3)) - { - return new global::Ideogram.JsonConverters.StyleTypeV3JsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.StyleTypeV3?)) - { - return new global::Ideogram.JsonConverters.StyleTypeV3NullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.StylePresetV3)) - { - return new global::Ideogram.JsonConverters.StylePresetV3JsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.StylePresetV3?)) - { - return new global::Ideogram.JsonConverters.StylePresetV3NullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.UpscaleFactor)) - { - return new global::Ideogram.JsonConverters.UpscaleFactorJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.UpscaleFactor?)) - { - return new global::Ideogram.JsonConverters.UpscaleFactorNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.Resolution)) - { - return new global::Ideogram.JsonConverters.ResolutionJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.Resolution?)) - { - return new global::Ideogram.JsonConverters.ResolutionNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.AspectRatio)) - { - return new global::Ideogram.JsonConverters.AspectRatioJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.AspectRatio?)) - { - return new global::Ideogram.JsonConverters.AspectRatioNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.MagicPromptVersionEnum)) - { - return new global::Ideogram.JsonConverters.MagicPromptVersionEnumJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.MagicPromptVersionEnum?)) - { - return new global::Ideogram.JsonConverters.MagicPromptVersionEnumNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.SvgGenerationObjectObjectType)) - { - return new global::Ideogram.JsonConverters.SvgGenerationObjectObjectTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.SvgGenerationObjectObjectType?)) - { - return new global::Ideogram.JsonConverters.SvgGenerationObjectObjectTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.SvgGenerationObjectMimeType)) - { - return new global::Ideogram.JsonConverters.SvgGenerationObjectMimeTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.SvgGenerationObjectMimeType?)) - { - return new global::Ideogram.JsonConverters.SvgGenerationObjectMimeTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.VideoObjectObjectType)) - { - return new global::Ideogram.JsonConverters.VideoObjectObjectTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.VideoObjectObjectType?)) - { - return new global::Ideogram.JsonConverters.VideoObjectObjectTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.TextLayerizerResultObjectObjectType)) - { - return new global::Ideogram.JsonConverters.TextLayerizerResultObjectObjectTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.TextLayerizerResultObjectObjectType?)) - { - return new global::Ideogram.JsonConverters.TextLayerizerResultObjectObjectTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.DetectedTextBlockAlignment)) - { - return new global::Ideogram.JsonConverters.DetectedTextBlockAlignmentJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.DetectedTextBlockAlignment?)) - { - return new global::Ideogram.JsonConverters.DetectedTextBlockAlignmentNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.DetectedTextBlockFormattingItem)) - { - return new global::Ideogram.JsonConverters.DetectedTextBlockFormattingItemJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.DetectedTextBlockFormattingItem?)) - { - return new global::Ideogram.JsonConverters.DetectedTextBlockFormattingItemNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.DetectedTextBlockRole)) - { - return new global::Ideogram.JsonConverters.DetectedTextBlockRoleJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.DetectedTextBlockRole?)) - { - return new global::Ideogram.JsonConverters.DetectedTextBlockRoleNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.AssetType)) - { - return new global::Ideogram.JsonConverters.AssetTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.AssetType?)) - { - return new global::Ideogram.JsonConverters.AssetTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.PostGenerateDesignV4200ResponseDiscriminatorResponseType)) - { - return new global::Ideogram.JsonConverters.PostGenerateDesignV4200ResponseDiscriminatorResponseTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.PostGenerateDesignV4200ResponseDiscriminatorResponseType?)) - { - return new global::Ideogram.JsonConverters.PostGenerateDesignV4200ResponseDiscriminatorResponseTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerationResponseDataInnerDiscriminatorObjectType)) - { - return new global::Ideogram.JsonConverters.GenerationResponseDataInnerDiscriminatorObjectTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerationResponseDataInnerDiscriminatorObjectType?)) - { - return new global::Ideogram.JsonConverters.GenerationResponseDataInnerDiscriminatorObjectTypeNullableJsonConverter(); - } - throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); - } - } - - private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver - { - private readonly object _gate = new(); - private readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[] _resolvers = new global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[1]; - - public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo( - global::System.Type type, - global::System.Text.Json.JsonSerializerOptions options) - { - for (var index = 0; index < _resolvers.Length; index++) - { - var typeInfo = GetResolver(index).GetTypeInfo(type, options); - if (typeInfo is not null) - { - return typeInfo; - } - } - - return null; - } - - private global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver GetResolver(int index) - { - var resolver = global::System.Threading.Volatile.Read(ref _resolvers[index]); - if (resolver is not null) - { - return resolver; - } - - lock (_gate) - { - return _resolvers[index] ??= CreateResolver(index); - } - } - - private static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver CreateResolver(int index) - { - return index switch - { - 0 => new GenerateSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), - _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), - }; - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.Authorizations.Bearer.g.cs b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.Authorizations.Bearer.g.cs deleted file mode 100644 index c6201c4b..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.Authorizations.Bearer.g.cs +++ /dev/null @@ -1,35 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public sealed partial class GenerateClient - { - - /// - public void AuthorizeUsingBearer( - string apiKey) - { - apiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey)); - - for (var i = Authorizations.Count - 1; i >= 0; i--) - { - var __authorization = Authorizations[i]; - if (__authorization.Type == "Http" && - __authorization.Name == "Bearer") - { - Authorizations.RemoveAt(i); - } - } - - Authorizations.Add(new global::Ideogram.EndPointAuthorization - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - Value = apiKey, - }); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.Constructors.Bearer.g.cs b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.Constructors.Bearer.g.cs deleted file mode 100644 index 46b3461d..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.Constructors.Bearer.g.cs +++ /dev/null @@ -1,31 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public sealed partial class GenerateClient - { - /// - - public GenerateClient( - string apiKey, - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - bool disposeHttpClient = true) : this(httpClient, baseUri, authorizations, disposeHttpClient) - { - Authorizing(HttpClient, ref apiKey); - - AuthorizeUsingBearer(apiKey); - - Authorized(HttpClient); - } - - partial void Authorizing( - global::System.Net.Http.HttpClient client, - ref string apiKey); - partial void Authorized( - global::System.Net.Http.HttpClient client); - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.GetGeneration.g.cs b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.GetGeneration.g.cs deleted file mode 100644 index 9e55a8b0..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.GetGeneration.g.cs +++ /dev/null @@ -1,554 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class GenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_GetGenerationSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_GetGenerationSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_GetGenerationSecurityRequirement0, - }; - partial void PrepareGetGenerationArguments( - global::System.Net.Http.HttpClient httpClient, - ref string generationId); - partial void PrepareGetGenerationRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string generationId); - partial void ProcessGetGenerationResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessGetGenerationResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Poll a generation
- /// Retrieves the current status of an asynchronous generation, and its results once complete. Use the `generation_id` returned by the async generation endpoint. While the generation is `pending` or has `failed`, the response contains only `generation_id`, `status`, and `created`. Once `status` is `completed`, the response includes `response_type` and `data`, and may include `usage_cost_usd_micros` when the request uses variable usage-based pricing. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task GetGenerationAsync( - string generationId, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await GetGenerationAsResponseAsync( - generationId: generationId, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Poll a generation
- /// Retrieves the current status of an asynchronous generation, and its results once complete. Use the `generation_id` returned by the async generation endpoint. While the generation is `pending` or has `failed`, the response contains only `generation_id`, `status`, and `created`. Once `status` is `completed`, the response includes `response_type` and `data`, and may include `usage_cost_usd_micros` when the request uses variable usage-based pricing. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> GetGenerationAsResponseAsync( - string generationId, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareGetGenerationArguments( - httpClient: HttpClient, - generationId: ref generationId); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_GetGenerationSecurityRequirements, - operationName: "GetGenerationAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: $"/v1/generations/{generationId}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetGenerationRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - generationId: generationId); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetGeneration", - methodName: "GetGenerationAsync", - pathTemplate: "$\"/v1/generations/{generationId}\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetGeneration", - methodName: "GetGenerationAsync", - pathTemplate: "$\"/v1/generations/{generationId}\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetGeneration", - methodName: "GetGenerationAsync", - pathTemplate: "$\"/v1/generations/{generationId}\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetGenerationResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetGeneration", - methodName: "GetGenerationAsync", - pathTemplate: "$\"/v1/generations/{generationId}\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetGeneration", - methodName: "GetGenerationAsync", - pathTemplate: "$\"/v1/generations/{generationId}\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetGenerationResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.GenerationResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.GenerationResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostEditImage.g.cs b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostEditImage.g.cs deleted file mode 100644 index dfb8bc55..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostEditImage.g.cs +++ /dev/null @@ -1,2159 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class GenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostEditImageSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostEditImageSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostEditImageSecurityRequirement0, - }; - partial void PreparePostEditImageArguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.EditImageRequest request); - partial void PreparePostEditImageRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.EditImageRequest request); - partial void ProcessPostEditImageResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostEditImageResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Edit (legacy)
- /// Edit a given image synchronously using the provided mask. The mask indicates which part of the image
- /// should be edited, while the prompt and chosen style type can further guide the edit.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostEditImageAsync( - - global::Ideogram.EditImageRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostEditImageAsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Edit (legacy)
- /// Edit a given image synchronously using the provided mask. The mask indicates which part of the image
- /// should be edited, while the prompt and chosen style type can further guide the edit.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostEditImageAsResponseAsync( - - global::Ideogram.EditImageRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostEditImageArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostEditImageSecurityRequirements, - operationName: "PostEditImageAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/edit", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - var __contentImageFile = new global::System.Net.Http.ByteArrayContent(request.ImageFile ?? global::System.Array.Empty()); - __contentImageFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.ImageFilename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.ImageFilename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImageFile, - name: "\"image_file\"", - fileName: request.ImageFilename != null ? $"\"{request.ImageFilename}\"" : string.Empty); - if (__contentImageFile.Headers.ContentDisposition != null) - { - __contentImageFile.Headers.ContentDisposition.FileNameStar = null; - } - - var __contentMask = new global::System.Net.Http.ByteArrayContent(request.Mask ?? global::System.Array.Empty()); - __contentMask.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Maskname is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Maskname) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentMask, - name: "\"mask\"", - fileName: request.Maskname != null ? $"\"{request.Maskname}\"" : string.Empty); - if (__contentMask.Headers.ContentDisposition != null) - { - __contentMask.Headers.ContentDisposition.FileNameStar = null; - } - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Model.ToValueString()), - name: "\"model\""); - - if (request.MagicPromptOption != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.MagicPromptOption).HasValue ? (request.MagicPromptOption).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"magic_prompt_option\""); - - } - if (request.MagicPromptSystemPromptConfigId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.MagicPromptSystemPromptConfigId ?? string.Empty), - name: "\"magic_prompt_system_prompt_config_id\""); - - } - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.StyleType != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.StyleType).HasValue ? (request.StyleType).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"style_type\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostEditImageRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostEditImage", - methodName: "PostEditImageAsync", - pathTemplate: "\"/edit\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostEditImage", - methodName: "PostEditImageAsync", - pathTemplate: "\"/edit\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostEditImage", - methodName: "PostEditImageAsync", - pathTemplate: "\"/edit\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostEditImageResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostEditImage", - methodName: "PostEditImageAsync", - pathTemplate: "\"/edit\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostEditImage", - methodName: "PostEditImageAsync", - pathTemplate: "\"/edit\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt or Initial Image failed the safety checks. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostEditImageResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.GenerateImageResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.GenerateImageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Edit (legacy)
- /// Edit a given image synchronously using the provided mask. The mask indicates which part of the image
- /// should be edited, while the prompt and chosen style type can further guide the edit.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// A black and white image of the same size as the image being edited (max size 25MB). Black regions in the mask should match up with the regions of the image that you would like to edit; only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// A black and white image of the same size as the image being edited (max size 25MB). Black regions in the mask should match up with the regions of the image that you would like to edit; only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The prompt used to describe the edited result.
- /// Example: A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there is an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset. - /// - /// - /// The model used to generate an image or edit one. /generate and /remix supports all model types, however, /edit is only supported for V_2 and V_2_TURBO.
- /// Default Value: V_2
- /// Example: V_2_TURBO - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The style type to generate with; this is only applicable for models V_2 and above and should not be specified for model versions V_1.
- /// Example: REALISTIC - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostEditImageAsync( - byte[] imageFile, - string imageFilename, - byte[] mask, - string maskname, - string prompt, - global::Ideogram.ModelEnum model = global::Ideogram.ModelEnum.V2, - global::Ideogram.MagicPromptOption? magicPromptOption = default, - string? magicPromptSystemPromptConfigId = default, - int? numImages = default, - int? seed = default, - global::Ideogram.StyleType? styleType = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.EditImageRequest - { - ImageFile = imageFile, - ImageFilename = imageFilename, - Mask = mask, - Maskname = maskname, - Prompt = prompt, - Model = model, - MagicPromptOption = magicPromptOption, - MagicPromptSystemPromptConfigId = magicPromptSystemPromptConfigId, - NumImages = numImages, - Seed = seed, - StyleType = styleType, - }; - - return await PostEditImageAsync( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - - /// - /// Edit (legacy)
- /// Edit a given image synchronously using the provided mask. The mask indicates which part of the image
- /// should be edited, while the prompt and chosen style type can further guide the edit.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// A black and white image of the same size as the image being edited (max size 25MB). Black regions in the mask should match up with the regions of the image that you would like to edit; only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// A black and white image of the same size as the image being edited (max size 25MB). Black regions in the mask should match up with the regions of the image that you would like to edit; only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The prompt used to describe the edited result.
- /// Example: A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there is an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset. - /// - /// - /// The model used to generate an image or edit one. /generate and /remix supports all model types, however, /edit is only supported for V_2 and V_2_TURBO.
- /// Default Value: V_2
- /// Example: V_2_TURBO - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The style type to generate with; this is only applicable for models V_2 and above and should not be specified for model versions V_1.
- /// Example: REALISTIC - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostEditImageAsync( - global::System.IO.Stream imageFile, - string imageFilename, - global::System.IO.Stream mask, - string maskname, - string prompt, - global::Ideogram.ModelEnum model = global::Ideogram.ModelEnum.V2, - global::Ideogram.MagicPromptOption? magicPromptOption = default, - string? magicPromptSystemPromptConfigId = default, - int? numImages = default, - int? seed = default, - global::Ideogram.StyleType? styleType = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - - imageFile = imageFile ?? throw new global::System.ArgumentNullException(nameof(imageFile)); - mask = mask ?? throw new global::System.ArgumentNullException(nameof(mask)); - var request = new global::Ideogram.EditImageRequest - { - ImageFile = global::System.Array.Empty(), - ImageFilename = imageFilename, - Mask = global::System.Array.Empty(), - Maskname = maskname, - Prompt = prompt, - Model = model, - MagicPromptOption = magicPromptOption, - MagicPromptSystemPromptConfigId = magicPromptSystemPromptConfigId, - NumImages = numImages, - Seed = seed, - StyleType = styleType, - }; - PrepareArguments( - client: HttpClient); - PreparePostEditImageArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostEditImageSecurityRequirements, - operationName: "PostEditImageAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/edit", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - var __contentImageFile = new global::System.Net.Http.StreamContent(imageFile); - __contentImageFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.ImageFilename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.ImageFilename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImageFile, - name: "\"image_file\"", - fileName: request.ImageFilename != null ? $"\"{request.ImageFilename}\"" : string.Empty); - if (__contentImageFile.Headers.ContentDisposition != null) - { - __contentImageFile.Headers.ContentDisposition.FileNameStar = null; - } - - var __contentMask = new global::System.Net.Http.StreamContent(mask); - __contentMask.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Maskname is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Maskname) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentMask, - name: "\"mask\"", - fileName: request.Maskname != null ? $"\"{request.Maskname}\"" : string.Empty); - if (__contentMask.Headers.ContentDisposition != null) - { - __contentMask.Headers.ContentDisposition.FileNameStar = null; - } - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Model.ToValueString()), - name: "\"model\""); - - if (request.MagicPromptOption != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.MagicPromptOption).HasValue ? (request.MagicPromptOption).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"magic_prompt_option\""); - - } - if (request.MagicPromptSystemPromptConfigId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.MagicPromptSystemPromptConfigId ?? string.Empty), - name: "\"magic_prompt_system_prompt_config_id\""); - - } - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.StyleType != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.StyleType).HasValue ? (request.StyleType).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"style_type\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostEditImageRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostEditImage", - methodName: "PostEditImageAsync", - pathTemplate: "\"/edit\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostEditImage", - methodName: "PostEditImageAsync", - pathTemplate: "\"/edit\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostEditImage", - methodName: "PostEditImageAsync", - pathTemplate: "\"/edit\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostEditImageResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostEditImage", - methodName: "PostEditImageAsync", - pathTemplate: "\"/edit\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostEditImage", - methodName: "PostEditImageAsync", - pathTemplate: "\"/edit\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt or Initial Image failed the safety checks. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostEditImageResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::Ideogram.GenerateImageResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - return - await global::Ideogram.GenerateImageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Edit (legacy)
- /// Edit a given image synchronously using the provided mask. The mask indicates which part of the image
- /// should be edited, while the prompt and chosen style type can further guide the edit.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// A black and white image of the same size as the image being edited (max size 25MB). Black regions in the mask should match up with the regions of the image that you would like to edit; only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// A black and white image of the same size as the image being edited (max size 25MB). Black regions in the mask should match up with the regions of the image that you would like to edit; only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The prompt used to describe the edited result.
- /// Example: A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there is an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset. - /// - /// - /// The model used to generate an image or edit one. /generate and /remix supports all model types, however, /edit is only supported for V_2 and V_2_TURBO.
- /// Default Value: V_2
- /// Example: V_2_TURBO - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The style type to generate with; this is only applicable for models V_2 and above and should not be specified for model versions V_1.
- /// Example: REALISTIC - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostEditImageAsResponseAsync( - global::System.IO.Stream imageFile, - string imageFilename, - global::System.IO.Stream mask, - string maskname, - string prompt, - global::Ideogram.ModelEnum model = global::Ideogram.ModelEnum.V2, - global::Ideogram.MagicPromptOption? magicPromptOption = default, - string? magicPromptSystemPromptConfigId = default, - int? numImages = default, - int? seed = default, - global::Ideogram.StyleType? styleType = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - - imageFile = imageFile ?? throw new global::System.ArgumentNullException(nameof(imageFile)); - mask = mask ?? throw new global::System.ArgumentNullException(nameof(mask)); - var request = new global::Ideogram.EditImageRequest - { - ImageFile = global::System.Array.Empty(), - ImageFilename = imageFilename, - Mask = global::System.Array.Empty(), - Maskname = maskname, - Prompt = prompt, - Model = model, - MagicPromptOption = magicPromptOption, - MagicPromptSystemPromptConfigId = magicPromptSystemPromptConfigId, - NumImages = numImages, - Seed = seed, - StyleType = styleType, - }; - PrepareArguments( - client: HttpClient); - PreparePostEditImageArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostEditImageSecurityRequirements, - operationName: "PostEditImageAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/edit", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - var __contentImageFile = new global::System.Net.Http.StreamContent(imageFile); - __contentImageFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.ImageFilename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.ImageFilename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImageFile, - name: "\"image_file\"", - fileName: request.ImageFilename != null ? $"\"{request.ImageFilename}\"" : string.Empty); - if (__contentImageFile.Headers.ContentDisposition != null) - { - __contentImageFile.Headers.ContentDisposition.FileNameStar = null; - } - - var __contentMask = new global::System.Net.Http.StreamContent(mask); - __contentMask.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Maskname is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Maskname) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentMask, - name: "\"mask\"", - fileName: request.Maskname != null ? $"\"{request.Maskname}\"" : string.Empty); - if (__contentMask.Headers.ContentDisposition != null) - { - __contentMask.Headers.ContentDisposition.FileNameStar = null; - } - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Model.ToValueString()), - name: "\"model\""); - - if (request.MagicPromptOption != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.MagicPromptOption).HasValue ? (request.MagicPromptOption).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"magic_prompt_option\""); - - } - if (request.MagicPromptSystemPromptConfigId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.MagicPromptSystemPromptConfigId ?? string.Empty), - name: "\"magic_prompt_system_prompt_config_id\""); - - } - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.StyleType != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.StyleType).HasValue ? (request.StyleType).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"style_type\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostEditImageRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostEditImage", - methodName: "PostEditImageAsync", - pathTemplate: "\"/edit\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostEditImage", - methodName: "PostEditImageAsync", - pathTemplate: "\"/edit\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostEditImage", - methodName: "PostEditImageAsync", - pathTemplate: "\"/edit\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostEditImageResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostEditImage", - methodName: "PostEditImageAsync", - pathTemplate: "\"/edit\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostEditImage", - methodName: "PostEditImageAsync", - pathTemplate: "\"/edit\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt or Initial Image failed the safety checks. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostEditImageResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.GenerateImageResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.GenerateImageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateDesignV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateDesignV3.g.cs deleted file mode 100644 index 8d60e338..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateDesignV3.g.cs +++ /dev/null @@ -1,1094 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class GenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostGenerateDesignV3SecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostGenerateDesignV3SecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostGenerateDesignV3SecurityRequirement0, - }; - partial void PreparePostGenerateDesignV3Arguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.GenerateDesignRequestV3 request); - partial void PreparePostGenerateDesignV3Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.GenerateDesignRequestV3 request); - partial void ProcessPostGenerateDesignV3Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostGenerateDesignV3ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Generate a design from a text prompt with text detection and correction
- /// Generates a design synchronously from a text prompt using the Ideogram 3.0 model, then detects and corrects text layers within the generated image.
- /// The response includes the generated image URL along with detected text layers (with font, size, color, position) and image asset layers.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateDesignV3Async( - - global::Ideogram.GenerateDesignRequestV3 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostGenerateDesignV3AsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Generate a design from a text prompt with text detection and correction
- /// Generates a design synchronously from a text prompt using the Ideogram 3.0 model, then detects and corrects text layers within the generated image.
- /// The response includes the generated image URL along with detected text layers (with font, size, color, position) and image asset layers.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostGenerateDesignV3AsResponseAsync( - - global::Ideogram.GenerateDesignRequestV3 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostGenerateDesignV3Arguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostGenerateDesignV3SecurityRequirements, - operationName: "PostGenerateDesignV3Async"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/ideogram-v3/generate-design", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.Resolution != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"resolution\""); - - } - if (request.AspectRatio != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.AspectRatio).HasValue ? (request.AspectRatio).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"aspect_ratio\""); - - } - if (request.RenderingSpeed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"rendering_speed\""); - - } - if (request.MagicPrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.MagicPrompt).HasValue ? (request.MagicPrompt).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"magic_prompt\""); - - } - if (request.MagicPromptSystemPromptConfigId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.MagicPromptSystemPromptConfigId ?? string.Empty), - name: "\"magic_prompt_system_prompt_config_id\""); - - } - if (request.NegativePrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.NegativePrompt ?? string.Empty), - name: "\"negative_prompt\""); - - } - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.ColorPalette != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ColorPalette.ToString() ?? string.Empty), - name: "\"color_palette\""); - - } - if (request.StyleCodes != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.StyleCodes!, x => x))}]"), - name: "\"style_codes\""); - - } - if (request.StyleType != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.StyleType).HasValue ? (request.StyleType).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"style_type\""); - - } - if (request.StylePreset != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.StylePreset).HasValue ? (request.StylePreset).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"style_preset\""); - - } - if (request.CustomModelUri != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.CustomModelUri ?? string.Empty), - name: "\"custom_model_uri\""); - - } - if (request.FontFileH1 != default) - { - - var __contentFontFileH1 = new global::System.Net.Http.ByteArrayContent(request.FontFileH1 ?? global::System.Array.Empty()); - __contentFontFileH1.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.FontFileH1name is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.FontFileH1name) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentFontFileH1, - name: "\"font_file_h1\"", - fileName: request.FontFileH1name != null ? $"\"{request.FontFileH1name}\"" : string.Empty); - if (__contentFontFileH1.Headers.ContentDisposition != null) - { - __contentFontFileH1.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.FontNameH1 != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.FontNameH1 ?? string.Empty), - name: "\"font_name_h1\""); - - } - if (request.FontFileH2 != default) - { - - var __contentFontFileH2 = new global::System.Net.Http.ByteArrayContent(request.FontFileH2 ?? global::System.Array.Empty()); - __contentFontFileH2.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.FontFileH2name is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.FontFileH2name) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentFontFileH2, - name: "\"font_file_h2\"", - fileName: request.FontFileH2name != null ? $"\"{request.FontFileH2name}\"" : string.Empty); - if (__contentFontFileH2.Headers.ContentDisposition != null) - { - __contentFontFileH2.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.FontNameH2 != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.FontNameH2 ?? string.Empty), - name: "\"font_name_h2\""); - - } - if (request.FontFileBody != default) - { - - var __contentFontFileBody = new global::System.Net.Http.ByteArrayContent(request.FontFileBody ?? global::System.Array.Empty()); - __contentFontFileBody.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.FontFileBodyname is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.FontFileBodyname) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentFontFileBody, - name: "\"font_file_body\"", - fileName: request.FontFileBodyname != null ? $"\"{request.FontFileBodyname}\"" : string.Empty); - if (__contentFontFileBody.Headers.ContentDisposition != null) - { - __contentFontFileBody.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.FontNameBody != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.FontNameBody ?? string.Empty), - name: "\"font_name_body\""); - - } - if (request.FontFileSmall != default) - { - - var __contentFontFileSmall = new global::System.Net.Http.ByteArrayContent(request.FontFileSmall ?? global::System.Array.Empty()); - __contentFontFileSmall.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.FontFileSmallname is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.FontFileSmallname) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentFontFileSmall, - name: "\"font_file_small\"", - fileName: request.FontFileSmallname != null ? $"\"{request.FontFileSmallname}\"" : string.Empty); - if (__contentFontFileSmall.Headers.ContentDisposition != null) - { - __contentFontFileSmall.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.FontNameSmall != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.FontNameSmall ?? string.Empty), - name: "\"font_name_small\""); - - } - if (request.StyleReferenceImages != default) - { - - for (var __iStyleReferenceImages = 0; __iStyleReferenceImages < request.StyleReferenceImages.Count; __iStyleReferenceImages++) - { - var __contentStyleReferenceImages = new global::System.Net.Http.ByteArrayContent(request.StyleReferenceImages[__iStyleReferenceImages]); - __contentStyleReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); - __httpRequestContent.Add( - content: __contentStyleReferenceImages, - name: "\"style_reference_images\"", - fileName: $"\"file{__iStyleReferenceImages}.bin\""); - if (__contentStyleReferenceImages.Headers.ContentDisposition != null) - { - __contentStyleReferenceImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - if (request.ReferenceAssetImages != default) - { - - for (var __iReferenceAssetImages = 0; __iReferenceAssetImages < request.ReferenceAssetImages.Count; __iReferenceAssetImages++) - { - var __contentReferenceAssetImages = new global::System.Net.Http.ByteArrayContent(request.ReferenceAssetImages[__iReferenceAssetImages]); - __contentReferenceAssetImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); - __httpRequestContent.Add( - content: __contentReferenceAssetImages, - name: "\"reference_asset_images\"", - fileName: $"\"file{__iReferenceAssetImages}.bin\""); - if (__contentReferenceAssetImages.Headers.ContentDisposition != null) - { - __contentReferenceAssetImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostGenerateDesignV3Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateDesignV3", - methodName: "PostGenerateDesignV3Async", - pathTemplate: "\"/v1/ideogram-v3/generate-design\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateDesignV3", - methodName: "PostGenerateDesignV3Async", - pathTemplate: "\"/v1/ideogram-v3/generate-design\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateDesignV3", - methodName: "PostGenerateDesignV3Async", - pathTemplate: "\"/v1/ideogram-v3/generate-design\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostGenerateDesignV3Response( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateDesignV3", - methodName: "PostGenerateDesignV3Async", - pathTemplate: "\"/v1/ideogram-v3/generate-design\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateDesignV3", - methodName: "PostGenerateDesignV3Async", - pathTemplate: "\"/v1/ideogram-v3/generate-design\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt failed the safety check. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostGenerateDesignV3ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.LayeredImageGenerationResponseV3.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.LayeredImageGenerationResponseV3.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Generate a design from a text prompt with text detection and correction
- /// Generates a design synchronously from a text prompt using the Ideogram 3.0 model, then detects and corrects text layers within the generated image.
- /// The response includes the generated image URL along with detected text layers (with font, size, color, position) and image asset layers.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The prompt to use to generate the design.
- /// Example: A birthday card saying 'Happy Birthday' - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The resolutions supported for Ideogram 3.0.
- /// Example: 1280x800 - /// - /// - /// Output aspect ratio. Cannot be combined with resolution. Generation defaults to 1x1; remix keeps the source ratio when both fields are omitted. - /// - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// Description of what to exclude from a design. Descriptions in the prompt take precedence
- /// to descriptions in the negative prompt.
- /// Example: brush strokes, painting - /// - /// - /// Number of designs to generate.
- /// Default Value: 1 - /// - /// - /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). Not supported by V_1, V_1_TURBO, V_2A and V_2A_TURBO models. - /// - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - /// - /// - /// The style type to generate with.
- /// Default Value: GENERAL
- /// Example: GENERAL - /// - /// - /// A predefined style preset that applies a specific artistic style to the generated image.
- /// Example: BRIGHT_ART - /// - /// - /// A custom model URI in the format model/<model_name>/version/<version_name>.
- /// When provided, the model version and style will be resolved from this URI, and style_type is not required.
- /// Example: model/my-custom-model/version/1 - /// - /// - /// Custom font file for H1 (heading) text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_h1. - /// - /// - /// Custom font file for H1 (heading) text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_h1. - /// - /// - /// Font name from the available font library for H1 text. Ignored if font_file_h1 is provided.
- /// Example: Ubuntu-Bold.ttf - /// - /// - /// Custom font file for H2 (subheading) text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_h2. - /// - /// - /// Custom font file for H2 (subheading) text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_h2. - /// - /// - /// Font name from the available font library for H2 text. Ignored if font_file_h2 is provided. - /// - /// - /// Custom font file for body text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_body. - /// - /// - /// Custom font file for body text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_body. - /// - /// - /// Font name from the available font library for body text. Ignored if font_file_body is provided. - /// - /// - /// Custom font file for small/caption text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_small. - /// - /// - /// Custom font file for small/caption text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_small. - /// - /// - /// Font name from the available font library for small text. Ignored if font_file_small is provided. - /// - /// - /// A set of images to use as style references (max size 25MB per image; the whole request must stay under 50MB). The images should be in JPEG, PNG or WebP format. - /// - /// - /// A set of asset images (e.g., logos, icons) to use as references for detection and replacement (maximum 10 images). The images should be in JPEG, PNG or WebP format. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateDesignV3Async( - string prompt, - int? seed = default, - global::Ideogram.ResolutionV3? resolution = default, - global::Ideogram.AspectRatioV3? aspectRatio = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - global::Ideogram.MagicPromptOption? magicPrompt = default, - string? magicPromptSystemPromptConfigId = default, - string? negativePrompt = default, - int? numImages = default, - global::Ideogram.ColorPaletteWithPresetNameOrMembers? colorPalette = default, - global::System.Collections.Generic.IList? styleCodes = default, - global::Ideogram.StyleTypeV3? styleType = default, - global::Ideogram.StylePresetV3? stylePreset = default, - string? customModelUri = default, - byte[]? fontFileH1 = default, - string? fontFileH1name = default, - string? fontNameH1 = default, - byte[]? fontFileH2 = default, - string? fontFileH2name = default, - string? fontNameH2 = default, - byte[]? fontFileBody = default, - string? fontFileBodyname = default, - string? fontNameBody = default, - byte[]? fontFileSmall = default, - string? fontFileSmallname = default, - string? fontNameSmall = default, - global::System.Collections.Generic.IList? styleReferenceImages = default, - global::System.Collections.Generic.IList? referenceAssetImages = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.GenerateDesignRequestV3 - { - Prompt = prompt, - Seed = seed, - Resolution = resolution, - AspectRatio = aspectRatio, - RenderingSpeed = renderingSpeed, - MagicPrompt = magicPrompt, - MagicPromptSystemPromptConfigId = magicPromptSystemPromptConfigId, - NegativePrompt = negativePrompt, - NumImages = numImages, - ColorPalette = colorPalette, - StyleCodes = styleCodes, - StyleType = styleType, - StylePreset = stylePreset, - CustomModelUri = customModelUri, - FontFileH1 = fontFileH1, - FontFileH1name = fontFileH1name, - FontNameH1 = fontNameH1, - FontFileH2 = fontFileH2, - FontFileH2name = fontFileH2name, - FontNameH2 = fontNameH2, - FontFileBody = fontFileBody, - FontFileBodyname = fontFileBodyname, - FontNameBody = fontNameBody, - FontFileSmall = fontFileSmall, - FontFileSmallname = fontFileSmallname, - FontNameSmall = fontNameSmall, - StyleReferenceImages = styleReferenceImages, - ReferenceAssetImages = referenceAssetImages, - }; - - return await PostGenerateDesignV3Async( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateDesignV4.g.cs b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateDesignV4.g.cs deleted file mode 100644 index 537d5c29..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateDesignV4.g.cs +++ /dev/null @@ -1,759 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class GenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostGenerateDesignV4SecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostGenerateDesignV4SecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostGenerateDesignV4SecurityRequirement0, - }; - partial void PreparePostGenerateDesignV4Arguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.GenerateDesignRequestV4 request); - partial void PreparePostGenerateDesignV4Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.GenerateDesignRequestV4 request); - partial void ProcessPostGenerateDesignV4Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostGenerateDesignV4ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Generate an editable design with Ideogram 4.0 HTML
- /// Experimental prototype endpoint for generating an editable V4 HTML design from a prompt.
- /// Optionally accepts inspiration reference images to guide transferable visual style. Inspiration images are design/style references only and are not edit targets.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateDesignV4Async( - - global::Ideogram.GenerateDesignRequestV4 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostGenerateDesignV4AsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Generate an editable design with Ideogram 4.0 HTML
- /// Experimental prototype endpoint for generating an editable V4 HTML design from a prompt.
- /// Optionally accepts inspiration reference images to guide transferable visual style. Inspiration images are design/style references only and are not edit targets.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostGenerateDesignV4AsResponseAsync( - - global::Ideogram.GenerateDesignRequestV4 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostGenerateDesignV4Arguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostGenerateDesignV4SecurityRequirements, - operationName: "PostGenerateDesignV4Async"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/ideogram-v4/generate-design", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - __httpRequest.Headers.TryAddWithoutValidation( - "Accept", - "application/json"); - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.MagicPromptOption != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.MagicPromptOption).HasValue ? (request.MagicPromptOption).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"magic_prompt_option\""); - - } - if (request.MagicPromptSystemPromptConfigId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.MagicPromptSystemPromptConfigId ?? string.Empty), - name: "\"magic_prompt_system_prompt_config_id\""); - - } - if (request.Resolution != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"resolution\""); - - } - if (request.RenderingSpeed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"rendering_speed\""); - - } - if (request.InspirationReferenceImages != default) - { - - for (var __iInspirationReferenceImages = 0; __iInspirationReferenceImages < request.InspirationReferenceImages.Count; __iInspirationReferenceImages++) - { - var __contentInspirationReferenceImages = new global::System.Net.Http.ByteArrayContent(request.InspirationReferenceImages[__iInspirationReferenceImages]); - __contentInspirationReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); - __httpRequestContent.Add( - content: __contentInspirationReferenceImages, - name: "\"inspiration_reference_images\"", - fileName: $"\"file{__iInspirationReferenceImages}.bin\""); - if (__contentInspirationReferenceImages.Headers.ContentDisposition != null) - { - __contentInspirationReferenceImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - if (request.InspirationReferenceModel != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.InspirationReferenceModel).HasValue ? (request.InspirationReferenceModel).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"inspiration_reference_model\""); - - } - if (request.ArtifactGenerationModel != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.ArtifactGenerationModel).HasValue ? (request.ArtifactGenerationModel).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"artifact_generation_model\""); - - } - if (request.Layout2imageVariant != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Layout2imageVariant).HasValue ? (request.Layout2imageVariant).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"layout2image_variant\""); - - } - if (request.ResponseType != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.ResponseType).HasValue ? (request.ResponseType).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"response_type\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostGenerateDesignV4Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateDesignV4", - methodName: "PostGenerateDesignV4Async", - pathTemplate: "\"/v1/ideogram-v4/generate-design\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateDesignV4", - methodName: "PostGenerateDesignV4Async", - pathTemplate: "\"/v1/ideogram-v4/generate-design\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateDesignV4", - methodName: "PostGenerateDesignV4Async", - pathTemplate: "\"/v1/ideogram-v4/generate-design\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostGenerateDesignV4Response( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateDesignV4", - methodName: "PostGenerateDesignV4Async", - pathTemplate: "\"/v1/ideogram-v4/generate-design\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateDesignV4", - methodName: "PostGenerateDesignV4Async", - pathTemplate: "\"/v1/ideogram-v4/generate-design\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt failed the safety check. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostGenerateDesignV4ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.PostGenerateDesignV4200Response.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.PostGenerateDesignV4200Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Generate an editable design with Ideogram 4.0 HTML
- /// Experimental prototype endpoint for generating an editable V4 HTML design from a prompt.
- /// Optionally accepts inspiration reference images to guide transferable visual style. Inspiration images are design/style references only and are not edit targets.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The text prompt for editable design generation. - /// - /// - /// Random seed for reproducibility. - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// The resolutions supported for Ideogram 4.0 layout-to-image and design generation.
- /// Example: 1024x1024 - /// - /// - /// The rendering speed to use. For Ideogram V4, `rendering_speed=FLASH`
- /// is coming soon; requests with `rendering_speed=FLASH` currently
- /// return a 400. - /// - /// - /// Experimental. Up to 4 static inspiration images used as transferable visual style references for V4 layout-to-image design. Images are not edit targets and are not inserted into the generated HTML layout. Supported formats are JPEG, PNG, and WebP (max size 25MB each). Animated images are not supported. - /// - /// - /// Experimental. Model to use for the inspiration vision prepass.
- /// Default Value: claude-sonnet-4-6 - /// - /// - /// Experimental. Model to use for the HTML/layout and base-plate handoff generation call.
- /// Default Value: claude-sonnet-4-6 - /// - /// - /// Experimental. Staging only. Select a v4 layout-to-image pipeline variant.
- /// Omit for the default v4l2i path. Rejected on production. - /// - /// - /// layered (default): full editable design payload with text layers and HTML.
- /// url: JSON with an expiring link to the final composited cover image.
- /// binary: raw PNG bytes of the final composited cover image (Content-Type image/png).
- /// html: raw HTML document of the generated layout (Content-Type text/html).
- /// Default Value: layered - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateDesignV4Async( - string prompt, - int? seed = default, - global::Ideogram.MagicPromptOption? magicPromptOption = default, - string? magicPromptSystemPromptConfigId = default, - global::Ideogram.ResolutionV4Layout? resolution = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - global::System.Collections.Generic.IList? inspirationReferenceImages = default, - global::Ideogram.GenerateDesignRequestV4InspirationReferenceModel? inspirationReferenceModel = default, - global::Ideogram.GenerateDesignRequestV4ArtifactGenerationModel? artifactGenerationModel = default, - global::Ideogram.GenerateDesignRequestV4Layout2imageVariant? layout2imageVariant = default, - global::Ideogram.GenerateDesignRequestV4ResponseType? responseType = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.GenerateDesignRequestV4 - { - Prompt = prompt, - Seed = seed, - MagicPromptOption = magicPromptOption, - MagicPromptSystemPromptConfigId = magicPromptSystemPromptConfigId, - Resolution = resolution, - RenderingSpeed = renderingSpeed, - InspirationReferenceImages = inspirationReferenceImages, - InspirationReferenceModel = inspirationReferenceModel, - ArtifactGenerationModel = artifactGenerationModel, - Layout2imageVariant = layout2imageVariant, - ResponseType = responseType, - }; - - return await PostGenerateDesignV4Async( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateDesignV4AsBytes.g.cs b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateDesignV4AsBytes.g.cs deleted file mode 100644 index c126da31..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateDesignV4AsBytes.g.cs +++ /dev/null @@ -1,1307 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class GenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostGenerateDesignV4AsBytesSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostGenerateDesignV4AsBytesSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostGenerateDesignV4AsBytesSecurityRequirement0, - }; - partial void PreparePostGenerateDesignV4AsBytesArguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.GenerateDesignRequestV4 request); - partial void PreparePostGenerateDesignV4AsBytesRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.GenerateDesignRequestV4 request); - partial void ProcessPostGenerateDesignV4AsBytesResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostGenerateDesignV4AsBytesResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref byte[] content); - - /// - /// Generate an editable design with Ideogram 4.0 HTML
- /// Experimental prototype endpoint for generating an editable V4 HTML design from a prompt.
- /// Optionally accepts inspiration reference images to guide transferable visual style. Inspiration images are design/style references only and are not edit targets.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateDesignV4AsBytesAsync( - - global::Ideogram.GenerateDesignRequestV4 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostGenerateDesignV4AsBytesAsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Generate an editable design with Ideogram 4.0 HTML
- /// Experimental prototype endpoint for generating an editable V4 HTML design from a prompt.
- /// Optionally accepts inspiration reference images to guide transferable visual style. Inspiration images are design/style references only and are not edit targets.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateDesignV4AsBytesAsStreamAsync( - - global::Ideogram.GenerateDesignRequestV4 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostGenerateDesignV4AsBytesArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostGenerateDesignV4AsBytesSecurityRequirements, - operationName: "PostGenerateDesignV4AsBytesAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/ideogram-v4/generate-design", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - __httpRequest.Headers.TryAddWithoutValidation( - "Accept", - "image/png"); - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.MagicPromptOption != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.MagicPromptOption).HasValue ? (request.MagicPromptOption).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"magic_prompt_option\""); - - } - if (request.MagicPromptSystemPromptConfigId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.MagicPromptSystemPromptConfigId ?? string.Empty), - name: "\"magic_prompt_system_prompt_config_id\""); - - } - if (request.Resolution != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"resolution\""); - - } - if (request.RenderingSpeed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"rendering_speed\""); - - } - if (request.InspirationReferenceImages != default) - { - - for (var __iInspirationReferenceImages = 0; __iInspirationReferenceImages < request.InspirationReferenceImages.Count; __iInspirationReferenceImages++) - { - var __contentInspirationReferenceImages = new global::System.Net.Http.ByteArrayContent(request.InspirationReferenceImages[__iInspirationReferenceImages]); - __contentInspirationReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); - __httpRequestContent.Add( - content: __contentInspirationReferenceImages, - name: "\"inspiration_reference_images\"", - fileName: $"\"file{__iInspirationReferenceImages}.bin\""); - if (__contentInspirationReferenceImages.Headers.ContentDisposition != null) - { - __contentInspirationReferenceImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - if (request.InspirationReferenceModel != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.InspirationReferenceModel).HasValue ? (request.InspirationReferenceModel).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"inspiration_reference_model\""); - - } - if (request.ArtifactGenerationModel != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.ArtifactGenerationModel).HasValue ? (request.ArtifactGenerationModel).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"artifact_generation_model\""); - - } - if (request.Layout2imageVariant != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Layout2imageVariant).HasValue ? (request.Layout2imageVariant).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"layout2image_variant\""); - - } - if (request.ResponseType != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.ResponseType).HasValue ? (request.ResponseType).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"response_type\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostGenerateDesignV4AsBytesRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateDesignV4AsBytes", - methodName: "PostGenerateDesignV4AsBytesAsync", - pathTemplate: "\"/v1/ideogram-v4/generate-design\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseHeadersRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateDesignV4AsBytes", - methodName: "PostGenerateDesignV4AsBytesAsync", - pathTemplate: "\"/v1/ideogram-v4/generate-design\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateDesignV4AsBytes", - methodName: "PostGenerateDesignV4AsBytesAsync", - pathTemplate: "\"/v1/ideogram-v4/generate-design\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - try - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostGenerateDesignV4AsBytesResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateDesignV4AsBytes", - methodName: "PostGenerateDesignV4AsBytesAsync", - pathTemplate: "\"/v1/ideogram-v4/generate-design\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateDesignV4AsBytes", - methodName: "PostGenerateDesignV4AsBytesAsync", - pathTemplate: "\"/v1/ideogram-v4/generate-design\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt failed the safety check. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - return new global::Ideogram.ResponseStream(__response, __content); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - } - catch - { - __response.Dispose(); - throw; - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Generate an editable design with Ideogram 4.0 HTML
- /// Experimental prototype endpoint for generating an editable V4 HTML design from a prompt.
- /// Optionally accepts inspiration reference images to guide transferable visual style. Inspiration images are design/style references only and are not edit targets.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostGenerateDesignV4AsBytesAsResponseAsync( - - global::Ideogram.GenerateDesignRequestV4 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostGenerateDesignV4AsBytesArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostGenerateDesignV4AsBytesSecurityRequirements, - operationName: "PostGenerateDesignV4AsBytesAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/ideogram-v4/generate-design", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - __httpRequest.Headers.TryAddWithoutValidation( - "Accept", - "image/png"); - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.MagicPromptOption != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.MagicPromptOption).HasValue ? (request.MagicPromptOption).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"magic_prompt_option\""); - - } - if (request.MagicPromptSystemPromptConfigId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.MagicPromptSystemPromptConfigId ?? string.Empty), - name: "\"magic_prompt_system_prompt_config_id\""); - - } - if (request.Resolution != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"resolution\""); - - } - if (request.RenderingSpeed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"rendering_speed\""); - - } - if (request.InspirationReferenceImages != default) - { - - for (var __iInspirationReferenceImages = 0; __iInspirationReferenceImages < request.InspirationReferenceImages.Count; __iInspirationReferenceImages++) - { - var __contentInspirationReferenceImages = new global::System.Net.Http.ByteArrayContent(request.InspirationReferenceImages[__iInspirationReferenceImages]); - __contentInspirationReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); - __httpRequestContent.Add( - content: __contentInspirationReferenceImages, - name: "\"inspiration_reference_images\"", - fileName: $"\"file{__iInspirationReferenceImages}.bin\""); - if (__contentInspirationReferenceImages.Headers.ContentDisposition != null) - { - __contentInspirationReferenceImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - if (request.InspirationReferenceModel != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.InspirationReferenceModel).HasValue ? (request.InspirationReferenceModel).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"inspiration_reference_model\""); - - } - if (request.ArtifactGenerationModel != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.ArtifactGenerationModel).HasValue ? (request.ArtifactGenerationModel).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"artifact_generation_model\""); - - } - if (request.Layout2imageVariant != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Layout2imageVariant).HasValue ? (request.Layout2imageVariant).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"layout2image_variant\""); - - } - if (request.ResponseType != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.ResponseType).HasValue ? (request.ResponseType).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"response_type\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostGenerateDesignV4AsBytesRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateDesignV4AsBytes", - methodName: "PostGenerateDesignV4AsBytesAsync", - pathTemplate: "\"/v1/ideogram-v4/generate-design\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateDesignV4AsBytes", - methodName: "PostGenerateDesignV4AsBytesAsync", - pathTemplate: "\"/v1/ideogram-v4/generate-design\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateDesignV4AsBytes", - methodName: "PostGenerateDesignV4AsBytesAsync", - pathTemplate: "\"/v1/ideogram-v4/generate-design\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostGenerateDesignV4AsBytesResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateDesignV4AsBytes", - methodName: "PostGenerateDesignV4AsBytesAsync", - pathTemplate: "\"/v1/ideogram-v4/generate-design\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateDesignV4AsBytes", - methodName: "PostGenerateDesignV4AsBytesAsync", - pathTemplate: "\"/v1/ideogram-v4/generate-design\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt failed the safety check. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsByteArrayAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessPostGenerateDesignV4AsBytesResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __content); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: null, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsByteArrayAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __content); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Generate an editable design with Ideogram 4.0 HTML
- /// Experimental prototype endpoint for generating an editable V4 HTML design from a prompt.
- /// Optionally accepts inspiration reference images to guide transferable visual style. Inspiration images are design/style references only and are not edit targets.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The text prompt for editable design generation. - /// - /// - /// Random seed for reproducibility. - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// The resolutions supported for Ideogram 4.0 layout-to-image and design generation.
- /// Example: 1024x1024 - /// - /// - /// The rendering speed to use. For Ideogram V4, `rendering_speed=FLASH`
- /// is coming soon; requests with `rendering_speed=FLASH` currently
- /// return a 400. - /// - /// - /// Experimental. Up to 4 static inspiration images used as transferable visual style references for V4 layout-to-image design. Images are not edit targets and are not inserted into the generated HTML layout. Supported formats are JPEG, PNG, and WebP (max size 25MB each). Animated images are not supported. - /// - /// - /// Experimental. Model to use for the inspiration vision prepass.
- /// Default Value: claude-sonnet-4-6 - /// - /// - /// Experimental. Model to use for the HTML/layout and base-plate handoff generation call.
- /// Default Value: claude-sonnet-4-6 - /// - /// - /// Experimental. Staging only. Select a v4 layout-to-image pipeline variant.
- /// Omit for the default v4l2i path. Rejected on production. - /// - /// - /// layered (default): full editable design payload with text layers and HTML.
- /// url: JSON with an expiring link to the final composited cover image.
- /// binary: raw PNG bytes of the final composited cover image (Content-Type image/png).
- /// html: raw HTML document of the generated layout (Content-Type text/html).
- /// Default Value: layered - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateDesignV4AsBytesAsync( - string prompt, - int? seed = default, - global::Ideogram.MagicPromptOption? magicPromptOption = default, - string? magicPromptSystemPromptConfigId = default, - global::Ideogram.ResolutionV4Layout? resolution = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - global::System.Collections.Generic.IList? inspirationReferenceImages = default, - global::Ideogram.GenerateDesignRequestV4InspirationReferenceModel? inspirationReferenceModel = default, - global::Ideogram.GenerateDesignRequestV4ArtifactGenerationModel? artifactGenerationModel = default, - global::Ideogram.GenerateDesignRequestV4Layout2imageVariant? layout2imageVariant = default, - global::Ideogram.GenerateDesignRequestV4ResponseType? responseType = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.GenerateDesignRequestV4 - { - Prompt = prompt, - Seed = seed, - MagicPromptOption = magicPromptOption, - MagicPromptSystemPromptConfigId = magicPromptSystemPromptConfigId, - Resolution = resolution, - RenderingSpeed = renderingSpeed, - InspirationReferenceImages = inspirationReferenceImages, - InspirationReferenceModel = inspirationReferenceModel, - ArtifactGenerationModel = artifactGenerationModel, - Layout2imageVariant = layout2imageVariant, - ResponseType = responseType, - }; - - return await PostGenerateDesignV4AsBytesAsync( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateDesignV4AsText.g.cs b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateDesignV4AsText.g.cs deleted file mode 100644 index 40645023..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateDesignV4AsText.g.cs +++ /dev/null @@ -1,755 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class GenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostGenerateDesignV4AsTextSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostGenerateDesignV4AsTextSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostGenerateDesignV4AsTextSecurityRequirement0, - }; - partial void PreparePostGenerateDesignV4AsTextArguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.GenerateDesignRequestV4 request); - partial void PreparePostGenerateDesignV4AsTextRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.GenerateDesignRequestV4 request); - partial void ProcessPostGenerateDesignV4AsTextResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostGenerateDesignV4AsTextResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Generate an editable design with Ideogram 4.0 HTML
- /// Experimental prototype endpoint for generating an editable V4 HTML design from a prompt.
- /// Optionally accepts inspiration reference images to guide transferable visual style. Inspiration images are design/style references only and are not edit targets.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateDesignV4AsTextAsync( - - global::Ideogram.GenerateDesignRequestV4 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostGenerateDesignV4AsTextAsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Generate an editable design with Ideogram 4.0 HTML
- /// Experimental prototype endpoint for generating an editable V4 HTML design from a prompt.
- /// Optionally accepts inspiration reference images to guide transferable visual style. Inspiration images are design/style references only and are not edit targets.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostGenerateDesignV4AsTextAsResponseAsync( - - global::Ideogram.GenerateDesignRequestV4 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostGenerateDesignV4AsTextArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostGenerateDesignV4AsTextSecurityRequirements, - operationName: "PostGenerateDesignV4AsTextAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/ideogram-v4/generate-design", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - __httpRequest.Headers.TryAddWithoutValidation( - "Accept", - "text/html"); - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.MagicPromptOption != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.MagicPromptOption).HasValue ? (request.MagicPromptOption).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"magic_prompt_option\""); - - } - if (request.MagicPromptSystemPromptConfigId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.MagicPromptSystemPromptConfigId ?? string.Empty), - name: "\"magic_prompt_system_prompt_config_id\""); - - } - if (request.Resolution != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"resolution\""); - - } - if (request.RenderingSpeed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"rendering_speed\""); - - } - if (request.InspirationReferenceImages != default) - { - - for (var __iInspirationReferenceImages = 0; __iInspirationReferenceImages < request.InspirationReferenceImages.Count; __iInspirationReferenceImages++) - { - var __contentInspirationReferenceImages = new global::System.Net.Http.ByteArrayContent(request.InspirationReferenceImages[__iInspirationReferenceImages]); - __contentInspirationReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); - __httpRequestContent.Add( - content: __contentInspirationReferenceImages, - name: "\"inspiration_reference_images\"", - fileName: $"\"file{__iInspirationReferenceImages}.bin\""); - if (__contentInspirationReferenceImages.Headers.ContentDisposition != null) - { - __contentInspirationReferenceImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - if (request.InspirationReferenceModel != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.InspirationReferenceModel).HasValue ? (request.InspirationReferenceModel).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"inspiration_reference_model\""); - - } - if (request.ArtifactGenerationModel != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.ArtifactGenerationModel).HasValue ? (request.ArtifactGenerationModel).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"artifact_generation_model\""); - - } - if (request.Layout2imageVariant != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Layout2imageVariant).HasValue ? (request.Layout2imageVariant).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"layout2image_variant\""); - - } - if (request.ResponseType != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.ResponseType).HasValue ? (request.ResponseType).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"response_type\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostGenerateDesignV4AsTextRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateDesignV4AsText", - methodName: "PostGenerateDesignV4AsTextAsync", - pathTemplate: "\"/v1/ideogram-v4/generate-design\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateDesignV4AsText", - methodName: "PostGenerateDesignV4AsTextAsync", - pathTemplate: "\"/v1/ideogram-v4/generate-design\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateDesignV4AsText", - methodName: "PostGenerateDesignV4AsTextAsync", - pathTemplate: "\"/v1/ideogram-v4/generate-design\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostGenerateDesignV4AsTextResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateDesignV4AsText", - methodName: "PostGenerateDesignV4AsTextAsync", - pathTemplate: "\"/v1/ideogram-v4/generate-design\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateDesignV4AsText", - methodName: "PostGenerateDesignV4AsTextAsync", - pathTemplate: "\"/v1/ideogram-v4/generate-design\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt failed the safety check. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostGenerateDesignV4AsTextResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __content); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __content); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Generate an editable design with Ideogram 4.0 HTML
- /// Experimental prototype endpoint for generating an editable V4 HTML design from a prompt.
- /// Optionally accepts inspiration reference images to guide transferable visual style. Inspiration images are design/style references only and are not edit targets.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The text prompt for editable design generation. - /// - /// - /// Random seed for reproducibility. - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// The resolutions supported for Ideogram 4.0 layout-to-image and design generation.
- /// Example: 1024x1024 - /// - /// - /// The rendering speed to use. For Ideogram V4, `rendering_speed=FLASH`
- /// is coming soon; requests with `rendering_speed=FLASH` currently
- /// return a 400. - /// - /// - /// Experimental. Up to 4 static inspiration images used as transferable visual style references for V4 layout-to-image design. Images are not edit targets and are not inserted into the generated HTML layout. Supported formats are JPEG, PNG, and WebP (max size 25MB each). Animated images are not supported. - /// - /// - /// Experimental. Model to use for the inspiration vision prepass.
- /// Default Value: claude-sonnet-4-6 - /// - /// - /// Experimental. Model to use for the HTML/layout and base-plate handoff generation call.
- /// Default Value: claude-sonnet-4-6 - /// - /// - /// Experimental. Staging only. Select a v4 layout-to-image pipeline variant.
- /// Omit for the default v4l2i path. Rejected on production. - /// - /// - /// layered (default): full editable design payload with text layers and HTML.
- /// url: JSON with an expiring link to the final composited cover image.
- /// binary: raw PNG bytes of the final composited cover image (Content-Type image/png).
- /// html: raw HTML document of the generated layout (Content-Type text/html).
- /// Default Value: layered - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateDesignV4AsTextAsync( - string prompt, - int? seed = default, - global::Ideogram.MagicPromptOption? magicPromptOption = default, - string? magicPromptSystemPromptConfigId = default, - global::Ideogram.ResolutionV4Layout? resolution = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - global::System.Collections.Generic.IList? inspirationReferenceImages = default, - global::Ideogram.GenerateDesignRequestV4InspirationReferenceModel? inspirationReferenceModel = default, - global::Ideogram.GenerateDesignRequestV4ArtifactGenerationModel? artifactGenerationModel = default, - global::Ideogram.GenerateDesignRequestV4Layout2imageVariant? layout2imageVariant = default, - global::Ideogram.GenerateDesignRequestV4ResponseType? responseType = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.GenerateDesignRequestV4 - { - Prompt = prompt, - Seed = seed, - MagicPromptOption = magicPromptOption, - MagicPromptSystemPromptConfigId = magicPromptSystemPromptConfigId, - Resolution = resolution, - RenderingSpeed = renderingSpeed, - InspirationReferenceImages = inspirationReferenceImages, - InspirationReferenceModel = inspirationReferenceModel, - ArtifactGenerationModel = artifactGenerationModel, - Layout2imageVariant = layout2imageVariant, - ResponseType = responseType, - }; - - return await PostGenerateDesignV4AsTextAsync( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateDesignV4Async.g.cs b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateDesignV4Async.g.cs deleted file mode 100644 index f680aef6..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateDesignV4Async.g.cs +++ /dev/null @@ -1,800 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class GenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostGenerateDesignV4AsyncSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostGenerateDesignV4AsyncSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostGenerateDesignV4AsyncSecurityRequirement0, - }; - partial void PreparePostGenerateDesignV4AsyncArguments( - global::System.Net.Http.HttpClient httpClient, - ref string webhookUrl, - global::Ideogram.GenerateDesignRequestV4 request); - partial void PreparePostGenerateDesignV4AsyncRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string webhookUrl, - global::Ideogram.GenerateDesignRequestV4 request); - partial void ProcessPostGenerateDesignV4AsyncResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostGenerateDesignV4AsyncResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Generate an editable V4 HTML design asynchronously via webhook
- /// Accepts an Ideogram 4.0 HTML design request for asynchronous processing and
- /// returns immediately with a request_id. The generated design is POSTed to the
- /// supplied `webhook_url` once ready. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateDesignV4AsyncAsync( - string webhookUrl, - - global::Ideogram.GenerateDesignRequestV4 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostGenerateDesignV4AsyncAsResponseAsync( - webhookUrl: webhookUrl, - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Generate an editable V4 HTML design asynchronously via webhook
- /// Accepts an Ideogram 4.0 HTML design request for asynchronous processing and
- /// returns immediately with a request_id. The generated design is POSTed to the
- /// supplied `webhook_url` once ready. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostGenerateDesignV4AsyncAsResponseAsync( - string webhookUrl, - - global::Ideogram.GenerateDesignRequestV4 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostGenerateDesignV4AsyncArguments( - httpClient: HttpClient, - webhookUrl: ref webhookUrl, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostGenerateDesignV4AsyncSecurityRequirements, - operationName: "PostGenerateDesignV4AsyncAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/ideogram-v4/async/generate-design", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("webhook_url", webhookUrl) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.MagicPromptOption != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.MagicPromptOption).HasValue ? (request.MagicPromptOption).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"magic_prompt_option\""); - - } - if (request.MagicPromptSystemPromptConfigId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.MagicPromptSystemPromptConfigId ?? string.Empty), - name: "\"magic_prompt_system_prompt_config_id\""); - - } - if (request.Resolution != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"resolution\""); - - } - if (request.RenderingSpeed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"rendering_speed\""); - - } - if (request.InspirationReferenceImages != default) - { - - for (var __iInspirationReferenceImages = 0; __iInspirationReferenceImages < request.InspirationReferenceImages.Count; __iInspirationReferenceImages++) - { - var __contentInspirationReferenceImages = new global::System.Net.Http.ByteArrayContent(request.InspirationReferenceImages[__iInspirationReferenceImages]); - __contentInspirationReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); - __httpRequestContent.Add( - content: __contentInspirationReferenceImages, - name: "\"inspiration_reference_images\"", - fileName: $"\"file{__iInspirationReferenceImages}.bin\""); - if (__contentInspirationReferenceImages.Headers.ContentDisposition != null) - { - __contentInspirationReferenceImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - if (request.InspirationReferenceModel != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.InspirationReferenceModel).HasValue ? (request.InspirationReferenceModel).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"inspiration_reference_model\""); - - } - if (request.ArtifactGenerationModel != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.ArtifactGenerationModel).HasValue ? (request.ArtifactGenerationModel).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"artifact_generation_model\""); - - } - if (request.Layout2imageVariant != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Layout2imageVariant).HasValue ? (request.Layout2imageVariant).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"layout2image_variant\""); - - } - if (request.ResponseType != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.ResponseType).HasValue ? (request.ResponseType).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"response_type\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostGenerateDesignV4AsyncRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - webhookUrl: webhookUrl, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateDesignV4Async", - methodName: "PostGenerateDesignV4AsyncAsync", - pathTemplate: "\"/v1/ideogram-v4/async/generate-design\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateDesignV4Async", - methodName: "PostGenerateDesignV4AsyncAsync", - pathTemplate: "\"/v1/ideogram-v4/async/generate-design\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateDesignV4Async", - methodName: "PostGenerateDesignV4AsyncAsync", - pathTemplate: "\"/v1/ideogram-v4/async/generate-design\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostGenerateDesignV4AsyncResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateDesignV4Async", - methodName: "PostGenerateDesignV4AsyncAsync", - pathTemplate: "\"/v1/ideogram-v4/async/generate-design\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateDesignV4Async", - methodName: "PostGenerateDesignV4AsyncAsync", - pathTemplate: "\"/v1/ideogram-v4/async/generate-design\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt failed the safety check. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostGenerateDesignV4AsyncResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.AsyncImageGenerationResponseV4.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.AsyncImageGenerationResponseV4.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Generate an editable V4 HTML design asynchronously via webhook
- /// Accepts an Ideogram 4.0 HTML design request for asynchronous processing and
- /// returns immediately with a request_id. The generated design is POSTed to the
- /// supplied `webhook_url` once ready. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// The text prompt for editable design generation. - /// - /// - /// Random seed for reproducibility. - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// The resolutions supported for Ideogram 4.0 layout-to-image and design generation.
- /// Example: 1024x1024 - /// - /// - /// The rendering speed to use. For Ideogram V4, `rendering_speed=FLASH`
- /// is coming soon; requests with `rendering_speed=FLASH` currently
- /// return a 400. - /// - /// - /// Experimental. Up to 4 static inspiration images used as transferable visual style references for V4 layout-to-image design. Images are not edit targets and are not inserted into the generated HTML layout. Supported formats are JPEG, PNG, and WebP (max size 25MB each). Animated images are not supported. - /// - /// - /// Experimental. Model to use for the inspiration vision prepass.
- /// Default Value: claude-sonnet-4-6 - /// - /// - /// Experimental. Model to use for the HTML/layout and base-plate handoff generation call.
- /// Default Value: claude-sonnet-4-6 - /// - /// - /// Experimental. Staging only. Select a v4 layout-to-image pipeline variant.
- /// Omit for the default v4l2i path. Rejected on production. - /// - /// - /// layered (default): full editable design payload with text layers and HTML.
- /// url: JSON with an expiring link to the final composited cover image.
- /// binary: raw PNG bytes of the final composited cover image (Content-Type image/png).
- /// html: raw HTML document of the generated layout (Content-Type text/html).
- /// Default Value: layered - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateDesignV4AsyncAsync( - string webhookUrl, - string prompt, - int? seed = default, - global::Ideogram.MagicPromptOption? magicPromptOption = default, - string? magicPromptSystemPromptConfigId = default, - global::Ideogram.ResolutionV4Layout? resolution = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - global::System.Collections.Generic.IList? inspirationReferenceImages = default, - global::Ideogram.GenerateDesignRequestV4InspirationReferenceModel? inspirationReferenceModel = default, - global::Ideogram.GenerateDesignRequestV4ArtifactGenerationModel? artifactGenerationModel = default, - global::Ideogram.GenerateDesignRequestV4Layout2imageVariant? layout2imageVariant = default, - global::Ideogram.GenerateDesignRequestV4ResponseType? responseType = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.GenerateDesignRequestV4 - { - Prompt = prompt, - Seed = seed, - MagicPromptOption = magicPromptOption, - MagicPromptSystemPromptConfigId = magicPromptSystemPromptConfigId, - Resolution = resolution, - RenderingSpeed = renderingSpeed, - InspirationReferenceImages = inspirationReferenceImages, - InspirationReferenceModel = inspirationReferenceModel, - ArtifactGenerationModel = artifactGenerationModel, - Layout2imageVariant = layout2imageVariant, - ResponseType = responseType, - }; - - return await PostGenerateDesignV4AsyncAsync( - webhookUrl: webhookUrl, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImage.g.cs b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImage.g.cs deleted file mode 100644 index 791a74dc..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImage.g.cs +++ /dev/null @@ -1,598 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class GenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostGenerateImageSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostGenerateImageSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostGenerateImageSecurityRequirement0, - }; - partial void PreparePostGenerateImageArguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.GenerateImageRequest request); - partial void PreparePostGenerateImageRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.GenerateImageRequest request); - partial void ProcessPostGenerateImageResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostGenerateImageResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Generate (legacy)
- /// Generates images synchronously based on a given prompt and optional parameters.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageAsync( - - global::Ideogram.GenerateImageRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostGenerateImageAsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Generate (legacy)
- /// Generates images synchronously based on a given prompt and optional parameters.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostGenerateImageAsResponseAsync( - - global::Ideogram.GenerateImageRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostGenerateImageArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostGenerateImageSecurityRequirements, - operationName: "PostGenerateImageAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/generate", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostGenerateImageRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImage", - methodName: "PostGenerateImageAsync", - pathTemplate: "\"/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImage", - methodName: "PostGenerateImageAsync", - pathTemplate: "\"/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImage", - methodName: "PostGenerateImageAsync", - pathTemplate: "\"/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostGenerateImageResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImage", - methodName: "PostGenerateImageAsync", - pathTemplate: "\"/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImage", - methodName: "PostGenerateImageAsync", - pathTemplate: "\"/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt failed the safety check. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostGenerateImageResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.GenerateImageResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.GenerateImageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Generate (legacy)
- /// Generates images synchronously based on a given prompt and optional parameters.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Example: {"aspect_ratio":"ASPECT_10_16","magic_prompt_option":"AUTO","model":"V_2","prompt":"A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there is an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset."} - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageAsync( - global::Ideogram.ImageRequest imageRequest, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.GenerateImageRequest - { - ImageRequest = imageRequest, - }; - - return await PostGenerateImageAsync( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageErnie.g.cs b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageErnie.g.cs deleted file mode 100644 index b49c79f1..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageErnie.g.cs +++ /dev/null @@ -1,715 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class GenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostGenerateImageErnieSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostGenerateImageErnieSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostGenerateImageErnieSecurityRequirement0, - }; - partial void PreparePostGenerateImageErnieArguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.GenerateImageRequestErnie request); - partial void PreparePostGenerateImageErnieRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.GenerateImageRequestErnie request); - partial void ProcessPostGenerateImageErnieResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostGenerateImageErnieResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Generate with ERNIE-Image-Turbo
- /// Generates images synchronously using the ERNIE-Image-Turbo model. Width
- /// and height must each be a positive multiple of 16 and the total area
- /// must not exceed 1,075,200 pixels (896×1200); the server validates these
- /// against the model's resolution constraints.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageErnieAsync( - - global::Ideogram.GenerateImageRequestErnie request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostGenerateImageErnieAsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Generate with ERNIE-Image-Turbo
- /// Generates images synchronously using the ERNIE-Image-Turbo model. Width
- /// and height must each be a positive multiple of 16 and the total area
- /// must not exceed 1,075,200 pixels (896×1200); the server validates these
- /// against the model's resolution constraints.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostGenerateImageErnieAsResponseAsync( - - global::Ideogram.GenerateImageRequestErnie request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostGenerateImageErnieArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostGenerateImageErnieSecurityRequirements, - operationName: "PostGenerateImageErnieAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/ernie/generate", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - if (request.SystemPrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.SystemPrompt ?? string.Empty), - name: "\"system_prompt\""); - - } - if (request.Width != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Width, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"width\""); - - } - if (request.Height != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Height, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"height\""); - - } - if (request.NumInferenceSteps != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumInferenceSteps, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_inference_steps\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.CustomModelUri != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.CustomModelUri ?? string.Empty), - name: "\"custom_model_uri\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostGenerateImageErnieRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageErnie", - methodName: "PostGenerateImageErnieAsync", - pathTemplate: "\"/v1/ernie/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageErnie", - methodName: "PostGenerateImageErnieAsync", - pathTemplate: "\"/v1/ernie/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageErnie", - methodName: "PostGenerateImageErnieAsync", - pathTemplate: "\"/v1/ernie/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostGenerateImageErnieResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageErnie", - methodName: "PostGenerateImageErnieAsync", - pathTemplate: "\"/v1/ernie/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageErnie", - methodName: "PostGenerateImageErnieAsync", - pathTemplate: "\"/v1/ernie/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt failed the safety check. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostGenerateImageErnieResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.ImageGenerationResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.ImageGenerationResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Generate with ERNIE-Image-Turbo
- /// Generates images synchronously using the ERNIE-Image-Turbo model. Width
- /// and height must each be a positive multiple of 16 and the total area
- /// must not exceed 1,075,200 pixels (896×1200); the server validates these
- /// against the model's resolution constraints.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// A natural-language prompt for image generation.
- /// Example: A poster with bold typography reading "GRAND OPENING", art deco style. - /// - /// - /// An optional system prompt applied alongside the prompt — use it for
- /// standing instructions such as style constraints or "do not render
- /// text". When omitted, no system prompt is applied. If you trained a
- /// LoRA with a system prompt, supply the same one here for best results.
- /// Example: Do not include any text in the image. - /// - /// - /// Output width in pixels; must be a positive multiple of 16.
- /// Example: 1024 - /// - /// - /// Output height in pixels; must be a positive multiple of 16.
- /// Example: 1024 - /// - /// - /// Optional diffusion step count. When omitted, the server uses the
- /// model's default. Higher values trade latency for quality.
- /// Example: 8 - /// - /// - /// Random seed for reproducibility. - /// - /// - /// Number of images to generate.
- /// Default Value: 1 - /// - /// - /// A custom model URI in the format model/<model_name>/version/<version_name>.
- /// When provided, the URI must resolve to a registered fine-tune of the
- /// ERNIE base model; the fine-tune's LoRA checkpoint is layered on the
- /// base. When omitted, the ERNIE base is used with no LoRA.
- /// Example: model/my-ernie-lora/version/0 - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageErnieAsync( - string prompt, - string? systemPrompt = default, - int? width = default, - int? height = default, - int? numInferenceSteps = default, - int? seed = default, - int? numImages = default, - string? customModelUri = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.GenerateImageRequestErnie - { - Prompt = prompt, - SystemPrompt = systemPrompt, - Width = width, - Height = height, - NumInferenceSteps = numInferenceSteps, - Seed = seed, - NumImages = numImages, - CustomModelUri = customModelUri, - }; - - return await PostGenerateImageErnieAsync( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageErnieAsync.g.cs b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageErnieAsync.g.cs deleted file mode 100644 index 70388c69..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageErnieAsync.g.cs +++ /dev/null @@ -1,763 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class GenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostGenerateImageErnieAsyncSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostGenerateImageErnieAsyncSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostGenerateImageErnieAsyncSecurityRequirement0, - }; - partial void PreparePostGenerateImageErnieAsyncArguments( - global::System.Net.Http.HttpClient httpClient, - ref string webhookUrl, - global::Ideogram.GenerateImageRequestErnie request); - partial void PreparePostGenerateImageErnieAsyncRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string webhookUrl, - global::Ideogram.GenerateImageRequestErnie request); - partial void ProcessPostGenerateImageErnieAsyncResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostGenerateImageErnieAsyncResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Generate with ERNIE-Image-Turbo asynchronously via webhook
- /// Accepts an ERNIE-Image-Turbo generation request for asynchronous
- /// processing and returns immediately with a generation_id. The generated
- /// images are POSTed to the supplied `webhook_url` once ready, in a payload
- /// that mirrors the synchronous response with an added generation_id for
- /// correlation.
- /// See [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageErnieAsyncAsync( - string webhookUrl, - - global::Ideogram.GenerateImageRequestErnie request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostGenerateImageErnieAsyncAsResponseAsync( - webhookUrl: webhookUrl, - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Generate with ERNIE-Image-Turbo asynchronously via webhook
- /// Accepts an ERNIE-Image-Turbo generation request for asynchronous
- /// processing and returns immediately with a generation_id. The generated
- /// images are POSTed to the supplied `webhook_url` once ready, in a payload
- /// that mirrors the synchronous response with an added generation_id for
- /// correlation.
- /// See [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostGenerateImageErnieAsyncAsResponseAsync( - string webhookUrl, - - global::Ideogram.GenerateImageRequestErnie request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostGenerateImageErnieAsyncArguments( - httpClient: HttpClient, - webhookUrl: ref webhookUrl, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostGenerateImageErnieAsyncSecurityRequirements, - operationName: "PostGenerateImageErnieAsyncAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/ernie/async/generate", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("webhook_url", webhookUrl) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - if (request.SystemPrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.SystemPrompt ?? string.Empty), - name: "\"system_prompt\""); - - } - if (request.Width != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Width, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"width\""); - - } - if (request.Height != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Height, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"height\""); - - } - if (request.NumInferenceSteps != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumInferenceSteps, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_inference_steps\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.CustomModelUri != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.CustomModelUri ?? string.Empty), - name: "\"custom_model_uri\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostGenerateImageErnieAsyncRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - webhookUrl: webhookUrl, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageErnieAsync", - methodName: "PostGenerateImageErnieAsyncAsync", - pathTemplate: "\"/v1/ernie/async/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageErnieAsync", - methodName: "PostGenerateImageErnieAsyncAsync", - pathTemplate: "\"/v1/ernie/async/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageErnieAsync", - methodName: "PostGenerateImageErnieAsyncAsync", - pathTemplate: "\"/v1/ernie/async/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostGenerateImageErnieAsyncResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageErnieAsync", - methodName: "PostGenerateImageErnieAsyncAsync", - pathTemplate: "\"/v1/ernie/async/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageErnieAsync", - methodName: "PostGenerateImageErnieAsyncAsync", - pathTemplate: "\"/v1/ernie/async/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt failed the safety check. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostGenerateImageErnieAsyncResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.AsyncImageGenerationResponseV4.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.AsyncImageGenerationResponseV4.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Generate with ERNIE-Image-Turbo asynchronously via webhook
- /// Accepts an ERNIE-Image-Turbo generation request for asynchronous
- /// processing and returns immediately with a generation_id. The generated
- /// images are POSTed to the supplied `webhook_url` once ready, in a payload
- /// that mirrors the synchronous response with an added generation_id for
- /// correlation.
- /// See [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// A natural-language prompt for image generation.
- /// Example: A poster with bold typography reading "GRAND OPENING", art deco style. - /// - /// - /// An optional system prompt applied alongside the prompt — use it for
- /// standing instructions such as style constraints or "do not render
- /// text". When omitted, no system prompt is applied. If you trained a
- /// LoRA with a system prompt, supply the same one here for best results.
- /// Example: Do not include any text in the image. - /// - /// - /// Output width in pixels; must be a positive multiple of 16.
- /// Example: 1024 - /// - /// - /// Output height in pixels; must be a positive multiple of 16.
- /// Example: 1024 - /// - /// - /// Optional diffusion step count. When omitted, the server uses the
- /// model's default. Higher values trade latency for quality.
- /// Example: 8 - /// - /// - /// Random seed for reproducibility. - /// - /// - /// Number of images to generate.
- /// Default Value: 1 - /// - /// - /// A custom model URI in the format model/<model_name>/version/<version_name>.
- /// When provided, the URI must resolve to a registered fine-tune of the
- /// ERNIE base model; the fine-tune's LoRA checkpoint is layered on the
- /// base. When omitted, the ERNIE base is used with no LoRA.
- /// Example: model/my-ernie-lora/version/0 - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageErnieAsyncAsync( - string webhookUrl, - string prompt, - string? systemPrompt = default, - int? width = default, - int? height = default, - int? numInferenceSteps = default, - int? seed = default, - int? numImages = default, - string? customModelUri = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.GenerateImageRequestErnie - { - Prompt = prompt, - SystemPrompt = systemPrompt, - Width = width, - Height = height, - NumInferenceSteps = numInferenceSteps, - Seed = seed, - NumImages = numImages, - CustomModelUri = customModelUri, - }; - - return await PostGenerateImageErnieAsyncAsync( - webhookUrl: webhookUrl, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageFlux2Klein.g.cs b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageFlux2Klein.g.cs deleted file mode 100644 index d55c496d..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageFlux2Klein.g.cs +++ /dev/null @@ -1,715 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class GenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostGenerateImageFlux2KleinSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostGenerateImageFlux2KleinSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostGenerateImageFlux2KleinSecurityRequirement0, - }; - partial void PreparePostGenerateImageFlux2KleinArguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.GenerateImageRequestFlux2Klein request); - partial void PreparePostGenerateImageFlux2KleinRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.GenerateImageRequestFlux2Klein request); - partial void ProcessPostGenerateImageFlux2KleinResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostGenerateImageFlux2KleinResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Generate with FLUX.2-Klein
- /// Generates images synchronously using the FLUX.2-Klein model. Width and
- /// height must each be a positive multiple of 16 and the total area must
- /// not exceed 1,048,576 pixels (1024×1024); the server validates these
- /// against the model's resolution constraints.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageFlux2KleinAsync( - - global::Ideogram.GenerateImageRequestFlux2Klein request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostGenerateImageFlux2KleinAsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Generate with FLUX.2-Klein
- /// Generates images synchronously using the FLUX.2-Klein model. Width and
- /// height must each be a positive multiple of 16 and the total area must
- /// not exceed 1,048,576 pixels (1024×1024); the server validates these
- /// against the model's resolution constraints.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostGenerateImageFlux2KleinAsResponseAsync( - - global::Ideogram.GenerateImageRequestFlux2Klein request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostGenerateImageFlux2KleinArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostGenerateImageFlux2KleinSecurityRequirements, - operationName: "PostGenerateImageFlux2KleinAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/flux-2-klein/generate", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - if (request.SystemPrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.SystemPrompt ?? string.Empty), - name: "\"system_prompt\""); - - } - if (request.Width != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Width, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"width\""); - - } - if (request.Height != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Height, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"height\""); - - } - if (request.NumInferenceSteps != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumInferenceSteps, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_inference_steps\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.CustomModelUri != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.CustomModelUri ?? string.Empty), - name: "\"custom_model_uri\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostGenerateImageFlux2KleinRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageFlux2Klein", - methodName: "PostGenerateImageFlux2KleinAsync", - pathTemplate: "\"/v1/flux-2-klein/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageFlux2Klein", - methodName: "PostGenerateImageFlux2KleinAsync", - pathTemplate: "\"/v1/flux-2-klein/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageFlux2Klein", - methodName: "PostGenerateImageFlux2KleinAsync", - pathTemplate: "\"/v1/flux-2-klein/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostGenerateImageFlux2KleinResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageFlux2Klein", - methodName: "PostGenerateImageFlux2KleinAsync", - pathTemplate: "\"/v1/flux-2-klein/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageFlux2Klein", - methodName: "PostGenerateImageFlux2KleinAsync", - pathTemplate: "\"/v1/flux-2-klein/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt failed the safety check. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostGenerateImageFlux2KleinResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.ImageGenerationResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.ImageGenerationResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Generate with FLUX.2-Klein
- /// Generates images synchronously using the FLUX.2-Klein model. Width and
- /// height must each be a positive multiple of 16 and the total area must
- /// not exceed 1,048,576 pixels (1024×1024); the server validates these
- /// against the model's resolution constraints.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// A natural-language prompt for image generation.
- /// Example: A photo of a tabby cat sleeping on a couch, soft daylight. - /// - /// - /// An optional system prompt applied alongside the prompt — use it for
- /// standing instructions such as style constraints or "do not render
- /// text". When omitted, no system prompt is applied. If you trained a
- /// LoRA with a system prompt, supply the same one here for best results.
- /// Example: Do not include any text in the image. - /// - /// - /// Output width in pixels; must be a positive multiple of 16.
- /// Example: 1024 - /// - /// - /// Output height in pixels; must be a positive multiple of 16.
- /// Example: 1024 - /// - /// - /// Optional diffusion step count. When omitted, the server uses the
- /// model's default. Higher values trade latency for quality.
- /// Example: 4 - /// - /// - /// Random seed for reproducibility. - /// - /// - /// Number of images to generate.
- /// Default Value: 1 - /// - /// - /// A custom model URI in the format model/<model_name>/version/<version_name>.
- /// When provided, the URI must resolve to a registered fine-tune of the
- /// FLUX.2-Klein base model; the fine-tune's LoRA checkpoint is layered
- /// on the base. When omitted, the FLUX.2-Klein base is used with no LoRA.
- /// Example: model/my-flux-klein-lora/version/0 - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageFlux2KleinAsync( - string prompt, - string? systemPrompt = default, - int? width = default, - int? height = default, - int? numInferenceSteps = default, - int? seed = default, - int? numImages = default, - string? customModelUri = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.GenerateImageRequestFlux2Klein - { - Prompt = prompt, - SystemPrompt = systemPrompt, - Width = width, - Height = height, - NumInferenceSteps = numInferenceSteps, - Seed = seed, - NumImages = numImages, - CustomModelUri = customModelUri, - }; - - return await PostGenerateImageFlux2KleinAsync( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageFlux2KleinAsync.g.cs b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageFlux2KleinAsync.g.cs deleted file mode 100644 index 74369630..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageFlux2KleinAsync.g.cs +++ /dev/null @@ -1,760 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class GenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostGenerateImageFlux2KleinAsyncSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostGenerateImageFlux2KleinAsyncSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostGenerateImageFlux2KleinAsyncSecurityRequirement0, - }; - partial void PreparePostGenerateImageFlux2KleinAsyncArguments( - global::System.Net.Http.HttpClient httpClient, - ref string webhookUrl, - global::Ideogram.GenerateImageRequestFlux2Klein request); - partial void PreparePostGenerateImageFlux2KleinAsyncRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string webhookUrl, - global::Ideogram.GenerateImageRequestFlux2Klein request); - partial void ProcessPostGenerateImageFlux2KleinAsyncResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostGenerateImageFlux2KleinAsyncResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Generate with FLUX.2-Klein asynchronously via webhook
- /// Accepts a FLUX.2-Klein generation request for asynchronous processing and
- /// returns immediately with a generation_id. The generated images are POSTed to
- /// the supplied `webhook_url` once ready, in a payload that mirrors the
- /// synchronous response with an added generation_id for correlation.
- /// See [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageFlux2KleinAsyncAsync( - string webhookUrl, - - global::Ideogram.GenerateImageRequestFlux2Klein request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostGenerateImageFlux2KleinAsyncAsResponseAsync( - webhookUrl: webhookUrl, - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Generate with FLUX.2-Klein asynchronously via webhook
- /// Accepts a FLUX.2-Klein generation request for asynchronous processing and
- /// returns immediately with a generation_id. The generated images are POSTed to
- /// the supplied `webhook_url` once ready, in a payload that mirrors the
- /// synchronous response with an added generation_id for correlation.
- /// See [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostGenerateImageFlux2KleinAsyncAsResponseAsync( - string webhookUrl, - - global::Ideogram.GenerateImageRequestFlux2Klein request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostGenerateImageFlux2KleinAsyncArguments( - httpClient: HttpClient, - webhookUrl: ref webhookUrl, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostGenerateImageFlux2KleinAsyncSecurityRequirements, - operationName: "PostGenerateImageFlux2KleinAsyncAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/flux-2-klein/async/generate", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("webhook_url", webhookUrl) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - if (request.SystemPrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.SystemPrompt ?? string.Empty), - name: "\"system_prompt\""); - - } - if (request.Width != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Width, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"width\""); - - } - if (request.Height != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Height, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"height\""); - - } - if (request.NumInferenceSteps != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumInferenceSteps, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_inference_steps\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.CustomModelUri != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.CustomModelUri ?? string.Empty), - name: "\"custom_model_uri\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostGenerateImageFlux2KleinAsyncRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - webhookUrl: webhookUrl, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageFlux2KleinAsync", - methodName: "PostGenerateImageFlux2KleinAsyncAsync", - pathTemplate: "\"/v1/flux-2-klein/async/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageFlux2KleinAsync", - methodName: "PostGenerateImageFlux2KleinAsyncAsync", - pathTemplate: "\"/v1/flux-2-klein/async/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageFlux2KleinAsync", - methodName: "PostGenerateImageFlux2KleinAsyncAsync", - pathTemplate: "\"/v1/flux-2-klein/async/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostGenerateImageFlux2KleinAsyncResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageFlux2KleinAsync", - methodName: "PostGenerateImageFlux2KleinAsyncAsync", - pathTemplate: "\"/v1/flux-2-klein/async/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageFlux2KleinAsync", - methodName: "PostGenerateImageFlux2KleinAsyncAsync", - pathTemplate: "\"/v1/flux-2-klein/async/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt failed the safety check. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostGenerateImageFlux2KleinAsyncResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.AsyncImageGenerationResponseV4.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.AsyncImageGenerationResponseV4.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Generate with FLUX.2-Klein asynchronously via webhook
- /// Accepts a FLUX.2-Klein generation request for asynchronous processing and
- /// returns immediately with a generation_id. The generated images are POSTed to
- /// the supplied `webhook_url` once ready, in a payload that mirrors the
- /// synchronous response with an added generation_id for correlation.
- /// See [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// A natural-language prompt for image generation.
- /// Example: A photo of a tabby cat sleeping on a couch, soft daylight. - /// - /// - /// An optional system prompt applied alongside the prompt — use it for
- /// standing instructions such as style constraints or "do not render
- /// text". When omitted, no system prompt is applied. If you trained a
- /// LoRA with a system prompt, supply the same one here for best results.
- /// Example: Do not include any text in the image. - /// - /// - /// Output width in pixels; must be a positive multiple of 16.
- /// Example: 1024 - /// - /// - /// Output height in pixels; must be a positive multiple of 16.
- /// Example: 1024 - /// - /// - /// Optional diffusion step count. When omitted, the server uses the
- /// model's default. Higher values trade latency for quality.
- /// Example: 4 - /// - /// - /// Random seed for reproducibility. - /// - /// - /// Number of images to generate.
- /// Default Value: 1 - /// - /// - /// A custom model URI in the format model/<model_name>/version/<version_name>.
- /// When provided, the URI must resolve to a registered fine-tune of the
- /// FLUX.2-Klein base model; the fine-tune's LoRA checkpoint is layered
- /// on the base. When omitted, the FLUX.2-Klein base is used with no LoRA.
- /// Example: model/my-flux-klein-lora/version/0 - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageFlux2KleinAsyncAsync( - string webhookUrl, - string prompt, - string? systemPrompt = default, - int? width = default, - int? height = default, - int? numInferenceSteps = default, - int? seed = default, - int? numImages = default, - string? customModelUri = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.GenerateImageRequestFlux2Klein - { - Prompt = prompt, - SystemPrompt = systemPrompt, - Width = width, - Height = height, - NumInferenceSteps = numInferenceSteps, - Seed = seed, - NumImages = numImages, - CustomModelUri = customModelUri, - }; - - return await PostGenerateImageFlux2KleinAsyncAsync( - webhookUrl: webhookUrl, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageFlux2KleinBase.g.cs b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageFlux2KleinBase.g.cs deleted file mode 100644 index 68fa3df1..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageFlux2KleinBase.g.cs +++ /dev/null @@ -1,715 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class GenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostGenerateImageFlux2KleinBaseSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostGenerateImageFlux2KleinBaseSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostGenerateImageFlux2KleinBaseSecurityRequirement0, - }; - partial void PreparePostGenerateImageFlux2KleinBaseArguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.GenerateImageRequestFlux2KleinBase request); - partial void PreparePostGenerateImageFlux2KleinBaseRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.GenerateImageRequestFlux2KleinBase request); - partial void ProcessPostGenerateImageFlux2KleinBaseResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostGenerateImageFlux2KleinBaseResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Generate with FLUX.2-Klein (undistilled base)
- /// Generates images synchronously using the UNDISTILLED FLUX.2-Klein base — the 50-step quality tier (vs the distilled /v1/flux-2-klein fast tier). Width and
- /// height must each be a positive multiple of 16 and the total area must
- /// not exceed 1,048,576 pixels (1024×1024); the server validates these
- /// against the model's resolution constraints.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageFlux2KleinBaseAsync( - - global::Ideogram.GenerateImageRequestFlux2KleinBase request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostGenerateImageFlux2KleinBaseAsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Generate with FLUX.2-Klein (undistilled base)
- /// Generates images synchronously using the UNDISTILLED FLUX.2-Klein base — the 50-step quality tier (vs the distilled /v1/flux-2-klein fast tier). Width and
- /// height must each be a positive multiple of 16 and the total area must
- /// not exceed 1,048,576 pixels (1024×1024); the server validates these
- /// against the model's resolution constraints.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostGenerateImageFlux2KleinBaseAsResponseAsync( - - global::Ideogram.GenerateImageRequestFlux2KleinBase request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostGenerateImageFlux2KleinBaseArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostGenerateImageFlux2KleinBaseSecurityRequirements, - operationName: "PostGenerateImageFlux2KleinBaseAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/flux-2-klein-base/generate", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - if (request.SystemPrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.SystemPrompt ?? string.Empty), - name: "\"system_prompt\""); - - } - if (request.Width != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Width, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"width\""); - - } - if (request.Height != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Height, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"height\""); - - } - if (request.NumInferenceSteps != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumInferenceSteps, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_inference_steps\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.CustomModelUri != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.CustomModelUri ?? string.Empty), - name: "\"custom_model_uri\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostGenerateImageFlux2KleinBaseRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageFlux2KleinBase", - methodName: "PostGenerateImageFlux2KleinBaseAsync", - pathTemplate: "\"/v1/flux-2-klein-base/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageFlux2KleinBase", - methodName: "PostGenerateImageFlux2KleinBaseAsync", - pathTemplate: "\"/v1/flux-2-klein-base/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageFlux2KleinBase", - methodName: "PostGenerateImageFlux2KleinBaseAsync", - pathTemplate: "\"/v1/flux-2-klein-base/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostGenerateImageFlux2KleinBaseResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageFlux2KleinBase", - methodName: "PostGenerateImageFlux2KleinBaseAsync", - pathTemplate: "\"/v1/flux-2-klein-base/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageFlux2KleinBase", - methodName: "PostGenerateImageFlux2KleinBaseAsync", - pathTemplate: "\"/v1/flux-2-klein-base/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt failed the safety check. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostGenerateImageFlux2KleinBaseResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.ImageGenerationResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.ImageGenerationResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Generate with FLUX.2-Klein (undistilled base)
- /// Generates images synchronously using the UNDISTILLED FLUX.2-Klein base — the 50-step quality tier (vs the distilled /v1/flux-2-klein fast tier). Width and
- /// height must each be a positive multiple of 16 and the total area must
- /// not exceed 1,048,576 pixels (1024×1024); the server validates these
- /// against the model's resolution constraints.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// A natural-language prompt for image generation.
- /// Example: A photo of a tabby cat sleeping on a couch, soft daylight. - /// - /// - /// An optional system prompt applied alongside the prompt — use it for
- /// standing instructions such as style constraints or "do not render
- /// text". When omitted, no system prompt is applied. If you trained a
- /// LoRA with a system prompt, supply the same one here for best results.
- /// Example: Do not include any text in the image. - /// - /// - /// Output width in pixels; must be a positive multiple of 16.
- /// Example: 1024 - /// - /// - /// Output height in pixels; must be a positive multiple of 16.
- /// Example: 1024 - /// - /// - /// Optional diffusion step count. When omitted, the server uses the
- /// model's default. Higher values trade latency for quality.
- /// Example: 50 - /// - /// - /// Random seed for reproducibility. - /// - /// - /// Number of images to generate.
- /// Default Value: 1 - /// - /// - /// A custom model URI in the format model/<model_name>/version/<version_name>.
- /// When provided, the URI must resolve to a registered fine-tune of the
- /// FLUX.2-Klein base model; the fine-tune's LoRA checkpoint is layered
- /// on the base. When omitted, the FLUX.2-Klein base is used with no LoRA.
- /// Example: model/my-flux-klein-base-lora/version/0 - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageFlux2KleinBaseAsync( - string prompt, - string? systemPrompt = default, - int? width = default, - int? height = default, - int? numInferenceSteps = default, - int? seed = default, - int? numImages = default, - string? customModelUri = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.GenerateImageRequestFlux2KleinBase - { - Prompt = prompt, - SystemPrompt = systemPrompt, - Width = width, - Height = height, - NumInferenceSteps = numInferenceSteps, - Seed = seed, - NumImages = numImages, - CustomModelUri = customModelUri, - }; - - return await PostGenerateImageFlux2KleinBaseAsync( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageFlux2KleinBaseAsync.g.cs b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageFlux2KleinBaseAsync.g.cs deleted file mode 100644 index 7d820750..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageFlux2KleinBaseAsync.g.cs +++ /dev/null @@ -1,760 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class GenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostGenerateImageFlux2KleinBaseAsyncSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostGenerateImageFlux2KleinBaseAsyncSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostGenerateImageFlux2KleinBaseAsyncSecurityRequirement0, - }; - partial void PreparePostGenerateImageFlux2KleinBaseAsyncArguments( - global::System.Net.Http.HttpClient httpClient, - ref string webhookUrl, - global::Ideogram.GenerateImageRequestFlux2KleinBase request); - partial void PreparePostGenerateImageFlux2KleinBaseAsyncRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string webhookUrl, - global::Ideogram.GenerateImageRequestFlux2KleinBase request); - partial void ProcessPostGenerateImageFlux2KleinBaseAsyncResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostGenerateImageFlux2KleinBaseAsyncResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Generate with FLUX.2-Klein (undistilled base) asynchronously via webhook
- /// Accepts an undistilled-base FLUX.2-Klein generation request for asynchronous processing and
- /// returns immediately with a generation_id. The generated images are POSTed to
- /// the supplied `webhook_url` once ready, in a payload that mirrors the
- /// synchronous response with an added generation_id for correlation.
- /// See [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageFlux2KleinBaseAsyncAsync( - string webhookUrl, - - global::Ideogram.GenerateImageRequestFlux2KleinBase request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostGenerateImageFlux2KleinBaseAsyncAsResponseAsync( - webhookUrl: webhookUrl, - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Generate with FLUX.2-Klein (undistilled base) asynchronously via webhook
- /// Accepts an undistilled-base FLUX.2-Klein generation request for asynchronous processing and
- /// returns immediately with a generation_id. The generated images are POSTed to
- /// the supplied `webhook_url` once ready, in a payload that mirrors the
- /// synchronous response with an added generation_id for correlation.
- /// See [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostGenerateImageFlux2KleinBaseAsyncAsResponseAsync( - string webhookUrl, - - global::Ideogram.GenerateImageRequestFlux2KleinBase request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostGenerateImageFlux2KleinBaseAsyncArguments( - httpClient: HttpClient, - webhookUrl: ref webhookUrl, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostGenerateImageFlux2KleinBaseAsyncSecurityRequirements, - operationName: "PostGenerateImageFlux2KleinBaseAsyncAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/flux-2-klein-base/async/generate", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("webhook_url", webhookUrl) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - if (request.SystemPrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.SystemPrompt ?? string.Empty), - name: "\"system_prompt\""); - - } - if (request.Width != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Width, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"width\""); - - } - if (request.Height != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Height, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"height\""); - - } - if (request.NumInferenceSteps != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumInferenceSteps, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_inference_steps\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.CustomModelUri != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.CustomModelUri ?? string.Empty), - name: "\"custom_model_uri\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostGenerateImageFlux2KleinBaseAsyncRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - webhookUrl: webhookUrl, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageFlux2KleinBaseAsync", - methodName: "PostGenerateImageFlux2KleinBaseAsyncAsync", - pathTemplate: "\"/v1/flux-2-klein-base/async/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageFlux2KleinBaseAsync", - methodName: "PostGenerateImageFlux2KleinBaseAsyncAsync", - pathTemplate: "\"/v1/flux-2-klein-base/async/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageFlux2KleinBaseAsync", - methodName: "PostGenerateImageFlux2KleinBaseAsyncAsync", - pathTemplate: "\"/v1/flux-2-klein-base/async/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostGenerateImageFlux2KleinBaseAsyncResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageFlux2KleinBaseAsync", - methodName: "PostGenerateImageFlux2KleinBaseAsyncAsync", - pathTemplate: "\"/v1/flux-2-klein-base/async/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageFlux2KleinBaseAsync", - methodName: "PostGenerateImageFlux2KleinBaseAsyncAsync", - pathTemplate: "\"/v1/flux-2-klein-base/async/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt failed the safety check. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostGenerateImageFlux2KleinBaseAsyncResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.AsyncImageGenerationResponseV4.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.AsyncImageGenerationResponseV4.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Generate with FLUX.2-Klein (undistilled base) asynchronously via webhook
- /// Accepts an undistilled-base FLUX.2-Klein generation request for asynchronous processing and
- /// returns immediately with a generation_id. The generated images are POSTed to
- /// the supplied `webhook_url` once ready, in a payload that mirrors the
- /// synchronous response with an added generation_id for correlation.
- /// See [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// A natural-language prompt for image generation.
- /// Example: A photo of a tabby cat sleeping on a couch, soft daylight. - /// - /// - /// An optional system prompt applied alongside the prompt — use it for
- /// standing instructions such as style constraints or "do not render
- /// text". When omitted, no system prompt is applied. If you trained a
- /// LoRA with a system prompt, supply the same one here for best results.
- /// Example: Do not include any text in the image. - /// - /// - /// Output width in pixels; must be a positive multiple of 16.
- /// Example: 1024 - /// - /// - /// Output height in pixels; must be a positive multiple of 16.
- /// Example: 1024 - /// - /// - /// Optional diffusion step count. When omitted, the server uses the
- /// model's default. Higher values trade latency for quality.
- /// Example: 50 - /// - /// - /// Random seed for reproducibility. - /// - /// - /// Number of images to generate.
- /// Default Value: 1 - /// - /// - /// A custom model URI in the format model/<model_name>/version/<version_name>.
- /// When provided, the URI must resolve to a registered fine-tune of the
- /// FLUX.2-Klein base model; the fine-tune's LoRA checkpoint is layered
- /// on the base. When omitted, the FLUX.2-Klein base is used with no LoRA.
- /// Example: model/my-flux-klein-base-lora/version/0 - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageFlux2KleinBaseAsyncAsync( - string webhookUrl, - string prompt, - string? systemPrompt = default, - int? width = default, - int? height = default, - int? numInferenceSteps = default, - int? seed = default, - int? numImages = default, - string? customModelUri = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.GenerateImageRequestFlux2KleinBase - { - Prompt = prompt, - SystemPrompt = systemPrompt, - Width = width, - Height = height, - NumInferenceSteps = numInferenceSteps, - Seed = seed, - NumImages = numImages, - CustomModelUri = customModelUri, - }; - - return await PostGenerateImageFlux2KleinBaseAsyncAsync( - webhookUrl: webhookUrl, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImagePImageHigh.g.cs b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImagePImageHigh.g.cs deleted file mode 100644 index 4a115a9c..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImagePImageHigh.g.cs +++ /dev/null @@ -1,687 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class GenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostGenerateImagePImageHighSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostGenerateImagePImageHighSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostGenerateImagePImageHighSecurityRequirement0, - }; - partial void PreparePostGenerateImagePImageHighArguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.GenerateImageRequestPImage request); - partial void PreparePostGenerateImagePImageHighRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.GenerateImageRequestPImage request); - partial void ProcessPostGenerateImagePImageHighResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostGenerateImagePImageHighResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Generate with the distilled few-step Ideogram model (high speed tier)
- /// Generates images synchronously using the distilled few-step Ideogram
- /// model at the high speed tier — the highest quality, at the highest cost.
- /// The speed tier controls the number of diffusion steps and the per-image
- /// price.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImagePImageHighAsync( - - global::Ideogram.GenerateImageRequestPImage request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostGenerateImagePImageHighAsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Generate with the distilled few-step Ideogram model (high speed tier)
- /// Generates images synchronously using the distilled few-step Ideogram
- /// model at the high speed tier — the highest quality, at the highest cost.
- /// The speed tier controls the number of diffusion steps and the per-image
- /// price.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostGenerateImagePImageHighAsResponseAsync( - - global::Ideogram.GenerateImageRequestPImage request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostGenerateImagePImageHighArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostGenerateImagePImageHighSecurityRequirements, - operationName: "PostGenerateImagePImageHighAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/p-image-ideogram/high/generate", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - if (request.PromptUpsampling != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.PromptUpsampling).HasValue ? (request.PromptUpsampling).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"prompt_upsampling\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.MagicPromptSystemPromptConfigId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.MagicPromptSystemPromptConfigId ?? string.Empty), - name: "\"magic_prompt_system_prompt_config_id\""); - - } - if (request.Resolution != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"resolution\""); - - } - if (request.EnableCopyrightDetection != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"enable_copyright_detection\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostGenerateImagePImageHighRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImagePImageHigh", - methodName: "PostGenerateImagePImageHighAsync", - pathTemplate: "\"/v1/p-image-ideogram/high/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImagePImageHigh", - methodName: "PostGenerateImagePImageHighAsync", - pathTemplate: "\"/v1/p-image-ideogram/high/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImagePImageHigh", - methodName: "PostGenerateImagePImageHighAsync", - pathTemplate: "\"/v1/p-image-ideogram/high/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostGenerateImagePImageHighResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImagePImageHigh", - methodName: "PostGenerateImagePImageHighAsync", - pathTemplate: "\"/v1/p-image-ideogram/high/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImagePImageHigh", - methodName: "PostGenerateImagePImageHighAsync", - pathTemplate: "\"/v1/p-image-ideogram/high/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt failed the safety check. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostGenerateImagePImageHighResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.ImageGenerationResponseV4.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.ImageGenerationResponseV4.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Generate with the distilled few-step Ideogram model (high speed tier)
- /// Generates images synchronously using the distilled few-step Ideogram
- /// model at the high speed tier — the highest quality, at the highest cost.
- /// The speed tier controls the number of diffusion steps and the per-image
- /// price.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The prompt for image generation. Accepts either natural language or
- /// a structured prompt that conforms to the Ideogram 4.0 JSON contract;
- /// the server detects which was supplied. See `prompt_upsampling` for
- /// how magic-prompt is applied. - /// - /// - /// Controls magic-prompt (prompt upsampling). `AUTO` (default) applies
- /// magic-prompt to a natural-language `prompt` or a non-Ideogram 4.0 JSON
- /// `prompt`, and skips it when `prompt` is already a structured Ideogram
- /// 4.0 JSON prompt. `ON` always applies magic-prompt, even to an Ideogram
- /// 4.0 JSON prompt; `OFF` never applies it. Defaults to `AUTO`. - /// - /// - /// Random seed for reproducibility. - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use
- /// for this request. Honored only when magic-prompt runs (a
- /// natural-language `prompt` with `prompt_upsampling` AUTO or ON). - /// - /// - /// The 1K and 2K resolutions supported for Ideogram 4.0 image generation.
- /// Example: 2048x2048 - /// - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). The effective gate is the OR of this field and the organization's
- /// `copyright_detection_enabled` setting on `/api`. See GenerateImageRequestV3 for details. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImagePImageHighAsync( - string prompt, - global::Ideogram.MagicPromptOption? promptUpsampling = default, - int? seed = default, - string? magicPromptSystemPromptConfigId = default, - global::Ideogram.ResolutionV4? resolution = default, - bool? enableCopyrightDetection = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.GenerateImageRequestPImage - { - Prompt = prompt, - PromptUpsampling = promptUpsampling, - Seed = seed, - MagicPromptSystemPromptConfigId = magicPromptSystemPromptConfigId, - Resolution = resolution, - EnableCopyrightDetection = enableCopyrightDetection, - }; - - return await PostGenerateImagePImageHighAsync( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImagePImageIdeogram.g.cs b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImagePImageIdeogram.g.cs deleted file mode 100644 index 38a19a3a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImagePImageIdeogram.g.cs +++ /dev/null @@ -1,738 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class GenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostGenerateImagePImageIdeogramSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostGenerateImagePImageIdeogramSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostGenerateImagePImageIdeogramSecurityRequirement0, - }; - partial void PreparePostGenerateImagePImageIdeogramArguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.GenerateImageRequestPImageIdeogram request); - partial void PreparePostGenerateImagePImageIdeogramRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.GenerateImageRequestPImageIdeogram request); - partial void ProcessPostGenerateImagePImageIdeogramResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostGenerateImagePImageIdeogramResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Generate with P-Image Ideogram
- /// Generates images synchronously using P-Image Ideogram. `quality` selects
- /// the generation quality level and `resolution` selects the output-size
- /// tier. Both parameters have defaults.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download them. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImagePImageIdeogramAsync( - - global::Ideogram.GenerateImageRequestPImageIdeogram request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostGenerateImagePImageIdeogramAsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Generate with P-Image Ideogram
- /// Generates images synchronously using P-Image Ideogram. `quality` selects
- /// the generation quality level and `resolution` selects the output-size
- /// tier. Both parameters have defaults.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download them. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostGenerateImagePImageIdeogramAsResponseAsync( - - global::Ideogram.GenerateImageRequestPImageIdeogram request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostGenerateImagePImageIdeogramArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostGenerateImagePImageIdeogramSecurityRequirements, - operationName: "PostGenerateImagePImageIdeogramAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/text-to-image/p-image-ideogram", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - if (request.PromptUpsampling != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.PromptUpsampling).HasValue ? (request.PromptUpsampling).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"prompt_upsampling\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.MagicPromptSystemPromptConfigId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.MagicPromptSystemPromptConfigId ?? string.Empty), - name: "\"magic_prompt_system_prompt_config_id\""); - - } - if (request.Quality != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Quality).HasValue ? (request.Quality).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"quality\""); - - } - if (request.Resolution != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"resolution\""); - - } - if (request.AspectRatio != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.AspectRatio).HasValue ? (request.AspectRatio).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"aspect_ratio\""); - - } - if (request.CustomWidth != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.CustomWidth, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"custom_width\""); - - } - if (request.CustomHeight != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.CustomHeight, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"custom_height\""); - - } - if (request.EnableCopyrightDetection != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"enable_copyright_detection\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostGenerateImagePImageIdeogramRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImagePImageIdeogram", - methodName: "PostGenerateImagePImageIdeogramAsync", - pathTemplate: "\"/v1/text-to-image/p-image-ideogram\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImagePImageIdeogram", - methodName: "PostGenerateImagePImageIdeogramAsync", - pathTemplate: "\"/v1/text-to-image/p-image-ideogram\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImagePImageIdeogram", - methodName: "PostGenerateImagePImageIdeogramAsync", - pathTemplate: "\"/v1/text-to-image/p-image-ideogram\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostGenerateImagePImageIdeogramResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImagePImageIdeogram", - methodName: "PostGenerateImagePImageIdeogramAsync", - pathTemplate: "\"/v1/text-to-image/p-image-ideogram\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImagePImageIdeogram", - methodName: "PostGenerateImagePImageIdeogramAsync", - pathTemplate: "\"/v1/text-to-image/p-image-ideogram\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt failed the safety check. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostGenerateImagePImageIdeogramResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.ImageGenerationResponseV4.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.ImageGenerationResponseV4.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Generate with P-Image Ideogram
- /// Generates images synchronously using P-Image Ideogram. `quality` selects
- /// the generation quality level and `resolution` selects the output-size
- /// tier. Both parameters have defaults.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download them. - ///
- /// - /// The prompt for image generation. Accepts either natural language or
- /// a structured Ideogram 4.0 JSON prompt; the server detects which was supplied. - /// - /// - /// Controls magic-prompt (prompt upsampling). Defaults to `AUTO`.
- /// Default Value: AUTO - /// - /// - /// Random seed for reproducibility. - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use
- /// for this request. - /// - /// - /// The generation quality level. Defaults to `MEDIUM`.
- /// Default Value: MEDIUM - /// - /// - /// The output-size tier. Defaults to `1K`.
- /// Default Value: 1K - /// - /// - /// The output aspect ratio. Defaults to `1x1`.
- /// Default Value: 1x1 - /// - /// - /// Optional. An exact output width in pixels, used together with
- /// `custom_height` for output sizes outside the preset tiers. Must be
- /// a positive multiple of 16 between 16 and 4096, and
- /// `custom_width` × `custom_height` must not exceed 4,194,304 pixels
- /// (2048×2048). Cannot be combined with `resolution` or
- /// `aspect_ratio`; the request is billed at the resolution tier
- /// matching its total pixel count. - /// - /// - /// Optional. An exact output height in pixels, used together with
- /// `custom_width`. See `custom_width` for the accepted range and
- /// billing behavior. - /// - /// - /// Optional. Opt this request into post-generation copyright detection. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImagePImageIdeogramAsync( - string prompt, - global::Ideogram.MagicPromptOption? promptUpsampling = default, - int? seed = default, - string? magicPromptSystemPromptConfigId = default, - global::Ideogram.Quality? quality = default, - global::Ideogram.PImageResolution? resolution = default, - global::Ideogram.AspectRatioV3? aspectRatio = default, - int? customWidth = default, - int? customHeight = default, - bool? enableCopyrightDetection = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.GenerateImageRequestPImageIdeogram - { - Prompt = prompt, - PromptUpsampling = promptUpsampling, - Seed = seed, - MagicPromptSystemPromptConfigId = magicPromptSystemPromptConfigId, - Quality = quality, - Resolution = resolution, - AspectRatio = aspectRatio, - CustomWidth = customWidth, - CustomHeight = customHeight, - EnableCopyrightDetection = enableCopyrightDetection, - }; - - return await PostGenerateImagePImageIdeogramAsync( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImagePImageIdeogramAsync.g.cs b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImagePImageIdeogramAsync.g.cs deleted file mode 100644 index 96d866fb..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImagePImageIdeogramAsync.g.cs +++ /dev/null @@ -1,792 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class GenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostGenerateImagePImageIdeogramAsyncSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostGenerateImagePImageIdeogramAsyncSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostGenerateImagePImageIdeogramAsyncSecurityRequirement0, - }; - partial void PreparePostGenerateImagePImageIdeogramAsyncArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? webhookUrl, - global::Ideogram.GenerateImageRequestPImageIdeogram request); - partial void PreparePostGenerateImagePImageIdeogramAsyncRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? webhookUrl, - global::Ideogram.GenerateImageRequestPImageIdeogram request); - partial void ProcessPostGenerateImagePImageIdeogramAsyncResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostGenerateImagePImageIdeogramAsyncResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Generate with P-Image Ideogram asynchronously
- /// Accepts a P-Image Ideogram generation request for asynchronous processing
- /// and returns immediately with a generation_id. Poll
- /// `GET /v1/generations/{generation_id}` to retrieve the result. If a
- /// `webhook_url` is supplied, the generated images are additionally POSTed
- /// to it once ready, in a payload that mirrors the synchronous response with
- /// an added generation_id for correlation.
- /// See [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImagePImageIdeogramAsyncAsync( - - global::Ideogram.GenerateImageRequestPImageIdeogram request, - string? webhookUrl = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostGenerateImagePImageIdeogramAsyncAsResponseAsync( - - request: request, - webhookUrl: webhookUrl, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Generate with P-Image Ideogram asynchronously
- /// Accepts a P-Image Ideogram generation request for asynchronous processing
- /// and returns immediately with a generation_id. Poll
- /// `GET /v1/generations/{generation_id}` to retrieve the result. If a
- /// `webhook_url` is supplied, the generated images are additionally POSTed
- /// to it once ready, in a payload that mirrors the synchronous response with
- /// an added generation_id for correlation.
- /// See [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostGenerateImagePImageIdeogramAsyncAsResponseAsync( - - global::Ideogram.GenerateImageRequestPImageIdeogram request, - string? webhookUrl = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostGenerateImagePImageIdeogramAsyncArguments( - httpClient: HttpClient, - webhookUrl: ref webhookUrl, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostGenerateImagePImageIdeogramAsyncSecurityRequirements, - operationName: "PostGenerateImagePImageIdeogramAsyncAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/async/text-to-image/p-image-ideogram", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("webhook_url", webhookUrl) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - if (request.PromptUpsampling != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.PromptUpsampling).HasValue ? (request.PromptUpsampling).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"prompt_upsampling\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.MagicPromptSystemPromptConfigId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.MagicPromptSystemPromptConfigId ?? string.Empty), - name: "\"magic_prompt_system_prompt_config_id\""); - - } - if (request.Quality != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Quality).HasValue ? (request.Quality).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"quality\""); - - } - if (request.Resolution != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"resolution\""); - - } - if (request.AspectRatio != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.AspectRatio).HasValue ? (request.AspectRatio).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"aspect_ratio\""); - - } - if (request.CustomWidth != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.CustomWidth, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"custom_width\""); - - } - if (request.CustomHeight != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.CustomHeight, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"custom_height\""); - - } - if (request.EnableCopyrightDetection != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"enable_copyright_detection\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostGenerateImagePImageIdeogramAsyncRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - webhookUrl: webhookUrl, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImagePImageIdeogramAsync", - methodName: "PostGenerateImagePImageIdeogramAsyncAsync", - pathTemplate: "\"/v1/async/text-to-image/p-image-ideogram\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImagePImageIdeogramAsync", - methodName: "PostGenerateImagePImageIdeogramAsyncAsync", - pathTemplate: "\"/v1/async/text-to-image/p-image-ideogram\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImagePImageIdeogramAsync", - methodName: "PostGenerateImagePImageIdeogramAsyncAsync", - pathTemplate: "\"/v1/async/text-to-image/p-image-ideogram\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostGenerateImagePImageIdeogramAsyncResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImagePImageIdeogramAsync", - methodName: "PostGenerateImagePImageIdeogramAsyncAsync", - pathTemplate: "\"/v1/async/text-to-image/p-image-ideogram\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImagePImageIdeogramAsync", - methodName: "PostGenerateImagePImageIdeogramAsyncAsync", - pathTemplate: "\"/v1/async/text-to-image/p-image-ideogram\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt failed the safety check. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostGenerateImagePImageIdeogramAsyncResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.AsyncImageGenerationResponseV4.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.AsyncImageGenerationResponseV4.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Generate with P-Image Ideogram asynchronously
- /// Accepts a P-Image Ideogram generation request for asynchronous processing
- /// and returns immediately with a generation_id. Poll
- /// `GET /v1/generations/{generation_id}` to retrieve the result. If a
- /// `webhook_url` is supplied, the generated images are additionally POSTed
- /// to it once ready, in a payload that mirrors the synchronous response with
- /// an added generation_id for correlation.
- /// See [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// The prompt for image generation. Accepts either natural language or
- /// a structured Ideogram 4.0 JSON prompt; the server detects which was supplied. - /// - /// - /// Controls magic-prompt (prompt upsampling). Defaults to `AUTO`.
- /// Default Value: AUTO - /// - /// - /// Random seed for reproducibility. - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use
- /// for this request. - /// - /// - /// The generation quality level. Defaults to `MEDIUM`.
- /// Default Value: MEDIUM - /// - /// - /// The output-size tier. Defaults to `1K`.
- /// Default Value: 1K - /// - /// - /// The output aspect ratio. Defaults to `1x1`.
- /// Default Value: 1x1 - /// - /// - /// Optional. An exact output width in pixels, used together with
- /// `custom_height` for output sizes outside the preset tiers. Must be
- /// a positive multiple of 16 between 16 and 4096, and
- /// `custom_width` × `custom_height` must not exceed 4,194,304 pixels
- /// (2048×2048). Cannot be combined with `resolution` or
- /// `aspect_ratio`; the request is billed at the resolution tier
- /// matching its total pixel count. - /// - /// - /// Optional. An exact output height in pixels, used together with
- /// `custom_width`. See `custom_width` for the accepted range and
- /// billing behavior. - /// - /// - /// Optional. Opt this request into post-generation copyright detection. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImagePImageIdeogramAsyncAsync( - string prompt, - string? webhookUrl = default, - global::Ideogram.MagicPromptOption? promptUpsampling = default, - int? seed = default, - string? magicPromptSystemPromptConfigId = default, - global::Ideogram.Quality? quality = default, - global::Ideogram.PImageResolution? resolution = default, - global::Ideogram.AspectRatioV3? aspectRatio = default, - int? customWidth = default, - int? customHeight = default, - bool? enableCopyrightDetection = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.GenerateImageRequestPImageIdeogram - { - Prompt = prompt, - PromptUpsampling = promptUpsampling, - Seed = seed, - MagicPromptSystemPromptConfigId = magicPromptSystemPromptConfigId, - Quality = quality, - Resolution = resolution, - AspectRatio = aspectRatio, - CustomWidth = customWidth, - CustomHeight = customHeight, - EnableCopyrightDetection = enableCopyrightDetection, - }; - - return await PostGenerateImagePImageIdeogramAsyncAsync( - webhookUrl: webhookUrl, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImagePImageLow.g.cs b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImagePImageLow.g.cs deleted file mode 100644 index f24e5d85..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImagePImageLow.g.cs +++ /dev/null @@ -1,687 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class GenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostGenerateImagePImageLowSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostGenerateImagePImageLowSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostGenerateImagePImageLowSecurityRequirement0, - }; - partial void PreparePostGenerateImagePImageLowArguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.GenerateImageRequestPImage request); - partial void PreparePostGenerateImagePImageLowRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.GenerateImageRequestPImage request); - partial void ProcessPostGenerateImagePImageLowResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostGenerateImagePImageLowResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Generate with the distilled few-step Ideogram model (low speed tier)
- /// Generates images synchronously using the distilled few-step Ideogram
- /// model at the low speed tier — fast and low-cost, with a modest quality
- /// trade-off. The speed tier controls the number of diffusion steps and the
- /// per-image price.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImagePImageLowAsync( - - global::Ideogram.GenerateImageRequestPImage request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostGenerateImagePImageLowAsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Generate with the distilled few-step Ideogram model (low speed tier)
- /// Generates images synchronously using the distilled few-step Ideogram
- /// model at the low speed tier — fast and low-cost, with a modest quality
- /// trade-off. The speed tier controls the number of diffusion steps and the
- /// per-image price.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostGenerateImagePImageLowAsResponseAsync( - - global::Ideogram.GenerateImageRequestPImage request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostGenerateImagePImageLowArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostGenerateImagePImageLowSecurityRequirements, - operationName: "PostGenerateImagePImageLowAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/p-image-ideogram/low/generate", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - if (request.PromptUpsampling != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.PromptUpsampling).HasValue ? (request.PromptUpsampling).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"prompt_upsampling\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.MagicPromptSystemPromptConfigId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.MagicPromptSystemPromptConfigId ?? string.Empty), - name: "\"magic_prompt_system_prompt_config_id\""); - - } - if (request.Resolution != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"resolution\""); - - } - if (request.EnableCopyrightDetection != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"enable_copyright_detection\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostGenerateImagePImageLowRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImagePImageLow", - methodName: "PostGenerateImagePImageLowAsync", - pathTemplate: "\"/v1/p-image-ideogram/low/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImagePImageLow", - methodName: "PostGenerateImagePImageLowAsync", - pathTemplate: "\"/v1/p-image-ideogram/low/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImagePImageLow", - methodName: "PostGenerateImagePImageLowAsync", - pathTemplate: "\"/v1/p-image-ideogram/low/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostGenerateImagePImageLowResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImagePImageLow", - methodName: "PostGenerateImagePImageLowAsync", - pathTemplate: "\"/v1/p-image-ideogram/low/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImagePImageLow", - methodName: "PostGenerateImagePImageLowAsync", - pathTemplate: "\"/v1/p-image-ideogram/low/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt failed the safety check. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostGenerateImagePImageLowResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.ImageGenerationResponseV4.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.ImageGenerationResponseV4.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Generate with the distilled few-step Ideogram model (low speed tier)
- /// Generates images synchronously using the distilled few-step Ideogram
- /// model at the low speed tier — fast and low-cost, with a modest quality
- /// trade-off. The speed tier controls the number of diffusion steps and the
- /// per-image price.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The prompt for image generation. Accepts either natural language or
- /// a structured prompt that conforms to the Ideogram 4.0 JSON contract;
- /// the server detects which was supplied. See `prompt_upsampling` for
- /// how magic-prompt is applied. - /// - /// - /// Controls magic-prompt (prompt upsampling). `AUTO` (default) applies
- /// magic-prompt to a natural-language `prompt` or a non-Ideogram 4.0 JSON
- /// `prompt`, and skips it when `prompt` is already a structured Ideogram
- /// 4.0 JSON prompt. `ON` always applies magic-prompt, even to an Ideogram
- /// 4.0 JSON prompt; `OFF` never applies it. Defaults to `AUTO`. - /// - /// - /// Random seed for reproducibility. - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use
- /// for this request. Honored only when magic-prompt runs (a
- /// natural-language `prompt` with `prompt_upsampling` AUTO or ON). - /// - /// - /// The 1K and 2K resolutions supported for Ideogram 4.0 image generation.
- /// Example: 2048x2048 - /// - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). The effective gate is the OR of this field and the organization's
- /// `copyright_detection_enabled` setting on `/api`. See GenerateImageRequestV3 for details. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImagePImageLowAsync( - string prompt, - global::Ideogram.MagicPromptOption? promptUpsampling = default, - int? seed = default, - string? magicPromptSystemPromptConfigId = default, - global::Ideogram.ResolutionV4? resolution = default, - bool? enableCopyrightDetection = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.GenerateImageRequestPImage - { - Prompt = prompt, - PromptUpsampling = promptUpsampling, - Seed = seed, - MagicPromptSystemPromptConfigId = magicPromptSystemPromptConfigId, - Resolution = resolution, - EnableCopyrightDetection = enableCopyrightDetection, - }; - - return await PostGenerateImagePImageLowAsync( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImagePImageMedium.g.cs b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImagePImageMedium.g.cs deleted file mode 100644 index d65179fc..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImagePImageMedium.g.cs +++ /dev/null @@ -1,687 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class GenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostGenerateImagePImageMediumSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostGenerateImagePImageMediumSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostGenerateImagePImageMediumSecurityRequirement0, - }; - partial void PreparePostGenerateImagePImageMediumArguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.GenerateImageRequestPImage request); - partial void PreparePostGenerateImagePImageMediumRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.GenerateImageRequestPImage request); - partial void ProcessPostGenerateImagePImageMediumResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostGenerateImagePImageMediumResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Generate with the distilled few-step Ideogram model (medium speed tier)
- /// Generates images synchronously using the distilled few-step Ideogram
- /// model at the medium speed tier — the balanced default of speed, cost, and
- /// quality. The speed tier controls the number of diffusion steps and the
- /// per-image price.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImagePImageMediumAsync( - - global::Ideogram.GenerateImageRequestPImage request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostGenerateImagePImageMediumAsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Generate with the distilled few-step Ideogram model (medium speed tier)
- /// Generates images synchronously using the distilled few-step Ideogram
- /// model at the medium speed tier — the balanced default of speed, cost, and
- /// quality. The speed tier controls the number of diffusion steps and the
- /// per-image price.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostGenerateImagePImageMediumAsResponseAsync( - - global::Ideogram.GenerateImageRequestPImage request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostGenerateImagePImageMediumArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostGenerateImagePImageMediumSecurityRequirements, - operationName: "PostGenerateImagePImageMediumAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/p-image-ideogram/medium/generate", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - if (request.PromptUpsampling != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.PromptUpsampling).HasValue ? (request.PromptUpsampling).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"prompt_upsampling\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.MagicPromptSystemPromptConfigId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.MagicPromptSystemPromptConfigId ?? string.Empty), - name: "\"magic_prompt_system_prompt_config_id\""); - - } - if (request.Resolution != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"resolution\""); - - } - if (request.EnableCopyrightDetection != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"enable_copyright_detection\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostGenerateImagePImageMediumRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImagePImageMedium", - methodName: "PostGenerateImagePImageMediumAsync", - pathTemplate: "\"/v1/p-image-ideogram/medium/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImagePImageMedium", - methodName: "PostGenerateImagePImageMediumAsync", - pathTemplate: "\"/v1/p-image-ideogram/medium/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImagePImageMedium", - methodName: "PostGenerateImagePImageMediumAsync", - pathTemplate: "\"/v1/p-image-ideogram/medium/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostGenerateImagePImageMediumResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImagePImageMedium", - methodName: "PostGenerateImagePImageMediumAsync", - pathTemplate: "\"/v1/p-image-ideogram/medium/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImagePImageMedium", - methodName: "PostGenerateImagePImageMediumAsync", - pathTemplate: "\"/v1/p-image-ideogram/medium/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt failed the safety check. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostGenerateImagePImageMediumResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.ImageGenerationResponseV4.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.ImageGenerationResponseV4.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Generate with the distilled few-step Ideogram model (medium speed tier)
- /// Generates images synchronously using the distilled few-step Ideogram
- /// model at the medium speed tier — the balanced default of speed, cost, and
- /// quality. The speed tier controls the number of diffusion steps and the
- /// per-image price.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The prompt for image generation. Accepts either natural language or
- /// a structured prompt that conforms to the Ideogram 4.0 JSON contract;
- /// the server detects which was supplied. See `prompt_upsampling` for
- /// how magic-prompt is applied. - /// - /// - /// Controls magic-prompt (prompt upsampling). `AUTO` (default) applies
- /// magic-prompt to a natural-language `prompt` or a non-Ideogram 4.0 JSON
- /// `prompt`, and skips it when `prompt` is already a structured Ideogram
- /// 4.0 JSON prompt. `ON` always applies magic-prompt, even to an Ideogram
- /// 4.0 JSON prompt; `OFF` never applies it. Defaults to `AUTO`. - /// - /// - /// Random seed for reproducibility. - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use
- /// for this request. Honored only when magic-prompt runs (a
- /// natural-language `prompt` with `prompt_upsampling` AUTO or ON). - /// - /// - /// The 1K and 2K resolutions supported for Ideogram 4.0 image generation.
- /// Example: 2048x2048 - /// - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). The effective gate is the OR of this field and the organization's
- /// `copyright_detection_enabled` setting on `/api`. See GenerateImageRequestV3 for details. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImagePImageMediumAsync( - string prompt, - global::Ideogram.MagicPromptOption? promptUpsampling = default, - int? seed = default, - string? magicPromptSystemPromptConfigId = default, - global::Ideogram.ResolutionV4? resolution = default, - bool? enableCopyrightDetection = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.GenerateImageRequestPImage - { - Prompt = prompt, - PromptUpsampling = promptUpsampling, - Seed = seed, - MagicPromptSystemPromptConfigId = magicPromptSystemPromptConfigId, - Resolution = resolution, - EnableCopyrightDetection = enableCopyrightDetection, - }; - - return await PostGenerateImagePImageMediumAsync( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImagePImageVeryLow.g.cs b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImagePImageVeryLow.g.cs deleted file mode 100644 index 216286bf..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImagePImageVeryLow.g.cs +++ /dev/null @@ -1,687 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class GenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostGenerateImagePImageVeryLowSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostGenerateImagePImageVeryLowSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostGenerateImagePImageVeryLowSecurityRequirement0, - }; - partial void PreparePostGenerateImagePImageVeryLowArguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.GenerateImageRequestPImage request); - partial void PreparePostGenerateImagePImageVeryLowRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.GenerateImageRequestPImage request); - partial void ProcessPostGenerateImagePImageVeryLowResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostGenerateImagePImageVeryLowResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Generate with the distilled few-step Ideogram model (very-low speed tier)
- /// Generates images synchronously using the distilled few-step Ideogram
- /// model at the very-low speed tier — the fastest and lowest-cost option.
- /// The speed tier controls the number of diffusion steps and the per-image
- /// price.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImagePImageVeryLowAsync( - - global::Ideogram.GenerateImageRequestPImage request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostGenerateImagePImageVeryLowAsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Generate with the distilled few-step Ideogram model (very-low speed tier)
- /// Generates images synchronously using the distilled few-step Ideogram
- /// model at the very-low speed tier — the fastest and lowest-cost option.
- /// The speed tier controls the number of diffusion steps and the per-image
- /// price.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostGenerateImagePImageVeryLowAsResponseAsync( - - global::Ideogram.GenerateImageRequestPImage request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostGenerateImagePImageVeryLowArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostGenerateImagePImageVeryLowSecurityRequirements, - operationName: "PostGenerateImagePImageVeryLowAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/p-image-ideogram/very-low/generate", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - if (request.PromptUpsampling != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.PromptUpsampling).HasValue ? (request.PromptUpsampling).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"prompt_upsampling\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.MagicPromptSystemPromptConfigId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.MagicPromptSystemPromptConfigId ?? string.Empty), - name: "\"magic_prompt_system_prompt_config_id\""); - - } - if (request.Resolution != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"resolution\""); - - } - if (request.EnableCopyrightDetection != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"enable_copyright_detection\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostGenerateImagePImageVeryLowRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImagePImageVeryLow", - methodName: "PostGenerateImagePImageVeryLowAsync", - pathTemplate: "\"/v1/p-image-ideogram/very-low/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImagePImageVeryLow", - methodName: "PostGenerateImagePImageVeryLowAsync", - pathTemplate: "\"/v1/p-image-ideogram/very-low/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImagePImageVeryLow", - methodName: "PostGenerateImagePImageVeryLowAsync", - pathTemplate: "\"/v1/p-image-ideogram/very-low/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostGenerateImagePImageVeryLowResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImagePImageVeryLow", - methodName: "PostGenerateImagePImageVeryLowAsync", - pathTemplate: "\"/v1/p-image-ideogram/very-low/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImagePImageVeryLow", - methodName: "PostGenerateImagePImageVeryLowAsync", - pathTemplate: "\"/v1/p-image-ideogram/very-low/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt failed the safety check. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostGenerateImagePImageVeryLowResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.ImageGenerationResponseV4.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.ImageGenerationResponseV4.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Generate with the distilled few-step Ideogram model (very-low speed tier)
- /// Generates images synchronously using the distilled few-step Ideogram
- /// model at the very-low speed tier — the fastest and lowest-cost option.
- /// The speed tier controls the number of diffusion steps and the per-image
- /// price.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The prompt for image generation. Accepts either natural language or
- /// a structured prompt that conforms to the Ideogram 4.0 JSON contract;
- /// the server detects which was supplied. See `prompt_upsampling` for
- /// how magic-prompt is applied. - /// - /// - /// Controls magic-prompt (prompt upsampling). `AUTO` (default) applies
- /// magic-prompt to a natural-language `prompt` or a non-Ideogram 4.0 JSON
- /// `prompt`, and skips it when `prompt` is already a structured Ideogram
- /// 4.0 JSON prompt. `ON` always applies magic-prompt, even to an Ideogram
- /// 4.0 JSON prompt; `OFF` never applies it. Defaults to `AUTO`. - /// - /// - /// Random seed for reproducibility. - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use
- /// for this request. Honored only when magic-prompt runs (a
- /// natural-language `prompt` with `prompt_upsampling` AUTO or ON). - /// - /// - /// The 1K and 2K resolutions supported for Ideogram 4.0 image generation.
- /// Example: 2048x2048 - /// - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). The effective gate is the OR of this field and the organization's
- /// `copyright_detection_enabled` setting on `/api`. See GenerateImageRequestV3 for details. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImagePImageVeryLowAsync( - string prompt, - global::Ideogram.MagicPromptOption? promptUpsampling = default, - int? seed = default, - string? magicPromptSystemPromptConfigId = default, - global::Ideogram.ResolutionV4? resolution = default, - bool? enableCopyrightDetection = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.GenerateImageRequestPImage - { - Prompt = prompt, - PromptUpsampling = promptUpsampling, - Seed = seed, - MagicPromptSystemPromptConfigId = magicPromptSystemPromptConfigId, - Resolution = resolution, - EnableCopyrightDetection = enableCopyrightDetection, - }; - - return await PostGenerateImagePImageVeryLowAsync( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageV3.g.cs deleted file mode 100644 index b060d31a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageV3.g.cs +++ /dev/null @@ -1,870 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class GenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostGenerateImageV3SecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostGenerateImageV3SecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostGenerateImageV3SecurityRequirement0, - }; - partial void PreparePostGenerateImageV3Arguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.GenerateImageRequestV3 request); - partial void PreparePostGenerateImageV3Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.GenerateImageRequestV3 request); - partial void ProcessPostGenerateImageV3Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostGenerateImageV3ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Generate with Ideogram 3.0
- /// Generates images synchronously based on a given prompt and optional parameters using the Ideogram 3.0 model.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageV3Async( - - global::Ideogram.GenerateImageRequestV3 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostGenerateImageV3AsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Generate with Ideogram 3.0
- /// Generates images synchronously based on a given prompt and optional parameters using the Ideogram 3.0 model.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostGenerateImageV3AsResponseAsync( - - global::Ideogram.GenerateImageRequestV3 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostGenerateImageV3Arguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostGenerateImageV3SecurityRequirements, - operationName: "PostGenerateImageV3Async"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/ideogram-v3/generate", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.Resolution != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"resolution\""); - - } - if (request.AspectRatio != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.AspectRatio).HasValue ? (request.AspectRatio).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"aspect_ratio\""); - - } - if (request.RenderingSpeed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"rendering_speed\""); - - } - if (request.MagicPrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.MagicPrompt).HasValue ? (request.MagicPrompt).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"magic_prompt\""); - - } - if (request.MagicPromptSystemPromptConfigId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.MagicPromptSystemPromptConfigId ?? string.Empty), - name: "\"magic_prompt_system_prompt_config_id\""); - - } - if (request.NegativePrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.NegativePrompt ?? string.Empty), - name: "\"negative_prompt\""); - - } - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.ColorPalette != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ColorPalette.ToString() ?? string.Empty), - name: "\"color_palette\""); - - } - if (request.StyleCodes != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.StyleCodes!, x => x))}]"), - name: "\"style_codes\""); - - } - if (request.StyleType != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.StyleType).HasValue ? (request.StyleType).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"style_type\""); - - } - if (request.StylePreset != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.StylePreset).HasValue ? (request.StylePreset).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"style_preset\""); - - } - if (request.CustomModelUri != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.CustomModelUri ?? string.Empty), - name: "\"custom_model_uri\""); - - } - if (request.StyleReferenceImages != default) - { - - for (var __iStyleReferenceImages = 0; __iStyleReferenceImages < request.StyleReferenceImages.Count; __iStyleReferenceImages++) - { - var __contentStyleReferenceImages = new global::System.Net.Http.ByteArrayContent(request.StyleReferenceImages[__iStyleReferenceImages]); - __contentStyleReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); - __httpRequestContent.Add( - content: __contentStyleReferenceImages, - name: "\"style_reference_images\"", - fileName: $"\"file{__iStyleReferenceImages}.bin\""); - if (__contentStyleReferenceImages.Headers.ContentDisposition != null) - { - __contentStyleReferenceImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - if (request.CharacterReferenceImages != default) - { - - for (var __iCharacterReferenceImages = 0; __iCharacterReferenceImages < request.CharacterReferenceImages.Count; __iCharacterReferenceImages++) - { - var __contentCharacterReferenceImages = new global::System.Net.Http.ByteArrayContent(request.CharacterReferenceImages[__iCharacterReferenceImages]); - __contentCharacterReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); - __httpRequestContent.Add( - content: __contentCharacterReferenceImages, - name: "\"character_reference_images\"", - fileName: $"\"file{__iCharacterReferenceImages}.bin\""); - if (__contentCharacterReferenceImages.Headers.ContentDisposition != null) - { - __contentCharacterReferenceImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - if (request.CharacterReferenceImagesMask != default) - { - - for (var __iCharacterReferenceImagesMask = 0; __iCharacterReferenceImagesMask < request.CharacterReferenceImagesMask.Count; __iCharacterReferenceImagesMask++) - { - var __contentCharacterReferenceImagesMask = new global::System.Net.Http.ByteArrayContent(request.CharacterReferenceImagesMask[__iCharacterReferenceImagesMask]); - __contentCharacterReferenceImagesMask.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); - __httpRequestContent.Add( - content: __contentCharacterReferenceImagesMask, - name: "\"character_reference_images_mask\"", - fileName: $"\"file{__iCharacterReferenceImagesMask}.bin\""); - if (__contentCharacterReferenceImagesMask.Headers.ContentDisposition != null) - { - __contentCharacterReferenceImagesMask.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - if (request.EnableCopyrightDetection != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"enable_copyright_detection\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostGenerateImageV3Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV3", - methodName: "PostGenerateImageV3Async", - pathTemplate: "\"/v1/ideogram-v3/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV3", - methodName: "PostGenerateImageV3Async", - pathTemplate: "\"/v1/ideogram-v3/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV3", - methodName: "PostGenerateImageV3Async", - pathTemplate: "\"/v1/ideogram-v3/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostGenerateImageV3Response( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV3", - methodName: "PostGenerateImageV3Async", - pathTemplate: "\"/v1/ideogram-v3/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV3", - methodName: "PostGenerateImageV3Async", - pathTemplate: "\"/v1/ideogram-v3/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt failed the safety check. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostGenerateImageV3ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.ImageGenerationResponseV3.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.ImageGenerationResponseV3.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Generate with Ideogram 3.0
- /// Generates images synchronously based on a given prompt and optional parameters using the Ideogram 3.0 model.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The prompt to use to generate the image.
- /// Example: A photo of a cat - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The resolutions supported for Ideogram 3.0.
- /// Example: 1280x800 - /// - /// - /// Output aspect ratio. Cannot be combined with resolution. Generation defaults to 1x1; remix keeps the source ratio when both fields are omitted. - /// - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// Description of what to exclude from an image. Descriptions in the prompt take precedence
- /// to descriptions in the negative prompt.
- /// Example: brush strokes, painting - /// - /// - /// Number of images to generate.
- /// Default Value: 1 - /// - /// - /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). Not supported by V_1, V_1_TURBO, V_2A and V_2A_TURBO models. - /// - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - /// - /// - /// The style type to generate with.
- /// Default Value: GENERAL
- /// Example: GENERAL - /// - /// - /// A predefined style preset that applies a specific artistic style to the generated image.
- /// Example: BRIGHT_ART - /// - /// - /// A custom model URI in the format model/<model_name>/version/<version_name>.
- /// When provided, the model version and style will be resolved from this URI, and style_type is not required.
- /// Example: model/my-custom-model/version/1 - /// - /// - /// A set of images to use as style references (max size 25MB per image; the whole request must stay under 50MB). The images should be in JPEG, PNG or WebP format. - /// - /// - /// Generations with character reference are subject to the character reference pricing. A set of images to use as character references (max size 25MB per image; the whole request must stay under 50MB), currently only supports 1 character reference image. The images should be in JPEG, PNG or WebP format. - /// - /// - /// Optional masks for character reference images. When provided, must match the number of character_reference_images. Each mask should be a grayscale image of the same dimensions as the corresponding character reference image. The images should be in JPEG, PNG or WebP format. - /// - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). The effective gate is the OR of this field and the organization's
- /// `copyright_detection_enabled` setting on `/api`: if the org has it on, this is ignored;
- /// if the org has it off, setting this `true` enables detection for this request only.
- /// Adds detection latency. Flagged images come back with `is_image_safe: false`. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageV3Async( - string prompt, - int? seed = default, - global::Ideogram.ResolutionV3? resolution = default, - global::Ideogram.AspectRatioV3? aspectRatio = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - global::Ideogram.MagicPromptOption? magicPrompt = default, - string? magicPromptSystemPromptConfigId = default, - string? negativePrompt = default, - int? numImages = default, - global::Ideogram.ColorPaletteWithPresetNameOrMembers? colorPalette = default, - global::System.Collections.Generic.IList? styleCodes = default, - global::Ideogram.StyleTypeV3? styleType = default, - global::Ideogram.StylePresetV3? stylePreset = default, - string? customModelUri = default, - global::System.Collections.Generic.IList? styleReferenceImages = default, - global::System.Collections.Generic.IList? characterReferenceImages = default, - global::System.Collections.Generic.IList? characterReferenceImagesMask = default, - bool? enableCopyrightDetection = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.GenerateImageRequestV3 - { - Prompt = prompt, - Seed = seed, - Resolution = resolution, - AspectRatio = aspectRatio, - RenderingSpeed = renderingSpeed, - MagicPrompt = magicPrompt, - MagicPromptSystemPromptConfigId = magicPromptSystemPromptConfigId, - NegativePrompt = negativePrompt, - NumImages = numImages, - ColorPalette = colorPalette, - StyleCodes = styleCodes, - StyleType = styleType, - StylePreset = stylePreset, - CustomModelUri = customModelUri, - StyleReferenceImages = styleReferenceImages, - CharacterReferenceImages = characterReferenceImages, - CharacterReferenceImagesMask = characterReferenceImagesMask, - EnableCopyrightDetection = enableCopyrightDetection, - }; - - return await PostGenerateImageV3Async( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageV3Transparent.g.cs b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageV3Transparent.g.cs deleted file mode 100644 index c44290f2..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageV3Transparent.g.cs +++ /dev/null @@ -1,762 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class GenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostGenerateImageV3TransparentSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostGenerateImageV3TransparentSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostGenerateImageV3TransparentSecurityRequirement0, - }; - partial void PreparePostGenerateImageV3TransparentArguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.GenerateTransparentImageRequestV3 request); - partial void PreparePostGenerateImageV3TransparentRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.GenerateTransparentImageRequestV3 request); - partial void ProcessPostGenerateImageV3TransparentResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostGenerateImageV3TransparentResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Generate with Ideogram 3.0 (Transparent Background)
- /// Generates images with transparent background synchronously based on a given prompt and optional parameters using
- /// the Ideogram 3.0 model. Images will be generated using maximum supported resolution at the specified aspect ratio
- /// to allow best results with upscaler. The selected resolution is written to the response, not the upscaled final
- /// resolution.
- /// `rendering_speed=FLASH` is not supported for transparent-background generation; the request will return a 400.
- /// Use `TURBO`, `DEFAULT`, or `QUALITY` instead.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageV3TransparentAsync( - - global::Ideogram.GenerateTransparentImageRequestV3 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostGenerateImageV3TransparentAsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Generate with Ideogram 3.0 (Transparent Background)
- /// Generates images with transparent background synchronously based on a given prompt and optional parameters using
- /// the Ideogram 3.0 model. Images will be generated using maximum supported resolution at the specified aspect ratio
- /// to allow best results with upscaler. The selected resolution is written to the response, not the upscaled final
- /// resolution.
- /// `rendering_speed=FLASH` is not supported for transparent-background generation; the request will return a 400.
- /// Use `TURBO`, `DEFAULT`, or `QUALITY` instead.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostGenerateImageV3TransparentAsResponseAsync( - - global::Ideogram.GenerateTransparentImageRequestV3 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostGenerateImageV3TransparentArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostGenerateImageV3TransparentSecurityRequirements, - operationName: "PostGenerateImageV3TransparentAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/ideogram-v3/generate-transparent", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.UpscaleFactor != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.UpscaleFactor).HasValue ? (request.UpscaleFactor).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"upscale_factor\""); - - } - if (request.AspectRatio != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.AspectRatio).HasValue ? (request.AspectRatio).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"aspect_ratio\""); - - } - if (request.RenderingSpeed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"rendering_speed\""); - - } - if (request.MagicPrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.MagicPrompt).HasValue ? (request.MagicPrompt).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"magic_prompt\""); - - } - if (request.MagicPromptSystemPromptConfigId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.MagicPromptSystemPromptConfigId ?? string.Empty), - name: "\"magic_prompt_system_prompt_config_id\""); - - } - if (request.NegativePrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.NegativePrompt ?? string.Empty), - name: "\"negative_prompt\""); - - } - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.CustomModelUri != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.CustomModelUri ?? string.Empty), - name: "\"custom_model_uri\""); - - } - if (request.EnableCopyrightDetection != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"enable_copyright_detection\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostGenerateImageV3TransparentRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV3Transparent", - methodName: "PostGenerateImageV3TransparentAsync", - pathTemplate: "\"/v1/ideogram-v3/generate-transparent\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV3Transparent", - methodName: "PostGenerateImageV3TransparentAsync", - pathTemplate: "\"/v1/ideogram-v3/generate-transparent\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV3Transparent", - methodName: "PostGenerateImageV3TransparentAsync", - pathTemplate: "\"/v1/ideogram-v3/generate-transparent\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostGenerateImageV3TransparentResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV3Transparent", - methodName: "PostGenerateImageV3TransparentAsync", - pathTemplate: "\"/v1/ideogram-v3/generate-transparent\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV3Transparent", - methodName: "PostGenerateImageV3TransparentAsync", - pathTemplate: "\"/v1/ideogram-v3/generate-transparent\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt failed the safety check. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostGenerateImageV3TransparentResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.ImageGenerationResponseV3.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.ImageGenerationResponseV3.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Generate with Ideogram 3.0 (Transparent Background)
- /// Generates images with transparent background synchronously based on a given prompt and optional parameters using
- /// the Ideogram 3.0 model. Images will be generated using maximum supported resolution at the specified aspect ratio
- /// to allow best results with upscaler. The selected resolution is written to the response, not the upscaled final
- /// resolution.
- /// `rendering_speed=FLASH` is not supported for transparent-background generation; the request will return a 400.
- /// Use `TURBO`, `DEFAULT`, or `QUALITY` instead.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The prompt to use to generate the image.
- /// Example: A photo of a cat - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// Upscale the initially generated image by the given factor. Upscale factors other than X1 will incur additional cost.
- /// Default Value: X1
- /// Example: X2 - /// - /// - /// Output aspect ratio. Cannot be combined with resolution. Generation defaults to 1x1; remix keeps the source ratio when both fields are omitted. - /// - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// Description of what to exclude from an image. Descriptions in the prompt take precedence
- /// to descriptions in the negative prompt.
- /// Example: brush strokes, painting - /// - /// - /// Number of images to generate.
- /// Default Value: 1 - /// - /// - /// A custom model URI in the format model/<model_name>/version/<version_name>.
- /// When provided, the model version and style will be resolved from this URI, and style_type is not required.
- /// A model must be able to generate transparent background to be used for this endpoint.
- /// Example: model/my-custom-model/version/1 - /// - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). The effective gate is the OR of this field and the organization's
- /// `copyright_detection_enabled` setting on `/api`: if the org has it on, this is ignored;
- /// if the org has it off, setting this `true` enables detection for this request only.
- /// Adds detection latency. Flagged images come back with `is_image_safe: false`. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageV3TransparentAsync( - string prompt, - int? seed = default, - global::Ideogram.UpscaleFactor? upscaleFactor = default, - global::Ideogram.AspectRatioV3? aspectRatio = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - global::Ideogram.MagicPromptOption? magicPrompt = default, - string? magicPromptSystemPromptConfigId = default, - string? negativePrompt = default, - int? numImages = default, - string? customModelUri = default, - bool? enableCopyrightDetection = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.GenerateTransparentImageRequestV3 - { - Prompt = prompt, - Seed = seed, - UpscaleFactor = upscaleFactor, - AspectRatio = aspectRatio, - RenderingSpeed = renderingSpeed, - MagicPrompt = magicPrompt, - MagicPromptSystemPromptConfigId = magicPromptSystemPromptConfigId, - NegativePrompt = negativePrompt, - NumImages = numImages, - CustomModelUri = customModelUri, - EnableCopyrightDetection = enableCopyrightDetection, - }; - - return await PostGenerateImageV3TransparentAsync( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageV4.g.cs b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageV4.g.cs deleted file mode 100644 index 16ad1e48..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageV4.g.cs +++ /dev/null @@ -1,710 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class GenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostGenerateImageV4SecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostGenerateImageV4SecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostGenerateImageV4SecurityRequirement0, - }; - partial void PreparePostGenerateImageV4Arguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.GenerateImageRequestV4 request); - partial void PreparePostGenerateImageV4Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.GenerateImageRequestV4 request); - partial void ProcessPostGenerateImageV4Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostGenerateImageV4ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Generate with Ideogram 4.0
- /// Generates images synchronously using the Ideogram 4.0 model.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageV4Async( - - global::Ideogram.GenerateImageRequestV4 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostGenerateImageV4AsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Generate with Ideogram 4.0
- /// Generates images synchronously using the Ideogram 4.0 model.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostGenerateImageV4AsResponseAsync( - - global::Ideogram.GenerateImageRequestV4 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostGenerateImageV4Arguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostGenerateImageV4SecurityRequirements, - operationName: "PostGenerateImageV4Async"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/ideogram-v4/generate", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (request.TextPrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.TextPrompt ?? string.Empty), - name: "\"text_prompt\""); - - } - if (request.JsonPrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.JsonPrompt.ToJson(JsonSerializerContext)), - name: "\"json_prompt\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.MagicPromptSystemPromptConfigId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.MagicPromptSystemPromptConfigId ?? string.Empty), - name: "\"magic_prompt_system_prompt_config_id\""); - - } - if (request.CustomModelUri != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.CustomModelUri ?? string.Empty), - name: "\"custom_model_uri\""); - - } - if (request.Resolution != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"resolution\""); - - } - if (request.RenderingSpeed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"rendering_speed\""); - - } - if (request.EnableCopyrightDetection != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"enable_copyright_detection\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostGenerateImageV4Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4", - methodName: "PostGenerateImageV4Async", - pathTemplate: "\"/v1/ideogram-v4/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4", - methodName: "PostGenerateImageV4Async", - pathTemplate: "\"/v1/ideogram-v4/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4", - methodName: "PostGenerateImageV4Async", - pathTemplate: "\"/v1/ideogram-v4/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostGenerateImageV4Response( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4", - methodName: "PostGenerateImageV4Async", - pathTemplate: "\"/v1/ideogram-v4/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4", - methodName: "PostGenerateImageV4Async", - pathTemplate: "\"/v1/ideogram-v4/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt failed the safety check. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostGenerateImageV4ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.ImageGenerationResponseV4.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.ImageGenerationResponseV4.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Generate with Ideogram 4.0
- /// Generates images synchronously using the Ideogram 4.0 model.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// A natural-language prompt for image generation. When supplied,
- /// magic-prompt is enabled automatically. Mutually exclusive with
- /// `json_prompt`. - /// - /// - /// A structured prompt that conforms to the Ideogram 4.0 JSON
- /// contract. When supplied, magic-prompt is disabled and the
- /// structured prompt is consumed by the diffusion model directly.
- /// Mutually exclusive with `text_prompt`. - /// - /// - /// Random seed for reproducibility. - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use
- /// for this request. Honored when `text_prompt` is supplied. Ignored
- /// when `json_prompt` is supplied. - /// - /// - /// A custom model URI in the format model/<model_name>/version/<version_name>.
- /// When provided, the model version and style will be resolved from this URI.
- /// Example: model/my-custom-model/version/0 - /// - /// - /// The 1K and 2K resolutions supported for Ideogram 4.0 image generation.
- /// Example: 2048x2048 - /// - /// - /// The rendering speed to use. For Ideogram V4, `rendering_speed=FLASH`
- /// is coming soon; requests with `rendering_speed=FLASH` currently
- /// return a 400. - /// - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). The effective gate is the OR of this field and the organization's
- /// `copyright_detection_enabled` setting on `/api`. See GenerateImageRequestV3 for details. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageV4Async( - string? textPrompt = default, - global::Ideogram.V4JsonPrompt? jsonPrompt = default, - int? seed = default, - string? magicPromptSystemPromptConfigId = default, - string? customModelUri = default, - global::Ideogram.ResolutionV4? resolution = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - bool? enableCopyrightDetection = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.GenerateImageRequestV4 - { - TextPrompt = textPrompt, - JsonPrompt = jsonPrompt, - Seed = seed, - MagicPromptSystemPromptConfigId = magicPromptSystemPromptConfigId, - CustomModelUri = customModelUri, - Resolution = resolution, - RenderingSpeed = renderingSpeed, - EnableCopyrightDetection = enableCopyrightDetection, - }; - - return await PostGenerateImageV4Async( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageV45.g.cs b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageV45.g.cs deleted file mode 100644 index cfcf5d3c..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageV45.g.cs +++ /dev/null @@ -1,710 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class GenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostGenerateImageV45SecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostGenerateImageV45SecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostGenerateImageV45SecurityRequirement0, - }; - partial void PreparePostGenerateImageV45Arguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.GenerateImageRequestV4 request); - partial void PreparePostGenerateImageV45Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.GenerateImageRequestV4 request); - partial void ProcessPostGenerateImageV45Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostGenerateImageV45ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Generate with Ideogram 4.5
- /// Generates images synchronously using the Ideogram 4.5 multimodal model.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageV45Async( - - global::Ideogram.GenerateImageRequestV4 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostGenerateImageV45AsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Generate with Ideogram 4.5
- /// Generates images synchronously using the Ideogram 4.5 multimodal model.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostGenerateImageV45AsResponseAsync( - - global::Ideogram.GenerateImageRequestV4 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostGenerateImageV45Arguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostGenerateImageV45SecurityRequirements, - operationName: "PostGenerateImageV45Async"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/ideogram-v45/generate", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (request.TextPrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.TextPrompt ?? string.Empty), - name: "\"text_prompt\""); - - } - if (request.JsonPrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.JsonPrompt.ToJson(JsonSerializerContext)), - name: "\"json_prompt\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.MagicPromptSystemPromptConfigId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.MagicPromptSystemPromptConfigId ?? string.Empty), - name: "\"magic_prompt_system_prompt_config_id\""); - - } - if (request.CustomModelUri != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.CustomModelUri ?? string.Empty), - name: "\"custom_model_uri\""); - - } - if (request.Resolution != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"resolution\""); - - } - if (request.RenderingSpeed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"rendering_speed\""); - - } - if (request.EnableCopyrightDetection != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"enable_copyright_detection\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostGenerateImageV45Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV45", - methodName: "PostGenerateImageV45Async", - pathTemplate: "\"/v1/ideogram-v45/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV45", - methodName: "PostGenerateImageV45Async", - pathTemplate: "\"/v1/ideogram-v45/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV45", - methodName: "PostGenerateImageV45Async", - pathTemplate: "\"/v1/ideogram-v45/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostGenerateImageV45Response( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV45", - methodName: "PostGenerateImageV45Async", - pathTemplate: "\"/v1/ideogram-v45/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV45", - methodName: "PostGenerateImageV45Async", - pathTemplate: "\"/v1/ideogram-v45/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt failed the safety check. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostGenerateImageV45ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.ImageGenerationResponseV4.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.ImageGenerationResponseV4.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Generate with Ideogram 4.5
- /// Generates images synchronously using the Ideogram 4.5 multimodal model.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// A natural-language prompt for image generation. When supplied,
- /// magic-prompt is enabled automatically. Mutually exclusive with
- /// `json_prompt`. - /// - /// - /// A structured prompt that conforms to the Ideogram 4.0 JSON
- /// contract. When supplied, magic-prompt is disabled and the
- /// structured prompt is consumed by the diffusion model directly.
- /// Mutually exclusive with `text_prompt`. - /// - /// - /// Random seed for reproducibility. - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use
- /// for this request. Honored when `text_prompt` is supplied. Ignored
- /// when `json_prompt` is supplied. - /// - /// - /// A custom model URI in the format model/<model_name>/version/<version_name>.
- /// When provided, the model version and style will be resolved from this URI.
- /// Example: model/my-custom-model/version/0 - /// - /// - /// The 1K and 2K resolutions supported for Ideogram 4.0 image generation.
- /// Example: 2048x2048 - /// - /// - /// The rendering speed to use. For Ideogram V4, `rendering_speed=FLASH`
- /// is coming soon; requests with `rendering_speed=FLASH` currently
- /// return a 400. - /// - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). The effective gate is the OR of this field and the organization's
- /// `copyright_detection_enabled` setting on `/api`. See GenerateImageRequestV3 for details. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageV45Async( - string? textPrompt = default, - global::Ideogram.V4JsonPrompt? jsonPrompt = default, - int? seed = default, - string? magicPromptSystemPromptConfigId = default, - string? customModelUri = default, - global::Ideogram.ResolutionV4? resolution = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - bool? enableCopyrightDetection = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.GenerateImageRequestV4 - { - TextPrompt = textPrompt, - JsonPrompt = jsonPrompt, - Seed = seed, - MagicPromptSystemPromptConfigId = magicPromptSystemPromptConfigId, - CustomModelUri = customModelUri, - Resolution = resolution, - RenderingSpeed = renderingSpeed, - EnableCopyrightDetection = enableCopyrightDetection, - }; - - return await PostGenerateImageV45Async( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageV45Async.g.cs b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageV45Async.g.cs deleted file mode 100644 index 9982d07c..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageV45Async.g.cs +++ /dev/null @@ -1,764 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class GenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostGenerateImageV45AsyncSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostGenerateImageV45AsyncSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostGenerateImageV45AsyncSecurityRequirement0, - }; - partial void PreparePostGenerateImageV45AsyncArguments( - global::System.Net.Http.HttpClient httpClient, - ref string webhookUrl, - global::Ideogram.GenerateImageRequestV4 request); - partial void PreparePostGenerateImageV45AsyncRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string webhookUrl, - global::Ideogram.GenerateImageRequestV4 request); - partial void ProcessPostGenerateImageV45AsyncResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostGenerateImageV45AsyncResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Generate with Ideogram 4.5 asynchronously via webhook
- /// Accepts an Ideogram 4.5 generation request for asynchronous processing and
- /// returns immediately with a generation_id. The generated images are POSTed to
- /// the supplied `webhook_url` once ready, in a payload that mirrors the
- /// synchronous response with an added generation_id for correlation.
- /// See [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageV45AsyncAsync( - string webhookUrl, - - global::Ideogram.GenerateImageRequestV4 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostGenerateImageV45AsyncAsResponseAsync( - webhookUrl: webhookUrl, - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Generate with Ideogram 4.5 asynchronously via webhook
- /// Accepts an Ideogram 4.5 generation request for asynchronous processing and
- /// returns immediately with a generation_id. The generated images are POSTed to
- /// the supplied `webhook_url` once ready, in a payload that mirrors the
- /// synchronous response with an added generation_id for correlation.
- /// See [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostGenerateImageV45AsyncAsResponseAsync( - string webhookUrl, - - global::Ideogram.GenerateImageRequestV4 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostGenerateImageV45AsyncArguments( - httpClient: HttpClient, - webhookUrl: ref webhookUrl, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostGenerateImageV45AsyncSecurityRequirements, - operationName: "PostGenerateImageV45AsyncAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/ideogram-v45/async/generate", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("webhook_url", webhookUrl) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (request.TextPrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.TextPrompt ?? string.Empty), - name: "\"text_prompt\""); - - } - if (request.JsonPrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.JsonPrompt.ToJson(JsonSerializerContext)), - name: "\"json_prompt\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.MagicPromptSystemPromptConfigId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.MagicPromptSystemPromptConfigId ?? string.Empty), - name: "\"magic_prompt_system_prompt_config_id\""); - - } - if (request.CustomModelUri != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.CustomModelUri ?? string.Empty), - name: "\"custom_model_uri\""); - - } - if (request.Resolution != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"resolution\""); - - } - if (request.RenderingSpeed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"rendering_speed\""); - - } - if (request.EnableCopyrightDetection != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"enable_copyright_detection\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostGenerateImageV45AsyncRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - webhookUrl: webhookUrl, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV45Async", - methodName: "PostGenerateImageV45AsyncAsync", - pathTemplate: "\"/v1/ideogram-v45/async/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV45Async", - methodName: "PostGenerateImageV45AsyncAsync", - pathTemplate: "\"/v1/ideogram-v45/async/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV45Async", - methodName: "PostGenerateImageV45AsyncAsync", - pathTemplate: "\"/v1/ideogram-v45/async/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostGenerateImageV45AsyncResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV45Async", - methodName: "PostGenerateImageV45AsyncAsync", - pathTemplate: "\"/v1/ideogram-v45/async/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV45Async", - methodName: "PostGenerateImageV45AsyncAsync", - pathTemplate: "\"/v1/ideogram-v45/async/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt failed the safety check. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostGenerateImageV45AsyncResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.AsyncImageGenerationResponseV4.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.AsyncImageGenerationResponseV4.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Generate with Ideogram 4.5 asynchronously via webhook
- /// Accepts an Ideogram 4.5 generation request for asynchronous processing and
- /// returns immediately with a generation_id. The generated images are POSTed to
- /// the supplied `webhook_url` once ready, in a payload that mirrors the
- /// synchronous response with an added generation_id for correlation.
- /// See [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// A natural-language prompt for image generation. When supplied,
- /// magic-prompt is enabled automatically. Mutually exclusive with
- /// `json_prompt`. - /// - /// - /// A structured prompt that conforms to the Ideogram 4.0 JSON
- /// contract. When supplied, magic-prompt is disabled and the
- /// structured prompt is consumed by the diffusion model directly.
- /// Mutually exclusive with `text_prompt`. - /// - /// - /// Random seed for reproducibility. - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use
- /// for this request. Honored when `text_prompt` is supplied. Ignored
- /// when `json_prompt` is supplied. - /// - /// - /// A custom model URI in the format model/<model_name>/version/<version_name>.
- /// When provided, the model version and style will be resolved from this URI.
- /// Example: model/my-custom-model/version/0 - /// - /// - /// The 1K and 2K resolutions supported for Ideogram 4.0 image generation.
- /// Example: 2048x2048 - /// - /// - /// The rendering speed to use. For Ideogram V4, `rendering_speed=FLASH`
- /// is coming soon; requests with `rendering_speed=FLASH` currently
- /// return a 400. - /// - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). The effective gate is the OR of this field and the organization's
- /// `copyright_detection_enabled` setting on `/api`. See GenerateImageRequestV3 for details. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageV45AsyncAsync( - string webhookUrl, - string? textPrompt = default, - global::Ideogram.V4JsonPrompt? jsonPrompt = default, - int? seed = default, - string? magicPromptSystemPromptConfigId = default, - string? customModelUri = default, - global::Ideogram.ResolutionV4? resolution = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - bool? enableCopyrightDetection = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.GenerateImageRequestV4 - { - TextPrompt = textPrompt, - JsonPrompt = jsonPrompt, - Seed = seed, - MagicPromptSystemPromptConfigId = magicPromptSystemPromptConfigId, - CustomModelUri = customModelUri, - Resolution = resolution, - RenderingSpeed = renderingSpeed, - EnableCopyrightDetection = enableCopyrightDetection, - }; - - return await PostGenerateImageV45AsyncAsync( - webhookUrl: webhookUrl, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageV4Async.g.cs b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageV4Async.g.cs deleted file mode 100644 index 180cb1f3..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageV4Async.g.cs +++ /dev/null @@ -1,767 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class GenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostGenerateImageV4AsyncSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostGenerateImageV4AsyncSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostGenerateImageV4AsyncSecurityRequirement0, - }; - partial void PreparePostGenerateImageV4AsyncArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? webhookUrl, - global::Ideogram.GenerateImageRequestV4 request); - partial void PreparePostGenerateImageV4AsyncRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? webhookUrl, - global::Ideogram.GenerateImageRequestV4 request); - partial void ProcessPostGenerateImageV4AsyncResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostGenerateImageV4AsyncResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Generate with Ideogram 4.0 asynchronously
- /// Accepts an Ideogram 4.0 generation request for asynchronous processing and
- /// returns immediately with a generation_id. Poll `GET /v1/generations/{generation_id}`
- /// to retrieve the result. If a `webhook_url` is supplied, the generated images are
- /// additionally POSTed to it once ready, in a payload that mirrors the synchronous
- /// response with an added generation_id for correlation.
- /// See [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageV4AsyncAsync( - - global::Ideogram.GenerateImageRequestV4 request, - string? webhookUrl = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostGenerateImageV4AsyncAsResponseAsync( - - request: request, - webhookUrl: webhookUrl, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Generate with Ideogram 4.0 asynchronously
- /// Accepts an Ideogram 4.0 generation request for asynchronous processing and
- /// returns immediately with a generation_id. Poll `GET /v1/generations/{generation_id}`
- /// to retrieve the result. If a `webhook_url` is supplied, the generated images are
- /// additionally POSTed to it once ready, in a payload that mirrors the synchronous
- /// response with an added generation_id for correlation.
- /// See [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostGenerateImageV4AsyncAsResponseAsync( - - global::Ideogram.GenerateImageRequestV4 request, - string? webhookUrl = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostGenerateImageV4AsyncArguments( - httpClient: HttpClient, - webhookUrl: ref webhookUrl, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostGenerateImageV4AsyncSecurityRequirements, - operationName: "PostGenerateImageV4AsyncAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/ideogram-v4/async/generate", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("webhook_url", webhookUrl) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (request.TextPrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.TextPrompt ?? string.Empty), - name: "\"text_prompt\""); - - } - if (request.JsonPrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.JsonPrompt.ToJson(JsonSerializerContext)), - name: "\"json_prompt\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.MagicPromptSystemPromptConfigId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.MagicPromptSystemPromptConfigId ?? string.Empty), - name: "\"magic_prompt_system_prompt_config_id\""); - - } - if (request.CustomModelUri != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.CustomModelUri ?? string.Empty), - name: "\"custom_model_uri\""); - - } - if (request.Resolution != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"resolution\""); - - } - if (request.RenderingSpeed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"rendering_speed\""); - - } - if (request.EnableCopyrightDetection != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"enable_copyright_detection\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostGenerateImageV4AsyncRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - webhookUrl: webhookUrl, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4Async", - methodName: "PostGenerateImageV4AsyncAsync", - pathTemplate: "\"/v1/ideogram-v4/async/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4Async", - methodName: "PostGenerateImageV4AsyncAsync", - pathTemplate: "\"/v1/ideogram-v4/async/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4Async", - methodName: "PostGenerateImageV4AsyncAsync", - pathTemplate: "\"/v1/ideogram-v4/async/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostGenerateImageV4AsyncResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4Async", - methodName: "PostGenerateImageV4AsyncAsync", - pathTemplate: "\"/v1/ideogram-v4/async/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4Async", - methodName: "PostGenerateImageV4AsyncAsync", - pathTemplate: "\"/v1/ideogram-v4/async/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt failed the safety check. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostGenerateImageV4AsyncResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.AsyncImageGenerationResponseV4.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.AsyncImageGenerationResponseV4.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Generate with Ideogram 4.0 asynchronously
- /// Accepts an Ideogram 4.0 generation request for asynchronous processing and
- /// returns immediately with a generation_id. Poll `GET /v1/generations/{generation_id}`
- /// to retrieve the result. If a `webhook_url` is supplied, the generated images are
- /// additionally POSTed to it once ready, in a payload that mirrors the synchronous
- /// response with an added generation_id for correlation.
- /// See [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// A natural-language prompt for image generation. When supplied,
- /// magic-prompt is enabled automatically. Mutually exclusive with
- /// `json_prompt`. - /// - /// - /// A structured prompt that conforms to the Ideogram 4.0 JSON
- /// contract. When supplied, magic-prompt is disabled and the
- /// structured prompt is consumed by the diffusion model directly.
- /// Mutually exclusive with `text_prompt`. - /// - /// - /// Random seed for reproducibility. - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use
- /// for this request. Honored when `text_prompt` is supplied. Ignored
- /// when `json_prompt` is supplied. - /// - /// - /// A custom model URI in the format model/<model_name>/version/<version_name>.
- /// When provided, the model version and style will be resolved from this URI.
- /// Example: model/my-custom-model/version/0 - /// - /// - /// The 1K and 2K resolutions supported for Ideogram 4.0 image generation.
- /// Example: 2048x2048 - /// - /// - /// The rendering speed to use. For Ideogram V4, `rendering_speed=FLASH`
- /// is coming soon; requests with `rendering_speed=FLASH` currently
- /// return a 400. - /// - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). The effective gate is the OR of this field and the organization's
- /// `copyright_detection_enabled` setting on `/api`. See GenerateImageRequestV3 for details. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageV4AsyncAsync( - string? webhookUrl = default, - string? textPrompt = default, - global::Ideogram.V4JsonPrompt? jsonPrompt = default, - int? seed = default, - string? magicPromptSystemPromptConfigId = default, - string? customModelUri = default, - global::Ideogram.ResolutionV4? resolution = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - bool? enableCopyrightDetection = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.GenerateImageRequestV4 - { - TextPrompt = textPrompt, - JsonPrompt = jsonPrompt, - Seed = seed, - MagicPromptSystemPromptConfigId = magicPromptSystemPromptConfigId, - CustomModelUri = customModelUri, - Resolution = resolution, - RenderingSpeed = renderingSpeed, - EnableCopyrightDetection = enableCopyrightDetection, - }; - - return await PostGenerateImageV4AsyncAsync( - webhookUrl: webhookUrl, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageV4CfgDistilled.g.cs b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageV4CfgDistilled.g.cs deleted file mode 100644 index 91ee0045..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageV4CfgDistilled.g.cs +++ /dev/null @@ -1,698 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class GenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostGenerateImageV4CfgDistilledSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostGenerateImageV4CfgDistilledSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostGenerateImageV4CfgDistilledSecurityRequirement0, - }; - partial void PreparePostGenerateImageV4CfgDistilledArguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.GenerateImageRequestV4CfgDistilled request); - partial void PreparePostGenerateImageV4CfgDistilledRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.GenerateImageRequestV4CfgDistilled request); - partial void ProcessPostGenerateImageV4CfgDistilledResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostGenerateImageV4CfgDistilledResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Generate with the CFG-distilled Ideogram 4.0 model
- /// Generates images synchronously using the CFG/guidance-distilled Ideogram
- /// 4.0 model, served guidance-free.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageV4CfgDistilledAsync( - - global::Ideogram.GenerateImageRequestV4CfgDistilled request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostGenerateImageV4CfgDistilledAsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Generate with the CFG-distilled Ideogram 4.0 model
- /// Generates images synchronously using the CFG/guidance-distilled Ideogram
- /// 4.0 model, served guidance-free.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostGenerateImageV4CfgDistilledAsResponseAsync( - - global::Ideogram.GenerateImageRequestV4CfgDistilled request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostGenerateImageV4CfgDistilledArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostGenerateImageV4CfgDistilledSecurityRequirements, - operationName: "PostGenerateImageV4CfgDistilledAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/ideogram-v4-cfg-distilled/generate", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (request.TextPrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.TextPrompt ?? string.Empty), - name: "\"text_prompt\""); - - } - if (request.JsonPrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.JsonPrompt.ToJson(JsonSerializerContext)), - name: "\"json_prompt\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.MagicPromptSystemPromptConfigId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.MagicPromptSystemPromptConfigId ?? string.Empty), - name: "\"magic_prompt_system_prompt_config_id\""); - - } - if (request.Resolution != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"resolution\""); - - } - if (request.RenderingSpeed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"rendering_speed\""); - - } - if (request.EnableCopyrightDetection != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"enable_copyright_detection\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostGenerateImageV4CfgDistilledRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4CfgDistilled", - methodName: "PostGenerateImageV4CfgDistilledAsync", - pathTemplate: "\"/v1/ideogram-v4-cfg-distilled/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4CfgDistilled", - methodName: "PostGenerateImageV4CfgDistilledAsync", - pathTemplate: "\"/v1/ideogram-v4-cfg-distilled/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4CfgDistilled", - methodName: "PostGenerateImageV4CfgDistilledAsync", - pathTemplate: "\"/v1/ideogram-v4-cfg-distilled/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostGenerateImageV4CfgDistilledResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4CfgDistilled", - methodName: "PostGenerateImageV4CfgDistilledAsync", - pathTemplate: "\"/v1/ideogram-v4-cfg-distilled/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4CfgDistilled", - methodName: "PostGenerateImageV4CfgDistilledAsync", - pathTemplate: "\"/v1/ideogram-v4-cfg-distilled/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt failed the safety check. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostGenerateImageV4CfgDistilledResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.ImageGenerationResponseV4.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.ImageGenerationResponseV4.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Generate with the CFG-distilled Ideogram 4.0 model
- /// Generates images synchronously using the CFG/guidance-distilled Ideogram
- /// 4.0 model, served guidance-free.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// A natural-language prompt for image generation. When supplied,
- /// magic-prompt is enabled automatically. Mutually exclusive with
- /// `json_prompt`. - /// - /// - /// A structured prompt that conforms to the Ideogram 4.0 JSON
- /// contract. When supplied, magic-prompt is disabled and the
- /// structured prompt is consumed by the diffusion model directly.
- /// Mutually exclusive with `text_prompt`. - /// - /// - /// Random seed for reproducibility. - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use
- /// for this request. Honored when `text_prompt` is supplied. Ignored
- /// when `json_prompt` is supplied. - /// - /// - /// The 1K and 2K resolutions supported for Ideogram 4.0 image generation.
- /// Example: 2048x2048 - /// - /// - /// The rendering speed to use. For Ideogram V4, `rendering_speed=FLASH`
- /// is coming soon; requests with `rendering_speed=FLASH` currently
- /// return a 400. - /// - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). The effective gate is the OR of this field and the organization's
- /// `copyright_detection_enabled` setting on `/api`. See GenerateImageRequestV3 for details. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageV4CfgDistilledAsync( - string? textPrompt = default, - global::Ideogram.V4JsonPrompt? jsonPrompt = default, - int? seed = default, - string? magicPromptSystemPromptConfigId = default, - global::Ideogram.ResolutionV4? resolution = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - bool? enableCopyrightDetection = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.GenerateImageRequestV4CfgDistilled - { - TextPrompt = textPrompt, - JsonPrompt = jsonPrompt, - Seed = seed, - MagicPromptSystemPromptConfigId = magicPromptSystemPromptConfigId, - Resolution = resolution, - RenderingSpeed = renderingSpeed, - EnableCopyrightDetection = enableCopyrightDetection, - }; - - return await PostGenerateImageV4CfgDistilledAsync( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageV4CfgDistilledAsync.g.cs b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageV4CfgDistilledAsync.g.cs deleted file mode 100644 index 87046842..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageV4CfgDistilledAsync.g.cs +++ /dev/null @@ -1,752 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class GenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostGenerateImageV4CfgDistilledAsyncSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostGenerateImageV4CfgDistilledAsyncSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostGenerateImageV4CfgDistilledAsyncSecurityRequirement0, - }; - partial void PreparePostGenerateImageV4CfgDistilledAsyncArguments( - global::System.Net.Http.HttpClient httpClient, - ref string webhookUrl, - global::Ideogram.GenerateImageRequestV4CfgDistilled request); - partial void PreparePostGenerateImageV4CfgDistilledAsyncRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string webhookUrl, - global::Ideogram.GenerateImageRequestV4CfgDistilled request); - partial void ProcessPostGenerateImageV4CfgDistilledAsyncResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostGenerateImageV4CfgDistilledAsyncResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Generate with the CFG-distilled Ideogram 4.0 model asynchronously via webhook
- /// Accepts a CFG-distilled Ideogram 4.0 generation request for asynchronous
- /// processing and returns immediately with a generation_id. The generated
- /// images are POSTed to the supplied `webhook_url` once ready, in a payload
- /// that mirrors the synchronous response with an added generation_id for
- /// correlation.
- /// See [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageV4CfgDistilledAsyncAsync( - string webhookUrl, - - global::Ideogram.GenerateImageRequestV4CfgDistilled request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostGenerateImageV4CfgDistilledAsyncAsResponseAsync( - webhookUrl: webhookUrl, - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Generate with the CFG-distilled Ideogram 4.0 model asynchronously via webhook
- /// Accepts a CFG-distilled Ideogram 4.0 generation request for asynchronous
- /// processing and returns immediately with a generation_id. The generated
- /// images are POSTed to the supplied `webhook_url` once ready, in a payload
- /// that mirrors the synchronous response with an added generation_id for
- /// correlation.
- /// See [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostGenerateImageV4CfgDistilledAsyncAsResponseAsync( - string webhookUrl, - - global::Ideogram.GenerateImageRequestV4CfgDistilled request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostGenerateImageV4CfgDistilledAsyncArguments( - httpClient: HttpClient, - webhookUrl: ref webhookUrl, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostGenerateImageV4CfgDistilledAsyncSecurityRequirements, - operationName: "PostGenerateImageV4CfgDistilledAsyncAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/ideogram-v4-cfg-distilled/async/generate", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("webhook_url", webhookUrl) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (request.TextPrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.TextPrompt ?? string.Empty), - name: "\"text_prompt\""); - - } - if (request.JsonPrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.JsonPrompt.ToJson(JsonSerializerContext)), - name: "\"json_prompt\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.MagicPromptSystemPromptConfigId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.MagicPromptSystemPromptConfigId ?? string.Empty), - name: "\"magic_prompt_system_prompt_config_id\""); - - } - if (request.Resolution != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"resolution\""); - - } - if (request.RenderingSpeed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"rendering_speed\""); - - } - if (request.EnableCopyrightDetection != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"enable_copyright_detection\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostGenerateImageV4CfgDistilledAsyncRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - webhookUrl: webhookUrl, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4CfgDistilledAsync", - methodName: "PostGenerateImageV4CfgDistilledAsyncAsync", - pathTemplate: "\"/v1/ideogram-v4-cfg-distilled/async/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4CfgDistilledAsync", - methodName: "PostGenerateImageV4CfgDistilledAsyncAsync", - pathTemplate: "\"/v1/ideogram-v4-cfg-distilled/async/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4CfgDistilledAsync", - methodName: "PostGenerateImageV4CfgDistilledAsyncAsync", - pathTemplate: "\"/v1/ideogram-v4-cfg-distilled/async/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostGenerateImageV4CfgDistilledAsyncResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4CfgDistilledAsync", - methodName: "PostGenerateImageV4CfgDistilledAsyncAsync", - pathTemplate: "\"/v1/ideogram-v4-cfg-distilled/async/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4CfgDistilledAsync", - methodName: "PostGenerateImageV4CfgDistilledAsyncAsync", - pathTemplate: "\"/v1/ideogram-v4-cfg-distilled/async/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt failed the safety check. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostGenerateImageV4CfgDistilledAsyncResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.AsyncImageGenerationResponseV4.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.AsyncImageGenerationResponseV4.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Generate with the CFG-distilled Ideogram 4.0 model asynchronously via webhook
- /// Accepts a CFG-distilled Ideogram 4.0 generation request for asynchronous
- /// processing and returns immediately with a generation_id. The generated
- /// images are POSTed to the supplied `webhook_url` once ready, in a payload
- /// that mirrors the synchronous response with an added generation_id for
- /// correlation.
- /// See [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// A natural-language prompt for image generation. When supplied,
- /// magic-prompt is enabled automatically. Mutually exclusive with
- /// `json_prompt`. - /// - /// - /// A structured prompt that conforms to the Ideogram 4.0 JSON
- /// contract. When supplied, magic-prompt is disabled and the
- /// structured prompt is consumed by the diffusion model directly.
- /// Mutually exclusive with `text_prompt`. - /// - /// - /// Random seed for reproducibility. - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use
- /// for this request. Honored when `text_prompt` is supplied. Ignored
- /// when `json_prompt` is supplied. - /// - /// - /// The 1K and 2K resolutions supported for Ideogram 4.0 image generation.
- /// Example: 2048x2048 - /// - /// - /// The rendering speed to use. For Ideogram V4, `rendering_speed=FLASH`
- /// is coming soon; requests with `rendering_speed=FLASH` currently
- /// return a 400. - /// - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). The effective gate is the OR of this field and the organization's
- /// `copyright_detection_enabled` setting on `/api`. See GenerateImageRequestV3 for details. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageV4CfgDistilledAsyncAsync( - string webhookUrl, - string? textPrompt = default, - global::Ideogram.V4JsonPrompt? jsonPrompt = default, - int? seed = default, - string? magicPromptSystemPromptConfigId = default, - global::Ideogram.ResolutionV4? resolution = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - bool? enableCopyrightDetection = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.GenerateImageRequestV4CfgDistilled - { - TextPrompt = textPrompt, - JsonPrompt = jsonPrompt, - Seed = seed, - MagicPromptSystemPromptConfigId = magicPromptSystemPromptConfigId, - Resolution = resolution, - RenderingSpeed = renderingSpeed, - EnableCopyrightDetection = enableCopyrightDetection, - }; - - return await PostGenerateImageV4CfgDistilledAsyncAsync( - webhookUrl: webhookUrl, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageV4Fp8.g.cs b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageV4Fp8.g.cs deleted file mode 100644 index bd9421f7..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageV4Fp8.g.cs +++ /dev/null @@ -1,701 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class GenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostGenerateImageV4Fp8SecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostGenerateImageV4Fp8SecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostGenerateImageV4Fp8SecurityRequirement0, - }; - partial void PreparePostGenerateImageV4Fp8Arguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.GenerateImageRequestV4Fp8 request); - partial void PreparePostGenerateImageV4Fp8Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.GenerateImageRequestV4Fp8 request); - partial void ProcessPostGenerateImageV4Fp8Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostGenerateImageV4Fp8ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Generate with the fp8-quantized Ideogram 4.0 model
- /// Generates images synchronously using the fp8-quantized Ideogram 4.0 model.
- /// A LoRA checkpoint can be layered on the base via the
- /// `X-Ideogram-Positive-Lora-Ckpt-Path` header.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageV4Fp8Async( - - global::Ideogram.GenerateImageRequestV4Fp8 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostGenerateImageV4Fp8AsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Generate with the fp8-quantized Ideogram 4.0 model
- /// Generates images synchronously using the fp8-quantized Ideogram 4.0 model.
- /// A LoRA checkpoint can be layered on the base via the
- /// `X-Ideogram-Positive-Lora-Ckpt-Path` header.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostGenerateImageV4Fp8AsResponseAsync( - - global::Ideogram.GenerateImageRequestV4Fp8 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostGenerateImageV4Fp8Arguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostGenerateImageV4Fp8SecurityRequirements, - operationName: "PostGenerateImageV4Fp8Async"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/ideogram-v4-fp8/generate", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (request.TextPrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.TextPrompt ?? string.Empty), - name: "\"text_prompt\""); - - } - if (request.JsonPrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.JsonPrompt.ToJson(JsonSerializerContext)), - name: "\"json_prompt\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.MagicPromptSystemPromptConfigId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.MagicPromptSystemPromptConfigId ?? string.Empty), - name: "\"magic_prompt_system_prompt_config_id\""); - - } - if (request.Resolution != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"resolution\""); - - } - if (request.RenderingSpeed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"rendering_speed\""); - - } - if (request.EnableCopyrightDetection != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"enable_copyright_detection\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostGenerateImageV4Fp8Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4Fp8", - methodName: "PostGenerateImageV4Fp8Async", - pathTemplate: "\"/v1/ideogram-v4-fp8/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4Fp8", - methodName: "PostGenerateImageV4Fp8Async", - pathTemplate: "\"/v1/ideogram-v4-fp8/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4Fp8", - methodName: "PostGenerateImageV4Fp8Async", - pathTemplate: "\"/v1/ideogram-v4-fp8/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostGenerateImageV4Fp8Response( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4Fp8", - methodName: "PostGenerateImageV4Fp8Async", - pathTemplate: "\"/v1/ideogram-v4-fp8/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4Fp8", - methodName: "PostGenerateImageV4Fp8Async", - pathTemplate: "\"/v1/ideogram-v4-fp8/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt failed the safety check. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostGenerateImageV4Fp8ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.ImageGenerationResponseV4.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.ImageGenerationResponseV4.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Generate with the fp8-quantized Ideogram 4.0 model
- /// Generates images synchronously using the fp8-quantized Ideogram 4.0 model.
- /// A LoRA checkpoint can be layered on the base via the
- /// `X-Ideogram-Positive-Lora-Ckpt-Path` header.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// A natural-language prompt for image generation. When supplied,
- /// magic-prompt is enabled automatically. Mutually exclusive with
- /// `json_prompt`. - /// - /// - /// A structured prompt that conforms to the Ideogram 4.0 JSON
- /// contract. When supplied, magic-prompt is disabled and the
- /// structured prompt is consumed by the diffusion model directly.
- /// Mutually exclusive with `text_prompt`. - /// - /// - /// Random seed for reproducibility. - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use
- /// for this request. Honored when `text_prompt` is supplied. Ignored
- /// when `json_prompt` is supplied. - /// - /// - /// The 1K and 2K resolutions supported for Ideogram 4.0 image generation.
- /// Example: 2048x2048 - /// - /// - /// The rendering speed to use. For Ideogram V4, `rendering_speed=FLASH`
- /// is coming soon; requests with `rendering_speed=FLASH` currently
- /// return a 400. - /// - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). The effective gate is the OR of this field and the organization's
- /// `copyright_detection_enabled` setting on `/api`. See GenerateImageRequestV3 for details. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageV4Fp8Async( - string? textPrompt = default, - global::Ideogram.V4JsonPrompt? jsonPrompt = default, - int? seed = default, - string? magicPromptSystemPromptConfigId = default, - global::Ideogram.ResolutionV4? resolution = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - bool? enableCopyrightDetection = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.GenerateImageRequestV4Fp8 - { - TextPrompt = textPrompt, - JsonPrompt = jsonPrompt, - Seed = seed, - MagicPromptSystemPromptConfigId = magicPromptSystemPromptConfigId, - Resolution = resolution, - RenderingSpeed = renderingSpeed, - EnableCopyrightDetection = enableCopyrightDetection, - }; - - return await PostGenerateImageV4Fp8Async( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageV4Im2Im.g.cs b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageV4Im2Im.g.cs deleted file mode 100644 index 39c926be..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageV4Im2Im.g.cs +++ /dev/null @@ -1,2171 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class GenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostGenerateImageV4Im2ImSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostGenerateImageV4Im2ImSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostGenerateImageV4Im2ImSecurityRequirement0, - }; - partial void PreparePostGenerateImageV4Im2ImArguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.GenerateImageRequestV4Im2Im request); - partial void PreparePostGenerateImageV4Im2ImRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.GenerateImageRequestV4Im2Im request); - partial void ProcessPostGenerateImageV4Im2ImResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostGenerateImageV4Im2ImResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Image-to-image with Ideogram 4.0
- /// Generates images synchronously using the Ideogram 4.0 model with an initial image as input.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageV4Im2ImAsync( - - global::Ideogram.GenerateImageRequestV4Im2Im request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostGenerateImageV4Im2ImAsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Image-to-image with Ideogram 4.0
- /// Generates images synchronously using the Ideogram 4.0 model with an initial image as input.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostGenerateImageV4Im2ImAsResponseAsync( - - global::Ideogram.GenerateImageRequestV4Im2Im request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostGenerateImageV4Im2ImArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostGenerateImageV4Im2ImSecurityRequirements, - operationName: "PostGenerateImageV4Im2ImAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/ideogram-v4/image-to-image", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - if (request.AdditionalImages != default) - { - - for (var __iAdditionalImages = 0; __iAdditionalImages < request.AdditionalImages.Count; __iAdditionalImages++) - { - var __contentAdditionalImages = new global::System.Net.Http.ByteArrayContent(request.AdditionalImages[__iAdditionalImages]); - __contentAdditionalImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); - __httpRequestContent.Add( - content: __contentAdditionalImages, - name: "\"additional_images\"", - fileName: $"\"file{__iAdditionalImages}.bin\""); - if (__contentAdditionalImages.Headers.ContentDisposition != null) - { - __contentAdditionalImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - if (request.Prompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.MagicPromptOption != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.MagicPromptOption).HasValue ? (request.MagicPromptOption).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"magic_prompt_option\""); - - } - if (request.MagicPromptSystemPromptConfigId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.MagicPromptSystemPromptConfigId ?? string.Empty), - name: "\"magic_prompt_system_prompt_config_id\""); - - } - if (request.Resolution != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"resolution\""); - - } - if (request.RenderingSpeed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"rendering_speed\""); - - } - if (request.EnableCopyrightDetection != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"enable_copyright_detection\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostGenerateImageV4Im2ImRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4Im2Im", - methodName: "PostGenerateImageV4Im2ImAsync", - pathTemplate: "\"/v1/ideogram-v4/image-to-image\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4Im2Im", - methodName: "PostGenerateImageV4Im2ImAsync", - pathTemplate: "\"/v1/ideogram-v4/image-to-image\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4Im2Im", - methodName: "PostGenerateImageV4Im2ImAsync", - pathTemplate: "\"/v1/ideogram-v4/image-to-image\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostGenerateImageV4Im2ImResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4Im2Im", - methodName: "PostGenerateImageV4Im2ImAsync", - pathTemplate: "\"/v1/ideogram-v4/image-to-image\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4Im2Im", - methodName: "PostGenerateImageV4Im2ImAsync", - pathTemplate: "\"/v1/ideogram-v4/image-to-image\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt failed the safety check. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostGenerateImageV4Im2ImResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.ImageGenerationResponseV4ImageToImage.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.ImageGenerationResponseV4ImageToImage.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Image-to-image with Ideogram 4.0
- /// Generates images synchronously using the Ideogram 4.0 model with an initial image as input.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The initial image binary (max 25MB); only JPEG, WebP and PNG formats are supported. - /// - /// - /// The initial image binary (max 25MB); only JPEG, WebP and PNG formats are supported. - /// - /// - /// Optional. Up to 4 additional reference images used together with `image` to condition
- /// the generation, for a maximum of 5 reference images total. Each image may be up to 25MB;
- /// only JPEG, WebP and PNG formats are supported. - /// - /// - /// An optional text prompt to guide the generation. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// Output resolutions for Ideogram 4.0 image-to-image. Superset of ResolutionV4 (the 1K/2K t2im set) plus the small 512-tier (512x512, 768x384, 384x768).
- /// Example: 1024x1024 - /// - /// - /// The rendering speed to use. For Ideogram V4, `rendering_speed=FLASH`
- /// is coming soon; requests with `rendering_speed=FLASH` currently
- /// return a 400. - /// - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). See GenerateImageRequestV3 for details. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageV4Im2ImAsync( - byte[] image, - string imagename, - global::System.Collections.Generic.IList? additionalImages = default, - string? prompt = default, - int? seed = default, - global::Ideogram.MagicPromptOption? magicPromptOption = default, - string? magicPromptSystemPromptConfigId = default, - global::Ideogram.ResolutionV4ImageToImage? resolution = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - bool? enableCopyrightDetection = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.GenerateImageRequestV4Im2Im - { - Image = image, - Imagename = imagename, - AdditionalImages = additionalImages, - Prompt = prompt, - Seed = seed, - MagicPromptOption = magicPromptOption, - MagicPromptSystemPromptConfigId = magicPromptSystemPromptConfigId, - Resolution = resolution, - RenderingSpeed = renderingSpeed, - EnableCopyrightDetection = enableCopyrightDetection, - }; - - return await PostGenerateImageV4Im2ImAsync( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - - /// - /// Image-to-image with Ideogram 4.0
- /// Generates images synchronously using the Ideogram 4.0 model with an initial image as input.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The initial image binary (max 25MB); only JPEG, WebP and PNG formats are supported. - /// - /// - /// The initial image binary (max 25MB); only JPEG, WebP and PNG formats are supported. - /// - /// - /// Optional. Up to 4 additional reference images used together with `image` to condition
- /// the generation, for a maximum of 5 reference images total. Each image may be up to 25MB;
- /// only JPEG, WebP and PNG formats are supported. - /// - /// - /// Optional file names to use for the multipart 'additional_images' file parts. - /// - /// - /// An optional text prompt to guide the generation. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// Output resolutions for Ideogram 4.0 image-to-image. Superset of ResolutionV4 (the 1K/2K t2im set) plus the small 512-tier (512x512, 768x384, 384x768).
- /// Example: 1024x1024 - /// - /// - /// The rendering speed to use. For Ideogram V4, `rendering_speed=FLASH`
- /// is coming soon; requests with `rendering_speed=FLASH` currently
- /// return a 400. - /// - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). See GenerateImageRequestV3 for details. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageV4Im2ImAsync( - global::System.IO.Stream image, - string imagename, - global::System.Collections.Generic.IReadOnlyList? additionalImages = default, - global::System.Collections.Generic.IReadOnlyList? additionalImagesFileNames = default, - string? prompt = default, - int? seed = default, - global::Ideogram.MagicPromptOption? magicPromptOption = default, - string? magicPromptSystemPromptConfigId = default, - global::Ideogram.ResolutionV4ImageToImage? resolution = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - bool? enableCopyrightDetection = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - - image = image ?? throw new global::System.ArgumentNullException(nameof(image)); - var request = new global::Ideogram.GenerateImageRequestV4Im2Im - { - Image = global::System.Array.Empty(), - Imagename = imagename, - AdditionalImages = new global::System.Collections.Generic.List(), - Prompt = prompt, - Seed = seed, - MagicPromptOption = magicPromptOption, - MagicPromptSystemPromptConfigId = magicPromptSystemPromptConfigId, - Resolution = resolution, - RenderingSpeed = renderingSpeed, - EnableCopyrightDetection = enableCopyrightDetection, - }; - PrepareArguments( - client: HttpClient); - PreparePostGenerateImageV4Im2ImArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostGenerateImageV4Im2ImSecurityRequirements, - operationName: "PostGenerateImageV4Im2ImAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/ideogram-v4/image-to-image", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - var __contentImage = new global::System.Net.Http.StreamContent(image); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - if (additionalImages != default) - { - - for (var __iAdditionalImages = 0; __iAdditionalImages < additionalImages.Count; __iAdditionalImages++) - { - var __fileNameAdditionalImages = additionalImagesFileNames != null && - __iAdditionalImages < additionalImagesFileNames.Count && - additionalImagesFileNames[__iAdditionalImages] != null - ? additionalImagesFileNames[__iAdditionalImages] - : $"file{__iAdditionalImages}.bin"; - var __contentAdditionalImages = new global::System.Net.Http.StreamContent(additionalImages[__iAdditionalImages]); - __contentAdditionalImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - __fileNameAdditionalImages is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(__fileNameAdditionalImages) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentAdditionalImages, - name: "\"additional_images\"", - fileName: $"\"{__fileNameAdditionalImages}\""); - if (__contentAdditionalImages.Headers.ContentDisposition != null) - { - __contentAdditionalImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - if (request.Prompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.MagicPromptOption != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.MagicPromptOption).HasValue ? (request.MagicPromptOption).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"magic_prompt_option\""); - - } - if (request.MagicPromptSystemPromptConfigId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.MagicPromptSystemPromptConfigId ?? string.Empty), - name: "\"magic_prompt_system_prompt_config_id\""); - - } - if (request.Resolution != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"resolution\""); - - } - if (request.RenderingSpeed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"rendering_speed\""); - - } - if (request.EnableCopyrightDetection != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"enable_copyright_detection\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostGenerateImageV4Im2ImRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4Im2Im", - methodName: "PostGenerateImageV4Im2ImAsync", - pathTemplate: "\"/v1/ideogram-v4/image-to-image\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4Im2Im", - methodName: "PostGenerateImageV4Im2ImAsync", - pathTemplate: "\"/v1/ideogram-v4/image-to-image\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4Im2Im", - methodName: "PostGenerateImageV4Im2ImAsync", - pathTemplate: "\"/v1/ideogram-v4/image-to-image\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostGenerateImageV4Im2ImResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4Im2Im", - methodName: "PostGenerateImageV4Im2ImAsync", - pathTemplate: "\"/v1/ideogram-v4/image-to-image\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4Im2Im", - methodName: "PostGenerateImageV4Im2ImAsync", - pathTemplate: "\"/v1/ideogram-v4/image-to-image\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt failed the safety check. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostGenerateImageV4Im2ImResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::Ideogram.ImageGenerationResponseV4ImageToImage.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - return - await global::Ideogram.ImageGenerationResponseV4ImageToImage.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Image-to-image with Ideogram 4.0
- /// Generates images synchronously using the Ideogram 4.0 model with an initial image as input.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The initial image binary (max 25MB); only JPEG, WebP and PNG formats are supported. - /// - /// - /// The initial image binary (max 25MB); only JPEG, WebP and PNG formats are supported. - /// - /// - /// Optional. Up to 4 additional reference images used together with `image` to condition
- /// the generation, for a maximum of 5 reference images total. Each image may be up to 25MB;
- /// only JPEG, WebP and PNG formats are supported. - /// - /// - /// Optional file names to use for the multipart 'additional_images' file parts. - /// - /// - /// An optional text prompt to guide the generation. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// Output resolutions for Ideogram 4.0 image-to-image. Superset of ResolutionV4 (the 1K/2K t2im set) plus the small 512-tier (512x512, 768x384, 384x768).
- /// Example: 1024x1024 - /// - /// - /// The rendering speed to use. For Ideogram V4, `rendering_speed=FLASH`
- /// is coming soon; requests with `rendering_speed=FLASH` currently
- /// return a 400. - /// - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). See GenerateImageRequestV3 for details. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostGenerateImageV4Im2ImAsResponseAsync( - global::System.IO.Stream image, - string imagename, - global::System.Collections.Generic.IReadOnlyList? additionalImages = default, - global::System.Collections.Generic.IReadOnlyList? additionalImagesFileNames = default, - string? prompt = default, - int? seed = default, - global::Ideogram.MagicPromptOption? magicPromptOption = default, - string? magicPromptSystemPromptConfigId = default, - global::Ideogram.ResolutionV4ImageToImage? resolution = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - bool? enableCopyrightDetection = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - - image = image ?? throw new global::System.ArgumentNullException(nameof(image)); - var request = new global::Ideogram.GenerateImageRequestV4Im2Im - { - Image = global::System.Array.Empty(), - Imagename = imagename, - AdditionalImages = new global::System.Collections.Generic.List(), - Prompt = prompt, - Seed = seed, - MagicPromptOption = magicPromptOption, - MagicPromptSystemPromptConfigId = magicPromptSystemPromptConfigId, - Resolution = resolution, - RenderingSpeed = renderingSpeed, - EnableCopyrightDetection = enableCopyrightDetection, - }; - PrepareArguments( - client: HttpClient); - PreparePostGenerateImageV4Im2ImArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostGenerateImageV4Im2ImSecurityRequirements, - operationName: "PostGenerateImageV4Im2ImAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/ideogram-v4/image-to-image", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - var __contentImage = new global::System.Net.Http.StreamContent(image); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - if (additionalImages != default) - { - - for (var __iAdditionalImages = 0; __iAdditionalImages < additionalImages.Count; __iAdditionalImages++) - { - var __fileNameAdditionalImages = additionalImagesFileNames != null && - __iAdditionalImages < additionalImagesFileNames.Count && - additionalImagesFileNames[__iAdditionalImages] != null - ? additionalImagesFileNames[__iAdditionalImages] - : $"file{__iAdditionalImages}.bin"; - var __contentAdditionalImages = new global::System.Net.Http.StreamContent(additionalImages[__iAdditionalImages]); - __contentAdditionalImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - __fileNameAdditionalImages is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(__fileNameAdditionalImages) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentAdditionalImages, - name: "\"additional_images\"", - fileName: $"\"{__fileNameAdditionalImages}\""); - if (__contentAdditionalImages.Headers.ContentDisposition != null) - { - __contentAdditionalImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - if (request.Prompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.MagicPromptOption != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.MagicPromptOption).HasValue ? (request.MagicPromptOption).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"magic_prompt_option\""); - - } - if (request.MagicPromptSystemPromptConfigId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.MagicPromptSystemPromptConfigId ?? string.Empty), - name: "\"magic_prompt_system_prompt_config_id\""); - - } - if (request.Resolution != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"resolution\""); - - } - if (request.RenderingSpeed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"rendering_speed\""); - - } - if (request.EnableCopyrightDetection != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"enable_copyright_detection\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostGenerateImageV4Im2ImRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4Im2Im", - methodName: "PostGenerateImageV4Im2ImAsync", - pathTemplate: "\"/v1/ideogram-v4/image-to-image\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4Im2Im", - methodName: "PostGenerateImageV4Im2ImAsync", - pathTemplate: "\"/v1/ideogram-v4/image-to-image\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4Im2Im", - methodName: "PostGenerateImageV4Im2ImAsync", - pathTemplate: "\"/v1/ideogram-v4/image-to-image\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostGenerateImageV4Im2ImResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4Im2Im", - methodName: "PostGenerateImageV4Im2ImAsync", - pathTemplate: "\"/v1/ideogram-v4/image-to-image\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4Im2Im", - methodName: "PostGenerateImageV4Im2ImAsync", - pathTemplate: "\"/v1/ideogram-v4/image-to-image\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt failed the safety check. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostGenerateImageV4Im2ImResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.ImageGenerationResponseV4ImageToImage.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.ImageGenerationResponseV4ImageToImage.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageV4Im2ImAsync.g.cs b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageV4Im2ImAsync.g.cs deleted file mode 100644 index 6c0372c4..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageV4Im2ImAsync.g.cs +++ /dev/null @@ -1,2255 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class GenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostGenerateImageV4Im2ImAsyncSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostGenerateImageV4Im2ImAsyncSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostGenerateImageV4Im2ImAsyncSecurityRequirement0, - }; - partial void PreparePostGenerateImageV4Im2ImAsyncArguments( - global::System.Net.Http.HttpClient httpClient, - ref string webhookUrl, - global::Ideogram.GenerateImageRequestV4Im2Im request); - partial void PreparePostGenerateImageV4Im2ImAsyncRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string webhookUrl, - global::Ideogram.GenerateImageRequestV4Im2Im request); - partial void ProcessPostGenerateImageV4Im2ImAsyncResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostGenerateImageV4Im2ImAsyncResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Image-to-image with Ideogram 4.0 asynchronously via webhook
- /// Accepts an Ideogram 4.0 image-to-image request for asynchronous processing
- /// and returns immediately with a request_id. The generated images are POSTed
- /// to the supplied `webhook_url` once ready. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageV4Im2ImAsyncAsync( - string webhookUrl, - - global::Ideogram.GenerateImageRequestV4Im2Im request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostGenerateImageV4Im2ImAsyncAsResponseAsync( - webhookUrl: webhookUrl, - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Image-to-image with Ideogram 4.0 asynchronously via webhook
- /// Accepts an Ideogram 4.0 image-to-image request for asynchronous processing
- /// and returns immediately with a request_id. The generated images are POSTed
- /// to the supplied `webhook_url` once ready. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostGenerateImageV4Im2ImAsyncAsResponseAsync( - string webhookUrl, - - global::Ideogram.GenerateImageRequestV4Im2Im request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostGenerateImageV4Im2ImAsyncArguments( - httpClient: HttpClient, - webhookUrl: ref webhookUrl, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostGenerateImageV4Im2ImAsyncSecurityRequirements, - operationName: "PostGenerateImageV4Im2ImAsyncAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/ideogram-v4/async/image-to-image", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("webhook_url", webhookUrl) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - if (request.AdditionalImages != default) - { - - for (var __iAdditionalImages = 0; __iAdditionalImages < request.AdditionalImages.Count; __iAdditionalImages++) - { - var __contentAdditionalImages = new global::System.Net.Http.ByteArrayContent(request.AdditionalImages[__iAdditionalImages]); - __contentAdditionalImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); - __httpRequestContent.Add( - content: __contentAdditionalImages, - name: "\"additional_images\"", - fileName: $"\"file{__iAdditionalImages}.bin\""); - if (__contentAdditionalImages.Headers.ContentDisposition != null) - { - __contentAdditionalImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - if (request.Prompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.MagicPromptOption != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.MagicPromptOption).HasValue ? (request.MagicPromptOption).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"magic_prompt_option\""); - - } - if (request.MagicPromptSystemPromptConfigId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.MagicPromptSystemPromptConfigId ?? string.Empty), - name: "\"magic_prompt_system_prompt_config_id\""); - - } - if (request.Resolution != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"resolution\""); - - } - if (request.RenderingSpeed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"rendering_speed\""); - - } - if (request.EnableCopyrightDetection != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"enable_copyright_detection\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostGenerateImageV4Im2ImAsyncRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - webhookUrl: webhookUrl, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4Im2ImAsync", - methodName: "PostGenerateImageV4Im2ImAsyncAsync", - pathTemplate: "\"/v1/ideogram-v4/async/image-to-image\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4Im2ImAsync", - methodName: "PostGenerateImageV4Im2ImAsyncAsync", - pathTemplate: "\"/v1/ideogram-v4/async/image-to-image\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4Im2ImAsync", - methodName: "PostGenerateImageV4Im2ImAsyncAsync", - pathTemplate: "\"/v1/ideogram-v4/async/image-to-image\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostGenerateImageV4Im2ImAsyncResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4Im2ImAsync", - methodName: "PostGenerateImageV4Im2ImAsyncAsync", - pathTemplate: "\"/v1/ideogram-v4/async/image-to-image\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4Im2ImAsync", - methodName: "PostGenerateImageV4Im2ImAsyncAsync", - pathTemplate: "\"/v1/ideogram-v4/async/image-to-image\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt failed the safety check. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostGenerateImageV4Im2ImAsyncResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.AsyncImageGenerationResponseV4.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.AsyncImageGenerationResponseV4.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Image-to-image with Ideogram 4.0 asynchronously via webhook
- /// Accepts an Ideogram 4.0 image-to-image request for asynchronous processing
- /// and returns immediately with a request_id. The generated images are POSTed
- /// to the supplied `webhook_url` once ready. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// The initial image binary (max 25MB); only JPEG, WebP and PNG formats are supported. - /// - /// - /// The initial image binary (max 25MB); only JPEG, WebP and PNG formats are supported. - /// - /// - /// Optional. Up to 4 additional reference images used together with `image` to condition
- /// the generation, for a maximum of 5 reference images total. Each image may be up to 25MB;
- /// only JPEG, WebP and PNG formats are supported. - /// - /// - /// An optional text prompt to guide the generation. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// Output resolutions for Ideogram 4.0 image-to-image. Superset of ResolutionV4 (the 1K/2K t2im set) plus the small 512-tier (512x512, 768x384, 384x768).
- /// Example: 1024x1024 - /// - /// - /// The rendering speed to use. For Ideogram V4, `rendering_speed=FLASH`
- /// is coming soon; requests with `rendering_speed=FLASH` currently
- /// return a 400. - /// - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). See GenerateImageRequestV3 for details. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageV4Im2ImAsyncAsync( - string webhookUrl, - byte[] image, - string imagename, - global::System.Collections.Generic.IList? additionalImages = default, - string? prompt = default, - int? seed = default, - global::Ideogram.MagicPromptOption? magicPromptOption = default, - string? magicPromptSystemPromptConfigId = default, - global::Ideogram.ResolutionV4ImageToImage? resolution = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - bool? enableCopyrightDetection = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.GenerateImageRequestV4Im2Im - { - Image = image, - Imagename = imagename, - AdditionalImages = additionalImages, - Prompt = prompt, - Seed = seed, - MagicPromptOption = magicPromptOption, - MagicPromptSystemPromptConfigId = magicPromptSystemPromptConfigId, - Resolution = resolution, - RenderingSpeed = renderingSpeed, - EnableCopyrightDetection = enableCopyrightDetection, - }; - - return await PostGenerateImageV4Im2ImAsyncAsync( - webhookUrl: webhookUrl, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - - /// - /// Image-to-image with Ideogram 4.0 asynchronously via webhook
- /// Accepts an Ideogram 4.0 image-to-image request for asynchronous processing
- /// and returns immediately with a request_id. The generated images are POSTed
- /// to the supplied `webhook_url` once ready. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// The initial image binary (max 25MB); only JPEG, WebP and PNG formats are supported. - /// - /// - /// The initial image binary (max 25MB); only JPEG, WebP and PNG formats are supported. - /// - /// - /// Optional. Up to 4 additional reference images used together with `image` to condition
- /// the generation, for a maximum of 5 reference images total. Each image may be up to 25MB;
- /// only JPEG, WebP and PNG formats are supported. - /// - /// - /// Optional file names to use for the multipart 'additional_images' file parts. - /// - /// - /// An optional text prompt to guide the generation. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// Output resolutions for Ideogram 4.0 image-to-image. Superset of ResolutionV4 (the 1K/2K t2im set) plus the small 512-tier (512x512, 768x384, 384x768).
- /// Example: 1024x1024 - /// - /// - /// The rendering speed to use. For Ideogram V4, `rendering_speed=FLASH`
- /// is coming soon; requests with `rendering_speed=FLASH` currently
- /// return a 400. - /// - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). See GenerateImageRequestV3 for details. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageV4Im2ImAsyncAsync( - string webhookUrl, - global::System.IO.Stream image, - string imagename, - global::System.Collections.Generic.IReadOnlyList? additionalImages = default, - global::System.Collections.Generic.IReadOnlyList? additionalImagesFileNames = default, - string? prompt = default, - int? seed = default, - global::Ideogram.MagicPromptOption? magicPromptOption = default, - string? magicPromptSystemPromptConfigId = default, - global::Ideogram.ResolutionV4ImageToImage? resolution = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - bool? enableCopyrightDetection = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - - image = image ?? throw new global::System.ArgumentNullException(nameof(image)); - var request = new global::Ideogram.GenerateImageRequestV4Im2Im - { - Image = global::System.Array.Empty(), - Imagename = imagename, - AdditionalImages = new global::System.Collections.Generic.List(), - Prompt = prompt, - Seed = seed, - MagicPromptOption = magicPromptOption, - MagicPromptSystemPromptConfigId = magicPromptSystemPromptConfigId, - Resolution = resolution, - RenderingSpeed = renderingSpeed, - EnableCopyrightDetection = enableCopyrightDetection, - }; - PrepareArguments( - client: HttpClient); - PreparePostGenerateImageV4Im2ImAsyncArguments( - httpClient: HttpClient, - webhookUrl: ref webhookUrl, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostGenerateImageV4Im2ImAsyncSecurityRequirements, - operationName: "PostGenerateImageV4Im2ImAsyncAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/ideogram-v4/async/image-to-image", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("webhook_url", webhookUrl) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - var __contentImage = new global::System.Net.Http.StreamContent(image); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - if (additionalImages != default) - { - - for (var __iAdditionalImages = 0; __iAdditionalImages < additionalImages.Count; __iAdditionalImages++) - { - var __fileNameAdditionalImages = additionalImagesFileNames != null && - __iAdditionalImages < additionalImagesFileNames.Count && - additionalImagesFileNames[__iAdditionalImages] != null - ? additionalImagesFileNames[__iAdditionalImages] - : $"file{__iAdditionalImages}.bin"; - var __contentAdditionalImages = new global::System.Net.Http.StreamContent(additionalImages[__iAdditionalImages]); - __contentAdditionalImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - __fileNameAdditionalImages is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(__fileNameAdditionalImages) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentAdditionalImages, - name: "\"additional_images\"", - fileName: $"\"{__fileNameAdditionalImages}\""); - if (__contentAdditionalImages.Headers.ContentDisposition != null) - { - __contentAdditionalImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - if (request.Prompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.MagicPromptOption != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.MagicPromptOption).HasValue ? (request.MagicPromptOption).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"magic_prompt_option\""); - - } - if (request.MagicPromptSystemPromptConfigId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.MagicPromptSystemPromptConfigId ?? string.Empty), - name: "\"magic_prompt_system_prompt_config_id\""); - - } - if (request.Resolution != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"resolution\""); - - } - if (request.RenderingSpeed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"rendering_speed\""); - - } - if (request.EnableCopyrightDetection != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"enable_copyright_detection\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostGenerateImageV4Im2ImAsyncRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - webhookUrl: webhookUrl, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4Im2ImAsync", - methodName: "PostGenerateImageV4Im2ImAsyncAsync", - pathTemplate: "\"/v1/ideogram-v4/async/image-to-image\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4Im2ImAsync", - methodName: "PostGenerateImageV4Im2ImAsyncAsync", - pathTemplate: "\"/v1/ideogram-v4/async/image-to-image\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4Im2ImAsync", - methodName: "PostGenerateImageV4Im2ImAsyncAsync", - pathTemplate: "\"/v1/ideogram-v4/async/image-to-image\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostGenerateImageV4Im2ImAsyncResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4Im2ImAsync", - methodName: "PostGenerateImageV4Im2ImAsyncAsync", - pathTemplate: "\"/v1/ideogram-v4/async/image-to-image\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4Im2ImAsync", - methodName: "PostGenerateImageV4Im2ImAsyncAsync", - pathTemplate: "\"/v1/ideogram-v4/async/image-to-image\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt failed the safety check. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostGenerateImageV4Im2ImAsyncResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::Ideogram.AsyncImageGenerationResponseV4.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - return - await global::Ideogram.AsyncImageGenerationResponseV4.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Image-to-image with Ideogram 4.0 asynchronously via webhook
- /// Accepts an Ideogram 4.0 image-to-image request for asynchronous processing
- /// and returns immediately with a request_id. The generated images are POSTed
- /// to the supplied `webhook_url` once ready. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// The initial image binary (max 25MB); only JPEG, WebP and PNG formats are supported. - /// - /// - /// The initial image binary (max 25MB); only JPEG, WebP and PNG formats are supported. - /// - /// - /// Optional. Up to 4 additional reference images used together with `image` to condition
- /// the generation, for a maximum of 5 reference images total. Each image may be up to 25MB;
- /// only JPEG, WebP and PNG formats are supported. - /// - /// - /// Optional file names to use for the multipart 'additional_images' file parts. - /// - /// - /// An optional text prompt to guide the generation. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// Output resolutions for Ideogram 4.0 image-to-image. Superset of ResolutionV4 (the 1K/2K t2im set) plus the small 512-tier (512x512, 768x384, 384x768).
- /// Example: 1024x1024 - /// - /// - /// The rendering speed to use. For Ideogram V4, `rendering_speed=FLASH`
- /// is coming soon; requests with `rendering_speed=FLASH` currently
- /// return a 400. - /// - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). See GenerateImageRequestV3 for details. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostGenerateImageV4Im2ImAsyncAsResponseAsync( - string webhookUrl, - global::System.IO.Stream image, - string imagename, - global::System.Collections.Generic.IReadOnlyList? additionalImages = default, - global::System.Collections.Generic.IReadOnlyList? additionalImagesFileNames = default, - string? prompt = default, - int? seed = default, - global::Ideogram.MagicPromptOption? magicPromptOption = default, - string? magicPromptSystemPromptConfigId = default, - global::Ideogram.ResolutionV4ImageToImage? resolution = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - bool? enableCopyrightDetection = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - - image = image ?? throw new global::System.ArgumentNullException(nameof(image)); - var request = new global::Ideogram.GenerateImageRequestV4Im2Im - { - Image = global::System.Array.Empty(), - Imagename = imagename, - AdditionalImages = new global::System.Collections.Generic.List(), - Prompt = prompt, - Seed = seed, - MagicPromptOption = magicPromptOption, - MagicPromptSystemPromptConfigId = magicPromptSystemPromptConfigId, - Resolution = resolution, - RenderingSpeed = renderingSpeed, - EnableCopyrightDetection = enableCopyrightDetection, - }; - PrepareArguments( - client: HttpClient); - PreparePostGenerateImageV4Im2ImAsyncArguments( - httpClient: HttpClient, - webhookUrl: ref webhookUrl, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostGenerateImageV4Im2ImAsyncSecurityRequirements, - operationName: "PostGenerateImageV4Im2ImAsyncAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/ideogram-v4/async/image-to-image", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("webhook_url", webhookUrl) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - var __contentImage = new global::System.Net.Http.StreamContent(image); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - if (additionalImages != default) - { - - for (var __iAdditionalImages = 0; __iAdditionalImages < additionalImages.Count; __iAdditionalImages++) - { - var __fileNameAdditionalImages = additionalImagesFileNames != null && - __iAdditionalImages < additionalImagesFileNames.Count && - additionalImagesFileNames[__iAdditionalImages] != null - ? additionalImagesFileNames[__iAdditionalImages] - : $"file{__iAdditionalImages}.bin"; - var __contentAdditionalImages = new global::System.Net.Http.StreamContent(additionalImages[__iAdditionalImages]); - __contentAdditionalImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - __fileNameAdditionalImages is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(__fileNameAdditionalImages) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentAdditionalImages, - name: "\"additional_images\"", - fileName: $"\"{__fileNameAdditionalImages}\""); - if (__contentAdditionalImages.Headers.ContentDisposition != null) - { - __contentAdditionalImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - if (request.Prompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.MagicPromptOption != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.MagicPromptOption).HasValue ? (request.MagicPromptOption).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"magic_prompt_option\""); - - } - if (request.MagicPromptSystemPromptConfigId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.MagicPromptSystemPromptConfigId ?? string.Empty), - name: "\"magic_prompt_system_prompt_config_id\""); - - } - if (request.Resolution != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"resolution\""); - - } - if (request.RenderingSpeed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"rendering_speed\""); - - } - if (request.EnableCopyrightDetection != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"enable_copyright_detection\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostGenerateImageV4Im2ImAsyncRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - webhookUrl: webhookUrl, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4Im2ImAsync", - methodName: "PostGenerateImageV4Im2ImAsyncAsync", - pathTemplate: "\"/v1/ideogram-v4/async/image-to-image\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4Im2ImAsync", - methodName: "PostGenerateImageV4Im2ImAsyncAsync", - pathTemplate: "\"/v1/ideogram-v4/async/image-to-image\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4Im2ImAsync", - methodName: "PostGenerateImageV4Im2ImAsyncAsync", - pathTemplate: "\"/v1/ideogram-v4/async/image-to-image\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostGenerateImageV4Im2ImAsyncResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4Im2ImAsync", - methodName: "PostGenerateImageV4Im2ImAsyncAsync", - pathTemplate: "\"/v1/ideogram-v4/async/image-to-image\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4Im2ImAsync", - methodName: "PostGenerateImageV4Im2ImAsyncAsync", - pathTemplate: "\"/v1/ideogram-v4/async/image-to-image\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt failed the safety check. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostGenerateImageV4Im2ImAsyncResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.AsyncImageGenerationResponseV4.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.AsyncImageGenerationResponseV4.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageV4Stable.g.cs b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageV4Stable.g.cs deleted file mode 100644 index 00f89dc1..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageV4Stable.g.cs +++ /dev/null @@ -1,678 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class GenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostGenerateImageV4StableSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostGenerateImageV4StableSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostGenerateImageV4StableSecurityRequirement0, - }; - partial void PreparePostGenerateImageV4StableArguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.GenerateImageRequestV4Stable request); - partial void PreparePostGenerateImageV4StableRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.GenerateImageRequestV4Stable request); - partial void ProcessPostGenerateImageV4StableResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostGenerateImageV4StableResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Generate with Ideogram 4.0 (stable model)
- /// Generates images synchronously using a pinned stable build of the
- /// Ideogram 4.0 model. This endpoint is intentionally minimal: it accepts
- /// only a prompt (and optional seed), pins the underlying model URI, and
- /// lets the server pick the output resolution automatically.
- /// Images links are available for a limited period of time; if you would
- /// like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageV4StableAsync( - - global::Ideogram.GenerateImageRequestV4Stable request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostGenerateImageV4StableAsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Generate with Ideogram 4.0 (stable model)
- /// Generates images synchronously using a pinned stable build of the
- /// Ideogram 4.0 model. This endpoint is intentionally minimal: it accepts
- /// only a prompt (and optional seed), pins the underlying model URI, and
- /// lets the server pick the output resolution automatically.
- /// Images links are available for a limited period of time; if you would
- /// like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostGenerateImageV4StableAsResponseAsync( - - global::Ideogram.GenerateImageRequestV4Stable request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostGenerateImageV4StableArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostGenerateImageV4StableSecurityRequirements, - operationName: "PostGenerateImageV4StableAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/ideogram-v4/generate/stable", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (request.TextPrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.TextPrompt ?? string.Empty), - name: "\"text_prompt\""); - - } - if (request.JsonPrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.JsonPrompt.ToJson(JsonSerializerContext)), - name: "\"json_prompt\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.Resolution != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"resolution\""); - - } - if (request.Version != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Version).HasValue ? (request.Version).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"version\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostGenerateImageV4StableRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4Stable", - methodName: "PostGenerateImageV4StableAsync", - pathTemplate: "\"/v1/ideogram-v4/generate/stable\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4Stable", - methodName: "PostGenerateImageV4StableAsync", - pathTemplate: "\"/v1/ideogram-v4/generate/stable\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4Stable", - methodName: "PostGenerateImageV4StableAsync", - pathTemplate: "\"/v1/ideogram-v4/generate/stable\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostGenerateImageV4StableResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4Stable", - methodName: "PostGenerateImageV4StableAsync", - pathTemplate: "\"/v1/ideogram-v4/generate/stable\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4Stable", - methodName: "PostGenerateImageV4StableAsync", - pathTemplate: "\"/v1/ideogram-v4/generate/stable\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt failed the safety check. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostGenerateImageV4StableResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.ImageGenerationResponseV4.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.ImageGenerationResponseV4.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Generate with Ideogram 4.0 (stable model)
- /// Generates images synchronously using a pinned stable build of the
- /// Ideogram 4.0 model. This endpoint is intentionally minimal: it accepts
- /// only a prompt (and optional seed), pins the underlying model URI, and
- /// lets the server pick the output resolution automatically.
- /// Images links are available for a limited period of time; if you would
- /// like to keep the image, you must download it. - ///
- /// - /// A natural-language prompt for image generation. When supplied,
- /// magic-prompt is enabled automatically. Mutually exclusive with
- /// `json_prompt`. - /// - /// - /// A structured prompt that conforms to the Ideogram 4.0 JSON
- /// contract. When supplied, magic-prompt is disabled and the
- /// structured prompt is consumed by the diffusion model directly.
- /// Mutually exclusive with `text_prompt`. - /// - /// - /// Random seed for reproducibility. - /// - /// - /// Optional. When supplied, the image is generated at this
- /// resolution. When omitted, the server picks an aspect ratio
- /// automatically based on the prompt. - /// - /// - /// Optional. Selects a specific pinned stable build. When omitted,
- /// the default stable model URI is used. When set to `stable_may29`,
- /// the request is routed to the May 29th stable build. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageV4StableAsync( - string? textPrompt = default, - global::Ideogram.V4JsonPrompt? jsonPrompt = default, - int? seed = default, - global::Ideogram.ResolutionV4? resolution = default, - global::Ideogram.GenerateImageRequestV4StableVersion? version = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.GenerateImageRequestV4Stable - { - TextPrompt = textPrompt, - JsonPrompt = jsonPrompt, - Seed = seed, - Resolution = resolution, - Version = version, - }; - - return await PostGenerateImageV4StableAsync( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageV4Transparent.g.cs b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageV4Transparent.g.cs deleted file mode 100644 index 46616a6a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageV4Transparent.g.cs +++ /dev/null @@ -1,744 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class GenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostGenerateImageV4TransparentSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostGenerateImageV4TransparentSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostGenerateImageV4TransparentSecurityRequirement0, - }; - partial void PreparePostGenerateImageV4TransparentArguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.GenerateTransparentImageRequestV4 request); - partial void PreparePostGenerateImageV4TransparentRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.GenerateTransparentImageRequestV4 request); - partial void ProcessPostGenerateImageV4TransparentResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostGenerateImageV4TransparentResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Generate with Ideogram 4.0 (Transparent Background)
- /// Generates images with a transparent background synchronously using the
- /// Ideogram 4.0 model. The result is delivered as a PNG with an alpha
- /// channel.
- /// All Ideogram 4.0 aspect ratios are supported, including `AUTO`, which
- /// lets the model select the most suitable ratio from the prompt.
- /// `output_resolution` selects the delivered resolution tier. Tiers are
- /// total-pixel budgets: wide and tall aspect ratios keep the same pixel
- /// budget as the square of the named size, so a single dimension may
- /// exceed it. The response reports the final delivered resolution.
- /// Image links are available for a limited period of time; if you would
- /// like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageV4TransparentAsync( - - global::Ideogram.GenerateTransparentImageRequestV4 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostGenerateImageV4TransparentAsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Generate with Ideogram 4.0 (Transparent Background)
- /// Generates images with a transparent background synchronously using the
- /// Ideogram 4.0 model. The result is delivered as a PNG with an alpha
- /// channel.
- /// All Ideogram 4.0 aspect ratios are supported, including `AUTO`, which
- /// lets the model select the most suitable ratio from the prompt.
- /// `output_resolution` selects the delivered resolution tier. Tiers are
- /// total-pixel budgets: wide and tall aspect ratios keep the same pixel
- /// budget as the square of the named size, so a single dimension may
- /// exceed it. The response reports the final delivered resolution.
- /// Image links are available for a limited period of time; if you would
- /// like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostGenerateImageV4TransparentAsResponseAsync( - - global::Ideogram.GenerateTransparentImageRequestV4 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostGenerateImageV4TransparentArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostGenerateImageV4TransparentSecurityRequirements, - operationName: "PostGenerateImageV4TransparentAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/ideogram-v4/generate-transparent", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (request.TextPrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.TextPrompt ?? string.Empty), - name: "\"text_prompt\""); - - } - if (request.JsonPrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.JsonPrompt.ToJson(JsonSerializerContext)), - name: "\"json_prompt\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.MagicPromptSystemPromptConfigId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.MagicPromptSystemPromptConfigId ?? string.Empty), - name: "\"magic_prompt_system_prompt_config_id\""); - - } - if (request.AspectRatio != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.AspectRatio).HasValue ? (request.AspectRatio).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"aspect_ratio\""); - - } - if (request.OutputResolution != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.OutputResolution).HasValue ? (request.OutputResolution).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"output_resolution\""); - - } - if (request.RenderingSpeed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"rendering_speed\""); - - } - if (request.EnableCopyrightDetection != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"enable_copyright_detection\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostGenerateImageV4TransparentRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4Transparent", - methodName: "PostGenerateImageV4TransparentAsync", - pathTemplate: "\"/v1/ideogram-v4/generate-transparent\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4Transparent", - methodName: "PostGenerateImageV4TransparentAsync", - pathTemplate: "\"/v1/ideogram-v4/generate-transparent\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4Transparent", - methodName: "PostGenerateImageV4TransparentAsync", - pathTemplate: "\"/v1/ideogram-v4/generate-transparent\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostGenerateImageV4TransparentResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4Transparent", - methodName: "PostGenerateImageV4TransparentAsync", - pathTemplate: "\"/v1/ideogram-v4/generate-transparent\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4Transparent", - methodName: "PostGenerateImageV4TransparentAsync", - pathTemplate: "\"/v1/ideogram-v4/generate-transparent\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt failed the safety check. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostGenerateImageV4TransparentResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.ImageGenerationResponseV4.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.ImageGenerationResponseV4.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Generate with Ideogram 4.0 (Transparent Background)
- /// Generates images with a transparent background synchronously using the
- /// Ideogram 4.0 model. The result is delivered as a PNG with an alpha
- /// channel.
- /// All Ideogram 4.0 aspect ratios are supported, including `AUTO`, which
- /// lets the model select the most suitable ratio from the prompt.
- /// `output_resolution` selects the delivered resolution tier. Tiers are
- /// total-pixel budgets: wide and tall aspect ratios keep the same pixel
- /// budget as the square of the named size, so a single dimension may
- /// exceed it. The response reports the final delivered resolution.
- /// Image links are available for a limited period of time; if you would
- /// like to keep the image, you must download it. - ///
- /// - /// A natural-language prompt for image generation. When supplied,
- /// magic-prompt is enabled automatically. Mutually exclusive with
- /// `json_prompt`. - /// - /// - /// A structured prompt that conforms to the Ideogram 4.0 JSON
- /// contract. When supplied, magic-prompt is disabled and the
- /// structured prompt is consumed by the diffusion model directly,
- /// except that `compositional_deconstruction.background` is replaced
- /// with a transparent-background directive. Mutually exclusive with
- /// `text_prompt`. - /// - /// - /// Random seed for reproducibility. - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use
- /// for this request. Honored when `text_prompt` is supplied. Ignored
- /// when `json_prompt` is supplied. - /// - /// - /// The aspect ratio for an Ideogram 4.0 magic prompt. `AUTO` lets the
- /// model select the most suitable ratio from the prompt; any other value
- /// pins the ratio. The non-AUTO values are the buckets the 4.0 model
- /// supports.
- /// Default Value: AUTO - /// - /// - /// The output resolution tier for the generated image. Tiers are
- /// total-pixel budgets matching a square of the named size (for example,
- /// `8K` delivers at most 8192x8192 total pixels); wide and tall aspect
- /// ratios keep the same pixel budget, so a single dimension may exceed
- /// the named size. Defaults to 1K.
- /// Default Value: 1K - /// - /// - /// The rendering speed to use. Defaults to DEFAULT.
- /// Default Value: DEFAULT - /// - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). The effective gate is the OR of this field and the organization's
- /// `copyright_detection_enabled` setting on `/api`. See GenerateImageRequestV3 for details. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageV4TransparentAsync( - string? textPrompt = default, - global::Ideogram.V4JsonPrompt? jsonPrompt = default, - int? seed = default, - string? magicPromptSystemPromptConfigId = default, - global::Ideogram.AspectRatioV4? aspectRatio = default, - global::Ideogram.OutputResolution? outputResolution = default, - global::Ideogram.RenderingSpeedV4? renderingSpeed = default, - bool? enableCopyrightDetection = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.GenerateTransparentImageRequestV4 - { - TextPrompt = textPrompt, - JsonPrompt = jsonPrompt, - Seed = seed, - MagicPromptSystemPromptConfigId = magicPromptSystemPromptConfigId, - AspectRatio = aspectRatio, - OutputResolution = outputResolution, - RenderingSpeed = renderingSpeed, - EnableCopyrightDetection = enableCopyrightDetection, - }; - - return await PostGenerateImageV4TransparentAsync( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageV4TransparentAsync.g.cs b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageV4TransparentAsync.g.cs deleted file mode 100644 index ee9f35b1..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageV4TransparentAsync.g.cs +++ /dev/null @@ -1,783 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class GenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostGenerateImageV4TransparentAsyncSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostGenerateImageV4TransparentAsyncSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostGenerateImageV4TransparentAsyncSecurityRequirement0, - }; - partial void PreparePostGenerateImageV4TransparentAsyncArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? webhookUrl, - global::Ideogram.GenerateTransparentImageRequestV4 request); - partial void PreparePostGenerateImageV4TransparentAsyncRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? webhookUrl, - global::Ideogram.GenerateTransparentImageRequestV4 request); - partial void ProcessPostGenerateImageV4TransparentAsyncResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostGenerateImageV4TransparentAsyncResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Generate with Ideogram 4.0 (Transparent Background) asynchronously
- /// Accepts an Ideogram 4.0 transparent-background generation request for
- /// asynchronous processing and returns immediately with a generation_id.
- /// Poll `GET /v1/generations/{generation_id}` to retrieve the result. If a
- /// `webhook_url` is supplied, the generated images are additionally POSTed
- /// to it once ready, in a payload that mirrors the synchronous response
- /// with an added generation_id for correlation.
- /// See the synchronous `/v1/ideogram-v4/generate-transparent` endpoint for
- /// the request semantics, including `output_resolution` tiers.
- /// See [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageV4TransparentAsyncAsync( - - global::Ideogram.GenerateTransparentImageRequestV4 request, - string? webhookUrl = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostGenerateImageV4TransparentAsyncAsResponseAsync( - - request: request, - webhookUrl: webhookUrl, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Generate with Ideogram 4.0 (Transparent Background) asynchronously
- /// Accepts an Ideogram 4.0 transparent-background generation request for
- /// asynchronous processing and returns immediately with a generation_id.
- /// Poll `GET /v1/generations/{generation_id}` to retrieve the result. If a
- /// `webhook_url` is supplied, the generated images are additionally POSTed
- /// to it once ready, in a payload that mirrors the synchronous response
- /// with an added generation_id for correlation.
- /// See the synchronous `/v1/ideogram-v4/generate-transparent` endpoint for
- /// the request semantics, including `output_resolution` tiers.
- /// See [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostGenerateImageV4TransparentAsyncAsResponseAsync( - - global::Ideogram.GenerateTransparentImageRequestV4 request, - string? webhookUrl = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostGenerateImageV4TransparentAsyncArguments( - httpClient: HttpClient, - webhookUrl: ref webhookUrl, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostGenerateImageV4TransparentAsyncSecurityRequirements, - operationName: "PostGenerateImageV4TransparentAsyncAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/ideogram-v4/async/generate-transparent", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("webhook_url", webhookUrl) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (request.TextPrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.TextPrompt ?? string.Empty), - name: "\"text_prompt\""); - - } - if (request.JsonPrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.JsonPrompt.ToJson(JsonSerializerContext)), - name: "\"json_prompt\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.MagicPromptSystemPromptConfigId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.MagicPromptSystemPromptConfigId ?? string.Empty), - name: "\"magic_prompt_system_prompt_config_id\""); - - } - if (request.AspectRatio != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.AspectRatio).HasValue ? (request.AspectRatio).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"aspect_ratio\""); - - } - if (request.OutputResolution != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.OutputResolution).HasValue ? (request.OutputResolution).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"output_resolution\""); - - } - if (request.RenderingSpeed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"rendering_speed\""); - - } - if (request.EnableCopyrightDetection != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"enable_copyright_detection\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostGenerateImageV4TransparentAsyncRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - webhookUrl: webhookUrl, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4TransparentAsync", - methodName: "PostGenerateImageV4TransparentAsyncAsync", - pathTemplate: "\"/v1/ideogram-v4/async/generate-transparent\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4TransparentAsync", - methodName: "PostGenerateImageV4TransparentAsyncAsync", - pathTemplate: "\"/v1/ideogram-v4/async/generate-transparent\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4TransparentAsync", - methodName: "PostGenerateImageV4TransparentAsyncAsync", - pathTemplate: "\"/v1/ideogram-v4/async/generate-transparent\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostGenerateImageV4TransparentAsyncResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4TransparentAsync", - methodName: "PostGenerateImageV4TransparentAsyncAsync", - pathTemplate: "\"/v1/ideogram-v4/async/generate-transparent\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV4TransparentAsync", - methodName: "PostGenerateImageV4TransparentAsyncAsync", - pathTemplate: "\"/v1/ideogram-v4/async/generate-transparent\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt failed the safety check. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostGenerateImageV4TransparentAsyncResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.AsyncImageGenerationResponseV4.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.AsyncImageGenerationResponseV4.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Generate with Ideogram 4.0 (Transparent Background) asynchronously
- /// Accepts an Ideogram 4.0 transparent-background generation request for
- /// asynchronous processing and returns immediately with a generation_id.
- /// Poll `GET /v1/generations/{generation_id}` to retrieve the result. If a
- /// `webhook_url` is supplied, the generated images are additionally POSTed
- /// to it once ready, in a payload that mirrors the synchronous response
- /// with an added generation_id for correlation.
- /// See the synchronous `/v1/ideogram-v4/generate-transparent` endpoint for
- /// the request semantics, including `output_resolution` tiers.
- /// See [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// A natural-language prompt for image generation. When supplied,
- /// magic-prompt is enabled automatically. Mutually exclusive with
- /// `json_prompt`. - /// - /// - /// A structured prompt that conforms to the Ideogram 4.0 JSON
- /// contract. When supplied, magic-prompt is disabled and the
- /// structured prompt is consumed by the diffusion model directly,
- /// except that `compositional_deconstruction.background` is replaced
- /// with a transparent-background directive. Mutually exclusive with
- /// `text_prompt`. - /// - /// - /// Random seed for reproducibility. - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use
- /// for this request. Honored when `text_prompt` is supplied. Ignored
- /// when `json_prompt` is supplied. - /// - /// - /// The aspect ratio for an Ideogram 4.0 magic prompt. `AUTO` lets the
- /// model select the most suitable ratio from the prompt; any other value
- /// pins the ratio. The non-AUTO values are the buckets the 4.0 model
- /// supports.
- /// Default Value: AUTO - /// - /// - /// The output resolution tier for the generated image. Tiers are
- /// total-pixel budgets matching a square of the named size (for example,
- /// `8K` delivers at most 8192x8192 total pixels); wide and tall aspect
- /// ratios keep the same pixel budget, so a single dimension may exceed
- /// the named size. Defaults to 1K.
- /// Default Value: 1K - /// - /// - /// The rendering speed to use. Defaults to DEFAULT.
- /// Default Value: DEFAULT - /// - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). The effective gate is the OR of this field and the organization's
- /// `copyright_detection_enabled` setting on `/api`. See GenerateImageRequestV3 for details. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageV4TransparentAsyncAsync( - string? webhookUrl = default, - string? textPrompt = default, - global::Ideogram.V4JsonPrompt? jsonPrompt = default, - int? seed = default, - string? magicPromptSystemPromptConfigId = default, - global::Ideogram.AspectRatioV4? aspectRatio = default, - global::Ideogram.OutputResolution? outputResolution = default, - global::Ideogram.RenderingSpeedV4? renderingSpeed = default, - bool? enableCopyrightDetection = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.GenerateTransparentImageRequestV4 - { - TextPrompt = textPrompt, - JsonPrompt = jsonPrompt, - Seed = seed, - MagicPromptSystemPromptConfigId = magicPromptSystemPromptConfigId, - AspectRatio = aspectRatio, - OutputResolution = outputResolution, - RenderingSpeed = renderingSpeed, - EnableCopyrightDetection = enableCopyrightDetection, - }; - - return await PostGenerateImageV4TransparentAsyncAsync( - webhookUrl: webhookUrl, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageZImage.g.cs b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageZImage.g.cs deleted file mode 100644 index a9f0373d..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageZImage.g.cs +++ /dev/null @@ -1,715 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class GenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostGenerateImageZImageSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostGenerateImageZImageSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostGenerateImageZImageSecurityRequirement0, - }; - partial void PreparePostGenerateImageZImageArguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.GenerateImageRequestZImage request); - partial void PreparePostGenerateImageZImageRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.GenerateImageRequestZImage request); - partial void ProcessPostGenerateImageZImageResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostGenerateImageZImageResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Generate with Z-Image
- /// Generates images synchronously using the Z-Image model. Width and height
- /// must each be a positive multiple of 16 and the total area must not exceed
- /// 1,048,576 pixels (1024×1024); the server validates these against the
- /// model's resolution constraints.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageZImageAsync( - - global::Ideogram.GenerateImageRequestZImage request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostGenerateImageZImageAsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Generate with Z-Image
- /// Generates images synchronously using the Z-Image model. Width and height
- /// must each be a positive multiple of 16 and the total area must not exceed
- /// 1,048,576 pixels (1024×1024); the server validates these against the
- /// model's resolution constraints.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostGenerateImageZImageAsResponseAsync( - - global::Ideogram.GenerateImageRequestZImage request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostGenerateImageZImageArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostGenerateImageZImageSecurityRequirements, - operationName: "PostGenerateImageZImageAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/z-image/generate", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - if (request.SystemPrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.SystemPrompt ?? string.Empty), - name: "\"system_prompt\""); - - } - if (request.Width != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Width, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"width\""); - - } - if (request.Height != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Height, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"height\""); - - } - if (request.NumInferenceSteps != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumInferenceSteps, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_inference_steps\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.CustomModelUri != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.CustomModelUri ?? string.Empty), - name: "\"custom_model_uri\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostGenerateImageZImageRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageZImage", - methodName: "PostGenerateImageZImageAsync", - pathTemplate: "\"/v1/z-image/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageZImage", - methodName: "PostGenerateImageZImageAsync", - pathTemplate: "\"/v1/z-image/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageZImage", - methodName: "PostGenerateImageZImageAsync", - pathTemplate: "\"/v1/z-image/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostGenerateImageZImageResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageZImage", - methodName: "PostGenerateImageZImageAsync", - pathTemplate: "\"/v1/z-image/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageZImage", - methodName: "PostGenerateImageZImageAsync", - pathTemplate: "\"/v1/z-image/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt failed the safety check. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostGenerateImageZImageResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.ImageGenerationResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.ImageGenerationResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Generate with Z-Image
- /// Generates images synchronously using the Z-Image model. Width and height
- /// must each be a positive multiple of 16 and the total area must not exceed
- /// 1,048,576 pixels (1024×1024); the server validates these against the
- /// model's resolution constraints.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// A natural-language prompt for image generation.
- /// Example: A futuristic cityscape at golden hour, highly detailed. - /// - /// - /// An optional system prompt applied alongside the prompt — use it for
- /// standing instructions such as style constraints or "do not render
- /// text". When omitted, no system prompt is applied. If you trained a
- /// LoRA with a system prompt, supply the same one here for best results.
- /// Example: Do not include any text in the image. - /// - /// - /// Output width in pixels; must be a positive multiple of 16.
- /// Example: 1024 - /// - /// - /// Output height in pixels; must be a positive multiple of 16.
- /// Example: 1024 - /// - /// - /// Optional diffusion step count. When omitted, the server uses the
- /// model's default. Higher values trade latency for quality.
- /// Example: 8 - /// - /// - /// Random seed for reproducibility. - /// - /// - /// Number of images to generate.
- /// Default Value: 1 - /// - /// - /// A custom model URI in the format model/<model_name>/version/<version_name>.
- /// When provided, the URI must resolve to a registered fine-tune of the
- /// Z-Image base model; the fine-tune's LoRA checkpoint is layered on
- /// the base. When omitted, the Z-Image base is used with no LoRA.
- /// Example: model/my-z-image-lora/version/0 - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageZImageAsync( - string prompt, - string? systemPrompt = default, - int? width = default, - int? height = default, - int? numInferenceSteps = default, - int? seed = default, - int? numImages = default, - string? customModelUri = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.GenerateImageRequestZImage - { - Prompt = prompt, - SystemPrompt = systemPrompt, - Width = width, - Height = height, - NumInferenceSteps = numInferenceSteps, - Seed = seed, - NumImages = numImages, - CustomModelUri = customModelUri, - }; - - return await PostGenerateImageZImageAsync( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageZImageAsync.g.cs b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageZImageAsync.g.cs deleted file mode 100644 index 50e1bd64..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageZImageAsync.g.cs +++ /dev/null @@ -1,760 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class GenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostGenerateImageZImageAsyncSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostGenerateImageZImageAsyncSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostGenerateImageZImageAsyncSecurityRequirement0, - }; - partial void PreparePostGenerateImageZImageAsyncArguments( - global::System.Net.Http.HttpClient httpClient, - ref string webhookUrl, - global::Ideogram.GenerateImageRequestZImage request); - partial void PreparePostGenerateImageZImageAsyncRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string webhookUrl, - global::Ideogram.GenerateImageRequestZImage request); - partial void ProcessPostGenerateImageZImageAsyncResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostGenerateImageZImageAsyncResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Generate with Z-Image asynchronously via webhook
- /// Accepts a Z-Image generation request for asynchronous processing and
- /// returns immediately with a generation_id. The generated images are POSTed to
- /// the supplied `webhook_url` once ready, in a payload that mirrors the
- /// synchronous response with an added generation_id for correlation.
- /// See [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageZImageAsyncAsync( - string webhookUrl, - - global::Ideogram.GenerateImageRequestZImage request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostGenerateImageZImageAsyncAsResponseAsync( - webhookUrl: webhookUrl, - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Generate with Z-Image asynchronously via webhook
- /// Accepts a Z-Image generation request for asynchronous processing and
- /// returns immediately with a generation_id. The generated images are POSTed to
- /// the supplied `webhook_url` once ready, in a payload that mirrors the
- /// synchronous response with an added generation_id for correlation.
- /// See [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostGenerateImageZImageAsyncAsResponseAsync( - string webhookUrl, - - global::Ideogram.GenerateImageRequestZImage request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostGenerateImageZImageAsyncArguments( - httpClient: HttpClient, - webhookUrl: ref webhookUrl, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostGenerateImageZImageAsyncSecurityRequirements, - operationName: "PostGenerateImageZImageAsyncAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/z-image/async/generate", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("webhook_url", webhookUrl) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - if (request.SystemPrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.SystemPrompt ?? string.Empty), - name: "\"system_prompt\""); - - } - if (request.Width != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Width, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"width\""); - - } - if (request.Height != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Height, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"height\""); - - } - if (request.NumInferenceSteps != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumInferenceSteps, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_inference_steps\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.CustomModelUri != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.CustomModelUri ?? string.Empty), - name: "\"custom_model_uri\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostGenerateImageZImageAsyncRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - webhookUrl: webhookUrl, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageZImageAsync", - methodName: "PostGenerateImageZImageAsyncAsync", - pathTemplate: "\"/v1/z-image/async/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageZImageAsync", - methodName: "PostGenerateImageZImageAsyncAsync", - pathTemplate: "\"/v1/z-image/async/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageZImageAsync", - methodName: "PostGenerateImageZImageAsyncAsync", - pathTemplate: "\"/v1/z-image/async/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostGenerateImageZImageAsyncResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageZImageAsync", - methodName: "PostGenerateImageZImageAsyncAsync", - pathTemplate: "\"/v1/z-image/async/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageZImageAsync", - methodName: "PostGenerateImageZImageAsyncAsync", - pathTemplate: "\"/v1/z-image/async/generate\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt failed the safety check. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostGenerateImageZImageAsyncResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.AsyncImageGenerationResponseV4.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.AsyncImageGenerationResponseV4.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Generate with Z-Image asynchronously via webhook
- /// Accepts a Z-Image generation request for asynchronous processing and
- /// returns immediately with a generation_id. The generated images are POSTed to
- /// the supplied `webhook_url` once ready, in a payload that mirrors the
- /// synchronous response with an added generation_id for correlation.
- /// See [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// A natural-language prompt for image generation.
- /// Example: A futuristic cityscape at golden hour, highly detailed. - /// - /// - /// An optional system prompt applied alongside the prompt — use it for
- /// standing instructions such as style constraints or "do not render
- /// text". When omitted, no system prompt is applied. If you trained a
- /// LoRA with a system prompt, supply the same one here for best results.
- /// Example: Do not include any text in the image. - /// - /// - /// Output width in pixels; must be a positive multiple of 16.
- /// Example: 1024 - /// - /// - /// Output height in pixels; must be a positive multiple of 16.
- /// Example: 1024 - /// - /// - /// Optional diffusion step count. When omitted, the server uses the
- /// model's default. Higher values trade latency for quality.
- /// Example: 8 - /// - /// - /// Random seed for reproducibility. - /// - /// - /// Number of images to generate.
- /// Default Value: 1 - /// - /// - /// A custom model URI in the format model/<model_name>/version/<version_name>.
- /// When provided, the URI must resolve to a registered fine-tune of the
- /// Z-Image base model; the fine-tune's LoRA checkpoint is layered on
- /// the base. When omitted, the Z-Image base is used with no LoRA.
- /// Example: model/my-z-image-lora/version/0 - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageZImageAsyncAsync( - string webhookUrl, - string prompt, - string? systemPrompt = default, - int? width = default, - int? height = default, - int? numInferenceSteps = default, - int? seed = default, - int? numImages = default, - string? customModelUri = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.GenerateImageRequestZImage - { - Prompt = prompt, - SystemPrompt = systemPrompt, - Width = width, - Height = height, - NumInferenceSteps = numInferenceSteps, - Seed = seed, - NumImages = numImages, - CustomModelUri = customModelUri, - }; - - return await PostGenerateImageZImageAsyncAsync( - webhookUrl: webhookUrl, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostInpaintImageV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostInpaintImageV3.g.cs deleted file mode 100644 index 471f0342..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostInpaintImageV3.g.cs +++ /dev/null @@ -1,2762 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class GenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostInpaintImageV3SecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostInpaintImageV3SecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostInpaintImageV3SecurityRequirement0, - }; - partial void PreparePostInpaintImageV3Arguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.EditImageRequestV3 request); - partial void PreparePostInpaintImageV3Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.EditImageRequestV3 request); - partial void ProcessPostInpaintImageV3Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostInpaintImageV3ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Inpaint with Ideogram 3.0
- /// Inpaint a given image synchronously using the provided mask with Ideogram 3.0. The mask indicates which part of the image
- /// should be edited, while the prompt and chosen style can further guide the edit.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostInpaintImageV3Async( - - global::Ideogram.EditImageRequestV3 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostInpaintImageV3AsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Inpaint with Ideogram 3.0
- /// Inpaint a given image synchronously using the provided mask with Ideogram 3.0. The mask indicates which part of the image
- /// should be edited, while the prompt and chosen style can further guide the edit.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostInpaintImageV3AsResponseAsync( - - global::Ideogram.EditImageRequestV3 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostInpaintImageV3Arguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostInpaintImageV3SecurityRequirements, - operationName: "PostInpaintImageV3Async"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/ideogram-v3/inpaint", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - var __contentMask = new global::System.Net.Http.ByteArrayContent(request.Mask ?? global::System.Array.Empty()); - __contentMask.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Maskname is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Maskname) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentMask, - name: "\"mask\"", - fileName: request.Maskname != null ? $"\"{request.Maskname}\"" : string.Empty); - if (__contentMask.Headers.ContentDisposition != null) - { - __contentMask.Headers.ContentDisposition.FileNameStar = null; - } - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - if (request.MagicPrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.MagicPrompt).HasValue ? (request.MagicPrompt).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"magic_prompt\""); - - } - if (request.MagicPromptSystemPromptConfigId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.MagicPromptSystemPromptConfigId ?? string.Empty), - name: "\"magic_prompt_system_prompt_config_id\""); - - } - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.RenderingSpeed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"rendering_speed\""); - - } - if (request.StyleType != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.StyleType).HasValue ? (request.StyleType).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"style_type\""); - - } - if (request.StylePreset != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.StylePreset).HasValue ? (request.StylePreset).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"style_preset\""); - - } - if (request.CustomModelUri != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.CustomModelUri ?? string.Empty), - name: "\"custom_model_uri\""); - - } - if (request.ColorPalette != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ColorPalette.ToString() ?? string.Empty), - name: "\"color_palette\""); - - } - if (request.StyleCodes != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.StyleCodes!, x => x))}]"), - name: "\"style_codes\""); - - } - if (request.StyleReferenceImages != default) - { - - for (var __iStyleReferenceImages = 0; __iStyleReferenceImages < request.StyleReferenceImages.Count; __iStyleReferenceImages++) - { - var __contentStyleReferenceImages = new global::System.Net.Http.ByteArrayContent(request.StyleReferenceImages[__iStyleReferenceImages]); - __contentStyleReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); - __httpRequestContent.Add( - content: __contentStyleReferenceImages, - name: "\"style_reference_images\"", - fileName: $"\"file{__iStyleReferenceImages}.bin\""); - if (__contentStyleReferenceImages.Headers.ContentDisposition != null) - { - __contentStyleReferenceImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - if (request.CharacterReferenceImages != default) - { - - for (var __iCharacterReferenceImages = 0; __iCharacterReferenceImages < request.CharacterReferenceImages.Count; __iCharacterReferenceImages++) - { - var __contentCharacterReferenceImages = new global::System.Net.Http.ByteArrayContent(request.CharacterReferenceImages[__iCharacterReferenceImages]); - __contentCharacterReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); - __httpRequestContent.Add( - content: __contentCharacterReferenceImages, - name: "\"character_reference_images\"", - fileName: $"\"file{__iCharacterReferenceImages}.bin\""); - if (__contentCharacterReferenceImages.Headers.ContentDisposition != null) - { - __contentCharacterReferenceImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - if (request.CharacterReferenceImagesMask != default) - { - - for (var __iCharacterReferenceImagesMask = 0; __iCharacterReferenceImagesMask < request.CharacterReferenceImagesMask.Count; __iCharacterReferenceImagesMask++) - { - var __contentCharacterReferenceImagesMask = new global::System.Net.Http.ByteArrayContent(request.CharacterReferenceImagesMask[__iCharacterReferenceImagesMask]); - __contentCharacterReferenceImagesMask.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); - __httpRequestContent.Add( - content: __contentCharacterReferenceImagesMask, - name: "\"character_reference_images_mask\"", - fileName: $"\"file{__iCharacterReferenceImagesMask}.bin\""); - if (__contentCharacterReferenceImagesMask.Headers.ContentDisposition != null) - { - __contentCharacterReferenceImagesMask.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostInpaintImageV3Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostInpaintImageV3", - methodName: "PostInpaintImageV3Async", - pathTemplate: "\"/v1/ideogram-v3/inpaint\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostInpaintImageV3", - methodName: "PostInpaintImageV3Async", - pathTemplate: "\"/v1/ideogram-v3/inpaint\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostInpaintImageV3", - methodName: "PostInpaintImageV3Async", - pathTemplate: "\"/v1/ideogram-v3/inpaint\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostInpaintImageV3Response( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostInpaintImageV3", - methodName: "PostInpaintImageV3Async", - pathTemplate: "\"/v1/ideogram-v3/inpaint\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostInpaintImageV3", - methodName: "PostInpaintImageV3Async", - pathTemplate: "\"/v1/ideogram-v3/inpaint\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt or Initial Image failed the safety checks. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostInpaintImageV3ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.ImageGenerationResponseV3.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.ImageGenerationResponseV3.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Inpaint with Ideogram 3.0
- /// Inpaint a given image synchronously using the provided mask with Ideogram 3.0. The mask indicates which part of the image
- /// should be edited, while the prompt and chosen style can further guide the edit.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The image being edited (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The image being edited (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// A black and white image of the same size as the image being edited (max size 25MB). Black regions in the mask should match up with the regions of the image that you would like to edit; only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// A black and white image of the same size as the image being edited (max size 25MB). Black regions in the mask should match up with the regions of the image that you would like to edit; only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The prompt used to describe the edited result.
- /// Example: A photo of a cat. - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - /// - /// - /// The style type to generate with.
- /// Default Value: GENERAL
- /// Example: GENERAL - /// - /// - /// A predefined style preset that applies a specific artistic style to the generated image.
- /// Example: BRIGHT_ART - /// - /// - /// A custom model URI in the format model/<model_name>/version/<version_name>.
- /// When provided, the model version and style will be resolved from this URI, and style_type is not required.
- /// Example: model/my-custom-model/version/1 - /// - /// - /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). Not supported by V_1, V_1_TURBO, V_2A and V_2A_TURBO models. - /// - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - /// - /// - /// A set of images to use as style references (max size 25MB per image; the whole request must stay under 50MB). The images should be in JPEG, PNG or WebP format. - /// - /// - /// Generations with character reference are subject to the character reference pricing. A set of images to use as character references (max size 25MB per image; the whole request must stay under 50MB), currently only supports 1 character reference image. The images should be in JPEG, PNG or WebP format. - /// - /// - /// Optional masks for character reference images. When provided, must match the number of character_reference_images. Each mask should be a grayscale image of the same dimensions as the corresponding character reference image. The images should be in JPEG, PNG or WebP format. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostInpaintImageV3Async( - byte[] image, - string imagename, - byte[] mask, - string maskname, - string prompt, - global::Ideogram.MagicPromptOption? magicPrompt = default, - string? magicPromptSystemPromptConfigId = default, - int? numImages = default, - int? seed = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - global::Ideogram.StyleTypeV3? styleType = default, - global::Ideogram.StylePresetV3? stylePreset = default, - string? customModelUri = default, - global::Ideogram.ColorPaletteWithPresetNameOrMembers? colorPalette = default, - global::System.Collections.Generic.IList? styleCodes = default, - global::System.Collections.Generic.IList? styleReferenceImages = default, - global::System.Collections.Generic.IList? characterReferenceImages = default, - global::System.Collections.Generic.IList? characterReferenceImagesMask = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.EditImageRequestV3 - { - Image = image, - Imagename = imagename, - Mask = mask, - Maskname = maskname, - Prompt = prompt, - MagicPrompt = magicPrompt, - MagicPromptSystemPromptConfigId = magicPromptSystemPromptConfigId, - NumImages = numImages, - Seed = seed, - RenderingSpeed = renderingSpeed, - StyleType = styleType, - StylePreset = stylePreset, - CustomModelUri = customModelUri, - ColorPalette = colorPalette, - StyleCodes = styleCodes, - StyleReferenceImages = styleReferenceImages, - CharacterReferenceImages = characterReferenceImages, - CharacterReferenceImagesMask = characterReferenceImagesMask, - }; - - return await PostInpaintImageV3Async( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - - /// - /// Inpaint with Ideogram 3.0
- /// Inpaint a given image synchronously using the provided mask with Ideogram 3.0. The mask indicates which part of the image
- /// should be edited, while the prompt and chosen style can further guide the edit.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The image being edited (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The image being edited (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// A black and white image of the same size as the image being edited (max size 25MB). Black regions in the mask should match up with the regions of the image that you would like to edit; only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// A black and white image of the same size as the image being edited (max size 25MB). Black regions in the mask should match up with the regions of the image that you would like to edit; only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The prompt used to describe the edited result.
- /// Example: A photo of a cat. - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - /// - /// - /// The style type to generate with.
- /// Default Value: GENERAL
- /// Example: GENERAL - /// - /// - /// A predefined style preset that applies a specific artistic style to the generated image.
- /// Example: BRIGHT_ART - /// - /// - /// A custom model URI in the format model/<model_name>/version/<version_name>.
- /// When provided, the model version and style will be resolved from this URI, and style_type is not required.
- /// Example: model/my-custom-model/version/1 - /// - /// - /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). Not supported by V_1, V_1_TURBO, V_2A and V_2A_TURBO models. - /// - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - /// - /// - /// A set of images to use as style references (max size 25MB per image; the whole request must stay under 50MB). The images should be in JPEG, PNG or WebP format. - /// - /// - /// Optional file names to use for the multipart 'style_reference_images' file parts. - /// - /// - /// Generations with character reference are subject to the character reference pricing. A set of images to use as character references (max size 25MB per image; the whole request must stay under 50MB), currently only supports 1 character reference image. The images should be in JPEG, PNG or WebP format. - /// - /// - /// Optional file names to use for the multipart 'character_reference_images' file parts. - /// - /// - /// Optional masks for character reference images. When provided, must match the number of character_reference_images. Each mask should be a grayscale image of the same dimensions as the corresponding character reference image. The images should be in JPEG, PNG or WebP format. - /// - /// - /// Optional file names to use for the multipart 'character_reference_images_mask' file parts. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostInpaintImageV3Async( - global::System.IO.Stream image, - string imagename, - global::System.IO.Stream mask, - string maskname, - string prompt, - global::Ideogram.MagicPromptOption? magicPrompt = default, - string? magicPromptSystemPromptConfigId = default, - int? numImages = default, - int? seed = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - global::Ideogram.StyleTypeV3? styleType = default, - global::Ideogram.StylePresetV3? stylePreset = default, - string? customModelUri = default, - global::Ideogram.ColorPaletteWithPresetNameOrMembers? colorPalette = default, - global::System.Collections.Generic.IList? styleCodes = default, - global::System.Collections.Generic.IReadOnlyList? styleReferenceImages = default, - global::System.Collections.Generic.IReadOnlyList? styleReferenceImagesFileNames = default, - global::System.Collections.Generic.IReadOnlyList? characterReferenceImages = default, - global::System.Collections.Generic.IReadOnlyList? characterReferenceImagesFileNames = default, - global::System.Collections.Generic.IReadOnlyList? characterReferenceImagesMask = default, - global::System.Collections.Generic.IReadOnlyList? characterReferenceImagesMaskFileNames = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - - image = image ?? throw new global::System.ArgumentNullException(nameof(image)); - mask = mask ?? throw new global::System.ArgumentNullException(nameof(mask)); - var request = new global::Ideogram.EditImageRequestV3 - { - Image = global::System.Array.Empty(), - Imagename = imagename, - Mask = global::System.Array.Empty(), - Maskname = maskname, - Prompt = prompt, - MagicPrompt = magicPrompt, - MagicPromptSystemPromptConfigId = magicPromptSystemPromptConfigId, - NumImages = numImages, - Seed = seed, - RenderingSpeed = renderingSpeed, - StyleType = styleType, - StylePreset = stylePreset, - CustomModelUri = customModelUri, - ColorPalette = colorPalette, - StyleCodes = styleCodes, - StyleReferenceImages = new global::System.Collections.Generic.List(), - CharacterReferenceImages = new global::System.Collections.Generic.List(), - CharacterReferenceImagesMask = new global::System.Collections.Generic.List(), - }; - PrepareArguments( - client: HttpClient); - PreparePostInpaintImageV3Arguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostInpaintImageV3SecurityRequirements, - operationName: "PostInpaintImageV3Async"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/ideogram-v3/inpaint", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - var __contentImage = new global::System.Net.Http.StreamContent(image); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - var __contentMask = new global::System.Net.Http.StreamContent(mask); - __contentMask.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Maskname is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Maskname) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentMask, - name: "\"mask\"", - fileName: request.Maskname != null ? $"\"{request.Maskname}\"" : string.Empty); - if (__contentMask.Headers.ContentDisposition != null) - { - __contentMask.Headers.ContentDisposition.FileNameStar = null; - } - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - if (request.MagicPrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.MagicPrompt).HasValue ? (request.MagicPrompt).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"magic_prompt\""); - - } - if (request.MagicPromptSystemPromptConfigId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.MagicPromptSystemPromptConfigId ?? string.Empty), - name: "\"magic_prompt_system_prompt_config_id\""); - - } - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.RenderingSpeed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"rendering_speed\""); - - } - if (request.StyleType != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.StyleType).HasValue ? (request.StyleType).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"style_type\""); - - } - if (request.StylePreset != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.StylePreset).HasValue ? (request.StylePreset).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"style_preset\""); - - } - if (request.CustomModelUri != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.CustomModelUri ?? string.Empty), - name: "\"custom_model_uri\""); - - } - if (request.ColorPalette != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ColorPalette.ToString() ?? string.Empty), - name: "\"color_palette\""); - - } - if (request.StyleCodes != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.StyleCodes!, x => x))}]"), - name: "\"style_codes\""); - - } - if (styleReferenceImages != default) - { - - for (var __iStyleReferenceImages = 0; __iStyleReferenceImages < styleReferenceImages.Count; __iStyleReferenceImages++) - { - var __fileNameStyleReferenceImages = styleReferenceImagesFileNames != null && - __iStyleReferenceImages < styleReferenceImagesFileNames.Count && - styleReferenceImagesFileNames[__iStyleReferenceImages] != null - ? styleReferenceImagesFileNames[__iStyleReferenceImages] - : $"file{__iStyleReferenceImages}.bin"; - var __contentStyleReferenceImages = new global::System.Net.Http.StreamContent(styleReferenceImages[__iStyleReferenceImages]); - __contentStyleReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - __fileNameStyleReferenceImages is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(__fileNameStyleReferenceImages) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentStyleReferenceImages, - name: "\"style_reference_images\"", - fileName: $"\"{__fileNameStyleReferenceImages}\""); - if (__contentStyleReferenceImages.Headers.ContentDisposition != null) - { - __contentStyleReferenceImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - if (characterReferenceImages != default) - { - - for (var __iCharacterReferenceImages = 0; __iCharacterReferenceImages < characterReferenceImages.Count; __iCharacterReferenceImages++) - { - var __fileNameCharacterReferenceImages = characterReferenceImagesFileNames != null && - __iCharacterReferenceImages < characterReferenceImagesFileNames.Count && - characterReferenceImagesFileNames[__iCharacterReferenceImages] != null - ? characterReferenceImagesFileNames[__iCharacterReferenceImages] - : $"file{__iCharacterReferenceImages}.bin"; - var __contentCharacterReferenceImages = new global::System.Net.Http.StreamContent(characterReferenceImages[__iCharacterReferenceImages]); - __contentCharacterReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - __fileNameCharacterReferenceImages is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(__fileNameCharacterReferenceImages) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentCharacterReferenceImages, - name: "\"character_reference_images\"", - fileName: $"\"{__fileNameCharacterReferenceImages}\""); - if (__contentCharacterReferenceImages.Headers.ContentDisposition != null) - { - __contentCharacterReferenceImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - if (characterReferenceImagesMask != default) - { - - for (var __iCharacterReferenceImagesMask = 0; __iCharacterReferenceImagesMask < characterReferenceImagesMask.Count; __iCharacterReferenceImagesMask++) - { - var __fileNameCharacterReferenceImagesMask = characterReferenceImagesMaskFileNames != null && - __iCharacterReferenceImagesMask < characterReferenceImagesMaskFileNames.Count && - characterReferenceImagesMaskFileNames[__iCharacterReferenceImagesMask] != null - ? characterReferenceImagesMaskFileNames[__iCharacterReferenceImagesMask] - : $"file{__iCharacterReferenceImagesMask}.bin"; - var __contentCharacterReferenceImagesMask = new global::System.Net.Http.StreamContent(characterReferenceImagesMask[__iCharacterReferenceImagesMask]); - __contentCharacterReferenceImagesMask.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - __fileNameCharacterReferenceImagesMask is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(__fileNameCharacterReferenceImagesMask) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentCharacterReferenceImagesMask, - name: "\"character_reference_images_mask\"", - fileName: $"\"{__fileNameCharacterReferenceImagesMask}\""); - if (__contentCharacterReferenceImagesMask.Headers.ContentDisposition != null) - { - __contentCharacterReferenceImagesMask.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostInpaintImageV3Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostInpaintImageV3", - methodName: "PostInpaintImageV3Async", - pathTemplate: "\"/v1/ideogram-v3/inpaint\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostInpaintImageV3", - methodName: "PostInpaintImageV3Async", - pathTemplate: "\"/v1/ideogram-v3/inpaint\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostInpaintImageV3", - methodName: "PostInpaintImageV3Async", - pathTemplate: "\"/v1/ideogram-v3/inpaint\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostInpaintImageV3Response( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostInpaintImageV3", - methodName: "PostInpaintImageV3Async", - pathTemplate: "\"/v1/ideogram-v3/inpaint\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostInpaintImageV3", - methodName: "PostInpaintImageV3Async", - pathTemplate: "\"/v1/ideogram-v3/inpaint\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt or Initial Image failed the safety checks. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostInpaintImageV3ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::Ideogram.ImageGenerationResponseV3.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - return - await global::Ideogram.ImageGenerationResponseV3.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Inpaint with Ideogram 3.0
- /// Inpaint a given image synchronously using the provided mask with Ideogram 3.0. The mask indicates which part of the image
- /// should be edited, while the prompt and chosen style can further guide the edit.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The image being edited (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The image being edited (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// A black and white image of the same size as the image being edited (max size 25MB). Black regions in the mask should match up with the regions of the image that you would like to edit; only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// A black and white image of the same size as the image being edited (max size 25MB). Black regions in the mask should match up with the regions of the image that you would like to edit; only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The prompt used to describe the edited result.
- /// Example: A photo of a cat. - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - /// - /// - /// The style type to generate with.
- /// Default Value: GENERAL
- /// Example: GENERAL - /// - /// - /// A predefined style preset that applies a specific artistic style to the generated image.
- /// Example: BRIGHT_ART - /// - /// - /// A custom model URI in the format model/<model_name>/version/<version_name>.
- /// When provided, the model version and style will be resolved from this URI, and style_type is not required.
- /// Example: model/my-custom-model/version/1 - /// - /// - /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). Not supported by V_1, V_1_TURBO, V_2A and V_2A_TURBO models. - /// - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - /// - /// - /// A set of images to use as style references (max size 25MB per image; the whole request must stay under 50MB). The images should be in JPEG, PNG or WebP format. - /// - /// - /// Optional file names to use for the multipart 'style_reference_images' file parts. - /// - /// - /// Generations with character reference are subject to the character reference pricing. A set of images to use as character references (max size 25MB per image; the whole request must stay under 50MB), currently only supports 1 character reference image. The images should be in JPEG, PNG or WebP format. - /// - /// - /// Optional file names to use for the multipart 'character_reference_images' file parts. - /// - /// - /// Optional masks for character reference images. When provided, must match the number of character_reference_images. Each mask should be a grayscale image of the same dimensions as the corresponding character reference image. The images should be in JPEG, PNG or WebP format. - /// - /// - /// Optional file names to use for the multipart 'character_reference_images_mask' file parts. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostInpaintImageV3AsResponseAsync( - global::System.IO.Stream image, - string imagename, - global::System.IO.Stream mask, - string maskname, - string prompt, - global::Ideogram.MagicPromptOption? magicPrompt = default, - string? magicPromptSystemPromptConfigId = default, - int? numImages = default, - int? seed = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - global::Ideogram.StyleTypeV3? styleType = default, - global::Ideogram.StylePresetV3? stylePreset = default, - string? customModelUri = default, - global::Ideogram.ColorPaletteWithPresetNameOrMembers? colorPalette = default, - global::System.Collections.Generic.IList? styleCodes = default, - global::System.Collections.Generic.IReadOnlyList? styleReferenceImages = default, - global::System.Collections.Generic.IReadOnlyList? styleReferenceImagesFileNames = default, - global::System.Collections.Generic.IReadOnlyList? characterReferenceImages = default, - global::System.Collections.Generic.IReadOnlyList? characterReferenceImagesFileNames = default, - global::System.Collections.Generic.IReadOnlyList? characterReferenceImagesMask = default, - global::System.Collections.Generic.IReadOnlyList? characterReferenceImagesMaskFileNames = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - - image = image ?? throw new global::System.ArgumentNullException(nameof(image)); - mask = mask ?? throw new global::System.ArgumentNullException(nameof(mask)); - var request = new global::Ideogram.EditImageRequestV3 - { - Image = global::System.Array.Empty(), - Imagename = imagename, - Mask = global::System.Array.Empty(), - Maskname = maskname, - Prompt = prompt, - MagicPrompt = magicPrompt, - MagicPromptSystemPromptConfigId = magicPromptSystemPromptConfigId, - NumImages = numImages, - Seed = seed, - RenderingSpeed = renderingSpeed, - StyleType = styleType, - StylePreset = stylePreset, - CustomModelUri = customModelUri, - ColorPalette = colorPalette, - StyleCodes = styleCodes, - StyleReferenceImages = new global::System.Collections.Generic.List(), - CharacterReferenceImages = new global::System.Collections.Generic.List(), - CharacterReferenceImagesMask = new global::System.Collections.Generic.List(), - }; - PrepareArguments( - client: HttpClient); - PreparePostInpaintImageV3Arguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostInpaintImageV3SecurityRequirements, - operationName: "PostInpaintImageV3Async"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/ideogram-v3/inpaint", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - var __contentImage = new global::System.Net.Http.StreamContent(image); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - var __contentMask = new global::System.Net.Http.StreamContent(mask); - __contentMask.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Maskname is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Maskname) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentMask, - name: "\"mask\"", - fileName: request.Maskname != null ? $"\"{request.Maskname}\"" : string.Empty); - if (__contentMask.Headers.ContentDisposition != null) - { - __contentMask.Headers.ContentDisposition.FileNameStar = null; - } - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - if (request.MagicPrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.MagicPrompt).HasValue ? (request.MagicPrompt).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"magic_prompt\""); - - } - if (request.MagicPromptSystemPromptConfigId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.MagicPromptSystemPromptConfigId ?? string.Empty), - name: "\"magic_prompt_system_prompt_config_id\""); - - } - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.RenderingSpeed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"rendering_speed\""); - - } - if (request.StyleType != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.StyleType).HasValue ? (request.StyleType).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"style_type\""); - - } - if (request.StylePreset != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.StylePreset).HasValue ? (request.StylePreset).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"style_preset\""); - - } - if (request.CustomModelUri != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.CustomModelUri ?? string.Empty), - name: "\"custom_model_uri\""); - - } - if (request.ColorPalette != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ColorPalette.ToString() ?? string.Empty), - name: "\"color_palette\""); - - } - if (request.StyleCodes != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.StyleCodes!, x => x))}]"), - name: "\"style_codes\""); - - } - if (styleReferenceImages != default) - { - - for (var __iStyleReferenceImages = 0; __iStyleReferenceImages < styleReferenceImages.Count; __iStyleReferenceImages++) - { - var __fileNameStyleReferenceImages = styleReferenceImagesFileNames != null && - __iStyleReferenceImages < styleReferenceImagesFileNames.Count && - styleReferenceImagesFileNames[__iStyleReferenceImages] != null - ? styleReferenceImagesFileNames[__iStyleReferenceImages] - : $"file{__iStyleReferenceImages}.bin"; - var __contentStyleReferenceImages = new global::System.Net.Http.StreamContent(styleReferenceImages[__iStyleReferenceImages]); - __contentStyleReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - __fileNameStyleReferenceImages is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(__fileNameStyleReferenceImages) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentStyleReferenceImages, - name: "\"style_reference_images\"", - fileName: $"\"{__fileNameStyleReferenceImages}\""); - if (__contentStyleReferenceImages.Headers.ContentDisposition != null) - { - __contentStyleReferenceImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - if (characterReferenceImages != default) - { - - for (var __iCharacterReferenceImages = 0; __iCharacterReferenceImages < characterReferenceImages.Count; __iCharacterReferenceImages++) - { - var __fileNameCharacterReferenceImages = characterReferenceImagesFileNames != null && - __iCharacterReferenceImages < characterReferenceImagesFileNames.Count && - characterReferenceImagesFileNames[__iCharacterReferenceImages] != null - ? characterReferenceImagesFileNames[__iCharacterReferenceImages] - : $"file{__iCharacterReferenceImages}.bin"; - var __contentCharacterReferenceImages = new global::System.Net.Http.StreamContent(characterReferenceImages[__iCharacterReferenceImages]); - __contentCharacterReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - __fileNameCharacterReferenceImages is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(__fileNameCharacterReferenceImages) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentCharacterReferenceImages, - name: "\"character_reference_images\"", - fileName: $"\"{__fileNameCharacterReferenceImages}\""); - if (__contentCharacterReferenceImages.Headers.ContentDisposition != null) - { - __contentCharacterReferenceImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - if (characterReferenceImagesMask != default) - { - - for (var __iCharacterReferenceImagesMask = 0; __iCharacterReferenceImagesMask < characterReferenceImagesMask.Count; __iCharacterReferenceImagesMask++) - { - var __fileNameCharacterReferenceImagesMask = characterReferenceImagesMaskFileNames != null && - __iCharacterReferenceImagesMask < characterReferenceImagesMaskFileNames.Count && - characterReferenceImagesMaskFileNames[__iCharacterReferenceImagesMask] != null - ? characterReferenceImagesMaskFileNames[__iCharacterReferenceImagesMask] - : $"file{__iCharacterReferenceImagesMask}.bin"; - var __contentCharacterReferenceImagesMask = new global::System.Net.Http.StreamContent(characterReferenceImagesMask[__iCharacterReferenceImagesMask]); - __contentCharacterReferenceImagesMask.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - __fileNameCharacterReferenceImagesMask is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(__fileNameCharacterReferenceImagesMask) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentCharacterReferenceImagesMask, - name: "\"character_reference_images_mask\"", - fileName: $"\"{__fileNameCharacterReferenceImagesMask}\""); - if (__contentCharacterReferenceImagesMask.Headers.ContentDisposition != null) - { - __contentCharacterReferenceImagesMask.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostInpaintImageV3Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostInpaintImageV3", - methodName: "PostInpaintImageV3Async", - pathTemplate: "\"/v1/ideogram-v3/inpaint\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostInpaintImageV3", - methodName: "PostInpaintImageV3Async", - pathTemplate: "\"/v1/ideogram-v3/inpaint\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostInpaintImageV3", - methodName: "PostInpaintImageV3Async", - pathTemplate: "\"/v1/ideogram-v3/inpaint\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostInpaintImageV3Response( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostInpaintImageV3", - methodName: "PostInpaintImageV3Async", - pathTemplate: "\"/v1/ideogram-v3/inpaint\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostInpaintImageV3", - methodName: "PostInpaintImageV3Async", - pathTemplate: "\"/v1/ideogram-v3/inpaint\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt or Initial Image failed the safety checks. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostInpaintImageV3ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.ImageGenerationResponseV3.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.ImageGenerationResponseV3.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostLayerizeDesignV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostLayerizeDesignV3.g.cs deleted file mode 100644 index 42677e83..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostLayerizeDesignV3.g.cs +++ /dev/null @@ -1,2637 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class GenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostLayerizeDesignV3SecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostLayerizeDesignV3SecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostLayerizeDesignV3SecurityRequirement0, - }; - partial void PreparePostLayerizeDesignV3Arguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.LayerizeDesignRequestV3 request); - partial void PreparePostLayerizeDesignV3Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.LayerizeDesignRequestV3 request); - partial void ProcessPostLayerizeDesignV3Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostLayerizeDesignV3ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Layerize an existing flat graphic image with text detection and correction
- /// Processes an existing flat graphic image to detect and correct text layers without generating a new image from scratch.
- /// The uploaded image is analyzed for text content, which is then removed and returned as structured text layers with font matching, sizing, and color information.
- /// Supported image formats include JPEG, PNG, and WebP (max size 25MB).
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostLayerizeDesignV3Async( - - global::Ideogram.LayerizeDesignRequestV3 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostLayerizeDesignV3AsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Layerize an existing flat graphic image with text detection and correction
- /// Processes an existing flat graphic image to detect and correct text layers without generating a new image from scratch.
- /// The uploaded image is analyzed for text content, which is then removed and returned as structured text layers with font matching, sizing, and color information.
- /// Supported image formats include JPEG, PNG, and WebP (max size 25MB).
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostLayerizeDesignV3AsResponseAsync( - - global::Ideogram.LayerizeDesignRequestV3 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostLayerizeDesignV3Arguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostLayerizeDesignV3SecurityRequirements, - operationName: "PostLayerizeDesignV3Async"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/ideogram-v3/layerize-design", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - var __contentFlatGraphicImage = new global::System.Net.Http.ByteArrayContent(request.FlatGraphicImage ?? global::System.Array.Empty()); - __contentFlatGraphicImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.FlatGraphicImagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.FlatGraphicImagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentFlatGraphicImage, - name: "\"flat_graphic_image\"", - fileName: request.FlatGraphicImagename != null ? $"\"{request.FlatGraphicImagename}\"" : string.Empty); - if (__contentFlatGraphicImage.Headers.ContentDisposition != null) - { - __contentFlatGraphicImage.Headers.ContentDisposition.FileNameStar = null; - } - - if (request.Prompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.FontFileH1 != default) - { - - var __contentFontFileH1 = new global::System.Net.Http.ByteArrayContent(request.FontFileH1 ?? global::System.Array.Empty()); - __contentFontFileH1.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.FontFileH1name is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.FontFileH1name) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentFontFileH1, - name: "\"font_file_h1\"", - fileName: request.FontFileH1name != null ? $"\"{request.FontFileH1name}\"" : string.Empty); - if (__contentFontFileH1.Headers.ContentDisposition != null) - { - __contentFontFileH1.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.FontNameH1 != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.FontNameH1 ?? string.Empty), - name: "\"font_name_h1\""); - - } - if (request.FontFileH2 != default) - { - - var __contentFontFileH2 = new global::System.Net.Http.ByteArrayContent(request.FontFileH2 ?? global::System.Array.Empty()); - __contentFontFileH2.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.FontFileH2name is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.FontFileH2name) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentFontFileH2, - name: "\"font_file_h2\"", - fileName: request.FontFileH2name != null ? $"\"{request.FontFileH2name}\"" : string.Empty); - if (__contentFontFileH2.Headers.ContentDisposition != null) - { - __contentFontFileH2.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.FontNameH2 != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.FontNameH2 ?? string.Empty), - name: "\"font_name_h2\""); - - } - if (request.FontFileBody != default) - { - - var __contentFontFileBody = new global::System.Net.Http.ByteArrayContent(request.FontFileBody ?? global::System.Array.Empty()); - __contentFontFileBody.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.FontFileBodyname is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.FontFileBodyname) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentFontFileBody, - name: "\"font_file_body\"", - fileName: request.FontFileBodyname != null ? $"\"{request.FontFileBodyname}\"" : string.Empty); - if (__contentFontFileBody.Headers.ContentDisposition != null) - { - __contentFontFileBody.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.FontNameBody != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.FontNameBody ?? string.Empty), - name: "\"font_name_body\""); - - } - if (request.FontFileSmall != default) - { - - var __contentFontFileSmall = new global::System.Net.Http.ByteArrayContent(request.FontFileSmall ?? global::System.Array.Empty()); - __contentFontFileSmall.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.FontFileSmallname is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.FontFileSmallname) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentFontFileSmall, - name: "\"font_file_small\"", - fileName: request.FontFileSmallname != null ? $"\"{request.FontFileSmallname}\"" : string.Empty); - if (__contentFontFileSmall.Headers.ContentDisposition != null) - { - __contentFontFileSmall.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.FontNameSmall != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.FontNameSmall ?? string.Empty), - name: "\"font_name_small\""); - - } - if (request.ReferenceAssetImages != default) - { - - for (var __iReferenceAssetImages = 0; __iReferenceAssetImages < request.ReferenceAssetImages.Count; __iReferenceAssetImages++) - { - var __contentReferenceAssetImages = new global::System.Net.Http.ByteArrayContent(request.ReferenceAssetImages[__iReferenceAssetImages]); - __contentReferenceAssetImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); - __httpRequestContent.Add( - content: __contentReferenceAssetImages, - name: "\"reference_asset_images\"", - fileName: $"\"file{__iReferenceAssetImages}.bin\""); - if (__contentReferenceAssetImages.Headers.ContentDisposition != null) - { - __contentReferenceAssetImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostLayerizeDesignV3Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostLayerizeDesignV3", - methodName: "PostLayerizeDesignV3Async", - pathTemplate: "\"/v1/ideogram-v3/layerize-design\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostLayerizeDesignV3", - methodName: "PostLayerizeDesignV3Async", - pathTemplate: "\"/v1/ideogram-v3/layerize-design\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostLayerizeDesignV3", - methodName: "PostLayerizeDesignV3Async", - pathTemplate: "\"/v1/ideogram-v3/layerize-design\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostLayerizeDesignV3Response( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostLayerizeDesignV3", - methodName: "PostLayerizeDesignV3Async", - pathTemplate: "\"/v1/ideogram-v3/layerize-design\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostLayerizeDesignV3", - methodName: "PostLayerizeDesignV3Async", - pathTemplate: "\"/v1/ideogram-v3/layerize-design\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostLayerizeDesignV3ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.LayeredImageGenerationResponseV3.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.LayeredImageGenerationResponseV3.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Layerize an existing flat graphic image with text detection and correction
- /// Processes an existing flat graphic image to detect and correct text layers without generating a new image from scratch.
- /// The uploaded image is analyzed for text content, which is then removed and returned as structured text layers with font matching, sizing, and color information.
- /// Supported image formats include JPEG, PNG, and WebP (max size 25MB).
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The flat graphic image to process for text detection and correction. The image should be in JPEG, PNG or WebP format (max size 25MB). - /// - /// - /// The flat graphic image to process for text detection and correction. The image should be in JPEG, PNG or WebP format (max size 25MB). - /// - /// - /// An optional prompt to describe the image. If not provided, a prompt will be auto-generated from the image via captioning. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// Custom font file for H1 (heading) text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_h1. - /// - /// - /// Custom font file for H1 (heading) text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_h1. - /// - /// - /// Font name from the available font library for H1 text. Ignored if font_file_h1 is provided.
- /// Example: Ubuntu-Bold.ttf - /// - /// - /// Custom font file for H2 (subheading) text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_h2. - /// - /// - /// Custom font file for H2 (subheading) text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_h2. - /// - /// - /// Font name from the available font library for H2 text. Ignored if font_file_h2 is provided. - /// - /// - /// Custom font file for body text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_body. - /// - /// - /// Custom font file for body text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_body. - /// - /// - /// Font name from the available font library for body text. Ignored if font_file_body is provided. - /// - /// - /// Custom font file for small/caption text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_small. - /// - /// - /// Custom font file for small/caption text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_small. - /// - /// - /// Font name from the available font library for small text. Ignored if font_file_small is provided. - /// - /// - /// A set of asset images (e.g., logos, icons) to use as references for detection and replacement (maximum 10 images). The images should be in JPEG, PNG or WebP format. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostLayerizeDesignV3Async( - byte[] flatGraphicImage, - string flatGraphicImagename, - string? prompt = default, - int? seed = default, - byte[]? fontFileH1 = default, - string? fontFileH1name = default, - string? fontNameH1 = default, - byte[]? fontFileH2 = default, - string? fontFileH2name = default, - string? fontNameH2 = default, - byte[]? fontFileBody = default, - string? fontFileBodyname = default, - string? fontNameBody = default, - byte[]? fontFileSmall = default, - string? fontFileSmallname = default, - string? fontNameSmall = default, - global::System.Collections.Generic.IList? referenceAssetImages = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.LayerizeDesignRequestV3 - { - FlatGraphicImage = flatGraphicImage, - FlatGraphicImagename = flatGraphicImagename, - Prompt = prompt, - Seed = seed, - FontFileH1 = fontFileH1, - FontFileH1name = fontFileH1name, - FontNameH1 = fontNameH1, - FontFileH2 = fontFileH2, - FontFileH2name = fontFileH2name, - FontNameH2 = fontNameH2, - FontFileBody = fontFileBody, - FontFileBodyname = fontFileBodyname, - FontNameBody = fontNameBody, - FontFileSmall = fontFileSmall, - FontFileSmallname = fontFileSmallname, - FontNameSmall = fontNameSmall, - ReferenceAssetImages = referenceAssetImages, - }; - - return await PostLayerizeDesignV3Async( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - - /// - /// Layerize an existing flat graphic image with text detection and correction
- /// Processes an existing flat graphic image to detect and correct text layers without generating a new image from scratch.
- /// The uploaded image is analyzed for text content, which is then removed and returned as structured text layers with font matching, sizing, and color information.
- /// Supported image formats include JPEG, PNG, and WebP (max size 25MB).
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The flat graphic image to process for text detection and correction. The image should be in JPEG, PNG or WebP format (max size 25MB). - /// - /// - /// The flat graphic image to process for text detection and correction. The image should be in JPEG, PNG or WebP format (max size 25MB). - /// - /// - /// An optional prompt to describe the image. If not provided, a prompt will be auto-generated from the image via captioning. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// Custom font file for H1 (heading) text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_h1. - /// - /// - /// Custom font file for H1 (heading) text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_h1. - /// - /// - /// Font name from the available font library for H1 text. Ignored if font_file_h1 is provided.
- /// Example: Ubuntu-Bold.ttf - /// - /// - /// Custom font file for H2 (subheading) text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_h2. - /// - /// - /// Custom font file for H2 (subheading) text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_h2. - /// - /// - /// Font name from the available font library for H2 text. Ignored if font_file_h2 is provided. - /// - /// - /// Custom font file for body text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_body. - /// - /// - /// Custom font file for body text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_body. - /// - /// - /// Font name from the available font library for body text. Ignored if font_file_body is provided. - /// - /// - /// Custom font file for small/caption text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_small. - /// - /// - /// Custom font file for small/caption text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_small. - /// - /// - /// Font name from the available font library for small text. Ignored if font_file_small is provided. - /// - /// - /// A set of asset images (e.g., logos, icons) to use as references for detection and replacement (maximum 10 images). The images should be in JPEG, PNG or WebP format. - /// - /// - /// Optional file names to use for the multipart 'reference_asset_images' file parts. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostLayerizeDesignV3Async( - global::System.IO.Stream flatGraphicImage, - string flatGraphicImagename, - string? prompt = default, - int? seed = default, - global::System.IO.Stream? fontFileH1 = default, - string? fontFileH1name = default, - string? fontNameH1 = default, - global::System.IO.Stream? fontFileH2 = default, - string? fontFileH2name = default, - string? fontNameH2 = default, - global::System.IO.Stream? fontFileBody = default, - string? fontFileBodyname = default, - string? fontNameBody = default, - global::System.IO.Stream? fontFileSmall = default, - string? fontFileSmallname = default, - string? fontNameSmall = default, - global::System.Collections.Generic.IReadOnlyList? referenceAssetImages = default, - global::System.Collections.Generic.IReadOnlyList? referenceAssetImagesFileNames = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - - flatGraphicImage = flatGraphicImage ?? throw new global::System.ArgumentNullException(nameof(flatGraphicImage)); - var request = new global::Ideogram.LayerizeDesignRequestV3 - { - FlatGraphicImage = global::System.Array.Empty(), - FlatGraphicImagename = flatGraphicImagename, - Prompt = prompt, - Seed = seed, - FontFileH1 = global::System.Array.Empty(), - FontFileH1name = fontFileH1name, - FontNameH1 = fontNameH1, - FontFileH2 = global::System.Array.Empty(), - FontFileH2name = fontFileH2name, - FontNameH2 = fontNameH2, - FontFileBody = global::System.Array.Empty(), - FontFileBodyname = fontFileBodyname, - FontNameBody = fontNameBody, - FontFileSmall = global::System.Array.Empty(), - FontFileSmallname = fontFileSmallname, - FontNameSmall = fontNameSmall, - ReferenceAssetImages = new global::System.Collections.Generic.List(), - }; - PrepareArguments( - client: HttpClient); - PreparePostLayerizeDesignV3Arguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostLayerizeDesignV3SecurityRequirements, - operationName: "PostLayerizeDesignV3Async"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/ideogram-v3/layerize-design", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - var __contentFlatGraphicImage = new global::System.Net.Http.StreamContent(flatGraphicImage); - __contentFlatGraphicImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.FlatGraphicImagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.FlatGraphicImagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentFlatGraphicImage, - name: "\"flat_graphic_image\"", - fileName: request.FlatGraphicImagename != null ? $"\"{request.FlatGraphicImagename}\"" : string.Empty); - if (__contentFlatGraphicImage.Headers.ContentDisposition != null) - { - __contentFlatGraphicImage.Headers.ContentDisposition.FileNameStar = null; - } - - if (request.Prompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (fontFileH1 != default) - { - - var __contentFontFileH1 = new global::System.Net.Http.StreamContent(fontFileH1); - __contentFontFileH1.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.FontFileH1name is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.FontFileH1name) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentFontFileH1, - name: "\"font_file_h1\"", - fileName: request.FontFileH1name != null ? $"\"{request.FontFileH1name}\"" : string.Empty); - if (__contentFontFileH1.Headers.ContentDisposition != null) - { - __contentFontFileH1.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.FontNameH1 != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.FontNameH1 ?? string.Empty), - name: "\"font_name_h1\""); - - } - if (fontFileH2 != default) - { - - var __contentFontFileH2 = new global::System.Net.Http.StreamContent(fontFileH2); - __contentFontFileH2.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.FontFileH2name is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.FontFileH2name) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentFontFileH2, - name: "\"font_file_h2\"", - fileName: request.FontFileH2name != null ? $"\"{request.FontFileH2name}\"" : string.Empty); - if (__contentFontFileH2.Headers.ContentDisposition != null) - { - __contentFontFileH2.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.FontNameH2 != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.FontNameH2 ?? string.Empty), - name: "\"font_name_h2\""); - - } - if (fontFileBody != default) - { - - var __contentFontFileBody = new global::System.Net.Http.StreamContent(fontFileBody); - __contentFontFileBody.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.FontFileBodyname is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.FontFileBodyname) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentFontFileBody, - name: "\"font_file_body\"", - fileName: request.FontFileBodyname != null ? $"\"{request.FontFileBodyname}\"" : string.Empty); - if (__contentFontFileBody.Headers.ContentDisposition != null) - { - __contentFontFileBody.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.FontNameBody != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.FontNameBody ?? string.Empty), - name: "\"font_name_body\""); - - } - if (fontFileSmall != default) - { - - var __contentFontFileSmall = new global::System.Net.Http.StreamContent(fontFileSmall); - __contentFontFileSmall.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.FontFileSmallname is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.FontFileSmallname) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentFontFileSmall, - name: "\"font_file_small\"", - fileName: request.FontFileSmallname != null ? $"\"{request.FontFileSmallname}\"" : string.Empty); - if (__contentFontFileSmall.Headers.ContentDisposition != null) - { - __contentFontFileSmall.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.FontNameSmall != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.FontNameSmall ?? string.Empty), - name: "\"font_name_small\""); - - } - if (referenceAssetImages != default) - { - - for (var __iReferenceAssetImages = 0; __iReferenceAssetImages < referenceAssetImages.Count; __iReferenceAssetImages++) - { - var __fileNameReferenceAssetImages = referenceAssetImagesFileNames != null && - __iReferenceAssetImages < referenceAssetImagesFileNames.Count && - referenceAssetImagesFileNames[__iReferenceAssetImages] != null - ? referenceAssetImagesFileNames[__iReferenceAssetImages] - : $"file{__iReferenceAssetImages}.bin"; - var __contentReferenceAssetImages = new global::System.Net.Http.StreamContent(referenceAssetImages[__iReferenceAssetImages]); - __contentReferenceAssetImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - __fileNameReferenceAssetImages is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(__fileNameReferenceAssetImages) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentReferenceAssetImages, - name: "\"reference_asset_images\"", - fileName: $"\"{__fileNameReferenceAssetImages}\""); - if (__contentReferenceAssetImages.Headers.ContentDisposition != null) - { - __contentReferenceAssetImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostLayerizeDesignV3Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostLayerizeDesignV3", - methodName: "PostLayerizeDesignV3Async", - pathTemplate: "\"/v1/ideogram-v3/layerize-design\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostLayerizeDesignV3", - methodName: "PostLayerizeDesignV3Async", - pathTemplate: "\"/v1/ideogram-v3/layerize-design\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostLayerizeDesignV3", - methodName: "PostLayerizeDesignV3Async", - pathTemplate: "\"/v1/ideogram-v3/layerize-design\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostLayerizeDesignV3Response( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostLayerizeDesignV3", - methodName: "PostLayerizeDesignV3Async", - pathTemplate: "\"/v1/ideogram-v3/layerize-design\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostLayerizeDesignV3", - methodName: "PostLayerizeDesignV3Async", - pathTemplate: "\"/v1/ideogram-v3/layerize-design\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostLayerizeDesignV3ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::Ideogram.LayeredImageGenerationResponseV3.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - return - await global::Ideogram.LayeredImageGenerationResponseV3.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Layerize an existing flat graphic image with text detection and correction
- /// Processes an existing flat graphic image to detect and correct text layers without generating a new image from scratch.
- /// The uploaded image is analyzed for text content, which is then removed and returned as structured text layers with font matching, sizing, and color information.
- /// Supported image formats include JPEG, PNG, and WebP (max size 25MB).
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The flat graphic image to process for text detection and correction. The image should be in JPEG, PNG or WebP format (max size 25MB). - /// - /// - /// The flat graphic image to process for text detection and correction. The image should be in JPEG, PNG or WebP format (max size 25MB). - /// - /// - /// An optional prompt to describe the image. If not provided, a prompt will be auto-generated from the image via captioning. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// Custom font file for H1 (heading) text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_h1. - /// - /// - /// Custom font file for H1 (heading) text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_h1. - /// - /// - /// Font name from the available font library for H1 text. Ignored if font_file_h1 is provided.
- /// Example: Ubuntu-Bold.ttf - /// - /// - /// Custom font file for H2 (subheading) text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_h2. - /// - /// - /// Custom font file for H2 (subheading) text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_h2. - /// - /// - /// Font name from the available font library for H2 text. Ignored if font_file_h2 is provided. - /// - /// - /// Custom font file for body text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_body. - /// - /// - /// Custom font file for body text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_body. - /// - /// - /// Font name from the available font library for body text. Ignored if font_file_body is provided. - /// - /// - /// Custom font file for small/caption text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_small. - /// - /// - /// Custom font file for small/caption text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_small. - /// - /// - /// Font name from the available font library for small text. Ignored if font_file_small is provided. - /// - /// - /// A set of asset images (e.g., logos, icons) to use as references for detection and replacement (maximum 10 images). The images should be in JPEG, PNG or WebP format. - /// - /// - /// Optional file names to use for the multipart 'reference_asset_images' file parts. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostLayerizeDesignV3AsResponseAsync( - global::System.IO.Stream flatGraphicImage, - string flatGraphicImagename, - string? prompt = default, - int? seed = default, - global::System.IO.Stream? fontFileH1 = default, - string? fontFileH1name = default, - string? fontNameH1 = default, - global::System.IO.Stream? fontFileH2 = default, - string? fontFileH2name = default, - string? fontNameH2 = default, - global::System.IO.Stream? fontFileBody = default, - string? fontFileBodyname = default, - string? fontNameBody = default, - global::System.IO.Stream? fontFileSmall = default, - string? fontFileSmallname = default, - string? fontNameSmall = default, - global::System.Collections.Generic.IReadOnlyList? referenceAssetImages = default, - global::System.Collections.Generic.IReadOnlyList? referenceAssetImagesFileNames = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - - flatGraphicImage = flatGraphicImage ?? throw new global::System.ArgumentNullException(nameof(flatGraphicImage)); - var request = new global::Ideogram.LayerizeDesignRequestV3 - { - FlatGraphicImage = global::System.Array.Empty(), - FlatGraphicImagename = flatGraphicImagename, - Prompt = prompt, - Seed = seed, - FontFileH1 = global::System.Array.Empty(), - FontFileH1name = fontFileH1name, - FontNameH1 = fontNameH1, - FontFileH2 = global::System.Array.Empty(), - FontFileH2name = fontFileH2name, - FontNameH2 = fontNameH2, - FontFileBody = global::System.Array.Empty(), - FontFileBodyname = fontFileBodyname, - FontNameBody = fontNameBody, - FontFileSmall = global::System.Array.Empty(), - FontFileSmallname = fontFileSmallname, - FontNameSmall = fontNameSmall, - ReferenceAssetImages = new global::System.Collections.Generic.List(), - }; - PrepareArguments( - client: HttpClient); - PreparePostLayerizeDesignV3Arguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostLayerizeDesignV3SecurityRequirements, - operationName: "PostLayerizeDesignV3Async"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/ideogram-v3/layerize-design", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - var __contentFlatGraphicImage = new global::System.Net.Http.StreamContent(flatGraphicImage); - __contentFlatGraphicImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.FlatGraphicImagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.FlatGraphicImagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentFlatGraphicImage, - name: "\"flat_graphic_image\"", - fileName: request.FlatGraphicImagename != null ? $"\"{request.FlatGraphicImagename}\"" : string.Empty); - if (__contentFlatGraphicImage.Headers.ContentDisposition != null) - { - __contentFlatGraphicImage.Headers.ContentDisposition.FileNameStar = null; - } - - if (request.Prompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (fontFileH1 != default) - { - - var __contentFontFileH1 = new global::System.Net.Http.StreamContent(fontFileH1); - __contentFontFileH1.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.FontFileH1name is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.FontFileH1name) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentFontFileH1, - name: "\"font_file_h1\"", - fileName: request.FontFileH1name != null ? $"\"{request.FontFileH1name}\"" : string.Empty); - if (__contentFontFileH1.Headers.ContentDisposition != null) - { - __contentFontFileH1.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.FontNameH1 != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.FontNameH1 ?? string.Empty), - name: "\"font_name_h1\""); - - } - if (fontFileH2 != default) - { - - var __contentFontFileH2 = new global::System.Net.Http.StreamContent(fontFileH2); - __contentFontFileH2.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.FontFileH2name is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.FontFileH2name) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentFontFileH2, - name: "\"font_file_h2\"", - fileName: request.FontFileH2name != null ? $"\"{request.FontFileH2name}\"" : string.Empty); - if (__contentFontFileH2.Headers.ContentDisposition != null) - { - __contentFontFileH2.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.FontNameH2 != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.FontNameH2 ?? string.Empty), - name: "\"font_name_h2\""); - - } - if (fontFileBody != default) - { - - var __contentFontFileBody = new global::System.Net.Http.StreamContent(fontFileBody); - __contentFontFileBody.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.FontFileBodyname is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.FontFileBodyname) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentFontFileBody, - name: "\"font_file_body\"", - fileName: request.FontFileBodyname != null ? $"\"{request.FontFileBodyname}\"" : string.Empty); - if (__contentFontFileBody.Headers.ContentDisposition != null) - { - __contentFontFileBody.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.FontNameBody != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.FontNameBody ?? string.Empty), - name: "\"font_name_body\""); - - } - if (fontFileSmall != default) - { - - var __contentFontFileSmall = new global::System.Net.Http.StreamContent(fontFileSmall); - __contentFontFileSmall.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.FontFileSmallname is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.FontFileSmallname) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentFontFileSmall, - name: "\"font_file_small\"", - fileName: request.FontFileSmallname != null ? $"\"{request.FontFileSmallname}\"" : string.Empty); - if (__contentFontFileSmall.Headers.ContentDisposition != null) - { - __contentFontFileSmall.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.FontNameSmall != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.FontNameSmall ?? string.Empty), - name: "\"font_name_small\""); - - } - if (referenceAssetImages != default) - { - - for (var __iReferenceAssetImages = 0; __iReferenceAssetImages < referenceAssetImages.Count; __iReferenceAssetImages++) - { - var __fileNameReferenceAssetImages = referenceAssetImagesFileNames != null && - __iReferenceAssetImages < referenceAssetImagesFileNames.Count && - referenceAssetImagesFileNames[__iReferenceAssetImages] != null - ? referenceAssetImagesFileNames[__iReferenceAssetImages] - : $"file{__iReferenceAssetImages}.bin"; - var __contentReferenceAssetImages = new global::System.Net.Http.StreamContent(referenceAssetImages[__iReferenceAssetImages]); - __contentReferenceAssetImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - __fileNameReferenceAssetImages is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(__fileNameReferenceAssetImages) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentReferenceAssetImages, - name: "\"reference_asset_images\"", - fileName: $"\"{__fileNameReferenceAssetImages}\""); - if (__contentReferenceAssetImages.Headers.ContentDisposition != null) - { - __contentReferenceAssetImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostLayerizeDesignV3Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostLayerizeDesignV3", - methodName: "PostLayerizeDesignV3Async", - pathTemplate: "\"/v1/ideogram-v3/layerize-design\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostLayerizeDesignV3", - methodName: "PostLayerizeDesignV3Async", - pathTemplate: "\"/v1/ideogram-v3/layerize-design\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostLayerizeDesignV3", - methodName: "PostLayerizeDesignV3Async", - pathTemplate: "\"/v1/ideogram-v3/layerize-design\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostLayerizeDesignV3Response( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostLayerizeDesignV3", - methodName: "PostLayerizeDesignV3Async", - pathTemplate: "\"/v1/ideogram-v3/layerize-design\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostLayerizeDesignV3", - methodName: "PostLayerizeDesignV3Async", - pathTemplate: "\"/v1/ideogram-v3/layerize-design\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostLayerizeDesignV3ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.LayeredImageGenerationResponseV3.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.LayeredImageGenerationResponseV3.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostLayerizeLogos.g.cs b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostLayerizeLogos.g.cs deleted file mode 100644 index 92336dff..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostLayerizeLogos.g.cs +++ /dev/null @@ -1,1668 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class GenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostLayerizeLogosSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostLayerizeLogosSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostLayerizeLogosSecurityRequirement0, - }; - partial void PreparePostLayerizeLogosArguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.LayerizeLogosRequest request); - partial void PreparePostLayerizeLogosRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.LayerizeLogosRequest request); - partial void ProcessPostLayerizeLogosResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostLayerizeLogosResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Detect and remove reference logos from an image
- /// Detects caller-supplied reference logos in a flat design image, inpaints
- /// them out, and returns the cleaned image together with the matched
- /// bounding boxes (each tagged with the matching reference's `REF_<n>`). - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostLayerizeLogosAsync( - - global::Ideogram.LayerizeLogosRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostLayerizeLogosAsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Detect and remove reference logos from an image
- /// Detects caller-supplied reference logos in a flat design image, inpaints
- /// them out, and returns the cleaned image together with the matched
- /// bounding boxes (each tagged with the matching reference's `REF_<n>`). - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostLayerizeLogosAsResponseAsync( - - global::Ideogram.LayerizeLogosRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostLayerizeLogosArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostLayerizeLogosSecurityRequirements, - operationName: "PostLayerizeLogosAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/layerize-logos", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - var __contentDesignImage = new global::System.Net.Http.ByteArrayContent(request.DesignImage ?? global::System.Array.Empty()); - __contentDesignImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.DesignImagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.DesignImagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentDesignImage, - name: "\"design_image\"", - fileName: request.DesignImagename != null ? $"\"{request.DesignImagename}\"" : string.Empty); - if (__contentDesignImage.Headers.ContentDisposition != null) - { - __contentDesignImage.Headers.ContentDisposition.FileNameStar = null; - } - - for (var __iReferenceImages = 0; __iReferenceImages < request.ReferenceImages.Count; __iReferenceImages++) - { - var __contentReferenceImages = new global::System.Net.Http.ByteArrayContent(request.ReferenceImages[__iReferenceImages]); - __contentReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); - __httpRequestContent.Add( - content: __contentReferenceImages, - name: "\"reference_images\"", - fileName: $"\"file{__iReferenceImages}.bin\""); - if (__contentReferenceImages.Headers.ContentDisposition != null) - { - __contentReferenceImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostLayerizeLogosRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostLayerizeLogos", - methodName: "PostLayerizeLogosAsync", - pathTemplate: "\"/v1/layerize-logos\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostLayerizeLogos", - methodName: "PostLayerizeLogosAsync", - pathTemplate: "\"/v1/layerize-logos\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostLayerizeLogos", - methodName: "PostLayerizeLogosAsync", - pathTemplate: "\"/v1/layerize-logos\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostLayerizeLogosResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostLayerizeLogos", - methodName: "PostLayerizeLogosAsync", - pathTemplate: "\"/v1/layerize-logos\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostLayerizeLogos", - methodName: "PostLayerizeLogosAsync", - pathTemplate: "\"/v1/layerize-logos\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostLayerizeLogosResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.LayerizeLogosResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.LayerizeLogosResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Detect and remove reference logos from an image
- /// Detects caller-supplied reference logos in a flat design image, inpaints
- /// them out, and returns the cleaned image together with the matched
- /// bounding boxes (each tagged with the matching reference's `REF_<n>`). - ///
- /// - /// The flat design image to analyze. The image should be in JPEG, PNG, or WebP format (max size 25MB). - /// - /// - /// The flat design image to analyze. The image should be in JPEG, PNG, or WebP format (max size 25MB). - /// - /// - /// Reference image assets to match against logos and image elements detected in
- /// `design_image`. Each entry is assigned a `ref_id` of `REF_0`, `REF_1`, ...
- /// in the order it appears in the request (maximum 10 images). The images
- /// should be in JPEG, PNG, or WebP format. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostLayerizeLogosAsync( - byte[] designImage, - string designImagename, - global::System.Collections.Generic.IList referenceImages, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.LayerizeLogosRequest - { - DesignImage = designImage, - DesignImagename = designImagename, - ReferenceImages = referenceImages, - }; - - return await PostLayerizeLogosAsync( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - - /// - /// Detect and remove reference logos from an image
- /// Detects caller-supplied reference logos in a flat design image, inpaints
- /// them out, and returns the cleaned image together with the matched
- /// bounding boxes (each tagged with the matching reference's `REF_<n>`). - ///
- /// - /// The flat design image to analyze. The image should be in JPEG, PNG, or WebP format (max size 25MB). - /// - /// - /// The flat design image to analyze. The image should be in JPEG, PNG, or WebP format (max size 25MB). - /// - /// - /// Reference image assets to match against logos and image elements detected in
- /// `design_image`. Each entry is assigned a `ref_id` of `REF_0`, `REF_1`, ...
- /// in the order it appears in the request (maximum 10 images). The images
- /// should be in JPEG, PNG, or WebP format. - /// - /// - /// Optional file names to use for the multipart 'reference_images' file parts. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostLayerizeLogosAsync( - global::System.IO.Stream designImage, - string designImagename, - global::System.Collections.Generic.IReadOnlyList referenceImages, - global::System.Collections.Generic.IReadOnlyList? referenceImagesFileNames = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - - designImage = designImage ?? throw new global::System.ArgumentNullException(nameof(designImage)); - referenceImages = referenceImages ?? throw new global::System.ArgumentNullException(nameof(referenceImages)); - var request = new global::Ideogram.LayerizeLogosRequest - { - DesignImage = global::System.Array.Empty(), - DesignImagename = designImagename, - ReferenceImages = new global::System.Collections.Generic.List(), - }; - PrepareArguments( - client: HttpClient); - PreparePostLayerizeLogosArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostLayerizeLogosSecurityRequirements, - operationName: "PostLayerizeLogosAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/layerize-logos", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - var __contentDesignImage = new global::System.Net.Http.StreamContent(designImage); - __contentDesignImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.DesignImagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.DesignImagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentDesignImage, - name: "\"design_image\"", - fileName: request.DesignImagename != null ? $"\"{request.DesignImagename}\"" : string.Empty); - if (__contentDesignImage.Headers.ContentDisposition != null) - { - __contentDesignImage.Headers.ContentDisposition.FileNameStar = null; - } - - for (var __iReferenceImages = 0; __iReferenceImages < referenceImages.Count; __iReferenceImages++) - { - var __fileNameReferenceImages = referenceImagesFileNames != null && - __iReferenceImages < referenceImagesFileNames.Count && - referenceImagesFileNames[__iReferenceImages] != null - ? referenceImagesFileNames[__iReferenceImages] - : $"file{__iReferenceImages}.bin"; - var __contentReferenceImages = new global::System.Net.Http.StreamContent(referenceImages[__iReferenceImages]); - __contentReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - __fileNameReferenceImages is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(__fileNameReferenceImages) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentReferenceImages, - name: "\"reference_images\"", - fileName: $"\"{__fileNameReferenceImages}\""); - if (__contentReferenceImages.Headers.ContentDisposition != null) - { - __contentReferenceImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostLayerizeLogosRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostLayerizeLogos", - methodName: "PostLayerizeLogosAsync", - pathTemplate: "\"/v1/layerize-logos\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostLayerizeLogos", - methodName: "PostLayerizeLogosAsync", - pathTemplate: "\"/v1/layerize-logos\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostLayerizeLogos", - methodName: "PostLayerizeLogosAsync", - pathTemplate: "\"/v1/layerize-logos\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostLayerizeLogosResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostLayerizeLogos", - methodName: "PostLayerizeLogosAsync", - pathTemplate: "\"/v1/layerize-logos\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostLayerizeLogos", - methodName: "PostLayerizeLogosAsync", - pathTemplate: "\"/v1/layerize-logos\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostLayerizeLogosResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::Ideogram.LayerizeLogosResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - return - await global::Ideogram.LayerizeLogosResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Detect and remove reference logos from an image
- /// Detects caller-supplied reference logos in a flat design image, inpaints
- /// them out, and returns the cleaned image together with the matched
- /// bounding boxes (each tagged with the matching reference's `REF_<n>`). - ///
- /// - /// The flat design image to analyze. The image should be in JPEG, PNG, or WebP format (max size 25MB). - /// - /// - /// The flat design image to analyze. The image should be in JPEG, PNG, or WebP format (max size 25MB). - /// - /// - /// Reference image assets to match against logos and image elements detected in
- /// `design_image`. Each entry is assigned a `ref_id` of `REF_0`, `REF_1`, ...
- /// in the order it appears in the request (maximum 10 images). The images
- /// should be in JPEG, PNG, or WebP format. - /// - /// - /// Optional file names to use for the multipart 'reference_images' file parts. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostLayerizeLogosAsResponseAsync( - global::System.IO.Stream designImage, - string designImagename, - global::System.Collections.Generic.IReadOnlyList referenceImages, - global::System.Collections.Generic.IReadOnlyList? referenceImagesFileNames = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - - designImage = designImage ?? throw new global::System.ArgumentNullException(nameof(designImage)); - referenceImages = referenceImages ?? throw new global::System.ArgumentNullException(nameof(referenceImages)); - var request = new global::Ideogram.LayerizeLogosRequest - { - DesignImage = global::System.Array.Empty(), - DesignImagename = designImagename, - ReferenceImages = new global::System.Collections.Generic.List(), - }; - PrepareArguments( - client: HttpClient); - PreparePostLayerizeLogosArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostLayerizeLogosSecurityRequirements, - operationName: "PostLayerizeLogosAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/layerize-logos", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - var __contentDesignImage = new global::System.Net.Http.StreamContent(designImage); - __contentDesignImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.DesignImagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.DesignImagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentDesignImage, - name: "\"design_image\"", - fileName: request.DesignImagename != null ? $"\"{request.DesignImagename}\"" : string.Empty); - if (__contentDesignImage.Headers.ContentDisposition != null) - { - __contentDesignImage.Headers.ContentDisposition.FileNameStar = null; - } - - for (var __iReferenceImages = 0; __iReferenceImages < referenceImages.Count; __iReferenceImages++) - { - var __fileNameReferenceImages = referenceImagesFileNames != null && - __iReferenceImages < referenceImagesFileNames.Count && - referenceImagesFileNames[__iReferenceImages] != null - ? referenceImagesFileNames[__iReferenceImages] - : $"file{__iReferenceImages}.bin"; - var __contentReferenceImages = new global::System.Net.Http.StreamContent(referenceImages[__iReferenceImages]); - __contentReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - __fileNameReferenceImages is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(__fileNameReferenceImages) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentReferenceImages, - name: "\"reference_images\"", - fileName: $"\"{__fileNameReferenceImages}\""); - if (__contentReferenceImages.Headers.ContentDisposition != null) - { - __contentReferenceImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostLayerizeLogosRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostLayerizeLogos", - methodName: "PostLayerizeLogosAsync", - pathTemplate: "\"/v1/layerize-logos\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostLayerizeLogos", - methodName: "PostLayerizeLogosAsync", - pathTemplate: "\"/v1/layerize-logos\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostLayerizeLogos", - methodName: "PostLayerizeLogosAsync", - pathTemplate: "\"/v1/layerize-logos\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostLayerizeLogosResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostLayerizeLogos", - methodName: "PostLayerizeLogosAsync", - pathTemplate: "\"/v1/layerize-logos\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostLayerizeLogos", - methodName: "PostLayerizeLogosAsync", - pathTemplate: "\"/v1/layerize-logos\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostLayerizeLogosResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.LayerizeLogosResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.LayerizeLogosResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostLayerizeTextV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostLayerizeTextV3.g.cs deleted file mode 100644 index e50cf881..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostLayerizeTextV3.g.cs +++ /dev/null @@ -1,1854 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class GenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostLayerizeTextV3SecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostLayerizeTextV3SecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostLayerizeTextV3SecurityRequirement0, - }; - partial void PreparePostLayerizeTextV3Arguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.LayerizeTextRequest request); - partial void PreparePostLayerizeTextV3Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.LayerizeTextRequest request); - partial void ProcessPostLayerizeTextV3Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostLayerizeTextV3ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Layerize Text
- /// Analyzes an image to detect text regions, then returns each detected text block with its position, content, font information, and styling.
- /// The response includes a text-erased base image (background with all text removed) and a flat list of detected text blocks.
- /// Supported image formats include JPEG, PNG, and WebP (max size 25MB).
- /// Image links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostLayerizeTextV3Async( - - global::Ideogram.LayerizeTextRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostLayerizeTextV3AsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Layerize Text
- /// Analyzes an image to detect text regions, then returns each detected text block with its position, content, font information, and styling.
- /// The response includes a text-erased base image (background with all text removed) and a flat list of detected text blocks.
- /// Supported image formats include JPEG, PNG, and WebP (max size 25MB).
- /// Image links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostLayerizeTextV3AsResponseAsync( - - global::Ideogram.LayerizeTextRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostLayerizeTextV3Arguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostLayerizeTextV3SecurityRequirements, - operationName: "PostLayerizeTextV3Async"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/ideogram-v3/layerize-text", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - if (request.Prompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.FontCandidateFiles != default) - { - - for (var __iFontCandidateFiles = 0; __iFontCandidateFiles < request.FontCandidateFiles.Count; __iFontCandidateFiles++) - { - var __contentFontCandidateFiles = new global::System.Net.Http.ByteArrayContent(request.FontCandidateFiles[__iFontCandidateFiles]); - __contentFontCandidateFiles.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); - __httpRequestContent.Add( - content: __contentFontCandidateFiles, - name: "\"font_candidate_files\"", - fileName: $"\"file{__iFontCandidateFiles}.bin\""); - if (__contentFontCandidateFiles.Headers.ContentDisposition != null) - { - __contentFontCandidateFiles.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostLayerizeTextV3Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostLayerizeTextV3", - methodName: "PostLayerizeTextV3Async", - pathTemplate: "\"/v1/ideogram-v3/layerize-text\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostLayerizeTextV3", - methodName: "PostLayerizeTextV3Async", - pathTemplate: "\"/v1/ideogram-v3/layerize-text\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostLayerizeTextV3", - methodName: "PostLayerizeTextV3Async", - pathTemplate: "\"/v1/ideogram-v3/layerize-text\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostLayerizeTextV3Response( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostLayerizeTextV3", - methodName: "PostLayerizeTextV3Async", - pathTemplate: "\"/v1/ideogram-v3/layerize-text\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostLayerizeTextV3", - methodName: "PostLayerizeTextV3Async", - pathTemplate: "\"/v1/ideogram-v3/layerize-text\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostLayerizeTextV3ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.LayerizeTextResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.LayerizeTextResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Layerize Text
- /// Analyzes an image to detect text regions, then returns each detected text block with its position, content, font information, and styling.
- /// The response includes a text-erased base image (background with all text removed) and a flat list of detected text blocks.
- /// Supported image formats include JPEG, PNG, and WebP (max size 25MB).
- /// Image links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The image to analyze for text detection. The image should be in JPEG, PNG, or WebP format (max size 25MB). - /// - /// - /// The image to analyze for text detection. The image should be in JPEG, PNG, or WebP format (max size 25MB). - /// - /// - /// An optional text description of the image. If not provided, a description will be auto-generated from the image. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// Candidate font files to make available for text style matching. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB each, maximum 5 files). - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostLayerizeTextV3Async( - byte[] image, - string imagename, - string? prompt = default, - int? seed = default, - global::System.Collections.Generic.IList? fontCandidateFiles = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.LayerizeTextRequest - { - Image = image, - Imagename = imagename, - Prompt = prompt, - Seed = seed, - FontCandidateFiles = fontCandidateFiles, - }; - - return await PostLayerizeTextV3Async( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - - /// - /// Layerize Text
- /// Analyzes an image to detect text regions, then returns each detected text block with its position, content, font information, and styling.
- /// The response includes a text-erased base image (background with all text removed) and a flat list of detected text blocks.
- /// Supported image formats include JPEG, PNG, and WebP (max size 25MB).
- /// Image links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The image to analyze for text detection. The image should be in JPEG, PNG, or WebP format (max size 25MB). - /// - /// - /// The image to analyze for text detection. The image should be in JPEG, PNG, or WebP format (max size 25MB). - /// - /// - /// An optional text description of the image. If not provided, a description will be auto-generated from the image. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// Candidate font files to make available for text style matching. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB each, maximum 5 files). - /// - /// - /// Optional file names to use for the multipart 'font_candidate_files' file parts. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostLayerizeTextV3Async( - global::System.IO.Stream image, - string imagename, - string? prompt = default, - int? seed = default, - global::System.Collections.Generic.IReadOnlyList? fontCandidateFiles = default, - global::System.Collections.Generic.IReadOnlyList? fontCandidateFilesFileNames = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - - image = image ?? throw new global::System.ArgumentNullException(nameof(image)); - var request = new global::Ideogram.LayerizeTextRequest - { - Image = global::System.Array.Empty(), - Imagename = imagename, - Prompt = prompt, - Seed = seed, - FontCandidateFiles = new global::System.Collections.Generic.List(), - }; - PrepareArguments( - client: HttpClient); - PreparePostLayerizeTextV3Arguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostLayerizeTextV3SecurityRequirements, - operationName: "PostLayerizeTextV3Async"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/ideogram-v3/layerize-text", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - var __contentImage = new global::System.Net.Http.StreamContent(image); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - if (request.Prompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (fontCandidateFiles != default) - { - - for (var __iFontCandidateFiles = 0; __iFontCandidateFiles < fontCandidateFiles.Count; __iFontCandidateFiles++) - { - var __fileNameFontCandidateFiles = fontCandidateFilesFileNames != null && - __iFontCandidateFiles < fontCandidateFilesFileNames.Count && - fontCandidateFilesFileNames[__iFontCandidateFiles] != null - ? fontCandidateFilesFileNames[__iFontCandidateFiles] - : $"file{__iFontCandidateFiles}.bin"; - var __contentFontCandidateFiles = new global::System.Net.Http.StreamContent(fontCandidateFiles[__iFontCandidateFiles]); - __contentFontCandidateFiles.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - __fileNameFontCandidateFiles is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(__fileNameFontCandidateFiles) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentFontCandidateFiles, - name: "\"font_candidate_files\"", - fileName: $"\"{__fileNameFontCandidateFiles}\""); - if (__contentFontCandidateFiles.Headers.ContentDisposition != null) - { - __contentFontCandidateFiles.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostLayerizeTextV3Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostLayerizeTextV3", - methodName: "PostLayerizeTextV3Async", - pathTemplate: "\"/v1/ideogram-v3/layerize-text\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostLayerizeTextV3", - methodName: "PostLayerizeTextV3Async", - pathTemplate: "\"/v1/ideogram-v3/layerize-text\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostLayerizeTextV3", - methodName: "PostLayerizeTextV3Async", - pathTemplate: "\"/v1/ideogram-v3/layerize-text\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostLayerizeTextV3Response( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostLayerizeTextV3", - methodName: "PostLayerizeTextV3Async", - pathTemplate: "\"/v1/ideogram-v3/layerize-text\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostLayerizeTextV3", - methodName: "PostLayerizeTextV3Async", - pathTemplate: "\"/v1/ideogram-v3/layerize-text\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostLayerizeTextV3ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::Ideogram.LayerizeTextResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - return - await global::Ideogram.LayerizeTextResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Layerize Text
- /// Analyzes an image to detect text regions, then returns each detected text block with its position, content, font information, and styling.
- /// The response includes a text-erased base image (background with all text removed) and a flat list of detected text blocks.
- /// Supported image formats include JPEG, PNG, and WebP (max size 25MB).
- /// Image links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The image to analyze for text detection. The image should be in JPEG, PNG, or WebP format (max size 25MB). - /// - /// - /// The image to analyze for text detection. The image should be in JPEG, PNG, or WebP format (max size 25MB). - /// - /// - /// An optional text description of the image. If not provided, a description will be auto-generated from the image. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// Candidate font files to make available for text style matching. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB each, maximum 5 files). - /// - /// - /// Optional file names to use for the multipart 'font_candidate_files' file parts. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostLayerizeTextV3AsResponseAsync( - global::System.IO.Stream image, - string imagename, - string? prompt = default, - int? seed = default, - global::System.Collections.Generic.IReadOnlyList? fontCandidateFiles = default, - global::System.Collections.Generic.IReadOnlyList? fontCandidateFilesFileNames = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - - image = image ?? throw new global::System.ArgumentNullException(nameof(image)); - var request = new global::Ideogram.LayerizeTextRequest - { - Image = global::System.Array.Empty(), - Imagename = imagename, - Prompt = prompt, - Seed = seed, - FontCandidateFiles = new global::System.Collections.Generic.List(), - }; - PrepareArguments( - client: HttpClient); - PreparePostLayerizeTextV3Arguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostLayerizeTextV3SecurityRequirements, - operationName: "PostLayerizeTextV3Async"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/ideogram-v3/layerize-text", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - var __contentImage = new global::System.Net.Http.StreamContent(image); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - if (request.Prompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (fontCandidateFiles != default) - { - - for (var __iFontCandidateFiles = 0; __iFontCandidateFiles < fontCandidateFiles.Count; __iFontCandidateFiles++) - { - var __fileNameFontCandidateFiles = fontCandidateFilesFileNames != null && - __iFontCandidateFiles < fontCandidateFilesFileNames.Count && - fontCandidateFilesFileNames[__iFontCandidateFiles] != null - ? fontCandidateFilesFileNames[__iFontCandidateFiles] - : $"file{__iFontCandidateFiles}.bin"; - var __contentFontCandidateFiles = new global::System.Net.Http.StreamContent(fontCandidateFiles[__iFontCandidateFiles]); - __contentFontCandidateFiles.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - __fileNameFontCandidateFiles is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(__fileNameFontCandidateFiles) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentFontCandidateFiles, - name: "\"font_candidate_files\"", - fileName: $"\"{__fileNameFontCandidateFiles}\""); - if (__contentFontCandidateFiles.Headers.ContentDisposition != null) - { - __contentFontCandidateFiles.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostLayerizeTextV3Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostLayerizeTextV3", - methodName: "PostLayerizeTextV3Async", - pathTemplate: "\"/v1/ideogram-v3/layerize-text\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostLayerizeTextV3", - methodName: "PostLayerizeTextV3Async", - pathTemplate: "\"/v1/ideogram-v3/layerize-text\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostLayerizeTextV3", - methodName: "PostLayerizeTextV3Async", - pathTemplate: "\"/v1/ideogram-v3/layerize-text\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostLayerizeTextV3Response( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostLayerizeTextV3", - methodName: "PostLayerizeTextV3Async", - pathTemplate: "\"/v1/ideogram-v3/layerize-text\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostLayerizeTextV3", - methodName: "PostLayerizeTextV3Async", - pathTemplate: "\"/v1/ideogram-v3/layerize-text\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostLayerizeTextV3ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.LayerizeTextResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.LayerizeTextResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostReframeImage.g.cs b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostReframeImage.g.cs deleted file mode 100644 index 27962f3c..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostReframeImage.g.cs +++ /dev/null @@ -1,1922 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class GenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostReframeImageSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostReframeImageSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostReframeImageSecurityRequirement0, - }; - partial void PreparePostReframeImageArguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.ReframeImageRequest request); - partial void PreparePostReframeImageRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.ReframeImageRequest request); - partial void ProcessPostReframeImageResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostReframeImageResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Reframe (legacy)
- /// Reframe a square image to a chosen resolution. The supported image formats include JPEG, PNG, and WebP.
- /// Image links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostReframeImageAsync( - - global::Ideogram.ReframeImageRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostReframeImageAsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Reframe (legacy)
- /// Reframe a square image to a chosen resolution. The supported image formats include JPEG, PNG, and WebP.
- /// Image links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostReframeImageAsResponseAsync( - - global::Ideogram.ReframeImageRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostReframeImageArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostReframeImageSecurityRequirements, - operationName: "PostReframeImageAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/reframe", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - var __contentImageFile = new global::System.Net.Http.ByteArrayContent(request.ImageFile ?? global::System.Array.Empty()); - __contentImageFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.ImageFilename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.ImageFilename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImageFile, - name: "\"image_file\"", - fileName: request.ImageFilename != null ? $"\"{request.ImageFilename}\"" : string.Empty); - if (__contentImageFile.Headers.ContentDisposition != null) - { - __contentImageFile.Headers.ContentDisposition.FileNameStar = null; - } - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Resolution.ToValueString()), - name: "\"resolution\""); - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Model.ToValueString()), - name: "\"model\""); - - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.StyleType != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.StyleType).HasValue ? (request.StyleType).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"style_type\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostReframeImageRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostReframeImage", - methodName: "PostReframeImageAsync", - pathTemplate: "\"/reframe\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostReframeImage", - methodName: "PostReframeImageAsync", - pathTemplate: "\"/reframe\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostReframeImage", - methodName: "PostReframeImageAsync", - pathTemplate: "\"/reframe\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostReframeImageResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostReframeImage", - methodName: "PostReframeImageAsync", - pathTemplate: "\"/reframe\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostReframeImage", - methodName: "PostReframeImageAsync", - pathTemplate: "\"/reframe\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt or Image failed the safety checks. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostReframeImageResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.GenerateImageResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.GenerateImageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Reframe (legacy)
- /// Reframe a square image to a chosen resolution. The supported image formats include JPEG, PNG, and WebP.
- /// Image links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The image being reframed (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The image being reframed (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// (For model_version for 2.0 only, cannot be used in conjunction with aspect_ratio) The resolution to use for image generation, represented in width x height. If not specified, defaults to using aspect_ratio.
- /// Example: RESOLUTION_1024_1024 - /// - /// - /// The model used to generate an image or edit one. /generate and /remix supports all model types, however, /edit is only supported for V_2 and V_2_TURBO.
- /// Default Value: V_2
- /// Example: V_2_TURBO - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The style type to generate with; this is only applicable for models V_2 and above and should not be specified for model versions V_1.
- /// Example: REALISTIC - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostReframeImageAsync( - byte[] imageFile, - string imageFilename, - global::Ideogram.Resolution resolution, - global::Ideogram.ModelEnum model = global::Ideogram.ModelEnum.V2, - int? numImages = default, - int? seed = default, - global::Ideogram.StyleType? styleType = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.ReframeImageRequest - { - ImageFile = imageFile, - ImageFilename = imageFilename, - Resolution = resolution, - Model = model, - NumImages = numImages, - Seed = seed, - StyleType = styleType, - }; - - return await PostReframeImageAsync( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - - /// - /// Reframe (legacy)
- /// Reframe a square image to a chosen resolution. The supported image formats include JPEG, PNG, and WebP.
- /// Image links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The image being reframed (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The image being reframed (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// (For model_version for 2.0 only, cannot be used in conjunction with aspect_ratio) The resolution to use for image generation, represented in width x height. If not specified, defaults to using aspect_ratio.
- /// Example: RESOLUTION_1024_1024 - /// - /// - /// The model used to generate an image or edit one. /generate and /remix supports all model types, however, /edit is only supported for V_2 and V_2_TURBO.
- /// Default Value: V_2
- /// Example: V_2_TURBO - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The style type to generate with; this is only applicable for models V_2 and above and should not be specified for model versions V_1.
- /// Example: REALISTIC - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostReframeImageAsync( - global::System.IO.Stream imageFile, - string imageFilename, - global::Ideogram.Resolution resolution, - global::Ideogram.ModelEnum model = global::Ideogram.ModelEnum.V2, - int? numImages = default, - int? seed = default, - global::Ideogram.StyleType? styleType = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - - imageFile = imageFile ?? throw new global::System.ArgumentNullException(nameof(imageFile)); - var request = new global::Ideogram.ReframeImageRequest - { - ImageFile = global::System.Array.Empty(), - ImageFilename = imageFilename, - Resolution = resolution, - Model = model, - NumImages = numImages, - Seed = seed, - StyleType = styleType, - }; - PrepareArguments( - client: HttpClient); - PreparePostReframeImageArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostReframeImageSecurityRequirements, - operationName: "PostReframeImageAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/reframe", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - var __contentImageFile = new global::System.Net.Http.StreamContent(imageFile); - __contentImageFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.ImageFilename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.ImageFilename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImageFile, - name: "\"image_file\"", - fileName: request.ImageFilename != null ? $"\"{request.ImageFilename}\"" : string.Empty); - if (__contentImageFile.Headers.ContentDisposition != null) - { - __contentImageFile.Headers.ContentDisposition.FileNameStar = null; - } - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Resolution.ToValueString()), - name: "\"resolution\""); - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Model.ToValueString()), - name: "\"model\""); - - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.StyleType != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.StyleType).HasValue ? (request.StyleType).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"style_type\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostReframeImageRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostReframeImage", - methodName: "PostReframeImageAsync", - pathTemplate: "\"/reframe\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostReframeImage", - methodName: "PostReframeImageAsync", - pathTemplate: "\"/reframe\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostReframeImage", - methodName: "PostReframeImageAsync", - pathTemplate: "\"/reframe\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostReframeImageResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostReframeImage", - methodName: "PostReframeImageAsync", - pathTemplate: "\"/reframe\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostReframeImage", - methodName: "PostReframeImageAsync", - pathTemplate: "\"/reframe\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt or Image failed the safety checks. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostReframeImageResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::Ideogram.GenerateImageResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - return - await global::Ideogram.GenerateImageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Reframe (legacy)
- /// Reframe a square image to a chosen resolution. The supported image formats include JPEG, PNG, and WebP.
- /// Image links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The image being reframed (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The image being reframed (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// (For model_version for 2.0 only, cannot be used in conjunction with aspect_ratio) The resolution to use for image generation, represented in width x height. If not specified, defaults to using aspect_ratio.
- /// Example: RESOLUTION_1024_1024 - /// - /// - /// The model used to generate an image or edit one. /generate and /remix supports all model types, however, /edit is only supported for V_2 and V_2_TURBO.
- /// Default Value: V_2
- /// Example: V_2_TURBO - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The style type to generate with; this is only applicable for models V_2 and above and should not be specified for model versions V_1.
- /// Example: REALISTIC - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostReframeImageAsResponseAsync( - global::System.IO.Stream imageFile, - string imageFilename, - global::Ideogram.Resolution resolution, - global::Ideogram.ModelEnum model = global::Ideogram.ModelEnum.V2, - int? numImages = default, - int? seed = default, - global::Ideogram.StyleType? styleType = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - - imageFile = imageFile ?? throw new global::System.ArgumentNullException(nameof(imageFile)); - var request = new global::Ideogram.ReframeImageRequest - { - ImageFile = global::System.Array.Empty(), - ImageFilename = imageFilename, - Resolution = resolution, - Model = model, - NumImages = numImages, - Seed = seed, - StyleType = styleType, - }; - PrepareArguments( - client: HttpClient); - PreparePostReframeImageArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostReframeImageSecurityRequirements, - operationName: "PostReframeImageAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/reframe", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - var __contentImageFile = new global::System.Net.Http.StreamContent(imageFile); - __contentImageFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.ImageFilename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.ImageFilename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImageFile, - name: "\"image_file\"", - fileName: request.ImageFilename != null ? $"\"{request.ImageFilename}\"" : string.Empty); - if (__contentImageFile.Headers.ContentDisposition != null) - { - __contentImageFile.Headers.ContentDisposition.FileNameStar = null; - } - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Resolution.ToValueString()), - name: "\"resolution\""); - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Model.ToValueString()), - name: "\"model\""); - - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.StyleType != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.StyleType).HasValue ? (request.StyleType).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"style_type\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostReframeImageRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostReframeImage", - methodName: "PostReframeImageAsync", - pathTemplate: "\"/reframe\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostReframeImage", - methodName: "PostReframeImageAsync", - pathTemplate: "\"/reframe\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostReframeImage", - methodName: "PostReframeImageAsync", - pathTemplate: "\"/reframe\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostReframeImageResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostReframeImage", - methodName: "PostReframeImageAsync", - pathTemplate: "\"/reframe\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostReframeImage", - methodName: "PostReframeImageAsync", - pathTemplate: "\"/reframe\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt or Image failed the safety checks. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostReframeImageResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.GenerateImageResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.GenerateImageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostReframeImageV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostReframeImageV3.g.cs deleted file mode 100644 index b247f38d..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostReframeImageV3.g.cs +++ /dev/null @@ -1,2153 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class GenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostReframeImageV3SecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostReframeImageV3SecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostReframeImageV3SecurityRequirement0, - }; - partial void PreparePostReframeImageV3Arguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.ReframeImageRequestV3 request); - partial void PreparePostReframeImageV3Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.ReframeImageRequestV3 request); - partial void ProcessPostReframeImageV3Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostReframeImageV3ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Reframe with Ideogram 3.0
- /// Reframe a square image to a chosen resolution with Ideogram 3.0. The supported image formats include JPEG, PNG, and WebP.
- /// Image links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostReframeImageV3Async( - - global::Ideogram.ReframeImageRequestV3 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostReframeImageV3AsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Reframe with Ideogram 3.0
- /// Reframe a square image to a chosen resolution with Ideogram 3.0. The supported image formats include JPEG, PNG, and WebP.
- /// Image links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostReframeImageV3AsResponseAsync( - - global::Ideogram.ReframeImageRequestV3 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostReframeImageV3Arguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostReframeImageV3SecurityRequirements, - operationName: "PostReframeImageV3Async"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/ideogram-v3/reframe", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Resolution.ToValueString()), - name: "\"resolution\""); - - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.RenderingSpeed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"rendering_speed\""); - - } - if (request.StylePreset != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.StylePreset).HasValue ? (request.StylePreset).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"style_preset\""); - - } - if (request.ColorPalette != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ColorPalette.ToString() ?? string.Empty), - name: "\"color_palette\""); - - } - if (request.StyleCodes != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.StyleCodes!, x => x))}]"), - name: "\"style_codes\""); - - } - if (request.StyleReferenceImages != default) - { - - for (var __iStyleReferenceImages = 0; __iStyleReferenceImages < request.StyleReferenceImages.Count; __iStyleReferenceImages++) - { - var __contentStyleReferenceImages = new global::System.Net.Http.ByteArrayContent(request.StyleReferenceImages[__iStyleReferenceImages]); - __contentStyleReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); - __httpRequestContent.Add( - content: __contentStyleReferenceImages, - name: "\"style_reference_images\"", - fileName: $"\"file{__iStyleReferenceImages}.bin\""); - if (__contentStyleReferenceImages.Headers.ContentDisposition != null) - { - __contentStyleReferenceImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostReframeImageV3Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostReframeImageV3", - methodName: "PostReframeImageV3Async", - pathTemplate: "\"/v1/ideogram-v3/reframe\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostReframeImageV3", - methodName: "PostReframeImageV3Async", - pathTemplate: "\"/v1/ideogram-v3/reframe\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostReframeImageV3", - methodName: "PostReframeImageV3Async", - pathTemplate: "\"/v1/ideogram-v3/reframe\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostReframeImageV3Response( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostReframeImageV3", - methodName: "PostReframeImageV3Async", - pathTemplate: "\"/v1/ideogram-v3/reframe\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostReframeImageV3", - methodName: "PostReframeImageV3Async", - pathTemplate: "\"/v1/ideogram-v3/reframe\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt or Image failed the safety checks. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostReframeImageV3ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.ImageGenerationResponseV3.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.ImageGenerationResponseV3.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Reframe with Ideogram 3.0
- /// Reframe a square image to a chosen resolution with Ideogram 3.0. The supported image formats include JPEG, PNG, and WebP.
- /// Image links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The image being reframed (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The image being reframed (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The resolutions supported for Ideogram 3.0.
- /// Example: 1280x800 - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - /// - /// - /// A predefined style preset that applies a specific artistic style to the generated image.
- /// Example: BRIGHT_ART - /// - /// - /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). Not supported by V_1, V_1_TURBO, V_2A and V_2A_TURBO models. - /// - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - /// - /// - /// A set of images to use as style references (max size 25MB per image; the whole request must stay under 50MB). The images should be in JPEG, PNG or WebP format. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostReframeImageV3Async( - byte[] image, - string imagename, - global::Ideogram.ResolutionV3 resolution, - int? numImages = default, - int? seed = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - global::Ideogram.StylePresetV3? stylePreset = default, - global::Ideogram.ColorPaletteWithPresetNameOrMembers? colorPalette = default, - global::System.Collections.Generic.IList? styleCodes = default, - global::System.Collections.Generic.IList? styleReferenceImages = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.ReframeImageRequestV3 - { - Image = image, - Imagename = imagename, - Resolution = resolution, - NumImages = numImages, - Seed = seed, - RenderingSpeed = renderingSpeed, - StylePreset = stylePreset, - ColorPalette = colorPalette, - StyleCodes = styleCodes, - StyleReferenceImages = styleReferenceImages, - }; - - return await PostReframeImageV3Async( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - - /// - /// Reframe with Ideogram 3.0
- /// Reframe a square image to a chosen resolution with Ideogram 3.0. The supported image formats include JPEG, PNG, and WebP.
- /// Image links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The image being reframed (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The image being reframed (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The resolutions supported for Ideogram 3.0.
- /// Example: 1280x800 - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - /// - /// - /// A predefined style preset that applies a specific artistic style to the generated image.
- /// Example: BRIGHT_ART - /// - /// - /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). Not supported by V_1, V_1_TURBO, V_2A and V_2A_TURBO models. - /// - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - /// - /// - /// A set of images to use as style references (max size 25MB per image; the whole request must stay under 50MB). The images should be in JPEG, PNG or WebP format. - /// - /// - /// Optional file names to use for the multipart 'style_reference_images' file parts. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostReframeImageV3Async( - global::System.IO.Stream image, - string imagename, - global::Ideogram.ResolutionV3 resolution, - int? numImages = default, - int? seed = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - global::Ideogram.StylePresetV3? stylePreset = default, - global::Ideogram.ColorPaletteWithPresetNameOrMembers? colorPalette = default, - global::System.Collections.Generic.IList? styleCodes = default, - global::System.Collections.Generic.IReadOnlyList? styleReferenceImages = default, - global::System.Collections.Generic.IReadOnlyList? styleReferenceImagesFileNames = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - - image = image ?? throw new global::System.ArgumentNullException(nameof(image)); - var request = new global::Ideogram.ReframeImageRequestV3 - { - Image = global::System.Array.Empty(), - Imagename = imagename, - Resolution = resolution, - NumImages = numImages, - Seed = seed, - RenderingSpeed = renderingSpeed, - StylePreset = stylePreset, - ColorPalette = colorPalette, - StyleCodes = styleCodes, - StyleReferenceImages = new global::System.Collections.Generic.List(), - }; - PrepareArguments( - client: HttpClient); - PreparePostReframeImageV3Arguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostReframeImageV3SecurityRequirements, - operationName: "PostReframeImageV3Async"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/ideogram-v3/reframe", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - var __contentImage = new global::System.Net.Http.StreamContent(image); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Resolution.ToValueString()), - name: "\"resolution\""); - - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.RenderingSpeed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"rendering_speed\""); - - } - if (request.StylePreset != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.StylePreset).HasValue ? (request.StylePreset).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"style_preset\""); - - } - if (request.ColorPalette != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ColorPalette.ToString() ?? string.Empty), - name: "\"color_palette\""); - - } - if (request.StyleCodes != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.StyleCodes!, x => x))}]"), - name: "\"style_codes\""); - - } - if (styleReferenceImages != default) - { - - for (var __iStyleReferenceImages = 0; __iStyleReferenceImages < styleReferenceImages.Count; __iStyleReferenceImages++) - { - var __fileNameStyleReferenceImages = styleReferenceImagesFileNames != null && - __iStyleReferenceImages < styleReferenceImagesFileNames.Count && - styleReferenceImagesFileNames[__iStyleReferenceImages] != null - ? styleReferenceImagesFileNames[__iStyleReferenceImages] - : $"file{__iStyleReferenceImages}.bin"; - var __contentStyleReferenceImages = new global::System.Net.Http.StreamContent(styleReferenceImages[__iStyleReferenceImages]); - __contentStyleReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - __fileNameStyleReferenceImages is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(__fileNameStyleReferenceImages) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentStyleReferenceImages, - name: "\"style_reference_images\"", - fileName: $"\"{__fileNameStyleReferenceImages}\""); - if (__contentStyleReferenceImages.Headers.ContentDisposition != null) - { - __contentStyleReferenceImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostReframeImageV3Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostReframeImageV3", - methodName: "PostReframeImageV3Async", - pathTemplate: "\"/v1/ideogram-v3/reframe\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostReframeImageV3", - methodName: "PostReframeImageV3Async", - pathTemplate: "\"/v1/ideogram-v3/reframe\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostReframeImageV3", - methodName: "PostReframeImageV3Async", - pathTemplate: "\"/v1/ideogram-v3/reframe\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostReframeImageV3Response( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostReframeImageV3", - methodName: "PostReframeImageV3Async", - pathTemplate: "\"/v1/ideogram-v3/reframe\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostReframeImageV3", - methodName: "PostReframeImageV3Async", - pathTemplate: "\"/v1/ideogram-v3/reframe\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt or Image failed the safety checks. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostReframeImageV3ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::Ideogram.ImageGenerationResponseV3.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - return - await global::Ideogram.ImageGenerationResponseV3.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Reframe with Ideogram 3.0
- /// Reframe a square image to a chosen resolution with Ideogram 3.0. The supported image formats include JPEG, PNG, and WebP.
- /// Image links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The image being reframed (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The image being reframed (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The resolutions supported for Ideogram 3.0.
- /// Example: 1280x800 - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - /// - /// - /// A predefined style preset that applies a specific artistic style to the generated image.
- /// Example: BRIGHT_ART - /// - /// - /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). Not supported by V_1, V_1_TURBO, V_2A and V_2A_TURBO models. - /// - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - /// - /// - /// A set of images to use as style references (max size 25MB per image; the whole request must stay under 50MB). The images should be in JPEG, PNG or WebP format. - /// - /// - /// Optional file names to use for the multipart 'style_reference_images' file parts. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostReframeImageV3AsResponseAsync( - global::System.IO.Stream image, - string imagename, - global::Ideogram.ResolutionV3 resolution, - int? numImages = default, - int? seed = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - global::Ideogram.StylePresetV3? stylePreset = default, - global::Ideogram.ColorPaletteWithPresetNameOrMembers? colorPalette = default, - global::System.Collections.Generic.IList? styleCodes = default, - global::System.Collections.Generic.IReadOnlyList? styleReferenceImages = default, - global::System.Collections.Generic.IReadOnlyList? styleReferenceImagesFileNames = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - - image = image ?? throw new global::System.ArgumentNullException(nameof(image)); - var request = new global::Ideogram.ReframeImageRequestV3 - { - Image = global::System.Array.Empty(), - Imagename = imagename, - Resolution = resolution, - NumImages = numImages, - Seed = seed, - RenderingSpeed = renderingSpeed, - StylePreset = stylePreset, - ColorPalette = colorPalette, - StyleCodes = styleCodes, - StyleReferenceImages = new global::System.Collections.Generic.List(), - }; - PrepareArguments( - client: HttpClient); - PreparePostReframeImageV3Arguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostReframeImageV3SecurityRequirements, - operationName: "PostReframeImageV3Async"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/ideogram-v3/reframe", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - var __contentImage = new global::System.Net.Http.StreamContent(image); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Resolution.ToValueString()), - name: "\"resolution\""); - - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.RenderingSpeed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"rendering_speed\""); - - } - if (request.StylePreset != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.StylePreset).HasValue ? (request.StylePreset).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"style_preset\""); - - } - if (request.ColorPalette != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ColorPalette.ToString() ?? string.Empty), - name: "\"color_palette\""); - - } - if (request.StyleCodes != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.StyleCodes!, x => x))}]"), - name: "\"style_codes\""); - - } - if (styleReferenceImages != default) - { - - for (var __iStyleReferenceImages = 0; __iStyleReferenceImages < styleReferenceImages.Count; __iStyleReferenceImages++) - { - var __fileNameStyleReferenceImages = styleReferenceImagesFileNames != null && - __iStyleReferenceImages < styleReferenceImagesFileNames.Count && - styleReferenceImagesFileNames[__iStyleReferenceImages] != null - ? styleReferenceImagesFileNames[__iStyleReferenceImages] - : $"file{__iStyleReferenceImages}.bin"; - var __contentStyleReferenceImages = new global::System.Net.Http.StreamContent(styleReferenceImages[__iStyleReferenceImages]); - __contentStyleReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - __fileNameStyleReferenceImages is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(__fileNameStyleReferenceImages) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentStyleReferenceImages, - name: "\"style_reference_images\"", - fileName: $"\"{__fileNameStyleReferenceImages}\""); - if (__contentStyleReferenceImages.Headers.ContentDisposition != null) - { - __contentStyleReferenceImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostReframeImageV3Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostReframeImageV3", - methodName: "PostReframeImageV3Async", - pathTemplate: "\"/v1/ideogram-v3/reframe\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostReframeImageV3", - methodName: "PostReframeImageV3Async", - pathTemplate: "\"/v1/ideogram-v3/reframe\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostReframeImageV3", - methodName: "PostReframeImageV3Async", - pathTemplate: "\"/v1/ideogram-v3/reframe\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostReframeImageV3Response( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostReframeImageV3", - methodName: "PostReframeImageV3Async", - pathTemplate: "\"/v1/ideogram-v3/reframe\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostReframeImageV3", - methodName: "PostReframeImageV3Async", - pathTemplate: "\"/v1/ideogram-v3/reframe\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt or Image failed the safety checks. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostReframeImageV3ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.ImageGenerationResponseV3.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.ImageGenerationResponseV3.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostRemixImage.g.cs b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostRemixImage.g.cs deleted file mode 100644 index 7ff047ae..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostRemixImage.g.cs +++ /dev/null @@ -1,1770 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class GenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostRemixImageSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostRemixImageSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostRemixImageSecurityRequirement0, - }; - partial void PreparePostRemixImageArguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.RemixImageRequest request); - partial void PreparePostRemixImageRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.RemixImageRequest request); - partial void ProcessPostRemixImageResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostRemixImageResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Remix (legacy)
- /// Remix provided images synchronously based on a given prompt and optional parameters.
- /// Input images are cropped to the chosen aspect ratio before being remixed.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostRemixImageAsync( - - global::Ideogram.RemixImageRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostRemixImageAsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Remix (legacy)
- /// Remix provided images synchronously based on a given prompt and optional parameters.
- /// Input images are cropped to the chosen aspect ratio before being remixed.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostRemixImageAsResponseAsync( - - global::Ideogram.RemixImageRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostRemixImageArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostRemixImageSecurityRequirements, - operationName: "PostRemixImageAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/remix", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ImageRequest.ToJson(JsonSerializerContext)), - name: "\"image_request\""); - - var __contentImageFile = new global::System.Net.Http.ByteArrayContent(request.ImageFile ?? global::System.Array.Empty()); - __contentImageFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.ImageFilename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.ImageFilename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImageFile, - name: "\"image_file\"", - fileName: request.ImageFilename != null ? $"\"{request.ImageFilename}\"" : string.Empty); - if (__contentImageFile.Headers.ContentDisposition != null) - { - __contentImageFile.Headers.ContentDisposition.FileNameStar = null; - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostRemixImageRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImage", - methodName: "PostRemixImageAsync", - pathTemplate: "\"/remix\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImage", - methodName: "PostRemixImageAsync", - pathTemplate: "\"/remix\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImage", - methodName: "PostRemixImageAsync", - pathTemplate: "\"/remix\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostRemixImageResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImage", - methodName: "PostRemixImageAsync", - pathTemplate: "\"/remix\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImage", - methodName: "PostRemixImageAsync", - pathTemplate: "\"/remix\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt or provided image failed safety check. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostRemixImageResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.GenerateImageResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.GenerateImageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Remix (legacy)
- /// Remix provided images synchronously based on a given prompt and optional parameters.
- /// Input images are cropped to the chosen aspect ratio before being remixed.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// A request to generate a new image using a provided image and a prompt.
- /// Example: {"aspect_ratio":"ASPECT_10_16","magic_prompt_option":"ON","model":"V_2","prompt":"A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there is an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset.","image_weight":50} - /// - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostRemixImageAsync( - global::Ideogram.InitialImageRequest imageRequest, - byte[] imageFile, - string imageFilename, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.RemixImageRequest - { - ImageRequest = imageRequest, - ImageFile = imageFile, - ImageFilename = imageFilename, - }; - - return await PostRemixImageAsync( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - - /// - /// Remix (legacy)
- /// Remix provided images synchronously based on a given prompt and optional parameters.
- /// Input images are cropped to the chosen aspect ratio before being remixed.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// A request to generate a new image using a provided image and a prompt.
- /// Example: {"aspect_ratio":"ASPECT_10_16","magic_prompt_option":"ON","model":"V_2","prompt":"A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there is an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset.","image_weight":50} - /// - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostRemixImageAsync( - global::Ideogram.InitialImageRequest imageRequest, - global::System.IO.Stream imageFile, - string imageFilename, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - - imageFile = imageFile ?? throw new global::System.ArgumentNullException(nameof(imageFile)); - var request = new global::Ideogram.RemixImageRequest - { - ImageRequest = imageRequest, - ImageFile = global::System.Array.Empty(), - ImageFilename = imageFilename, - }; - PrepareArguments( - client: HttpClient); - PreparePostRemixImageArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostRemixImageSecurityRequirements, - operationName: "PostRemixImageAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/remix", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ImageRequest.ToJson(JsonSerializerContext)), - name: "\"image_request\""); - - var __contentImageFile = new global::System.Net.Http.StreamContent(imageFile); - __contentImageFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.ImageFilename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.ImageFilename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImageFile, - name: "\"image_file\"", - fileName: request.ImageFilename != null ? $"\"{request.ImageFilename}\"" : string.Empty); - if (__contentImageFile.Headers.ContentDisposition != null) - { - __contentImageFile.Headers.ContentDisposition.FileNameStar = null; - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostRemixImageRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImage", - methodName: "PostRemixImageAsync", - pathTemplate: "\"/remix\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImage", - methodName: "PostRemixImageAsync", - pathTemplate: "\"/remix\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImage", - methodName: "PostRemixImageAsync", - pathTemplate: "\"/remix\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostRemixImageResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImage", - methodName: "PostRemixImageAsync", - pathTemplate: "\"/remix\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImage", - methodName: "PostRemixImageAsync", - pathTemplate: "\"/remix\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt or provided image failed safety check. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostRemixImageResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::Ideogram.GenerateImageResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - return - await global::Ideogram.GenerateImageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Remix (legacy)
- /// Remix provided images synchronously based on a given prompt and optional parameters.
- /// Input images are cropped to the chosen aspect ratio before being remixed.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// A request to generate a new image using a provided image and a prompt.
- /// Example: {"aspect_ratio":"ASPECT_10_16","magic_prompt_option":"ON","model":"V_2","prompt":"A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there is an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset.","image_weight":50} - /// - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostRemixImageAsResponseAsync( - global::Ideogram.InitialImageRequest imageRequest, - global::System.IO.Stream imageFile, - string imageFilename, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - - imageFile = imageFile ?? throw new global::System.ArgumentNullException(nameof(imageFile)); - var request = new global::Ideogram.RemixImageRequest - { - ImageRequest = imageRequest, - ImageFile = global::System.Array.Empty(), - ImageFilename = imageFilename, - }; - PrepareArguments( - client: HttpClient); - PreparePostRemixImageArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostRemixImageSecurityRequirements, - operationName: "PostRemixImageAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/remix", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ImageRequest.ToJson(JsonSerializerContext)), - name: "\"image_request\""); - - var __contentImageFile = new global::System.Net.Http.StreamContent(imageFile); - __contentImageFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.ImageFilename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.ImageFilename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImageFile, - name: "\"image_file\"", - fileName: request.ImageFilename != null ? $"\"{request.ImageFilename}\"" : string.Empty); - if (__contentImageFile.Headers.ContentDisposition != null) - { - __contentImageFile.Headers.ContentDisposition.FileNameStar = null; - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostRemixImageRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImage", - methodName: "PostRemixImageAsync", - pathTemplate: "\"/remix\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImage", - methodName: "PostRemixImageAsync", - pathTemplate: "\"/remix\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImage", - methodName: "PostRemixImageAsync", - pathTemplate: "\"/remix\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostRemixImageResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImage", - methodName: "PostRemixImageAsync", - pathTemplate: "\"/remix\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImage", - methodName: "PostRemixImageAsync", - pathTemplate: "\"/remix\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt or provided image failed safety check. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostRemixImageResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.GenerateImageResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.GenerateImageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostRemixImageV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostRemixImageV3.g.cs deleted file mode 100644 index 85235e09..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostRemixImageV3.g.cs +++ /dev/null @@ -1,2784 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class GenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostRemixImageV3SecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostRemixImageV3SecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostRemixImageV3SecurityRequirement0, - }; - partial void PreparePostRemixImageV3Arguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.RemixImageRequestV3 request); - partial void PreparePostRemixImageV3Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.RemixImageRequestV3 request); - partial void ProcessPostRemixImageV3Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostRemixImageV3ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Remix with Ideogram 3.0
- /// Remix provided images synchronously based on a given prompt and optional parameters with the Ideogram 3.0 model.
- /// Input images are cropped to the chosen aspect ratio before being remixed.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostRemixImageV3Async( - - global::Ideogram.RemixImageRequestV3 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostRemixImageV3AsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Remix with Ideogram 3.0
- /// Remix provided images synchronously based on a given prompt and optional parameters with the Ideogram 3.0 model.
- /// Input images are cropped to the chosen aspect ratio before being remixed.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostRemixImageV3AsResponseAsync( - - global::Ideogram.RemixImageRequestV3 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostRemixImageV3Arguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostRemixImageV3SecurityRequirements, - operationName: "PostRemixImageV3Async"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/ideogram-v3/remix", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - if (request.ImageWeight != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.ImageWeight, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"image_weight\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.Resolution != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"resolution\""); - - } - if (request.AspectRatio != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.AspectRatio).HasValue ? (request.AspectRatio).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"aspect_ratio\""); - - } - if (request.RenderingSpeed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"rendering_speed\""); - - } - if (request.MagicPrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.MagicPrompt).HasValue ? (request.MagicPrompt).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"magic_prompt\""); - - } - if (request.MagicPromptSystemPromptConfigId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.MagicPromptSystemPromptConfigId ?? string.Empty), - name: "\"magic_prompt_system_prompt_config_id\""); - - } - if (request.NegativePrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.NegativePrompt ?? string.Empty), - name: "\"negative_prompt\""); - - } - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.ColorPalette != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ColorPalette.ToString() ?? string.Empty), - name: "\"color_palette\""); - - } - if (request.StyleCodes != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.StyleCodes!, x => x))}]"), - name: "\"style_codes\""); - - } - if (request.StyleType != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.StyleType).HasValue ? (request.StyleType).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"style_type\""); - - } - if (request.StylePreset != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.StylePreset).HasValue ? (request.StylePreset).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"style_preset\""); - - } - if (request.CustomModelUri != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.CustomModelUri ?? string.Empty), - name: "\"custom_model_uri\""); - - } - if (request.StyleReferenceImages != default) - { - - for (var __iStyleReferenceImages = 0; __iStyleReferenceImages < request.StyleReferenceImages.Count; __iStyleReferenceImages++) - { - var __contentStyleReferenceImages = new global::System.Net.Http.ByteArrayContent(request.StyleReferenceImages[__iStyleReferenceImages]); - __contentStyleReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); - __httpRequestContent.Add( - content: __contentStyleReferenceImages, - name: "\"style_reference_images\"", - fileName: $"\"file{__iStyleReferenceImages}.bin\""); - if (__contentStyleReferenceImages.Headers.ContentDisposition != null) - { - __contentStyleReferenceImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - if (request.CharacterReferenceImages != default) - { - - for (var __iCharacterReferenceImages = 0; __iCharacterReferenceImages < request.CharacterReferenceImages.Count; __iCharacterReferenceImages++) - { - var __contentCharacterReferenceImages = new global::System.Net.Http.ByteArrayContent(request.CharacterReferenceImages[__iCharacterReferenceImages]); - __contentCharacterReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); - __httpRequestContent.Add( - content: __contentCharacterReferenceImages, - name: "\"character_reference_images\"", - fileName: $"\"file{__iCharacterReferenceImages}.bin\""); - if (__contentCharacterReferenceImages.Headers.ContentDisposition != null) - { - __contentCharacterReferenceImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - if (request.CharacterReferenceImagesMask != default) - { - - for (var __iCharacterReferenceImagesMask = 0; __iCharacterReferenceImagesMask < request.CharacterReferenceImagesMask.Count; __iCharacterReferenceImagesMask++) - { - var __contentCharacterReferenceImagesMask = new global::System.Net.Http.ByteArrayContent(request.CharacterReferenceImagesMask[__iCharacterReferenceImagesMask]); - __contentCharacterReferenceImagesMask.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); - __httpRequestContent.Add( - content: __contentCharacterReferenceImagesMask, - name: "\"character_reference_images_mask\"", - fileName: $"\"file{__iCharacterReferenceImagesMask}.bin\""); - if (__contentCharacterReferenceImagesMask.Headers.ContentDisposition != null) - { - __contentCharacterReferenceImagesMask.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostRemixImageV3Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImageV3", - methodName: "PostRemixImageV3Async", - pathTemplate: "\"/v1/ideogram-v3/remix\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImageV3", - methodName: "PostRemixImageV3Async", - pathTemplate: "\"/v1/ideogram-v3/remix\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImageV3", - methodName: "PostRemixImageV3Async", - pathTemplate: "\"/v1/ideogram-v3/remix\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostRemixImageV3Response( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImageV3", - methodName: "PostRemixImageV3Async", - pathTemplate: "\"/v1/ideogram-v3/remix\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImageV3", - methodName: "PostRemixImageV3Async", - pathTemplate: "\"/v1/ideogram-v3/remix\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt or provided image failed safety check. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostRemixImageV3ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.ImageGenerationResponseV3.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.ImageGenerationResponseV3.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Remix with Ideogram 3.0
- /// Remix provided images synchronously based on a given prompt and optional parameters with the Ideogram 3.0 model.
- /// Input images are cropped to the chosen aspect ratio before being remixed.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The image to remix binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The image to remix binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The prompt to use to generate the image.
- /// Example: A photo of a cat - /// - /// - /// Default Value: 50
- /// Example: 50 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The resolutions supported for Ideogram 3.0.
- /// Example: 1280x800 - /// - /// - /// Output aspect ratio. Cannot be combined with resolution. Generation defaults to 1x1; remix keeps the source ratio when both fields are omitted. - /// - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// Description of what to exclude from an image. Descriptions in the prompt take precedence
- /// to descriptions in the negative prompt.
- /// Example: brush strokes, painting - /// - /// - /// Number of images to generate.
- /// Default Value: 1 - /// - /// - /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). Not supported by V_1, V_1_TURBO, V_2A and V_2A_TURBO models. - /// - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - /// - /// - /// The style type to generate with.
- /// Default Value: GENERAL
- /// Example: GENERAL - /// - /// - /// A predefined style preset that applies a specific artistic style to the generated image.
- /// Example: BRIGHT_ART - /// - /// - /// A custom model URI in the format model/<model_name>/version/<version_name>.
- /// When provided, the model version and style will be resolved from this URI, and style_type is not required.
- /// Example: model/my-custom-model/version/1 - /// - /// - /// A set of images to use as style references (max size 25MB per image; the whole request must stay under 50MB). The images should be in JPEG, PNG or WebP format. - /// - /// - /// Generations with character reference are subject to the character reference pricing. A set of images to use as character references (max size 25MB per image; the whole request must stay under 50MB), currently only supports 1 character reference image. The images should be in JPEG, PNG or WebP format. - /// - /// - /// Optional masks for character reference images. When provided, must match the number of character_reference_images. Each mask should be a grayscale image of the same dimensions as the corresponding character reference image. The images should be in JPEG, PNG or WebP format. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostRemixImageV3Async( - byte[] image, - string imagename, - string prompt, - int? imageWeight = default, - int? seed = default, - global::Ideogram.ResolutionV3? resolution = default, - global::Ideogram.AspectRatioV3? aspectRatio = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - global::Ideogram.MagicPromptOption? magicPrompt = default, - string? magicPromptSystemPromptConfigId = default, - string? negativePrompt = default, - int? numImages = default, - global::Ideogram.ColorPaletteWithPresetNameOrMembers? colorPalette = default, - global::System.Collections.Generic.IList? styleCodes = default, - global::Ideogram.StyleTypeV3? styleType = default, - global::Ideogram.StylePresetV3? stylePreset = default, - string? customModelUri = default, - global::System.Collections.Generic.IList? styleReferenceImages = default, - global::System.Collections.Generic.IList? characterReferenceImages = default, - global::System.Collections.Generic.IList? characterReferenceImagesMask = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.RemixImageRequestV3 - { - Image = image, - Imagename = imagename, - Prompt = prompt, - ImageWeight = imageWeight, - Seed = seed, - Resolution = resolution, - AspectRatio = aspectRatio, - RenderingSpeed = renderingSpeed, - MagicPrompt = magicPrompt, - MagicPromptSystemPromptConfigId = magicPromptSystemPromptConfigId, - NegativePrompt = negativePrompt, - NumImages = numImages, - ColorPalette = colorPalette, - StyleCodes = styleCodes, - StyleType = styleType, - StylePreset = stylePreset, - CustomModelUri = customModelUri, - StyleReferenceImages = styleReferenceImages, - CharacterReferenceImages = characterReferenceImages, - CharacterReferenceImagesMask = characterReferenceImagesMask, - }; - - return await PostRemixImageV3Async( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - - /// - /// Remix with Ideogram 3.0
- /// Remix provided images synchronously based on a given prompt and optional parameters with the Ideogram 3.0 model.
- /// Input images are cropped to the chosen aspect ratio before being remixed.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The image to remix binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The image to remix binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The prompt to use to generate the image.
- /// Example: A photo of a cat - /// - /// - /// Default Value: 50
- /// Example: 50 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The resolutions supported for Ideogram 3.0.
- /// Example: 1280x800 - /// - /// - /// Output aspect ratio. Cannot be combined with resolution. Generation defaults to 1x1; remix keeps the source ratio when both fields are omitted. - /// - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// Description of what to exclude from an image. Descriptions in the prompt take precedence
- /// to descriptions in the negative prompt.
- /// Example: brush strokes, painting - /// - /// - /// Number of images to generate.
- /// Default Value: 1 - /// - /// - /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). Not supported by V_1, V_1_TURBO, V_2A and V_2A_TURBO models. - /// - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - /// - /// - /// The style type to generate with.
- /// Default Value: GENERAL
- /// Example: GENERAL - /// - /// - /// A predefined style preset that applies a specific artistic style to the generated image.
- /// Example: BRIGHT_ART - /// - /// - /// A custom model URI in the format model/<model_name>/version/<version_name>.
- /// When provided, the model version and style will be resolved from this URI, and style_type is not required.
- /// Example: model/my-custom-model/version/1 - /// - /// - /// A set of images to use as style references (max size 25MB per image; the whole request must stay under 50MB). The images should be in JPEG, PNG or WebP format. - /// - /// - /// Optional file names to use for the multipart 'style_reference_images' file parts. - /// - /// - /// Generations with character reference are subject to the character reference pricing. A set of images to use as character references (max size 25MB per image; the whole request must stay under 50MB), currently only supports 1 character reference image. The images should be in JPEG, PNG or WebP format. - /// - /// - /// Optional file names to use for the multipart 'character_reference_images' file parts. - /// - /// - /// Optional masks for character reference images. When provided, must match the number of character_reference_images. Each mask should be a grayscale image of the same dimensions as the corresponding character reference image. The images should be in JPEG, PNG or WebP format. - /// - /// - /// Optional file names to use for the multipart 'character_reference_images_mask' file parts. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostRemixImageV3Async( - global::System.IO.Stream image, - string imagename, - string prompt, - int? imageWeight = default, - int? seed = default, - global::Ideogram.ResolutionV3? resolution = default, - global::Ideogram.AspectRatioV3? aspectRatio = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - global::Ideogram.MagicPromptOption? magicPrompt = default, - string? magicPromptSystemPromptConfigId = default, - string? negativePrompt = default, - int? numImages = default, - global::Ideogram.ColorPaletteWithPresetNameOrMembers? colorPalette = default, - global::System.Collections.Generic.IList? styleCodes = default, - global::Ideogram.StyleTypeV3? styleType = default, - global::Ideogram.StylePresetV3? stylePreset = default, - string? customModelUri = default, - global::System.Collections.Generic.IReadOnlyList? styleReferenceImages = default, - global::System.Collections.Generic.IReadOnlyList? styleReferenceImagesFileNames = default, - global::System.Collections.Generic.IReadOnlyList? characterReferenceImages = default, - global::System.Collections.Generic.IReadOnlyList? characterReferenceImagesFileNames = default, - global::System.Collections.Generic.IReadOnlyList? characterReferenceImagesMask = default, - global::System.Collections.Generic.IReadOnlyList? characterReferenceImagesMaskFileNames = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - - image = image ?? throw new global::System.ArgumentNullException(nameof(image)); - var request = new global::Ideogram.RemixImageRequestV3 - { - Image = global::System.Array.Empty(), - Imagename = imagename, - Prompt = prompt, - ImageWeight = imageWeight, - Seed = seed, - Resolution = resolution, - AspectRatio = aspectRatio, - RenderingSpeed = renderingSpeed, - MagicPrompt = magicPrompt, - MagicPromptSystemPromptConfigId = magicPromptSystemPromptConfigId, - NegativePrompt = negativePrompt, - NumImages = numImages, - ColorPalette = colorPalette, - StyleCodes = styleCodes, - StyleType = styleType, - StylePreset = stylePreset, - CustomModelUri = customModelUri, - StyleReferenceImages = new global::System.Collections.Generic.List(), - CharacterReferenceImages = new global::System.Collections.Generic.List(), - CharacterReferenceImagesMask = new global::System.Collections.Generic.List(), - }; - PrepareArguments( - client: HttpClient); - PreparePostRemixImageV3Arguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostRemixImageV3SecurityRequirements, - operationName: "PostRemixImageV3Async"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/ideogram-v3/remix", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - var __contentImage = new global::System.Net.Http.StreamContent(image); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - if (request.ImageWeight != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.ImageWeight, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"image_weight\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.Resolution != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"resolution\""); - - } - if (request.AspectRatio != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.AspectRatio).HasValue ? (request.AspectRatio).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"aspect_ratio\""); - - } - if (request.RenderingSpeed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"rendering_speed\""); - - } - if (request.MagicPrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.MagicPrompt).HasValue ? (request.MagicPrompt).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"magic_prompt\""); - - } - if (request.MagicPromptSystemPromptConfigId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.MagicPromptSystemPromptConfigId ?? string.Empty), - name: "\"magic_prompt_system_prompt_config_id\""); - - } - if (request.NegativePrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.NegativePrompt ?? string.Empty), - name: "\"negative_prompt\""); - - } - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.ColorPalette != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ColorPalette.ToString() ?? string.Empty), - name: "\"color_palette\""); - - } - if (request.StyleCodes != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.StyleCodes!, x => x))}]"), - name: "\"style_codes\""); - - } - if (request.StyleType != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.StyleType).HasValue ? (request.StyleType).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"style_type\""); - - } - if (request.StylePreset != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.StylePreset).HasValue ? (request.StylePreset).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"style_preset\""); - - } - if (request.CustomModelUri != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.CustomModelUri ?? string.Empty), - name: "\"custom_model_uri\""); - - } - if (styleReferenceImages != default) - { - - for (var __iStyleReferenceImages = 0; __iStyleReferenceImages < styleReferenceImages.Count; __iStyleReferenceImages++) - { - var __fileNameStyleReferenceImages = styleReferenceImagesFileNames != null && - __iStyleReferenceImages < styleReferenceImagesFileNames.Count && - styleReferenceImagesFileNames[__iStyleReferenceImages] != null - ? styleReferenceImagesFileNames[__iStyleReferenceImages] - : $"file{__iStyleReferenceImages}.bin"; - var __contentStyleReferenceImages = new global::System.Net.Http.StreamContent(styleReferenceImages[__iStyleReferenceImages]); - __contentStyleReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - __fileNameStyleReferenceImages is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(__fileNameStyleReferenceImages) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentStyleReferenceImages, - name: "\"style_reference_images\"", - fileName: $"\"{__fileNameStyleReferenceImages}\""); - if (__contentStyleReferenceImages.Headers.ContentDisposition != null) - { - __contentStyleReferenceImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - if (characterReferenceImages != default) - { - - for (var __iCharacterReferenceImages = 0; __iCharacterReferenceImages < characterReferenceImages.Count; __iCharacterReferenceImages++) - { - var __fileNameCharacterReferenceImages = characterReferenceImagesFileNames != null && - __iCharacterReferenceImages < characterReferenceImagesFileNames.Count && - characterReferenceImagesFileNames[__iCharacterReferenceImages] != null - ? characterReferenceImagesFileNames[__iCharacterReferenceImages] - : $"file{__iCharacterReferenceImages}.bin"; - var __contentCharacterReferenceImages = new global::System.Net.Http.StreamContent(characterReferenceImages[__iCharacterReferenceImages]); - __contentCharacterReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - __fileNameCharacterReferenceImages is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(__fileNameCharacterReferenceImages) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentCharacterReferenceImages, - name: "\"character_reference_images\"", - fileName: $"\"{__fileNameCharacterReferenceImages}\""); - if (__contentCharacterReferenceImages.Headers.ContentDisposition != null) - { - __contentCharacterReferenceImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - if (characterReferenceImagesMask != default) - { - - for (var __iCharacterReferenceImagesMask = 0; __iCharacterReferenceImagesMask < characterReferenceImagesMask.Count; __iCharacterReferenceImagesMask++) - { - var __fileNameCharacterReferenceImagesMask = characterReferenceImagesMaskFileNames != null && - __iCharacterReferenceImagesMask < characterReferenceImagesMaskFileNames.Count && - characterReferenceImagesMaskFileNames[__iCharacterReferenceImagesMask] != null - ? characterReferenceImagesMaskFileNames[__iCharacterReferenceImagesMask] - : $"file{__iCharacterReferenceImagesMask}.bin"; - var __contentCharacterReferenceImagesMask = new global::System.Net.Http.StreamContent(characterReferenceImagesMask[__iCharacterReferenceImagesMask]); - __contentCharacterReferenceImagesMask.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - __fileNameCharacterReferenceImagesMask is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(__fileNameCharacterReferenceImagesMask) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentCharacterReferenceImagesMask, - name: "\"character_reference_images_mask\"", - fileName: $"\"{__fileNameCharacterReferenceImagesMask}\""); - if (__contentCharacterReferenceImagesMask.Headers.ContentDisposition != null) - { - __contentCharacterReferenceImagesMask.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostRemixImageV3Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImageV3", - methodName: "PostRemixImageV3Async", - pathTemplate: "\"/v1/ideogram-v3/remix\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImageV3", - methodName: "PostRemixImageV3Async", - pathTemplate: "\"/v1/ideogram-v3/remix\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImageV3", - methodName: "PostRemixImageV3Async", - pathTemplate: "\"/v1/ideogram-v3/remix\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostRemixImageV3Response( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImageV3", - methodName: "PostRemixImageV3Async", - pathTemplate: "\"/v1/ideogram-v3/remix\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImageV3", - methodName: "PostRemixImageV3Async", - pathTemplate: "\"/v1/ideogram-v3/remix\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt or provided image failed safety check. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostRemixImageV3ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::Ideogram.ImageGenerationResponseV3.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - return - await global::Ideogram.ImageGenerationResponseV3.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Remix with Ideogram 3.0
- /// Remix provided images synchronously based on a given prompt and optional parameters with the Ideogram 3.0 model.
- /// Input images are cropped to the chosen aspect ratio before being remixed.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The image to remix binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The image to remix binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The prompt to use to generate the image.
- /// Example: A photo of a cat - /// - /// - /// Default Value: 50
- /// Example: 50 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The resolutions supported for Ideogram 3.0.
- /// Example: 1280x800 - /// - /// - /// Output aspect ratio. Cannot be combined with resolution. Generation defaults to 1x1; remix keeps the source ratio when both fields are omitted. - /// - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// Description of what to exclude from an image. Descriptions in the prompt take precedence
- /// to descriptions in the negative prompt.
- /// Example: brush strokes, painting - /// - /// - /// Number of images to generate.
- /// Default Value: 1 - /// - /// - /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). Not supported by V_1, V_1_TURBO, V_2A and V_2A_TURBO models. - /// - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - /// - /// - /// The style type to generate with.
- /// Default Value: GENERAL
- /// Example: GENERAL - /// - /// - /// A predefined style preset that applies a specific artistic style to the generated image.
- /// Example: BRIGHT_ART - /// - /// - /// A custom model URI in the format model/<model_name>/version/<version_name>.
- /// When provided, the model version and style will be resolved from this URI, and style_type is not required.
- /// Example: model/my-custom-model/version/1 - /// - /// - /// A set of images to use as style references (max size 25MB per image; the whole request must stay under 50MB). The images should be in JPEG, PNG or WebP format. - /// - /// - /// Optional file names to use for the multipart 'style_reference_images' file parts. - /// - /// - /// Generations with character reference are subject to the character reference pricing. A set of images to use as character references (max size 25MB per image; the whole request must stay under 50MB), currently only supports 1 character reference image. The images should be in JPEG, PNG or WebP format. - /// - /// - /// Optional file names to use for the multipart 'character_reference_images' file parts. - /// - /// - /// Optional masks for character reference images. When provided, must match the number of character_reference_images. Each mask should be a grayscale image of the same dimensions as the corresponding character reference image. The images should be in JPEG, PNG or WebP format. - /// - /// - /// Optional file names to use for the multipart 'character_reference_images_mask' file parts. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostRemixImageV3AsResponseAsync( - global::System.IO.Stream image, - string imagename, - string prompt, - int? imageWeight = default, - int? seed = default, - global::Ideogram.ResolutionV3? resolution = default, - global::Ideogram.AspectRatioV3? aspectRatio = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - global::Ideogram.MagicPromptOption? magicPrompt = default, - string? magicPromptSystemPromptConfigId = default, - string? negativePrompt = default, - int? numImages = default, - global::Ideogram.ColorPaletteWithPresetNameOrMembers? colorPalette = default, - global::System.Collections.Generic.IList? styleCodes = default, - global::Ideogram.StyleTypeV3? styleType = default, - global::Ideogram.StylePresetV3? stylePreset = default, - string? customModelUri = default, - global::System.Collections.Generic.IReadOnlyList? styleReferenceImages = default, - global::System.Collections.Generic.IReadOnlyList? styleReferenceImagesFileNames = default, - global::System.Collections.Generic.IReadOnlyList? characterReferenceImages = default, - global::System.Collections.Generic.IReadOnlyList? characterReferenceImagesFileNames = default, - global::System.Collections.Generic.IReadOnlyList? characterReferenceImagesMask = default, - global::System.Collections.Generic.IReadOnlyList? characterReferenceImagesMaskFileNames = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - - image = image ?? throw new global::System.ArgumentNullException(nameof(image)); - var request = new global::Ideogram.RemixImageRequestV3 - { - Image = global::System.Array.Empty(), - Imagename = imagename, - Prompt = prompt, - ImageWeight = imageWeight, - Seed = seed, - Resolution = resolution, - AspectRatio = aspectRatio, - RenderingSpeed = renderingSpeed, - MagicPrompt = magicPrompt, - MagicPromptSystemPromptConfigId = magicPromptSystemPromptConfigId, - NegativePrompt = negativePrompt, - NumImages = numImages, - ColorPalette = colorPalette, - StyleCodes = styleCodes, - StyleType = styleType, - StylePreset = stylePreset, - CustomModelUri = customModelUri, - StyleReferenceImages = new global::System.Collections.Generic.List(), - CharacterReferenceImages = new global::System.Collections.Generic.List(), - CharacterReferenceImagesMask = new global::System.Collections.Generic.List(), - }; - PrepareArguments( - client: HttpClient); - PreparePostRemixImageV3Arguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostRemixImageV3SecurityRequirements, - operationName: "PostRemixImageV3Async"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/ideogram-v3/remix", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - var __contentImage = new global::System.Net.Http.StreamContent(image); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - if (request.ImageWeight != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.ImageWeight, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"image_weight\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.Resolution != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"resolution\""); - - } - if (request.AspectRatio != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.AspectRatio).HasValue ? (request.AspectRatio).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"aspect_ratio\""); - - } - if (request.RenderingSpeed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"rendering_speed\""); - - } - if (request.MagicPrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.MagicPrompt).HasValue ? (request.MagicPrompt).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"magic_prompt\""); - - } - if (request.MagicPromptSystemPromptConfigId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.MagicPromptSystemPromptConfigId ?? string.Empty), - name: "\"magic_prompt_system_prompt_config_id\""); - - } - if (request.NegativePrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.NegativePrompt ?? string.Empty), - name: "\"negative_prompt\""); - - } - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.ColorPalette != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ColorPalette.ToString() ?? string.Empty), - name: "\"color_palette\""); - - } - if (request.StyleCodes != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.StyleCodes!, x => x))}]"), - name: "\"style_codes\""); - - } - if (request.StyleType != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.StyleType).HasValue ? (request.StyleType).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"style_type\""); - - } - if (request.StylePreset != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.StylePreset).HasValue ? (request.StylePreset).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"style_preset\""); - - } - if (request.CustomModelUri != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.CustomModelUri ?? string.Empty), - name: "\"custom_model_uri\""); - - } - if (styleReferenceImages != default) - { - - for (var __iStyleReferenceImages = 0; __iStyleReferenceImages < styleReferenceImages.Count; __iStyleReferenceImages++) - { - var __fileNameStyleReferenceImages = styleReferenceImagesFileNames != null && - __iStyleReferenceImages < styleReferenceImagesFileNames.Count && - styleReferenceImagesFileNames[__iStyleReferenceImages] != null - ? styleReferenceImagesFileNames[__iStyleReferenceImages] - : $"file{__iStyleReferenceImages}.bin"; - var __contentStyleReferenceImages = new global::System.Net.Http.StreamContent(styleReferenceImages[__iStyleReferenceImages]); - __contentStyleReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - __fileNameStyleReferenceImages is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(__fileNameStyleReferenceImages) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentStyleReferenceImages, - name: "\"style_reference_images\"", - fileName: $"\"{__fileNameStyleReferenceImages}\""); - if (__contentStyleReferenceImages.Headers.ContentDisposition != null) - { - __contentStyleReferenceImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - if (characterReferenceImages != default) - { - - for (var __iCharacterReferenceImages = 0; __iCharacterReferenceImages < characterReferenceImages.Count; __iCharacterReferenceImages++) - { - var __fileNameCharacterReferenceImages = characterReferenceImagesFileNames != null && - __iCharacterReferenceImages < characterReferenceImagesFileNames.Count && - characterReferenceImagesFileNames[__iCharacterReferenceImages] != null - ? characterReferenceImagesFileNames[__iCharacterReferenceImages] - : $"file{__iCharacterReferenceImages}.bin"; - var __contentCharacterReferenceImages = new global::System.Net.Http.StreamContent(characterReferenceImages[__iCharacterReferenceImages]); - __contentCharacterReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - __fileNameCharacterReferenceImages is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(__fileNameCharacterReferenceImages) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentCharacterReferenceImages, - name: "\"character_reference_images\"", - fileName: $"\"{__fileNameCharacterReferenceImages}\""); - if (__contentCharacterReferenceImages.Headers.ContentDisposition != null) - { - __contentCharacterReferenceImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - if (characterReferenceImagesMask != default) - { - - for (var __iCharacterReferenceImagesMask = 0; __iCharacterReferenceImagesMask < characterReferenceImagesMask.Count; __iCharacterReferenceImagesMask++) - { - var __fileNameCharacterReferenceImagesMask = characterReferenceImagesMaskFileNames != null && - __iCharacterReferenceImagesMask < characterReferenceImagesMaskFileNames.Count && - characterReferenceImagesMaskFileNames[__iCharacterReferenceImagesMask] != null - ? characterReferenceImagesMaskFileNames[__iCharacterReferenceImagesMask] - : $"file{__iCharacterReferenceImagesMask}.bin"; - var __contentCharacterReferenceImagesMask = new global::System.Net.Http.StreamContent(characterReferenceImagesMask[__iCharacterReferenceImagesMask]); - __contentCharacterReferenceImagesMask.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - __fileNameCharacterReferenceImagesMask is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(__fileNameCharacterReferenceImagesMask) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentCharacterReferenceImagesMask, - name: "\"character_reference_images_mask\"", - fileName: $"\"{__fileNameCharacterReferenceImagesMask}\""); - if (__contentCharacterReferenceImagesMask.Headers.ContentDisposition != null) - { - __contentCharacterReferenceImagesMask.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostRemixImageV3Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImageV3", - methodName: "PostRemixImageV3Async", - pathTemplate: "\"/v1/ideogram-v3/remix\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImageV3", - methodName: "PostRemixImageV3Async", - pathTemplate: "\"/v1/ideogram-v3/remix\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImageV3", - methodName: "PostRemixImageV3Async", - pathTemplate: "\"/v1/ideogram-v3/remix\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostRemixImageV3Response( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImageV3", - methodName: "PostRemixImageV3Async", - pathTemplate: "\"/v1/ideogram-v3/remix\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImageV3", - methodName: "PostRemixImageV3Async", - pathTemplate: "\"/v1/ideogram-v3/remix\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt or provided image failed safety check. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostRemixImageV3ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.ImageGenerationResponseV3.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.ImageGenerationResponseV3.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostRemixImageV4.g.cs b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostRemixImageV4.g.cs deleted file mode 100644 index 6e67fd33..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostRemixImageV4.g.cs +++ /dev/null @@ -1,1953 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class GenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostRemixImageV4SecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostRemixImageV4SecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostRemixImageV4SecurityRequirement0, - }; - partial void PreparePostRemixImageV4Arguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.RemixImageRequestV4 request); - partial void PreparePostRemixImageV4Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.RemixImageRequestV4 request); - partial void ProcessPostRemixImageV4Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostRemixImageV4ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Remix with Ideogram 4.0
- /// Remix an image synchronously using the Ideogram 4.0 model with an initial image and a prompt.
- /// Mirrors `/v1/ideogram-v3/remix` semantics (including `image_weight` for how strongly the
- /// output should resemble the input image) but routes the request through the V_4_0 model.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostRemixImageV4Async( - - global::Ideogram.RemixImageRequestV4 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostRemixImageV4AsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Remix with Ideogram 4.0
- /// Remix an image synchronously using the Ideogram 4.0 model with an initial image and a prompt.
- /// Mirrors `/v1/ideogram-v3/remix` semantics (including `image_weight` for how strongly the
- /// output should resemble the input image) but routes the request through the V_4_0 model.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostRemixImageV4AsResponseAsync( - - global::Ideogram.RemixImageRequestV4 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostRemixImageV4Arguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostRemixImageV4SecurityRequirements, - operationName: "PostRemixImageV4Async"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/ideogram-v4/remix", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.TextPrompt ?? string.Empty), - name: "\"text_prompt\""); - - if (request.ImageWeight != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.ImageWeight, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"image_weight\""); - - } - if (request.Resolution != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"resolution\""); - - } - if (request.RenderingSpeed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"rendering_speed\""); - - } - if (request.EnableCopyrightDetection != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"enable_copyright_detection\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostRemixImageV4Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImageV4", - methodName: "PostRemixImageV4Async", - pathTemplate: "\"/v1/ideogram-v4/remix\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImageV4", - methodName: "PostRemixImageV4Async", - pathTemplate: "\"/v1/ideogram-v4/remix\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImageV4", - methodName: "PostRemixImageV4Async", - pathTemplate: "\"/v1/ideogram-v4/remix\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostRemixImageV4Response( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImageV4", - methodName: "PostRemixImageV4Async", - pathTemplate: "\"/v1/ideogram-v4/remix\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImageV4", - methodName: "PostRemixImageV4Async", - pathTemplate: "\"/v1/ideogram-v4/remix\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt failed the safety check. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostRemixImageV4ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.ImageGenerationResponseV4.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.ImageGenerationResponseV4.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Remix with Ideogram 4.0
- /// Remix an image synchronously using the Ideogram 4.0 model with an initial image and a prompt.
- /// Mirrors `/v1/ideogram-v3/remix` semantics (including `image_weight` for how strongly the
- /// output should resemble the input image) but routes the request through the V_4_0 model.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The initial image binary (max 25MB); only JPEG, WebP and PNG formats are supported. - /// - /// - /// The initial image binary (max 25MB); only JPEG, WebP and PNG formats are supported. - /// - /// - /// The text prompt that guides the remix. - /// - /// - /// Optional. How strongly the output should resemble the input image. Higher values keep
- /// the input image's structure; lower values allow the prompt to drive the output more.
- /// When omitted, the weight is chosen automatically from the edit instruction; supplying
- /// a value overrides that automatic choice. Only accepted when the output keeps the input
- /// image's shape: combining image_weight with a resolution whose aspect ratio differs
- /// from the input image's is rejected with a 400. - /// - /// - /// Optional. When supplied, the images are generated at this resolution. When omitted,
- /// the input image's shape is kept. A resolution whose aspect ratio differs from the
- /// input image's cannot be combined with image_weight. - /// - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - /// - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). See GenerateImageRequestV3 for details. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostRemixImageV4Async( - byte[] image, - string imagename, - string textPrompt, - int? imageWeight = default, - global::Ideogram.ResolutionV4? resolution = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - bool? enableCopyrightDetection = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.RemixImageRequestV4 - { - Image = image, - Imagename = imagename, - TextPrompt = textPrompt, - ImageWeight = imageWeight, - Resolution = resolution, - RenderingSpeed = renderingSpeed, - EnableCopyrightDetection = enableCopyrightDetection, - }; - - return await PostRemixImageV4Async( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - - /// - /// Remix with Ideogram 4.0
- /// Remix an image synchronously using the Ideogram 4.0 model with an initial image and a prompt.
- /// Mirrors `/v1/ideogram-v3/remix` semantics (including `image_weight` for how strongly the
- /// output should resemble the input image) but routes the request through the V_4_0 model.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The initial image binary (max 25MB); only JPEG, WebP and PNG formats are supported. - /// - /// - /// The initial image binary (max 25MB); only JPEG, WebP and PNG formats are supported. - /// - /// - /// The text prompt that guides the remix. - /// - /// - /// Optional. How strongly the output should resemble the input image. Higher values keep
- /// the input image's structure; lower values allow the prompt to drive the output more.
- /// When omitted, the weight is chosen automatically from the edit instruction; supplying
- /// a value overrides that automatic choice. Only accepted when the output keeps the input
- /// image's shape: combining image_weight with a resolution whose aspect ratio differs
- /// from the input image's is rejected with a 400. - /// - /// - /// Optional. When supplied, the images are generated at this resolution. When omitted,
- /// the input image's shape is kept. A resolution whose aspect ratio differs from the
- /// input image's cannot be combined with image_weight. - /// - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - /// - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). See GenerateImageRequestV3 for details. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostRemixImageV4Async( - global::System.IO.Stream image, - string imagename, - string textPrompt, - int? imageWeight = default, - global::Ideogram.ResolutionV4? resolution = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - bool? enableCopyrightDetection = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - - image = image ?? throw new global::System.ArgumentNullException(nameof(image)); - var request = new global::Ideogram.RemixImageRequestV4 - { - Image = global::System.Array.Empty(), - Imagename = imagename, - TextPrompt = textPrompt, - ImageWeight = imageWeight, - Resolution = resolution, - RenderingSpeed = renderingSpeed, - EnableCopyrightDetection = enableCopyrightDetection, - }; - PrepareArguments( - client: HttpClient); - PreparePostRemixImageV4Arguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostRemixImageV4SecurityRequirements, - operationName: "PostRemixImageV4Async"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/ideogram-v4/remix", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - var __contentImage = new global::System.Net.Http.StreamContent(image); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.TextPrompt ?? string.Empty), - name: "\"text_prompt\""); - - if (request.ImageWeight != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.ImageWeight, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"image_weight\""); - - } - if (request.Resolution != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"resolution\""); - - } - if (request.RenderingSpeed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"rendering_speed\""); - - } - if (request.EnableCopyrightDetection != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"enable_copyright_detection\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostRemixImageV4Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImageV4", - methodName: "PostRemixImageV4Async", - pathTemplate: "\"/v1/ideogram-v4/remix\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImageV4", - methodName: "PostRemixImageV4Async", - pathTemplate: "\"/v1/ideogram-v4/remix\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImageV4", - methodName: "PostRemixImageV4Async", - pathTemplate: "\"/v1/ideogram-v4/remix\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostRemixImageV4Response( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImageV4", - methodName: "PostRemixImageV4Async", - pathTemplate: "\"/v1/ideogram-v4/remix\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImageV4", - methodName: "PostRemixImageV4Async", - pathTemplate: "\"/v1/ideogram-v4/remix\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt failed the safety check. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostRemixImageV4ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::Ideogram.ImageGenerationResponseV4.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - return - await global::Ideogram.ImageGenerationResponseV4.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Remix with Ideogram 4.0
- /// Remix an image synchronously using the Ideogram 4.0 model with an initial image and a prompt.
- /// Mirrors `/v1/ideogram-v3/remix` semantics (including `image_weight` for how strongly the
- /// output should resemble the input image) but routes the request through the V_4_0 model.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The initial image binary (max 25MB); only JPEG, WebP and PNG formats are supported. - /// - /// - /// The initial image binary (max 25MB); only JPEG, WebP and PNG formats are supported. - /// - /// - /// The text prompt that guides the remix. - /// - /// - /// Optional. How strongly the output should resemble the input image. Higher values keep
- /// the input image's structure; lower values allow the prompt to drive the output more.
- /// When omitted, the weight is chosen automatically from the edit instruction; supplying
- /// a value overrides that automatic choice. Only accepted when the output keeps the input
- /// image's shape: combining image_weight with a resolution whose aspect ratio differs
- /// from the input image's is rejected with a 400. - /// - /// - /// Optional. When supplied, the images are generated at this resolution. When omitted,
- /// the input image's shape is kept. A resolution whose aspect ratio differs from the
- /// input image's cannot be combined with image_weight. - /// - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - /// - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). See GenerateImageRequestV3 for details. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostRemixImageV4AsResponseAsync( - global::System.IO.Stream image, - string imagename, - string textPrompt, - int? imageWeight = default, - global::Ideogram.ResolutionV4? resolution = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - bool? enableCopyrightDetection = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - - image = image ?? throw new global::System.ArgumentNullException(nameof(image)); - var request = new global::Ideogram.RemixImageRequestV4 - { - Image = global::System.Array.Empty(), - Imagename = imagename, - TextPrompt = textPrompt, - ImageWeight = imageWeight, - Resolution = resolution, - RenderingSpeed = renderingSpeed, - EnableCopyrightDetection = enableCopyrightDetection, - }; - PrepareArguments( - client: HttpClient); - PreparePostRemixImageV4Arguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostRemixImageV4SecurityRequirements, - operationName: "PostRemixImageV4Async"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/ideogram-v4/remix", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - var __contentImage = new global::System.Net.Http.StreamContent(image); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.TextPrompt ?? string.Empty), - name: "\"text_prompt\""); - - if (request.ImageWeight != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.ImageWeight, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"image_weight\""); - - } - if (request.Resolution != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"resolution\""); - - } - if (request.RenderingSpeed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"rendering_speed\""); - - } - if (request.EnableCopyrightDetection != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"enable_copyright_detection\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostRemixImageV4Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImageV4", - methodName: "PostRemixImageV4Async", - pathTemplate: "\"/v1/ideogram-v4/remix\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImageV4", - methodName: "PostRemixImageV4Async", - pathTemplate: "\"/v1/ideogram-v4/remix\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImageV4", - methodName: "PostRemixImageV4Async", - pathTemplate: "\"/v1/ideogram-v4/remix\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostRemixImageV4Response( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImageV4", - methodName: "PostRemixImageV4Async", - pathTemplate: "\"/v1/ideogram-v4/remix\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImageV4", - methodName: "PostRemixImageV4Async", - pathTemplate: "\"/v1/ideogram-v4/remix\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt failed the safety check. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostRemixImageV4ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.ImageGenerationResponseV4.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.ImageGenerationResponseV4.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostRemixImageV4Async.g.cs b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostRemixImageV4Async.g.cs deleted file mode 100644 index 33d8ce43..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostRemixImageV4Async.g.cs +++ /dev/null @@ -1,2032 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class GenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostRemixImageV4AsyncSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostRemixImageV4AsyncSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostRemixImageV4AsyncSecurityRequirement0, - }; - partial void PreparePostRemixImageV4AsyncArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? webhookUrl, - global::Ideogram.RemixImageRequestV4 request); - partial void PreparePostRemixImageV4AsyncRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? webhookUrl, - global::Ideogram.RemixImageRequestV4 request); - partial void ProcessPostRemixImageV4AsyncResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostRemixImageV4AsyncResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Remix with Ideogram 4.0 asynchronously
- /// Accepts an Ideogram 4.0 remix request for asynchronous processing and returns
- /// immediately with a `generation_id`. Poll `GET /v1/generations/{generation_id}`
- /// to retrieve the result. If a `webhook_url` is supplied, the generated images
- /// are additionally POSTed to it once ready. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostRemixImageV4AsyncAsync( - - global::Ideogram.RemixImageRequestV4 request, - string? webhookUrl = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostRemixImageV4AsyncAsResponseAsync( - - request: request, - webhookUrl: webhookUrl, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Remix with Ideogram 4.0 asynchronously
- /// Accepts an Ideogram 4.0 remix request for asynchronous processing and returns
- /// immediately with a `generation_id`. Poll `GET /v1/generations/{generation_id}`
- /// to retrieve the result. If a `webhook_url` is supplied, the generated images
- /// are additionally POSTed to it once ready. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostRemixImageV4AsyncAsResponseAsync( - - global::Ideogram.RemixImageRequestV4 request, - string? webhookUrl = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostRemixImageV4AsyncArguments( - httpClient: HttpClient, - webhookUrl: ref webhookUrl, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostRemixImageV4AsyncSecurityRequirements, - operationName: "PostRemixImageV4AsyncAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/ideogram-v4/async/remix", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("webhook_url", webhookUrl) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.TextPrompt ?? string.Empty), - name: "\"text_prompt\""); - - if (request.ImageWeight != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.ImageWeight, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"image_weight\""); - - } - if (request.Resolution != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"resolution\""); - - } - if (request.RenderingSpeed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"rendering_speed\""); - - } - if (request.EnableCopyrightDetection != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"enable_copyright_detection\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostRemixImageV4AsyncRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - webhookUrl: webhookUrl, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImageV4Async", - methodName: "PostRemixImageV4AsyncAsync", - pathTemplate: "\"/v1/ideogram-v4/async/remix\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImageV4Async", - methodName: "PostRemixImageV4AsyncAsync", - pathTemplate: "\"/v1/ideogram-v4/async/remix\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImageV4Async", - methodName: "PostRemixImageV4AsyncAsync", - pathTemplate: "\"/v1/ideogram-v4/async/remix\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostRemixImageV4AsyncResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImageV4Async", - methodName: "PostRemixImageV4AsyncAsync", - pathTemplate: "\"/v1/ideogram-v4/async/remix\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImageV4Async", - methodName: "PostRemixImageV4AsyncAsync", - pathTemplate: "\"/v1/ideogram-v4/async/remix\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt failed the safety check. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostRemixImageV4AsyncResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.AsyncImageGenerationResponseV4.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.AsyncImageGenerationResponseV4.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Remix with Ideogram 4.0 asynchronously
- /// Accepts an Ideogram 4.0 remix request for asynchronous processing and returns
- /// immediately with a `generation_id`. Poll `GET /v1/generations/{generation_id}`
- /// to retrieve the result. If a `webhook_url` is supplied, the generated images
- /// are additionally POSTed to it once ready. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// The initial image binary (max 25MB); only JPEG, WebP and PNG formats are supported. - /// - /// - /// The initial image binary (max 25MB); only JPEG, WebP and PNG formats are supported. - /// - /// - /// The text prompt that guides the remix. - /// - /// - /// Optional. How strongly the output should resemble the input image. Higher values keep
- /// the input image's structure; lower values allow the prompt to drive the output more.
- /// When omitted, the weight is chosen automatically from the edit instruction; supplying
- /// a value overrides that automatic choice. Only accepted when the output keeps the input
- /// image's shape: combining image_weight with a resolution whose aspect ratio differs
- /// from the input image's is rejected with a 400. - /// - /// - /// Optional. When supplied, the images are generated at this resolution. When omitted,
- /// the input image's shape is kept. A resolution whose aspect ratio differs from the
- /// input image's cannot be combined with image_weight. - /// - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - /// - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). See GenerateImageRequestV3 for details. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostRemixImageV4AsyncAsync( - byte[] image, - string imagename, - string textPrompt, - string? webhookUrl = default, - int? imageWeight = default, - global::Ideogram.ResolutionV4? resolution = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - bool? enableCopyrightDetection = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.RemixImageRequestV4 - { - Image = image, - Imagename = imagename, - TextPrompt = textPrompt, - ImageWeight = imageWeight, - Resolution = resolution, - RenderingSpeed = renderingSpeed, - EnableCopyrightDetection = enableCopyrightDetection, - }; - - return await PostRemixImageV4AsyncAsync( - webhookUrl: webhookUrl, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - - /// - /// Remix with Ideogram 4.0 asynchronously
- /// Accepts an Ideogram 4.0 remix request for asynchronous processing and returns
- /// immediately with a `generation_id`. Poll `GET /v1/generations/{generation_id}`
- /// to retrieve the result. If a `webhook_url` is supplied, the generated images
- /// are additionally POSTed to it once ready. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// The initial image binary (max 25MB); only JPEG, WebP and PNG formats are supported. - /// - /// - /// The initial image binary (max 25MB); only JPEG, WebP and PNG formats are supported. - /// - /// - /// The text prompt that guides the remix. - /// - /// - /// Optional. How strongly the output should resemble the input image. Higher values keep
- /// the input image's structure; lower values allow the prompt to drive the output more.
- /// When omitted, the weight is chosen automatically from the edit instruction; supplying
- /// a value overrides that automatic choice. Only accepted when the output keeps the input
- /// image's shape: combining image_weight with a resolution whose aspect ratio differs
- /// from the input image's is rejected with a 400. - /// - /// - /// Optional. When supplied, the images are generated at this resolution. When omitted,
- /// the input image's shape is kept. A resolution whose aspect ratio differs from the
- /// input image's cannot be combined with image_weight. - /// - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - /// - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). See GenerateImageRequestV3 for details. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostRemixImageV4AsyncAsync( - global::System.IO.Stream image, - string imagename, - string textPrompt, - string? webhookUrl = default, - int? imageWeight = default, - global::Ideogram.ResolutionV4? resolution = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - bool? enableCopyrightDetection = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - - image = image ?? throw new global::System.ArgumentNullException(nameof(image)); - var request = new global::Ideogram.RemixImageRequestV4 - { - Image = global::System.Array.Empty(), - Imagename = imagename, - TextPrompt = textPrompt, - ImageWeight = imageWeight, - Resolution = resolution, - RenderingSpeed = renderingSpeed, - EnableCopyrightDetection = enableCopyrightDetection, - }; - PrepareArguments( - client: HttpClient); - PreparePostRemixImageV4AsyncArguments( - httpClient: HttpClient, - webhookUrl: ref webhookUrl, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostRemixImageV4AsyncSecurityRequirements, - operationName: "PostRemixImageV4AsyncAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/ideogram-v4/async/remix", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("webhook_url", webhookUrl) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - var __contentImage = new global::System.Net.Http.StreamContent(image); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.TextPrompt ?? string.Empty), - name: "\"text_prompt\""); - - if (request.ImageWeight != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.ImageWeight, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"image_weight\""); - - } - if (request.Resolution != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"resolution\""); - - } - if (request.RenderingSpeed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"rendering_speed\""); - - } - if (request.EnableCopyrightDetection != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"enable_copyright_detection\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostRemixImageV4AsyncRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - webhookUrl: webhookUrl, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImageV4Async", - methodName: "PostRemixImageV4AsyncAsync", - pathTemplate: "\"/v1/ideogram-v4/async/remix\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImageV4Async", - methodName: "PostRemixImageV4AsyncAsync", - pathTemplate: "\"/v1/ideogram-v4/async/remix\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImageV4Async", - methodName: "PostRemixImageV4AsyncAsync", - pathTemplate: "\"/v1/ideogram-v4/async/remix\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostRemixImageV4AsyncResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImageV4Async", - methodName: "PostRemixImageV4AsyncAsync", - pathTemplate: "\"/v1/ideogram-v4/async/remix\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImageV4Async", - methodName: "PostRemixImageV4AsyncAsync", - pathTemplate: "\"/v1/ideogram-v4/async/remix\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt failed the safety check. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostRemixImageV4AsyncResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::Ideogram.AsyncImageGenerationResponseV4.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - return - await global::Ideogram.AsyncImageGenerationResponseV4.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Remix with Ideogram 4.0 asynchronously
- /// Accepts an Ideogram 4.0 remix request for asynchronous processing and returns
- /// immediately with a `generation_id`. Poll `GET /v1/generations/{generation_id}`
- /// to retrieve the result. If a `webhook_url` is supplied, the generated images
- /// are additionally POSTed to it once ready. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// The initial image binary (max 25MB); only JPEG, WebP and PNG formats are supported. - /// - /// - /// The initial image binary (max 25MB); only JPEG, WebP and PNG formats are supported. - /// - /// - /// The text prompt that guides the remix. - /// - /// - /// Optional. How strongly the output should resemble the input image. Higher values keep
- /// the input image's structure; lower values allow the prompt to drive the output more.
- /// When omitted, the weight is chosen automatically from the edit instruction; supplying
- /// a value overrides that automatic choice. Only accepted when the output keeps the input
- /// image's shape: combining image_weight with a resolution whose aspect ratio differs
- /// from the input image's is rejected with a 400. - /// - /// - /// Optional. When supplied, the images are generated at this resolution. When omitted,
- /// the input image's shape is kept. A resolution whose aspect ratio differs from the
- /// input image's cannot be combined with image_weight. - /// - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - /// - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). See GenerateImageRequestV3 for details. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostRemixImageV4AsyncAsResponseAsync( - global::System.IO.Stream image, - string imagename, - string textPrompt, - string? webhookUrl = default, - int? imageWeight = default, - global::Ideogram.ResolutionV4? resolution = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - bool? enableCopyrightDetection = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - - image = image ?? throw new global::System.ArgumentNullException(nameof(image)); - var request = new global::Ideogram.RemixImageRequestV4 - { - Image = global::System.Array.Empty(), - Imagename = imagename, - TextPrompt = textPrompt, - ImageWeight = imageWeight, - Resolution = resolution, - RenderingSpeed = renderingSpeed, - EnableCopyrightDetection = enableCopyrightDetection, - }; - PrepareArguments( - client: HttpClient); - PreparePostRemixImageV4AsyncArguments( - httpClient: HttpClient, - webhookUrl: ref webhookUrl, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostRemixImageV4AsyncSecurityRequirements, - operationName: "PostRemixImageV4AsyncAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/ideogram-v4/async/remix", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("webhook_url", webhookUrl) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - var __contentImage = new global::System.Net.Http.StreamContent(image); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.TextPrompt ?? string.Empty), - name: "\"text_prompt\""); - - if (request.ImageWeight != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.ImageWeight, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"image_weight\""); - - } - if (request.Resolution != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"resolution\""); - - } - if (request.RenderingSpeed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"rendering_speed\""); - - } - if (request.EnableCopyrightDetection != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"enable_copyright_detection\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostRemixImageV4AsyncRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - webhookUrl: webhookUrl, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImageV4Async", - methodName: "PostRemixImageV4AsyncAsync", - pathTemplate: "\"/v1/ideogram-v4/async/remix\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImageV4Async", - methodName: "PostRemixImageV4AsyncAsync", - pathTemplate: "\"/v1/ideogram-v4/async/remix\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImageV4Async", - methodName: "PostRemixImageV4AsyncAsync", - pathTemplate: "\"/v1/ideogram-v4/async/remix\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostRemixImageV4AsyncResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImageV4Async", - methodName: "PostRemixImageV4AsyncAsync", - pathTemplate: "\"/v1/ideogram-v4/async/remix\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImageV4Async", - methodName: "PostRemixImageV4AsyncAsync", - pathTemplate: "\"/v1/ideogram-v4/async/remix\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt failed the safety check. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostRemixImageV4AsyncResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.AsyncImageGenerationResponseV4.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.AsyncImageGenerationResponseV4.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostRemoveBackground.g.cs b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostRemoveBackground.g.cs deleted file mode 100644 index 1f9ab252..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostRemoveBackground.g.cs +++ /dev/null @@ -1,1745 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class GenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostRemoveBackgroundSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostRemoveBackgroundSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostRemoveBackgroundSecurityRequirement0, - }; - partial void PreparePostRemoveBackgroundArguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.RemoveBackgroundRequest request); - partial void PreparePostRemoveBackgroundRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.RemoveBackgroundRequest request); - partial void ProcessPostRemoveBackgroundResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostRemoveBackgroundResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Remove Background
- /// Remove the background of a given image synchronously. The foreground subject
- /// is identified and returned on a transparent background. Supported image formats include JPEG,
- /// PNG, and WebP.
- /// Image links are available for a limited period of time; if you would like to keep the image,
- /// you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostRemoveBackgroundAsync( - - global::Ideogram.RemoveBackgroundRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostRemoveBackgroundAsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Remove Background
- /// Remove the background of a given image synchronously. The foreground subject
- /// is identified and returned on a transparent background. Supported image formats include JPEG,
- /// PNG, and WebP.
- /// Image links are available for a limited period of time; if you would like to keep the image,
- /// you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostRemoveBackgroundAsResponseAsync( - - global::Ideogram.RemoveBackgroundRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostRemoveBackgroundArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostRemoveBackgroundSecurityRequirements, - operationName: "PostRemoveBackgroundAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/remove-background", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostRemoveBackgroundRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemoveBackground", - methodName: "PostRemoveBackgroundAsync", - pathTemplate: "\"/v1/remove-background\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemoveBackground", - methodName: "PostRemoveBackgroundAsync", - pathTemplate: "\"/v1/remove-background\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemoveBackground", - methodName: "PostRemoveBackgroundAsync", - pathTemplate: "\"/v1/remove-background\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostRemoveBackgroundResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemoveBackground", - methodName: "PostRemoveBackgroundAsync", - pathTemplate: "\"/v1/remove-background\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemoveBackground", - methodName: "PostRemoveBackgroundAsync", - pathTemplate: "\"/v1/remove-background\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Initial image failed the safety checks. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostRemoveBackgroundResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.RemoveBackgroundResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.RemoveBackgroundResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Remove Background
- /// Remove the background of a given image synchronously. The foreground subject
- /// is identified and returned on a transparent background. Supported image formats include JPEG,
- /// PNG, and WebP.
- /// Image links are available for a limited period of time; if you would like to keep the image,
- /// you must download it. - ///
- /// - /// The image whose background is being removed (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The image whose background is being removed (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostRemoveBackgroundAsync( - byte[] image, - string imagename, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.RemoveBackgroundRequest - { - Image = image, - Imagename = imagename, - }; - - return await PostRemoveBackgroundAsync( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - - /// - /// Remove Background
- /// Remove the background of a given image synchronously. The foreground subject
- /// is identified and returned on a transparent background. Supported image formats include JPEG,
- /// PNG, and WebP.
- /// Image links are available for a limited period of time; if you would like to keep the image,
- /// you must download it. - ///
- /// - /// The image whose background is being removed (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The image whose background is being removed (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostRemoveBackgroundAsync( - global::System.IO.Stream image, - string imagename, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - - image = image ?? throw new global::System.ArgumentNullException(nameof(image)); - var request = new global::Ideogram.RemoveBackgroundRequest - { - Image = global::System.Array.Empty(), - Imagename = imagename, - }; - PrepareArguments( - client: HttpClient); - PreparePostRemoveBackgroundArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostRemoveBackgroundSecurityRequirements, - operationName: "PostRemoveBackgroundAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/remove-background", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - var __contentImage = new global::System.Net.Http.StreamContent(image); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostRemoveBackgroundRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemoveBackground", - methodName: "PostRemoveBackgroundAsync", - pathTemplate: "\"/v1/remove-background\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemoveBackground", - methodName: "PostRemoveBackgroundAsync", - pathTemplate: "\"/v1/remove-background\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemoveBackground", - methodName: "PostRemoveBackgroundAsync", - pathTemplate: "\"/v1/remove-background\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostRemoveBackgroundResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemoveBackground", - methodName: "PostRemoveBackgroundAsync", - pathTemplate: "\"/v1/remove-background\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemoveBackground", - methodName: "PostRemoveBackgroundAsync", - pathTemplate: "\"/v1/remove-background\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Initial image failed the safety checks. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostRemoveBackgroundResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::Ideogram.RemoveBackgroundResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - return - await global::Ideogram.RemoveBackgroundResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Remove Background
- /// Remove the background of a given image synchronously. The foreground subject
- /// is identified and returned on a transparent background. Supported image formats include JPEG,
- /// PNG, and WebP.
- /// Image links are available for a limited period of time; if you would like to keep the image,
- /// you must download it. - ///
- /// - /// The image whose background is being removed (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The image whose background is being removed (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostRemoveBackgroundAsResponseAsync( - global::System.IO.Stream image, - string imagename, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - - image = image ?? throw new global::System.ArgumentNullException(nameof(image)); - var request = new global::Ideogram.RemoveBackgroundRequest - { - Image = global::System.Array.Empty(), - Imagename = imagename, - }; - PrepareArguments( - client: HttpClient); - PreparePostRemoveBackgroundArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostRemoveBackgroundSecurityRequirements, - operationName: "PostRemoveBackgroundAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/remove-background", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - var __contentImage = new global::System.Net.Http.StreamContent(image); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostRemoveBackgroundRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemoveBackground", - methodName: "PostRemoveBackgroundAsync", - pathTemplate: "\"/v1/remove-background\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemoveBackground", - methodName: "PostRemoveBackgroundAsync", - pathTemplate: "\"/v1/remove-background\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemoveBackground", - methodName: "PostRemoveBackgroundAsync", - pathTemplate: "\"/v1/remove-background\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostRemoveBackgroundResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemoveBackground", - methodName: "PostRemoveBackgroundAsync", - pathTemplate: "\"/v1/remove-background\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemoveBackground", - methodName: "PostRemoveBackgroundAsync", - pathTemplate: "\"/v1/remove-background\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Initial image failed the safety checks. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostRemoveBackgroundResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.RemoveBackgroundResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.RemoveBackgroundResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostRemoveObject.g.cs b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostRemoveObject.g.cs deleted file mode 100644 index 0c65eeb8..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostRemoveObject.g.cs +++ /dev/null @@ -1,2033 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class GenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostRemoveObjectSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostRemoveObjectSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostRemoveObjectSecurityRequirement0, - }; - partial void PreparePostRemoveObjectArguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.RemoveObjectRequest request); - partial void PreparePostRemoveObjectRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.RemoveObjectRequest request); - partial void ProcessPostRemoveObjectResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostRemoveObjectResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Remove Object
- /// Remove a masked object from a given image synchronously. Supply the image and a binary mask marking the region to remove (white = remove); the masked region is regenerated to blend with the surrounding scene. Supported image formats include JPEG, PNG, and WebP. Image links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostRemoveObjectAsync( - - global::Ideogram.RemoveObjectRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostRemoveObjectAsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Remove Object
- /// Remove a masked object from a given image synchronously. Supply the image and a binary mask marking the region to remove (white = remove); the masked region is regenerated to blend with the surrounding scene. Supported image formats include JPEG, PNG, and WebP. Image links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostRemoveObjectAsResponseAsync( - - global::Ideogram.RemoveObjectRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostRemoveObjectArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostRemoveObjectSecurityRequirements, - operationName: "PostRemoveObjectAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/remove-object", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - var __contentMask = new global::System.Net.Http.ByteArrayContent(request.Mask ?? global::System.Array.Empty()); - __contentMask.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Maskname is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Maskname) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentMask, - name: "\"mask\"", - fileName: request.Maskname != null ? $"\"{request.Maskname}\"" : string.Empty); - if (__contentMask.Headers.ContentDisposition != null) - { - __contentMask.Headers.ContentDisposition.FileNameStar = null; - } - - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.NumInferenceSteps != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumInferenceSteps, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_inference_steps\""); - - } - if (request.GuidanceScale != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.GuidanceScale, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"guidance_scale\""); - - } - if (request.RenderingSpeed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"rendering_speed\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostRemoveObjectRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemoveObject", - methodName: "PostRemoveObjectAsync", - pathTemplate: "\"/v1/remove-object\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemoveObject", - methodName: "PostRemoveObjectAsync", - pathTemplate: "\"/v1/remove-object\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemoveObject", - methodName: "PostRemoveObjectAsync", - pathTemplate: "\"/v1/remove-object\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostRemoveObjectResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemoveObject", - methodName: "PostRemoveObjectAsync", - pathTemplate: "\"/v1/remove-object\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemoveObject", - methodName: "PostRemoveObjectAsync", - pathTemplate: "\"/v1/remove-object\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Initial image failed the safety checks. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostRemoveObjectResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.RemoveObjectResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.RemoveObjectResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Remove Object
- /// Remove a masked object from a given image synchronously. Supply the image and a binary mask marking the region to remove (white = remove); the masked region is regenerated to blend with the surrounding scene. Supported image formats include JPEG, PNG, and WebP. Image links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The image to remove an object from (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The image to remove an object from (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// A binary mask the same size as the image; white (>= 128) marks the region to remove. Only JPEG, WebP and PNG formats are supported. - /// - /// - /// A binary mask the same size as the image; white (>= 128) marks the region to remove. Only JPEG, WebP and PNG formats are supported. - /// - /// - /// Optional random seed for reproducible output. When omitted, a random seed is chosen. - /// - /// - /// Optional number of diffusion steps. Higher is slower but can improve quality; values are clamped to [1, 128]. When omitted, the model default is used. - /// - /// - /// Optional classifier-free guidance (CFG) scale. Higher follows the removal instruction more strongly; values are clamped to [1, 10]. When omitted, the model default is used. - /// - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostRemoveObjectAsync( - byte[] image, - string imagename, - byte[] mask, - string maskname, - int? seed = default, - int? numInferenceSteps = default, - float? guidanceScale = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.RemoveObjectRequest - { - Image = image, - Imagename = imagename, - Mask = mask, - Maskname = maskname, - Seed = seed, - NumInferenceSteps = numInferenceSteps, - GuidanceScale = guidanceScale, - RenderingSpeed = renderingSpeed, - }; - - return await PostRemoveObjectAsync( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - - /// - /// Remove Object
- /// Remove a masked object from a given image synchronously. Supply the image and a binary mask marking the region to remove (white = remove); the masked region is regenerated to blend with the surrounding scene. Supported image formats include JPEG, PNG, and WebP. Image links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The image to remove an object from (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The image to remove an object from (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// A binary mask the same size as the image; white (>= 128) marks the region to remove. Only JPEG, WebP and PNG formats are supported. - /// - /// - /// A binary mask the same size as the image; white (>= 128) marks the region to remove. Only JPEG, WebP and PNG formats are supported. - /// - /// - /// Optional random seed for reproducible output. When omitted, a random seed is chosen. - /// - /// - /// Optional number of diffusion steps. Higher is slower but can improve quality; values are clamped to [1, 128]. When omitted, the model default is used. - /// - /// - /// Optional classifier-free guidance (CFG) scale. Higher follows the removal instruction more strongly; values are clamped to [1, 10]. When omitted, the model default is used. - /// - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostRemoveObjectAsync( - global::System.IO.Stream image, - string imagename, - global::System.IO.Stream mask, - string maskname, - int? seed = default, - int? numInferenceSteps = default, - float? guidanceScale = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - - image = image ?? throw new global::System.ArgumentNullException(nameof(image)); - mask = mask ?? throw new global::System.ArgumentNullException(nameof(mask)); - var request = new global::Ideogram.RemoveObjectRequest - { - Image = global::System.Array.Empty(), - Imagename = imagename, - Mask = global::System.Array.Empty(), - Maskname = maskname, - Seed = seed, - NumInferenceSteps = numInferenceSteps, - GuidanceScale = guidanceScale, - RenderingSpeed = renderingSpeed, - }; - PrepareArguments( - client: HttpClient); - PreparePostRemoveObjectArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostRemoveObjectSecurityRequirements, - operationName: "PostRemoveObjectAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/remove-object", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - var __contentImage = new global::System.Net.Http.StreamContent(image); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - var __contentMask = new global::System.Net.Http.StreamContent(mask); - __contentMask.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Maskname is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Maskname) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentMask, - name: "\"mask\"", - fileName: request.Maskname != null ? $"\"{request.Maskname}\"" : string.Empty); - if (__contentMask.Headers.ContentDisposition != null) - { - __contentMask.Headers.ContentDisposition.FileNameStar = null; - } - - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.NumInferenceSteps != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumInferenceSteps, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_inference_steps\""); - - } - if (request.GuidanceScale != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.GuidanceScale, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"guidance_scale\""); - - } - if (request.RenderingSpeed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"rendering_speed\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostRemoveObjectRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemoveObject", - methodName: "PostRemoveObjectAsync", - pathTemplate: "\"/v1/remove-object\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemoveObject", - methodName: "PostRemoveObjectAsync", - pathTemplate: "\"/v1/remove-object\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemoveObject", - methodName: "PostRemoveObjectAsync", - pathTemplate: "\"/v1/remove-object\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostRemoveObjectResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemoveObject", - methodName: "PostRemoveObjectAsync", - pathTemplate: "\"/v1/remove-object\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemoveObject", - methodName: "PostRemoveObjectAsync", - pathTemplate: "\"/v1/remove-object\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Initial image failed the safety checks. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostRemoveObjectResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::Ideogram.RemoveObjectResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - return - await global::Ideogram.RemoveObjectResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Remove Object
- /// Remove a masked object from a given image synchronously. Supply the image and a binary mask marking the region to remove (white = remove); the masked region is regenerated to blend with the surrounding scene. Supported image formats include JPEG, PNG, and WebP. Image links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The image to remove an object from (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The image to remove an object from (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// A binary mask the same size as the image; white (>= 128) marks the region to remove. Only JPEG, WebP and PNG formats are supported. - /// - /// - /// A binary mask the same size as the image; white (>= 128) marks the region to remove. Only JPEG, WebP and PNG formats are supported. - /// - /// - /// Optional random seed for reproducible output. When omitted, a random seed is chosen. - /// - /// - /// Optional number of diffusion steps. Higher is slower but can improve quality; values are clamped to [1, 128]. When omitted, the model default is used. - /// - /// - /// Optional classifier-free guidance (CFG) scale. Higher follows the removal instruction more strongly; values are clamped to [1, 10]. When omitted, the model default is used. - /// - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostRemoveObjectAsResponseAsync( - global::System.IO.Stream image, - string imagename, - global::System.IO.Stream mask, - string maskname, - int? seed = default, - int? numInferenceSteps = default, - float? guidanceScale = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - - image = image ?? throw new global::System.ArgumentNullException(nameof(image)); - mask = mask ?? throw new global::System.ArgumentNullException(nameof(mask)); - var request = new global::Ideogram.RemoveObjectRequest - { - Image = global::System.Array.Empty(), - Imagename = imagename, - Mask = global::System.Array.Empty(), - Maskname = maskname, - Seed = seed, - NumInferenceSteps = numInferenceSteps, - GuidanceScale = guidanceScale, - RenderingSpeed = renderingSpeed, - }; - PrepareArguments( - client: HttpClient); - PreparePostRemoveObjectArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostRemoveObjectSecurityRequirements, - operationName: "PostRemoveObjectAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/remove-object", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - var __contentImage = new global::System.Net.Http.StreamContent(image); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - var __contentMask = new global::System.Net.Http.StreamContent(mask); - __contentMask.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Maskname is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Maskname) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentMask, - name: "\"mask\"", - fileName: request.Maskname != null ? $"\"{request.Maskname}\"" : string.Empty); - if (__contentMask.Headers.ContentDisposition != null) - { - __contentMask.Headers.ContentDisposition.FileNameStar = null; - } - - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.NumInferenceSteps != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumInferenceSteps, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_inference_steps\""); - - } - if (request.GuidanceScale != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.GuidanceScale, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"guidance_scale\""); - - } - if (request.RenderingSpeed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"rendering_speed\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostRemoveObjectRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemoveObject", - methodName: "PostRemoveObjectAsync", - pathTemplate: "\"/v1/remove-object\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemoveObject", - methodName: "PostRemoveObjectAsync", - pathTemplate: "\"/v1/remove-object\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemoveObject", - methodName: "PostRemoveObjectAsync", - pathTemplate: "\"/v1/remove-object\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostRemoveObjectResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemoveObject", - methodName: "PostRemoveObjectAsync", - pathTemplate: "\"/v1/remove-object\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemoveObject", - methodName: "PostRemoveObjectAsync", - pathTemplate: "\"/v1/remove-object\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Initial image failed the safety checks. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostRemoveObjectResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.RemoveObjectResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.RemoveObjectResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostReplaceBackgroundV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostReplaceBackgroundV3.g.cs deleted file mode 100644 index f6644667..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostReplaceBackgroundV3.g.cs +++ /dev/null @@ -1,2244 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class GenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostReplaceBackgroundV3SecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostReplaceBackgroundV3SecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostReplaceBackgroundV3SecurityRequirement0, - }; - partial void PreparePostReplaceBackgroundV3Arguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.ReplaceBackgroundRequestV3 request); - partial void PreparePostReplaceBackgroundV3Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.ReplaceBackgroundRequestV3 request); - partial void ProcessPostReplaceBackgroundV3Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostReplaceBackgroundV3ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Replace Background with Ideogram 3.0
- /// Replace the background of a given image synchronously using a prompt with Ideogram 3.0. The foreground subject
- /// will be identified and kept, while the background is replaced based on the prompt and chosen style.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostReplaceBackgroundV3Async( - - global::Ideogram.ReplaceBackgroundRequestV3 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostReplaceBackgroundV3AsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Replace Background with Ideogram 3.0
- /// Replace the background of a given image synchronously using a prompt with Ideogram 3.0. The foreground subject
- /// will be identified and kept, while the background is replaced based on the prompt and chosen style.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostReplaceBackgroundV3AsResponseAsync( - - global::Ideogram.ReplaceBackgroundRequestV3 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostReplaceBackgroundV3Arguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostReplaceBackgroundV3SecurityRequirements, - operationName: "PostReplaceBackgroundV3Async"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/ideogram-v3/replace-background", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - if (request.MagicPrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.MagicPrompt).HasValue ? (request.MagicPrompt).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"magic_prompt\""); - - } - if (request.MagicPromptSystemPromptConfigId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.MagicPromptSystemPromptConfigId ?? string.Empty), - name: "\"magic_prompt_system_prompt_config_id\""); - - } - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.RenderingSpeed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"rendering_speed\""); - - } - if (request.StylePreset != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.StylePreset).HasValue ? (request.StylePreset).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"style_preset\""); - - } - if (request.ColorPalette != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ColorPalette.ToString() ?? string.Empty), - name: "\"color_palette\""); - - } - if (request.StyleCodes != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.StyleCodes!, x => x))}]"), - name: "\"style_codes\""); - - } - if (request.StyleReferenceImages != default) - { - - for (var __iStyleReferenceImages = 0; __iStyleReferenceImages < request.StyleReferenceImages.Count; __iStyleReferenceImages++) - { - var __contentStyleReferenceImages = new global::System.Net.Http.ByteArrayContent(request.StyleReferenceImages[__iStyleReferenceImages]); - __contentStyleReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); - __httpRequestContent.Add( - content: __contentStyleReferenceImages, - name: "\"style_reference_images\"", - fileName: $"\"file{__iStyleReferenceImages}.bin\""); - if (__contentStyleReferenceImages.Headers.ContentDisposition != null) - { - __contentStyleReferenceImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostReplaceBackgroundV3Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostReplaceBackgroundV3", - methodName: "PostReplaceBackgroundV3Async", - pathTemplate: "\"/v1/ideogram-v3/replace-background\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostReplaceBackgroundV3", - methodName: "PostReplaceBackgroundV3Async", - pathTemplate: "\"/v1/ideogram-v3/replace-background\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostReplaceBackgroundV3", - methodName: "PostReplaceBackgroundV3Async", - pathTemplate: "\"/v1/ideogram-v3/replace-background\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostReplaceBackgroundV3Response( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostReplaceBackgroundV3", - methodName: "PostReplaceBackgroundV3Async", - pathTemplate: "\"/v1/ideogram-v3/replace-background\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostReplaceBackgroundV3", - methodName: "PostReplaceBackgroundV3Async", - pathTemplate: "\"/v1/ideogram-v3/replace-background\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt or Initial Image failed the safety checks. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostReplaceBackgroundV3ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.ImageGenerationResponseV3.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.ImageGenerationResponseV3.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Replace Background with Ideogram 3.0
- /// Replace the background of a given image synchronously using a prompt with Ideogram 3.0. The foreground subject
- /// will be identified and kept, while the background is replaced based on the prompt and chosen style.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The image whose background is being replaced (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The image whose background is being replaced (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The prompt describing the desired new background.
- /// Example: A vibrant cityscape at night. - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - /// - /// - /// A predefined style preset that applies a specific artistic style to the generated image.
- /// Example: BRIGHT_ART - /// - /// - /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). Not supported by V_1, V_1_TURBO, V_2A and V_2A_TURBO models. - /// - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - /// - /// - /// A set of images to use as style references (max size 25MB per image; the whole request must stay under 50MB). The images should be in JPEG, PNG or WebP format. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostReplaceBackgroundV3Async( - byte[] image, - string imagename, - string prompt, - global::Ideogram.MagicPromptOption? magicPrompt = default, - string? magicPromptSystemPromptConfigId = default, - int? numImages = default, - int? seed = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - global::Ideogram.StylePresetV3? stylePreset = default, - global::Ideogram.ColorPaletteWithPresetNameOrMembers? colorPalette = default, - global::System.Collections.Generic.IList? styleCodes = default, - global::System.Collections.Generic.IList? styleReferenceImages = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.ReplaceBackgroundRequestV3 - { - Image = image, - Imagename = imagename, - Prompt = prompt, - MagicPrompt = magicPrompt, - MagicPromptSystemPromptConfigId = magicPromptSystemPromptConfigId, - NumImages = numImages, - Seed = seed, - RenderingSpeed = renderingSpeed, - StylePreset = stylePreset, - ColorPalette = colorPalette, - StyleCodes = styleCodes, - StyleReferenceImages = styleReferenceImages, - }; - - return await PostReplaceBackgroundV3Async( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - - /// - /// Replace Background with Ideogram 3.0
- /// Replace the background of a given image synchronously using a prompt with Ideogram 3.0. The foreground subject
- /// will be identified and kept, while the background is replaced based on the prompt and chosen style.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The image whose background is being replaced (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The image whose background is being replaced (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The prompt describing the desired new background.
- /// Example: A vibrant cityscape at night. - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - /// - /// - /// A predefined style preset that applies a specific artistic style to the generated image.
- /// Example: BRIGHT_ART - /// - /// - /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). Not supported by V_1, V_1_TURBO, V_2A and V_2A_TURBO models. - /// - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - /// - /// - /// A set of images to use as style references (max size 25MB per image; the whole request must stay under 50MB). The images should be in JPEG, PNG or WebP format. - /// - /// - /// Optional file names to use for the multipart 'style_reference_images' file parts. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostReplaceBackgroundV3Async( - global::System.IO.Stream image, - string imagename, - string prompt, - global::Ideogram.MagicPromptOption? magicPrompt = default, - string? magicPromptSystemPromptConfigId = default, - int? numImages = default, - int? seed = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - global::Ideogram.StylePresetV3? stylePreset = default, - global::Ideogram.ColorPaletteWithPresetNameOrMembers? colorPalette = default, - global::System.Collections.Generic.IList? styleCodes = default, - global::System.Collections.Generic.IReadOnlyList? styleReferenceImages = default, - global::System.Collections.Generic.IReadOnlyList? styleReferenceImagesFileNames = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - - image = image ?? throw new global::System.ArgumentNullException(nameof(image)); - var request = new global::Ideogram.ReplaceBackgroundRequestV3 - { - Image = global::System.Array.Empty(), - Imagename = imagename, - Prompt = prompt, - MagicPrompt = magicPrompt, - MagicPromptSystemPromptConfigId = magicPromptSystemPromptConfigId, - NumImages = numImages, - Seed = seed, - RenderingSpeed = renderingSpeed, - StylePreset = stylePreset, - ColorPalette = colorPalette, - StyleCodes = styleCodes, - StyleReferenceImages = new global::System.Collections.Generic.List(), - }; - PrepareArguments( - client: HttpClient); - PreparePostReplaceBackgroundV3Arguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostReplaceBackgroundV3SecurityRequirements, - operationName: "PostReplaceBackgroundV3Async"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/ideogram-v3/replace-background", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - var __contentImage = new global::System.Net.Http.StreamContent(image); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - if (request.MagicPrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.MagicPrompt).HasValue ? (request.MagicPrompt).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"magic_prompt\""); - - } - if (request.MagicPromptSystemPromptConfigId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.MagicPromptSystemPromptConfigId ?? string.Empty), - name: "\"magic_prompt_system_prompt_config_id\""); - - } - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.RenderingSpeed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"rendering_speed\""); - - } - if (request.StylePreset != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.StylePreset).HasValue ? (request.StylePreset).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"style_preset\""); - - } - if (request.ColorPalette != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ColorPalette.ToString() ?? string.Empty), - name: "\"color_palette\""); - - } - if (request.StyleCodes != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.StyleCodes!, x => x))}]"), - name: "\"style_codes\""); - - } - if (styleReferenceImages != default) - { - - for (var __iStyleReferenceImages = 0; __iStyleReferenceImages < styleReferenceImages.Count; __iStyleReferenceImages++) - { - var __fileNameStyleReferenceImages = styleReferenceImagesFileNames != null && - __iStyleReferenceImages < styleReferenceImagesFileNames.Count && - styleReferenceImagesFileNames[__iStyleReferenceImages] != null - ? styleReferenceImagesFileNames[__iStyleReferenceImages] - : $"file{__iStyleReferenceImages}.bin"; - var __contentStyleReferenceImages = new global::System.Net.Http.StreamContent(styleReferenceImages[__iStyleReferenceImages]); - __contentStyleReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - __fileNameStyleReferenceImages is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(__fileNameStyleReferenceImages) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentStyleReferenceImages, - name: "\"style_reference_images\"", - fileName: $"\"{__fileNameStyleReferenceImages}\""); - if (__contentStyleReferenceImages.Headers.ContentDisposition != null) - { - __contentStyleReferenceImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostReplaceBackgroundV3Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostReplaceBackgroundV3", - methodName: "PostReplaceBackgroundV3Async", - pathTemplate: "\"/v1/ideogram-v3/replace-background\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostReplaceBackgroundV3", - methodName: "PostReplaceBackgroundV3Async", - pathTemplate: "\"/v1/ideogram-v3/replace-background\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostReplaceBackgroundV3", - methodName: "PostReplaceBackgroundV3Async", - pathTemplate: "\"/v1/ideogram-v3/replace-background\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostReplaceBackgroundV3Response( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostReplaceBackgroundV3", - methodName: "PostReplaceBackgroundV3Async", - pathTemplate: "\"/v1/ideogram-v3/replace-background\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostReplaceBackgroundV3", - methodName: "PostReplaceBackgroundV3Async", - pathTemplate: "\"/v1/ideogram-v3/replace-background\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt or Initial Image failed the safety checks. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostReplaceBackgroundV3ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::Ideogram.ImageGenerationResponseV3.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - return - await global::Ideogram.ImageGenerationResponseV3.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Replace Background with Ideogram 3.0
- /// Replace the background of a given image synchronously using a prompt with Ideogram 3.0. The foreground subject
- /// will be identified and kept, while the background is replaced based on the prompt and chosen style.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The image whose background is being replaced (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The image whose background is being replaced (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The prompt describing the desired new background.
- /// Example: A vibrant cityscape at night. - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - /// - /// - /// A predefined style preset that applies a specific artistic style to the generated image.
- /// Example: BRIGHT_ART - /// - /// - /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). Not supported by V_1, V_1_TURBO, V_2A and V_2A_TURBO models. - /// - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - /// - /// - /// A set of images to use as style references (max size 25MB per image; the whole request must stay under 50MB). The images should be in JPEG, PNG or WebP format. - /// - /// - /// Optional file names to use for the multipart 'style_reference_images' file parts. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostReplaceBackgroundV3AsResponseAsync( - global::System.IO.Stream image, - string imagename, - string prompt, - global::Ideogram.MagicPromptOption? magicPrompt = default, - string? magicPromptSystemPromptConfigId = default, - int? numImages = default, - int? seed = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - global::Ideogram.StylePresetV3? stylePreset = default, - global::Ideogram.ColorPaletteWithPresetNameOrMembers? colorPalette = default, - global::System.Collections.Generic.IList? styleCodes = default, - global::System.Collections.Generic.IReadOnlyList? styleReferenceImages = default, - global::System.Collections.Generic.IReadOnlyList? styleReferenceImagesFileNames = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - - image = image ?? throw new global::System.ArgumentNullException(nameof(image)); - var request = new global::Ideogram.ReplaceBackgroundRequestV3 - { - Image = global::System.Array.Empty(), - Imagename = imagename, - Prompt = prompt, - MagicPrompt = magicPrompt, - MagicPromptSystemPromptConfigId = magicPromptSystemPromptConfigId, - NumImages = numImages, - Seed = seed, - RenderingSpeed = renderingSpeed, - StylePreset = stylePreset, - ColorPalette = colorPalette, - StyleCodes = styleCodes, - StyleReferenceImages = new global::System.Collections.Generic.List(), - }; - PrepareArguments( - client: HttpClient); - PreparePostReplaceBackgroundV3Arguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostReplaceBackgroundV3SecurityRequirements, - operationName: "PostReplaceBackgroundV3Async"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/ideogram-v3/replace-background", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - var __contentImage = new global::System.Net.Http.StreamContent(image); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - if (request.MagicPrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.MagicPrompt).HasValue ? (request.MagicPrompt).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"magic_prompt\""); - - } - if (request.MagicPromptSystemPromptConfigId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.MagicPromptSystemPromptConfigId ?? string.Empty), - name: "\"magic_prompt_system_prompt_config_id\""); - - } - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.RenderingSpeed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"rendering_speed\""); - - } - if (request.StylePreset != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.StylePreset).HasValue ? (request.StylePreset).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"style_preset\""); - - } - if (request.ColorPalette != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ColorPalette.ToString() ?? string.Empty), - name: "\"color_palette\""); - - } - if (request.StyleCodes != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.StyleCodes!, x => x))}]"), - name: "\"style_codes\""); - - } - if (styleReferenceImages != default) - { - - for (var __iStyleReferenceImages = 0; __iStyleReferenceImages < styleReferenceImages.Count; __iStyleReferenceImages++) - { - var __fileNameStyleReferenceImages = styleReferenceImagesFileNames != null && - __iStyleReferenceImages < styleReferenceImagesFileNames.Count && - styleReferenceImagesFileNames[__iStyleReferenceImages] != null - ? styleReferenceImagesFileNames[__iStyleReferenceImages] - : $"file{__iStyleReferenceImages}.bin"; - var __contentStyleReferenceImages = new global::System.Net.Http.StreamContent(styleReferenceImages[__iStyleReferenceImages]); - __contentStyleReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - __fileNameStyleReferenceImages is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(__fileNameStyleReferenceImages) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentStyleReferenceImages, - name: "\"style_reference_images\"", - fileName: $"\"{__fileNameStyleReferenceImages}\""); - if (__contentStyleReferenceImages.Headers.ContentDisposition != null) - { - __contentStyleReferenceImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostReplaceBackgroundV3Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostReplaceBackgroundV3", - methodName: "PostReplaceBackgroundV3Async", - pathTemplate: "\"/v1/ideogram-v3/replace-background\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostReplaceBackgroundV3", - methodName: "PostReplaceBackgroundV3Async", - pathTemplate: "\"/v1/ideogram-v3/replace-background\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostReplaceBackgroundV3", - methodName: "PostReplaceBackgroundV3Async", - pathTemplate: "\"/v1/ideogram-v3/replace-background\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostReplaceBackgroundV3Response( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostReplaceBackgroundV3", - methodName: "PostReplaceBackgroundV3Async", - pathTemplate: "\"/v1/ideogram-v3/replace-background\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostReplaceBackgroundV3", - methodName: "PostReplaceBackgroundV3Async", - pathTemplate: "\"/v1/ideogram-v3/replace-background\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt or Initial Image failed the safety checks. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostReplaceBackgroundV3ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.ImageGenerationResponseV3.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.ImageGenerationResponseV3.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostResizeImageAsync.g.cs b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostResizeImageAsync.g.cs deleted file mode 100644 index c831b19b..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostResizeImageAsync.g.cs +++ /dev/null @@ -1,864 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class GenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostResizeImageAsyncSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostResizeImageAsyncSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostResizeImageAsyncSecurityRequirement0, - }; - partial void PreparePostResizeImageAsyncArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? webhookUrl, - global::Ideogram.ResizeAdImageRequest request); - partial void PreparePostResizeImageAsyncRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? webhookUrl, - global::Ideogram.ResizeAdImageRequest request); - partial void ProcessPostResizeImageAsyncResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostResizeImageAsyncResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Advertisement Resizer
- /// Resizes an advertisement image to the exact target size. Supply `prompt`
- /// to provide specific instructions for how the advertisement should look
- /// after resizing.
- /// The request is processed asynchronously and immediately returns a
- /// `generation_id`. Poll `GET /v1/generations/{generation_id}` until `status`
- /// is `completed` or `failed`. The completed polling response contains the
- /// final resized image(s) in `data` and the amount charged for variable
- /// usage-based pricing in `usage_cost_usd_micros`. If a `webhook_url` is
- /// supplied, the completed result is also POSTed to that URL.
- /// Supply the advertisement image as raw `image` bytes via
- /// `multipart/form-data`.
- /// The required `resolution` (`WIDTHxHEIGHT`) sets the exact output
- /// dimensions.
- /// The model is fixed by the route, so no `model` field is accepted. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostResizeImageAsyncAsync( - - global::Ideogram.ResizeAdImageRequest request, - string? webhookUrl = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostResizeImageAsyncAsResponseAsync( - - request: request, - webhookUrl: webhookUrl, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Advertisement Resizer
- /// Resizes an advertisement image to the exact target size. Supply `prompt`
- /// to provide specific instructions for how the advertisement should look
- /// after resizing.
- /// The request is processed asynchronously and immediately returns a
- /// `generation_id`. Poll `GET /v1/generations/{generation_id}` until `status`
- /// is `completed` or `failed`. The completed polling response contains the
- /// final resized image(s) in `data` and the amount charged for variable
- /// usage-based pricing in `usage_cost_usd_micros`. If a `webhook_url` is
- /// supplied, the completed result is also POSTed to that URL.
- /// Supply the advertisement image as raw `image` bytes via
- /// `multipart/form-data`.
- /// The required `resolution` (`WIDTHxHEIGHT`) sets the exact output
- /// dimensions.
- /// The model is fixed by the route, so no `model` field is accepted. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostResizeImageAsyncAsResponseAsync( - - global::Ideogram.ResizeAdImageRequest request, - string? webhookUrl = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostResizeImageAsyncArguments( - httpClient: HttpClient, - webhookUrl: ref webhookUrl, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostResizeImageAsyncSecurityRequirements, - operationName: "PostResizeImageAsyncAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/async/ad-resizer", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("webhook_url", webhookUrl) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (request.ImageAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ImageAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"image_asset_identifier\""); - - } - if (request.Image != default) - { - - var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - } - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Resolution.ToValueString()), - name: "\"resolution\""); - - if (request.Prompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - } - if (request.Quality != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Quality).HasValue ? (request.Quality).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"quality\""); - - } - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.StoreAssets != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.StoreAssets, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"store_assets\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostResizeImageAsyncRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - webhookUrl: webhookUrl, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostResizeImageAsync", - methodName: "PostResizeImageAsyncAsync", - pathTemplate: "\"/v1/async/ad-resizer\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostResizeImageAsync", - methodName: "PostResizeImageAsyncAsync", - pathTemplate: "\"/v1/async/ad-resizer\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostResizeImageAsync", - methodName: "PostResizeImageAsyncAsync", - pathTemplate: "\"/v1/async/ad-resizer\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostResizeImageAsyncResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostResizeImageAsync", - methodName: "PostResizeImageAsyncAsync", - pathTemplate: "\"/v1/async/ad-resizer\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostResizeImageAsync", - methodName: "PostResizeImageAsyncAsync", - pathTemplate: "\"/v1/async/ad-resizer\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostResizeImageAsyncResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.AsyncImageGenerationResponseV4.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.AsyncImageGenerationResponseV4.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Advertisement Resizer
- /// Resizes an advertisement image to the exact target size. Supply `prompt`
- /// to provide specific instructions for how the advertisement should look
- /// after resizing.
- /// The request is processed asynchronously and immediately returns a
- /// `generation_id`. Poll `GET /v1/generations/{generation_id}` until `status`
- /// is `completed` or `failed`. The completed polling response contains the
- /// final resized image(s) in `data` and the amount charged for variable
- /// usage-based pricing in `usage_cost_usd_micros`. If a `webhook_url` is
- /// supplied, the completed result is also POSTed to that URL.
- /// Supply the advertisement image as raw `image` bytes via
- /// `multipart/form-data`.
- /// The required `resolution` (`WIDTHxHEIGHT`) sets the exact output
- /// dimensions.
- /// The model is fixed by the route, so no `model` field is accepted. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// The source image asset to reframe, by reference. Provide exactly one of `image_asset_identifier` or `image`. - /// - /// - /// The source image to reframe (max size 25MB), as raw bytes; only JPEG, PNG, and WEBP formats are supported. - /// - /// - /// The source image to reframe (max size 25MB), as raw bytes; only JPEG, PNG, and WEBP formats are supported. - /// - /// - /// Target ad resolution, formatted as `WIDTHxHEIGHT`. Must be one of
- /// the supported ad resolutions listed above; any other value is
- /// rejected with a 400. Each returned image has exactly these pixel
- /// dimensions. - /// - /// - /// Optional edit instruction to apply while reframing, for example "remove the logo" or "put the price bottom-right". - /// - /// - /// Output quality tier. Higher tiers generally improve detail and may take longer to complete. Supported values are LOW, MEDIUM, and HIGH.
- /// Default Value: HIGH - /// - /// - /// The number of reframed variations to generate.
- /// Default Value: 1 - /// - /// - /// Reserved for a future release: accepted for forward compatibility but not yet applied. Resulting assets are not stored to your account regardless of this value.
- /// Default Value: false - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostResizeImageAsyncAsync( - global::Ideogram.ResizeAdImageRequestResolution resolution, - string? webhookUrl = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - string? prompt = default, - global::Ideogram.ResizeAdImageQuality? quality = default, - int? numImages = default, - bool? storeAssets = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.ResizeAdImageRequest - { - ImageAssetIdentifier = imageAssetIdentifier, - Image = image, - Imagename = imagename, - Resolution = resolution, - Prompt = prompt, - Quality = quality, - NumImages = numImages, - StoreAssets = storeAssets, - }; - - return await PostResizeImageAsyncAsync( - webhookUrl: webhookUrl, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostSnapMask.g.cs b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostSnapMask.g.cs deleted file mode 100644 index 0c087a12..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostSnapMask.g.cs +++ /dev/null @@ -1,2745 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class GenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostSnapMaskSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostSnapMaskSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostSnapMaskSecurityRequirement0, - }; - partial void PreparePostSnapMaskArguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.SnapMaskRequest request); - partial void PreparePostSnapMaskRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.SnapMaskRequest request); - partial void ProcessPostSnapMaskResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostSnapMaskResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref byte[] content); - - /// - /// Snap a hand-drawn mask to the selected object
- /// Refine a hand-drawn binary mask to the object it marks. Supply the source image and a mask with the same dimensions; white (>= 128) marks the object. The response is a binary PNG mask with white pixels marking the snapped object. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostSnapMaskAsync( - - global::Ideogram.SnapMaskRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostSnapMaskAsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Snap a hand-drawn mask to the selected object
- /// Refine a hand-drawn binary mask to the object it marks. Supply the source image and a mask with the same dimensions; white (>= 128) marks the object. The response is a binary PNG mask with white pixels marking the snapped object. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostSnapMaskAsStreamAsync( - - global::Ideogram.SnapMaskRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostSnapMaskArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostSnapMaskSecurityRequirements, - operationName: "PostSnapMaskAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/snap-mask", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - var __contentMask = new global::System.Net.Http.ByteArrayContent(request.Mask ?? global::System.Array.Empty()); - __contentMask.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Maskname is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Maskname) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentMask, - name: "\"mask\"", - fileName: request.Maskname != null ? $"\"{request.Maskname}\"" : string.Empty); - if (__contentMask.Headers.ContentDisposition != null) - { - __contentMask.Headers.ContentDisposition.FileNameStar = null; - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostSnapMaskRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostSnapMask", - methodName: "PostSnapMaskAsync", - pathTemplate: "\"/v1/snap-mask\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseHeadersRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostSnapMask", - methodName: "PostSnapMaskAsync", - pathTemplate: "\"/v1/snap-mask\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostSnapMask", - methodName: "PostSnapMaskAsync", - pathTemplate: "\"/v1/snap-mask\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - try - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostSnapMaskResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostSnapMask", - methodName: "PostSnapMaskAsync", - pathTemplate: "\"/v1/snap-mask\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostSnapMask", - methodName: "PostSnapMaskAsync", - pathTemplate: "\"/v1/snap-mask\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - return new global::Ideogram.ResponseStream(__response, __content); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - } - catch - { - __response.Dispose(); - throw; - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Snap a hand-drawn mask to the selected object
- /// Refine a hand-drawn binary mask to the object it marks. Supply the source image and a mask with the same dimensions; white (>= 128) marks the object. The response is a binary PNG mask with white pixels marking the snapped object. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostSnapMaskAsResponseAsync( - - global::Ideogram.SnapMaskRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostSnapMaskArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostSnapMaskSecurityRequirements, - operationName: "PostSnapMaskAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/snap-mask", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - var __contentMask = new global::System.Net.Http.ByteArrayContent(request.Mask ?? global::System.Array.Empty()); - __contentMask.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Maskname is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Maskname) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentMask, - name: "\"mask\"", - fileName: request.Maskname != null ? $"\"{request.Maskname}\"" : string.Empty); - if (__contentMask.Headers.ContentDisposition != null) - { - __contentMask.Headers.ContentDisposition.FileNameStar = null; - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostSnapMaskRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostSnapMask", - methodName: "PostSnapMaskAsync", - pathTemplate: "\"/v1/snap-mask\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostSnapMask", - methodName: "PostSnapMaskAsync", - pathTemplate: "\"/v1/snap-mask\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostSnapMask", - methodName: "PostSnapMaskAsync", - pathTemplate: "\"/v1/snap-mask\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostSnapMaskResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostSnapMask", - methodName: "PostSnapMaskAsync", - pathTemplate: "\"/v1/snap-mask\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostSnapMask", - methodName: "PostSnapMaskAsync", - pathTemplate: "\"/v1/snap-mask\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsByteArrayAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessPostSnapMaskResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __content); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: null, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsByteArrayAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __content); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Snap a hand-drawn mask to the selected object
- /// Refine a hand-drawn binary mask to the object it marks. Supply the source image and a mask with the same dimensions; white (>= 128) marks the object. The response is a binary PNG mask with white pixels marking the snapped object. - ///
- /// - /// The source image containing the object (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The source image containing the object (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// A hand-drawn binary mask the same size as the image; white (>= 128) marks the object to snap. Only JPEG, WebP and PNG formats are supported. - /// - /// - /// A hand-drawn binary mask the same size as the image; white (>= 128) marks the object to snap. Only JPEG, WebP and PNG formats are supported. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostSnapMaskAsync( - byte[] image, - string imagename, - byte[] mask, - string maskname, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.SnapMaskRequest - { - Image = image, - Imagename = imagename, - Mask = mask, - Maskname = maskname, - }; - - return await PostSnapMaskAsync( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - - /// - /// Snap a hand-drawn mask to the selected object
- /// Refine a hand-drawn binary mask to the object it marks. Supply the source image and a mask with the same dimensions; white (>= 128) marks the object. The response is a binary PNG mask with white pixels marking the snapped object. - ///
- /// - /// The source image containing the object (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The source image containing the object (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// A hand-drawn binary mask the same size as the image; white (>= 128) marks the object to snap. Only JPEG, WebP and PNG formats are supported. - /// - /// - /// A hand-drawn binary mask the same size as the image; white (>= 128) marks the object to snap. Only JPEG, WebP and PNG formats are supported. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostSnapMaskAsync( - global::System.IO.Stream image, - string imagename, - global::System.IO.Stream mask, - string maskname, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - - image = image ?? throw new global::System.ArgumentNullException(nameof(image)); - mask = mask ?? throw new global::System.ArgumentNullException(nameof(mask)); - var request = new global::Ideogram.SnapMaskRequest - { - Image = global::System.Array.Empty(), - Imagename = imagename, - Mask = global::System.Array.Empty(), - Maskname = maskname, - }; - PrepareArguments( - client: HttpClient); - PreparePostSnapMaskArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostSnapMaskSecurityRequirements, - operationName: "PostSnapMaskAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/snap-mask", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - var __contentImage = new global::System.Net.Http.StreamContent(image); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - var __contentMask = new global::System.Net.Http.StreamContent(mask); - __contentMask.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Maskname is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Maskname) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentMask, - name: "\"mask\"", - fileName: request.Maskname != null ? $"\"{request.Maskname}\"" : string.Empty); - if (__contentMask.Headers.ContentDisposition != null) - { - __contentMask.Headers.ContentDisposition.FileNameStar = null; - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostSnapMaskRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostSnapMask", - methodName: "PostSnapMaskAsync", - pathTemplate: "\"/v1/snap-mask\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostSnapMask", - methodName: "PostSnapMaskAsync", - pathTemplate: "\"/v1/snap-mask\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostSnapMask", - methodName: "PostSnapMaskAsync", - pathTemplate: "\"/v1/snap-mask\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostSnapMaskResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostSnapMask", - methodName: "PostSnapMaskAsync", - pathTemplate: "\"/v1/snap-mask\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostSnapMask", - methodName: "PostSnapMaskAsync", - pathTemplate: "\"/v1/snap-mask\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsByteArrayAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessPostSnapMaskResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: null, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsByteArrayAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Snap a hand-drawn mask to the selected object
- /// Refine a hand-drawn binary mask to the object it marks. Supply the source image and a mask with the same dimensions; white (>= 128) marks the object. The response is a binary PNG mask with white pixels marking the snapped object. - ///
- /// - /// The source image containing the object (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The source image containing the object (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// A hand-drawn binary mask the same size as the image; white (>= 128) marks the object to snap. Only JPEG, WebP and PNG formats are supported. - /// - /// - /// A hand-drawn binary mask the same size as the image; white (>= 128) marks the object to snap. Only JPEG, WebP and PNG formats are supported. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostSnapMaskAsStreamAsync( - global::System.IO.Stream image, - string imagename, - global::System.IO.Stream mask, - string maskname, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - - image = image ?? throw new global::System.ArgumentNullException(nameof(image)); - mask = mask ?? throw new global::System.ArgumentNullException(nameof(mask)); - var request = new global::Ideogram.SnapMaskRequest - { - Image = global::System.Array.Empty(), - Imagename = imagename, - Mask = global::System.Array.Empty(), - Maskname = maskname, - }; - PrepareArguments( - client: HttpClient); - PreparePostSnapMaskArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostSnapMaskSecurityRequirements, - operationName: "PostSnapMaskAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/snap-mask", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - var __contentImage = new global::System.Net.Http.StreamContent(image); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - var __contentMask = new global::System.Net.Http.StreamContent(mask); - __contentMask.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Maskname is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Maskname) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentMask, - name: "\"mask\"", - fileName: request.Maskname != null ? $"\"{request.Maskname}\"" : string.Empty); - if (__contentMask.Headers.ContentDisposition != null) - { - __contentMask.Headers.ContentDisposition.FileNameStar = null; - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostSnapMaskRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostSnapMask", - methodName: "PostSnapMaskAsync", - pathTemplate: "\"/v1/snap-mask\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseHeadersRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostSnapMask", - methodName: "PostSnapMaskAsync", - pathTemplate: "\"/v1/snap-mask\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostSnapMask", - methodName: "PostSnapMaskAsync", - pathTemplate: "\"/v1/snap-mask\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - try - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostSnapMaskResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostSnapMask", - methodName: "PostSnapMaskAsync", - pathTemplate: "\"/v1/snap-mask\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostSnapMask", - methodName: "PostSnapMaskAsync", - pathTemplate: "\"/v1/snap-mask\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - return new global::Ideogram.ResponseStream(__response, __content); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - } - catch - { - __response.Dispose(); - throw; - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Snap a hand-drawn mask to the selected object
- /// Refine a hand-drawn binary mask to the object it marks. Supply the source image and a mask with the same dimensions; white (>= 128) marks the object. The response is a binary PNG mask with white pixels marking the snapped object. - ///
- /// - /// The source image containing the object (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The source image containing the object (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// A hand-drawn binary mask the same size as the image; white (>= 128) marks the object to snap. Only JPEG, WebP and PNG formats are supported. - /// - /// - /// A hand-drawn binary mask the same size as the image; white (>= 128) marks the object to snap. Only JPEG, WebP and PNG formats are supported. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostSnapMaskAsResponseAsync( - global::System.IO.Stream image, - string imagename, - global::System.IO.Stream mask, - string maskname, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - - image = image ?? throw new global::System.ArgumentNullException(nameof(image)); - mask = mask ?? throw new global::System.ArgumentNullException(nameof(mask)); - var request = new global::Ideogram.SnapMaskRequest - { - Image = global::System.Array.Empty(), - Imagename = imagename, - Mask = global::System.Array.Empty(), - Maskname = maskname, - }; - PrepareArguments( - client: HttpClient); - PreparePostSnapMaskArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostSnapMaskSecurityRequirements, - operationName: "PostSnapMaskAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/snap-mask", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - var __contentImage = new global::System.Net.Http.StreamContent(image); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - var __contentMask = new global::System.Net.Http.StreamContent(mask); - __contentMask.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Maskname is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Maskname) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentMask, - name: "\"mask\"", - fileName: request.Maskname != null ? $"\"{request.Maskname}\"" : string.Empty); - if (__contentMask.Headers.ContentDisposition != null) - { - __contentMask.Headers.ContentDisposition.FileNameStar = null; - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostSnapMaskRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostSnapMask", - methodName: "PostSnapMaskAsync", - pathTemplate: "\"/v1/snap-mask\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostSnapMask", - methodName: "PostSnapMaskAsync", - pathTemplate: "\"/v1/snap-mask\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostSnapMask", - methodName: "PostSnapMaskAsync", - pathTemplate: "\"/v1/snap-mask\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostSnapMaskResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostSnapMask", - methodName: "PostSnapMaskAsync", - pathTemplate: "\"/v1/snap-mask\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostSnapMask", - methodName: "PostSnapMaskAsync", - pathTemplate: "\"/v1/snap-mask\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsByteArrayAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessPostSnapMaskResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __content); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: null, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsByteArrayAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __content); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostTryOnV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostTryOnV3.g.cs deleted file mode 100644 index 388a5725..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostTryOnV3.g.cs +++ /dev/null @@ -1,2215 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class GenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostTryOnV3SecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostTryOnV3SecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostTryOnV3SecurityRequirement0, - }; - partial void PreparePostTryOnV3Arguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.TryOnRequestV3 request); - partial void PreparePostTryOnV3Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.TryOnRequestV3 request); - partial void ProcessPostTryOnV3Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostTryOnV3ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Virtual Try-On with Ideogram 3.0
- /// Performs virtual clothing try-on by automatically segmenting the clothing in the provided image
- /// and replacing it based on the prompt. The user provides an image and an optional prompt describing
- /// the desired clothing change (e.g., "change his shirt to a pink shirt").
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostTryOnV3Async( - - global::Ideogram.TryOnRequestV3 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostTryOnV3AsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Virtual Try-On with Ideogram 3.0
- /// Performs virtual clothing try-on by automatically segmenting the clothing in the provided image
- /// and replacing it based on the prompt. The user provides an image and an optional prompt describing
- /// the desired clothing change (e.g., "change his shirt to a pink shirt").
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostTryOnV3AsResponseAsync( - - global::Ideogram.TryOnRequestV3 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostTryOnV3Arguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostTryOnV3SecurityRequirements, - operationName: "PostTryOnV3Async"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/ideogram-v3/try-on", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - if (request.Prompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - } - if (request.MagicPrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.MagicPrompt).HasValue ? (request.MagicPrompt).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"magic_prompt\""); - - } - if (request.MagicPromptSystemPromptConfigId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.MagicPromptSystemPromptConfigId ?? string.Empty), - name: "\"magic_prompt_system_prompt_config_id\""); - - } - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.RenderingSpeed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"rendering_speed\""); - - } - if (request.StyleType != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.StyleType).HasValue ? (request.StyleType).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"style_type\""); - - } - if (request.StylePreset != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.StylePreset).HasValue ? (request.StylePreset).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"style_preset\""); - - } - for (var __iProductReferenceImages = 0; __iProductReferenceImages < request.ProductReferenceImages.Count; __iProductReferenceImages++) - { - var __contentProductReferenceImages = new global::System.Net.Http.ByteArrayContent(request.ProductReferenceImages[__iProductReferenceImages]); - __contentProductReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); - __httpRequestContent.Add( - content: __contentProductReferenceImages, - name: "\"product_reference_images\"", - fileName: $"\"file{__iProductReferenceImages}.bin\""); - if (__contentProductReferenceImages.Headers.ContentDisposition != null) - { - __contentProductReferenceImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostTryOnV3Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostTryOnV3", - methodName: "PostTryOnV3Async", - pathTemplate: "\"/v1/ideogram-v3/try-on\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostTryOnV3", - methodName: "PostTryOnV3Async", - pathTemplate: "\"/v1/ideogram-v3/try-on\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostTryOnV3", - methodName: "PostTryOnV3Async", - pathTemplate: "\"/v1/ideogram-v3/try-on\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostTryOnV3Response( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostTryOnV3", - methodName: "PostTryOnV3Async", - pathTemplate: "\"/v1/ideogram-v3/try-on\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostTryOnV3", - methodName: "PostTryOnV3Async", - pathTemplate: "\"/v1/ideogram-v3/try-on\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt or provided image failed safety check, or clothing segmentation failed. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostTryOnV3ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.ImageGenerationResponseV3.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.ImageGenerationResponseV3.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Virtual Try-On with Ideogram 3.0
- /// Performs virtual clothing try-on by automatically segmenting the clothing in the provided image
- /// and replacing it based on the prompt. The user provides an image and an optional prompt describing
- /// the desired clothing change (e.g., "change his shirt to a pink shirt").
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The image containing a person wearing clothing to be modified (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The image containing a person wearing clothing to be modified (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The prompt describing the desired clothing change. Defaults to "Person wearing this piece of clothing" if omitted or empty.
- /// Default Value: Person wearing this piece of clothing
- /// Example: Change his shirt to a pink shirt - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - /// - /// - /// The style type to generate with.
- /// Default Value: GENERAL
- /// Example: GENERAL - /// - /// - /// A predefined style preset that applies a specific artistic style to the generated image.
- /// Example: BRIGHT_ART - /// - /// - /// An image to use as the product reference for the try-on (exactly 1 image required). The image should be in JPEG, PNG or WebP format. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostTryOnV3Async( - byte[] image, - string imagename, - global::System.Collections.Generic.IList productReferenceImages, - string? prompt = default, - global::Ideogram.MagicPromptOption? magicPrompt = default, - string? magicPromptSystemPromptConfigId = default, - int? numImages = default, - int? seed = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - global::Ideogram.StyleTypeV3? styleType = default, - global::Ideogram.StylePresetV3? stylePreset = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.TryOnRequestV3 - { - Image = image, - Imagename = imagename, - Prompt = prompt, - MagicPrompt = magicPrompt, - MagicPromptSystemPromptConfigId = magicPromptSystemPromptConfigId, - NumImages = numImages, - Seed = seed, - RenderingSpeed = renderingSpeed, - StyleType = styleType, - StylePreset = stylePreset, - ProductReferenceImages = productReferenceImages, - }; - - return await PostTryOnV3Async( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - - /// - /// Virtual Try-On with Ideogram 3.0
- /// Performs virtual clothing try-on by automatically segmenting the clothing in the provided image
- /// and replacing it based on the prompt. The user provides an image and an optional prompt describing
- /// the desired clothing change (e.g., "change his shirt to a pink shirt").
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The image containing a person wearing clothing to be modified (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The image containing a person wearing clothing to be modified (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The prompt describing the desired clothing change. Defaults to "Person wearing this piece of clothing" if omitted or empty.
- /// Default Value: Person wearing this piece of clothing
- /// Example: Change his shirt to a pink shirt - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - /// - /// - /// The style type to generate with.
- /// Default Value: GENERAL
- /// Example: GENERAL - /// - /// - /// A predefined style preset that applies a specific artistic style to the generated image.
- /// Example: BRIGHT_ART - /// - /// - /// An image to use as the product reference for the try-on (exactly 1 image required). The image should be in JPEG, PNG or WebP format. - /// - /// - /// Optional file names to use for the multipart 'product_reference_images' file parts. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostTryOnV3Async( - global::System.IO.Stream image, - string imagename, - global::System.Collections.Generic.IReadOnlyList productReferenceImages, - string? prompt = default, - global::Ideogram.MagicPromptOption? magicPrompt = default, - string? magicPromptSystemPromptConfigId = default, - int? numImages = default, - int? seed = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - global::Ideogram.StyleTypeV3? styleType = default, - global::Ideogram.StylePresetV3? stylePreset = default, - global::System.Collections.Generic.IReadOnlyList? productReferenceImagesFileNames = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - - image = image ?? throw new global::System.ArgumentNullException(nameof(image)); - productReferenceImages = productReferenceImages ?? throw new global::System.ArgumentNullException(nameof(productReferenceImages)); - var request = new global::Ideogram.TryOnRequestV3 - { - Image = global::System.Array.Empty(), - Imagename = imagename, - Prompt = prompt, - MagicPrompt = magicPrompt, - MagicPromptSystemPromptConfigId = magicPromptSystemPromptConfigId, - NumImages = numImages, - Seed = seed, - RenderingSpeed = renderingSpeed, - StyleType = styleType, - StylePreset = stylePreset, - ProductReferenceImages = new global::System.Collections.Generic.List(), - }; - PrepareArguments( - client: HttpClient); - PreparePostTryOnV3Arguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostTryOnV3SecurityRequirements, - operationName: "PostTryOnV3Async"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/ideogram-v3/try-on", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - var __contentImage = new global::System.Net.Http.StreamContent(image); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - if (request.Prompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - } - if (request.MagicPrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.MagicPrompt).HasValue ? (request.MagicPrompt).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"magic_prompt\""); - - } - if (request.MagicPromptSystemPromptConfigId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.MagicPromptSystemPromptConfigId ?? string.Empty), - name: "\"magic_prompt_system_prompt_config_id\""); - - } - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.RenderingSpeed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"rendering_speed\""); - - } - if (request.StyleType != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.StyleType).HasValue ? (request.StyleType).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"style_type\""); - - } - if (request.StylePreset != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.StylePreset).HasValue ? (request.StylePreset).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"style_preset\""); - - } - for (var __iProductReferenceImages = 0; __iProductReferenceImages < productReferenceImages.Count; __iProductReferenceImages++) - { - var __fileNameProductReferenceImages = productReferenceImagesFileNames != null && - __iProductReferenceImages < productReferenceImagesFileNames.Count && - productReferenceImagesFileNames[__iProductReferenceImages] != null - ? productReferenceImagesFileNames[__iProductReferenceImages] - : $"file{__iProductReferenceImages}.bin"; - var __contentProductReferenceImages = new global::System.Net.Http.StreamContent(productReferenceImages[__iProductReferenceImages]); - __contentProductReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - __fileNameProductReferenceImages is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(__fileNameProductReferenceImages) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentProductReferenceImages, - name: "\"product_reference_images\"", - fileName: $"\"{__fileNameProductReferenceImages}\""); - if (__contentProductReferenceImages.Headers.ContentDisposition != null) - { - __contentProductReferenceImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostTryOnV3Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostTryOnV3", - methodName: "PostTryOnV3Async", - pathTemplate: "\"/v1/ideogram-v3/try-on\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostTryOnV3", - methodName: "PostTryOnV3Async", - pathTemplate: "\"/v1/ideogram-v3/try-on\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostTryOnV3", - methodName: "PostTryOnV3Async", - pathTemplate: "\"/v1/ideogram-v3/try-on\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostTryOnV3Response( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostTryOnV3", - methodName: "PostTryOnV3Async", - pathTemplate: "\"/v1/ideogram-v3/try-on\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostTryOnV3", - methodName: "PostTryOnV3Async", - pathTemplate: "\"/v1/ideogram-v3/try-on\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt or provided image failed safety check, or clothing segmentation failed. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostTryOnV3ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::Ideogram.ImageGenerationResponseV3.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - return - await global::Ideogram.ImageGenerationResponseV3.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Virtual Try-On with Ideogram 3.0
- /// Performs virtual clothing try-on by automatically segmenting the clothing in the provided image
- /// and replacing it based on the prompt. The user provides an image and an optional prompt describing
- /// the desired clothing change (e.g., "change his shirt to a pink shirt").
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The image containing a person wearing clothing to be modified (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The image containing a person wearing clothing to be modified (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The prompt describing the desired clothing change. Defaults to "Person wearing this piece of clothing" if omitted or empty.
- /// Default Value: Person wearing this piece of clothing
- /// Example: Change his shirt to a pink shirt - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - /// - /// - /// The style type to generate with.
- /// Default Value: GENERAL
- /// Example: GENERAL - /// - /// - /// A predefined style preset that applies a specific artistic style to the generated image.
- /// Example: BRIGHT_ART - /// - /// - /// An image to use as the product reference for the try-on (exactly 1 image required). The image should be in JPEG, PNG or WebP format. - /// - /// - /// Optional file names to use for the multipart 'product_reference_images' file parts. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostTryOnV3AsResponseAsync( - global::System.IO.Stream image, - string imagename, - global::System.Collections.Generic.IReadOnlyList productReferenceImages, - string? prompt = default, - global::Ideogram.MagicPromptOption? magicPrompt = default, - string? magicPromptSystemPromptConfigId = default, - int? numImages = default, - int? seed = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - global::Ideogram.StyleTypeV3? styleType = default, - global::Ideogram.StylePresetV3? stylePreset = default, - global::System.Collections.Generic.IReadOnlyList? productReferenceImagesFileNames = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - - image = image ?? throw new global::System.ArgumentNullException(nameof(image)); - productReferenceImages = productReferenceImages ?? throw new global::System.ArgumentNullException(nameof(productReferenceImages)); - var request = new global::Ideogram.TryOnRequestV3 - { - Image = global::System.Array.Empty(), - Imagename = imagename, - Prompt = prompt, - MagicPrompt = magicPrompt, - MagicPromptSystemPromptConfigId = magicPromptSystemPromptConfigId, - NumImages = numImages, - Seed = seed, - RenderingSpeed = renderingSpeed, - StyleType = styleType, - StylePreset = stylePreset, - ProductReferenceImages = new global::System.Collections.Generic.List(), - }; - PrepareArguments( - client: HttpClient); - PreparePostTryOnV3Arguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostTryOnV3SecurityRequirements, - operationName: "PostTryOnV3Async"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/ideogram-v3/try-on", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - var __contentImage = new global::System.Net.Http.StreamContent(image); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - if (request.Prompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - } - if (request.MagicPrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.MagicPrompt).HasValue ? (request.MagicPrompt).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"magic_prompt\""); - - } - if (request.MagicPromptSystemPromptConfigId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.MagicPromptSystemPromptConfigId ?? string.Empty), - name: "\"magic_prompt_system_prompt_config_id\""); - - } - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.RenderingSpeed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"rendering_speed\""); - - } - if (request.StyleType != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.StyleType).HasValue ? (request.StyleType).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"style_type\""); - - } - if (request.StylePreset != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.StylePreset).HasValue ? (request.StylePreset).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"style_preset\""); - - } - for (var __iProductReferenceImages = 0; __iProductReferenceImages < productReferenceImages.Count; __iProductReferenceImages++) - { - var __fileNameProductReferenceImages = productReferenceImagesFileNames != null && - __iProductReferenceImages < productReferenceImagesFileNames.Count && - productReferenceImagesFileNames[__iProductReferenceImages] != null - ? productReferenceImagesFileNames[__iProductReferenceImages] - : $"file{__iProductReferenceImages}.bin"; - var __contentProductReferenceImages = new global::System.Net.Http.StreamContent(productReferenceImages[__iProductReferenceImages]); - __contentProductReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - __fileNameProductReferenceImages is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(__fileNameProductReferenceImages) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentProductReferenceImages, - name: "\"product_reference_images\"", - fileName: $"\"{__fileNameProductReferenceImages}\""); - if (__contentProductReferenceImages.Headers.ContentDisposition != null) - { - __contentProductReferenceImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostTryOnV3Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostTryOnV3", - methodName: "PostTryOnV3Async", - pathTemplate: "\"/v1/ideogram-v3/try-on\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostTryOnV3", - methodName: "PostTryOnV3Async", - pathTemplate: "\"/v1/ideogram-v3/try-on\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostTryOnV3", - methodName: "PostTryOnV3Async", - pathTemplate: "\"/v1/ideogram-v3/try-on\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostTryOnV3Response( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostTryOnV3", - methodName: "PostTryOnV3Async", - pathTemplate: "\"/v1/ideogram-v3/try-on\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostTryOnV3", - methodName: "PostTryOnV3Async", - pathTemplate: "\"/v1/ideogram-v3/try-on\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt or provided image failed safety check, or clothing segmentation failed. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostTryOnV3ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.ImageGenerationResponseV3.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.ImageGenerationResponseV3.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostUpscaleImage.g.cs b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostUpscaleImage.g.cs deleted file mode 100644 index c389d9fa..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostUpscaleImage.g.cs +++ /dev/null @@ -1,1762 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class GenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostUpscaleImageSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostUpscaleImageSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostUpscaleImageSecurityRequirement0, - }; - partial void PreparePostUpscaleImageArguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.UpscaleImageRequest request); - partial void PreparePostUpscaleImageRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.UpscaleImageRequest request); - partial void ProcessPostUpscaleImageResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostUpscaleImageResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Upscale
- /// Upscale provided images synchronously with an optional prompt.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostUpscaleImageAsync( - - global::Ideogram.UpscaleImageRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostUpscaleImageAsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Upscale
- /// Upscale provided images synchronously with an optional prompt.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostUpscaleImageAsResponseAsync( - - global::Ideogram.UpscaleImageRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostUpscaleImageArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostUpscaleImageSecurityRequirements, - operationName: "PostUpscaleImageAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/upscale", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ImageRequest.ToJson(JsonSerializerContext)), - name: "\"image_request\""); - - var __contentImageFile = new global::System.Net.Http.ByteArrayContent(request.ImageFile ?? global::System.Array.Empty()); - __contentImageFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.ImageFilename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.ImageFilename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImageFile, - name: "\"image_file\"", - fileName: request.ImageFilename != null ? $"\"{request.ImageFilename}\"" : string.Empty); - if (__contentImageFile.Headers.ContentDisposition != null) - { - __contentImageFile.Headers.ContentDisposition.FileNameStar = null; - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostUpscaleImageRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostUpscaleImage", - methodName: "PostUpscaleImageAsync", - pathTemplate: "\"/upscale\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostUpscaleImage", - methodName: "PostUpscaleImageAsync", - pathTemplate: "\"/upscale\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostUpscaleImage", - methodName: "PostUpscaleImageAsync", - pathTemplate: "\"/upscale\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostUpscaleImageResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostUpscaleImage", - methodName: "PostUpscaleImageAsync", - pathTemplate: "\"/upscale\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostUpscaleImage", - methodName: "PostUpscaleImageAsync", - pathTemplate: "\"/upscale\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt or provided image failed safety check. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostUpscaleImageResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.GenerateImageResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.GenerateImageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Upscale
- /// Upscale provided images synchronously with an optional prompt.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// A request to upscale a provided image with the help of an optional prompt. - /// - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostUpscaleImageAsync( - global::Ideogram.UpscaleInitialImageRequest imageRequest, - byte[] imageFile, - string imageFilename, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.UpscaleImageRequest - { - ImageRequest = imageRequest, - ImageFile = imageFile, - ImageFilename = imageFilename, - }; - - return await PostUpscaleImageAsync( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - - /// - /// Upscale
- /// Upscale provided images synchronously with an optional prompt.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// A request to upscale a provided image with the help of an optional prompt. - /// - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostUpscaleImageAsync( - global::Ideogram.UpscaleInitialImageRequest imageRequest, - global::System.IO.Stream imageFile, - string imageFilename, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - - imageFile = imageFile ?? throw new global::System.ArgumentNullException(nameof(imageFile)); - var request = new global::Ideogram.UpscaleImageRequest - { - ImageRequest = imageRequest, - ImageFile = global::System.Array.Empty(), - ImageFilename = imageFilename, - }; - PrepareArguments( - client: HttpClient); - PreparePostUpscaleImageArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostUpscaleImageSecurityRequirements, - operationName: "PostUpscaleImageAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/upscale", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ImageRequest.ToJson(JsonSerializerContext)), - name: "\"image_request\""); - - var __contentImageFile = new global::System.Net.Http.StreamContent(imageFile); - __contentImageFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.ImageFilename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.ImageFilename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImageFile, - name: "\"image_file\"", - fileName: request.ImageFilename != null ? $"\"{request.ImageFilename}\"" : string.Empty); - if (__contentImageFile.Headers.ContentDisposition != null) - { - __contentImageFile.Headers.ContentDisposition.FileNameStar = null; - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostUpscaleImageRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostUpscaleImage", - methodName: "PostUpscaleImageAsync", - pathTemplate: "\"/upscale\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostUpscaleImage", - methodName: "PostUpscaleImageAsync", - pathTemplate: "\"/upscale\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostUpscaleImage", - methodName: "PostUpscaleImageAsync", - pathTemplate: "\"/upscale\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostUpscaleImageResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostUpscaleImage", - methodName: "PostUpscaleImageAsync", - pathTemplate: "\"/upscale\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostUpscaleImage", - methodName: "PostUpscaleImageAsync", - pathTemplate: "\"/upscale\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt or provided image failed safety check. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostUpscaleImageResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::Ideogram.GenerateImageResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - return - await global::Ideogram.GenerateImageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Upscale
- /// Upscale provided images synchronously with an optional prompt.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// A request to upscale a provided image with the help of an optional prompt. - /// - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostUpscaleImageAsResponseAsync( - global::Ideogram.UpscaleInitialImageRequest imageRequest, - global::System.IO.Stream imageFile, - string imageFilename, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - - imageFile = imageFile ?? throw new global::System.ArgumentNullException(nameof(imageFile)); - var request = new global::Ideogram.UpscaleImageRequest - { - ImageRequest = imageRequest, - ImageFile = global::System.Array.Empty(), - ImageFilename = imageFilename, - }; - PrepareArguments( - client: HttpClient); - PreparePostUpscaleImageArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostUpscaleImageSecurityRequirements, - operationName: "PostUpscaleImageAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/upscale", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ImageRequest.ToJson(JsonSerializerContext)), - name: "\"image_request\""); - - var __contentImageFile = new global::System.Net.Http.StreamContent(imageFile); - __contentImageFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.ImageFilename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.ImageFilename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImageFile, - name: "\"image_file\"", - fileName: request.ImageFilename != null ? $"\"{request.ImageFilename}\"" : string.Empty); - if (__contentImageFile.Headers.ContentDisposition != null) - { - __contentImageFile.Headers.ContentDisposition.FileNameStar = null; - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostUpscaleImageRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostUpscaleImage", - methodName: "PostUpscaleImageAsync", - pathTemplate: "\"/upscale\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostUpscaleImage", - methodName: "PostUpscaleImageAsync", - pathTemplate: "\"/upscale\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostUpscaleImage", - methodName: "PostUpscaleImageAsync", - pathTemplate: "\"/upscale\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostUpscaleImageResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostUpscaleImage", - methodName: "PostUpscaleImageAsync", - pathTemplate: "\"/upscale\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostUpscaleImage", - methodName: "PostUpscaleImageAsync", - pathTemplate: "\"/upscale\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt or provided image failed safety check. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostUpscaleImageResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.GenerateImageResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.GenerateImageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostV1EditImage.g.cs b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostV1EditImage.g.cs deleted file mode 100644 index 4812556f..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostV1EditImage.g.cs +++ /dev/null @@ -1,806 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class GenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostV1EditImageSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostV1EditImageSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostV1EditImageSecurityRequirement0, - }; - partial void PreparePostV1EditImageArguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.V1EditImagesRequest request); - partial void PreparePostV1EditImageRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.V1EditImagesRequest request); - partial void ProcessPostV1EditImageResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostV1EditImageResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Edit images with a prompt
- /// Edit one or more images using a text prompt. Provide images via file upload
- /// or Ideogram image URLs, and describe the desired edit in your prompt.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostV1EditImageAsync( - - global::Ideogram.V1EditImagesRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostV1EditImageAsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Edit images with a prompt
- /// Edit one or more images using a text prompt. Provide images via file upload
- /// or Ideogram image URLs, and describe the desired edit in your prompt.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostV1EditImageAsResponseAsync( - - global::Ideogram.V1EditImagesRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostV1EditImageArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostV1EditImageSecurityRequirements, - operationName: "PostV1EditImageAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/edit", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - if (request.Images != default) - { - - for (var __iImages = 0; __iImages < request.Images.Count; __iImages++) - { - var __contentImages = new global::System.Net.Http.ByteArrayContent(request.Images[__iImages]); - __contentImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); - __httpRequestContent.Add( - content: __contentImages, - name: "\"images\"", - fileName: $"\"file{__iImages}.bin\""); - if (__contentImages.Headers.ContentDisposition != null) - { - __contentImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - if (request.ImageUrls != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.ImageUrls!, x => x))}]"), - name: "\"image_urls\""); - - } - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.MagicPrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.MagicPrompt).HasValue ? (request.MagicPrompt).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"magic_prompt\""); - - } - if (request.MagicPromptSystemPromptConfigId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.MagicPromptSystemPromptConfigId ?? string.Empty), - name: "\"magic_prompt_system_prompt_config_id\""); - - } - if (request.Resolution != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"resolution\""); - - } - if (request.AspectRatio != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.AspectRatio).HasValue ? (request.AspectRatio).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"aspect_ratio\""); - - } - if (request.TransparentBackground != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.TransparentBackground, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"transparent_background\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostV1EditImageRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostV1EditImage", - methodName: "PostV1EditImageAsync", - pathTemplate: "\"/v1/edit\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostV1EditImage", - methodName: "PostV1EditImageAsync", - pathTemplate: "\"/v1/edit\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostV1EditImage", - methodName: "PostV1EditImageAsync", - pathTemplate: "\"/v1/edit\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostV1EditImageResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostV1EditImage", - methodName: "PostV1EditImageAsync", - pathTemplate: "\"/v1/edit\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostV1EditImage", - methodName: "PostV1EditImageAsync", - pathTemplate: "\"/v1/edit\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt or provided image failed safety checks. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostV1EditImageResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.V1EditImagesResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.V1EditImagesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Edit images with a prompt
- /// Edit one or more images using a text prompt. Provide images via file upload
- /// or Ideogram image URLs, and describe the desired edit in your prompt.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The prompt describing the desired edit.
- /// Example: Change the background to a beach sunset. - /// - /// - /// Images to edit (max 10 images, max size 25MB each); JPEG, WebP and PNG formats are supported. - /// - /// - /// URLs to Ideogram images to use as references (max 10). Supports URLs from generation responses and image uploads. Alternative to uploading via the images field. - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// The resolutions supported for Ideogram 3.0.
- /// Example: 1280x800 - /// - /// - /// Output aspect ratio. Cannot be combined with resolution. Generation defaults to 1x1; remix keeps the source ratio when both fields are omitted. - /// - /// - /// Whether the output should have a transparent background. Default false.
- /// When more than one image is supplied, the first image is treated as
- /// the image being edited and drives the transparency decision.
- /// Default Value: false - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostV1EditImageAsync( - string prompt, - global::System.Collections.Generic.IList? images = default, - global::System.Collections.Generic.IList? imageUrls = default, - int? numImages = default, - int? seed = default, - global::Ideogram.MagicPromptOption? magicPrompt = default, - string? magicPromptSystemPromptConfigId = default, - global::Ideogram.ResolutionV3? resolution = default, - global::Ideogram.AspectRatioV3? aspectRatio = default, - bool? transparentBackground = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.V1EditImagesRequest - { - Prompt = prompt, - Images = images, - ImageUrls = imageUrls, - NumImages = numImages, - Seed = seed, - MagicPrompt = magicPrompt, - MagicPromptSystemPromptConfigId = magicPromptSystemPromptConfigId, - Resolution = resolution, - AspectRatio = aspectRatio, - TransparentBackground = transparentBackground, - }; - - return await PostV1EditImageAsync( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostV1EditLiteImage.g.cs b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostV1EditLiteImage.g.cs deleted file mode 100644 index f0eee7f1..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostV1EditLiteImage.g.cs +++ /dev/null @@ -1,2406 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class GenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostV1EditLiteImageSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostV1EditLiteImageSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostV1EditLiteImageSecurityRequirement0, - }; - partial void PreparePostV1EditLiteImageArguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.V1EditLiteImagesRequest request); - partial void PreparePostV1EditLiteImageRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.V1EditLiteImagesRequest request); - partial void ProcessPostV1EditLiteImageResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostV1EditLiteImageResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Edit an image with a prompt at lower cost and latency
- /// Edit an image using a text prompt, optimized for lower cost and
- /// latency. Upload the image being edited via the `image` field. Up to 9
- /// additional `reference_images` may be supplied to guide the edit.
- /// Output is always generated at 1K resolution. Input images larger than
- /// 1024px on their long edge are downscaled before processing. The
- /// `aspect_ratio` field controls the output aspect ratio only; when
- /// omitted, the output follows the aspect ratio of the image being
- /// edited.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostV1EditLiteImageAsync( - - global::Ideogram.V1EditLiteImagesRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostV1EditLiteImageAsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Edit an image with a prompt at lower cost and latency
- /// Edit an image using a text prompt, optimized for lower cost and
- /// latency. Upload the image being edited via the `image` field. Up to 9
- /// additional `reference_images` may be supplied to guide the edit.
- /// Output is always generated at 1K resolution. Input images larger than
- /// 1024px on their long edge are downscaled before processing. The
- /// `aspect_ratio` field controls the output aspect ratio only; when
- /// omitted, the output follows the aspect ratio of the image being
- /// edited.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostV1EditLiteImageAsResponseAsync( - - global::Ideogram.V1EditLiteImagesRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostV1EditLiteImageArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostV1EditLiteImageSecurityRequirements, - operationName: "PostV1EditLiteImageAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/edit-lite", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - if (request.ReferenceImages != default) - { - - for (var __iReferenceImages = 0; __iReferenceImages < request.ReferenceImages.Count; __iReferenceImages++) - { - var __contentReferenceImages = new global::System.Net.Http.ByteArrayContent(request.ReferenceImages[__iReferenceImages]); - __contentReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); - __httpRequestContent.Add( - content: __contentReferenceImages, - name: "\"reference_images\"", - fileName: $"\"file{__iReferenceImages}.bin\""); - if (__contentReferenceImages.Headers.ContentDisposition != null) - { - __contentReferenceImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.MagicPrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.MagicPrompt).HasValue ? (request.MagicPrompt).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"magic_prompt\""); - - } - if (request.MagicPromptSystemPromptConfigId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.MagicPromptSystemPromptConfigId ?? string.Empty), - name: "\"magic_prompt_system_prompt_config_id\""); - - } - if (request.AspectRatio != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.AspectRatio).HasValue ? (request.AspectRatio).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"aspect_ratio\""); - - } - if (request.Transparency != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Transparency).HasValue ? (request.Transparency).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"transparency\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostV1EditLiteImageRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostV1EditLiteImage", - methodName: "PostV1EditLiteImageAsync", - pathTemplate: "\"/v1/edit-lite\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostV1EditLiteImage", - methodName: "PostV1EditLiteImageAsync", - pathTemplate: "\"/v1/edit-lite\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostV1EditLiteImage", - methodName: "PostV1EditLiteImageAsync", - pathTemplate: "\"/v1/edit-lite\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostV1EditLiteImageResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostV1EditLiteImage", - methodName: "PostV1EditLiteImageAsync", - pathTemplate: "\"/v1/edit-lite\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostV1EditLiteImage", - methodName: "PostV1EditLiteImageAsync", - pathTemplate: "\"/v1/edit-lite\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt or provided image failed safety checks. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostV1EditLiteImageResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.V1EditImagesResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.V1EditImagesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Edit an image with a prompt at lower cost and latency
- /// Edit an image using a text prompt, optimized for lower cost and
- /// latency. Upload the image being edited via the `image` field. Up to 9
- /// additional `reference_images` may be supplied to guide the edit.
- /// Output is always generated at 1K resolution. Input images larger than
- /// 1024px on their long edge are downscaled before processing. The
- /// `aspect_ratio` field controls the output aspect ratio only; when
- /// omitted, the output follows the aspect ratio of the image being
- /// edited.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The prompt describing the desired edit.
- /// Example: Remove the person from the photo. - /// - /// - /// The image being edited (max size 25MB); JPEG, WebP and PNG formats are supported. - /// - /// - /// The image being edited (max size 25MB); JPEG, WebP and PNG formats are supported. - /// - /// - /// Optional additional reference images to guide the edit (max 9, max size 25MB each); JPEG, WebP and PNG formats are supported. - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// The aspect ratio of the edited output. When omitted, the output
- /// follows the aspect ratio of the image being edited.
- /// Example: 16x9 - /// - /// - /// Controls whether the edited output has a transparent background.
- /// - `TRANSPARENT`: the output is produced with a transparent background.
- /// - `OPAQUE`: the output is produced with an opaque background.
- /// - `AUTO`: the server decides based on the prompt and the image being
- /// edited (e.g. whether it already has a transparent background). This is
- /// the default. When the prompt asks only for background removal, the
- /// output may be the edited image with its background removed.
- /// Default Value: AUTO - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostV1EditLiteImageAsync( - string prompt, - byte[] image, - string imagename, - global::System.Collections.Generic.IList? referenceImages = default, - int? numImages = default, - int? seed = default, - global::Ideogram.MagicPromptOption? magicPrompt = default, - string? magicPromptSystemPromptConfigId = default, - global::Ideogram.AspectRatioEditLite? aspectRatio = default, - global::Ideogram.TransparencyOption? transparency = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.V1EditLiteImagesRequest - { - Prompt = prompt, - Image = image, - Imagename = imagename, - ReferenceImages = referenceImages, - NumImages = numImages, - Seed = seed, - MagicPrompt = magicPrompt, - MagicPromptSystemPromptConfigId = magicPromptSystemPromptConfigId, - AspectRatio = aspectRatio, - Transparency = transparency, - }; - - return await PostV1EditLiteImageAsync( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - - /// - /// Edit an image with a prompt at lower cost and latency
- /// Edit an image using a text prompt, optimized for lower cost and
- /// latency. Upload the image being edited via the `image` field. Up to 9
- /// additional `reference_images` may be supplied to guide the edit.
- /// Output is always generated at 1K resolution. Input images larger than
- /// 1024px on their long edge are downscaled before processing. The
- /// `aspect_ratio` field controls the output aspect ratio only; when
- /// omitted, the output follows the aspect ratio of the image being
- /// edited.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The prompt describing the desired edit.
- /// Example: Remove the person from the photo. - /// - /// - /// The image being edited (max size 25MB); JPEG, WebP and PNG formats are supported. - /// - /// - /// The image being edited (max size 25MB); JPEG, WebP and PNG formats are supported. - /// - /// - /// Optional additional reference images to guide the edit (max 9, max size 25MB each); JPEG, WebP and PNG formats are supported. - /// - /// - /// Optional file names to use for the multipart 'reference_images' file parts. - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// The aspect ratio of the edited output. When omitted, the output
- /// follows the aspect ratio of the image being edited.
- /// Example: 16x9 - /// - /// - /// Controls whether the edited output has a transparent background.
- /// - `TRANSPARENT`: the output is produced with a transparent background.
- /// - `OPAQUE`: the output is produced with an opaque background.
- /// - `AUTO`: the server decides based on the prompt and the image being
- /// edited (e.g. whether it already has a transparent background). This is
- /// the default. When the prompt asks only for background removal, the
- /// output may be the edited image with its background removed.
- /// Default Value: AUTO - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostV1EditLiteImageAsync( - string prompt, - global::System.IO.Stream image, - string imagename, - global::System.Collections.Generic.IReadOnlyList? referenceImages = default, - global::System.Collections.Generic.IReadOnlyList? referenceImagesFileNames = default, - int? numImages = default, - int? seed = default, - global::Ideogram.MagicPromptOption? magicPrompt = default, - string? magicPromptSystemPromptConfigId = default, - global::Ideogram.AspectRatioEditLite? aspectRatio = default, - global::Ideogram.TransparencyOption? transparency = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - - image = image ?? throw new global::System.ArgumentNullException(nameof(image)); - var request = new global::Ideogram.V1EditLiteImagesRequest - { - Prompt = prompt, - Image = global::System.Array.Empty(), - Imagename = imagename, - ReferenceImages = new global::System.Collections.Generic.List(), - NumImages = numImages, - Seed = seed, - MagicPrompt = magicPrompt, - MagicPromptSystemPromptConfigId = magicPromptSystemPromptConfigId, - AspectRatio = aspectRatio, - Transparency = transparency, - }; - PrepareArguments( - client: HttpClient); - PreparePostV1EditLiteImageArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostV1EditLiteImageSecurityRequirements, - operationName: "PostV1EditLiteImageAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/edit-lite", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - var __contentImage = new global::System.Net.Http.StreamContent(image); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - if (referenceImages != default) - { - - for (var __iReferenceImages = 0; __iReferenceImages < referenceImages.Count; __iReferenceImages++) - { - var __fileNameReferenceImages = referenceImagesFileNames != null && - __iReferenceImages < referenceImagesFileNames.Count && - referenceImagesFileNames[__iReferenceImages] != null - ? referenceImagesFileNames[__iReferenceImages] - : $"file{__iReferenceImages}.bin"; - var __contentReferenceImages = new global::System.Net.Http.StreamContent(referenceImages[__iReferenceImages]); - __contentReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - __fileNameReferenceImages is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(__fileNameReferenceImages) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentReferenceImages, - name: "\"reference_images\"", - fileName: $"\"{__fileNameReferenceImages}\""); - if (__contentReferenceImages.Headers.ContentDisposition != null) - { - __contentReferenceImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.MagicPrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.MagicPrompt).HasValue ? (request.MagicPrompt).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"magic_prompt\""); - - } - if (request.MagicPromptSystemPromptConfigId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.MagicPromptSystemPromptConfigId ?? string.Empty), - name: "\"magic_prompt_system_prompt_config_id\""); - - } - if (request.AspectRatio != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.AspectRatio).HasValue ? (request.AspectRatio).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"aspect_ratio\""); - - } - if (request.Transparency != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Transparency).HasValue ? (request.Transparency).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"transparency\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostV1EditLiteImageRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostV1EditLiteImage", - methodName: "PostV1EditLiteImageAsync", - pathTemplate: "\"/v1/edit-lite\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostV1EditLiteImage", - methodName: "PostV1EditLiteImageAsync", - pathTemplate: "\"/v1/edit-lite\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostV1EditLiteImage", - methodName: "PostV1EditLiteImageAsync", - pathTemplate: "\"/v1/edit-lite\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostV1EditLiteImageResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostV1EditLiteImage", - methodName: "PostV1EditLiteImageAsync", - pathTemplate: "\"/v1/edit-lite\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostV1EditLiteImage", - methodName: "PostV1EditLiteImageAsync", - pathTemplate: "\"/v1/edit-lite\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt or provided image failed safety checks. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostV1EditLiteImageResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::Ideogram.V1EditImagesResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - return - await global::Ideogram.V1EditImagesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Edit an image with a prompt at lower cost and latency
- /// Edit an image using a text prompt, optimized for lower cost and
- /// latency. Upload the image being edited via the `image` field. Up to 9
- /// additional `reference_images` may be supplied to guide the edit.
- /// Output is always generated at 1K resolution. Input images larger than
- /// 1024px on their long edge are downscaled before processing. The
- /// `aspect_ratio` field controls the output aspect ratio only; when
- /// omitted, the output follows the aspect ratio of the image being
- /// edited.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The prompt describing the desired edit.
- /// Example: Remove the person from the photo. - /// - /// - /// The image being edited (max size 25MB); JPEG, WebP and PNG formats are supported. - /// - /// - /// The image being edited (max size 25MB); JPEG, WebP and PNG formats are supported. - /// - /// - /// Optional additional reference images to guide the edit (max 9, max size 25MB each); JPEG, WebP and PNG formats are supported. - /// - /// - /// Optional file names to use for the multipart 'reference_images' file parts. - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// The aspect ratio of the edited output. When omitted, the output
- /// follows the aspect ratio of the image being edited.
- /// Example: 16x9 - /// - /// - /// Controls whether the edited output has a transparent background.
- /// - `TRANSPARENT`: the output is produced with a transparent background.
- /// - `OPAQUE`: the output is produced with an opaque background.
- /// - `AUTO`: the server decides based on the prompt and the image being
- /// edited (e.g. whether it already has a transparent background). This is
- /// the default. When the prompt asks only for background removal, the
- /// output may be the edited image with its background removed.
- /// Default Value: AUTO - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostV1EditLiteImageAsResponseAsync( - string prompt, - global::System.IO.Stream image, - string imagename, - global::System.Collections.Generic.IReadOnlyList? referenceImages = default, - global::System.Collections.Generic.IReadOnlyList? referenceImagesFileNames = default, - int? numImages = default, - int? seed = default, - global::Ideogram.MagicPromptOption? magicPrompt = default, - string? magicPromptSystemPromptConfigId = default, - global::Ideogram.AspectRatioEditLite? aspectRatio = default, - global::Ideogram.TransparencyOption? transparency = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - - image = image ?? throw new global::System.ArgumentNullException(nameof(image)); - var request = new global::Ideogram.V1EditLiteImagesRequest - { - Prompt = prompt, - Image = global::System.Array.Empty(), - Imagename = imagename, - ReferenceImages = new global::System.Collections.Generic.List(), - NumImages = numImages, - Seed = seed, - MagicPrompt = magicPrompt, - MagicPromptSystemPromptConfigId = magicPromptSystemPromptConfigId, - AspectRatio = aspectRatio, - Transparency = transparency, - }; - PrepareArguments( - client: HttpClient); - PreparePostV1EditLiteImageArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostV1EditLiteImageSecurityRequirements, - operationName: "PostV1EditLiteImageAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/edit-lite", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - var __contentImage = new global::System.Net.Http.StreamContent(image); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - if (referenceImages != default) - { - - for (var __iReferenceImages = 0; __iReferenceImages < referenceImages.Count; __iReferenceImages++) - { - var __fileNameReferenceImages = referenceImagesFileNames != null && - __iReferenceImages < referenceImagesFileNames.Count && - referenceImagesFileNames[__iReferenceImages] != null - ? referenceImagesFileNames[__iReferenceImages] - : $"file{__iReferenceImages}.bin"; - var __contentReferenceImages = new global::System.Net.Http.StreamContent(referenceImages[__iReferenceImages]); - __contentReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - __fileNameReferenceImages is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(__fileNameReferenceImages) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentReferenceImages, - name: "\"reference_images\"", - fileName: $"\"{__fileNameReferenceImages}\""); - if (__contentReferenceImages.Headers.ContentDisposition != null) - { - __contentReferenceImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.MagicPrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.MagicPrompt).HasValue ? (request.MagicPrompt).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"magic_prompt\""); - - } - if (request.MagicPromptSystemPromptConfigId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.MagicPromptSystemPromptConfigId ?? string.Empty), - name: "\"magic_prompt_system_prompt_config_id\""); - - } - if (request.AspectRatio != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.AspectRatio).HasValue ? (request.AspectRatio).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"aspect_ratio\""); - - } - if (request.Transparency != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Transparency).HasValue ? (request.Transparency).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"transparency\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostV1EditLiteImageRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostV1EditLiteImage", - methodName: "PostV1EditLiteImageAsync", - pathTemplate: "\"/v1/edit-lite\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostV1EditLiteImage", - methodName: "PostV1EditLiteImageAsync", - pathTemplate: "\"/v1/edit-lite\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostV1EditLiteImage", - methodName: "PostV1EditLiteImageAsync", - pathTemplate: "\"/v1/edit-lite\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostV1EditLiteImageResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostV1EditLiteImage", - methodName: "PostV1EditLiteImageAsync", - pathTemplate: "\"/v1/edit-lite\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostV1EditLiteImage", - methodName: "PostV1EditLiteImageAsync", - pathTemplate: "\"/v1/edit-lite\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Prompt or provided image failed safety checks. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.GenerateImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostV1EditLiteImageResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.V1EditImagesResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.V1EditImagesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.g.cs b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.g.cs deleted file mode 100644 index 4231c2eb..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.g.cs +++ /dev/null @@ -1,144 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// All things related to generating content.
- /// If no httpClient is provided, a new one will be created.
- /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. - ///
- public sealed partial class GenerateClient : global::Ideogram.IGenerateClient, global::System.IDisposable - { - /// - /// - /// - public const string DefaultBaseUrl = "https://api.ideogram.ai/"; - - private bool _disposeHttpClient = true; - - /// - public global::System.Net.Http.HttpClient HttpClient { get; } - - /// - public System.Uri? BaseUri => HttpClient.BaseAddress; - - /// - public global::System.Collections.Generic.List Authorizations { get; } - - /// - public bool ReadResponseAsString { get; set; } -#if DEBUG - = true; -#endif - - /// - public global::Ideogram.AutoSDKClientOptions Options { get; } - - internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::Ideogram.GenerateSourceGenerationContext.Default); - - /// - /// - /// - public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext - { - get => JsonSerializerContextProvider.Value; - set => JsonSerializerContextProvider = new(() => value); - } - - - /// - /// Creates a new instance of the GenerateClient. - /// If no httpClient is provided, a new one will be created. - /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. - /// - /// The HttpClient instance. If not provided, a new one will be created. - /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. - /// The authorizations to use for the requests. - /// Dispose the HttpClient when the instance is disposed. True by default. - public GenerateClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - bool disposeHttpClient = true) : this( - httpClient, - baseUri, - authorizations, - options: null, - disposeHttpClient: disposeHttpClient) - { - } - - /// - /// Creates a new instance of the GenerateClient with explicit options but no base URL override. - /// Skips passing baseUri so the default base URL from the OpenAPI spec applies. - /// - /// The HttpClient instance. If not provided, a new one will be created. - /// The authorizations to use for the requests. - /// Client-wide request defaults such as headers, query parameters, retries, and timeout. - /// Dispose the HttpClient when the instance is disposed. True by default. - public GenerateClient( - global::System.Net.Http.HttpClient? httpClient, - global::System.Collections.Generic.List? authorizations, - global::Ideogram.AutoSDKClientOptions? options, - bool disposeHttpClient = true) : this( - httpClient, - baseUri: null, - authorizations, - options, - disposeHttpClient: disposeHttpClient) - { - } - - /// - /// Creates a new instance of the GenerateClient. - /// If no httpClient is provided, a new one will be created. - /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. - /// - /// The HttpClient instance. If not provided, a new one will be created. - /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. - /// The authorizations to use for the requests. - /// Client-wide request defaults such as headers, query parameters, retries, and timeout. - /// Dispose the HttpClient when the instance is disposed. True by default. - public GenerateClient( - global::System.Net.Http.HttpClient? httpClient, - global::System.Uri? baseUri, - global::System.Collections.Generic.List? authorizations, - global::Ideogram.AutoSDKClientOptions? options, - bool disposeHttpClient = true) - { - - HttpClient = httpClient ?? new global::System.Net.Http.HttpClient(); - HttpClient.BaseAddress ??= baseUri ?? new global::System.Uri(DefaultBaseUrl); - Authorizations = authorizations ?? new global::System.Collections.Generic.List(); - Options = options ?? new global::Ideogram.AutoSDKClientOptions(); - _disposeHttpClient = disposeHttpClient; - - Initialized(HttpClient); - } - - /// - public void Dispose() - { - if (_disposeHttpClient) - { - HttpClient.Dispose(); - } - } - - partial void Initialized( - global::System.Net.Http.HttpClient client); - partial void PrepareArguments( - global::System.Net.Http.HttpClient client); - partial void PrepareRequest( - global::System.Net.Http.HttpClient client, - global::System.Net.Http.HttpRequestMessage request); - partial void ProcessResponse( - global::System.Net.Http.HttpClient client, - global::System.Net.Http.HttpResponseMessage response); - partial void ProcessResponseContent( - global::System.Net.Http.HttpClient client, - global::System.Net.Http.HttpResponseMessage response, - ref string content); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Generations.JsonSerializerContext.g.cs b/src/libs/Ideogram/Generated/Ideogram.Generations.JsonSerializerContext.g.cs index 03a1d632..06cf85b5 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Generations.JsonSerializerContext.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Generations.JsonSerializerContext.g.cs @@ -14,69 +14,74 @@ namespace Ideogram [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(long))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LayerizedTextBlock), TypeInfoPropertyName = "LayerizedTextBlock2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DetectedTextBlock))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LayerizedTextBlockVariant2))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TextColorSpan))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(float))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DetectedTextBlockAlignment), TypeInfoPropertyName = "DetectedTextBlockAlignment2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DetectedTextBlockFormattingItems), TypeInfoPropertyName = "DetectedTextBlockFormattingItems2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DetectedTextBlockRole), TypeInfoPropertyName = "DetectedTextBlockRole2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DetectedTextBlock))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponseStatus), TypeInfoPropertyName = "GenerationResponseStatus2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponseResponseType), TypeInfoPropertyName = "GenerationResponseResponseType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponseDataInnerDiscriminatorMappingSvgGenerationMimeType), TypeInfoPropertyName = "GenerationResponseDataInnerDiscriminatorMappingSvgGenerationMimeType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LayerizedTextBlockAlignment), TypeInfoPropertyName = "LayerizedTextBlockAlignment2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LayerizedTextBlockFormattingItems), TypeInfoPropertyName = "LayerizedTextBlockFormattingItems2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LayerizedTextBlockRole), TypeInfoPropertyName = "LayerizedTextBlockRole2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TextColorSpan))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LayerizedTextBlock))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponseDataInner), TypeInfoPropertyName = "GenerationResponseDataInner2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImageObjectWithoutPromptOrSeed))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImageObjectWithoutPromptOrSeedObjectType), TypeInfoPropertyName = "ImageObjectWithoutPromptOrSeedObjectType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImageGenerationObject))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImageGenerationObjectObjectType), TypeInfoPropertyName = "ImageGenerationObjectObjectType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LayerizedImageObject))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LayerizedImageObjectObjectType), TypeInfoPropertyName = "LayerizedImageObjectObjectType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SvgGenerationObject))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SvgGenerationObjectObjectType), TypeInfoPropertyName = "SvgGenerationObjectObjectType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SvgGenerationObjectMimeType), TypeInfoPropertyName = "SvgGenerationObjectMimeType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.VideoObject))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.VideoObjectObjectType), TypeInfoPropertyName = "VideoObjectObjectType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TextLayerizerResultObject))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TextLayerizerResultObjectObjectType), TypeInfoPropertyName = "TextLayerizerResultObjectObjectType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponseDataInnerVariant1))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponseDataInnerVariant1ObjectType), TypeInfoPropertyName = "GenerationResponseDataInnerVariant1ObjectType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponseDataInnerVariant2))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponseDataInnerVariant2ObjectType), TypeInfoPropertyName = "GenerationResponseDataInnerVariant2ObjectType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponseDataInnerVariant3))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponseDataInnerVariant3ObjectType), TypeInfoPropertyName = "GenerationResponseDataInnerVariant3ObjectType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponseDataInnerVariant4))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponseDataInnerVariant4ObjectType), TypeInfoPropertyName = "GenerationResponseDataInnerVariant4ObjectType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponseDataInnerVariant5))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponseDataInnerVariant5ObjectType), TypeInfoPropertyName = "GenerationResponseDataInnerVariant5ObjectType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponseDataInnerVariant6))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponseDataInnerVariant6ObjectType), TypeInfoPropertyName = "GenerationResponseDataInnerVariant6ObjectType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DetectedTextBlockAlignment), TypeInfoPropertyName = "DetectedTextBlockAlignment2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DetectedTextBlockFormattingItem), TypeInfoPropertyName = "DetectedTextBlockFormattingItem2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DetectedTextBlockRole), TypeInfoPropertyName = "DetectedTextBlockRole2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponseDataInnerDiscriminator))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponseDataInnerDiscriminatorObjectType), TypeInfoPropertyName = "GenerationResponseDataInnerDiscriminatorObjectType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(long?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LayerizedTextBlock?), TypeInfoPropertyName = "NullableLayerizedTextBlock2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(long))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(float?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DetectedTextBlockAlignment?), TypeInfoPropertyName = "NullableDetectedTextBlockAlignment2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DetectedTextBlockFormattingItems?), TypeInfoPropertyName = "NullableDetectedTextBlockFormattingItems2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DetectedTextBlockRole?), TypeInfoPropertyName = "NullableDetectedTextBlockRole2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponseStatus?), TypeInfoPropertyName = "NullableGenerationResponseStatus2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponseResponseType?), TypeInfoPropertyName = "NullableGenerationResponseResponseType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponseDataInnerDiscriminatorMappingSvgGenerationMimeType?), TypeInfoPropertyName = "NullableGenerationResponseDataInnerDiscriminatorMappingSvgGenerationMimeType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LayerizedTextBlockAlignment?), TypeInfoPropertyName = "NullableLayerizedTextBlockAlignment2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LayerizedTextBlockFormattingItems?), TypeInfoPropertyName = "NullableLayerizedTextBlockFormattingItems2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LayerizedTextBlockRole?), TypeInfoPropertyName = "NullableLayerizedTextBlockRole2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponseDataInner?), TypeInfoPropertyName = "NullableGenerationResponseDataInner2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImageObjectWithoutPromptOrSeedObjectType?), TypeInfoPropertyName = "NullableImageObjectWithoutPromptOrSeedObjectType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImageGenerationObjectObjectType?), TypeInfoPropertyName = "NullableImageGenerationObjectObjectType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LayerizedImageObjectObjectType?), TypeInfoPropertyName = "NullableLayerizedImageObjectObjectType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SvgGenerationObjectObjectType?), TypeInfoPropertyName = "NullableSvgGenerationObjectObjectType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SvgGenerationObjectMimeType?), TypeInfoPropertyName = "NullableSvgGenerationObjectMimeType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.VideoObjectObjectType?), TypeInfoPropertyName = "NullableVideoObjectObjectType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TextLayerizerResultObjectObjectType?), TypeInfoPropertyName = "NullableTextLayerizerResultObjectObjectType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DetectedTextBlockAlignment?), TypeInfoPropertyName = "NullableDetectedTextBlockAlignment2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DetectedTextBlockFormattingItem?), TypeInfoPropertyName = "NullableDetectedTextBlockFormattingItem2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DetectedTextBlockRole?), TypeInfoPropertyName = "NullableDetectedTextBlockRole2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponseDataInnerVariant1ObjectType?), TypeInfoPropertyName = "NullableGenerationResponseDataInnerVariant1ObjectType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponseDataInnerVariant2ObjectType?), TypeInfoPropertyName = "NullableGenerationResponseDataInnerVariant2ObjectType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponseDataInnerVariant3ObjectType?), TypeInfoPropertyName = "NullableGenerationResponseDataInnerVariant3ObjectType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponseDataInnerVariant4ObjectType?), TypeInfoPropertyName = "NullableGenerationResponseDataInnerVariant4ObjectType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponseDataInnerVariant5ObjectType?), TypeInfoPropertyName = "NullableGenerationResponseDataInnerVariant5ObjectType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponseDataInnerVariant6ObjectType?), TypeInfoPropertyName = "NullableGenerationResponseDataInnerVariant6ObjectType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponseDataInnerDiscriminatorObjectType?), TypeInfoPropertyName = "NullableGenerationResponseDataInnerDiscriminatorObjectType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(long?))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] internal sealed partial class GenerationsSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext { } @@ -124,7 +129,6 @@ private GenerationsSourceGenerationContext(global::System.Text.Json.JsonSerializ [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) { - options.Converters.Add(new global::Ideogram.JsonConverters.LayerizedTextBlockJsonConverter()); options.Converters.Add(new global::Ideogram.JsonConverters.GenerationResponseDataInnerJsonConverter()); options.Converters.Add(new global::Ideogram.JsonConverters.UnixTimestampJsonConverter()); options.Converters.Add(new LazyEnumJsonConverterFactory()); @@ -148,7 +152,19 @@ private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Ser public override bool CanConvert(global::System.Type typeToConvert) { return - typeToConvert == typeof(global::Ideogram.GenerationResponseStatus) + typeToConvert == typeof(global::Ideogram.DetectedTextBlockAlignment) + + || typeToConvert == typeof(global::Ideogram.DetectedTextBlockAlignment?) + + || typeToConvert == typeof(global::Ideogram.DetectedTextBlockFormattingItems) + + || typeToConvert == typeof(global::Ideogram.DetectedTextBlockFormattingItems?) + + || typeToConvert == typeof(global::Ideogram.DetectedTextBlockRole) + + || typeToConvert == typeof(global::Ideogram.DetectedTextBlockRole?) + + || typeToConvert == typeof(global::Ideogram.GenerationResponseStatus) || typeToConvert == typeof(global::Ideogram.GenerationResponseStatus?) @@ -156,45 +172,45 @@ public override bool CanConvert(global::System.Type typeToConvert) || typeToConvert == typeof(global::Ideogram.GenerationResponseResponseType?) - || typeToConvert == typeof(global::Ideogram.ImageObjectWithoutPromptOrSeedObjectType) + || typeToConvert == typeof(global::Ideogram.GenerationResponseDataInnerDiscriminatorMappingSvgGenerationMimeType) - || typeToConvert == typeof(global::Ideogram.ImageObjectWithoutPromptOrSeedObjectType?) + || typeToConvert == typeof(global::Ideogram.GenerationResponseDataInnerDiscriminatorMappingSvgGenerationMimeType?) - || typeToConvert == typeof(global::Ideogram.ImageGenerationObjectObjectType) + || typeToConvert == typeof(global::Ideogram.LayerizedTextBlockAlignment) - || typeToConvert == typeof(global::Ideogram.ImageGenerationObjectObjectType?) + || typeToConvert == typeof(global::Ideogram.LayerizedTextBlockAlignment?) - || typeToConvert == typeof(global::Ideogram.LayerizedImageObjectObjectType) + || typeToConvert == typeof(global::Ideogram.LayerizedTextBlockFormattingItems) - || typeToConvert == typeof(global::Ideogram.LayerizedImageObjectObjectType?) + || typeToConvert == typeof(global::Ideogram.LayerizedTextBlockFormattingItems?) - || typeToConvert == typeof(global::Ideogram.SvgGenerationObjectObjectType) + || typeToConvert == typeof(global::Ideogram.LayerizedTextBlockRole) - || typeToConvert == typeof(global::Ideogram.SvgGenerationObjectObjectType?) + || typeToConvert == typeof(global::Ideogram.LayerizedTextBlockRole?) - || typeToConvert == typeof(global::Ideogram.SvgGenerationObjectMimeType) + || typeToConvert == typeof(global::Ideogram.GenerationResponseDataInnerVariant1ObjectType) - || typeToConvert == typeof(global::Ideogram.SvgGenerationObjectMimeType?) + || typeToConvert == typeof(global::Ideogram.GenerationResponseDataInnerVariant1ObjectType?) - || typeToConvert == typeof(global::Ideogram.VideoObjectObjectType) + || typeToConvert == typeof(global::Ideogram.GenerationResponseDataInnerVariant2ObjectType) - || typeToConvert == typeof(global::Ideogram.VideoObjectObjectType?) + || typeToConvert == typeof(global::Ideogram.GenerationResponseDataInnerVariant2ObjectType?) - || typeToConvert == typeof(global::Ideogram.TextLayerizerResultObjectObjectType) + || typeToConvert == typeof(global::Ideogram.GenerationResponseDataInnerVariant3ObjectType) - || typeToConvert == typeof(global::Ideogram.TextLayerizerResultObjectObjectType?) + || typeToConvert == typeof(global::Ideogram.GenerationResponseDataInnerVariant3ObjectType?) - || typeToConvert == typeof(global::Ideogram.DetectedTextBlockAlignment) + || typeToConvert == typeof(global::Ideogram.GenerationResponseDataInnerVariant4ObjectType) - || typeToConvert == typeof(global::Ideogram.DetectedTextBlockAlignment?) + || typeToConvert == typeof(global::Ideogram.GenerationResponseDataInnerVariant4ObjectType?) - || typeToConvert == typeof(global::Ideogram.DetectedTextBlockFormattingItem) + || typeToConvert == typeof(global::Ideogram.GenerationResponseDataInnerVariant5ObjectType) - || typeToConvert == typeof(global::Ideogram.DetectedTextBlockFormattingItem?) + || typeToConvert == typeof(global::Ideogram.GenerationResponseDataInnerVariant5ObjectType?) - || typeToConvert == typeof(global::Ideogram.DetectedTextBlockRole) + || typeToConvert == typeof(global::Ideogram.GenerationResponseDataInnerVariant6ObjectType) - || typeToConvert == typeof(global::Ideogram.DetectedTextBlockRole?) + || typeToConvert == typeof(global::Ideogram.GenerationResponseDataInnerVariant6ObjectType?) || typeToConvert == typeof(global::Ideogram.GenerationResponseDataInnerDiscriminatorObjectType) @@ -205,6 +221,36 @@ public override bool CanConvert(global::System.Type typeToConvert) global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) { + if (typeToConvert == typeof(global::Ideogram.DetectedTextBlockAlignment)) + { + return new global::Ideogram.JsonConverters.DetectedTextBlockAlignmentJsonConverter(); + } + + if (typeToConvert == typeof(global::Ideogram.DetectedTextBlockAlignment?)) + { + return new global::Ideogram.JsonConverters.DetectedTextBlockAlignmentNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::Ideogram.DetectedTextBlockFormattingItems)) + { + return new global::Ideogram.JsonConverters.DetectedTextBlockFormattingItemsJsonConverter(); + } + + if (typeToConvert == typeof(global::Ideogram.DetectedTextBlockFormattingItems?)) + { + return new global::Ideogram.JsonConverters.DetectedTextBlockFormattingItemsNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::Ideogram.DetectedTextBlockRole)) + { + return new global::Ideogram.JsonConverters.DetectedTextBlockRoleJsonConverter(); + } + + if (typeToConvert == typeof(global::Ideogram.DetectedTextBlockRole?)) + { + return new global::Ideogram.JsonConverters.DetectedTextBlockRoleNullableJsonConverter(); + } + if (typeToConvert == typeof(global::Ideogram.GenerationResponseStatus)) { return new global::Ideogram.JsonConverters.GenerationResponseStatusJsonConverter(); @@ -225,104 +271,104 @@ public override bool CanConvert(global::System.Type typeToConvert) return new global::Ideogram.JsonConverters.GenerationResponseResponseTypeNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.ImageObjectWithoutPromptOrSeedObjectType)) + if (typeToConvert == typeof(global::Ideogram.GenerationResponseDataInnerDiscriminatorMappingSvgGenerationMimeType)) { - return new global::Ideogram.JsonConverters.ImageObjectWithoutPromptOrSeedObjectTypeJsonConverter(); + return new global::Ideogram.JsonConverters.GenerationResponseDataInnerDiscriminatorMappingSvgGenerationMimeTypeJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.ImageObjectWithoutPromptOrSeedObjectType?)) + if (typeToConvert == typeof(global::Ideogram.GenerationResponseDataInnerDiscriminatorMappingSvgGenerationMimeType?)) { - return new global::Ideogram.JsonConverters.ImageObjectWithoutPromptOrSeedObjectTypeNullableJsonConverter(); + return new global::Ideogram.JsonConverters.GenerationResponseDataInnerDiscriminatorMappingSvgGenerationMimeTypeNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.ImageGenerationObjectObjectType)) + if (typeToConvert == typeof(global::Ideogram.LayerizedTextBlockAlignment)) { - return new global::Ideogram.JsonConverters.ImageGenerationObjectObjectTypeJsonConverter(); + return new global::Ideogram.JsonConverters.LayerizedTextBlockAlignmentJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.ImageGenerationObjectObjectType?)) + if (typeToConvert == typeof(global::Ideogram.LayerizedTextBlockAlignment?)) { - return new global::Ideogram.JsonConverters.ImageGenerationObjectObjectTypeNullableJsonConverter(); + return new global::Ideogram.JsonConverters.LayerizedTextBlockAlignmentNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.LayerizedImageObjectObjectType)) + if (typeToConvert == typeof(global::Ideogram.LayerizedTextBlockFormattingItems)) { - return new global::Ideogram.JsonConverters.LayerizedImageObjectObjectTypeJsonConverter(); + return new global::Ideogram.JsonConverters.LayerizedTextBlockFormattingItemsJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.LayerizedImageObjectObjectType?)) + if (typeToConvert == typeof(global::Ideogram.LayerizedTextBlockFormattingItems?)) { - return new global::Ideogram.JsonConverters.LayerizedImageObjectObjectTypeNullableJsonConverter(); + return new global::Ideogram.JsonConverters.LayerizedTextBlockFormattingItemsNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.SvgGenerationObjectObjectType)) + if (typeToConvert == typeof(global::Ideogram.LayerizedTextBlockRole)) { - return new global::Ideogram.JsonConverters.SvgGenerationObjectObjectTypeJsonConverter(); + return new global::Ideogram.JsonConverters.LayerizedTextBlockRoleJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.SvgGenerationObjectObjectType?)) + if (typeToConvert == typeof(global::Ideogram.LayerizedTextBlockRole?)) { - return new global::Ideogram.JsonConverters.SvgGenerationObjectObjectTypeNullableJsonConverter(); + return new global::Ideogram.JsonConverters.LayerizedTextBlockRoleNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.SvgGenerationObjectMimeType)) + if (typeToConvert == typeof(global::Ideogram.GenerationResponseDataInnerVariant1ObjectType)) { - return new global::Ideogram.JsonConverters.SvgGenerationObjectMimeTypeJsonConverter(); + return new global::Ideogram.JsonConverters.GenerationResponseDataInnerVariant1ObjectTypeJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.SvgGenerationObjectMimeType?)) + if (typeToConvert == typeof(global::Ideogram.GenerationResponseDataInnerVariant1ObjectType?)) { - return new global::Ideogram.JsonConverters.SvgGenerationObjectMimeTypeNullableJsonConverter(); + return new global::Ideogram.JsonConverters.GenerationResponseDataInnerVariant1ObjectTypeNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.VideoObjectObjectType)) + if (typeToConvert == typeof(global::Ideogram.GenerationResponseDataInnerVariant2ObjectType)) { - return new global::Ideogram.JsonConverters.VideoObjectObjectTypeJsonConverter(); + return new global::Ideogram.JsonConverters.GenerationResponseDataInnerVariant2ObjectTypeJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.VideoObjectObjectType?)) + if (typeToConvert == typeof(global::Ideogram.GenerationResponseDataInnerVariant2ObjectType?)) { - return new global::Ideogram.JsonConverters.VideoObjectObjectTypeNullableJsonConverter(); + return new global::Ideogram.JsonConverters.GenerationResponseDataInnerVariant2ObjectTypeNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.TextLayerizerResultObjectObjectType)) + if (typeToConvert == typeof(global::Ideogram.GenerationResponseDataInnerVariant3ObjectType)) { - return new global::Ideogram.JsonConverters.TextLayerizerResultObjectObjectTypeJsonConverter(); + return new global::Ideogram.JsonConverters.GenerationResponseDataInnerVariant3ObjectTypeJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.TextLayerizerResultObjectObjectType?)) + if (typeToConvert == typeof(global::Ideogram.GenerationResponseDataInnerVariant3ObjectType?)) { - return new global::Ideogram.JsonConverters.TextLayerizerResultObjectObjectTypeNullableJsonConverter(); + return new global::Ideogram.JsonConverters.GenerationResponseDataInnerVariant3ObjectTypeNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.DetectedTextBlockAlignment)) + if (typeToConvert == typeof(global::Ideogram.GenerationResponseDataInnerVariant4ObjectType)) { - return new global::Ideogram.JsonConverters.DetectedTextBlockAlignmentJsonConverter(); + return new global::Ideogram.JsonConverters.GenerationResponseDataInnerVariant4ObjectTypeJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.DetectedTextBlockAlignment?)) + if (typeToConvert == typeof(global::Ideogram.GenerationResponseDataInnerVariant4ObjectType?)) { - return new global::Ideogram.JsonConverters.DetectedTextBlockAlignmentNullableJsonConverter(); + return new global::Ideogram.JsonConverters.GenerationResponseDataInnerVariant4ObjectTypeNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.DetectedTextBlockFormattingItem)) + if (typeToConvert == typeof(global::Ideogram.GenerationResponseDataInnerVariant5ObjectType)) { - return new global::Ideogram.JsonConverters.DetectedTextBlockFormattingItemJsonConverter(); + return new global::Ideogram.JsonConverters.GenerationResponseDataInnerVariant5ObjectTypeJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.DetectedTextBlockFormattingItem?)) + if (typeToConvert == typeof(global::Ideogram.GenerationResponseDataInnerVariant5ObjectType?)) { - return new global::Ideogram.JsonConverters.DetectedTextBlockFormattingItemNullableJsonConverter(); + return new global::Ideogram.JsonConverters.GenerationResponseDataInnerVariant5ObjectTypeNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.DetectedTextBlockRole)) + if (typeToConvert == typeof(global::Ideogram.GenerationResponseDataInnerVariant6ObjectType)) { - return new global::Ideogram.JsonConverters.DetectedTextBlockRoleJsonConverter(); + return new global::Ideogram.JsonConverters.GenerationResponseDataInnerVariant6ObjectTypeJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.DetectedTextBlockRole?)) + if (typeToConvert == typeof(global::Ideogram.GenerationResponseDataInnerVariant6ObjectType?)) { - return new global::Ideogram.JsonConverters.DetectedTextBlockRoleNullableJsonConverter(); + return new global::Ideogram.JsonConverters.GenerationResponseDataInnerVariant6ObjectTypeNullableJsonConverter(); } if (typeToConvert == typeof(global::Ideogram.GenerationResponseDataInnerDiscriminatorObjectType)) diff --git a/src/libs/Ideogram/Generated/Ideogram.GenerationsClient.GenerationsGetGenerationV2.g.cs b/src/libs/Ideogram/Generated/Ideogram.GenerationsClient.GenerationsGetGenerationV2.g.cs new file mode 100644 index 00000000..aac07cbc --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.GenerationsClient.GenerationsGetGenerationV2.g.cs @@ -0,0 +1,598 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class GenerationsClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_GenerationsGetGenerationV2SecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_GenerationsGetGenerationV2SecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_GenerationsGetGenerationV2SecurityRequirement0, + }; + partial void PrepareGenerationsGetGenerationV2Arguments( + global::System.Net.Http.HttpClient httpClient, + ref string generationId); + partial void PrepareGenerationsGetGenerationV2Request( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string generationId); + partial void ProcessGenerationsGetGenerationV2Response( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessGenerationsGetGenerationV2ResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Poll a generation
+ /// Retrieves the current status of an asynchronous generation, and its
+ /// results once complete. Use the `generation_id` returned by any `/v2`
+ /// endpoint that runs asynchronously: every video and tool endpoint, and
+ /// any image endpoint called with `async` or a `webhook_url`.
+ /// While the generation is `pending` or has `failed`, the response
+ /// contains only `generation_id`, `status`, and `created` (plus
+ /// `failure_reason` once failed). Once `status` is `completed`, the
+ /// response includes `response_type` and `data`. Each `data` item carries
+ /// an `object_type` that identifies its shape, so image and video results
+ /// can be told apart. `usage_cost_usd_micros` reports the amount billed
+ /// when the request uses variable usage-based pricing.
+ /// Polling is rate limited per organization; a 429 response carries a
+ /// `Retry-After` header with the number of seconds to wait. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task GenerationsGetGenerationV2Async( + string generationId, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GenerationsGetGenerationV2AsResponseAsync( + generationId: generationId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Poll a generation
+ /// Retrieves the current status of an asynchronous generation, and its
+ /// results once complete. Use the `generation_id` returned by any `/v2`
+ /// endpoint that runs asynchronously: every video and tool endpoint, and
+ /// any image endpoint called with `async` or a `webhook_url`.
+ /// While the generation is `pending` or has `failed`, the response
+ /// contains only `generation_id`, `status`, and `created` (plus
+ /// `failure_reason` once failed). Once `status` is `completed`, the
+ /// response includes `response_type` and `data`. Each `data` item carries
+ /// an `object_type` that identifies its shape, so image and video results
+ /// can be told apart. `usage_cost_usd_micros` reports the amount billed
+ /// when the request uses variable usage-based pricing.
+ /// Polling is rate limited per organization; a 429 response carries a
+ /// `Retry-After` header with the number of seconds to wait. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GenerationsGetGenerationV2AsResponseAsync( + string generationId, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareGenerationsGetGenerationV2Arguments( + httpClient: HttpClient, + generationId: ref generationId); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_GenerationsGetGenerationV2SecurityRequirements, + operationName: "GenerationsGetGenerationV2Async"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: $"/v2/generations/{generationId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGenerationsGetGenerationV2Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + generationId: generationId); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GenerationsGetGenerationV2", + methodName: "GenerationsGetGenerationV2Async", + pathTemplate: "$\"/v2/generations/{generationId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GenerationsGetGenerationV2", + methodName: "GenerationsGetGenerationV2Async", + pathTemplate: "$\"/v2/generations/{generationId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GenerationsGetGenerationV2", + methodName: "GenerationsGetGenerationV2Async", + pathTemplate: "$\"/v2/generations/{generationId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessGenerationsGetGenerationV2Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GenerationsGetGenerationV2", + methodName: "GenerationsGetGenerationV2Async", + pathTemplate: "$\"/v2/generations/{generationId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GenerationsGetGenerationV2", + methodName: "GenerationsGetGenerationV2Async", + pathTemplate: "$\"/v2/generations/{generationId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // The generation ID is not a valid URL-safe base64 ID. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not authorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Generation not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + string? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_429, typeof(string), JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_429, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessGenerationsGetGenerationV2ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.GenerationResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.GenerationResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.GenerationsClient.GetGenerationV2.g.cs b/src/libs/Ideogram/Generated/Ideogram.GenerationsClient.GetGenerationV2.g.cs deleted file mode 100644 index 4dc5fec1..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.GenerationsClient.GetGenerationV2.g.cs +++ /dev/null @@ -1,578 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class GenerationsClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_GetGenerationV2SecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_GetGenerationV2SecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_GetGenerationV2SecurityRequirement0, - }; - partial void PrepareGetGenerationV2Arguments( - global::System.Net.Http.HttpClient httpClient, - ref string generationId); - partial void PrepareGetGenerationV2Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string generationId); - partial void ProcessGetGenerationV2Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessGetGenerationV2ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Poll a generation
- /// Retrieves the current status of an asynchronous generation, and its
- /// results once complete. Use the `generation_id` returned by any `/v2`
- /// endpoint that runs asynchronously: every video and tool endpoint, and
- /// any image endpoint called with `async` or a `webhook_url`.
- /// While the generation is `pending` or has `failed`, the response
- /// contains only `generation_id`, `status`, and `created` (plus
- /// `failure_reason` once failed). Once `status` is `completed`, the
- /// response includes `response_type` and `data`. Each `data` item carries
- /// an `object_type` that identifies its shape, so image and video results
- /// can be told apart. `usage_cost_usd_micros` reports the amount billed
- /// when the request uses variable usage-based pricing.
- /// Polling is rate limited per organization; a 429 response carries a
- /// `Retry-After` header with the number of seconds to wait. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task GetGenerationV2Async( - string generationId, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await GetGenerationV2AsResponseAsync( - generationId: generationId, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Poll a generation
- /// Retrieves the current status of an asynchronous generation, and its
- /// results once complete. Use the `generation_id` returned by any `/v2`
- /// endpoint that runs asynchronously: every video and tool endpoint, and
- /// any image endpoint called with `async` or a `webhook_url`.
- /// While the generation is `pending` or has `failed`, the response
- /// contains only `generation_id`, `status`, and `created` (plus
- /// `failure_reason` once failed). Once `status` is `completed`, the
- /// response includes `response_type` and `data`. Each `data` item carries
- /// an `object_type` that identifies its shape, so image and video results
- /// can be told apart. `usage_cost_usd_micros` reports the amount billed
- /// when the request uses variable usage-based pricing.
- /// Polling is rate limited per organization; a 429 response carries a
- /// `Retry-After` header with the number of seconds to wait. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> GetGenerationV2AsResponseAsync( - string generationId, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareGetGenerationV2Arguments( - httpClient: HttpClient, - generationId: ref generationId); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_GetGenerationV2SecurityRequirements, - operationName: "GetGenerationV2Async"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: $"/v2/generations/{generationId}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetGenerationV2Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - generationId: generationId); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetGenerationV2", - methodName: "GetGenerationV2Async", - pathTemplate: "$\"/v2/generations/{generationId}\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetGenerationV2", - methodName: "GetGenerationV2Async", - pathTemplate: "$\"/v2/generations/{generationId}\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetGenerationV2", - methodName: "GetGenerationV2Async", - pathTemplate: "$\"/v2/generations/{generationId}\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetGenerationV2Response( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetGenerationV2", - methodName: "GetGenerationV2Async", - pathTemplate: "$\"/v2/generations/{generationId}\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetGenerationV2", - methodName: "GetGenerationV2Async", - pathTemplate: "$\"/v2/generations/{generationId}\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetGenerationV2ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.GenerationResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.GenerationResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IAccountClient.AccountGetAccountApiKeys.g.cs b/src/libs/Ideogram/Generated/Ideogram.IAccountClient.AccountGetAccountApiKeys.g.cs new file mode 100644 index 00000000..c24f9e2a --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IAccountClient.AccountGetAccountApiKeys.g.cs @@ -0,0 +1,38 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IAccountClient + { + /// + /// List API keys
+ /// Lists the API keys in your organization. Key material is redacted —
+ /// the full key is only shown once, when it is created. Disabled and
+ /// archived keys are included (see each key's `status`) so historical
+ /// usage can always be matched to the key that generated it.
+ /// Requires an API key whose owner is an organization admin. Keys owned
+ /// by other members receive a 404. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task AccountGetAccountApiKeysAsync( + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List API keys
+ /// Lists the API keys in your organization. Key material is redacted —
+ /// the full key is only shown once, when it is created. Disabled and
+ /// archived keys are included (see each key's `status`) so historical
+ /// usage can always be matched to the key that generated it.
+ /// Requires an API key whose owner is an organization admin. Keys owned
+ /// by other members receive a 404. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> AccountGetAccountApiKeysAsResponseAsync( + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IAccountClient.AccountGetAccountInvoices.g.cs b/src/libs/Ideogram/Generated/Ideogram.IAccountClient.AccountGetAccountInvoices.g.cs new file mode 100644 index 00000000..e23db686 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IAccountClient.AccountGetAccountInvoices.g.cs @@ -0,0 +1,36 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IAccountClient + { + /// + /// List invoices
+ /// Returns your organization's invoices with their line items — the
+ /// billing record your usage reports reconcile against. Amounts are
+ /// decimal strings in the invoice's currency.
+ /// Requires an API key whose owner is an organization admin. Keys owned
+ /// by other members receive a 404. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task AccountGetAccountInvoicesAsync( + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List invoices
+ /// Returns your organization's invoices with their line items — the
+ /// billing record your usage reports reconcile against. Amounts are
+ /// decimal strings in the invoice's currency.
+ /// Requires an API key whose owner is an organization admin. Keys owned
+ /// by other members receive a 404. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> AccountGetAccountInvoicesAsResponseAsync( + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IAccountClient.AccountGetAccountUsage.g.cs b/src/libs/Ideogram/Generated/Ideogram.IAccountClient.AccountGetAccountUsage.g.cs new file mode 100644 index 00000000..f9779c1c --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IAccountClient.AccountGetAccountUsage.g.cs @@ -0,0 +1,86 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IAccountClient + { + /// + /// Get usage and spend
+ /// Returns your organization's billed API usage as dense time buckets of
+ /// line items. Every line item carries the billed dollar amount; products
+ /// billed per item also carry `billed_units` (unit, quantity, and unit
+ /// price, where `quantity × unit_price = cost_total`). Usage-priced
+ /// products (billed by metered provider usage) report `cost_total` only.
+ /// Buckets cover the requested range completely — a bucket with no line
+ /// items means no billed usage in that window. Line items are unique per
+ /// bucket on (`product`, `dimensions`, `api_key.id`, unit price). Usage
+ /// billed without an API key (requests authenticated as a user session)
+ /// is included with `api_key` absent, so totals always reconcile with
+ /// your invoices.
+ /// `product` and `endpoint` are stable identifiers safe to aggregate on;
+ /// `description` is display text and may be reworded at any time.
+ /// Usage data may lag live traffic by a few minutes, and responses may be
+ /// cached briefly, so this endpoint is for reporting rather than
+ /// real-time monitoring.
+ /// Requires an API key whose owner is an organization admin. Keys owned
+ /// by other members receive a 404. + ///
+ /// + /// + /// + /// Default Value: 1d + /// + /// + /// Default Value: [api, app] + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task AccountGetAccountUsageAsync( + global::System.DateTime startTime, + global::System.DateTime? endTime = default, + global::Ideogram.V2AccountUsageGetParametersBucketWidth? bucketWidth = default, + global::System.Collections.Generic.IList? sources = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get usage and spend
+ /// Returns your organization's billed API usage as dense time buckets of
+ /// line items. Every line item carries the billed dollar amount; products
+ /// billed per item also carry `billed_units` (unit, quantity, and unit
+ /// price, where `quantity × unit_price = cost_total`). Usage-priced
+ /// products (billed by metered provider usage) report `cost_total` only.
+ /// Buckets cover the requested range completely — a bucket with no line
+ /// items means no billed usage in that window. Line items are unique per
+ /// bucket on (`product`, `dimensions`, `api_key.id`, unit price). Usage
+ /// billed without an API key (requests authenticated as a user session)
+ /// is included with `api_key` absent, so totals always reconcile with
+ /// your invoices.
+ /// `product` and `endpoint` are stable identifiers safe to aggregate on;
+ /// `description` is display text and may be reworded at any time.
+ /// Usage data may lag live traffic by a few minutes, and responses may be
+ /// cached briefly, so this endpoint is for reporting rather than
+ /// real-time monitoring.
+ /// Requires an API key whose owner is an organization admin. Keys owned
+ /// by other members receive a 404. + ///
+ /// + /// + /// + /// Default Value: 1d + /// + /// + /// Default Value: [api, app] + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> AccountGetAccountUsageAsResponseAsync( + global::System.DateTime startTime, + global::System.DateTime? endTime = default, + global::Ideogram.V2AccountUsageGetParametersBucketWidth? bucketWidth = default, + global::System.Collections.Generic.IList? sources = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IAccountClient.GetAccountApiKeys.g.cs b/src/libs/Ideogram/Generated/Ideogram.IAccountClient.GetAccountApiKeys.g.cs deleted file mode 100644 index ca764c21..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IAccountClient.GetAccountApiKeys.g.cs +++ /dev/null @@ -1,38 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IAccountClient - { - /// - /// List API keys
- /// Lists the API keys in your organization. Key material is redacted —
- /// the full key is only shown once, when it is created. Disabled and
- /// archived keys are included (see each key's `status`) so historical
- /// usage can always be matched to the key that generated it.
- /// Requires an API key whose owner is an organization admin. Keys owned
- /// by other members receive a 404. - ///
- /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task GetAccountApiKeysAsync( - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// List API keys
- /// Lists the API keys in your organization. Key material is redacted —
- /// the full key is only shown once, when it is created. Disabled and
- /// archived keys are included (see each key's `status`) so historical
- /// usage can always be matched to the key that generated it.
- /// Requires an API key whose owner is an organization admin. Keys owned
- /// by other members receive a 404. - ///
- /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> GetAccountApiKeysAsResponseAsync( - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IAccountClient.GetAccountInvoices.g.cs b/src/libs/Ideogram/Generated/Ideogram.IAccountClient.GetAccountInvoices.g.cs deleted file mode 100644 index 158d2471..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IAccountClient.GetAccountInvoices.g.cs +++ /dev/null @@ -1,36 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IAccountClient - { - /// - /// List invoices
- /// Returns your organization's invoices with their line items — the
- /// billing record your usage reports reconcile against. Amounts are
- /// decimal strings in the invoice's currency.
- /// Requires an API key whose owner is an organization admin. Keys owned
- /// by other members receive a 404. - ///
- /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task GetAccountInvoicesAsync( - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// List invoices
- /// Returns your organization's invoices with their line items — the
- /// billing record your usage reports reconcile against. Amounts are
- /// decimal strings in the invoice's currency.
- /// Requires an API key whose owner is an organization admin. Keys owned
- /// by other members receive a 404. - ///
- /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> GetAccountInvoicesAsResponseAsync( - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IAccountClient.GetAccountUsage.g.cs b/src/libs/Ideogram/Generated/Ideogram.IAccountClient.GetAccountUsage.g.cs deleted file mode 100644 index 3f1b9b8b..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IAccountClient.GetAccountUsage.g.cs +++ /dev/null @@ -1,86 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IAccountClient - { - /// - /// Get usage and spend
- /// Returns your organization's billed API usage as dense time buckets of
- /// line items. Every line item carries the billed dollar amount; products
- /// billed per item also carry `billed_units` (unit, quantity, and unit
- /// price, where `quantity × unit_price = cost_total`). Usage-priced
- /// products (billed by metered provider usage) report `cost_total` only.
- /// Buckets cover the requested range completely — a bucket with no line
- /// items means no billed usage in that window. Line items are unique per
- /// bucket on (`product`, `dimensions`, `api_key.id`, unit price). Usage
- /// billed without an API key (requests authenticated as a user session)
- /// is included with `api_key` absent, so totals always reconcile with
- /// your invoices.
- /// `product` and `endpoint` are stable identifiers safe to aggregate on;
- /// `description` is display text and may be reworded at any time.
- /// Usage data may lag live traffic by a few minutes, and responses may be
- /// cached briefly, so this endpoint is for reporting rather than
- /// real-time monitoring.
- /// Requires an API key whose owner is an organization admin. Keys owned
- /// by other members receive a 404. - ///
- /// - /// - /// - /// Default Value: 1d - /// - /// - /// Default Value: [api, app] - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task GetAccountUsageAsync( - global::System.DateTime startTime, - global::System.DateTime? endTime = default, - global::Ideogram.GetAccountUsageBucketWidth? bucketWidth = default, - global::System.Collections.Generic.IList? sources = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Get usage and spend
- /// Returns your organization's billed API usage as dense time buckets of
- /// line items. Every line item carries the billed dollar amount; products
- /// billed per item also carry `billed_units` (unit, quantity, and unit
- /// price, where `quantity × unit_price = cost_total`). Usage-priced
- /// products (billed by metered provider usage) report `cost_total` only.
- /// Buckets cover the requested range completely — a bucket with no line
- /// items means no billed usage in that window. Line items are unique per
- /// bucket on (`product`, `dimensions`, `api_key.id`, unit price). Usage
- /// billed without an API key (requests authenticated as a user session)
- /// is included with `api_key` absent, so totals always reconcile with
- /// your invoices.
- /// `product` and `endpoint` are stable identifiers safe to aggregate on;
- /// `description` is display text and may be reworded at any time.
- /// Usage data may lag live traffic by a few minutes, and responses may be
- /// cached briefly, so this endpoint is for reporting rather than
- /// real-time monitoring.
- /// Requires an API key whose owner is an organization admin. Keys owned
- /// by other members receive a 404. - ///
- /// - /// - /// - /// Default Value: 1d - /// - /// - /// Default Value: [api, app] - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> GetAccountUsageAsResponseAsync( - global::System.DateTime startTime, - global::System.DateTime? endTime = default, - global::Ideogram.GetAccountUsageBucketWidth? bucketWidth = default, - global::System.Collections.Generic.IList? sources = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IAssetReferenceUsageClient.Authorizations.Bearer.g.cs b/src/libs/Ideogram/Generated/Ideogram.IAssetReferenceUsageClient.Authorizations.Bearer.g.cs deleted file mode 100644 index 7f523c4b..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IAssetReferenceUsageClient.Authorizations.Bearer.g.cs +++ /dev/null @@ -1,16 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial interface IAssetReferenceUsageClient - { - /// - /// Authorize using bearer authentication. - /// - /// - - public void AuthorizeUsingBearer( - string apiKey); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IAssetReferenceUsageClient.GetAssetReferenceUsage.g.cs b/src/libs/Ideogram/Generated/Ideogram.IAssetReferenceUsageClient.GetAssetReferenceUsage.g.cs deleted file mode 100644 index 9a7757b9..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IAssetReferenceUsageClient.GetAssetReferenceUsage.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IAssetReferenceUsageClient - { - /// - /// Rank edit reference assets used by organization requests
- /// Counts completed requests made by the authenticated organization that used each existing asset as an edit input during the UTC date range. Direct file uploads without saved asset identifiers are excluded. Results are independent of current asset ownership, collection membership, and sharing. Returning an identifier does not grant access to its image. Tracking begins when enabled; earlier history is not included. Returns 50 assets per page by default, up to 100 with limit. Rankings may change between pages when daily counts are updated; cursors do not pin a historical snapshot. - ///
- /// - /// Default Value: 50 - /// - /// - /// - /// Default Value: false - /// - /// - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task GetAssetReferenceUsageAsync( - global::System.DateTime startDate, - global::System.DateTime endDate, - int? limit = default, - global::System.Collections.Generic.IList? collectionIds = default, - bool? includeCollections = default, - string? cursor = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Rank edit reference assets used by organization requests
- /// Counts completed requests made by the authenticated organization that used each existing asset as an edit input during the UTC date range. Direct file uploads without saved asset identifiers are excluded. Results are independent of current asset ownership, collection membership, and sharing. Returning an identifier does not grant access to its image. Tracking begins when enabled; earlier history is not included. Returns 50 assets per page by default, up to 100 with limit. Rankings may change between pages when daily counts are updated; cursors do not pin a historical snapshot. - ///
- /// - /// Default Value: 50 - /// - /// - /// - /// Default Value: false - /// - /// - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> GetAssetReferenceUsageAsResponseAsync( - global::System.DateTime startDate, - global::System.DateTime endDate, - int? limit = default, - global::System.Collections.Generic.IList? collectionIds = default, - bool? includeCollections = default, - string? cursor = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IAssetReferenceUsageClient.g.cs b/src/libs/Ideogram/Generated/Ideogram.IAssetReferenceUsageClient.g.cs deleted file mode 100644 index 2974d7fb..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IAssetReferenceUsageClient.g.cs +++ /dev/null @@ -1,48 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// If no httpClient is provided, a new one will be created.
- /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. - ///
- public partial interface IAssetReferenceUsageClient : global::System.IDisposable - { - /// - /// The HttpClient instance. - /// - public global::System.Net.Http.HttpClient HttpClient { get; } - - /// - /// The base URL for the API. - /// - public System.Uri? BaseUri { get; } - - /// - /// The authorizations to use for the requests. - /// - public global::System.Collections.Generic.List Authorizations { get; } - - /// - /// Gets or sets a value indicating whether the response content should be read as a string. - /// True by default in debug builds, false otherwise. - /// When false, successful responses are deserialized directly from the response stream for better performance. - /// Error responses are always read as strings regardless of this setting, - /// ensuring is populated. - /// - public bool ReadResponseAsString { get; set; } - /// - /// Client-wide request defaults such as headers, query parameters, retries, and timeout. - /// - public global::Ideogram.AutoSDKClientOptions Options { get; } - - - /// - /// - /// - global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } - - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IAutoModelClient.AutoModelPostGenerateImageV2Auto.g.cs b/src/libs/Ideogram/Generated/Ideogram.IAutoModelClient.AutoModelPostGenerateImageV2Auto.g.cs new file mode 100644 index 00000000..654eb8fd --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IAutoModelClient.AutoModelPostGenerateImageV2Auto.g.cs @@ -0,0 +1,116 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IAutoModelClient + { + /// + /// Generate with automatic model selection
+ /// Generate images with the model Ideogram picks as best suited to each
+ /// request. Optionally upload source images as `images` using
+ /// `multipart/form-data` to edit them with the prompt. Returns results
+ /// directly by default; set `async` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task AutoModelPostGenerateImageV2AutoAsync( + + global::Ideogram.AutoModelPostGenerateImageV2AutoRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Generate with automatic model selection
+ /// Generate images with the model Ideogram picks as best suited to each
+ /// request. Optionally upload source images as `images` using
+ /// `multipart/form-data` to edit them with the prompt. Returns results
+ /// directly by default; set `async` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> AutoModelPostGenerateImageV2AutoAsResponseAsync( + + global::Ideogram.AutoModelPostGenerateImageV2AutoRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Generate with automatic model selection
+ /// Generate images with the model Ideogram picks as best suited to each
+ /// request. Optionally upload source images as `images` using
+ /// `multipart/form-data` to edit them with the prompt. Returns results
+ /// directly by default; set `async` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt to generate images from or, when source images are supplied, the change to make to them. + /// + /// + /// Optional source images to edit (max 10, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only. + /// + /// + /// Description of what to exclude from the images. The prompt takes precedence over the negative prompt. Not every model uses it. Cannot be combined with source images. + /// + /// + /// The output aspect ratio. `auto` (the default) picks the most suitable ratio for the request. Without source images the value must be a supported ratio (for example "16x9" or "1x1"); with source images any "WIDTHxHEIGHT" value is accepted and the output uses the closest supported shape. Omit `resolution` when supplying a non-`auto` value.
+ /// Default Value: auto + /// + /// + /// The requested output resolution, formatted as "WIDTHxHEIGHT" (for example "1280x800"). The output is served at the closest resolution the selected model supports. Omit `aspect_ratio` (or leave it `auto`) when supplying a resolution. + /// + /// + /// The output resolution tier. Affects which model serves the request, since not every model offers every tier. When omitted, the selected model's default tier is used. + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// Whether the generated images should be kept private. When omitted, the default follows the caller's plan; some plans always generate privately. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task AutoModelPostGenerateImageV2AutoAsync( + string prompt, + bool? dryRun = default, + global::System.Collections.Generic.IList? images = default, + string? negativePrompt = default, + string? aspectRatio = default, + string? resolution = default, + global::Ideogram.V2ImageGenerateAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier? resolutionTier = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + int? numImages = default, + int? seed = default, + bool? @private = default, + bool? async = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IAutoModelClient.AutoModelPostToolRemix.g.cs b/src/libs/Ideogram/Generated/Ideogram.IAutoModelClient.AutoModelPostToolRemix.g.cs new file mode 100644 index 00000000..9e40fe9b --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IAutoModelClient.AutoModelPostToolRemix.g.cs @@ -0,0 +1,357 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IAutoModelClient + { + /// + /// Remix with automatic model selection
+ /// Remix an image guided by a text prompt, with Ideogram choosing the
+ /// model. Upload the source image as `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task AutoModelPostToolRemixAsync( + + global::Ideogram.AutoModelPostToolRemixRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Remix with automatic model selection
+ /// Remix an image guided by a text prompt, with Ideogram choosing the
+ /// model. Upload the source image as `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> AutoModelPostToolRemixAsResponseAsync( + + global::Ideogram.AutoModelPostToolRemixRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Remix with automatic model selection
+ /// Remix an image guided by a text prompt, with Ideogram choosing the
+ /// model. Upload the source image as `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt that guides the remix. + /// + /// + /// The image to remix (max 50MB; JPEG, PNG, or WEBP). Multipart requests only. The image is used only for this request and is not saved to your account. + /// + /// + /// The image to remix (max 50MB; JPEG, PNG, or WEBP). Multipart requests only. The image is used only for this request and is not saved to your account. + /// + /// + /// Optional. How closely the result should follow the source image, from 1 to 100. When omitted the selected model chooses its usual strength. Combining a weight with a `resolution` or `aspect_ratio` that changes the source's aspect ratio crops the source to the new shape; this is only available at the 1K tier and is rejected at 2K. + /// + /// + /// Description of what to exclude from the images. The prompt takes precedence over the negative prompt. Not every model uses it. + /// + /// + /// The requested output resolution, formatted as "WIDTHxHEIGHT" (for example "1280x800"). The output uses the closest supported resolution in the matching 1K or 2K tier. Omit `aspect_ratio` when supplying a resolution. If `resolution_tier` is also supplied, it must match the tier these dimensions fall in. Combining a shape-changing value with `image_weight` requires the 1K tier. + /// + /// + /// The requested output aspect ratio. Omit it to keep the source image's shape. `auto` also keeps the source shape. Omit `resolution` when supplying a concrete value. Combining a shape-changing value with `image_weight` requires the 1K tier.
+ /// Default Value: auto + /// + /// + /// The output resolution tier. When omitted, the tier is inferred from `resolution`, or defaults to 1k. A color palette, style codes, style preset, or non-`auto` style type are only supported at 1k. + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`. The selected model decides how to interpret it.
+ /// Default Value: auto + /// + /// + /// Optional. Only honored when the request uses a model that supports reproducible remixes; results from the default model are not reproducible. The response reports the seed used. + /// + /// + /// A predefined style preset to apply. Limits the request to a model that supports it and requires the 1K resolution tier. Cannot be combined with style codes. + /// + /// + /// A color palette to apply. Limits the request to a model that supports palettes and requires the 1K resolution tier. + /// + /// + /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images. + /// + /// + /// The style type to generate with. A value other than `auto` limits the request to a model that supports it and requires the 1K resolution tier.
+ /// Default Value: general + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task AutoModelPostToolRemixAsync( + string prompt, + byte[] image, + string imagename, + bool? dryRun = default, + int? imageWeight = default, + string? negativePrompt = default, + string? resolution = default, + global::Ideogram.IdeogramV4AspectRatio? aspectRatio = default, + global::Ideogram.V2ImageRemixAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier? resolutionTier = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + int? seed = default, + global::Ideogram.IdeogramV3StylePreset? stylePreset = default, + global::Ideogram.IdeogramColorPalette? colorPalette = default, + global::System.Collections.Generic.IList? styleCodes = default, + global::Ideogram.IdeogramV3StyleType? styleType = default, + int? numImages = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Remix with automatic model selection
+ /// Remix an image guided by a text prompt, with Ideogram choosing the
+ /// model. Upload the source image as `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt that guides the remix. + /// + /// + /// The image to remix (max 50MB; JPEG, PNG, or WEBP). Multipart requests only. The image is used only for this request and is not saved to your account. + /// + /// + /// The image to remix (max 50MB; JPEG, PNG, or WEBP). Multipart requests only. The image is used only for this request and is not saved to your account. + /// + /// + /// Optional. How closely the result should follow the source image, from 1 to 100. When omitted the selected model chooses its usual strength. Combining a weight with a `resolution` or `aspect_ratio` that changes the source's aspect ratio crops the source to the new shape; this is only available at the 1K tier and is rejected at 2K. + /// + /// + /// Description of what to exclude from the images. The prompt takes precedence over the negative prompt. Not every model uses it. + /// + /// + /// The requested output resolution, formatted as "WIDTHxHEIGHT" (for example "1280x800"). The output uses the closest supported resolution in the matching 1K or 2K tier. Omit `aspect_ratio` when supplying a resolution. If `resolution_tier` is also supplied, it must match the tier these dimensions fall in. Combining a shape-changing value with `image_weight` requires the 1K tier. + /// + /// + /// The requested output aspect ratio. Omit it to keep the source image's shape. `auto` also keeps the source shape. Omit `resolution` when supplying a concrete value. Combining a shape-changing value with `image_weight` requires the 1K tier.
+ /// Default Value: auto + /// + /// + /// The output resolution tier. When omitted, the tier is inferred from `resolution`, or defaults to 1k. A color palette, style codes, style preset, or non-`auto` style type are only supported at 1k. + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`. The selected model decides how to interpret it.
+ /// Default Value: auto + /// + /// + /// Optional. Only honored when the request uses a model that supports reproducible remixes; results from the default model are not reproducible. The response reports the seed used. + /// + /// + /// A predefined style preset to apply. Limits the request to a model that supports it and requires the 1K resolution tier. Cannot be combined with style codes. + /// + /// + /// A color palette to apply. Limits the request to a model that supports palettes and requires the 1K resolution tier. + /// + /// + /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images. + /// + /// + /// The style type to generate with. A value other than `auto` limits the request to a model that supports it and requires the 1K resolution tier.
+ /// Default Value: general + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task AutoModelPostToolRemixAsync( + string prompt, + global::System.IO.Stream image, + string imagename, + bool? dryRun = default, + int? imageWeight = default, + string? negativePrompt = default, + string? resolution = default, + global::Ideogram.IdeogramV4AspectRatio? aspectRatio = default, + global::Ideogram.V2ImageRemixAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier? resolutionTier = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + int? seed = default, + global::Ideogram.IdeogramV3StylePreset? stylePreset = default, + global::Ideogram.IdeogramColorPalette? colorPalette = default, + global::System.Collections.Generic.IList? styleCodes = default, + global::Ideogram.IdeogramV3StyleType? styleType = default, + int? numImages = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Remix with automatic model selection
+ /// Remix an image guided by a text prompt, with Ideogram choosing the
+ /// model. Upload the source image as `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt that guides the remix. + /// + /// + /// The image to remix (max 50MB; JPEG, PNG, or WEBP). Multipart requests only. The image is used only for this request and is not saved to your account. + /// + /// + /// The image to remix (max 50MB; JPEG, PNG, or WEBP). Multipart requests only. The image is used only for this request and is not saved to your account. + /// + /// + /// Optional. How closely the result should follow the source image, from 1 to 100. When omitted the selected model chooses its usual strength. Combining a weight with a `resolution` or `aspect_ratio` that changes the source's aspect ratio crops the source to the new shape; this is only available at the 1K tier and is rejected at 2K. + /// + /// + /// Description of what to exclude from the images. The prompt takes precedence over the negative prompt. Not every model uses it. + /// + /// + /// The requested output resolution, formatted as "WIDTHxHEIGHT" (for example "1280x800"). The output uses the closest supported resolution in the matching 1K or 2K tier. Omit `aspect_ratio` when supplying a resolution. If `resolution_tier` is also supplied, it must match the tier these dimensions fall in. Combining a shape-changing value with `image_weight` requires the 1K tier. + /// + /// + /// The requested output aspect ratio. Omit it to keep the source image's shape. `auto` also keeps the source shape. Omit `resolution` when supplying a concrete value. Combining a shape-changing value with `image_weight` requires the 1K tier.
+ /// Default Value: auto + /// + /// + /// The output resolution tier. When omitted, the tier is inferred from `resolution`, or defaults to 1k. A color palette, style codes, style preset, or non-`auto` style type are only supported at 1k. + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`. The selected model decides how to interpret it.
+ /// Default Value: auto + /// + /// + /// Optional. Only honored when the request uses a model that supports reproducible remixes; results from the default model are not reproducible. The response reports the seed used. + /// + /// + /// A predefined style preset to apply. Limits the request to a model that supports it and requires the 1K resolution tier. Cannot be combined with style codes. + /// + /// + /// A color palette to apply. Limits the request to a model that supports palettes and requires the 1K resolution tier. + /// + /// + /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images. + /// + /// + /// The style type to generate with. A value other than `auto` limits the request to a model that supports it and requires the 1K resolution tier.
+ /// Default Value: general + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> AutoModelPostToolRemixAsResponseAsync( + string prompt, + global::System.IO.Stream image, + string imagename, + bool? dryRun = default, + int? imageWeight = default, + string? negativePrompt = default, + string? resolution = default, + global::Ideogram.IdeogramV4AspectRatio? aspectRatio = default, + global::Ideogram.V2ImageRemixAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier? resolutionTier = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + int? seed = default, + global::Ideogram.IdeogramV3StylePreset? stylePreset = default, + global::Ideogram.IdeogramColorPalette? colorPalette = default, + global::System.Collections.Generic.IList? styleCodes = default, + global::Ideogram.IdeogramV3StyleType? styleType = default, + int? numImages = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IAutoModelClient.PostGenerateImageV2Auto.g.cs b/src/libs/Ideogram/Generated/Ideogram.IAutoModelClient.PostGenerateImageV2Auto.g.cs deleted file mode 100644 index 50a02ffb..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IAutoModelClient.PostGenerateImageV2Auto.g.cs +++ /dev/null @@ -1,133 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IAutoModelClient - { - /// - /// Generate with automatic model selection
- /// Generate images with the model Ideogram picks as best suited to each
- /// request. Optionally upload source images as `images` using
- /// `multipart/form-data` to edit them with the prompt. Returns results
- /// directly by default; set `async` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageV2AutoAsync( - - global::Ideogram.GenerateImageV2AutoRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with automatic model selection
- /// Generate images with the model Ideogram picks as best suited to each
- /// request. Optionally upload source images as `images` using
- /// `multipart/form-data` to edit them with the prompt. Returns results
- /// directly by default; set `async` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostGenerateImageV2AutoAsResponseAsync( - - global::Ideogram.GenerateImageV2AutoRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with automatic model selection
- /// Generate images with the model Ideogram picks as best suited to each
- /// request. Optionally upload source images as `images` using
- /// `multipart/form-data` to edit them with the prompt. Returns results
- /// directly by default; set `async` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// The prompt to generate images from or, when source images are supplied, the change to make to them. - /// - /// - /// Existing upload or generated image assets to transform, by reference. Takes priority over `images` if both are supplied. Supplying sources turns the request into a transform. - /// - /// - /// Optional source images to edit (max 10, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only. - /// - /// - /// Description of what to exclude from the images. The prompt takes precedence over the negative prompt. Not every model uses it. Cannot be combined with source images. - /// - /// - /// Existing upload or generated image assets whose style should guide the generation, by reference. Cannot be combined with source images. - /// - /// - /// The output aspect ratio. `auto` (the default) picks the most suitable ratio for the request. Without source images the value must be a supported ratio (for example "16x9" or "1x1"); with source images any "WIDTHxHEIGHT" value is accepted and the output uses the closest supported shape. Omit `resolution` when supplying a non-`auto` value.
- /// Default Value: auto - /// - /// - /// The requested output resolution, formatted as "WIDTHxHEIGHT" (for example "1280x800"). The output is served at the closest resolution the selected model supports. Omit `aspect_ratio` (or leave it `auto`) when supplying a resolution. - /// - /// - /// The output resolution tier. Affects which model serves the request, since not every model offers every tier. When omitted, the selected model's default tier is used. - /// - /// - /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
- /// Default Value: auto - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// Whether the generated images should be kept private. When omitted, the default follows the caller's plan; some plans always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - /// - /// The internal generation category to attribute to the output, as a URL-safe base64 UUID without padding. Only applies when source images are supplied. - /// - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageV2AutoAsync( - string prompt, - bool? dryRun = default, - global::System.Collections.Generic.IList? imageAssetIdentifiers = default, - global::System.Collections.Generic.IList? images = default, - string? negativePrompt = default, - global::System.Collections.Generic.IList? styleReferenceAssetIdentifiers = default, - string? aspectRatio = default, - string? resolution = default, - global::Ideogram.GenerateImageV2AutoRequestResolutionTier? resolutionTier = default, - global::Ideogram.MagicPromptMode? magicPrompt = default, - int? numImages = default, - int? seed = default, - bool? @private = default, - string? targetCollectionId = default, - string? categoryId = default, - bool? async = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IAutoModelClient.PostToolRemix.g.cs b/src/libs/Ideogram/Generated/Ideogram.IAutoModelClient.PostToolRemix.g.cs deleted file mode 100644 index 202bcc44..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IAutoModelClient.PostToolRemix.g.cs +++ /dev/null @@ -1,177 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IAutoModelClient - { - /// - /// Remix with automatic model selection
- /// Remix an image guided by a text prompt, with Ideogram choosing the
- /// model. Upload the source image as `image` using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostToolRemixAsync( - - global::Ideogram.ToolRemixRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Remix with automatic model selection
- /// Remix an image guided by a text prompt, with Ideogram choosing the
- /// model. Upload the source image as `image` using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostToolRemixAsResponseAsync( - - global::Ideogram.ToolRemixRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Remix with automatic model selection
- /// Remix an image guided by a text prompt, with Ideogram choosing the
- /// model. Upload the source image as `image` using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// The prompt that guides the remix. - /// - /// - /// The existing upload or generated image to transform. Supply this or `image`, never both. Omit `resolution` and `aspect_ratio` to keep its shape. - /// - /// - /// The image to remix (max 50MB; JPEG, PNG, or WEBP). Multipart requests only. The image is used only for this request and is not saved to your account. - /// - /// - /// The image to remix (max 50MB; JPEG, PNG, or WEBP). Multipart requests only. The image is used only for this request and is not saved to your account. - /// - /// - /// Optional. How closely the result should follow the source image, from 1 to 100. When omitted the selected model chooses its usual strength. Combining a weight with a `resolution` or `aspect_ratio` that changes the source's aspect ratio crops the source to the new shape; this is only available at the 1K tier and is rejected at 2K. - /// - /// - /// Description of what to exclude from the images. The prompt takes precedence over the negative prompt. Not every model uses it. - /// - /// - /// The requested output resolution, formatted as "WIDTHxHEIGHT" (for example "1280x800"). The output uses the closest supported resolution in the matching 1K or 2K tier. Omit `aspect_ratio` when supplying a resolution. If `resolution_tier` is also supplied, it must match the tier these dimensions fall in. Combining a shape-changing value with `image_weight` requires the 1K tier. - /// - /// - /// The requested output aspect ratio. Omit it to keep the source image's shape. `auto` also keeps the source shape. Omit `resolution` when supplying a concrete value. Combining a shape-changing value with `image_weight` requires the 1K tier. - /// - /// - /// The output resolution tier. When omitted, the tier is inferred from `resolution`, or defaults to 1k. A color palette, style codes, style preset, or non-`auto` style type are only supported at 1k. - /// - /// - /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`. The selected model decides how to interpret it.
- /// Default Value: auto - /// - /// - /// Optional. Only honored when the request uses a model that supports reproducible remixes; results from the default model are not reproducible. The response reports the seed used.
- /// Example: 12345 - /// - /// - /// Existing upload or generated image assets whose style should guide the remix, by reference. Supplying style references restricts the server to a model that supports them and requires the 1K resolution tier. Ignored if `style_reference_collection_id` is also supplied. - /// - /// - /// A saved style to apply, by its URL-safe base64 collection id. Limits the request to a model that supports style references and requires the 1K resolution tier. - /// - /// - /// Optional URL-safe base64 version id of the saved style in `style_reference_collection_id`. Ignored without it. - /// - /// - /// A predefined style preset to apply. Limits the request to a model that supports it and requires the 1K resolution tier. Cannot be combined with style codes. - /// - /// - /// A color palette to apply. Limits the request to a model that supports palettes and requires the 1K resolution tier. - /// - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - /// - /// - /// The style type to generate with. A value other than `auto` limits the request to a model that supports it and requires the 1K resolution tier. - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. - /// - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// Whether the generated images should be kept private. Omitted or true keeps them private. False publishes them unless the caller's plan always generates privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostToolRemixAsync( - string prompt, - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - int? imageWeight = default, - string? negativePrompt = default, - string? resolution = default, - global::Ideogram.IdeogramV4AspectRatio? aspectRatio = default, - global::Ideogram.ToolRemixRequestResolutionTier? resolutionTier = default, - global::Ideogram.MagicPromptMode? magicPrompt = default, - int? seed = default, - global::System.Collections.Generic.IList? styleReferenceAssetIdentifiers = default, - string? styleReferenceCollectionId = default, - string? styleReferenceCollectionVersionId = default, - global::Ideogram.IdeogramV3StylePreset? stylePreset = default, - global::Ideogram.IdeogramColorPalette? colorPalette = default, - global::System.Collections.Generic.IList? styleCodes = default, - global::Ideogram.IdeogramV3StyleType? styleType = default, - int? numImages = default, - bool? enableCopyrightDetection = default, - bool? async = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IAutoModelClient.g.cs b/src/libs/Ideogram/Generated/Ideogram.IAutoModelClient.g.cs index 9347a9a5..3dd78c4f 100644 --- a/src/libs/Ideogram/Generated/Ideogram.IAutoModelClient.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.IAutoModelClient.g.cs @@ -4,9 +4,6 @@ namespace Ideogram { /// - /// Model-agnostic endpoints where the server selects the model for each
- /// request. Requests are JSON and return a generation id that can be
- /// polled via `GET /v2/generations/{generation_id}`.
/// If no httpClient is provided, a new one will be created.
/// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. ///
diff --git a/src/libs/Ideogram/Generated/Ideogram.IBatchClient.Authorizations.Bearer.g.cs b/src/libs/Ideogram/Generated/Ideogram.IBatchClient.Authorizations.Bearer.g.cs deleted file mode 100644 index 18d2a878..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IBatchClient.Authorizations.Bearer.g.cs +++ /dev/null @@ -1,16 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial interface IBatchClient - { - /// - /// Authorize using bearer authentication. - /// - /// - - public void AuthorizeUsingBearer( - string apiKey); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IBatchClient.GetMaybeBatchResults.g.cs b/src/libs/Ideogram/Generated/Ideogram.IBatchClient.GetMaybeBatchResults.g.cs deleted file mode 100644 index 6df74be8..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IBatchClient.GetMaybeBatchResults.g.cs +++ /dev/null @@ -1,32 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IBatchClient - { - /// - /// Get Batch Magic Prompt Job Results if available.
- /// Gets the results of a batch magic prompt job if available. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task GetMaybeBatchResultsAsync( - string jobId, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Get Batch Magic Prompt Job Results if available.
- /// Gets the results of a batch magic prompt job if available. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> GetMaybeBatchResultsAsResponseAsync( - string jobId, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IBatchClient.PostBatch.g.cs b/src/libs/Ideogram/Generated/Ideogram.IBatchClient.PostBatch.g.cs deleted file mode 100644 index 26096eb8..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IBatchClient.PostBatch.g.cs +++ /dev/null @@ -1,61 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IBatchClient - { - /// - /// Initiate Batch Magic Prompt Evalution
- /// Runs automated evaluation of multiple LLM models and system prompts for magic prompt generation.
- /// Generates images using large batches of user prompt inputs. Internal use only (feature flagged). - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostBatchAsync( - - global::Ideogram.InternalBatchRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Initiate Batch Magic Prompt Evalution
- /// Runs automated evaluation of multiple LLM models and system prompts for magic prompt generation.
- /// Generates images using large batches of user prompt inputs. Internal use only (feature flagged). - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostBatchAsResponseAsync( - - global::Ideogram.InternalBatchRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Initiate Batch Magic Prompt Evalution
- /// Runs automated evaluation of multiple LLM models and system prompts for magic prompt generation.
- /// Generates images using large batches of user prompt inputs. Internal use only (feature flagged). - ///
- /// - /// The prompts to enhance with a magic prompt.
- /// Example: [a cat, a dog] - /// - /// - /// The experiment variant used for template selection for the magic prompts.
- /// Example: MAGIC_PROMPT_NO_TEXT - /// - /// - /// Example: {"magic_prompt_system_prompt_config_id":"magic_prompt_system_prompt_config_id","aspect_ratio":"1x1","style_type":"GENERAL","magic_prompt_version":"V_0","seed":12345,"negative_prompt":"brush strokes, painting","magic_prompt_option":"ON","model":"V_2_TURBO","resolution":"1280x800","num_images":1,"color_palette":{"name":"PASTEL"}} - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostBatchAsync( - global::System.Collections.Generic.IList userPrompts, - string? experimentVariant = default, - global::Ideogram.SamplingRequestParams? samplingRequestParams = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IBatchClient.g.cs b/src/libs/Ideogram/Generated/Ideogram.IBatchClient.g.cs deleted file mode 100644 index 9a3abd6a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IBatchClient.g.cs +++ /dev/null @@ -1,48 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// If no httpClient is provided, a new one will be created.
- /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. - ///
- public partial interface IBatchClient : global::System.IDisposable - { - /// - /// The HttpClient instance. - /// - public global::System.Net.Http.HttpClient HttpClient { get; } - - /// - /// The base URL for the API. - /// - public System.Uri? BaseUri { get; } - - /// - /// The authorizations to use for the requests. - /// - public global::System.Collections.Generic.List Authorizations { get; } - - /// - /// Gets or sets a value indicating whether the response content should be read as a string. - /// True by default in debug builds, false otherwise. - /// When false, successful responses are deserialized directly from the response stream for better performance. - /// Error responses are always read as strings regardless of this setting, - /// ensuring is populated. - /// - public bool ReadResponseAsString { get; set; } - /// - /// Client-wide request defaults such as headers, query parameters, retries, and timeout. - /// - public global::Ideogram.AutoSDKClientOptions Options { get; } - - - /// - /// - /// - global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } - - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IDatasetsClient.Authorizations.Bearer.g.cs b/src/libs/Ideogram/Generated/Ideogram.IDatasetsClient.Authorizations.Bearer.g.cs deleted file mode 100644 index d6ca3223..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IDatasetsClient.Authorizations.Bearer.g.cs +++ /dev/null @@ -1,16 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial interface IDatasetsClient - { - /// - /// Authorize using bearer authentication. - /// - /// - - public void AuthorizeUsingBearer( - string apiKey); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IDatasetsClient.CreateDataset.g.cs b/src/libs/Ideogram/Generated/Ideogram.IDatasetsClient.CreateDataset.g.cs deleted file mode 100644 index 69ab609a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IDatasetsClient.CreateDataset.g.cs +++ /dev/null @@ -1,48 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IDatasetsClient - { - /// - /// Create a new dataset
- /// Creates a new dataset - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task CreateDatasetAsync( - - global::Ideogram.CreateDatasetRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Create a new dataset
- /// Creates a new dataset - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> CreateDatasetAsResponseAsync( - - global::Ideogram.CreateDatasetRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Create a new dataset
- /// Creates a new dataset - ///
- /// - /// Name of the dataset. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task CreateDatasetAsync( - string name, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IDatasetsClient.GetDataset.g.cs b/src/libs/Ideogram/Generated/Ideogram.IDatasetsClient.GetDataset.g.cs deleted file mode 100644 index f15d31c3..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IDatasetsClient.GetDataset.g.cs +++ /dev/null @@ -1,32 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IDatasetsClient - { - /// - /// Get a dataset
- /// Returns a dataset by ID, including the total number of files and a list of each file's name and size in bytes. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task GetDatasetAsync( - string datasetId, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Get a dataset
- /// Returns a dataset by ID, including the total number of files and a list of each file's name and size in bytes. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> GetDatasetAsResponseAsync( - string datasetId, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IDatasetsClient.ListDatasets.g.cs b/src/libs/Ideogram/Generated/Ideogram.IDatasetsClient.ListDatasets.g.cs deleted file mode 100644 index 5e0c1a4d..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IDatasetsClient.ListDatasets.g.cs +++ /dev/null @@ -1,32 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IDatasetsClient - { - /// - /// List datasets
- /// Lists datasets for the authenticated user, most recently updated first. Supports an optional case-insensitive name search. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task ListDatasetsAsync( - string? search = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// List datasets
- /// Lists datasets for the authenticated user, most recently updated first. Supports an optional case-insensitive name search. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> ListDatasetsAsResponseAsync( - string? search = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IDatasetsClient.TrainDatasetModel.g.cs b/src/libs/Ideogram/Generated/Ideogram.IDatasetsClient.TrainDatasetModel.g.cs deleted file mode 100644 index 96ecd18d..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IDatasetsClient.TrainDatasetModel.g.cs +++ /dev/null @@ -1,55 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IDatasetsClient - { - /// - /// Train a model from a dataset
- /// Start training a custom model from a dataset. The dataset must contain at least 15 images and a maximum of 100 images. Returns the model ID and training status. - ///
- /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task TrainDatasetModelAsync( - string datasetId, - - global::Ideogram.TrainDatasetModelRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Train a model from a dataset
- /// Start training a custom model from a dataset. The dataset must contain at least 15 images and a maximum of 100 images. Returns the model ID and training status. - ///
- /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> TrainDatasetModelAsResponseAsync( - string datasetId, - - global::Ideogram.TrainDatasetModelRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Train a model from a dataset
- /// Start training a custom model from a dataset. The dataset must contain at least 15 images and a maximum of 100 images. Returns the model ID and training status. - ///
- /// - /// - /// Name after trimming surrounding whitespace: 5–30 Unicode letters, numbers, spaces, underscores, parentheses, periods, or hyphens.
- /// Example: my-custom-model - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task TrainDatasetModelAsync( - string datasetId, - string modelName, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IDatasetsClient.UploadDatasetAssets.g.cs b/src/libs/Ideogram/Generated/Ideogram.IDatasetsClient.UploadDatasetAssets.g.cs deleted file mode 100644 index 2bf18c99..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IDatasetsClient.UploadDatasetAssets.g.cs +++ /dev/null @@ -1,95 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IDatasetsClient - { - /// - /// Upload assets to a dataset
- /// Upload image assets to a dataset for model training. Accepts individual images (JPEG, PNG, WebP), optional .txt caption sidecar files, and/or ZIP archives containing images and captions. A dataset can contain up to 100 images. - ///
- /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task UploadDatasetAssetsAsync( - string datasetId, - - global::Ideogram.UploadDatasetAssetsRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Upload assets to a dataset
- /// Upload image assets to a dataset for model training. Accepts individual images (JPEG, PNG, WebP), optional .txt caption sidecar files, and/or ZIP archives containing images and captions. A dataset can contain up to 100 images. - ///
- /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> UploadDatasetAssetsAsResponseAsync( - string datasetId, - - global::Ideogram.UploadDatasetAssetsRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Upload assets to a dataset
- /// Upload image assets to a dataset for model training. Accepts individual images (JPEG, PNG, WebP), optional .txt caption sidecar files, and/or ZIP archives containing images and captions. A dataset can contain up to 100 images. - ///
- /// - /// - /// Image files (JPEG, PNG, WebP), .txt caption sidecar files, and/or ZIP archives containing images and captions. Caption .txt files are matched to images by filename stem (e.g. sunset.txt provides the caption for sunset.jpg). Captions are optional! - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task UploadDatasetAssetsAsync( - string datasetId, - global::System.Collections.Generic.IList files, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - - /// - /// Upload assets to a dataset
- /// Upload image assets to a dataset for model training. Accepts individual images (JPEG, PNG, WebP), optional .txt caption sidecar files, and/or ZIP archives containing images and captions. A dataset can contain up to 100 images. - ///
- /// - /// - /// Image files (JPEG, PNG, WebP), .txt caption sidecar files, and/or ZIP archives containing images and captions. Caption .txt files are matched to images by filename stem (e.g. sunset.txt provides the caption for sunset.jpg). Captions are optional! - /// - /// - /// Optional file names to use for the multipart 'files' file parts. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task UploadDatasetAssetsAsync( - string datasetId, - global::System.Collections.Generic.IReadOnlyList files, - global::System.Collections.Generic.IReadOnlyList? filesFileNames = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Upload assets to a dataset
- /// Upload image assets to a dataset for model training. Accepts individual images (JPEG, PNG, WebP), optional .txt caption sidecar files, and/or ZIP archives containing images and captions. A dataset can contain up to 100 images. - ///
- /// - /// - /// Image files (JPEG, PNG, WebP), .txt caption sidecar files, and/or ZIP archives containing images and captions. Caption .txt files are matched to images by filename stem (e.g. sunset.txt provides the caption for sunset.jpg). Captions are optional! - /// - /// - /// Optional file names to use for the multipart 'files' file parts. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> UploadDatasetAssetsAsResponseAsync( - string datasetId, - global::System.Collections.Generic.IReadOnlyList files, - global::System.Collections.Generic.IReadOnlyList? filesFileNames = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IDatasetsClient.g.cs b/src/libs/Ideogram/Generated/Ideogram.IDatasetsClient.g.cs deleted file mode 100644 index 4ea0e533..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IDatasetsClient.g.cs +++ /dev/null @@ -1,49 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Operations related to managing datasets
- /// If no httpClient is provided, a new one will be created.
- /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. - ///
- public partial interface IDatasetsClient : global::System.IDisposable - { - /// - /// The HttpClient instance. - /// - public global::System.Net.Http.HttpClient HttpClient { get; } - - /// - /// The base URL for the API. - /// - public System.Uri? BaseUri { get; } - - /// - /// The authorizations to use for the requests. - /// - public global::System.Collections.Generic.List Authorizations { get; } - - /// - /// Gets or sets a value indicating whether the response content should be read as a string. - /// True by default in debug builds, false otherwise. - /// When false, successful responses are deserialized directly from the response stream for better performance. - /// Error responses are always read as strings regardless of this setting, - /// ensuring is populated. - /// - public bool ReadResponseAsString { get; set; } - /// - /// Client-wide request defaults such as headers, query parameters, retries, and timeout. - /// - public global::Ideogram.AutoSDKClientOptions Options { get; } - - - /// - /// - /// - global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } - - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IDesignClient.DesignPostLayerizeDesignIdeogramV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.IDesignClient.DesignPostLayerizeDesignIdeogramV3.g.cs new file mode 100644 index 00000000..7c2ba4d1 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IDesignClient.DesignPostLayerizeDesignIdeogramV3.g.cs @@ -0,0 +1,226 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IDesignClient + { + /// + /// Layerize text with Ideogram 3.0
+ /// Turn a flat image into an editable design: detected text is returned as
+ /// positioned text blocks with matched fonts, sizes, and colors, alongside
+ /// a text-free base image. Upload the image as `image` using
+ /// `multipart/form-data`. Returns results directly by default; set `async`
+ /// or supply a `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task DesignPostLayerizeDesignIdeogramV3Async( + + global::Ideogram.DesignPostLayerizeDesignIdeogramV3Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Layerize text with Ideogram 3.0
+ /// Turn a flat image into an editable design: detected text is returned as
+ /// positioned text blocks with matched fonts, sizes, and colors, alongside
+ /// a text-free base image. Upload the image as `image` using
+ /// `multipart/form-data`. Returns results directly by default; set `async`
+ /// or supply a `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DesignPostLayerizeDesignIdeogramV3AsResponseAsync( + + global::Ideogram.DesignPostLayerizeDesignIdeogramV3Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Layerize text with Ideogram 3.0
+ /// Turn a flat image into an editable design: detected text is returned as
+ /// positioned text blocks with matched fonts, sizes, and colors, alongside
+ /// a text-free base image. Upload the image as `image` using
+ /// `multipart/form-data`. Returns results directly by default; set `async`
+ /// or supply a `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image to layerize (max 50MB). Common image formats such as JPEG, PNG, and WEBP are supported. Multipart requests only. + /// + /// + /// The source image to layerize (max 50MB). Common image formats such as JPEG, PNG, and WEBP are supported. Multipart requests only. + /// + /// + /// A description of the image, used to guide text detection. When omitted, detection runs on the image alone. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// Candidate font files to make available for text style matching. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB each, maximum 5 files). Multipart requests only. + /// + /// + /// When false (the default), the request waits until layerization is complete and returns the result in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task DesignPostLayerizeDesignIdeogramV3Async( + byte[] image, + string imagename, + bool? dryRun = default, + string? prompt = default, + int? seed = default, + global::System.Collections.Generic.IList? fontCandidateFiles = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Layerize text with Ideogram 3.0
+ /// Turn a flat image into an editable design: detected text is returned as
+ /// positioned text blocks with matched fonts, sizes, and colors, alongside
+ /// a text-free base image. Upload the image as `image` using
+ /// `multipart/form-data`. Returns results directly by default; set `async`
+ /// or supply a `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image to layerize (max 50MB). Common image formats such as JPEG, PNG, and WEBP are supported. Multipart requests only. + /// + /// + /// The source image to layerize (max 50MB). Common image formats such as JPEG, PNG, and WEBP are supported. Multipart requests only. + /// + /// + /// A description of the image, used to guide text detection. When omitted, detection runs on the image alone. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// Candidate font files to make available for text style matching. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB each, maximum 5 files). Multipart requests only. + /// + /// + /// Optional file names to use for the multipart 'font_candidate_files' file parts. + /// + /// + /// When false (the default), the request waits until layerization is complete and returns the result in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task DesignPostLayerizeDesignIdeogramV3Async( + global::System.IO.Stream image, + string imagename, + bool? dryRun = default, + string? prompt = default, + int? seed = default, + global::System.Collections.Generic.IReadOnlyList? fontCandidateFiles = default, + global::System.Collections.Generic.IReadOnlyList? fontCandidateFilesFileNames = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Layerize text with Ideogram 3.0
+ /// Turn a flat image into an editable design: detected text is returned as
+ /// positioned text blocks with matched fonts, sizes, and colors, alongside
+ /// a text-free base image. Upload the image as `image` using
+ /// `multipart/form-data`. Returns results directly by default; set `async`
+ /// or supply a `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image to layerize (max 50MB). Common image formats such as JPEG, PNG, and WEBP are supported. Multipart requests only. + /// + /// + /// The source image to layerize (max 50MB). Common image formats such as JPEG, PNG, and WEBP are supported. Multipart requests only. + /// + /// + /// A description of the image, used to guide text detection. When omitted, detection runs on the image alone. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// Candidate font files to make available for text style matching. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB each, maximum 5 files). Multipart requests only. + /// + /// + /// Optional file names to use for the multipart 'font_candidate_files' file parts. + /// + /// + /// When false (the default), the request waits until layerization is complete and returns the result in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DesignPostLayerizeDesignIdeogramV3AsResponseAsync( + global::System.IO.Stream image, + string imagename, + bool? dryRun = default, + string? prompt = default, + int? seed = default, + global::System.Collections.Generic.IReadOnlyList? fontCandidateFiles = default, + global::System.Collections.Generic.IReadOnlyList? fontCandidateFilesFileNames = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IDesignClient.PostLayerizeDesignIdeogramV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.IDesignClient.PostLayerizeDesignIdeogramV3.g.cs deleted file mode 100644 index 1a054577..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IDesignClient.PostLayerizeDesignIdeogramV3.g.cs +++ /dev/null @@ -1,122 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IDesignClient - { - /// - /// Layerize text with Ideogram 3.0
- /// Turn a flat image into an editable design: detected text is returned as
- /// positioned text blocks with matched fonts, sizes, and colors, alongside
- /// a text-free base image. Upload the image as `image` using
- /// `multipart/form-data`. Returns results directly by default; set `async`
- /// or supply a `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostLayerizeDesignIdeogramV3Async( - - global::Ideogram.LayerizeDesignIdeogramV3Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Layerize text with Ideogram 3.0
- /// Turn a flat image into an editable design: detected text is returned as
- /// positioned text blocks with matched fonts, sizes, and colors, alongside
- /// a text-free base image. Upload the image as `image` using
- /// `multipart/form-data`. Returns results directly by default; set `async`
- /// or supply a `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostLayerizeDesignIdeogramV3AsResponseAsync( - - global::Ideogram.LayerizeDesignIdeogramV3Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Layerize text with Ideogram 3.0
- /// Turn a flat image into an editable design: detected text is returned as
- /// positioned text blocks with matched fonts, sizes, and colors, alongside
- /// a text-free base image. Upload the image as `image` using
- /// `multipart/form-data`. Returns results directly by default; set `async`
- /// or supply a `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The source image to layerize (max 50MB). Common image formats such as JPEG, PNG, and WEBP are supported. Multipart requests only. - /// - /// - /// The source image to layerize (max 50MB). Common image formats such as JPEG, PNG, and WEBP are supported. Multipart requests only. - /// - /// - /// A description of the image, used to guide text detection. When omitted, detection runs on the image alone. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// Candidate font files to make available for text style matching. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB each, maximum 5 files). Multipart requests only. - /// - /// - /// When false (the default), the request waits until layerization is complete and returns the result in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output is added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostLayerizeDesignIdeogramV3Async( - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - string? prompt = default, - int? seed = default, - global::System.Collections.Generic.IList? fontCandidateFiles = default, - bool? async = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.EditWorkflowPostAdLocalizer.g.cs b/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.EditWorkflowPostAdLocalizer.g.cs new file mode 100644 index 00000000..49aad27c --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.EditWorkflowPostAdLocalizer.g.cs @@ -0,0 +1,263 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IEditWorkflowClient + { + /// + /// Ad Localizer
+ /// Rebuilds an ad in one target language, preserving its layout, logos,
+ /// brand type, and product so only the visible marketing copy changes.
+ /// Upload the source ad as `image` using `multipart/form-data`; the copy
+ /// is translated unless you supply `exact_copy`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task EditWorkflowPostAdLocalizerAsync( + + global::Ideogram.EditWorkflowPostAdLocalizerRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Ad Localizer
+ /// Rebuilds an ad in one target language, preserving its layout, logos,
+ /// brand type, and product so only the visible marketing copy changes.
+ /// Upload the source ad as `image` using `multipart/form-data`; the copy
+ /// is translated unless you supply `exact_copy`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> EditWorkflowPostAdLocalizerAsResponseAsync( + + global::Ideogram.EditWorkflowPostAdLocalizerRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Ad Localizer
+ /// Rebuilds an ad in one target language, preserving its layout, logos,
+ /// brand type, and product so only the visible marketing copy changes.
+ /// Upload the source ad as `image` using `multipart/form-data`; the copy
+ /// is translated unless you supply `exact_copy`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source ad to localize (max size 25MB). Its layout, logos, brand
+ /// type, and product are preserved, and the output keeps its shape, so
+ /// no size or aspect ratio is needed. JPEG, PNG, and WEBP formats are
+ /// supported. Multipart requests only. + /// + /// + /// The source ad to localize (max size 25MB). Its layout, logos, brand
+ /// type, and product are preserved, and the output keeps its shape, so
+ /// no size or aspect ratio is needed. JPEG, PNG, and WEBP formats are
+ /// supported. Multipart requests only. + /// + /// + /// The target language for the copy. Arabic is rendered right-to-left. Each request covers one language; send one request per language. + /// + /// + /// Pre-approved wording, one `original => replacement` mapping per line. Each mapping names the text element showing `original` and sets it to `replacement`, placed character for character rather than translated. Any text element not listed is left as it is in the source. When omitted, all visible marketing copy is translated. + /// + /// + /// Optional additional direction for the localization, for example "keep the badge in English". Anything it explicitly asks to change takes priority over the preservation rules. + /// + /// + /// The quality tier for the edit. Higher tiers may improve detail and
+ /// take longer to complete. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// Number of localized variations to create for this language.
+ /// Default Value: 1 + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task EditWorkflowPostAdLocalizerAsync( + byte[] image, + string imagename, + global::Ideogram.V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage language, + bool? dryRun = default, + string? exactCopy = default, + string? prompt = default, + global::Ideogram.AdLocalizerQuality? quality = default, + int? seed = default, + int? numImages = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Ad Localizer
+ /// Rebuilds an ad in one target language, preserving its layout, logos,
+ /// brand type, and product so only the visible marketing copy changes.
+ /// Upload the source ad as `image` using `multipart/form-data`; the copy
+ /// is translated unless you supply `exact_copy`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source ad to localize (max size 25MB). Its layout, logos, brand
+ /// type, and product are preserved, and the output keeps its shape, so
+ /// no size or aspect ratio is needed. JPEG, PNG, and WEBP formats are
+ /// supported. Multipart requests only. + /// + /// + /// The source ad to localize (max size 25MB). Its layout, logos, brand
+ /// type, and product are preserved, and the output keeps its shape, so
+ /// no size or aspect ratio is needed. JPEG, PNG, and WEBP formats are
+ /// supported. Multipart requests only. + /// + /// + /// The target language for the copy. Arabic is rendered right-to-left. Each request covers one language; send one request per language. + /// + /// + /// Pre-approved wording, one `original => replacement` mapping per line. Each mapping names the text element showing `original` and sets it to `replacement`, placed character for character rather than translated. Any text element not listed is left as it is in the source. When omitted, all visible marketing copy is translated. + /// + /// + /// Optional additional direction for the localization, for example "keep the badge in English". Anything it explicitly asks to change takes priority over the preservation rules. + /// + /// + /// The quality tier for the edit. Higher tiers may improve detail and
+ /// take longer to complete. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// Number of localized variations to create for this language.
+ /// Default Value: 1 + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task EditWorkflowPostAdLocalizerAsync( + global::System.IO.Stream image, + string imagename, + global::Ideogram.V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage language, + bool? dryRun = default, + string? exactCopy = default, + string? prompt = default, + global::Ideogram.AdLocalizerQuality? quality = default, + int? seed = default, + int? numImages = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Ad Localizer
+ /// Rebuilds an ad in one target language, preserving its layout, logos,
+ /// brand type, and product so only the visible marketing copy changes.
+ /// Upload the source ad as `image` using `multipart/form-data`; the copy
+ /// is translated unless you supply `exact_copy`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source ad to localize (max size 25MB). Its layout, logos, brand
+ /// type, and product are preserved, and the output keeps its shape, so
+ /// no size or aspect ratio is needed. JPEG, PNG, and WEBP formats are
+ /// supported. Multipart requests only. + /// + /// + /// The source ad to localize (max size 25MB). Its layout, logos, brand
+ /// type, and product are preserved, and the output keeps its shape, so
+ /// no size or aspect ratio is needed. JPEG, PNG, and WEBP formats are
+ /// supported. Multipart requests only. + /// + /// + /// The target language for the copy. Arabic is rendered right-to-left. Each request covers one language; send one request per language. + /// + /// + /// Pre-approved wording, one `original => replacement` mapping per line. Each mapping names the text element showing `original` and sets it to `replacement`, placed character for character rather than translated. Any text element not listed is left as it is in the source. When omitted, all visible marketing copy is translated. + /// + /// + /// Optional additional direction for the localization, for example "keep the badge in English". Anything it explicitly asks to change takes priority over the preservation rules. + /// + /// + /// The quality tier for the edit. Higher tiers may improve detail and
+ /// take longer to complete. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// Number of localized variations to create for this language.
+ /// Default Value: 1 + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> EditWorkflowPostAdLocalizerAsResponseAsync( + global::System.IO.Stream image, + string imagename, + global::Ideogram.V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage language, + bool? dryRun = default, + string? exactCopy = default, + string? prompt = default, + global::Ideogram.AdLocalizerQuality? quality = default, + int? seed = default, + int? numImages = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.EditWorkflowPostAdResizer.g.cs b/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.EditWorkflowPostAdResizer.g.cs new file mode 100644 index 00000000..3af3c9e4 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.EditWorkflowPostAdResizer.g.cs @@ -0,0 +1,305 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IEditWorkflowClient + { + /// + /// Ad Resizer
+ /// Reframes an ad creative to an exact ad resolution, regenerating the
+ /// layout so text and key elements stay legible at the new size. Upload
+ /// the source creative as `image` using `multipart/form-data`, and supply
+ /// `platform` to keep the ad inside that platform's safe zone.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task EditWorkflowPostAdResizerAsync( + + global::Ideogram.EditWorkflowPostAdResizerRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Ad Resizer
+ /// Reframes an ad creative to an exact ad resolution, regenerating the
+ /// layout so text and key elements stay legible at the new size. Upload
+ /// the source creative as `image` using `multipart/form-data`, and supply
+ /// `platform` to keep the ad inside that platform's safe zone.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> EditWorkflowPostAdResizerAsResponseAsync( + + global::Ideogram.EditWorkflowPostAdResizerRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Ad Resizer
+ /// Reframes an ad creative to an exact ad resolution, regenerating the
+ /// layout so text and key elements stay legible at the new size. Upload
+ /// the source creative as `image` using `multipart/form-data`, and supply
+ /// `platform` to keep the ad inside that platform's safe zone.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source creative to reframe (max size 25MB). JPEG, PNG, and
+ /// WEBP formats are supported. Multipart requests only. + /// + /// + /// The source creative to reframe (max size 25MB). JPEG, PNG, and
+ /// WEBP formats are supported. Multipart requests only. + /// + /// + /// Target ad resolution, formatted as `WIDTHxHEIGHT`. Any value not in
+ /// the list is rejected with a 400. Each output image has exactly these
+ /// pixel dimensions, with or without a `platform`. + /// + /// + /// The ad platform whose published safe zone the ad must stay inside.
+ /// The ad is generated inside the largest rectangle that fits the
+ /// platform's safe zone for the requested aspect ratio, and the space
+ /// around it is filled in so the output is still exactly the requested
+ /// `resolution`. `google` covers YouTube and Google Ads placements.
+ /// Use `meta_stories` or `meta_reels` for Meta placements; Reels uses
+ /// the largest rectangle inside its notched safe zone. The legacy
+ /// `meta` value is still supported and uses a more conservative safe
+ /// zone. When omitted, the ad fills the whole frame and every
+ /// supported `resolution` is accepted. Any other value is rejected
+ /// with a 400.
+ /// Each platform accepts only the resolutions for which it publishes a
+ /// safe zone; any other `resolution` is rejected with a 400:
+ /// | Platform | Accepted resolutions |
+ /// | --- | --- |
+ /// | `google` | `1920x1080`, `3840x2160`, `1080x1080`, `2400x2400`, `2880x2880`, `1080x1920`, `2160x3840` |
+ /// | `tiktok` | `1920x1080`, `3840x2160`, `1080x1080`, `2400x2400`, `2880x2880`, `1080x1920`, `2160x3840` |
+ /// | `meta_stories` | `1080x1920`, `2160x3840` |
+ /// | `meta_reels` | `1080x1920`, `2160x3840` |
+ /// | `meta` (legacy) | `1080x1920`, `2160x3840` |
+ /// | `snapchat` | `1080x1920`, `2160x3840` | + /// + /// + /// Optional edit instruction to apply while reframing, for example "remove the logo" or "put the price bottom-right". + /// + /// + /// The quality tier for the reframe. Higher tiers may improve detail and
+ /// take longer to complete. + /// + /// + /// The number of reframed variations to generate.
+ /// Default Value: 1 + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task EditWorkflowPostAdResizerAsync( + byte[] image, + string imagename, + global::Ideogram.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution resolution, + bool? dryRun = default, + global::Ideogram.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaPlatform? platform = default, + string? prompt = default, + global::Ideogram.AdResizerQuality? quality = default, + int? numImages = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Ad Resizer
+ /// Reframes an ad creative to an exact ad resolution, regenerating the
+ /// layout so text and key elements stay legible at the new size. Upload
+ /// the source creative as `image` using `multipart/form-data`, and supply
+ /// `platform` to keep the ad inside that platform's safe zone.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source creative to reframe (max size 25MB). JPEG, PNG, and
+ /// WEBP formats are supported. Multipart requests only. + /// + /// + /// The source creative to reframe (max size 25MB). JPEG, PNG, and
+ /// WEBP formats are supported. Multipart requests only. + /// + /// + /// Target ad resolution, formatted as `WIDTHxHEIGHT`. Any value not in
+ /// the list is rejected with a 400. Each output image has exactly these
+ /// pixel dimensions, with or without a `platform`. + /// + /// + /// The ad platform whose published safe zone the ad must stay inside.
+ /// The ad is generated inside the largest rectangle that fits the
+ /// platform's safe zone for the requested aspect ratio, and the space
+ /// around it is filled in so the output is still exactly the requested
+ /// `resolution`. `google` covers YouTube and Google Ads placements.
+ /// Use `meta_stories` or `meta_reels` for Meta placements; Reels uses
+ /// the largest rectangle inside its notched safe zone. The legacy
+ /// `meta` value is still supported and uses a more conservative safe
+ /// zone. When omitted, the ad fills the whole frame and every
+ /// supported `resolution` is accepted. Any other value is rejected
+ /// with a 400.
+ /// Each platform accepts only the resolutions for which it publishes a
+ /// safe zone; any other `resolution` is rejected with a 400:
+ /// | Platform | Accepted resolutions |
+ /// | --- | --- |
+ /// | `google` | `1920x1080`, `3840x2160`, `1080x1080`, `2400x2400`, `2880x2880`, `1080x1920`, `2160x3840` |
+ /// | `tiktok` | `1920x1080`, `3840x2160`, `1080x1080`, `2400x2400`, `2880x2880`, `1080x1920`, `2160x3840` |
+ /// | `meta_stories` | `1080x1920`, `2160x3840` |
+ /// | `meta_reels` | `1080x1920`, `2160x3840` |
+ /// | `meta` (legacy) | `1080x1920`, `2160x3840` |
+ /// | `snapchat` | `1080x1920`, `2160x3840` | + /// + /// + /// Optional edit instruction to apply while reframing, for example "remove the logo" or "put the price bottom-right". + /// + /// + /// The quality tier for the reframe. Higher tiers may improve detail and
+ /// take longer to complete. + /// + /// + /// The number of reframed variations to generate.
+ /// Default Value: 1 + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task EditWorkflowPostAdResizerAsync( + global::System.IO.Stream image, + string imagename, + global::Ideogram.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution resolution, + bool? dryRun = default, + global::Ideogram.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaPlatform? platform = default, + string? prompt = default, + global::Ideogram.AdResizerQuality? quality = default, + int? numImages = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Ad Resizer
+ /// Reframes an ad creative to an exact ad resolution, regenerating the
+ /// layout so text and key elements stay legible at the new size. Upload
+ /// the source creative as `image` using `multipart/form-data`, and supply
+ /// `platform` to keep the ad inside that platform's safe zone.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source creative to reframe (max size 25MB). JPEG, PNG, and
+ /// WEBP formats are supported. Multipart requests only. + /// + /// + /// The source creative to reframe (max size 25MB). JPEG, PNG, and
+ /// WEBP formats are supported. Multipart requests only. + /// + /// + /// Target ad resolution, formatted as `WIDTHxHEIGHT`. Any value not in
+ /// the list is rejected with a 400. Each output image has exactly these
+ /// pixel dimensions, with or without a `platform`. + /// + /// + /// The ad platform whose published safe zone the ad must stay inside.
+ /// The ad is generated inside the largest rectangle that fits the
+ /// platform's safe zone for the requested aspect ratio, and the space
+ /// around it is filled in so the output is still exactly the requested
+ /// `resolution`. `google` covers YouTube and Google Ads placements.
+ /// Use `meta_stories` or `meta_reels` for Meta placements; Reels uses
+ /// the largest rectangle inside its notched safe zone. The legacy
+ /// `meta` value is still supported and uses a more conservative safe
+ /// zone. When omitted, the ad fills the whole frame and every
+ /// supported `resolution` is accepted. Any other value is rejected
+ /// with a 400.
+ /// Each platform accepts only the resolutions for which it publishes a
+ /// safe zone; any other `resolution` is rejected with a 400:
+ /// | Platform | Accepted resolutions |
+ /// | --- | --- |
+ /// | `google` | `1920x1080`, `3840x2160`, `1080x1080`, `2400x2400`, `2880x2880`, `1080x1920`, `2160x3840` |
+ /// | `tiktok` | `1920x1080`, `3840x2160`, `1080x1080`, `2400x2400`, `2880x2880`, `1080x1920`, `2160x3840` |
+ /// | `meta_stories` | `1080x1920`, `2160x3840` |
+ /// | `meta_reels` | `1080x1920`, `2160x3840` |
+ /// | `meta` (legacy) | `1080x1920`, `2160x3840` |
+ /// | `snapchat` | `1080x1920`, `2160x3840` | + /// + /// + /// Optional edit instruction to apply while reframing, for example "remove the logo" or "put the price bottom-right". + /// + /// + /// The quality tier for the reframe. Higher tiers may improve detail and
+ /// take longer to complete. + /// + /// + /// The number of reframed variations to generate.
+ /// Default Value: 1 + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> EditWorkflowPostAdResizerAsResponseAsync( + global::System.IO.Stream image, + string imagename, + global::Ideogram.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution resolution, + bool? dryRun = default, + global::Ideogram.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaPlatform? platform = default, + string? prompt = default, + global::Ideogram.AdResizerQuality? quality = default, + int? numImages = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.EditWorkflowPostAdVariations.g.cs b/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.EditWorkflowPostAdVariations.g.cs new file mode 100644 index 00000000..479ac2a8 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.EditWorkflowPostAdVariations.g.cs @@ -0,0 +1,231 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IEditWorkflowClient + { + /// + /// Ad Variations
+ /// Creates on-brand variations of an ad along one axis, preserving logos,
+ /// brand colors, the product, and all on-image text. Upload the source
+ /// creative as `image` using `multipart/form-data` and choose a
+ /// `variation_type`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task EditWorkflowPostAdVariationsAsync( + + global::Ideogram.EditWorkflowPostAdVariationsRequest request, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Ad Variations
+ /// Creates on-brand variations of an ad along one axis, preserving logos,
+ /// brand colors, the product, and all on-image text. Upload the source
+ /// creative as `image` using `multipart/form-data` and choose a
+ /// `variation_type`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> EditWorkflowPostAdVariationsAsResponseAsync( + + global::Ideogram.EditWorkflowPostAdVariationsRequest request, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Ad Variations
+ /// Creates on-brand variations of an ad along one axis, preserving logos,
+ /// brand colors, the product, and all on-image text. Upload the source
+ /// creative as `image` using `multipart/form-data` and choose a
+ /// `variation_type`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// The source creative to vary (max size 25MB). JPEG, PNG, and WEBP
+ /// formats are supported. Multipart requests only. Each output keeps
+ /// the source's aspect ratio, capped at 3:1 between the long and short
+ /// sides. + /// + /// + /// The source creative to vary (max size 25MB). JPEG, PNG, and WEBP
+ /// formats are supported. Multipart requests only. Each output keeps
+ /// the source's aspect ratio, capped at 3:1 between the long and short
+ /// sides. + /// + /// + /// The axis to vary. `people`
+ /// replaces the people in the ad with different talent. `setting`
+ /// moves the same subject and product to a different environment.
+ /// `group_size` changes how many people appear. `scene` shifts the
+ /// moment or occasion (time of day, season, or activity). + /// + /// + /// Optional direction to steer the variation, for example "set it on a beach" or "make the models older". Anything it explicitly asks to change takes priority over the default preservation rules. + /// + /// + /// The quality tier for the edit. Higher tiers may improve detail and
+ /// take longer to complete. + /// + /// + /// The number of variations to generate along the requested axis.
+ /// Default Value: 1 + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task EditWorkflowPostAdVariationsAsync( + byte[] image, + string imagename, + global::Ideogram.V2ToolAdVariationsPostRequestBodyContentMultipartFormDataSchemaVariationType variationType, + string? prompt = default, + global::Ideogram.AdVariationsQuality? quality = default, + int? numImages = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Ad Variations
+ /// Creates on-brand variations of an ad along one axis, preserving logos,
+ /// brand colors, the product, and all on-image text. Upload the source
+ /// creative as `image` using `multipart/form-data` and choose a
+ /// `variation_type`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// The source creative to vary (max size 25MB). JPEG, PNG, and WEBP
+ /// formats are supported. Multipart requests only. Each output keeps
+ /// the source's aspect ratio, capped at 3:1 between the long and short
+ /// sides. + /// + /// + /// The source creative to vary (max size 25MB). JPEG, PNG, and WEBP
+ /// formats are supported. Multipart requests only. Each output keeps
+ /// the source's aspect ratio, capped at 3:1 between the long and short
+ /// sides. + /// + /// + /// The axis to vary. `people`
+ /// replaces the people in the ad with different talent. `setting`
+ /// moves the same subject and product to a different environment.
+ /// `group_size` changes how many people appear. `scene` shifts the
+ /// moment or occasion (time of day, season, or activity). + /// + /// + /// Optional direction to steer the variation, for example "set it on a beach" or "make the models older". Anything it explicitly asks to change takes priority over the default preservation rules. + /// + /// + /// The quality tier for the edit. Higher tiers may improve detail and
+ /// take longer to complete. + /// + /// + /// The number of variations to generate along the requested axis.
+ /// Default Value: 1 + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task EditWorkflowPostAdVariationsAsync( + global::System.IO.Stream image, + string imagename, + global::Ideogram.V2ToolAdVariationsPostRequestBodyContentMultipartFormDataSchemaVariationType variationType, + string? prompt = default, + global::Ideogram.AdVariationsQuality? quality = default, + int? numImages = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Ad Variations
+ /// Creates on-brand variations of an ad along one axis, preserving logos,
+ /// brand colors, the product, and all on-image text. Upload the source
+ /// creative as `image` using `multipart/form-data` and choose a
+ /// `variation_type`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// The source creative to vary (max size 25MB). JPEG, PNG, and WEBP
+ /// formats are supported. Multipart requests only. Each output keeps
+ /// the source's aspect ratio, capped at 3:1 between the long and short
+ /// sides. + /// + /// + /// The source creative to vary (max size 25MB). JPEG, PNG, and WEBP
+ /// formats are supported. Multipart requests only. Each output keeps
+ /// the source's aspect ratio, capped at 3:1 between the long and short
+ /// sides. + /// + /// + /// The axis to vary. `people`
+ /// replaces the people in the ad with different talent. `setting`
+ /// moves the same subject and product to a different environment.
+ /// `group_size` changes how many people appear. `scene` shifts the
+ /// moment or occasion (time of day, season, or activity). + /// + /// + /// Optional direction to steer the variation, for example "set it on a beach" or "make the models older". Anything it explicitly asks to change takes priority over the default preservation rules. + /// + /// + /// The quality tier for the edit. Higher tiers may improve detail and
+ /// take longer to complete. + /// + /// + /// The number of variations to generate along the requested axis.
+ /// Default Value: 1 + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> EditWorkflowPostAdVariationsAsResponseAsync( + global::System.IO.Stream image, + string imagename, + global::Ideogram.V2ToolAdVariationsPostRequestBodyContentMultipartFormDataSchemaVariationType variationType, + string? prompt = default, + global::Ideogram.AdVariationsQuality? quality = default, + int? numImages = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.EditWorkflowPostColorways.g.cs b/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.EditWorkflowPostColorways.g.cs new file mode 100644 index 00000000..999d2458 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.EditWorkflowPostColorways.g.cs @@ -0,0 +1,265 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IEditWorkflowClient + { + /// + /// Colorways
+ /// Recolors masked regions of a product photo, each to its own target
+ /// color, preserving the product's geometry, materials, prints, logos, and
+ /// everything outside the masks. Upload the `image` and up to 4 `masks`
+ /// using `multipart/form-data`, with one entry in `colors` per mask.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task EditWorkflowPostColorwaysAsync( + + global::Ideogram.EditWorkflowPostColorwaysRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Colorways
+ /// Recolors masked regions of a product photo, each to its own target
+ /// color, preserving the product's geometry, materials, prints, logos, and
+ /// everything outside the masks. Upload the `image` and up to 4 `masks`
+ /// using `multipart/form-data`, with one entry in `colors` per mask.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> EditWorkflowPostColorwaysAsResponseAsync( + + global::Ideogram.EditWorkflowPostColorwaysRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Colorways
+ /// Recolors masked regions of a product photo, each to its own target
+ /// color, preserving the product's geometry, materials, prints, logos, and
+ /// everything outside the masks. Upload the `image` and up to 4 `masks`
+ /// using `multipart/form-data`, with one entry in `colors` per mask.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// The product photo to recolor (max size 25MB). JPEG, PNG, and WEBP
+ /// formats are supported. + /// + /// + /// The product photo to recolor (max size 25MB). JPEG, PNG, and WEBP
+ /// formats are supported. + /// + /// + /// Masks marking the regions to recolor (max 4, max size 25MB each),
+ /// paired by position with `colors`. JPEG, PNG, and WEBP formats are
+ /// supported. Every mask must have the same pixel dimensions as the
+ /// product photo. White pixels mark the region to recolor and black
+ /// pixels are preserved; alpha-only masks also work (opaque =
+ /// recolor, transparent = preserve). + /// + /// + /// One target color per mask in `masks`, as six-digit hex codes like
+ /// `#B3202C`, paired by position. The product's shape, construction,
+ /// materials, prints, and logos are always preserved. + /// + /// + /// Output aspect ratio. Defaults to the product photo's aspect ratio,
+ /// which keeps the original framing. A different ratio extends the
+ /// scene to fill the new shape rather than cropping, so part of the
+ /// frame is newly generated. Supported values are `1:1`, `3:4`,
+ /// `4:3`, `16:9`, and `9:16`. + /// + /// + /// The quality tier for the edit. Higher tiers may improve detail and
+ /// take longer to complete. + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task EditWorkflowPostColorwaysAsync( + byte[] image, + string imagename, + global::System.Collections.Generic.IList colors, + bool? dryRun = default, + global::System.Collections.Generic.IList? masks = default, + string? aspectRatio = default, + global::Ideogram.ColorwaysQuality? quality = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Colorways
+ /// Recolors masked regions of a product photo, each to its own target
+ /// color, preserving the product's geometry, materials, prints, logos, and
+ /// everything outside the masks. Upload the `image` and up to 4 `masks`
+ /// using `multipart/form-data`, with one entry in `colors` per mask.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// The product photo to recolor (max size 25MB). JPEG, PNG, and WEBP
+ /// formats are supported. + /// + /// + /// The product photo to recolor (max size 25MB). JPEG, PNG, and WEBP
+ /// formats are supported. + /// + /// + /// Masks marking the regions to recolor (max 4, max size 25MB each),
+ /// paired by position with `colors`. JPEG, PNG, and WEBP formats are
+ /// supported. Every mask must have the same pixel dimensions as the
+ /// product photo. White pixels mark the region to recolor and black
+ /// pixels are preserved; alpha-only masks also work (opaque =
+ /// recolor, transparent = preserve). + /// + /// + /// Optional file names to use for the multipart 'masks' file parts. + /// + /// + /// One target color per mask in `masks`, as six-digit hex codes like
+ /// `#B3202C`, paired by position. The product's shape, construction,
+ /// materials, prints, and logos are always preserved. + /// + /// + /// Output aspect ratio. Defaults to the product photo's aspect ratio,
+ /// which keeps the original framing. A different ratio extends the
+ /// scene to fill the new shape rather than cropping, so part of the
+ /// frame is newly generated. Supported values are `1:1`, `3:4`,
+ /// `4:3`, `16:9`, and `9:16`. + /// + /// + /// The quality tier for the edit. Higher tiers may improve detail and
+ /// take longer to complete. + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task EditWorkflowPostColorwaysAsync( + global::System.IO.Stream image, + string imagename, + global::System.Collections.Generic.IList colors, + bool? dryRun = default, + global::System.Collections.Generic.IReadOnlyList? masks = default, + global::System.Collections.Generic.IReadOnlyList? masksFileNames = default, + string? aspectRatio = default, + global::Ideogram.ColorwaysQuality? quality = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Colorways
+ /// Recolors masked regions of a product photo, each to its own target
+ /// color, preserving the product's geometry, materials, prints, logos, and
+ /// everything outside the masks. Upload the `image` and up to 4 `masks`
+ /// using `multipart/form-data`, with one entry in `colors` per mask.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// The product photo to recolor (max size 25MB). JPEG, PNG, and WEBP
+ /// formats are supported. + /// + /// + /// The product photo to recolor (max size 25MB). JPEG, PNG, and WEBP
+ /// formats are supported. + /// + /// + /// Masks marking the regions to recolor (max 4, max size 25MB each),
+ /// paired by position with `colors`. JPEG, PNG, and WEBP formats are
+ /// supported. Every mask must have the same pixel dimensions as the
+ /// product photo. White pixels mark the region to recolor and black
+ /// pixels are preserved; alpha-only masks also work (opaque =
+ /// recolor, transparent = preserve). + /// + /// + /// Optional file names to use for the multipart 'masks' file parts. + /// + /// + /// One target color per mask in `masks`, as six-digit hex codes like
+ /// `#B3202C`, paired by position. The product's shape, construction,
+ /// materials, prints, and logos are always preserved. + /// + /// + /// Output aspect ratio. Defaults to the product photo's aspect ratio,
+ /// which keeps the original framing. A different ratio extends the
+ /// scene to fill the new shape rather than cropping, so part of the
+ /// frame is newly generated. Supported values are `1:1`, `3:4`,
+ /// `4:3`, `16:9`, and `9:16`. + /// + /// + /// The quality tier for the edit. Higher tiers may improve detail and
+ /// take longer to complete. + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> EditWorkflowPostColorwaysAsResponseAsync( + global::System.IO.Stream image, + string imagename, + global::System.Collections.Generic.IList colors, + bool? dryRun = default, + global::System.Collections.Generic.IReadOnlyList? masks = default, + global::System.Collections.Generic.IReadOnlyList? masksFileNames = default, + string? aspectRatio = default, + global::Ideogram.ColorwaysQuality? quality = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.EditWorkflowPostGhostMannequin.g.cs b/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.EditWorkflowPostGhostMannequin.g.cs new file mode 100644 index 00000000..992138ad --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.EditWorkflowPostGhostMannequin.g.cs @@ -0,0 +1,204 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IEditWorkflowClient + { + /// + /// Ghost Mannequin
+ /// Turns photos of one garment into a ghost-mannequin product image on a
+ /// clean white studio background, removing the person, mannequin, hanger,
+ /// and other clothing. Upload the photos using `multipart/form-data`, in
+ /// the directional fields (such as `front_image`) when the camera
+ /// direction is known and in `garment_images` otherwise.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task EditWorkflowPostGhostMannequinAsync( + + global::Ideogram.EditWorkflowPostGhostMannequinRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Ghost Mannequin
+ /// Turns photos of one garment into a ghost-mannequin product image on a
+ /// clean white studio background, removing the person, mannequin, hanger,
+ /// and other clothing. Upload the photos using `multipart/form-data`, in
+ /// the directional fields (such as `front_image`) when the camera
+ /// direction is known and in `garment_images` otherwise.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> EditWorkflowPostGhostMannequinAsResponseAsync( + + global::Ideogram.EditWorkflowPostGhostMannequinRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Ghost Mannequin
+ /// Turns photos of one garment into a ghost-mannequin product image on a
+ /// clean white studio background, removing the person, mannequin, hanger,
+ /// and other clothing. Upload the photos using `multipart/form-data`, in
+ /// the directional fields (such as `front_image`) when the camera
+ /// direction is known and in `garment_images` otherwise.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Additional photos of the same garment, up to 50 MB each. JPEG,
+ /// PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and MPO are supported.
+ /// Multipart requests only. + /// + /// + /// Optional front-view garment photo, up to 50 MB. Multipart requests
+ /// only. + /// + /// + /// Optional front-view garment photo, up to 50 MB. Multipart requests
+ /// only. + /// + /// + /// Optional back-view garment photo, up to 50 MB. Multipart requests
+ /// only. + /// + /// + /// Optional back-view garment photo, up to 50 MB. Multipart requests
+ /// only. + /// + /// + /// Optional left-view garment photo, up to 50 MB. Multipart requests
+ /// only. + /// + /// + /// Optional left-view garment photo, up to 50 MB. Multipart requests
+ /// only. + /// + /// + /// Optional right-view garment photo, up to 50 MB. Multipart requests
+ /// only. + /// + /// + /// Optional right-view garment photo, up to 50 MB. Multipart requests
+ /// only. + /// + /// + /// Optional top-view garment photo, up to 50 MB. Multipart requests
+ /// only. + /// + /// + /// Optional top-view garment photo, up to 50 MB. Multipart requests
+ /// only. + /// + /// + /// Optional bottom-view garment photo, up to 50 MB. Multipart
+ /// requests only. + /// + /// + /// Optional bottom-view garment photo, up to 50 MB. Multipart
+ /// requests only. + /// + /// + /// An identifier for an ideogram asset. + /// + /// + /// Optional presentation example, up to 50 MB. Multipart requests only.
+ /// Guides pose, framing, and lighting without copying its garment,
+ /// colors, text, or branding. Garment photos remain authoritative for
+ /// product identity; view and aspect_ratio take precedence, and the
+ /// background remains white. Does not replace a required garment photo.
+ /// Mutually exclusive with `output_reference_asset_identifier`. + /// + /// + /// Optional presentation example, up to 50 MB. Multipart requests only.
+ /// Guides pose, framing, and lighting without copying its garment,
+ /// colors, text, or branding. Garment photos remain authoritative for
+ /// product identity; view and aspect_ratio take precedence, and the
+ /// background remains white. Does not replace a required garment photo.
+ /// Mutually exclusive with `output_reference_asset_identifier`. + /// + /// + /// Camera view for the output garment. + /// + /// + /// Optional reconstruction guidance or identity-critical garment
+ /// details to check against the photos. The output always uses a clean
+ /// white studio background. + /// + /// + /// Optional JSON object serialized as a string containing factual
+ /// product context, such as title, brand, category, color, material,
+ /// item code, and exact printed text. Metadata helps disambiguate the
+ /// garment photos but does not add features they do not show. + /// + /// + /// Output aspect ratio. Defaults to `1:1` when omitted. Supported
+ /// values are `1:1`, `3:4`, `4:3`, `16:9`, and `9:16`. + /// + /// + /// The quality tier for the edit. Higher tiers may improve detail and
+ /// take longer to complete. + /// + /// + /// Optional seed for repeatable results. + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task EditWorkflowPostGhostMannequinAsync( + global::Ideogram.V2ToolGhostMannequinPostRequestBodyContentMultipartFormDataSchemaView view, + bool? dryRun = default, + global::System.Collections.Generic.IList? garmentImages = default, + byte[]? frontImage = default, + string? frontImagename = default, + byte[]? backImage = default, + string? backImagename = default, + byte[]? leftImage = default, + string? leftImagename = default, + byte[]? rightImage = default, + string? rightImagename = default, + byte[]? topImage = default, + string? topImagename = default, + byte[]? bottomImage = default, + string? bottomImagename = default, + global::Ideogram.AssetIdentifier? outputReferenceAssetIdentifier = default, + byte[]? outputReferenceImage = default, + string? outputReferenceImagename = default, + string? instruction = default, + string? metadata = default, + string? aspectRatio = default, + global::Ideogram.GhostMannequinQuality? quality = default, + int? seed = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.EditWorkflowPostMaterialSwap.g.cs b/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.EditWorkflowPostMaterialSwap.g.cs new file mode 100644 index 00000000..e18f8d6e --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.EditWorkflowPostMaterialSwap.g.cs @@ -0,0 +1,276 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IEditWorkflowClient + { + /// + /// Material Swap
+ /// Re-renders masked regions of a product photo in the materials shown in
+ /// reference images, preserving the product's construction and everything
+ /// outside the masks. Upload the `image`, up to 4 `masks`, and the
+ /// `materials` using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task EditWorkflowPostMaterialSwapAsync( + + global::Ideogram.EditWorkflowPostMaterialSwapRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Material Swap
+ /// Re-renders masked regions of a product photo in the materials shown in
+ /// reference images, preserving the product's construction and everything
+ /// outside the masks. Upload the `image`, up to 4 `masks`, and the
+ /// `materials` using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> EditWorkflowPostMaterialSwapAsResponseAsync( + + global::Ideogram.EditWorkflowPostMaterialSwapRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Material Swap
+ /// Re-renders masked regions of a product photo in the materials shown in
+ /// reference images, preserving the product's construction and everything
+ /// outside the masks. Upload the `image`, up to 4 `masks`, and the
+ /// `materials` using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// The product photo to edit (max size 25MB). JPEG, PNG, and WEBP
+ /// formats are supported. + /// + /// + /// The product photo to edit (max size 25MB). JPEG, PNG, and WEBP
+ /// formats are supported. + /// + /// + /// Masks marking the regions to change (max 4, max size 25MB each).
+ /// JPEG, PNG, and WEBP formats are supported. Every mask must have the
+ /// same pixel dimensions as the product photo. White pixels mark the
+ /// region to change and black pixels are preserved; alpha-only masks
+ /// also work (opaque = change, transparent = preserve). + /// + /// + /// Material reference images (max size 25MB each). JPEG, PNG, and WEBP
+ /// formats are supported. Only their material (color, texture, pattern
+ /// scale, and orientation) is applied to the masked regions. Send one
+ /// material for every mask, or exactly one per mask, paired by
+ /// position. + /// + /// + /// Output aspect ratio. Defaults to the product photo's aspect ratio,
+ /// which keeps the original framing. A different ratio extends the
+ /// scene to fill the new shape rather than cropping, so part of the
+ /// frame is newly generated. Supported values are `1:1`, `3:4`,
+ /// `4:3`, `16:9`, and `9:16`. + /// + /// + /// The quality tier for the edit. Higher tiers may improve detail and
+ /// take longer to complete. + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task EditWorkflowPostMaterialSwapAsync( + byte[] image, + string imagename, + bool? dryRun = default, + global::System.Collections.Generic.IList? masks = default, + global::System.Collections.Generic.IList? materials = default, + string? aspectRatio = default, + global::Ideogram.MaterialSwapQuality? quality = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Material Swap
+ /// Re-renders masked regions of a product photo in the materials shown in
+ /// reference images, preserving the product's construction and everything
+ /// outside the masks. Upload the `image`, up to 4 `masks`, and the
+ /// `materials` using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// The product photo to edit (max size 25MB). JPEG, PNG, and WEBP
+ /// formats are supported. + /// + /// + /// The product photo to edit (max size 25MB). JPEG, PNG, and WEBP
+ /// formats are supported. + /// + /// + /// Masks marking the regions to change (max 4, max size 25MB each).
+ /// JPEG, PNG, and WEBP formats are supported. Every mask must have the
+ /// same pixel dimensions as the product photo. White pixels mark the
+ /// region to change and black pixels are preserved; alpha-only masks
+ /// also work (opaque = change, transparent = preserve). + /// + /// + /// Optional file names to use for the multipart 'masks' file parts. + /// + /// + /// Material reference images (max size 25MB each). JPEG, PNG, and WEBP
+ /// formats are supported. Only their material (color, texture, pattern
+ /// scale, and orientation) is applied to the masked regions. Send one
+ /// material for every mask, or exactly one per mask, paired by
+ /// position. + /// + /// + /// Optional file names to use for the multipart 'materials' file parts. + /// + /// + /// Output aspect ratio. Defaults to the product photo's aspect ratio,
+ /// which keeps the original framing. A different ratio extends the
+ /// scene to fill the new shape rather than cropping, so part of the
+ /// frame is newly generated. Supported values are `1:1`, `3:4`,
+ /// `4:3`, `16:9`, and `9:16`. + /// + /// + /// The quality tier for the edit. Higher tiers may improve detail and
+ /// take longer to complete. + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task EditWorkflowPostMaterialSwapAsync( + global::System.IO.Stream image, + string imagename, + bool? dryRun = default, + global::System.Collections.Generic.IReadOnlyList? masks = default, + global::System.Collections.Generic.IReadOnlyList? masksFileNames = default, + global::System.Collections.Generic.IReadOnlyList? materials = default, + global::System.Collections.Generic.IReadOnlyList? materialsFileNames = default, + string? aspectRatio = default, + global::Ideogram.MaterialSwapQuality? quality = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Material Swap
+ /// Re-renders masked regions of a product photo in the materials shown in
+ /// reference images, preserving the product's construction and everything
+ /// outside the masks. Upload the `image`, up to 4 `masks`, and the
+ /// `materials` using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// The product photo to edit (max size 25MB). JPEG, PNG, and WEBP
+ /// formats are supported. + /// + /// + /// The product photo to edit (max size 25MB). JPEG, PNG, and WEBP
+ /// formats are supported. + /// + /// + /// Masks marking the regions to change (max 4, max size 25MB each).
+ /// JPEG, PNG, and WEBP formats are supported. Every mask must have the
+ /// same pixel dimensions as the product photo. White pixels mark the
+ /// region to change and black pixels are preserved; alpha-only masks
+ /// also work (opaque = change, transparent = preserve). + /// + /// + /// Optional file names to use for the multipart 'masks' file parts. + /// + /// + /// Material reference images (max size 25MB each). JPEG, PNG, and WEBP
+ /// formats are supported. Only their material (color, texture, pattern
+ /// scale, and orientation) is applied to the masked regions. Send one
+ /// material for every mask, or exactly one per mask, paired by
+ /// position. + /// + /// + /// Optional file names to use for the multipart 'materials' file parts. + /// + /// + /// Output aspect ratio. Defaults to the product photo's aspect ratio,
+ /// which keeps the original framing. A different ratio extends the
+ /// scene to fill the new shape rather than cropping, so part of the
+ /// frame is newly generated. Supported values are `1:1`, `3:4`,
+ /// `4:3`, `16:9`, and `9:16`. + /// + /// + /// The quality tier for the edit. Higher tiers may improve detail and
+ /// take longer to complete. + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> EditWorkflowPostMaterialSwapAsResponseAsync( + global::System.IO.Stream image, + string imagename, + bool? dryRun = default, + global::System.Collections.Generic.IReadOnlyList? masks = default, + global::System.Collections.Generic.IReadOnlyList? masksFileNames = default, + global::System.Collections.Generic.IReadOnlyList? materials = default, + global::System.Collections.Generic.IReadOnlyList? materialsFileNames = default, + string? aspectRatio = default, + global::Ideogram.MaterialSwapQuality? quality = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.EditWorkflowPostModelPoseVariants.g.cs b/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.EditWorkflowPostModelPoseVariants.g.cs new file mode 100644 index 00000000..37e1f9b6 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.EditWorkflowPostModelPoseVariants.g.cs @@ -0,0 +1,234 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IEditWorkflowClient + { + /// + /// Model Pose Variants
+ /// Changes the model's pose or camera angle in a fashion image while
+ /// preserving the model, garment, styling, and scene. Upload the
+ /// `source_image` using `multipart/form-data` and describe the new pose in
+ /// `instruction`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task EditWorkflowPostModelPoseVariantsAsync( + + global::Ideogram.EditWorkflowPostModelPoseVariantsRequest request, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Model Pose Variants
+ /// Changes the model's pose or camera angle in a fashion image while
+ /// preserving the model, garment, styling, and scene. Upload the
+ /// `source_image` using `multipart/form-data` and describe the new pose in
+ /// `instruction`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> EditWorkflowPostModelPoseVariantsAsResponseAsync( + + global::Ideogram.EditWorkflowPostModelPoseVariantsRequest request, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Model Pose Variants
+ /// Changes the model's pose or camera angle in a fashion image while
+ /// preserving the model, garment, styling, and scene. Upload the
+ /// `source_image` using `multipart/form-data` and describe the new pose in
+ /// `instruction`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// Fashion image to edit (max size 50MB). JPEG, PNG, WEBP, HEIF,
+ /// AVIF, GIF, BMP, TIFF, and MPO formats are supported. Multipart
+ /// requests only. + /// + /// + /// Fashion image to edit (max size 50MB). JPEG, PNG, WEBP, HEIF,
+ /// AVIF, GIF, BMP, TIFF, and MPO formats are supported. Multipart
+ /// requests only. + /// + /// + /// Plain-language pose or camera direction, such as a front-facing
+ /// catalog stance or right-facing walking profile. + /// + /// + /// Output aspect ratio. When omitted, the nearest supported ratio is
+ /// derived from the source image. Supported values are `1:1`, `3:4`,
+ /// `4:3`, `16:9`, and `9:16`. + /// + /// + /// The quality tier for the edit. Higher tiers may improve detail and
+ /// take longer to complete. + /// + /// + /// Optional seed for repeatable results. + /// + /// + /// Number of pose variants to create.
+ /// Default Value: 1 + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task EditWorkflowPostModelPoseVariantsAsync( + byte[] sourceImage, + string sourceImagename, + string instruction, + string? aspectRatio = default, + global::Ideogram.ModelPoseVariantsQuality? quality = default, + int? seed = default, + int? numImages = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Model Pose Variants
+ /// Changes the model's pose or camera angle in a fashion image while
+ /// preserving the model, garment, styling, and scene. Upload the
+ /// `source_image` using `multipart/form-data` and describe the new pose in
+ /// `instruction`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// Fashion image to edit (max size 50MB). JPEG, PNG, WEBP, HEIF,
+ /// AVIF, GIF, BMP, TIFF, and MPO formats are supported. Multipart
+ /// requests only. + /// + /// + /// Fashion image to edit (max size 50MB). JPEG, PNG, WEBP, HEIF,
+ /// AVIF, GIF, BMP, TIFF, and MPO formats are supported. Multipart
+ /// requests only. + /// + /// + /// Plain-language pose or camera direction, such as a front-facing
+ /// catalog stance or right-facing walking profile. + /// + /// + /// Output aspect ratio. When omitted, the nearest supported ratio is
+ /// derived from the source image. Supported values are `1:1`, `3:4`,
+ /// `4:3`, `16:9`, and `9:16`. + /// + /// + /// The quality tier for the edit. Higher tiers may improve detail and
+ /// take longer to complete. + /// + /// + /// Optional seed for repeatable results. + /// + /// + /// Number of pose variants to create.
+ /// Default Value: 1 + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task EditWorkflowPostModelPoseVariantsAsync( + global::System.IO.Stream sourceImage, + string sourceImagename, + string instruction, + string? aspectRatio = default, + global::Ideogram.ModelPoseVariantsQuality? quality = default, + int? seed = default, + int? numImages = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Model Pose Variants
+ /// Changes the model's pose or camera angle in a fashion image while
+ /// preserving the model, garment, styling, and scene. Upload the
+ /// `source_image` using `multipart/form-data` and describe the new pose in
+ /// `instruction`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// Fashion image to edit (max size 50MB). JPEG, PNG, WEBP, HEIF,
+ /// AVIF, GIF, BMP, TIFF, and MPO formats are supported. Multipart
+ /// requests only. + /// + /// + /// Fashion image to edit (max size 50MB). JPEG, PNG, WEBP, HEIF,
+ /// AVIF, GIF, BMP, TIFF, and MPO formats are supported. Multipart
+ /// requests only. + /// + /// + /// Plain-language pose or camera direction, such as a front-facing
+ /// catalog stance or right-facing walking profile. + /// + /// + /// Output aspect ratio. When omitted, the nearest supported ratio is
+ /// derived from the source image. Supported values are `1:1`, `3:4`,
+ /// `4:3`, `16:9`, and `9:16`. + /// + /// + /// The quality tier for the edit. Higher tiers may improve detail and
+ /// take longer to complete. + /// + /// + /// Optional seed for repeatable results. + /// + /// + /// Number of pose variants to create.
+ /// Default Value: 1 + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> EditWorkflowPostModelPoseVariantsAsResponseAsync( + global::System.IO.Stream sourceImage, + string sourceImagename, + string instruction, + string? aspectRatio = default, + global::Ideogram.ModelPoseVariantsQuality? quality = default, + int? seed = default, + int? numImages = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.EditWorkflowPostSketchToRender.g.cs b/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.EditWorkflowPostSketchToRender.g.cs new file mode 100644 index 00000000..eec69945 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.EditWorkflowPostSketchToRender.g.cs @@ -0,0 +1,228 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IEditWorkflowClient + { + /// + /// Sketch to Render
+ /// Turns a fashion sketch into photorealistic garment or product imagery,
+ /// preserving its silhouette, construction, colors, and design details.
+ /// Upload the `sketch_image` using `multipart/form-data` and describe
+ /// materials and rendering in `instruction`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task EditWorkflowPostSketchToRenderAsync( + + global::Ideogram.EditWorkflowPostSketchToRenderRequest request, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Sketch to Render
+ /// Turns a fashion sketch into photorealistic garment or product imagery,
+ /// preserving its silhouette, construction, colors, and design details.
+ /// Upload the `sketch_image` using `multipart/form-data` and describe
+ /// materials and rendering in `instruction`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> EditWorkflowPostSketchToRenderAsResponseAsync( + + global::Ideogram.EditWorkflowPostSketchToRenderRequest request, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Sketch to Render
+ /// Turns a fashion sketch into photorealistic garment or product imagery,
+ /// preserving its silhouette, construction, colors, and design details.
+ /// Upload the `sketch_image` using `multipart/form-data` and describe
+ /// materials and rendering in `instruction`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// The fashion sketch to render, up to 50 MB. JPEG, PNG, WEBP, HEIF,
+ /// AVIF, GIF, BMP, TIFF, and MPO are supported. Multipart requests
+ /// only. + /// + /// + /// The fashion sketch to render, up to 50 MB. JPEG, PNG, WEBP, HEIF,
+ /// AVIF, GIF, BMP, TIFF, and MPO are supported. Multipart requests
+ /// only. + /// + /// + /// Material and rendering direction, plus any construction or design
+ /// details that are not legible in the sketch. + /// + /// + /// Aspect ratio of each output image. Defaults to `1:1` when omitted. + /// + /// + /// The quality tier for the edit. Higher tiers may improve detail and
+ /// take longer to complete. + /// + /// + /// Optional seed for repeatable results. + /// + /// + /// Number of product renders to create.
+ /// Default Value: 1 + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task EditWorkflowPostSketchToRenderAsync( + byte[] sketchImage, + string sketchImagename, + string instruction, + string? aspectRatio = default, + global::Ideogram.SketchToRenderQuality? quality = default, + int? seed = default, + int? numImages = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Sketch to Render
+ /// Turns a fashion sketch into photorealistic garment or product imagery,
+ /// preserving its silhouette, construction, colors, and design details.
+ /// Upload the `sketch_image` using `multipart/form-data` and describe
+ /// materials and rendering in `instruction`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// The fashion sketch to render, up to 50 MB. JPEG, PNG, WEBP, HEIF,
+ /// AVIF, GIF, BMP, TIFF, and MPO are supported. Multipart requests
+ /// only. + /// + /// + /// The fashion sketch to render, up to 50 MB. JPEG, PNG, WEBP, HEIF,
+ /// AVIF, GIF, BMP, TIFF, and MPO are supported. Multipart requests
+ /// only. + /// + /// + /// Material and rendering direction, plus any construction or design
+ /// details that are not legible in the sketch. + /// + /// + /// Aspect ratio of each output image. Defaults to `1:1` when omitted. + /// + /// + /// The quality tier for the edit. Higher tiers may improve detail and
+ /// take longer to complete. + /// + /// + /// Optional seed for repeatable results. + /// + /// + /// Number of product renders to create.
+ /// Default Value: 1 + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task EditWorkflowPostSketchToRenderAsync( + global::System.IO.Stream sketchImage, + string sketchImagename, + string instruction, + string? aspectRatio = default, + global::Ideogram.SketchToRenderQuality? quality = default, + int? seed = default, + int? numImages = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Sketch to Render
+ /// Turns a fashion sketch into photorealistic garment or product imagery,
+ /// preserving its silhouette, construction, colors, and design details.
+ /// Upload the `sketch_image` using `multipart/form-data` and describe
+ /// materials and rendering in `instruction`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
+ /// supply a `webhook_url`. + ///
+ /// + /// The fashion sketch to render, up to 50 MB. JPEG, PNG, WEBP, HEIF,
+ /// AVIF, GIF, BMP, TIFF, and MPO are supported. Multipart requests
+ /// only. + /// + /// + /// The fashion sketch to render, up to 50 MB. JPEG, PNG, WEBP, HEIF,
+ /// AVIF, GIF, BMP, TIFF, and MPO are supported. Multipart requests
+ /// only. + /// + /// + /// Material and rendering direction, plus any construction or design
+ /// details that are not legible in the sketch. + /// + /// + /// Aspect ratio of each output image. Defaults to `1:1` when omitted. + /// + /// + /// The quality tier for the edit. Higher tiers may improve detail and
+ /// take longer to complete. + /// + /// + /// Optional seed for repeatable results. + /// + /// + /// Number of product renders to create.
+ /// Default Value: 1 + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> EditWorkflowPostSketchToRenderAsResponseAsync( + global::System.IO.Stream sketchImage, + string sketchImagename, + string instruction, + string? aspectRatio = default, + global::Ideogram.SketchToRenderQuality? quality = default, + int? seed = default, + int? numImages = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostAdLocalizer.g.cs b/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostAdLocalizer.g.cs deleted file mode 100644 index c0f1fb5f..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostAdLocalizer.g.cs +++ /dev/null @@ -1,137 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IEditWorkflowClient - { - /// - /// Ad Localizer
- /// Rebuilds an ad in one target language, preserving its layout, logos,
- /// brand type, and product so only the visible marketing copy changes.
- /// Upload the source ad as `image` using `multipart/form-data`; the copy
- /// is translated unless you supply `exact_copy`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
- /// supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostAdLocalizerAsync( - - global::Ideogram.AdLocalizerRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Ad Localizer
- /// Rebuilds an ad in one target language, preserving its layout, logos,
- /// brand type, and product so only the visible marketing copy changes.
- /// Upload the source ad as `image` using `multipart/form-data`; the copy
- /// is translated unless you supply `exact_copy`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
- /// supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostAdLocalizerAsResponseAsync( - - global::Ideogram.AdLocalizerRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Ad Localizer
- /// Rebuilds an ad in one target language, preserving its layout, logos,
- /// brand type, and product so only the visible marketing copy changes.
- /// Upload the source ad as `image` using `multipart/form-data`; the copy
- /// is translated unless you supply `exact_copy`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
- /// supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The source ad to localize (max size 25MB). Its layout, logos, brand
- /// type, and product are preserved, and the output keeps its shape, so
- /// no size or aspect ratio is needed. JPEG, PNG, and WEBP formats are
- /// supported. Multipart requests only. - /// - /// - /// The source ad to localize (max size 25MB). Its layout, logos, brand
- /// type, and product are preserved, and the output keeps its shape, so
- /// no size or aspect ratio is needed. JPEG, PNG, and WEBP formats are
- /// supported. Multipart requests only. - /// - /// - /// The target language for the copy. Arabic is rendered right-to-left. Each request covers one language; send one request per language. - /// - /// - /// Pre-approved wording, one `original => replacement` mapping per line. Each mapping names the text element showing `original` and sets it to `replacement`, placed character for character rather than translated. Any text element not listed is left as it is in the source. When omitted, all visible marketing copy is translated. - /// - /// - /// Optional additional direction for the localization, for example "keep the badge in English". Anything it explicitly asks to change takes priority over the preservation rules. - /// - /// - /// The quality tier for the edit. Higher tiers may improve detail and
- /// take longer to complete. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// Number of localized variations to create for this language.
- /// Default Value: 1 - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. Completed outputs are added to it automatically. - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostAdLocalizerAsync( - global::Ideogram.AdLocalizerRequestLanguage language, - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - string? exactCopy = default, - string? prompt = default, - global::Ideogram.AdLocalizerQuality? quality = default, - int? seed = default, - int? numImages = default, - string? targetCollectionId = default, - bool? @private = default, - string? webhookUrl = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostAdResizer.g.cs b/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostAdResizer.g.cs deleted file mode 100644 index 8b30f26e..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostAdResizer.g.cs +++ /dev/null @@ -1,150 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IEditWorkflowClient - { - /// - /// Ad Resizer
- /// Reframes an ad creative to an exact ad resolution, regenerating the
- /// layout so text and key elements stay legible at the new size. Upload
- /// the source creative as `image` using `multipart/form-data`, and supply
- /// `platform` to keep the ad inside that platform's safe zone.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
- /// supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostAdResizerAsync( - - global::Ideogram.AdResizerRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Ad Resizer
- /// Reframes an ad creative to an exact ad resolution, regenerating the
- /// layout so text and key elements stay legible at the new size. Upload
- /// the source creative as `image` using `multipart/form-data`, and supply
- /// `platform` to keep the ad inside that platform's safe zone.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
- /// supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostAdResizerAsResponseAsync( - - global::Ideogram.AdResizerRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Ad Resizer
- /// Reframes an ad creative to an exact ad resolution, regenerating the
- /// layout so text and key elements stay legible at the new size. Upload
- /// the source creative as `image` using `multipart/form-data`, and supply
- /// `platform` to keep the ad inside that platform's safe zone.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
- /// supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The source creative to reframe (max size 25MB). JPEG, PNG, and
- /// WEBP formats are supported. Multipart requests only. - /// - /// - /// The source creative to reframe (max size 25MB). JPEG, PNG, and
- /// WEBP formats are supported. Multipart requests only. - /// - /// - /// Target ad resolution, formatted as `WIDTHxHEIGHT`. Any value not in
- /// the list is rejected with a 400. Each output image has exactly these
- /// pixel dimensions, with or without a `platform`. - /// - /// - /// The ad platform whose published safe zone the ad must stay inside.
- /// The ad is generated inside the largest rectangle that fits the
- /// platform's safe zone for the requested aspect ratio, and the space
- /// around it is filled in so the output is still exactly the requested
- /// `resolution`. `google` covers YouTube and Google Ads placements.
- /// Use `meta_stories` or `meta_reels` for Meta placements; Reels uses
- /// the largest rectangle inside its notched safe zone. The legacy
- /// `meta` value is still supported and uses a more conservative safe
- /// zone. When omitted, the ad fills the whole frame and every
- /// supported `resolution` is accepted. Any other value is rejected
- /// with a 400.
- /// Each platform accepts only the resolutions for which it publishes a
- /// safe zone; any other `resolution` is rejected with a 400:
- /// | Platform | Accepted resolutions |
- /// | --- | --- |
- /// | `google` | `1920x1080`, `3840x2160`, `1080x1080`, `2400x2400`, `2880x2880`, `1080x1920`, `2160x3840` |
- /// | `tiktok` | `1920x1080`, `3840x2160`, `1080x1080`, `2400x2400`, `2880x2880`, `1080x1920`, `2160x3840` |
- /// | `meta_stories` | `1080x1920`, `2160x3840` |
- /// | `meta_reels` | `1080x1920`, `2160x3840` |
- /// | `meta` (legacy) | `1080x1920`, `2160x3840` |
- /// | `snapchat` | `1080x1920`, `2160x3840` | - /// - /// - /// Optional edit instruction to apply while reframing, for example "remove the logo" or "put the price bottom-right". - /// - /// - /// The quality tier for the reframe. Higher tiers may improve detail and
- /// take longer to complete. - /// - /// - /// The number of reframed variations to generate.
- /// Default Value: 1 - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. Completed outputs are added to it automatically. - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostAdResizerAsync( - global::Ideogram.AdResizerRequestResolution resolution, - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - global::Ideogram.AdResizerRequestPlatform? platform = default, - string? prompt = default, - global::Ideogram.AdResizerQuality? quality = default, - int? numImages = default, - string? targetCollectionId = default, - bool? @private = default, - string? webhookUrl = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostAdVariations.g.cs b/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostAdVariations.g.cs deleted file mode 100644 index 2b92b79d..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostAdVariations.g.cs +++ /dev/null @@ -1,116 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IEditWorkflowClient - { - /// - /// Ad Variations
- /// Creates on-brand variations of an ad along one axis, preserving logos,
- /// brand colors, the product, and all on-image text. Upload the source
- /// creative as `image` using `multipart/form-data` and choose a
- /// `variation_type`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
- /// supply a `webhook_url`. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostAdVariationsAsync( - - global::Ideogram.AdVariationsRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Ad Variations
- /// Creates on-brand variations of an ad along one axis, preserving logos,
- /// brand colors, the product, and all on-image text. Upload the source
- /// creative as `image` using `multipart/form-data` and choose a
- /// `variation_type`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
- /// supply a `webhook_url`. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostAdVariationsAsResponseAsync( - - global::Ideogram.AdVariationsRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Ad Variations
- /// Creates on-brand variations of an ad along one axis, preserving logos,
- /// brand colors, the product, and all on-image text. Upload the source
- /// creative as `image` using `multipart/form-data` and choose a
- /// `variation_type`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
- /// supply a `webhook_url`. - ///
- /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The source creative to vary (max size 25MB). JPEG, PNG, and WEBP
- /// formats are supported. Multipart requests only. Each output keeps
- /// the source's aspect ratio, capped at 3:1 between the long and short
- /// sides. - /// - /// - /// The source creative to vary (max size 25MB). JPEG, PNG, and WEBP
- /// formats are supported. Multipart requests only. Each output keeps
- /// the source's aspect ratio, capped at 3:1 between the long and short
- /// sides. - /// - /// - /// The axis to vary. `people`
- /// replaces the people in the ad with different talent. `setting`
- /// moves the same subject and product to a different environment.
- /// `group_size` changes how many people appear. `scene` shifts the
- /// moment or occasion (time of day, season, or activity). - /// - /// - /// Optional direction to steer the variation, for example "set it on a beach" or "make the models older". Anything it explicitly asks to change takes priority over the default preservation rules. - /// - /// - /// The quality tier for the edit. Higher tiers may improve detail and
- /// take longer to complete. - /// - /// - /// The number of variations to generate along the requested axis.
- /// Default Value: 1 - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostAdVariationsAsync( - global::Ideogram.AdVariationsRequestVariationType variationType, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - string? prompt = default, - global::Ideogram.AdVariationsQuality? quality = default, - int? numImages = default, - bool? @private = default, - string? webhookUrl = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostColorways.g.cs b/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostColorways.g.cs deleted file mode 100644 index 42617297..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostColorways.g.cs +++ /dev/null @@ -1,145 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IEditWorkflowClient - { - /// - /// Colorways
- /// Recolors masked regions of a product photo, each to its own target
- /// color, preserving the product's geometry, materials, prints, logos, and
- /// everything outside the masks. Upload the `image` and up to 4 `masks`
- /// using `multipart/form-data`, with one entry in `colors` per mask.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
- /// supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostColorwaysAsync( - - global::Ideogram.ColorwaysRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Colorways
- /// Recolors masked regions of a product photo, each to its own target
- /// color, preserving the product's geometry, materials, prints, logos, and
- /// everything outside the masks. Upload the `image` and up to 4 `masks`
- /// using `multipart/form-data`, with one entry in `colors` per mask.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
- /// supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostColorwaysAsResponseAsync( - - global::Ideogram.ColorwaysRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Colorways
- /// Recolors masked regions of a product photo, each to its own target
- /// color, preserving the product's geometry, materials, prints, logos, and
- /// everything outside the masks. Upload the `image` and up to 4 `masks`
- /// using `multipart/form-data`, with one entry in `colors` per mask.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
- /// supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// The product photo to recolor, by reference. Everything outside
- /// the masked region is preserved. Provide exactly one of
- /// `image_asset_identifier` or `image`. - /// - /// - /// The product photo to recolor (max size 25MB). JPEG, PNG, and WEBP
- /// formats are supported. - /// - /// - /// The product photo to recolor (max size 25MB). JPEG, PNG, and WEBP
- /// formats are supported. - /// - /// - /// The masks marking the regions of the product photo to recolor, by
- /// reference, paired by position with `colors` (max 4). Every mask
- /// must have the same pixel dimensions as the product photo. White
- /// pixels mark the region to recolor; black pixels are preserved.
- /// Alpha-only masks are also supported: opaque pixels mark the
- /// region to recolor and transparent pixels are preserved. Provide
- /// exactly one of `mask_asset_identifiers` or `masks`. - /// - /// - /// Masks marking the regions to recolor (max 4, max size 25MB each),
- /// paired by position with `colors`. JPEG, PNG, and WEBP formats are
- /// supported. Every mask must have the same pixel dimensions as the
- /// product photo. White pixels mark the region to recolor and black
- /// pixels are preserved; alpha-only masks also work (opaque =
- /// recolor, transparent = preserve). - /// - /// - /// One target color per mask in `masks`, as six-digit hex codes like
- /// `#B3202C`, paired by position. The product's shape, construction,
- /// materials, prints, and logos are always preserved. - /// - /// - /// Output aspect ratio. Defaults to the product photo's aspect ratio,
- /// which keeps the original framing. A different ratio extends the
- /// scene to fill the new shape rather than cropping, so part of the
- /// frame is newly generated. Supported values are `1:1`, `3:4`,
- /// `4:3`, `16:9`, and `9:16`. - /// - /// - /// The quality tier for the edit. Higher tiers may improve detail and
- /// take longer to complete. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. Completed outputs are added to it automatically. - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostColorwaysAsync( - global::System.Collections.Generic.IList colors, - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - global::System.Collections.Generic.IList? maskAssetIdentifiers = default, - global::System.Collections.Generic.IList? masks = default, - string? aspectRatio = default, - global::Ideogram.ColorwaysQuality? quality = default, - string? targetCollectionId = default, - bool? @private = default, - string? webhookUrl = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostGhostMannequin.g.cs b/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostGhostMannequin.g.cs deleted file mode 100644 index 437ec28c..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostGhostMannequin.g.cs +++ /dev/null @@ -1,251 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IEditWorkflowClient - { - /// - /// Ghost Mannequin
- /// Turns photos of one garment into a ghost-mannequin product image on a
- /// clean white studio background, removing the person, mannequin, hanger,
- /// and other clothing. Upload the photos using `multipart/form-data`, in
- /// the directional fields (such as `front_image`) when the camera
- /// direction is known and in `garment_images` otherwise.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
- /// supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGhostMannequinAsync( - - global::Ideogram.GhostMannequinRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Ghost Mannequin
- /// Turns photos of one garment into a ghost-mannequin product image on a
- /// clean white studio background, removing the person, mannequin, hanger,
- /// and other clothing. Upload the photos using `multipart/form-data`, in
- /// the directional fields (such as `front_image`) when the camera
- /// direction is known and in `garment_images` otherwise.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
- /// supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostGhostMannequinAsResponseAsync( - - global::Ideogram.GhostMannequinRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Ghost Mannequin
- /// Turns photos of one garment into a ghost-mannequin product image on a
- /// clean white studio background, removing the person, mannequin, hanger,
- /// and other clothing. Upload the photos using `multipart/form-data`, in
- /// the directional fields (such as `front_image`) when the camera
- /// direction is known and in `garment_images` otherwise.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
- /// supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Ordered uploaded or generated images of the same garment. Use
- /// multiple angles when available so obscured construction can be
- /// reconstructed conservatively. Mutually exclusive with
- /// `garment_images`. - /// - /// - /// Additional photos of the same garment, up to 50 MB each. JPEG,
- /// PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and MPO are supported.
- /// Multipart requests only. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// Optional front-view garment photo, up to 50 MB. Multipart requests
- /// only. - /// - /// - /// Optional front-view garment photo, up to 50 MB. Multipart requests
- /// only. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// Optional back-view garment photo, up to 50 MB. Multipart requests
- /// only. - /// - /// - /// Optional back-view garment photo, up to 50 MB. Multipart requests
- /// only. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// Optional left-view garment photo, up to 50 MB. Multipart requests
- /// only. - /// - /// - /// Optional left-view garment photo, up to 50 MB. Multipart requests
- /// only. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// Optional right-view garment photo, up to 50 MB. Multipart requests
- /// only. - /// - /// - /// Optional right-view garment photo, up to 50 MB. Multipart requests
- /// only. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// Optional top-view garment photo, up to 50 MB. Multipart requests
- /// only. - /// - /// - /// Optional top-view garment photo, up to 50 MB. Multipart requests
- /// only. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// Optional bottom-view garment photo, up to 50 MB. Multipart
- /// requests only. - /// - /// - /// Optional bottom-view garment photo, up to 50 MB. Multipart
- /// requests only. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// Optional presentation example, up to 50 MB. Multipart requests only.
- /// Guides pose, framing, and lighting without copying its garment,
- /// colors, text, or branding. Garment photos remain authoritative for
- /// product identity; view and aspect_ratio take precedence, and the
- /// background remains white. Does not replace a required garment photo.
- /// Mutually exclusive with `output_reference_asset_identifier`. - /// - /// - /// Optional presentation example, up to 50 MB. Multipart requests only.
- /// Guides pose, framing, and lighting without copying its garment,
- /// colors, text, or branding. Garment photos remain authoritative for
- /// product identity; view and aspect_ratio take precedence, and the
- /// background remains white. Does not replace a required garment photo.
- /// Mutually exclusive with `output_reference_asset_identifier`. - /// - /// - /// Camera view for the output garment. - /// - /// - /// Optional reconstruction guidance or identity-critical garment
- /// details to check against the photos. The output always uses a clean
- /// white studio background. - /// - /// - /// Optional JSON object serialized as a string containing factual
- /// product context, such as title, brand, category, color, material,
- /// item code, and exact printed text. Metadata helps disambiguate the
- /// garment photos but does not add features they do not show. - /// - /// - /// Output aspect ratio. Defaults to `1:1` when omitted. Supported
- /// values are `1:1`, `3:4`, `4:3`, `16:9`, and `9:16`. - /// - /// - /// The quality tier for the edit. Higher tiers may improve detail and
- /// take longer to complete. - /// - /// - /// Optional seed for repeatable results. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. Completed outputs are added to it automatically. - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGhostMannequinAsync( - global::Ideogram.GhostMannequinRequestView view, - bool? dryRun = default, - global::System.Collections.Generic.IList? garmentAssetIdentifiers = default, - global::System.Collections.Generic.IList? garmentImages = default, - global::Ideogram.AssetIdentifier? frontAssetIdentifier = default, - byte[]? frontImage = default, - string? frontImagename = default, - global::Ideogram.AssetIdentifier? backAssetIdentifier = default, - byte[]? backImage = default, - string? backImagename = default, - global::Ideogram.AssetIdentifier? leftAssetIdentifier = default, - byte[]? leftImage = default, - string? leftImagename = default, - global::Ideogram.AssetIdentifier? rightAssetIdentifier = default, - byte[]? rightImage = default, - string? rightImagename = default, - global::Ideogram.AssetIdentifier? topAssetIdentifier = default, - byte[]? topImage = default, - string? topImagename = default, - global::Ideogram.AssetIdentifier? bottomAssetIdentifier = default, - byte[]? bottomImage = default, - string? bottomImagename = default, - global::Ideogram.AssetIdentifier? outputReferenceAssetIdentifier = default, - byte[]? outputReferenceImage = default, - string? outputReferenceImagename = default, - string? instruction = default, - string? metadata = default, - string? aspectRatio = default, - global::Ideogram.GhostMannequinQuality? quality = default, - int? seed = default, - string? targetCollectionId = default, - bool? @private = default, - string? webhookUrl = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostLookbook.g.cs b/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostLookbook.g.cs deleted file mode 100644 index aa549c8e..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostLookbook.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IEditWorkflowClient - { - /// - /// Create a fashion lookbook
- /// Creates polished fashion product imagery from one or more product
- /// references and an aesthetic reference. Each generated shoot is returned
- /// as four individual lookbook images.
- /// The request is processed asynchronously. Poll
- /// `GET /v2/generations/{generation_id}` with the returned `generation_id`
- /// until the generation is completed or failed. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostLookbookAsync( - - global::Ideogram.LookbookRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Create a fashion lookbook
- /// Creates polished fashion product imagery from one or more product
- /// references and an aesthetic reference. Each generated shoot is returned
- /// as four individual lookbook images.
- /// The request is processed asynchronously. Poll
- /// `GET /v2/generations/{generation_id}` with the returned `generation_id`
- /// until the generation is completed or failed. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostLookbookAsResponseAsync( - - global::Ideogram.LookbookRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Create a fashion lookbook
- /// Creates polished fashion product imagery from one or more product
- /// references and an aesthetic reference. Each generated shoot is returned
- /// as four individual lookbook images.
- /// The request is processed asynchronously. Poll
- /// `GET /v2/generations/{generation_id}` with the returned `generation_id`
- /// until the generation is completed or failed. - ///
- /// - /// Product images whose appearance must be preserved in the generated looks. - /// - /// - /// Selects the category-specific Lookbook presentation reference. - /// - /// - /// The aspect ratio of each generated 2x2 composite before it is split into images. Defaults to `1:1` when omitted. Supported values are `1:1`, `3:4`, and `9:16`. - /// - /// - /// Number of four-image lookbook shoots to create.
- /// Default Value: 3 - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostLookbookAsync( - global::System.Collections.Generic.IList productAssetIdentifiers, - global::Ideogram.LookbookRequestCategory category, - string? aspectRatio = default, - int? numShoots = default, - bool? @private = default, - string? webhookUrl = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostMaterialSwap.g.cs b/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostMaterialSwap.g.cs deleted file mode 100644 index 1646b031..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostMaterialSwap.g.cs +++ /dev/null @@ -1,154 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IEditWorkflowClient - { - /// - /// Material Swap
- /// Re-renders masked regions of a product photo in the materials shown in
- /// reference images, preserving the product's construction and everything
- /// outside the masks. Upload the `image`, up to 4 `masks`, and the
- /// `materials` using `multipart/form-data`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
- /// supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostMaterialSwapAsync( - - global::Ideogram.MaterialSwapRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Material Swap
- /// Re-renders masked regions of a product photo in the materials shown in
- /// reference images, preserving the product's construction and everything
- /// outside the masks. Upload the `image`, up to 4 `masks`, and the
- /// `materials` using `multipart/form-data`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
- /// supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostMaterialSwapAsResponseAsync( - - global::Ideogram.MaterialSwapRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Material Swap
- /// Re-renders masked regions of a product photo in the materials shown in
- /// reference images, preserving the product's construction and everything
- /// outside the masks. Upload the `image`, up to 4 `masks`, and the
- /// `materials` using `multipart/form-data`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
- /// supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// The product photo to edit, by reference. Everything outside the
- /// masked region is preserved. Provide exactly one of
- /// `image_asset_identifier` or `image`. - /// - /// - /// The product photo to edit (max size 25MB). JPEG, PNG, and WEBP
- /// formats are supported. - /// - /// - /// The product photo to edit (max size 25MB). JPEG, PNG, and WEBP
- /// formats are supported. - /// - /// - /// The masks marking the regions of the product photo to change, by
- /// reference (max 4). Every mask must have the same pixel dimensions
- /// as the product photo. White pixels mark the region to change; black
- /// pixels are preserved. Alpha-only masks are also supported: opaque
- /// pixels mark the region to change and transparent pixels are
- /// preserved. Provide exactly one of `mask_asset_identifiers` or
- /// `masks`. - /// - /// - /// Masks marking the regions to change (max 4, max size 25MB each).
- /// JPEG, PNG, and WEBP formats are supported. Every mask must have the
- /// same pixel dimensions as the product photo. White pixels mark the
- /// region to change and black pixels are preserved; alpha-only masks
- /// also work (opaque = change, transparent = preserve). - /// - /// - /// The material reference images, by reference. Only their material —
- /// color, texture, pattern scale, and orientation — is applied to the
- /// masked regions. Send one material, which every mask takes, or
- /// exactly one per mask paired by position. Provide exactly one of
- /// `material_asset_identifiers` or `materials`. - /// - /// - /// Material reference images (max size 25MB each). JPEG, PNG, and WEBP
- /// formats are supported. Only their material (color, texture, pattern
- /// scale, and orientation) is applied to the masked regions. Send one
- /// material for every mask, or exactly one per mask, paired by
- /// position. - /// - /// - /// Output aspect ratio. Defaults to the product photo's aspect ratio,
- /// which keeps the original framing. A different ratio extends the
- /// scene to fill the new shape rather than cropping, so part of the
- /// frame is newly generated. Supported values are `1:1`, `3:4`,
- /// `4:3`, `16:9`, and `9:16`. - /// - /// - /// The quality tier for the edit. Higher tiers may improve detail and
- /// take longer to complete. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. Completed outputs are added to it automatically. - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostMaterialSwapAsync( - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - global::System.Collections.Generic.IList? maskAssetIdentifiers = default, - global::System.Collections.Generic.IList? masks = default, - global::System.Collections.Generic.IList? materialAssetIdentifiers = default, - global::System.Collections.Generic.IList? materials = default, - string? aspectRatio = default, - global::Ideogram.MaterialSwapQuality? quality = default, - string? targetCollectionId = default, - bool? @private = default, - string? webhookUrl = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostModelPoseVariants.g.cs b/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostModelPoseVariants.g.cs deleted file mode 100644 index 02d51327..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostModelPoseVariants.g.cs +++ /dev/null @@ -1,122 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IEditWorkflowClient - { - /// - /// Model Pose Variants
- /// Changes the model's pose or camera angle in a fashion image while
- /// preserving the model, garment, styling, and scene. Upload the
- /// `source_image` using `multipart/form-data` and describe the new pose in
- /// `instruction`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
- /// supply a `webhook_url`. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostModelPoseVariantsAsync( - - global::Ideogram.ModelPoseVariantsRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Model Pose Variants
- /// Changes the model's pose or camera angle in a fashion image while
- /// preserving the model, garment, styling, and scene. Upload the
- /// `source_image` using `multipart/form-data` and describe the new pose in
- /// `instruction`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
- /// supply a `webhook_url`. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostModelPoseVariantsAsResponseAsync( - - global::Ideogram.ModelPoseVariantsRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Model Pose Variants
- /// Changes the model's pose or camera angle in a fashion image while
- /// preserving the model, garment, styling, and scene. Upload the
- /// `source_image` using `multipart/form-data` and describe the new pose in
- /// `instruction`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
- /// supply a `webhook_url`. - ///
- /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// Fashion image to edit (max size 50MB). JPEG, PNG, WEBP, HEIF,
- /// AVIF, GIF, BMP, TIFF, and MPO formats are supported. Multipart
- /// requests only. - /// - /// - /// Fashion image to edit (max size 50MB). JPEG, PNG, WEBP, HEIF,
- /// AVIF, GIF, BMP, TIFF, and MPO formats are supported. Multipart
- /// requests only. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// Plain-language pose or camera direction, such as a front-facing
- /// catalog stance or right-facing walking profile. - /// - /// - /// Output aspect ratio. When omitted, the nearest supported ratio is
- /// derived from the source image. Supported values are `1:1`, `3:4`,
- /// `4:3`, `16:9`, and `9:16`. - /// - /// - /// The quality tier for the edit. Higher tiers may improve detail and
- /// take longer to complete. - /// - /// - /// Optional seed for repeatable results. - /// - /// - /// Number of pose variants to create.
- /// Default Value: 1 - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostModelPoseVariantsAsync( - string instruction, - global::Ideogram.AssetIdentifier? sourceAssetIdentifier = default, - byte[]? sourceImage = default, - string? sourceImagename = default, - global::Ideogram.AssetIdentifier? poseReferenceAssetIdentifier = default, - string? aspectRatio = default, - global::Ideogram.ModelPoseVariantsQuality? quality = default, - int? seed = default, - int? numImages = default, - bool? @private = default, - string? webhookUrl = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostModelSwap.g.cs b/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostModelSwap.g.cs deleted file mode 100644 index c8876651..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostModelSwap.g.cs +++ /dev/null @@ -1,114 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IEditWorkflowClient - { - /// - /// Model Swap
- /// Replaces the model in a fashion image with the person shown in one to
- /// four target-model references, keeping the product, pose, scene,
- /// lighting, and framing. Upload the working image as `source_image` using
- /// `multipart/form-data`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
- /// supply a `webhook_url`. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostModelSwapAsync( - - global::Ideogram.ModelSwapRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Model Swap
- /// Replaces the model in a fashion image with the person shown in one to
- /// four target-model references, keeping the product, pose, scene,
- /// lighting, and framing. Upload the working image as `source_image` using
- /// `multipart/form-data`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
- /// supply a `webhook_url`. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostModelSwapAsResponseAsync( - - global::Ideogram.ModelSwapRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Model Swap
- /// Replaces the model in a fashion image with the person shown in one to
- /// four target-model references, keeping the product, pose, scene,
- /// lighting, and framing. Upload the working image as `source_image` using
- /// `multipart/form-data`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
- /// supply a `webhook_url`. - ///
- /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The working image whose product, pose, scene, lighting, framing, and camera are preserved. Supported formats and the 50 MB limit match the image upload API. Multipart requests only. - /// - /// - /// The working image whose product, pose, scene, lighting, framing, and camera are preserved. Supported formats and the 50 MB limit match the image upload API. Multipart requests only. - /// - /// - /// Ordered target-model identity and angle references. These images supply only identity, hair, skin tone, and body proportions. - /// - /// - /// Optional identity details that are not visible in the target-model references. This cannot override the source roles described above. - /// - /// - /// Output aspect ratio. When omitted, the closest supported ratio is derived from the working image. - /// - /// - /// The quality tier for the edit. Higher tiers may improve detail and
- /// take longer to complete. - /// - /// - /// Optional seed for repeatable results. - /// - /// - /// Number of model-swap images to create.
- /// Default Value: 1 - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostModelSwapAsync( - global::System.Collections.Generic.IList modelAssetIdentifiers, - global::Ideogram.AssetIdentifier? sourceAssetIdentifier = default, - byte[]? sourceImage = default, - string? sourceImagename = default, - string? instruction = default, - string? aspectRatio = default, - global::Ideogram.ModelSwapQuality? quality = default, - int? seed = default, - int? numImages = default, - bool? @private = default, - string? webhookUrl = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostPackshots.g.cs b/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostPackshots.g.cs deleted file mode 100644 index 98a96829..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostPackshots.g.cs +++ /dev/null @@ -1,109 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IEditWorkflowClient - { - /// - /// Packshots
- /// Creates one polished product photograph from one or more ordered product
- /// references. An optional style reference may guide framing, crop,
- /// background, and lighting without changing the product's identity.
- /// The request is processed asynchronously. Poll
- /// `GET /v2/generations/{generation_id}` with the returned `generation_id`
- /// until the generation is completed or failed. Product fidelity is
- /// best-effort and details absent from every reference may be reconstructed. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostPackshotsAsync( - - global::Ideogram.PackshotsRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Packshots
- /// Creates one polished product photograph from one or more ordered product
- /// references. An optional style reference may guide framing, crop,
- /// background, and lighting without changing the product's identity.
- /// The request is processed asynchronously. Poll
- /// `GET /v2/generations/{generation_id}` with the returned `generation_id`
- /// until the generation is completed or failed. Product fidelity is
- /// best-effort and details absent from every reference may be reconstructed. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostPackshotsAsResponseAsync( - - global::Ideogram.PackshotsRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Packshots
- /// Creates one polished product photograph from one or more ordered product
- /// references. An optional style reference may guide framing, crop,
- /// background, and lighting without changing the product's identity.
- /// The request is processed asynchronously. Poll
- /// `GET /v2/generations/{generation_id}` with the returned `generation_id`
- /// until the generation is completed or failed. Product fidelity is
- /// best-effort and details absent from every reference may be reconstructed. - ///
- /// - /// Ordered uploaded or generated product images. Their product color,
- /// construction, materials, logos, proportions, and distinguishing
- /// details guide every output. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// Product view to generate. - /// - /// - /// Optional art direction for the studio background, lighting,
- /// framing, and presentation. Product fidelity rules always take
- /// precedence. - /// - /// - /// Aspect ratio for every generated image. Supported values are
- /// `1:1`, `3:4`, `4:3`, `16:9`, and `9:16`. - /// - /// - /// The quality tier for the edit. Higher tiers may improve detail and
- /// take longer to complete. - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostPackshotsAsync( - global::System.Collections.Generic.IList productAssetIdentifiers, - global::Ideogram.PackshotView view, - global::Ideogram.AssetIdentifier? styleReferenceAssetIdentifier = default, - string? instruction = default, - string? aspectRatio = default, - global::Ideogram.PackshotsQuality? quality = default, - bool? @private = default, - string? webhookUrl = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostPreciseMaskedEdit.g.cs b/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostPreciseMaskedEdit.g.cs deleted file mode 100644 index c4cdf90f..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostPreciseMaskedEdit.g.cs +++ /dev/null @@ -1,136 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IEditWorkflowClient - { - /// - /// Edit an image, optionally using a mask
- /// Applies an instruction to an image. When a mask is supplied, it identifies
- /// the primary edit region. Without a mask, the model edits the full image.
- /// Optional reference images can guide the requested appearance. Set
- /// `preserve_unmasked_pixels` to keep decoded pixels outside a supplied mask
- /// unchanged in the final image.
- /// The request runs asynchronously. Poll
- /// `GET /v2/generations/{generation_id}` with the returned `generation_id`
- /// until the generation is completed or failed. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostPreciseMaskedEditAsync( - - global::Ideogram.PreciseMaskedEditRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Edit an image, optionally using a mask
- /// Applies an instruction to an image. When a mask is supplied, it identifies
- /// the primary edit region. Without a mask, the model edits the full image.
- /// Optional reference images can guide the requested appearance. Set
- /// `preserve_unmasked_pixels` to keep decoded pixels outside a supplied mask
- /// unchanged in the final image.
- /// The request runs asynchronously. Poll
- /// `GET /v2/generations/{generation_id}` with the returned `generation_id`
- /// until the generation is completed or failed. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostPreciseMaskedEditAsResponseAsync( - - global::Ideogram.PreciseMaskedEditRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Edit an image, optionally using a mask
- /// Applies an instruction to an image. When a mask is supplied, it identifies
- /// the primary edit region. Without a mask, the model edits the full image.
- /// Optional reference images can guide the requested appearance. Set
- /// `preserve_unmasked_pixels` to keep decoded pixels outside a supplied mask
- /// unchanged in the final image.
- /// The request runs asynchronously. Poll
- /// `GET /v2/generations/{generation_id}` with the returned `generation_id`
- /// until the generation is completed or failed. - ///
- /// - /// The model used to apply the masked edit. - /// - /// - /// The generation quality level. Defaults to `high`.
- /// Default Value: high - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// Raw source image bytes. Supported formats and the 50 MB limit match the image upload API. Available only with `multipart/form-data`. - /// - /// - /// Raw source image bytes. Supported formats and the 50 MB limit match the image upload API. Available only with `multipart/form-data`. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// Optional assets that show the desired appearance of the edit. GPT Image 2 accepts up to 15. Ideogram 4.5 accepts up to 4 without a mask, or 3 when a mask is supplied. - /// - /// - /// Plain-language description of the desired change. - /// - /// - /// Optional seed for repeatable results. - /// - /// - /// Number of edited images to create.
- /// Default Value: 1 - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. Completed outputs are added to it automatically. - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// When true, decoded pixels outside the mask are copied from the
- /// source image into the final result. Requires `mask_asset_identifier`.
- /// When false, the final result is the model's full edited image.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostPreciseMaskedEditAsync( - string instruction, - global::Ideogram.PreciseMaskedEditModel? model = default, - global::Ideogram.PreciseMaskedEditQuality? quality = default, - global::Ideogram.AssetIdentifier? sourceAssetIdentifier = default, - byte[]? sourceImage = default, - string? sourceImagename = default, - global::Ideogram.AssetIdentifier? maskAssetIdentifier = default, - global::System.Collections.Generic.IList? referenceAssetIdentifiers = default, - int? seed = default, - int? numImages = default, - string? targetCollectionId = default, - bool? @private = default, - bool? preserveUnmaskedPixels = default, - string? webhookUrl = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostSkechersStyleEdit.g.cs b/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostSkechersStyleEdit.g.cs deleted file mode 100644 index 4df6f99c..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostSkechersStyleEdit.g.cs +++ /dev/null @@ -1,114 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IEditWorkflowClient - { - /// - /// Edit a product image using an instruction and ordered references
- /// Edits the base image while preserving details the instruction does not
- /// change. Image 1 is the base; reference images are numbered from image 2
- /// in the supplied order. Resolve image mentions to these numbers before
- /// submitting. Descriptions identify the selected view or reference.
- /// Poll GET /v2/generations/{generation_id} with the returned generation_id
- /// until the workflow completes or fails. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostSkechersStyleEditAsync( - - global::Ideogram.SkechersStyleEditRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Edit a product image using an instruction and ordered references
- /// Edits the base image while preserving details the instruction does not
- /// change. Image 1 is the base; reference images are numbered from image 2
- /// in the supplied order. Resolve image mentions to these numbers before
- /// submitting. Descriptions identify the selected view or reference.
- /// Poll GET /v2/generations/{generation_id} with the returned generation_id
- /// until the workflow completes or fails. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostSkechersStyleEditAsResponseAsync( - - global::Ideogram.SkechersStyleEditRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Edit a product image using an instruction and ordered references
- /// Edits the base image while preserving details the instruction does not
- /// change. Image 1 is the base; reference images are numbered from image 2
- /// in the supplied order. Resolve image mentions to these numbers before
- /// submitting. Descriptions identify the selected view or reference.
- /// Poll GET /v2/generations/{generation_id} with the returned generation_id
- /// until the workflow completes or fails. - ///
- /// - /// Image to edit, used as image 1 and the output canvas. - /// - /// - /// Ordered reference images, numbered from image 2. - /// - /// - /// Edit instructions with known image mentions resolved to image numbers. - /// - /// - /// Optional description of the selected base image or named view. - /// - /// - /// One nonempty description per reference image, in the same order. - /// - /// - /// Output ratio. When omitted, derive the nearest supported ratio from the base. - /// - /// - /// Output resolution tier; corresponds to the app's low, medium, and high settings.
- /// Default Value: 2k - /// - /// - /// The quality tier for the edit. Higher tiers may improve detail and
- /// take longer to complete. - /// - /// - /// Number of edited images to create.
- /// Default Value: 1 - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostSkechersStyleEditAsync( - global::Ideogram.AssetIdentifier baseAssetIdentifier, - string resolvedInstruction, - global::System.Collections.Generic.IList? referenceAssetIdentifiers = default, - string? baseDescription = default, - global::System.Collections.Generic.IList? referenceDescriptions = default, - global::Ideogram.SkechersStyleEditRequestAspectRatio? aspectRatio = default, - global::Ideogram.SkechersStyleEditRequestBaseGenerationSize? baseGenerationSize = default, - global::Ideogram.SkechersStyleEditQuality? quality = default, - int? numImages = default, - bool? @private = default, - string? webhookUrl = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostSketchToRender.g.cs b/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostSketchToRender.g.cs deleted file mode 100644 index c2523daf..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostSketchToRender.g.cs +++ /dev/null @@ -1,115 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IEditWorkflowClient - { - /// - /// Sketch to Render
- /// Turns a fashion sketch into photorealistic garment or product imagery,
- /// preserving its silhouette, construction, colors, and design details.
- /// Upload the `sketch_image` using `multipart/form-data` and describe
- /// materials and rendering in `instruction`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
- /// supply a `webhook_url`. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostSketchToRenderAsync( - - global::Ideogram.SketchToRenderRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Sketch to Render
- /// Turns a fashion sketch into photorealistic garment or product imagery,
- /// preserving its silhouette, construction, colors, and design details.
- /// Upload the `sketch_image` using `multipart/form-data` and describe
- /// materials and rendering in `instruction`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
- /// supply a `webhook_url`. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostSketchToRenderAsResponseAsync( - - global::Ideogram.SketchToRenderRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Sketch to Render
- /// Turns a fashion sketch into photorealistic garment or product imagery,
- /// preserving its silhouette, construction, colors, and design details.
- /// Upload the `sketch_image` using `multipart/form-data` and describe
- /// materials and rendering in `instruction`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}` or
- /// supply a `webhook_url`. - ///
- /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The fashion sketch to render, up to 50 MB. JPEG, PNG, WEBP, HEIF,
- /// AVIF, GIF, BMP, TIFF, and MPO are supported. Multipart requests
- /// only. - /// - /// - /// The fashion sketch to render, up to 50 MB. JPEG, PNG, WEBP, HEIF,
- /// AVIF, GIF, BMP, TIFF, and MPO are supported. Multipart requests
- /// only. - /// - /// - /// Material and rendering direction, plus any construction or design
- /// details that are not legible in the sketch. - /// - /// - /// Aspect ratio of each output image. Defaults to `1:1` when omitted. - /// - /// - /// The quality tier for the edit. Higher tiers may improve detail and
- /// take longer to complete. - /// - /// - /// Optional seed for repeatable results. - /// - /// - /// Number of product renders to create.
- /// Default Value: 1 - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostSketchToRenderAsync( - string instruction, - global::Ideogram.AssetIdentifier? sketchAssetIdentifier = default, - byte[]? sketchImage = default, - string? sketchImagename = default, - string? aspectRatio = default, - global::Ideogram.SketchToRenderQuality? quality = default, - int? seed = default, - int? numImages = default, - bool? @private = default, - string? webhookUrl = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostSoleSwap.g.cs b/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostSoleSwap.g.cs deleted file mode 100644 index b7dfb099..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostSoleSwap.g.cs +++ /dev/null @@ -1,109 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IEditWorkflowClient - { - /// - /// Sole Swap
- /// Uses the sole-donor shoe as the output canvas, preserving its sole, camera,
- /// background, and lighting while transferring the upper from ordered references.
- /// The request is processed asynchronously. Poll
- /// `GET /v2/generations/{generation_id}` with the returned
- /// `generation_id` until the generation is completed or failed. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostSoleSwapAsync( - - global::Ideogram.SoleSwapRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Sole Swap
- /// Uses the sole-donor shoe as the output canvas, preserving its sole, camera,
- /// background, and lighting while transferring the upper from ordered references.
- /// The request is processed asynchronously. Poll
- /// `GET /v2/generations/{generation_id}` with the returned
- /// `generation_id` until the generation is completed or failed. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostSoleSwapAsResponseAsync( - - global::Ideogram.SoleSwapRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Sole Swap
- /// Uses the sole-donor shoe as the output canvas, preserving its sole, camera,
- /// background, and lighting while transferring the upper from ordered references.
- /// The request is processed asynchronously. Poll
- /// `GET /v2/generations/{generation_id}` with the returned
- /// `generation_id` until the generation is completed or failed. - ///
- /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// Ordered upper-donor references. Put the primary upper view first, then additional angles of the same upper to transfer. - /// - /// - /// Optional additional direction for the sole swap. - /// - /// - /// Output aspect ratio. When omitted, the closest supported ratio is derived from the sole-donor base image. - /// - /// - /// Output resolution tier. Defaults to 2k.
- /// Default Value: 2k - /// - /// - /// The quality tier for the edit. Higher tiers may improve detail and
- /// take longer to complete. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// Number of sole-swap images to create.
- /// Default Value: 1 - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostSoleSwapAsync( - global::Ideogram.AssetIdentifier baseAssetIdentifier, - global::System.Collections.Generic.IList upperAssetIdentifiers, - string? instruction = default, - string? aspectRatio = default, - global::Ideogram.SoleSwapRequestBaseGenerationSize? baseGenerationSize = default, - global::Ideogram.SoleSwapQuality? quality = default, - int? seed = default, - int? numImages = default, - bool? @private = default, - string? webhookUrl = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostSwanSLogoDesign.g.cs b/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostSwanSLogoDesign.g.cs deleted file mode 100644 index 0c465599..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostSwanSLogoDesign.g.cs +++ /dev/null @@ -1,95 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IEditWorkflowClient - { - /// - /// Design one Swan S logo candidate
- /// Creates one isolated logo candidate using either a shoe swatch or a supplied style reference. For 3D reference designs, choose split or full coverage with design_variant. Send a separate request for each candidate; each request completes and is billed independently. Processing is asynchronous. Poll GET /v2/generations/{generation_id} until completed or failed. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostSwanSLogoDesignAsync( - - global::Ideogram.SwanSLogoDesignRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Design one Swan S logo candidate
- /// Creates one isolated logo candidate using either a shoe swatch or a supplied style reference. For 3D reference designs, choose split or full coverage with design_variant. Send a separate request for each candidate; each request completes and is billed independently. Processing is asynchronous. Poll GET /v2/generations/{generation_id} until completed or failed. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostSwanSLogoDesignAsResponseAsync( - - global::Ideogram.SwanSLogoDesignRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Design one Swan S logo candidate
- /// Creates one isolated logo candidate using either a shoe swatch or a supplied style reference. For 3D reference designs, choose split or full coverage with design_variant. Send a separate request for each candidate; each request completes and is billed independently. Processing is asynchronous. Poll GET /v2/generations/{generation_id} until completed or failed. - ///
- /// - /// - /// Use a shoe color swatch or an uploaded logo reference as the style source. - /// - /// - /// Required for 3D user_reference designs. Omit for other designs. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The quality tier for the edit. Higher tiers may improve detail and
- /// take longer to complete. - /// - /// - /// When true or omitted, keep outputs private. Enterprise accounts always generate privately. - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostSwanSLogoDesignAsync( - global::Ideogram.SwanSLogoDesignRequestLogoStyle logoStyle, - global::Ideogram.SwanSLogoDesignRequestSourceMode sourceMode, - global::Ideogram.AssetIdentifier styleSourceAssetIdentifier, - global::Ideogram.SwanSLogoDesignRequestDesignVariant? designVariant = default, - global::Ideogram.AssetIdentifier? geometryHeroAssetIdentifier = default, - global::Ideogram.AssetIdentifier? logoSpecificationAssetIdentifier = default, - global::Ideogram.AssetIdentifier? flatSilhouetteAssetIdentifier = default, - global::Ideogram.SwanSLogoQuality? quality = default, - bool? @private = default, - string? webhookUrl = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostSwanSLogoInstall.g.cs b/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostSwanSLogoInstall.g.cs deleted file mode 100644 index de6538d7..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostSwanSLogoInstall.g.cs +++ /dev/null @@ -1,88 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IEditWorkflowClient - { - /// - /// Install a Swan S logo on a shoe
- /// Installs the selected logo onto the ordered shoe views, preserving the shoe and chosen camera framing. Processing is asynchronous. Poll GET /v2/generations/{generation_id} until completed or failed. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostSwanSLogoInstallAsync( - - global::Ideogram.SwanSLogoInstallRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Install a Swan S logo on a shoe
- /// Installs the selected logo onto the ordered shoe views, preserving the shoe and chosen camera framing. Processing is asynchronous. Poll GET /v2/generations/{generation_id} until completed or failed. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostSwanSLogoInstallAsResponseAsync( - - global::Ideogram.SwanSLogoInstallRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Install a Swan S logo on a shoe
- /// Installs the selected logo onto the ordered shoe views, preserving the shoe and chosen camera framing. Processing is asynchronous. Poll GET /v2/generations/{generation_id} until completed or failed. - ///
- /// - /// - /// Ordered shoe views, primary view first. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// - /// Number of images to create.
- /// Default Value: 4 - /// - /// - /// The quality tier for the edit. Higher tiers may improve detail and
- /// take longer to complete. - /// - /// - /// When true or omitted, keep outputs private. Enterprise accounts always generate privately. - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostSwanSLogoInstallAsync( - global::Ideogram.SwanSLogoInstallRequestLogoStyle logoStyle, - global::System.Collections.Generic.IList shoeAssetIdentifiers, - global::Ideogram.AssetIdentifier logoAssetIdentifier, - string aspectRatio, - global::Ideogram.AssetIdentifier? logoSpecificationAssetIdentifier = default, - int? numImages = default, - global::Ideogram.SwanSLogoQuality? quality = default, - bool? @private = default, - string? webhookUrl = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostSwapProduct.g.cs b/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostSwapProduct.g.cs deleted file mode 100644 index c1e71878..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostSwapProduct.g.cs +++ /dev/null @@ -1,95 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IEditWorkflowClient - { - /// - /// Swap Product
- /// Edits the footwear in a source advertisement using ordered product references.
- /// Poll `GET /v2/generations/{generation_id}` for status and image results. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostSwapProductAsync( - - global::Ideogram.SwapProductRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Swap Product
- /// Edits the footwear in a source advertisement using ordered product references.
- /// Poll `GET /v2/generations/{generation_id}` for status and image results. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostSwapProductAsResponseAsync( - - global::Ideogram.SwapProductRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Swap Product
- /// Edits the footwear in a source advertisement using ordered product references.
- /// Poll `GET /v2/generations/{generation_id}` for status and image results. - ///
- /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// Ordered footwear references, following the source advertisement. - /// - /// - /// Replace the footwear or match its colorway to the references. - /// - /// - /// Optional edits that take precedence over the default preservation guidance. - /// - /// - /// Output aspect ratio. Defaults to the closest supported ratio to the source. - /// - /// - /// Number of images to generate.
- /// Default Value: 1 - /// - /// - /// The quality tier for the edit. Higher tiers may improve detail and
- /// take longer to complete. - /// - /// - /// Results are private by default. Set false to request public results.
- /// Enterprise accounts always generate privately. - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostSwapProductAsync( - global::Ideogram.AssetIdentifier sourceAssetIdentifier, - global::System.Collections.Generic.IList productAssetIdentifiers, - global::Ideogram.SwapProductMode mode, - string? instruction = default, - string? aspectRatio = default, - int? numImages = default, - global::Ideogram.SwapProductQuality? quality = default, - bool? @private = default, - string? webhookUrl = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostTextLayerizer.g.cs b/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostTextLayerizer.g.cs deleted file mode 100644 index 9e76470d..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostTextLayerizer.g.cs +++ /dev/null @@ -1,114 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IEditWorkflowClient - { - /// - /// Text Layerizer
- /// Turns a flat image into an editable design asynchronously: detected text
- /// is returned as positioned text blocks with matched fonts, sizes, and
- /// colors, alongside a text-free base image and a standalone HTML page of
- /// the editable design. Returns a `generation_id`; poll
- /// `GET /v2/generations/{generation_id}` or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostTextLayerizerAsync( - - global::Ideogram.TextLayerizerRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Text Layerizer
- /// Turns a flat image into an editable design asynchronously: detected text
- /// is returned as positioned text blocks with matched fonts, sizes, and
- /// colors, alongside a text-free base image and a standalone HTML page of
- /// the editable design. Returns a `generation_id`; poll
- /// `GET /v2/generations/{generation_id}` or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostTextLayerizerAsResponseAsync( - - global::Ideogram.TextLayerizerRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Text Layerizer
- /// Turns a flat image into an editable design asynchronously: detected text
- /// is returned as positioned text blocks with matched fonts, sizes, and
- /// colors, alongside a text-free base image and a standalone HTML page of
- /// the editable design. Returns a `generation_id`; poll
- /// `GET /v2/generations/{generation_id}` or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// JPEG, PNG or WEBP source; at most 50 MB. Multipart only. - /// - /// - /// JPEG, PNG or WEBP source; at most 50 MB. Multipart only. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// A description of the image, used to guide text detection. When omitted, detection runs on the image alone. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// Candidate font files to make available for text style matching and to embed in the standalone HTML page. Supported formats .ttf, .otf, .woff, .woff2 (max 5 MB each, at most 5 files). Multipart only. You are responsible for holding the rights to embed and redistribute the fonts you upload. - /// - /// - /// Outputs are private by default. Enterprise outputs are always private. - /// - /// - /// URL-safe base64 ID of a writable destination collection. - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostTextLayerizerAsync( - bool? dryRun = default, - byte[]? image = default, - string? imagename = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - string? prompt = default, - int? seed = default, - global::System.Collections.Generic.IList? fontCandidateFiles = default, - bool? @private = default, - string? targetCollectionId = default, - string? webhookUrl = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostVectorizer.g.cs b/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostVectorizer.g.cs deleted file mode 100644 index e29ac6f0..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostVectorizer.g.cs +++ /dev/null @@ -1,99 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IEditWorkflowClient - { - /// - /// Vectorizer
- /// Converts an image to SVG asynchronously. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostVectorizerAsync( - - global::Ideogram.VectorizerRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Vectorizer
- /// Converts an image to SVG asynchronously. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostVectorizerAsResponseAsync( - - global::Ideogram.VectorizerRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Vectorizer
- /// Converts an image to SVG asynchronously. - ///
- /// - /// Default Value: false - /// - /// - /// JPEG, PNG or WEBP source; at most 50 MB. Multipart only. - /// - /// - /// JPEG, PNG or WEBP source; at most 50 MB. Multipart only. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// Default draws fewer, simpler shapes; detailed preserves more fine detail.
- /// Default Value: default - /// - /// - /// Request grouping of shapes into layers. Grouping is not yet available.
- /// Default Value: false - /// - /// - /// Outputs are private by default. Enterprise outputs are always private. - /// - /// - /// URL-safe base64 ID of a writable destination collection. - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostVectorizerAsync( - bool? dryRun = default, - byte[]? image = default, - string? imagename = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - global::Ideogram.VectorizerRequestMode? mode = default, - bool? group = default, - bool? @private = default, - string? targetCollectionId = default, - string? webhookUrl = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostVirtualTryOn.g.cs b/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostVirtualTryOn.g.cs deleted file mode 100644 index b398578e..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.PostVirtualTryOn.g.cs +++ /dev/null @@ -1,137 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IEditWorkflowClient - { - /// - /// Dress a person in one or more garments
- /// Generates a photorealistic image of the person in the supplied photo
- /// wearing the supplied garments, preserving their face, body, and
- /// background.
- /// The request is processed asynchronously. Poll
- /// `GET /v2/generations/{generation_id}` with the returned `generation_id`
- /// until the generation is completed or failed.
- /// Supply the person as either an `AssetIdentifier` reference
- /// (`person_asset_identifier`) or the raw image bytes directly
- /// (`person_image`, multipart requests only), and likewise the garments as
- /// either `garment_asset_identifiers` or `garment_images`. For each of the
- /// two sources, provide exactly one of the two forms; supplying both, or
- /// neither, is rejected with a 400. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostVirtualTryOnAsync( - - global::Ideogram.VirtualTryOnRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Dress a person in one or more garments
- /// Generates a photorealistic image of the person in the supplied photo
- /// wearing the supplied garments, preserving their face, body, and
- /// background.
- /// The request is processed asynchronously. Poll
- /// `GET /v2/generations/{generation_id}` with the returned `generation_id`
- /// until the generation is completed or failed.
- /// Supply the person as either an `AssetIdentifier` reference
- /// (`person_asset_identifier`) or the raw image bytes directly
- /// (`person_image`, multipart requests only), and likewise the garments as
- /// either `garment_asset_identifiers` or `garment_images`. For each of the
- /// two sources, provide exactly one of the two forms; supplying both, or
- /// neither, is rejected with a 400. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostVirtualTryOnAsResponseAsync( - - global::Ideogram.VirtualTryOnRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Dress a person in one or more garments
- /// Generates a photorealistic image of the person in the supplied photo
- /// wearing the supplied garments, preserving their face, body, and
- /// background.
- /// The request is processed asynchronously. Poll
- /// `GET /v2/generations/{generation_id}` with the returned `generation_id`
- /// until the generation is completed or failed.
- /// Supply the person as either an `AssetIdentifier` reference
- /// (`person_asset_identifier`) or the raw image bytes directly
- /// (`person_image`, multipart requests only), and likewise the garments as
- /// either `garment_asset_identifiers` or `garment_images`. For each of the
- /// two sources, provide exactly one of the two forms; supplying both, or
- /// neither, is rejected with a 400. - ///
- /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// Photo of the person to dress (max size 25MB), as raw bytes; only
- /// JPEG, PNG, and WEBP formats are supported. Multipart requests only.
- /// Provide exactly one of `person_asset_identifier` or `person_image`. - /// - /// - /// Photo of the person to dress (max size 25MB), as raw bytes; only
- /// JPEG, PNG, and WEBP formats are supported. Multipart requests only.
- /// Provide exactly one of `person_asset_identifier` or `person_image`. - /// - /// - /// Photos of the clothing items to put on the person, by reference.
- /// Multiple garments are layered into one coherent outfit. Provide
- /// exactly one of `garment_asset_identifiers` or `garment_images`. - /// - /// - /// Photos of the clothing items to put on the person (max 7, max size
- /// 25MB per image), as raw bytes; only JPEG, PNG, and WEBP formats are
- /// supported. Multipart requests only. Provide exactly one of
- /// `garment_asset_identifiers` or `garment_images`. - /// - /// - /// The aspect ratio of the generated image. Defaults to the aspect
- /// ratio of the person's photo when omitted. Supported values are
- /// `1:1`, `3:4`, `4:3`, `16:9`, and `9:16`. - /// - /// - /// Free-text art direction, for example which garments to name, how to
- /// pose the person, and what background to place them in. The person's
- /// identity and each garment's exact appearance are always preserved,
- /// whatever this says. When omitted, the person keeps the pose and
- /// background from their photo. - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostVirtualTryOnAsync( - global::Ideogram.AssetIdentifier? personAssetIdentifier = default, - byte[]? personImage = default, - string? personImagename = default, - global::System.Collections.Generic.IList? garmentAssetIdentifiers = default, - global::System.Collections.Generic.IList? garmentImages = default, - string? aspectRatio = default, - string? instruction = default, - bool? @private = default, - string? webhookUrl = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.g.cs b/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.g.cs index c53a369a..a4bbdbc4 100644 --- a/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.IEditWorkflowClient.g.cs @@ -4,7 +4,6 @@ namespace Ideogram { /// - /// Asynchronous image-editing workflows that return results through generation polling.
/// If no httpClient is provided, a new one will be created.
/// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. ///
diff --git a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.Authorizations.Bearer.g.cs b/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.Authorizations.Bearer.g.cs deleted file mode 100644 index f7017343..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.Authorizations.Bearer.g.cs +++ /dev/null @@ -1,16 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial interface IGenerateClient - { - /// - /// Authorize using bearer authentication. - /// - /// - - public void AuthorizeUsingBearer( - string apiKey); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.GetGeneration.g.cs b/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.GetGeneration.g.cs deleted file mode 100644 index 14918793..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.GetGeneration.g.cs +++ /dev/null @@ -1,32 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IGenerateClient - { - /// - /// Poll a generation
- /// Retrieves the current status of an asynchronous generation, and its results once complete. Use the `generation_id` returned by the async generation endpoint. While the generation is `pending` or has `failed`, the response contains only `generation_id`, `status`, and `created`. Once `status` is `completed`, the response includes `response_type` and `data`, and may include `usage_cost_usd_micros` when the request uses variable usage-based pricing. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task GetGenerationAsync( - string generationId, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Poll a generation
- /// Retrieves the current status of an asynchronous generation, and its results once complete. Use the `generation_id` returned by the async generation endpoint. While the generation is `pending` or has `failed`, the response contains only `generation_id`, `status`, and `created`. Once `status` is `completed`, the response includes `response_type` and `data`, and may include `usage_cost_usd_micros` when the request uses variable usage-based pricing. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> GetGenerationAsResponseAsync( - string generationId, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostEditImage.g.cs b/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostEditImage.g.cs deleted file mode 100644 index 83fc2fcf..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostEditImage.g.cs +++ /dev/null @@ -1,233 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IGenerateClient - { - /// - /// Edit (legacy)
- /// Edit a given image synchronously using the provided mask. The mask indicates which part of the image
- /// should be edited, while the prompt and chosen style type can further guide the edit.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostEditImageAsync( - - global::Ideogram.EditImageRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Edit (legacy)
- /// Edit a given image synchronously using the provided mask. The mask indicates which part of the image
- /// should be edited, while the prompt and chosen style type can further guide the edit.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostEditImageAsResponseAsync( - - global::Ideogram.EditImageRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Edit (legacy)
- /// Edit a given image synchronously using the provided mask. The mask indicates which part of the image
- /// should be edited, while the prompt and chosen style type can further guide the edit.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// A black and white image of the same size as the image being edited (max size 25MB). Black regions in the mask should match up with the regions of the image that you would like to edit; only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// A black and white image of the same size as the image being edited (max size 25MB). Black regions in the mask should match up with the regions of the image that you would like to edit; only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The prompt used to describe the edited result.
- /// Example: A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there is an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset. - /// - /// - /// The model used to generate an image or edit one. /generate and /remix supports all model types, however, /edit is only supported for V_2 and V_2_TURBO.
- /// Default Value: V_2
- /// Example: V_2_TURBO - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The style type to generate with; this is only applicable for models V_2 and above and should not be specified for model versions V_1.
- /// Example: REALISTIC - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostEditImageAsync( - byte[] imageFile, - string imageFilename, - byte[] mask, - string maskname, - string prompt, - global::Ideogram.ModelEnum model = global::Ideogram.ModelEnum.V2, - global::Ideogram.MagicPromptOption? magicPromptOption = default, - string? magicPromptSystemPromptConfigId = default, - int? numImages = default, - int? seed = default, - global::Ideogram.StyleType? styleType = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - - /// - /// Edit (legacy)
- /// Edit a given image synchronously using the provided mask. The mask indicates which part of the image
- /// should be edited, while the prompt and chosen style type can further guide the edit.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// A black and white image of the same size as the image being edited (max size 25MB). Black regions in the mask should match up with the regions of the image that you would like to edit; only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// A black and white image of the same size as the image being edited (max size 25MB). Black regions in the mask should match up with the regions of the image that you would like to edit; only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The prompt used to describe the edited result.
- /// Example: A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there is an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset. - /// - /// - /// The model used to generate an image or edit one. /generate and /remix supports all model types, however, /edit is only supported for V_2 and V_2_TURBO.
- /// Default Value: V_2
- /// Example: V_2_TURBO - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The style type to generate with; this is only applicable for models V_2 and above and should not be specified for model versions V_1.
- /// Example: REALISTIC - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostEditImageAsync( - global::System.IO.Stream imageFile, - string imageFilename, - global::System.IO.Stream mask, - string maskname, - string prompt, - global::Ideogram.ModelEnum model = global::Ideogram.ModelEnum.V2, - global::Ideogram.MagicPromptOption? magicPromptOption = default, - string? magicPromptSystemPromptConfigId = default, - int? numImages = default, - int? seed = default, - global::Ideogram.StyleType? styleType = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Edit (legacy)
- /// Edit a given image synchronously using the provided mask. The mask indicates which part of the image
- /// should be edited, while the prompt and chosen style type can further guide the edit.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// A black and white image of the same size as the image being edited (max size 25MB). Black regions in the mask should match up with the regions of the image that you would like to edit; only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// A black and white image of the same size as the image being edited (max size 25MB). Black regions in the mask should match up with the regions of the image that you would like to edit; only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The prompt used to describe the edited result.
- /// Example: A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there is an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset. - /// - /// - /// The model used to generate an image or edit one. /generate and /remix supports all model types, however, /edit is only supported for V_2 and V_2_TURBO.
- /// Default Value: V_2
- /// Example: V_2_TURBO - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The style type to generate with; this is only applicable for models V_2 and above and should not be specified for model versions V_1.
- /// Example: REALISTIC - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostEditImageAsResponseAsync( - global::System.IO.Stream imageFile, - string imageFilename, - global::System.IO.Stream mask, - string maskname, - string prompt, - global::Ideogram.ModelEnum model = global::Ideogram.ModelEnum.V2, - global::Ideogram.MagicPromptOption? magicPromptOption = default, - string? magicPromptSystemPromptConfigId = default, - int? numImages = default, - int? seed = default, - global::Ideogram.StyleType? styleType = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateDesignV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateDesignV3.g.cs deleted file mode 100644 index 215a5821..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateDesignV3.g.cs +++ /dev/null @@ -1,177 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IGenerateClient - { - /// - /// Generate a design from a text prompt with text detection and correction
- /// Generates a design synchronously from a text prompt using the Ideogram 3.0 model, then detects and corrects text layers within the generated image.
- /// The response includes the generated image URL along with detected text layers (with font, size, color, position) and image asset layers.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateDesignV3Async( - - global::Ideogram.GenerateDesignRequestV3 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate a design from a text prompt with text detection and correction
- /// Generates a design synchronously from a text prompt using the Ideogram 3.0 model, then detects and corrects text layers within the generated image.
- /// The response includes the generated image URL along with detected text layers (with font, size, color, position) and image asset layers.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostGenerateDesignV3AsResponseAsync( - - global::Ideogram.GenerateDesignRequestV3 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate a design from a text prompt with text detection and correction
- /// Generates a design synchronously from a text prompt using the Ideogram 3.0 model, then detects and corrects text layers within the generated image.
- /// The response includes the generated image URL along with detected text layers (with font, size, color, position) and image asset layers.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The prompt to use to generate the design.
- /// Example: A birthday card saying 'Happy Birthday' - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The resolutions supported for Ideogram 3.0.
- /// Example: 1280x800 - /// - /// - /// Output aspect ratio. Cannot be combined with resolution. Generation defaults to 1x1; remix keeps the source ratio when both fields are omitted. - /// - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// Description of what to exclude from a design. Descriptions in the prompt take precedence
- /// to descriptions in the negative prompt.
- /// Example: brush strokes, painting - /// - /// - /// Number of designs to generate.
- /// Default Value: 1 - /// - /// - /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). Not supported by V_1, V_1_TURBO, V_2A and V_2A_TURBO models. - /// - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - /// - /// - /// The style type to generate with.
- /// Default Value: GENERAL
- /// Example: GENERAL - /// - /// - /// A predefined style preset that applies a specific artistic style to the generated image.
- /// Example: BRIGHT_ART - /// - /// - /// A custom model URI in the format model/<model_name>/version/<version_name>.
- /// When provided, the model version and style will be resolved from this URI, and style_type is not required.
- /// Example: model/my-custom-model/version/1 - /// - /// - /// Custom font file for H1 (heading) text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_h1. - /// - /// - /// Custom font file for H1 (heading) text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_h1. - /// - /// - /// Font name from the available font library for H1 text. Ignored if font_file_h1 is provided.
- /// Example: Ubuntu-Bold.ttf - /// - /// - /// Custom font file for H2 (subheading) text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_h2. - /// - /// - /// Custom font file for H2 (subheading) text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_h2. - /// - /// - /// Font name from the available font library for H2 text. Ignored if font_file_h2 is provided. - /// - /// - /// Custom font file for body text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_body. - /// - /// - /// Custom font file for body text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_body. - /// - /// - /// Font name from the available font library for body text. Ignored if font_file_body is provided. - /// - /// - /// Custom font file for small/caption text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_small. - /// - /// - /// Custom font file for small/caption text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_small. - /// - /// - /// Font name from the available font library for small text. Ignored if font_file_small is provided. - /// - /// - /// A set of images to use as style references (max size 25MB per image; the whole request must stay under 50MB). The images should be in JPEG, PNG or WebP format. - /// - /// - /// A set of asset images (e.g., logos, icons) to use as references for detection and replacement (maximum 10 images). The images should be in JPEG, PNG or WebP format. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateDesignV3Async( - string prompt, - int? seed = default, - global::Ideogram.ResolutionV3? resolution = default, - global::Ideogram.AspectRatioV3? aspectRatio = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - global::Ideogram.MagicPromptOption? magicPrompt = default, - string? magicPromptSystemPromptConfigId = default, - string? negativePrompt = default, - int? numImages = default, - global::Ideogram.ColorPaletteWithPresetNameOrMembers? colorPalette = default, - global::System.Collections.Generic.IList? styleCodes = default, - global::Ideogram.StyleTypeV3? styleType = default, - global::Ideogram.StylePresetV3? stylePreset = default, - string? customModelUri = default, - byte[]? fontFileH1 = default, - string? fontFileH1name = default, - string? fontNameH1 = default, - byte[]? fontFileH2 = default, - string? fontFileH2name = default, - string? fontNameH2 = default, - byte[]? fontFileBody = default, - string? fontFileBodyname = default, - string? fontNameBody = default, - byte[]? fontFileSmall = default, - string? fontFileSmallname = default, - string? fontNameSmall = default, - global::System.Collections.Generic.IList? styleReferenceImages = default, - global::System.Collections.Generic.IList? referenceAssetImages = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateDesignV4.g.cs b/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateDesignV4.g.cs deleted file mode 100644 index c57b0621..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateDesignV4.g.cs +++ /dev/null @@ -1,105 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IGenerateClient - { - /// - /// Generate an editable design with Ideogram 4.0 HTML
- /// Experimental prototype endpoint for generating an editable V4 HTML design from a prompt.
- /// Optionally accepts inspiration reference images to guide transferable visual style. Inspiration images are design/style references only and are not edit targets.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateDesignV4Async( - - global::Ideogram.GenerateDesignRequestV4 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate an editable design with Ideogram 4.0 HTML
- /// Experimental prototype endpoint for generating an editable V4 HTML design from a prompt.
- /// Optionally accepts inspiration reference images to guide transferable visual style. Inspiration images are design/style references only and are not edit targets.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostGenerateDesignV4AsResponseAsync( - - global::Ideogram.GenerateDesignRequestV4 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate an editable design with Ideogram 4.0 HTML
- /// Experimental prototype endpoint for generating an editable V4 HTML design from a prompt.
- /// Optionally accepts inspiration reference images to guide transferable visual style. Inspiration images are design/style references only and are not edit targets.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The text prompt for editable design generation. - /// - /// - /// Random seed for reproducibility. - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// The resolutions supported for Ideogram 4.0 layout-to-image and design generation.
- /// Example: 1024x1024 - /// - /// - /// The rendering speed to use. For Ideogram V4, `rendering_speed=FLASH`
- /// is coming soon; requests with `rendering_speed=FLASH` currently
- /// return a 400. - /// - /// - /// Experimental. Up to 4 static inspiration images used as transferable visual style references for V4 layout-to-image design. Images are not edit targets and are not inserted into the generated HTML layout. Supported formats are JPEG, PNG, and WebP (max size 25MB each). Animated images are not supported. - /// - /// - /// Experimental. Model to use for the inspiration vision prepass.
- /// Default Value: claude-sonnet-4-6 - /// - /// - /// Experimental. Model to use for the HTML/layout and base-plate handoff generation call.
- /// Default Value: claude-sonnet-4-6 - /// - /// - /// Experimental. Staging only. Select a v4 layout-to-image pipeline variant.
- /// Omit for the default v4l2i path. Rejected on production. - /// - /// - /// layered (default): full editable design payload with text layers and HTML.
- /// url: JSON with an expiring link to the final composited cover image.
- /// binary: raw PNG bytes of the final composited cover image (Content-Type image/png).
- /// html: raw HTML document of the generated layout (Content-Type text/html).
- /// Default Value: layered - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateDesignV4Async( - string prompt, - int? seed = default, - global::Ideogram.MagicPromptOption? magicPromptOption = default, - string? magicPromptSystemPromptConfigId = default, - global::Ideogram.ResolutionV4Layout? resolution = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - global::System.Collections.Generic.IList? inspirationReferenceImages = default, - global::Ideogram.GenerateDesignRequestV4InspirationReferenceModel? inspirationReferenceModel = default, - global::Ideogram.GenerateDesignRequestV4ArtifactGenerationModel? artifactGenerationModel = default, - global::Ideogram.GenerateDesignRequestV4Layout2imageVariant? layout2imageVariant = default, - global::Ideogram.GenerateDesignRequestV4ResponseType? responseType = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateDesignV4AsBytes.g.cs b/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateDesignV4AsBytes.g.cs deleted file mode 100644 index ba54e3d1..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateDesignV4AsBytes.g.cs +++ /dev/null @@ -1,120 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IGenerateClient - { - /// - /// Generate an editable design with Ideogram 4.0 HTML
- /// Experimental prototype endpoint for generating an editable V4 HTML design from a prompt.
- /// Optionally accepts inspiration reference images to guide transferable visual style. Inspiration images are design/style references only and are not edit targets.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateDesignV4AsBytesAsync( - - global::Ideogram.GenerateDesignRequestV4 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate an editable design with Ideogram 4.0 HTML
- /// Experimental prototype endpoint for generating an editable V4 HTML design from a prompt.
- /// Optionally accepts inspiration reference images to guide transferable visual style. Inspiration images are design/style references only and are not edit targets.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateDesignV4AsBytesAsStreamAsync( - - global::Ideogram.GenerateDesignRequestV4 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate an editable design with Ideogram 4.0 HTML
- /// Experimental prototype endpoint for generating an editable V4 HTML design from a prompt.
- /// Optionally accepts inspiration reference images to guide transferable visual style. Inspiration images are design/style references only and are not edit targets.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostGenerateDesignV4AsBytesAsResponseAsync( - - global::Ideogram.GenerateDesignRequestV4 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate an editable design with Ideogram 4.0 HTML
- /// Experimental prototype endpoint for generating an editable V4 HTML design from a prompt.
- /// Optionally accepts inspiration reference images to guide transferable visual style. Inspiration images are design/style references only and are not edit targets.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The text prompt for editable design generation. - /// - /// - /// Random seed for reproducibility. - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// The resolutions supported for Ideogram 4.0 layout-to-image and design generation.
- /// Example: 1024x1024 - /// - /// - /// The rendering speed to use. For Ideogram V4, `rendering_speed=FLASH`
- /// is coming soon; requests with `rendering_speed=FLASH` currently
- /// return a 400. - /// - /// - /// Experimental. Up to 4 static inspiration images used as transferable visual style references for V4 layout-to-image design. Images are not edit targets and are not inserted into the generated HTML layout. Supported formats are JPEG, PNG, and WebP (max size 25MB each). Animated images are not supported. - /// - /// - /// Experimental. Model to use for the inspiration vision prepass.
- /// Default Value: claude-sonnet-4-6 - /// - /// - /// Experimental. Model to use for the HTML/layout and base-plate handoff generation call.
- /// Default Value: claude-sonnet-4-6 - /// - /// - /// Experimental. Staging only. Select a v4 layout-to-image pipeline variant.
- /// Omit for the default v4l2i path. Rejected on production. - /// - /// - /// layered (default): full editable design payload with text layers and HTML.
- /// url: JSON with an expiring link to the final composited cover image.
- /// binary: raw PNG bytes of the final composited cover image (Content-Type image/png).
- /// html: raw HTML document of the generated layout (Content-Type text/html).
- /// Default Value: layered - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateDesignV4AsBytesAsync( - string prompt, - int? seed = default, - global::Ideogram.MagicPromptOption? magicPromptOption = default, - string? magicPromptSystemPromptConfigId = default, - global::Ideogram.ResolutionV4Layout? resolution = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - global::System.Collections.Generic.IList? inspirationReferenceImages = default, - global::Ideogram.GenerateDesignRequestV4InspirationReferenceModel? inspirationReferenceModel = default, - global::Ideogram.GenerateDesignRequestV4ArtifactGenerationModel? artifactGenerationModel = default, - global::Ideogram.GenerateDesignRequestV4Layout2imageVariant? layout2imageVariant = default, - global::Ideogram.GenerateDesignRequestV4ResponseType? responseType = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateDesignV4AsText.g.cs b/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateDesignV4AsText.g.cs deleted file mode 100644 index 8b8bfde8..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateDesignV4AsText.g.cs +++ /dev/null @@ -1,105 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IGenerateClient - { - /// - /// Generate an editable design with Ideogram 4.0 HTML
- /// Experimental prototype endpoint for generating an editable V4 HTML design from a prompt.
- /// Optionally accepts inspiration reference images to guide transferable visual style. Inspiration images are design/style references only and are not edit targets.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateDesignV4AsTextAsync( - - global::Ideogram.GenerateDesignRequestV4 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate an editable design with Ideogram 4.0 HTML
- /// Experimental prototype endpoint for generating an editable V4 HTML design from a prompt.
- /// Optionally accepts inspiration reference images to guide transferable visual style. Inspiration images are design/style references only and are not edit targets.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostGenerateDesignV4AsTextAsResponseAsync( - - global::Ideogram.GenerateDesignRequestV4 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate an editable design with Ideogram 4.0 HTML
- /// Experimental prototype endpoint for generating an editable V4 HTML design from a prompt.
- /// Optionally accepts inspiration reference images to guide transferable visual style. Inspiration images are design/style references only and are not edit targets.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The text prompt for editable design generation. - /// - /// - /// Random seed for reproducibility. - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// The resolutions supported for Ideogram 4.0 layout-to-image and design generation.
- /// Example: 1024x1024 - /// - /// - /// The rendering speed to use. For Ideogram V4, `rendering_speed=FLASH`
- /// is coming soon; requests with `rendering_speed=FLASH` currently
- /// return a 400. - /// - /// - /// Experimental. Up to 4 static inspiration images used as transferable visual style references for V4 layout-to-image design. Images are not edit targets and are not inserted into the generated HTML layout. Supported formats are JPEG, PNG, and WebP (max size 25MB each). Animated images are not supported. - /// - /// - /// Experimental. Model to use for the inspiration vision prepass.
- /// Default Value: claude-sonnet-4-6 - /// - /// - /// Experimental. Model to use for the HTML/layout and base-plate handoff generation call.
- /// Default Value: claude-sonnet-4-6 - /// - /// - /// Experimental. Staging only. Select a v4 layout-to-image pipeline variant.
- /// Omit for the default v4l2i path. Rejected on production. - /// - /// - /// layered (default): full editable design payload with text layers and HTML.
- /// url: JSON with an expiring link to the final composited cover image.
- /// binary: raw PNG bytes of the final composited cover image (Content-Type image/png).
- /// html: raw HTML document of the generated layout (Content-Type text/html).
- /// Default Value: layered - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateDesignV4AsTextAsync( - string prompt, - int? seed = default, - global::Ideogram.MagicPromptOption? magicPromptOption = default, - string? magicPromptSystemPromptConfigId = default, - global::Ideogram.ResolutionV4Layout? resolution = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - global::System.Collections.Generic.IList? inspirationReferenceImages = default, - global::Ideogram.GenerateDesignRequestV4InspirationReferenceModel? inspirationReferenceModel = default, - global::Ideogram.GenerateDesignRequestV4ArtifactGenerationModel? artifactGenerationModel = default, - global::Ideogram.GenerateDesignRequestV4Layout2imageVariant? layout2imageVariant = default, - global::Ideogram.GenerateDesignRequestV4ResponseType? responseType = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateDesignV4Async.g.cs b/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateDesignV4Async.g.cs deleted file mode 100644 index 026a63f1..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateDesignV4Async.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IGenerateClient - { - /// - /// Generate an editable V4 HTML design asynchronously via webhook
- /// Accepts an Ideogram 4.0 HTML design request for asynchronous processing and
- /// returns immediately with a request_id. The generated design is POSTed to the
- /// supplied `webhook_url` once ready. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateDesignV4AsyncAsync( - string webhookUrl, - - global::Ideogram.GenerateDesignRequestV4 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate an editable V4 HTML design asynchronously via webhook
- /// Accepts an Ideogram 4.0 HTML design request for asynchronous processing and
- /// returns immediately with a request_id. The generated design is POSTed to the
- /// supplied `webhook_url` once ready. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostGenerateDesignV4AsyncAsResponseAsync( - string webhookUrl, - - global::Ideogram.GenerateDesignRequestV4 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate an editable V4 HTML design asynchronously via webhook
- /// Accepts an Ideogram 4.0 HTML design request for asynchronous processing and
- /// returns immediately with a request_id. The generated design is POSTed to the
- /// supplied `webhook_url` once ready. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// The text prompt for editable design generation. - /// - /// - /// Random seed for reproducibility. - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// The resolutions supported for Ideogram 4.0 layout-to-image and design generation.
- /// Example: 1024x1024 - /// - /// - /// The rendering speed to use. For Ideogram V4, `rendering_speed=FLASH`
- /// is coming soon; requests with `rendering_speed=FLASH` currently
- /// return a 400. - /// - /// - /// Experimental. Up to 4 static inspiration images used as transferable visual style references for V4 layout-to-image design. Images are not edit targets and are not inserted into the generated HTML layout. Supported formats are JPEG, PNG, and WebP (max size 25MB each). Animated images are not supported. - /// - /// - /// Experimental. Model to use for the inspiration vision prepass.
- /// Default Value: claude-sonnet-4-6 - /// - /// - /// Experimental. Model to use for the HTML/layout and base-plate handoff generation call.
- /// Default Value: claude-sonnet-4-6 - /// - /// - /// Experimental. Staging only. Select a v4 layout-to-image pipeline variant.
- /// Omit for the default v4l2i path. Rejected on production. - /// - /// - /// layered (default): full editable design payload with text layers and HTML.
- /// url: JSON with an expiring link to the final composited cover image.
- /// binary: raw PNG bytes of the final composited cover image (Content-Type image/png).
- /// html: raw HTML document of the generated layout (Content-Type text/html).
- /// Default Value: layered - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateDesignV4AsyncAsync( - string webhookUrl, - string prompt, - int? seed = default, - global::Ideogram.MagicPromptOption? magicPromptOption = default, - string? magicPromptSystemPromptConfigId = default, - global::Ideogram.ResolutionV4Layout? resolution = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - global::System.Collections.Generic.IList? inspirationReferenceImages = default, - global::Ideogram.GenerateDesignRequestV4InspirationReferenceModel? inspirationReferenceModel = default, - global::Ideogram.GenerateDesignRequestV4ArtifactGenerationModel? artifactGenerationModel = default, - global::Ideogram.GenerateDesignRequestV4Layout2imageVariant? layout2imageVariant = default, - global::Ideogram.GenerateDesignRequestV4ResponseType? responseType = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImage.g.cs b/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImage.g.cs deleted file mode 100644 index e5c59b19..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImage.g.cs +++ /dev/null @@ -1,51 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IGenerateClient - { - /// - /// Generate (legacy)
- /// Generates images synchronously based on a given prompt and optional parameters.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageAsync( - - global::Ideogram.GenerateImageRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate (legacy)
- /// Generates images synchronously based on a given prompt and optional parameters.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostGenerateImageAsResponseAsync( - - global::Ideogram.GenerateImageRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate (legacy)
- /// Generates images synchronously based on a given prompt and optional parameters.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Example: {"aspect_ratio":"ASPECT_10_16","magic_prompt_option":"AUTO","model":"V_2","prompt":"A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there is an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset."} - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageAsync( - global::Ideogram.ImageRequest imageRequest, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageErnie.g.cs b/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageErnie.g.cs deleted file mode 100644 index 62dbcb35..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageErnie.g.cs +++ /dev/null @@ -1,102 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IGenerateClient - { - /// - /// Generate with ERNIE-Image-Turbo
- /// Generates images synchronously using the ERNIE-Image-Turbo model. Width
- /// and height must each be a positive multiple of 16 and the total area
- /// must not exceed 1,075,200 pixels (896×1200); the server validates these
- /// against the model's resolution constraints.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageErnieAsync( - - global::Ideogram.GenerateImageRequestErnie request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with ERNIE-Image-Turbo
- /// Generates images synchronously using the ERNIE-Image-Turbo model. Width
- /// and height must each be a positive multiple of 16 and the total area
- /// must not exceed 1,075,200 pixels (896×1200); the server validates these
- /// against the model's resolution constraints.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostGenerateImageErnieAsResponseAsync( - - global::Ideogram.GenerateImageRequestErnie request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with ERNIE-Image-Turbo
- /// Generates images synchronously using the ERNIE-Image-Turbo model. Width
- /// and height must each be a positive multiple of 16 and the total area
- /// must not exceed 1,075,200 pixels (896×1200); the server validates these
- /// against the model's resolution constraints.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// A natural-language prompt for image generation.
- /// Example: A poster with bold typography reading "GRAND OPENING", art deco style. - /// - /// - /// An optional system prompt applied alongside the prompt — use it for
- /// standing instructions such as style constraints or "do not render
- /// text". When omitted, no system prompt is applied. If you trained a
- /// LoRA with a system prompt, supply the same one here for best results.
- /// Example: Do not include any text in the image. - /// - /// - /// Output width in pixels; must be a positive multiple of 16.
- /// Example: 1024 - /// - /// - /// Output height in pixels; must be a positive multiple of 16.
- /// Example: 1024 - /// - /// - /// Optional diffusion step count. When omitted, the server uses the
- /// model's default. Higher values trade latency for quality.
- /// Example: 8 - /// - /// - /// Random seed for reproducibility. - /// - /// - /// Number of images to generate.
- /// Default Value: 1 - /// - /// - /// A custom model URI in the format model/<model_name>/version/<version_name>.
- /// When provided, the URI must resolve to a registered fine-tune of the
- /// ERNIE base model; the fine-tune's LoRA checkpoint is layered on the
- /// base. When omitted, the ERNIE base is used with no LoRA.
- /// Example: model/my-ernie-lora/version/0 - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageErnieAsync( - string prompt, - string? systemPrompt = default, - int? width = default, - int? height = default, - int? numInferenceSteps = default, - int? seed = default, - int? numImages = default, - string? customModelUri = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageErnieAsync.g.cs b/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageErnieAsync.g.cs deleted file mode 100644 index 4d529a16..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageErnieAsync.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IGenerateClient - { - /// - /// Generate with ERNIE-Image-Turbo asynchronously via webhook
- /// Accepts an ERNIE-Image-Turbo generation request for asynchronous
- /// processing and returns immediately with a generation_id. The generated
- /// images are POSTed to the supplied `webhook_url` once ready, in a payload
- /// that mirrors the synchronous response with an added generation_id for
- /// correlation.
- /// See [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageErnieAsyncAsync( - string webhookUrl, - - global::Ideogram.GenerateImageRequestErnie request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with ERNIE-Image-Turbo asynchronously via webhook
- /// Accepts an ERNIE-Image-Turbo generation request for asynchronous
- /// processing and returns immediately with a generation_id. The generated
- /// images are POSTed to the supplied `webhook_url` once ready, in a payload
- /// that mirrors the synchronous response with an added generation_id for
- /// correlation.
- /// See [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostGenerateImageErnieAsyncAsResponseAsync( - string webhookUrl, - - global::Ideogram.GenerateImageRequestErnie request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with ERNIE-Image-Turbo asynchronously via webhook
- /// Accepts an ERNIE-Image-Turbo generation request for asynchronous
- /// processing and returns immediately with a generation_id. The generated
- /// images are POSTed to the supplied `webhook_url` once ready, in a payload
- /// that mirrors the synchronous response with an added generation_id for
- /// correlation.
- /// See [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// A natural-language prompt for image generation.
- /// Example: A poster with bold typography reading "GRAND OPENING", art deco style. - /// - /// - /// An optional system prompt applied alongside the prompt — use it for
- /// standing instructions such as style constraints or "do not render
- /// text". When omitted, no system prompt is applied. If you trained a
- /// LoRA with a system prompt, supply the same one here for best results.
- /// Example: Do not include any text in the image. - /// - /// - /// Output width in pixels; must be a positive multiple of 16.
- /// Example: 1024 - /// - /// - /// Output height in pixels; must be a positive multiple of 16.
- /// Example: 1024 - /// - /// - /// Optional diffusion step count. When omitted, the server uses the
- /// model's default. Higher values trade latency for quality.
- /// Example: 8 - /// - /// - /// Random seed for reproducibility. - /// - /// - /// Number of images to generate.
- /// Default Value: 1 - /// - /// - /// A custom model URI in the format model/<model_name>/version/<version_name>.
- /// When provided, the URI must resolve to a registered fine-tune of the
- /// ERNIE base model; the fine-tune's LoRA checkpoint is layered on the
- /// base. When omitted, the ERNIE base is used with no LoRA.
- /// Example: model/my-ernie-lora/version/0 - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageErnieAsyncAsync( - string webhookUrl, - string prompt, - string? systemPrompt = default, - int? width = default, - int? height = default, - int? numInferenceSteps = default, - int? seed = default, - int? numImages = default, - string? customModelUri = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageFlux2Klein.g.cs b/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageFlux2Klein.g.cs deleted file mode 100644 index 01dfa015..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageFlux2Klein.g.cs +++ /dev/null @@ -1,102 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IGenerateClient - { - /// - /// Generate with FLUX.2-Klein
- /// Generates images synchronously using the FLUX.2-Klein model. Width and
- /// height must each be a positive multiple of 16 and the total area must
- /// not exceed 1,048,576 pixels (1024×1024); the server validates these
- /// against the model's resolution constraints.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageFlux2KleinAsync( - - global::Ideogram.GenerateImageRequestFlux2Klein request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with FLUX.2-Klein
- /// Generates images synchronously using the FLUX.2-Klein model. Width and
- /// height must each be a positive multiple of 16 and the total area must
- /// not exceed 1,048,576 pixels (1024×1024); the server validates these
- /// against the model's resolution constraints.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostGenerateImageFlux2KleinAsResponseAsync( - - global::Ideogram.GenerateImageRequestFlux2Klein request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with FLUX.2-Klein
- /// Generates images synchronously using the FLUX.2-Klein model. Width and
- /// height must each be a positive multiple of 16 and the total area must
- /// not exceed 1,048,576 pixels (1024×1024); the server validates these
- /// against the model's resolution constraints.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// A natural-language prompt for image generation.
- /// Example: A photo of a tabby cat sleeping on a couch, soft daylight. - /// - /// - /// An optional system prompt applied alongside the prompt — use it for
- /// standing instructions such as style constraints or "do not render
- /// text". When omitted, no system prompt is applied. If you trained a
- /// LoRA with a system prompt, supply the same one here for best results.
- /// Example: Do not include any text in the image. - /// - /// - /// Output width in pixels; must be a positive multiple of 16.
- /// Example: 1024 - /// - /// - /// Output height in pixels; must be a positive multiple of 16.
- /// Example: 1024 - /// - /// - /// Optional diffusion step count. When omitted, the server uses the
- /// model's default. Higher values trade latency for quality.
- /// Example: 4 - /// - /// - /// Random seed for reproducibility. - /// - /// - /// Number of images to generate.
- /// Default Value: 1 - /// - /// - /// A custom model URI in the format model/<model_name>/version/<version_name>.
- /// When provided, the URI must resolve to a registered fine-tune of the
- /// FLUX.2-Klein base model; the fine-tune's LoRA checkpoint is layered
- /// on the base. When omitted, the FLUX.2-Klein base is used with no LoRA.
- /// Example: model/my-flux-klein-lora/version/0 - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageFlux2KleinAsync( - string prompt, - string? systemPrompt = default, - int? width = default, - int? height = default, - int? numInferenceSteps = default, - int? seed = default, - int? numImages = default, - string? customModelUri = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageFlux2KleinAsync.g.cs b/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageFlux2KleinAsync.g.cs deleted file mode 100644 index 413b1fa2..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageFlux2KleinAsync.g.cs +++ /dev/null @@ -1,138 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IGenerateClient - { - /// - /// Generate with FLUX.2-Klein asynchronously via webhook
- /// Accepts a FLUX.2-Klein generation request for asynchronous processing and
- /// returns immediately with a generation_id. The generated images are POSTed to
- /// the supplied `webhook_url` once ready, in a payload that mirrors the
- /// synchronous response with an added generation_id for correlation.
- /// See [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageFlux2KleinAsyncAsync( - string webhookUrl, - - global::Ideogram.GenerateImageRequestFlux2Klein request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with FLUX.2-Klein asynchronously via webhook
- /// Accepts a FLUX.2-Klein generation request for asynchronous processing and
- /// returns immediately with a generation_id. The generated images are POSTed to
- /// the supplied `webhook_url` once ready, in a payload that mirrors the
- /// synchronous response with an added generation_id for correlation.
- /// See [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostGenerateImageFlux2KleinAsyncAsResponseAsync( - string webhookUrl, - - global::Ideogram.GenerateImageRequestFlux2Klein request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with FLUX.2-Klein asynchronously via webhook
- /// Accepts a FLUX.2-Klein generation request for asynchronous processing and
- /// returns immediately with a generation_id. The generated images are POSTed to
- /// the supplied `webhook_url` once ready, in a payload that mirrors the
- /// synchronous response with an added generation_id for correlation.
- /// See [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// A natural-language prompt for image generation.
- /// Example: A photo of a tabby cat sleeping on a couch, soft daylight. - /// - /// - /// An optional system prompt applied alongside the prompt — use it for
- /// standing instructions such as style constraints or "do not render
- /// text". When omitted, no system prompt is applied. If you trained a
- /// LoRA with a system prompt, supply the same one here for best results.
- /// Example: Do not include any text in the image. - /// - /// - /// Output width in pixels; must be a positive multiple of 16.
- /// Example: 1024 - /// - /// - /// Output height in pixels; must be a positive multiple of 16.
- /// Example: 1024 - /// - /// - /// Optional diffusion step count. When omitted, the server uses the
- /// model's default. Higher values trade latency for quality.
- /// Example: 4 - /// - /// - /// Random seed for reproducibility. - /// - /// - /// Number of images to generate.
- /// Default Value: 1 - /// - /// - /// A custom model URI in the format model/<model_name>/version/<version_name>.
- /// When provided, the URI must resolve to a registered fine-tune of the
- /// FLUX.2-Klein base model; the fine-tune's LoRA checkpoint is layered
- /// on the base. When omitted, the FLUX.2-Klein base is used with no LoRA.
- /// Example: model/my-flux-klein-lora/version/0 - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageFlux2KleinAsyncAsync( - string webhookUrl, - string prompt, - string? systemPrompt = default, - int? width = default, - int? height = default, - int? numInferenceSteps = default, - int? seed = default, - int? numImages = default, - string? customModelUri = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageFlux2KleinBase.g.cs b/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageFlux2KleinBase.g.cs deleted file mode 100644 index 5c17a5a5..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageFlux2KleinBase.g.cs +++ /dev/null @@ -1,102 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IGenerateClient - { - /// - /// Generate with FLUX.2-Klein (undistilled base)
- /// Generates images synchronously using the UNDISTILLED FLUX.2-Klein base — the 50-step quality tier (vs the distilled /v1/flux-2-klein fast tier). Width and
- /// height must each be a positive multiple of 16 and the total area must
- /// not exceed 1,048,576 pixels (1024×1024); the server validates these
- /// against the model's resolution constraints.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageFlux2KleinBaseAsync( - - global::Ideogram.GenerateImageRequestFlux2KleinBase request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with FLUX.2-Klein (undistilled base)
- /// Generates images synchronously using the UNDISTILLED FLUX.2-Klein base — the 50-step quality tier (vs the distilled /v1/flux-2-klein fast tier). Width and
- /// height must each be a positive multiple of 16 and the total area must
- /// not exceed 1,048,576 pixels (1024×1024); the server validates these
- /// against the model's resolution constraints.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostGenerateImageFlux2KleinBaseAsResponseAsync( - - global::Ideogram.GenerateImageRequestFlux2KleinBase request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with FLUX.2-Klein (undistilled base)
- /// Generates images synchronously using the UNDISTILLED FLUX.2-Klein base — the 50-step quality tier (vs the distilled /v1/flux-2-klein fast tier). Width and
- /// height must each be a positive multiple of 16 and the total area must
- /// not exceed 1,048,576 pixels (1024×1024); the server validates these
- /// against the model's resolution constraints.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// A natural-language prompt for image generation.
- /// Example: A photo of a tabby cat sleeping on a couch, soft daylight. - /// - /// - /// An optional system prompt applied alongside the prompt — use it for
- /// standing instructions such as style constraints or "do not render
- /// text". When omitted, no system prompt is applied. If you trained a
- /// LoRA with a system prompt, supply the same one here for best results.
- /// Example: Do not include any text in the image. - /// - /// - /// Output width in pixels; must be a positive multiple of 16.
- /// Example: 1024 - /// - /// - /// Output height in pixels; must be a positive multiple of 16.
- /// Example: 1024 - /// - /// - /// Optional diffusion step count. When omitted, the server uses the
- /// model's default. Higher values trade latency for quality.
- /// Example: 50 - /// - /// - /// Random seed for reproducibility. - /// - /// - /// Number of images to generate.
- /// Default Value: 1 - /// - /// - /// A custom model URI in the format model/<model_name>/version/<version_name>.
- /// When provided, the URI must resolve to a registered fine-tune of the
- /// FLUX.2-Klein base model; the fine-tune's LoRA checkpoint is layered
- /// on the base. When omitted, the FLUX.2-Klein base is used with no LoRA.
- /// Example: model/my-flux-klein-base-lora/version/0 - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageFlux2KleinBaseAsync( - string prompt, - string? systemPrompt = default, - int? width = default, - int? height = default, - int? numInferenceSteps = default, - int? seed = default, - int? numImages = default, - string? customModelUri = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageFlux2KleinBaseAsync.g.cs b/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageFlux2KleinBaseAsync.g.cs deleted file mode 100644 index f75e1149..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageFlux2KleinBaseAsync.g.cs +++ /dev/null @@ -1,138 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IGenerateClient - { - /// - /// Generate with FLUX.2-Klein (undistilled base) asynchronously via webhook
- /// Accepts an undistilled-base FLUX.2-Klein generation request for asynchronous processing and
- /// returns immediately with a generation_id. The generated images are POSTed to
- /// the supplied `webhook_url` once ready, in a payload that mirrors the
- /// synchronous response with an added generation_id for correlation.
- /// See [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageFlux2KleinBaseAsyncAsync( - string webhookUrl, - - global::Ideogram.GenerateImageRequestFlux2KleinBase request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with FLUX.2-Klein (undistilled base) asynchronously via webhook
- /// Accepts an undistilled-base FLUX.2-Klein generation request for asynchronous processing and
- /// returns immediately with a generation_id. The generated images are POSTed to
- /// the supplied `webhook_url` once ready, in a payload that mirrors the
- /// synchronous response with an added generation_id for correlation.
- /// See [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostGenerateImageFlux2KleinBaseAsyncAsResponseAsync( - string webhookUrl, - - global::Ideogram.GenerateImageRequestFlux2KleinBase request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with FLUX.2-Klein (undistilled base) asynchronously via webhook
- /// Accepts an undistilled-base FLUX.2-Klein generation request for asynchronous processing and
- /// returns immediately with a generation_id. The generated images are POSTed to
- /// the supplied `webhook_url` once ready, in a payload that mirrors the
- /// synchronous response with an added generation_id for correlation.
- /// See [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// A natural-language prompt for image generation.
- /// Example: A photo of a tabby cat sleeping on a couch, soft daylight. - /// - /// - /// An optional system prompt applied alongside the prompt — use it for
- /// standing instructions such as style constraints or "do not render
- /// text". When omitted, no system prompt is applied. If you trained a
- /// LoRA with a system prompt, supply the same one here for best results.
- /// Example: Do not include any text in the image. - /// - /// - /// Output width in pixels; must be a positive multiple of 16.
- /// Example: 1024 - /// - /// - /// Output height in pixels; must be a positive multiple of 16.
- /// Example: 1024 - /// - /// - /// Optional diffusion step count. When omitted, the server uses the
- /// model's default. Higher values trade latency for quality.
- /// Example: 50 - /// - /// - /// Random seed for reproducibility. - /// - /// - /// Number of images to generate.
- /// Default Value: 1 - /// - /// - /// A custom model URI in the format model/<model_name>/version/<version_name>.
- /// When provided, the URI must resolve to a registered fine-tune of the
- /// FLUX.2-Klein base model; the fine-tune's LoRA checkpoint is layered
- /// on the base. When omitted, the FLUX.2-Klein base is used with no LoRA.
- /// Example: model/my-flux-klein-base-lora/version/0 - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageFlux2KleinBaseAsyncAsync( - string webhookUrl, - string prompt, - string? systemPrompt = default, - int? width = default, - int? height = default, - int? numInferenceSteps = default, - int? seed = default, - int? numImages = default, - string? customModelUri = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImagePImageHigh.g.cs b/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImagePImageHigh.g.cs deleted file mode 100644 index 95f93914..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImagePImageHigh.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IGenerateClient - { - /// - /// Generate with the distilled few-step Ideogram model (high speed tier)
- /// Generates images synchronously using the distilled few-step Ideogram
- /// model at the high speed tier — the highest quality, at the highest cost.
- /// The speed tier controls the number of diffusion steps and the per-image
- /// price.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImagePImageHighAsync( - - global::Ideogram.GenerateImageRequestPImage request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with the distilled few-step Ideogram model (high speed tier)
- /// Generates images synchronously using the distilled few-step Ideogram
- /// model at the high speed tier — the highest quality, at the highest cost.
- /// The speed tier controls the number of diffusion steps and the per-image
- /// price.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostGenerateImagePImageHighAsResponseAsync( - - global::Ideogram.GenerateImageRequestPImage request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with the distilled few-step Ideogram model (high speed tier)
- /// Generates images synchronously using the distilled few-step Ideogram
- /// model at the high speed tier — the highest quality, at the highest cost.
- /// The speed tier controls the number of diffusion steps and the per-image
- /// price.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The prompt for image generation. Accepts either natural language or
- /// a structured prompt that conforms to the Ideogram 4.0 JSON contract;
- /// the server detects which was supplied. See `prompt_upsampling` for
- /// how magic-prompt is applied. - /// - /// - /// Controls magic-prompt (prompt upsampling). `AUTO` (default) applies
- /// magic-prompt to a natural-language `prompt` or a non-Ideogram 4.0 JSON
- /// `prompt`, and skips it when `prompt` is already a structured Ideogram
- /// 4.0 JSON prompt. `ON` always applies magic-prompt, even to an Ideogram
- /// 4.0 JSON prompt; `OFF` never applies it. Defaults to `AUTO`. - /// - /// - /// Random seed for reproducibility. - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use
- /// for this request. Honored only when magic-prompt runs (a
- /// natural-language `prompt` with `prompt_upsampling` AUTO or ON). - /// - /// - /// The 1K and 2K resolutions supported for Ideogram 4.0 image generation.
- /// Example: 2048x2048 - /// - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). The effective gate is the OR of this field and the organization's
- /// `copyright_detection_enabled` setting on `/api`. See GenerateImageRequestV3 for details. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImagePImageHighAsync( - string prompt, - global::Ideogram.MagicPromptOption? promptUpsampling = default, - int? seed = default, - string? magicPromptSystemPromptConfigId = default, - global::Ideogram.ResolutionV4? resolution = default, - bool? enableCopyrightDetection = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImagePImageIdeogram.g.cs b/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImagePImageIdeogram.g.cs deleted file mode 100644 index 98017455..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImagePImageIdeogram.g.cs +++ /dev/null @@ -1,107 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IGenerateClient - { - /// - /// Generate with P-Image Ideogram
- /// Generates images synchronously using P-Image Ideogram. `quality` selects
- /// the generation quality level and `resolution` selects the output-size
- /// tier. Both parameters have defaults.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download them. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImagePImageIdeogramAsync( - - global::Ideogram.GenerateImageRequestPImageIdeogram request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with P-Image Ideogram
- /// Generates images synchronously using P-Image Ideogram. `quality` selects
- /// the generation quality level and `resolution` selects the output-size
- /// tier. Both parameters have defaults.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download them. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostGenerateImagePImageIdeogramAsResponseAsync( - - global::Ideogram.GenerateImageRequestPImageIdeogram request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with P-Image Ideogram
- /// Generates images synchronously using P-Image Ideogram. `quality` selects
- /// the generation quality level and `resolution` selects the output-size
- /// tier. Both parameters have defaults.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download them. - ///
- /// - /// The prompt for image generation. Accepts either natural language or
- /// a structured Ideogram 4.0 JSON prompt; the server detects which was supplied. - /// - /// - /// Controls magic-prompt (prompt upsampling). Defaults to `AUTO`.
- /// Default Value: AUTO - /// - /// - /// Random seed for reproducibility. - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use
- /// for this request. - /// - /// - /// The generation quality level. Defaults to `MEDIUM`.
- /// Default Value: MEDIUM - /// - /// - /// The output-size tier. Defaults to `1K`.
- /// Default Value: 1K - /// - /// - /// The output aspect ratio. Defaults to `1x1`.
- /// Default Value: 1x1 - /// - /// - /// Optional. An exact output width in pixels, used together with
- /// `custom_height` for output sizes outside the preset tiers. Must be
- /// a positive multiple of 16 between 16 and 4096, and
- /// `custom_width` × `custom_height` must not exceed 4,194,304 pixels
- /// (2048×2048). Cannot be combined with `resolution` or
- /// `aspect_ratio`; the request is billed at the resolution tier
- /// matching its total pixel count. - /// - /// - /// Optional. An exact output height in pixels, used together with
- /// `custom_width`. See `custom_width` for the accepted range and
- /// billing behavior. - /// - /// - /// Optional. Opt this request into post-generation copyright detection. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImagePImageIdeogramAsync( - string prompt, - global::Ideogram.MagicPromptOption? promptUpsampling = default, - int? seed = default, - string? magicPromptSystemPromptConfigId = default, - global::Ideogram.Quality? quality = default, - global::Ideogram.PImageResolution? resolution = default, - global::Ideogram.AspectRatioV3? aspectRatio = default, - int? customWidth = default, - int? customHeight = default, - bool? enableCopyrightDetection = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImagePImageIdeogramAsync.g.cs b/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImagePImageIdeogramAsync.g.cs deleted file mode 100644 index 5c8157c8..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImagePImageIdeogramAsync.g.cs +++ /dev/null @@ -1,152 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IGenerateClient - { - /// - /// Generate with P-Image Ideogram asynchronously
- /// Accepts a P-Image Ideogram generation request for asynchronous processing
- /// and returns immediately with a generation_id. Poll
- /// `GET /v1/generations/{generation_id}` to retrieve the result. If a
- /// `webhook_url` is supplied, the generated images are additionally POSTed
- /// to it once ready, in a payload that mirrors the synchronous response with
- /// an added generation_id for correlation.
- /// See [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImagePImageIdeogramAsyncAsync( - - global::Ideogram.GenerateImageRequestPImageIdeogram request, - string? webhookUrl = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with P-Image Ideogram asynchronously
- /// Accepts a P-Image Ideogram generation request for asynchronous processing
- /// and returns immediately with a generation_id. Poll
- /// `GET /v1/generations/{generation_id}` to retrieve the result. If a
- /// `webhook_url` is supplied, the generated images are additionally POSTed
- /// to it once ready, in a payload that mirrors the synchronous response with
- /// an added generation_id for correlation.
- /// See [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostGenerateImagePImageIdeogramAsyncAsResponseAsync( - - global::Ideogram.GenerateImageRequestPImageIdeogram request, - string? webhookUrl = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with P-Image Ideogram asynchronously
- /// Accepts a P-Image Ideogram generation request for asynchronous processing
- /// and returns immediately with a generation_id. Poll
- /// `GET /v1/generations/{generation_id}` to retrieve the result. If a
- /// `webhook_url` is supplied, the generated images are additionally POSTed
- /// to it once ready, in a payload that mirrors the synchronous response with
- /// an added generation_id for correlation.
- /// See [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// The prompt for image generation. Accepts either natural language or
- /// a structured Ideogram 4.0 JSON prompt; the server detects which was supplied. - /// - /// - /// Controls magic-prompt (prompt upsampling). Defaults to `AUTO`.
- /// Default Value: AUTO - /// - /// - /// Random seed for reproducibility. - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use
- /// for this request. - /// - /// - /// The generation quality level. Defaults to `MEDIUM`.
- /// Default Value: MEDIUM - /// - /// - /// The output-size tier. Defaults to `1K`.
- /// Default Value: 1K - /// - /// - /// The output aspect ratio. Defaults to `1x1`.
- /// Default Value: 1x1 - /// - /// - /// Optional. An exact output width in pixels, used together with
- /// `custom_height` for output sizes outside the preset tiers. Must be
- /// a positive multiple of 16 between 16 and 4096, and
- /// `custom_width` × `custom_height` must not exceed 4,194,304 pixels
- /// (2048×2048). Cannot be combined with `resolution` or
- /// `aspect_ratio`; the request is billed at the resolution tier
- /// matching its total pixel count. - /// - /// - /// Optional. An exact output height in pixels, used together with
- /// `custom_width`. See `custom_width` for the accepted range and
- /// billing behavior. - /// - /// - /// Optional. Opt this request into post-generation copyright detection. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImagePImageIdeogramAsyncAsync( - string prompt, - string? webhookUrl = default, - global::Ideogram.MagicPromptOption? promptUpsampling = default, - int? seed = default, - string? magicPromptSystemPromptConfigId = default, - global::Ideogram.Quality? quality = default, - global::Ideogram.PImageResolution? resolution = default, - global::Ideogram.AspectRatioV3? aspectRatio = default, - int? customWidth = default, - int? customHeight = default, - bool? enableCopyrightDetection = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImagePImageLow.g.cs b/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImagePImageLow.g.cs deleted file mode 100644 index 8dfeab7d..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImagePImageLow.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IGenerateClient - { - /// - /// Generate with the distilled few-step Ideogram model (low speed tier)
- /// Generates images synchronously using the distilled few-step Ideogram
- /// model at the low speed tier — fast and low-cost, with a modest quality
- /// trade-off. The speed tier controls the number of diffusion steps and the
- /// per-image price.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImagePImageLowAsync( - - global::Ideogram.GenerateImageRequestPImage request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with the distilled few-step Ideogram model (low speed tier)
- /// Generates images synchronously using the distilled few-step Ideogram
- /// model at the low speed tier — fast and low-cost, with a modest quality
- /// trade-off. The speed tier controls the number of diffusion steps and the
- /// per-image price.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostGenerateImagePImageLowAsResponseAsync( - - global::Ideogram.GenerateImageRequestPImage request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with the distilled few-step Ideogram model (low speed tier)
- /// Generates images synchronously using the distilled few-step Ideogram
- /// model at the low speed tier — fast and low-cost, with a modest quality
- /// trade-off. The speed tier controls the number of diffusion steps and the
- /// per-image price.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The prompt for image generation. Accepts either natural language or
- /// a structured prompt that conforms to the Ideogram 4.0 JSON contract;
- /// the server detects which was supplied. See `prompt_upsampling` for
- /// how magic-prompt is applied. - /// - /// - /// Controls magic-prompt (prompt upsampling). `AUTO` (default) applies
- /// magic-prompt to a natural-language `prompt` or a non-Ideogram 4.0 JSON
- /// `prompt`, and skips it when `prompt` is already a structured Ideogram
- /// 4.0 JSON prompt. `ON` always applies magic-prompt, even to an Ideogram
- /// 4.0 JSON prompt; `OFF` never applies it. Defaults to `AUTO`. - /// - /// - /// Random seed for reproducibility. - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use
- /// for this request. Honored only when magic-prompt runs (a
- /// natural-language `prompt` with `prompt_upsampling` AUTO or ON). - /// - /// - /// The 1K and 2K resolutions supported for Ideogram 4.0 image generation.
- /// Example: 2048x2048 - /// - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). The effective gate is the OR of this field and the organization's
- /// `copyright_detection_enabled` setting on `/api`. See GenerateImageRequestV3 for details. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImagePImageLowAsync( - string prompt, - global::Ideogram.MagicPromptOption? promptUpsampling = default, - int? seed = default, - string? magicPromptSystemPromptConfigId = default, - global::Ideogram.ResolutionV4? resolution = default, - bool? enableCopyrightDetection = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImagePImageMedium.g.cs b/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImagePImageMedium.g.cs deleted file mode 100644 index 2420f16a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImagePImageMedium.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IGenerateClient - { - /// - /// Generate with the distilled few-step Ideogram model (medium speed tier)
- /// Generates images synchronously using the distilled few-step Ideogram
- /// model at the medium speed tier — the balanced default of speed, cost, and
- /// quality. The speed tier controls the number of diffusion steps and the
- /// per-image price.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImagePImageMediumAsync( - - global::Ideogram.GenerateImageRequestPImage request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with the distilled few-step Ideogram model (medium speed tier)
- /// Generates images synchronously using the distilled few-step Ideogram
- /// model at the medium speed tier — the balanced default of speed, cost, and
- /// quality. The speed tier controls the number of diffusion steps and the
- /// per-image price.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostGenerateImagePImageMediumAsResponseAsync( - - global::Ideogram.GenerateImageRequestPImage request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with the distilled few-step Ideogram model (medium speed tier)
- /// Generates images synchronously using the distilled few-step Ideogram
- /// model at the medium speed tier — the balanced default of speed, cost, and
- /// quality. The speed tier controls the number of diffusion steps and the
- /// per-image price.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The prompt for image generation. Accepts either natural language or
- /// a structured prompt that conforms to the Ideogram 4.0 JSON contract;
- /// the server detects which was supplied. See `prompt_upsampling` for
- /// how magic-prompt is applied. - /// - /// - /// Controls magic-prompt (prompt upsampling). `AUTO` (default) applies
- /// magic-prompt to a natural-language `prompt` or a non-Ideogram 4.0 JSON
- /// `prompt`, and skips it when `prompt` is already a structured Ideogram
- /// 4.0 JSON prompt. `ON` always applies magic-prompt, even to an Ideogram
- /// 4.0 JSON prompt; `OFF` never applies it. Defaults to `AUTO`. - /// - /// - /// Random seed for reproducibility. - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use
- /// for this request. Honored only when magic-prompt runs (a
- /// natural-language `prompt` with `prompt_upsampling` AUTO or ON). - /// - /// - /// The 1K and 2K resolutions supported for Ideogram 4.0 image generation.
- /// Example: 2048x2048 - /// - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). The effective gate is the OR of this field and the organization's
- /// `copyright_detection_enabled` setting on `/api`. See GenerateImageRequestV3 for details. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImagePImageMediumAsync( - string prompt, - global::Ideogram.MagicPromptOption? promptUpsampling = default, - int? seed = default, - string? magicPromptSystemPromptConfigId = default, - global::Ideogram.ResolutionV4? resolution = default, - bool? enableCopyrightDetection = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImagePImageVeryLow.g.cs b/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImagePImageVeryLow.g.cs deleted file mode 100644 index c96ebd14..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImagePImageVeryLow.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IGenerateClient - { - /// - /// Generate with the distilled few-step Ideogram model (very-low speed tier)
- /// Generates images synchronously using the distilled few-step Ideogram
- /// model at the very-low speed tier — the fastest and lowest-cost option.
- /// The speed tier controls the number of diffusion steps and the per-image
- /// price.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImagePImageVeryLowAsync( - - global::Ideogram.GenerateImageRequestPImage request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with the distilled few-step Ideogram model (very-low speed tier)
- /// Generates images synchronously using the distilled few-step Ideogram
- /// model at the very-low speed tier — the fastest and lowest-cost option.
- /// The speed tier controls the number of diffusion steps and the per-image
- /// price.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostGenerateImagePImageVeryLowAsResponseAsync( - - global::Ideogram.GenerateImageRequestPImage request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with the distilled few-step Ideogram model (very-low speed tier)
- /// Generates images synchronously using the distilled few-step Ideogram
- /// model at the very-low speed tier — the fastest and lowest-cost option.
- /// The speed tier controls the number of diffusion steps and the per-image
- /// price.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The prompt for image generation. Accepts either natural language or
- /// a structured prompt that conforms to the Ideogram 4.0 JSON contract;
- /// the server detects which was supplied. See `prompt_upsampling` for
- /// how magic-prompt is applied. - /// - /// - /// Controls magic-prompt (prompt upsampling). `AUTO` (default) applies
- /// magic-prompt to a natural-language `prompt` or a non-Ideogram 4.0 JSON
- /// `prompt`, and skips it when `prompt` is already a structured Ideogram
- /// 4.0 JSON prompt. `ON` always applies magic-prompt, even to an Ideogram
- /// 4.0 JSON prompt; `OFF` never applies it. Defaults to `AUTO`. - /// - /// - /// Random seed for reproducibility. - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use
- /// for this request. Honored only when magic-prompt runs (a
- /// natural-language `prompt` with `prompt_upsampling` AUTO or ON). - /// - /// - /// The 1K and 2K resolutions supported for Ideogram 4.0 image generation.
- /// Example: 2048x2048 - /// - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). The effective gate is the OR of this field and the organization's
- /// `copyright_detection_enabled` setting on `/api`. See GenerateImageRequestV3 for details. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImagePImageVeryLowAsync( - string prompt, - global::Ideogram.MagicPromptOption? promptUpsampling = default, - int? seed = default, - string? magicPromptSystemPromptConfigId = default, - global::Ideogram.ResolutionV4? resolution = default, - bool? enableCopyrightDetection = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageV3.g.cs deleted file mode 100644 index 31d6c3e2..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageV3.g.cs +++ /dev/null @@ -1,137 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IGenerateClient - { - /// - /// Generate with Ideogram 3.0
- /// Generates images synchronously based on a given prompt and optional parameters using the Ideogram 3.0 model.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageV3Async( - - global::Ideogram.GenerateImageRequestV3 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with Ideogram 3.0
- /// Generates images synchronously based on a given prompt and optional parameters using the Ideogram 3.0 model.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostGenerateImageV3AsResponseAsync( - - global::Ideogram.GenerateImageRequestV3 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with Ideogram 3.0
- /// Generates images synchronously based on a given prompt and optional parameters using the Ideogram 3.0 model.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The prompt to use to generate the image.
- /// Example: A photo of a cat - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The resolutions supported for Ideogram 3.0.
- /// Example: 1280x800 - /// - /// - /// Output aspect ratio. Cannot be combined with resolution. Generation defaults to 1x1; remix keeps the source ratio when both fields are omitted. - /// - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// Description of what to exclude from an image. Descriptions in the prompt take precedence
- /// to descriptions in the negative prompt.
- /// Example: brush strokes, painting - /// - /// - /// Number of images to generate.
- /// Default Value: 1 - /// - /// - /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). Not supported by V_1, V_1_TURBO, V_2A and V_2A_TURBO models. - /// - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - /// - /// - /// The style type to generate with.
- /// Default Value: GENERAL
- /// Example: GENERAL - /// - /// - /// A predefined style preset that applies a specific artistic style to the generated image.
- /// Example: BRIGHT_ART - /// - /// - /// A custom model URI in the format model/<model_name>/version/<version_name>.
- /// When provided, the model version and style will be resolved from this URI, and style_type is not required.
- /// Example: model/my-custom-model/version/1 - /// - /// - /// A set of images to use as style references (max size 25MB per image; the whole request must stay under 50MB). The images should be in JPEG, PNG or WebP format. - /// - /// - /// Generations with character reference are subject to the character reference pricing. A set of images to use as character references (max size 25MB per image; the whole request must stay under 50MB), currently only supports 1 character reference image. The images should be in JPEG, PNG or WebP format. - /// - /// - /// Optional masks for character reference images. When provided, must match the number of character_reference_images. Each mask should be a grayscale image of the same dimensions as the corresponding character reference image. The images should be in JPEG, PNG or WebP format. - /// - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). The effective gate is the OR of this field and the organization's
- /// `copyright_detection_enabled` setting on `/api`: if the org has it on, this is ignored;
- /// if the org has it off, setting this `true` enables detection for this request only.
- /// Adds detection latency. Flagged images come back with `is_image_safe: false`. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageV3Async( - string prompt, - int? seed = default, - global::Ideogram.ResolutionV3? resolution = default, - global::Ideogram.AspectRatioV3? aspectRatio = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - global::Ideogram.MagicPromptOption? magicPrompt = default, - string? magicPromptSystemPromptConfigId = default, - string? negativePrompt = default, - int? numImages = default, - global::Ideogram.ColorPaletteWithPresetNameOrMembers? colorPalette = default, - global::System.Collections.Generic.IList? styleCodes = default, - global::Ideogram.StyleTypeV3? styleType = default, - global::Ideogram.StylePresetV3? stylePreset = default, - string? customModelUri = default, - global::System.Collections.Generic.IList? styleReferenceImages = default, - global::System.Collections.Generic.IList? characterReferenceImages = default, - global::System.Collections.Generic.IList? characterReferenceImagesMask = default, - bool? enableCopyrightDetection = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageV3Transparent.g.cs b/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageV3Transparent.g.cs deleted file mode 100644 index 44b68a04..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageV3Transparent.g.cs +++ /dev/null @@ -1,122 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IGenerateClient - { - /// - /// Generate with Ideogram 3.0 (Transparent Background)
- /// Generates images with transparent background synchronously based on a given prompt and optional parameters using
- /// the Ideogram 3.0 model. Images will be generated using maximum supported resolution at the specified aspect ratio
- /// to allow best results with upscaler. The selected resolution is written to the response, not the upscaled final
- /// resolution.
- /// `rendering_speed=FLASH` is not supported for transparent-background generation; the request will return a 400.
- /// Use `TURBO`, `DEFAULT`, or `QUALITY` instead.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageV3TransparentAsync( - - global::Ideogram.GenerateTransparentImageRequestV3 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with Ideogram 3.0 (Transparent Background)
- /// Generates images with transparent background synchronously based on a given prompt and optional parameters using
- /// the Ideogram 3.0 model. Images will be generated using maximum supported resolution at the specified aspect ratio
- /// to allow best results with upscaler. The selected resolution is written to the response, not the upscaled final
- /// resolution.
- /// `rendering_speed=FLASH` is not supported for transparent-background generation; the request will return a 400.
- /// Use `TURBO`, `DEFAULT`, or `QUALITY` instead.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostGenerateImageV3TransparentAsResponseAsync( - - global::Ideogram.GenerateTransparentImageRequestV3 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with Ideogram 3.0 (Transparent Background)
- /// Generates images with transparent background synchronously based on a given prompt and optional parameters using
- /// the Ideogram 3.0 model. Images will be generated using maximum supported resolution at the specified aspect ratio
- /// to allow best results with upscaler. The selected resolution is written to the response, not the upscaled final
- /// resolution.
- /// `rendering_speed=FLASH` is not supported for transparent-background generation; the request will return a 400.
- /// Use `TURBO`, `DEFAULT`, or `QUALITY` instead.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The prompt to use to generate the image.
- /// Example: A photo of a cat - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// Upscale the initially generated image by the given factor. Upscale factors other than X1 will incur additional cost.
- /// Default Value: X1
- /// Example: X2 - /// - /// - /// Output aspect ratio. Cannot be combined with resolution. Generation defaults to 1x1; remix keeps the source ratio when both fields are omitted. - /// - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// Description of what to exclude from an image. Descriptions in the prompt take precedence
- /// to descriptions in the negative prompt.
- /// Example: brush strokes, painting - /// - /// - /// Number of images to generate.
- /// Default Value: 1 - /// - /// - /// A custom model URI in the format model/<model_name>/version/<version_name>.
- /// When provided, the model version and style will be resolved from this URI, and style_type is not required.
- /// A model must be able to generate transparent background to be used for this endpoint.
- /// Example: model/my-custom-model/version/1 - /// - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). The effective gate is the OR of this field and the organization's
- /// `copyright_detection_enabled` setting on `/api`: if the org has it on, this is ignored;
- /// if the org has it off, setting this `true` enables detection for this request only.
- /// Adds detection latency. Flagged images come back with `is_image_safe: false`. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageV3TransparentAsync( - string prompt, - int? seed = default, - global::Ideogram.UpscaleFactor? upscaleFactor = default, - global::Ideogram.AspectRatioV3? aspectRatio = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - global::Ideogram.MagicPromptOption? magicPrompt = default, - string? magicPromptSystemPromptConfigId = default, - string? negativePrompt = default, - int? numImages = default, - string? customModelUri = default, - bool? enableCopyrightDetection = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageV4.g.cs b/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageV4.g.cs deleted file mode 100644 index c664b3e8..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageV4.g.cs +++ /dev/null @@ -1,93 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IGenerateClient - { - /// - /// Generate with Ideogram 4.0
- /// Generates images synchronously using the Ideogram 4.0 model.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageV4Async( - - global::Ideogram.GenerateImageRequestV4 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with Ideogram 4.0
- /// Generates images synchronously using the Ideogram 4.0 model.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostGenerateImageV4AsResponseAsync( - - global::Ideogram.GenerateImageRequestV4 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with Ideogram 4.0
- /// Generates images synchronously using the Ideogram 4.0 model.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// A natural-language prompt for image generation. When supplied,
- /// magic-prompt is enabled automatically. Mutually exclusive with
- /// `json_prompt`. - /// - /// - /// A structured prompt that conforms to the Ideogram 4.0 JSON
- /// contract. When supplied, magic-prompt is disabled and the
- /// structured prompt is consumed by the diffusion model directly.
- /// Mutually exclusive with `text_prompt`. - /// - /// - /// Random seed for reproducibility. - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use
- /// for this request. Honored when `text_prompt` is supplied. Ignored
- /// when `json_prompt` is supplied. - /// - /// - /// A custom model URI in the format model/<model_name>/version/<version_name>.
- /// When provided, the model version and style will be resolved from this URI.
- /// Example: model/my-custom-model/version/0 - /// - /// - /// The 1K and 2K resolutions supported for Ideogram 4.0 image generation.
- /// Example: 2048x2048 - /// - /// - /// The rendering speed to use. For Ideogram V4, `rendering_speed=FLASH`
- /// is coming soon; requests with `rendering_speed=FLASH` currently
- /// return a 400. - /// - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). The effective gate is the OR of this field and the organization's
- /// `copyright_detection_enabled` setting on `/api`. See GenerateImageRequestV3 for details. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageV4Async( - string? textPrompt = default, - global::Ideogram.V4JsonPrompt? jsonPrompt = default, - int? seed = default, - string? magicPromptSystemPromptConfigId = default, - string? customModelUri = default, - global::Ideogram.ResolutionV4? resolution = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - bool? enableCopyrightDetection = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageV45.g.cs b/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageV45.g.cs deleted file mode 100644 index 28ebfa12..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageV45.g.cs +++ /dev/null @@ -1,93 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IGenerateClient - { - /// - /// Generate with Ideogram 4.5
- /// Generates images synchronously using the Ideogram 4.5 multimodal model.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageV45Async( - - global::Ideogram.GenerateImageRequestV4 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with Ideogram 4.5
- /// Generates images synchronously using the Ideogram 4.5 multimodal model.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostGenerateImageV45AsResponseAsync( - - global::Ideogram.GenerateImageRequestV4 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with Ideogram 4.5
- /// Generates images synchronously using the Ideogram 4.5 multimodal model.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// A natural-language prompt for image generation. When supplied,
- /// magic-prompt is enabled automatically. Mutually exclusive with
- /// `json_prompt`. - /// - /// - /// A structured prompt that conforms to the Ideogram 4.0 JSON
- /// contract. When supplied, magic-prompt is disabled and the
- /// structured prompt is consumed by the diffusion model directly.
- /// Mutually exclusive with `text_prompt`. - /// - /// - /// Random seed for reproducibility. - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use
- /// for this request. Honored when `text_prompt` is supplied. Ignored
- /// when `json_prompt` is supplied. - /// - /// - /// A custom model URI in the format model/<model_name>/version/<version_name>.
- /// When provided, the model version and style will be resolved from this URI.
- /// Example: model/my-custom-model/version/0 - /// - /// - /// The 1K and 2K resolutions supported for Ideogram 4.0 image generation.
- /// Example: 2048x2048 - /// - /// - /// The rendering speed to use. For Ideogram V4, `rendering_speed=FLASH`
- /// is coming soon; requests with `rendering_speed=FLASH` currently
- /// return a 400. - /// - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). The effective gate is the OR of this field and the organization's
- /// `copyright_detection_enabled` setting on `/api`. See GenerateImageRequestV3 for details. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageV45Async( - string? textPrompt = default, - global::Ideogram.V4JsonPrompt? jsonPrompt = default, - int? seed = default, - string? magicPromptSystemPromptConfigId = default, - string? customModelUri = default, - global::Ideogram.ResolutionV4? resolution = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - bool? enableCopyrightDetection = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageV45Async.g.cs b/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageV45Async.g.cs deleted file mode 100644 index 3d5a03bb..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageV45Async.g.cs +++ /dev/null @@ -1,138 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IGenerateClient - { - /// - /// Generate with Ideogram 4.5 asynchronously via webhook
- /// Accepts an Ideogram 4.5 generation request for asynchronous processing and
- /// returns immediately with a generation_id. The generated images are POSTed to
- /// the supplied `webhook_url` once ready, in a payload that mirrors the
- /// synchronous response with an added generation_id for correlation.
- /// See [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageV45AsyncAsync( - string webhookUrl, - - global::Ideogram.GenerateImageRequestV4 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with Ideogram 4.5 asynchronously via webhook
- /// Accepts an Ideogram 4.5 generation request for asynchronous processing and
- /// returns immediately with a generation_id. The generated images are POSTed to
- /// the supplied `webhook_url` once ready, in a payload that mirrors the
- /// synchronous response with an added generation_id for correlation.
- /// See [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostGenerateImageV45AsyncAsResponseAsync( - string webhookUrl, - - global::Ideogram.GenerateImageRequestV4 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with Ideogram 4.5 asynchronously via webhook
- /// Accepts an Ideogram 4.5 generation request for asynchronous processing and
- /// returns immediately with a generation_id. The generated images are POSTed to
- /// the supplied `webhook_url` once ready, in a payload that mirrors the
- /// synchronous response with an added generation_id for correlation.
- /// See [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// A natural-language prompt for image generation. When supplied,
- /// magic-prompt is enabled automatically. Mutually exclusive with
- /// `json_prompt`. - /// - /// - /// A structured prompt that conforms to the Ideogram 4.0 JSON
- /// contract. When supplied, magic-prompt is disabled and the
- /// structured prompt is consumed by the diffusion model directly.
- /// Mutually exclusive with `text_prompt`. - /// - /// - /// Random seed for reproducibility. - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use
- /// for this request. Honored when `text_prompt` is supplied. Ignored
- /// when `json_prompt` is supplied. - /// - /// - /// A custom model URI in the format model/<model_name>/version/<version_name>.
- /// When provided, the model version and style will be resolved from this URI.
- /// Example: model/my-custom-model/version/0 - /// - /// - /// The 1K and 2K resolutions supported for Ideogram 4.0 image generation.
- /// Example: 2048x2048 - /// - /// - /// The rendering speed to use. For Ideogram V4, `rendering_speed=FLASH`
- /// is coming soon; requests with `rendering_speed=FLASH` currently
- /// return a 400. - /// - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). The effective gate is the OR of this field and the organization's
- /// `copyright_detection_enabled` setting on `/api`. See GenerateImageRequestV3 for details. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageV45AsyncAsync( - string webhookUrl, - string? textPrompt = default, - global::Ideogram.V4JsonPrompt? jsonPrompt = default, - int? seed = default, - string? magicPromptSystemPromptConfigId = default, - string? customModelUri = default, - global::Ideogram.ResolutionV4? resolution = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - bool? enableCopyrightDetection = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageV4Async.g.cs b/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageV4Async.g.cs deleted file mode 100644 index 69f4f20a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageV4Async.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IGenerateClient - { - /// - /// Generate with Ideogram 4.0 asynchronously
- /// Accepts an Ideogram 4.0 generation request for asynchronous processing and
- /// returns immediately with a generation_id. Poll `GET /v1/generations/{generation_id}`
- /// to retrieve the result. If a `webhook_url` is supplied, the generated images are
- /// additionally POSTed to it once ready, in a payload that mirrors the synchronous
- /// response with an added generation_id for correlation.
- /// See [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageV4AsyncAsync( - - global::Ideogram.GenerateImageRequestV4 request, - string? webhookUrl = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with Ideogram 4.0 asynchronously
- /// Accepts an Ideogram 4.0 generation request for asynchronous processing and
- /// returns immediately with a generation_id. Poll `GET /v1/generations/{generation_id}`
- /// to retrieve the result. If a `webhook_url` is supplied, the generated images are
- /// additionally POSTed to it once ready, in a payload that mirrors the synchronous
- /// response with an added generation_id for correlation.
- /// See [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostGenerateImageV4AsyncAsResponseAsync( - - global::Ideogram.GenerateImageRequestV4 request, - string? webhookUrl = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with Ideogram 4.0 asynchronously
- /// Accepts an Ideogram 4.0 generation request for asynchronous processing and
- /// returns immediately with a generation_id. Poll `GET /v1/generations/{generation_id}`
- /// to retrieve the result. If a `webhook_url` is supplied, the generated images are
- /// additionally POSTed to it once ready, in a payload that mirrors the synchronous
- /// response with an added generation_id for correlation.
- /// See [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// A natural-language prompt for image generation. When supplied,
- /// magic-prompt is enabled automatically. Mutually exclusive with
- /// `json_prompt`. - /// - /// - /// A structured prompt that conforms to the Ideogram 4.0 JSON
- /// contract. When supplied, magic-prompt is disabled and the
- /// structured prompt is consumed by the diffusion model directly.
- /// Mutually exclusive with `text_prompt`. - /// - /// - /// Random seed for reproducibility. - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use
- /// for this request. Honored when `text_prompt` is supplied. Ignored
- /// when `json_prompt` is supplied. - /// - /// - /// A custom model URI in the format model/<model_name>/version/<version_name>.
- /// When provided, the model version and style will be resolved from this URI.
- /// Example: model/my-custom-model/version/0 - /// - /// - /// The 1K and 2K resolutions supported for Ideogram 4.0 image generation.
- /// Example: 2048x2048 - /// - /// - /// The rendering speed to use. For Ideogram V4, `rendering_speed=FLASH`
- /// is coming soon; requests with `rendering_speed=FLASH` currently
- /// return a 400. - /// - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). The effective gate is the OR of this field and the organization's
- /// `copyright_detection_enabled` setting on `/api`. See GenerateImageRequestV3 for details. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageV4AsyncAsync( - string? webhookUrl = default, - string? textPrompt = default, - global::Ideogram.V4JsonPrompt? jsonPrompt = default, - int? seed = default, - string? magicPromptSystemPromptConfigId = default, - string? customModelUri = default, - global::Ideogram.ResolutionV4? resolution = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - bool? enableCopyrightDetection = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageV4CfgDistilled.g.cs b/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageV4CfgDistilled.g.cs deleted file mode 100644 index 626bb6cc..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageV4CfgDistilled.g.cs +++ /dev/null @@ -1,90 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IGenerateClient - { - /// - /// Generate with the CFG-distilled Ideogram 4.0 model
- /// Generates images synchronously using the CFG/guidance-distilled Ideogram
- /// 4.0 model, served guidance-free.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageV4CfgDistilledAsync( - - global::Ideogram.GenerateImageRequestV4CfgDistilled request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with the CFG-distilled Ideogram 4.0 model
- /// Generates images synchronously using the CFG/guidance-distilled Ideogram
- /// 4.0 model, served guidance-free.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostGenerateImageV4CfgDistilledAsResponseAsync( - - global::Ideogram.GenerateImageRequestV4CfgDistilled request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with the CFG-distilled Ideogram 4.0 model
- /// Generates images synchronously using the CFG/guidance-distilled Ideogram
- /// 4.0 model, served guidance-free.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// A natural-language prompt for image generation. When supplied,
- /// magic-prompt is enabled automatically. Mutually exclusive with
- /// `json_prompt`. - /// - /// - /// A structured prompt that conforms to the Ideogram 4.0 JSON
- /// contract. When supplied, magic-prompt is disabled and the
- /// structured prompt is consumed by the diffusion model directly.
- /// Mutually exclusive with `text_prompt`. - /// - /// - /// Random seed for reproducibility. - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use
- /// for this request. Honored when `text_prompt` is supplied. Ignored
- /// when `json_prompt` is supplied. - /// - /// - /// The 1K and 2K resolutions supported for Ideogram 4.0 image generation.
- /// Example: 2048x2048 - /// - /// - /// The rendering speed to use. For Ideogram V4, `rendering_speed=FLASH`
- /// is coming soon; requests with `rendering_speed=FLASH` currently
- /// return a 400. - /// - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). The effective gate is the OR of this field and the organization's
- /// `copyright_detection_enabled` setting on `/api`. See GenerateImageRequestV3 for details. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageV4CfgDistilledAsync( - string? textPrompt = default, - global::Ideogram.V4JsonPrompt? jsonPrompt = default, - int? seed = default, - string? magicPromptSystemPromptConfigId = default, - global::Ideogram.ResolutionV4? resolution = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - bool? enableCopyrightDetection = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageV4CfgDistilledAsync.g.cs b/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageV4CfgDistilledAsync.g.cs deleted file mode 100644 index 26aa3f3e..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageV4CfgDistilledAsync.g.cs +++ /dev/null @@ -1,135 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IGenerateClient - { - /// - /// Generate with the CFG-distilled Ideogram 4.0 model asynchronously via webhook
- /// Accepts a CFG-distilled Ideogram 4.0 generation request for asynchronous
- /// processing and returns immediately with a generation_id. The generated
- /// images are POSTed to the supplied `webhook_url` once ready, in a payload
- /// that mirrors the synchronous response with an added generation_id for
- /// correlation.
- /// See [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageV4CfgDistilledAsyncAsync( - string webhookUrl, - - global::Ideogram.GenerateImageRequestV4CfgDistilled request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with the CFG-distilled Ideogram 4.0 model asynchronously via webhook
- /// Accepts a CFG-distilled Ideogram 4.0 generation request for asynchronous
- /// processing and returns immediately with a generation_id. The generated
- /// images are POSTed to the supplied `webhook_url` once ready, in a payload
- /// that mirrors the synchronous response with an added generation_id for
- /// correlation.
- /// See [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostGenerateImageV4CfgDistilledAsyncAsResponseAsync( - string webhookUrl, - - global::Ideogram.GenerateImageRequestV4CfgDistilled request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with the CFG-distilled Ideogram 4.0 model asynchronously via webhook
- /// Accepts a CFG-distilled Ideogram 4.0 generation request for asynchronous
- /// processing and returns immediately with a generation_id. The generated
- /// images are POSTed to the supplied `webhook_url` once ready, in a payload
- /// that mirrors the synchronous response with an added generation_id for
- /// correlation.
- /// See [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// A natural-language prompt for image generation. When supplied,
- /// magic-prompt is enabled automatically. Mutually exclusive with
- /// `json_prompt`. - /// - /// - /// A structured prompt that conforms to the Ideogram 4.0 JSON
- /// contract. When supplied, magic-prompt is disabled and the
- /// structured prompt is consumed by the diffusion model directly.
- /// Mutually exclusive with `text_prompt`. - /// - /// - /// Random seed for reproducibility. - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use
- /// for this request. Honored when `text_prompt` is supplied. Ignored
- /// when `json_prompt` is supplied. - /// - /// - /// The 1K and 2K resolutions supported for Ideogram 4.0 image generation.
- /// Example: 2048x2048 - /// - /// - /// The rendering speed to use. For Ideogram V4, `rendering_speed=FLASH`
- /// is coming soon; requests with `rendering_speed=FLASH` currently
- /// return a 400. - /// - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). The effective gate is the OR of this field and the organization's
- /// `copyright_detection_enabled` setting on `/api`. See GenerateImageRequestV3 for details. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageV4CfgDistilledAsyncAsync( - string webhookUrl, - string? textPrompt = default, - global::Ideogram.V4JsonPrompt? jsonPrompt = default, - int? seed = default, - string? magicPromptSystemPromptConfigId = default, - global::Ideogram.ResolutionV4? resolution = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - bool? enableCopyrightDetection = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageV4Fp8.g.cs b/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageV4Fp8.g.cs deleted file mode 100644 index 2f673352..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageV4Fp8.g.cs +++ /dev/null @@ -1,93 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IGenerateClient - { - /// - /// Generate with the fp8-quantized Ideogram 4.0 model
- /// Generates images synchronously using the fp8-quantized Ideogram 4.0 model.
- /// A LoRA checkpoint can be layered on the base via the
- /// `X-Ideogram-Positive-Lora-Ckpt-Path` header.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageV4Fp8Async( - - global::Ideogram.GenerateImageRequestV4Fp8 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with the fp8-quantized Ideogram 4.0 model
- /// Generates images synchronously using the fp8-quantized Ideogram 4.0 model.
- /// A LoRA checkpoint can be layered on the base via the
- /// `X-Ideogram-Positive-Lora-Ckpt-Path` header.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostGenerateImageV4Fp8AsResponseAsync( - - global::Ideogram.GenerateImageRequestV4Fp8 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with the fp8-quantized Ideogram 4.0 model
- /// Generates images synchronously using the fp8-quantized Ideogram 4.0 model.
- /// A LoRA checkpoint can be layered on the base via the
- /// `X-Ideogram-Positive-Lora-Ckpt-Path` header.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// A natural-language prompt for image generation. When supplied,
- /// magic-prompt is enabled automatically. Mutually exclusive with
- /// `json_prompt`. - /// - /// - /// A structured prompt that conforms to the Ideogram 4.0 JSON
- /// contract. When supplied, magic-prompt is disabled and the
- /// structured prompt is consumed by the diffusion model directly.
- /// Mutually exclusive with `text_prompt`. - /// - /// - /// Random seed for reproducibility. - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use
- /// for this request. Honored when `text_prompt` is supplied. Ignored
- /// when `json_prompt` is supplied. - /// - /// - /// The 1K and 2K resolutions supported for Ideogram 4.0 image generation.
- /// Example: 2048x2048 - /// - /// - /// The rendering speed to use. For Ideogram V4, `rendering_speed=FLASH`
- /// is coming soon; requests with `rendering_speed=FLASH` currently
- /// return a 400. - /// - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). The effective gate is the OR of this field and the organization's
- /// `copyright_detection_enabled` setting on `/api`. See GenerateImageRequestV3 for details. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageV4Fp8Async( - string? textPrompt = default, - global::Ideogram.V4JsonPrompt? jsonPrompt = default, - int? seed = default, - string? magicPromptSystemPromptConfigId = default, - global::Ideogram.ResolutionV4? resolution = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - bool? enableCopyrightDetection = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageV4Im2Im.g.cs b/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageV4Im2Im.g.cs deleted file mode 100644 index c95c541c..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageV4Im2Im.g.cs +++ /dev/null @@ -1,222 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IGenerateClient - { - /// - /// Image-to-image with Ideogram 4.0
- /// Generates images synchronously using the Ideogram 4.0 model with an initial image as input.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageV4Im2ImAsync( - - global::Ideogram.GenerateImageRequestV4Im2Im request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Image-to-image with Ideogram 4.0
- /// Generates images synchronously using the Ideogram 4.0 model with an initial image as input.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostGenerateImageV4Im2ImAsResponseAsync( - - global::Ideogram.GenerateImageRequestV4Im2Im request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Image-to-image with Ideogram 4.0
- /// Generates images synchronously using the Ideogram 4.0 model with an initial image as input.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The initial image binary (max 25MB); only JPEG, WebP and PNG formats are supported. - /// - /// - /// The initial image binary (max 25MB); only JPEG, WebP and PNG formats are supported. - /// - /// - /// Optional. Up to 4 additional reference images used together with `image` to condition
- /// the generation, for a maximum of 5 reference images total. Each image may be up to 25MB;
- /// only JPEG, WebP and PNG formats are supported. - /// - /// - /// An optional text prompt to guide the generation. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// Output resolutions for Ideogram 4.0 image-to-image. Superset of ResolutionV4 (the 1K/2K t2im set) plus the small 512-tier (512x512, 768x384, 384x768).
- /// Example: 1024x1024 - /// - /// - /// The rendering speed to use. For Ideogram V4, `rendering_speed=FLASH`
- /// is coming soon; requests with `rendering_speed=FLASH` currently
- /// return a 400. - /// - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). See GenerateImageRequestV3 for details. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageV4Im2ImAsync( - byte[] image, - string imagename, - global::System.Collections.Generic.IList? additionalImages = default, - string? prompt = default, - int? seed = default, - global::Ideogram.MagicPromptOption? magicPromptOption = default, - string? magicPromptSystemPromptConfigId = default, - global::Ideogram.ResolutionV4ImageToImage? resolution = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - bool? enableCopyrightDetection = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - - /// - /// Image-to-image with Ideogram 4.0
- /// Generates images synchronously using the Ideogram 4.0 model with an initial image as input.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The initial image binary (max 25MB); only JPEG, WebP and PNG formats are supported. - /// - /// - /// The initial image binary (max 25MB); only JPEG, WebP and PNG formats are supported. - /// - /// - /// Optional. Up to 4 additional reference images used together with `image` to condition
- /// the generation, for a maximum of 5 reference images total. Each image may be up to 25MB;
- /// only JPEG, WebP and PNG formats are supported. - /// - /// - /// Optional file names to use for the multipart 'additional_images' file parts. - /// - /// - /// An optional text prompt to guide the generation. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// Output resolutions for Ideogram 4.0 image-to-image. Superset of ResolutionV4 (the 1K/2K t2im set) plus the small 512-tier (512x512, 768x384, 384x768).
- /// Example: 1024x1024 - /// - /// - /// The rendering speed to use. For Ideogram V4, `rendering_speed=FLASH`
- /// is coming soon; requests with `rendering_speed=FLASH` currently
- /// return a 400. - /// - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). See GenerateImageRequestV3 for details. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageV4Im2ImAsync( - global::System.IO.Stream image, - string imagename, - global::System.Collections.Generic.IReadOnlyList? additionalImages = default, - global::System.Collections.Generic.IReadOnlyList? additionalImagesFileNames = default, - string? prompt = default, - int? seed = default, - global::Ideogram.MagicPromptOption? magicPromptOption = default, - string? magicPromptSystemPromptConfigId = default, - global::Ideogram.ResolutionV4ImageToImage? resolution = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - bool? enableCopyrightDetection = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Image-to-image with Ideogram 4.0
- /// Generates images synchronously using the Ideogram 4.0 model with an initial image as input.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The initial image binary (max 25MB); only JPEG, WebP and PNG formats are supported. - /// - /// - /// The initial image binary (max 25MB); only JPEG, WebP and PNG formats are supported. - /// - /// - /// Optional. Up to 4 additional reference images used together with `image` to condition
- /// the generation, for a maximum of 5 reference images total. Each image may be up to 25MB;
- /// only JPEG, WebP and PNG formats are supported. - /// - /// - /// Optional file names to use for the multipart 'additional_images' file parts. - /// - /// - /// An optional text prompt to guide the generation. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// Output resolutions for Ideogram 4.0 image-to-image. Superset of ResolutionV4 (the 1K/2K t2im set) plus the small 512-tier (512x512, 768x384, 384x768).
- /// Example: 1024x1024 - /// - /// - /// The rendering speed to use. For Ideogram V4, `rendering_speed=FLASH`
- /// is coming soon; requests with `rendering_speed=FLASH` currently
- /// return a 400. - /// - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). See GenerateImageRequestV3 for details. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostGenerateImageV4Im2ImAsResponseAsync( - global::System.IO.Stream image, - string imagename, - global::System.Collections.Generic.IReadOnlyList? additionalImages = default, - global::System.Collections.Generic.IReadOnlyList? additionalImagesFileNames = default, - string? prompt = default, - int? seed = default, - global::Ideogram.MagicPromptOption? magicPromptOption = default, - string? magicPromptSystemPromptConfigId = default, - global::Ideogram.ResolutionV4ImageToImage? resolution = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - bool? enableCopyrightDetection = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageV4Im2ImAsync.g.cs b/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageV4Im2ImAsync.g.cs deleted file mode 100644 index a0712a49..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageV4Im2ImAsync.g.cs +++ /dev/null @@ -1,287 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IGenerateClient - { - /// - /// Image-to-image with Ideogram 4.0 asynchronously via webhook
- /// Accepts an Ideogram 4.0 image-to-image request for asynchronous processing
- /// and returns immediately with a request_id. The generated images are POSTed
- /// to the supplied `webhook_url` once ready. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageV4Im2ImAsyncAsync( - string webhookUrl, - - global::Ideogram.GenerateImageRequestV4Im2Im request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Image-to-image with Ideogram 4.0 asynchronously via webhook
- /// Accepts an Ideogram 4.0 image-to-image request for asynchronous processing
- /// and returns immediately with a request_id. The generated images are POSTed
- /// to the supplied `webhook_url` once ready. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostGenerateImageV4Im2ImAsyncAsResponseAsync( - string webhookUrl, - - global::Ideogram.GenerateImageRequestV4Im2Im request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Image-to-image with Ideogram 4.0 asynchronously via webhook
- /// Accepts an Ideogram 4.0 image-to-image request for asynchronous processing
- /// and returns immediately with a request_id. The generated images are POSTed
- /// to the supplied `webhook_url` once ready. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// The initial image binary (max 25MB); only JPEG, WebP and PNG formats are supported. - /// - /// - /// The initial image binary (max 25MB); only JPEG, WebP and PNG formats are supported. - /// - /// - /// Optional. Up to 4 additional reference images used together with `image` to condition
- /// the generation, for a maximum of 5 reference images total. Each image may be up to 25MB;
- /// only JPEG, WebP and PNG formats are supported. - /// - /// - /// An optional text prompt to guide the generation. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// Output resolutions for Ideogram 4.0 image-to-image. Superset of ResolutionV4 (the 1K/2K t2im set) plus the small 512-tier (512x512, 768x384, 384x768).
- /// Example: 1024x1024 - /// - /// - /// The rendering speed to use. For Ideogram V4, `rendering_speed=FLASH`
- /// is coming soon; requests with `rendering_speed=FLASH` currently
- /// return a 400. - /// - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). See GenerateImageRequestV3 for details. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageV4Im2ImAsyncAsync( - string webhookUrl, - byte[] image, - string imagename, - global::System.Collections.Generic.IList? additionalImages = default, - string? prompt = default, - int? seed = default, - global::Ideogram.MagicPromptOption? magicPromptOption = default, - string? magicPromptSystemPromptConfigId = default, - global::Ideogram.ResolutionV4ImageToImage? resolution = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - bool? enableCopyrightDetection = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - - /// - /// Image-to-image with Ideogram 4.0 asynchronously via webhook
- /// Accepts an Ideogram 4.0 image-to-image request for asynchronous processing
- /// and returns immediately with a request_id. The generated images are POSTed
- /// to the supplied `webhook_url` once ready. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// The initial image binary (max 25MB); only JPEG, WebP and PNG formats are supported. - /// - /// - /// The initial image binary (max 25MB); only JPEG, WebP and PNG formats are supported. - /// - /// - /// Optional. Up to 4 additional reference images used together with `image` to condition
- /// the generation, for a maximum of 5 reference images total. Each image may be up to 25MB;
- /// only JPEG, WebP and PNG formats are supported. - /// - /// - /// Optional file names to use for the multipart 'additional_images' file parts. - /// - /// - /// An optional text prompt to guide the generation. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// Output resolutions for Ideogram 4.0 image-to-image. Superset of ResolutionV4 (the 1K/2K t2im set) plus the small 512-tier (512x512, 768x384, 384x768).
- /// Example: 1024x1024 - /// - /// - /// The rendering speed to use. For Ideogram V4, `rendering_speed=FLASH`
- /// is coming soon; requests with `rendering_speed=FLASH` currently
- /// return a 400. - /// - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). See GenerateImageRequestV3 for details. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageV4Im2ImAsyncAsync( - string webhookUrl, - global::System.IO.Stream image, - string imagename, - global::System.Collections.Generic.IReadOnlyList? additionalImages = default, - global::System.Collections.Generic.IReadOnlyList? additionalImagesFileNames = default, - string? prompt = default, - int? seed = default, - global::Ideogram.MagicPromptOption? magicPromptOption = default, - string? magicPromptSystemPromptConfigId = default, - global::Ideogram.ResolutionV4ImageToImage? resolution = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - bool? enableCopyrightDetection = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Image-to-image with Ideogram 4.0 asynchronously via webhook
- /// Accepts an Ideogram 4.0 image-to-image request for asynchronous processing
- /// and returns immediately with a request_id. The generated images are POSTed
- /// to the supplied `webhook_url` once ready. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// The initial image binary (max 25MB); only JPEG, WebP and PNG formats are supported. - /// - /// - /// The initial image binary (max 25MB); only JPEG, WebP and PNG formats are supported. - /// - /// - /// Optional. Up to 4 additional reference images used together with `image` to condition
- /// the generation, for a maximum of 5 reference images total. Each image may be up to 25MB;
- /// only JPEG, WebP and PNG formats are supported. - /// - /// - /// Optional file names to use for the multipart 'additional_images' file parts. - /// - /// - /// An optional text prompt to guide the generation. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// Output resolutions for Ideogram 4.0 image-to-image. Superset of ResolutionV4 (the 1K/2K t2im set) plus the small 512-tier (512x512, 768x384, 384x768).
- /// Example: 1024x1024 - /// - /// - /// The rendering speed to use. For Ideogram V4, `rendering_speed=FLASH`
- /// is coming soon; requests with `rendering_speed=FLASH` currently
- /// return a 400. - /// - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). See GenerateImageRequestV3 for details. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostGenerateImageV4Im2ImAsyncAsResponseAsync( - string webhookUrl, - global::System.IO.Stream image, - string imagename, - global::System.Collections.Generic.IReadOnlyList? additionalImages = default, - global::System.Collections.Generic.IReadOnlyList? additionalImagesFileNames = default, - string? prompt = default, - int? seed = default, - global::Ideogram.MagicPromptOption? magicPromptOption = default, - string? magicPromptSystemPromptConfigId = default, - global::Ideogram.ResolutionV4ImageToImage? resolution = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - bool? enableCopyrightDetection = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageV4Stable.g.cs b/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageV4Stable.g.cs deleted file mode 100644 index 337fc7b2..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageV4Stable.g.cs +++ /dev/null @@ -1,88 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IGenerateClient - { - /// - /// Generate with Ideogram 4.0 (stable model)
- /// Generates images synchronously using a pinned stable build of the
- /// Ideogram 4.0 model. This endpoint is intentionally minimal: it accepts
- /// only a prompt (and optional seed), pins the underlying model URI, and
- /// lets the server pick the output resolution automatically.
- /// Images links are available for a limited period of time; if you would
- /// like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageV4StableAsync( - - global::Ideogram.GenerateImageRequestV4Stable request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with Ideogram 4.0 (stable model)
- /// Generates images synchronously using a pinned stable build of the
- /// Ideogram 4.0 model. This endpoint is intentionally minimal: it accepts
- /// only a prompt (and optional seed), pins the underlying model URI, and
- /// lets the server pick the output resolution automatically.
- /// Images links are available for a limited period of time; if you would
- /// like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostGenerateImageV4StableAsResponseAsync( - - global::Ideogram.GenerateImageRequestV4Stable request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with Ideogram 4.0 (stable model)
- /// Generates images synchronously using a pinned stable build of the
- /// Ideogram 4.0 model. This endpoint is intentionally minimal: it accepts
- /// only a prompt (and optional seed), pins the underlying model URI, and
- /// lets the server pick the output resolution automatically.
- /// Images links are available for a limited period of time; if you would
- /// like to keep the image, you must download it. - ///
- /// - /// A natural-language prompt for image generation. When supplied,
- /// magic-prompt is enabled automatically. Mutually exclusive with
- /// `json_prompt`. - /// - /// - /// A structured prompt that conforms to the Ideogram 4.0 JSON
- /// contract. When supplied, magic-prompt is disabled and the
- /// structured prompt is consumed by the diffusion model directly.
- /// Mutually exclusive with `text_prompt`. - /// - /// - /// Random seed for reproducibility. - /// - /// - /// Optional. When supplied, the image is generated at this
- /// resolution. When omitted, the server picks an aspect ratio
- /// automatically based on the prompt. - /// - /// - /// Optional. Selects a specific pinned stable build. When omitted,
- /// the default stable model URI is used. When set to `stable_may29`,
- /// the request is routed to the May 29th stable build. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageV4StableAsync( - string? textPrompt = default, - global::Ideogram.V4JsonPrompt? jsonPrompt = default, - int? seed = default, - global::Ideogram.ResolutionV4? resolution = default, - global::Ideogram.GenerateImageRequestV4StableVersion? version = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageV4Transparent.g.cs b/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageV4Transparent.g.cs deleted file mode 100644 index bbffdd3e..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageV4Transparent.g.cs +++ /dev/null @@ -1,127 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IGenerateClient - { - /// - /// Generate with Ideogram 4.0 (Transparent Background)
- /// Generates images with a transparent background synchronously using the
- /// Ideogram 4.0 model. The result is delivered as a PNG with an alpha
- /// channel.
- /// All Ideogram 4.0 aspect ratios are supported, including `AUTO`, which
- /// lets the model select the most suitable ratio from the prompt.
- /// `output_resolution` selects the delivered resolution tier. Tiers are
- /// total-pixel budgets: wide and tall aspect ratios keep the same pixel
- /// budget as the square of the named size, so a single dimension may
- /// exceed it. The response reports the final delivered resolution.
- /// Image links are available for a limited period of time; if you would
- /// like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageV4TransparentAsync( - - global::Ideogram.GenerateTransparentImageRequestV4 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with Ideogram 4.0 (Transparent Background)
- /// Generates images with a transparent background synchronously using the
- /// Ideogram 4.0 model. The result is delivered as a PNG with an alpha
- /// channel.
- /// All Ideogram 4.0 aspect ratios are supported, including `AUTO`, which
- /// lets the model select the most suitable ratio from the prompt.
- /// `output_resolution` selects the delivered resolution tier. Tiers are
- /// total-pixel budgets: wide and tall aspect ratios keep the same pixel
- /// budget as the square of the named size, so a single dimension may
- /// exceed it. The response reports the final delivered resolution.
- /// Image links are available for a limited period of time; if you would
- /// like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostGenerateImageV4TransparentAsResponseAsync( - - global::Ideogram.GenerateTransparentImageRequestV4 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with Ideogram 4.0 (Transparent Background)
- /// Generates images with a transparent background synchronously using the
- /// Ideogram 4.0 model. The result is delivered as a PNG with an alpha
- /// channel.
- /// All Ideogram 4.0 aspect ratios are supported, including `AUTO`, which
- /// lets the model select the most suitable ratio from the prompt.
- /// `output_resolution` selects the delivered resolution tier. Tiers are
- /// total-pixel budgets: wide and tall aspect ratios keep the same pixel
- /// budget as the square of the named size, so a single dimension may
- /// exceed it. The response reports the final delivered resolution.
- /// Image links are available for a limited period of time; if you would
- /// like to keep the image, you must download it. - ///
- /// - /// A natural-language prompt for image generation. When supplied,
- /// magic-prompt is enabled automatically. Mutually exclusive with
- /// `json_prompt`. - /// - /// - /// A structured prompt that conforms to the Ideogram 4.0 JSON
- /// contract. When supplied, magic-prompt is disabled and the
- /// structured prompt is consumed by the diffusion model directly,
- /// except that `compositional_deconstruction.background` is replaced
- /// with a transparent-background directive. Mutually exclusive with
- /// `text_prompt`. - /// - /// - /// Random seed for reproducibility. - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use
- /// for this request. Honored when `text_prompt` is supplied. Ignored
- /// when `json_prompt` is supplied. - /// - /// - /// The aspect ratio for an Ideogram 4.0 magic prompt. `AUTO` lets the
- /// model select the most suitable ratio from the prompt; any other value
- /// pins the ratio. The non-AUTO values are the buckets the 4.0 model
- /// supports.
- /// Default Value: AUTO - /// - /// - /// The output resolution tier for the generated image. Tiers are
- /// total-pixel budgets matching a square of the named size (for example,
- /// `8K` delivers at most 8192x8192 total pixels); wide and tall aspect
- /// ratios keep the same pixel budget, so a single dimension may exceed
- /// the named size. Defaults to 1K.
- /// Default Value: 1K - /// - /// - /// The rendering speed to use. Defaults to DEFAULT.
- /// Default Value: DEFAULT - /// - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). The effective gate is the OR of this field and the organization's
- /// `copyright_detection_enabled` setting on `/api`. See GenerateImageRequestV3 for details. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageV4TransparentAsync( - string? textPrompt = default, - global::Ideogram.V4JsonPrompt? jsonPrompt = default, - int? seed = default, - string? magicPromptSystemPromptConfigId = default, - global::Ideogram.AspectRatioV4? aspectRatio = default, - global::Ideogram.OutputResolution? outputResolution = default, - global::Ideogram.RenderingSpeedV4? renderingSpeed = default, - bool? enableCopyrightDetection = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageV4TransparentAsync.g.cs b/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageV4TransparentAsync.g.cs deleted file mode 100644 index 51ec23d2..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageV4TransparentAsync.g.cs +++ /dev/null @@ -1,157 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IGenerateClient - { - /// - /// Generate with Ideogram 4.0 (Transparent Background) asynchronously
- /// Accepts an Ideogram 4.0 transparent-background generation request for
- /// asynchronous processing and returns immediately with a generation_id.
- /// Poll `GET /v1/generations/{generation_id}` to retrieve the result. If a
- /// `webhook_url` is supplied, the generated images are additionally POSTed
- /// to it once ready, in a payload that mirrors the synchronous response
- /// with an added generation_id for correlation.
- /// See the synchronous `/v1/ideogram-v4/generate-transparent` endpoint for
- /// the request semantics, including `output_resolution` tiers.
- /// See [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageV4TransparentAsyncAsync( - - global::Ideogram.GenerateTransparentImageRequestV4 request, - string? webhookUrl = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with Ideogram 4.0 (Transparent Background) asynchronously
- /// Accepts an Ideogram 4.0 transparent-background generation request for
- /// asynchronous processing and returns immediately with a generation_id.
- /// Poll `GET /v1/generations/{generation_id}` to retrieve the result. If a
- /// `webhook_url` is supplied, the generated images are additionally POSTed
- /// to it once ready, in a payload that mirrors the synchronous response
- /// with an added generation_id for correlation.
- /// See the synchronous `/v1/ideogram-v4/generate-transparent` endpoint for
- /// the request semantics, including `output_resolution` tiers.
- /// See [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostGenerateImageV4TransparentAsyncAsResponseAsync( - - global::Ideogram.GenerateTransparentImageRequestV4 request, - string? webhookUrl = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with Ideogram 4.0 (Transparent Background) asynchronously
- /// Accepts an Ideogram 4.0 transparent-background generation request for
- /// asynchronous processing and returns immediately with a generation_id.
- /// Poll `GET /v1/generations/{generation_id}` to retrieve the result. If a
- /// `webhook_url` is supplied, the generated images are additionally POSTed
- /// to it once ready, in a payload that mirrors the synchronous response
- /// with an added generation_id for correlation.
- /// See the synchronous `/v1/ideogram-v4/generate-transparent` endpoint for
- /// the request semantics, including `output_resolution` tiers.
- /// See [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// A natural-language prompt for image generation. When supplied,
- /// magic-prompt is enabled automatically. Mutually exclusive with
- /// `json_prompt`. - /// - /// - /// A structured prompt that conforms to the Ideogram 4.0 JSON
- /// contract. When supplied, magic-prompt is disabled and the
- /// structured prompt is consumed by the diffusion model directly,
- /// except that `compositional_deconstruction.background` is replaced
- /// with a transparent-background directive. Mutually exclusive with
- /// `text_prompt`. - /// - /// - /// Random seed for reproducibility. - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use
- /// for this request. Honored when `text_prompt` is supplied. Ignored
- /// when `json_prompt` is supplied. - /// - /// - /// The aspect ratio for an Ideogram 4.0 magic prompt. `AUTO` lets the
- /// model select the most suitable ratio from the prompt; any other value
- /// pins the ratio. The non-AUTO values are the buckets the 4.0 model
- /// supports.
- /// Default Value: AUTO - /// - /// - /// The output resolution tier for the generated image. Tiers are
- /// total-pixel budgets matching a square of the named size (for example,
- /// `8K` delivers at most 8192x8192 total pixels); wide and tall aspect
- /// ratios keep the same pixel budget, so a single dimension may exceed
- /// the named size. Defaults to 1K.
- /// Default Value: 1K - /// - /// - /// The rendering speed to use. Defaults to DEFAULT.
- /// Default Value: DEFAULT - /// - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). The effective gate is the OR of this field and the organization's
- /// `copyright_detection_enabled` setting on `/api`. See GenerateImageRequestV3 for details. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageV4TransparentAsyncAsync( - string? webhookUrl = default, - string? textPrompt = default, - global::Ideogram.V4JsonPrompt? jsonPrompt = default, - int? seed = default, - string? magicPromptSystemPromptConfigId = default, - global::Ideogram.AspectRatioV4? aspectRatio = default, - global::Ideogram.OutputResolution? outputResolution = default, - global::Ideogram.RenderingSpeedV4? renderingSpeed = default, - bool? enableCopyrightDetection = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageZImage.g.cs b/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageZImage.g.cs deleted file mode 100644 index 445e75fc..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageZImage.g.cs +++ /dev/null @@ -1,102 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IGenerateClient - { - /// - /// Generate with Z-Image
- /// Generates images synchronously using the Z-Image model. Width and height
- /// must each be a positive multiple of 16 and the total area must not exceed
- /// 1,048,576 pixels (1024×1024); the server validates these against the
- /// model's resolution constraints.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageZImageAsync( - - global::Ideogram.GenerateImageRequestZImage request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with Z-Image
- /// Generates images synchronously using the Z-Image model. Width and height
- /// must each be a positive multiple of 16 and the total area must not exceed
- /// 1,048,576 pixels (1024×1024); the server validates these against the
- /// model's resolution constraints.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostGenerateImageZImageAsResponseAsync( - - global::Ideogram.GenerateImageRequestZImage request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with Z-Image
- /// Generates images synchronously using the Z-Image model. Width and height
- /// must each be a positive multiple of 16 and the total area must not exceed
- /// 1,048,576 pixels (1024×1024); the server validates these against the
- /// model's resolution constraints.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// A natural-language prompt for image generation.
- /// Example: A futuristic cityscape at golden hour, highly detailed. - /// - /// - /// An optional system prompt applied alongside the prompt — use it for
- /// standing instructions such as style constraints or "do not render
- /// text". When omitted, no system prompt is applied. If you trained a
- /// LoRA with a system prompt, supply the same one here for best results.
- /// Example: Do not include any text in the image. - /// - /// - /// Output width in pixels; must be a positive multiple of 16.
- /// Example: 1024 - /// - /// - /// Output height in pixels; must be a positive multiple of 16.
- /// Example: 1024 - /// - /// - /// Optional diffusion step count. When omitted, the server uses the
- /// model's default. Higher values trade latency for quality.
- /// Example: 8 - /// - /// - /// Random seed for reproducibility. - /// - /// - /// Number of images to generate.
- /// Default Value: 1 - /// - /// - /// A custom model URI in the format model/<model_name>/version/<version_name>.
- /// When provided, the URI must resolve to a registered fine-tune of the
- /// Z-Image base model; the fine-tune's LoRA checkpoint is layered on
- /// the base. When omitted, the Z-Image base is used with no LoRA.
- /// Example: model/my-z-image-lora/version/0 - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageZImageAsync( - string prompt, - string? systemPrompt = default, - int? width = default, - int? height = default, - int? numInferenceSteps = default, - int? seed = default, - int? numImages = default, - string? customModelUri = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageZImageAsync.g.cs b/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageZImageAsync.g.cs deleted file mode 100644 index 1ebca168..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageZImageAsync.g.cs +++ /dev/null @@ -1,138 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IGenerateClient - { - /// - /// Generate with Z-Image asynchronously via webhook
- /// Accepts a Z-Image generation request for asynchronous processing and
- /// returns immediately with a generation_id. The generated images are POSTed to
- /// the supplied `webhook_url` once ready, in a payload that mirrors the
- /// synchronous response with an added generation_id for correlation.
- /// See [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageZImageAsyncAsync( - string webhookUrl, - - global::Ideogram.GenerateImageRequestZImage request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with Z-Image asynchronously via webhook
- /// Accepts a Z-Image generation request for asynchronous processing and
- /// returns immediately with a generation_id. The generated images are POSTed to
- /// the supplied `webhook_url` once ready, in a payload that mirrors the
- /// synchronous response with an added generation_id for correlation.
- /// See [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostGenerateImageZImageAsyncAsResponseAsync( - string webhookUrl, - - global::Ideogram.GenerateImageRequestZImage request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with Z-Image asynchronously via webhook
- /// Accepts a Z-Image generation request for asynchronous processing and
- /// returns immediately with a generation_id. The generated images are POSTed to
- /// the supplied `webhook_url` once ready, in a payload that mirrors the
- /// synchronous response with an added generation_id for correlation.
- /// See [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// A natural-language prompt for image generation.
- /// Example: A futuristic cityscape at golden hour, highly detailed. - /// - /// - /// An optional system prompt applied alongside the prompt — use it for
- /// standing instructions such as style constraints or "do not render
- /// text". When omitted, no system prompt is applied. If you trained a
- /// LoRA with a system prompt, supply the same one here for best results.
- /// Example: Do not include any text in the image. - /// - /// - /// Output width in pixels; must be a positive multiple of 16.
- /// Example: 1024 - /// - /// - /// Output height in pixels; must be a positive multiple of 16.
- /// Example: 1024 - /// - /// - /// Optional diffusion step count. When omitted, the server uses the
- /// model's default. Higher values trade latency for quality.
- /// Example: 8 - /// - /// - /// Random seed for reproducibility. - /// - /// - /// Number of images to generate.
- /// Default Value: 1 - /// - /// - /// A custom model URI in the format model/<model_name>/version/<version_name>.
- /// When provided, the URI must resolve to a registered fine-tune of the
- /// Z-Image base model; the fine-tune's LoRA checkpoint is layered on
- /// the base. When omitted, the Z-Image base is used with no LoRA.
- /// Example: model/my-z-image-lora/version/0 - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageZImageAsyncAsync( - string webhookUrl, - string prompt, - string? systemPrompt = default, - int? width = default, - int? height = default, - int? numInferenceSteps = default, - int? seed = default, - int? numImages = default, - string? customModelUri = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostInpaintImageV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostInpaintImageV3.g.cs deleted file mode 100644 index 7be9f1f4..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostInpaintImageV3.g.cs +++ /dev/null @@ -1,353 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IGenerateClient - { - /// - /// Inpaint with Ideogram 3.0
- /// Inpaint a given image synchronously using the provided mask with Ideogram 3.0. The mask indicates which part of the image
- /// should be edited, while the prompt and chosen style can further guide the edit.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostInpaintImageV3Async( - - global::Ideogram.EditImageRequestV3 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Inpaint with Ideogram 3.0
- /// Inpaint a given image synchronously using the provided mask with Ideogram 3.0. The mask indicates which part of the image
- /// should be edited, while the prompt and chosen style can further guide the edit.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostInpaintImageV3AsResponseAsync( - - global::Ideogram.EditImageRequestV3 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Inpaint with Ideogram 3.0
- /// Inpaint a given image synchronously using the provided mask with Ideogram 3.0. The mask indicates which part of the image
- /// should be edited, while the prompt and chosen style can further guide the edit.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The image being edited (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The image being edited (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// A black and white image of the same size as the image being edited (max size 25MB). Black regions in the mask should match up with the regions of the image that you would like to edit; only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// A black and white image of the same size as the image being edited (max size 25MB). Black regions in the mask should match up with the regions of the image that you would like to edit; only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The prompt used to describe the edited result.
- /// Example: A photo of a cat. - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - /// - /// - /// The style type to generate with.
- /// Default Value: GENERAL
- /// Example: GENERAL - /// - /// - /// A predefined style preset that applies a specific artistic style to the generated image.
- /// Example: BRIGHT_ART - /// - /// - /// A custom model URI in the format model/<model_name>/version/<version_name>.
- /// When provided, the model version and style will be resolved from this URI, and style_type is not required.
- /// Example: model/my-custom-model/version/1 - /// - /// - /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). Not supported by V_1, V_1_TURBO, V_2A and V_2A_TURBO models. - /// - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - /// - /// - /// A set of images to use as style references (max size 25MB per image; the whole request must stay under 50MB). The images should be in JPEG, PNG or WebP format. - /// - /// - /// Generations with character reference are subject to the character reference pricing. A set of images to use as character references (max size 25MB per image; the whole request must stay under 50MB), currently only supports 1 character reference image. The images should be in JPEG, PNG or WebP format. - /// - /// - /// Optional masks for character reference images. When provided, must match the number of character_reference_images. Each mask should be a grayscale image of the same dimensions as the corresponding character reference image. The images should be in JPEG, PNG or WebP format. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostInpaintImageV3Async( - byte[] image, - string imagename, - byte[] mask, - string maskname, - string prompt, - global::Ideogram.MagicPromptOption? magicPrompt = default, - string? magicPromptSystemPromptConfigId = default, - int? numImages = default, - int? seed = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - global::Ideogram.StyleTypeV3? styleType = default, - global::Ideogram.StylePresetV3? stylePreset = default, - string? customModelUri = default, - global::Ideogram.ColorPaletteWithPresetNameOrMembers? colorPalette = default, - global::System.Collections.Generic.IList? styleCodes = default, - global::System.Collections.Generic.IList? styleReferenceImages = default, - global::System.Collections.Generic.IList? characterReferenceImages = default, - global::System.Collections.Generic.IList? characterReferenceImagesMask = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - - /// - /// Inpaint with Ideogram 3.0
- /// Inpaint a given image synchronously using the provided mask with Ideogram 3.0. The mask indicates which part of the image
- /// should be edited, while the prompt and chosen style can further guide the edit.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The image being edited (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The image being edited (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// A black and white image of the same size as the image being edited (max size 25MB). Black regions in the mask should match up with the regions of the image that you would like to edit; only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// A black and white image of the same size as the image being edited (max size 25MB). Black regions in the mask should match up with the regions of the image that you would like to edit; only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The prompt used to describe the edited result.
- /// Example: A photo of a cat. - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - /// - /// - /// The style type to generate with.
- /// Default Value: GENERAL
- /// Example: GENERAL - /// - /// - /// A predefined style preset that applies a specific artistic style to the generated image.
- /// Example: BRIGHT_ART - /// - /// - /// A custom model URI in the format model/<model_name>/version/<version_name>.
- /// When provided, the model version and style will be resolved from this URI, and style_type is not required.
- /// Example: model/my-custom-model/version/1 - /// - /// - /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). Not supported by V_1, V_1_TURBO, V_2A and V_2A_TURBO models. - /// - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - /// - /// - /// A set of images to use as style references (max size 25MB per image; the whole request must stay under 50MB). The images should be in JPEG, PNG or WebP format. - /// - /// - /// Optional file names to use for the multipart 'style_reference_images' file parts. - /// - /// - /// Generations with character reference are subject to the character reference pricing. A set of images to use as character references (max size 25MB per image; the whole request must stay under 50MB), currently only supports 1 character reference image. The images should be in JPEG, PNG or WebP format. - /// - /// - /// Optional file names to use for the multipart 'character_reference_images' file parts. - /// - /// - /// Optional masks for character reference images. When provided, must match the number of character_reference_images. Each mask should be a grayscale image of the same dimensions as the corresponding character reference image. The images should be in JPEG, PNG or WebP format. - /// - /// - /// Optional file names to use for the multipart 'character_reference_images_mask' file parts. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostInpaintImageV3Async( - global::System.IO.Stream image, - string imagename, - global::System.IO.Stream mask, - string maskname, - string prompt, - global::Ideogram.MagicPromptOption? magicPrompt = default, - string? magicPromptSystemPromptConfigId = default, - int? numImages = default, - int? seed = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - global::Ideogram.StyleTypeV3? styleType = default, - global::Ideogram.StylePresetV3? stylePreset = default, - string? customModelUri = default, - global::Ideogram.ColorPaletteWithPresetNameOrMembers? colorPalette = default, - global::System.Collections.Generic.IList? styleCodes = default, - global::System.Collections.Generic.IReadOnlyList? styleReferenceImages = default, - global::System.Collections.Generic.IReadOnlyList? styleReferenceImagesFileNames = default, - global::System.Collections.Generic.IReadOnlyList? characterReferenceImages = default, - global::System.Collections.Generic.IReadOnlyList? characterReferenceImagesFileNames = default, - global::System.Collections.Generic.IReadOnlyList? characterReferenceImagesMask = default, - global::System.Collections.Generic.IReadOnlyList? characterReferenceImagesMaskFileNames = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Inpaint with Ideogram 3.0
- /// Inpaint a given image synchronously using the provided mask with Ideogram 3.0. The mask indicates which part of the image
- /// should be edited, while the prompt and chosen style can further guide the edit.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The image being edited (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The image being edited (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// A black and white image of the same size as the image being edited (max size 25MB). Black regions in the mask should match up with the regions of the image that you would like to edit; only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// A black and white image of the same size as the image being edited (max size 25MB). Black regions in the mask should match up with the regions of the image that you would like to edit; only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The prompt used to describe the edited result.
- /// Example: A photo of a cat. - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - /// - /// - /// The style type to generate with.
- /// Default Value: GENERAL
- /// Example: GENERAL - /// - /// - /// A predefined style preset that applies a specific artistic style to the generated image.
- /// Example: BRIGHT_ART - /// - /// - /// A custom model URI in the format model/<model_name>/version/<version_name>.
- /// When provided, the model version and style will be resolved from this URI, and style_type is not required.
- /// Example: model/my-custom-model/version/1 - /// - /// - /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). Not supported by V_1, V_1_TURBO, V_2A and V_2A_TURBO models. - /// - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - /// - /// - /// A set of images to use as style references (max size 25MB per image; the whole request must stay under 50MB). The images should be in JPEG, PNG or WebP format. - /// - /// - /// Optional file names to use for the multipart 'style_reference_images' file parts. - /// - /// - /// Generations with character reference are subject to the character reference pricing. A set of images to use as character references (max size 25MB per image; the whole request must stay under 50MB), currently only supports 1 character reference image. The images should be in JPEG, PNG or WebP format. - /// - /// - /// Optional file names to use for the multipart 'character_reference_images' file parts. - /// - /// - /// Optional masks for character reference images. When provided, must match the number of character_reference_images. Each mask should be a grayscale image of the same dimensions as the corresponding character reference image. The images should be in JPEG, PNG or WebP format. - /// - /// - /// Optional file names to use for the multipart 'character_reference_images_mask' file parts. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostInpaintImageV3AsResponseAsync( - global::System.IO.Stream image, - string imagename, - global::System.IO.Stream mask, - string maskname, - string prompt, - global::Ideogram.MagicPromptOption? magicPrompt = default, - string? magicPromptSystemPromptConfigId = default, - int? numImages = default, - int? seed = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - global::Ideogram.StyleTypeV3? styleType = default, - global::Ideogram.StylePresetV3? stylePreset = default, - string? customModelUri = default, - global::Ideogram.ColorPaletteWithPresetNameOrMembers? colorPalette = default, - global::System.Collections.Generic.IList? styleCodes = default, - global::System.Collections.Generic.IReadOnlyList? styleReferenceImages = default, - global::System.Collections.Generic.IReadOnlyList? styleReferenceImagesFileNames = default, - global::System.Collections.Generic.IReadOnlyList? characterReferenceImages = default, - global::System.Collections.Generic.IReadOnlyList? characterReferenceImagesFileNames = default, - global::System.Collections.Generic.IReadOnlyList? characterReferenceImagesMask = default, - global::System.Collections.Generic.IReadOnlyList? characterReferenceImagesMaskFileNames = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostLayerizeDesignV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostLayerizeDesignV3.g.cs deleted file mode 100644 index 2a2dba02..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostLayerizeDesignV3.g.cs +++ /dev/null @@ -1,298 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IGenerateClient - { - /// - /// Layerize an existing flat graphic image with text detection and correction
- /// Processes an existing flat graphic image to detect and correct text layers without generating a new image from scratch.
- /// The uploaded image is analyzed for text content, which is then removed and returned as structured text layers with font matching, sizing, and color information.
- /// Supported image formats include JPEG, PNG, and WebP (max size 25MB).
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostLayerizeDesignV3Async( - - global::Ideogram.LayerizeDesignRequestV3 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Layerize an existing flat graphic image with text detection and correction
- /// Processes an existing flat graphic image to detect and correct text layers without generating a new image from scratch.
- /// The uploaded image is analyzed for text content, which is then removed and returned as structured text layers with font matching, sizing, and color information.
- /// Supported image formats include JPEG, PNG, and WebP (max size 25MB).
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostLayerizeDesignV3AsResponseAsync( - - global::Ideogram.LayerizeDesignRequestV3 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Layerize an existing flat graphic image with text detection and correction
- /// Processes an existing flat graphic image to detect and correct text layers without generating a new image from scratch.
- /// The uploaded image is analyzed for text content, which is then removed and returned as structured text layers with font matching, sizing, and color information.
- /// Supported image formats include JPEG, PNG, and WebP (max size 25MB).
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The flat graphic image to process for text detection and correction. The image should be in JPEG, PNG or WebP format (max size 25MB). - /// - /// - /// The flat graphic image to process for text detection and correction. The image should be in JPEG, PNG or WebP format (max size 25MB). - /// - /// - /// An optional prompt to describe the image. If not provided, a prompt will be auto-generated from the image via captioning. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// Custom font file for H1 (heading) text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_h1. - /// - /// - /// Custom font file for H1 (heading) text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_h1. - /// - /// - /// Font name from the available font library for H1 text. Ignored if font_file_h1 is provided.
- /// Example: Ubuntu-Bold.ttf - /// - /// - /// Custom font file for H2 (subheading) text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_h2. - /// - /// - /// Custom font file for H2 (subheading) text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_h2. - /// - /// - /// Font name from the available font library for H2 text. Ignored if font_file_h2 is provided. - /// - /// - /// Custom font file for body text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_body. - /// - /// - /// Custom font file for body text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_body. - /// - /// - /// Font name from the available font library for body text. Ignored if font_file_body is provided. - /// - /// - /// Custom font file for small/caption text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_small. - /// - /// - /// Custom font file for small/caption text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_small. - /// - /// - /// Font name from the available font library for small text. Ignored if font_file_small is provided. - /// - /// - /// A set of asset images (e.g., logos, icons) to use as references for detection and replacement (maximum 10 images). The images should be in JPEG, PNG or WebP format. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostLayerizeDesignV3Async( - byte[] flatGraphicImage, - string flatGraphicImagename, - string? prompt = default, - int? seed = default, - byte[]? fontFileH1 = default, - string? fontFileH1name = default, - string? fontNameH1 = default, - byte[]? fontFileH2 = default, - string? fontFileH2name = default, - string? fontNameH2 = default, - byte[]? fontFileBody = default, - string? fontFileBodyname = default, - string? fontNameBody = default, - byte[]? fontFileSmall = default, - string? fontFileSmallname = default, - string? fontNameSmall = default, - global::System.Collections.Generic.IList? referenceAssetImages = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - - /// - /// Layerize an existing flat graphic image with text detection and correction
- /// Processes an existing flat graphic image to detect and correct text layers without generating a new image from scratch.
- /// The uploaded image is analyzed for text content, which is then removed and returned as structured text layers with font matching, sizing, and color information.
- /// Supported image formats include JPEG, PNG, and WebP (max size 25MB).
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The flat graphic image to process for text detection and correction. The image should be in JPEG, PNG or WebP format (max size 25MB). - /// - /// - /// The flat graphic image to process for text detection and correction. The image should be in JPEG, PNG or WebP format (max size 25MB). - /// - /// - /// An optional prompt to describe the image. If not provided, a prompt will be auto-generated from the image via captioning. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// Custom font file for H1 (heading) text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_h1. - /// - /// - /// Custom font file for H1 (heading) text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_h1. - /// - /// - /// Font name from the available font library for H1 text. Ignored if font_file_h1 is provided.
- /// Example: Ubuntu-Bold.ttf - /// - /// - /// Custom font file for H2 (subheading) text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_h2. - /// - /// - /// Custom font file for H2 (subheading) text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_h2. - /// - /// - /// Font name from the available font library for H2 text. Ignored if font_file_h2 is provided. - /// - /// - /// Custom font file for body text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_body. - /// - /// - /// Custom font file for body text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_body. - /// - /// - /// Font name from the available font library for body text. Ignored if font_file_body is provided. - /// - /// - /// Custom font file for small/caption text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_small. - /// - /// - /// Custom font file for small/caption text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_small. - /// - /// - /// Font name from the available font library for small text. Ignored if font_file_small is provided. - /// - /// - /// A set of asset images (e.g., logos, icons) to use as references for detection and replacement (maximum 10 images). The images should be in JPEG, PNG or WebP format. - /// - /// - /// Optional file names to use for the multipart 'reference_asset_images' file parts. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostLayerizeDesignV3Async( - global::System.IO.Stream flatGraphicImage, - string flatGraphicImagename, - string? prompt = default, - int? seed = default, - global::System.IO.Stream? fontFileH1 = default, - string? fontFileH1name = default, - string? fontNameH1 = default, - global::System.IO.Stream? fontFileH2 = default, - string? fontFileH2name = default, - string? fontNameH2 = default, - global::System.IO.Stream? fontFileBody = default, - string? fontFileBodyname = default, - string? fontNameBody = default, - global::System.IO.Stream? fontFileSmall = default, - string? fontFileSmallname = default, - string? fontNameSmall = default, - global::System.Collections.Generic.IReadOnlyList? referenceAssetImages = default, - global::System.Collections.Generic.IReadOnlyList? referenceAssetImagesFileNames = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Layerize an existing flat graphic image with text detection and correction
- /// Processes an existing flat graphic image to detect and correct text layers without generating a new image from scratch.
- /// The uploaded image is analyzed for text content, which is then removed and returned as structured text layers with font matching, sizing, and color information.
- /// Supported image formats include JPEG, PNG, and WebP (max size 25MB).
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The flat graphic image to process for text detection and correction. The image should be in JPEG, PNG or WebP format (max size 25MB). - /// - /// - /// The flat graphic image to process for text detection and correction. The image should be in JPEG, PNG or WebP format (max size 25MB). - /// - /// - /// An optional prompt to describe the image. If not provided, a prompt will be auto-generated from the image via captioning. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// Custom font file for H1 (heading) text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_h1. - /// - /// - /// Custom font file for H1 (heading) text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_h1. - /// - /// - /// Font name from the available font library for H1 text. Ignored if font_file_h1 is provided.
- /// Example: Ubuntu-Bold.ttf - /// - /// - /// Custom font file for H2 (subheading) text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_h2. - /// - /// - /// Custom font file for H2 (subheading) text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_h2. - /// - /// - /// Font name from the available font library for H2 text. Ignored if font_file_h2 is provided. - /// - /// - /// Custom font file for body text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_body. - /// - /// - /// Custom font file for body text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_body. - /// - /// - /// Font name from the available font library for body text. Ignored if font_file_body is provided. - /// - /// - /// Custom font file for small/caption text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_small. - /// - /// - /// Custom font file for small/caption text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_small. - /// - /// - /// Font name from the available font library for small text. Ignored if font_file_small is provided. - /// - /// - /// A set of asset images (e.g., logos, icons) to use as references for detection and replacement (maximum 10 images). The images should be in JPEG, PNG or WebP format. - /// - /// - /// Optional file names to use for the multipart 'reference_asset_images' file parts. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostLayerizeDesignV3AsResponseAsync( - global::System.IO.Stream flatGraphicImage, - string flatGraphicImagename, - string? prompt = default, - int? seed = default, - global::System.IO.Stream? fontFileH1 = default, - string? fontFileH1name = default, - string? fontNameH1 = default, - global::System.IO.Stream? fontFileH2 = default, - string? fontFileH2name = default, - string? fontNameH2 = default, - global::System.IO.Stream? fontFileBody = default, - string? fontFileBodyname = default, - string? fontNameBody = default, - global::System.IO.Stream? fontFileSmall = default, - string? fontFileSmallname = default, - string? fontNameSmall = default, - global::System.Collections.Generic.IReadOnlyList? referenceAssetImages = default, - global::System.Collections.Generic.IReadOnlyList? referenceAssetImagesFileNames = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostLayerizeLogos.g.cs b/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostLayerizeLogos.g.cs deleted file mode 100644 index 894e24f5..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostLayerizeLogos.g.cs +++ /dev/null @@ -1,128 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IGenerateClient - { - /// - /// Detect and remove reference logos from an image
- /// Detects caller-supplied reference logos in a flat design image, inpaints
- /// them out, and returns the cleaned image together with the matched
- /// bounding boxes (each tagged with the matching reference's `REF_<n>`). - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostLayerizeLogosAsync( - - global::Ideogram.LayerizeLogosRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Detect and remove reference logos from an image
- /// Detects caller-supplied reference logos in a flat design image, inpaints
- /// them out, and returns the cleaned image together with the matched
- /// bounding boxes (each tagged with the matching reference's `REF_<n>`). - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostLayerizeLogosAsResponseAsync( - - global::Ideogram.LayerizeLogosRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Detect and remove reference logos from an image
- /// Detects caller-supplied reference logos in a flat design image, inpaints
- /// them out, and returns the cleaned image together with the matched
- /// bounding boxes (each tagged with the matching reference's `REF_<n>`). - ///
- /// - /// The flat design image to analyze. The image should be in JPEG, PNG, or WebP format (max size 25MB). - /// - /// - /// The flat design image to analyze. The image should be in JPEG, PNG, or WebP format (max size 25MB). - /// - /// - /// Reference image assets to match against logos and image elements detected in
- /// `design_image`. Each entry is assigned a `ref_id` of `REF_0`, `REF_1`, ...
- /// in the order it appears in the request (maximum 10 images). The images
- /// should be in JPEG, PNG, or WebP format. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostLayerizeLogosAsync( - byte[] designImage, - string designImagename, - global::System.Collections.Generic.IList referenceImages, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - - /// - /// Detect and remove reference logos from an image
- /// Detects caller-supplied reference logos in a flat design image, inpaints
- /// them out, and returns the cleaned image together with the matched
- /// bounding boxes (each tagged with the matching reference's `REF_<n>`). - ///
- /// - /// The flat design image to analyze. The image should be in JPEG, PNG, or WebP format (max size 25MB). - /// - /// - /// The flat design image to analyze. The image should be in JPEG, PNG, or WebP format (max size 25MB). - /// - /// - /// Reference image assets to match against logos and image elements detected in
- /// `design_image`. Each entry is assigned a `ref_id` of `REF_0`, `REF_1`, ...
- /// in the order it appears in the request (maximum 10 images). The images
- /// should be in JPEG, PNG, or WebP format. - /// - /// - /// Optional file names to use for the multipart 'reference_images' file parts. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostLayerizeLogosAsync( - global::System.IO.Stream designImage, - string designImagename, - global::System.Collections.Generic.IReadOnlyList referenceImages, - global::System.Collections.Generic.IReadOnlyList? referenceImagesFileNames = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Detect and remove reference logos from an image
- /// Detects caller-supplied reference logos in a flat design image, inpaints
- /// them out, and returns the cleaned image together with the matched
- /// bounding boxes (each tagged with the matching reference's `REF_<n>`). - ///
- /// - /// The flat design image to analyze. The image should be in JPEG, PNG, or WebP format (max size 25MB). - /// - /// - /// The flat design image to analyze. The image should be in JPEG, PNG, or WebP format (max size 25MB). - /// - /// - /// Reference image assets to match against logos and image elements detected in
- /// `design_image`. Each entry is assigned a `ref_id` of `REF_0`, `REF_1`, ...
- /// in the order it appears in the request (maximum 10 images). The images
- /// should be in JPEG, PNG, or WebP format. - /// - /// - /// Optional file names to use for the multipart 'reference_images' file parts. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostLayerizeLogosAsResponseAsync( - global::System.IO.Stream designImage, - string designImagename, - global::System.Collections.Generic.IReadOnlyList referenceImages, - global::System.Collections.Generic.IReadOnlyList? referenceImagesFileNames = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostLayerizeTextV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostLayerizeTextV3.g.cs deleted file mode 100644 index 3ed6f7a3..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostLayerizeTextV3.g.cs +++ /dev/null @@ -1,151 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IGenerateClient - { - /// - /// Layerize Text
- /// Analyzes an image to detect text regions, then returns each detected text block with its position, content, font information, and styling.
- /// The response includes a text-erased base image (background with all text removed) and a flat list of detected text blocks.
- /// Supported image formats include JPEG, PNG, and WebP (max size 25MB).
- /// Image links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostLayerizeTextV3Async( - - global::Ideogram.LayerizeTextRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Layerize Text
- /// Analyzes an image to detect text regions, then returns each detected text block with its position, content, font information, and styling.
- /// The response includes a text-erased base image (background with all text removed) and a flat list of detected text blocks.
- /// Supported image formats include JPEG, PNG, and WebP (max size 25MB).
- /// Image links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostLayerizeTextV3AsResponseAsync( - - global::Ideogram.LayerizeTextRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Layerize Text
- /// Analyzes an image to detect text regions, then returns each detected text block with its position, content, font information, and styling.
- /// The response includes a text-erased base image (background with all text removed) and a flat list of detected text blocks.
- /// Supported image formats include JPEG, PNG, and WebP (max size 25MB).
- /// Image links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The image to analyze for text detection. The image should be in JPEG, PNG, or WebP format (max size 25MB). - /// - /// - /// The image to analyze for text detection. The image should be in JPEG, PNG, or WebP format (max size 25MB). - /// - /// - /// An optional text description of the image. If not provided, a description will be auto-generated from the image. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// Candidate font files to make available for text style matching. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB each, maximum 5 files). - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostLayerizeTextV3Async( - byte[] image, - string imagename, - string? prompt = default, - int? seed = default, - global::System.Collections.Generic.IList? fontCandidateFiles = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - - /// - /// Layerize Text
- /// Analyzes an image to detect text regions, then returns each detected text block with its position, content, font information, and styling.
- /// The response includes a text-erased base image (background with all text removed) and a flat list of detected text blocks.
- /// Supported image formats include JPEG, PNG, and WebP (max size 25MB).
- /// Image links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The image to analyze for text detection. The image should be in JPEG, PNG, or WebP format (max size 25MB). - /// - /// - /// The image to analyze for text detection. The image should be in JPEG, PNG, or WebP format (max size 25MB). - /// - /// - /// An optional text description of the image. If not provided, a description will be auto-generated from the image. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// Candidate font files to make available for text style matching. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB each, maximum 5 files). - /// - /// - /// Optional file names to use for the multipart 'font_candidate_files' file parts. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostLayerizeTextV3Async( - global::System.IO.Stream image, - string imagename, - string? prompt = default, - int? seed = default, - global::System.Collections.Generic.IReadOnlyList? fontCandidateFiles = default, - global::System.Collections.Generic.IReadOnlyList? fontCandidateFilesFileNames = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Layerize Text
- /// Analyzes an image to detect text regions, then returns each detected text block with its position, content, font information, and styling.
- /// The response includes a text-erased base image (background with all text removed) and a flat list of detected text blocks.
- /// Supported image formats include JPEG, PNG, and WebP (max size 25MB).
- /// Image links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The image to analyze for text detection. The image should be in JPEG, PNG, or WebP format (max size 25MB). - /// - /// - /// The image to analyze for text detection. The image should be in JPEG, PNG, or WebP format (max size 25MB). - /// - /// - /// An optional text description of the image. If not provided, a description will be auto-generated from the image. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// Candidate font files to make available for text style matching. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB each, maximum 5 files). - /// - /// - /// Optional file names to use for the multipart 'font_candidate_files' file parts. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostLayerizeTextV3AsResponseAsync( - global::System.IO.Stream image, - string imagename, - string? prompt = default, - int? seed = default, - global::System.Collections.Generic.IReadOnlyList? fontCandidateFiles = default, - global::System.Collections.Generic.IReadOnlyList? fontCandidateFilesFileNames = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostReframeImage.g.cs b/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostReframeImage.g.cs deleted file mode 100644 index 20ffe93b..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostReframeImage.g.cs +++ /dev/null @@ -1,172 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IGenerateClient - { - /// - /// Reframe (legacy)
- /// Reframe a square image to a chosen resolution. The supported image formats include JPEG, PNG, and WebP.
- /// Image links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostReframeImageAsync( - - global::Ideogram.ReframeImageRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Reframe (legacy)
- /// Reframe a square image to a chosen resolution. The supported image formats include JPEG, PNG, and WebP.
- /// Image links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostReframeImageAsResponseAsync( - - global::Ideogram.ReframeImageRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Reframe (legacy)
- /// Reframe a square image to a chosen resolution. The supported image formats include JPEG, PNG, and WebP.
- /// Image links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The image being reframed (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The image being reframed (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// (For model_version for 2.0 only, cannot be used in conjunction with aspect_ratio) The resolution to use for image generation, represented in width x height. If not specified, defaults to using aspect_ratio.
- /// Example: RESOLUTION_1024_1024 - /// - /// - /// The model used to generate an image or edit one. /generate and /remix supports all model types, however, /edit is only supported for V_2 and V_2_TURBO.
- /// Default Value: V_2
- /// Example: V_2_TURBO - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The style type to generate with; this is only applicable for models V_2 and above and should not be specified for model versions V_1.
- /// Example: REALISTIC - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostReframeImageAsync( - byte[] imageFile, - string imageFilename, - global::Ideogram.Resolution resolution, - global::Ideogram.ModelEnum model = global::Ideogram.ModelEnum.V2, - int? numImages = default, - int? seed = default, - global::Ideogram.StyleType? styleType = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - - /// - /// Reframe (legacy)
- /// Reframe a square image to a chosen resolution. The supported image formats include JPEG, PNG, and WebP.
- /// Image links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The image being reframed (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The image being reframed (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// (For model_version for 2.0 only, cannot be used in conjunction with aspect_ratio) The resolution to use for image generation, represented in width x height. If not specified, defaults to using aspect_ratio.
- /// Example: RESOLUTION_1024_1024 - /// - /// - /// The model used to generate an image or edit one. /generate and /remix supports all model types, however, /edit is only supported for V_2 and V_2_TURBO.
- /// Default Value: V_2
- /// Example: V_2_TURBO - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The style type to generate with; this is only applicable for models V_2 and above and should not be specified for model versions V_1.
- /// Example: REALISTIC - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostReframeImageAsync( - global::System.IO.Stream imageFile, - string imageFilename, - global::Ideogram.Resolution resolution, - global::Ideogram.ModelEnum model = global::Ideogram.ModelEnum.V2, - int? numImages = default, - int? seed = default, - global::Ideogram.StyleType? styleType = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Reframe (legacy)
- /// Reframe a square image to a chosen resolution. The supported image formats include JPEG, PNG, and WebP.
- /// Image links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The image being reframed (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The image being reframed (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// (For model_version for 2.0 only, cannot be used in conjunction with aspect_ratio) The resolution to use for image generation, represented in width x height. If not specified, defaults to using aspect_ratio.
- /// Example: RESOLUTION_1024_1024 - /// - /// - /// The model used to generate an image or edit one. /generate and /remix supports all model types, however, /edit is only supported for V_2 and V_2_TURBO.
- /// Default Value: V_2
- /// Example: V_2_TURBO - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The style type to generate with; this is only applicable for models V_2 and above and should not be specified for model versions V_1.
- /// Example: REALISTIC - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostReframeImageAsResponseAsync( - global::System.IO.Stream imageFile, - string imageFilename, - global::Ideogram.Resolution resolution, - global::Ideogram.ModelEnum model = global::Ideogram.ModelEnum.V2, - int? numImages = default, - int? seed = default, - global::Ideogram.StyleType? styleType = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostReframeImageV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostReframeImageV3.g.cs deleted file mode 100644 index cc35cb6b..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostReframeImageV3.g.cs +++ /dev/null @@ -1,216 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IGenerateClient - { - /// - /// Reframe with Ideogram 3.0
- /// Reframe a square image to a chosen resolution with Ideogram 3.0. The supported image formats include JPEG, PNG, and WebP.
- /// Image links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostReframeImageV3Async( - - global::Ideogram.ReframeImageRequestV3 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Reframe with Ideogram 3.0
- /// Reframe a square image to a chosen resolution with Ideogram 3.0. The supported image formats include JPEG, PNG, and WebP.
- /// Image links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostReframeImageV3AsResponseAsync( - - global::Ideogram.ReframeImageRequestV3 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Reframe with Ideogram 3.0
- /// Reframe a square image to a chosen resolution with Ideogram 3.0. The supported image formats include JPEG, PNG, and WebP.
- /// Image links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The image being reframed (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The image being reframed (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The resolutions supported for Ideogram 3.0.
- /// Example: 1280x800 - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - /// - /// - /// A predefined style preset that applies a specific artistic style to the generated image.
- /// Example: BRIGHT_ART - /// - /// - /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). Not supported by V_1, V_1_TURBO, V_2A and V_2A_TURBO models. - /// - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - /// - /// - /// A set of images to use as style references (max size 25MB per image; the whole request must stay under 50MB). The images should be in JPEG, PNG or WebP format. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostReframeImageV3Async( - byte[] image, - string imagename, - global::Ideogram.ResolutionV3 resolution, - int? numImages = default, - int? seed = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - global::Ideogram.StylePresetV3? stylePreset = default, - global::Ideogram.ColorPaletteWithPresetNameOrMembers? colorPalette = default, - global::System.Collections.Generic.IList? styleCodes = default, - global::System.Collections.Generic.IList? styleReferenceImages = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - - /// - /// Reframe with Ideogram 3.0
- /// Reframe a square image to a chosen resolution with Ideogram 3.0. The supported image formats include JPEG, PNG, and WebP.
- /// Image links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The image being reframed (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The image being reframed (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The resolutions supported for Ideogram 3.0.
- /// Example: 1280x800 - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - /// - /// - /// A predefined style preset that applies a specific artistic style to the generated image.
- /// Example: BRIGHT_ART - /// - /// - /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). Not supported by V_1, V_1_TURBO, V_2A and V_2A_TURBO models. - /// - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - /// - /// - /// A set of images to use as style references (max size 25MB per image; the whole request must stay under 50MB). The images should be in JPEG, PNG or WebP format. - /// - /// - /// Optional file names to use for the multipart 'style_reference_images' file parts. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostReframeImageV3Async( - global::System.IO.Stream image, - string imagename, - global::Ideogram.ResolutionV3 resolution, - int? numImages = default, - int? seed = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - global::Ideogram.StylePresetV3? stylePreset = default, - global::Ideogram.ColorPaletteWithPresetNameOrMembers? colorPalette = default, - global::System.Collections.Generic.IList? styleCodes = default, - global::System.Collections.Generic.IReadOnlyList? styleReferenceImages = default, - global::System.Collections.Generic.IReadOnlyList? styleReferenceImagesFileNames = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Reframe with Ideogram 3.0
- /// Reframe a square image to a chosen resolution with Ideogram 3.0. The supported image formats include JPEG, PNG, and WebP.
- /// Image links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The image being reframed (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The image being reframed (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The resolutions supported for Ideogram 3.0.
- /// Example: 1280x800 - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - /// - /// - /// A predefined style preset that applies a specific artistic style to the generated image.
- /// Example: BRIGHT_ART - /// - /// - /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). Not supported by V_1, V_1_TURBO, V_2A and V_2A_TURBO models. - /// - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - /// - /// - /// A set of images to use as style references (max size 25MB per image; the whole request must stay under 50MB). The images should be in JPEG, PNG or WebP format. - /// - /// - /// Optional file names to use for the multipart 'style_reference_images' file parts. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostReframeImageV3AsResponseAsync( - global::System.IO.Stream image, - string imagename, - global::Ideogram.ResolutionV3 resolution, - int? numImages = default, - int? seed = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - global::Ideogram.StylePresetV3? stylePreset = default, - global::Ideogram.ColorPaletteWithPresetNameOrMembers? colorPalette = default, - global::System.Collections.Generic.IList? styleCodes = default, - global::System.Collections.Generic.IReadOnlyList? styleReferenceImages = default, - global::System.Collections.Generic.IReadOnlyList? styleReferenceImagesFileNames = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostRemixImage.g.cs b/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostRemixImage.g.cs deleted file mode 100644 index 95834ff2..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostRemixImage.g.cs +++ /dev/null @@ -1,119 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IGenerateClient - { - /// - /// Remix (legacy)
- /// Remix provided images synchronously based on a given prompt and optional parameters.
- /// Input images are cropped to the chosen aspect ratio before being remixed.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostRemixImageAsync( - - global::Ideogram.RemixImageRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Remix (legacy)
- /// Remix provided images synchronously based on a given prompt and optional parameters.
- /// Input images are cropped to the chosen aspect ratio before being remixed.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostRemixImageAsResponseAsync( - - global::Ideogram.RemixImageRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Remix (legacy)
- /// Remix provided images synchronously based on a given prompt and optional parameters.
- /// Input images are cropped to the chosen aspect ratio before being remixed.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// A request to generate a new image using a provided image and a prompt.
- /// Example: {"aspect_ratio":"ASPECT_10_16","magic_prompt_option":"ON","model":"V_2","prompt":"A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there is an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset.","image_weight":50} - /// - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostRemixImageAsync( - global::Ideogram.InitialImageRequest imageRequest, - byte[] imageFile, - string imageFilename, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - - /// - /// Remix (legacy)
- /// Remix provided images synchronously based on a given prompt and optional parameters.
- /// Input images are cropped to the chosen aspect ratio before being remixed.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// A request to generate a new image using a provided image and a prompt.
- /// Example: {"aspect_ratio":"ASPECT_10_16","magic_prompt_option":"ON","model":"V_2","prompt":"A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there is an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset.","image_weight":50} - /// - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostRemixImageAsync( - global::Ideogram.InitialImageRequest imageRequest, - global::System.IO.Stream imageFile, - string imageFilename, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Remix (legacy)
- /// Remix provided images synchronously based on a given prompt and optional parameters.
- /// Input images are cropped to the chosen aspect ratio before being remixed.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// A request to generate a new image using a provided image and a prompt.
- /// Example: {"aspect_ratio":"ASPECT_10_16","magic_prompt_option":"ON","model":"V_2","prompt":"A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there is an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset.","image_weight":50} - /// - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostRemixImageAsResponseAsync( - global::Ideogram.InitialImageRequest imageRequest, - global::System.IO.Stream imageFile, - string imageFilename, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostRemixImageV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostRemixImageV3.g.cs deleted file mode 100644 index 8fe4d018..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostRemixImageV3.g.cs +++ /dev/null @@ -1,389 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IGenerateClient - { - /// - /// Remix with Ideogram 3.0
- /// Remix provided images synchronously based on a given prompt and optional parameters with the Ideogram 3.0 model.
- /// Input images are cropped to the chosen aspect ratio before being remixed.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostRemixImageV3Async( - - global::Ideogram.RemixImageRequestV3 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Remix with Ideogram 3.0
- /// Remix provided images synchronously based on a given prompt and optional parameters with the Ideogram 3.0 model.
- /// Input images are cropped to the chosen aspect ratio before being remixed.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostRemixImageV3AsResponseAsync( - - global::Ideogram.RemixImageRequestV3 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Remix with Ideogram 3.0
- /// Remix provided images synchronously based on a given prompt and optional parameters with the Ideogram 3.0 model.
- /// Input images are cropped to the chosen aspect ratio before being remixed.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The image to remix binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The image to remix binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The prompt to use to generate the image.
- /// Example: A photo of a cat - /// - /// - /// Default Value: 50
- /// Example: 50 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The resolutions supported for Ideogram 3.0.
- /// Example: 1280x800 - /// - /// - /// Output aspect ratio. Cannot be combined with resolution. Generation defaults to 1x1; remix keeps the source ratio when both fields are omitted. - /// - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// Description of what to exclude from an image. Descriptions in the prompt take precedence
- /// to descriptions in the negative prompt.
- /// Example: brush strokes, painting - /// - /// - /// Number of images to generate.
- /// Default Value: 1 - /// - /// - /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). Not supported by V_1, V_1_TURBO, V_2A and V_2A_TURBO models. - /// - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - /// - /// - /// The style type to generate with.
- /// Default Value: GENERAL
- /// Example: GENERAL - /// - /// - /// A predefined style preset that applies a specific artistic style to the generated image.
- /// Example: BRIGHT_ART - /// - /// - /// A custom model URI in the format model/<model_name>/version/<version_name>.
- /// When provided, the model version and style will be resolved from this URI, and style_type is not required.
- /// Example: model/my-custom-model/version/1 - /// - /// - /// A set of images to use as style references (max size 25MB per image; the whole request must stay under 50MB). The images should be in JPEG, PNG or WebP format. - /// - /// - /// Generations with character reference are subject to the character reference pricing. A set of images to use as character references (max size 25MB per image; the whole request must stay under 50MB), currently only supports 1 character reference image. The images should be in JPEG, PNG or WebP format. - /// - /// - /// Optional masks for character reference images. When provided, must match the number of character_reference_images. Each mask should be a grayscale image of the same dimensions as the corresponding character reference image. The images should be in JPEG, PNG or WebP format. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostRemixImageV3Async( - byte[] image, - string imagename, - string prompt, - int? imageWeight = default, - int? seed = default, - global::Ideogram.ResolutionV3? resolution = default, - global::Ideogram.AspectRatioV3? aspectRatio = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - global::Ideogram.MagicPromptOption? magicPrompt = default, - string? magicPromptSystemPromptConfigId = default, - string? negativePrompt = default, - int? numImages = default, - global::Ideogram.ColorPaletteWithPresetNameOrMembers? colorPalette = default, - global::System.Collections.Generic.IList? styleCodes = default, - global::Ideogram.StyleTypeV3? styleType = default, - global::Ideogram.StylePresetV3? stylePreset = default, - string? customModelUri = default, - global::System.Collections.Generic.IList? styleReferenceImages = default, - global::System.Collections.Generic.IList? characterReferenceImages = default, - global::System.Collections.Generic.IList? characterReferenceImagesMask = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - - /// - /// Remix with Ideogram 3.0
- /// Remix provided images synchronously based on a given prompt and optional parameters with the Ideogram 3.0 model.
- /// Input images are cropped to the chosen aspect ratio before being remixed.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The image to remix binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The image to remix binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The prompt to use to generate the image.
- /// Example: A photo of a cat - /// - /// - /// Default Value: 50
- /// Example: 50 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The resolutions supported for Ideogram 3.0.
- /// Example: 1280x800 - /// - /// - /// Output aspect ratio. Cannot be combined with resolution. Generation defaults to 1x1; remix keeps the source ratio when both fields are omitted. - /// - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// Description of what to exclude from an image. Descriptions in the prompt take precedence
- /// to descriptions in the negative prompt.
- /// Example: brush strokes, painting - /// - /// - /// Number of images to generate.
- /// Default Value: 1 - /// - /// - /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). Not supported by V_1, V_1_TURBO, V_2A and V_2A_TURBO models. - /// - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - /// - /// - /// The style type to generate with.
- /// Default Value: GENERAL
- /// Example: GENERAL - /// - /// - /// A predefined style preset that applies a specific artistic style to the generated image.
- /// Example: BRIGHT_ART - /// - /// - /// A custom model URI in the format model/<model_name>/version/<version_name>.
- /// When provided, the model version and style will be resolved from this URI, and style_type is not required.
- /// Example: model/my-custom-model/version/1 - /// - /// - /// A set of images to use as style references (max size 25MB per image; the whole request must stay under 50MB). The images should be in JPEG, PNG or WebP format. - /// - /// - /// Optional file names to use for the multipart 'style_reference_images' file parts. - /// - /// - /// Generations with character reference are subject to the character reference pricing. A set of images to use as character references (max size 25MB per image; the whole request must stay under 50MB), currently only supports 1 character reference image. The images should be in JPEG, PNG or WebP format. - /// - /// - /// Optional file names to use for the multipart 'character_reference_images' file parts. - /// - /// - /// Optional masks for character reference images. When provided, must match the number of character_reference_images. Each mask should be a grayscale image of the same dimensions as the corresponding character reference image. The images should be in JPEG, PNG or WebP format. - /// - /// - /// Optional file names to use for the multipart 'character_reference_images_mask' file parts. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostRemixImageV3Async( - global::System.IO.Stream image, - string imagename, - string prompt, - int? imageWeight = default, - int? seed = default, - global::Ideogram.ResolutionV3? resolution = default, - global::Ideogram.AspectRatioV3? aspectRatio = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - global::Ideogram.MagicPromptOption? magicPrompt = default, - string? magicPromptSystemPromptConfigId = default, - string? negativePrompt = default, - int? numImages = default, - global::Ideogram.ColorPaletteWithPresetNameOrMembers? colorPalette = default, - global::System.Collections.Generic.IList? styleCodes = default, - global::Ideogram.StyleTypeV3? styleType = default, - global::Ideogram.StylePresetV3? stylePreset = default, - string? customModelUri = default, - global::System.Collections.Generic.IReadOnlyList? styleReferenceImages = default, - global::System.Collections.Generic.IReadOnlyList? styleReferenceImagesFileNames = default, - global::System.Collections.Generic.IReadOnlyList? characterReferenceImages = default, - global::System.Collections.Generic.IReadOnlyList? characterReferenceImagesFileNames = default, - global::System.Collections.Generic.IReadOnlyList? characterReferenceImagesMask = default, - global::System.Collections.Generic.IReadOnlyList? characterReferenceImagesMaskFileNames = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Remix with Ideogram 3.0
- /// Remix provided images synchronously based on a given prompt and optional parameters with the Ideogram 3.0 model.
- /// Input images are cropped to the chosen aspect ratio before being remixed.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The image to remix binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The image to remix binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The prompt to use to generate the image.
- /// Example: A photo of a cat - /// - /// - /// Default Value: 50
- /// Example: 50 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The resolutions supported for Ideogram 3.0.
- /// Example: 1280x800 - /// - /// - /// Output aspect ratio. Cannot be combined with resolution. Generation defaults to 1x1; remix keeps the source ratio when both fields are omitted. - /// - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// Description of what to exclude from an image. Descriptions in the prompt take precedence
- /// to descriptions in the negative prompt.
- /// Example: brush strokes, painting - /// - /// - /// Number of images to generate.
- /// Default Value: 1 - /// - /// - /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). Not supported by V_1, V_1_TURBO, V_2A and V_2A_TURBO models. - /// - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - /// - /// - /// The style type to generate with.
- /// Default Value: GENERAL
- /// Example: GENERAL - /// - /// - /// A predefined style preset that applies a specific artistic style to the generated image.
- /// Example: BRIGHT_ART - /// - /// - /// A custom model URI in the format model/<model_name>/version/<version_name>.
- /// When provided, the model version and style will be resolved from this URI, and style_type is not required.
- /// Example: model/my-custom-model/version/1 - /// - /// - /// A set of images to use as style references (max size 25MB per image; the whole request must stay under 50MB). The images should be in JPEG, PNG or WebP format. - /// - /// - /// Optional file names to use for the multipart 'style_reference_images' file parts. - /// - /// - /// Generations with character reference are subject to the character reference pricing. A set of images to use as character references (max size 25MB per image; the whole request must stay under 50MB), currently only supports 1 character reference image. The images should be in JPEG, PNG or WebP format. - /// - /// - /// Optional file names to use for the multipart 'character_reference_images' file parts. - /// - /// - /// Optional masks for character reference images. When provided, must match the number of character_reference_images. Each mask should be a grayscale image of the same dimensions as the corresponding character reference image. The images should be in JPEG, PNG or WebP format. - /// - /// - /// Optional file names to use for the multipart 'character_reference_images_mask' file parts. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostRemixImageV3AsResponseAsync( - global::System.IO.Stream image, - string imagename, - string prompt, - int? imageWeight = default, - int? seed = default, - global::Ideogram.ResolutionV3? resolution = default, - global::Ideogram.AspectRatioV3? aspectRatio = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - global::Ideogram.MagicPromptOption? magicPrompt = default, - string? magicPromptSystemPromptConfigId = default, - string? negativePrompt = default, - int? numImages = default, - global::Ideogram.ColorPaletteWithPresetNameOrMembers? colorPalette = default, - global::System.Collections.Generic.IList? styleCodes = default, - global::Ideogram.StyleTypeV3? styleType = default, - global::Ideogram.StylePresetV3? stylePreset = default, - string? customModelUri = default, - global::System.Collections.Generic.IReadOnlyList? styleReferenceImages = default, - global::System.Collections.Generic.IReadOnlyList? styleReferenceImagesFileNames = default, - global::System.Collections.Generic.IReadOnlyList? characterReferenceImages = default, - global::System.Collections.Generic.IReadOnlyList? characterReferenceImagesFileNames = default, - global::System.Collections.Generic.IReadOnlyList? characterReferenceImagesMask = default, - global::System.Collections.Generic.IReadOnlyList? characterReferenceImagesMaskFileNames = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostRemixImageV4.g.cs b/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostRemixImageV4.g.cs deleted file mode 100644 index b9572065..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostRemixImageV4.g.cs +++ /dev/null @@ -1,191 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IGenerateClient - { - /// - /// Remix with Ideogram 4.0
- /// Remix an image synchronously using the Ideogram 4.0 model with an initial image and a prompt.
- /// Mirrors `/v1/ideogram-v3/remix` semantics (including `image_weight` for how strongly the
- /// output should resemble the input image) but routes the request through the V_4_0 model.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostRemixImageV4Async( - - global::Ideogram.RemixImageRequestV4 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Remix with Ideogram 4.0
- /// Remix an image synchronously using the Ideogram 4.0 model with an initial image and a prompt.
- /// Mirrors `/v1/ideogram-v3/remix` semantics (including `image_weight` for how strongly the
- /// output should resemble the input image) but routes the request through the V_4_0 model.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostRemixImageV4AsResponseAsync( - - global::Ideogram.RemixImageRequestV4 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Remix with Ideogram 4.0
- /// Remix an image synchronously using the Ideogram 4.0 model with an initial image and a prompt.
- /// Mirrors `/v1/ideogram-v3/remix` semantics (including `image_weight` for how strongly the
- /// output should resemble the input image) but routes the request through the V_4_0 model.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The initial image binary (max 25MB); only JPEG, WebP and PNG formats are supported. - /// - /// - /// The initial image binary (max 25MB); only JPEG, WebP and PNG formats are supported. - /// - /// - /// The text prompt that guides the remix. - /// - /// - /// Optional. How strongly the output should resemble the input image. Higher values keep
- /// the input image's structure; lower values allow the prompt to drive the output more.
- /// When omitted, the weight is chosen automatically from the edit instruction; supplying
- /// a value overrides that automatic choice. Only accepted when the output keeps the input
- /// image's shape: combining image_weight with a resolution whose aspect ratio differs
- /// from the input image's is rejected with a 400. - /// - /// - /// Optional. When supplied, the images are generated at this resolution. When omitted,
- /// the input image's shape is kept. A resolution whose aspect ratio differs from the
- /// input image's cannot be combined with image_weight. - /// - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - /// - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). See GenerateImageRequestV3 for details. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostRemixImageV4Async( - byte[] image, - string imagename, - string textPrompt, - int? imageWeight = default, - global::Ideogram.ResolutionV4? resolution = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - bool? enableCopyrightDetection = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - - /// - /// Remix with Ideogram 4.0
- /// Remix an image synchronously using the Ideogram 4.0 model with an initial image and a prompt.
- /// Mirrors `/v1/ideogram-v3/remix` semantics (including `image_weight` for how strongly the
- /// output should resemble the input image) but routes the request through the V_4_0 model.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The initial image binary (max 25MB); only JPEG, WebP and PNG formats are supported. - /// - /// - /// The initial image binary (max 25MB); only JPEG, WebP and PNG formats are supported. - /// - /// - /// The text prompt that guides the remix. - /// - /// - /// Optional. How strongly the output should resemble the input image. Higher values keep
- /// the input image's structure; lower values allow the prompt to drive the output more.
- /// When omitted, the weight is chosen automatically from the edit instruction; supplying
- /// a value overrides that automatic choice. Only accepted when the output keeps the input
- /// image's shape: combining image_weight with a resolution whose aspect ratio differs
- /// from the input image's is rejected with a 400. - /// - /// - /// Optional. When supplied, the images are generated at this resolution. When omitted,
- /// the input image's shape is kept. A resolution whose aspect ratio differs from the
- /// input image's cannot be combined with image_weight. - /// - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - /// - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). See GenerateImageRequestV3 for details. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostRemixImageV4Async( - global::System.IO.Stream image, - string imagename, - string textPrompt, - int? imageWeight = default, - global::Ideogram.ResolutionV4? resolution = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - bool? enableCopyrightDetection = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Remix with Ideogram 4.0
- /// Remix an image synchronously using the Ideogram 4.0 model with an initial image and a prompt.
- /// Mirrors `/v1/ideogram-v3/remix` semantics (including `image_weight` for how strongly the
- /// output should resemble the input image) but routes the request through the V_4_0 model.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The initial image binary (max 25MB); only JPEG, WebP and PNG formats are supported. - /// - /// - /// The initial image binary (max 25MB); only JPEG, WebP and PNG formats are supported. - /// - /// - /// The text prompt that guides the remix. - /// - /// - /// Optional. How strongly the output should resemble the input image. Higher values keep
- /// the input image's structure; lower values allow the prompt to drive the output more.
- /// When omitted, the weight is chosen automatically from the edit instruction; supplying
- /// a value overrides that automatic choice. Only accepted when the output keeps the input
- /// image's shape: combining image_weight with a resolution whose aspect ratio differs
- /// from the input image's is rejected with a 400. - /// - /// - /// Optional. When supplied, the images are generated at this resolution. When omitted,
- /// the input image's shape is kept. A resolution whose aspect ratio differs from the
- /// input image's cannot be combined with image_weight. - /// - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - /// - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). See GenerateImageRequestV3 for details. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostRemixImageV4AsResponseAsync( - global::System.IO.Stream image, - string imagename, - string textPrompt, - int? imageWeight = default, - global::Ideogram.ResolutionV4? resolution = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - bool? enableCopyrightDetection = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostRemixImageV4Async.g.cs b/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostRemixImageV4Async.g.cs deleted file mode 100644 index 6504c591..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostRemixImageV4Async.g.cs +++ /dev/null @@ -1,251 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IGenerateClient - { - /// - /// Remix with Ideogram 4.0 asynchronously
- /// Accepts an Ideogram 4.0 remix request for asynchronous processing and returns
- /// immediately with a `generation_id`. Poll `GET /v1/generations/{generation_id}`
- /// to retrieve the result. If a `webhook_url` is supplied, the generated images
- /// are additionally POSTed to it once ready. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostRemixImageV4AsyncAsync( - - global::Ideogram.RemixImageRequestV4 request, - string? webhookUrl = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Remix with Ideogram 4.0 asynchronously
- /// Accepts an Ideogram 4.0 remix request for asynchronous processing and returns
- /// immediately with a `generation_id`. Poll `GET /v1/generations/{generation_id}`
- /// to retrieve the result. If a `webhook_url` is supplied, the generated images
- /// are additionally POSTed to it once ready. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostRemixImageV4AsyncAsResponseAsync( - - global::Ideogram.RemixImageRequestV4 request, - string? webhookUrl = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Remix with Ideogram 4.0 asynchronously
- /// Accepts an Ideogram 4.0 remix request for asynchronous processing and returns
- /// immediately with a `generation_id`. Poll `GET /v1/generations/{generation_id}`
- /// to retrieve the result. If a `webhook_url` is supplied, the generated images
- /// are additionally POSTed to it once ready. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// The initial image binary (max 25MB); only JPEG, WebP and PNG formats are supported. - /// - /// - /// The initial image binary (max 25MB); only JPEG, WebP and PNG formats are supported. - /// - /// - /// The text prompt that guides the remix. - /// - /// - /// Optional. How strongly the output should resemble the input image. Higher values keep
- /// the input image's structure; lower values allow the prompt to drive the output more.
- /// When omitted, the weight is chosen automatically from the edit instruction; supplying
- /// a value overrides that automatic choice. Only accepted when the output keeps the input
- /// image's shape: combining image_weight with a resolution whose aspect ratio differs
- /// from the input image's is rejected with a 400. - /// - /// - /// Optional. When supplied, the images are generated at this resolution. When omitted,
- /// the input image's shape is kept. A resolution whose aspect ratio differs from the
- /// input image's cannot be combined with image_weight. - /// - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - /// - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). See GenerateImageRequestV3 for details. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostRemixImageV4AsyncAsync( - byte[] image, - string imagename, - string textPrompt, - string? webhookUrl = default, - int? imageWeight = default, - global::Ideogram.ResolutionV4? resolution = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - bool? enableCopyrightDetection = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - - /// - /// Remix with Ideogram 4.0 asynchronously
- /// Accepts an Ideogram 4.0 remix request for asynchronous processing and returns
- /// immediately with a `generation_id`. Poll `GET /v1/generations/{generation_id}`
- /// to retrieve the result. If a `webhook_url` is supplied, the generated images
- /// are additionally POSTed to it once ready. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// The initial image binary (max 25MB); only JPEG, WebP and PNG formats are supported. - /// - /// - /// The initial image binary (max 25MB); only JPEG, WebP and PNG formats are supported. - /// - /// - /// The text prompt that guides the remix. - /// - /// - /// Optional. How strongly the output should resemble the input image. Higher values keep
- /// the input image's structure; lower values allow the prompt to drive the output more.
- /// When omitted, the weight is chosen automatically from the edit instruction; supplying
- /// a value overrides that automatic choice. Only accepted when the output keeps the input
- /// image's shape: combining image_weight with a resolution whose aspect ratio differs
- /// from the input image's is rejected with a 400. - /// - /// - /// Optional. When supplied, the images are generated at this resolution. When omitted,
- /// the input image's shape is kept. A resolution whose aspect ratio differs from the
- /// input image's cannot be combined with image_weight. - /// - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - /// - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). See GenerateImageRequestV3 for details. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostRemixImageV4AsyncAsync( - global::System.IO.Stream image, - string imagename, - string textPrompt, - string? webhookUrl = default, - int? imageWeight = default, - global::Ideogram.ResolutionV4? resolution = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - bool? enableCopyrightDetection = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Remix with Ideogram 4.0 asynchronously
- /// Accepts an Ideogram 4.0 remix request for asynchronous processing and returns
- /// immediately with a `generation_id`. Poll `GET /v1/generations/{generation_id}`
- /// to retrieve the result. If a `webhook_url` is supplied, the generated images
- /// are additionally POSTed to it once ready. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// The initial image binary (max 25MB); only JPEG, WebP and PNG formats are supported. - /// - /// - /// The initial image binary (max 25MB); only JPEG, WebP and PNG formats are supported. - /// - /// - /// The text prompt that guides the remix. - /// - /// - /// Optional. How strongly the output should resemble the input image. Higher values keep
- /// the input image's structure; lower values allow the prompt to drive the output more.
- /// When omitted, the weight is chosen automatically from the edit instruction; supplying
- /// a value overrides that automatic choice. Only accepted when the output keeps the input
- /// image's shape: combining image_weight with a resolution whose aspect ratio differs
- /// from the input image's is rejected with a 400. - /// - /// - /// Optional. When supplied, the images are generated at this resolution. When omitted,
- /// the input image's shape is kept. A resolution whose aspect ratio differs from the
- /// input image's cannot be combined with image_weight. - /// - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - /// - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). See GenerateImageRequestV3 for details. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostRemixImageV4AsyncAsResponseAsync( - global::System.IO.Stream image, - string imagename, - string textPrompt, - string? webhookUrl = default, - int? imageWeight = default, - global::Ideogram.ResolutionV4? resolution = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - bool? enableCopyrightDetection = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostRemoveBackground.g.cs b/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostRemoveBackground.g.cs deleted file mode 100644 index fc4f68e3..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostRemoveBackground.g.cs +++ /dev/null @@ -1,109 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IGenerateClient - { - /// - /// Remove Background
- /// Remove the background of a given image synchronously. The foreground subject
- /// is identified and returned on a transparent background. Supported image formats include JPEG,
- /// PNG, and WebP.
- /// Image links are available for a limited period of time; if you would like to keep the image,
- /// you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostRemoveBackgroundAsync( - - global::Ideogram.RemoveBackgroundRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Remove Background
- /// Remove the background of a given image synchronously. The foreground subject
- /// is identified and returned on a transparent background. Supported image formats include JPEG,
- /// PNG, and WebP.
- /// Image links are available for a limited period of time; if you would like to keep the image,
- /// you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostRemoveBackgroundAsResponseAsync( - - global::Ideogram.RemoveBackgroundRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Remove Background
- /// Remove the background of a given image synchronously. The foreground subject
- /// is identified and returned on a transparent background. Supported image formats include JPEG,
- /// PNG, and WebP.
- /// Image links are available for a limited period of time; if you would like to keep the image,
- /// you must download it. - ///
- /// - /// The image whose background is being removed (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The image whose background is being removed (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostRemoveBackgroundAsync( - byte[] image, - string imagename, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - - /// - /// Remove Background
- /// Remove the background of a given image synchronously. The foreground subject
- /// is identified and returned on a transparent background. Supported image formats include JPEG,
- /// PNG, and WebP.
- /// Image links are available for a limited period of time; if you would like to keep the image,
- /// you must download it. - ///
- /// - /// The image whose background is being removed (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The image whose background is being removed (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostRemoveBackgroundAsync( - global::System.IO.Stream image, - string imagename, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Remove Background
- /// Remove the background of a given image synchronously. The foreground subject
- /// is identified and returned on a transparent background. Supported image formats include JPEG,
- /// PNG, and WebP.
- /// Image links are available for a limited period of time; if you would like to keep the image,
- /// you must download it. - ///
- /// - /// The image whose background is being removed (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The image whose background is being removed (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostRemoveBackgroundAsResponseAsync( - global::System.IO.Stream image, - string imagename, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostRemoveObject.g.cs b/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostRemoveObject.g.cs deleted file mode 100644 index d71e7c67..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostRemoveObject.g.cs +++ /dev/null @@ -1,164 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IGenerateClient - { - /// - /// Remove Object
- /// Remove a masked object from a given image synchronously. Supply the image and a binary mask marking the region to remove (white = remove); the masked region is regenerated to blend with the surrounding scene. Supported image formats include JPEG, PNG, and WebP. Image links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostRemoveObjectAsync( - - global::Ideogram.RemoveObjectRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Remove Object
- /// Remove a masked object from a given image synchronously. Supply the image and a binary mask marking the region to remove (white = remove); the masked region is regenerated to blend with the surrounding scene. Supported image formats include JPEG, PNG, and WebP. Image links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostRemoveObjectAsResponseAsync( - - global::Ideogram.RemoveObjectRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Remove Object
- /// Remove a masked object from a given image synchronously. Supply the image and a binary mask marking the region to remove (white = remove); the masked region is regenerated to blend with the surrounding scene. Supported image formats include JPEG, PNG, and WebP. Image links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The image to remove an object from (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The image to remove an object from (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// A binary mask the same size as the image; white (>= 128) marks the region to remove. Only JPEG, WebP and PNG formats are supported. - /// - /// - /// A binary mask the same size as the image; white (>= 128) marks the region to remove. Only JPEG, WebP and PNG formats are supported. - /// - /// - /// Optional random seed for reproducible output. When omitted, a random seed is chosen. - /// - /// - /// Optional number of diffusion steps. Higher is slower but can improve quality; values are clamped to [1, 128]. When omitted, the model default is used. - /// - /// - /// Optional classifier-free guidance (CFG) scale. Higher follows the removal instruction more strongly; values are clamped to [1, 10]. When omitted, the model default is used. - /// - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostRemoveObjectAsync( - byte[] image, - string imagename, - byte[] mask, - string maskname, - int? seed = default, - int? numInferenceSteps = default, - float? guidanceScale = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - - /// - /// Remove Object
- /// Remove a masked object from a given image synchronously. Supply the image and a binary mask marking the region to remove (white = remove); the masked region is regenerated to blend with the surrounding scene. Supported image formats include JPEG, PNG, and WebP. Image links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The image to remove an object from (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The image to remove an object from (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// A binary mask the same size as the image; white (>= 128) marks the region to remove. Only JPEG, WebP and PNG formats are supported. - /// - /// - /// A binary mask the same size as the image; white (>= 128) marks the region to remove. Only JPEG, WebP and PNG formats are supported. - /// - /// - /// Optional random seed for reproducible output. When omitted, a random seed is chosen. - /// - /// - /// Optional number of diffusion steps. Higher is slower but can improve quality; values are clamped to [1, 128]. When omitted, the model default is used. - /// - /// - /// Optional classifier-free guidance (CFG) scale. Higher follows the removal instruction more strongly; values are clamped to [1, 10]. When omitted, the model default is used. - /// - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostRemoveObjectAsync( - global::System.IO.Stream image, - string imagename, - global::System.IO.Stream mask, - string maskname, - int? seed = default, - int? numInferenceSteps = default, - float? guidanceScale = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Remove Object
- /// Remove a masked object from a given image synchronously. Supply the image and a binary mask marking the region to remove (white = remove); the masked region is regenerated to blend with the surrounding scene. Supported image formats include JPEG, PNG, and WebP. Image links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The image to remove an object from (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The image to remove an object from (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// A binary mask the same size as the image; white (>= 128) marks the region to remove. Only JPEG, WebP and PNG formats are supported. - /// - /// - /// A binary mask the same size as the image; white (>= 128) marks the region to remove. Only JPEG, WebP and PNG formats are supported. - /// - /// - /// Optional random seed for reproducible output. When omitted, a random seed is chosen. - /// - /// - /// Optional number of diffusion steps. Higher is slower but can improve quality; values are clamped to [1, 128]. When omitted, the model default is used. - /// - /// - /// Optional classifier-free guidance (CFG) scale. Higher follows the removal instruction more strongly; values are clamped to [1, 10]. When omitted, the model default is used. - /// - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostRemoveObjectAsResponseAsync( - global::System.IO.Stream image, - string imagename, - global::System.IO.Stream mask, - string maskname, - int? seed = default, - int? numInferenceSteps = default, - float? guidanceScale = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostReplaceBackgroundV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostReplaceBackgroundV3.g.cs deleted file mode 100644 index 9714ab3f..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostReplaceBackgroundV3.g.cs +++ /dev/null @@ -1,253 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IGenerateClient - { - /// - /// Replace Background with Ideogram 3.0
- /// Replace the background of a given image synchronously using a prompt with Ideogram 3.0. The foreground subject
- /// will be identified and kept, while the background is replaced based on the prompt and chosen style.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostReplaceBackgroundV3Async( - - global::Ideogram.ReplaceBackgroundRequestV3 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Replace Background with Ideogram 3.0
- /// Replace the background of a given image synchronously using a prompt with Ideogram 3.0. The foreground subject
- /// will be identified and kept, while the background is replaced based on the prompt and chosen style.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostReplaceBackgroundV3AsResponseAsync( - - global::Ideogram.ReplaceBackgroundRequestV3 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Replace Background with Ideogram 3.0
- /// Replace the background of a given image synchronously using a prompt with Ideogram 3.0. The foreground subject
- /// will be identified and kept, while the background is replaced based on the prompt and chosen style.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The image whose background is being replaced (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The image whose background is being replaced (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The prompt describing the desired new background.
- /// Example: A vibrant cityscape at night. - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - /// - /// - /// A predefined style preset that applies a specific artistic style to the generated image.
- /// Example: BRIGHT_ART - /// - /// - /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). Not supported by V_1, V_1_TURBO, V_2A and V_2A_TURBO models. - /// - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - /// - /// - /// A set of images to use as style references (max size 25MB per image; the whole request must stay under 50MB). The images should be in JPEG, PNG or WebP format. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostReplaceBackgroundV3Async( - byte[] image, - string imagename, - string prompt, - global::Ideogram.MagicPromptOption? magicPrompt = default, - string? magicPromptSystemPromptConfigId = default, - int? numImages = default, - int? seed = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - global::Ideogram.StylePresetV3? stylePreset = default, - global::Ideogram.ColorPaletteWithPresetNameOrMembers? colorPalette = default, - global::System.Collections.Generic.IList? styleCodes = default, - global::System.Collections.Generic.IList? styleReferenceImages = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - - /// - /// Replace Background with Ideogram 3.0
- /// Replace the background of a given image synchronously using a prompt with Ideogram 3.0. The foreground subject
- /// will be identified and kept, while the background is replaced based on the prompt and chosen style.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The image whose background is being replaced (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The image whose background is being replaced (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The prompt describing the desired new background.
- /// Example: A vibrant cityscape at night. - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - /// - /// - /// A predefined style preset that applies a specific artistic style to the generated image.
- /// Example: BRIGHT_ART - /// - /// - /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). Not supported by V_1, V_1_TURBO, V_2A and V_2A_TURBO models. - /// - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - /// - /// - /// A set of images to use as style references (max size 25MB per image; the whole request must stay under 50MB). The images should be in JPEG, PNG or WebP format. - /// - /// - /// Optional file names to use for the multipart 'style_reference_images' file parts. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostReplaceBackgroundV3Async( - global::System.IO.Stream image, - string imagename, - string prompt, - global::Ideogram.MagicPromptOption? magicPrompt = default, - string? magicPromptSystemPromptConfigId = default, - int? numImages = default, - int? seed = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - global::Ideogram.StylePresetV3? stylePreset = default, - global::Ideogram.ColorPaletteWithPresetNameOrMembers? colorPalette = default, - global::System.Collections.Generic.IList? styleCodes = default, - global::System.Collections.Generic.IReadOnlyList? styleReferenceImages = default, - global::System.Collections.Generic.IReadOnlyList? styleReferenceImagesFileNames = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Replace Background with Ideogram 3.0
- /// Replace the background of a given image synchronously using a prompt with Ideogram 3.0. The foreground subject
- /// will be identified and kept, while the background is replaced based on the prompt and chosen style.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The image whose background is being replaced (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The image whose background is being replaced (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The prompt describing the desired new background.
- /// Example: A vibrant cityscape at night. - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - /// - /// - /// A predefined style preset that applies a specific artistic style to the generated image.
- /// Example: BRIGHT_ART - /// - /// - /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). Not supported by V_1, V_1_TURBO, V_2A and V_2A_TURBO models. - /// - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - /// - /// - /// A set of images to use as style references (max size 25MB per image; the whole request must stay under 50MB). The images should be in JPEG, PNG or WebP format. - /// - /// - /// Optional file names to use for the multipart 'style_reference_images' file parts. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostReplaceBackgroundV3AsResponseAsync( - global::System.IO.Stream image, - string imagename, - string prompt, - global::Ideogram.MagicPromptOption? magicPrompt = default, - string? magicPromptSystemPromptConfigId = default, - int? numImages = default, - int? seed = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - global::Ideogram.StylePresetV3? stylePreset = default, - global::Ideogram.ColorPaletteWithPresetNameOrMembers? colorPalette = default, - global::System.Collections.Generic.IList? styleCodes = default, - global::System.Collections.Generic.IReadOnlyList? styleReferenceImages = default, - global::System.Collections.Generic.IReadOnlyList? styleReferenceImagesFileNames = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostResizeImageAsync.g.cs b/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostResizeImageAsync.g.cs deleted file mode 100644 index 573df9a3..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostResizeImageAsync.g.cs +++ /dev/null @@ -1,157 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IGenerateClient - { - /// - /// Advertisement Resizer
- /// Resizes an advertisement image to the exact target size. Supply `prompt`
- /// to provide specific instructions for how the advertisement should look
- /// after resizing.
- /// The request is processed asynchronously and immediately returns a
- /// `generation_id`. Poll `GET /v1/generations/{generation_id}` until `status`
- /// is `completed` or `failed`. The completed polling response contains the
- /// final resized image(s) in `data` and the amount charged for variable
- /// usage-based pricing in `usage_cost_usd_micros`. If a `webhook_url` is
- /// supplied, the completed result is also POSTed to that URL.
- /// Supply the advertisement image as raw `image` bytes via
- /// `multipart/form-data`.
- /// The required `resolution` (`WIDTHxHEIGHT`) sets the exact output
- /// dimensions.
- /// The model is fixed by the route, so no `model` field is accepted. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostResizeImageAsyncAsync( - - global::Ideogram.ResizeAdImageRequest request, - string? webhookUrl = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Advertisement Resizer
- /// Resizes an advertisement image to the exact target size. Supply `prompt`
- /// to provide specific instructions for how the advertisement should look
- /// after resizing.
- /// The request is processed asynchronously and immediately returns a
- /// `generation_id`. Poll `GET /v1/generations/{generation_id}` until `status`
- /// is `completed` or `failed`. The completed polling response contains the
- /// final resized image(s) in `data` and the amount charged for variable
- /// usage-based pricing in `usage_cost_usd_micros`. If a `webhook_url` is
- /// supplied, the completed result is also POSTed to that URL.
- /// Supply the advertisement image as raw `image` bytes via
- /// `multipart/form-data`.
- /// The required `resolution` (`WIDTHxHEIGHT`) sets the exact output
- /// dimensions.
- /// The model is fixed by the route, so no `model` field is accepted. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostResizeImageAsyncAsResponseAsync( - - global::Ideogram.ResizeAdImageRequest request, - string? webhookUrl = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Advertisement Resizer
- /// Resizes an advertisement image to the exact target size. Supply `prompt`
- /// to provide specific instructions for how the advertisement should look
- /// after resizing.
- /// The request is processed asynchronously and immediately returns a
- /// `generation_id`. Poll `GET /v1/generations/{generation_id}` until `status`
- /// is `completed` or `failed`. The completed polling response contains the
- /// final resized image(s) in `data` and the amount charged for variable
- /// usage-based pricing in `usage_cost_usd_micros`. If a `webhook_url` is
- /// supplied, the completed result is also POSTed to that URL.
- /// Supply the advertisement image as raw `image` bytes via
- /// `multipart/form-data`.
- /// The required `resolution` (`WIDTHxHEIGHT`) sets the exact output
- /// dimensions.
- /// The model is fixed by the route, so no `model` field is accepted. - ///
- /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// The source image asset to reframe, by reference. Provide exactly one of `image_asset_identifier` or `image`. - /// - /// - /// The source image to reframe (max size 25MB), as raw bytes; only JPEG, PNG, and WEBP formats are supported. - /// - /// - /// The source image to reframe (max size 25MB), as raw bytes; only JPEG, PNG, and WEBP formats are supported. - /// - /// - /// Target ad resolution, formatted as `WIDTHxHEIGHT`. Must be one of
- /// the supported ad resolutions listed above; any other value is
- /// rejected with a 400. Each returned image has exactly these pixel
- /// dimensions. - /// - /// - /// Optional edit instruction to apply while reframing, for example "remove the logo" or "put the price bottom-right". - /// - /// - /// Output quality tier. Higher tiers generally improve detail and may take longer to complete. Supported values are LOW, MEDIUM, and HIGH.
- /// Default Value: HIGH - /// - /// - /// The number of reframed variations to generate.
- /// Default Value: 1 - /// - /// - /// Reserved for a future release: accepted for forward compatibility but not yet applied. Resulting assets are not stored to your account regardless of this value.
- /// Default Value: false - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostResizeImageAsyncAsync( - global::Ideogram.ResizeAdImageRequestResolution resolution, - string? webhookUrl = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - string? prompt = default, - global::Ideogram.ResizeAdImageQuality? quality = default, - int? numImages = default, - bool? storeAssets = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostSnapMask.g.cs b/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostSnapMask.g.cs deleted file mode 100644 index 45719cae..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostSnapMask.g.cs +++ /dev/null @@ -1,152 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IGenerateClient - { - /// - /// Snap a hand-drawn mask to the selected object
- /// Refine a hand-drawn binary mask to the object it marks. Supply the source image and a mask with the same dimensions; white (>= 128) marks the object. The response is a binary PNG mask with white pixels marking the snapped object. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostSnapMaskAsync( - - global::Ideogram.SnapMaskRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Snap a hand-drawn mask to the selected object
- /// Refine a hand-drawn binary mask to the object it marks. Supply the source image and a mask with the same dimensions; white (>= 128) marks the object. The response is a binary PNG mask with white pixels marking the snapped object. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostSnapMaskAsStreamAsync( - - global::Ideogram.SnapMaskRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Snap a hand-drawn mask to the selected object
- /// Refine a hand-drawn binary mask to the object it marks. Supply the source image and a mask with the same dimensions; white (>= 128) marks the object. The response is a binary PNG mask with white pixels marking the snapped object. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostSnapMaskAsResponseAsync( - - global::Ideogram.SnapMaskRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Snap a hand-drawn mask to the selected object
- /// Refine a hand-drawn binary mask to the object it marks. Supply the source image and a mask with the same dimensions; white (>= 128) marks the object. The response is a binary PNG mask with white pixels marking the snapped object. - ///
- /// - /// The source image containing the object (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The source image containing the object (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// A hand-drawn binary mask the same size as the image; white (>= 128) marks the object to snap. Only JPEG, WebP and PNG formats are supported. - /// - /// - /// A hand-drawn binary mask the same size as the image; white (>= 128) marks the object to snap. Only JPEG, WebP and PNG formats are supported. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostSnapMaskAsync( - byte[] image, - string imagename, - byte[] mask, - string maskname, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - - /// - /// Snap a hand-drawn mask to the selected object
- /// Refine a hand-drawn binary mask to the object it marks. Supply the source image and a mask with the same dimensions; white (>= 128) marks the object. The response is a binary PNG mask with white pixels marking the snapped object. - ///
- /// - /// The source image containing the object (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The source image containing the object (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// A hand-drawn binary mask the same size as the image; white (>= 128) marks the object to snap. Only JPEG, WebP and PNG formats are supported. - /// - /// - /// A hand-drawn binary mask the same size as the image; white (>= 128) marks the object to snap. Only JPEG, WebP and PNG formats are supported. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostSnapMaskAsync( - global::System.IO.Stream image, - string imagename, - global::System.IO.Stream mask, - string maskname, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Snap a hand-drawn mask to the selected object
- /// Refine a hand-drawn binary mask to the object it marks. Supply the source image and a mask with the same dimensions; white (>= 128) marks the object. The response is a binary PNG mask with white pixels marking the snapped object. - ///
- /// - /// The source image containing the object (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The source image containing the object (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// A hand-drawn binary mask the same size as the image; white (>= 128) marks the object to snap. Only JPEG, WebP and PNG formats are supported. - /// - /// - /// A hand-drawn binary mask the same size as the image; white (>= 128) marks the object to snap. Only JPEG, WebP and PNG formats are supported. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostSnapMaskAsStreamAsync( - global::System.IO.Stream image, - string imagename, - global::System.IO.Stream mask, - string maskname, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Snap a hand-drawn mask to the selected object
- /// Refine a hand-drawn binary mask to the object it marks. Supply the source image and a mask with the same dimensions; white (>= 128) marks the object. The response is a binary PNG mask with white pixels marking the snapped object. - ///
- /// - /// The source image containing the object (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The source image containing the object (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// A hand-drawn binary mask the same size as the image; white (>= 128) marks the object to snap. Only JPEG, WebP and PNG formats are supported. - /// - /// - /// A hand-drawn binary mask the same size as the image; white (>= 128) marks the object to snap. Only JPEG, WebP and PNG formats are supported. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostSnapMaskAsResponseAsync( - global::System.IO.Stream image, - string imagename, - global::System.IO.Stream mask, - string maskname, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostTryOnV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostTryOnV3.g.cs deleted file mode 100644 index 07c7db5d..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostTryOnV3.g.cs +++ /dev/null @@ -1,252 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IGenerateClient - { - /// - /// Virtual Try-On with Ideogram 3.0
- /// Performs virtual clothing try-on by automatically segmenting the clothing in the provided image
- /// and replacing it based on the prompt. The user provides an image and an optional prompt describing
- /// the desired clothing change (e.g., "change his shirt to a pink shirt").
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostTryOnV3Async( - - global::Ideogram.TryOnRequestV3 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Virtual Try-On with Ideogram 3.0
- /// Performs virtual clothing try-on by automatically segmenting the clothing in the provided image
- /// and replacing it based on the prompt. The user provides an image and an optional prompt describing
- /// the desired clothing change (e.g., "change his shirt to a pink shirt").
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostTryOnV3AsResponseAsync( - - global::Ideogram.TryOnRequestV3 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Virtual Try-On with Ideogram 3.0
- /// Performs virtual clothing try-on by automatically segmenting the clothing in the provided image
- /// and replacing it based on the prompt. The user provides an image and an optional prompt describing
- /// the desired clothing change (e.g., "change his shirt to a pink shirt").
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The image containing a person wearing clothing to be modified (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The image containing a person wearing clothing to be modified (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The prompt describing the desired clothing change. Defaults to "Person wearing this piece of clothing" if omitted or empty.
- /// Default Value: Person wearing this piece of clothing
- /// Example: Change his shirt to a pink shirt - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - /// - /// - /// The style type to generate with.
- /// Default Value: GENERAL
- /// Example: GENERAL - /// - /// - /// A predefined style preset that applies a specific artistic style to the generated image.
- /// Example: BRIGHT_ART - /// - /// - /// An image to use as the product reference for the try-on (exactly 1 image required). The image should be in JPEG, PNG or WebP format. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostTryOnV3Async( - byte[] image, - string imagename, - global::System.Collections.Generic.IList productReferenceImages, - string? prompt = default, - global::Ideogram.MagicPromptOption? magicPrompt = default, - string? magicPromptSystemPromptConfigId = default, - int? numImages = default, - int? seed = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - global::Ideogram.StyleTypeV3? styleType = default, - global::Ideogram.StylePresetV3? stylePreset = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - - /// - /// Virtual Try-On with Ideogram 3.0
- /// Performs virtual clothing try-on by automatically segmenting the clothing in the provided image
- /// and replacing it based on the prompt. The user provides an image and an optional prompt describing
- /// the desired clothing change (e.g., "change his shirt to a pink shirt").
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The image containing a person wearing clothing to be modified (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The image containing a person wearing clothing to be modified (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The prompt describing the desired clothing change. Defaults to "Person wearing this piece of clothing" if omitted or empty.
- /// Default Value: Person wearing this piece of clothing
- /// Example: Change his shirt to a pink shirt - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - /// - /// - /// The style type to generate with.
- /// Default Value: GENERAL
- /// Example: GENERAL - /// - /// - /// A predefined style preset that applies a specific artistic style to the generated image.
- /// Example: BRIGHT_ART - /// - /// - /// An image to use as the product reference for the try-on (exactly 1 image required). The image should be in JPEG, PNG or WebP format. - /// - /// - /// Optional file names to use for the multipart 'product_reference_images' file parts. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostTryOnV3Async( - global::System.IO.Stream image, - string imagename, - global::System.Collections.Generic.IReadOnlyList productReferenceImages, - string? prompt = default, - global::Ideogram.MagicPromptOption? magicPrompt = default, - string? magicPromptSystemPromptConfigId = default, - int? numImages = default, - int? seed = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - global::Ideogram.StyleTypeV3? styleType = default, - global::Ideogram.StylePresetV3? stylePreset = default, - global::System.Collections.Generic.IReadOnlyList? productReferenceImagesFileNames = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Virtual Try-On with Ideogram 3.0
- /// Performs virtual clothing try-on by automatically segmenting the clothing in the provided image
- /// and replacing it based on the prompt. The user provides an image and an optional prompt describing
- /// the desired clothing change (e.g., "change his shirt to a pink shirt").
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The image containing a person wearing clothing to be modified (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The image containing a person wearing clothing to be modified (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The prompt describing the desired clothing change. Defaults to "Person wearing this piece of clothing" if omitted or empty.
- /// Default Value: Person wearing this piece of clothing
- /// Example: Change his shirt to a pink shirt - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - /// - /// - /// The style type to generate with.
- /// Default Value: GENERAL
- /// Example: GENERAL - /// - /// - /// A predefined style preset that applies a specific artistic style to the generated image.
- /// Example: BRIGHT_ART - /// - /// - /// An image to use as the product reference for the try-on (exactly 1 image required). The image should be in JPEG, PNG or WebP format. - /// - /// - /// Optional file names to use for the multipart 'product_reference_images' file parts. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostTryOnV3AsResponseAsync( - global::System.IO.Stream image, - string imagename, - global::System.Collections.Generic.IReadOnlyList productReferenceImages, - string? prompt = default, - global::Ideogram.MagicPromptOption? magicPrompt = default, - string? magicPromptSystemPromptConfigId = default, - int? numImages = default, - int? seed = default, - global::Ideogram.RenderingSpeed? renderingSpeed = default, - global::Ideogram.StyleTypeV3? styleType = default, - global::Ideogram.StylePresetV3? stylePreset = default, - global::System.Collections.Generic.IReadOnlyList? productReferenceImagesFileNames = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostUpscaleImage.g.cs b/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostUpscaleImage.g.cs deleted file mode 100644 index add8591e..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostUpscaleImage.g.cs +++ /dev/null @@ -1,111 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IGenerateClient - { - /// - /// Upscale
- /// Upscale provided images synchronously with an optional prompt.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostUpscaleImageAsync( - - global::Ideogram.UpscaleImageRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Upscale
- /// Upscale provided images synchronously with an optional prompt.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostUpscaleImageAsResponseAsync( - - global::Ideogram.UpscaleImageRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Upscale
- /// Upscale provided images synchronously with an optional prompt.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// A request to upscale a provided image with the help of an optional prompt. - /// - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostUpscaleImageAsync( - global::Ideogram.UpscaleInitialImageRequest imageRequest, - byte[] imageFile, - string imageFilename, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - - /// - /// Upscale
- /// Upscale provided images synchronously with an optional prompt.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// A request to upscale a provided image with the help of an optional prompt. - /// - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostUpscaleImageAsync( - global::Ideogram.UpscaleInitialImageRequest imageRequest, - global::System.IO.Stream imageFile, - string imageFilename, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Upscale
- /// Upscale provided images synchronously with an optional prompt.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// A request to upscale a provided image with the help of an optional prompt. - /// - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostUpscaleImageAsResponseAsync( - global::Ideogram.UpscaleInitialImageRequest imageRequest, - global::System.IO.Stream imageFile, - string imageFilename, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostV1EditImage.g.cs b/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostV1EditImage.g.cs deleted file mode 100644 index 3b108f7d..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostV1EditImage.g.cs +++ /dev/null @@ -1,101 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IGenerateClient - { - /// - /// Edit images with a prompt
- /// Edit one or more images using a text prompt. Provide images via file upload
- /// or Ideogram image URLs, and describe the desired edit in your prompt.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostV1EditImageAsync( - - global::Ideogram.V1EditImagesRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Edit images with a prompt
- /// Edit one or more images using a text prompt. Provide images via file upload
- /// or Ideogram image URLs, and describe the desired edit in your prompt.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostV1EditImageAsResponseAsync( - - global::Ideogram.V1EditImagesRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Edit images with a prompt
- /// Edit one or more images using a text prompt. Provide images via file upload
- /// or Ideogram image URLs, and describe the desired edit in your prompt.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The prompt describing the desired edit.
- /// Example: Change the background to a beach sunset. - /// - /// - /// Images to edit (max 10 images, max size 25MB each); JPEG, WebP and PNG formats are supported. - /// - /// - /// URLs to Ideogram images to use as references (max 10). Supports URLs from generation responses and image uploads. Alternative to uploading via the images field. - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// The resolutions supported for Ideogram 3.0.
- /// Example: 1280x800 - /// - /// - /// Output aspect ratio. Cannot be combined with resolution. Generation defaults to 1x1; remix keeps the source ratio when both fields are omitted. - /// - /// - /// Whether the output should have a transparent background. Default false.
- /// When more than one image is supplied, the first image is treated as
- /// the image being edited and drives the transparency decision.
- /// Default Value: false - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostV1EditImageAsync( - string prompt, - global::System.Collections.Generic.IList? images = default, - global::System.Collections.Generic.IList? imageUrls = default, - int? numImages = default, - int? seed = default, - global::Ideogram.MagicPromptOption? magicPrompt = default, - string? magicPromptSystemPromptConfigId = default, - global::Ideogram.ResolutionV3? resolution = default, - global::Ideogram.AspectRatioV3? aspectRatio = default, - bool? transparentBackground = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostV1EditLiteImage.g.cs b/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostV1EditLiteImage.g.cs deleted file mode 100644 index fa640a6b..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostV1EditLiteImage.g.cs +++ /dev/null @@ -1,277 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IGenerateClient - { - /// - /// Edit an image with a prompt at lower cost and latency
- /// Edit an image using a text prompt, optimized for lower cost and
- /// latency. Upload the image being edited via the `image` field. Up to 9
- /// additional `reference_images` may be supplied to guide the edit.
- /// Output is always generated at 1K resolution. Input images larger than
- /// 1024px on their long edge are downscaled before processing. The
- /// `aspect_ratio` field controls the output aspect ratio only; when
- /// omitted, the output follows the aspect ratio of the image being
- /// edited.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostV1EditLiteImageAsync( - - global::Ideogram.V1EditLiteImagesRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Edit an image with a prompt at lower cost and latency
- /// Edit an image using a text prompt, optimized for lower cost and
- /// latency. Upload the image being edited via the `image` field. Up to 9
- /// additional `reference_images` may be supplied to guide the edit.
- /// Output is always generated at 1K resolution. Input images larger than
- /// 1024px on their long edge are downscaled before processing. The
- /// `aspect_ratio` field controls the output aspect ratio only; when
- /// omitted, the output follows the aspect ratio of the image being
- /// edited.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostV1EditLiteImageAsResponseAsync( - - global::Ideogram.V1EditLiteImagesRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Edit an image with a prompt at lower cost and latency
- /// Edit an image using a text prompt, optimized for lower cost and
- /// latency. Upload the image being edited via the `image` field. Up to 9
- /// additional `reference_images` may be supplied to guide the edit.
- /// Output is always generated at 1K resolution. Input images larger than
- /// 1024px on their long edge are downscaled before processing. The
- /// `aspect_ratio` field controls the output aspect ratio only; when
- /// omitted, the output follows the aspect ratio of the image being
- /// edited.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The prompt describing the desired edit.
- /// Example: Remove the person from the photo. - /// - /// - /// The image being edited (max size 25MB); JPEG, WebP and PNG formats are supported. - /// - /// - /// The image being edited (max size 25MB); JPEG, WebP and PNG formats are supported. - /// - /// - /// Optional additional reference images to guide the edit (max 9, max size 25MB each); JPEG, WebP and PNG formats are supported. - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// The aspect ratio of the edited output. When omitted, the output
- /// follows the aspect ratio of the image being edited.
- /// Example: 16x9 - /// - /// - /// Controls whether the edited output has a transparent background.
- /// - `TRANSPARENT`: the output is produced with a transparent background.
- /// - `OPAQUE`: the output is produced with an opaque background.
- /// - `AUTO`: the server decides based on the prompt and the image being
- /// edited (e.g. whether it already has a transparent background). This is
- /// the default. When the prompt asks only for background removal, the
- /// output may be the edited image with its background removed.
- /// Default Value: AUTO - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostV1EditLiteImageAsync( - string prompt, - byte[] image, - string imagename, - global::System.Collections.Generic.IList? referenceImages = default, - int? numImages = default, - int? seed = default, - global::Ideogram.MagicPromptOption? magicPrompt = default, - string? magicPromptSystemPromptConfigId = default, - global::Ideogram.AspectRatioEditLite? aspectRatio = default, - global::Ideogram.TransparencyOption? transparency = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - - /// - /// Edit an image with a prompt at lower cost and latency
- /// Edit an image using a text prompt, optimized for lower cost and
- /// latency. Upload the image being edited via the `image` field. Up to 9
- /// additional `reference_images` may be supplied to guide the edit.
- /// Output is always generated at 1K resolution. Input images larger than
- /// 1024px on their long edge are downscaled before processing. The
- /// `aspect_ratio` field controls the output aspect ratio only; when
- /// omitted, the output follows the aspect ratio of the image being
- /// edited.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The prompt describing the desired edit.
- /// Example: Remove the person from the photo. - /// - /// - /// The image being edited (max size 25MB); JPEG, WebP and PNG formats are supported. - /// - /// - /// The image being edited (max size 25MB); JPEG, WebP and PNG formats are supported. - /// - /// - /// Optional additional reference images to guide the edit (max 9, max size 25MB each); JPEG, WebP and PNG formats are supported. - /// - /// - /// Optional file names to use for the multipart 'reference_images' file parts. - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// The aspect ratio of the edited output. When omitted, the output
- /// follows the aspect ratio of the image being edited.
- /// Example: 16x9 - /// - /// - /// Controls whether the edited output has a transparent background.
- /// - `TRANSPARENT`: the output is produced with a transparent background.
- /// - `OPAQUE`: the output is produced with an opaque background.
- /// - `AUTO`: the server decides based on the prompt and the image being
- /// edited (e.g. whether it already has a transparent background). This is
- /// the default. When the prompt asks only for background removal, the
- /// output may be the edited image with its background removed.
- /// Default Value: AUTO - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostV1EditLiteImageAsync( - string prompt, - global::System.IO.Stream image, - string imagename, - global::System.Collections.Generic.IReadOnlyList? referenceImages = default, - global::System.Collections.Generic.IReadOnlyList? referenceImagesFileNames = default, - int? numImages = default, - int? seed = default, - global::Ideogram.MagicPromptOption? magicPrompt = default, - string? magicPromptSystemPromptConfigId = default, - global::Ideogram.AspectRatioEditLite? aspectRatio = default, - global::Ideogram.TransparencyOption? transparency = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Edit an image with a prompt at lower cost and latency
- /// Edit an image using a text prompt, optimized for lower cost and
- /// latency. Upload the image being edited via the `image` field. Up to 9
- /// additional `reference_images` may be supplied to guide the edit.
- /// Output is always generated at 1K resolution. Input images larger than
- /// 1024px on their long edge are downscaled before processing. The
- /// `aspect_ratio` field controls the output aspect ratio only; when
- /// omitted, the output follows the aspect ratio of the image being
- /// edited.
- /// Supported image formats include JPEG, PNG, and WebP.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- /// - /// The prompt describing the desired edit.
- /// Example: Remove the person from the photo. - /// - /// - /// The image being edited (max size 25MB); JPEG, WebP and PNG formats are supported. - /// - /// - /// The image being edited (max size 25MB); JPEG, WebP and PNG formats are supported. - /// - /// - /// Optional additional reference images to guide the edit (max 9, max size 25MB each); JPEG, WebP and PNG formats are supported. - /// - /// - /// Optional file names to use for the multipart 'reference_images' file parts. - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// The aspect ratio of the edited output. When omitted, the output
- /// follows the aspect ratio of the image being edited.
- /// Example: 16x9 - /// - /// - /// Controls whether the edited output has a transparent background.
- /// - `TRANSPARENT`: the output is produced with a transparent background.
- /// - `OPAQUE`: the output is produced with an opaque background.
- /// - `AUTO`: the server decides based on the prompt and the image being
- /// edited (e.g. whether it already has a transparent background). This is
- /// the default. When the prompt asks only for background removal, the
- /// output may be the edited image with its background removed.
- /// Default Value: AUTO - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostV1EditLiteImageAsResponseAsync( - string prompt, - global::System.IO.Stream image, - string imagename, - global::System.Collections.Generic.IReadOnlyList? referenceImages = default, - global::System.Collections.Generic.IReadOnlyList? referenceImagesFileNames = default, - int? numImages = default, - int? seed = default, - global::Ideogram.MagicPromptOption? magicPrompt = default, - string? magicPromptSystemPromptConfigId = default, - global::Ideogram.AspectRatioEditLite? aspectRatio = default, - global::Ideogram.TransparencyOption? transparency = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.g.cs b/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.g.cs deleted file mode 100644 index 9342225d..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.g.cs +++ /dev/null @@ -1,49 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// All things related to generating content.
- /// If no httpClient is provided, a new one will be created.
- /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. - ///
- public partial interface IGenerateClient : global::System.IDisposable - { - /// - /// The HttpClient instance. - /// - public global::System.Net.Http.HttpClient HttpClient { get; } - - /// - /// The base URL for the API. - /// - public System.Uri? BaseUri { get; } - - /// - /// The authorizations to use for the requests. - /// - public global::System.Collections.Generic.List Authorizations { get; } - - /// - /// Gets or sets a value indicating whether the response content should be read as a string. - /// True by default in debug builds, false otherwise. - /// When false, successful responses are deserialized directly from the response stream for better performance. - /// Error responses are always read as strings regardless of this setting, - /// ensuring is populated. - /// - public bool ReadResponseAsString { get; set; } - /// - /// Client-wide request defaults such as headers, query parameters, retries, and timeout. - /// - public global::Ideogram.AutoSDKClientOptions Options { get; } - - - /// - /// - /// - global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } - - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IGenerationsClient.GenerationsGetGenerationV2.g.cs b/src/libs/Ideogram/Generated/Ideogram.IGenerationsClient.GenerationsGetGenerationV2.g.cs new file mode 100644 index 00000000..cb9b18ad --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IGenerationsClient.GenerationsGetGenerationV2.g.cs @@ -0,0 +1,56 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IGenerationsClient + { + /// + /// Poll a generation
+ /// Retrieves the current status of an asynchronous generation, and its
+ /// results once complete. Use the `generation_id` returned by any `/v2`
+ /// endpoint that runs asynchronously: every video and tool endpoint, and
+ /// any image endpoint called with `async` or a `webhook_url`.
+ /// While the generation is `pending` or has `failed`, the response
+ /// contains only `generation_id`, `status`, and `created` (plus
+ /// `failure_reason` once failed). Once `status` is `completed`, the
+ /// response includes `response_type` and `data`. Each `data` item carries
+ /// an `object_type` that identifies its shape, so image and video results
+ /// can be told apart. `usage_cost_usd_micros` reports the amount billed
+ /// when the request uses variable usage-based pricing.
+ /// Polling is rate limited per organization; a 429 response carries a
+ /// `Retry-After` header with the number of seconds to wait. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task GenerationsGetGenerationV2Async( + string generationId, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Poll a generation
+ /// Retrieves the current status of an asynchronous generation, and its
+ /// results once complete. Use the `generation_id` returned by any `/v2`
+ /// endpoint that runs asynchronously: every video and tool endpoint, and
+ /// any image endpoint called with `async` or a `webhook_url`.
+ /// While the generation is `pending` or has `failed`, the response
+ /// contains only `generation_id`, `status`, and `created` (plus
+ /// `failure_reason` once failed). Once `status` is `completed`, the
+ /// response includes `response_type` and `data`. Each `data` item carries
+ /// an `object_type` that identifies its shape, so image and video results
+ /// can be told apart. `usage_cost_usd_micros` reports the amount billed
+ /// when the request uses variable usage-based pricing.
+ /// Polling is rate limited per organization; a 429 response carries a
+ /// `Retry-After` header with the number of seconds to wait. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GenerationsGetGenerationV2AsResponseAsync( + string generationId, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IGenerationsClient.GetGenerationV2.g.cs b/src/libs/Ideogram/Generated/Ideogram.IGenerationsClient.GetGenerationV2.g.cs deleted file mode 100644 index d785a6bf..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IGenerationsClient.GetGenerationV2.g.cs +++ /dev/null @@ -1,56 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IGenerationsClient - { - /// - /// Poll a generation
- /// Retrieves the current status of an asynchronous generation, and its
- /// results once complete. Use the `generation_id` returned by any `/v2`
- /// endpoint that runs asynchronously: every video and tool endpoint, and
- /// any image endpoint called with `async` or a `webhook_url`.
- /// While the generation is `pending` or has `failed`, the response
- /// contains only `generation_id`, `status`, and `created` (plus
- /// `failure_reason` once failed). Once `status` is `completed`, the
- /// response includes `response_type` and `data`. Each `data` item carries
- /// an `object_type` that identifies its shape, so image and video results
- /// can be told apart. `usage_cost_usd_micros` reports the amount billed
- /// when the request uses variable usage-based pricing.
- /// Polling is rate limited per organization; a 429 response carries a
- /// `Retry-After` header with the number of seconds to wait. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task GetGenerationV2Async( - string generationId, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Poll a generation
- /// Retrieves the current status of an asynchronous generation, and its
- /// results once complete. Use the `generation_id` returned by any `/v2`
- /// endpoint that runs asynchronously: every video and tool endpoint, and
- /// any image endpoint called with `async` or a `webhook_url`.
- /// While the generation is `pending` or has `failed`, the response
- /// contains only `generation_id`, `status`, and `created` (plus
- /// `failure_reason` once failed). Once `status` is `completed`, the
- /// response includes `response_type` and `data`. Each `data` item carries
- /// an `object_type` that identifies its shape, so image and video results
- /// can be told apart. `usage_cost_usd_micros` reports the amount billed
- /// when the request uses variable usage-based pricing.
- /// Polling is rate limited per organization; a 429 response carries a
- /// `Retry-After` header with the number of seconds to wait. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> GetGenerationV2AsResponseAsync( - string generationId, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IIdeogramClient.g.cs b/src/libs/Ideogram/Generated/Ideogram.IIdeogramClient.g.cs index 05a76af9..3ac0c45a 100644 --- a/src/libs/Ideogram/Generated/Ideogram.IIdeogramClient.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.IIdeogramClient.g.cs @@ -4,7 +4,6 @@ namespace Ideogram { /// - /// This is the API definition for Ideogram AI.
/// If no httpClient is provided, a new one will be created.
/// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. ///
@@ -53,40 +52,18 @@ public partial interface IIdeogramClient : global::System.IDisposable /// /// /// - public AssetReferenceUsageClient AssetReferenceUsage { get; } - - /// - /// Model-agnostic endpoints where the server selects the model for each
- /// request. Requests are JSON and return a generation id that can be
- /// polled via `GET /v2/generations/{generation_id}`. - ///
public AutoModelClient AutoModel { get; } - /// - /// - /// - public BatchClient Batch { get; } - - /// - /// Operations related to managing datasets. - /// - public DatasetsClient Datasets { get; } - /// /// /// public DesignClient Design { get; } /// - /// Asynchronous image-editing workflows that return results through generation polling. + /// /// public EditWorkflowClient EditWorkflow { get; } - /// - /// All things related to generating content. - /// - public GenerateClient Generate { get; } - /// /// /// @@ -98,31 +75,22 @@ public partial interface IIdeogramClient : global::System.IDisposable public ImageDescribeClient ImageDescribe { get; } /// - /// Generate images with a specific model contract. Requests are JSON
- /// (Ideogram 3.0 also accepts multipart for style reference bytes) and
- /// return a generation id that can be polled via
- /// `GET /v2/generations/{generation_id}`. + /// ///
public ImagesGenerateClient ImagesGenerate { get; } /// - /// Repaint a masked region of an image with a specific model. + /// /// public ImagesInpaintClient ImagesInpaint { get; } /// - /// Edit source images at the source's own width and height. These endpoints never reframe: the output always matches the image you sent. + /// /// public ImagesPreciseEditClient ImagesPreciseEdit { get; } /// - /// Expand an existing image to a new model-specific output shape while
- /// preserving the source content and filling the new area. - ///
- public ImagesReframeClient ImagesReframe { get; } - - /// - /// Transform an image with a specific model, guided by a prompt. + /// /// public ImagesRemixClient ImagesRemix { get; } @@ -132,49 +100,18 @@ public partial interface IIdeogramClient : global::System.IDisposable public ImagesUpscaleClient ImagesUpscale { get; } /// - /// Organization-scoped external asset integrations. - /// - public IntegrationsClient Integrations { get; } - - /// - /// Operations and endpoints designed for doing internal testing. Not intended to be called outside a test environment. - /// - public InternalTestingClient InternalTesting { get; } - - /// - /// Content related to managing API account and API access. - /// - public ManageClient Manage { get; } - - /// - /// Operations related to publishing mini-apps into the catalog. - /// - public MiniAppsClient MiniApps { get; } - - /// - /// Operations related to managing custom models. - /// - public ModelsClient Models { get; } - - /// - /// Remove unwanted objects from an image. Requests return a generation id
- /// to poll with `GET /v2/generations/{generation_id}`. + /// ///
public ObjectRemovalClient ObjectRemoval { get; } /// /// /// - public PromptClient Prompt { get; } + public ReframeClient Reframe { get; } /// /// /// - public ProvenanceClient Provenance { get; } - - /// - /// Outcome-focused image tools with implementation details managed by Ideogram. - /// public ToolClient Tool { get; } /// @@ -192,17 +129,5 @@ public partial interface IIdeogramClient : global::System.IDisposable /// public VideoGenerateClient VideoGenerate { get; } - /// - /// Operations related to understanding visual content. - /// - public VisionClient Vision { get; } - - /// - /// Endpoints related to webhook delivery and verification. The JWKS
- /// endpoint publishes the Ed25519 public keys customers use to verify
- /// that an inbound webhook genuinely originated from Ideogram. - ///
- public WebhooksClient Webhooks { get; } - } } \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImageDescribeClient.ImageDescribePostDescribeImageIdeogramV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImageDescribeClient.ImageDescribePostDescribeImageIdeogramV3.g.cs new file mode 100644 index 00000000..11e7028f --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IImageDescribeClient.ImageDescribePostDescribeImageIdeogramV3.g.cs @@ -0,0 +1,104 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IImageDescribeClient + { + /// + /// Describe with Ideogram 3.0
+ /// Generate a natural-language description of an image with Ideogram's 3.0
+ /// image captioner (a fine-tune of the Qwen2-VL vision-language model).
+ /// Upload the image as `image` using `multipart/form-data`; the description
+ /// is returned directly. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImageDescribePostDescribeImageIdeogramV3Async( + + global::Ideogram.ImageDescribePostDescribeImageIdeogramV3Request request, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Describe with Ideogram 3.0
+ /// Generate a natural-language description of an image with Ideogram's 3.0
+ /// image captioner (a fine-tune of the Qwen2-VL vision-language model).
+ /// Upload the image as `image` using `multipart/form-data`; the description
+ /// is returned directly. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ImageDescribePostDescribeImageIdeogramV3AsResponseAsync( + + global::Ideogram.ImageDescribePostDescribeImageIdeogramV3Request request, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Describe with Ideogram 3.0
+ /// Generate a natural-language description of an image with Ideogram's 3.0
+ /// image captioner (a fine-tune of the Qwen2-VL vision-language model).
+ /// Upload the image as `image` using `multipart/form-data`; the description
+ /// is returned directly. + ///
+ /// + /// The image to describe (max 10MB). JPEG, PNG, and WebP are supported. Multipart requests only. + /// + /// + /// The image to describe (max 10MB). JPEG, PNG, and WebP are supported. Multipart requests only. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImageDescribePostDescribeImageIdeogramV3Async( + byte[] image, + string imagename, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Describe with Ideogram 3.0
+ /// Generate a natural-language description of an image with Ideogram's 3.0
+ /// image captioner (a fine-tune of the Qwen2-VL vision-language model).
+ /// Upload the image as `image` using `multipart/form-data`; the description
+ /// is returned directly. + ///
+ /// + /// The image to describe (max 10MB). JPEG, PNG, and WebP are supported. Multipart requests only. + /// + /// + /// The image to describe (max 10MB). JPEG, PNG, and WebP are supported. Multipart requests only. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImageDescribePostDescribeImageIdeogramV3Async( + global::System.IO.Stream image, + string imagename, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Describe with Ideogram 3.0
+ /// Generate a natural-language description of an image with Ideogram's 3.0
+ /// image captioner (a fine-tune of the Qwen2-VL vision-language model).
+ /// Upload the image as `image` using `multipart/form-data`; the description
+ /// is returned directly. + ///
+ /// + /// The image to describe (max 10MB). JPEG, PNG, and WebP are supported. Multipart requests only. + /// + /// + /// The image to describe (max 10MB). JPEG, PNG, and WebP are supported. Multipart requests only. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ImageDescribePostDescribeImageIdeogramV3AsResponseAsync( + global::System.IO.Stream image, + string imagename, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImageDescribeClient.ImageDescribePostDescribeImageIdeogramV4.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImageDescribeClient.ImageDescribePostDescribeImageIdeogramV4.g.cs new file mode 100644 index 00000000..f87ba6dc --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IImageDescribeClient.ImageDescribePostDescribeImageIdeogramV4.g.cs @@ -0,0 +1,154 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IImageDescribeClient + { + /// + /// Describe with Ideogram 4.0
+ /// Describe an image as a structured `V4JsonPrompt` with Ideogram's 4.0
+ /// image captioner (a fine-tune of the Qwen3-VL vision-language model).
+ /// Upload the image as `image` using `multipart/form-data`; the
+ /// `json_prompt` is returned directly and can be passed to the
+ /// `/v1/ideogram-v4/generate` endpoints. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImageDescribePostDescribeImageIdeogramV4Async( + + global::Ideogram.ImageDescribePostDescribeImageIdeogramV4Request request, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Describe with Ideogram 4.0
+ /// Describe an image as a structured `V4JsonPrompt` with Ideogram's 4.0
+ /// image captioner (a fine-tune of the Qwen3-VL vision-language model).
+ /// Upload the image as `image` using `multipart/form-data`; the
+ /// `json_prompt` is returned directly and can be passed to the
+ /// `/v1/ideogram-v4/generate` endpoints. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ImageDescribePostDescribeImageIdeogramV4AsResponseAsync( + + global::Ideogram.ImageDescribePostDescribeImageIdeogramV4Request request, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Describe with Ideogram 4.0
+ /// Describe an image as a structured `V4JsonPrompt` with Ideogram's 4.0
+ /// image captioner (a fine-tune of the Qwen3-VL vision-language model).
+ /// Upload the image as `image` using `multipart/form-data`; the
+ /// `json_prompt` is returned directly and can be passed to the
+ /// `/v1/ideogram-v4/generate` endpoints. + ///
+ /// + /// The image to describe (max 10MB). JPEG, PNG, and WebP are supported. Multipart requests only. + /// + /// + /// The image to describe (max 10MB). JPEG, PNG, and WebP are supported. Multipart requests only. + /// + /// + /// Whether to include bounding boxes for the subjects and text in the returned `json_prompt`. Defaults to true, so the prompt preserves the layout of the described image.
+ /// Default Value: true + /// + /// + /// Whether to include a free-form style description in the returned `json_prompt`. Defaults to false.
+ /// Default Value: false + /// + /// + /// Whether to include free-form tags in the returned `json_prompt`. Defaults to false.
+ /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImageDescribePostDescribeImageIdeogramV4Async( + byte[] image, + string imagename, + bool? includeBbox = default, + bool? includeStyleDescriptions = default, + bool? includeTags = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Describe with Ideogram 4.0
+ /// Describe an image as a structured `V4JsonPrompt` with Ideogram's 4.0
+ /// image captioner (a fine-tune of the Qwen3-VL vision-language model).
+ /// Upload the image as `image` using `multipart/form-data`; the
+ /// `json_prompt` is returned directly and can be passed to the
+ /// `/v1/ideogram-v4/generate` endpoints. + ///
+ /// + /// The image to describe (max 10MB). JPEG, PNG, and WebP are supported. Multipart requests only. + /// + /// + /// The image to describe (max 10MB). JPEG, PNG, and WebP are supported. Multipart requests only. + /// + /// + /// Whether to include bounding boxes for the subjects and text in the returned `json_prompt`. Defaults to true, so the prompt preserves the layout of the described image.
+ /// Default Value: true + /// + /// + /// Whether to include a free-form style description in the returned `json_prompt`. Defaults to false.
+ /// Default Value: false + /// + /// + /// Whether to include free-form tags in the returned `json_prompt`. Defaults to false.
+ /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImageDescribePostDescribeImageIdeogramV4Async( + global::System.IO.Stream image, + string imagename, + bool? includeBbox = default, + bool? includeStyleDescriptions = default, + bool? includeTags = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Describe with Ideogram 4.0
+ /// Describe an image as a structured `V4JsonPrompt` with Ideogram's 4.0
+ /// image captioner (a fine-tune of the Qwen3-VL vision-language model).
+ /// Upload the image as `image` using `multipart/form-data`; the
+ /// `json_prompt` is returned directly and can be passed to the
+ /// `/v1/ideogram-v4/generate` endpoints. + ///
+ /// + /// The image to describe (max 10MB). JPEG, PNG, and WebP are supported. Multipart requests only. + /// + /// + /// The image to describe (max 10MB). JPEG, PNG, and WebP are supported. Multipart requests only. + /// + /// + /// Whether to include bounding boxes for the subjects and text in the returned `json_prompt`. Defaults to true, so the prompt preserves the layout of the described image.
+ /// Default Value: true + /// + /// + /// Whether to include a free-form style description in the returned `json_prompt`. Defaults to false.
+ /// Default Value: false + /// + /// + /// Whether to include free-form tags in the returned `json_prompt`. Defaults to false.
+ /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ImageDescribePostDescribeImageIdeogramV4AsResponseAsync( + global::System.IO.Stream image, + string imagename, + bool? includeBbox = default, + bool? includeStyleDescriptions = default, + bool? includeTags = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImageDescribeClient.PostDescribeImageIdeogramV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImageDescribeClient.PostDescribeImageIdeogramV3.g.cs deleted file mode 100644 index e3a137bc..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IImageDescribeClient.PostDescribeImageIdeogramV3.g.cs +++ /dev/null @@ -1,66 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IImageDescribeClient - { - /// - /// Describe with Ideogram 3.0
- /// Generate a natural-language description of an image with Ideogram's 3.0
- /// image captioner (a fine-tune of the Qwen2-VL vision-language model).
- /// Upload the image as `image` using `multipart/form-data`; the description
- /// is returned directly. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostDescribeImageIdeogramV3Async( - - global::Ideogram.DescribeImageIdeogramV3Request request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Describe with Ideogram 3.0
- /// Generate a natural-language description of an image with Ideogram's 3.0
- /// image captioner (a fine-tune of the Qwen2-VL vision-language model).
- /// Upload the image as `image` using `multipart/form-data`; the description
- /// is returned directly. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostDescribeImageIdeogramV3AsResponseAsync( - - global::Ideogram.DescribeImageIdeogramV3Request request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Describe with Ideogram 3.0
- /// Generate a natural-language description of an image with Ideogram's 3.0
- /// image captioner (a fine-tune of the Qwen2-VL vision-language model).
- /// Upload the image as `image` using `multipart/form-data`; the description
- /// is returned directly. - ///
- /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The image to describe (max 10MB). JPEG, PNG, and WebP are supported. Multipart requests only. - /// - /// - /// The image to describe (max 10MB). JPEG, PNG, and WebP are supported. Multipart requests only. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostDescribeImageIdeogramV3Async( - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImageDescribeClient.PostDescribeImageIdeogramV4.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImageDescribeClient.PostDescribeImageIdeogramV4.g.cs deleted file mode 100644 index 796af326..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IImageDescribeClient.PostDescribeImageIdeogramV4.g.cs +++ /dev/null @@ -1,84 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IImageDescribeClient - { - /// - /// Describe with Ideogram 4.0
- /// Describe an image as a structured `V4JsonPrompt` with Ideogram's 4.0
- /// image captioner (a fine-tune of the Qwen3-VL vision-language model).
- /// Upload the image as `image` using `multipart/form-data`; the
- /// `json_prompt` is returned directly and can be passed to the
- /// `/v1/ideogram-v4/generate` endpoints. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostDescribeImageIdeogramV4Async( - - global::Ideogram.DescribeImageIdeogramV4Request request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Describe with Ideogram 4.0
- /// Describe an image as a structured `V4JsonPrompt` with Ideogram's 4.0
- /// image captioner (a fine-tune of the Qwen3-VL vision-language model).
- /// Upload the image as `image` using `multipart/form-data`; the
- /// `json_prompt` is returned directly and can be passed to the
- /// `/v1/ideogram-v4/generate` endpoints. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostDescribeImageIdeogramV4AsResponseAsync( - - global::Ideogram.DescribeImageIdeogramV4Request request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Describe with Ideogram 4.0
- /// Describe an image as a structured `V4JsonPrompt` with Ideogram's 4.0
- /// image captioner (a fine-tune of the Qwen3-VL vision-language model).
- /// Upload the image as `image` using `multipart/form-data`; the
- /// `json_prompt` is returned directly and can be passed to the
- /// `/v1/ideogram-v4/generate` endpoints. - ///
- /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The image to describe (max 10MB). JPEG, PNG, and WebP are supported. Multipart requests only. - /// - /// - /// The image to describe (max 10MB). JPEG, PNG, and WebP are supported. Multipart requests only. - /// - /// - /// Whether to include bounding boxes for the subjects and text in the returned `json_prompt`. Defaults to true, so the prompt preserves the layout of the described image.
- /// Default Value: true - /// - /// - /// Whether to include a free-form style description in the returned `json_prompt`. Defaults to false.
- /// Default Value: false - /// - /// - /// Whether to include free-form tags in the returned `json_prompt`. Defaults to false.
- /// Default Value: false - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostDescribeImageIdeogramV4Async( - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - bool? includeBbox = default, - bool? includeStyleDescriptions = default, - bool? includeTags = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2GptImage2.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2GptImage2.g.cs new file mode 100644 index 00000000..80f66218 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2GptImage2.g.cs @@ -0,0 +1,114 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IImagesGenerateClient + { + /// + /// Generate with GPT Image 2
+ /// Generate images with GPT Image 2. Optionally upload source images as
+ /// `images` using `multipart/form-data` to edit them with the prompt.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2GptImage2Async( + + global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage2Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Generate with GPT Image 2
+ /// Generate images with GPT Image 2. Optionally upload source images as
+ /// `images` using `multipart/form-data` to edit them with the prompt.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ImagesGeneratePostGenerateImageV2GptImage2AsResponseAsync( + + global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage2Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Generate with GPT Image 2
+ /// Generate images with GPT Image 2. Optionally upload source images as
+ /// `images` using `multipart/form-data` to edit them with the prompt.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt to generate images from, or the edit instruction to apply when source images are supplied. It is passed to the model as written. + /// + /// + /// Optional source images to edit (max 16, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only. + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The requested output aspect ratio, for example "1:1", "16:9", or "9:16". Ignored when `resolution` is provided. Defaults to "1:1". + /// + /// + /// Exact output resolution, formatted as "WIDTHxHEIGHT", for example
+ /// "2048x2048" or "1920x1088". When provided, this takes precedence
+ /// over `aspect_ratio`. The dimensions must satisfy GPT Image 2
+ /// constraints: each side is a multiple of 16, the largest side is at
+ /// most 3840px, the long:short ratio is at most 3:1, and total pixels
+ /// are between 655360 and 8294400 inclusive. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2GptImage2Async( + string prompt, + bool? dryRun = default, + global::System.Collections.Generic.IList? images = default, + int? numImages = default, + int? seed = default, + string? aspectRatio = default, + string? resolution = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2GptImage25Flare.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2GptImage25Flare.g.cs new file mode 100644 index 00000000..12153f9e --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2GptImage25Flare.g.cs @@ -0,0 +1,132 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IImagesGenerateClient + { + /// + /// Generate with GPT Image 2.5 Flare
+ /// Generate images with GPT Image 2.5 Flare, the fast variant of GPT Image
+ /// 2.5. Optionally upload source images as `images` using
+ /// `multipart/form-data` to edit them with the prompt. Returns results
+ /// directly by default; set `async` or supply a `webhook_url` to get a
+ /// `generation_id` and poll `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2GptImage25FlareAsync( + + global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25FlareRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Generate with GPT Image 2.5 Flare
+ /// Generate images with GPT Image 2.5 Flare, the fast variant of GPT Image
+ /// 2.5. Optionally upload source images as `images` using
+ /// `multipart/form-data` to edit them with the prompt. Returns results
+ /// directly by default; set `async` or supply a `webhook_url` to get a
+ /// `generation_id` and poll `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ImagesGeneratePostGenerateImageV2GptImage25FlareAsResponseAsync( + + global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25FlareRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Generate with GPT Image 2.5 Flare
+ /// Generate images with GPT Image 2.5 Flare, the fast variant of GPT Image
+ /// 2.5. Optionally upload source images as `images` using
+ /// `multipart/form-data` to edit them with the prompt. Returns results
+ /// directly by default; set `async` or supply a `webhook_url` to get a
+ /// `generation_id` and poll `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt to generate images from, or the edit instruction to apply when source images are supplied. It is passed to the model as written. + /// + /// + /// Optional source images to edit (max 16, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only. + /// + /// + /// An optional mask for the first source image (max 25MB; JPEG, PNG, or WEBP). Multipart requests only. Fully transparent pixels mark the areas to edit. The mask must have the same dimensions as the first source image, and requires source images in the same request. + /// + /// + /// An optional mask for the first source image (max 25MB; JPEG, PNG, or WEBP). Multipart requests only. Fully transparent pixels mark the areas to edit. The mask must have the same dimensions as the first source image, and requires source images in the same request. + /// + /// + /// The output background. `transparent` returns images with an alpha channel, `opaque` forces a solid background, and `auto` lets the model decide from the prompt.
+ /// Default Value: auto + /// + /// + /// How much rendering effort the model spends. Lower tiers return sooner and cost less; `auto` lets the model choose, which it currently renders at `high`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The requested output aspect ratio, for example "1:1", "16:9", or "9:16". Ignored when `resolution` is provided. Defaults to "1:1". + /// + /// + /// Exact output resolution, formatted as "WIDTHxHEIGHT", for example
+ /// "2048x2048" or "1920x1088". When provided, this takes precedence
+ /// over `aspect_ratio`. The dimensions must satisfy GPT Image 2.5 Flare
+ /// constraints: each side is a multiple of 16, the largest side is at
+ /// most 3840px, the long:short ratio is at most 3:1, and total pixels
+ /// are between 655360 and 8294400 inclusive. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2GptImage25FlareAsync( + string prompt, + bool? dryRun = default, + global::System.Collections.Generic.IList? images = default, + byte[]? mask = default, + string? maskname = default, + global::Ideogram.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaBackground? background = default, + global::Ideogram.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaQuality? quality = default, + int? numImages = default, + int? seed = default, + string? aspectRatio = default, + string? resolution = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2GptImage25Sunburst.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2GptImage25Sunburst.g.cs new file mode 100644 index 00000000..afa33a3b --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2GptImage25Sunburst.g.cs @@ -0,0 +1,135 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IImagesGenerateClient + { + /// + /// Generate with GPT Image 2.5 Sunburst
+ /// Generate images with GPT Image 2.5 Sunburst, the quality variant of GPT
+ /// Image 2.5, with finer detail at higher latency than Flare. Optionally
+ /// upload source images as `images` using `multipart/form-data` to edit
+ /// them with the prompt. Returns results directly by default; set `async`
+ /// or supply a `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2GptImage25SunburstAsync( + + global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25SunburstRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Generate with GPT Image 2.5 Sunburst
+ /// Generate images with GPT Image 2.5 Sunburst, the quality variant of GPT
+ /// Image 2.5, with finer detail at higher latency than Flare. Optionally
+ /// upload source images as `images` using `multipart/form-data` to edit
+ /// them with the prompt. Returns results directly by default; set `async`
+ /// or supply a `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ImagesGeneratePostGenerateImageV2GptImage25SunburstAsResponseAsync( + + global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25SunburstRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Generate with GPT Image 2.5 Sunburst
+ /// Generate images with GPT Image 2.5 Sunburst, the quality variant of GPT
+ /// Image 2.5, with finer detail at higher latency than Flare. Optionally
+ /// upload source images as `images` using `multipart/form-data` to edit
+ /// them with the prompt. Returns results directly by default; set `async`
+ /// or supply a `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt to generate images from, or the edit instruction to apply when source images are supplied. It is passed to the model as written. + /// + /// + /// Optional source images to edit (max 16, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only. + /// + /// + /// An optional mask for the first source image (max 25MB; JPEG, PNG, or WEBP). Multipart requests only. Fully transparent pixels mark the areas to edit. The mask must have the same dimensions as the first source image, and requires source images in the same request. + /// + /// + /// An optional mask for the first source image (max 25MB; JPEG, PNG, or WEBP). Multipart requests only. Fully transparent pixels mark the areas to edit. The mask must have the same dimensions as the first source image, and requires source images in the same request. + /// + /// + /// The output background. `transparent` returns images with an alpha channel, `opaque` forces a solid background, and `auto` lets the model decide from the prompt.
+ /// Default Value: auto + /// + /// + /// How much rendering effort the model spends. Lower tiers return sooner and cost less; `auto` lets the model choose, which it currently renders at `high`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The requested output aspect ratio, for example "1:1", "16:9", or "9:16". Ignored when `resolution` is provided. Defaults to "1:1". + /// + /// + /// Exact output resolution, formatted as "WIDTHxHEIGHT", for example
+ /// "2048x2048" or "1920x1088". When provided, this takes precedence
+ /// over `aspect_ratio`. The dimensions must satisfy GPT Image 2.5 Sunburst
+ /// constraints: each side is a multiple of 16, the largest side is at
+ /// most 3840px, the long:short ratio is at most 3:1, and total pixels
+ /// are between 655360 and 8294400 inclusive. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2GptImage25SunburstAsync( + string prompt, + bool? dryRun = default, + global::System.Collections.Generic.IList? images = default, + byte[]? mask = default, + string? maskname = default, + global::Ideogram.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaBackground? background = default, + global::Ideogram.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaQuality? quality = default, + int? numImages = default, + int? seed = default, + string? aspectRatio = default, + string? resolution = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2Ideogram45.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2Ideogram45.g.cs new file mode 100644 index 00000000..c3b30b19 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2Ideogram45.g.cs @@ -0,0 +1,154 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IImagesGenerateClient + { + /// + /// Generate with Ideogram 4.5
+ /// Generate images with Ideogram 4.5 from a natural-language or structured
+ /// JSON prompt. Optionally upload source images as `images` using
+ /// `multipart/form-data` to edit them with the prompt. Returns results
+ /// directly by default; set `async` or supply a `webhook_url` to get a
+ /// `generation_id` and poll `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2Ideogram45Async( + + global::Ideogram.ImagesGeneratePostGenerateImageV2Ideogram45Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Generate with Ideogram 4.5
+ /// Generate images with Ideogram 4.5 from a natural-language or structured
+ /// JSON prompt. Optionally upload source images as `images` using
+ /// `multipart/form-data` to edit them with the prompt. Returns results
+ /// directly by default; set `async` or supply a `webhook_url` to get a
+ /// `generation_id` and poll `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ImagesGeneratePostGenerateImageV2Ideogram45AsResponseAsync( + + global::Ideogram.ImagesGeneratePostGenerateImageV2Ideogram45Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Generate with Ideogram 4.5
+ /// Generate images with Ideogram 4.5 from a natural-language or structured
+ /// JSON prompt. Optionally upload source images as `images` using
+ /// `multipart/form-data` to edit them with the prompt. Returns results
+ /// directly by default; set `async` or supply a `webhook_url` to get a
+ /// `generation_id` and poll `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt to generate images from, or the edit instruction when
+ /// source images are supplied. Natural language or a structured
+ /// Ideogram 4.0 JSON prompt. + /// + /// + /// Controls how a natural-language prompt is prepared. `auto` (the
+ /// default) and `on` rewrite and expand the prompt before generation.
+ /// `off` keeps your wording and only converts it into a structured
+ /// prompt. A valid structured JSON prompt skips magic prompt unless
+ /// `magic_prompt` is `on`. With source images, every mode converts
+ /// the edit instruction into a structured edit prompt.
+ /// Default Value: auto + /// + /// + /// Optional source images to edit (max 5, max 25MB each; JPEG, PNG, or WEBP). The first image is the one being edited; any others are extra references. Multipart requests only. + /// + /// + /// An optional mask that limits the edit to part of the first source image (max 25MB; JPEG, PNG, or WEBP). Multipart requests only. Black marks the area to edit and white the area to keep; values in between are rounded to the nearer of the two. The mask must have the same width and height as the first source image and contain both black and white areas. A masked request can include at most three other source images. With a mask, the output is always the first source image's own size, so `size` cannot be set. + /// + /// + /// An optional mask that limits the edit to part of the first source image (max 25MB; JPEG, PNG, or WEBP). Multipart requests only. Black marks the area to edit and white the area to keep; values in between are rounded to the nearer of the two. The mask must have the same width and height as the first source image and contain both black and white areas. A masked request can include at most three other source images. With a mask, the output is always the first source image's own size, so `size` cannot be set. + /// + /// + /// The output size: "auto", "source" or an exact "WIDTHxHEIGHT".
+ /// Without source images, an exact size must be one of the supported
+ /// 1K/2K presets (for example 1024x1024, 2048x2048 or 1440x2880);
+ /// "auto" or omitted picks a supported size based on the prompt.
+ /// "source" is rejected.
+ /// With source images, "auto" (the default) picks a supported 2K size
+ /// based on the source images and the prompt, and "source" returns the
+ /// output at the first source image's own width and height (scaled
+ /// down, keeping its proportions, if it is too large for the model).
+ /// Every source image's aspect ratio must be between 1:6 and 6:1.
+ /// An exact size must have both sides a multiple of 32 and at least
+ /// 256px, a total of at most 2048x2048 pixels, and an aspect ratio of
+ /// at most 6:1. With source images, an exact size reshapes the source
+ /// to it.
+ /// Pricing is tiered by the resolved output pixels: up to 1024x1024
+ /// bills as 1K, above that as 2K. An "auto" size bills as 2K.
+ /// Default Value: auto + /// + /// + /// The output background. `transparent` returns images with an alpha channel, `opaque` returns a solid one, and `auto` decides for you.
+ /// Default Value: auto + /// + /// + /// The rendering quality to use. Higher quality takes longer and costs more. Defaults to `medium` with source images and `high` without. `very_low`, the fastest and cheapest, requires source images. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2Ideogram45Async( + string prompt, + bool? dryRun = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + global::System.Collections.Generic.IList? images = default, + byte[]? mask = default, + string? maskname = default, + string? size = default, + global::Ideogram.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaBackground? background = default, + global::Ideogram.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality? quality = default, + int? seed = default, + int? numImages = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV2.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV2.g.cs new file mode 100644 index 00000000..c904bc51 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV2.g.cs @@ -0,0 +1,120 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IImagesGenerateClient + { + /// + /// Generate with Ideogram 2.0
+ /// Generate images from a text prompt with Ideogram 2.0. Returns results
+ /// directly by default; set `async` or supply a `webhook_url` to get a
+ /// `generation_id` and poll `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2IdeogramV2Async( + + global::Ideogram.GenerateImageIdeogramV2Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Generate with Ideogram 2.0
+ /// Generate images from a text prompt with Ideogram 2.0. Returns results
+ /// directly by default; set `async` or supply a `webhook_url` to get a
+ /// `generation_id` and poll `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ImagesGeneratePostGenerateImageV2IdeogramV2AsResponseAsync( + + global::Ideogram.GenerateImageIdeogramV2Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Generate with Ideogram 2.0
+ /// Generate images from a text prompt with Ideogram 2.0. Returns results
+ /// directly by default; set `async` or supply a `webhook_url` to get a
+ /// `generation_id` and poll `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt to generate images from. + /// + /// + /// Description of what to exclude from the images. The prompt takes precedence over the negative prompt. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The aspect ratio for an Ideogram 3.x or 2.x generation. `auto` lets the
+ /// model select a ratio from the prompt; any other value pins the ratio.
+ /// Cannot be combined with `resolution`. Omitting the field is not `auto`:
+ /// it uses `1x1`. + /// + /// + /// The rendering speed to use. `turbo` generates faster at a lower cost, while `quality` prioritizes the highest-quality result.
+ /// Default Value: default + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// The style type to generate with. When omitted, the model's default styling is used; pass `auto` to have a style selected automatically from the prompt. + /// + /// + /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2IdeogramV2Async( + string prompt, + bool? dryRun = default, + string? negativePrompt = default, + int? seed = default, + global::Ideogram.IdeogramV3AspectRatio? aspectRatio = default, + global::Ideogram.GenerateImageIdeogramV2RequestRenderingSpeed? renderingSpeed = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + int? numImages = default, + global::Ideogram.IdeogramV2StyleType? styleType = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV2A.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV2A.g.cs new file mode 100644 index 00000000..59777ac9 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV2A.g.cs @@ -0,0 +1,119 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IImagesGenerateClient + { + /// + /// Generate with Ideogram 2a
+ /// Generate images from a text prompt with Ideogram 2a, a fast, lower-cost
+ /// model. Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2IdeogramV2AAsync( + + global::Ideogram.GenerateImageIdeogramV2ARequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Generate with Ideogram 2a
+ /// Generate images from a text prompt with Ideogram 2a, a fast, lower-cost
+ /// model. Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ImagesGeneratePostGenerateImageV2IdeogramV2AAsResponseAsync( + + global::Ideogram.GenerateImageIdeogramV2ARequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Generate with Ideogram 2a
+ /// Generate images from a text prompt with Ideogram 2a, a fast, lower-cost
+ /// model. Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt to generate images from. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The aspect ratio for an Ideogram 3.x or 2.x generation. `auto` lets the
+ /// model select a ratio from the prompt; any other value pins the ratio.
+ /// Cannot be combined with `resolution`. Omitting the field is not `auto`:
+ /// it uses `1x1`. + /// + /// + /// The rendering speed to use. `turbo` generates faster at a lower cost, while `quality` prioritizes the highest-quality result.
+ /// Default Value: default + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// The style type to generate with. When omitted, the model's default styling is used; pass `auto` to have a style selected automatically from the prompt. + /// + /// + /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2IdeogramV2AAsync( + string prompt, + bool? dryRun = default, + int? seed = default, + global::Ideogram.IdeogramV3AspectRatio? aspectRatio = default, + global::Ideogram.GenerateImageIdeogramV2ARequestRenderingSpeed? renderingSpeed = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + int? numImages = default, + global::Ideogram.IdeogramV2StyleType? styleType = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV3.g.cs new file mode 100644 index 00000000..3b70814c --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV3.g.cs @@ -0,0 +1,147 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IImagesGenerateClient + { + /// + /// Generate with Ideogram 3.0
+ /// Generate images from a text prompt with Ideogram 3.0. Optional style
+ /// controls include style codes, a style preset, a color palette, and style
+ /// references (uploaded `style_reference_images`). Returns
+ /// results directly by default; set `async` or supply a `webhook_url` to
+ /// get a `generation_id` and poll `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2IdeogramV3Async( + + global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Generate with Ideogram 3.0
+ /// Generate images from a text prompt with Ideogram 3.0. Optional style
+ /// controls include style codes, a style preset, a color palette, and style
+ /// references (uploaded `style_reference_images`). Returns
+ /// results directly by default; set `async` or supply a `webhook_url` to
+ /// get a `generation_id` and poll `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ImagesGeneratePostGenerateImageV2IdeogramV3AsResponseAsync( + + global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Generate with Ideogram 3.0
+ /// Generate images from a text prompt with Ideogram 3.0. Optional style
+ /// controls include style codes, a style preset, a color palette, and style
+ /// references (uploaded `style_reference_images`). Returns
+ /// results directly by default; set `async` or supply a `webhook_url` to
+ /// get a `generation_id` and poll `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt to generate images from. + /// + /// + /// Description of what to exclude from the images. The prompt takes precedence over the negative prompt. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The resolutions supported for Ideogram 3.0. + /// + /// + /// The aspect ratio for an Ideogram 3.x or 2.x generation. `auto` lets the
+ /// model select a ratio from the prompt; any other value pins the ratio.
+ /// Cannot be combined with `resolution`. Omitting the field is not `auto`:
+ /// it uses `1x1`. + /// + /// + /// The rendering speed to use.
+ /// Default Value: default + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). + /// + /// + /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images. + /// + /// + /// The style type to generate with.
+ /// Default Value: general + /// + /// + /// A predefined style preset to apply to the generated images. Cannot be combined with style codes or style references. + /// + /// + /// Images to use as style references (max 10, max 25MB each; JPEG, PNG, or WEBP). + /// + /// + /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2IdeogramV3Async( + string prompt, + bool? dryRun = default, + string? negativePrompt = default, + int? seed = default, + global::Ideogram.ResolutionV3? resolution = default, + global::Ideogram.IdeogramV3AspectRatio? aspectRatio = default, + global::Ideogram.V2ImageGenerateIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + int? numImages = default, + global::Ideogram.IdeogramColorPalette? colorPalette = default, + global::System.Collections.Generic.IList? styleCodes = default, + global::Ideogram.IdeogramV3StyleType? styleType = default, + global::Ideogram.IdeogramV3StylePreset? stylePreset = default, + global::System.Collections.Generic.IList? styleReferenceImages = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV3Character.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV3Character.g.cs new file mode 100644 index 00000000..2e3d8484 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV3Character.g.cs @@ -0,0 +1,358 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IImagesGenerateClient + { + /// + /// Generate a consistent character with Ideogram 3.0
+ /// Generate images featuring a consistent character with Ideogram 3.0.
+ /// Upload the character as `character_reference_images` using
+ /// `multipart/form-data`. Returns
+ /// results directly by default; set `async` or supply a `webhook_url` to
+ /// get a `generation_id` and poll `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2IdeogramV3CharacterAsync( + + global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Generate a consistent character with Ideogram 3.0
+ /// Generate images featuring a consistent character with Ideogram 3.0.
+ /// Upload the character as `character_reference_images` using
+ /// `multipart/form-data`. Returns
+ /// results directly by default; set `async` or supply a `webhook_url` to
+ /// get a `generation_id` and poll `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ImagesGeneratePostGenerateImageV2IdeogramV3CharacterAsResponseAsync( + + global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Generate a consistent character with Ideogram 3.0
+ /// Generate images featuring a consistent character with Ideogram 3.0.
+ /// Upload the character as `character_reference_images` using
+ /// `multipart/form-data`. Returns
+ /// results directly by default; set `async` or supply a `webhook_url` to
+ /// get a `generation_id` and poll `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt to generate images from. + /// + /// + /// Description of what to exclude from the images. The prompt takes precedence over the negative prompt. + /// + /// + /// An image of the character to feature (max 25MB; JPEG, PNG, or WEBP). + /// + /// + /// Optional grayscale mask marking where the character is in the character reference image, at the same size as that image (JPEG, PNG, or WEBP). Multipart requests only. + /// + /// + /// Optional grayscale mask marking where the character is in the character reference image, at the same size as that image (JPEG, PNG, or WEBP). Multipart requests only. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The resolutions supported for Ideogram 3.0. + /// + /// + /// The aspect ratio for an Ideogram 3.x or 2.x generation. `auto` lets the
+ /// model select a ratio from the prompt; any other value pins the ratio.
+ /// Cannot be combined with `resolution`. Omitting the field is not `auto`:
+ /// it uses `1x1`. + /// + /// + /// The rendering speed to use.
+ /// Default Value: default + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// The style type to generate the character with. Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// Images to use as style references (max 10, max 25MB each; JPEG, PNG, or WEBP). + /// + /// + /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2IdeogramV3CharacterAsync( + string prompt, + global::System.Collections.Generic.IList characterReferenceImages, + bool? dryRun = default, + string? negativePrompt = default, + byte[]? characterReferenceMask = default, + string? characterReferenceMaskname = default, + int? seed = default, + global::Ideogram.ResolutionV3? resolution = default, + global::Ideogram.IdeogramV3AspectRatio? aspectRatio = default, + global::Ideogram.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + int? numImages = default, + global::Ideogram.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType? styleType = default, + global::System.Collections.Generic.IList? styleReferenceImages = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Generate a consistent character with Ideogram 3.0
+ /// Generate images featuring a consistent character with Ideogram 3.0.
+ /// Upload the character as `character_reference_images` using
+ /// `multipart/form-data`. Returns
+ /// results directly by default; set `async` or supply a `webhook_url` to
+ /// get a `generation_id` and poll `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt to generate images from. + /// + /// + /// Description of what to exclude from the images. The prompt takes precedence over the negative prompt. + /// + /// + /// An image of the character to feature (max 25MB; JPEG, PNG, or WEBP). + /// + /// + /// Optional file names to use for the multipart 'character_reference_images' file parts. + /// + /// + /// Optional grayscale mask marking where the character is in the character reference image, at the same size as that image (JPEG, PNG, or WEBP). Multipart requests only. + /// + /// + /// Optional grayscale mask marking where the character is in the character reference image, at the same size as that image (JPEG, PNG, or WEBP). Multipart requests only. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The resolutions supported for Ideogram 3.0. + /// + /// + /// The aspect ratio for an Ideogram 3.x or 2.x generation. `auto` lets the
+ /// model select a ratio from the prompt; any other value pins the ratio.
+ /// Cannot be combined with `resolution`. Omitting the field is not `auto`:
+ /// it uses `1x1`. + /// + /// + /// The rendering speed to use.
+ /// Default Value: default + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// The style type to generate the character with. Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// Images to use as style references (max 10, max 25MB each; JPEG, PNG, or WEBP). + /// + /// + /// Optional file names to use for the multipart 'style_reference_images' file parts. + /// + /// + /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2IdeogramV3CharacterAsync( + string prompt, + global::System.Collections.Generic.IReadOnlyList characterReferenceImages, + bool? dryRun = default, + string? negativePrompt = default, + global::System.Collections.Generic.IReadOnlyList? characterReferenceImagesFileNames = default, + global::System.IO.Stream? characterReferenceMask = default, + string? characterReferenceMaskname = default, + int? seed = default, + global::Ideogram.ResolutionV3? resolution = default, + global::Ideogram.IdeogramV3AspectRatio? aspectRatio = default, + global::Ideogram.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + int? numImages = default, + global::Ideogram.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType? styleType = default, + global::System.Collections.Generic.IReadOnlyList? styleReferenceImages = default, + global::System.Collections.Generic.IReadOnlyList? styleReferenceImagesFileNames = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Generate a consistent character with Ideogram 3.0
+ /// Generate images featuring a consistent character with Ideogram 3.0.
+ /// Upload the character as `character_reference_images` using
+ /// `multipart/form-data`. Returns
+ /// results directly by default; set `async` or supply a `webhook_url` to
+ /// get a `generation_id` and poll `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt to generate images from. + /// + /// + /// Description of what to exclude from the images. The prompt takes precedence over the negative prompt. + /// + /// + /// An image of the character to feature (max 25MB; JPEG, PNG, or WEBP). + /// + /// + /// Optional file names to use for the multipart 'character_reference_images' file parts. + /// + /// + /// Optional grayscale mask marking where the character is in the character reference image, at the same size as that image (JPEG, PNG, or WEBP). Multipart requests only. + /// + /// + /// Optional grayscale mask marking where the character is in the character reference image, at the same size as that image (JPEG, PNG, or WEBP). Multipart requests only. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The resolutions supported for Ideogram 3.0. + /// + /// + /// The aspect ratio for an Ideogram 3.x or 2.x generation. `auto` lets the
+ /// model select a ratio from the prompt; any other value pins the ratio.
+ /// Cannot be combined with `resolution`. Omitting the field is not `auto`:
+ /// it uses `1x1`. + /// + /// + /// The rendering speed to use.
+ /// Default Value: default + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// The style type to generate the character with. Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// Images to use as style references (max 10, max 25MB each; JPEG, PNG, or WEBP). + /// + /// + /// Optional file names to use for the multipart 'style_reference_images' file parts. + /// + /// + /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ImagesGeneratePostGenerateImageV2IdeogramV3CharacterAsResponseAsync( + string prompt, + global::System.Collections.Generic.IReadOnlyList characterReferenceImages, + bool? dryRun = default, + string? negativePrompt = default, + global::System.Collections.Generic.IReadOnlyList? characterReferenceImagesFileNames = default, + global::System.IO.Stream? characterReferenceMask = default, + string? characterReferenceMaskname = default, + int? seed = default, + global::Ideogram.ResolutionV3? resolution = default, + global::Ideogram.IdeogramV3AspectRatio? aspectRatio = default, + global::Ideogram.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + int? numImages = default, + global::Ideogram.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType? styleType = default, + global::System.Collections.Generic.IReadOnlyList? styleReferenceImages = default, + global::System.Collections.Generic.IReadOnlyList? styleReferenceImagesFileNames = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModel.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModel.g.cs new file mode 100644 index 00000000..1acc15c6 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModel.g.cs @@ -0,0 +1,147 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IImagesGenerateClient + { + /// + /// Generate with a custom Ideogram 3.0 model
+ /// Generate images with a custom Ideogram 3.0 model that you or your
+ /// organization can access, selected by `custom_model_uri`. Returns results
+ /// directly by default; set `async` or supply a `webhook_url` to get a
+ /// `generation_id` and poll `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelAsync( + + global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Generate with a custom Ideogram 3.0 model
+ /// Generate images with a custom Ideogram 3.0 model that you or your
+ /// organization can access, selected by `custom_model_uri`. Returns results
+ /// directly by default; set `async` or supply a `webhook_url` to get a
+ /// `generation_id` and poll `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelAsResponseAsync( + + global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Generate with a custom Ideogram 3.0 model
+ /// Generate images with a custom Ideogram 3.0 model that you or your
+ /// organization can access, selected by `custom_model_uri`. Returns results
+ /// directly by default; set `async` or supply a `webhook_url` to get a
+ /// `generation_id` and poll `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt to generate images from. + /// + /// + /// The custom model URI, in the form `model/<model_name>/version/<version_name>`. You or your organization must have access to the model. The model determines which rendering speeds are supported and whether backgrounds are removed automatically. + /// + /// + /// Remove the background after generation and return transparent PNG images. Included in the custom model generation price at no extra charge. When false, the model's automatic background removal behavior still applies.
+ /// Default Value: false + /// + /// + /// Description of what to exclude from the images. The prompt takes precedence over the negative prompt. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The resolutions supported for Ideogram 3.0. + /// + /// + /// The aspect ratio for an Ideogram 3.x or 2.x generation. `auto` lets the
+ /// model select a ratio from the prompt; any other value pins the ratio.
+ /// Cannot be combined with `resolution`. Omitting the field is not `auto`:
+ /// it uses `1x1`. + /// + /// + /// The rendering speed to use. When omitted, a speed supported by the custom model is used. + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). + /// + /// + /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images. + /// + /// + /// A predefined style preset to apply to the generated images. Cannot be combined with style codes or style references. + /// + /// + /// Images to use as style references (max 10, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only. + /// + /// + /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelAsync( + string prompt, + string customModelUri, + bool? dryRun = default, + bool? transparentBackground = default, + string? negativePrompt = default, + int? seed = default, + global::Ideogram.ResolutionV3? resolution = default, + global::Ideogram.IdeogramV3AspectRatio? aspectRatio = default, + global::Ideogram.V2ImageGenerateIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + int? numImages = default, + global::Ideogram.IdeogramColorPalette? colorPalette = default, + global::System.Collections.Generic.IList? styleCodes = default, + global::Ideogram.IdeogramV3StylePreset? stylePreset = default, + global::System.Collections.Generic.IList? styleReferenceImages = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV3Transparent.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV3Transparent.g.cs new file mode 100644 index 00000000..a11a4739 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV3Transparent.g.cs @@ -0,0 +1,124 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IImagesGenerateClient + { + /// + /// Generate transparent images with Ideogram 3.0
+ /// Generate images on a transparent background with Ideogram 3.0, delivered
+ /// as PNGs with alpha. Returns results directly by default; set `async` or
+ /// supply a `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2IdeogramV3TransparentAsync( + + global::Ideogram.GenerateImageIdeogramV3TransparentRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Generate transparent images with Ideogram 3.0
+ /// Generate images on a transparent background with Ideogram 3.0, delivered
+ /// as PNGs with alpha. Returns results directly by default; set `async` or
+ /// supply a `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ImagesGeneratePostGenerateImageV2IdeogramV3TransparentAsResponseAsync( + + global::Ideogram.GenerateImageIdeogramV3TransparentRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Generate transparent images with Ideogram 3.0
+ /// Generate images on a transparent background with Ideogram 3.0, delivered
+ /// as PNGs with alpha. Returns results directly by default; set `async` or
+ /// supply a `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt to generate images from. + /// + /// + /// Description of what to exclude from the images. The prompt takes precedence over the negative prompt. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// Optional enhancement factor applied after generation. `x1` (the default) delivers the base render.
+ /// Default Value: x1 + /// + /// + /// The aspect ratio for an Ideogram 3.x or 2.x generation. `auto` lets the
+ /// model select a ratio from the prompt; any other value pins the ratio.
+ /// Cannot be combined with `resolution`. Omitting the field is not `auto`:
+ /// it uses `1x1`. + /// + /// + /// The rendering speed to use.
+ /// Default Value: default + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2IdeogramV3TransparentAsync( + string prompt, + bool? dryRun = default, + string? negativePrompt = default, + int? seed = default, + global::Ideogram.GenerateImageIdeogramV3TransparentRequestUpscaleFactor? upscaleFactor = default, + global::Ideogram.IdeogramV3AspectRatio? aspectRatio = default, + global::Ideogram.GenerateImageIdeogramV3TransparentRequestRenderingSpeed? renderingSpeed = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + int? numImages = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV4.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV4.g.cs new file mode 100644 index 00000000..e57edf72 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV4.g.cs @@ -0,0 +1,120 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IImagesGenerateClient + { + /// + /// Generate with Ideogram 4.0
+ /// Generate images with Ideogram 4.0 from a natural-language or structured
+ /// JSON prompt. Returns results directly by default; set `async` or supply
+ /// a `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2IdeogramV4Async( + + global::Ideogram.GenerateImageIdeogramV4Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Generate with Ideogram 4.0
+ /// Generate images with Ideogram 4.0 from a natural-language or structured
+ /// JSON prompt. Returns results directly by default; set `async` or supply
+ /// a `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ImagesGeneratePostGenerateImageV2IdeogramV4AsResponseAsync( + + global::Ideogram.GenerateImageIdeogramV4Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Generate with Ideogram 4.0
+ /// Generate images with Ideogram 4.0 from a natural-language or structured
+ /// JSON prompt. Returns results directly by default; set `async` or supply
+ /// a `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt to generate images from, in natural language or as a
+ /// structured Ideogram 4.0 JSON prompt. A structured JSON prompt is
+ /// used as is and skips magic prompt unless `magic_prompt` is `on`. + /// + /// + /// Controls how a natural-language prompt is prepared. `auto` (the
+ /// default) and `on` rewrite and expand the prompt before generation.
+ /// `off` keeps your wording and only converts it into a structured
+ /// prompt. A valid structured JSON prompt skips magic prompt unless
+ /// `magic_prompt` is `on`.
+ /// Default Value: auto + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Optional. When supplied, the images are generated at this
+ /// resolution. When omitted, an aspect ratio is picked automatically
+ /// based on the prompt. + /// + /// + /// The rendering speed to use.
+ /// Default Value: default + /// + /// + /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2IdeogramV4Async( + string prompt, + bool? dryRun = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + int? seed = default, + int? numImages = default, + global::Ideogram.ResolutionV4? resolution = default, + global::Ideogram.GenerateImageIdeogramV4RequestRenderingSpeed? renderingSpeed = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModel.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModel.g.cs new file mode 100644 index 00000000..943c6a82 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModel.g.cs @@ -0,0 +1,128 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IImagesGenerateClient + { + /// + /// Generate with a custom Ideogram 4.0 model
+ /// Generate images with a custom Ideogram 4.0 model that you or your
+ /// organization can access, selected by `custom_model_uri`. Returns results
+ /// directly by default; set `async` or supply a `webhook_url` to get a
+ /// `generation_id` and poll `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelAsync( + + global::Ideogram.GenerateImageIdeogramV4CustomModelRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Generate with a custom Ideogram 4.0 model
+ /// Generate images with a custom Ideogram 4.0 model that you or your
+ /// organization can access, selected by `custom_model_uri`. Returns results
+ /// directly by default; set `async` or supply a `webhook_url` to get a
+ /// `generation_id` and poll `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelAsResponseAsync( + + global::Ideogram.GenerateImageIdeogramV4CustomModelRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Generate with a custom Ideogram 4.0 model
+ /// Generate images with a custom Ideogram 4.0 model that you or your
+ /// organization can access, selected by `custom_model_uri`. Returns results
+ /// directly by default; set `async` or supply a `webhook_url` to get a
+ /// `generation_id` and poll `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt to generate images from, in natural language or as a
+ /// structured Ideogram 4.0 JSON prompt. A structured JSON prompt is
+ /// used as is and skips magic prompt unless `magic_prompt` is `on`. + /// + /// + /// The custom model URI, in the form `model/<model_name>/version/<version_name>`. You or your organization must have access to the model. The model determines which rendering speeds are supported. + /// + /// + /// Remove the background after generation and return transparent PNG images. Included in the custom model generation price at no extra charge. When false, the model's automatic background removal behavior still applies.
+ /// Default Value: false + /// + /// + /// Controls how a natural-language prompt is prepared. `auto` (the
+ /// default) and `on` rewrite and expand the prompt before generation.
+ /// `off` keeps your wording and only converts it into a structured
+ /// prompt. A valid structured JSON prompt skips magic prompt unless
+ /// `magic_prompt` is `on`.
+ /// Default Value: auto + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Optional. When supplied, the images are generated at this
+ /// resolution. When omitted, an aspect ratio is picked automatically
+ /// based on the prompt. + /// + /// + /// The rendering speed to use. When omitted, a speed supported by the custom model is used. + /// + /// + /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelAsync( + string prompt, + string customModelUri, + bool? dryRun = default, + bool? transparentBackground = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + int? seed = default, + int? numImages = default, + global::Ideogram.ResolutionV4? resolution = default, + global::Ideogram.GenerateImageIdeogramV4CustomModelRequestRenderingSpeed? renderingSpeed = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV4Transparent.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV4Transparent.g.cs new file mode 100644 index 00000000..c33fd041 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV4Transparent.g.cs @@ -0,0 +1,130 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IImagesGenerateClient + { + /// + /// Generate transparent images with Ideogram 4.0
+ /// Generate images on a transparent background with Ideogram 4.0, delivered
+ /// as PNGs with alpha. Returns results directly by default; set `async` or
+ /// supply a `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2IdeogramV4TransparentAsync( + + global::Ideogram.GenerateImageIdeogramV4TransparentRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Generate transparent images with Ideogram 4.0
+ /// Generate images on a transparent background with Ideogram 4.0, delivered
+ /// as PNGs with alpha. Returns results directly by default; set `async` or
+ /// supply a `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ImagesGeneratePostGenerateImageV2IdeogramV4TransparentAsResponseAsync( + + global::Ideogram.GenerateImageIdeogramV4TransparentRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Generate transparent images with Ideogram 4.0
+ /// Generate images on a transparent background with Ideogram 4.0, delivered
+ /// as PNGs with alpha. Returns results directly by default; set `async` or
+ /// supply a `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt to generate images from, in natural language or as a
+ /// structured Ideogram 4.0 JSON prompt. A structured JSON prompt is
+ /// used as is and skips magic prompt, except that its background
+ /// description is replaced with a transparent background. + /// + /// + /// Controls how a natural-language prompt is prepared. `auto` (the
+ /// default) and `on` rewrite and expand the prompt before generation.
+ /// `off` keeps your wording and only converts it into a structured
+ /// prompt. A valid structured JSON prompt skips magic prompt unless
+ /// `magic_prompt` is `on`.
+ /// Default Value: auto + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Supported output aspect ratios. The operation defines whether `auto`
+ /// preserves the source shape or selects a shape from the prompt.
+ /// Default Value: auto + /// + /// + /// The output resolution tier. Each tier is a total pixel budget equal
+ /// to a square of the named size (for example, `8k` delivers at most
+ /// 8192x8192 pixels in total). Wide and tall aspect ratios keep the
+ /// same budget, so one side may exceed the named size. Tiers above
+ /// 2k are produced by upscaling after generation. Defaults to 1k.
+ /// Default Value: 1k + /// + /// + /// The rendering speed to use.
+ /// Default Value: default + /// + /// + /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2IdeogramV4TransparentAsync( + string prompt, + bool? dryRun = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + int? seed = default, + int? numImages = default, + global::Ideogram.IdeogramV4AspectRatio? aspectRatio = default, + global::Ideogram.GenerateImageIdeogramV4TransparentRequestOutputResolution? outputResolution = default, + global::Ideogram.GenerateImageIdeogramV4TransparentRequestRenderingSpeed? renderingSpeed = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2NanoBanana2.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2NanoBanana2.g.cs new file mode 100644 index 00000000..ed04c7c2 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2NanoBanana2.g.cs @@ -0,0 +1,111 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IImagesGenerateClient + { + /// + /// Generate with Nano Banana 2
+ /// Generate images with Nano Banana 2. Optionally upload source images as
+ /// `images` using `multipart/form-data` to edit them with the prompt.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2NanoBanana2Async( + + global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana2Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Generate with Nano Banana 2
+ /// Generate images with Nano Banana 2. Optionally upload source images as
+ /// `images` using `multipart/form-data` to edit them with the prompt.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ImagesGeneratePostGenerateImageV2NanoBanana2AsResponseAsync( + + global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana2Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Generate with Nano Banana 2
+ /// Generate images with Nano Banana 2. Optionally upload source images as
+ /// `images` using `multipart/form-data` to edit them with the prompt.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt to generate images from, or the edit instruction to apply when source images are supplied. It is passed to the model as written. + /// + /// + /// Optional source images to edit (max 10, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only. + /// + /// + /// Output aspect ratios Nano Banana 2 serves. `auto` lets the model choose the shape; an edit keeps its source image's shape.
+ /// Default Value: auto + /// + /// + /// The output resolution tier.
+ /// Default Value: 1K + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2NanoBanana2Async( + string prompt, + bool? dryRun = default, + global::System.Collections.Generic.IList? images = default, + global::Ideogram.NanoBanana2AspectRatio? aspectRatio = default, + global::Ideogram.V2ImageGenerateNanoBanana2PostRequestBodyContentMultipartFormDataSchemaResolutionTier? resolutionTier = default, + int? numImages = default, + int? seed = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2NanoBanana21.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2NanoBanana21.g.cs new file mode 100644 index 00000000..1c29221b --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2NanoBanana21.g.cs @@ -0,0 +1,111 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IImagesGenerateClient + { + /// + /// Generate with Nano Banana 2.1
+ /// Generate images with Nano Banana 2.1. Optionally upload source images as
+ /// `images` using `multipart/form-data` to edit them with the prompt.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2NanoBanana21Async( + + global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana21Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Generate with Nano Banana 2.1
+ /// Generate images with Nano Banana 2.1. Optionally upload source images as
+ /// `images` using `multipart/form-data` to edit them with the prompt.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ImagesGeneratePostGenerateImageV2NanoBanana21AsResponseAsync( + + global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana21Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Generate with Nano Banana 2.1
+ /// Generate images with Nano Banana 2.1. Optionally upload source images as
+ /// `images` using `multipart/form-data` to edit them with the prompt.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt to generate images from, or the edit instruction to apply when source images are supplied. It is passed to the model as written. + /// + /// + /// Optional source images to edit (max 10, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only. + /// + /// + /// Output aspect ratios Nano Banana 2.1 serves. `auto` lets the model choose the shape; an edit keeps its source image's shape.
+ /// Default Value: auto + /// + /// + /// The output resolution tier.
+ /// Default Value: 1K + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2NanoBanana21Async( + string prompt, + bool? dryRun = default, + global::System.Collections.Generic.IList? images = default, + global::Ideogram.NanoBanana21AspectRatio? aspectRatio = default, + global::Ideogram.V2ImageGenerateNanoBanana21PostRequestBodyContentMultipartFormDataSchemaResolutionTier? resolutionTier = default, + int? numImages = default, + int? seed = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2NanoBananaPro.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2NanoBananaPro.g.cs new file mode 100644 index 00000000..482f2fee --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2NanoBananaPro.g.cs @@ -0,0 +1,111 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IImagesGenerateClient + { + /// + /// Generate with Nano Banana Pro
+ /// Generate images with Nano Banana Pro. Optionally upload source images as
+ /// `images` using `multipart/form-data` to edit them with the prompt.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2NanoBananaProAsync( + + global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBananaProRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Generate with Nano Banana Pro
+ /// Generate images with Nano Banana Pro. Optionally upload source images as
+ /// `images` using `multipart/form-data` to edit them with the prompt.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ImagesGeneratePostGenerateImageV2NanoBananaProAsResponseAsync( + + global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBananaProRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Generate with Nano Banana Pro
+ /// Generate images with Nano Banana Pro. Optionally upload source images as
+ /// `images` using `multipart/form-data` to edit them with the prompt.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt to generate images from, or the edit instruction to apply when source images are supplied. It is passed to the model as written. + /// + /// + /// Optional source images to edit (max 10, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only. + /// + /// + /// Output aspect ratios Nano Banana Pro serves. `auto` lets the model choose the shape; an edit keeps its source image's shape.
+ /// Default Value: auto + /// + /// + /// The output resolution tier.
+ /// Default Value: 1K + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2NanoBananaProAsync( + string prompt, + bool? dryRun = default, + global::System.Collections.Generic.IList? images = default, + global::Ideogram.NanoBananaProAspectRatio? aspectRatio = default, + global::Ideogram.V2ImageGenerateNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier? resolutionTier = default, + int? numImages = default, + int? seed = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2PImageIdeogram.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2PImageIdeogram.g.cs new file mode 100644 index 00000000..0157f267 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2PImageIdeogram.g.cs @@ -0,0 +1,134 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IImagesGenerateClient + { + /// + /// Generate with P-Image Ideogram
+ /// Generate images with P-Image Ideogram, a fast model with selectable
+ /// quality and resolution tiers. Returns results directly by default; set
+ /// `async` or supply a `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2PImageIdeogramAsync( + + global::Ideogram.GenerateImagePImageIdeogramRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Generate with P-Image Ideogram
+ /// Generate images with P-Image Ideogram, a fast model with selectable
+ /// quality and resolution tiers. Returns results directly by default; set
+ /// `async` or supply a `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ImagesGeneratePostGenerateImageV2PImageIdeogramAsResponseAsync( + + global::Ideogram.GenerateImagePImageIdeogramRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Generate with P-Image Ideogram
+ /// Generate images with P-Image Ideogram, a fast model with selectable
+ /// quality and resolution tiers. Returns results directly by default; set
+ /// `async` or supply a `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt to generate images from, in natural language or as a
+ /// structured Ideogram 4.0 JSON prompt. + /// + /// + /// Controls magic prompt (automatic prompt rewriting). `off` disables magic prompt entirely. Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// The generation quality level. Defaults to `medium`.
+ /// Default Value: medium + /// + /// + /// The output size tier. Defaults to `1k`. Cannot be combined with `custom_width`/`custom_height`. + /// + /// + /// The output aspect ratio. Defaults to `1x1`.
+ /// Default Value: 1x1 + /// + /// + /// Optional. An exact output width in pixels, used together with
+ /// `custom_height` for output sizes outside the preset tiers. Must
+ /// be a positive multiple of 16 between 16 and 4096, and
+ /// `custom_width` × `custom_height` must not exceed 4,194,304 pixels
+ /// (2048×2048). Cannot be combined with `resolution` or
+ /// `aspect_ratio`; the request is billed at the resolution tier
+ /// matching its total pixel count. + /// + /// + /// Optional. An exact output height in pixels, used together with
+ /// `custom_width`. See `custom_width` for the accepted range and
+ /// billing behavior. + /// + /// + /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2PImageIdeogramAsync( + string prompt, + bool? dryRun = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + int? seed = default, + int? numImages = default, + global::Ideogram.GenerationQuality? quality = default, + global::Ideogram.GenerateImagePImageIdeogramRequestResolution? resolution = default, + global::Ideogram.AspectRatioV3? aspectRatio = default, + int? customWidth = default, + int? customHeight = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2ZImage.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2ZImage.g.cs new file mode 100644 index 00000000..afc97874 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.ImagesGeneratePostGenerateImageV2ZImage.g.cs @@ -0,0 +1,100 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IImagesGenerateClient + { + /// + /// Generate with Z-Image
+ /// Generate images from a text prompt with Z-Image. Returns results
+ /// directly by default; set `async` or supply a `webhook_url` to get a
+ /// `generation_id` and poll `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2ZImageAsync( + + global::Ideogram.GenerateImageZImageRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Generate with Z-Image
+ /// Generate images from a text prompt with Z-Image. Returns results
+ /// directly by default; set `async` or supply a `webhook_url` to get a
+ /// `generation_id` and poll `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ImagesGeneratePostGenerateImageV2ZImageAsResponseAsync( + + global::Ideogram.GenerateImageZImageRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Generate with Z-Image
+ /// Generate images from a text prompt with Z-Image. Returns results
+ /// directly by default; set `async` or supply a `webhook_url` to get a
+ /// `generation_id` and poll `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt to generate images from. + /// + /// + /// Exact output resolution, formatted as "WIDTHxHEIGHT". Each side must be a positive multiple of 16 and the total area must not exceed 1,048,576 pixels (1024×1024). When omitted, the model's default 1024×1024 is used. + /// + /// + /// Optional number of diffusion steps. When omitted, the model's
+ /// default is used. Higher values improve quality but take longer. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2ZImageAsync( + string prompt, + bool? dryRun = default, + string? resolution = default, + int? numInferenceSteps = default, + int? seed = default, + int? numImages = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2GptImage2.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2GptImage2.g.cs deleted file mode 100644 index 40c22f64..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2GptImage2.g.cs +++ /dev/null @@ -1,128 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IImagesGenerateClient - { - /// - /// Generate with GPT Image 2
- /// Generate images with GPT Image 2. Optionally upload source images as
- /// `images` using `multipart/form-data` to edit them with the prompt.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageV2GptImage2Async( - - global::Ideogram.GenerateImageGptImage2Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with GPT Image 2
- /// Generate images with GPT Image 2. Optionally upload source images as
- /// `images` using `multipart/form-data` to edit them with the prompt.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostGenerateImageV2GptImage2AsResponseAsync( - - global::Ideogram.GenerateImageGptImage2Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with GPT Image 2
- /// Generate images with GPT Image 2. Optionally upload source images as
- /// `images` using `multipart/form-data` to edit them with the prompt.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// The prompt to generate images from, or the edit instruction to apply when source images are supplied. It is passed to the model as written. - /// - /// - /// Existing upload or generated image assets to edit, by reference. Takes priority over `images` if both are supplied. - /// - /// - /// Optional source images to edit (max 16, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only. - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The requested output aspect ratio, for example "1:1", "16:9", or "9:16". Ignored when `resolution` is provided. Defaults to "1:1". - /// - /// - /// Exact output resolution, formatted as "WIDTHxHEIGHT", for example
- /// "2048x2048" or "1920x1088". When provided, this takes precedence
- /// over `aspect_ratio`. The dimensions must satisfy GPT Image 2
- /// constraints: each side is a multiple of 16, the largest side is at
- /// most 3840px, the long:short ratio is at most 3:1, and total pixels
- /// are between 655360 and 8294400 inclusive. - /// - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageV2GptImage2Async( - string prompt, - bool? dryRun = default, - global::System.Collections.Generic.IList? imageAssetIdentifiers = default, - global::System.Collections.Generic.IList? images = default, - int? numImages = default, - int? seed = default, - string? aspectRatio = default, - string? resolution = default, - bool? async = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2GptImage25Flare.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2GptImage25Flare.g.cs deleted file mode 100644 index e45ce89a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2GptImage25Flare.g.cs +++ /dev/null @@ -1,150 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IImagesGenerateClient - { - /// - /// Generate with GPT Image 2.5 Flare
- /// Generate images with GPT Image 2.5 Flare, the fast variant of GPT Image
- /// 2.5. Optionally upload source images as `images` using
- /// `multipart/form-data` to edit them with the prompt. Returns results
- /// directly by default; set `async` or supply a `webhook_url` to get a
- /// `generation_id` and poll `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageV2GptImage25FlareAsync( - - global::Ideogram.GenerateImageGptImage25FlareRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with GPT Image 2.5 Flare
- /// Generate images with GPT Image 2.5 Flare, the fast variant of GPT Image
- /// 2.5. Optionally upload source images as `images` using
- /// `multipart/form-data` to edit them with the prompt. Returns results
- /// directly by default; set `async` or supply a `webhook_url` to get a
- /// `generation_id` and poll `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostGenerateImageV2GptImage25FlareAsResponseAsync( - - global::Ideogram.GenerateImageGptImage25FlareRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with GPT Image 2.5 Flare
- /// Generate images with GPT Image 2.5 Flare, the fast variant of GPT Image
- /// 2.5. Optionally upload source images as `images` using
- /// `multipart/form-data` to edit them with the prompt. Returns results
- /// directly by default; set `async` or supply a `webhook_url` to get a
- /// `generation_id` and poll `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// The prompt to generate images from, or the edit instruction to apply when source images are supplied. It is passed to the model as written. - /// - /// - /// Existing upload or generated image assets to edit, by reference. Takes priority over `images` if both are supplied. - /// - /// - /// Optional source images to edit (max 16, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only. - /// - /// - /// An existing upload or generated image asset to use as the mask, by reference. The same rules as `mask` apply. Takes priority over `mask` if both are supplied. - /// - /// - /// An optional mask for the first source image (max 25MB; JPEG, PNG, or WEBP). Multipart requests only. Fully transparent pixels mark the areas to edit. The mask must have the same dimensions as the first source image, and requires source images in the same request. - /// - /// - /// An optional mask for the first source image (max 25MB; JPEG, PNG, or WEBP). Multipart requests only. Fully transparent pixels mark the areas to edit. The mask must have the same dimensions as the first source image, and requires source images in the same request. - /// - /// - /// The output background. `transparent` returns images with an alpha channel, `opaque` forces a solid background, and `auto` lets the model decide from the prompt.
- /// Default Value: auto - /// - /// - /// How much rendering effort the model spends. Lower tiers return sooner and cost less; `auto` lets the model choose, which it currently renders at `high`.
- /// Default Value: auto - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The requested output aspect ratio, for example "1:1", "16:9", or "9:16". Ignored when `resolution` is provided. Defaults to "1:1". - /// - /// - /// Exact output resolution, formatted as "WIDTHxHEIGHT", for example
- /// "2048x2048" or "1920x1088". When provided, this takes precedence
- /// over `aspect_ratio`. The dimensions must satisfy GPT Image 2.5 Flare
- /// constraints: each side is a multiple of 16, the largest side is at
- /// most 3840px, the long:short ratio is at most 3:1, and total pixels
- /// are between 655360 and 8294400 inclusive. - /// - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageV2GptImage25FlareAsync( - string prompt, - bool? dryRun = default, - global::System.Collections.Generic.IList? imageAssetIdentifiers = default, - global::System.Collections.Generic.IList? images = default, - global::Ideogram.AssetIdentifier? maskAssetIdentifier = default, - byte[]? mask = default, - string? maskname = default, - global::Ideogram.GenerateImageGptImage25FlareRequestBackground? background = default, - global::Ideogram.GenerateImageGptImage25FlareRequestQuality? quality = default, - int? numImages = default, - int? seed = default, - string? aspectRatio = default, - string? resolution = default, - bool? async = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2GptImage25Sunburst.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2GptImage25Sunburst.g.cs deleted file mode 100644 index 9026ee4f..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2GptImage25Sunburst.g.cs +++ /dev/null @@ -1,153 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IImagesGenerateClient - { - /// - /// Generate with GPT Image 2.5 Sunburst
- /// Generate images with GPT Image 2.5 Sunburst, the quality variant of GPT
- /// Image 2.5, with finer detail at higher latency than Flare. Optionally
- /// upload source images as `images` using `multipart/form-data` to edit
- /// them with the prompt. Returns results directly by default; set `async`
- /// or supply a `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageV2GptImage25SunburstAsync( - - global::Ideogram.GenerateImageGptImage25SunburstRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with GPT Image 2.5 Sunburst
- /// Generate images with GPT Image 2.5 Sunburst, the quality variant of GPT
- /// Image 2.5, with finer detail at higher latency than Flare. Optionally
- /// upload source images as `images` using `multipart/form-data` to edit
- /// them with the prompt. Returns results directly by default; set `async`
- /// or supply a `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostGenerateImageV2GptImage25SunburstAsResponseAsync( - - global::Ideogram.GenerateImageGptImage25SunburstRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with GPT Image 2.5 Sunburst
- /// Generate images with GPT Image 2.5 Sunburst, the quality variant of GPT
- /// Image 2.5, with finer detail at higher latency than Flare. Optionally
- /// upload source images as `images` using `multipart/form-data` to edit
- /// them with the prompt. Returns results directly by default; set `async`
- /// or supply a `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// The prompt to generate images from, or the edit instruction to apply when source images are supplied. It is passed to the model as written. - /// - /// - /// Existing upload or generated image assets to edit, by reference. Takes priority over `images` if both are supplied. - /// - /// - /// Optional source images to edit (max 16, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only. - /// - /// - /// An existing upload or generated image asset to use as the mask, by reference. The same rules as `mask` apply. Takes priority over `mask` if both are supplied. - /// - /// - /// An optional mask for the first source image (max 25MB; JPEG, PNG, or WEBP). Multipart requests only. Fully transparent pixels mark the areas to edit. The mask must have the same dimensions as the first source image, and requires source images in the same request. - /// - /// - /// An optional mask for the first source image (max 25MB; JPEG, PNG, or WEBP). Multipart requests only. Fully transparent pixels mark the areas to edit. The mask must have the same dimensions as the first source image, and requires source images in the same request. - /// - /// - /// The output background. `transparent` returns images with an alpha channel, `opaque` forces a solid background, and `auto` lets the model decide from the prompt.
- /// Default Value: auto - /// - /// - /// How much rendering effort the model spends. Lower tiers return sooner and cost less; `auto` lets the model choose, which it currently renders at `high`.
- /// Default Value: auto - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The requested output aspect ratio, for example "1:1", "16:9", or "9:16". Ignored when `resolution` is provided. Defaults to "1:1". - /// - /// - /// Exact output resolution, formatted as "WIDTHxHEIGHT", for example
- /// "2048x2048" or "1920x1088". When provided, this takes precedence
- /// over `aspect_ratio`. The dimensions must satisfy GPT Image 2.5 Sunburst
- /// constraints: each side is a multiple of 16, the largest side is at
- /// most 3840px, the long:short ratio is at most 3:1, and total pixels
- /// are between 655360 and 8294400 inclusive. - /// - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageV2GptImage25SunburstAsync( - string prompt, - bool? dryRun = default, - global::System.Collections.Generic.IList? imageAssetIdentifiers = default, - global::System.Collections.Generic.IList? images = default, - global::Ideogram.AssetIdentifier? maskAssetIdentifier = default, - byte[]? mask = default, - string? maskname = default, - global::Ideogram.GenerateImageGptImage25SunburstRequestBackground? background = default, - global::Ideogram.GenerateImageGptImage25SunburstRequestQuality? quality = default, - int? numImages = default, - int? seed = default, - string? aspectRatio = default, - string? resolution = default, - bool? async = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2Ideogram45.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2Ideogram45.g.cs deleted file mode 100644 index 1286f69a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2Ideogram45.g.cs +++ /dev/null @@ -1,173 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IImagesGenerateClient - { - /// - /// Generate with Ideogram 4.5
- /// Generate images with Ideogram 4.5 from a natural-language or structured
- /// JSON prompt. Optionally upload source images as `images` using
- /// `multipart/form-data` to edit them with the prompt. Returns results
- /// directly by default; set `async` or supply a `webhook_url` to get a
- /// `generation_id` and poll `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageV2Ideogram45Async( - - global::Ideogram.GenerateImageIdeogram45Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with Ideogram 4.5
- /// Generate images with Ideogram 4.5 from a natural-language or structured
- /// JSON prompt. Optionally upload source images as `images` using
- /// `multipart/form-data` to edit them with the prompt. Returns results
- /// directly by default; set `async` or supply a `webhook_url` to get a
- /// `generation_id` and poll `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostGenerateImageV2Ideogram45AsResponseAsync( - - global::Ideogram.GenerateImageIdeogram45Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with Ideogram 4.5
- /// Generate images with Ideogram 4.5 from a natural-language or structured
- /// JSON prompt. Optionally upload source images as `images` using
- /// `multipart/form-data` to edit them with the prompt. Returns results
- /// directly by default; set `async` or supply a `webhook_url` to get a
- /// `generation_id` and poll `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// The prompt to generate images from, or the edit instruction when
- /// source images are supplied. Natural language or a structured
- /// Ideogram 4.0 JSON prompt. - /// - /// - /// Controls how a natural-language prompt is prepared. `auto` (the
- /// default) and `on` rewrite and expand the prompt before generation.
- /// `off` keeps your wording and only converts it into a structured
- /// prompt. A valid structured JSON prompt skips magic prompt unless
- /// `magic_prompt` is `on`. With source images, every mode converts
- /// the edit instruction into a structured edit prompt.
- /// Default Value: auto - /// - /// - /// Existing upload or generated image assets to transform, by reference. Takes priority over `images` if both are supplied. The first source is the primary image; any further sources are additional references. Supplying sources turns the request into an image-to-image transform. - /// - /// - /// Optional source images to edit (max 5, max 25MB each; JPEG, PNG, or WEBP). The first image is the one being edited; any others are extra references. Multipart requests only. - /// - /// - /// An existing upload or generated image asset to use as the mask, by reference. The same rules as `mask` apply. Takes priority over `mask` if both are supplied. - /// - /// - /// An optional mask that limits the edit to part of the first source image (max 25MB; JPEG, PNG, or WEBP). Multipart requests only. Black marks the area to edit and white the area to keep; values in between are rounded to the nearer of the two. The mask must have the same width and height as the first source image and contain both black and white areas. A masked request can include at most three other source images. With a mask, the output is always the first source image's own size, so `size` cannot be set. - /// - /// - /// An optional mask that limits the edit to part of the first source image (max 25MB; JPEG, PNG, or WEBP). Multipart requests only. Black marks the area to edit and white the area to keep; values in between are rounded to the nearer of the two. The mask must have the same width and height as the first source image and contain both black and white areas. A masked request can include at most three other source images. With a mask, the output is always the first source image's own size, so `size` cannot be set. - /// - /// - /// The output size: "auto", "source" or an exact "WIDTHxHEIGHT".
- /// Without source images, an exact size must be one of the supported
- /// 1K/2K presets (for example 1024x1024, 2048x2048 or 1440x2880);
- /// "auto" or omitted picks a supported size based on the prompt.
- /// "source" is rejected.
- /// With source images, "auto" (the default) picks a supported 2K size
- /// based on the source images and the prompt, and "source" returns the
- /// output at the first source image's own width and height (scaled
- /// down, keeping its proportions, if it is too large for the model).
- /// Every source image's aspect ratio must be between 1:6 and 6:1.
- /// An exact size must have both sides a multiple of 32 and at least
- /// 256px, a total of at most 2048x2048 pixels, and an aspect ratio of
- /// at most 6:1. With source images, an exact size reshapes the source
- /// to it.
- /// Pricing is tiered by the resolved output pixels: up to 1024x1024
- /// bills as 1K, above that as 2K. An "auto" size bills as 2K.
- /// Default Value: auto
- /// Example: 2048x2048 - /// - /// - /// The output background. `transparent` returns images with an alpha channel, `opaque` returns a solid one, and `auto` decides for you.
- /// Default Value: auto - /// - /// - /// The rendering quality to use. Higher quality takes longer and costs more. Defaults to `medium` with source images and `high` without. `very_low`, the fastest and cheapest, requires source images. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. - /// - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageV2Ideogram45Async( - string prompt, - bool? dryRun = default, - global::Ideogram.MagicPromptMode? magicPrompt = default, - global::System.Collections.Generic.IList? imageAssetIdentifiers = default, - global::System.Collections.Generic.IList? images = default, - global::Ideogram.AssetIdentifier? maskAssetIdentifier = default, - byte[]? mask = default, - string? maskname = default, - string? size = default, - global::Ideogram.GenerateImageIdeogram45RequestBackground? background = default, - global::Ideogram.GenerateImageIdeogram45RequestQuality? quality = default, - int? seed = default, - int? numImages = default, - bool? enableCopyrightDetection = default, - bool? async = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2IdeogramV2.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2IdeogramV2.g.cs deleted file mode 100644 index eeab3c8d..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2IdeogramV2.g.cs +++ /dev/null @@ -1,131 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IImagesGenerateClient - { - /// - /// Generate with Ideogram 2.0
- /// Generate images from a text prompt with Ideogram 2.0. Returns results
- /// directly by default; set `async` or supply a `webhook_url` to get a
- /// `generation_id` and poll `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageV2IdeogramV2Async( - - global::Ideogram.GenerateImageIdeogramV2Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with Ideogram 2.0
- /// Generate images from a text prompt with Ideogram 2.0. Returns results
- /// directly by default; set `async` or supply a `webhook_url` to get a
- /// `generation_id` and poll `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostGenerateImageV2IdeogramV2AsResponseAsync( - - global::Ideogram.GenerateImageIdeogramV2Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with Ideogram 2.0
- /// Generate images from a text prompt with Ideogram 2.0. Returns results
- /// directly by default; set `async` or supply a `webhook_url` to get a
- /// `generation_id` and poll `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// The prompt to generate images from. - /// - /// - /// Description of what to exclude from the images. The prompt takes precedence over the negative prompt. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The aspect ratio for an Ideogram 3.x or 2.x generation. `auto` lets the
- /// model select a ratio from the prompt; any other value pins the ratio.
- /// Cannot be combined with `resolution`. Omitting the field is not `auto`:
- /// it uses `1x1`. - /// - /// - /// The rendering speed to use. `turbo` generates faster at a lower cost, while `quality` prioritizes the highest-quality result.
- /// Default Value: default - /// - /// - /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
- /// Default Value: auto - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// The style type to generate with. When omitted, the model's default styling is used; pass `auto` to have a style selected automatically from the prompt.
- /// Example: realistic - /// - /// - /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. - /// - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageV2IdeogramV2Async( - string prompt, - bool? dryRun = default, - string? negativePrompt = default, - int? seed = default, - global::Ideogram.IdeogramV3AspectRatio? aspectRatio = default, - global::Ideogram.GenerateImageIdeogramV2RequestRenderingSpeed? renderingSpeed = default, - global::Ideogram.MagicPromptMode? magicPrompt = default, - int? numImages = default, - global::Ideogram.IdeogramV2StyleType? styleType = default, - bool? enableCopyrightDetection = default, - bool? async = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2IdeogramV2A.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2IdeogramV2A.g.cs deleted file mode 100644 index a050f094..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2IdeogramV2A.g.cs +++ /dev/null @@ -1,130 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IImagesGenerateClient - { - /// - /// Generate with Ideogram 2a
- /// Generate images from a text prompt with Ideogram 2a, a fast, lower-cost
- /// model. Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageV2IdeogramV2AAsync( - - global::Ideogram.GenerateImageIdeogramV2ARequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with Ideogram 2a
- /// Generate images from a text prompt with Ideogram 2a, a fast, lower-cost
- /// model. Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostGenerateImageV2IdeogramV2AAsResponseAsync( - - global::Ideogram.GenerateImageIdeogramV2ARequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with Ideogram 2a
- /// Generate images from a text prompt with Ideogram 2a, a fast, lower-cost
- /// model. Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// The prompt to generate images from. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The aspect ratio for an Ideogram 3.x or 2.x generation. `auto` lets the
- /// model select a ratio from the prompt; any other value pins the ratio.
- /// Cannot be combined with `resolution`. Omitting the field is not `auto`:
- /// it uses `1x1`. - /// - /// - /// The rendering speed to use. `turbo` generates faster at a lower cost, while `quality` prioritizes the highest-quality result.
- /// Default Value: default - /// - /// - /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
- /// Default Value: auto - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// The style type to generate with. When omitted, the model's default styling is used; pass `auto` to have a style selected automatically from the prompt.
- /// Example: realistic - /// - /// - /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. - /// - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageV2IdeogramV2AAsync( - string prompt, - bool? dryRun = default, - int? seed = default, - global::Ideogram.IdeogramV3AspectRatio? aspectRatio = default, - global::Ideogram.GenerateImageIdeogramV2ARequestRenderingSpeed? renderingSpeed = default, - global::Ideogram.MagicPromptMode? magicPrompt = default, - int? numImages = default, - global::Ideogram.IdeogramV2StyleType? styleType = default, - bool? enableCopyrightDetection = default, - bool? async = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2IdeogramV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2IdeogramV3.g.cs deleted file mode 100644 index 648f2718..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2IdeogramV3.g.cs +++ /dev/null @@ -1,172 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IImagesGenerateClient - { - /// - /// Generate with Ideogram 3.0
- /// Generate images from a text prompt with Ideogram 3.0. Optional style
- /// controls include style codes, a style preset, a color palette, and style
- /// references (uploaded `style_reference_images`). Returns
- /// results directly by default; set `async` or supply a `webhook_url` to
- /// get a `generation_id` and poll `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageV2IdeogramV3Async( - - global::Ideogram.GenerateImageIdeogramV3Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with Ideogram 3.0
- /// Generate images from a text prompt with Ideogram 3.0. Optional style
- /// controls include style codes, a style preset, a color palette, and style
- /// references (uploaded `style_reference_images`). Returns
- /// results directly by default; set `async` or supply a `webhook_url` to
- /// get a `generation_id` and poll `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostGenerateImageV2IdeogramV3AsResponseAsync( - - global::Ideogram.GenerateImageIdeogramV3Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with Ideogram 3.0
- /// Generate images from a text prompt with Ideogram 3.0. Optional style
- /// controls include style codes, a style preset, a color palette, and style
- /// references (uploaded `style_reference_images`). Returns
- /// results directly by default; set `async` or supply a `webhook_url` to
- /// get a `generation_id` and poll `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// The prompt to generate images from. - /// - /// - /// Description of what to exclude from the images. The prompt takes precedence over the negative prompt. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The resolutions supported for Ideogram 3.0.
- /// Example: 1280x800 - /// - /// - /// The aspect ratio for an Ideogram 3.x or 2.x generation. `auto` lets the
- /// model select a ratio from the prompt; any other value pins the ratio.
- /// Cannot be combined with `resolution`. Omitting the field is not `auto`:
- /// it uses `1x1`. - /// - /// - /// The rendering speed to use.
- /// Default Value: default - /// - /// - /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
- /// Default Value: auto - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). - /// - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - /// - /// - /// The style type to generate with.
- /// Default Value: general
- /// Example: general - /// - /// - /// A predefined style preset to apply to the generated images. Cannot be combined with style codes or style references. - /// - /// - /// A saved style to apply, by its URL-safe base64 collection id. Cannot be combined with `style_reference_images`. - /// - /// - /// Optional URL-safe base64 version id of the saved style in `style_reference_collection_id`. Ignored without it. - /// - /// - /// Existing upload or generated image assets to use as style references, by reference. Cannot be combined with `style_reference_collection_id` or `style_reference_images`. - /// - /// - /// Images to use as style references (max 10, max 25MB each; JPEG, PNG, or WEBP). - /// - /// - /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. - /// - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageV2IdeogramV3Async( - string prompt, - bool? dryRun = default, - string? negativePrompt = default, - int? seed = default, - global::Ideogram.ResolutionV3? resolution = default, - global::Ideogram.IdeogramV3AspectRatio? aspectRatio = default, - global::Ideogram.GenerateImageIdeogramV3RequestRenderingSpeed? renderingSpeed = default, - global::Ideogram.MagicPromptMode? magicPrompt = default, - int? numImages = default, - global::Ideogram.IdeogramColorPalette? colorPalette = default, - global::System.Collections.Generic.IList? styleCodes = default, - global::Ideogram.IdeogramV3StyleType? styleType = default, - global::Ideogram.IdeogramV3StylePreset? stylePreset = default, - string? styleReferenceCollectionId = default, - string? styleReferenceCollectionVersionId = default, - global::System.Collections.Generic.IList? styleReferenceAssetIdentifiers = default, - global::System.Collections.Generic.IList? styleReferenceImages = default, - bool? enableCopyrightDetection = default, - bool? async = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2IdeogramV3Character.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2IdeogramV3Character.g.cs deleted file mode 100644 index 1c6ce758..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2IdeogramV3Character.g.cs +++ /dev/null @@ -1,186 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IImagesGenerateClient - { - /// - /// Generate a consistent character with Ideogram 3.0
- /// Generate images featuring a consistent character with Ideogram 3.0.
- /// Upload the character as `character_reference_images` using
- /// `multipart/form-data`. Returns
- /// results directly by default; set `async` or supply a `webhook_url` to
- /// get a `generation_id` and poll `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageV2IdeogramV3CharacterAsync( - - global::Ideogram.GenerateImageIdeogramV3CharacterRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate a consistent character with Ideogram 3.0
- /// Generate images featuring a consistent character with Ideogram 3.0.
- /// Upload the character as `character_reference_images` using
- /// `multipart/form-data`. Returns
- /// results directly by default; set `async` or supply a `webhook_url` to
- /// get a `generation_id` and poll `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostGenerateImageV2IdeogramV3CharacterAsResponseAsync( - - global::Ideogram.GenerateImageIdeogramV3CharacterRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate a consistent character with Ideogram 3.0
- /// Generate images featuring a consistent character with Ideogram 3.0.
- /// Upload the character as `character_reference_images` using
- /// `multipart/form-data`. Returns
- /// results directly by default; set `async` or supply a `webhook_url` to
- /// get a `generation_id` and poll `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// The prompt to generate images from. - /// - /// - /// Description of what to exclude from the images. The prompt takes precedence over the negative prompt. - /// - /// - /// A saved character to feature, by its URL-safe base64 collection id. Takes priority over `character_reference_images` if both are supplied. - /// - /// - /// Optional URL-safe base64 version id of the saved character in `character_reference_collection_id`. Ignored without it. - /// - /// - /// An existing upload or generated image asset to use as the character reference, by reference. Takes priority over `character_reference_images` if both are supplied. - /// - /// - /// An image of the character to feature (max 25MB; JPEG, PNG, or WEBP). - /// - /// - /// An existing upload or generated image asset to use as the character reference mask, by reference. The same rules as `character_reference_mask` apply. Takes priority over `character_reference_mask` if both are supplied. - /// - /// - /// Optional grayscale mask marking where the character is in the character reference image, at the same size as that image (JPEG, PNG, or WEBP). Multipart requests only. - /// - /// - /// Optional grayscale mask marking where the character is in the character reference image, at the same size as that image (JPEG, PNG, or WEBP). Multipart requests only. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The resolutions supported for Ideogram 3.0.
- /// Example: 1280x800 - /// - /// - /// The aspect ratio for an Ideogram 3.x or 2.x generation. `auto` lets the
- /// model select a ratio from the prompt; any other value pins the ratio.
- /// Cannot be combined with `resolution`. Omitting the field is not `auto`:
- /// it uses `1x1`. - /// - /// - /// The rendering speed to use.
- /// Default Value: default - /// - /// - /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
- /// Default Value: auto - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// The style type to generate the character with. Defaults to `auto`.
- /// Default Value: auto - /// - /// - /// A saved style to apply, by its URL-safe base64 collection id. Takes priority over `style_reference_images` if both are supplied. - /// - /// - /// Optional URL-safe base64 version id of the saved style in `style_reference_collection_id`. Ignored without it. - /// - /// - /// Existing upload or generated image assets to use as style references, by reference. Takes priority over `style_reference_images` if both are supplied. - /// - /// - /// Images to use as style references (max 10, max 25MB each; JPEG, PNG, or WEBP). - /// - /// - /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. - /// - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageV2IdeogramV3CharacterAsync( - string prompt, - bool? dryRun = default, - string? negativePrompt = default, - string? characterReferenceCollectionId = default, - string? characterReferenceCollectionVersionId = default, - global::System.Collections.Generic.IList? characterReferenceAssetIdentifiers = default, - global::System.Collections.Generic.IList? characterReferenceImages = default, - global::Ideogram.AssetIdentifier? characterReferenceMaskAssetIdentifier = default, - byte[]? characterReferenceMask = default, - string? characterReferenceMaskname = default, - int? seed = default, - global::Ideogram.ResolutionV3? resolution = default, - global::Ideogram.IdeogramV3AspectRatio? aspectRatio = default, - global::Ideogram.GenerateImageIdeogramV3CharacterRequestRenderingSpeed? renderingSpeed = default, - global::Ideogram.MagicPromptMode? magicPrompt = default, - int? numImages = default, - global::Ideogram.GenerateImageIdeogramV3CharacterRequestStyleType? styleType = default, - string? styleReferenceCollectionId = default, - string? styleReferenceCollectionVersionId = default, - global::System.Collections.Generic.IList? styleReferenceAssetIdentifiers = default, - global::System.Collections.Generic.IList? styleReferenceImages = default, - bool? enableCopyrightDetection = default, - bool? async = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2IdeogramV3CustomModel.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2IdeogramV3CustomModel.g.cs deleted file mode 100644 index e7ca5b27..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2IdeogramV3CustomModel.g.cs +++ /dev/null @@ -1,164 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IImagesGenerateClient - { - /// - /// Generate with a custom Ideogram 3.0 model
- /// Generate images with a custom Ideogram 3.0 model that you or your
- /// organization can access, selected by `custom_model_uri`. Returns results
- /// directly by default; set `async` or supply a `webhook_url` to get a
- /// `generation_id` and poll `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageV2IdeogramV3CustomModelAsync( - - global::Ideogram.GenerateImageIdeogramV3CustomModelRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with a custom Ideogram 3.0 model
- /// Generate images with a custom Ideogram 3.0 model that you or your
- /// organization can access, selected by `custom_model_uri`. Returns results
- /// directly by default; set `async` or supply a `webhook_url` to get a
- /// `generation_id` and poll `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostGenerateImageV2IdeogramV3CustomModelAsResponseAsync( - - global::Ideogram.GenerateImageIdeogramV3CustomModelRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with a custom Ideogram 3.0 model
- /// Generate images with a custom Ideogram 3.0 model that you or your
- /// organization can access, selected by `custom_model_uri`. Returns results
- /// directly by default; set `async` or supply a `webhook_url` to get a
- /// `generation_id` and poll `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// The prompt to generate images from. - /// - /// - /// The custom model URI, in the form `model/<model_name>/version/<version_name>`. You or your organization must have access to the model. The model determines which rendering speeds are supported and whether backgrounds are removed automatically.
- /// Example: model/my-custom-model/version/1 - /// - /// - /// Remove the background after generation and return transparent PNG images. Included in the custom model generation price at no extra charge. When false, the model's automatic background removal behavior still applies.
- /// Default Value: false - /// - /// - /// Description of what to exclude from the images. The prompt takes precedence over the negative prompt. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The resolutions supported for Ideogram 3.0.
- /// Example: 1280x800 - /// - /// - /// The aspect ratio for an Ideogram 3.x or 2.x generation. `auto` lets the
- /// model select a ratio from the prompt; any other value pins the ratio.
- /// Cannot be combined with `resolution`. Omitting the field is not `auto`:
- /// it uses `1x1`. - /// - /// - /// The rendering speed to use. When omitted, a speed supported by the custom model is used. - /// - /// - /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
- /// Default Value: auto - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). - /// - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - /// - /// - /// A predefined style preset to apply to the generated images. Cannot be combined with style codes or style references. - /// - /// - /// Existing upload or generated image assets to use as style references, by reference. Cannot be combined with `style_reference_images`. - /// - /// - /// Images to use as style references (max 10, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only. - /// - /// - /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. - /// - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageV2IdeogramV3CustomModelAsync( - string prompt, - string customModelUri, - bool? dryRun = default, - bool? transparentBackground = default, - string? negativePrompt = default, - int? seed = default, - global::Ideogram.ResolutionV3? resolution = default, - global::Ideogram.IdeogramV3AspectRatio? aspectRatio = default, - global::Ideogram.GenerateImageIdeogramV3CustomModelRequestRenderingSpeed? renderingSpeed = default, - global::Ideogram.MagicPromptMode? magicPrompt = default, - int? numImages = default, - global::Ideogram.IdeogramColorPalette? colorPalette = default, - global::System.Collections.Generic.IList? styleCodes = default, - global::Ideogram.IdeogramV3StylePreset? stylePreset = default, - global::System.Collections.Generic.IList? styleReferenceAssetIdentifiers = default, - global::System.Collections.Generic.IList? styleReferenceImages = default, - bool? enableCopyrightDetection = default, - bool? async = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2IdeogramV3Transparent.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2IdeogramV3Transparent.g.cs deleted file mode 100644 index bc6a85e8..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2IdeogramV3Transparent.g.cs +++ /dev/null @@ -1,134 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IImagesGenerateClient - { - /// - /// Generate transparent images with Ideogram 3.0
- /// Generate images on a transparent background with Ideogram 3.0, delivered
- /// as PNGs with alpha. Returns results directly by default; set `async` or
- /// supply a `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageV2IdeogramV3TransparentAsync( - - global::Ideogram.GenerateImageIdeogramV3TransparentRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate transparent images with Ideogram 3.0
- /// Generate images on a transparent background with Ideogram 3.0, delivered
- /// as PNGs with alpha. Returns results directly by default; set `async` or
- /// supply a `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostGenerateImageV2IdeogramV3TransparentAsResponseAsync( - - global::Ideogram.GenerateImageIdeogramV3TransparentRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate transparent images with Ideogram 3.0
- /// Generate images on a transparent background with Ideogram 3.0, delivered
- /// as PNGs with alpha. Returns results directly by default; set `async` or
- /// supply a `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// The prompt to generate images from. - /// - /// - /// Description of what to exclude from the images. The prompt takes precedence over the negative prompt. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// Optional enhancement factor applied after generation. `x1` (the default) delivers the base render.
- /// Default Value: x1 - /// - /// - /// The aspect ratio for an Ideogram 3.x or 2.x generation. `auto` lets the
- /// model select a ratio from the prompt; any other value pins the ratio.
- /// Cannot be combined with `resolution`. Omitting the field is not `auto`:
- /// it uses `1x1`. - /// - /// - /// The rendering speed to use.
- /// Default Value: default - /// - /// - /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
- /// Default Value: auto - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. - /// - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageV2IdeogramV3TransparentAsync( - string prompt, - bool? dryRun = default, - string? negativePrompt = default, - int? seed = default, - global::Ideogram.GenerateImageIdeogramV3TransparentRequestUpscaleFactor? upscaleFactor = default, - global::Ideogram.IdeogramV3AspectRatio? aspectRatio = default, - global::Ideogram.GenerateImageIdeogramV3TransparentRequestRenderingSpeed? renderingSpeed = default, - global::Ideogram.MagicPromptMode? magicPrompt = default, - int? numImages = default, - bool? enableCopyrightDetection = default, - bool? async = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2IdeogramV4.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2IdeogramV4.g.cs deleted file mode 100644 index 5cb28449..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2IdeogramV4.g.cs +++ /dev/null @@ -1,130 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IImagesGenerateClient - { - /// - /// Generate with Ideogram 4.0
- /// Generate images with Ideogram 4.0 from a natural-language or structured
- /// JSON prompt. Returns results directly by default; set `async` or supply
- /// a `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageV2IdeogramV4Async( - - global::Ideogram.GenerateImageIdeogramV4Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with Ideogram 4.0
- /// Generate images with Ideogram 4.0 from a natural-language or structured
- /// JSON prompt. Returns results directly by default; set `async` or supply
- /// a `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostGenerateImageV2IdeogramV4AsResponseAsync( - - global::Ideogram.GenerateImageIdeogramV4Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with Ideogram 4.0
- /// Generate images with Ideogram 4.0 from a natural-language or structured
- /// JSON prompt. Returns results directly by default; set `async` or supply
- /// a `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// The prompt to generate images from, in natural language or as a
- /// structured Ideogram 4.0 JSON prompt. A structured JSON prompt is
- /// used as is and skips magic prompt unless `magic_prompt` is `on`. - /// - /// - /// Controls how a natural-language prompt is prepared. `auto` (the
- /// default) and `on` rewrite and expand the prompt before generation.
- /// `off` keeps your wording and only converts it into a structured
- /// prompt. A valid structured JSON prompt skips magic prompt unless
- /// `magic_prompt` is `on`.
- /// Default Value: auto - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Optional. When supplied, the images are generated at this
- /// resolution. When omitted, an aspect ratio is picked automatically
- /// based on the prompt. - /// - /// - /// The rendering speed to use.
- /// Default Value: default - /// - /// - /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. - /// - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageV2IdeogramV4Async( - string prompt, - bool? dryRun = default, - global::Ideogram.MagicPromptMode? magicPrompt = default, - int? seed = default, - int? numImages = default, - global::Ideogram.ResolutionV4? resolution = default, - global::Ideogram.GenerateImageIdeogramV4RequestRenderingSpeed? renderingSpeed = default, - bool? enableCopyrightDetection = default, - bool? async = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2IdeogramV4CustomModel.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2IdeogramV4CustomModel.g.cs deleted file mode 100644 index f6ec66bf..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2IdeogramV4CustomModel.g.cs +++ /dev/null @@ -1,144 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IImagesGenerateClient - { - /// - /// Generate with a custom Ideogram 4.0 model
- /// Generate images with a custom Ideogram 4.0 model that you or your
- /// organization can access, selected by `custom_model_uri`. Returns results
- /// directly by default; set `async` or supply a `webhook_url` to get a
- /// `generation_id` and poll `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageV2IdeogramV4CustomModelAsync( - - global::Ideogram.GenerateImageIdeogramV4CustomModelRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with a custom Ideogram 4.0 model
- /// Generate images with a custom Ideogram 4.0 model that you or your
- /// organization can access, selected by `custom_model_uri`. Returns results
- /// directly by default; set `async` or supply a `webhook_url` to get a
- /// `generation_id` and poll `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostGenerateImageV2IdeogramV4CustomModelAsResponseAsync( - - global::Ideogram.GenerateImageIdeogramV4CustomModelRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with a custom Ideogram 4.0 model
- /// Generate images with a custom Ideogram 4.0 model that you or your
- /// organization can access, selected by `custom_model_uri`. Returns results
- /// directly by default; set `async` or supply a `webhook_url` to get a
- /// `generation_id` and poll `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// The prompt to generate images from, in natural language or as a
- /// structured Ideogram 4.0 JSON prompt. A structured JSON prompt is
- /// used as is and skips magic prompt unless `magic_prompt` is `on`. - /// - /// - /// The custom model URI, in the form `model/<model_name>/version/<version_name>`. You or your organization must have access to the model. The model determines which rendering speeds are supported.
- /// Example: model/my-custom-v4-model/version/1 - /// - /// - /// Remove the background after generation and return transparent PNG images. Included in the custom model generation price at no extra charge. When false, the model's automatic background removal behavior still applies.
- /// Default Value: false - /// - /// - /// Custom models whose pLoRA checkpoints are fused beneath the `custom_model_uri` model, in list order: the first entry is applied first and `custom_model_uri` last. Every entry must be an accessible Ideogram 4.0 LoRA with a registered checkpoint and must not repeat `custom_model_uri`.
- /// Example: [{"custom_model_uri":"model/my-base-plora/version/1","weight":0.5}] - /// - /// - /// Controls how a natural-language prompt is prepared. `auto` (the
- /// default) and `on` rewrite and expand the prompt before generation.
- /// `off` keeps your wording and only converts it into a structured
- /// prompt. A valid structured JSON prompt skips magic prompt unless
- /// `magic_prompt` is `on`.
- /// Default Value: auto - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Optional. When supplied, the images are generated at this
- /// resolution. When omitted, an aspect ratio is picked automatically
- /// based on the prompt. - /// - /// - /// The rendering speed to use. When omitted, a speed supported by the custom model is used. - /// - /// - /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. - /// - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageV2IdeogramV4CustomModelAsync( - string prompt, - string customModelUri, - bool? dryRun = default, - bool? transparentBackground = default, - global::System.Collections.Generic.IList? stackedCustomModels = default, - global::Ideogram.MagicPromptMode? magicPrompt = default, - int? seed = default, - int? numImages = default, - global::Ideogram.ResolutionV4? resolution = default, - global::Ideogram.GenerateImageIdeogramV4CustomModelRequestRenderingSpeed? renderingSpeed = default, - bool? enableCopyrightDetection = default, - bool? async = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2IdeogramV4Transparent.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2IdeogramV4Transparent.g.cs deleted file mode 100644 index 1ac71566..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2IdeogramV4Transparent.g.cs +++ /dev/null @@ -1,140 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IImagesGenerateClient - { - /// - /// Generate transparent images with Ideogram 4.0
- /// Generate images on a transparent background with Ideogram 4.0, delivered
- /// as PNGs with alpha. Returns results directly by default; set `async` or
- /// supply a `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageV2IdeogramV4TransparentAsync( - - global::Ideogram.GenerateImageIdeogramV4TransparentRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate transparent images with Ideogram 4.0
- /// Generate images on a transparent background with Ideogram 4.0, delivered
- /// as PNGs with alpha. Returns results directly by default; set `async` or
- /// supply a `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostGenerateImageV2IdeogramV4TransparentAsResponseAsync( - - global::Ideogram.GenerateImageIdeogramV4TransparentRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate transparent images with Ideogram 4.0
- /// Generate images on a transparent background with Ideogram 4.0, delivered
- /// as PNGs with alpha. Returns results directly by default; set `async` or
- /// supply a `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// The prompt to generate images from, in natural language or as a
- /// structured Ideogram 4.0 JSON prompt. A structured JSON prompt is
- /// used as is and skips magic prompt, except that its background
- /// description is replaced with a transparent background. - /// - /// - /// Controls how a natural-language prompt is prepared. `auto` (the
- /// default) and `on` rewrite and expand the prompt before generation.
- /// `off` keeps your wording and only converts it into a structured
- /// prompt. A valid structured JSON prompt skips magic prompt unless
- /// `magic_prompt` is `on`.
- /// Default Value: auto - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Supported output aspect ratios. The operation defines whether `auto`
- /// preserves the source shape or selects a shape from the prompt.
- /// Default Value: auto - /// - /// - /// The output resolution tier. Each tier is a total pixel budget equal
- /// to a square of the named size (for example, `8k` delivers at most
- /// 8192x8192 pixels in total). Wide and tall aspect ratios keep the
- /// same budget, so one side may exceed the named size. Tiers above
- /// 2k are produced by upscaling after generation. Defaults to 1k.
- /// Default Value: 1k - /// - /// - /// The rendering speed to use.
- /// Default Value: default - /// - /// - /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. - /// - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageV2IdeogramV4TransparentAsync( - string prompt, - bool? dryRun = default, - global::Ideogram.MagicPromptMode? magicPrompt = default, - int? seed = default, - int? numImages = default, - global::Ideogram.IdeogramV4AspectRatio? aspectRatio = default, - global::Ideogram.GenerateImageIdeogramV4TransparentRequestOutputResolution? outputResolution = default, - global::Ideogram.GenerateImageIdeogramV4TransparentRequestRenderingSpeed? renderingSpeed = default, - bool? enableCopyrightDetection = default, - bool? async = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2NanoBanana2.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2NanoBanana2.g.cs deleted file mode 100644 index c1febb52..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2NanoBanana2.g.cs +++ /dev/null @@ -1,125 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IImagesGenerateClient - { - /// - /// Generate with Nano Banana 2
- /// Generate images with Nano Banana 2. Optionally upload source images as
- /// `images` using `multipart/form-data` to edit them with the prompt.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageV2NanoBanana2Async( - - global::Ideogram.GenerateImageNanoBanana2Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with Nano Banana 2
- /// Generate images with Nano Banana 2. Optionally upload source images as
- /// `images` using `multipart/form-data` to edit them with the prompt.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostGenerateImageV2NanoBanana2AsResponseAsync( - - global::Ideogram.GenerateImageNanoBanana2Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with Nano Banana 2
- /// Generate images with Nano Banana 2. Optionally upload source images as
- /// `images` using `multipart/form-data` to edit them with the prompt.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// The prompt to generate images from, or the edit instruction to apply when source images are supplied. It is passed to the model as written. - /// - /// - /// Existing upload or generated image assets to edit, by reference. Takes priority over `images` if both are supplied. - /// - /// - /// Optional source images to edit (max 10, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only. - /// - /// - /// Output aspect ratios Nano Banana 2 serves. `auto` lets the model choose the shape; an edit keeps its source image's shape.
- /// Default Value: auto - /// - /// - /// The output resolution tier.
- /// Default Value: 1K - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageV2NanoBanana2Async( - string prompt, - bool? dryRun = default, - global::System.Collections.Generic.IList? imageAssetIdentifiers = default, - global::System.Collections.Generic.IList? images = default, - global::Ideogram.NanoBanana2AspectRatio? aspectRatio = default, - global::Ideogram.GenerateImageNanoBanana2RequestResolutionTier? resolutionTier = default, - int? numImages = default, - int? seed = default, - bool? async = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2NanoBanana21.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2NanoBanana21.g.cs deleted file mode 100644 index 9e868fca..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2NanoBanana21.g.cs +++ /dev/null @@ -1,125 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IImagesGenerateClient - { - /// - /// Generate with Nano Banana 2.1
- /// Generate images with Nano Banana 2.1. Optionally upload source images as
- /// `images` using `multipart/form-data` to edit them with the prompt.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageV2NanoBanana21Async( - - global::Ideogram.GenerateImageNanoBanana21Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with Nano Banana 2.1
- /// Generate images with Nano Banana 2.1. Optionally upload source images as
- /// `images` using `multipart/form-data` to edit them with the prompt.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostGenerateImageV2NanoBanana21AsResponseAsync( - - global::Ideogram.GenerateImageNanoBanana21Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with Nano Banana 2.1
- /// Generate images with Nano Banana 2.1. Optionally upload source images as
- /// `images` using `multipart/form-data` to edit them with the prompt.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// The prompt to generate images from, or the edit instruction to apply when source images are supplied. It is passed to the model as written. - /// - /// - /// Existing upload or generated image assets to edit, by reference. Takes priority over `images` if both are supplied. - /// - /// - /// Optional source images to edit (max 10, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only. - /// - /// - /// Output aspect ratios Nano Banana 2.1 serves. `auto` lets the model choose the shape; an edit keeps its source image's shape.
- /// Default Value: auto - /// - /// - /// The output resolution tier.
- /// Default Value: 1K - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageV2NanoBanana21Async( - string prompt, - bool? dryRun = default, - global::System.Collections.Generic.IList? imageAssetIdentifiers = default, - global::System.Collections.Generic.IList? images = default, - global::Ideogram.NanoBanana21AspectRatio? aspectRatio = default, - global::Ideogram.GenerateImageNanoBanana21RequestResolutionTier? resolutionTier = default, - int? numImages = default, - int? seed = default, - bool? async = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2NanoBananaPro.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2NanoBananaPro.g.cs deleted file mode 100644 index 4b734ded..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2NanoBananaPro.g.cs +++ /dev/null @@ -1,125 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IImagesGenerateClient - { - /// - /// Generate with Nano Banana Pro
- /// Generate images with Nano Banana Pro. Optionally upload source images as
- /// `images` using `multipart/form-data` to edit them with the prompt.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageV2NanoBananaProAsync( - - global::Ideogram.GenerateImageNanoBananaProRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with Nano Banana Pro
- /// Generate images with Nano Banana Pro. Optionally upload source images as
- /// `images` using `multipart/form-data` to edit them with the prompt.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostGenerateImageV2NanoBananaProAsResponseAsync( - - global::Ideogram.GenerateImageNanoBananaProRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with Nano Banana Pro
- /// Generate images with Nano Banana Pro. Optionally upload source images as
- /// `images` using `multipart/form-data` to edit them with the prompt.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// The prompt to generate images from, or the edit instruction to apply when source images are supplied. It is passed to the model as written. - /// - /// - /// Existing upload or generated image assets to edit, by reference. Takes priority over `images` if both are supplied. - /// - /// - /// Optional source images to edit (max 10, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only. - /// - /// - /// Output aspect ratios Nano Banana Pro serves. `auto` lets the model choose the shape; an edit keeps its source image's shape.
- /// Default Value: auto - /// - /// - /// The output resolution tier.
- /// Default Value: 1K - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageV2NanoBananaProAsync( - string prompt, - bool? dryRun = default, - global::System.Collections.Generic.IList? imageAssetIdentifiers = default, - global::System.Collections.Generic.IList? images = default, - global::Ideogram.NanoBananaProAspectRatio? aspectRatio = default, - global::Ideogram.GenerateImageNanoBananaProRequestResolutionTier? resolutionTier = default, - int? numImages = default, - int? seed = default, - bool? async = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2PImageIdeogram.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2PImageIdeogram.g.cs deleted file mode 100644 index a97bc735..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2PImageIdeogram.g.cs +++ /dev/null @@ -1,144 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IImagesGenerateClient - { - /// - /// Generate with P-Image Ideogram
- /// Generate images with P-Image Ideogram, a fast model with selectable
- /// quality and resolution tiers. Returns results directly by default; set
- /// `async` or supply a `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageV2PImageIdeogramAsync( - - global::Ideogram.GenerateImagePImageIdeogramRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with P-Image Ideogram
- /// Generate images with P-Image Ideogram, a fast model with selectable
- /// quality and resolution tiers. Returns results directly by default; set
- /// `async` or supply a `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostGenerateImageV2PImageIdeogramAsResponseAsync( - - global::Ideogram.GenerateImagePImageIdeogramRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with P-Image Ideogram
- /// Generate images with P-Image Ideogram, a fast model with selectable
- /// quality and resolution tiers. Returns results directly by default; set
- /// `async` or supply a `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// The prompt to generate images from, in natural language or as a
- /// structured Ideogram 4.0 JSON prompt. - /// - /// - /// Controls magic prompt (automatic prompt rewriting). `off` disables magic prompt entirely. Defaults to `auto`.
- /// Default Value: auto - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// The generation quality level. Defaults to `medium`.
- /// Default Value: medium - /// - /// - /// The output size tier. Defaults to `1k`. Cannot be combined with `custom_width`/`custom_height`. - /// - /// - /// The output aspect ratio. Defaults to `1x1`.
- /// Default Value: 1x1 - /// - /// - /// Optional. An exact output width in pixels, used together with
- /// `custom_height` for output sizes outside the preset tiers. Must
- /// be a positive multiple of 16 between 16 and 4096, and
- /// `custom_width` × `custom_height` must not exceed 4,194,304 pixels
- /// (2048×2048). Cannot be combined with `resolution` or
- /// `aspect_ratio`; the request is billed at the resolution tier
- /// matching its total pixel count. - /// - /// - /// Optional. An exact output height in pixels, used together with
- /// `custom_width`. See `custom_width` for the accepted range and
- /// billing behavior. - /// - /// - /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. - /// - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageV2PImageIdeogramAsync( - string prompt, - bool? dryRun = default, - global::Ideogram.MagicPromptMode? magicPrompt = default, - int? seed = default, - int? numImages = default, - global::Ideogram.GenerationQuality? quality = default, - global::Ideogram.GenerateImagePImageIdeogramRequestResolution? resolution = default, - global::Ideogram.AspectRatioV3? aspectRatio = default, - int? customWidth = default, - int? customHeight = default, - bool? enableCopyrightDetection = default, - bool? async = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2ZImage.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2ZImage.g.cs deleted file mode 100644 index 6971ddf2..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.PostGenerateImageV2ZImage.g.cs +++ /dev/null @@ -1,113 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IImagesGenerateClient - { - /// - /// Generate with Z-Image
- /// Generate images from a text prompt with Z-Image. Returns results
- /// directly by default; set `async` or supply a `webhook_url` to get a
- /// `generation_id` and poll `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageV2ZImageAsync( - - global::Ideogram.GenerateImageZImageRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with Z-Image
- /// Generate images from a text prompt with Z-Image. Returns results
- /// directly by default; set `async` or supply a `webhook_url` to get a
- /// `generation_id` and poll `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostGenerateImageV2ZImageAsResponseAsync( - - global::Ideogram.GenerateImageZImageRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate with Z-Image
- /// Generate images from a text prompt with Z-Image. Returns results
- /// directly by default; set `async` or supply a `webhook_url` to get a
- /// `generation_id` and poll `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// The prompt to generate images from.
- /// Example: A futuristic cityscape at golden hour, highly detailed. - /// - /// - /// Exact output resolution, formatted as "WIDTHxHEIGHT". Each side must be a positive multiple of 16 and the total area must not exceed 1,048,576 pixels (1024×1024). When omitted, the model's default 1024×1024 is used.
- /// Example: 1024x1024 - /// - /// - /// Optional number of diffusion steps. When omitted, the model's
- /// default is used. Higher values improve quality but take longer.
- /// Example: 8 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateImageV2ZImageAsync( - string prompt, - bool? dryRun = default, - string? resolution = default, - int? numInferenceSteps = default, - int? seed = default, - int? numImages = default, - bool? async = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.g.cs index 12ccc427..9a106f88 100644 --- a/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.IImagesGenerateClient.g.cs @@ -4,10 +4,6 @@ namespace Ideogram { /// - /// Generate images with a specific model contract. Requests are JSON
- /// (Ideogram 3.0 also accepts multipart for style reference bytes) and
- /// return a generation id that can be polled via
- /// `GET /v2/generations/{generation_id}`.
/// If no httpClient is provided, a new one will be created.
/// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. ///
diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesInpaintClient.ImagesInpaintPostInpaintImageV2IdeogramV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesInpaintClient.ImagesInpaintPostInpaintImageV2IdeogramV3.g.cs new file mode 100644 index 00000000..4c06afce --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IImagesInpaintClient.ImagesInpaintPostInpaintImageV2IdeogramV3.g.cs @@ -0,0 +1,346 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IImagesInpaintClient + { + /// + /// Inpaint with Ideogram 3.0
+ /// Repaint the masked region of a source image with Ideogram 3.0, guided
+ /// by a text prompt. Upload the source `image` and its `mask` using
+ /// `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesInpaintPostInpaintImageV2IdeogramV3Async( + + global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Inpaint with Ideogram 3.0
+ /// Repaint the masked region of a source image with Ideogram 3.0, guided
+ /// by a text prompt. Upload the source `image` and its `mask` using
+ /// `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ImagesInpaintPostInpaintImageV2IdeogramV3AsResponseAsync( + + global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Inpaint with Ideogram 3.0
+ /// Repaint the masked region of a source image with Ideogram 3.0, guided
+ /// by a text prompt. Upload the source `image` and its `mask` using
+ /// `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt describing the repainted result. + /// + /// + /// The source image to repaint (max 25MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The output matches its size, snapped to the nearest supported resolution. + /// + /// + /// The source image to repaint (max 25MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The output matches its size, snapped to the nearest supported resolution. + /// + /// + /// A black-and-white mask the same size as the source image. Black marks the region to repaint. JPEG, PNG, and WEBP are supported. Multipart requests only. + /// + /// + /// A black-and-white mask the same size as the source image. Black marks the region to repaint. JPEG, PNG, and WEBP are supported. Multipart requests only. + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The rendering speed to use.
+ /// Default Value: default + /// + /// + /// The style type to generate with.
+ /// Default Value: general + /// + /// + /// A predefined style preset to apply to the repainted images. Cannot be combined with style codes or style references. + /// + /// + /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images. + /// + /// + /// Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported. + /// + /// + /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the repainted images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesInpaintPostInpaintImageV2IdeogramV3Async( + string prompt, + byte[] image, + string imagename, + byte[] mask, + string maskname, + bool? dryRun = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + int? numImages = default, + int? seed = default, + global::Ideogram.V2ImageInpaintIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed = default, + global::Ideogram.IdeogramV3StyleType? styleType = default, + global::Ideogram.IdeogramV3StylePreset? stylePreset = default, + global::System.Collections.Generic.IList? styleCodes = default, + global::System.Collections.Generic.IList? styleReferenceImages = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Inpaint with Ideogram 3.0
+ /// Repaint the masked region of a source image with Ideogram 3.0, guided
+ /// by a text prompt. Upload the source `image` and its `mask` using
+ /// `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt describing the repainted result. + /// + /// + /// The source image to repaint (max 25MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The output matches its size, snapped to the nearest supported resolution. + /// + /// + /// The source image to repaint (max 25MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The output matches its size, snapped to the nearest supported resolution. + /// + /// + /// A black-and-white mask the same size as the source image. Black marks the region to repaint. JPEG, PNG, and WEBP are supported. Multipart requests only. + /// + /// + /// A black-and-white mask the same size as the source image. Black marks the region to repaint. JPEG, PNG, and WEBP are supported. Multipart requests only. + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The rendering speed to use.
+ /// Default Value: default + /// + /// + /// The style type to generate with.
+ /// Default Value: general + /// + /// + /// A predefined style preset to apply to the repainted images. Cannot be combined with style codes or style references. + /// + /// + /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images. + /// + /// + /// Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported. + /// + /// + /// Optional file names to use for the multipart 'style_reference_images' file parts. + /// + /// + /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the repainted images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesInpaintPostInpaintImageV2IdeogramV3Async( + string prompt, + global::System.IO.Stream image, + string imagename, + global::System.IO.Stream mask, + string maskname, + bool? dryRun = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + int? numImages = default, + int? seed = default, + global::Ideogram.V2ImageInpaintIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed = default, + global::Ideogram.IdeogramV3StyleType? styleType = default, + global::Ideogram.IdeogramV3StylePreset? stylePreset = default, + global::System.Collections.Generic.IList? styleCodes = default, + global::System.Collections.Generic.IReadOnlyList? styleReferenceImages = default, + global::System.Collections.Generic.IReadOnlyList? styleReferenceImagesFileNames = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Inpaint with Ideogram 3.0
+ /// Repaint the masked region of a source image with Ideogram 3.0, guided
+ /// by a text prompt. Upload the source `image` and its `mask` using
+ /// `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt describing the repainted result. + /// + /// + /// The source image to repaint (max 25MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The output matches its size, snapped to the nearest supported resolution. + /// + /// + /// The source image to repaint (max 25MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The output matches its size, snapped to the nearest supported resolution. + /// + /// + /// A black-and-white mask the same size as the source image. Black marks the region to repaint. JPEG, PNG, and WEBP are supported. Multipart requests only. + /// + /// + /// A black-and-white mask the same size as the source image. Black marks the region to repaint. JPEG, PNG, and WEBP are supported. Multipart requests only. + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The rendering speed to use.
+ /// Default Value: default + /// + /// + /// The style type to generate with.
+ /// Default Value: general + /// + /// + /// A predefined style preset to apply to the repainted images. Cannot be combined with style codes or style references. + /// + /// + /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images. + /// + /// + /// Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported. + /// + /// + /// Optional file names to use for the multipart 'style_reference_images' file parts. + /// + /// + /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the repainted images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ImagesInpaintPostInpaintImageV2IdeogramV3AsResponseAsync( + string prompt, + global::System.IO.Stream image, + string imagename, + global::System.IO.Stream mask, + string maskname, + bool? dryRun = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + int? numImages = default, + int? seed = default, + global::Ideogram.V2ImageInpaintIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed = default, + global::Ideogram.IdeogramV3StyleType? styleType = default, + global::Ideogram.IdeogramV3StylePreset? stylePreset = default, + global::System.Collections.Generic.IList? styleCodes = default, + global::System.Collections.Generic.IReadOnlyList? styleReferenceImages = default, + global::System.Collections.Generic.IReadOnlyList? styleReferenceImagesFileNames = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesInpaintClient.ImagesInpaintPostInpaintImageV2IdeogramV3Character.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesInpaintClient.ImagesInpaintPostInpaintImageV2IdeogramV3Character.g.cs new file mode 100644 index 00000000..c3d871ce --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IImagesInpaintClient.ImagesInpaintPostInpaintImageV2IdeogramV3Character.g.cs @@ -0,0 +1,383 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IImagesInpaintClient + { + /// + /// Inpaint a consistent character with Ideogram 3.0
+ /// Repaint the masked region of a source image with Ideogram 3.0 so it
+ /// features a consistent character. Upload the source `image`, its
+ /// `mask`, and a `character_reference_images` image (or use a saved
+ /// character) using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesInpaintPostInpaintImageV2IdeogramV3CharacterAsync( + + global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Inpaint a consistent character with Ideogram 3.0
+ /// Repaint the masked region of a source image with Ideogram 3.0 so it
+ /// features a consistent character. Upload the source `image`, its
+ /// `mask`, and a `character_reference_images` image (or use a saved
+ /// character) using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ImagesInpaintPostInpaintImageV2IdeogramV3CharacterAsResponseAsync( + + global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Inpaint a consistent character with Ideogram 3.0
+ /// Repaint the masked region of a source image with Ideogram 3.0 so it
+ /// features a consistent character. Upload the source `image`, its
+ /// `mask`, and a `character_reference_images` image (or use a saved
+ /// character) using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt describing the repainted result. + /// + /// + /// The source image to repaint (max 25MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The output matches its size, snapped to the nearest supported resolution. + /// + /// + /// The source image to repaint (max 25MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The output matches its size, snapped to the nearest supported resolution. + /// + /// + /// A black-and-white mask the same size as the source image. Black marks the region to repaint. JPEG, PNG, and WEBP are supported. Multipart requests only. + /// + /// + /// A black-and-white mask the same size as the source image. Black marks the region to repaint. JPEG, PNG, and WEBP are supported. Multipart requests only. + /// + /// + /// An image to use as the character reference (max 25MB). JPEG, PNG, and WEBP are supported. + /// + /// + /// Optional grayscale mask for the character reference image, the same size as that image, marking where the character is. Only JPEG, PNG, and WEBP formats are supported. Multipart requests only; cannot be combined with `character_reference_collection_id`. + /// + /// + /// Optional grayscale mask for the character reference image, the same size as that image, marking where the character is. Only JPEG, PNG, and WEBP formats are supported. Multipart requests only; cannot be combined with `character_reference_collection_id`. + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The rendering speed to use.
+ /// Default Value: default + /// + /// + /// The style type to repaint the character with. Defaults to `auto`. `realistic` and `fiction` are supported for character-only requests; style codes or style references (not both) require `auto`. For API-key callers, combining a style with a character requires that feature to be enabled for their account.
+ /// Default Value: auto + /// + /// + /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images. + /// + /// + /// Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported. Cannot be combined with `style_codes`. + /// + /// + /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the repainted images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesInpaintPostInpaintImageV2IdeogramV3CharacterAsync( + string prompt, + byte[] image, + string imagename, + byte[] mask, + string maskname, + global::System.Collections.Generic.IList characterReferenceImages, + bool? dryRun = default, + byte[]? characterReferenceMask = default, + string? characterReferenceMaskname = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + int? numImages = default, + int? seed = default, + global::Ideogram.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed = default, + global::Ideogram.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType? styleType = default, + global::System.Collections.Generic.IList? styleCodes = default, + global::System.Collections.Generic.IList? styleReferenceImages = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Inpaint a consistent character with Ideogram 3.0
+ /// Repaint the masked region of a source image with Ideogram 3.0 so it
+ /// features a consistent character. Upload the source `image`, its
+ /// `mask`, and a `character_reference_images` image (or use a saved
+ /// character) using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt describing the repainted result. + /// + /// + /// The source image to repaint (max 25MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The output matches its size, snapped to the nearest supported resolution. + /// + /// + /// The source image to repaint (max 25MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The output matches its size, snapped to the nearest supported resolution. + /// + /// + /// A black-and-white mask the same size as the source image. Black marks the region to repaint. JPEG, PNG, and WEBP are supported. Multipart requests only. + /// + /// + /// A black-and-white mask the same size as the source image. Black marks the region to repaint. JPEG, PNG, and WEBP are supported. Multipart requests only. + /// + /// + /// An image to use as the character reference (max 25MB). JPEG, PNG, and WEBP are supported. + /// + /// + /// Optional file names to use for the multipart 'character_reference_images' file parts. + /// + /// + /// Optional grayscale mask for the character reference image, the same size as that image, marking where the character is. Only JPEG, PNG, and WEBP formats are supported. Multipart requests only; cannot be combined with `character_reference_collection_id`. + /// + /// + /// Optional grayscale mask for the character reference image, the same size as that image, marking where the character is. Only JPEG, PNG, and WEBP formats are supported. Multipart requests only; cannot be combined with `character_reference_collection_id`. + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The rendering speed to use.
+ /// Default Value: default + /// + /// + /// The style type to repaint the character with. Defaults to `auto`. `realistic` and `fiction` are supported for character-only requests; style codes or style references (not both) require `auto`. For API-key callers, combining a style with a character requires that feature to be enabled for their account.
+ /// Default Value: auto + /// + /// + /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images. + /// + /// + /// Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported. Cannot be combined with `style_codes`. + /// + /// + /// Optional file names to use for the multipart 'style_reference_images' file parts. + /// + /// + /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the repainted images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesInpaintPostInpaintImageV2IdeogramV3CharacterAsync( + string prompt, + global::System.IO.Stream image, + string imagename, + global::System.IO.Stream mask, + string maskname, + global::System.Collections.Generic.IReadOnlyList characterReferenceImages, + bool? dryRun = default, + global::System.Collections.Generic.IReadOnlyList? characterReferenceImagesFileNames = default, + global::System.IO.Stream? characterReferenceMask = default, + string? characterReferenceMaskname = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + int? numImages = default, + int? seed = default, + global::Ideogram.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed = default, + global::Ideogram.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType? styleType = default, + global::System.Collections.Generic.IList? styleCodes = default, + global::System.Collections.Generic.IReadOnlyList? styleReferenceImages = default, + global::System.Collections.Generic.IReadOnlyList? styleReferenceImagesFileNames = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Inpaint a consistent character with Ideogram 3.0
+ /// Repaint the masked region of a source image with Ideogram 3.0 so it
+ /// features a consistent character. Upload the source `image`, its
+ /// `mask`, and a `character_reference_images` image (or use a saved
+ /// character) using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt describing the repainted result. + /// + /// + /// The source image to repaint (max 25MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The output matches its size, snapped to the nearest supported resolution. + /// + /// + /// The source image to repaint (max 25MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The output matches its size, snapped to the nearest supported resolution. + /// + /// + /// A black-and-white mask the same size as the source image. Black marks the region to repaint. JPEG, PNG, and WEBP are supported. Multipart requests only. + /// + /// + /// A black-and-white mask the same size as the source image. Black marks the region to repaint. JPEG, PNG, and WEBP are supported. Multipart requests only. + /// + /// + /// An image to use as the character reference (max 25MB). JPEG, PNG, and WEBP are supported. + /// + /// + /// Optional file names to use for the multipart 'character_reference_images' file parts. + /// + /// + /// Optional grayscale mask for the character reference image, the same size as that image, marking where the character is. Only JPEG, PNG, and WEBP formats are supported. Multipart requests only; cannot be combined with `character_reference_collection_id`. + /// + /// + /// Optional grayscale mask for the character reference image, the same size as that image, marking where the character is. Only JPEG, PNG, and WEBP formats are supported. Multipart requests only; cannot be combined with `character_reference_collection_id`. + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The rendering speed to use.
+ /// Default Value: default + /// + /// + /// The style type to repaint the character with. Defaults to `auto`. `realistic` and `fiction` are supported for character-only requests; style codes or style references (not both) require `auto`. For API-key callers, combining a style with a character requires that feature to be enabled for their account.
+ /// Default Value: auto + /// + /// + /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images. + /// + /// + /// Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported. Cannot be combined with `style_codes`. + /// + /// + /// Optional file names to use for the multipart 'style_reference_images' file parts. + /// + /// + /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the repainted images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ImagesInpaintPostInpaintImageV2IdeogramV3CharacterAsResponseAsync( + string prompt, + global::System.IO.Stream image, + string imagename, + global::System.IO.Stream mask, + string maskname, + global::System.Collections.Generic.IReadOnlyList characterReferenceImages, + bool? dryRun = default, + global::System.Collections.Generic.IReadOnlyList? characterReferenceImagesFileNames = default, + global::System.IO.Stream? characterReferenceMask = default, + string? characterReferenceMaskname = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + int? numImages = default, + int? seed = default, + global::Ideogram.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed = default, + global::Ideogram.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType? styleType = default, + global::System.Collections.Generic.IList? styleCodes = default, + global::System.Collections.Generic.IReadOnlyList? styleReferenceImages = default, + global::System.Collections.Generic.IReadOnlyList? styleReferenceImagesFileNames = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesInpaintClient.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModel.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesInpaintClient.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModel.g.cs new file mode 100644 index 00000000..cc5ccaec --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IImagesInpaintClient.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModel.g.cs @@ -0,0 +1,302 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IImagesInpaintClient + { + /// + /// Inpaint with a custom Ideogram 3.0 model
+ /// Repaint the masked region of a source image with a custom Ideogram 3.0
+ /// model, passed as `custom_model_uri`. Upload the source `image` and its
+ /// `mask` using `multipart/form-data`. Returns results directly by
+ /// default; set `async` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelAsync( + + global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Inpaint with a custom Ideogram 3.0 model
+ /// Repaint the masked region of a source image with a custom Ideogram 3.0
+ /// model, passed as `custom_model_uri`. Upload the source `image` and its
+ /// `mask` using `multipart/form-data`. Returns results directly by
+ /// default; set `async` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelAsResponseAsync( + + global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Inpaint with a custom Ideogram 3.0 model
+ /// Repaint the masked region of a source image with a custom Ideogram 3.0
+ /// model, passed as `custom_model_uri`. Upload the source `image` and its
+ /// `mask` using `multipart/form-data`. Returns results directly by
+ /// default; set `async` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt describing the repainted result. + /// + /// + /// The custom model URI returned by the custom-model API, in the form `model/<model_name>/version/<version_name>`. The authenticated user or organization must have access to the model. + /// + /// + /// The source image to repaint (max 25MB), as JPEG, PNG, or WEBP. Multipart requests only. + /// + /// + /// The source image to repaint (max 25MB), as JPEG, PNG, or WEBP. Multipart requests only. + /// + /// + /// A black-and-white mask the same size as the source image, as JPEG, PNG, or WEBP. Black marks the region to repaint. Multipart requests only. + /// + /// + /// A black-and-white mask the same size as the source image, as JPEG, PNG, or WEBP. Black marks the region to repaint. Multipart requests only. + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The rendering speed to use. When omitted, the server chooses a speed supported by the selected custom model. + /// + /// + /// A predefined style preset. Cannot be combined with style codes or style references. + /// + /// + /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images. + /// + /// + /// Images to use as style references (max 10, max 25MB each), as JPEG, PNG, or WEBP. + /// + /// + /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images return `is_image_safe: false`. + /// + /// + /// When false, wait until the images are ready. When true, return as soon as the request is accepted and poll `GET /v2/generations/{generation_id}`.
+ /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelAsync( + string prompt, + string customModelUri, + byte[] image, + string imagename, + byte[] mask, + string maskname, + bool? dryRun = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + int? numImages = default, + int? seed = default, + global::Ideogram.V2ImageInpaintIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed = default, + global::Ideogram.IdeogramV3StylePreset? stylePreset = default, + global::System.Collections.Generic.IList? styleCodes = default, + global::System.Collections.Generic.IList? styleReferenceImages = default, + bool? enableCopyrightDetection = default, + bool? async = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Inpaint with a custom Ideogram 3.0 model
+ /// Repaint the masked region of a source image with a custom Ideogram 3.0
+ /// model, passed as `custom_model_uri`. Upload the source `image` and its
+ /// `mask` using `multipart/form-data`. Returns results directly by
+ /// default; set `async` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt describing the repainted result. + /// + /// + /// The custom model URI returned by the custom-model API, in the form `model/<model_name>/version/<version_name>`. The authenticated user or organization must have access to the model. + /// + /// + /// The source image to repaint (max 25MB), as JPEG, PNG, or WEBP. Multipart requests only. + /// + /// + /// The source image to repaint (max 25MB), as JPEG, PNG, or WEBP. Multipart requests only. + /// + /// + /// A black-and-white mask the same size as the source image, as JPEG, PNG, or WEBP. Black marks the region to repaint. Multipart requests only. + /// + /// + /// A black-and-white mask the same size as the source image, as JPEG, PNG, or WEBP. Black marks the region to repaint. Multipart requests only. + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The rendering speed to use. When omitted, the server chooses a speed supported by the selected custom model. + /// + /// + /// A predefined style preset. Cannot be combined with style codes or style references. + /// + /// + /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images. + /// + /// + /// Images to use as style references (max 10, max 25MB each), as JPEG, PNG, or WEBP. + /// + /// + /// Optional file names to use for the multipart 'style_reference_images' file parts. + /// + /// + /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images return `is_image_safe: false`. + /// + /// + /// When false, wait until the images are ready. When true, return as soon as the request is accepted and poll `GET /v2/generations/{generation_id}`.
+ /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelAsync( + string prompt, + string customModelUri, + global::System.IO.Stream image, + string imagename, + global::System.IO.Stream mask, + string maskname, + bool? dryRun = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + int? numImages = default, + int? seed = default, + global::Ideogram.V2ImageInpaintIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed = default, + global::Ideogram.IdeogramV3StylePreset? stylePreset = default, + global::System.Collections.Generic.IList? styleCodes = default, + global::System.Collections.Generic.IReadOnlyList? styleReferenceImages = default, + global::System.Collections.Generic.IReadOnlyList? styleReferenceImagesFileNames = default, + bool? enableCopyrightDetection = default, + bool? async = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Inpaint with a custom Ideogram 3.0 model
+ /// Repaint the masked region of a source image with a custom Ideogram 3.0
+ /// model, passed as `custom_model_uri`. Upload the source `image` and its
+ /// `mask` using `multipart/form-data`. Returns results directly by
+ /// default; set `async` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt describing the repainted result. + /// + /// + /// The custom model URI returned by the custom-model API, in the form `model/<model_name>/version/<version_name>`. The authenticated user or organization must have access to the model. + /// + /// + /// The source image to repaint (max 25MB), as JPEG, PNG, or WEBP. Multipart requests only. + /// + /// + /// The source image to repaint (max 25MB), as JPEG, PNG, or WEBP. Multipart requests only. + /// + /// + /// A black-and-white mask the same size as the source image, as JPEG, PNG, or WEBP. Black marks the region to repaint. Multipart requests only. + /// + /// + /// A black-and-white mask the same size as the source image, as JPEG, PNG, or WEBP. Black marks the region to repaint. Multipart requests only. + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The rendering speed to use. When omitted, the server chooses a speed supported by the selected custom model. + /// + /// + /// A predefined style preset. Cannot be combined with style codes or style references. + /// + /// + /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images. + /// + /// + /// Images to use as style references (max 10, max 25MB each), as JPEG, PNG, or WEBP. + /// + /// + /// Optional file names to use for the multipart 'style_reference_images' file parts. + /// + /// + /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images return `is_image_safe: false`. + /// + /// + /// When false, wait until the images are ready. When true, return as soon as the request is accepted and poll `GET /v2/generations/{generation_id}`.
+ /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelAsResponseAsync( + string prompt, + string customModelUri, + global::System.IO.Stream image, + string imagename, + global::System.IO.Stream mask, + string maskname, + bool? dryRun = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + int? numImages = default, + int? seed = default, + global::Ideogram.V2ImageInpaintIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed = default, + global::Ideogram.IdeogramV3StylePreset? stylePreset = default, + global::System.Collections.Generic.IList? styleCodes = default, + global::System.Collections.Generic.IReadOnlyList? styleReferenceImages = default, + global::System.Collections.Generic.IReadOnlyList? styleReferenceImagesFileNames = default, + bool? enableCopyrightDetection = default, + bool? async = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesInpaintClient.PostInpaintImageV2IdeogramV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesInpaintClient.PostInpaintImageV2IdeogramV3.g.cs deleted file mode 100644 index 10953c34..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IImagesInpaintClient.PostInpaintImageV2IdeogramV3.g.cs +++ /dev/null @@ -1,181 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IImagesInpaintClient - { - /// - /// Inpaint with Ideogram 3.0
- /// Repaint the masked region of a source image with Ideogram 3.0, guided
- /// by a text prompt. Upload the source `image` and its `mask` using
- /// `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostInpaintImageV2IdeogramV3Async( - - global::Ideogram.InpaintImageIdeogramV3Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Inpaint with Ideogram 3.0
- /// Repaint the masked region of a source image with Ideogram 3.0, guided
- /// by a text prompt. Upload the source `image` and its `mask` using
- /// `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostInpaintImageV2IdeogramV3AsResponseAsync( - - global::Ideogram.InpaintImageIdeogramV3Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Inpaint with Ideogram 3.0
- /// Repaint the masked region of a source image with Ideogram 3.0, guided
- /// by a text prompt. Upload the source `image` and its `mask` using
- /// `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// The prompt describing the repainted result. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The source image to repaint (max 25MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The output matches its size, snapped to the nearest supported resolution. - /// - /// - /// The source image to repaint (max 25MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The output matches its size, snapped to the nearest supported resolution. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// A black-and-white mask the same size as the source image. Black marks the region to repaint. JPEG, PNG, and WEBP are supported. Multipart requests only. - /// - /// - /// A black-and-white mask the same size as the source image. Black marks the region to repaint. JPEG, PNG, and WEBP are supported. Multipart requests only. - /// - /// - /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
- /// Default Value: auto - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The rendering speed to use.
- /// Default Value: default - /// - /// - /// The style type to generate with.
- /// Default Value: general
- /// Example: general - /// - /// - /// A predefined style preset to apply to the repainted images. Cannot be combined with style codes or style references. - /// - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - /// - /// - /// A saved style to apply, by its URL-safe base64 collection id. Takes priority over `style_reference_images` if both are supplied. - /// - /// - /// Optional URL-safe base64 version id pinning a specific version of the `style_reference_collection_id` collection. Ignored without it. - /// - /// - /// Existing upload or generated image assets to use as style references, by reference. Takes priority over `style_reference_images` if both are supplied. - /// - /// - /// Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported. - /// - /// - /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. - /// - /// - /// When false (the default), the request waits until the repainted images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostInpaintImageV2IdeogramV3Async( - string prompt, - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - global::Ideogram.AssetIdentifier? maskAssetIdentifier = default, - byte[]? mask = default, - string? maskname = default, - global::Ideogram.MagicPromptMode? magicPrompt = default, - int? numImages = default, - int? seed = default, - global::Ideogram.InpaintImageIdeogramV3RequestRenderingSpeed? renderingSpeed = default, - global::Ideogram.IdeogramV3StyleType? styleType = default, - global::Ideogram.IdeogramV3StylePreset? stylePreset = default, - global::System.Collections.Generic.IList? styleCodes = default, - string? styleReferenceCollectionId = default, - string? styleReferenceCollectionVersionId = default, - global::System.Collections.Generic.IList? styleReferenceAssetIdentifiers = default, - global::System.Collections.Generic.IList? styleReferenceImages = default, - bool? enableCopyrightDetection = default, - bool? async = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesInpaintClient.PostInpaintImageV2IdeogramV3Character.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesInpaintClient.PostInpaintImageV2IdeogramV3Character.g.cs deleted file mode 100644 index d4619ec6..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IImagesInpaintClient.PostInpaintImageV2IdeogramV3Character.g.cs +++ /dev/null @@ -1,207 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IImagesInpaintClient - { - /// - /// Inpaint a consistent character with Ideogram 3.0
- /// Repaint the masked region of a source image with Ideogram 3.0 so it
- /// features a consistent character. Upload the source `image`, its
- /// `mask`, and a `character_reference_images` image (or use a saved
- /// character) using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostInpaintImageV2IdeogramV3CharacterAsync( - - global::Ideogram.InpaintImageIdeogramV3CharacterRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Inpaint a consistent character with Ideogram 3.0
- /// Repaint the masked region of a source image with Ideogram 3.0 so it
- /// features a consistent character. Upload the source `image`, its
- /// `mask`, and a `character_reference_images` image (or use a saved
- /// character) using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostInpaintImageV2IdeogramV3CharacterAsResponseAsync( - - global::Ideogram.InpaintImageIdeogramV3CharacterRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Inpaint a consistent character with Ideogram 3.0
- /// Repaint the masked region of a source image with Ideogram 3.0 so it
- /// features a consistent character. Upload the source `image`, its
- /// `mask`, and a `character_reference_images` image (or use a saved
- /// character) using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// The prompt describing the repainted result. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The source image to repaint (max 25MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The output matches its size, snapped to the nearest supported resolution. - /// - /// - /// The source image to repaint (max 25MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The output matches its size, snapped to the nearest supported resolution. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// A black-and-white mask the same size as the source image. Black marks the region to repaint. JPEG, PNG, and WEBP are supported. Multipart requests only. - /// - /// - /// A black-and-white mask the same size as the source image. Black marks the region to repaint. JPEG, PNG, and WEBP are supported. Multipart requests only. - /// - /// - /// A saved character to feature, by its URL-safe base64 collection id. Takes priority over `character_reference_images` if both are supplied. - /// - /// - /// Optional URL-safe base64 version id pinning a specific version of the `character_reference_collection_id` collection. Ignored without it. - /// - /// - /// An existing upload or generated image asset to use as the character reference, by reference. Takes priority over `character_reference_images` if both are supplied. - /// - /// - /// An image to use as the character reference (max 25MB). JPEG, PNG, and WEBP are supported. - /// - /// - /// An existing upload or generated image asset to use as the character reference mask, by reference. The same rules as `character_reference_mask` apply. Takes priority over `character_reference_mask` if both are supplied. - /// - /// - /// Optional grayscale mask for the character reference image, the same size as that image, marking where the character is. Only JPEG, PNG, and WEBP formats are supported. Multipart requests only; cannot be combined with `character_reference_collection_id`. - /// - /// - /// Optional grayscale mask for the character reference image, the same size as that image, marking where the character is. Only JPEG, PNG, and WEBP formats are supported. Multipart requests only; cannot be combined with `character_reference_collection_id`. - /// - /// - /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
- /// Default Value: auto - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The rendering speed to use.
- /// Default Value: default - /// - /// - /// The style type to repaint the character with. Defaults to `auto`. `realistic` and `fiction` are supported for character-only requests; style codes or style references (not both) require `auto`. For API-key callers, combining a style with a character requires that feature to be enabled for their account.
- /// Default Value: auto - /// - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - /// - /// - /// A saved style to apply, by its URL-safe base64 collection id. Takes priority over `style_reference_images` if both are supplied. Cannot be combined with `style_codes`. - /// - /// - /// Optional URL-safe base64 version id pinning a specific version of the `style_reference_collection_id` collection. Ignored without it. - /// - /// - /// Existing upload or generated image assets to use as style references, by reference. Takes priority over `style_reference_images` if both are supplied. Cannot be combined with `style_codes`. - /// - /// - /// Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported. Cannot be combined with `style_codes`. - /// - /// - /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. - /// - /// - /// When false (the default), the request waits until the repainted images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostInpaintImageV2IdeogramV3CharacterAsync( - string prompt, - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - global::Ideogram.AssetIdentifier? maskAssetIdentifier = default, - byte[]? mask = default, - string? maskname = default, - string? characterReferenceCollectionId = default, - string? characterReferenceCollectionVersionId = default, - global::System.Collections.Generic.IList? characterReferenceAssetIdentifiers = default, - global::System.Collections.Generic.IList? characterReferenceImages = default, - global::Ideogram.AssetIdentifier? characterReferenceMaskAssetIdentifier = default, - byte[]? characterReferenceMask = default, - string? characterReferenceMaskname = default, - global::Ideogram.MagicPromptMode? magicPrompt = default, - int? numImages = default, - int? seed = default, - global::Ideogram.InpaintImageIdeogramV3CharacterRequestRenderingSpeed? renderingSpeed = default, - global::Ideogram.InpaintImageIdeogramV3CharacterRequestStyleType? styleType = default, - global::System.Collections.Generic.IList? styleCodes = default, - string? styleReferenceCollectionId = default, - string? styleReferenceCollectionVersionId = default, - global::System.Collections.Generic.IList? styleReferenceAssetIdentifiers = default, - global::System.Collections.Generic.IList? styleReferenceImages = default, - bool? enableCopyrightDetection = default, - bool? async = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesInpaintClient.PostInpaintImageV2IdeogramV3CustomModel.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesInpaintClient.PostInpaintImageV2IdeogramV3CustomModel.g.cs deleted file mode 100644 index cc335f4f..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IImagesInpaintClient.PostInpaintImageV2IdeogramV3CustomModel.g.cs +++ /dev/null @@ -1,162 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IImagesInpaintClient - { - /// - /// Inpaint with a custom Ideogram 3.0 model
- /// Repaint the masked region of a source image with a custom Ideogram 3.0
- /// model, passed as `custom_model_uri`. Upload the source `image` and its
- /// `mask` using `multipart/form-data`. Returns results directly by
- /// default; set `async` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostInpaintImageV2IdeogramV3CustomModelAsync( - - global::Ideogram.InpaintImageIdeogramV3CustomModelRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Inpaint with a custom Ideogram 3.0 model
- /// Repaint the masked region of a source image with a custom Ideogram 3.0
- /// model, passed as `custom_model_uri`. Upload the source `image` and its
- /// `mask` using `multipart/form-data`. Returns results directly by
- /// default; set `async` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostInpaintImageV2IdeogramV3CustomModelAsResponseAsync( - - global::Ideogram.InpaintImageIdeogramV3CustomModelRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Inpaint with a custom Ideogram 3.0 model
- /// Repaint the masked region of a source image with a custom Ideogram 3.0
- /// model, passed as `custom_model_uri`. Upload the source `image` and its
- /// `mask` using `multipart/form-data`. Returns results directly by
- /// default; set `async` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// The prompt describing the repainted result. - /// - /// - /// The custom model URI returned by the custom-model API, in the form `model/<model_name>/version/<version_name>`. The authenticated user or organization must have access to the model.
- /// Example: model/my-custom-model/version/1 - /// - /// - /// The source image asset to repaint. Takes priority over `image`. - /// - /// - /// The source image to repaint (max 25MB), as JPEG, PNG, or WEBP. Multipart requests only. - /// - /// - /// The source image to repaint (max 25MB), as JPEG, PNG, or WEBP. Multipart requests only. - /// - /// - /// A black-and-white mask asset the same size as the source image. Black marks the region to repaint. Takes priority over `mask`. - /// - /// - /// A black-and-white mask the same size as the source image, as JPEG, PNG, or WEBP. Black marks the region to repaint. Multipart requests only. - /// - /// - /// A black-and-white mask the same size as the source image, as JPEG, PNG, or WEBP. Black marks the region to repaint. Multipart requests only. - /// - /// - /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
- /// Default Value: auto - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The rendering speed to use. When omitted, the server chooses a speed supported by the selected custom model. - /// - /// - /// A predefined style preset. Cannot be combined with style codes or style references. - /// - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - /// - /// - /// A saved style, by its URL-safe base64 collection id. Takes priority over `style_reference_images` if both are supplied. - /// - /// - /// Optional URL-safe base64 version id for the saved style. Ignored without `style_reference_collection_id`. - /// - /// - /// Existing upload or generated image assets to use as style references. Takes priority over raw style reference images. - /// - /// - /// Images to use as style references (max 10, max 25MB each), as JPEG, PNG, or WEBP. - /// - /// - /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images return `is_image_safe: false`. - /// - /// - /// When false, wait until the images are ready. When true, return as soon as the request is accepted and poll `GET /v2/generations/{generation_id}`.
- /// Default Value: false - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish it. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. Completed images are added to it. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostInpaintImageV2IdeogramV3CustomModelAsync( - string prompt, - string customModelUri, - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - global::Ideogram.AssetIdentifier? maskAssetIdentifier = default, - byte[]? mask = default, - string? maskname = default, - global::Ideogram.MagicPromptMode? magicPrompt = default, - int? numImages = default, - int? seed = default, - global::Ideogram.InpaintImageIdeogramV3CustomModelRequestRenderingSpeed? renderingSpeed = default, - global::Ideogram.IdeogramV3StylePreset? stylePreset = default, - global::System.Collections.Generic.IList? styleCodes = default, - string? styleReferenceCollectionId = default, - string? styleReferenceCollectionVersionId = default, - global::System.Collections.Generic.IList? styleReferenceAssetIdentifiers = default, - global::System.Collections.Generic.IList? styleReferenceImages = default, - bool? enableCopyrightDetection = default, - bool? async = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesInpaintClient.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesInpaintClient.g.cs index 9bf61e3e..0eeef673 100644 --- a/src/libs/Ideogram/Generated/Ideogram.IImagesInpaintClient.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.IImagesInpaintClient.g.cs @@ -4,7 +4,6 @@ namespace Ideogram { /// - /// Repaint a masked region of an image with a specific model.
/// If no httpClient is provided, a new one will be created.
/// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. ///
diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesPreciseEditClient.ImagesPreciseEditPostPreciseEditImageV2Ideogram45.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesPreciseEditClient.ImagesPreciseEditPostPreciseEditImageV2Ideogram45.g.cs new file mode 100644 index 00000000..a406b407 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IImagesPreciseEditClient.ImagesPreciseEditPostPreciseEditImageV2Ideogram45.g.cs @@ -0,0 +1,345 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IImagesPreciseEditClient + { + /// + /// Precise edit with Ideogram 4.5
+ /// Edit an image with Ideogram 4.5 and get the result back at that image's
+ /// exact width and height. Upload the image as `image` using
+ /// `multipart/form-data`, with optional `reference_images` and a `mask`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`.
+ /// `context_window` confines the edit to one region of the image, so a
+ /// large image keeps its detail: pass `y_min,x_min,y_max,x_max`, or `auto`
+ /// together with a `mask`. The result always keeps the image's own width
+ /// and height. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesPreciseEditPostPreciseEditImageV2Ideogram45Async( + + global::Ideogram.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Precise edit with Ideogram 4.5
+ /// Edit an image with Ideogram 4.5 and get the result back at that image's
+ /// exact width and height. Upload the image as `image` using
+ /// `multipart/form-data`, with optional `reference_images` and a `mask`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`.
+ /// `context_window` confines the edit to one region of the image, so a
+ /// large image keeps its detail: pass `y_min,x_min,y_max,x_max`, or `auto`
+ /// together with a `mask`. The result always keeps the image's own width
+ /// and height. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ImagesPreciseEditPostPreciseEditImageV2Ideogram45AsResponseAsync( + + global::Ideogram.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Precise edit with Ideogram 4.5
+ /// Edit an image with Ideogram 4.5 and get the result back at that image's
+ /// exact width and height. Upload the image as `image` using
+ /// `multipart/form-data`, with optional `reference_images` and a `mask`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`.
+ /// `context_window` confines the edit to one region of the image, so a
+ /// large image keeps its detail: pass `y_min,x_min,y_max,x_max`, or `auto`
+ /// together with a `mask`. The result always keeps the image's own width
+ /// and height. + ///
+ /// + /// Default Value: false + /// + /// + /// The edit instruction, in natural language or as a structured JSON
+ /// prompt. Natural language is automatically converted into a
+ /// structured prompt; valid structured JSON is used as is. + /// + /// + /// The image to edit, as raw bytes (max 50MB; JPEG, PNG, or WEBP). Multipart requests only; ignored if `image_asset_identifier` is also supplied. The output always matches this image's width and height, and pixels the edit did not meaningfully change are copied exactly from it. + /// + /// + /// The image to edit, as raw bytes (max 50MB; JPEG, PNG, or WEBP). Multipart requests only; ignored if `image_asset_identifier` is also supplied. The output always matches this image's width and height, and pixels the edit did not meaningfully change are copied exactly from it. + /// + /// + /// Optional images to guide the edit (max 4, max 50MB each; JPEG, PNG, or WEBP). They are never edited themselves; only `image` is. Multipart requests only; ignored if `reference_image_asset_identifiers` is also supplied. A request with a `mask` can include at most three, because the mask takes up one reference slot. + /// + /// + /// An optional mask that limits the edit to part of `image` (max 50MB; JPEG, PNG, or WEBP). Multipart requests only. Black marks the area to edit and white the area to keep; values in between are rounded to the nearer of the two. The mask must have the same width and height as the image being edited and contain both black and white areas. A masked request can include at most three reference images. + /// + /// + /// An optional mask that limits the edit to part of `image` (max 50MB; JPEG, PNG, or WEBP). Multipart requests only. Black marks the area to edit and white the area to keep; values in between are rounded to the nearer of the two. The mask must have the same width and height as the image being edited and contain both black and white areas. A masked request can include at most three reference images. + /// + /// + /// Which region of the image to edit.
+ /// `none`, the default, edits the whole image. A large image may come back smaller than it was sent.
+ /// `auto` requires a `mask` and automatically selects an appropriate context region around the masked area.
+ /// `y_min,x_min,y_max,x_max` names the region explicitly, by its corners. Rows come first, matching the `bbox` ordering used elsewhere in this API, and the values are the edited image's own pixels with the origin at its top-left corner. For example `512,1024,2048,3072` is the region 2048 pixels wide and 1536 tall whose top-left corner is 1024 across and 512 down. The maximum edges are exclusive, so the region measures `x_max - x_min` by `y_max - y_min`. It must lie inside the image, measure at least 256px on each side, have an aspect ratio between 1:6 and 6:1, and cover no more than 4194304 pixels. A `mask` may select only pixels inside it.
+ /// With `auto` or an explicit region, only that region changes and the output keeps the image's own width and height.
+ /// Default Value: none + /// + /// + /// The rendering quality to use. `very_low` is the fastest and cheapest, and `high` takes longer and is priced higher.
+ /// Default Value: medium + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesPreciseEditPostPreciseEditImageV2Ideogram45Async( + string prompt, + byte[] image, + string imagename, + bool? dryRun = default, + global::System.Collections.Generic.IList? referenceImages = default, + byte[]? mask = default, + string? maskname = default, + string? contextWindow = default, + global::Ideogram.V2ImagePreciseEditIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality? quality = default, + int? seed = default, + int? numImages = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Precise edit with Ideogram 4.5
+ /// Edit an image with Ideogram 4.5 and get the result back at that image's
+ /// exact width and height. Upload the image as `image` using
+ /// `multipart/form-data`, with optional `reference_images` and a `mask`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`.
+ /// `context_window` confines the edit to one region of the image, so a
+ /// large image keeps its detail: pass `y_min,x_min,y_max,x_max`, or `auto`
+ /// together with a `mask`. The result always keeps the image's own width
+ /// and height. + ///
+ /// + /// Default Value: false + /// + /// + /// The edit instruction, in natural language or as a structured JSON
+ /// prompt. Natural language is automatically converted into a
+ /// structured prompt; valid structured JSON is used as is. + /// + /// + /// The image to edit, as raw bytes (max 50MB; JPEG, PNG, or WEBP). Multipart requests only; ignored if `image_asset_identifier` is also supplied. The output always matches this image's width and height, and pixels the edit did not meaningfully change are copied exactly from it. + /// + /// + /// The image to edit, as raw bytes (max 50MB; JPEG, PNG, or WEBP). Multipart requests only; ignored if `image_asset_identifier` is also supplied. The output always matches this image's width and height, and pixels the edit did not meaningfully change are copied exactly from it. + /// + /// + /// Optional images to guide the edit (max 4, max 50MB each; JPEG, PNG, or WEBP). They are never edited themselves; only `image` is. Multipart requests only; ignored if `reference_image_asset_identifiers` is also supplied. A request with a `mask` can include at most three, because the mask takes up one reference slot. + /// + /// + /// Optional file names to use for the multipart 'reference_images' file parts. + /// + /// + /// An optional mask that limits the edit to part of `image` (max 50MB; JPEG, PNG, or WEBP). Multipart requests only. Black marks the area to edit and white the area to keep; values in between are rounded to the nearer of the two. The mask must have the same width and height as the image being edited and contain both black and white areas. A masked request can include at most three reference images. + /// + /// + /// An optional mask that limits the edit to part of `image` (max 50MB; JPEG, PNG, or WEBP). Multipart requests only. Black marks the area to edit and white the area to keep; values in between are rounded to the nearer of the two. The mask must have the same width and height as the image being edited and contain both black and white areas. A masked request can include at most three reference images. + /// + /// + /// Which region of the image to edit.
+ /// `none`, the default, edits the whole image. A large image may come back smaller than it was sent.
+ /// `auto` requires a `mask` and automatically selects an appropriate context region around the masked area.
+ /// `y_min,x_min,y_max,x_max` names the region explicitly, by its corners. Rows come first, matching the `bbox` ordering used elsewhere in this API, and the values are the edited image's own pixels with the origin at its top-left corner. For example `512,1024,2048,3072` is the region 2048 pixels wide and 1536 tall whose top-left corner is 1024 across and 512 down. The maximum edges are exclusive, so the region measures `x_max - x_min` by `y_max - y_min`. It must lie inside the image, measure at least 256px on each side, have an aspect ratio between 1:6 and 6:1, and cover no more than 4194304 pixels. A `mask` may select only pixels inside it.
+ /// With `auto` or an explicit region, only that region changes and the output keeps the image's own width and height.
+ /// Default Value: none + /// + /// + /// The rendering quality to use. `very_low` is the fastest and cheapest, and `high` takes longer and is priced higher.
+ /// Default Value: medium + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesPreciseEditPostPreciseEditImageV2Ideogram45Async( + string prompt, + global::System.IO.Stream image, + string imagename, + bool? dryRun = default, + global::System.Collections.Generic.IReadOnlyList? referenceImages = default, + global::System.Collections.Generic.IReadOnlyList? referenceImagesFileNames = default, + global::System.IO.Stream? mask = default, + string? maskname = default, + string? contextWindow = default, + global::Ideogram.V2ImagePreciseEditIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality? quality = default, + int? seed = default, + int? numImages = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Precise edit with Ideogram 4.5
+ /// Edit an image with Ideogram 4.5 and get the result back at that image's
+ /// exact width and height. Upload the image as `image` using
+ /// `multipart/form-data`, with optional `reference_images` and a `mask`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`.
+ /// `context_window` confines the edit to one region of the image, so a
+ /// large image keeps its detail: pass `y_min,x_min,y_max,x_max`, or `auto`
+ /// together with a `mask`. The result always keeps the image's own width
+ /// and height. + ///
+ /// + /// Default Value: false + /// + /// + /// The edit instruction, in natural language or as a structured JSON
+ /// prompt. Natural language is automatically converted into a
+ /// structured prompt; valid structured JSON is used as is. + /// + /// + /// The image to edit, as raw bytes (max 50MB; JPEG, PNG, or WEBP). Multipart requests only; ignored if `image_asset_identifier` is also supplied. The output always matches this image's width and height, and pixels the edit did not meaningfully change are copied exactly from it. + /// + /// + /// The image to edit, as raw bytes (max 50MB; JPEG, PNG, or WEBP). Multipart requests only; ignored if `image_asset_identifier` is also supplied. The output always matches this image's width and height, and pixels the edit did not meaningfully change are copied exactly from it. + /// + /// + /// Optional images to guide the edit (max 4, max 50MB each; JPEG, PNG, or WEBP). They are never edited themselves; only `image` is. Multipart requests only; ignored if `reference_image_asset_identifiers` is also supplied. A request with a `mask` can include at most three, because the mask takes up one reference slot. + /// + /// + /// Optional file names to use for the multipart 'reference_images' file parts. + /// + /// + /// An optional mask that limits the edit to part of `image` (max 50MB; JPEG, PNG, or WEBP). Multipart requests only. Black marks the area to edit and white the area to keep; values in between are rounded to the nearer of the two. The mask must have the same width and height as the image being edited and contain both black and white areas. A masked request can include at most three reference images. + /// + /// + /// An optional mask that limits the edit to part of `image` (max 50MB; JPEG, PNG, or WEBP). Multipart requests only. Black marks the area to edit and white the area to keep; values in between are rounded to the nearer of the two. The mask must have the same width and height as the image being edited and contain both black and white areas. A masked request can include at most three reference images. + /// + /// + /// Which region of the image to edit.
+ /// `none`, the default, edits the whole image. A large image may come back smaller than it was sent.
+ /// `auto` requires a `mask` and automatically selects an appropriate context region around the masked area.
+ /// `y_min,x_min,y_max,x_max` names the region explicitly, by its corners. Rows come first, matching the `bbox` ordering used elsewhere in this API, and the values are the edited image's own pixels with the origin at its top-left corner. For example `512,1024,2048,3072` is the region 2048 pixels wide and 1536 tall whose top-left corner is 1024 across and 512 down. The maximum edges are exclusive, so the region measures `x_max - x_min` by `y_max - y_min`. It must lie inside the image, measure at least 256px on each side, have an aspect ratio between 1:6 and 6:1, and cover no more than 4194304 pixels. A `mask` may select only pixels inside it.
+ /// With `auto` or an explicit region, only that region changes and the output keeps the image's own width and height.
+ /// Default Value: none + /// + /// + /// The rendering quality to use. `very_low` is the fastest and cheapest, and `high` takes longer and is priced higher.
+ /// Default Value: medium + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ImagesPreciseEditPostPreciseEditImageV2Ideogram45AsResponseAsync( + string prompt, + global::System.IO.Stream image, + string imagename, + bool? dryRun = default, + global::System.Collections.Generic.IReadOnlyList? referenceImages = default, + global::System.Collections.Generic.IReadOnlyList? referenceImagesFileNames = default, + global::System.IO.Stream? mask = default, + string? maskname = default, + string? contextWindow = default, + global::Ideogram.V2ImagePreciseEditIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality? quality = default, + int? seed = default, + int? numImages = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesPreciseEditClient.PostPreciseEditImageV2Ideogram45.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesPreciseEditClient.PostPreciseEditImageV2Ideogram45.g.cs deleted file mode 100644 index 9303a5cc..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IImagesPreciseEditClient.PostPreciseEditImageV2Ideogram45.g.cs +++ /dev/null @@ -1,174 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IImagesPreciseEditClient - { - /// - /// Precise edit with Ideogram 4.5
- /// Edit an image with Ideogram 4.5 and get the result back at that image's
- /// exact width and height. Upload the image as `image` using
- /// `multipart/form-data`, with optional `reference_images` and a `mask`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`.
- /// `context_window` confines the edit to one region of the image, so a
- /// large image keeps its detail: pass `y_min,x_min,y_max,x_max`, or `auto`
- /// together with a `mask`. The result always keeps the image's own width
- /// and height. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostPreciseEditImageV2Ideogram45Async( - - global::Ideogram.PreciseEditImageIdeogram45Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Precise edit with Ideogram 4.5
- /// Edit an image with Ideogram 4.5 and get the result back at that image's
- /// exact width and height. Upload the image as `image` using
- /// `multipart/form-data`, with optional `reference_images` and a `mask`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`.
- /// `context_window` confines the edit to one region of the image, so a
- /// large image keeps its detail: pass `y_min,x_min,y_max,x_max`, or `auto`
- /// together with a `mask`. The result always keeps the image's own width
- /// and height. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostPreciseEditImageV2Ideogram45AsResponseAsync( - - global::Ideogram.PreciseEditImageIdeogram45Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Precise edit with Ideogram 4.5
- /// Edit an image with Ideogram 4.5 and get the result back at that image's
- /// exact width and height. Upload the image as `image` using
- /// `multipart/form-data`, with optional `reference_images` and a `mask`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`.
- /// `context_window` confines the edit to one region of the image, so a
- /// large image keeps its detail: pass `y_min,x_min,y_max,x_max`, or `auto`
- /// together with a `mask`. The result always keeps the image's own width
- /// and height. - ///
- /// - /// Default Value: false - /// - /// - /// The edit instruction, in natural language or as a structured JSON
- /// prompt. Natural language is automatically converted into a
- /// structured prompt; valid structured JSON is used as is. - /// - /// - /// The image to edit, as an existing upload or generated image asset. Supply this or `image`, never both. Takes priority over `image` if both are supplied. - /// - /// - /// The image to edit, as raw bytes (max 50MB; JPEG, PNG, or WEBP). Multipart requests only; ignored if `image_asset_identifier` is also supplied. The output always matches this image's width and height, and pixels the edit did not meaningfully change are copied exactly from it. - /// - /// - /// The image to edit, as raw bytes (max 50MB; JPEG, PNG, or WEBP). Multipart requests only; ignored if `image_asset_identifier` is also supplied. The output always matches this image's width and height, and pixels the edit did not meaningfully change are copied exactly from it. - /// - /// - /// Optional additional images to guide the edit, by reference. These are never edited themselves; only `image_asset_identifier` or `image` is. Requires the image being edited to be supplied by reference too. A request with a mask can include at most three. - /// - /// - /// Optional images to guide the edit (max 4, max 50MB each; JPEG, PNG, or WEBP). They are never edited themselves; only `image` is. Multipart requests only; ignored if `reference_image_asset_identifiers` is also supplied. A request with a `mask` can include at most three, because the mask takes up one reference slot. - /// - /// - /// An existing upload or generated image asset to use as the mask, by reference. The same rules as `mask` apply. Takes priority over `mask` if both are supplied. - /// - /// - /// An optional mask that limits the edit to part of `image` (max 50MB; JPEG, PNG, or WEBP). Multipart requests only. Black marks the area to edit and white the area to keep; values in between are rounded to the nearer of the two. The mask must have the same width and height as the image being edited and contain both black and white areas. A masked request can include at most three reference images. - /// - /// - /// An optional mask that limits the edit to part of `image` (max 50MB; JPEG, PNG, or WEBP). Multipart requests only. Black marks the area to edit and white the area to keep; values in between are rounded to the nearer of the two. The mask must have the same width and height as the image being edited and contain both black and white areas. A masked request can include at most three reference images. - /// - /// - /// Which region of the image to edit.
- /// `none`, the default, edits the whole image. A large image may come back smaller than it was sent.
- /// `auto` requires a `mask` and automatically selects an appropriate context region around the masked area.
- /// `y_min,x_min,y_max,x_max` names the region explicitly, by its corners. Rows come first, matching the `bbox` ordering used elsewhere in this API, and the values are the edited image's own pixels with the origin at its top-left corner. For example `512,1024,2048,3072` is the region 2048 pixels wide and 1536 tall whose top-left corner is 1024 across and 512 down. The maximum edges are exclusive, so the region measures `x_max - x_min` by `y_max - y_min`. It must lie inside the image, measure at least 256px on each side, have an aspect ratio between 1:6 and 6:1, and cover no more than 4194304 pixels. A `mask` may select only pixels inside it.
- /// With `auto` or an explicit region, only that region changes and the output keeps the image's own width and height.
- /// Default Value: none - /// - /// - /// The rendering quality to use. `very_low` is the fastest and cheapest, and `high` takes longer and is priced higher.
- /// Default Value: medium - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. - /// - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostPreciseEditImageV2Ideogram45Async( - string prompt, - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - global::System.Collections.Generic.IList? referenceImageAssetIdentifiers = default, - global::System.Collections.Generic.IList? referenceImages = default, - global::Ideogram.AssetIdentifier? maskAssetIdentifier = default, - byte[]? mask = default, - string? maskname = default, - string? contextWindow = default, - global::Ideogram.PreciseEditImageIdeogram45RequestQuality? quality = default, - int? seed = default, - int? numImages = default, - bool? enableCopyrightDetection = default, - bool? async = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesPreciseEditClient.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesPreciseEditClient.g.cs index ce67dbcd..a361e9a7 100644 --- a/src/libs/Ideogram/Generated/Ideogram.IImagesPreciseEditClient.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.IImagesPreciseEditClient.g.cs @@ -4,7 +4,6 @@ namespace Ideogram { /// - /// Edit source images at the source's own width and height. These endpoints never reframe: the output always matches the image you sent.
/// If no httpClient is provided, a new one will be created.
/// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. ///
diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesReframeClient.Authorizations.Bearer.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesReframeClient.Authorizations.Bearer.g.cs deleted file mode 100644 index d630aa92..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IImagesReframeClient.Authorizations.Bearer.g.cs +++ /dev/null @@ -1,16 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial interface IImagesReframeClient - { - /// - /// Authorize using bearer authentication. - /// - /// - - public void AuthorizeUsingBearer( - string apiKey); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesReframeClient.Auto.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesReframeClient.Auto.g.cs deleted file mode 100644 index 4ad84f88..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IImagesReframeClient.Auto.g.cs +++ /dev/null @@ -1,112 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IImagesReframeClient - { - /// - /// Reframe an image, letting Ideogram pick the model
- /// Reframe one image to a new aspect ratio without choosing a model.
- /// Ideogram selects the model best suited to the source and may route
- /// different requests to different models; the request is billed at the
- /// chosen model's price. Supply either an existing Ideogram image asset
- /// or raw image bytes, but not both.
- /// This operation is asynchronous. It returns as soon as the request is
- /// accepted; poll `GET /v2/generations/{generation_id}` for completion
- /// and results. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task AutoAsync( - - global::Ideogram.ReframeImageAutoRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Reframe an image, letting Ideogram pick the model
- /// Reframe one image to a new aspect ratio without choosing a model.
- /// Ideogram selects the model best suited to the source and may route
- /// different requests to different models; the request is billed at the
- /// chosen model's price. Supply either an existing Ideogram image asset
- /// or raw image bytes, but not both.
- /// This operation is asynchronous. It returns as soon as the request is
- /// accepted; poll `GET /v2/generations/{generation_id}` for completion
- /// and results. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> AutoAsResponseAsync( - - global::Ideogram.ReframeImageAutoRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Reframe an image, letting Ideogram pick the model
- /// Reframe one image to a new aspect ratio without choosing a model.
- /// Ideogram selects the model best suited to the source and may route
- /// different requests to different models; the request is billed at the
- /// chosen model's price. Supply either an existing Ideogram image asset
- /// or raw image bytes, but not both.
- /// This operation is asynchronous. It returns as soon as the request is
- /// accepted; poll `GET /v2/generations/{generation_id}` for completion
- /// and results. - ///
- /// - /// Default Value: false - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The JPEG, PNG, or WEBP image to reframe (max 50MB). - /// - /// - /// The JPEG, PNG, or WEBP image to reframe (max 50MB). - /// - /// - /// The requested output aspect ratio, as `width:height`.
- /// Example: 16:9 - /// - /// - /// API-key requests are always private. For bearer-authenticated
- /// requests, this controls whether the result is private; when
- /// omitted, it follows the caller's plan entitlement. Enterprise
- /// generations are always private. - /// - /// - /// The number of output images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task AutoAsync( - string aspectRatio, - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - bool? @private = default, - int? numImages = default, - int? seed = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesReframeClient.BriaExpand.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesReframeClient.BriaExpand.g.cs deleted file mode 100644 index e8029c2c..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IImagesReframeClient.BriaExpand.g.cs +++ /dev/null @@ -1,107 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IImagesReframeClient - { - /// - /// Reframe an image with Bria Expand
- /// Extend one image to a new aspect ratio with Bria Expand. The source
- /// pixels are kept exactly as they are, centered on the new canvas, and
- /// the model paints only the added area. Supply either an existing
- /// Ideogram image asset or raw image bytes, but not both. The canvas is
- /// sized from the source so that the whole source fits.
- /// This operation is asynchronous. It returns as soon as the request is
- /// accepted; poll `GET /v2/generations/{generation_id}` for completion
- /// and results. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task BriaExpandAsync( - - global::Ideogram.ReframeImageBriaExpandRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Reframe an image with Bria Expand
- /// Extend one image to a new aspect ratio with Bria Expand. The source
- /// pixels are kept exactly as they are, centered on the new canvas, and
- /// the model paints only the added area. Supply either an existing
- /// Ideogram image asset or raw image bytes, but not both. The canvas is
- /// sized from the source so that the whole source fits.
- /// This operation is asynchronous. It returns as soon as the request is
- /// accepted; poll `GET /v2/generations/{generation_id}` for completion
- /// and results. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> BriaExpandAsResponseAsync( - - global::Ideogram.ReframeImageBriaExpandRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Reframe an image with Bria Expand
- /// Extend one image to a new aspect ratio with Bria Expand. The source
- /// pixels are kept exactly as they are, centered on the new canvas, and
- /// the model paints only the added area. Supply either an existing
- /// Ideogram image asset or raw image bytes, but not both. The canvas is
- /// sized from the source so that the whole source fits.
- /// This operation is asynchronous. It returns as soon as the request is
- /// accepted; poll `GET /v2/generations/{generation_id}` for completion
- /// and results. - ///
- /// - /// Default Value: false - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The JPEG, PNG, or WEBP image to reframe (max 50MB). - /// - /// - /// The JPEG, PNG, or WEBP image to reframe (max 50MB). - /// - /// - /// The requested output aspect ratio, as `width:height`.
- /// Example: 16:9 - /// - /// - /// API-key requests are always private. For bearer-authenticated
- /// requests, this controls whether the result is private; when
- /// omitted, it follows the caller's plan entitlement. Enterprise
- /// generations are always private. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task BriaExpandAsync( - string aspectRatio, - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - bool? @private = default, - int? seed = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesReframeClient.GptImage25Flare.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesReframeClient.GptImage25Flare.g.cs deleted file mode 100644 index e1973255..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IImagesReframeClient.GptImage25Flare.g.cs +++ /dev/null @@ -1,114 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IImagesReframeClient - { - /// - /// Reframe an image with GPT Image 2.5 Flare
- /// Recompose one image for a new aspect ratio with GPT Image 2.5 Flare.
- /// Supply either an existing Ideogram image asset or raw image bytes, but
- /// not both. The requested aspect ratio is resolved to the closest output
- /// size the model supports.
- /// This operation is asynchronous. It returns as soon as the request is
- /// accepted; poll `GET /v2/generations/{generation_id}` for completion
- /// and results. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task GptImage25FlareAsync( - - global::Ideogram.ReframeImageGptImage25FlareRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Reframe an image with GPT Image 2.5 Flare
- /// Recompose one image for a new aspect ratio with GPT Image 2.5 Flare.
- /// Supply either an existing Ideogram image asset or raw image bytes, but
- /// not both. The requested aspect ratio is resolved to the closest output
- /// size the model supports.
- /// This operation is asynchronous. It returns as soon as the request is
- /// accepted; poll `GET /v2/generations/{generation_id}` for completion
- /// and results. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> GptImage25FlareAsResponseAsync( - - global::Ideogram.ReframeImageGptImage25FlareRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Reframe an image with GPT Image 2.5 Flare
- /// Recompose one image for a new aspect ratio with GPT Image 2.5 Flare.
- /// Supply either an existing Ideogram image asset or raw image bytes, but
- /// not both. The requested aspect ratio is resolved to the closest output
- /// size the model supports.
- /// This operation is asynchronous. It returns as soon as the request is
- /// accepted; poll `GET /v2/generations/{generation_id}` for completion
- /// and results. - ///
- /// - /// Default Value: false - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The JPEG, PNG, or WEBP image to reframe (max 50MB). - /// - /// - /// The JPEG, PNG, or WEBP image to reframe (max 50MB). - /// - /// - /// The requested output aspect ratio, as `width:height`.
- /// Example: 16:9 - /// - /// - /// How much rendering effort the model spends. Lower tiers return sooner and cost less; `auto` lets the model choose.
- /// Default Value: auto - /// - /// - /// API-key requests are always private. For bearer-authenticated
- /// requests, this controls whether the result is private; when
- /// omitted, it follows the caller's plan entitlement. Enterprise
- /// generations are always private. - /// - /// - /// The number of output images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task GptImage25FlareAsync( - string aspectRatio, - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - global::Ideogram.ReframeImageGptImage25FlareRequestQuality? quality = default, - bool? @private = default, - int? numImages = default, - int? seed = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesReframeClient.IdeogramV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesReframeClient.IdeogramV3.g.cs deleted file mode 100644 index 770f2ea5..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IImagesReframeClient.IdeogramV3.g.cs +++ /dev/null @@ -1,127 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IImagesReframeClient - { - /// - /// Reframe with Ideogram 3.0
- /// Expand an image to a new Ideogram 3.0 resolution, keeping the source
- /// pixels in the center and filling the new area. Upload the source
- /// `image` using `multipart/form-data`. Returns results directly by
- /// default; set `async` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task IdeogramV3Async( - - global::Ideogram.ReframeImageIdeogramV3Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Reframe with Ideogram 3.0
- /// Expand an image to a new Ideogram 3.0 resolution, keeping the source
- /// pixels in the center and filling the new area. Upload the source
- /// `image` using `multipart/form-data`. Returns results directly by
- /// default; set `async` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> IdeogramV3AsResponseAsync( - - global::Ideogram.ReframeImageIdeogramV3Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Reframe with Ideogram 3.0
- /// Expand an image to a new Ideogram 3.0 resolution, keeping the source
- /// pixels in the center and filling the new area. Upload the source
- /// `image` using `multipart/form-data`. Returns results directly by
- /// default; set `async` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The JPEG, PNG, or WEBP image to reframe (max 25MB). Multipart requests only. - /// - /// - /// The JPEG, PNG, or WEBP image to reframe (max 25MB). Multipart requests only. - /// - /// - /// The resolutions supported for Ideogram 3.0.
- /// Example: 1280x800 - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// Default Value: default - /// - /// - /// A predefined style preset that applies a specific artistic style to the generated image.
- /// Example: bright_art - /// - /// - /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). - /// - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - /// - /// - /// Existing upload or generated image assets to use as style references. Cannot be combined with a style preset, style codes, or uploaded style reference images. - /// - /// - /// JPEG, PNG, or WEBP style reference images (max 10, max 25MB each). Multipart requests only. Cannot be combined with `style_preset` or `style_codes`. - /// - /// - /// Return immediately instead of waiting for reframed images.
- /// Default Value: false - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task IdeogramV3Async( - global::Ideogram.ResolutionV3 resolution, - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - int? numImages = default, - int? seed = default, - global::Ideogram.ReframeImageIdeogramV3RequestRenderingSpeed? renderingSpeed = default, - global::Ideogram.IdeogramV3StylePreset? stylePreset = default, - global::Ideogram.IdeogramColorPalette? colorPalette = default, - global::System.Collections.Generic.IList? styleCodes = default, - global::System.Collections.Generic.IList? styleReferenceAssetIdentifiers = default, - global::System.Collections.Generic.IList? styleReferenceImages = default, - bool? async = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesReframeClient.NanoBanana2.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesReframeClient.NanoBanana2.g.cs deleted file mode 100644 index b4c12d72..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IImagesReframeClient.NanoBanana2.g.cs +++ /dev/null @@ -1,99 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IImagesReframeClient - { - /// - /// Reframe with Nano Banana 2
- /// Expand an image to a new aspect ratio with Nano Banana 2. Upload the
- /// source `image` using `multipart/form-data`. Always asynchronous:
- /// returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// for results. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task NanoBanana2Async( - - global::Ideogram.ReframeImageNanoBanana2Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Reframe with Nano Banana 2
- /// Expand an image to a new aspect ratio with Nano Banana 2. Upload the
- /// source `image` using `multipart/form-data`. Always asynchronous:
- /// returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// for results. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> NanoBanana2AsResponseAsync( - - global::Ideogram.ReframeImageNanoBanana2Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Reframe with Nano Banana 2
- /// Expand an image to a new aspect ratio with Nano Banana 2. Upload the
- /// source `image` using `multipart/form-data`. Always asynchronous:
- /// returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// for results. - ///
- /// - /// Default Value: false - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The JPEG, PNG, or WEBP image to reframe (max 50MB). - /// - /// - /// The JPEG, PNG, or WEBP image to reframe (max 50MB). - /// - /// - /// Aspect ratios Nano Banana 2 can reframe an image to. - /// - /// - /// API-key requests are always private. For bearer-authenticated
- /// requests, this controls whether the result is private; when
- /// omitted, it follows the caller's plan entitlement. Enterprise
- /// generations are always private. - /// - /// - /// The number of output images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task NanoBanana2Async( - global::Ideogram.NanoBanana2ReframeAspectRatio aspectRatio, - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - bool? @private = default, - int? numImages = default, - int? seed = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesReframeClient.NanoBananaPro.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesReframeClient.NanoBananaPro.g.cs deleted file mode 100644 index b5e92ce0..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IImagesReframeClient.NanoBananaPro.g.cs +++ /dev/null @@ -1,113 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IImagesReframeClient - { - /// - /// Reframe an image with Nano Banana Pro
- /// Recompose one image for a new aspect ratio with Nano Banana Pro, at a
- /// 1K, 2K, or 4K output tier. Supply either an existing Ideogram image
- /// asset or raw image bytes, but not both. The requested aspect ratio is
- /// resolved to the closest dimensions the model supports at that tier.
- /// This operation is asynchronous. It returns as soon as the request is
- /// accepted; poll `GET /v2/generations/{generation_id}` for completion
- /// and results. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task NanoBananaProAsync( - - global::Ideogram.ReframeImageNanoBananaProRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Reframe an image with Nano Banana Pro
- /// Recompose one image for a new aspect ratio with Nano Banana Pro, at a
- /// 1K, 2K, or 4K output tier. Supply either an existing Ideogram image
- /// asset or raw image bytes, but not both. The requested aspect ratio is
- /// resolved to the closest dimensions the model supports at that tier.
- /// This operation is asynchronous. It returns as soon as the request is
- /// accepted; poll `GET /v2/generations/{generation_id}` for completion
- /// and results. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> NanoBananaProAsResponseAsync( - - global::Ideogram.ReframeImageNanoBananaProRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Reframe an image with Nano Banana Pro
- /// Recompose one image for a new aspect ratio with Nano Banana Pro, at a
- /// 1K, 2K, or 4K output tier. Supply either an existing Ideogram image
- /// asset or raw image bytes, but not both. The requested aspect ratio is
- /// resolved to the closest dimensions the model supports at that tier.
- /// This operation is asynchronous. It returns as soon as the request is
- /// accepted; poll `GET /v2/generations/{generation_id}` for completion
- /// and results. - ///
- /// - /// Default Value: false - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The JPEG, PNG, or WEBP image to reframe (max 50MB). - /// - /// - /// The JPEG, PNG, or WEBP image to reframe (max 50MB). - /// - /// - /// Aspect ratios Nano Banana Pro can reframe an image to. - /// - /// - /// The output resolution tier. The model sizes its output by tier at the requested aspect ratio; exact pixel dimensions cannot be requested.
- /// Default Value: 1K - /// - /// - /// API-key requests are always private. For bearer-authenticated
- /// requests, this controls whether the result is private; when
- /// omitted, it follows the caller's plan entitlement. Enterprise
- /// generations are always private. - /// - /// - /// The number of output images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task NanoBananaProAsync( - global::Ideogram.NanoBananaProReframeAspectRatio aspectRatio, - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - global::Ideogram.ReframeImageNanoBananaProRequestResolutionTier? resolutionTier = default, - bool? @private = default, - int? numImages = default, - int? seed = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesReframeClient.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesReframeClient.g.cs deleted file mode 100644 index b4d955ae..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IImagesReframeClient.g.cs +++ /dev/null @@ -1,50 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Expand an existing image to a new model-specific output shape while
- /// preserving the source content and filling the new area.
- /// If no httpClient is provided, a new one will be created.
- /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. - ///
- public partial interface IImagesReframeClient : global::System.IDisposable - { - /// - /// The HttpClient instance. - /// - public global::System.Net.Http.HttpClient HttpClient { get; } - - /// - /// The base URL for the API. - /// - public System.Uri? BaseUri { get; } - - /// - /// The authorizations to use for the requests. - /// - public global::System.Collections.Generic.List Authorizations { get; } - - /// - /// Gets or sets a value indicating whether the response content should be read as a string. - /// True by default in debug builds, false otherwise. - /// When false, successful responses are deserialized directly from the response stream for better performance. - /// Error responses are always read as strings regardless of this setting, - /// ensuring is populated. - /// - public bool ReadResponseAsString { get; set; } - /// - /// Client-wide request defaults such as headers, query parameters, retries, and timeout. - /// - public global::Ideogram.AutoSDKClientOptions Options { get; } - - - /// - /// - /// - global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } - - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesRemixClient.ImagesRemixPostRemixImageV2IdeogramV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesRemixClient.ImagesRemixPostRemixImageV2IdeogramV3.g.cs new file mode 100644 index 00000000..01ca2a1e --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IImagesRemixClient.ImagesRemixPostRemixImageV2IdeogramV3.g.cs @@ -0,0 +1,377 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IImagesRemixClient + { + /// + /// Remix with Ideogram 3.0
+ /// Transform an existing image with Ideogram 3.0, guided by a text
+ /// prompt. Upload the source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesRemixPostRemixImageV2IdeogramV3Async( + + global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Remix with Ideogram 3.0
+ /// Transform an existing image with Ideogram 3.0, guided by a text
+ /// prompt. Upload the source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ImagesRemixPostRemixImageV2IdeogramV3AsResponseAsync( + + global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Remix with Ideogram 3.0
+ /// Transform an existing image with Ideogram 3.0, guided by a text
+ /// prompt. Upload the source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt that guides the remix. + /// + /// + /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. + /// + /// + /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. + /// + /// + /// Optional. How closely the result should follow the source image, from 1 to 100. When omitted the server chooses a value from your prompt, which is the usual case. + /// + /// + /// Description of what to exclude from the images. Descriptions in the prompt take precedence over descriptions in the negative prompt. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The resolutions supported for Ideogram 3.0. + /// + /// + /// Output aspect ratio. Cannot be combined with resolution. Generation defaults to 1x1; remix keeps the source ratio when both fields are omitted. + /// + /// + /// The rendering speed to use.
+ /// Default Value: default + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). + /// + /// + /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images. + /// + /// + /// The style type to generate with.
+ /// Default Value: general + /// + /// + /// A predefined style preset to apply to the remixed images. Cannot be combined with style codes or style references. + /// + /// + /// Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported. + /// + /// + /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesRemixPostRemixImageV2IdeogramV3Async( + string prompt, + byte[] image, + string imagename, + bool? dryRun = default, + int? imageWeight = default, + string? negativePrompt = default, + int? seed = default, + global::Ideogram.ResolutionV3? resolution = default, + global::Ideogram.AspectRatioV3? aspectRatio = default, + global::Ideogram.V2ImageRemixIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + int? numImages = default, + global::Ideogram.IdeogramColorPalette? colorPalette = default, + global::System.Collections.Generic.IList? styleCodes = default, + global::Ideogram.IdeogramV3StyleType? styleType = default, + global::Ideogram.IdeogramV3StylePreset? stylePreset = default, + global::System.Collections.Generic.IList? styleReferenceImages = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Remix with Ideogram 3.0
+ /// Transform an existing image with Ideogram 3.0, guided by a text
+ /// prompt. Upload the source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt that guides the remix. + /// + /// + /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. + /// + /// + /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. + /// + /// + /// Optional. How closely the result should follow the source image, from 1 to 100. When omitted the server chooses a value from your prompt, which is the usual case. + /// + /// + /// Description of what to exclude from the images. Descriptions in the prompt take precedence over descriptions in the negative prompt. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The resolutions supported for Ideogram 3.0. + /// + /// + /// Output aspect ratio. Cannot be combined with resolution. Generation defaults to 1x1; remix keeps the source ratio when both fields are omitted. + /// + /// + /// The rendering speed to use.
+ /// Default Value: default + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). + /// + /// + /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images. + /// + /// + /// The style type to generate with.
+ /// Default Value: general + /// + /// + /// A predefined style preset to apply to the remixed images. Cannot be combined with style codes or style references. + /// + /// + /// Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported. + /// + /// + /// Optional file names to use for the multipart 'style_reference_images' file parts. + /// + /// + /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesRemixPostRemixImageV2IdeogramV3Async( + string prompt, + global::System.IO.Stream image, + string imagename, + bool? dryRun = default, + int? imageWeight = default, + string? negativePrompt = default, + int? seed = default, + global::Ideogram.ResolutionV3? resolution = default, + global::Ideogram.AspectRatioV3? aspectRatio = default, + global::Ideogram.V2ImageRemixIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + int? numImages = default, + global::Ideogram.IdeogramColorPalette? colorPalette = default, + global::System.Collections.Generic.IList? styleCodes = default, + global::Ideogram.IdeogramV3StyleType? styleType = default, + global::Ideogram.IdeogramV3StylePreset? stylePreset = default, + global::System.Collections.Generic.IReadOnlyList? styleReferenceImages = default, + global::System.Collections.Generic.IReadOnlyList? styleReferenceImagesFileNames = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Remix with Ideogram 3.0
+ /// Transform an existing image with Ideogram 3.0, guided by a text
+ /// prompt. Upload the source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt that guides the remix. + /// + /// + /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. + /// + /// + /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. + /// + /// + /// Optional. How closely the result should follow the source image, from 1 to 100. When omitted the server chooses a value from your prompt, which is the usual case. + /// + /// + /// Description of what to exclude from the images. Descriptions in the prompt take precedence over descriptions in the negative prompt. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The resolutions supported for Ideogram 3.0. + /// + /// + /// Output aspect ratio. Cannot be combined with resolution. Generation defaults to 1x1; remix keeps the source ratio when both fields are omitted. + /// + /// + /// The rendering speed to use.
+ /// Default Value: default + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). + /// + /// + /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images. + /// + /// + /// The style type to generate with.
+ /// Default Value: general + /// + /// + /// A predefined style preset to apply to the remixed images. Cannot be combined with style codes or style references. + /// + /// + /// Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported. + /// + /// + /// Optional file names to use for the multipart 'style_reference_images' file parts. + /// + /// + /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ImagesRemixPostRemixImageV2IdeogramV3AsResponseAsync( + string prompt, + global::System.IO.Stream image, + string imagename, + bool? dryRun = default, + int? imageWeight = default, + string? negativePrompt = default, + int? seed = default, + global::Ideogram.ResolutionV3? resolution = default, + global::Ideogram.AspectRatioV3? aspectRatio = default, + global::Ideogram.V2ImageRemixIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + int? numImages = default, + global::Ideogram.IdeogramColorPalette? colorPalette = default, + global::System.Collections.Generic.IList? styleCodes = default, + global::Ideogram.IdeogramV3StyleType? styleType = default, + global::Ideogram.IdeogramV3StylePreset? stylePreset = default, + global::System.Collections.Generic.IReadOnlyList? styleReferenceImages = default, + global::System.Collections.Generic.IReadOnlyList? styleReferenceImagesFileNames = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesRemixClient.ImagesRemixPostRemixImageV2IdeogramV3Character.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesRemixClient.ImagesRemixPostRemixImageV2IdeogramV3Character.g.cs new file mode 100644 index 00000000..6b8773d5 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IImagesRemixClient.ImagesRemixPostRemixImageV2IdeogramV3Character.g.cs @@ -0,0 +1,395 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IImagesRemixClient + { + /// + /// Remix a consistent character with Ideogram 3.0
+ /// Transform an existing image with Ideogram 3.0 so it features a
+ /// consistent character, guided by a text prompt. Upload the source
+ /// `image` and a `character_reference_images` image (or use a saved
+ /// character) using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesRemixPostRemixImageV2IdeogramV3CharacterAsync( + + global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CharacterRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Remix a consistent character with Ideogram 3.0
+ /// Transform an existing image with Ideogram 3.0 so it features a
+ /// consistent character, guided by a text prompt. Upload the source
+ /// `image` and a `character_reference_images` image (or use a saved
+ /// character) using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ImagesRemixPostRemixImageV2IdeogramV3CharacterAsResponseAsync( + + global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CharacterRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Remix a consistent character with Ideogram 3.0
+ /// Transform an existing image with Ideogram 3.0 so it features a
+ /// consistent character, guided by a text prompt. Upload the source
+ /// `image` and a `character_reference_images` image (or use a saved
+ /// character) using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt that guides the remix. + /// + /// + /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. + /// + /// + /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. + /// + /// + /// Optional. How closely the result should follow the source image, from 1 to 100. When omitted the server chooses a value from your prompt, which is the usual case. + /// + /// + /// Description of what to exclude from the images. Descriptions in the prompt take precedence over descriptions in the negative prompt. + /// + /// + /// An image to use as the character reference (max 25MB). JPEG, PNG, and WEBP are supported. + /// + /// + /// Optional grayscale mask for the character reference image, the same size as that image, marking where the character is. Only JPEG, PNG, and WEBP formats are supported. Multipart requests only; cannot be combined with `character_reference_collection_id`. + /// + /// + /// Optional grayscale mask for the character reference image, the same size as that image, marking where the character is. Only JPEG, PNG, and WEBP formats are supported. Multipart requests only; cannot be combined with `character_reference_collection_id`. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The resolutions supported for Ideogram 3.0. + /// + /// + /// Output aspect ratio. Cannot be combined with resolution. Generation defaults to 1x1; remix keeps the source ratio when both fields are omitted. + /// + /// + /// The rendering speed to use.
+ /// Default Value: default + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// The style type to remix the character with. Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported. + /// + /// + /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesRemixPostRemixImageV2IdeogramV3CharacterAsync( + string prompt, + byte[] image, + string imagename, + global::System.Collections.Generic.IList characterReferenceImages, + bool? dryRun = default, + int? imageWeight = default, + string? negativePrompt = default, + byte[]? characterReferenceMask = default, + string? characterReferenceMaskname = default, + int? seed = default, + global::Ideogram.ResolutionV3? resolution = default, + global::Ideogram.AspectRatioV3? aspectRatio = default, + global::Ideogram.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + int? numImages = default, + global::Ideogram.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType? styleType = default, + global::System.Collections.Generic.IList? styleReferenceImages = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Remix a consistent character with Ideogram 3.0
+ /// Transform an existing image with Ideogram 3.0 so it features a
+ /// consistent character, guided by a text prompt. Upload the source
+ /// `image` and a `character_reference_images` image (or use a saved
+ /// character) using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt that guides the remix. + /// + /// + /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. + /// + /// + /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. + /// + /// + /// Optional. How closely the result should follow the source image, from 1 to 100. When omitted the server chooses a value from your prompt, which is the usual case. + /// + /// + /// Description of what to exclude from the images. Descriptions in the prompt take precedence over descriptions in the negative prompt. + /// + /// + /// An image to use as the character reference (max 25MB). JPEG, PNG, and WEBP are supported. + /// + /// + /// Optional file names to use for the multipart 'character_reference_images' file parts. + /// + /// + /// Optional grayscale mask for the character reference image, the same size as that image, marking where the character is. Only JPEG, PNG, and WEBP formats are supported. Multipart requests only; cannot be combined with `character_reference_collection_id`. + /// + /// + /// Optional grayscale mask for the character reference image, the same size as that image, marking where the character is. Only JPEG, PNG, and WEBP formats are supported. Multipart requests only; cannot be combined with `character_reference_collection_id`. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The resolutions supported for Ideogram 3.0. + /// + /// + /// Output aspect ratio. Cannot be combined with resolution. Generation defaults to 1x1; remix keeps the source ratio when both fields are omitted. + /// + /// + /// The rendering speed to use.
+ /// Default Value: default + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// The style type to remix the character with. Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported. + /// + /// + /// Optional file names to use for the multipart 'style_reference_images' file parts. + /// + /// + /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesRemixPostRemixImageV2IdeogramV3CharacterAsync( + string prompt, + global::System.IO.Stream image, + string imagename, + global::System.Collections.Generic.IReadOnlyList characterReferenceImages, + bool? dryRun = default, + int? imageWeight = default, + string? negativePrompt = default, + global::System.Collections.Generic.IReadOnlyList? characterReferenceImagesFileNames = default, + global::System.IO.Stream? characterReferenceMask = default, + string? characterReferenceMaskname = default, + int? seed = default, + global::Ideogram.ResolutionV3? resolution = default, + global::Ideogram.AspectRatioV3? aspectRatio = default, + global::Ideogram.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + int? numImages = default, + global::Ideogram.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType? styleType = default, + global::System.Collections.Generic.IReadOnlyList? styleReferenceImages = default, + global::System.Collections.Generic.IReadOnlyList? styleReferenceImagesFileNames = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Remix a consistent character with Ideogram 3.0
+ /// Transform an existing image with Ideogram 3.0 so it features a
+ /// consistent character, guided by a text prompt. Upload the source
+ /// `image` and a `character_reference_images` image (or use a saved
+ /// character) using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt that guides the remix. + /// + /// + /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. + /// + /// + /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. + /// + /// + /// Optional. How closely the result should follow the source image, from 1 to 100. When omitted the server chooses a value from your prompt, which is the usual case. + /// + /// + /// Description of what to exclude from the images. Descriptions in the prompt take precedence over descriptions in the negative prompt. + /// + /// + /// An image to use as the character reference (max 25MB). JPEG, PNG, and WEBP are supported. + /// + /// + /// Optional file names to use for the multipart 'character_reference_images' file parts. + /// + /// + /// Optional grayscale mask for the character reference image, the same size as that image, marking where the character is. Only JPEG, PNG, and WEBP formats are supported. Multipart requests only; cannot be combined with `character_reference_collection_id`. + /// + /// + /// Optional grayscale mask for the character reference image, the same size as that image, marking where the character is. Only JPEG, PNG, and WEBP formats are supported. Multipart requests only; cannot be combined with `character_reference_collection_id`. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The resolutions supported for Ideogram 3.0. + /// + /// + /// Output aspect ratio. Cannot be combined with resolution. Generation defaults to 1x1; remix keeps the source ratio when both fields are omitted. + /// + /// + /// The rendering speed to use.
+ /// Default Value: default + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// The style type to remix the character with. Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported. + /// + /// + /// Optional file names to use for the multipart 'style_reference_images' file parts. + /// + /// + /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ImagesRemixPostRemixImageV2IdeogramV3CharacterAsResponseAsync( + string prompt, + global::System.IO.Stream image, + string imagename, + global::System.Collections.Generic.IReadOnlyList characterReferenceImages, + bool? dryRun = default, + int? imageWeight = default, + string? negativePrompt = default, + global::System.Collections.Generic.IReadOnlyList? characterReferenceImagesFileNames = default, + global::System.IO.Stream? characterReferenceMask = default, + string? characterReferenceMaskname = default, + int? seed = default, + global::Ideogram.ResolutionV3? resolution = default, + global::Ideogram.AspectRatioV3? aspectRatio = default, + global::Ideogram.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + int? numImages = default, + global::Ideogram.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType? styleType = default, + global::System.Collections.Generic.IReadOnlyList? styleReferenceImages = default, + global::System.Collections.Generic.IReadOnlyList? styleReferenceImagesFileNames = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesRemixClient.ImagesRemixPostRemixImageV2IdeogramV3CustomModel.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesRemixClient.ImagesRemixPostRemixImageV2IdeogramV3CustomModel.g.cs new file mode 100644 index 00000000..b88151ac --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IImagesRemixClient.ImagesRemixPostRemixImageV2IdeogramV3CustomModel.g.cs @@ -0,0 +1,376 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IImagesRemixClient + { + /// + /// Remix with a custom Ideogram 3.0 model
+ /// Transform an existing image with a custom Ideogram 3.0 model that your
+ /// user or organization can access, guided by a text prompt. Upload the
+ /// source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesRemixPostRemixImageV2IdeogramV3CustomModelAsync( + + global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CustomModelRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Remix with a custom Ideogram 3.0 model
+ /// Transform an existing image with a custom Ideogram 3.0 model that your
+ /// user or organization can access, guided by a text prompt. Upload the
+ /// source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ImagesRemixPostRemixImageV2IdeogramV3CustomModelAsResponseAsync( + + global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CustomModelRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Remix with a custom Ideogram 3.0 model
+ /// Transform an existing image with a custom Ideogram 3.0 model that your
+ /// user or organization can access, guided by a text prompt. Upload the
+ /// source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt that guides the remix. + /// + /// + /// The custom model URI returned by the custom-model API, in the form `model/<model_name>/version/<version_name>`. The authenticated user or organization must have access to the model. + /// + /// + /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. + /// + /// + /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. + /// + /// + /// Optional. How closely the result should follow the source image, from 1 to 100. When omitted the server chooses a value from your prompt, which is the usual case. + /// + /// + /// Description of what to exclude from the images. Descriptions in the prompt take precedence over descriptions in the negative prompt. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The resolutions supported for Ideogram 3.0. + /// + /// + /// Output aspect ratio. Cannot be combined with resolution. Generation defaults to 1x1; remix keeps the source ratio when both fields are omitted. + /// + /// + /// The rendering speed to use. When omitted, the server chooses a speed supported by the selected custom model. + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). + /// + /// + /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images. + /// + /// + /// A predefined style preset to apply to the remixed images. Cannot be combined with style codes or style references. + /// + /// + /// Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported. Multipart requests only. + /// + /// + /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesRemixPostRemixImageV2IdeogramV3CustomModelAsync( + string prompt, + string customModelUri, + byte[] image, + string imagename, + bool? dryRun = default, + int? imageWeight = default, + string? negativePrompt = default, + int? seed = default, + global::Ideogram.ResolutionV3? resolution = default, + global::Ideogram.AspectRatioV3? aspectRatio = default, + global::Ideogram.V2ImageRemixIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + int? numImages = default, + global::Ideogram.IdeogramColorPalette? colorPalette = default, + global::System.Collections.Generic.IList? styleCodes = default, + global::Ideogram.IdeogramV3StylePreset? stylePreset = default, + global::System.Collections.Generic.IList? styleReferenceImages = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Remix with a custom Ideogram 3.0 model
+ /// Transform an existing image with a custom Ideogram 3.0 model that your
+ /// user or organization can access, guided by a text prompt. Upload the
+ /// source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt that guides the remix. + /// + /// + /// The custom model URI returned by the custom-model API, in the form `model/<model_name>/version/<version_name>`. The authenticated user or organization must have access to the model. + /// + /// + /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. + /// + /// + /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. + /// + /// + /// Optional. How closely the result should follow the source image, from 1 to 100. When omitted the server chooses a value from your prompt, which is the usual case. + /// + /// + /// Description of what to exclude from the images. Descriptions in the prompt take precedence over descriptions in the negative prompt. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The resolutions supported for Ideogram 3.0. + /// + /// + /// Output aspect ratio. Cannot be combined with resolution. Generation defaults to 1x1; remix keeps the source ratio when both fields are omitted. + /// + /// + /// The rendering speed to use. When omitted, the server chooses a speed supported by the selected custom model. + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). + /// + /// + /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images. + /// + /// + /// A predefined style preset to apply to the remixed images. Cannot be combined with style codes or style references. + /// + /// + /// Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported. Multipart requests only. + /// + /// + /// Optional file names to use for the multipart 'style_reference_images' file parts. + /// + /// + /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesRemixPostRemixImageV2IdeogramV3CustomModelAsync( + string prompt, + string customModelUri, + global::System.IO.Stream image, + string imagename, + bool? dryRun = default, + int? imageWeight = default, + string? negativePrompt = default, + int? seed = default, + global::Ideogram.ResolutionV3? resolution = default, + global::Ideogram.AspectRatioV3? aspectRatio = default, + global::Ideogram.V2ImageRemixIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + int? numImages = default, + global::Ideogram.IdeogramColorPalette? colorPalette = default, + global::System.Collections.Generic.IList? styleCodes = default, + global::Ideogram.IdeogramV3StylePreset? stylePreset = default, + global::System.Collections.Generic.IReadOnlyList? styleReferenceImages = default, + global::System.Collections.Generic.IReadOnlyList? styleReferenceImagesFileNames = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Remix with a custom Ideogram 3.0 model
+ /// Transform an existing image with a custom Ideogram 3.0 model that your
+ /// user or organization can access, guided by a text prompt. Upload the
+ /// source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt that guides the remix. + /// + /// + /// The custom model URI returned by the custom-model API, in the form `model/<model_name>/version/<version_name>`. The authenticated user or organization must have access to the model. + /// + /// + /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. + /// + /// + /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. + /// + /// + /// Optional. How closely the result should follow the source image, from 1 to 100. When omitted the server chooses a value from your prompt, which is the usual case. + /// + /// + /// Description of what to exclude from the images. Descriptions in the prompt take precedence over descriptions in the negative prompt. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The resolutions supported for Ideogram 3.0. + /// + /// + /// Output aspect ratio. Cannot be combined with resolution. Generation defaults to 1x1; remix keeps the source ratio when both fields are omitted. + /// + /// + /// The rendering speed to use. When omitted, the server chooses a speed supported by the selected custom model. + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). + /// + /// + /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images. + /// + /// + /// A predefined style preset to apply to the remixed images. Cannot be combined with style codes or style references. + /// + /// + /// Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported. Multipart requests only. + /// + /// + /// Optional file names to use for the multipart 'style_reference_images' file parts. + /// + /// + /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ImagesRemixPostRemixImageV2IdeogramV3CustomModelAsResponseAsync( + string prompt, + string customModelUri, + global::System.IO.Stream image, + string imagename, + bool? dryRun = default, + int? imageWeight = default, + string? negativePrompt = default, + int? seed = default, + global::Ideogram.ResolutionV3? resolution = default, + global::Ideogram.AspectRatioV3? aspectRatio = default, + global::Ideogram.V2ImageRemixIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + int? numImages = default, + global::Ideogram.IdeogramColorPalette? colorPalette = default, + global::System.Collections.Generic.IList? styleCodes = default, + global::Ideogram.IdeogramV3StylePreset? stylePreset = default, + global::System.Collections.Generic.IReadOnlyList? styleReferenceImages = default, + global::System.Collections.Generic.IReadOnlyList? styleReferenceImagesFileNames = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesRemixClient.ImagesRemixPostRemixImageV2IdeogramV4.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesRemixClient.ImagesRemixPostRemixImageV2IdeogramV4.g.cs new file mode 100644 index 00000000..a0133126 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IImagesRemixClient.ImagesRemixPostRemixImageV2IdeogramV4.g.cs @@ -0,0 +1,264 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IImagesRemixClient + { + /// + /// Remix with Ideogram 4.0
+ /// Transform an existing image with Ideogram 4.0, guided by a text
+ /// prompt. Upload the source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesRemixPostRemixImageV2IdeogramV4Async( + + global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV4Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Remix with Ideogram 4.0
+ /// Transform an existing image with Ideogram 4.0, guided by a text
+ /// prompt. Upload the source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ImagesRemixPostRemixImageV2IdeogramV4AsResponseAsync( + + global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV4Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Remix with Ideogram 4.0
+ /// Transform an existing image with Ideogram 4.0, guided by a text
+ /// prompt. Upload the source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt that guides the remix. It is always read as an editing instruction, so there is no `magic_prompt` option. + /// + /// + /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` to keep its shape. + /// + /// + /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` to keep its shape. + /// + /// + /// Optional. How closely the result should follow the source image, from 1 to 100. When omitted the server chooses a value from your prompt, which is the usual case. Only accepted when the output keeps the source image's shape: combining `image_weight` with a `resolution` whose aspect ratio differs from the source's is rejected with a 400. + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Optional. When supplied, the images are generated at this
+ /// resolution. When omitted, the source image's shape is kept. A
+ /// resolution whose aspect ratio differs from the source's cannot
+ /// be combined with `image_weight`. + /// + /// + /// The rendering speed to use.
+ /// Default Value: default + /// + /// + /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesRemixPostRemixImageV2IdeogramV4Async( + string prompt, + byte[] image, + string imagename, + bool? dryRun = default, + int? imageWeight = default, + int? numImages = default, + global::Ideogram.ResolutionV4? resolution = default, + global::Ideogram.V2ImageRemixIdeogram4PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Remix with Ideogram 4.0
+ /// Transform an existing image with Ideogram 4.0, guided by a text
+ /// prompt. Upload the source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt that guides the remix. It is always read as an editing instruction, so there is no `magic_prompt` option. + /// + /// + /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` to keep its shape. + /// + /// + /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` to keep its shape. + /// + /// + /// Optional. How closely the result should follow the source image, from 1 to 100. When omitted the server chooses a value from your prompt, which is the usual case. Only accepted when the output keeps the source image's shape: combining `image_weight` with a `resolution` whose aspect ratio differs from the source's is rejected with a 400. + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Optional. When supplied, the images are generated at this
+ /// resolution. When omitted, the source image's shape is kept. A
+ /// resolution whose aspect ratio differs from the source's cannot
+ /// be combined with `image_weight`. + /// + /// + /// The rendering speed to use.
+ /// Default Value: default + /// + /// + /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesRemixPostRemixImageV2IdeogramV4Async( + string prompt, + global::System.IO.Stream image, + string imagename, + bool? dryRun = default, + int? imageWeight = default, + int? numImages = default, + global::Ideogram.ResolutionV4? resolution = default, + global::Ideogram.V2ImageRemixIdeogram4PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Remix with Ideogram 4.0
+ /// Transform an existing image with Ideogram 4.0, guided by a text
+ /// prompt. Upload the source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt that guides the remix. It is always read as an editing instruction, so there is no `magic_prompt` option. + /// + /// + /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` to keep its shape. + /// + /// + /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` to keep its shape. + /// + /// + /// Optional. How closely the result should follow the source image, from 1 to 100. When omitted the server chooses a value from your prompt, which is the usual case. Only accepted when the output keeps the source image's shape: combining `image_weight` with a `resolution` whose aspect ratio differs from the source's is rejected with a 400. + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Optional. When supplied, the images are generated at this
+ /// resolution. When omitted, the source image's shape is kept. A
+ /// resolution whose aspect ratio differs from the source's cannot
+ /// be combined with `image_weight`. + /// + /// + /// The rendering speed to use.
+ /// Default Value: default + /// + /// + /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ImagesRemixPostRemixImageV2IdeogramV4AsResponseAsync( + string prompt, + global::System.IO.Stream image, + string imagename, + bool? dryRun = default, + int? imageWeight = default, + int? numImages = default, + global::Ideogram.ResolutionV4? resolution = default, + global::Ideogram.V2ImageRemixIdeogram4PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesRemixClient.PostRemixImageV2IdeogramV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesRemixClient.PostRemixImageV2IdeogramV3.g.cs deleted file mode 100644 index faf0e3c7..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IImagesRemixClient.PostRemixImageV2IdeogramV3.g.cs +++ /dev/null @@ -1,185 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IImagesRemixClient - { - /// - /// Remix with Ideogram 3.0
- /// Transform an existing image with Ideogram 3.0, guided by a text
- /// prompt. Upload the source `image` using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostRemixImageV2IdeogramV3Async( - - global::Ideogram.RemixImageIdeogramV3Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Remix with Ideogram 3.0
- /// Transform an existing image with Ideogram 3.0, guided by a text
- /// prompt. Upload the source `image` using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostRemixImageV2IdeogramV3AsResponseAsync( - - global::Ideogram.RemixImageIdeogramV3Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Remix with Ideogram 3.0
- /// Transform an existing image with Ideogram 3.0, guided by a text
- /// prompt. Upload the source `image` using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// The prompt that guides the remix. - /// - /// - /// The existing upload or generated image to transform. Supply this or `image`, never both. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. - /// - /// - /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. - /// - /// - /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. - /// - /// - /// Optional. How closely the result should follow the source image, from 1 to 100. When omitted the server chooses a value from your prompt, which is the usual case. - /// - /// - /// Description of what to exclude from the images. Descriptions in the prompt take precedence over descriptions in the negative prompt. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The resolutions supported for Ideogram 3.0.
- /// Example: 1280x800 - /// - /// - /// Output aspect ratio. Cannot be combined with resolution. Generation defaults to 1x1; remix keeps the source ratio when both fields are omitted. - /// - /// - /// The rendering speed to use.
- /// Default Value: default - /// - /// - /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
- /// Default Value: auto - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). - /// - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - /// - /// - /// The style type to generate with.
- /// Default Value: general
- /// Example: general - /// - /// - /// A predefined style preset to apply to the remixed images. Cannot be combined with style codes or style references. - /// - /// - /// A saved style to apply, by its URL-safe base64 collection id. Cannot be combined with `style_reference_images`. - /// - /// - /// Optional URL-safe base64 version id pinning a specific version of the `style_reference_collection_id` collection. Ignored without it. - /// - /// - /// Existing upload or generated image assets to use as style references, by reference. Cannot be combined with `style_reference_collection_id` or `style_reference_images`. - /// - /// - /// Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported. - /// - /// - /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. - /// - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostRemixImageV2IdeogramV3Async( - string prompt, - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - int? imageWeight = default, - string? negativePrompt = default, - int? seed = default, - global::Ideogram.ResolutionV3? resolution = default, - global::Ideogram.AspectRatioV3? aspectRatio = default, - global::Ideogram.RemixImageIdeogramV3RequestRenderingSpeed? renderingSpeed = default, - global::Ideogram.MagicPromptMode? magicPrompt = default, - int? numImages = default, - global::Ideogram.IdeogramColorPalette? colorPalette = default, - global::System.Collections.Generic.IList? styleCodes = default, - global::Ideogram.IdeogramV3StyleType? styleType = default, - global::Ideogram.IdeogramV3StylePreset? stylePreset = default, - string? styleReferenceCollectionId = default, - string? styleReferenceCollectionVersionId = default, - global::System.Collections.Generic.IList? styleReferenceAssetIdentifiers = default, - global::System.Collections.Generic.IList? styleReferenceImages = default, - bool? enableCopyrightDetection = default, - bool? async = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesRemixClient.PostRemixImageV2IdeogramV3Character.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesRemixClient.PostRemixImageV2IdeogramV3Character.g.cs deleted file mode 100644 index e70d88aa..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IImagesRemixClient.PostRemixImageV2IdeogramV3Character.g.cs +++ /dev/null @@ -1,205 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IImagesRemixClient - { - /// - /// Remix a consistent character with Ideogram 3.0
- /// Transform an existing image with Ideogram 3.0 so it features a
- /// consistent character, guided by a text prompt. Upload the source
- /// `image` and a `character_reference_images` image (or use a saved
- /// character) using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostRemixImageV2IdeogramV3CharacterAsync( - - global::Ideogram.RemixImageIdeogramV3CharacterRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Remix a consistent character with Ideogram 3.0
- /// Transform an existing image with Ideogram 3.0 so it features a
- /// consistent character, guided by a text prompt. Upload the source
- /// `image` and a `character_reference_images` image (or use a saved
- /// character) using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostRemixImageV2IdeogramV3CharacterAsResponseAsync( - - global::Ideogram.RemixImageIdeogramV3CharacterRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Remix a consistent character with Ideogram 3.0
- /// Transform an existing image with Ideogram 3.0 so it features a
- /// consistent character, guided by a text prompt. Upload the source
- /// `image` and a `character_reference_images` image (or use a saved
- /// character) using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// The prompt that guides the remix. - /// - /// - /// The existing upload or generated image to transform. Supply this or `image`, never both. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. - /// - /// - /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. - /// - /// - /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. - /// - /// - /// Optional. How closely the result should follow the source image, from 1 to 100. When omitted the server chooses a value from your prompt, which is the usual case. - /// - /// - /// Description of what to exclude from the images. Descriptions in the prompt take precedence over descriptions in the negative prompt. - /// - /// - /// A saved character to feature, by its URL-safe base64 collection id. Takes priority over `character_reference_images` if both are supplied. - /// - /// - /// Optional URL-safe base64 version id pinning a specific version of the `character_reference_collection_id` collection. Ignored without it. - /// - /// - /// An existing upload or generated image asset to use as the character reference, by reference. Takes priority over `character_reference_images` if both are supplied. - /// - /// - /// An image to use as the character reference (max 25MB). JPEG, PNG, and WEBP are supported. - /// - /// - /// An existing upload or generated image asset to use as the character reference mask, by reference. The same rules as `character_reference_mask` apply. Takes priority over `character_reference_mask` if both are supplied. - /// - /// - /// Optional grayscale mask for the character reference image, the same size as that image, marking where the character is. Only JPEG, PNG, and WEBP formats are supported. Multipart requests only; cannot be combined with `character_reference_collection_id`. - /// - /// - /// Optional grayscale mask for the character reference image, the same size as that image, marking where the character is. Only JPEG, PNG, and WEBP formats are supported. Multipart requests only; cannot be combined with `character_reference_collection_id`. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The resolutions supported for Ideogram 3.0.
- /// Example: 1280x800 - /// - /// - /// Output aspect ratio. Cannot be combined with resolution. Generation defaults to 1x1; remix keeps the source ratio when both fields are omitted. - /// - /// - /// The rendering speed to use.
- /// Default Value: default - /// - /// - /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
- /// Default Value: auto - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// The style type to remix the character with. Defaults to `auto`.
- /// Default Value: auto - /// - /// - /// A saved style to apply, by its URL-safe base64 collection id. Takes priority over `style_reference_images` if both are supplied. - /// - /// - /// Optional URL-safe base64 version id pinning a specific version of the `style_reference_collection_id` collection. Ignored without it. - /// - /// - /// Existing upload or generated image assets to use as style references, by reference. Takes priority over `style_reference_images` if both are supplied. - /// - /// - /// Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported. - /// - /// - /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. - /// - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostRemixImageV2IdeogramV3CharacterAsync( - string prompt, - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - int? imageWeight = default, - string? negativePrompt = default, - string? characterReferenceCollectionId = default, - string? characterReferenceCollectionVersionId = default, - global::System.Collections.Generic.IList? characterReferenceAssetIdentifiers = default, - global::System.Collections.Generic.IList? characterReferenceImages = default, - global::Ideogram.AssetIdentifier? characterReferenceMaskAssetIdentifier = default, - byte[]? characterReferenceMask = default, - string? characterReferenceMaskname = default, - int? seed = default, - global::Ideogram.ResolutionV3? resolution = default, - global::Ideogram.AspectRatioV3? aspectRatio = default, - global::Ideogram.RemixImageIdeogramV3CharacterRequestRenderingSpeed? renderingSpeed = default, - global::Ideogram.MagicPromptMode? magicPrompt = default, - int? numImages = default, - global::Ideogram.RemixImageIdeogramV3CharacterRequestStyleType? styleType = default, - string? styleReferenceCollectionId = default, - string? styleReferenceCollectionVersionId = default, - global::System.Collections.Generic.IList? styleReferenceAssetIdentifiers = default, - global::System.Collections.Generic.IList? styleReferenceImages = default, - bool? enableCopyrightDetection = default, - bool? async = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesRemixClient.PostRemixImageV2IdeogramV3CustomModel.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesRemixClient.PostRemixImageV2IdeogramV3CustomModel.g.cs deleted file mode 100644 index 33b874df..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IImagesRemixClient.PostRemixImageV2IdeogramV3CustomModel.g.cs +++ /dev/null @@ -1,178 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IImagesRemixClient - { - /// - /// Remix with a custom Ideogram 3.0 model
- /// Transform an existing image with a custom Ideogram 3.0 model that your
- /// user or organization can access, guided by a text prompt. Upload the
- /// source `image` using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostRemixImageV2IdeogramV3CustomModelAsync( - - global::Ideogram.RemixImageIdeogramV3CustomModelRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Remix with a custom Ideogram 3.0 model
- /// Transform an existing image with a custom Ideogram 3.0 model that your
- /// user or organization can access, guided by a text prompt. Upload the
- /// source `image` using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostRemixImageV2IdeogramV3CustomModelAsResponseAsync( - - global::Ideogram.RemixImageIdeogramV3CustomModelRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Remix with a custom Ideogram 3.0 model
- /// Transform an existing image with a custom Ideogram 3.0 model that your
- /// user or organization can access, guided by a text prompt. Upload the
- /// source `image` using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// The prompt that guides the remix. - /// - /// - /// The custom model URI returned by the custom-model API, in the form `model/<model_name>/version/<version_name>`. The authenticated user or organization must have access to the model.
- /// Example: model/my-custom-model/version/1 - /// - /// - /// The existing upload or generated image to transform. Supply this or `image`, never both. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. - /// - /// - /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. - /// - /// - /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. - /// - /// - /// Optional. How closely the result should follow the source image, from 1 to 100. When omitted the server chooses a value from your prompt, which is the usual case. - /// - /// - /// Description of what to exclude from the images. Descriptions in the prompt take precedence over descriptions in the negative prompt. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The resolutions supported for Ideogram 3.0.
- /// Example: 1280x800 - /// - /// - /// Output aspect ratio. Cannot be combined with resolution. Generation defaults to 1x1; remix keeps the source ratio when both fields are omitted. - /// - /// - /// The rendering speed to use. When omitted, the server chooses a speed supported by the selected custom model. - /// - /// - /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
- /// Default Value: auto - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). - /// - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - /// - /// - /// A predefined style preset to apply to the remixed images. Cannot be combined with style codes or style references. - /// - /// - /// Existing upload or generated image assets to use as style references, by reference. Takes priority over `style_reference_images` if both are supplied. - /// - /// - /// Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported. Multipart requests only. - /// - /// - /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. - /// - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostRemixImageV2IdeogramV3CustomModelAsync( - string prompt, - string customModelUri, - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - int? imageWeight = default, - string? negativePrompt = default, - int? seed = default, - global::Ideogram.ResolutionV3? resolution = default, - global::Ideogram.AspectRatioV3? aspectRatio = default, - global::Ideogram.RemixImageIdeogramV3CustomModelRequestRenderingSpeed? renderingSpeed = default, - global::Ideogram.MagicPromptMode? magicPrompt = default, - int? numImages = default, - global::Ideogram.IdeogramColorPalette? colorPalette = default, - global::System.Collections.Generic.IList? styleCodes = default, - global::Ideogram.IdeogramV3StylePreset? stylePreset = default, - global::System.Collections.Generic.IList? styleReferenceAssetIdentifiers = default, - global::System.Collections.Generic.IList? styleReferenceImages = default, - bool? enableCopyrightDetection = default, - bool? async = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesRemixClient.PostRemixImageV2IdeogramV4.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesRemixClient.PostRemixImageV2IdeogramV4.g.cs deleted file mode 100644 index 1759b3b2..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IImagesRemixClient.PostRemixImageV2IdeogramV4.g.cs +++ /dev/null @@ -1,134 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IImagesRemixClient - { - /// - /// Remix with Ideogram 4.0
- /// Transform an existing image with Ideogram 4.0, guided by a text
- /// prompt. Upload the source `image` using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostRemixImageV2IdeogramV4Async( - - global::Ideogram.RemixImageIdeogramV4Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Remix with Ideogram 4.0
- /// Transform an existing image with Ideogram 4.0, guided by a text
- /// prompt. Upload the source `image` using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostRemixImageV2IdeogramV4AsResponseAsync( - - global::Ideogram.RemixImageIdeogramV4Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Remix with Ideogram 4.0
- /// Transform an existing image with Ideogram 4.0, guided by a text
- /// prompt. Upload the source `image` using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// The prompt that guides the remix. It is always read as an editing instruction, so there is no `magic_prompt` option. - /// - /// - /// The existing upload or generated image to transform. Supply this or `image`, never both. Omit `resolution` to keep its shape. - /// - /// - /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` to keep its shape. - /// - /// - /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` to keep its shape. - /// - /// - /// Optional. How closely the result should follow the source image, from 1 to 100. When omitted the server chooses a value from your prompt, which is the usual case. Only accepted when the output keeps the source image's shape: combining `image_weight` with a `resolution` whose aspect ratio differs from the source's is rejected with a 400. - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Optional. When supplied, the images are generated at this
- /// resolution. When omitted, the source image's shape is kept. A
- /// resolution whose aspect ratio differs from the source's cannot
- /// be combined with `image_weight`. - /// - /// - /// The rendering speed to use.
- /// Default Value: default - /// - /// - /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. - /// - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostRemixImageV2IdeogramV4Async( - string prompt, - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - int? imageWeight = default, - int? numImages = default, - global::Ideogram.ResolutionV4? resolution = default, - global::Ideogram.RemixImageIdeogramV4RequestRenderingSpeed? renderingSpeed = default, - bool? enableCopyrightDetection = default, - bool? async = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesRemixClient.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesRemixClient.g.cs index 8e2baa5c..fff9ef58 100644 --- a/src/libs/Ideogram/Generated/Ideogram.IImagesRemixClient.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.IImagesRemixClient.g.cs @@ -4,7 +4,6 @@ namespace Ideogram { /// - /// Transform an image with a specific model, guided by a prompt.
/// If no httpClient is provided, a new one will be created.
/// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. ///
diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesUpscaleClient.ImagesUpscalePostUpscaleImageNanoBananaPro.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesUpscaleClient.ImagesUpscalePostUpscaleImageNanoBananaPro.g.cs new file mode 100644 index 00000000..73304bf7 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IImagesUpscaleClient.ImagesUpscalePostUpscaleImageNanoBananaPro.g.cs @@ -0,0 +1,221 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IImagesUpscaleClient + { + /// + /// Upscale with Nano Banana Pro
+ /// Regenerate an image at a higher `resolution_tier` (1K, 2K, or 4K) while
+ /// preserving its content, composition, and style. Upload the source
+ /// `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesUpscalePostUpscaleImageNanoBananaProAsync( + + global::Ideogram.ImagesUpscalePostUpscaleImageNanoBananaProRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Upscale with Nano Banana Pro
+ /// Regenerate an image at a higher `resolution_tier` (1K, 2K, or 4K) while
+ /// preserving its content, composition, and style. Upload the source
+ /// `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ImagesUpscalePostUpscaleImageNanoBananaProAsResponseAsync( + + global::Ideogram.ImagesUpscalePostUpscaleImageNanoBananaProRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Upscale with Nano Banana Pro
+ /// Regenerate an image at a higher `resolution_tier` (1K, 2K, or 4K) while
+ /// preserving its content, composition, and style. Upload the source
+ /// `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// Optional short guidance for the enhancement, appended to the model's upscaling instruction. When omitted, the image is upscaled as-is. + /// + /// + /// The output resolution tier. The model sizes its output by tier at the source image's aspect ratio; exact pixel dimensions cannot be requested. Rejected when the source is already at or above the requested tier. Defaults to "2K".
+ /// Default Value: 2K + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesUpscalePostUpscaleImageNanoBananaProAsync( + byte[] image, + string imagename, + bool? dryRun = default, + string? prompt = default, + global::Ideogram.V2ImageUpscaleNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier? resolutionTier = default, + int? seed = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Upscale with Nano Banana Pro
+ /// Regenerate an image at a higher `resolution_tier` (1K, 2K, or 4K) while
+ /// preserving its content, composition, and style. Upload the source
+ /// `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// Optional short guidance for the enhancement, appended to the model's upscaling instruction. When omitted, the image is upscaled as-is. + /// + /// + /// The output resolution tier. The model sizes its output by tier at the source image's aspect ratio; exact pixel dimensions cannot be requested. Rejected when the source is already at or above the requested tier. Defaults to "2K".
+ /// Default Value: 2K + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesUpscalePostUpscaleImageNanoBananaProAsync( + global::System.IO.Stream image, + string imagename, + bool? dryRun = default, + string? prompt = default, + global::Ideogram.V2ImageUpscaleNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier? resolutionTier = default, + int? seed = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Upscale with Nano Banana Pro
+ /// Regenerate an image at a higher `resolution_tier` (1K, 2K, or 4K) while
+ /// preserving its content, composition, and style. Upload the source
+ /// `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// Optional short guidance for the enhancement, appended to the model's upscaling instruction. When omitted, the image is upscaled as-is. + /// + /// + /// The output resolution tier. The model sizes its output by tier at the source image's aspect ratio; exact pixel dimensions cannot be requested. Rejected when the source is already at or above the requested tier. Defaults to "2K".
+ /// Default Value: 2K + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ImagesUpscalePostUpscaleImageNanoBananaProAsResponseAsync( + global::System.IO.Stream image, + string imagename, + bool? dryRun = default, + string? prompt = default, + global::Ideogram.V2ImageUpscaleNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier? resolutionTier = default, + int? seed = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesUpscaleClient.ImagesUpscalePostUpscaleImageTopazBloom2.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesUpscaleClient.ImagesUpscalePostUpscaleImageTopazBloom2.g.cs new file mode 100644 index 00000000..a89b7351 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IImagesUpscaleClient.ImagesUpscalePostUpscaleImageTopazBloom2.g.cs @@ -0,0 +1,251 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IImagesUpscaleClient + { + /// + /// Upscale with Topaz Bloom 2
+ /// Creatively upscale an image to 2x, 4x, or 8x its original resolution,
+ /// optionally guided by a `prompt`. Upload the source `image` using
+ /// `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesUpscalePostUpscaleImageTopazBloom2Async( + + global::Ideogram.ImagesUpscalePostUpscaleImageTopazBloom2Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Upscale with Topaz Bloom 2
+ /// Creatively upscale an image to 2x, 4x, or 8x its original resolution,
+ /// optionally guided by a `prompt`. Upload the source `image` using
+ /// `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ImagesUpscalePostUpscaleImageTopazBloom2AsResponseAsync( + + global::Ideogram.ImagesUpscalePostUpscaleImageTopazBloom2Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Upscale with Topaz Bloom 2
+ /// Creatively upscale an image to 2x, 4x, or 8x its original resolution,
+ /// optionally guided by a `prompt`. Upload the source `image` using
+ /// `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
+ /// Default Value: x2 + /// + /// + /// An optional prompt guiding the detail the model regenerates while enlarging the image. Leave empty to enhance the source image as-is. + /// + /// + /// How strongly the model reinterprets the source while enlarging it, from 1 (most faithful) to 9 (most creative).
+ /// Default Value: 3 + /// + /// + /// When true (the default), the output keeps the source image's colors. Set to false to let the model adjust colors while enhancing.
+ /// Default Value: true + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesUpscalePostUpscaleImageTopazBloom2Async( + byte[] image, + string imagename, + bool? dryRun = default, + global::Ideogram.V2ImageUpscaleTopazBloom2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? upscaleFactor = default, + string? prompt = default, + int? creativity = default, + bool? colorPreservation = default, + int? seed = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Upscale with Topaz Bloom 2
+ /// Creatively upscale an image to 2x, 4x, or 8x its original resolution,
+ /// optionally guided by a `prompt`. Upload the source `image` using
+ /// `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
+ /// Default Value: x2 + /// + /// + /// An optional prompt guiding the detail the model regenerates while enlarging the image. Leave empty to enhance the source image as-is. + /// + /// + /// How strongly the model reinterprets the source while enlarging it, from 1 (most faithful) to 9 (most creative).
+ /// Default Value: 3 + /// + /// + /// When true (the default), the output keeps the source image's colors. Set to false to let the model adjust colors while enhancing.
+ /// Default Value: true + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesUpscalePostUpscaleImageTopazBloom2Async( + global::System.IO.Stream image, + string imagename, + bool? dryRun = default, + global::Ideogram.V2ImageUpscaleTopazBloom2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? upscaleFactor = default, + string? prompt = default, + int? creativity = default, + bool? colorPreservation = default, + int? seed = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Upscale with Topaz Bloom 2
+ /// Creatively upscale an image to 2x, 4x, or 8x its original resolution,
+ /// optionally guided by a `prompt`. Upload the source `image` using
+ /// `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
+ /// Default Value: x2 + /// + /// + /// An optional prompt guiding the detail the model regenerates while enlarging the image. Leave empty to enhance the source image as-is. + /// + /// + /// How strongly the model reinterprets the source while enlarging it, from 1 (most faithful) to 9 (most creative).
+ /// Default Value: 3 + /// + /// + /// When true (the default), the output keeps the source image's colors. Set to false to let the model adjust colors while enhancing.
+ /// Default Value: true + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ImagesUpscalePostUpscaleImageTopazBloom2AsResponseAsync( + global::System.IO.Stream image, + string imagename, + bool? dryRun = default, + global::Ideogram.V2ImageUpscaleTopazBloom2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? upscaleFactor = default, + string? prompt = default, + int? creativity = default, + bool? colorPreservation = default, + int? seed = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesUpscaleClient.ImagesUpscalePostUpscaleImageTopazRedefine.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesUpscaleClient.ImagesUpscalePostUpscaleImageTopazRedefine.g.cs new file mode 100644 index 00000000..6c9e2947 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IImagesUpscaleClient.ImagesUpscalePostUpscaleImageTopazRedefine.g.cs @@ -0,0 +1,365 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IImagesUpscaleClient + { + /// + /// Upscale with Topaz Redefine
+ /// Creatively upscale an image to 2x, 4x, or 8x its original resolution,
+ /// guided by an optional `prompt` or `autoprompt`. Upload the source
+ /// `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesUpscalePostUpscaleImageTopazRedefineAsync( + + global::Ideogram.ImagesUpscalePostUpscaleImageTopazRedefineRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Upscale with Topaz Redefine
+ /// Creatively upscale an image to 2x, 4x, or 8x its original resolution,
+ /// guided by an optional `prompt` or `autoprompt`. Upload the source
+ /// `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ImagesUpscalePostUpscaleImageTopazRedefineAsResponseAsync( + + global::Ideogram.ImagesUpscalePostUpscaleImageTopazRedefineRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Upscale with Topaz Redefine
+ /// Creatively upscale an image to 2x, 4x, or 8x its original resolution,
+ /// guided by an optional `prompt` or `autoprompt`. Upload the source
+ /// `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
+ /// Default Value: x2 + /// + /// + /// An optional prompt guiding the detail the model regenerates while enlarging the image. Leave empty to enhance the source image as-is. + /// + /// + /// How strongly the model reinterprets the source while enlarging it, from 1 (most faithful) to 9 (most creative).
+ /// Default Value: 3 + /// + /// + /// When true, the model describes the image itself and any `prompt` is ignored.
+ /// Default Value: false + /// + /// + /// How much fine texture the model adds, from 1 to 5. Keep it low at low creativity.
+ /// Default Value: 1 + /// + /// + /// Apply a detail adjustment after rendering. When true, `detail_strength` sets how much.
+ /// Default Value: false + /// + /// + /// Detail adjustment intensity, from 0 to 10. + /// + /// + /// Edge sharpening applied after enlarging, from 0 to 1. Omit to let the model choose per image. + /// + /// + /// Noise and grain reduction, from 0 to 1. Omit to let the model choose per image. + /// + /// + /// Recover detail in faces. When true, `face_enhancement_strength` and `face_enhancement_creativity` are required. + /// + /// + /// How strongly faces are recovered, from 0 to 1. + /// + /// + /// How freely face recovery may reinterpret features, from 0 (faithful) to 1 (creative). + /// + /// + /// Where enhancements apply. Omit to let the model choose per image. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesUpscalePostUpscaleImageTopazRedefineAsync( + byte[] image, + string imagename, + bool? dryRun = default, + global::Ideogram.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? upscaleFactor = default, + string? prompt = default, + int? creativity = default, + bool? autoprompt = default, + int? texture = default, + bool? detail = default, + string? detailStrength = default, + string? sharpen = default, + string? denoise = default, + bool? faceEnhancement = default, + string? faceEnhancementStrength = default, + string? faceEnhancementCreativity = default, + global::Ideogram.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection? subjectDetection = default, + int? seed = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Upscale with Topaz Redefine
+ /// Creatively upscale an image to 2x, 4x, or 8x its original resolution,
+ /// guided by an optional `prompt` or `autoprompt`. Upload the source
+ /// `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
+ /// Default Value: x2 + /// + /// + /// An optional prompt guiding the detail the model regenerates while enlarging the image. Leave empty to enhance the source image as-is. + /// + /// + /// How strongly the model reinterprets the source while enlarging it, from 1 (most faithful) to 9 (most creative).
+ /// Default Value: 3 + /// + /// + /// When true, the model describes the image itself and any `prompt` is ignored.
+ /// Default Value: false + /// + /// + /// How much fine texture the model adds, from 1 to 5. Keep it low at low creativity.
+ /// Default Value: 1 + /// + /// + /// Apply a detail adjustment after rendering. When true, `detail_strength` sets how much.
+ /// Default Value: false + /// + /// + /// Detail adjustment intensity, from 0 to 10. + /// + /// + /// Edge sharpening applied after enlarging, from 0 to 1. Omit to let the model choose per image. + /// + /// + /// Noise and grain reduction, from 0 to 1. Omit to let the model choose per image. + /// + /// + /// Recover detail in faces. When true, `face_enhancement_strength` and `face_enhancement_creativity` are required. + /// + /// + /// How strongly faces are recovered, from 0 to 1. + /// + /// + /// How freely face recovery may reinterpret features, from 0 (faithful) to 1 (creative). + /// + /// + /// Where enhancements apply. Omit to let the model choose per image. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesUpscalePostUpscaleImageTopazRedefineAsync( + global::System.IO.Stream image, + string imagename, + bool? dryRun = default, + global::Ideogram.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? upscaleFactor = default, + string? prompt = default, + int? creativity = default, + bool? autoprompt = default, + int? texture = default, + bool? detail = default, + string? detailStrength = default, + string? sharpen = default, + string? denoise = default, + bool? faceEnhancement = default, + string? faceEnhancementStrength = default, + string? faceEnhancementCreativity = default, + global::Ideogram.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection? subjectDetection = default, + int? seed = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Upscale with Topaz Redefine
+ /// Creatively upscale an image to 2x, 4x, or 8x its original resolution,
+ /// guided by an optional `prompt` or `autoprompt`. Upload the source
+ /// `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
+ /// Default Value: x2 + /// + /// + /// An optional prompt guiding the detail the model regenerates while enlarging the image. Leave empty to enhance the source image as-is. + /// + /// + /// How strongly the model reinterprets the source while enlarging it, from 1 (most faithful) to 9 (most creative).
+ /// Default Value: 3 + /// + /// + /// When true, the model describes the image itself and any `prompt` is ignored.
+ /// Default Value: false + /// + /// + /// How much fine texture the model adds, from 1 to 5. Keep it low at low creativity.
+ /// Default Value: 1 + /// + /// + /// Apply a detail adjustment after rendering. When true, `detail_strength` sets how much.
+ /// Default Value: false + /// + /// + /// Detail adjustment intensity, from 0 to 10. + /// + /// + /// Edge sharpening applied after enlarging, from 0 to 1. Omit to let the model choose per image. + /// + /// + /// Noise and grain reduction, from 0 to 1. Omit to let the model choose per image. + /// + /// + /// Recover detail in faces. When true, `face_enhancement_strength` and `face_enhancement_creativity` are required. + /// + /// + /// How strongly faces are recovered, from 0 to 1. + /// + /// + /// How freely face recovery may reinterpret features, from 0 (faithful) to 1 (creative). + /// + /// + /// Where enhancements apply. Omit to let the model choose per image. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ImagesUpscalePostUpscaleImageTopazRedefineAsResponseAsync( + global::System.IO.Stream image, + string imagename, + bool? dryRun = default, + global::Ideogram.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? upscaleFactor = default, + string? prompt = default, + int? creativity = default, + bool? autoprompt = default, + int? texture = default, + bool? detail = default, + string? detailStrength = default, + string? sharpen = default, + string? denoise = default, + bool? faceEnhancement = default, + string? faceEnhancementStrength = default, + string? faceEnhancementCreativity = default, + global::Ideogram.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection? subjectDetection = default, + int? seed = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesUpscaleClient.ImagesUpscalePostUpscaleImageTopazStandardV2.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesUpscaleClient.ImagesUpscalePostUpscaleImageTopazStandardV2.g.cs new file mode 100644 index 00000000..05ba3abe --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IImagesUpscaleClient.ImagesUpscalePostUpscaleImageTopazStandardV2.g.cs @@ -0,0 +1,288 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IImagesUpscaleClient + { + /// + /// Upscale with Topaz Standard V2
+ /// Upscale an image to 2x, 4x, or 8x its original resolution; no prompt is
+ /// needed. Upload the source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesUpscalePostUpscaleImageTopazStandardV2Async( + + global::Ideogram.ImagesUpscalePostUpscaleImageTopazStandardV2Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Upscale with Topaz Standard V2
+ /// Upscale an image to 2x, 4x, or 8x its original resolution; no prompt is
+ /// needed. Upload the source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ImagesUpscalePostUpscaleImageTopazStandardV2AsResponseAsync( + + global::Ideogram.ImagesUpscalePostUpscaleImageTopazStandardV2Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Upscale with Topaz Standard V2
+ /// Upscale an image to 2x, 4x, or 8x its original resolution; no prompt is
+ /// needed. Upload the source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
+ /// Default Value: x2 + /// + /// + /// Overall intensity of the enhancement model, from 0.01 to 1. Higher values look crisper but can turn unrealistic. Omit to let the model choose per image. + /// + /// + /// Edge sharpening applied after enlarging, from 0 to 1. Omit to let the model choose per image. + /// + /// + /// Noise and grain reduction, from 0 to 1. Omit to let the model choose per image. + /// + /// + /// Compression artifact removal, from 0 to 1. Omit to let the model choose per image. + /// + /// + /// Recover detail in faces. When true, `face_enhancement_strength` and `face_enhancement_creativity` are required. + /// + /// + /// How strongly faces are recovered, from 0 to 1. + /// + /// + /// How freely face recovery may reinterpret features, from 0 (faithful) to 1 (creative). + /// + /// + /// Where enhancements apply. Omit to let the model choose per image. + /// + /// + /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesUpscalePostUpscaleImageTopazStandardV2Async( + byte[] image, + string imagename, + bool? dryRun = default, + global::Ideogram.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? upscaleFactor = default, + string? strength = default, + string? sharpen = default, + string? denoise = default, + string? fixCompression = default, + bool? faceEnhancement = default, + string? faceEnhancementStrength = default, + string? faceEnhancementCreativity = default, + global::Ideogram.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaSubjectDetection? subjectDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Upscale with Topaz Standard V2
+ /// Upscale an image to 2x, 4x, or 8x its original resolution; no prompt is
+ /// needed. Upload the source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
+ /// Default Value: x2 + /// + /// + /// Overall intensity of the enhancement model, from 0.01 to 1. Higher values look crisper but can turn unrealistic. Omit to let the model choose per image. + /// + /// + /// Edge sharpening applied after enlarging, from 0 to 1. Omit to let the model choose per image. + /// + /// + /// Noise and grain reduction, from 0 to 1. Omit to let the model choose per image. + /// + /// + /// Compression artifact removal, from 0 to 1. Omit to let the model choose per image. + /// + /// + /// Recover detail in faces. When true, `face_enhancement_strength` and `face_enhancement_creativity` are required. + /// + /// + /// How strongly faces are recovered, from 0 to 1. + /// + /// + /// How freely face recovery may reinterpret features, from 0 (faithful) to 1 (creative). + /// + /// + /// Where enhancements apply. Omit to let the model choose per image. + /// + /// + /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesUpscalePostUpscaleImageTopazStandardV2Async( + global::System.IO.Stream image, + string imagename, + bool? dryRun = default, + global::Ideogram.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? upscaleFactor = default, + string? strength = default, + string? sharpen = default, + string? denoise = default, + string? fixCompression = default, + bool? faceEnhancement = default, + string? faceEnhancementStrength = default, + string? faceEnhancementCreativity = default, + global::Ideogram.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaSubjectDetection? subjectDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Upscale with Topaz Standard V2
+ /// Upscale an image to 2x, 4x, or 8x its original resolution; no prompt is
+ /// needed. Upload the source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
+ /// Default Value: x2 + /// + /// + /// Overall intensity of the enhancement model, from 0.01 to 1. Higher values look crisper but can turn unrealistic. Omit to let the model choose per image. + /// + /// + /// Edge sharpening applied after enlarging, from 0 to 1. Omit to let the model choose per image. + /// + /// + /// Noise and grain reduction, from 0 to 1. Omit to let the model choose per image. + /// + /// + /// Compression artifact removal, from 0 to 1. Omit to let the model choose per image. + /// + /// + /// Recover detail in faces. When true, `face_enhancement_strength` and `face_enhancement_creativity` are required. + /// + /// + /// How strongly faces are recovered, from 0 to 1. + /// + /// + /// How freely face recovery may reinterpret features, from 0 (faithful) to 1 (creative). + /// + /// + /// Where enhancements apply. Omit to let the model choose per image. + /// + /// + /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ImagesUpscalePostUpscaleImageTopazStandardV2AsResponseAsync( + global::System.IO.Stream image, + string imagename, + bool? dryRun = default, + global::Ideogram.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? upscaleFactor = default, + string? strength = default, + string? sharpen = default, + string? denoise = default, + string? fixCompression = default, + bool? faceEnhancement = default, + string? faceEnhancementStrength = default, + string? faceEnhancementCreativity = default, + global::Ideogram.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaSubjectDetection? subjectDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesUpscaleClient.ImagesUpscalePostUpscaleImageTopazTextRefine.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesUpscaleClient.ImagesUpscalePostUpscaleImageTopazTextRefine.g.cs new file mode 100644 index 00000000..1e35c779 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IImagesUpscaleClient.ImagesUpscalePostUpscaleImageTopazTextRefine.g.cs @@ -0,0 +1,300 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IImagesUpscaleClient + { + /// + /// Upscale with Topaz Text Refine
+ /// Upscale an image to 2x, 4x, or 8x its original resolution; no prompt is
+ /// needed. Upload the source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesUpscalePostUpscaleImageTopazTextRefineAsync( + + global::Ideogram.ImagesUpscalePostUpscaleImageTopazTextRefineRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Upscale with Topaz Text Refine
+ /// Upscale an image to 2x, 4x, or 8x its original resolution; no prompt is
+ /// needed. Upload the source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ImagesUpscalePostUpscaleImageTopazTextRefineAsResponseAsync( + + global::Ideogram.ImagesUpscalePostUpscaleImageTopazTextRefineRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Upscale with Topaz Text Refine
+ /// Upscale an image to 2x, 4x, or 8x its original resolution; no prompt is
+ /// needed. Upload the source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
+ /// Default Value: x2 + /// + /// + /// Overall intensity of the enhancement model, from 0.01 to 1. Higher values look crisper but can turn unrealistic. Omit to let the model choose per image. + /// + /// + /// Edge sharpening applied after enlarging, from 0 to 1. Omit to let the model choose per image. + /// + /// + /// Noise and grain reduction, from 0 to 1. Omit to let the model choose per image. + /// + /// + /// Compression artifact removal, from 0 to 1. Omit to let the model choose per image. + /// + /// + /// Recover detail in faces. When true, `face_enhancement_strength` and `face_enhancement_creativity` are required. + /// + /// + /// How strongly faces are recovered, from 0 to 1. + /// + /// + /// How freely face recovery may reinterpret features, from 0 (faithful) to 1 (creative). + /// + /// + /// Where enhancements apply. Omit to let the model choose per image. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesUpscalePostUpscaleImageTopazTextRefineAsync( + byte[] image, + string imagename, + bool? dryRun = default, + global::Ideogram.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? upscaleFactor = default, + string? strength = default, + string? sharpen = default, + string? denoise = default, + string? fixCompression = default, + bool? faceEnhancement = default, + string? faceEnhancementStrength = default, + string? faceEnhancementCreativity = default, + global::Ideogram.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection? subjectDetection = default, + int? seed = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Upscale with Topaz Text Refine
+ /// Upscale an image to 2x, 4x, or 8x its original resolution; no prompt is
+ /// needed. Upload the source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
+ /// Default Value: x2 + /// + /// + /// Overall intensity of the enhancement model, from 0.01 to 1. Higher values look crisper but can turn unrealistic. Omit to let the model choose per image. + /// + /// + /// Edge sharpening applied after enlarging, from 0 to 1. Omit to let the model choose per image. + /// + /// + /// Noise and grain reduction, from 0 to 1. Omit to let the model choose per image. + /// + /// + /// Compression artifact removal, from 0 to 1. Omit to let the model choose per image. + /// + /// + /// Recover detail in faces. When true, `face_enhancement_strength` and `face_enhancement_creativity` are required. + /// + /// + /// How strongly faces are recovered, from 0 to 1. + /// + /// + /// How freely face recovery may reinterpret features, from 0 (faithful) to 1 (creative). + /// + /// + /// Where enhancements apply. Omit to let the model choose per image. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesUpscalePostUpscaleImageTopazTextRefineAsync( + global::System.IO.Stream image, + string imagename, + bool? dryRun = default, + global::Ideogram.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? upscaleFactor = default, + string? strength = default, + string? sharpen = default, + string? denoise = default, + string? fixCompression = default, + bool? faceEnhancement = default, + string? faceEnhancementStrength = default, + string? faceEnhancementCreativity = default, + global::Ideogram.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection? subjectDetection = default, + int? seed = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Upscale with Topaz Text Refine
+ /// Upscale an image to 2x, 4x, or 8x its original resolution; no prompt is
+ /// needed. Upload the source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
+ /// Default Value: x2 + /// + /// + /// Overall intensity of the enhancement model, from 0.01 to 1. Higher values look crisper but can turn unrealistic. Omit to let the model choose per image. + /// + /// + /// Edge sharpening applied after enlarging, from 0 to 1. Omit to let the model choose per image. + /// + /// + /// Noise and grain reduction, from 0 to 1. Omit to let the model choose per image. + /// + /// + /// Compression artifact removal, from 0 to 1. Omit to let the model choose per image. + /// + /// + /// Recover detail in faces. When true, `face_enhancement_strength` and `face_enhancement_creativity` are required. + /// + /// + /// How strongly faces are recovered, from 0 to 1. + /// + /// + /// How freely face recovery may reinterpret features, from 0 (faithful) to 1 (creative). + /// + /// + /// Where enhancements apply. Omit to let the model choose per image. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ImagesUpscalePostUpscaleImageTopazTextRefineAsResponseAsync( + global::System.IO.Stream image, + string imagename, + bool? dryRun = default, + global::Ideogram.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? upscaleFactor = default, + string? strength = default, + string? sharpen = default, + string? denoise = default, + string? fixCompression = default, + bool? faceEnhancement = default, + string? faceEnhancementStrength = default, + string? faceEnhancementCreativity = default, + global::Ideogram.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection? subjectDetection = default, + int? seed = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesUpscaleClient.ImagesUpscalePostUpscaleImageTopazWonder35.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesUpscaleClient.ImagesUpscalePostUpscaleImageTopazWonder35.g.cs new file mode 100644 index 00000000..cb6e1872 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IImagesUpscaleClient.ImagesUpscalePostUpscaleImageTopazWonder35.g.cs @@ -0,0 +1,224 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IImagesUpscaleClient + { + /// + /// Upscale with Topaz Wonder 3.5
+ /// Upscale an image to 2x, 4x, or 8x its original resolution, with
+ /// `enhancement_strength` controlling how strongly detail is reconstructed.
+ /// Upload the source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesUpscalePostUpscaleImageTopazWonder35Async( + + global::Ideogram.ImagesUpscalePostUpscaleImageTopazWonder35Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Upscale with Topaz Wonder 3.5
+ /// Upscale an image to 2x, 4x, or 8x its original resolution, with
+ /// `enhancement_strength` controlling how strongly detail is reconstructed.
+ /// Upload the source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ImagesUpscalePostUpscaleImageTopazWonder35AsResponseAsync( + + global::Ideogram.ImagesUpscalePostUpscaleImageTopazWonder35Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Upscale with Topaz Wonder 3.5
+ /// Upscale an image to 2x, 4x, or 8x its original resolution, with
+ /// `enhancement_strength` controlling how strongly detail is reconstructed.
+ /// Upload the source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
+ /// Default Value: x2 + /// + /// + /// How strongly the generative model reconstructs detail while upscaling. Lower values stay closer to the source image; higher values produce a more enhanced result.
+ /// Default Value: high + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesUpscalePostUpscaleImageTopazWonder35Async( + byte[] image, + string imagename, + bool? dryRun = default, + global::Ideogram.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? upscaleFactor = default, + global::Ideogram.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaEnhancementStrength? enhancementStrength = default, + int? seed = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Upscale with Topaz Wonder 3.5
+ /// Upscale an image to 2x, 4x, or 8x its original resolution, with
+ /// `enhancement_strength` controlling how strongly detail is reconstructed.
+ /// Upload the source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
+ /// Default Value: x2 + /// + /// + /// How strongly the generative model reconstructs detail while upscaling. Lower values stay closer to the source image; higher values produce a more enhanced result.
+ /// Default Value: high + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImagesUpscalePostUpscaleImageTopazWonder35Async( + global::System.IO.Stream image, + string imagename, + bool? dryRun = default, + global::Ideogram.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? upscaleFactor = default, + global::Ideogram.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaEnhancementStrength? enhancementStrength = default, + int? seed = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Upscale with Topaz Wonder 3.5
+ /// Upscale an image to 2x, 4x, or 8x its original resolution, with
+ /// `enhancement_strength` controlling how strongly detail is reconstructed.
+ /// Upload the source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
+ /// Default Value: x2 + /// + /// + /// How strongly the generative model reconstructs detail while upscaling. Lower values stay closer to the source image; higher values produce a more enhanced result.
+ /// Default Value: high + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ImagesUpscalePostUpscaleImageTopazWonder35AsResponseAsync( + global::System.IO.Stream image, + string imagename, + bool? dryRun = default, + global::Ideogram.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? upscaleFactor = default, + global::Ideogram.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaEnhancementStrength? enhancementStrength = default, + int? seed = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesUpscaleClient.PostUpscaleImageNanoBananaPro.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesUpscaleClient.PostUpscaleImageNanoBananaPro.g.cs deleted file mode 100644 index 97930ee9..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IImagesUpscaleClient.PostUpscaleImageNanoBananaPro.g.cs +++ /dev/null @@ -1,123 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IImagesUpscaleClient - { - /// - /// Upscale with Nano Banana Pro
- /// Regenerate an image at a higher `resolution_tier` (1K, 2K, or 4K) while
- /// preserving its content, composition, and style. Upload the source
- /// `image` using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostUpscaleImageNanoBananaProAsync( - - global::Ideogram.UpscaleImageNanoBananaProRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Upscale with Nano Banana Pro
- /// Regenerate an image at a higher `resolution_tier` (1K, 2K, or 4K) while
- /// preserving its content, composition, and style. Upload the source
- /// `image` using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostUpscaleImageNanoBananaProAsResponseAsync( - - global::Ideogram.UpscaleImageNanoBananaProRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Upscale with Nano Banana Pro
- /// Regenerate an image at a higher `resolution_tier` (1K, 2K, or 4K) while
- /// preserving its content, composition, and style. Upload the source
- /// `image` using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - /// - /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - /// - /// Optional short guidance for the enhancement, appended to the model's upscaling instruction. When omitted, the image is upscaled as-is. - /// - /// - /// The output resolution tier. The model sizes its output by tier at the source image's aspect ratio; exact pixel dimensions cannot be requested. Rejected when the source is already at or above the requested tier. Defaults to "2K".
- /// Default Value: 2K - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostUpscaleImageNanoBananaProAsync( - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - string? prompt = default, - global::Ideogram.UpscaleImageNanoBananaProRequestResolutionTier? resolutionTier = default, - int? seed = default, - bool? async = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesUpscaleClient.PostUpscaleImageTopazBloom2.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesUpscaleClient.PostUpscaleImageTopazBloom2.g.cs deleted file mode 100644 index 343dace0..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IImagesUpscaleClient.PostUpscaleImageTopazBloom2.g.cs +++ /dev/null @@ -1,133 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IImagesUpscaleClient - { - /// - /// Upscale with Topaz Bloom 2
- /// Creatively upscale an image to 2x, 4x, or 8x its original resolution,
- /// optionally guided by a `prompt`. Upload the source `image` using
- /// `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostUpscaleImageTopazBloom2Async( - - global::Ideogram.UpscaleImageTopazBloom2Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Upscale with Topaz Bloom 2
- /// Creatively upscale an image to 2x, 4x, or 8x its original resolution,
- /// optionally guided by a `prompt`. Upload the source `image` using
- /// `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostUpscaleImageTopazBloom2AsResponseAsync( - - global::Ideogram.UpscaleImageTopazBloom2Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Upscale with Topaz Bloom 2
- /// Creatively upscale an image to 2x, 4x, or 8x its original resolution,
- /// optionally guided by a `prompt`. Upload the source `image` using
- /// `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - /// - /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - /// - /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
- /// Default Value: x2 - /// - /// - /// An optional prompt guiding the detail the model regenerates while enlarging the image. Leave empty to enhance the source image as-is. - /// - /// - /// How strongly the model reinterprets the source while enlarging it, from 1 (most faithful) to 9 (most creative).
- /// Default Value: 3 - /// - /// - /// When true (the default), the output keeps the source image's colors. Set to false to let the model adjust colors while enhancing.
- /// Default Value: true - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostUpscaleImageTopazBloom2Async( - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - global::Ideogram.UpscaleImageTopazBloom2RequestUpscaleFactor? upscaleFactor = default, - string? prompt = default, - int? creativity = default, - bool? colorPreservation = default, - int? seed = default, - bool? async = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesUpscaleClient.PostUpscaleImageTopazRedefine.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesUpscaleClient.PostUpscaleImageTopazRedefine.g.cs deleted file mode 100644 index 05238af9..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IImagesUpscaleClient.PostUpscaleImageTopazRedefine.g.cs +++ /dev/null @@ -1,171 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IImagesUpscaleClient - { - /// - /// Upscale with Topaz Redefine
- /// Creatively upscale an image to 2x, 4x, or 8x its original resolution,
- /// guided by an optional `prompt` or `autoprompt`. Upload the source
- /// `image` using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostUpscaleImageTopazRedefineAsync( - - global::Ideogram.UpscaleImageTopazRedefineRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Upscale with Topaz Redefine
- /// Creatively upscale an image to 2x, 4x, or 8x its original resolution,
- /// guided by an optional `prompt` or `autoprompt`. Upload the source
- /// `image` using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostUpscaleImageTopazRedefineAsResponseAsync( - - global::Ideogram.UpscaleImageTopazRedefineRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Upscale with Topaz Redefine
- /// Creatively upscale an image to 2x, 4x, or 8x its original resolution,
- /// guided by an optional `prompt` or `autoprompt`. Upload the source
- /// `image` using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - /// - /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - /// - /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
- /// Default Value: x2 - /// - /// - /// An optional prompt guiding the detail the model regenerates while enlarging the image. Leave empty to enhance the source image as-is. - /// - /// - /// How strongly the model reinterprets the source while enlarging it, from 1 (most faithful) to 9 (most creative).
- /// Default Value: 3 - /// - /// - /// When true, the model describes the image itself and any `prompt` is ignored.
- /// Default Value: false - /// - /// - /// How much fine texture the model adds, from 1 to 5. Keep it low at low creativity.
- /// Default Value: 1 - /// - /// - /// Apply a detail adjustment after rendering. When true, `detail_strength` sets how much.
- /// Default Value: false - /// - /// - /// Detail adjustment intensity, from 0 to 10. - /// - /// - /// Edge sharpening applied after enlarging, from 0 to 1. Omit to let the model choose per image. - /// - /// - /// Noise and grain reduction, from 0 to 1. Omit to let the model choose per image. - /// - /// - /// Recover detail in faces. When true, `face_enhancement_strength` and `face_enhancement_creativity` are required. - /// - /// - /// How strongly faces are recovered, from 0 to 1. - /// - /// - /// How freely face recovery may reinterpret features, from 0 (faithful) to 1 (creative). - /// - /// - /// Where enhancements apply. Omit to let the model choose per image. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostUpscaleImageTopazRedefineAsync( - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - global::Ideogram.UpscaleImageTopazRedefineRequestUpscaleFactor? upscaleFactor = default, - string? prompt = default, - int? creativity = default, - bool? autoprompt = default, - int? texture = default, - bool? detail = default, - float? detailStrength = default, - float? sharpen = default, - float? denoise = default, - bool? faceEnhancement = default, - float? faceEnhancementStrength = default, - float? faceEnhancementCreativity = default, - global::Ideogram.UpscaleImageTopazRedefineRequestSubjectDetection? subjectDetection = default, - int? seed = default, - bool? async = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesUpscaleClient.PostUpscaleImageTopazStandardV2.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesUpscaleClient.PostUpscaleImageTopazStandardV2.g.cs deleted file mode 100644 index cde1153a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IImagesUpscaleClient.PostUpscaleImageTopazStandardV2.g.cs +++ /dev/null @@ -1,143 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IImagesUpscaleClient - { - /// - /// Upscale with Topaz Standard V2
- /// Upscale an image to 2x, 4x, or 8x its original resolution; no prompt is
- /// needed. Upload the source `image` using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostUpscaleImageTopazStandardV2Async( - - global::Ideogram.UpscaleImageTopazStandardV2Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Upscale with Topaz Standard V2
- /// Upscale an image to 2x, 4x, or 8x its original resolution; no prompt is
- /// needed. Upload the source `image` using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostUpscaleImageTopazStandardV2AsResponseAsync( - - global::Ideogram.UpscaleImageTopazStandardV2Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Upscale with Topaz Standard V2
- /// Upscale an image to 2x, 4x, or 8x its original resolution; no prompt is
- /// needed. Upload the source `image` using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - /// - /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - /// - /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
- /// Default Value: x2 - /// - /// - /// Overall intensity of the enhancement model, from 0.01 to 1. Higher values look crisper but can turn unrealistic. Omit to let the model choose per image. - /// - /// - /// Edge sharpening applied after enlarging, from 0 to 1. Omit to let the model choose per image. - /// - /// - /// Noise and grain reduction, from 0 to 1. Omit to let the model choose per image. - /// - /// - /// Compression artifact removal, from 0 to 1. Omit to let the model choose per image. - /// - /// - /// Recover detail in faces. When true, `face_enhancement_strength` and `face_enhancement_creativity` are required. - /// - /// - /// How strongly faces are recovered, from 0 to 1. - /// - /// - /// How freely face recovery may reinterpret features, from 0 (faithful) to 1 (creative). - /// - /// - /// Where enhancements apply. Omit to let the model choose per image. - /// - /// - /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostUpscaleImageTopazStandardV2Async( - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - global::Ideogram.UpscaleImageTopazStandardV2RequestUpscaleFactor? upscaleFactor = default, - float? strength = default, - float? sharpen = default, - float? denoise = default, - float? fixCompression = default, - bool? faceEnhancement = default, - float? faceEnhancementStrength = default, - float? faceEnhancementCreativity = default, - global::Ideogram.UpscaleImageTopazStandardV2RequestSubjectDetection? subjectDetection = default, - bool? async = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesUpscaleClient.PostUpscaleImageTopazTextRefine.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesUpscaleClient.PostUpscaleImageTopazTextRefine.g.cs deleted file mode 100644 index b9e34748..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IImagesUpscaleClient.PostUpscaleImageTopazTextRefine.g.cs +++ /dev/null @@ -1,148 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IImagesUpscaleClient - { - /// - /// Upscale with Topaz Text Refine
- /// Upscale an image to 2x, 4x, or 8x its original resolution; no prompt is
- /// needed. Upload the source `image` using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostUpscaleImageTopazTextRefineAsync( - - global::Ideogram.UpscaleImageTopazTextRefineRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Upscale with Topaz Text Refine
- /// Upscale an image to 2x, 4x, or 8x its original resolution; no prompt is
- /// needed. Upload the source `image` using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostUpscaleImageTopazTextRefineAsResponseAsync( - - global::Ideogram.UpscaleImageTopazTextRefineRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Upscale with Topaz Text Refine
- /// Upscale an image to 2x, 4x, or 8x its original resolution; no prompt is
- /// needed. Upload the source `image` using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - /// - /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - /// - /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
- /// Default Value: x2 - /// - /// - /// Overall intensity of the enhancement model, from 0.01 to 1. Higher values look crisper but can turn unrealistic. Omit to let the model choose per image. - /// - /// - /// Edge sharpening applied after enlarging, from 0 to 1. Omit to let the model choose per image. - /// - /// - /// Noise and grain reduction, from 0 to 1. Omit to let the model choose per image. - /// - /// - /// Compression artifact removal, from 0 to 1. Omit to let the model choose per image. - /// - /// - /// Recover detail in faces. When true, `face_enhancement_strength` and `face_enhancement_creativity` are required. - /// - /// - /// How strongly faces are recovered, from 0 to 1. - /// - /// - /// How freely face recovery may reinterpret features, from 0 (faithful) to 1 (creative). - /// - /// - /// Where enhancements apply. Omit to let the model choose per image. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostUpscaleImageTopazTextRefineAsync( - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - global::Ideogram.UpscaleImageTopazTextRefineRequestUpscaleFactor? upscaleFactor = default, - float? strength = default, - float? sharpen = default, - float? denoise = default, - float? fixCompression = default, - bool? faceEnhancement = default, - float? faceEnhancementStrength = default, - float? faceEnhancementCreativity = default, - global::Ideogram.UpscaleImageTopazTextRefineRequestSubjectDetection? subjectDetection = default, - int? seed = default, - bool? async = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IImagesUpscaleClient.PostUpscaleImageTopazWonder35.g.cs b/src/libs/Ideogram/Generated/Ideogram.IImagesUpscaleClient.PostUpscaleImageTopazWonder35.g.cs deleted file mode 100644 index 1ffbb391..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IImagesUpscaleClient.PostUpscaleImageTopazWonder35.g.cs +++ /dev/null @@ -1,124 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IImagesUpscaleClient - { - /// - /// Upscale with Topaz Wonder 3.5
- /// Upscale an image to 2x, 4x, or 8x its original resolution, with
- /// `enhancement_strength` controlling how strongly detail is reconstructed.
- /// Upload the source `image` using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostUpscaleImageTopazWonder35Async( - - global::Ideogram.UpscaleImageTopazWonder35Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Upscale with Topaz Wonder 3.5
- /// Upscale an image to 2x, 4x, or 8x its original resolution, with
- /// `enhancement_strength` controlling how strongly detail is reconstructed.
- /// Upload the source `image` using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostUpscaleImageTopazWonder35AsResponseAsync( - - global::Ideogram.UpscaleImageTopazWonder35Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Upscale with Topaz Wonder 3.5
- /// Upscale an image to 2x, 4x, or 8x its original resolution, with
- /// `enhancement_strength` controlling how strongly detail is reconstructed.
- /// Upload the source `image` using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - /// - /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - /// - /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
- /// Default Value: x2 - /// - /// - /// How strongly the generative model reconstructs detail while upscaling. Lower values stay closer to the source image; higher values produce a more enhanced result.
- /// Default Value: high - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostUpscaleImageTopazWonder35Async( - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - global::Ideogram.UpscaleImageTopazWonder35RequestUpscaleFactor? upscaleFactor = default, - global::Ideogram.UpscaleImageTopazWonder35RequestEnhancementStrength? enhancementStrength = default, - int? seed = default, - bool? async = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IIntegrationsClient.Authorizations.Bearer.g.cs b/src/libs/Ideogram/Generated/Ideogram.IIntegrationsClient.Authorizations.Bearer.g.cs deleted file mode 100644 index d330be16..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IIntegrationsClient.Authorizations.Bearer.g.cs +++ /dev/null @@ -1,16 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial interface IIntegrationsClient - { - /// - /// Authorize using bearer authentication. - /// - /// - - public void AuthorizeUsingBearer( - string apiKey); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IIntegrationsClient.GetIntegrationAssetDelivery.g.cs b/src/libs/Ideogram/Generated/Ideogram.IIntegrationsClient.GetIntegrationAssetDelivery.g.cs deleted file mode 100644 index 6271d9f5..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IIntegrationsClient.GetIntegrationAssetDelivery.g.cs +++ /dev/null @@ -1,44 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IIntegrationsClient - { - /// - /// Fetch the media bytes for an integration asset
- /// Redeems the short-lived signed delivery reference returned by an integration asset search and streams the asset's media bytes. The signed reference is the sole authorization for this endpoint; it is rejected once it expires or when the integration it names has changed. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task GetIntegrationAssetDeliveryAsync( - string externalRef, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Fetch the media bytes for an integration asset
- /// Redeems the short-lived signed delivery reference returned by an integration asset search and streams the asset's media bytes. The signed reference is the sole authorization for this endpoint; it is rejected once it expires or when the integration it names has changed. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task GetIntegrationAssetDeliveryAsStreamAsync( - string externalRef, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Fetch the media bytes for an integration asset
- /// Redeems the short-lived signed delivery reference returned by an integration asset search and streams the asset's media bytes. The signed reference is the sole authorization for this endpoint; it is rejected once it expires or when the integration it names has changed. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> GetIntegrationAssetDeliveryAsResponseAsync( - string externalRef, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IIntegrationsClient.GetIntegrations.g.cs b/src/libs/Ideogram/Generated/Ideogram.IIntegrationsClient.GetIntegrations.g.cs deleted file mode 100644 index 6f5692ff..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IIntegrationsClient.GetIntegrations.g.cs +++ /dev/null @@ -1,28 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IIntegrationsClient - { - /// - /// List enabled integration types
- /// Lists the distinct integration types enabled for the authenticated organization. The response does not expose configured integration rows, provider details, configuration, or credentials. - ///
- /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task GetIntegrationsAsync( - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// List enabled integration types
- /// Lists the distinct integration types enabled for the authenticated organization. The response does not expose configured integration rows, provider details, configuration, or credentials. - ///
- /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> GetIntegrationsAsResponseAsync( - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IIntegrationsClient.PostIntegrationAssetsSearch.g.cs b/src/libs/Ideogram/Generated/Ideogram.IIntegrationsClient.PostIntegrationAssetsSearch.g.cs deleted file mode 100644 index 0197df30..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IIntegrationsClient.PostIntegrationAssetsSearch.g.cs +++ /dev/null @@ -1,61 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IIntegrationsClient - { - /// - /// Search assets from an enabled integration type - /// - /// - /// A provider-neutral integration operation family. - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostIntegrationAssetsSearchAsync( - global::Ideogram.IntegrationType integrationType, - - global::Ideogram.IntegrationAssetSearchRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Search assets from an enabled integration type - /// - /// - /// A provider-neutral integration operation family. - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostIntegrationAssetsSearchAsResponseAsync( - global::Ideogram.IntegrationType integrationType, - - global::Ideogram.IntegrationAssetSearchRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Search assets from an enabled integration type - /// - /// - /// A provider-neutral integration operation family. - /// - /// - /// Maximum number of assets to return, bounded by the configured runtime policy. The operation returns a single bounded result; pagination is a future extension that adds optional fields additively. - /// - /// - /// Optional keyed lookup. For integrations whose upstream is a keyed catalog, this is the item key (for example a product style code); integrations without keyed lookup ignore it. Omitted means browse. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostIntegrationAssetsSearchAsync( - global::Ideogram.IntegrationType integrationType, - int limit, - string? query = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IIntegrationsClient.g.cs b/src/libs/Ideogram/Generated/Ideogram.IIntegrationsClient.g.cs deleted file mode 100644 index dcda012a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IIntegrationsClient.g.cs +++ /dev/null @@ -1,49 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Organization-scoped external asset integrations.
- /// If no httpClient is provided, a new one will be created.
- /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. - ///
- public partial interface IIntegrationsClient : global::System.IDisposable - { - /// - /// The HttpClient instance. - /// - public global::System.Net.Http.HttpClient HttpClient { get; } - - /// - /// The base URL for the API. - /// - public System.Uri? BaseUri { get; } - - /// - /// The authorizations to use for the requests. - /// - public global::System.Collections.Generic.List Authorizations { get; } - - /// - /// Gets or sets a value indicating whether the response content should be read as a string. - /// True by default in debug builds, false otherwise. - /// When false, successful responses are deserialized directly from the response stream for better performance. - /// Error responses are always read as strings regardless of this setting, - /// ensuring is populated. - /// - public bool ReadResponseAsString { get; set; } - /// - /// Client-wide request defaults such as headers, query parameters, retries, and timeout. - /// - public global::Ideogram.AutoSDKClientOptions Options { get; } - - - /// - /// - /// - global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } - - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IInternalTestingClient.Authorizations.Bearer.g.cs b/src/libs/Ideogram/Generated/Ideogram.IInternalTestingClient.Authorizations.Bearer.g.cs deleted file mode 100644 index 8a58da1a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IInternalTestingClient.Authorizations.Bearer.g.cs +++ /dev/null @@ -1,16 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial interface IInternalTestingClient - { - /// - /// Authorize using bearer authentication. - /// - /// - - public void AuthorizeUsingBearer( - string apiKey); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IInternalTestingClient.PostInternalTesting.g.cs b/src/libs/Ideogram/Generated/Ideogram.IInternalTestingClient.PostInternalTesting.g.cs deleted file mode 100644 index 87ff4295..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IInternalTestingClient.PostInternalTesting.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IInternalTestingClient - { - /// - /// Testing
- /// Just a testing endpoint - ///
- /// - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostInternalTestingAsync( - - global::Ideogram.InternalTestingRequest request, - string? xTestHeader = default, - string? xTestHeader2 = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Testing
- /// Just a testing endpoint - ///
- /// - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostInternalTestingAsResponseAsync( - - global::Ideogram.InternalTestingRequest request, - string? xTestHeader = default, - string? xTestHeader2 = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Testing
- /// Just a testing endpoint - ///
- /// - /// - /// - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostInternalTestingAsync( - global::System.DateTime requiredDateTypeField, - string? xTestHeader = default, - string? xTestHeader2 = default, - int? xPosition = default, - byte[]? imageFile = default, - string? imageFilename = default, - byte[]? anotherImageFile = default, - string? anotherImageFilename = default, - string? someText = default, - global::Ideogram.InternalTestingNestedObject? nestedObject = default, - global::Ideogram.InternalTestingNestedObjectRequiredFields? nestedObjectRequiredFields = default, - global::System.DateTime? dateTypeField = default, - global::System.DateTime? dateTimeTypeField = default, - global::System.Collections.Generic.IList? repeatedPrimitiveField = default, - global::System.Collections.Generic.IList? repeatedComplexField = default, - global::Ideogram.InternalTestingEnumField? enumTypeField = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IInternalTestingClient.g.cs b/src/libs/Ideogram/Generated/Ideogram.IInternalTestingClient.g.cs deleted file mode 100644 index 637415c9..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IInternalTestingClient.g.cs +++ /dev/null @@ -1,49 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Operations and endpoints designed for doing internal testing. Not intended to be called outside a test environment.
- /// If no httpClient is provided, a new one will be created.
- /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. - ///
- public partial interface IInternalTestingClient : global::System.IDisposable - { - /// - /// The HttpClient instance. - /// - public global::System.Net.Http.HttpClient HttpClient { get; } - - /// - /// The base URL for the API. - /// - public System.Uri? BaseUri { get; } - - /// - /// The authorizations to use for the requests. - /// - public global::System.Collections.Generic.List Authorizations { get; } - - /// - /// Gets or sets a value indicating whether the response content should be read as a string. - /// True by default in debug builds, false otherwise. - /// When false, successful responses are deserialized directly from the response stream for better performance. - /// Error responses are always read as strings regardless of this setting, - /// ensuring is populated. - /// - public bool ReadResponseAsString { get; set; } - /// - /// Client-wide request defaults such as headers, query parameters, retries, and timeout. - /// - public global::Ideogram.AutoSDKClientOptions Options { get; } - - - /// - /// - /// - global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } - - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IManageClient.AddOrganizationMembers.g.cs b/src/libs/Ideogram/Generated/Ideogram.IManageClient.AddOrganizationMembers.g.cs deleted file mode 100644 index 81a32522..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IManageClient.AddOrganizationMembers.g.cs +++ /dev/null @@ -1,52 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IManageClient - { - /// - /// Add members to a specific organization - /// - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task AddOrganizationMembersAsync( - string organizationId, - - global::Ideogram.AddOrganizationMembersRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Add members to a specific organization - /// - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> AddOrganizationMembersAsResponseAsync( - string organizationId, - - global::Ideogram.AddOrganizationMembersRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Add members to a specific organization - /// - /// - /// - /// List of organization members to add
- /// Default Value: [] - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task AddOrganizationMembersAsync( - string organizationId, - global::System.Collections.Generic.IList members, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IManageClient.Authorizations.Bearer.g.cs b/src/libs/Ideogram/Generated/Ideogram.IManageClient.Authorizations.Bearer.g.cs deleted file mode 100644 index 4fde3c92..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IManageClient.Authorizations.Bearer.g.cs +++ /dev/null @@ -1,16 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial interface IManageClient - { - /// - /// Authorize using bearer authentication. - /// - /// - - public void AuthorizeUsingBearer( - string apiKey); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IManageClient.CancelOrganizationInvite.g.cs b/src/libs/Ideogram/Generated/Ideogram.IManageClient.CancelOrganizationInvite.g.cs deleted file mode 100644 index 92f00b61..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IManageClient.CancelOrganizationInvite.g.cs +++ /dev/null @@ -1,51 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IManageClient - { - /// - /// Cancel a pending invite for an organization - /// - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task CancelOrganizationInviteAsync( - string organizationId, - - global::Ideogram.CancelOrganizationInviteRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Cancel a pending invite for an organization - /// - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> CancelOrganizationInviteAsResponseAsync( - string organizationId, - - global::Ideogram.CancelOrganizationInviteRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Cancel a pending invite for an organization - /// - /// - /// - /// Base64 URL-safe encoded ID of the invite to cancel - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task CancelOrganizationInviteAsync( - string organizationId, - string inviteId, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IManageClient.CreateApiKey.g.cs b/src/libs/Ideogram/Generated/Ideogram.IManageClient.CreateApiKey.g.cs deleted file mode 100644 index bc405e5c..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IManageClient.CreateApiKey.g.cs +++ /dev/null @@ -1,45 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IManageClient - { - /// - /// Creates an API key. - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task CreateApiKeyAsync( - - global::Ideogram.CreateApiKeyRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Creates an API key. - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> CreateApiKeyAsResponseAsync( - - global::Ideogram.CreateApiKeyRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Creates an API key. - /// - /// - /// User-supplied label shown alongside the key in the management UI. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task CreateApiKeyAsync( - string? label = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IManageClient.CreateApiKeyV2.g.cs b/src/libs/Ideogram/Generated/Ideogram.IManageClient.CreateApiKeyV2.g.cs deleted file mode 100644 index ec34ff7d..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IManageClient.CreateApiKeyV2.g.cs +++ /dev/null @@ -1,51 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IManageClient - { - /// - /// Create an API key for a specific organization - /// - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task CreateApiKeyV2Async( - string organizationId, - - global::Ideogram.CreateApiKeyRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Create an API key for a specific organization - /// - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> CreateApiKeyV2AsResponseAsync( - string organizationId, - - global::Ideogram.CreateApiKeyRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Create an API key for a specific organization - /// - /// - /// - /// User-supplied label shown alongside the key in the management UI. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task CreateApiKeyV2Async( - string organizationId, - string? label = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IManageClient.CreateApiPayment.g.cs b/src/libs/Ideogram/Generated/Ideogram.IManageClient.CreateApiPayment.g.cs deleted file mode 100644 index b5dbe37e..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IManageClient.CreateApiPayment.g.cs +++ /dev/null @@ -1,44 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IManageClient - { - /// - /// Create a payment setup session for inline card collection.
- /// Returns a client_secret for the org's payment customer so the inline payment
- /// modal can save a card without leaving the app.
- /// Soft-deprecated: the inline Elements flow was removed in the Stripe.js
- /// eager-bundle incident (2026-05-20). New clients should use the
- /// stripe_payment_setup_url field on ManageApiStripeSubscriptionResponse, which
- /// returns a hosted Stripe Checkout URL instead. This endpoint will be formally
- /// deprecated and then removed once no callers reference it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task CreateApiPaymentAsync( - string organizationId, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Create a payment setup session for inline card collection.
- /// Returns a client_secret for the org's payment customer so the inline payment
- /// modal can save a card without leaving the app.
- /// Soft-deprecated: the inline Elements flow was removed in the Stripe.js
- /// eager-bundle incident (2026-05-20). New clients should use the
- /// stripe_payment_setup_url field on ManageApiStripeSubscriptionResponse, which
- /// returns a hosted Stripe Checkout URL instead. This endpoint will be formally
- /// deprecated and then removed once no callers reference it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> CreateApiPaymentAsResponseAsync( - string organizationId, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IManageClient.DeactivateOrganizationApiKey.g.cs b/src/libs/Ideogram/Generated/Ideogram.IManageClient.DeactivateOrganizationApiKey.g.cs deleted file mode 100644 index 2085cb27..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IManageClient.DeactivateOrganizationApiKey.g.cs +++ /dev/null @@ -1,30 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IManageClient - { - /// - /// Deactivate an API key for a specific organization - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task DeactivateOrganizationApiKeyAsync( - string apiKeyId, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Deactivate an API key for a specific organization - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task DeactivateOrganizationApiKeyAsResponseAsync( - string apiKeyId, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IManageClient.DeleteSingleApiKey.g.cs b/src/libs/Ideogram/Generated/Ideogram.IManageClient.DeleteSingleApiKey.g.cs deleted file mode 100644 index 1698bfd5..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IManageClient.DeleteSingleApiKey.g.cs +++ /dev/null @@ -1,30 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IManageClient - { - /// - /// Delete an API key. - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task DeleteSingleApiKeyAsync( - string apiKeyId, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Delete an API key. - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task DeleteSingleApiKeyAsResponseAsync( - string apiKeyId, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IManageClient.DemoteOrganizationAdmins.g.cs b/src/libs/Ideogram/Generated/Ideogram.IManageClient.DemoteOrganizationAdmins.g.cs deleted file mode 100644 index 7c621705..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IManageClient.DemoteOrganizationAdmins.g.cs +++ /dev/null @@ -1,52 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IManageClient - { - /// - /// Demote admins back to member role in an ENTERPRISE_PREPAID or ENTERPRISE_API organization - /// - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task DemoteOrganizationAdminsAsync( - string organizationId, - - global::Ideogram.DemoteOrganizationAdminsRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Demote admins back to member role in an ENTERPRISE_PREPAID or ENTERPRISE_API organization - /// - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> DemoteOrganizationAdminsAsResponseAsync( - string organizationId, - - global::Ideogram.DemoteOrganizationAdminsRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Demote admins back to member role in an ENTERPRISE_PREPAID or ENTERPRISE_API organization - /// - /// - /// - /// List of admins to demote back to MEMBER role
- /// Default Value: [] - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task DemoteOrganizationAdminsAsync( - string organizationId, - global::System.Collections.Generic.IList members, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IManageClient.GetApiCreditSummary.g.cs b/src/libs/Ideogram/Generated/Ideogram.IManageClient.GetApiCreditSummary.g.cs deleted file mode 100644 index 0add9b0a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IManageClient.GetApiCreditSummary.g.cs +++ /dev/null @@ -1,36 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IManageClient - { - /// - /// Lifetime credit totals for the API user's account.
- /// Returns the lifetime credit KPIs (consumed, expired, issued) used to
- /// render the API credit dashboard strip. All values default to $0 when
- /// Metronome is unavailable so the FE can always render. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task GetApiCreditSummaryAsync( - string organizationId, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Lifetime credit totals for the API user's account.
- /// Returns the lifetime credit KPIs (consumed, expired, issued) used to
- /// render the API credit dashboard strip. All values default to $0 when
- /// Metronome is unavailable so the FE can always render. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> GetApiCreditSummaryAsResponseAsync( - string organizationId, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IManageClient.GetApiKeys.g.cs b/src/libs/Ideogram/Generated/Ideogram.IManageClient.GetApiKeys.g.cs deleted file mode 100644 index 35148b76..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IManageClient.GetApiKeys.g.cs +++ /dev/null @@ -1,26 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IManageClient - { - /// - /// Retrieve current API keys and their respective data. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task GetApiKeysAsync( - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Retrieve current API keys and their respective data. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> GetApiKeysAsResponseAsync( - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IManageClient.GetApiKeysV2.g.cs b/src/libs/Ideogram/Generated/Ideogram.IManageClient.GetApiKeysV2.g.cs deleted file mode 100644 index a89ec327..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IManageClient.GetApiKeysV2.g.cs +++ /dev/null @@ -1,30 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IManageClient - { - /// - /// Retrieve API keys for a specific organization - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task GetApiKeysV2Async( - string organizationId, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Retrieve API keys for a specific organization - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> GetApiKeysV2AsResponseAsync( - string organizationId, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IManageClient.GetApiOrganizationUserSuggestions.g.cs b/src/libs/Ideogram/Generated/Ideogram.IManageClient.GetApiOrganizationUserSuggestions.g.cs deleted file mode 100644 index eb5a020a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IManageClient.GetApiOrganizationUserSuggestions.g.cs +++ /dev/null @@ -1,42 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IManageClient - { - /// - /// Get search results for user handles with suggestions for a particular organization. - /// - /// - /// - /// - /// Default Value: 3 - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task GetApiOrganizationUserSuggestionsAsync( - string organizationId, - string? userHandlePrefix = default, - int? maxItems = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Get search results for user handles with suggestions for a particular organization. - /// - /// - /// - /// - /// Default Value: 3 - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> GetApiOrganizationUserSuggestionsAsResponseAsync( - string organizationId, - string? userHandlePrefix = default, - int? maxItems = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IManageClient.GetApiProfiles.g.cs b/src/libs/Ideogram/Generated/Ideogram.IManageClient.GetApiProfiles.g.cs deleted file mode 100644 index e1ccade4..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IManageClient.GetApiProfiles.g.cs +++ /dev/null @@ -1,26 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IManageClient - { - /// - /// Retrieve the user's current API profiles - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task GetApiProfilesAsync( - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Retrieve the user's current API profiles - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> GetApiProfilesAsResponseAsync( - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IManageClient.GetApiStripeSubscription.g.cs b/src/libs/Ideogram/Generated/Ideogram.IManageClient.GetApiStripeSubscription.g.cs deleted file mode 100644 index ed33015a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IManageClient.GetApiStripeSubscription.g.cs +++ /dev/null @@ -1,34 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IManageClient - { - /// - /// Retrieve data relevant to connecting to Stripe. - /// - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task GetApiStripeSubscriptionAsync( - string organizationId, - bool? isBusiness = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Retrieve data relevant to connecting to Stripe. - /// - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> GetApiStripeSubscriptionAsResponseAsync( - string organizationId, - bool? isBusiness = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IManageClient.GetApiSubscription.g.cs b/src/libs/Ideogram/Generated/Ideogram.IManageClient.GetApiSubscription.g.cs deleted file mode 100644 index 6d243e09..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IManageClient.GetApiSubscription.g.cs +++ /dev/null @@ -1,30 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IManageClient - { - /// - /// Retrieve data relevant to creating an API subscription. - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task GetApiSubscriptionAsync( - string organizationId, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Retrieve data relevant to creating an API subscription. - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> GetApiSubscriptionAsResponseAsync( - string organizationId, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IManageClient.GetApiTerms.g.cs b/src/libs/Ideogram/Generated/Ideogram.IManageClient.GetApiTerms.g.cs deleted file mode 100644 index 308fa93a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IManageClient.GetApiTerms.g.cs +++ /dev/null @@ -1,26 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IManageClient - { - /// - /// Retrieve the latest terms of service for API usage. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task GetApiTermsAsync( - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Retrieve the latest terms of service for API usage. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> GetApiTermsAsResponseAsync( - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IManageClient.GetOrganizationBillingPortal.g.cs b/src/libs/Ideogram/Generated/Ideogram.IManageClient.GetOrganizationBillingPortal.g.cs deleted file mode 100644 index 6a684340..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IManageClient.GetOrganizationBillingPortal.g.cs +++ /dev/null @@ -1,30 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IManageClient - { - /// - /// Retrieve the Stripe billing portal URL for a specific organization - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task GetOrganizationBillingPortalAsync( - string organizationId, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Retrieve the Stripe billing portal URL for a specific organization - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> GetOrganizationBillingPortalAsResponseAsync( - string organizationId, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IManageClient.GetOrganizationMembers.g.cs b/src/libs/Ideogram/Generated/Ideogram.IManageClient.GetOrganizationMembers.g.cs deleted file mode 100644 index 84543030..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IManageClient.GetOrganizationMembers.g.cs +++ /dev/null @@ -1,32 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IManageClient - { - /// - /// Retrieve members of a specific organization
- /// Returns both active members and pending invites for the organization. A pending invite is identified by a non-null invite_status (e.g. PENDING); active members have a null invite_status. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task GetOrganizationMembersAsync( - string organizationId, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Retrieve members of a specific organization
- /// Returns both active members and pending invites for the organization. A pending invite is identified by a non-null invite_status (e.g. PENDING); active members have a null invite_status. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> GetOrganizationMembersAsResponseAsync( - string organizationId, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IManageClient.GetUsageInfo.g.cs b/src/libs/Ideogram/Generated/Ideogram.IManageClient.GetUsageInfo.g.cs deleted file mode 100644 index f48323b9..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IManageClient.GetUsageInfo.g.cs +++ /dev/null @@ -1,90 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IManageClient - { - /// - /// Retrieve usage information segmented by time period with tool-specific breakdowns - /// - /// - /// - /// Time segment granularity for usage breakdown
- /// Example: DAY - /// - /// - /// - /// - /// Default Value: [] - /// - /// - /// Default Value: [] - /// - /// - /// Default Value: [] - /// - /// - /// Default Value: [] - /// - /// - /// Filter usage by source - API for programmatic API usage, APP for web application usage
- /// Default Value: API - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task GetUsageInfoAsync( - string organizationId, - global::Ideogram.SegmentBy segmentBy, - global::System.DateTime startTime, - global::System.DateTime? endTime = default, - global::System.Collections.Generic.IList? modelVersions = default, - global::System.Collections.Generic.IList? tools = default, - global::System.Collections.Generic.IList? apiKeyIds = default, - global::System.Collections.Generic.IList? userEmails = default, - global::Ideogram.UsageSource? source = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Retrieve usage information segmented by time period with tool-specific breakdowns - /// - /// - /// - /// Time segment granularity for usage breakdown
- /// Example: DAY - /// - /// - /// - /// - /// Default Value: [] - /// - /// - /// Default Value: [] - /// - /// - /// Default Value: [] - /// - /// - /// Default Value: [] - /// - /// - /// Filter usage by source - API for programmatic API usage, APP for web application usage
- /// Default Value: API - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> GetUsageInfoAsResponseAsync( - string organizationId, - global::Ideogram.SegmentBy segmentBy, - global::System.DateTime startTime, - global::System.DateTime? endTime = default, - global::System.Collections.Generic.IList? modelVersions = default, - global::System.Collections.Generic.IList? tools = default, - global::System.Collections.Generic.IList? apiKeyIds = default, - global::System.Collections.Generic.IList? userEmails = default, - global::Ideogram.UsageSource? source = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IManageClient.GetUserCredits.g.cs b/src/libs/Ideogram/Generated/Ideogram.IManageClient.GetUserCredits.g.cs deleted file mode 100644 index e0c31782..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IManageClient.GetUserCredits.g.cs +++ /dev/null @@ -1,38 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IManageClient - { - /// - /// Retrieve user credit information and spending metrics - /// - /// - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task GetUserCreditsAsync( - string organizationId, - global::System.DateTime startTime, - global::System.DateTime? endTime = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Retrieve user credit information and spending metrics - /// - /// - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> GetUserCreditsAsResponseAsync( - string organizationId, - global::System.DateTime startTime, - global::System.DateTime? endTime = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IManageClient.GetUserSpendCommitInfo.g.cs b/src/libs/Ideogram/Generated/Ideogram.IManageClient.GetUserSpendCommitInfo.g.cs deleted file mode 100644 index e50a712a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IManageClient.GetUserSpendCommitInfo.g.cs +++ /dev/null @@ -1,34 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IManageClient - { - /// - /// Retrieve user spend commit information - /// - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task GetUserSpendCommitInfoAsync( - string organizationId, - bool? postpaidOnly = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Retrieve user spend commit information - /// - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> GetUserSpendCommitInfoAsResponseAsync( - string organizationId, - bool? postpaidOnly = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IManageClient.ListOrganizationInvoices.g.cs b/src/libs/Ideogram/Generated/Ideogram.IManageClient.ListOrganizationInvoices.g.cs deleted file mode 100644 index 2c8b0380..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IManageClient.ListOrganizationInvoices.g.cs +++ /dev/null @@ -1,30 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IManageClient - { - /// - /// Retrieve invoices for a specific organization - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task ListOrganizationInvoicesAsync( - string organizationId, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Retrieve invoices for a specific organization - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> ListOrganizationInvoicesAsResponseAsync( - string organizationId, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IManageClient.PostAddCreditsForApi.g.cs b/src/libs/Ideogram/Generated/Ideogram.IManageClient.PostAddCreditsForApi.g.cs deleted file mode 100644 index f54aaddb..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IManageClient.PostAddCreditsForApi.g.cs +++ /dev/null @@ -1,52 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IManageClient - { - /// - /// Add credits to an API user's account. - /// - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostAddCreditsForApiAsync( - string organizationId, - - global::Ideogram.PostAddCreditsRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Add credits to an API user's account. - /// - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostAddCreditsForApiAsResponseAsync( - string organizationId, - - global::Ideogram.PostAddCreditsRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Add credits to an API user's account. - /// - /// - /// - /// Represents a price.
- /// Example: {"amount":1050,"currency_code":"USD"} - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostAddCreditsForApiAsync( - string organizationId, - global::Ideogram.Price amount, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IManageClient.PostApiSubscription.g.cs b/src/libs/Ideogram/Generated/Ideogram.IManageClient.PostApiSubscription.g.cs deleted file mode 100644 index 705c1dcb..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IManageClient.PostApiSubscription.g.cs +++ /dev/null @@ -1,56 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IManageClient - { - /// - /// Update API subscription settings - /// - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostApiSubscriptionAsync( - string organizationId, - - global::Ideogram.PostApiSubscriptionRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Update API subscription settings - /// - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostApiSubscriptionAsResponseAsync( - string organizationId, - - global::Ideogram.PostApiSubscriptionRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Update API subscription settings - /// - /// - /// - /// The current recharge settings for the API subscription.
- /// Example: {"minimum_balance_threshold":{"amount":1050,"currency_code":"USD"},"top_up_balance":{"amount":1050,"currency_code":"USD"}} - /// - /// - /// Whether to enable or disable auto recharge. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostApiSubscriptionAsync( - string organizationId, - global::Ideogram.RechargeSettings? rechargeSettings = default, - bool? isActive = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IManageClient.PostApiTerms.g.cs b/src/libs/Ideogram/Generated/Ideogram.IManageClient.PostApiTerms.g.cs deleted file mode 100644 index 4c1a83b1..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IManageClient.PostApiTerms.g.cs +++ /dev/null @@ -1,46 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IManageClient - { - /// - /// Accept terms - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostApiTermsAsync( - - global::Ideogram.PostApiTermsRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Accept terms - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostApiTermsAsResponseAsync( - - global::Ideogram.PostApiTermsRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Accept terms - /// - /// - /// The ID of the terms which are being accepted.
- /// Example: TOS_2024_04_20 - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostApiTermsAsync( - string termsId, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IManageClient.PromoteOrganizationAdmins.g.cs b/src/libs/Ideogram/Generated/Ideogram.IManageClient.PromoteOrganizationAdmins.g.cs deleted file mode 100644 index 9d3a3a92..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IManageClient.PromoteOrganizationAdmins.g.cs +++ /dev/null @@ -1,52 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IManageClient - { - /// - /// Promote members to ADMIN role in an ENTERPRISE_PREPAID or ENTERPRISE_API organization - /// - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PromoteOrganizationAdminsAsync( - string organizationId, - - global::Ideogram.PromoteOrganizationAdminsRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Promote members to ADMIN role in an ENTERPRISE_PREPAID or ENTERPRISE_API organization - /// - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PromoteOrganizationAdminsAsResponseAsync( - string organizationId, - - global::Ideogram.PromoteOrganizationAdminsRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Promote members to ADMIN role in an ENTERPRISE_PREPAID or ENTERPRISE_API organization - /// - /// - /// - /// List of organization members to promote to ADMIN role
- /// Default Value: [] - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PromoteOrganizationAdminsAsync( - string organizationId, - global::System.Collections.Generic.IList members, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IManageClient.RemoveOrganizationMembers.g.cs b/src/libs/Ideogram/Generated/Ideogram.IManageClient.RemoveOrganizationMembers.g.cs deleted file mode 100644 index 795a7a20..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IManageClient.RemoveOrganizationMembers.g.cs +++ /dev/null @@ -1,52 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IManageClient - { - /// - /// Remove members from a specific organization - /// - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task RemoveOrganizationMembersAsync( - string organizationId, - - global::Ideogram.RemoveOrganizationMembersRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Remove members from a specific organization - /// - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> RemoveOrganizationMembersAsResponseAsync( - string organizationId, - - global::Ideogram.RemoveOrganizationMembersRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Remove members from a specific organization - /// - /// - /// - /// List of organization members to remove
- /// Default Value: [] - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task RemoveOrganizationMembersAsync( - string organizationId, - global::System.Collections.Generic.IList members, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IManageClient.ResendOrganizationInvite.g.cs b/src/libs/Ideogram/Generated/Ideogram.IManageClient.ResendOrganizationInvite.g.cs deleted file mode 100644 index 9fad5275..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IManageClient.ResendOrganizationInvite.g.cs +++ /dev/null @@ -1,51 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IManageClient - { - /// - /// Resend a pending invite for an organization - /// - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task ResendOrganizationInviteAsync( - string organizationId, - - global::Ideogram.ResendOrganizationInviteRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Resend a pending invite for an organization - /// - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> ResendOrganizationInviteAsResponseAsync( - string organizationId, - - global::Ideogram.ResendOrganizationInviteRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Resend a pending invite for an organization - /// - /// - /// - /// Base64 URL-safe encoded ID of the invite to resend - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task ResendOrganizationInviteAsync( - string organizationId, - string inviteId, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IManageClient.UpdateOrganizationApiProperties.g.cs b/src/libs/Ideogram/Generated/Ideogram.IManageClient.UpdateOrganizationApiProperties.g.cs deleted file mode 100644 index 5e8cda6d..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IManageClient.UpdateOrganizationApiProperties.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IManageClient - { - /// - /// Update a single field on an organization's API properties.
- /// Lets an organization owner toggle API-only settings such as
- /// copyright_detection_enabled. Updates only the fields explicitly present
- /// in the request body; absent fields are left unchanged. - ///
- /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task UpdateOrganizationApiPropertiesAsync( - string organizationId, - - global::Ideogram.UpdateOrganizationApiPropertiesRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Update a single field on an organization's API properties.
- /// Lets an organization owner toggle API-only settings such as
- /// copyright_detection_enabled. Updates only the fields explicitly present
- /// in the request body; absent fields are left unchanged. - ///
- /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> UpdateOrganizationApiPropertiesAsResponseAsync( - string organizationId, - - global::Ideogram.UpdateOrganizationApiPropertiesRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Update a single field on an organization's API properties.
- /// Lets an organization owner toggle API-only settings such as
- /// copyright_detection_enabled. Updates only the fields explicitly present
- /// in the request body; absent fields are left unchanged. - ///
- /// - /// - /// Toggle post-generation Hive likeness + logo detection for this organization. See ApiProfile.copyright_detection_enabled for behavior. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task UpdateOrganizationApiPropertiesAsync( - string organizationId, - bool? copyrightDetectionEnabled = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IManageClient.UpdateSingleApiKey.g.cs b/src/libs/Ideogram/Generated/Ideogram.IManageClient.UpdateSingleApiKey.g.cs deleted file mode 100644 index f7d90225..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IManageClient.UpdateSingleApiKey.g.cs +++ /dev/null @@ -1,52 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IManageClient - { - /// - /// Update an API key's user-supplied label. - /// - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task UpdateSingleApiKeyAsync( - string apiKeyId, - - global::Ideogram.PatchApiKeyRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Update an API key's user-supplied label. - /// - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> UpdateSingleApiKeyAsResponseAsync( - string apiKeyId, - - global::Ideogram.PatchApiKeyRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Update an API key's user-supplied label. - /// - /// - /// - /// New label for the API key. Pass null (or omit) to clear the existing label.
- /// Example: Live production environment - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task UpdateSingleApiKeyAsync( - string apiKeyId, - string? label = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IManageClient.g.cs b/src/libs/Ideogram/Generated/Ideogram.IManageClient.g.cs deleted file mode 100644 index 09f5bfb6..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IManageClient.g.cs +++ /dev/null @@ -1,49 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Content related to managing API account and API access
- /// If no httpClient is provided, a new one will be created.
- /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. - ///
- public partial interface IManageClient : global::System.IDisposable - { - /// - /// The HttpClient instance. - /// - public global::System.Net.Http.HttpClient HttpClient { get; } - - /// - /// The base URL for the API. - /// - public System.Uri? BaseUri { get; } - - /// - /// The authorizations to use for the requests. - /// - public global::System.Collections.Generic.List Authorizations { get; } - - /// - /// Gets or sets a value indicating whether the response content should be read as a string. - /// True by default in debug builds, false otherwise. - /// When false, successful responses are deserialized directly from the response stream for better performance. - /// Error responses are always read as strings regardless of this setting, - /// ensuring is populated. - /// - public bool ReadResponseAsString { get; set; } - /// - /// Client-wide request defaults such as headers, query parameters, retries, and timeout. - /// - public global::Ideogram.AutoSDKClientOptions Options { get; } - - - /// - /// - /// - global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } - - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IMiniAppsClient.Authorizations.Bearer.g.cs b/src/libs/Ideogram/Generated/Ideogram.IMiniAppsClient.Authorizations.Bearer.g.cs deleted file mode 100644 index f0713253..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IMiniAppsClient.Authorizations.Bearer.g.cs +++ /dev/null @@ -1,16 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial interface IMiniAppsClient - { - /// - /// Authorize using bearer authentication. - /// - /// - - public void AuthorizeUsingBearer( - string apiKey); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IMiniAppsClient.GetMiniAppMarketingProjection.g.cs b/src/libs/Ideogram/Generated/Ideogram.IMiniAppsClient.GetMiniAppMarketingProjection.g.cs deleted file mode 100644 index a7a99ff9..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IMiniAppsClient.GetMiniAppMarketingProjection.g.cs +++ /dev/null @@ -1,28 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IMiniAppsClient - { - /// - /// Get the public mini-app marketing projection
- /// Returns the public-safe mini-app metadata used to build marketing pages. The response includes only active marketing entries that have website metadata and can be published unchanged as the marketing registry. - ///
- /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> GetMiniAppMarketingProjectionAsync( - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Get the public mini-app marketing projection
- /// Returns the public-safe mini-app metadata used to build marketing pages. The response includes only active marketing entries that have website metadata and can be published unchanged as the marketing registry. - ///
- /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task>> GetMiniAppMarketingProjectionAsResponseAsync( - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IMiniAppsClient.GetStalePreviewMiniApps.g.cs b/src/libs/Ideogram/Generated/Ideogram.IMiniAppsClient.GetStalePreviewMiniApps.g.cs deleted file mode 100644 index 48048efb..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IMiniAppsClient.GetStalePreviewMiniApps.g.cs +++ /dev/null @@ -1,32 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IMiniAppsClient - { - /// - /// Get stale mini-app preview entries
- /// Returns preview ids whose most recent successful publish is older than the cutoff. This read-only endpoint does not delete preview entries. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task GetStalePreviewMiniAppsAsync( - global::System.DateTime cutoff, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Get stale mini-app preview entries
- /// Returns preview ids whose most recent successful publish is older than the cutoff. This read-only endpoint does not delete preview entries. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> GetStalePreviewMiniAppsAsResponseAsync( - global::System.DateTime cutoff, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IMiniAppsClient.PublishMiniApp.g.cs b/src/libs/Ideogram/Generated/Ideogram.IMiniAppsClient.PublishMiniApp.g.cs deleted file mode 100644 index c4ce5151..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IMiniAppsClient.PublishMiniApp.g.cs +++ /dev/null @@ -1,84 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IMiniAppsClient - { - /// - /// Publish a mini-app catalog entry
- /// Publishes a mini-app's catalog entry. Called by the mini-apps deploy pipeline after a deploy to register or refresh a single app, keyed by its unique slug. Re-publishing an existing app refreshes the deploy-managed fields (label, description, embed mode, scopes, image-input support, deployment details, and website) while leaving administrator-managed settings and artwork untouched. Artwork from the request is used only when creating a new app. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PublishMiniAppAsync( - - global::Ideogram.PublishMiniAppRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Publish a mini-app catalog entry
- /// Publishes a mini-app's catalog entry. Called by the mini-apps deploy pipeline after a deploy to register or refresh a single app, keyed by its unique slug. Re-publishing an existing app refreshes the deploy-managed fields (label, description, embed mode, scopes, image-input support, deployment details, and website) while leaving administrator-managed settings and artwork untouched. Artwork from the request is used only when creating a new app. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PublishMiniAppAsResponseAsync( - - global::Ideogram.PublishMiniAppRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Publish a mini-app catalog entry
- /// Publishes a mini-app's catalog entry. Called by the mini-apps deploy pipeline after a deploy to register or refresh a single app, keyed by its unique slug. Re-publishing an existing app refreshes the deploy-managed fields (label, description, embed mode, scopes, image-input support, deployment details, and website) while leaving administrator-managed settings and artwork untouched. Artwork from the request is used only when creating a new app. - ///
- /// - /// Unique, stable, URL-safe mini-app identifier. - /// - /// - /// Human-readable display name shown in the catalog. - /// - /// - /// Short description of what the mini-app does. - /// - /// - /// How the mini-app is embedded. `iframe` loads the app in a sandboxed frame. - /// - /// - /// Permission scopes the mini-app requests. - /// - /// - /// Optional on publish. Whether the app can receive an existing image as its initial input. Omit this field to preserve the current value when re-publishing an existing app; new apps default to false. Catalog responses always include the resolved boolean. - /// - /// - /// Absolute HTTPS URL where the deployed mini-app is served from. - /// - /// - /// Source commit hash of the deployed build. - /// - /// - /// When the deployment that produced this build completed. - /// - /// - /// Structured website metadata for the mini-app. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PublishMiniAppAsync( - string slug, - string label, - global::System.Collections.Generic.IList scopes, - string? description = default, - global::Ideogram.PublishMiniAppRequestEmbed embed = default, - bool? acceptsImageInput = default, - string? deploymentUrl = default, - string? deploymentCommit = default, - global::System.DateTime? deploymentTime = default, - object? website = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IMiniAppsClient.PublishPreviewMiniApp.g.cs b/src/libs/Ideogram/Generated/Ideogram.IMiniAppsClient.PublishPreviewMiniApp.g.cs deleted file mode 100644 index d6b97b84..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IMiniAppsClient.PublishPreviewMiniApp.g.cs +++ /dev/null @@ -1,88 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IMiniAppsClient - { - /// - /// Publish a mini-app preview entry
- /// Publishes a mini-app preview entry. Called by the mini-apps preview deploy pipeline to register a throwaway preview deploy, keyed by its unique preview id. Re-publishing an existing preview id refreshes every deploy-managed field. Preview entries are independent from the main catalog: they carry no slug, owner, or membership gating, and anyone with the preview link can access the app. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PublishPreviewMiniAppAsync( - - global::Ideogram.PublishMiniAppPreviewRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Publish a mini-app preview entry
- /// Publishes a mini-app preview entry. Called by the mini-apps preview deploy pipeline to register a throwaway preview deploy, keyed by its unique preview id. Re-publishing an existing preview id refreshes every deploy-managed field. Preview entries are independent from the main catalog: they carry no slug, owner, or membership gating, and anyone with the preview link can access the app. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PublishPreviewMiniAppAsResponseAsync( - - global::Ideogram.PublishMiniAppPreviewRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Publish a mini-app preview entry
- /// Publishes a mini-app preview entry. Called by the mini-apps preview deploy pipeline to register a throwaway preview deploy, keyed by its unique preview id. Re-publishing an existing preview id refreshes every deploy-managed field. Preview entries are independent from the main catalog: they carry no slug, owner, or membership gating, and anyone with the preview link can access the app. - ///
- /// - /// Unique, URL-safe preview identifier composed by the deploy pipeline. - /// - /// - /// Unique, stable, URL-safe mini-app identifier. - /// - /// - /// Human-readable display name shown for the preview. - /// - /// - /// Short description of what the mini-app does. - /// - /// - /// How the mini-app is embedded. `iframe` loads the app in a sandboxed frame. - /// - /// - /// Permission scopes the mini-app preview requests. - /// - /// - /// Optional on publish. Whether the app can receive an existing image as its initial input. Omit this field to preserve the current value when re-publishing an existing preview; new previews default to false. - /// - /// - /// URL where the preview mini-app is served. Must be an `https://*.run.app` Cloud Run URL. - /// - /// - /// Source commit hash of the deployed build. - /// - /// - /// When the deployment that produced this build completed. - /// - /// - /// Structured website metadata for the mini-app. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PublishPreviewMiniAppAsync( - string previewId, - string label, - global::System.Collections.Generic.IList scopes, - string deploymentUrl, - string? slug = default, - string? description = default, - global::Ideogram.PublishMiniAppPreviewRequestEmbed embed = default, - bool? acceptsImageInput = default, - string? deploymentCommit = default, - global::System.DateTime? deploymentTime = default, - object? website = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IMiniAppsClient.UnpublishMiniApp.g.cs b/src/libs/Ideogram/Generated/Ideogram.IMiniAppsClient.UnpublishMiniApp.g.cs deleted file mode 100644 index 7ba6a169..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IMiniAppsClient.UnpublishMiniApp.g.cs +++ /dev/null @@ -1,36 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IMiniAppsClient - { - /// - /// Unpublish a mini-app catalog entry
- /// Archives a mini-app by slug while preserving its deployment details and administrator-managed settings. Publishing the same slug again does not reactivate it; only an administrator can restore an archived app. - ///
- /// - /// Unique, stable, URL-safe mini-app identifier. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task UnpublishMiniAppAsync( - string slug, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Unpublish a mini-app catalog entry
- /// Archives a mini-app by slug while preserving its deployment details and administrator-managed settings. Publishing the same slug again does not reactivate it; only an administrator can restore an archived app. - ///
- /// - /// Unique, stable, URL-safe mini-app identifier. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task UnpublishMiniAppAsResponseAsync( - string slug, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IMiniAppsClient.UnpublishPreviewMiniApp.g.cs b/src/libs/Ideogram/Generated/Ideogram.IMiniAppsClient.UnpublishPreviewMiniApp.g.cs deleted file mode 100644 index c0cbcf78..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IMiniAppsClient.UnpublishPreviewMiniApp.g.cs +++ /dev/null @@ -1,36 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IMiniAppsClient - { - /// - /// Unpublish a mini-app preview entry
- /// Deletes a mini-app preview entry by its preview id. Repeated requests succeed when the entry is already absent, so preview teardown can retry safely. - ///
- /// - /// Unique, URL-safe preview identifier composed by the deploy pipeline. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task UnpublishPreviewMiniAppAsync( - string previewId, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Unpublish a mini-app preview entry
- /// Deletes a mini-app preview entry by its preview id. Repeated requests succeed when the entry is already absent, so preview teardown can retry safely. - ///
- /// - /// Unique, URL-safe preview identifier composed by the deploy pipeline. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> UnpublishPreviewMiniAppAsResponseAsync( - string previewId, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IMiniAppsClient.g.cs b/src/libs/Ideogram/Generated/Ideogram.IMiniAppsClient.g.cs deleted file mode 100644 index ede805e8..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IMiniAppsClient.g.cs +++ /dev/null @@ -1,49 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Operations related to publishing mini-apps into the catalog.
- /// If no httpClient is provided, a new one will be created.
- /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. - ///
- public partial interface IMiniAppsClient : global::System.IDisposable - { - /// - /// The HttpClient instance. - /// - public global::System.Net.Http.HttpClient HttpClient { get; } - - /// - /// The base URL for the API. - /// - public System.Uri? BaseUri { get; } - - /// - /// The authorizations to use for the requests. - /// - public global::System.Collections.Generic.List Authorizations { get; } - - /// - /// Gets or sets a value indicating whether the response content should be read as a string. - /// True by default in debug builds, false otherwise. - /// When false, successful responses are deserialized directly from the response stream for better performance. - /// Error responses are always read as strings regardless of this setting, - /// ensuring is populated. - /// - public bool ReadResponseAsString { get; set; } - /// - /// Client-wide request defaults such as headers, query parameters, retries, and timeout. - /// - public global::Ideogram.AutoSDKClientOptions Options { get; } - - - /// - /// - /// - global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } - - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IModelsClient.Authorizations.Bearer.g.cs b/src/libs/Ideogram/Generated/Ideogram.IModelsClient.Authorizations.Bearer.g.cs deleted file mode 100644 index bf6b9269..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IModelsClient.Authorizations.Bearer.g.cs +++ /dev/null @@ -1,16 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial interface IModelsClient - { - /// - /// Authorize using bearer authentication. - /// - /// - - public void AuthorizeUsingBearer( - string apiKey); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IModelsClient.GetCustomModel.g.cs b/src/libs/Ideogram/Generated/Ideogram.IModelsClient.GetCustomModel.g.cs deleted file mode 100644 index bb16532a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IModelsClient.GetCustomModel.g.cs +++ /dev/null @@ -1,32 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IModelsClient - { - /// - /// Get model details
- /// Get detailed information about a specific custom model. The user must either own the model or the model must be shared with the user's organization via the model registry. Returns 404 if the model is not found or not accessible. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task GetCustomModelAsync( - string modelId, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Get model details
- /// Get detailed information about a specific custom model. The user must either own the model or the model must be shared with the user's organization via the model registry. Returns 404 if the model is not found or not accessible. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> GetCustomModelAsResponseAsync( - string modelId, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IModelsClient.ListCustomModels.g.cs b/src/libs/Ideogram/Generated/Ideogram.IModelsClient.ListCustomModels.g.cs deleted file mode 100644 index 8afc917f..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IModelsClient.ListCustomModels.g.cs +++ /dev/null @@ -1,36 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IModelsClient - { - /// - /// List models
- /// Lists custom models for the authenticated user. Use the `scope` parameter to control which models are returned. If omitted, returns both owned models and models shared with the user's organization via the model registry. `owned` returns only models created by the user. `shared` returns only models shared via the model registry, excluding the user's own models. - ///
- /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task ListCustomModelsAsync( - global::Ideogram.ListCustomModelsScope? scope = default, - global::System.Collections.Generic.IList? status = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// List models
- /// Lists custom models for the authenticated user. Use the `scope` parameter to control which models are returned. If omitted, returns both owned models and models shared with the user's organization via the model registry. `owned` returns only models created by the user. `shared` returns only models shared via the model registry, excluding the user's own models. - ///
- /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> ListCustomModelsAsResponseAsync( - global::Ideogram.ListCustomModelsScope? scope = default, - global::System.Collections.Generic.IList? status = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IModelsClient.TrainModelV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.IModelsClient.TrainModelV3.g.cs deleted file mode 100644 index 1e4dec75..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IModelsClient.TrainModelV3.g.cs +++ /dev/null @@ -1,54 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IModelsClient - { - /// - /// Train a custom Ideogram v3 model
- /// Start training a custom Ideogram v3 model from a dataset using default hyperparameters. The dataset must contain at least 15 images and a maximum of 100 images. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task TrainModelV3Async( - - global::Ideogram.TrainModelV3Request request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Train a custom Ideogram v3 model
- /// Start training a custom Ideogram v3 model from a dataset using default hyperparameters. The dataset must contain at least 15 images and a maximum of 100 images. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> TrainModelV3AsResponseAsync( - - global::Ideogram.TrainModelV3Request request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Train a custom Ideogram v3 model
- /// Start training a custom Ideogram v3 model from a dataset using default hyperparameters. The dataset must contain at least 15 images and a maximum of 100 images. - ///
- /// - /// ID of the dataset to train the model from.
- /// Example: abc123 - /// - /// - /// Name for the trained model. Must be 5-30 characters, alphanumeric with spaces and hyphens allowed.
- /// Example: my-custom-model - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task TrainModelV3Async( - string datasetId, - string modelName, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IModelsClient.TrainModelV3Advanced.g.cs b/src/libs/Ideogram/Generated/Ideogram.IModelsClient.TrainModelV3Advanced.g.cs deleted file mode 100644 index 2ff5014b..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IModelsClient.TrainModelV3Advanced.g.cs +++ /dev/null @@ -1,74 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IModelsClient - { - /// - /// Train a custom Ideogram v3 model with advanced hyperparameters
- /// Start training a custom Ideogram v3 model from a dataset with caller-supplied hyperparameters (training steps, LoRA rank, EMA decay, learning rate). All hyperparameters are optional and fall back to defaults when omitted. The dataset must contain at least 15 images and a maximum of 100 images. Returns the model ID and training status. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task TrainModelV3AdvancedAsync( - - global::Ideogram.TrainModelV3AdvancedRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Train a custom Ideogram v3 model with advanced hyperparameters
- /// Start training a custom Ideogram v3 model from a dataset with caller-supplied hyperparameters (training steps, LoRA rank, EMA decay, learning rate). All hyperparameters are optional and fall back to defaults when omitted. The dataset must contain at least 15 images and a maximum of 100 images. Returns the model ID and training status. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> TrainModelV3AdvancedAsResponseAsync( - - global::Ideogram.TrainModelV3AdvancedRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Train a custom Ideogram v3 model with advanced hyperparameters
- /// Start training a custom Ideogram v3 model from a dataset with caller-supplied hyperparameters (training steps, LoRA rank, EMA decay, learning rate). All hyperparameters are optional and fall back to defaults when omitted. The dataset must contain at least 15 images and a maximum of 100 images. Returns the model ID and training status. - ///
- /// - /// ID of the dataset to train the model from.
- /// Example: abc123 - /// - /// - /// Name for the trained model. Must be 5-30 characters, alphanumeric with spaces and hyphens allowed.
- /// Example: my-custom-model - /// - /// - /// Number of training steps. Must be between 100 and 10000 and a multiple of 100. Defaults to 1000.
- /// Example: 1000 - /// - /// - /// LoRA rank for model training. Must be one of 64 or 128. Defaults to 128. Higher rank increases model capacity at the cost of longer training and larger weights.
- /// Example: 64 - /// - /// - /// Exponential moving average decay rate for the model weights. Must be between 0 and 1 (exclusive). Typical values are 0.99-0.9999; higher values produce smoother weight averages but respond more slowly to training updates.
- /// Example: 0.999F - /// - /// - /// Learning rate for the optimizer. Must be greater than 0. Typical values for LoRA fine-tuning are 1e-5 to 1e-4; larger values train faster but risk instability.
- /// Example: 0.0001F - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task TrainModelV3AdvancedAsync( - string datasetId, - string modelName, - int? trainingSteps = default, - int? loraRank = default, - double? ema = default, - double? learningRate = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IModelsClient.TrainModelV4.g.cs b/src/libs/Ideogram/Generated/Ideogram.IModelsClient.TrainModelV4.g.cs deleted file mode 100644 index 53220e77..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IModelsClient.TrainModelV4.g.cs +++ /dev/null @@ -1,54 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IModelsClient - { - /// - /// Train a custom Ideogram v4 model
- /// Start training a custom Ideogram v4 model from a dataset using default hyperparameters. The dataset must contain at least 15 images and a maximum of 100 images. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task TrainModelV4Async( - - global::Ideogram.TrainModelV4Request request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Train a custom Ideogram v4 model
- /// Start training a custom Ideogram v4 model from a dataset using default hyperparameters. The dataset must contain at least 15 images and a maximum of 100 images. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> TrainModelV4AsResponseAsync( - - global::Ideogram.TrainModelV4Request request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Train a custom Ideogram v4 model
- /// Start training a custom Ideogram v4 model from a dataset using default hyperparameters. The dataset must contain at least 15 images and a maximum of 100 images. - ///
- /// - /// ID of the dataset to train the model from.
- /// Example: abc123 - /// - /// - /// Name for the trained model. Must be 5-30 characters, alphanumeric with spaces and hyphens allowed.
- /// Example: my-custom-model - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task TrainModelV4Async( - string datasetId, - string modelName, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IModelsClient.TrainModelV4Advanced.g.cs b/src/libs/Ideogram/Generated/Ideogram.IModelsClient.TrainModelV4Advanced.g.cs deleted file mode 100644 index dc71677b..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IModelsClient.TrainModelV4Advanced.g.cs +++ /dev/null @@ -1,89 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IModelsClient - { - /// - /// Train a custom Ideogram v4 model with advanced hyperparameters
- /// Start training a custom Ideogram v4 model from a dataset with caller-supplied hyperparameters (training steps, LoRA rank, EMA decay, learning rate). All hyperparameters are optional and fall back to defaults when omitted. The dataset must contain at least 15 images and a maximum of 100 images. Returns the model ID and training status. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task TrainModelV4AdvancedAsync( - - global::Ideogram.TrainModelV4AdvancedRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Train a custom Ideogram v4 model with advanced hyperparameters
- /// Start training a custom Ideogram v4 model from a dataset with caller-supplied hyperparameters (training steps, LoRA rank, EMA decay, learning rate). All hyperparameters are optional and fall back to defaults when omitted. The dataset must contain at least 15 images and a maximum of 100 images. Returns the model ID and training status. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> TrainModelV4AdvancedAsResponseAsync( - - global::Ideogram.TrainModelV4AdvancedRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Train a custom Ideogram v4 model with advanced hyperparameters
- /// Start training a custom Ideogram v4 model from a dataset with caller-supplied hyperparameters (training steps, LoRA rank, EMA decay, learning rate). All hyperparameters are optional and fall back to defaults when omitted. The dataset must contain at least 15 images and a maximum of 100 images. Returns the model ID and training status. - ///
- /// - /// ID of the dataset to train the model from.
- /// Example: abc123 - /// - /// - /// Name for the trained model. Must be 5-30 characters, alphanumeric with spaces and hyphens allowed.
- /// Example: my-custom-model - /// - /// - /// Number of training steps. Must be between 100 and 10000 and a multiple of 100. Defaults to 1000.
- /// Example: 1000 - /// - /// - /// LoRA rank for model training. Must be one of 64 or 128. Defaults to 128. Higher rank increases model capacity at the cost of longer training and larger weights.
- /// Example: 64 - /// - /// - /// Exponential moving average decay rate for the model weights. Must be between 0 and 1 (exclusive). Typical values are 0.99-0.9999; higher values produce smoother weight averages but respond more slowly to training updates.
- /// Example: 0.999F - /// - /// - /// Learning rate for the optimizer. Must be greater than 0. Typical values for LoRA fine-tuning are 1e-5 to 1e-4; larger values train faster but risk instability.
- /// Example: 0.0001F - /// - /// - /// Per-step training batch size. Must be one of 1, 2, 4, 8, 16, or 32. Defaults to a trainer-side value when omitted. Larger batches can improve throughput at the cost of more memory.
- /// Example: 8 - /// - /// - /// Weights & Biases project to log this training run to. When set, the run streams metrics to this W&B project; when omitted, no W&B logging happens.
- /// Example: my-wandb-project - /// - /// - /// Frozen v4 backbone the custom LoRA is trained on. Must be one of `distilled_gd` (the guidance-distilled base, default) or `oldbase_farzad_fused` (the fused non-distilled base). Omit to use the default.
- /// Example: distilled_gd - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task TrainModelV4AdvancedAsync( - string datasetId, - string modelName, - int? trainingSteps = default, - int? loraRank = default, - double? ema = default, - double? learningRate = default, - int? batchSize = default, - string? wandbProject = default, - string? baseVariant = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IModelsClient.g.cs b/src/libs/Ideogram/Generated/Ideogram.IModelsClient.g.cs deleted file mode 100644 index 59b731c9..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IModelsClient.g.cs +++ /dev/null @@ -1,49 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Operations related to managing custom models
- /// If no httpClient is provided, a new one will be created.
- /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. - ///
- public partial interface IModelsClient : global::System.IDisposable - { - /// - /// The HttpClient instance. - /// - public global::System.Net.Http.HttpClient HttpClient { get; } - - /// - /// The base URL for the API. - /// - public System.Uri? BaseUri { get; } - - /// - /// The authorizations to use for the requests. - /// - public global::System.Collections.Generic.List Authorizations { get; } - - /// - /// Gets or sets a value indicating whether the response content should be read as a string. - /// True by default in debug builds, false otherwise. - /// When false, successful responses are deserialized directly from the response stream for better performance. - /// Error responses are always read as strings regardless of this setting, - /// ensuring is populated. - /// - public bool ReadResponseAsString { get; set; } - /// - /// Client-wide request defaults such as headers, query parameters, retries, and timeout. - /// - public global::Ideogram.AutoSDKClientOptions Options { get; } - - - /// - /// - /// - global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } - - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IObjectRemovalClient.ObjectRemovalPostRemoveObjectFromV2Assets.g.cs b/src/libs/Ideogram/Generated/Ideogram.IObjectRemovalClient.ObjectRemovalPostRemoveObjectFromV2Assets.g.cs new file mode 100644 index 00000000..4a7f5bf5 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IObjectRemovalClient.ObjectRemovalPostRemoveObjectFromV2Assets.g.cs @@ -0,0 +1,160 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IObjectRemovalClient + { + /// + /// Remove an object
+ /// Remove a masked object from an image. Upload the source `image` and a
+ /// `mask` of the same size using `multipart/form-data`. Returns a
+ /// `generation_id`; poll `GET /v2/generations/{generation_id}` for the
+ /// result. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ObjectRemovalPostRemoveObjectFromV2AssetsAsync( + + global::Ideogram.ObjectRemovalPostRemoveObjectFromV2AssetsRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Remove an object
+ /// Remove a masked object from an image. Upload the source `image` and a
+ /// `mask` of the same size using `multipart/form-data`. Returns a
+ /// `generation_id`; poll `GET /v2/generations/{generation_id}` for the
+ /// result. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ObjectRemovalPostRemoveObjectFromV2AssetsAsResponseAsync( + + global::Ideogram.ObjectRemovalPostRemoveObjectFromV2AssetsRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Remove an object
+ /// Remove a masked object from an image. Upload the source `image` and a
+ /// `mask` of the same size using `multipart/form-data`. Returns a
+ /// `generation_id`; poll `GET /v2/generations/{generation_id}` for the
+ /// result. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image to remove an object from. JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. + /// + /// + /// The source image to remove an object from. JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. + /// + /// + /// A black-and-white mask the same size as the image; white (>= 128) marks the region to remove. JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. + /// + /// + /// A black-and-white mask the same size as the image; white (>= 128) marks the region to remove. JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ObjectRemovalPostRemoveObjectFromV2AssetsAsync( + byte[] image, + string imagename, + byte[] mask, + string maskname, + bool? dryRun = default, + int? seed = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Remove an object
+ /// Remove a masked object from an image. Upload the source `image` and a
+ /// `mask` of the same size using `multipart/form-data`. Returns a
+ /// `generation_id`; poll `GET /v2/generations/{generation_id}` for the
+ /// result. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image to remove an object from. JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. + /// + /// + /// The source image to remove an object from. JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. + /// + /// + /// A black-and-white mask the same size as the image; white (>= 128) marks the region to remove. JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. + /// + /// + /// A black-and-white mask the same size as the image; white (>= 128) marks the region to remove. JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ObjectRemovalPostRemoveObjectFromV2AssetsAsync( + global::System.IO.Stream image, + string imagename, + global::System.IO.Stream mask, + string maskname, + bool? dryRun = default, + int? seed = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Remove an object
+ /// Remove a masked object from an image. Upload the source `image` and a
+ /// `mask` of the same size using `multipart/form-data`. Returns a
+ /// `generation_id`; poll `GET /v2/generations/{generation_id}` for the
+ /// result. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image to remove an object from. JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. + /// + /// + /// The source image to remove an object from. JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. + /// + /// + /// A black-and-white mask the same size as the image; white (>= 128) marks the region to remove. JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. + /// + /// + /// A black-and-white mask the same size as the image; white (>= 128) marks the region to remove. JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ObjectRemovalPostRemoveObjectFromV2AssetsAsResponseAsync( + global::System.IO.Stream image, + string imagename, + global::System.IO.Stream mask, + string maskname, + bool? dryRun = default, + int? seed = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IObjectRemovalClient.PostRemoveObjectFromV2Assets.g.cs b/src/libs/Ideogram/Generated/Ideogram.IObjectRemovalClient.PostRemoveObjectFromV2Assets.g.cs deleted file mode 100644 index 6e537644..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IObjectRemovalClient.PostRemoveObjectFromV2Assets.g.cs +++ /dev/null @@ -1,106 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IObjectRemovalClient - { - /// - /// Remove an object
- /// Remove a masked object from an image. Upload the source `image` and a
- /// `mask` of the same size using `multipart/form-data`. Returns a
- /// `generation_id`; poll `GET /v2/generations/{generation_id}` for the
- /// result. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostRemoveObjectFromV2AssetsAsync( - - global::Ideogram.RemoveObjectFromV2AssetsRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Remove an object
- /// Remove a masked object from an image. Upload the source `image` and a
- /// `mask` of the same size using `multipart/form-data`. Returns a
- /// `generation_id`; poll `GET /v2/generations/{generation_id}` for the
- /// result. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostRemoveObjectFromV2AssetsAsResponseAsync( - - global::Ideogram.RemoveObjectFromV2AssetsRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Remove an object
- /// Remove a masked object from an image. Upload the source `image` and a
- /// `mask` of the same size using `multipart/form-data`. Returns a
- /// `generation_id`; poll `GET /v2/generations/{generation_id}` for the
- /// result. - ///
- /// - /// Default Value: false - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The source image to remove an object from. JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. - /// - /// - /// The source image to remove an object from. JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// A black-and-white mask the same size as the image; white (>= 128) marks the region to remove. JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. - /// - /// - /// A black-and-white mask the same size as the image; white (>= 128) marks the region to remove. JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. Completed outputs are added to it automatically. - /// - /// - /// Whether to store the resulting images on Ideogram. Defaults to `false`.
- /// Currently accepted but not yet enforced.
- /// Default Value: false - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostRemoveObjectFromV2AssetsAsync( - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - global::Ideogram.AssetIdentifier? maskAssetIdentifier = default, - byte[]? mask = default, - string? maskname = default, - int? seed = default, - string? targetCollectionId = default, - bool? storeAssets = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IObjectRemovalClient.g.cs b/src/libs/Ideogram/Generated/Ideogram.IObjectRemovalClient.g.cs index 5942cbf4..73e9f51a 100644 --- a/src/libs/Ideogram/Generated/Ideogram.IObjectRemovalClient.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.IObjectRemovalClient.g.cs @@ -4,8 +4,6 @@ namespace Ideogram { /// - /// Remove unwanted objects from an image. Requests return a generation id
- /// to poll with `GET /v2/generations/{generation_id}`.
/// If no httpClient is provided, a new one will be created.
/// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. ///
diff --git a/src/libs/Ideogram/Generated/Ideogram.IPromptClient.Authorizations.Bearer.g.cs b/src/libs/Ideogram/Generated/Ideogram.IPromptClient.Authorizations.Bearer.g.cs deleted file mode 100644 index 99a26a9b..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IPromptClient.Authorizations.Bearer.g.cs +++ /dev/null @@ -1,16 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial interface IPromptClient - { - /// - /// Authorize using bearer authentication. - /// - /// - - public void AuthorizeUsingBearer( - string apiKey); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IPromptClient.PostMagicPrompt.g.cs b/src/libs/Ideogram/Generated/Ideogram.IPromptClient.PostMagicPrompt.g.cs deleted file mode 100644 index 4b9fd9d6..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IPromptClient.PostMagicPrompt.g.cs +++ /dev/null @@ -1,143 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IPromptClient - { - /// - /// Generate Magic Prompt
- /// Transforms basic prompts into a magic prompt. Internal use only (feature flagged). TODO: update description if enabled externally. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostMagicPromptAsync( - - global::Ideogram.MagicPromptRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate Magic Prompt
- /// Transforms basic prompts into a magic prompt. Internal use only (feature flagged). TODO: update description if enabled externally. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostMagicPromptAsResponseAsync( - - global::Ideogram.MagicPromptRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate Magic Prompt
- /// Transforms basic prompts into a magic prompt. Internal use only (feature flagged). TODO: update description if enabled externally. - ///
- /// - /// The prompt to enhance with a magic prompt. Mutually
- /// exclusive with `messages`; one of the two must be set.
- /// Example: a cat - /// - /// - /// The magic prompt version to use when magic prompt option is set to AUTO or ON.
- /// Example: V_0 - /// - /// - /// Whether to classify the prompt into a use case category.
- /// Default Value: true
- /// Example: false - /// - /// - /// The style type to generate with.
- /// Default Value: GENERAL
- /// Example: GENERAL - /// - /// - /// Random seed for reproducible generation
- /// Example: 12345 - /// - /// - /// Generations with character reference are subject to the character reference pricing. A set of images to use as character references (max size 25MB per image; the whole request must stay under 50MB), currently only supports 1 character reference image. The images should be in JPEG, PNG or WebP format. - /// - /// - /// A system prompt to use for the magic prompt.
- /// Example: You are a helpful assistant that generates magic prompts for images. - /// - /// - /// Optional target aspect ratio used to condition the generated
- /// magic prompt's framing. Forwarded to the autoprompt pipeline
- /// so registry-driven system prompts that interpolate
- /// `{{aspect_ratio}}` see the bucket the caller intends. - /// - /// - /// Sampling temperature override. Defaults to the trainer-conditioned
- /// value when omitted (0.7 for V4_QWEN_3_5_27B). Only honored with
- /// V4 magic-prompt versions; supplying it with another version
- /// returns 400. - /// - /// - /// Nucleus-sampling top_p override. Only honored with V4 versions. - /// - /// - /// Top-k sampling override. Only honored with V4 versions. - /// - /// - /// min_p sampling override. Only honored with V4 versions. - /// - /// - /// Cap on the number of tokens the model may generate. Defaults to
- /// 4096 (the trainer's reference cap) when omitted. Only honored
- /// with V4 versions. - /// - /// - /// Presence-penalty override. Only honored with V4 versions. - /// - /// - /// Frequency-penalty override. Only honored with V4 versions. - /// - /// - /// Repetition-penalty override. Only honored with V4 versions. - /// - /// - /// Optional override of the LoRA adapter the V4 magic-prompt
- /// wrapper downloads and runs. Pass a `gs://` URI pointing at a
- /// checkpoint directory containing `adapter_config.json`. When
- /// omitted, the wrapper-preloaded production checkpoint is used.
- /// Honored with the wrapper-routed LoRA versions
- /// `V4_QWEN_3_5_27B` and `V4_QWEN_3_5_27B_FULL_FINETUNE_LORA`;
- /// supplying it with `V4_QWEN_3_5_27B_PREFUSED` or
- /// `V4_QWEN_3_5_27B_FULL_FINETUNE` (which serve fixed weights and
- /// cannot swap adapters per request) or any other version returns
- /// 400. - /// - /// - /// Pre-formed chat messages forwarded verbatim to V4. Mutually
- /// exclusive with `prompt`; exactly one must be set. V4 only. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostMagicPromptAsync( - global::Ideogram.MagicPromptVersionEnum magicPromptVersion, - bool classifyPromptCategory, - string? prompt = default, - global::Ideogram.StyleTypeV3? styleType = default, - int? seed = default, - global::System.Collections.Generic.IList? characterReferenceImages = default, - string? systemPrompt = default, - global::Ideogram.AspectRatioV3? aspectRatio = default, - float? temperature = default, - float? topP = default, - int? topK = default, - float? minP = default, - int? maxTokens = default, - float? presencePenalty = default, - float? frequencyPenalty = default, - float? repetitionPenalty = default, - string? checkpoint = default, - global::System.Collections.Generic.IList? messages = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IPromptClient.PostMagicPromptV4.g.cs b/src/libs/Ideogram/Generated/Ideogram.IPromptClient.PostMagicPromptV4.g.cs deleted file mode 100644 index f4ef8192..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IPromptClient.PostMagicPromptV4.g.cs +++ /dev/null @@ -1,65 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IPromptClient - { - /// - /// Generate a Magic Prompt with Ideogram 4.0
- /// Transforms a basic prompt into an enhanced Ideogram 4.0 magic prompt.
- /// The magic prompt model version is fixed; callers cannot select it.
- /// When `aspect_ratio` is `AUTO` (the default), the model selects the most
- /// suitable aspect ratio for the prompt and returns it in the response. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostMagicPromptV4Async( - - global::Ideogram.MagicPromptV4Request request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate a Magic Prompt with Ideogram 4.0
- /// Transforms a basic prompt into an enhanced Ideogram 4.0 magic prompt.
- /// The magic prompt model version is fixed; callers cannot select it.
- /// When `aspect_ratio` is `AUTO` (the default), the model selects the most
- /// suitable aspect ratio for the prompt and returns it in the response. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostMagicPromptV4AsResponseAsync( - - global::Ideogram.MagicPromptV4Request request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate a Magic Prompt with Ideogram 4.0
- /// Transforms a basic prompt into an enhanced Ideogram 4.0 magic prompt.
- /// The magic prompt model version is fixed; callers cannot select it.
- /// When `aspect_ratio` is `AUTO` (the default), the model selects the most
- /// suitable aspect ratio for the prompt and returns it in the response. - ///
- /// - /// The natural-language prompt to enhance into an Ideogram 4.0 magic
- /// prompt. Named `text_prompt` to match the Ideogram 4.0 generate
- /// request surface.
- /// Example: a cat - /// - /// - /// Target aspect ratio. Defaults to `AUTO`, which lets the model
- /// select the most suitable ratio and return it in the response. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostMagicPromptV4Async( - string textPrompt, - global::Ideogram.AspectRatioV4? aspectRatio = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IPromptClient.g.cs b/src/libs/Ideogram/Generated/Ideogram.IPromptClient.g.cs deleted file mode 100644 index 9544d637..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IPromptClient.g.cs +++ /dev/null @@ -1,48 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// If no httpClient is provided, a new one will be created.
- /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. - ///
- public partial interface IPromptClient : global::System.IDisposable - { - /// - /// The HttpClient instance. - /// - public global::System.Net.Http.HttpClient HttpClient { get; } - - /// - /// The base URL for the API. - /// - public System.Uri? BaseUri { get; } - - /// - /// The authorizations to use for the requests. - /// - public global::System.Collections.Generic.List Authorizations { get; } - - /// - /// Gets or sets a value indicating whether the response content should be read as a string. - /// True by default in debug builds, false otherwise. - /// When false, successful responses are deserialized directly from the response stream for better performance. - /// Error responses are always read as strings regardless of this setting, - /// ensuring is populated. - /// - public bool ReadResponseAsString { get; set; } - /// - /// Client-wide request defaults such as headers, query parameters, retries, and timeout. - /// - public global::Ideogram.AutoSDKClientOptions Options { get; } - - - /// - /// - /// - global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } - - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IProvenanceClient.Authorizations.Bearer.g.cs b/src/libs/Ideogram/Generated/Ideogram.IProvenanceClient.Authorizations.Bearer.g.cs deleted file mode 100644 index 650bce5e..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IProvenanceClient.Authorizations.Bearer.g.cs +++ /dev/null @@ -1,16 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial interface IProvenanceClient - { - /// - /// Authorize using bearer authentication. - /// - /// - - public void AuthorizeUsingBearer( - string apiKey); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IProvenanceClient.PostProvenanceVerify.g.cs b/src/libs/Ideogram/Generated/Ideogram.IProvenanceClient.PostProvenanceVerify.g.cs deleted file mode 100644 index 8cbc0a31..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IProvenanceClient.PostProvenanceVerify.g.cs +++ /dev/null @@ -1,119 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IProvenanceClient - { - /// - /// Check whether content was created by Ideogram
- /// Checks image content for an Ideogram provenance manifest (C2PA Content
- /// Credentials) and returns the disclosure it carries: the provider name,
- /// the generating system and its version, the creation time, and the
- /// content's unique identifier.
- /// Upload the image to verify as the `content` part.
- /// This endpoint is public and unauthenticated — no API key is required.
- /// Submitted content is analyzed in memory and never stored. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostProvenanceVerifyAsync( - - global::Ideogram.ProvenanceVerifyRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Check whether content was created by Ideogram
- /// Checks image content for an Ideogram provenance manifest (C2PA Content
- /// Credentials) and returns the disclosure it carries: the provider name,
- /// the generating system and its version, the creation time, and the
- /// content's unique identifier.
- /// Upload the image to verify as the `content` part.
- /// This endpoint is public and unauthenticated — no API key is required.
- /// Submitted content is analyzed in memory and never stored. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostProvenanceVerifyAsResponseAsync( - - global::Ideogram.ProvenanceVerifyRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Check whether content was created by Ideogram
- /// Checks image content for an Ideogram provenance manifest (C2PA Content
- /// Credentials) and returns the disclosure it carries: the provider name,
- /// the generating system and its version, the creation time, and the
- /// content's unique identifier.
- /// Upload the image to verify as the `content` part.
- /// This endpoint is public and unauthenticated — no API key is required.
- /// Submitted content is analyzed in memory and never stored. - ///
- /// - /// The image file to verify. - /// - /// - /// The image file to verify. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostProvenanceVerifyAsync( - byte[] content, - string contentname, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - - /// - /// Check whether content was created by Ideogram
- /// Checks image content for an Ideogram provenance manifest (C2PA Content
- /// Credentials) and returns the disclosure it carries: the provider name,
- /// the generating system and its version, the creation time, and the
- /// content's unique identifier.
- /// Upload the image to verify as the `content` part.
- /// This endpoint is public and unauthenticated — no API key is required.
- /// Submitted content is analyzed in memory and never stored. - ///
- /// - /// The image file to verify. - /// - /// - /// The image file to verify. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostProvenanceVerifyAsync( - global::System.IO.Stream content, - string contentname, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Check whether content was created by Ideogram
- /// Checks image content for an Ideogram provenance manifest (C2PA Content
- /// Credentials) and returns the disclosure it carries: the provider name,
- /// the generating system and its version, the creation time, and the
- /// content's unique identifier.
- /// Upload the image to verify as the `content` part.
- /// This endpoint is public and unauthenticated — no API key is required.
- /// Submitted content is analyzed in memory and never stored. - ///
- /// - /// The image file to verify. - /// - /// - /// The image file to verify. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostProvenanceVerifyAsResponseAsync( - global::System.IO.Stream content, - string contentname, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IProvenanceClient.g.cs b/src/libs/Ideogram/Generated/Ideogram.IProvenanceClient.g.cs deleted file mode 100644 index 1bdce212..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IProvenanceClient.g.cs +++ /dev/null @@ -1,48 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// If no httpClient is provided, a new one will be created.
- /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. - ///
- public partial interface IProvenanceClient : global::System.IDisposable - { - /// - /// The HttpClient instance. - /// - public global::System.Net.Http.HttpClient HttpClient { get; } - - /// - /// The base URL for the API. - /// - public System.Uri? BaseUri { get; } - - /// - /// The authorizations to use for the requests. - /// - public global::System.Collections.Generic.List Authorizations { get; } - - /// - /// Gets or sets a value indicating whether the response content should be read as a string. - /// True by default in debug builds, false otherwise. - /// When false, successful responses are deserialized directly from the response stream for better performance. - /// Error responses are always read as strings regardless of this setting, - /// ensuring is populated. - /// - public bool ReadResponseAsString { get; set; } - /// - /// Client-wide request defaults such as headers, query parameters, retries, and timeout. - /// - public global::Ideogram.AutoSDKClientOptions Options { get; } - - - /// - /// - /// - global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } - - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IReframeClient.Authorizations.Bearer.g.cs b/src/libs/Ideogram/Generated/Ideogram.IReframeClient.Authorizations.Bearer.g.cs new file mode 100644 index 00000000..d7e9cbf7 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IReframeClient.Authorizations.Bearer.g.cs @@ -0,0 +1,16 @@ + +#nullable enable + +namespace Ideogram +{ + public partial interface IReframeClient + { + /// + /// Authorize using bearer authentication. + /// + /// + + public void AuthorizeUsingBearer( + string apiKey); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IReframeClient.ReframeIdeogramV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.IReframeClient.ReframeIdeogramV3.g.cs new file mode 100644 index 00000000..a67dee7b --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IReframeClient.ReframeIdeogramV3.g.cs @@ -0,0 +1,251 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IReframeClient + { + /// + /// Reframe with Ideogram 3.0
+ /// Expand an image to a new Ideogram 3.0 resolution, keeping the source
+ /// pixels in the center and filling the new area. Upload the source
+ /// `image` using `multipart/form-data`. Returns results directly by
+ /// default; set `async` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ReframeIdeogramV3Async( + + global::Ideogram.ReframeIdeogramV3Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Reframe with Ideogram 3.0
+ /// Expand an image to a new Ideogram 3.0 resolution, keeping the source
+ /// pixels in the center and filling the new area. Upload the source
+ /// `image` using `multipart/form-data`. Returns results directly by
+ /// default; set `async` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ReframeIdeogramV3AsResponseAsync( + + global::Ideogram.ReframeIdeogramV3Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Reframe with Ideogram 3.0
+ /// Expand an image to a new Ideogram 3.0 resolution, keeping the source
+ /// pixels in the center and filling the new area. Upload the source
+ /// `image` using `multipart/form-data`. Returns results directly by
+ /// default; set `async` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The JPEG, PNG, or WEBP image to reframe (max 25MB). Multipart requests only. + /// + /// + /// The JPEG, PNG, or WEBP image to reframe (max 25MB). Multipart requests only. + /// + /// + /// The resolutions supported for Ideogram 3.0. + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// Default Value: default + /// + /// + /// A predefined style preset that applies a specific artistic style to the generated image. + /// + /// + /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). + /// + /// + /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images. + /// + /// + /// JPEG, PNG, or WEBP style reference images (max 10, max 25MB each). Multipart requests only. Cannot be combined with `style_preset` or `style_codes`. + /// + /// + /// Return immediately instead of waiting for reframed images.
+ /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ReframeIdeogramV3Async( + byte[] image, + string imagename, + global::Ideogram.ResolutionV3 resolution, + bool? dryRun = default, + int? numImages = default, + int? seed = default, + global::Ideogram.V2ImageReframeIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed = default, + global::Ideogram.IdeogramV3StylePreset? stylePreset = default, + global::Ideogram.IdeogramColorPalette? colorPalette = default, + global::System.Collections.Generic.IList? styleCodes = default, + global::System.Collections.Generic.IList? styleReferenceImages = default, + bool? async = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Reframe with Ideogram 3.0
+ /// Expand an image to a new Ideogram 3.0 resolution, keeping the source
+ /// pixels in the center and filling the new area. Upload the source
+ /// `image` using `multipart/form-data`. Returns results directly by
+ /// default; set `async` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The JPEG, PNG, or WEBP image to reframe (max 25MB). Multipart requests only. + /// + /// + /// The JPEG, PNG, or WEBP image to reframe (max 25MB). Multipart requests only. + /// + /// + /// The resolutions supported for Ideogram 3.0. + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// Default Value: default + /// + /// + /// A predefined style preset that applies a specific artistic style to the generated image. + /// + /// + /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). + /// + /// + /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images. + /// + /// + /// JPEG, PNG, or WEBP style reference images (max 10, max 25MB each). Multipart requests only. Cannot be combined with `style_preset` or `style_codes`. + /// + /// + /// Optional file names to use for the multipart 'style_reference_images' file parts. + /// + /// + /// Return immediately instead of waiting for reframed images.
+ /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ReframeIdeogramV3Async( + global::System.IO.Stream image, + string imagename, + global::Ideogram.ResolutionV3 resolution, + bool? dryRun = default, + int? numImages = default, + int? seed = default, + global::Ideogram.V2ImageReframeIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed = default, + global::Ideogram.IdeogramV3StylePreset? stylePreset = default, + global::Ideogram.IdeogramColorPalette? colorPalette = default, + global::System.Collections.Generic.IList? styleCodes = default, + global::System.Collections.Generic.IReadOnlyList? styleReferenceImages = default, + global::System.Collections.Generic.IReadOnlyList? styleReferenceImagesFileNames = default, + bool? async = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Reframe with Ideogram 3.0
+ /// Expand an image to a new Ideogram 3.0 resolution, keeping the source
+ /// pixels in the center and filling the new area. Upload the source
+ /// `image` using `multipart/form-data`. Returns results directly by
+ /// default; set `async` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The JPEG, PNG, or WEBP image to reframe (max 25MB). Multipart requests only. + /// + /// + /// The JPEG, PNG, or WEBP image to reframe (max 25MB). Multipart requests only. + /// + /// + /// The resolutions supported for Ideogram 3.0. + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// Default Value: default + /// + /// + /// A predefined style preset that applies a specific artistic style to the generated image. + /// + /// + /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). + /// + /// + /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images. + /// + /// + /// JPEG, PNG, or WEBP style reference images (max 10, max 25MB each). Multipart requests only. Cannot be combined with `style_preset` or `style_codes`. + /// + /// + /// Optional file names to use for the multipart 'style_reference_images' file parts. + /// + /// + /// Return immediately instead of waiting for reframed images.
+ /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ReframeIdeogramV3AsResponseAsync( + global::System.IO.Stream image, + string imagename, + global::Ideogram.ResolutionV3 resolution, + bool? dryRun = default, + int? numImages = default, + int? seed = default, + global::Ideogram.V2ImageReframeIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed = default, + global::Ideogram.IdeogramV3StylePreset? stylePreset = default, + global::Ideogram.IdeogramColorPalette? colorPalette = default, + global::System.Collections.Generic.IList? styleCodes = default, + global::System.Collections.Generic.IReadOnlyList? styleReferenceImages = default, + global::System.Collections.Generic.IReadOnlyList? styleReferenceImagesFileNames = default, + bool? async = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IReframeClient.ReframeNanoBanana2.g.cs b/src/libs/Ideogram/Generated/Ideogram.IReframeClient.ReframeNanoBanana2.g.cs new file mode 100644 index 00000000..7c7a9132 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IReframeClient.ReframeNanoBanana2.g.cs @@ -0,0 +1,184 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IReframeClient + { + /// + /// Reframe with Nano Banana 2
+ /// Expand an image to a new aspect ratio with Nano Banana 2. Upload the
+ /// source `image` using `multipart/form-data`. Always asynchronous:
+ /// returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// for results. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ReframeNanoBanana2Async( + + global::Ideogram.ReframeNanoBanana2Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Reframe with Nano Banana 2
+ /// Expand an image to a new aspect ratio with Nano Banana 2. Upload the
+ /// source `image` using `multipart/form-data`. Always asynchronous:
+ /// returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// for results. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ReframeNanoBanana2AsResponseAsync( + + global::Ideogram.ReframeNanoBanana2Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Reframe with Nano Banana 2
+ /// Expand an image to a new aspect ratio with Nano Banana 2. Upload the
+ /// source `image` using `multipart/form-data`. Always asynchronous:
+ /// returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// for results. + ///
+ /// + /// Default Value: false + /// + /// + /// The JPEG, PNG, or WEBP image to reframe (max 50MB). + /// + /// + /// The JPEG, PNG, or WEBP image to reframe (max 50MB). + /// + /// + /// Aspect ratios Nano Banana 2 can reframe an image to. + /// + /// + /// API-key requests are always private. For bearer-authenticated
+ /// requests, this controls whether the result is private; when
+ /// omitted, it follows the caller's plan entitlement. Enterprise
+ /// generations are always private. + /// + /// + /// The number of output images to generate.
+ /// Default Value: 1 + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ReframeNanoBanana2Async( + byte[] image, + string imagename, + global::Ideogram.NanoBanana2ReframeAspectRatio aspectRatio, + bool? dryRun = default, + bool? @private = default, + int? numImages = default, + int? seed = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Reframe with Nano Banana 2
+ /// Expand an image to a new aspect ratio with Nano Banana 2. Upload the
+ /// source `image` using `multipart/form-data`. Always asynchronous:
+ /// returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// for results. + ///
+ /// + /// Default Value: false + /// + /// + /// The JPEG, PNG, or WEBP image to reframe (max 50MB). + /// + /// + /// The JPEG, PNG, or WEBP image to reframe (max 50MB). + /// + /// + /// Aspect ratios Nano Banana 2 can reframe an image to. + /// + /// + /// API-key requests are always private. For bearer-authenticated
+ /// requests, this controls whether the result is private; when
+ /// omitted, it follows the caller's plan entitlement. Enterprise
+ /// generations are always private. + /// + /// + /// The number of output images to generate.
+ /// Default Value: 1 + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ReframeNanoBanana2Async( + global::System.IO.Stream image, + string imagename, + global::Ideogram.NanoBanana2ReframeAspectRatio aspectRatio, + bool? dryRun = default, + bool? @private = default, + int? numImages = default, + int? seed = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Reframe with Nano Banana 2
+ /// Expand an image to a new aspect ratio with Nano Banana 2. Upload the
+ /// source `image` using `multipart/form-data`. Always asynchronous:
+ /// returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// for results. + ///
+ /// + /// Default Value: false + /// + /// + /// The JPEG, PNG, or WEBP image to reframe (max 50MB). + /// + /// + /// The JPEG, PNG, or WEBP image to reframe (max 50MB). + /// + /// + /// Aspect ratios Nano Banana 2 can reframe an image to. + /// + /// + /// API-key requests are always private. For bearer-authenticated
+ /// requests, this controls whether the result is private; when
+ /// omitted, it follows the caller's plan entitlement. Enterprise
+ /// generations are always private. + /// + /// + /// The number of output images to generate.
+ /// Default Value: 1 + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ReframeNanoBanana2AsResponseAsync( + global::System.IO.Stream image, + string imagename, + global::Ideogram.NanoBanana2ReframeAspectRatio aspectRatio, + bool? dryRun = default, + bool? @private = default, + int? numImages = default, + int? seed = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IReframeClient.g.cs b/src/libs/Ideogram/Generated/Ideogram.IReframeClient.g.cs new file mode 100644 index 00000000..583c7633 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IReframeClient.g.cs @@ -0,0 +1,48 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public partial interface IReframeClient : global::System.IDisposable + { + /// + /// The HttpClient instance. + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + /// The base URL for the API. + /// + public System.Uri? BaseUri { get; } + + /// + /// The authorizations to use for the requests. + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + /// Gets or sets a value indicating whether the response content should be read as a string. + /// True by default in debug builds, false otherwise. + /// When false, successful responses are deserialized directly from the response stream for better performance. + /// Error responses are always read as strings regardless of this setting, + /// ensuring is populated. + /// + public bool ReadResponseAsString { get; set; } + /// + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// + public global::Ideogram.AutoSDKClientOptions Options { get; } + + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IToolClient.RemoveBackground.g.cs b/src/libs/Ideogram/Generated/Ideogram.IToolClient.RemoveBackground.g.cs deleted file mode 100644 index 046fb7cc..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IToolClient.RemoveBackground.g.cs +++ /dev/null @@ -1,93 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IToolClient - { - /// - /// Remove background
- /// Remove the background from an image and return the foreground as a
- /// transparent PNG. Upload the source `image` using `multipart/form-data`.
- /// Returns the result directly by default; set `async` to get a
- /// `generation_id` and poll `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task RemoveBackgroundAsync( - - global::Ideogram.RemoveBackgroundV2Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Remove background
- /// Remove the background from an image and return the foreground as a
- /// transparent PNG. Upload the source `image` using `multipart/form-data`.
- /// Returns the result directly by default; set `async` to get a
- /// `generation_id` and poll `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> RemoveBackgroundAsResponseAsync( - - global::Ideogram.RemoveBackgroundV2Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Remove background
- /// Remove the background from an image and return the foreground as a
- /// transparent PNG. Upload the source `image` using `multipart/form-data`.
- /// Returns the result directly by default; set `async` to get a
- /// `generation_id` and poll `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// The source image. JPEG, PNG, or WebP, up to 25MB. Multipart requests only. - /// - /// - /// The source image. JPEG, PNG, or WebP, up to 25MB. Multipart requests only. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. Completed outputs are added to it automatically. - /// - /// - /// Whether to keep the result out of the public gallery. When omitted,
- /// defaults to your plan's setting, or public if your plan has none.
- /// Enterprise generations are always private. - /// - /// - /// When false (the default), wait for and return the foreground image. When true, return as soon as the request is accepted; poll `GET /v2/generations/{generation_id}` for the result.
- /// Default Value: false - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task RemoveBackgroundAsync( - bool? dryRun = default, - byte[]? image = default, - string? imagename = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - string? targetCollectionId = default, - bool? @private = default, - bool? async = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IToolClient.ReplaceBackground.g.cs b/src/libs/Ideogram/Generated/Ideogram.IToolClient.ReplaceBackground.g.cs deleted file mode 100644 index ca08f1ae..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IToolClient.ReplaceBackground.g.cs +++ /dev/null @@ -1,114 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IToolClient - { - /// - /// Replace background with GPT Image 2
- /// Replace the background of an image from a text prompt while keeping the
- /// automatically detected foreground subject; no mask is needed. Upload
- /// the source `image` using `multipart/form-data`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task ReplaceBackgroundAsync( - - global::Ideogram.ReplaceBackgroundRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Replace background with GPT Image 2
- /// Replace the background of an image from a text prompt while keeping the
- /// automatically detected foreground subject; no mask is needed. Upload
- /// the source `image` using `multipart/form-data`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> ReplaceBackgroundAsResponseAsync( - - global::Ideogram.ReplaceBackgroundRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Replace background with GPT Image 2
- /// Replace the background of an image from a text prompt while keeping the
- /// automatically detected foreground subject; no mask is needed. Upload
- /// the source `image` using `multipart/form-data`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
- /// MPO are supported, up to 50 MB. Multipart requests only. - /// - /// - /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
- /// MPO are supported, up to 50 MB. Multipart requests only. - /// - /// - /// Plain-language description of the desired new background. - /// - /// - /// The generation quality level. Defaults to `high`.
- /// Default Value: high - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Whether to keep the result private. When omitted, defaults to your
- /// plan's setting. Enterprise generations are always private. - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task ReplaceBackgroundAsync( - string prompt, - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - global::Ideogram.ReplaceBackgroundQuality? quality = default, - int? numImages = default, - bool? @private = default, - string? webhookUrl = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IToolClient.ReplaceBackgroundIdeogram45.g.cs b/src/libs/Ideogram/Generated/Ideogram.IToolClient.ReplaceBackgroundIdeogram45.g.cs deleted file mode 100644 index 300d2217..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IToolClient.ReplaceBackgroundIdeogram45.g.cs +++ /dev/null @@ -1,131 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IToolClient - { - /// - /// Replace background with Ideogram 4.5
- /// Rebuild the background of an image as the setting shown in a
- /// `background_reference` image, with Ideogram 4.5 at its highest
- /// quality. The people in the source image are kept, people in the
- /// reference are left out, and results keep the source image's aspect
- /// ratio. Returns a `generation_id`; poll
- /// `GET /v2/generations/{generation_id}` or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task ReplaceBackgroundIdeogram45Async( - - global::Ideogram.ReplaceBackgroundIdeogram45Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Replace background with Ideogram 4.5
- /// Rebuild the background of an image as the setting shown in a
- /// `background_reference` image, with Ideogram 4.5 at its highest
- /// quality. The people in the source image are kept, people in the
- /// reference are left out, and results keep the source image's aspect
- /// ratio. Returns a `generation_id`; poll
- /// `GET /v2/generations/{generation_id}` or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> ReplaceBackgroundIdeogram45AsResponseAsync( - - global::Ideogram.ReplaceBackgroundIdeogram45Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Replace background with Ideogram 4.5
- /// Rebuild the background of an image as the setting shown in a
- /// `background_reference` image, with Ideogram 4.5 at its highest
- /// quality. The people in the source image are kept, people in the
- /// reference are left out, and results keep the source image's aspect
- /// ratio. Returns a `generation_id`; poll
- /// `GET /v2/generations/{generation_id}` or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
- /// MPO are supported, up to 50 MB. Its longer side may be at most the
- /// model's maximum aspect ratio times its shorter side; a more extreme
- /// proportion is rejected with a 400 that states the allowed range.
- /// Multipart requests only. - /// - /// - /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
- /// MPO are supported, up to 50 MB. Its longer side may be at most the
- /// model's maximum aspect ratio times its shorter side; a more extreme
- /// proportion is rejected with a 400 that states the allowed range.
- /// Multipart requests only. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// A photo of the setting the new background should match. Its people
- /// are not copied. It is held to the same aspect-ratio limit as
- /// `image`. Multipart requests only. - /// - /// - /// A photo of the setting the new background should match. Its people
- /// are not copied. It is held to the same aspect-ratio limit as
- /// `image`. Multipart requests only. - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Whether to keep the result private. When omitted, the result is
- /// private. Enterprise generations are always private. - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task ReplaceBackgroundIdeogram45Async( - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - global::Ideogram.AssetIdentifier? backgroundReferenceAssetIdentifier = default, - byte[]? backgroundReference = default, - string? backgroundReferencename = default, - int? numImages = default, - bool? @private = default, - string? webhookUrl = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IToolClient.ReplaceBackgroundIdeogramV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.IToolClient.ReplaceBackgroundIdeogramV3.g.cs deleted file mode 100644 index f54aa49d..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IToolClient.ReplaceBackgroundIdeogramV3.g.cs +++ /dev/null @@ -1,118 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IToolClient - { - /// - /// Replace background with Ideogram 3.0
- /// Replace the background of an image from a text prompt with Ideogram 3.0,
- /// keeping the automatically detected foreground subject; no mask is
- /// needed. Upload the source `image` using `multipart/form-data`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task ReplaceBackgroundIdeogramV3Async( - - global::Ideogram.ReplaceBackgroundIdeogramV3Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Replace background with Ideogram 3.0
- /// Replace the background of an image from a text prompt with Ideogram 3.0,
- /// keeping the automatically detected foreground subject; no mask is
- /// needed. Upload the source `image` using `multipart/form-data`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> ReplaceBackgroundIdeogramV3AsResponseAsync( - - global::Ideogram.ReplaceBackgroundIdeogramV3Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Replace background with Ideogram 3.0
- /// Replace the background of an image from a text prompt with Ideogram 3.0,
- /// keeping the automatically detected foreground subject; no mask is
- /// needed. Upload the source `image` using `multipart/form-data`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
- /// MPO are supported, up to 50 MB. Multipart requests only.
- /// The longer side must be at most 3 times the shorter side; wider
- /// aspect ratios are rejected with a 400. - /// - /// - /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
- /// MPO are supported, up to 50 MB. Multipart requests only.
- /// The longer side must be at most 3 times the shorter side; wider
- /// aspect ratios are rejected with a 400. - /// - /// - /// Plain-language description of the desired new background. - /// - /// - /// The rendering speed to use.
- /// Default Value: default - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Whether to keep the result private. When omitted, defaults to your
- /// plan's setting. Enterprise generations are always private. - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task ReplaceBackgroundIdeogramV3Async( - string prompt, - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - global::Ideogram.ReplaceBackgroundIdeogramV3RequestRenderingSpeed? renderingSpeed = default, - int? numImages = default, - bool? @private = default, - string? webhookUrl = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IToolClient.ToolRemoveBackground.g.cs b/src/libs/Ideogram/Generated/Ideogram.IToolClient.ToolRemoveBackground.g.cs new file mode 100644 index 00000000..f039919e --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IToolClient.ToolRemoveBackground.g.cs @@ -0,0 +1,157 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IToolClient + { + /// + /// Remove background
+ /// Remove the background from an image and return the foreground as a
+ /// transparent PNG. Upload the source `image` using `multipart/form-data`.
+ /// Returns the result directly by default; set `async` to get a
+ /// `generation_id` and poll `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ToolRemoveBackgroundAsync( + + global::Ideogram.ToolRemoveBackgroundRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Remove background
+ /// Remove the background from an image and return the foreground as a
+ /// transparent PNG. Upload the source `image` using `multipart/form-data`.
+ /// Returns the result directly by default; set `async` to get a
+ /// `generation_id` and poll `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ToolRemoveBackgroundAsResponseAsync( + + global::Ideogram.ToolRemoveBackgroundRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Remove background
+ /// Remove the background from an image and return the foreground as a
+ /// transparent PNG. Upload the source `image` using `multipart/form-data`.
+ /// Returns the result directly by default; set `async` to get a
+ /// `generation_id` and poll `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image. JPEG, PNG, or WebP, up to 25MB. Multipart requests only. + /// + /// + /// The source image. JPEG, PNG, or WebP, up to 25MB. Multipart requests only. + /// + /// + /// Whether to keep the result out of the public gallery. When omitted,
+ /// defaults to your plan's setting, or public if your plan has none.
+ /// Enterprise generations are always private. + /// + /// + /// When false (the default), wait for and return the foreground image. When true, return as soon as the request is accepted; poll `GET /v2/generations/{generation_id}` for the result.
+ /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ToolRemoveBackgroundAsync( + byte[] image, + string imagename, + bool? dryRun = default, + bool? @private = default, + bool? async = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Remove background
+ /// Remove the background from an image and return the foreground as a
+ /// transparent PNG. Upload the source `image` using `multipart/form-data`.
+ /// Returns the result directly by default; set `async` to get a
+ /// `generation_id` and poll `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image. JPEG, PNG, or WebP, up to 25MB. Multipart requests only. + /// + /// + /// The source image. JPEG, PNG, or WebP, up to 25MB. Multipart requests only. + /// + /// + /// Whether to keep the result out of the public gallery. When omitted,
+ /// defaults to your plan's setting, or public if your plan has none.
+ /// Enterprise generations are always private. + /// + /// + /// When false (the default), wait for and return the foreground image. When true, return as soon as the request is accepted; poll `GET /v2/generations/{generation_id}` for the result.
+ /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ToolRemoveBackgroundAsync( + global::System.IO.Stream image, + string imagename, + bool? dryRun = default, + bool? @private = default, + bool? async = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Remove background
+ /// Remove the background from an image and return the foreground as a
+ /// transparent PNG. Upload the source `image` using `multipart/form-data`.
+ /// Returns the result directly by default; set `async` to get a
+ /// `generation_id` and poll `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image. JPEG, PNG, or WebP, up to 25MB. Multipart requests only. + /// + /// + /// The source image. JPEG, PNG, or WebP, up to 25MB. Multipart requests only. + /// + /// + /// Whether to keep the result out of the public gallery. When omitted,
+ /// defaults to your plan's setting, or public if your plan has none.
+ /// Enterprise generations are always private. + /// + /// + /// When false (the default), wait for and return the foreground image. When true, return as soon as the request is accepted; poll `GET /v2/generations/{generation_id}` for the result.
+ /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ToolRemoveBackgroundAsResponseAsync( + global::System.IO.Stream image, + string imagename, + bool? dryRun = default, + bool? @private = default, + bool? async = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IToolClient.ToolReplaceBackground.g.cs b/src/libs/Ideogram/Generated/Ideogram.IToolClient.ToolReplaceBackground.g.cs new file mode 100644 index 00000000..73aa8274 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IToolClient.ToolReplaceBackground.g.cs @@ -0,0 +1,225 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IToolClient + { + /// + /// Replace background with GPT Image 2
+ /// Replace the background of an image from a text prompt while keeping the
+ /// automatically detected foreground subject; no mask is needed. Upload
+ /// the source `image` using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ToolReplaceBackgroundAsync( + + global::Ideogram.ToolReplaceBackgroundRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Replace background with GPT Image 2
+ /// Replace the background of an image from a text prompt while keeping the
+ /// automatically detected foreground subject; no mask is needed. Upload
+ /// the source `image` using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ToolReplaceBackgroundAsResponseAsync( + + global::Ideogram.ToolReplaceBackgroundRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Replace background with GPT Image 2
+ /// Replace the background of an image from a text prompt while keeping the
+ /// automatically detected foreground subject; no mask is needed. Upload
+ /// the source `image` using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
+ /// MPO are supported, up to 50 MB. Multipart requests only. + /// + /// + /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
+ /// MPO are supported, up to 50 MB. Multipart requests only. + /// + /// + /// Plain-language description of the desired new background. + /// + /// + /// The generation quality level. Defaults to `high`.
+ /// Default Value: high + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Whether to keep the result private. When omitted, defaults to your
+ /// plan's setting. Enterprise generations are always private. + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ToolReplaceBackgroundAsync( + byte[] image, + string imagename, + string prompt, + bool? dryRun = default, + global::Ideogram.ReplaceBackgroundQuality? quality = default, + int? numImages = default, + bool? @private = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Replace background with GPT Image 2
+ /// Replace the background of an image from a text prompt while keeping the
+ /// automatically detected foreground subject; no mask is needed. Upload
+ /// the source `image` using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
+ /// MPO are supported, up to 50 MB. Multipart requests only. + /// + /// + /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
+ /// MPO are supported, up to 50 MB. Multipart requests only. + /// + /// + /// Plain-language description of the desired new background. + /// + /// + /// The generation quality level. Defaults to `high`.
+ /// Default Value: high + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Whether to keep the result private. When omitted, defaults to your
+ /// plan's setting. Enterprise generations are always private. + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ToolReplaceBackgroundAsync( + global::System.IO.Stream image, + string imagename, + string prompt, + bool? dryRun = default, + global::Ideogram.ReplaceBackgroundQuality? quality = default, + int? numImages = default, + bool? @private = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Replace background with GPT Image 2
+ /// Replace the background of an image from a text prompt while keeping the
+ /// automatically detected foreground subject; no mask is needed. Upload
+ /// the source `image` using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
+ /// MPO are supported, up to 50 MB. Multipart requests only. + /// + /// + /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
+ /// MPO are supported, up to 50 MB. Multipart requests only. + /// + /// + /// Plain-language description of the desired new background. + /// + /// + /// The generation quality level. Defaults to `high`.
+ /// Default Value: high + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Whether to keep the result private. When omitted, defaults to your
+ /// plan's setting. Enterprise generations are always private. + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ToolReplaceBackgroundAsResponseAsync( + global::System.IO.Stream image, + string imagename, + string prompt, + bool? dryRun = default, + global::Ideogram.ReplaceBackgroundQuality? quality = default, + int? numImages = default, + bool? @private = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IToolClient.ToolReplaceBackgroundIdeogram45.g.cs b/src/libs/Ideogram/Generated/Ideogram.IToolClient.ToolReplaceBackgroundIdeogram45.g.cs new file mode 100644 index 00000000..f7f162d6 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IToolClient.ToolReplaceBackgroundIdeogram45.g.cs @@ -0,0 +1,257 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IToolClient + { + /// + /// Replace background with Ideogram 4.5
+ /// Rebuild the background of an image as the setting shown in a
+ /// `background_reference` image, with Ideogram 4.5 at its highest
+ /// quality. The people in the source image are kept, people in the
+ /// reference are left out, and results keep the source image's aspect
+ /// ratio. Returns a `generation_id`; poll
+ /// `GET /v2/generations/{generation_id}` or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ToolReplaceBackgroundIdeogram45Async( + + global::Ideogram.ToolReplaceBackgroundIdeogram45Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Replace background with Ideogram 4.5
+ /// Rebuild the background of an image as the setting shown in a
+ /// `background_reference` image, with Ideogram 4.5 at its highest
+ /// quality. The people in the source image are kept, people in the
+ /// reference are left out, and results keep the source image's aspect
+ /// ratio. Returns a `generation_id`; poll
+ /// `GET /v2/generations/{generation_id}` or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ToolReplaceBackgroundIdeogram45AsResponseAsync( + + global::Ideogram.ToolReplaceBackgroundIdeogram45Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Replace background with Ideogram 4.5
+ /// Rebuild the background of an image as the setting shown in a
+ /// `background_reference` image, with Ideogram 4.5 at its highest
+ /// quality. The people in the source image are kept, people in the
+ /// reference are left out, and results keep the source image's aspect
+ /// ratio. Returns a `generation_id`; poll
+ /// `GET /v2/generations/{generation_id}` or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
+ /// MPO are supported, up to 50 MB. Its longer side may be at most the
+ /// model's maximum aspect ratio times its shorter side; a more extreme
+ /// proportion is rejected with a 400 that states the allowed range.
+ /// Multipart requests only. + /// + /// + /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
+ /// MPO are supported, up to 50 MB. Its longer side may be at most the
+ /// model's maximum aspect ratio times its shorter side; a more extreme
+ /// proportion is rejected with a 400 that states the allowed range.
+ /// Multipart requests only. + /// + /// + /// A photo of the setting the new background should match. Its people
+ /// are not copied. It is held to the same aspect-ratio limit as
+ /// `image`. Multipart requests only. + /// + /// + /// A photo of the setting the new background should match. Its people
+ /// are not copied. It is held to the same aspect-ratio limit as
+ /// `image`. Multipart requests only. + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Whether to keep the result private. When omitted, the result is
+ /// private. Enterprise generations are always private. + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ToolReplaceBackgroundIdeogram45Async( + byte[] image, + string imagename, + byte[] backgroundReference, + string backgroundReferencename, + bool? dryRun = default, + int? numImages = default, + bool? @private = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Replace background with Ideogram 4.5
+ /// Rebuild the background of an image as the setting shown in a
+ /// `background_reference` image, with Ideogram 4.5 at its highest
+ /// quality. The people in the source image are kept, people in the
+ /// reference are left out, and results keep the source image's aspect
+ /// ratio. Returns a `generation_id`; poll
+ /// `GET /v2/generations/{generation_id}` or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
+ /// MPO are supported, up to 50 MB. Its longer side may be at most the
+ /// model's maximum aspect ratio times its shorter side; a more extreme
+ /// proportion is rejected with a 400 that states the allowed range.
+ /// Multipart requests only. + /// + /// + /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
+ /// MPO are supported, up to 50 MB. Its longer side may be at most the
+ /// model's maximum aspect ratio times its shorter side; a more extreme
+ /// proportion is rejected with a 400 that states the allowed range.
+ /// Multipart requests only. + /// + /// + /// A photo of the setting the new background should match. Its people
+ /// are not copied. It is held to the same aspect-ratio limit as
+ /// `image`. Multipart requests only. + /// + /// + /// A photo of the setting the new background should match. Its people
+ /// are not copied. It is held to the same aspect-ratio limit as
+ /// `image`. Multipart requests only. + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Whether to keep the result private. When omitted, the result is
+ /// private. Enterprise generations are always private. + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ToolReplaceBackgroundIdeogram45Async( + global::System.IO.Stream image, + string imagename, + global::System.IO.Stream backgroundReference, + string backgroundReferencename, + bool? dryRun = default, + int? numImages = default, + bool? @private = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Replace background with Ideogram 4.5
+ /// Rebuild the background of an image as the setting shown in a
+ /// `background_reference` image, with Ideogram 4.5 at its highest
+ /// quality. The people in the source image are kept, people in the
+ /// reference are left out, and results keep the source image's aspect
+ /// ratio. Returns a `generation_id`; poll
+ /// `GET /v2/generations/{generation_id}` or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
+ /// MPO are supported, up to 50 MB. Its longer side may be at most the
+ /// model's maximum aspect ratio times its shorter side; a more extreme
+ /// proportion is rejected with a 400 that states the allowed range.
+ /// Multipart requests only. + /// + /// + /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
+ /// MPO are supported, up to 50 MB. Its longer side may be at most the
+ /// model's maximum aspect ratio times its shorter side; a more extreme
+ /// proportion is rejected with a 400 that states the allowed range.
+ /// Multipart requests only. + /// + /// + /// A photo of the setting the new background should match. Its people
+ /// are not copied. It is held to the same aspect-ratio limit as
+ /// `image`. Multipart requests only. + /// + /// + /// A photo of the setting the new background should match. Its people
+ /// are not copied. It is held to the same aspect-ratio limit as
+ /// `image`. Multipart requests only. + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Whether to keep the result private. When omitted, the result is
+ /// private. Enterprise generations are always private. + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ToolReplaceBackgroundIdeogram45AsResponseAsync( + global::System.IO.Stream image, + string imagename, + global::System.IO.Stream backgroundReference, + string backgroundReferencename, + bool? dryRun = default, + int? numImages = default, + bool? @private = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IToolClient.ToolReplaceBackgroundIdeogramV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.IToolClient.ToolReplaceBackgroundIdeogramV3.g.cs new file mode 100644 index 00000000..ce1e28ca --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IToolClient.ToolReplaceBackgroundIdeogramV3.g.cs @@ -0,0 +1,237 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IToolClient + { + /// + /// Replace background with Ideogram 3.0
+ /// Replace the background of an image from a text prompt with Ideogram 3.0,
+ /// keeping the automatically detected foreground subject; no mask is
+ /// needed. Upload the source `image` using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ToolReplaceBackgroundIdeogramV3Async( + + global::Ideogram.ToolReplaceBackgroundIdeogramV3Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Replace background with Ideogram 3.0
+ /// Replace the background of an image from a text prompt with Ideogram 3.0,
+ /// keeping the automatically detected foreground subject; no mask is
+ /// needed. Upload the source `image` using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ToolReplaceBackgroundIdeogramV3AsResponseAsync( + + global::Ideogram.ToolReplaceBackgroundIdeogramV3Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Replace background with Ideogram 3.0
+ /// Replace the background of an image from a text prompt with Ideogram 3.0,
+ /// keeping the automatically detected foreground subject; no mask is
+ /// needed. Upload the source `image` using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
+ /// MPO are supported, up to 50 MB. Multipart requests only.
+ /// The longer side must be at most 3 times the shorter side; wider
+ /// aspect ratios are rejected with a 400. + /// + /// + /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
+ /// MPO are supported, up to 50 MB. Multipart requests only.
+ /// The longer side must be at most 3 times the shorter side; wider
+ /// aspect ratios are rejected with a 400. + /// + /// + /// Plain-language description of the desired new background. + /// + /// + /// The rendering speed to use.
+ /// Default Value: default + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Whether to keep the result private. When omitted, defaults to your
+ /// plan's setting. Enterprise generations are always private. + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ToolReplaceBackgroundIdeogramV3Async( + byte[] image, + string imagename, + string prompt, + bool? dryRun = default, + global::Ideogram.V2ImageReplaceBackgroundIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed = default, + int? numImages = default, + bool? @private = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Replace background with Ideogram 3.0
+ /// Replace the background of an image from a text prompt with Ideogram 3.0,
+ /// keeping the automatically detected foreground subject; no mask is
+ /// needed. Upload the source `image` using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
+ /// MPO are supported, up to 50 MB. Multipart requests only.
+ /// The longer side must be at most 3 times the shorter side; wider
+ /// aspect ratios are rejected with a 400. + /// + /// + /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
+ /// MPO are supported, up to 50 MB. Multipart requests only.
+ /// The longer side must be at most 3 times the shorter side; wider
+ /// aspect ratios are rejected with a 400. + /// + /// + /// Plain-language description of the desired new background. + /// + /// + /// The rendering speed to use.
+ /// Default Value: default + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Whether to keep the result private. When omitted, defaults to your
+ /// plan's setting. Enterprise generations are always private. + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ToolReplaceBackgroundIdeogramV3Async( + global::System.IO.Stream image, + string imagename, + string prompt, + bool? dryRun = default, + global::Ideogram.V2ImageReplaceBackgroundIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed = default, + int? numImages = default, + bool? @private = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Replace background with Ideogram 3.0
+ /// Replace the background of an image from a text prompt with Ideogram 3.0,
+ /// keeping the automatically detected foreground subject; no mask is
+ /// needed. Upload the source `image` using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
+ /// MPO are supported, up to 50 MB. Multipart requests only.
+ /// The longer side must be at most 3 times the shorter side; wider
+ /// aspect ratios are rejected with a 400. + /// + /// + /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
+ /// MPO are supported, up to 50 MB. Multipart requests only.
+ /// The longer side must be at most 3 times the shorter side; wider
+ /// aspect ratios are rejected with a 400. + /// + /// + /// Plain-language description of the desired new background. + /// + /// + /// The rendering speed to use.
+ /// Default Value: default + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Whether to keep the result private. When omitted, defaults to your
+ /// plan's setting. Enterprise generations are always private. + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ToolReplaceBackgroundIdeogramV3AsResponseAsync( + global::System.IO.Stream image, + string imagename, + string prompt, + bool? dryRun = default, + global::Ideogram.V2ImageReplaceBackgroundIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed = default, + int? numImages = default, + bool? @private = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IToolClient.g.cs b/src/libs/Ideogram/Generated/Ideogram.IToolClient.g.cs index 1d548d98..d517a9eb 100644 --- a/src/libs/Ideogram/Generated/Ideogram.IToolClient.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.IToolClient.g.cs @@ -4,7 +4,6 @@ namespace Ideogram { /// - /// Outcome-focused image tools with implementation details managed by Ideogram.
/// If no httpClient is provided, a new one will be created.
/// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. ///
diff --git a/src/libs/Ideogram/Generated/Ideogram.IToolsClient.PostUpscale.g.cs b/src/libs/Ideogram/Generated/Ideogram.IToolsClient.PostUpscale.g.cs deleted file mode 100644 index 13e3ff0b..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IToolsClient.PostUpscale.g.cs +++ /dev/null @@ -1,124 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IToolsClient - { - /// - /// Upscale with automatic model selection
- /// Upscale an image to 2x, 4x, or 8x its original resolution with a model
- /// Ideogram picks per request; the choice may change over time. Upload the
- /// source `image` using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostUpscaleAsync( - - global::Ideogram.UpscaleToolRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Upscale with automatic model selection
- /// Upscale an image to 2x, 4x, or 8x its original resolution with a model
- /// Ideogram picks per request; the choice may change over time. Upload the
- /// source `image` using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostUpscaleAsResponseAsync( - - global::Ideogram.UpscaleToolRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Upscale with automatic model selection
- /// Upscale an image to 2x, 4x, or 8x its original resolution with a model
- /// Ideogram picks per request; the choice may change over time. Upload the
- /// source `image` using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - /// - /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - /// - /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
- /// Default Value: x2 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// When true, the upscale is excluded from the user's gallery and feeds.
- /// Default Value: false - /// - /// - /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostUpscaleAsync( - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - global::Ideogram.UpscaleToolRequestUpscaleFactor? upscaleFactor = default, - int? seed = default, - bool? @internal = default, - bool? async = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IToolsClient.ToolsPostUpscale.g.cs b/src/libs/Ideogram/Generated/Ideogram.IToolsClient.ToolsPostUpscale.g.cs new file mode 100644 index 00000000..e7f2755d --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IToolsClient.ToolsPostUpscale.g.cs @@ -0,0 +1,209 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IToolsClient + { + /// + /// Upscale with automatic model selection
+ /// Upscale an image to 2x, 4x, or 8x its original resolution with a model
+ /// Ideogram picks per request; the choice may change over time. Upload the
+ /// source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ToolsPostUpscaleAsync( + + global::Ideogram.ToolsPostUpscaleRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Upscale with automatic model selection
+ /// Upscale an image to 2x, 4x, or 8x its original resolution with a model
+ /// Ideogram picks per request; the choice may change over time. Upload the
+ /// source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ToolsPostUpscaleAsResponseAsync( + + global::Ideogram.ToolsPostUpscaleRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Upscale with automatic model selection
+ /// Upscale an image to 2x, 4x, or 8x its original resolution with a model
+ /// Ideogram picks per request; the choice may change over time. Upload the
+ /// source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
+ /// Default Value: x2 + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ToolsPostUpscaleAsync( + byte[] image, + string imagename, + bool? dryRun = default, + global::Ideogram.V2ImageUpscaleAutoPostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? upscaleFactor = default, + int? seed = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Upscale with automatic model selection
+ /// Upscale an image to 2x, 4x, or 8x its original resolution with a model
+ /// Ideogram picks per request; the choice may change over time. Upload the
+ /// source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
+ /// Default Value: x2 + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ToolsPostUpscaleAsync( + global::System.IO.Stream image, + string imagename, + bool? dryRun = default, + global::Ideogram.V2ImageUpscaleAutoPostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? upscaleFactor = default, + int? seed = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Upscale with automatic model selection
+ /// Upscale an image to 2x, 4x, or 8x its original resolution with a model
+ /// Ideogram picks per request; the choice may change over time. Upload the
+ /// source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
+ /// Default Value: x2 + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ToolsPostUpscaleAsResponseAsync( + global::System.IO.Stream image, + string imagename, + bool? dryRun = default, + global::Ideogram.V2ImageUpscaleAutoPostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? upscaleFactor = default, + int? seed = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IVideoEditClient.PostEditVideoMinimaxH3ReferenceToVideo.g.cs b/src/libs/Ideogram/Generated/Ideogram.IVideoEditClient.PostEditVideoMinimaxH3ReferenceToVideo.g.cs deleted file mode 100644 index fc0e701f..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IVideoEditClient.PostEditVideoMinimaxH3ReferenceToVideo.g.cs +++ /dev/null @@ -1,135 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IVideoEditClient - { - /// - /// Reference to video with MiniMax H3
- /// Produce a video from a text prompt and optional reference media with
- /// MiniMax H3. Upload `reference_images` and `reference_audios` using
- /// `multipart/form-data`, and address them in the prompt by position
- /// (`Image 1`, `Audio 1`, …). Returns a `generation_id`; poll
- /// `GET /v2/generations/{generation_id}` or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostEditVideoMinimaxH3ReferenceToVideoAsync( - - global::Ideogram.EditVideoMinimaxH3ReferenceToVideoRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Reference to video with MiniMax H3
- /// Produce a video from a text prompt and optional reference media with
- /// MiniMax H3. Upload `reference_images` and `reference_audios` using
- /// `multipart/form-data`, and address them in the prompt by position
- /// (`Image 1`, `Audio 1`, …). Returns a `generation_id`; poll
- /// `GET /v2/generations/{generation_id}` or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostEditVideoMinimaxH3ReferenceToVideoAsResponseAsync( - - global::Ideogram.EditVideoMinimaxH3ReferenceToVideoRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Reference to video with MiniMax H3
- /// Produce a video from a text prompt and optional reference media with
- /// MiniMax H3. Upload `reference_images` and `reference_audios` using
- /// `multipart/form-data`, and address them in the prompt by position
- /// (`Image 1`, `Audio 1`, …). Returns a `generation_id`; poll
- /// `GET /v2/generations/{generation_id}` or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// A natural-language prompt describing the video to produce. Reference media is addressed by position, as in "Image 1 walks toward the camera with the motion of Video 1".
- /// Example: Image 1 walks through the snowy forest at dawn. - /// - /// - /// Images already stored with Ideogram to use as references, by reference, in prompt order. Cannot be combined with `reference_images`. Only image assets are accepted. - /// - /// - /// Images to use as references (max size 50MB each), as raw bytes, in prompt order; only common image formats such as JPEG, PNG, and WEBP are supported. Uploaded images are used for this request only and are not stored. - /// - /// - /// Videos generated or uploaded with Ideogram to use as motion references, by reference, in prompt order. Each clip must be between 2 and 15 seconds long, and the clips must total no more than 15 seconds. Raw video uploads are not accepted. - /// - /// - /// MP3 or WAV audio references, in prompt order as Audio 1, Audio 2, and Audio 3. Multipart uploads only; up to 15 MB per file and 2–15 seconds each. Audio and video references must total no more than 15 seconds. Requires a reference image or video. At most 12 references across images, videos, and audio. Used only for this request and not saved as assets. - /// - /// - /// The aspect ratio of the generated video.
- /// Default Value: 16x9 - /// - /// - /// The resolution tier of the generated video, spelled the way MiniMax
- /// spells it. `480P` and `768P` are generated natively; `2K` and `4K` are
- /// upscaled from a `768P` result.
- /// Higher tiers cost more.
- /// Default Value: 2K - /// - /// - /// The length of the generated video in seconds.
- /// Default Value: 5
- /// Example: 5 - /// - /// - /// How much the model may rewrite the prompt before generating. `disabled`
- /// uses the prompt as written; the other modes trade latency for a richer
- /// rewrite.
- /// Default Value: balanced - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output videos are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostEditVideoMinimaxH3ReferenceToVideoAsync( - string prompt, - bool? dryRun = default, - global::System.Collections.Generic.IList? referenceImageAssetIdentifiers = default, - global::System.Collections.Generic.IList? referenceImages = default, - global::System.Collections.Generic.IList? referenceVideoAssetIdentifiers = default, - global::System.Collections.Generic.IList? referenceAudios = default, - global::Ideogram.MinimaxH3AspectRatio? aspectRatio = default, - global::Ideogram.MinimaxH3Resolution? resolution = default, - int? duration = default, - global::Ideogram.MinimaxH3PromptExpansionMode? promptExpansionMode = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IVideoEditClient.PostEditVideoSeedDance2.g.cs b/src/libs/Ideogram/Generated/Ideogram.IVideoEditClient.PostEditVideoSeedDance2.g.cs deleted file mode 100644 index 1604524f..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IVideoEditClient.PostEditVideoSeedDance2.g.cs +++ /dev/null @@ -1,200 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IVideoEditClient - { - /// - /// Edit video with Seedance 2.0
- /// Edit a video you already have stored with Ideogram by replacing part of
- /// it. Reference the source video with `video_asset_identifier` and mark the
- /// span to replace with `start_frame_time` and `end_frame_time`, in seconds.
- /// Seedance 2.0 generates a new clip for that span from your prompt, and the
- /// result is the source video with the generated clip spliced in over the
- /// span: everything before `start_frame_time`, then the generated clip, then
- /// everything from `end_frame_time` on. That edited video is the asset the
- /// request produces.
- /// `is_start_frame_included` and `is_end_frame_included` anchor the generated
- /// clip on the span's own end frames, so it joins the surrounding footage
- /// instead of cutting to something unrelated. Anchoring the start opens the
- /// clip on the frame already at `start_frame_time`; anchoring the end lands
- /// it on the frame at `end_frame_time`; anchoring both joins at each seam. At
- /// least one must be anchored.
- /// The generated clip is used at its own length, which the model rarely makes
- /// exactly the span's, so the edited video is usually a different length from
- /// the source. Request a `duration` close to the span to keep them near each
- /// other. The clip is scaled and cropped to fill the source's frame and
- /// conformed to its frame rate, so resolution and aspect ratio follow the
- /// source rather than being requested.
- /// Video generation always runs asynchronously: the response returns as
- /// soon as the request is accepted and carries only a `generation_id`.
- /// Poll for completion and results with
- /// `GET /v2/generations/{generation_id}` using that id, or supply a
- /// `webhook_url` to have the finished result POSTed to your server
- /// instead.
- /// Video links are available for a limited period of time; download the
- /// video if you want to keep it. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostEditVideoSeedDance2Async( - - global::Ideogram.EditVideoSeedDance2Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Edit video with Seedance 2.0
- /// Edit a video you already have stored with Ideogram by replacing part of
- /// it. Reference the source video with `video_asset_identifier` and mark the
- /// span to replace with `start_frame_time` and `end_frame_time`, in seconds.
- /// Seedance 2.0 generates a new clip for that span from your prompt, and the
- /// result is the source video with the generated clip spliced in over the
- /// span: everything before `start_frame_time`, then the generated clip, then
- /// everything from `end_frame_time` on. That edited video is the asset the
- /// request produces.
- /// `is_start_frame_included` and `is_end_frame_included` anchor the generated
- /// clip on the span's own end frames, so it joins the surrounding footage
- /// instead of cutting to something unrelated. Anchoring the start opens the
- /// clip on the frame already at `start_frame_time`; anchoring the end lands
- /// it on the frame at `end_frame_time`; anchoring both joins at each seam. At
- /// least one must be anchored.
- /// The generated clip is used at its own length, which the model rarely makes
- /// exactly the span's, so the edited video is usually a different length from
- /// the source. Request a `duration` close to the span to keep them near each
- /// other. The clip is scaled and cropped to fill the source's frame and
- /// conformed to its frame rate, so resolution and aspect ratio follow the
- /// source rather than being requested.
- /// Video generation always runs asynchronously: the response returns as
- /// soon as the request is accepted and carries only a `generation_id`.
- /// Poll for completion and results with
- /// `GET /v2/generations/{generation_id}` using that id, or supply a
- /// `webhook_url` to have the finished result POSTed to your server
- /// instead.
- /// Video links are available for a limited period of time; download the
- /// video if you want to keep it. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostEditVideoSeedDance2AsResponseAsync( - - global::Ideogram.EditVideoSeedDance2Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Edit video with Seedance 2.0
- /// Edit a video you already have stored with Ideogram by replacing part of
- /// it. Reference the source video with `video_asset_identifier` and mark the
- /// span to replace with `start_frame_time` and `end_frame_time`, in seconds.
- /// Seedance 2.0 generates a new clip for that span from your prompt, and the
- /// result is the source video with the generated clip spliced in over the
- /// span: everything before `start_frame_time`, then the generated clip, then
- /// everything from `end_frame_time` on. That edited video is the asset the
- /// request produces.
- /// `is_start_frame_included` and `is_end_frame_included` anchor the generated
- /// clip on the span's own end frames, so it joins the surrounding footage
- /// instead of cutting to something unrelated. Anchoring the start opens the
- /// clip on the frame already at `start_frame_time`; anchoring the end lands
- /// it on the frame at `end_frame_time`; anchoring both joins at each seam. At
- /// least one must be anchored.
- /// The generated clip is used at its own length, which the model rarely makes
- /// exactly the span's, so the edited video is usually a different length from
- /// the source. Request a `duration` close to the span to keep them near each
- /// other. The clip is scaled and cropped to fill the source's frame and
- /// conformed to its frame rate, so resolution and aspect ratio follow the
- /// source rather than being requested.
- /// Video generation always runs asynchronously: the response returns as
- /// soon as the request is accepted and carries only a `generation_id`.
- /// Poll for completion and results with
- /// `GET /v2/generations/{generation_id}` using that id, or supply a
- /// `webhook_url` to have the finished result POSTed to your server
- /// instead.
- /// Video links are available for a limited period of time; download the
- /// video if you want to keep it. - ///
- /// - /// Default Value: false - /// - /// - /// A reference to a video already stored with Ideogram to take the frames from. Only video assets are accepted. - /// - /// - /// Where the replaced span of the source video begins. Everything before it is kept as-is. - /// - /// - /// Whether the generated clip is anchored on the frame already at `start_frame_time`, so it opens on the footage it replaces. Set it to false to anchor on the end frame alone, in which case `is_end_frame_included` must be true.
- /// Default Value: true - /// - /// - /// Where the replaced span of the source video ends; must come after `start_frame_time`. Everything from here on is kept as-is. - /// - /// - /// Whether the generated clip is anchored on the frame at `end_frame_time`, so it lands on the footage that follows the span.
- /// Default Value: false - /// - /// - /// A natural-language prompt describing what the replaced span should show.
- /// Example: The camera pushes in as the dancer turns towards the light. - /// - /// - /// The resolution tier the replaced span is generated at. The clip is then scaled to the source video's own frame, so this affects the detail generated rather than the edited video's dimensions. - /// - /// - /// The length of the generated video in seconds. When omitted, the model
- /// picks the best duration for the prompt ("auto").
- /// Example: 5 - /// - /// - /// Whether to generate an audio track for the video. Audio roughly
- /// doubles the provider cost and is subject to stricter output moderation.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output videos are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostEditVideoSeedDance2Async( - global::Ideogram.AssetIdentifier videoAssetIdentifier, - float startFrameTime, - float endFrameTime, - string prompt, - bool? dryRun = default, - bool? isStartFrameIncluded = default, - bool? isEndFrameIncluded = default, - global::Ideogram.SeedDance2Resolution? resolution = default, - int? duration = default, - bool? generateAudio = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IVideoEditClient.VideoEditPostEditVideoMinimaxH3ReferenceToVideo.g.cs b/src/libs/Ideogram/Generated/Ideogram.IVideoEditClient.VideoEditPostEditVideoMinimaxH3ReferenceToVideo.g.cs new file mode 100644 index 00000000..54f66455 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IVideoEditClient.VideoEditPostEditVideoMinimaxH3ReferenceToVideo.g.cs @@ -0,0 +1,116 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IVideoEditClient + { + /// + /// Reference to video with MiniMax H3
+ /// Produce a video from a text prompt and optional reference media with
+ /// MiniMax H3. Upload `reference_images` and `reference_audios` using
+ /// `multipart/form-data`, and address them in the prompt by position
+ /// (`Image 1`, `Audio 1`, …). Returns a `generation_id`; poll
+ /// `GET /v2/generations/{generation_id}` or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task VideoEditPostEditVideoMinimaxH3ReferenceToVideoAsync( + + global::Ideogram.VideoEditPostEditVideoMinimaxH3ReferenceToVideoRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Reference to video with MiniMax H3
+ /// Produce a video from a text prompt and optional reference media with
+ /// MiniMax H3. Upload `reference_images` and `reference_audios` using
+ /// `multipart/form-data`, and address them in the prompt by position
+ /// (`Image 1`, `Audio 1`, …). Returns a `generation_id`; poll
+ /// `GET /v2/generations/{generation_id}` or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> VideoEditPostEditVideoMinimaxH3ReferenceToVideoAsResponseAsync( + + global::Ideogram.VideoEditPostEditVideoMinimaxH3ReferenceToVideoRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Reference to video with MiniMax H3
+ /// Produce a video from a text prompt and optional reference media with
+ /// MiniMax H3. Upload `reference_images` and `reference_audios` using
+ /// `multipart/form-data`, and address them in the prompt by position
+ /// (`Image 1`, `Audio 1`, …). Returns a `generation_id`; poll
+ /// `GET /v2/generations/{generation_id}` or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// A natural-language prompt describing the video to produce. Reference media is addressed by position, as in "Image 1 walks toward the camera with the motion of Video 1". + /// + /// + /// Images to use as references (max size 50MB each), as raw bytes, in prompt order; only common image formats such as JPEG, PNG, and WEBP are supported. Uploaded images are used for this request only and are not stored. + /// + /// + /// MP3 or WAV audio references, in prompt order as Audio 1, Audio 2, and Audio 3. Multipart uploads only; up to 15 MB per file and 2–15 seconds each. Audio and video references must total no more than 15 seconds. Requires a reference image or video. At most 12 references across images, videos, and audio. Used only for this request and not saved as assets. + /// + /// + /// The aspect ratio of the generated video.
+ /// Default Value: 16x9 + /// + /// + /// The resolution tier of the generated video, spelled the way MiniMax
+ /// spells it. `480P` and `768P` are generated natively; `2K` and `4K` are
+ /// upscaled from a `768P` result.
+ /// Higher tiers cost more.
+ /// Default Value: 2K + /// + /// + /// The length of the generated video in seconds.
+ /// Default Value: 5 + /// + /// + /// How much the model may rewrite the prompt before generating. `disabled`
+ /// uses the prompt as written; the other modes trade latency for a richer
+ /// rewrite.
+ /// Default Value: balanced + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task VideoEditPostEditVideoMinimaxH3ReferenceToVideoAsync( + string prompt, + bool? dryRun = default, + global::System.Collections.Generic.IList? referenceImages = default, + global::System.Collections.Generic.IList? referenceAudios = default, + global::Ideogram.MinimaxH3AspectRatio? aspectRatio = default, + global::Ideogram.MinimaxH3Resolution? resolution = default, + int? duration = default, + global::Ideogram.MinimaxH3PromptExpansionMode? promptExpansionMode = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.PostGenerateVideoKlingV3StandardImageToVideo.g.cs b/src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.PostGenerateVideoKlingV3StandardImageToVideo.g.cs deleted file mode 100644 index f2fe01be..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.PostGenerateVideoKlingV3StandardImageToVideo.g.cs +++ /dev/null @@ -1,145 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IVideoGenerateClient - { - /// - /// Image to video with Kling v3 Standard
- /// Generate a video from a first-frame image and a text prompt with Kling
- /// v3 Standard. Upload the first frame as `image`, and optionally a final
- /// frame as `end_image`, using `multipart/form-data`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateVideoKlingV3StandardImageToVideoAsync( - - global::Ideogram.GenerateVideoKlingV3StandardImageToVideoRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Image to video with Kling v3 Standard
- /// Generate a video from a first-frame image and a text prompt with Kling
- /// v3 Standard. Upload the first frame as `image`, and optionally a final
- /// frame as `end_image`, using `multipart/form-data`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostGenerateVideoKlingV3StandardImageToVideoAsResponseAsync( - - global::Ideogram.GenerateVideoKlingV3StandardImageToVideoRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Image to video with Kling v3 Standard
- /// Generate a video from a first-frame image and a text prompt with Kling
- /// v3 Standard. Upload the first frame as `image`, and optionally a final
- /// frame as `end_image`, using `multipart/form-data`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// A reference to an image already stored with Ideogram to use as the first frame, in place of uploading `image`. Only image assets are accepted. - /// - /// - /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - /// - /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - /// - /// An optional final frame, as a reference to an image already stored with Ideogram. When supplied, the generated video transitions from the first frame to this one. Only image assets are accepted. - /// - /// - /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. - /// - /// - /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. - /// - /// - /// A natural-language prompt describing how the first frame should animate.
- /// Example: The camera slowly pans right as the waves roll in. - /// - /// - /// Description of what to keep out of the video. Descriptions in the prompt take precedence over descriptions in the negative prompt. - /// - /// - /// The length of the generated video in seconds. Defaults to 5 seconds
- /// when omitted.
- /// Example: 5 - /// - /// - /// Whether to generate an audio track for the video. Audio roughly
- /// doubles the provider cost and is subject to stricter output moderation.
- /// Default Value: false - /// - /// - /// How the prompt is staged. `customize` follows the prompt as written;
- /// `intelligent` lets the model break the prompt into its own shots.
- /// Default Value: customize - /// - /// - /// How closely the video follows the prompt, from 0 to 1. Lower values
- /// leave the model more freedom. Defaults to 0.5 when omitted.
- /// Example: 0.5F - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output videos are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateVideoKlingV3StandardImageToVideoAsync( - string prompt, - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - global::Ideogram.AssetIdentifier? endImageAssetIdentifier = default, - byte[]? endImage = default, - string? endImagename = default, - string? negativePrompt = default, - int? duration = default, - bool? generateAudio = default, - global::Ideogram.KlingV3ShotType? shotType = default, - float? cfgScale = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.PostGenerateVideoKlingV3StandardTextToVideo.g.cs b/src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.PostGenerateVideoKlingV3StandardTextToVideo.g.cs deleted file mode 100644 index ee261acc..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.PostGenerateVideoKlingV3StandardTextToVideo.g.cs +++ /dev/null @@ -1,120 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IVideoGenerateClient - { - /// - /// Text to video with Kling v3 Standard
- /// Generate a video from a text prompt with Kling v3 Standard.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateVideoKlingV3StandardTextToVideoAsync( - - global::Ideogram.GenerateVideoKlingV3StandardTextToVideoRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Text to video with Kling v3 Standard
- /// Generate a video from a text prompt with Kling v3 Standard.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostGenerateVideoKlingV3StandardTextToVideoAsResponseAsync( - - global::Ideogram.GenerateVideoKlingV3StandardTextToVideoRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Text to video with Kling v3 Standard
- /// Generate a video from a text prompt with Kling v3 Standard.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// A natural-language prompt describing the video to generate.
- /// Example: A red fox running through a snowy forest at dawn. - /// - /// - /// Description of what to keep out of the video. Descriptions in the prompt take precedence over descriptions in the negative prompt. - /// - /// - /// The aspect ratio of the generated video.
- /// Default Value: 16x9 - /// - /// - /// The length of the generated video in seconds. Defaults to 5 seconds
- /// when omitted.
- /// Example: 5 - /// - /// - /// Whether to generate an audio track for the video. Audio roughly
- /// doubles the provider cost and is subject to stricter output moderation.
- /// Default Value: false - /// - /// - /// How the prompt is staged. `customize` follows the prompt as written;
- /// `intelligent` lets the model break the prompt into its own shots.
- /// Default Value: customize - /// - /// - /// How closely the video follows the prompt, from 0 to 1. Lower values
- /// leave the model more freedom. Defaults to 0.5 when omitted.
- /// Example: 0.5F - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output videos are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateVideoKlingV3StandardTextToVideoAsync( - string prompt, - bool? dryRun = default, - string? negativePrompt = default, - global::Ideogram.KlingV3AspectRatio? aspectRatio = default, - int? duration = default, - bool? generateAudio = default, - global::Ideogram.KlingV3ShotType? shotType = default, - float? cfgScale = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.PostGenerateVideoMinimaxH3ImageToVideo.g.cs b/src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.PostGenerateVideoMinimaxH3ImageToVideo.g.cs deleted file mode 100644 index f3978907..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.PostGenerateVideoMinimaxH3ImageToVideo.g.cs +++ /dev/null @@ -1,131 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IVideoGenerateClient - { - /// - /// Image to video with MiniMax H3
- /// Generate a video from a first-frame image and a text prompt with
- /// MiniMax H3. Upload the first frame as `image`, and optionally a final
- /// frame as `end_image`, using `multipart/form-data`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateVideoMinimaxH3ImageToVideoAsync( - - global::Ideogram.GenerateVideoMinimaxH3ImageToVideoRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Image to video with MiniMax H3
- /// Generate a video from a first-frame image and a text prompt with
- /// MiniMax H3. Upload the first frame as `image`, and optionally a final
- /// frame as `end_image`, using `multipart/form-data`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostGenerateVideoMinimaxH3ImageToVideoAsResponseAsync( - - global::Ideogram.GenerateVideoMinimaxH3ImageToVideoRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Image to video with MiniMax H3
- /// Generate a video from a first-frame image and a text prompt with
- /// MiniMax H3. Upload the first frame as `image`, and optionally a final
- /// frame as `end_image`, using `multipart/form-data`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// A reference to an image already stored with Ideogram to use as the first frame, in place of uploading `image`. Only image assets are accepted. - /// - /// - /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - /// - /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - /// - /// An optional final frame, as a reference to an image already stored with Ideogram. When supplied, the generated video transitions from the first frame to this one. Only image assets are accepted. - /// - /// - /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. - /// - /// - /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. - /// - /// - /// A natural-language prompt describing how the first frame should animate.
- /// Example: The camera slowly pans right as the waves roll in. - /// - /// - /// The resolution tier of the generated video, spelled the way MiniMax
- /// spells it. `480P` and `768P` are generated natively; `2K` and `4K` are
- /// upscaled from a `768P` result.
- /// Higher tiers cost more.
- /// Default Value: 2K - /// - /// - /// The length of the generated video in seconds.
- /// Default Value: 5
- /// Example: 5 - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output video is added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateVideoMinimaxH3ImageToVideoAsync( - string prompt, - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - global::Ideogram.AssetIdentifier? endImageAssetIdentifier = default, - byte[]? endImage = default, - string? endImagename = default, - global::Ideogram.MinimaxH3Resolution? resolution = default, - int? duration = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.PostGenerateVideoMinimaxH3TextToVideo.g.cs b/src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.PostGenerateVideoMinimaxH3TextToVideo.g.cs deleted file mode 100644 index 929426d0..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.PostGenerateVideoMinimaxH3TextToVideo.g.cs +++ /dev/null @@ -1,106 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IVideoGenerateClient - { - /// - /// Text to video with MiniMax H3
- /// Generate a video from a text prompt with MiniMax H3.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateVideoMinimaxH3TextToVideoAsync( - - global::Ideogram.GenerateVideoMinimaxH3TextToVideoRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Text to video with MiniMax H3
- /// Generate a video from a text prompt with MiniMax H3.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostGenerateVideoMinimaxH3TextToVideoAsResponseAsync( - - global::Ideogram.GenerateVideoMinimaxH3TextToVideoRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Text to video with MiniMax H3
- /// Generate a video from a text prompt with MiniMax H3.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// A natural-language prompt describing the video to generate.
- /// Example: A red fox running through a snowy forest at dawn. - /// - /// - /// The aspect ratio of the generated video.
- /// Default Value: 16x9 - /// - /// - /// The resolution tier of the generated video, spelled the way MiniMax
- /// spells it. `480P` and `768P` are generated natively; `2K` and `4K` are
- /// upscaled from a `768P` result.
- /// Higher tiers cost more.
- /// Default Value: 2K - /// - /// - /// The length of the generated video in seconds.
- /// Default Value: 5
- /// Example: 5 - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output video is added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateVideoMinimaxH3TextToVideoAsync( - string prompt, - bool? dryRun = default, - global::Ideogram.MinimaxH3AspectRatio? aspectRatio = default, - global::Ideogram.MinimaxH3Resolution? resolution = default, - int? duration = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.PostGenerateVideoSeedDance25ImageToVideo.g.cs b/src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.PostGenerateVideoSeedDance25ImageToVideo.g.cs deleted file mode 100644 index a901b6d9..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.PostGenerateVideoSeedDance25ImageToVideo.g.cs +++ /dev/null @@ -1,134 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IVideoGenerateClient - { - /// - /// Image to video with Seedance 2.5
- /// Generate a video from a first-frame image and a text prompt with
- /// Seedance 2.5. Upload the first frame as `image`, and optionally a final
- /// frame as `end_image`, using `multipart/form-data`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateVideoSeedDance25ImageToVideoAsync( - - global::Ideogram.GenerateVideoSeedDance25ImageToVideoRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Image to video with Seedance 2.5
- /// Generate a video from a first-frame image and a text prompt with
- /// Seedance 2.5. Upload the first frame as `image`, and optionally a final
- /// frame as `end_image`, using `multipart/form-data`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostGenerateVideoSeedDance25ImageToVideoAsResponseAsync( - - global::Ideogram.GenerateVideoSeedDance25ImageToVideoRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Image to video with Seedance 2.5
- /// Generate a video from a first-frame image and a text prompt with
- /// Seedance 2.5. Upload the first frame as `image`, and optionally a final
- /// frame as `end_image`, using `multipart/form-data`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// A reference to an image already stored with Ideogram to use as the first frame, in place of uploading `image`. Only image assets are accepted. - /// - /// - /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - /// - /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - /// - /// An optional final frame, as a reference to an image already stored with Ideogram. When supplied, the generated video transitions from the first frame to this one. Only image assets are accepted. - /// - /// - /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. - /// - /// - /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. - /// - /// - /// A natural-language prompt describing how the first frame should animate.
- /// Example: The camera slowly pans right as the waves roll in. - /// - /// - /// The resolution tier of the generated video.
- /// Default Value: 720p - /// - /// - /// The length of the generated video in seconds. When omitted, the model
- /// picks the best duration for the prompt ("auto").
- /// Example: 5 - /// - /// - /// Whether to generate an audio track for the video. Audio roughly
- /// doubles the provider cost and is subject to stricter output moderation.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output video is added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateVideoSeedDance25ImageToVideoAsync( - string prompt, - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - global::Ideogram.AssetIdentifier? endImageAssetIdentifier = default, - byte[]? endImage = default, - string? endImagename = default, - global::Ideogram.SeedDance25Resolution? resolution = default, - int? duration = default, - bool? generateAudio = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.PostGenerateVideoSeedDance25ReferenceToVideo.g.cs b/src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.PostGenerateVideoSeedDance25ReferenceToVideo.g.cs deleted file mode 100644 index 76bb28d3..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.PostGenerateVideoSeedDance25ReferenceToVideo.g.cs +++ /dev/null @@ -1,132 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IVideoGenerateClient - { - /// - /// Reference to video with Seedance 2.5
- /// Generate a video from a text prompt and reference media with
- /// Seedance 2.5. Upload at least one image in `reference_images`, plus optional
- /// `reference_audios`, using `multipart/form-data`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateVideoSeedDance25ReferenceToVideoAsync( - - global::Ideogram.GenerateVideoSeedDance25ReferenceToVideoRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Reference to video with Seedance 2.5
- /// Generate a video from a text prompt and reference media with
- /// Seedance 2.5. Upload at least one image in `reference_images`, plus optional
- /// `reference_audios`, using `multipart/form-data`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostGenerateVideoSeedDance25ReferenceToVideoAsResponseAsync( - - global::Ideogram.GenerateVideoSeedDance25ReferenceToVideoRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Reference to video with Seedance 2.5
- /// Generate a video from a text prompt and reference media with
- /// Seedance 2.5. Upload at least one image in `reference_images`, plus optional
- /// `reference_audios`, using `multipart/form-data`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// A natural-language prompt describing the video to produce. Refer to references by position, as in "[Image1] walks toward the camera".
- /// Example: [Image1] walks through the snowy forest at dawn. - /// - /// - /// Images already stored with Ideogram to use as references, by reference, in prompt order. Cannot be combined with `reference_images`. Only image assets are accepted. - /// - /// - /// Reference images, in prompt order. Common formats such as JPEG, PNG, and WEBP are supported, up to 50MB each. Multipart requests only. Uploaded images are used for this request only and are not stored. - /// - /// - /// Uploaded or generated videos to use as references, by reference, in prompt order. Each clip must be between 2 and 30 seconds long, and the clips must total no more than 30 seconds. Upload video files first and pass their asset identifiers. - /// - /// - /// MP3 or WAV audio references, in prompt order. Multipart requests only. Each file must be at most 15 MB and between 2 and 30 seconds long, with a combined duration of at most 30 seconds. Requires at least one reference image. Audio is used for this request only and is not saved to your library. - /// - /// - /// The aspect ratio of the generated video. `auto` lets the model choose the
- /// most suitable ratio from the prompt; any other value pins the ratio.
- /// Default Value: auto - /// - /// - /// The resolution tier of the generated video.
- /// Default Value: 720p - /// - /// - /// The length of the generated video in seconds. When omitted, the model
- /// picks the best duration for the prompt ("auto").
- /// Example: 5 - /// - /// - /// Whether to generate an audio track for the video. Audio roughly
- /// doubles the provider cost and is subject to stricter output moderation.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output videos are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateVideoSeedDance25ReferenceToVideoAsync( - string prompt, - bool? dryRun = default, - global::System.Collections.Generic.IList? referenceImageAssetIdentifiers = default, - global::System.Collections.Generic.IList? referenceImages = default, - global::System.Collections.Generic.IList? referenceVideoAssetIdentifiers = default, - global::System.Collections.Generic.IList? referenceAudios = default, - global::Ideogram.SeedDance2AspectRatio? aspectRatio = default, - global::Ideogram.SeedDance25Resolution? resolution = default, - int? duration = default, - bool? generateAudio = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.PostGenerateVideoSeedDance25TextToVideo.g.cs b/src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.PostGenerateVideoSeedDance25TextToVideo.g.cs deleted file mode 100644 index 6087d48c..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.PostGenerateVideoSeedDance25TextToVideo.g.cs +++ /dev/null @@ -1,110 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IVideoGenerateClient - { - /// - /// Text to video with Seedance 2.5
- /// Generate a video from a text prompt with Seedance 2.5, at up to 1080p and
- /// 30 seconds. Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateVideoSeedDance25TextToVideoAsync( - - global::Ideogram.GenerateVideoSeedDance25TextToVideoRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Text to video with Seedance 2.5
- /// Generate a video from a text prompt with Seedance 2.5, at up to 1080p and
- /// 30 seconds. Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostGenerateVideoSeedDance25TextToVideoAsResponseAsync( - - global::Ideogram.GenerateVideoSeedDance25TextToVideoRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Text to video with Seedance 2.5
- /// Generate a video from a text prompt with Seedance 2.5, at up to 1080p and
- /// 30 seconds. Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// A natural-language prompt describing the video to generate.
- /// Example: A red fox running through a snowy forest at dawn. - /// - /// - /// The aspect ratio of the generated video. `auto` lets the model choose the
- /// most suitable ratio from the prompt; any other value pins the ratio.
- /// Default Value: auto - /// - /// - /// The resolution tier of the generated video.
- /// Default Value: 720p - /// - /// - /// The length of the generated video in seconds. When omitted, the model
- /// picks the best duration for the prompt ("auto").
- /// Example: 5 - /// - /// - /// Whether to generate an audio track for the video. Audio roughly
- /// doubles the provider cost and is subject to stricter output moderation.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output video is added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateVideoSeedDance25TextToVideoAsync( - string prompt, - bool? dryRun = default, - global::Ideogram.SeedDance2AspectRatio? aspectRatio = default, - global::Ideogram.SeedDance25Resolution? resolution = default, - int? duration = default, - bool? generateAudio = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.PostGenerateVideoSeedDance2ImageToVideo.g.cs b/src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.PostGenerateVideoSeedDance2ImageToVideo.g.cs deleted file mode 100644 index 6f57cc4c..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.PostGenerateVideoSeedDance2ImageToVideo.g.cs +++ /dev/null @@ -1,140 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IVideoGenerateClient - { - /// - /// Image to video with Seedance 2.0
- /// Generate one or more videos from a first-frame image and a text prompt
- /// with Seedance 2.0. Upload the first frame as `image`, and optionally a final
- /// frame as `end_image`, using `multipart/form-data`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateVideoSeedDance2ImageToVideoAsync( - - global::Ideogram.GenerateVideoSeedDance2ImageToVideoRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Image to video with Seedance 2.0
- /// Generate one or more videos from a first-frame image and a text prompt
- /// with Seedance 2.0. Upload the first frame as `image`, and optionally a final
- /// frame as `end_image`, using `multipart/form-data`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostGenerateVideoSeedDance2ImageToVideoAsResponseAsync( - - global::Ideogram.GenerateVideoSeedDance2ImageToVideoRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Image to video with Seedance 2.0
- /// Generate one or more videos from a first-frame image and a text prompt
- /// with Seedance 2.0. Upload the first frame as `image`, and optionally a final
- /// frame as `end_image`, using `multipart/form-data`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// A reference to an image already stored with Ideogram to use as the first frame, in place of uploading `image`. Only image assets are accepted. - /// - /// - /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - /// - /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - /// - /// An optional final frame, as a reference to an image already stored with Ideogram. When supplied, the generated video transitions from the first frame to this one. Only image assets are accepted. - /// - /// - /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. - /// - /// - /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. - /// - /// - /// A natural-language prompt describing how the first frame should animate.
- /// Example: The camera slowly pans right as the waves roll in. - /// - /// - /// The aspect ratio of the generated video. `auto` lets the model choose the
- /// most suitable ratio from the prompt; any other value pins the ratio.
- /// Default Value: auto - /// - /// - /// The resolution tier of the generated video.
- /// Default Value: 720p - /// - /// - /// The length of the generated video in seconds. When omitted, the model
- /// picks the best duration for the prompt ("auto").
- /// Example: 5 - /// - /// - /// Whether to generate an audio track for the video. Audio roughly
- /// doubles the provider cost and is subject to stricter output moderation.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output videos are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateVideoSeedDance2ImageToVideoAsync( - string prompt, - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - global::Ideogram.AssetIdentifier? endImageAssetIdentifier = default, - byte[]? endImage = default, - string? endImagename = default, - global::Ideogram.SeedDance2AspectRatio? aspectRatio = default, - global::Ideogram.SeedDance2Resolution? resolution = default, - int? duration = default, - bool? generateAudio = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.PostGenerateVideoSeedDance2ReferenceToVideo.g.cs b/src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.PostGenerateVideoSeedDance2ReferenceToVideo.g.cs deleted file mode 100644 index 5c9298f4..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.PostGenerateVideoSeedDance2ReferenceToVideo.g.cs +++ /dev/null @@ -1,132 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IVideoGenerateClient - { - /// - /// Reference to video with Seedance 2.0
- /// Generate a video from a text prompt and reference media with
- /// Seedance 2.0. Upload at least one image in `reference_images`, plus optional
- /// `reference_audios`, using `multipart/form-data`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateVideoSeedDance2ReferenceToVideoAsync( - - global::Ideogram.GenerateVideoSeedDance2ReferenceToVideoRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Reference to video with Seedance 2.0
- /// Generate a video from a text prompt and reference media with
- /// Seedance 2.0. Upload at least one image in `reference_images`, plus optional
- /// `reference_audios`, using `multipart/form-data`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostGenerateVideoSeedDance2ReferenceToVideoAsResponseAsync( - - global::Ideogram.GenerateVideoSeedDance2ReferenceToVideoRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Reference to video with Seedance 2.0
- /// Generate a video from a text prompt and reference media with
- /// Seedance 2.0. Upload at least one image in `reference_images`, plus optional
- /// `reference_audios`, using `multipart/form-data`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// A natural-language prompt describing the video to produce. Refer to references by position, as in "@Image1 walks toward the camera".
- /// Example: @Image1 walks through the snowy forest at dawn. - /// - /// - /// Images already stored with Ideogram to use as references, by reference, in prompt order. Cannot be combined with `reference_images`. Only image assets are accepted. - /// - /// - /// Reference images, in prompt order. Common formats such as JPEG, PNG, and WEBP are supported, up to 50MB each. Multipart requests only. Uploaded images are used for this request only and are not stored. - /// - /// - /// Uploaded or generated videos to use as references, by reference, in prompt order. Each clip must be between 2 and 15 seconds long, and the clips must total no more than 15 seconds. Upload video files first and pass their asset identifiers. - /// - /// - /// MP3 or WAV audio references, in prompt order. Multipart requests only. Each file must be at most 15 MB and between 2 and 15 seconds long, with a combined duration of at most 15 seconds. Requires at least one reference image. Audio is used for this request only and is not saved to your library. - /// - /// - /// The aspect ratio of the generated video. `auto` lets the model choose the
- /// most suitable ratio from the prompt; any other value pins the ratio.
- /// Default Value: auto - /// - /// - /// The resolution tier of the generated video.
- /// Default Value: 720p - /// - /// - /// The length of the generated video in seconds. When omitted, the model
- /// picks the best duration for the prompt ("auto").
- /// Example: 5 - /// - /// - /// Whether to generate an audio track for the video. Audio roughly
- /// doubles the provider cost and is subject to stricter output moderation.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output videos are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateVideoSeedDance2ReferenceToVideoAsync( - string prompt, - bool? dryRun = default, - global::System.Collections.Generic.IList? referenceImageAssetIdentifiers = default, - global::System.Collections.Generic.IList? referenceImages = default, - global::System.Collections.Generic.IList? referenceVideoAssetIdentifiers = default, - global::System.Collections.Generic.IList? referenceAudios = default, - global::Ideogram.SeedDance2AspectRatio? aspectRatio = default, - global::Ideogram.SeedDance2Resolution? resolution = default, - int? duration = default, - bool? generateAudio = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.PostGenerateVideoSeedDance2TextToVideo.g.cs b/src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.PostGenerateVideoSeedDance2TextToVideo.g.cs deleted file mode 100644 index d069fd44..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.PostGenerateVideoSeedDance2TextToVideo.g.cs +++ /dev/null @@ -1,110 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IVideoGenerateClient - { - /// - /// Text to video with Seedance 2.0
- /// Generate one or more videos from a text prompt with Seedance 2.0.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateVideoSeedDance2TextToVideoAsync( - - global::Ideogram.GenerateVideoSeedDance2TextToVideoRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Text to video with Seedance 2.0
- /// Generate one or more videos from a text prompt with Seedance 2.0.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostGenerateVideoSeedDance2TextToVideoAsResponseAsync( - - global::Ideogram.GenerateVideoSeedDance2TextToVideoRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Text to video with Seedance 2.0
- /// Generate one or more videos from a text prompt with Seedance 2.0.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// A natural-language prompt describing the video to generate.
- /// Example: A red fox running through a snowy forest at dawn. - /// - /// - /// The aspect ratio of the generated video. `auto` lets the model choose the
- /// most suitable ratio from the prompt; any other value pins the ratio.
- /// Default Value: auto - /// - /// - /// The resolution tier of the generated video.
- /// Default Value: 720p - /// - /// - /// The length of the generated video in seconds. When omitted, the model
- /// picks the best duration for the prompt ("auto").
- /// Example: 5 - /// - /// - /// Whether to generate an audio track for the video. Audio roughly
- /// doubles the provider cost and is subject to stricter output moderation.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output videos are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostGenerateVideoSeedDance2TextToVideoAsync( - string prompt, - bool? dryRun = default, - global::Ideogram.SeedDance2AspectRatio? aspectRatio = default, - global::Ideogram.SeedDance2Resolution? resolution = default, - int? duration = default, - bool? generateAudio = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.PostLivingImage.g.cs b/src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.PostLivingImage.g.cs deleted file mode 100644 index 2a31465f..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.PostLivingImage.g.cs +++ /dev/null @@ -1,79 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IVideoGenerateClient - { - /// - /// Turn a still image into a subtle looping video
- /// Animates one image into a short, loop-ready clip for use as a living background. The camera stays fixed and only the parts of the scene that would move in real life move: water, light, mist, particles, fabric, creatures. Ideogram inspects the image and writes the motion prompt, so the request needs only the image.
- /// Video generation runs asynchronously. Poll `GET /v1/generations/{generation_id}` with the returned `generation_id` until the generation completes or fails. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostLivingImageAsync( - - global::Ideogram.LivingImageRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Turn a still image into a subtle looping video
- /// Animates one image into a short, loop-ready clip for use as a living background. The camera stays fixed and only the parts of the scene that would move in real life move: water, light, mist, particles, fabric, creatures. Ideogram inspects the image and writes the motion prompt, so the request needs only the image.
- /// Video generation runs asynchronously. Poll `GET /v1/generations/{generation_id}` with the returned `generation_id` until the generation completes or fails. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostLivingImageAsResponseAsync( - - global::Ideogram.LivingImageRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Turn a still image into a subtle looping video
- /// Animates one image into a short, loop-ready clip for use as a living background. The camera stays fixed and only the parts of the scene that would move in real life move: water, light, mist, particles, fabric, creatures. Ideogram inspects the image and writes the motion prompt, so the request needs only the image.
- /// Video generation runs asynchronously. Poll `GET /v1/generations/{generation_id}` with the returned `generation_id` until the generation completes or fails. - ///
- /// - /// Default Value: false - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The output resolution tier. `standard` renders at 768P; `high` renders at 2K. Higher tiers cost more.
- /// Default Value: standard - /// - /// - /// The length of the generated video in seconds.
- /// Default Value: 8
- /// Example: 8 - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output video is added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostLivingImageAsync( - global::Ideogram.AssetIdentifier imageAssetIdentifier, - bool? dryRun = default, - global::Ideogram.LivingImageQuality? quality = default, - int? duration = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.PostProduct360Video.g.cs b/src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.PostProduct360Video.g.cs deleted file mode 100644 index 63c9749f..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.PostProduct360Video.g.cs +++ /dev/null @@ -1,87 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IVideoGenerateClient - { - /// - /// Product 360 Video
- /// Animates one product image through a complete turntable revolution and returns to the starting pose so the result loops cleanly.
- /// Video generation runs asynchronously. Poll `GET /v2/generations/{generation_id}` with the returned `generation_id` until the generation completes or fails. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostProduct360VideoAsync( - - global::Ideogram.Product360VideoRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Product 360 Video
- /// Animates one product image through a complete turntable revolution and returns to the starting pose so the result loops cleanly.
- /// Video generation runs asynchronously. Poll `GET /v2/generations/{generation_id}` with the returned `generation_id` until the generation completes or fails. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostProduct360VideoAsResponseAsync( - - global::Ideogram.Product360VideoRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Product 360 Video
- /// Animates one product image through a complete turntable revolution and returns to the starting pose so the result loops cleanly.
- /// Video generation runs asynchronously. Poll `GET /v2/generations/{generation_id}` with the returned `generation_id` until the generation completes or fails. - ///
- /// - /// Default Value: false - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// Direction the product rotates around its vertical axis. - /// - /// - /// Optional factual description of the product in the source image. - /// - /// - /// The resolution tier of the generated video.
- /// Default Value: 720p - /// - /// - /// The length of the generated video in seconds. When omitted, the model
- /// picks the best duration for the prompt ("auto").
- /// Example: 5 - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output video is added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostProduct360VideoAsync( - global::Ideogram.AssetIdentifier imageAssetIdentifier, - global::Ideogram.Product360VideoDirection direction, - bool? dryRun = default, - string? productDescription = default, - global::Ideogram.SeedDance25Resolution? resolution = default, - int? duration = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideo.g.cs b/src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideo.g.cs new file mode 100644 index 00000000..09281df7 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideo.g.cs @@ -0,0 +1,276 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IVideoGenerateClient + { + /// + /// Image to video with Kling v3 Standard
+ /// Generate a video from a first-frame image and a text prompt with Kling
+ /// v3 Standard. Upload the first frame as `image`, and optionally a final
+ /// frame as `end_image`, using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoAsync( + + global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Image to video with Kling v3 Standard
+ /// Generate a video from a first-frame image and a text prompt with Kling
+ /// v3 Standard. Upload the first frame as `image`, and optionally a final
+ /// frame as `end_image`, using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoAsResponseAsync( + + global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Image to video with Kling v3 Standard
+ /// Generate a video from a first-frame image and a text prompt with Kling
+ /// v3 Standard. Upload the first frame as `image`, and optionally a final
+ /// frame as `end_image`, using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. + /// + /// + /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. + /// + /// + /// A natural-language prompt describing how the first frame should animate. + /// + /// + /// Description of what to keep out of the video. Descriptions in the prompt take precedence over descriptions in the negative prompt. + /// + /// + /// The length of the generated video in seconds. Defaults to 5 seconds
+ /// when omitted. + /// + /// + /// Whether to generate an audio track for the video. Audio roughly
+ /// doubles the provider cost and is subject to stricter output moderation.
+ /// Default Value: false + /// + /// + /// How the prompt is staged. `customize` follows the prompt as written;
+ /// `intelligent` lets the model break the prompt into its own shots.
+ /// Default Value: customize + /// + /// + /// How closely the video follows the prompt, from 0 to 1. Lower values
+ /// leave the model more freedom. Defaults to 0.5 when omitted. + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoAsync( + byte[] image, + string imagename, + string prompt, + bool? dryRun = default, + byte[]? endImage = default, + string? endImagename = default, + string? negativePrompt = default, + int? duration = default, + bool? generateAudio = default, + global::Ideogram.KlingV3ShotType? shotType = default, + string? cfgScale = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Image to video with Kling v3 Standard
+ /// Generate a video from a first-frame image and a text prompt with Kling
+ /// v3 Standard. Upload the first frame as `image`, and optionally a final
+ /// frame as `end_image`, using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. + /// + /// + /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. + /// + /// + /// A natural-language prompt describing how the first frame should animate. + /// + /// + /// Description of what to keep out of the video. Descriptions in the prompt take precedence over descriptions in the negative prompt. + /// + /// + /// The length of the generated video in seconds. Defaults to 5 seconds
+ /// when omitted. + /// + /// + /// Whether to generate an audio track for the video. Audio roughly
+ /// doubles the provider cost and is subject to stricter output moderation.
+ /// Default Value: false + /// + /// + /// How the prompt is staged. `customize` follows the prompt as written;
+ /// `intelligent` lets the model break the prompt into its own shots.
+ /// Default Value: customize + /// + /// + /// How closely the video follows the prompt, from 0 to 1. Lower values
+ /// leave the model more freedom. Defaults to 0.5 when omitted. + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoAsync( + global::System.IO.Stream image, + string imagename, + string prompt, + bool? dryRun = default, + global::System.IO.Stream? endImage = default, + string? endImagename = default, + string? negativePrompt = default, + int? duration = default, + bool? generateAudio = default, + global::Ideogram.KlingV3ShotType? shotType = default, + string? cfgScale = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Image to video with Kling v3 Standard
+ /// Generate a video from a first-frame image and a text prompt with Kling
+ /// v3 Standard. Upload the first frame as `image`, and optionally a final
+ /// frame as `end_image`, using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. + /// + /// + /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. + /// + /// + /// A natural-language prompt describing how the first frame should animate. + /// + /// + /// Description of what to keep out of the video. Descriptions in the prompt take precedence over descriptions in the negative prompt. + /// + /// + /// The length of the generated video in seconds. Defaults to 5 seconds
+ /// when omitted. + /// + /// + /// Whether to generate an audio track for the video. Audio roughly
+ /// doubles the provider cost and is subject to stricter output moderation.
+ /// Default Value: false + /// + /// + /// How the prompt is staged. `customize` follows the prompt as written;
+ /// `intelligent` lets the model break the prompt into its own shots.
+ /// Default Value: customize + /// + /// + /// How closely the video follows the prompt, from 0 to 1. Lower values
+ /// leave the model more freedom. Defaults to 0.5 when omitted. + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoAsResponseAsync( + global::System.IO.Stream image, + string imagename, + string prompt, + bool? dryRun = default, + global::System.IO.Stream? endImage = default, + string? endImagename = default, + string? negativePrompt = default, + int? duration = default, + bool? generateAudio = default, + global::Ideogram.KlingV3ShotType? shotType = default, + string? cfgScale = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideo.g.cs b/src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideo.g.cs new file mode 100644 index 00000000..46782957 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideo.g.cs @@ -0,0 +1,108 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IVideoGenerateClient + { + /// + /// Text to video with Kling v3 Standard
+ /// Generate a video from a text prompt with Kling v3 Standard.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoAsync( + + global::Ideogram.GenerateVideoKlingV3StandardTextToVideoRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Text to video with Kling v3 Standard
+ /// Generate a video from a text prompt with Kling v3 Standard.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoAsResponseAsync( + + global::Ideogram.GenerateVideoKlingV3StandardTextToVideoRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Text to video with Kling v3 Standard
+ /// Generate a video from a text prompt with Kling v3 Standard.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// A natural-language prompt describing the video to generate. + /// + /// + /// Description of what to keep out of the video. Descriptions in the prompt take precedence over descriptions in the negative prompt. + /// + /// + /// The aspect ratio of the generated video.
+ /// Default Value: 16x9 + /// + /// + /// The length of the generated video in seconds. Defaults to 5 seconds
+ /// when omitted. + /// + /// + /// Whether to generate an audio track for the video. Audio roughly
+ /// doubles the provider cost and is subject to stricter output moderation.
+ /// Default Value: false + /// + /// + /// How the prompt is staged. `customize` follows the prompt as written;
+ /// `intelligent` lets the model break the prompt into its own shots.
+ /// Default Value: customize + /// + /// + /// How closely the video follows the prompt, from 0 to 1. Lower values
+ /// leave the model more freedom. Defaults to 0.5 when omitted. + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoAsync( + string prompt, + bool? dryRun = default, + string? negativePrompt = default, + global::Ideogram.KlingV3AspectRatio? aspectRatio = default, + int? duration = default, + bool? generateAudio = default, + global::Ideogram.KlingV3ShotType? shotType = default, + string? cfgScale = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideo.g.cs b/src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideo.g.cs new file mode 100644 index 00000000..6f805daf --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideo.g.cs @@ -0,0 +1,237 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IVideoGenerateClient + { + /// + /// Image to video with MiniMax H3
+ /// Generate a video from a first-frame image and a text prompt with
+ /// MiniMax H3. Upload the first frame as `image`, and optionally a final
+ /// frame as `end_image`, using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoAsync( + + global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Image to video with MiniMax H3
+ /// Generate a video from a first-frame image and a text prompt with
+ /// MiniMax H3. Upload the first frame as `image`, and optionally a final
+ /// frame as `end_image`, using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoAsResponseAsync( + + global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Image to video with MiniMax H3
+ /// Generate a video from a first-frame image and a text prompt with
+ /// MiniMax H3. Upload the first frame as `image`, and optionally a final
+ /// frame as `end_image`, using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. + /// + /// + /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. + /// + /// + /// A natural-language prompt describing how the first frame should animate. + /// + /// + /// The resolution tier of the generated video, spelled the way MiniMax
+ /// spells it. `480P` and `768P` are generated natively; `2K` and `4K` are
+ /// upscaled from a `768P` result.
+ /// Higher tiers cost more.
+ /// Default Value: 2K + /// + /// + /// The length of the generated video in seconds.
+ /// Default Value: 5 + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoAsync( + byte[] image, + string imagename, + string prompt, + bool? dryRun = default, + byte[]? endImage = default, + string? endImagename = default, + global::Ideogram.MinimaxH3Resolution? resolution = default, + int? duration = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Image to video with MiniMax H3
+ /// Generate a video from a first-frame image and a text prompt with
+ /// MiniMax H3. Upload the first frame as `image`, and optionally a final
+ /// frame as `end_image`, using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. + /// + /// + /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. + /// + /// + /// A natural-language prompt describing how the first frame should animate. + /// + /// + /// The resolution tier of the generated video, spelled the way MiniMax
+ /// spells it. `480P` and `768P` are generated natively; `2K` and `4K` are
+ /// upscaled from a `768P` result.
+ /// Higher tiers cost more.
+ /// Default Value: 2K + /// + /// + /// The length of the generated video in seconds.
+ /// Default Value: 5 + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoAsync( + global::System.IO.Stream image, + string imagename, + string prompt, + bool? dryRun = default, + global::System.IO.Stream? endImage = default, + string? endImagename = default, + global::Ideogram.MinimaxH3Resolution? resolution = default, + int? duration = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Image to video with MiniMax H3
+ /// Generate a video from a first-frame image and a text prompt with
+ /// MiniMax H3. Upload the first frame as `image`, and optionally a final
+ /// frame as `end_image`, using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. + /// + /// + /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. + /// + /// + /// A natural-language prompt describing how the first frame should animate. + /// + /// + /// The resolution tier of the generated video, spelled the way MiniMax
+ /// spells it. `480P` and `768P` are generated natively; `2K` and `4K` are
+ /// upscaled from a `768P` result.
+ /// Higher tiers cost more.
+ /// Default Value: 2K + /// + /// + /// The length of the generated video in seconds.
+ /// Default Value: 5 + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoAsResponseAsync( + global::System.IO.Stream image, + string imagename, + string prompt, + bool? dryRun = default, + global::System.IO.Stream? endImage = default, + string? endImagename = default, + global::Ideogram.MinimaxH3Resolution? resolution = default, + int? duration = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.VideoGeneratePostGenerateVideoMinimaxH3TextToVideo.g.cs b/src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.VideoGeneratePostGenerateVideoMinimaxH3TextToVideo.g.cs new file mode 100644 index 00000000..df3840aa --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.VideoGeneratePostGenerateVideoMinimaxH3TextToVideo.g.cs @@ -0,0 +1,95 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IVideoGenerateClient + { + /// + /// Text to video with MiniMax H3
+ /// Generate a video from a text prompt with MiniMax H3.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task VideoGeneratePostGenerateVideoMinimaxH3TextToVideoAsync( + + global::Ideogram.GenerateVideoMinimaxH3TextToVideoRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Text to video with MiniMax H3
+ /// Generate a video from a text prompt with MiniMax H3.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> VideoGeneratePostGenerateVideoMinimaxH3TextToVideoAsResponseAsync( + + global::Ideogram.GenerateVideoMinimaxH3TextToVideoRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Text to video with MiniMax H3
+ /// Generate a video from a text prompt with MiniMax H3.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// A natural-language prompt describing the video to generate. + /// + /// + /// The aspect ratio of the generated video.
+ /// Default Value: 16x9 + /// + /// + /// The resolution tier of the generated video, spelled the way MiniMax
+ /// spells it. `480P` and `768P` are generated natively; `2K` and `4K` are
+ /// upscaled from a `768P` result.
+ /// Higher tiers cost more.
+ /// Default Value: 2K + /// + /// + /// The length of the generated video in seconds.
+ /// Default Value: 5 + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task VideoGeneratePostGenerateVideoMinimaxH3TextToVideoAsync( + string prompt, + bool? dryRun = default, + global::Ideogram.MinimaxH3AspectRatio? aspectRatio = default, + global::Ideogram.MinimaxH3Resolution? resolution = default, + int? duration = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.VideoGeneratePostGenerateVideoSeedDance25ImageToVideo.g.cs b/src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.VideoGeneratePostGenerateVideoSeedDance25ImageToVideo.g.cs new file mode 100644 index 00000000..712040b0 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.VideoGeneratePostGenerateVideoSeedDance25ImageToVideo.g.cs @@ -0,0 +1,246 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IVideoGenerateClient + { + /// + /// Image to video with Seedance 2.5
+ /// Generate a video from a first-frame image and a text prompt with
+ /// Seedance 2.5. Upload the first frame as `image`, and optionally a final
+ /// frame as `end_image`, using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task VideoGeneratePostGenerateVideoSeedDance25ImageToVideoAsync( + + global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Image to video with Seedance 2.5
+ /// Generate a video from a first-frame image and a text prompt with
+ /// Seedance 2.5. Upload the first frame as `image`, and optionally a final
+ /// frame as `end_image`, using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> VideoGeneratePostGenerateVideoSeedDance25ImageToVideoAsResponseAsync( + + global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Image to video with Seedance 2.5
+ /// Generate a video from a first-frame image and a text prompt with
+ /// Seedance 2.5. Upload the first frame as `image`, and optionally a final
+ /// frame as `end_image`, using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. + /// + /// + /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. + /// + /// + /// A natural-language prompt describing how the first frame should animate. + /// + /// + /// The resolution tier of the generated video.
+ /// Default Value: 720p + /// + /// + /// The length of the generated video in seconds. When omitted, the model
+ /// picks the best duration for the prompt ("auto"). + /// + /// + /// Whether to generate an audio track for the video. Audio roughly
+ /// doubles the provider cost and is subject to stricter output moderation.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task VideoGeneratePostGenerateVideoSeedDance25ImageToVideoAsync( + byte[] image, + string imagename, + string prompt, + bool? dryRun = default, + byte[]? endImage = default, + string? endImagename = default, + global::Ideogram.SeedDance25Resolution? resolution = default, + int? duration = default, + bool? generateAudio = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Image to video with Seedance 2.5
+ /// Generate a video from a first-frame image and a text prompt with
+ /// Seedance 2.5. Upload the first frame as `image`, and optionally a final
+ /// frame as `end_image`, using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. + /// + /// + /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. + /// + /// + /// A natural-language prompt describing how the first frame should animate. + /// + /// + /// The resolution tier of the generated video.
+ /// Default Value: 720p + /// + /// + /// The length of the generated video in seconds. When omitted, the model
+ /// picks the best duration for the prompt ("auto"). + /// + /// + /// Whether to generate an audio track for the video. Audio roughly
+ /// doubles the provider cost and is subject to stricter output moderation.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task VideoGeneratePostGenerateVideoSeedDance25ImageToVideoAsync( + global::System.IO.Stream image, + string imagename, + string prompt, + bool? dryRun = default, + global::System.IO.Stream? endImage = default, + string? endImagename = default, + global::Ideogram.SeedDance25Resolution? resolution = default, + int? duration = default, + bool? generateAudio = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Image to video with Seedance 2.5
+ /// Generate a video from a first-frame image and a text prompt with
+ /// Seedance 2.5. Upload the first frame as `image`, and optionally a final
+ /// frame as `end_image`, using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. + /// + /// + /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. + /// + /// + /// A natural-language prompt describing how the first frame should animate. + /// + /// + /// The resolution tier of the generated video.
+ /// Default Value: 720p + /// + /// + /// The length of the generated video in seconds. When omitted, the model
+ /// picks the best duration for the prompt ("auto"). + /// + /// + /// Whether to generate an audio track for the video. Audio roughly
+ /// doubles the provider cost and is subject to stricter output moderation.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> VideoGeneratePostGenerateVideoSeedDance25ImageToVideoAsResponseAsync( + global::System.IO.Stream image, + string imagename, + string prompt, + bool? dryRun = default, + global::System.IO.Stream? endImage = default, + string? endImagename = default, + global::Ideogram.SeedDance25Resolution? resolution = default, + int? duration = default, + bool? generateAudio = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideo.g.cs b/src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideo.g.cs new file mode 100644 index 00000000..be22bcb7 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideo.g.cs @@ -0,0 +1,113 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IVideoGenerateClient + { + /// + /// Reference to video with Seedance 2.5
+ /// Generate a video from a text prompt and reference media with
+ /// Seedance 2.5. Upload at least one image in `reference_images`, plus optional
+ /// `reference_audios`, using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoAsync( + + global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Reference to video with Seedance 2.5
+ /// Generate a video from a text prompt and reference media with
+ /// Seedance 2.5. Upload at least one image in `reference_images`, plus optional
+ /// `reference_audios`, using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoAsResponseAsync( + + global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Reference to video with Seedance 2.5
+ /// Generate a video from a text prompt and reference media with
+ /// Seedance 2.5. Upload at least one image in `reference_images`, plus optional
+ /// `reference_audios`, using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// A natural-language prompt describing the video to produce. Refer to references by position, as in "[Image1] walks toward the camera". + /// + /// + /// Reference images, in prompt order. Common formats such as JPEG, PNG, and WEBP are supported, up to 50MB each. Multipart requests only. Uploaded images are used for this request only and are not stored. + /// + /// + /// MP3 or WAV audio references, in prompt order. Multipart requests only. Each file must be at most 15 MB and between 2 and 30 seconds long, with a combined duration of at most 30 seconds. Requires at least one reference image. Audio is used for this request only and is not saved to your library. + /// + /// + /// The aspect ratio of the generated video. `auto` lets the model choose the
+ /// most suitable ratio from the prompt; any other value pins the ratio.
+ /// Default Value: auto + /// + /// + /// The resolution tier of the generated video.
+ /// Default Value: 720p + /// + /// + /// The length of the generated video in seconds. When omitted, the model
+ /// picks the best duration for the prompt ("auto"). + /// + /// + /// Whether to generate an audio track for the video. Audio roughly
+ /// doubles the provider cost and is subject to stricter output moderation.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoAsync( + string prompt, + bool? dryRun = default, + global::System.Collections.Generic.IList? referenceImages = default, + global::System.Collections.Generic.IList? referenceAudios = default, + global::Ideogram.SeedDance2AspectRatio? aspectRatio = default, + global::Ideogram.SeedDance25Resolution? resolution = default, + int? duration = default, + bool? generateAudio = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.VideoGeneratePostGenerateVideoSeedDance25TextToVideo.g.cs b/src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.VideoGeneratePostGenerateVideoSeedDance25TextToVideo.g.cs new file mode 100644 index 00000000..7059ee8c --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.VideoGeneratePostGenerateVideoSeedDance25TextToVideo.g.cs @@ -0,0 +1,99 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IVideoGenerateClient + { + /// + /// Text to video with Seedance 2.5
+ /// Generate a video from a text prompt with Seedance 2.5, at up to 1080p and
+ /// 30 seconds. Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task VideoGeneratePostGenerateVideoSeedDance25TextToVideoAsync( + + global::Ideogram.GenerateVideoSeedDance25TextToVideoRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Text to video with Seedance 2.5
+ /// Generate a video from a text prompt with Seedance 2.5, at up to 1080p and
+ /// 30 seconds. Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> VideoGeneratePostGenerateVideoSeedDance25TextToVideoAsResponseAsync( + + global::Ideogram.GenerateVideoSeedDance25TextToVideoRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Text to video with Seedance 2.5
+ /// Generate a video from a text prompt with Seedance 2.5, at up to 1080p and
+ /// 30 seconds. Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// A natural-language prompt describing the video to generate. + /// + /// + /// The aspect ratio of the generated video. `auto` lets the model choose the
+ /// most suitable ratio from the prompt; any other value pins the ratio.
+ /// Default Value: auto + /// + /// + /// The resolution tier of the generated video.
+ /// Default Value: 720p + /// + /// + /// The length of the generated video in seconds. When omitted, the model
+ /// picks the best duration for the prompt ("auto"). + /// + /// + /// Whether to generate an audio track for the video. Audio roughly
+ /// doubles the provider cost and is subject to stricter output moderation.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task VideoGeneratePostGenerateVideoSeedDance25TextToVideoAsync( + string prompt, + bool? dryRun = default, + global::Ideogram.SeedDance2AspectRatio? aspectRatio = default, + global::Ideogram.SeedDance25Resolution? resolution = default, + int? duration = default, + bool? generateAudio = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.VideoGeneratePostGenerateVideoSeedDance2ImageToVideo.g.cs b/src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.VideoGeneratePostGenerateVideoSeedDance2ImageToVideo.g.cs new file mode 100644 index 00000000..c47fba66 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.VideoGeneratePostGenerateVideoSeedDance2ImageToVideo.g.cs @@ -0,0 +1,264 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IVideoGenerateClient + { + /// + /// Image to video with Seedance 2.0
+ /// Generate one or more videos from a first-frame image and a text prompt
+ /// with Seedance 2.0. Upload the first frame as `image`, and optionally a final
+ /// frame as `end_image`, using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task VideoGeneratePostGenerateVideoSeedDance2ImageToVideoAsync( + + global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Image to video with Seedance 2.0
+ /// Generate one or more videos from a first-frame image and a text prompt
+ /// with Seedance 2.0. Upload the first frame as `image`, and optionally a final
+ /// frame as `end_image`, using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> VideoGeneratePostGenerateVideoSeedDance2ImageToVideoAsResponseAsync( + + global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Image to video with Seedance 2.0
+ /// Generate one or more videos from a first-frame image and a text prompt
+ /// with Seedance 2.0. Upload the first frame as `image`, and optionally a final
+ /// frame as `end_image`, using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. + /// + /// + /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. + /// + /// + /// A natural-language prompt describing how the first frame should animate. + /// + /// + /// The aspect ratio of the generated video. `auto` lets the model choose the
+ /// most suitable ratio from the prompt; any other value pins the ratio.
+ /// Default Value: auto + /// + /// + /// The resolution tier of the generated video.
+ /// Default Value: 720p + /// + /// + /// The length of the generated video in seconds. When omitted, the model
+ /// picks the best duration for the prompt ("auto"). + /// + /// + /// Whether to generate an audio track for the video. Audio roughly
+ /// doubles the provider cost and is subject to stricter output moderation.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task VideoGeneratePostGenerateVideoSeedDance2ImageToVideoAsync( + byte[] image, + string imagename, + string prompt, + bool? dryRun = default, + byte[]? endImage = default, + string? endImagename = default, + global::Ideogram.SeedDance2AspectRatio? aspectRatio = default, + global::Ideogram.SeedDance2Resolution? resolution = default, + int? duration = default, + bool? generateAudio = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Image to video with Seedance 2.0
+ /// Generate one or more videos from a first-frame image and a text prompt
+ /// with Seedance 2.0. Upload the first frame as `image`, and optionally a final
+ /// frame as `end_image`, using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. + /// + /// + /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. + /// + /// + /// A natural-language prompt describing how the first frame should animate. + /// + /// + /// The aspect ratio of the generated video. `auto` lets the model choose the
+ /// most suitable ratio from the prompt; any other value pins the ratio.
+ /// Default Value: auto + /// + /// + /// The resolution tier of the generated video.
+ /// Default Value: 720p + /// + /// + /// The length of the generated video in seconds. When omitted, the model
+ /// picks the best duration for the prompt ("auto"). + /// + /// + /// Whether to generate an audio track for the video. Audio roughly
+ /// doubles the provider cost and is subject to stricter output moderation.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task VideoGeneratePostGenerateVideoSeedDance2ImageToVideoAsync( + global::System.IO.Stream image, + string imagename, + string prompt, + bool? dryRun = default, + global::System.IO.Stream? endImage = default, + string? endImagename = default, + global::Ideogram.SeedDance2AspectRatio? aspectRatio = default, + global::Ideogram.SeedDance2Resolution? resolution = default, + int? duration = default, + bool? generateAudio = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Image to video with Seedance 2.0
+ /// Generate one or more videos from a first-frame image and a text prompt
+ /// with Seedance 2.0. Upload the first frame as `image`, and optionally a final
+ /// frame as `end_image`, using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. + /// + /// + /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. + /// + /// + /// A natural-language prompt describing how the first frame should animate. + /// + /// + /// The aspect ratio of the generated video. `auto` lets the model choose the
+ /// most suitable ratio from the prompt; any other value pins the ratio.
+ /// Default Value: auto + /// + /// + /// The resolution tier of the generated video.
+ /// Default Value: 720p + /// + /// + /// The length of the generated video in seconds. When omitted, the model
+ /// picks the best duration for the prompt ("auto"). + /// + /// + /// Whether to generate an audio track for the video. Audio roughly
+ /// doubles the provider cost and is subject to stricter output moderation.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> VideoGeneratePostGenerateVideoSeedDance2ImageToVideoAsResponseAsync( + global::System.IO.Stream image, + string imagename, + string prompt, + bool? dryRun = default, + global::System.IO.Stream? endImage = default, + string? endImagename = default, + global::Ideogram.SeedDance2AspectRatio? aspectRatio = default, + global::Ideogram.SeedDance2Resolution? resolution = default, + int? duration = default, + bool? generateAudio = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideo.g.cs b/src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideo.g.cs new file mode 100644 index 00000000..8ec9a802 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideo.g.cs @@ -0,0 +1,113 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IVideoGenerateClient + { + /// + /// Reference to video with Seedance 2.0
+ /// Generate a video from a text prompt and reference media with
+ /// Seedance 2.0. Upload at least one image in `reference_images`, plus optional
+ /// `reference_audios`, using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoAsync( + + global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Reference to video with Seedance 2.0
+ /// Generate a video from a text prompt and reference media with
+ /// Seedance 2.0. Upload at least one image in `reference_images`, plus optional
+ /// `reference_audios`, using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoAsResponseAsync( + + global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Reference to video with Seedance 2.0
+ /// Generate a video from a text prompt and reference media with
+ /// Seedance 2.0. Upload at least one image in `reference_images`, plus optional
+ /// `reference_audios`, using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// A natural-language prompt describing the video to produce. Refer to references by position, as in "@Image1 walks toward the camera". + /// + /// + /// Reference images, in prompt order. Common formats such as JPEG, PNG, and WEBP are supported, up to 50MB each. Multipart requests only. Uploaded images are used for this request only and are not stored. + /// + /// + /// MP3 or WAV audio references, in prompt order. Multipart requests only. Each file must be at most 15 MB and between 2 and 15 seconds long, with a combined duration of at most 15 seconds. Requires at least one reference image. Audio is used for this request only and is not saved to your library. + /// + /// + /// The aspect ratio of the generated video. `auto` lets the model choose the
+ /// most suitable ratio from the prompt; any other value pins the ratio.
+ /// Default Value: auto + /// + /// + /// The resolution tier of the generated video.
+ /// Default Value: 720p + /// + /// + /// The length of the generated video in seconds. When omitted, the model
+ /// picks the best duration for the prompt ("auto"). + /// + /// + /// Whether to generate an audio track for the video. Audio roughly
+ /// doubles the provider cost and is subject to stricter output moderation.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoAsync( + string prompt, + bool? dryRun = default, + global::System.Collections.Generic.IList? referenceImages = default, + global::System.Collections.Generic.IList? referenceAudios = default, + global::Ideogram.SeedDance2AspectRatio? aspectRatio = default, + global::Ideogram.SeedDance2Resolution? resolution = default, + int? duration = default, + bool? generateAudio = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.VideoGeneratePostGenerateVideoSeedDance2TextToVideo.g.cs b/src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.VideoGeneratePostGenerateVideoSeedDance2TextToVideo.g.cs new file mode 100644 index 00000000..0d2ad68d --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IVideoGenerateClient.VideoGeneratePostGenerateVideoSeedDance2TextToVideo.g.cs @@ -0,0 +1,99 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IVideoGenerateClient + { + /// + /// Text to video with Seedance 2.0
+ /// Generate one or more videos from a text prompt with Seedance 2.0.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task VideoGeneratePostGenerateVideoSeedDance2TextToVideoAsync( + + global::Ideogram.GenerateVideoSeedDance2TextToVideoRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Text to video with Seedance 2.0
+ /// Generate one or more videos from a text prompt with Seedance 2.0.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> VideoGeneratePostGenerateVideoSeedDance2TextToVideoAsResponseAsync( + + global::Ideogram.GenerateVideoSeedDance2TextToVideoRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Text to video with Seedance 2.0
+ /// Generate one or more videos from a text prompt with Seedance 2.0.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// A natural-language prompt describing the video to generate. + /// + /// + /// The aspect ratio of the generated video. `auto` lets the model choose the
+ /// most suitable ratio from the prompt; any other value pins the ratio.
+ /// Default Value: auto + /// + /// + /// The resolution tier of the generated video.
+ /// Default Value: 720p + /// + /// + /// The length of the generated video in seconds. When omitted, the model
+ /// picks the best duration for the prompt ("auto"). + /// + /// + /// Whether to generate an audio track for the video. Audio roughly
+ /// doubles the provider cost and is subject to stricter output moderation.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task VideoGeneratePostGenerateVideoSeedDance2TextToVideoAsync( + string prompt, + bool? dryRun = default, + global::Ideogram.SeedDance2AspectRatio? aspectRatio = default, + global::Ideogram.SeedDance2Resolution? resolution = default, + int? duration = default, + bool? generateAudio = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IVisionClient.Authorizations.Bearer.g.cs b/src/libs/Ideogram/Generated/Ideogram.IVisionClient.Authorizations.Bearer.g.cs deleted file mode 100644 index 670322c8..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IVisionClient.Authorizations.Bearer.g.cs +++ /dev/null @@ -1,16 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial interface IVisionClient - { - /// - /// Authorize using bearer authentication. - /// - /// - - public void AuthorizeUsingBearer( - string apiKey); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IVisionClient.PostDescribe.g.cs b/src/libs/Ideogram/Generated/Ideogram.IVisionClient.PostDescribe.g.cs deleted file mode 100644 index 07100446..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IVisionClient.PostDescribe.g.cs +++ /dev/null @@ -1,109 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IVisionClient - { - /// - /// Describe
- /// Describe an image.
- /// Supported image formats include JPEG, PNG, and WebP. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostDescribeAsync( - - global::Ideogram.DescribeRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Describe
- /// Describe an image.
- /// Supported image formats include JPEG, PNG, and WebP. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostDescribeAsResponseAsync( - - global::Ideogram.DescribeRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Describe
- /// Describe an image.
- /// Supported image formats include JPEG, PNG, and WebP. - ///
- /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The model version to use for describing images. Defaults to V_3.
- /// Default Value: V_3 - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostDescribeAsync( - byte[] imageFile, - string imageFilename, - global::Ideogram.DescribeModelVersion? describeModelVersion = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - - /// - /// Describe
- /// Describe an image.
- /// Supported image formats include JPEG, PNG, and WebP. - ///
- /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The model version to use for describing images. Defaults to V_3.
- /// Default Value: V_3 - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostDescribeAsync( - global::System.IO.Stream imageFile, - string imageFilename, - global::Ideogram.DescribeModelVersion? describeModelVersion = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Describe
- /// Describe an image.
- /// Supported image formats include JPEG, PNG, and WebP. - ///
- /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The model version to use for describing images. Defaults to V_3.
- /// Default Value: V_3 - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostDescribeAsResponseAsync( - global::System.IO.Stream imageFile, - string imageFilename, - global::Ideogram.DescribeModelVersion? describeModelVersion = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IVisionClient.PostDescribeV4.g.cs b/src/libs/Ideogram/Generated/Ideogram.IVisionClient.PostDescribeV4.g.cs deleted file mode 100644 index a88a303f..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IVisionClient.PostDescribeV4.g.cs +++ /dev/null @@ -1,181 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IVisionClient - { - /// - /// Describe with Ideogram 4.0
- /// Describe an image with Ideogram 4.0 and return a structured
- /// `V4JsonPrompt`. The returned `json_prompt` is a working JSON prompt
- /// that can be passed directly as `json_prompt` to the
- /// `/v1/ideogram-v4/generate` family of endpoints.
- /// Supported image formats include JPEG, PNG, and WebP. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostDescribeV4Async( - - global::Ideogram.DescribeRequestV4 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Describe with Ideogram 4.0
- /// Describe an image with Ideogram 4.0 and return a structured
- /// `V4JsonPrompt`. The returned `json_prompt` is a working JSON prompt
- /// that can be passed directly as `json_prompt` to the
- /// `/v1/ideogram-v4/generate` family of endpoints.
- /// Supported image formats include JPEG, PNG, and WebP. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostDescribeV4AsResponseAsync( - - global::Ideogram.DescribeRequestV4 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Describe with Ideogram 4.0
- /// Describe an image with Ideogram 4.0 and return a structured
- /// `V4JsonPrompt`. The returned `json_prompt` is a working JSON prompt
- /// that can be passed directly as `json_prompt` to the
- /// `/v1/ideogram-v4/generate` family of endpoints.
- /// Supported image formats include JPEG, PNG, and WebP. - ///
- /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// When true (default), the response preserves bounding boxes on each
- /// element so the prompt can be pasted into `/v1/ideogram-v4/generate`
- /// as `json_prompt` and reproduce the source layout. Set to false to
- /// drop bounding boxes and let the sampler place elements freely.
- /// Default Value: true - /// - /// - /// When false (default), the response omits `json_prompt.style_description`
- /// to match the contract used by `/v1/ideogram-v4/generate`'s `json_prompt`
- /// input. Set to true to surface the captioner's source-image style
- /// description in the response.
- /// Default Value: false - /// - /// - /// When false (default), the response omits `json_prompt.tags` to match
- /// the contract used by `/v1/ideogram-v4/generate`'s `json_prompt`
- /// input. Set to true to surface the captioner's free-form tags on the
- /// response.
- /// Default Value: false - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostDescribeV4Async( - byte[] imageFile, - string imageFilename, - bool? includeBbox = default, - bool? includeStyleDescriptions = default, - bool? includeTags = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - - /// - /// Describe with Ideogram 4.0
- /// Describe an image with Ideogram 4.0 and return a structured
- /// `V4JsonPrompt`. The returned `json_prompt` is a working JSON prompt
- /// that can be passed directly as `json_prompt` to the
- /// `/v1/ideogram-v4/generate` family of endpoints.
- /// Supported image formats include JPEG, PNG, and WebP. - ///
- /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// When true (default), the response preserves bounding boxes on each
- /// element so the prompt can be pasted into `/v1/ideogram-v4/generate`
- /// as `json_prompt` and reproduce the source layout. Set to false to
- /// drop bounding boxes and let the sampler place elements freely.
- /// Default Value: true - /// - /// - /// When false (default), the response omits `json_prompt.style_description`
- /// to match the contract used by `/v1/ideogram-v4/generate`'s `json_prompt`
- /// input. Set to true to surface the captioner's source-image style
- /// description in the response.
- /// Default Value: false - /// - /// - /// When false (default), the response omits `json_prompt.tags` to match
- /// the contract used by `/v1/ideogram-v4/generate`'s `json_prompt`
- /// input. Set to true to surface the captioner's free-form tags on the
- /// response.
- /// Default Value: false - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostDescribeV4Async( - global::System.IO.Stream imageFile, - string imageFilename, - bool? includeBbox = default, - bool? includeStyleDescriptions = default, - bool? includeTags = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Describe with Ideogram 4.0
- /// Describe an image with Ideogram 4.0 and return a structured
- /// `V4JsonPrompt`. The returned `json_prompt` is a working JSON prompt
- /// that can be passed directly as `json_prompt` to the
- /// `/v1/ideogram-v4/generate` family of endpoints.
- /// Supported image formats include JPEG, PNG, and WebP. - ///
- /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// When true (default), the response preserves bounding boxes on each
- /// element so the prompt can be pasted into `/v1/ideogram-v4/generate`
- /// as `json_prompt` and reproduce the source layout. Set to false to
- /// drop bounding boxes and let the sampler place elements freely.
- /// Default Value: true - /// - /// - /// When false (default), the response omits `json_prompt.style_description`
- /// to match the contract used by `/v1/ideogram-v4/generate`'s `json_prompt`
- /// input. Set to true to surface the captioner's source-image style
- /// description in the response.
- /// Default Value: false - /// - /// - /// When false (default), the response omits `json_prompt.tags` to match
- /// the contract used by `/v1/ideogram-v4/generate`'s `json_prompt`
- /// input. Set to true to surface the captioner's free-form tags on the
- /// response.
- /// Default Value: false - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PostDescribeV4AsResponseAsync( - global::System.IO.Stream imageFile, - string imageFilename, - bool? includeBbox = default, - bool? includeStyleDescriptions = default, - bool? includeTags = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IVisionClient.g.cs b/src/libs/Ideogram/Generated/Ideogram.IVisionClient.g.cs deleted file mode 100644 index 892a3b43..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IVisionClient.g.cs +++ /dev/null @@ -1,49 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Operations related to understanding visual content
- /// If no httpClient is provided, a new one will be created.
- /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. - ///
- public partial interface IVisionClient : global::System.IDisposable - { - /// - /// The HttpClient instance. - /// - public global::System.Net.Http.HttpClient HttpClient { get; } - - /// - /// The base URL for the API. - /// - public System.Uri? BaseUri { get; } - - /// - /// The authorizations to use for the requests. - /// - public global::System.Collections.Generic.List Authorizations { get; } - - /// - /// Gets or sets a value indicating whether the response content should be read as a string. - /// True by default in debug builds, false otherwise. - /// When false, successful responses are deserialized directly from the response stream for better performance. - /// Error responses are always read as strings regardless of this setting, - /// ensuring is populated. - /// - public bool ReadResponseAsString { get; set; } - /// - /// Client-wide request defaults such as headers, query parameters, retries, and timeout. - /// - public global::Ideogram.AutoSDKClientOptions Options { get; } - - - /// - /// - /// - global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } - - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IWebhooksClient.Authorizations.Bearer.g.cs b/src/libs/Ideogram/Generated/Ideogram.IWebhooksClient.Authorizations.Bearer.g.cs deleted file mode 100644 index 063ba43e..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IWebhooksClient.Authorizations.Bearer.g.cs +++ /dev/null @@ -1,16 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial interface IWebhooksClient - { - /// - /// Authorize using bearer authentication. - /// - /// - - public void AuthorizeUsingBearer( - string apiKey); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IWebhooksClient.GetWebhookSigningJwks.g.cs b/src/libs/Ideogram/Generated/Ideogram.IWebhooksClient.GetWebhookSigningJwks.g.cs deleted file mode 100644 index d16dc74c..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IWebhooksClient.GetWebhookSigningJwks.g.cs +++ /dev/null @@ -1,46 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public partial interface IWebhooksClient - { - /// - /// Get the public keys used to verify webhook signatures
- /// Returns the set of Ed25519 public keys Ideogram uses to sign outbound
- /// webhook payloads. Customers verify incoming webhooks by recomputing the
- /// canonical signed message (`request_id\nuser_id\ntimestamp\nsha256_hex(body)`)
- /// and checking the `X-Ideogram-Webhook-Signature` header against any key
- /// in this document.
- /// The document includes the current signing key plus any keys recently
- /// rotated out, so signatures already in flight remain verifiable across
- /// rotations. Cache for up to 24 hours; refresh sooner if a signature
- /// fails to verify against the cached set.
- /// This endpoint is public and unauthenticated — no API key is required. - ///
- /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task GetWebhookSigningJwksAsync( - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Get the public keys used to verify webhook signatures
- /// Returns the set of Ed25519 public keys Ideogram uses to sign outbound
- /// webhook payloads. Customers verify incoming webhooks by recomputing the
- /// canonical signed message (`request_id\nuser_id\ntimestamp\nsha256_hex(body)`)
- /// and checking the `X-Ideogram-Webhook-Signature` header against any key
- /// in this document.
- /// The document includes the current signing key plus any keys recently
- /// rotated out, so signatures already in flight remain verifiable across
- /// rotations. Cache for up to 24 hours; refresh sooner if a signature
- /// fails to verify against the cached set.
- /// This endpoint is public and unauthenticated — no API key is required. - ///
- /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> GetWebhookSigningJwksAsResponseAsync( - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IWebhooksClient.g.cs b/src/libs/Ideogram/Generated/Ideogram.IWebhooksClient.g.cs deleted file mode 100644 index 3447f2ed..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IWebhooksClient.g.cs +++ /dev/null @@ -1,51 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Endpoints related to webhook delivery and verification. The JWKS
- /// endpoint publishes the Ed25519 public keys customers use to verify
- /// that an inbound webhook genuinely originated from Ideogram.
- /// If no httpClient is provided, a new one will be created.
- /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. - ///
- public partial interface IWebhooksClient : global::System.IDisposable - { - /// - /// The HttpClient instance. - /// - public global::System.Net.Http.HttpClient HttpClient { get; } - - /// - /// The base URL for the API. - /// - public System.Uri? BaseUri { get; } - - /// - /// The authorizations to use for the requests. - /// - public global::System.Collections.Generic.List Authorizations { get; } - - /// - /// Gets or sets a value indicating whether the response content should be read as a string. - /// True by default in debug builds, false otherwise. - /// When false, successful responses are deserialized directly from the response stream for better performance. - /// Error responses are always read as strings regardless of this setting, - /// ensuring is populated. - /// - public bool ReadResponseAsString { get; set; } - /// - /// Client-wide request defaults such as headers, query parameters, retries, and timeout. - /// - public global::Ideogram.AutoSDKClientOptions Options { get; } - - - /// - /// - /// - global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } - - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IdeogramClient.g.cs b/src/libs/Ideogram/Generated/Ideogram.IdeogramClient.g.cs index 532db9a5..a1ae5428 100644 --- a/src/libs/Ideogram/Generated/Ideogram.IdeogramClient.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.IdeogramClient.g.cs @@ -4,7 +4,6 @@ namespace Ideogram { /// - /// This is the API definition for Ideogram AI.
/// If no httpClient is provided, a new one will be created.
/// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. ///
@@ -59,41 +58,12 @@ public sealed partial class IdeogramClient : global::Ideogram.IIdeogramClient, g /// /// /// - public AssetReferenceUsageClient AssetReferenceUsage => new AssetReferenceUsageClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) - { - ReadResponseAsString = ReadResponseAsString, - JsonSerializerContextProvider = JsonSerializerContextProvider, - }; - - /// - /// Model-agnostic endpoints where the server selects the model for each
- /// request. Requests are JSON and return a generation id that can be
- /// polled via `GET /v2/generations/{generation_id}`. - ///
public AutoModelClient AutoModel => new AutoModelClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContextProvider = JsonSerializerContextProvider, }; - /// - /// - /// - public BatchClient Batch => new BatchClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) - { - ReadResponseAsString = ReadResponseAsString, - JsonSerializerContextProvider = JsonSerializerContextProvider, - }; - - /// - /// Operations related to managing datasets. - /// - public DatasetsClient Datasets => new DatasetsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) - { - ReadResponseAsString = ReadResponseAsString, - JsonSerializerContextProvider = JsonSerializerContextProvider, - }; - /// /// /// @@ -104,7 +74,7 @@ public sealed partial class IdeogramClient : global::Ideogram.IIdeogramClient, g }; /// - /// Asynchronous image-editing workflows that return results through generation polling. + /// /// public EditWorkflowClient EditWorkflow => new EditWorkflowClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { @@ -112,15 +82,6 @@ public sealed partial class IdeogramClient : global::Ideogram.IIdeogramClient, g JsonSerializerContextProvider = JsonSerializerContextProvider, }; - /// - /// All things related to generating content. - /// - public GenerateClient Generate => new GenerateClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) - { - ReadResponseAsString = ReadResponseAsString, - JsonSerializerContextProvider = JsonSerializerContextProvider, - }; - /// /// /// @@ -140,10 +101,7 @@ public sealed partial class IdeogramClient : global::Ideogram.IIdeogramClient, g }; /// - /// Generate images with a specific model contract. Requests are JSON
- /// (Ideogram 3.0 also accepts multipart for style reference bytes) and
- /// return a generation id that can be polled via
- /// `GET /v2/generations/{generation_id}`. + /// ///
public ImagesGenerateClient ImagesGenerate => new ImagesGenerateClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { @@ -152,7 +110,7 @@ public sealed partial class IdeogramClient : global::Ideogram.IIdeogramClient, g }; /// - /// Repaint a masked region of an image with a specific model. + /// /// public ImagesInpaintClient ImagesInpaint => new ImagesInpaintClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { @@ -161,7 +119,7 @@ public sealed partial class IdeogramClient : global::Ideogram.IIdeogramClient, g }; /// - /// Edit source images at the source's own width and height. These endpoints never reframe: the output always matches the image you sent. + /// /// public ImagesPreciseEditClient ImagesPreciseEdit => new ImagesPreciseEditClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { @@ -170,17 +128,7 @@ public sealed partial class IdeogramClient : global::Ideogram.IIdeogramClient, g }; /// - /// Expand an existing image to a new model-specific output shape while
- /// preserving the source content and filling the new area. - ///
- public ImagesReframeClient ImagesReframe => new ImagesReframeClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) - { - ReadResponseAsString = ReadResponseAsString, - JsonSerializerContextProvider = JsonSerializerContextProvider, - }; - - /// - /// Transform an image with a specific model, guided by a prompt. + /// /// public ImagesRemixClient ImagesRemix => new ImagesRemixClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { @@ -198,53 +146,7 @@ public sealed partial class IdeogramClient : global::Ideogram.IIdeogramClient, g }; /// - /// Organization-scoped external asset integrations. - /// - public IntegrationsClient Integrations => new IntegrationsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) - { - ReadResponseAsString = ReadResponseAsString, - JsonSerializerContextProvider = JsonSerializerContextProvider, - }; - - /// - /// Operations and endpoints designed for doing internal testing. Not intended to be called outside a test environment. - /// - public InternalTestingClient InternalTesting => new InternalTestingClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) - { - ReadResponseAsString = ReadResponseAsString, - JsonSerializerContextProvider = JsonSerializerContextProvider, - }; - - /// - /// Content related to managing API account and API access. - /// - public ManageClient Manage => new ManageClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) - { - ReadResponseAsString = ReadResponseAsString, - JsonSerializerContextProvider = JsonSerializerContextProvider, - }; - - /// - /// Operations related to publishing mini-apps into the catalog. - /// - public MiniAppsClient MiniApps => new MiniAppsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) - { - ReadResponseAsString = ReadResponseAsString, - JsonSerializerContextProvider = JsonSerializerContextProvider, - }; - - /// - /// Operations related to managing custom models. - /// - public ModelsClient Models => new ModelsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) - { - ReadResponseAsString = ReadResponseAsString, - JsonSerializerContextProvider = JsonSerializerContextProvider, - }; - - /// - /// Remove unwanted objects from an image. Requests return a generation id
- /// to poll with `GET /v2/generations/{generation_id}`. + /// ///
public ObjectRemovalClient ObjectRemoval => new ObjectRemovalClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { @@ -255,7 +157,7 @@ public sealed partial class IdeogramClient : global::Ideogram.IIdeogramClient, g /// /// /// - public PromptClient Prompt => new PromptClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + public ReframeClient Reframe => new ReframeClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContextProvider = JsonSerializerContextProvider, @@ -264,15 +166,6 @@ public sealed partial class IdeogramClient : global::Ideogram.IIdeogramClient, g /// /// /// - public ProvenanceClient Provenance => new ProvenanceClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) - { - ReadResponseAsString = ReadResponseAsString, - JsonSerializerContextProvider = JsonSerializerContextProvider, - }; - - /// - /// Outcome-focused image tools with implementation details managed by Ideogram. - /// public ToolClient Tool => new ToolClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, @@ -306,26 +199,6 @@ public sealed partial class IdeogramClient : global::Ideogram.IIdeogramClient, g JsonSerializerContextProvider = JsonSerializerContextProvider, }; - /// - /// Operations related to understanding visual content. - /// - public VisionClient Vision => new VisionClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) - { - ReadResponseAsString = ReadResponseAsString, - JsonSerializerContextProvider = JsonSerializerContextProvider, - }; - - /// - /// Endpoints related to webhook delivery and verification. The JWKS
- /// endpoint publishes the Ed25519 public keys customers use to verify
- /// that an inbound webhook genuinely originated from Ideogram. - ///
- public WebhooksClient Webhooks => new WebhooksClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) - { - ReadResponseAsString = ReadResponseAsString, - JsonSerializerContextProvider = JsonSerializerContextProvider, - }; - /// /// Creates a new instance of the IdeogramClient. /// If no httpClient is provided, a new one will be created. diff --git a/src/libs/Ideogram/Generated/Ideogram.ImageDescribe.JsonSerializerContext.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImageDescribe.JsonSerializerContext.g.cs index 36c31200..8b0179f5 100644 --- a/src/libs/Ideogram/Generated/Ideogram.ImageDescribe.JsonSerializerContext.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.ImageDescribe.JsonSerializerContext.g.cs @@ -14,49 +14,47 @@ namespace Ideogram [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4JsonPrompt))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(byte[]))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AssetIdentifier))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationErrorResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationRejectReason), TypeInfoPropertyName = "GenerationRejectReason2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed), TypeInfoPropertyName = "GenerationErrorResponseTaskCompletionSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DescribeImageIdeogramV3Response))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GeneratedDescription))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DescribeImageIdeogramV3Request))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImageSafetyError))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DescribeImageIdeogramV4Response))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DescribeImageIdeogramV4Request))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationErrorResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4StyleDescription))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4CompositionalDeconstruction))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4ObjPromptElementType), TypeInfoPropertyName = "V4ObjPromptElementType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4TextPromptElementType), TypeInfoPropertyName = "V4TextPromptElementType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4PromptElement), TypeInfoPropertyName = "V4PromptElement2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4ObjPromptElement))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4TextPromptElement))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4PromptElementVariant1))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4PromptElementVariant2))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4PromptElementDiscriminator))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4PromptElementDiscriminatorType), TypeInfoPropertyName = "V4PromptElementDiscriminatorType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4ObjPromptElementType), TypeInfoPropertyName = "V4ObjPromptElementType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4TextPromptElementType), TypeInfoPropertyName = "V4TextPromptElementType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AssetType), TypeInfoPropertyName = "AssetType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4CompositionalDeconstruction))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4JsonPrompt))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DescribeImageIdeogramV4Response))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImageSafetyError))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GeneratedDescription))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DescribeImageIdeogramV3Response))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(byte[]))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImageDescribePostDescribeImageIdeogramV4Request))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImageDescribePostDescribeImageIdeogramV3Request))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationRejectReason?), TypeInfoPropertyName = "NullableGenerationRejectReason2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?), TypeInfoPropertyName = "NullableGenerationErrorResponseTaskCompletionSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4PromptElement?), TypeInfoPropertyName = "NullableV4PromptElement2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4PromptElementDiscriminatorType?), TypeInfoPropertyName = "NullableV4PromptElementDiscriminatorType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4ObjPromptElementType?), TypeInfoPropertyName = "NullableV4ObjPromptElementType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4TextPromptElementType?), TypeInfoPropertyName = "NullableV4TextPromptElementType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AssetType?), TypeInfoPropertyName = "NullableAssetType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4PromptElement?), TypeInfoPropertyName = "NullableV4PromptElement2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4PromptElementDiscriminatorType?), TypeInfoPropertyName = "NullableV4PromptElementDiscriminatorType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime?))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] internal sealed partial class ImageDescribeSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext { } @@ -127,17 +125,13 @@ private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Ser public override bool CanConvert(global::System.Type typeToConvert) { return - typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed) - - || typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?) - - || typeToConvert == typeof(global::Ideogram.GenerationRejectReason) + typeToConvert == typeof(global::Ideogram.GenerationRejectReason) || typeToConvert == typeof(global::Ideogram.GenerationRejectReason?) - || typeToConvert == typeof(global::Ideogram.V4PromptElementDiscriminatorType) + || typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed) - || typeToConvert == typeof(global::Ideogram.V4PromptElementDiscriminatorType?) + || typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?) || typeToConvert == typeof(global::Ideogram.V4ObjPromptElementType) @@ -147,25 +141,15 @@ public override bool CanConvert(global::System.Type typeToConvert) || typeToConvert == typeof(global::Ideogram.V4TextPromptElementType?) - || typeToConvert == typeof(global::Ideogram.AssetType) + || typeToConvert == typeof(global::Ideogram.V4PromptElementDiscriminatorType) - || typeToConvert == typeof(global::Ideogram.AssetType?); + || typeToConvert == typeof(global::Ideogram.V4PromptElementDiscriminatorType?); } public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) { - if (typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed)) - { - return new global::Ideogram.JsonConverters.GenerationErrorResponseTaskCompletionSpeedJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?)) - { - return new global::Ideogram.JsonConverters.GenerationErrorResponseTaskCompletionSpeedNullableJsonConverter(); - } - if (typeToConvert == typeof(global::Ideogram.GenerationRejectReason)) { return new global::Ideogram.JsonConverters.GenerationRejectReasonJsonConverter(); @@ -176,14 +160,14 @@ public override bool CanConvert(global::System.Type typeToConvert) return new global::Ideogram.JsonConverters.GenerationRejectReasonNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.V4PromptElementDiscriminatorType)) + if (typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed)) { - return new global::Ideogram.JsonConverters.V4PromptElementDiscriminatorTypeJsonConverter(); + return new global::Ideogram.JsonConverters.GenerationErrorResponseTaskCompletionSpeedJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.V4PromptElementDiscriminatorType?)) + if (typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?)) { - return new global::Ideogram.JsonConverters.V4PromptElementDiscriminatorTypeNullableJsonConverter(); + return new global::Ideogram.JsonConverters.GenerationErrorResponseTaskCompletionSpeedNullableJsonConverter(); } if (typeToConvert == typeof(global::Ideogram.V4ObjPromptElementType)) @@ -206,14 +190,14 @@ public override bool CanConvert(global::System.Type typeToConvert) return new global::Ideogram.JsonConverters.V4TextPromptElementTypeNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.AssetType)) + if (typeToConvert == typeof(global::Ideogram.V4PromptElementDiscriminatorType)) { - return new global::Ideogram.JsonConverters.AssetTypeJsonConverter(); + return new global::Ideogram.JsonConverters.V4PromptElementDiscriminatorTypeJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.AssetType?)) + if (typeToConvert == typeof(global::Ideogram.V4PromptElementDiscriminatorType?)) { - return new global::Ideogram.JsonConverters.AssetTypeNullableJsonConverter(); + return new global::Ideogram.JsonConverters.V4PromptElementDiscriminatorTypeNullableJsonConverter(); } throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); } diff --git a/src/libs/Ideogram/Generated/Ideogram.ImageDescribeClient.ImageDescribePostDescribeImageIdeogramV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImageDescribeClient.ImageDescribePostDescribeImageIdeogramV3.g.cs new file mode 100644 index 00000000..20e0ac89 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.ImageDescribeClient.ImageDescribePostDescribeImageIdeogramV3.g.cs @@ -0,0 +1,2229 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class ImageDescribeClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_ImageDescribePostDescribeImageIdeogramV3SecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_ImageDescribePostDescribeImageIdeogramV3SecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_ImageDescribePostDescribeImageIdeogramV3SecurityRequirement0, + }; + partial void PrepareImageDescribePostDescribeImageIdeogramV3Arguments( + global::System.Net.Http.HttpClient httpClient, + global::Ideogram.ImageDescribePostDescribeImageIdeogramV3Request request); + partial void PrepareImageDescribePostDescribeImageIdeogramV3Request( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + global::Ideogram.ImageDescribePostDescribeImageIdeogramV3Request request); + partial void ProcessImageDescribePostDescribeImageIdeogramV3Response( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessImageDescribePostDescribeImageIdeogramV3ResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Describe with Ideogram 3.0
+ /// Generate a natural-language description of an image with Ideogram's 3.0
+ /// image captioner (a fine-tune of the Qwen2-VL vision-language model).
+ /// Upload the image as `image` using `multipart/form-data`; the description
+ /// is returned directly. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImageDescribePostDescribeImageIdeogramV3Async( + + global::Ideogram.ImageDescribePostDescribeImageIdeogramV3Request request, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ImageDescribePostDescribeImageIdeogramV3AsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Describe with Ideogram 3.0
+ /// Generate a natural-language description of an image with Ideogram's 3.0
+ /// image captioner (a fine-tune of the Qwen2-VL vision-language model).
+ /// Upload the image as `image` using `multipart/form-data`; the description
+ /// is returned directly. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ImageDescribePostDescribeImageIdeogramV3AsResponseAsync( + + global::Ideogram.ImageDescribePostDescribeImageIdeogramV3Request request, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareImageDescribePostDescribeImageIdeogramV3Arguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImageDescribePostDescribeImageIdeogramV3SecurityRequirements, + operationName: "ImageDescribePostDescribeImageIdeogramV3Async"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/describe/ideogram-3", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImageDescribePostDescribeImageIdeogramV3Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImageDescribePostDescribeImageIdeogramV3", + methodName: "ImageDescribePostDescribeImageIdeogramV3Async", + pathTemplate: "\"/v2/image/describe/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImageDescribePostDescribeImageIdeogramV3", + methodName: "ImageDescribePostDescribeImageIdeogramV3Async", + pathTemplate: "\"/v2/image/describe/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImageDescribePostDescribeImageIdeogramV3", + methodName: "ImageDescribePostDescribeImageIdeogramV3Async", + pathTemplate: "\"/v2/image/describe/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImageDescribePostDescribeImageIdeogramV3Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImageDescribePostDescribeImageIdeogramV3", + methodName: "ImageDescribePostDescribeImageIdeogramV3Async", + pathTemplate: "\"/v2/image/describe/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImageDescribePostDescribeImageIdeogramV3", + methodName: "ImageDescribePostDescribeImageIdeogramV3Async", + pathTemplate: "\"/v2/image/describe/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The source image was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Image failed the safety check. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::Ideogram.ImageSafetyError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::Ideogram.ImageSafetyError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::Ideogram.ImageSafetyError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImageDescribePostDescribeImageIdeogramV3ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.DescribeImageIdeogramV3Response.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.DescribeImageIdeogramV3Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Describe with Ideogram 3.0
+ /// Generate a natural-language description of an image with Ideogram's 3.0
+ /// image captioner (a fine-tune of the Qwen2-VL vision-language model).
+ /// Upload the image as `image` using `multipart/form-data`; the description
+ /// is returned directly. + ///
+ /// + /// The image to describe (max 10MB). JPEG, PNG, and WebP are supported. Multipart requests only. + /// + /// + /// The image to describe (max 10MB). JPEG, PNG, and WebP are supported. Multipart requests only. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImageDescribePostDescribeImageIdeogramV3Async( + byte[] image, + string imagename, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Ideogram.ImageDescribePostDescribeImageIdeogramV3Request + { + Image = image, + Imagename = imagename, + }; + + return await ImageDescribePostDescribeImageIdeogramV3Async( + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// Describe with Ideogram 3.0
+ /// Generate a natural-language description of an image with Ideogram's 3.0
+ /// image captioner (a fine-tune of the Qwen2-VL vision-language model).
+ /// Upload the image as `image` using `multipart/form-data`; the description
+ /// is returned directly. + ///
+ /// + /// The image to describe (max 10MB). JPEG, PNG, and WebP are supported. Multipart requests only. + /// + /// + /// The image to describe (max 10MB). JPEG, PNG, and WebP are supported. Multipart requests only. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImageDescribePostDescribeImageIdeogramV3Async( + global::System.IO.Stream image, + string imagename, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + var request = new global::Ideogram.ImageDescribePostDescribeImageIdeogramV3Request + { + Image = global::System.Array.Empty(), + Imagename = imagename, + }; + PrepareArguments( + client: HttpClient); + PrepareImageDescribePostDescribeImageIdeogramV3Arguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImageDescribePostDescribeImageIdeogramV3SecurityRequirements, + operationName: "ImageDescribePostDescribeImageIdeogramV3Async"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/describe/ideogram-3", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImageDescribePostDescribeImageIdeogramV3Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImageDescribePostDescribeImageIdeogramV3", + methodName: "ImageDescribePostDescribeImageIdeogramV3Async", + pathTemplate: "\"/v2/image/describe/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImageDescribePostDescribeImageIdeogramV3", + methodName: "ImageDescribePostDescribeImageIdeogramV3Async", + pathTemplate: "\"/v2/image/describe/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImageDescribePostDescribeImageIdeogramV3", + methodName: "ImageDescribePostDescribeImageIdeogramV3Async", + pathTemplate: "\"/v2/image/describe/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImageDescribePostDescribeImageIdeogramV3Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImageDescribePostDescribeImageIdeogramV3", + methodName: "ImageDescribePostDescribeImageIdeogramV3Async", + pathTemplate: "\"/v2/image/describe/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImageDescribePostDescribeImageIdeogramV3", + methodName: "ImageDescribePostDescribeImageIdeogramV3Async", + pathTemplate: "\"/v2/image/describe/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The source image was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Image failed the safety check. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::Ideogram.ImageSafetyError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::Ideogram.ImageSafetyError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::Ideogram.ImageSafetyError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImageDescribePostDescribeImageIdeogramV3ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::Ideogram.DescribeImageIdeogramV3Response.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::Ideogram.DescribeImageIdeogramV3Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Describe with Ideogram 3.0
+ /// Generate a natural-language description of an image with Ideogram's 3.0
+ /// image captioner (a fine-tune of the Qwen2-VL vision-language model).
+ /// Upload the image as `image` using `multipart/form-data`; the description
+ /// is returned directly. + ///
+ /// + /// The image to describe (max 10MB). JPEG, PNG, and WebP are supported. Multipart requests only. + /// + /// + /// The image to describe (max 10MB). JPEG, PNG, and WebP are supported. Multipart requests only. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ImageDescribePostDescribeImageIdeogramV3AsResponseAsync( + global::System.IO.Stream image, + string imagename, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + var request = new global::Ideogram.ImageDescribePostDescribeImageIdeogramV3Request + { + Image = global::System.Array.Empty(), + Imagename = imagename, + }; + PrepareArguments( + client: HttpClient); + PrepareImageDescribePostDescribeImageIdeogramV3Arguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImageDescribePostDescribeImageIdeogramV3SecurityRequirements, + operationName: "ImageDescribePostDescribeImageIdeogramV3Async"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/describe/ideogram-3", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImageDescribePostDescribeImageIdeogramV3Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImageDescribePostDescribeImageIdeogramV3", + methodName: "ImageDescribePostDescribeImageIdeogramV3Async", + pathTemplate: "\"/v2/image/describe/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImageDescribePostDescribeImageIdeogramV3", + methodName: "ImageDescribePostDescribeImageIdeogramV3Async", + pathTemplate: "\"/v2/image/describe/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImageDescribePostDescribeImageIdeogramV3", + methodName: "ImageDescribePostDescribeImageIdeogramV3Async", + pathTemplate: "\"/v2/image/describe/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImageDescribePostDescribeImageIdeogramV3Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImageDescribePostDescribeImageIdeogramV3", + methodName: "ImageDescribePostDescribeImageIdeogramV3Async", + pathTemplate: "\"/v2/image/describe/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImageDescribePostDescribeImageIdeogramV3", + methodName: "ImageDescribePostDescribeImageIdeogramV3Async", + pathTemplate: "\"/v2/image/describe/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The source image was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Image failed the safety check. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::Ideogram.ImageSafetyError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::Ideogram.ImageSafetyError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::Ideogram.ImageSafetyError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImageDescribePostDescribeImageIdeogramV3ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.DescribeImageIdeogramV3Response.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.DescribeImageIdeogramV3Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImageDescribeClient.ImageDescribePostDescribeImageIdeogramV4.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImageDescribeClient.ImageDescribePostDescribeImageIdeogramV4.g.cs new file mode 100644 index 00000000..8d21798f --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.ImageDescribeClient.ImageDescribePostDescribeImageIdeogramV4.g.cs @@ -0,0 +1,2363 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class ImageDescribeClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_ImageDescribePostDescribeImageIdeogramV4SecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_ImageDescribePostDescribeImageIdeogramV4SecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_ImageDescribePostDescribeImageIdeogramV4SecurityRequirement0, + }; + partial void PrepareImageDescribePostDescribeImageIdeogramV4Arguments( + global::System.Net.Http.HttpClient httpClient, + global::Ideogram.ImageDescribePostDescribeImageIdeogramV4Request request); + partial void PrepareImageDescribePostDescribeImageIdeogramV4Request( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + global::Ideogram.ImageDescribePostDescribeImageIdeogramV4Request request); + partial void ProcessImageDescribePostDescribeImageIdeogramV4Response( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessImageDescribePostDescribeImageIdeogramV4ResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Describe with Ideogram 4.0
+ /// Describe an image as a structured `V4JsonPrompt` with Ideogram's 4.0
+ /// image captioner (a fine-tune of the Qwen3-VL vision-language model).
+ /// Upload the image as `image` using `multipart/form-data`; the
+ /// `json_prompt` is returned directly and can be passed to the
+ /// `/v1/ideogram-v4/generate` endpoints. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImageDescribePostDescribeImageIdeogramV4Async( + + global::Ideogram.ImageDescribePostDescribeImageIdeogramV4Request request, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ImageDescribePostDescribeImageIdeogramV4AsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Describe with Ideogram 4.0
+ /// Describe an image as a structured `V4JsonPrompt` with Ideogram's 4.0
+ /// image captioner (a fine-tune of the Qwen3-VL vision-language model).
+ /// Upload the image as `image` using `multipart/form-data`; the
+ /// `json_prompt` is returned directly and can be passed to the
+ /// `/v1/ideogram-v4/generate` endpoints. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ImageDescribePostDescribeImageIdeogramV4AsResponseAsync( + + global::Ideogram.ImageDescribePostDescribeImageIdeogramV4Request request, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareImageDescribePostDescribeImageIdeogramV4Arguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImageDescribePostDescribeImageIdeogramV4SecurityRequirements, + operationName: "ImageDescribePostDescribeImageIdeogramV4Async"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/describe/ideogram-4", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.IncludeBbox != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.IncludeBbox, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"include_bbox\""); + + } + if (request.IncludeStyleDescriptions != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.IncludeStyleDescriptions, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"include_style_descriptions\""); + + } + if (request.IncludeTags != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.IncludeTags, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"include_tags\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImageDescribePostDescribeImageIdeogramV4Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImageDescribePostDescribeImageIdeogramV4", + methodName: "ImageDescribePostDescribeImageIdeogramV4Async", + pathTemplate: "\"/v2/image/describe/ideogram-4\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImageDescribePostDescribeImageIdeogramV4", + methodName: "ImageDescribePostDescribeImageIdeogramV4Async", + pathTemplate: "\"/v2/image/describe/ideogram-4\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImageDescribePostDescribeImageIdeogramV4", + methodName: "ImageDescribePostDescribeImageIdeogramV4Async", + pathTemplate: "\"/v2/image/describe/ideogram-4\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImageDescribePostDescribeImageIdeogramV4Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImageDescribePostDescribeImageIdeogramV4", + methodName: "ImageDescribePostDescribeImageIdeogramV4Async", + pathTemplate: "\"/v2/image/describe/ideogram-4\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImageDescribePostDescribeImageIdeogramV4", + methodName: "ImageDescribePostDescribeImageIdeogramV4Async", + pathTemplate: "\"/v2/image/describe/ideogram-4\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The source image was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Image failed the safety check. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::Ideogram.ImageSafetyError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::Ideogram.ImageSafetyError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::Ideogram.ImageSafetyError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImageDescribePostDescribeImageIdeogramV4ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.DescribeImageIdeogramV4Response.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.DescribeImageIdeogramV4Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Describe with Ideogram 4.0
+ /// Describe an image as a structured `V4JsonPrompt` with Ideogram's 4.0
+ /// image captioner (a fine-tune of the Qwen3-VL vision-language model).
+ /// Upload the image as `image` using `multipart/form-data`; the
+ /// `json_prompt` is returned directly and can be passed to the
+ /// `/v1/ideogram-v4/generate` endpoints. + ///
+ /// + /// The image to describe (max 10MB). JPEG, PNG, and WebP are supported. Multipart requests only. + /// + /// + /// The image to describe (max 10MB). JPEG, PNG, and WebP are supported. Multipart requests only. + /// + /// + /// Whether to include bounding boxes for the subjects and text in the returned `json_prompt`. Defaults to true, so the prompt preserves the layout of the described image.
+ /// Default Value: true + /// + /// + /// Whether to include a free-form style description in the returned `json_prompt`. Defaults to false.
+ /// Default Value: false + /// + /// + /// Whether to include free-form tags in the returned `json_prompt`. Defaults to false.
+ /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImageDescribePostDescribeImageIdeogramV4Async( + byte[] image, + string imagename, + bool? includeBbox = default, + bool? includeStyleDescriptions = default, + bool? includeTags = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Ideogram.ImageDescribePostDescribeImageIdeogramV4Request + { + Image = image, + Imagename = imagename, + IncludeBbox = includeBbox, + IncludeStyleDescriptions = includeStyleDescriptions, + IncludeTags = includeTags, + }; + + return await ImageDescribePostDescribeImageIdeogramV4Async( + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// Describe with Ideogram 4.0
+ /// Describe an image as a structured `V4JsonPrompt` with Ideogram's 4.0
+ /// image captioner (a fine-tune of the Qwen3-VL vision-language model).
+ /// Upload the image as `image` using `multipart/form-data`; the
+ /// `json_prompt` is returned directly and can be passed to the
+ /// `/v1/ideogram-v4/generate` endpoints. + ///
+ /// + /// The image to describe (max 10MB). JPEG, PNG, and WebP are supported. Multipart requests only. + /// + /// + /// The image to describe (max 10MB). JPEG, PNG, and WebP are supported. Multipart requests only. + /// + /// + /// Whether to include bounding boxes for the subjects and text in the returned `json_prompt`. Defaults to true, so the prompt preserves the layout of the described image.
+ /// Default Value: true + /// + /// + /// Whether to include a free-form style description in the returned `json_prompt`. Defaults to false.
+ /// Default Value: false + /// + /// + /// Whether to include free-form tags in the returned `json_prompt`. Defaults to false.
+ /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImageDescribePostDescribeImageIdeogramV4Async( + global::System.IO.Stream image, + string imagename, + bool? includeBbox = default, + bool? includeStyleDescriptions = default, + bool? includeTags = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + var request = new global::Ideogram.ImageDescribePostDescribeImageIdeogramV4Request + { + Image = global::System.Array.Empty(), + Imagename = imagename, + IncludeBbox = includeBbox, + IncludeStyleDescriptions = includeStyleDescriptions, + IncludeTags = includeTags, + }; + PrepareArguments( + client: HttpClient); + PrepareImageDescribePostDescribeImageIdeogramV4Arguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImageDescribePostDescribeImageIdeogramV4SecurityRequirements, + operationName: "ImageDescribePostDescribeImageIdeogramV4Async"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/describe/ideogram-4", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.IncludeBbox != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.IncludeBbox, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"include_bbox\""); + + } + if (request.IncludeStyleDescriptions != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.IncludeStyleDescriptions, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"include_style_descriptions\""); + + } + if (request.IncludeTags != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.IncludeTags, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"include_tags\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImageDescribePostDescribeImageIdeogramV4Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImageDescribePostDescribeImageIdeogramV4", + methodName: "ImageDescribePostDescribeImageIdeogramV4Async", + pathTemplate: "\"/v2/image/describe/ideogram-4\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImageDescribePostDescribeImageIdeogramV4", + methodName: "ImageDescribePostDescribeImageIdeogramV4Async", + pathTemplate: "\"/v2/image/describe/ideogram-4\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImageDescribePostDescribeImageIdeogramV4", + methodName: "ImageDescribePostDescribeImageIdeogramV4Async", + pathTemplate: "\"/v2/image/describe/ideogram-4\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImageDescribePostDescribeImageIdeogramV4Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImageDescribePostDescribeImageIdeogramV4", + methodName: "ImageDescribePostDescribeImageIdeogramV4Async", + pathTemplate: "\"/v2/image/describe/ideogram-4\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImageDescribePostDescribeImageIdeogramV4", + methodName: "ImageDescribePostDescribeImageIdeogramV4Async", + pathTemplate: "\"/v2/image/describe/ideogram-4\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The source image was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Image failed the safety check. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::Ideogram.ImageSafetyError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::Ideogram.ImageSafetyError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::Ideogram.ImageSafetyError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImageDescribePostDescribeImageIdeogramV4ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::Ideogram.DescribeImageIdeogramV4Response.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::Ideogram.DescribeImageIdeogramV4Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Describe with Ideogram 4.0
+ /// Describe an image as a structured `V4JsonPrompt` with Ideogram's 4.0
+ /// image captioner (a fine-tune of the Qwen3-VL vision-language model).
+ /// Upload the image as `image` using `multipart/form-data`; the
+ /// `json_prompt` is returned directly and can be passed to the
+ /// `/v1/ideogram-v4/generate` endpoints. + ///
+ /// + /// The image to describe (max 10MB). JPEG, PNG, and WebP are supported. Multipart requests only. + /// + /// + /// The image to describe (max 10MB). JPEG, PNG, and WebP are supported. Multipart requests only. + /// + /// + /// Whether to include bounding boxes for the subjects and text in the returned `json_prompt`. Defaults to true, so the prompt preserves the layout of the described image.
+ /// Default Value: true + /// + /// + /// Whether to include a free-form style description in the returned `json_prompt`. Defaults to false.
+ /// Default Value: false + /// + /// + /// Whether to include free-form tags in the returned `json_prompt`. Defaults to false.
+ /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ImageDescribePostDescribeImageIdeogramV4AsResponseAsync( + global::System.IO.Stream image, + string imagename, + bool? includeBbox = default, + bool? includeStyleDescriptions = default, + bool? includeTags = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + var request = new global::Ideogram.ImageDescribePostDescribeImageIdeogramV4Request + { + Image = global::System.Array.Empty(), + Imagename = imagename, + IncludeBbox = includeBbox, + IncludeStyleDescriptions = includeStyleDescriptions, + IncludeTags = includeTags, + }; + PrepareArguments( + client: HttpClient); + PrepareImageDescribePostDescribeImageIdeogramV4Arguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImageDescribePostDescribeImageIdeogramV4SecurityRequirements, + operationName: "ImageDescribePostDescribeImageIdeogramV4Async"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/describe/ideogram-4", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.IncludeBbox != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.IncludeBbox, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"include_bbox\""); + + } + if (request.IncludeStyleDescriptions != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.IncludeStyleDescriptions, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"include_style_descriptions\""); + + } + if (request.IncludeTags != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.IncludeTags, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"include_tags\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImageDescribePostDescribeImageIdeogramV4Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImageDescribePostDescribeImageIdeogramV4", + methodName: "ImageDescribePostDescribeImageIdeogramV4Async", + pathTemplate: "\"/v2/image/describe/ideogram-4\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImageDescribePostDescribeImageIdeogramV4", + methodName: "ImageDescribePostDescribeImageIdeogramV4Async", + pathTemplate: "\"/v2/image/describe/ideogram-4\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImageDescribePostDescribeImageIdeogramV4", + methodName: "ImageDescribePostDescribeImageIdeogramV4Async", + pathTemplate: "\"/v2/image/describe/ideogram-4\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImageDescribePostDescribeImageIdeogramV4Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImageDescribePostDescribeImageIdeogramV4", + methodName: "ImageDescribePostDescribeImageIdeogramV4Async", + pathTemplate: "\"/v2/image/describe/ideogram-4\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImageDescribePostDescribeImageIdeogramV4", + methodName: "ImageDescribePostDescribeImageIdeogramV4Async", + pathTemplate: "\"/v2/image/describe/ideogram-4\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The source image was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Image failed the safety check. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::Ideogram.ImageSafetyError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::Ideogram.ImageSafetyError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::Ideogram.ImageSafetyError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImageDescribePostDescribeImageIdeogramV4ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.DescribeImageIdeogramV4Response.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.DescribeImageIdeogramV4Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImageDescribeClient.PostDescribeImageIdeogramV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImageDescribeClient.PostDescribeImageIdeogramV3.g.cs deleted file mode 100644 index 795f3033..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ImageDescribeClient.PostDescribeImageIdeogramV3.g.cs +++ /dev/null @@ -1,802 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ImageDescribeClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostDescribeImageIdeogramV3SecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostDescribeImageIdeogramV3SecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostDescribeImageIdeogramV3SecurityRequirement0, - }; - partial void PreparePostDescribeImageIdeogramV3Arguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.DescribeImageIdeogramV3Request request); - partial void PreparePostDescribeImageIdeogramV3Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.DescribeImageIdeogramV3Request request); - partial void ProcessPostDescribeImageIdeogramV3Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostDescribeImageIdeogramV3ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Describe with Ideogram 3.0
- /// Generate a natural-language description of an image with Ideogram's 3.0
- /// image captioner (a fine-tune of the Qwen2-VL vision-language model).
- /// Upload the image as `image` using `multipart/form-data`; the description
- /// is returned directly. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostDescribeImageIdeogramV3Async( - - global::Ideogram.DescribeImageIdeogramV3Request request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostDescribeImageIdeogramV3AsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Describe with Ideogram 3.0
- /// Generate a natural-language description of an image with Ideogram's 3.0
- /// image captioner (a fine-tune of the Qwen2-VL vision-language model).
- /// Upload the image as `image` using `multipart/form-data`; the description
- /// is returned directly. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostDescribeImageIdeogramV3AsResponseAsync( - - global::Ideogram.DescribeImageIdeogramV3Request request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostDescribeImageIdeogramV3Arguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostDescribeImageIdeogramV3SecurityRequirements, - operationName: "PostDescribeImageIdeogramV3Async"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/image/describe/ideogram-3", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (request.ImageAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ImageAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"image_asset_identifier\""); - - } - if (request.Image != default) - { - - var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostDescribeImageIdeogramV3Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostDescribeImageIdeogramV3", - methodName: "PostDescribeImageIdeogramV3Async", - pathTemplate: "\"/v2/image/describe/ideogram-3\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostDescribeImageIdeogramV3", - methodName: "PostDescribeImageIdeogramV3Async", - pathTemplate: "\"/v2/image/describe/ideogram-3\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostDescribeImageIdeogramV3", - methodName: "PostDescribeImageIdeogramV3Async", - pathTemplate: "\"/v2/image/describe/ideogram-3\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostDescribeImageIdeogramV3Response( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostDescribeImageIdeogramV3", - methodName: "PostDescribeImageIdeogramV3Async", - pathTemplate: "\"/v2/image/describe/ideogram-3\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostDescribeImageIdeogramV3", - methodName: "PostDescribeImageIdeogramV3Async", - pathTemplate: "\"/v2/image/describe/ideogram-3\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Image failed the safety check. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.ImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.ImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.ImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 500) - { - string? __content_500 = null; - global::System.Exception? __exception_500 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_500 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_500, - responseBody: __content_500, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostDescribeImageIdeogramV3ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.DescribeImageIdeogramV3Response.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.DescribeImageIdeogramV3Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Describe with Ideogram 3.0
- /// Generate a natural-language description of an image with Ideogram's 3.0
- /// image captioner (a fine-tune of the Qwen2-VL vision-language model).
- /// Upload the image as `image` using `multipart/form-data`; the description
- /// is returned directly. - ///
- /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The image to describe (max 10MB). JPEG, PNG, and WebP are supported. Multipart requests only. - /// - /// - /// The image to describe (max 10MB). JPEG, PNG, and WebP are supported. Multipart requests only. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostDescribeImageIdeogramV3Async( - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.DescribeImageIdeogramV3Request - { - ImageAssetIdentifier = imageAssetIdentifier, - Image = image, - Imagename = imagename, - }; - - return await PostDescribeImageIdeogramV3Async( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImageDescribeClient.PostDescribeImageIdeogramV4.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImageDescribeClient.PostDescribeImageIdeogramV4.g.cs deleted file mode 100644 index 50151feb..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ImageDescribeClient.PostDescribeImageIdeogramV4.g.cs +++ /dev/null @@ -1,847 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ImageDescribeClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostDescribeImageIdeogramV4SecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostDescribeImageIdeogramV4SecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostDescribeImageIdeogramV4SecurityRequirement0, - }; - partial void PreparePostDescribeImageIdeogramV4Arguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.DescribeImageIdeogramV4Request request); - partial void PreparePostDescribeImageIdeogramV4Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.DescribeImageIdeogramV4Request request); - partial void ProcessPostDescribeImageIdeogramV4Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostDescribeImageIdeogramV4ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Describe with Ideogram 4.0
- /// Describe an image as a structured `V4JsonPrompt` with Ideogram's 4.0
- /// image captioner (a fine-tune of the Qwen3-VL vision-language model).
- /// Upload the image as `image` using `multipart/form-data`; the
- /// `json_prompt` is returned directly and can be passed to the
- /// `/v1/ideogram-v4/generate` endpoints. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostDescribeImageIdeogramV4Async( - - global::Ideogram.DescribeImageIdeogramV4Request request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostDescribeImageIdeogramV4AsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Describe with Ideogram 4.0
- /// Describe an image as a structured `V4JsonPrompt` with Ideogram's 4.0
- /// image captioner (a fine-tune of the Qwen3-VL vision-language model).
- /// Upload the image as `image` using `multipart/form-data`; the
- /// `json_prompt` is returned directly and can be passed to the
- /// `/v1/ideogram-v4/generate` endpoints. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostDescribeImageIdeogramV4AsResponseAsync( - - global::Ideogram.DescribeImageIdeogramV4Request request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostDescribeImageIdeogramV4Arguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostDescribeImageIdeogramV4SecurityRequirements, - operationName: "PostDescribeImageIdeogramV4Async"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/image/describe/ideogram-4", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (request.ImageAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ImageAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"image_asset_identifier\""); - - } - if (request.Image != default) - { - - var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.IncludeBbox != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.IncludeBbox, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"include_bbox\""); - - } - if (request.IncludeStyleDescriptions != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.IncludeStyleDescriptions, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"include_style_descriptions\""); - - } - if (request.IncludeTags != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.IncludeTags, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"include_tags\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostDescribeImageIdeogramV4Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostDescribeImageIdeogramV4", - methodName: "PostDescribeImageIdeogramV4Async", - pathTemplate: "\"/v2/image/describe/ideogram-4\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostDescribeImageIdeogramV4", - methodName: "PostDescribeImageIdeogramV4Async", - pathTemplate: "\"/v2/image/describe/ideogram-4\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostDescribeImageIdeogramV4", - methodName: "PostDescribeImageIdeogramV4Async", - pathTemplate: "\"/v2/image/describe/ideogram-4\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostDescribeImageIdeogramV4Response( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostDescribeImageIdeogramV4", - methodName: "PostDescribeImageIdeogramV4Async", - pathTemplate: "\"/v2/image/describe/ideogram-4\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostDescribeImageIdeogramV4", - methodName: "PostDescribeImageIdeogramV4Async", - pathTemplate: "\"/v2/image/describe/ideogram-4\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Image failed the safety check. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.ImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.ImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.ImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 500) - { - string? __content_500 = null; - global::System.Exception? __exception_500 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_500 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_500, - responseBody: __content_500, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostDescribeImageIdeogramV4ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.DescribeImageIdeogramV4Response.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.DescribeImageIdeogramV4Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Describe with Ideogram 4.0
- /// Describe an image as a structured `V4JsonPrompt` with Ideogram's 4.0
- /// image captioner (a fine-tune of the Qwen3-VL vision-language model).
- /// Upload the image as `image` using `multipart/form-data`; the
- /// `json_prompt` is returned directly and can be passed to the
- /// `/v1/ideogram-v4/generate` endpoints. - ///
- /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The image to describe (max 10MB). JPEG, PNG, and WebP are supported. Multipart requests only. - /// - /// - /// The image to describe (max 10MB). JPEG, PNG, and WebP are supported. Multipart requests only. - /// - /// - /// Whether to include bounding boxes for the subjects and text in the returned `json_prompt`. Defaults to true, so the prompt preserves the layout of the described image.
- /// Default Value: true - /// - /// - /// Whether to include a free-form style description in the returned `json_prompt`. Defaults to false.
- /// Default Value: false - /// - /// - /// Whether to include free-form tags in the returned `json_prompt`. Defaults to false.
- /// Default Value: false - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostDescribeImageIdeogramV4Async( - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - bool? includeBbox = default, - bool? includeStyleDescriptions = default, - bool? includeTags = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.DescribeImageIdeogramV4Request - { - ImageAssetIdentifier = imageAssetIdentifier, - Image = image, - Imagename = imagename, - IncludeBbox = includeBbox, - IncludeStyleDescriptions = includeStyleDescriptions, - IncludeTags = includeTags, - }; - - return await PostDescribeImageIdeogramV4Async( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesGenerate.JsonSerializerContext.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesGenerate.JsonSerializerContext.g.cs index ead630ff..70b1c3cb 100644 --- a/src/libs/Ideogram/Generated/Ideogram.ImagesGenerate.JsonSerializerContext.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.ImagesGenerate.JsonSerializerContext.g.cs @@ -13,151 +13,144 @@ namespace Ideogram [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationKind), TypeInfoPropertyName = "GenerationKind2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GeneratedImageObject))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ResolutionV4), TypeInfoPropertyName = "ResolutionV42")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AspectRatioV3), TypeInfoPropertyName = "AspectRatioV32")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(byte[]))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ResolutionV3), TypeInfoPropertyName = "ResolutionV32")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AssetIdentifier))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationErrorResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationRejectReason), TypeInfoPropertyName = "GenerationRejectReason2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed), TypeInfoPropertyName = "GenerationErrorResponseTaskCompletionSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV3Response))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GeneratedImageObject))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV3Request))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramV3AspectRatio), TypeInfoPropertyName = "IdeogramV3AspectRatio2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV3RequestRenderingSpeed), TypeInfoPropertyName = "GenerateImageIdeogramV3RequestRenderingSpeed2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationErrorResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MagicPromptMode), TypeInfoPropertyName = "MagicPromptMode2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaBackground), TypeInfoPropertyName = "V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaBackground2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality), TypeInfoPropertyName = "V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogram45Response))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ResolutionV4), TypeInfoPropertyName = "ResolutionV42")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV4RequestRenderingSpeed), TypeInfoPropertyName = "GenerateImageIdeogramV4RequestRenderingSpeed2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV4Request))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV4Response))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV4CustomModelRequestRenderingSpeed), TypeInfoPropertyName = "GenerateImageIdeogramV4CustomModelRequestRenderingSpeed2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV4CustomModelRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV4CustomModelResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramV4AspectRatio), TypeInfoPropertyName = "IdeogramV4AspectRatio2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV4TransparentRequestOutputResolution), TypeInfoPropertyName = "GenerateImageIdeogramV4TransparentRequestOutputResolution2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV4TransparentRequestRenderingSpeed), TypeInfoPropertyName = "GenerateImageIdeogramV4TransparentRequestRenderingSpeed2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV4TransparentRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV4TransparentResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ResolutionV3), TypeInfoPropertyName = "ResolutionV32")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramV3AspectRatio), TypeInfoPropertyName = "IdeogramV3AspectRatio2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageGenerateIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed), TypeInfoPropertyName = "V2ImageGenerateIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramColorPalettePresetName), TypeInfoPropertyName = "IdeogramColorPalettePresetName2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramColorPaletteWithPresetName))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ColorPaletteMember))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ColorPaletteWithMembers))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramColorPalette), TypeInfoPropertyName = "IdeogramColorPalette2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramV3StyleType), TypeInfoPropertyName = "IdeogramV3StyleType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramV3StylePreset), TypeInfoPropertyName = "IdeogramV3StylePreset2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV3Response))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed), TypeInfoPropertyName = "V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType), TypeInfoPropertyName = "V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV3CharacterResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageGenerateIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed), TypeInfoPropertyName = "V2ImageGenerateIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV3CustomModelResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV3CustomModelRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV3CustomModelRequestRenderingSpeed), TypeInfoPropertyName = "GenerateImageIdeogramV3CustomModelRequestRenderingSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV4Response))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV4Request))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV4RequestRenderingSpeed), TypeInfoPropertyName = "GenerateImageIdeogramV4RequestRenderingSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV4CustomModelResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV4CustomModelRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.StackedCustomModel))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV4CustomModelRequestRenderingSpeed), TypeInfoPropertyName = "GenerateImageIdeogramV4CustomModelRequestRenderingSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV3TransparentResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV3TransparentRequest))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV3TransparentRequestUpscaleFactor), TypeInfoPropertyName = "GenerateImageIdeogramV3TransparentRequestUpscaleFactor2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV3TransparentRequestRenderingSpeed), TypeInfoPropertyName = "GenerateImageIdeogramV3TransparentRequestRenderingSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV4TransparentResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV4TransparentRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramV4AspectRatio), TypeInfoPropertyName = "IdeogramV4AspectRatio2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV4TransparentRequestOutputResolution), TypeInfoPropertyName = "GenerateImageIdeogramV4TransparentRequestOutputResolution2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV4TransparentRequestRenderingSpeed), TypeInfoPropertyName = "GenerateImageIdeogramV4TransparentRequestRenderingSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImagePImageIdeogramResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImagePImageIdeogramRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationQuality), TypeInfoPropertyName = "GenerationQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImagePImageIdeogramRequestResolution), TypeInfoPropertyName = "GenerateImagePImageIdeogramRequestResolution2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageZImageResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageZImageRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogram45Response))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationKind), TypeInfoPropertyName = "GenerationKind2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogram45Request))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogram45RequestBackground), TypeInfoPropertyName = "GenerateImageIdeogram45RequestBackground2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogram45RequestQuality), TypeInfoPropertyName = "GenerateImageIdeogram45RequestQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageNanoBanana2Response))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageNanoBanana2Request))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV3TransparentRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV3TransparentResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV2ARequestRenderingSpeed), TypeInfoPropertyName = "GenerateImageIdeogramV2ARequestRenderingSpeed2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramV2StyleType), TypeInfoPropertyName = "IdeogramV2StyleType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV2ARequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV2AResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV2RequestRenderingSpeed), TypeInfoPropertyName = "GenerateImageIdeogramV2RequestRenderingSpeed2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV2Request))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV2Response))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaBackground), TypeInfoPropertyName = "V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaBackground2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaQuality), TypeInfoPropertyName = "V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaQuality2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageGptImage25FlareResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaBackground), TypeInfoPropertyName = "V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaBackground2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaQuality), TypeInfoPropertyName = "V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaQuality2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageGptImage25SunburstResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageGptImage2Response))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.NanoBanana2AspectRatio), TypeInfoPropertyName = "NanoBanana2AspectRatio2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageNanoBanana2RequestResolutionTier), TypeInfoPropertyName = "GenerateImageNanoBanana2RequestResolutionTier2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageNanoBanana21Response))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageNanoBanana21Request))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageGenerateNanoBanana2PostRequestBodyContentMultipartFormDataSchemaResolutionTier), TypeInfoPropertyName = "V2ImageGenerateNanoBanana2PostRequestBodyContentMultipartFormDataSchemaResolutionTier2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageNanoBanana2Response))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.NanoBanana21AspectRatio), TypeInfoPropertyName = "NanoBanana21AspectRatio2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageNanoBanana21RequestResolutionTier), TypeInfoPropertyName = "GenerateImageNanoBanana21RequestResolutionTier2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageNanoBananaProResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageNanoBananaProRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageGenerateNanoBanana21PostRequestBodyContentMultipartFormDataSchemaResolutionTier), TypeInfoPropertyName = "V2ImageGenerateNanoBanana21PostRequestBodyContentMultipartFormDataSchemaResolutionTier2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageNanoBanana21Response))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.NanoBananaProAspectRatio), TypeInfoPropertyName = "NanoBananaProAspectRatio2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageNanoBananaProRequestResolutionTier), TypeInfoPropertyName = "GenerateImageNanoBananaProRequestResolutionTier2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageGptImage2Response))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageGptImage2Request))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageGptImage25FlareResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageGptImage25FlareRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageGptImage25FlareRequestBackground), TypeInfoPropertyName = "GenerateImageGptImage25FlareRequestBackground2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageGptImage25FlareRequestQuality), TypeInfoPropertyName = "GenerateImageGptImage25FlareRequestQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageGptImage25SunburstResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageGptImage25SunburstRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageGptImage25SunburstRequestBackground), TypeInfoPropertyName = "GenerateImageGptImage25SunburstRequestBackground2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageGptImage25SunburstRequestQuality), TypeInfoPropertyName = "GenerateImageGptImage25SunburstRequestQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV2Response))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV2Request))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV2RequestRenderingSpeed), TypeInfoPropertyName = "GenerateImageIdeogramV2RequestRenderingSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramV2StyleType), TypeInfoPropertyName = "IdeogramV2StyleType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV2AResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV2ARequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV2ARequestRenderingSpeed), TypeInfoPropertyName = "GenerateImageIdeogramV2ARequestRenderingSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV3CharacterResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV3CharacterRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV3CharacterRequestRenderingSpeed), TypeInfoPropertyName = "GenerateImageIdeogramV3CharacterRequestRenderingSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV3CharacterRequestStyleType), TypeInfoPropertyName = "GenerateImageIdeogramV3CharacterRequestStyleType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ColorPaletteWithMembers))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ColorPaletteMember))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AssetType), TypeInfoPropertyName = "AssetType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramColorPaletteWithPresetName))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramColorPalettePresetName), TypeInfoPropertyName = "IdeogramColorPalettePresetName2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ResolutionV4?), TypeInfoPropertyName = "NullableResolutionV42")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageGenerateNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier), TypeInfoPropertyName = "V2ImageGenerateNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageNanoBananaProResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationQuality), TypeInfoPropertyName = "GenerationQuality2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImagePImageIdeogramRequestResolution), TypeInfoPropertyName = "GenerateImagePImageIdeogramRequestResolution2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AspectRatioV3), TypeInfoPropertyName = "AspectRatioV32")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImagePImageIdeogramRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImagePImageIdeogramResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageZImageRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageZImageResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(byte[]))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2Ideogram45Request))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3Request))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25FlareRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25SunburstRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage2Request))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana2Request))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana21Request))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBananaProRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationKind?), TypeInfoPropertyName = "NullableGenerationKind2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AspectRatioV3?), TypeInfoPropertyName = "NullableAspectRatioV32")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ResolutionV3?), TypeInfoPropertyName = "NullableResolutionV32")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationRejectReason?), TypeInfoPropertyName = "NullableGenerationRejectReason2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?), TypeInfoPropertyName = "NullableGenerationErrorResponseTaskCompletionSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramV3AspectRatio?), TypeInfoPropertyName = "NullableIdeogramV3AspectRatio2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV3RequestRenderingSpeed?), TypeInfoPropertyName = "NullableGenerateImageIdeogramV3RequestRenderingSpeed2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MagicPromptMode?), TypeInfoPropertyName = "NullableMagicPromptMode2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramColorPalette?), TypeInfoPropertyName = "NullableIdeogramColorPalette2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramV3StyleType?), TypeInfoPropertyName = "NullableIdeogramV3StyleType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramV3StylePreset?), TypeInfoPropertyName = "NullableIdeogramV3StylePreset2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV3CustomModelRequestRenderingSpeed?), TypeInfoPropertyName = "NullableGenerateImageIdeogramV3CustomModelRequestRenderingSpeed2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaBackground?), TypeInfoPropertyName = "NullableV2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaBackground2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality?), TypeInfoPropertyName = "NullableV2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ResolutionV4?), TypeInfoPropertyName = "NullableResolutionV42")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV4RequestRenderingSpeed?), TypeInfoPropertyName = "NullableGenerateImageIdeogramV4RequestRenderingSpeed2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV4CustomModelRequestRenderingSpeed?), TypeInfoPropertyName = "NullableGenerateImageIdeogramV4CustomModelRequestRenderingSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(double?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV3TransparentRequestUpscaleFactor?), TypeInfoPropertyName = "NullableGenerateImageIdeogramV3TransparentRequestUpscaleFactor2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV3TransparentRequestRenderingSpeed?), TypeInfoPropertyName = "NullableGenerateImageIdeogramV3TransparentRequestRenderingSpeed2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramV4AspectRatio?), TypeInfoPropertyName = "NullableIdeogramV4AspectRatio2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV4TransparentRequestOutputResolution?), TypeInfoPropertyName = "NullableGenerateImageIdeogramV4TransparentRequestOutputResolution2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV4TransparentRequestRenderingSpeed?), TypeInfoPropertyName = "NullableGenerateImageIdeogramV4TransparentRequestRenderingSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationQuality?), TypeInfoPropertyName = "NullableGenerationQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImagePImageIdeogramRequestResolution?), TypeInfoPropertyName = "NullableGenerateImagePImageIdeogramRequestResolution2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationKind?), TypeInfoPropertyName = "NullableGenerationKind2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogram45RequestBackground?), TypeInfoPropertyName = "NullableGenerateImageIdeogram45RequestBackground2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogram45RequestQuality?), TypeInfoPropertyName = "NullableGenerateImageIdeogram45RequestQuality2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ResolutionV3?), TypeInfoPropertyName = "NullableResolutionV32")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramV3AspectRatio?), TypeInfoPropertyName = "NullableIdeogramV3AspectRatio2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageGenerateIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed?), TypeInfoPropertyName = "NullableV2ImageGenerateIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramColorPalettePresetName?), TypeInfoPropertyName = "NullableIdeogramColorPalettePresetName2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(double?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramColorPalette?), TypeInfoPropertyName = "NullableIdeogramColorPalette2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramV3StyleType?), TypeInfoPropertyName = "NullableIdeogramV3StyleType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramV3StylePreset?), TypeInfoPropertyName = "NullableIdeogramV3StylePreset2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed?), TypeInfoPropertyName = "NullableV2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType?), TypeInfoPropertyName = "NullableV2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageGenerateIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed?), TypeInfoPropertyName = "NullableV2ImageGenerateIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV3TransparentRequestUpscaleFactor?), TypeInfoPropertyName = "NullableGenerateImageIdeogramV3TransparentRequestUpscaleFactor2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV3TransparentRequestRenderingSpeed?), TypeInfoPropertyName = "NullableGenerateImageIdeogramV3TransparentRequestRenderingSpeed2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV2ARequestRenderingSpeed?), TypeInfoPropertyName = "NullableGenerateImageIdeogramV2ARequestRenderingSpeed2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramV2StyleType?), TypeInfoPropertyName = "NullableIdeogramV2StyleType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV2RequestRenderingSpeed?), TypeInfoPropertyName = "NullableGenerateImageIdeogramV2RequestRenderingSpeed2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaBackground?), TypeInfoPropertyName = "NullableV2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaBackground2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaQuality?), TypeInfoPropertyName = "NullableV2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaQuality2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaBackground?), TypeInfoPropertyName = "NullableV2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaBackground2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaQuality?), TypeInfoPropertyName = "NullableV2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaQuality2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.NanoBanana2AspectRatio?), TypeInfoPropertyName = "NullableNanoBanana2AspectRatio2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageNanoBanana2RequestResolutionTier?), TypeInfoPropertyName = "NullableGenerateImageNanoBanana2RequestResolutionTier2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageGenerateNanoBanana2PostRequestBodyContentMultipartFormDataSchemaResolutionTier?), TypeInfoPropertyName = "NullableV2ImageGenerateNanoBanana2PostRequestBodyContentMultipartFormDataSchemaResolutionTier2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.NanoBanana21AspectRatio?), TypeInfoPropertyName = "NullableNanoBanana21AspectRatio2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageNanoBanana21RequestResolutionTier?), TypeInfoPropertyName = "NullableGenerateImageNanoBanana21RequestResolutionTier2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageGenerateNanoBanana21PostRequestBodyContentMultipartFormDataSchemaResolutionTier?), TypeInfoPropertyName = "NullableV2ImageGenerateNanoBanana21PostRequestBodyContentMultipartFormDataSchemaResolutionTier2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.NanoBananaProAspectRatio?), TypeInfoPropertyName = "NullableNanoBananaProAspectRatio2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageNanoBananaProRequestResolutionTier?), TypeInfoPropertyName = "NullableGenerateImageNanoBananaProRequestResolutionTier2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageGptImage25FlareRequestBackground?), TypeInfoPropertyName = "NullableGenerateImageGptImage25FlareRequestBackground2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageGptImage25FlareRequestQuality?), TypeInfoPropertyName = "NullableGenerateImageGptImage25FlareRequestQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageGptImage25SunburstRequestBackground?), TypeInfoPropertyName = "NullableGenerateImageGptImage25SunburstRequestBackground2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageGptImage25SunburstRequestQuality?), TypeInfoPropertyName = "NullableGenerateImageGptImage25SunburstRequestQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV2RequestRenderingSpeed?), TypeInfoPropertyName = "NullableGenerateImageIdeogramV2RequestRenderingSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramV2StyleType?), TypeInfoPropertyName = "NullableIdeogramV2StyleType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV2ARequestRenderingSpeed?), TypeInfoPropertyName = "NullableGenerateImageIdeogramV2ARequestRenderingSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV3CharacterRequestRenderingSpeed?), TypeInfoPropertyName = "NullableGenerateImageIdeogramV3CharacterRequestRenderingSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV3CharacterRequestStyleType?), TypeInfoPropertyName = "NullableGenerateImageIdeogramV3CharacterRequestStyleType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AssetType?), TypeInfoPropertyName = "NullableAssetType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramColorPalettePresetName?), TypeInfoPropertyName = "NullableIdeogramColorPalettePresetName2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageGenerateNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier?), TypeInfoPropertyName = "NullableV2ImageGenerateNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationQuality?), TypeInfoPropertyName = "NullableGenerationQuality2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImagePImageIdeogramRequestResolution?), TypeInfoPropertyName = "NullableGenerateImagePImageIdeogramRequestResolution2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AspectRatioV3?), TypeInfoPropertyName = "NullableAspectRatioV32")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] internal sealed partial class ImagesGenerateSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext { } @@ -228,21 +221,33 @@ private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Ser public override bool CanConvert(global::System.Type typeToConvert) { return - typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed) + typeToConvert == typeof(global::Ideogram.GenerationKind) - || typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?) + || typeToConvert == typeof(global::Ideogram.GenerationKind?) || typeToConvert == typeof(global::Ideogram.GenerationRejectReason) || typeToConvert == typeof(global::Ideogram.GenerationRejectReason?) - || typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV3RequestRenderingSpeed) + || typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed) + + || typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?) - || typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV3RequestRenderingSpeed?) + || typeToConvert == typeof(global::Ideogram.MagicPromptMode) + + || typeToConvert == typeof(global::Ideogram.MagicPromptMode?) - || typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV3CustomModelRequestRenderingSpeed) + || typeToConvert == typeof(global::Ideogram.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaBackground) - || typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV3CustomModelRequestRenderingSpeed?) + || typeToConvert == typeof(global::Ideogram.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaBackground?) + + || typeToConvert == typeof(global::Ideogram.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality) + + || typeToConvert == typeof(global::Ideogram.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality?) + + || typeToConvert == typeof(global::Ideogram.ResolutionV4) + + || typeToConvert == typeof(global::Ideogram.ResolutionV4?) || typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV4RequestRenderingSpeed) @@ -252,13 +257,9 @@ public override bool CanConvert(global::System.Type typeToConvert) || typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV4CustomModelRequestRenderingSpeed?) - || typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV3TransparentRequestUpscaleFactor) - - || typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV3TransparentRequestUpscaleFactor?) - - || typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV3TransparentRequestRenderingSpeed) + || typeToConvert == typeof(global::Ideogram.IdeogramV4AspectRatio) - || typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV3TransparentRequestRenderingSpeed?) + || typeToConvert == typeof(global::Ideogram.IdeogramV4AspectRatio?) || typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV4TransparentRequestOutputResolution) @@ -268,139 +269,127 @@ public override bool CanConvert(global::System.Type typeToConvert) || typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV4TransparentRequestRenderingSpeed?) - || typeToConvert == typeof(global::Ideogram.GenerateImagePImageIdeogramRequestResolution) + || typeToConvert == typeof(global::Ideogram.ResolutionV3) - || typeToConvert == typeof(global::Ideogram.GenerateImagePImageIdeogramRequestResolution?) + || typeToConvert == typeof(global::Ideogram.ResolutionV3?) - || typeToConvert == typeof(global::Ideogram.GenerateImageIdeogram45RequestBackground) + || typeToConvert == typeof(global::Ideogram.IdeogramV3AspectRatio) - || typeToConvert == typeof(global::Ideogram.GenerateImageIdeogram45RequestBackground?) + || typeToConvert == typeof(global::Ideogram.IdeogramV3AspectRatio?) - || typeToConvert == typeof(global::Ideogram.GenerateImageIdeogram45RequestQuality) + || typeToConvert == typeof(global::Ideogram.V2ImageGenerateIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed) - || typeToConvert == typeof(global::Ideogram.GenerateImageIdeogram45RequestQuality?) + || typeToConvert == typeof(global::Ideogram.V2ImageGenerateIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed?) - || typeToConvert == typeof(global::Ideogram.GenerateImageNanoBanana2RequestResolutionTier) + || typeToConvert == typeof(global::Ideogram.IdeogramColorPalettePresetName) - || typeToConvert == typeof(global::Ideogram.GenerateImageNanoBanana2RequestResolutionTier?) + || typeToConvert == typeof(global::Ideogram.IdeogramColorPalettePresetName?) - || typeToConvert == typeof(global::Ideogram.GenerateImageNanoBanana21RequestResolutionTier) + || typeToConvert == typeof(global::Ideogram.IdeogramV3StyleType) - || typeToConvert == typeof(global::Ideogram.GenerateImageNanoBanana21RequestResolutionTier?) + || typeToConvert == typeof(global::Ideogram.IdeogramV3StyleType?) - || typeToConvert == typeof(global::Ideogram.GenerateImageNanoBananaProRequestResolutionTier) + || typeToConvert == typeof(global::Ideogram.IdeogramV3StylePreset) - || typeToConvert == typeof(global::Ideogram.GenerateImageNanoBananaProRequestResolutionTier?) + || typeToConvert == typeof(global::Ideogram.IdeogramV3StylePreset?) - || typeToConvert == typeof(global::Ideogram.GenerateImageGptImage25FlareRequestBackground) + || typeToConvert == typeof(global::Ideogram.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed) - || typeToConvert == typeof(global::Ideogram.GenerateImageGptImage25FlareRequestBackground?) + || typeToConvert == typeof(global::Ideogram.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed?) - || typeToConvert == typeof(global::Ideogram.GenerateImageGptImage25FlareRequestQuality) + || typeToConvert == typeof(global::Ideogram.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType) - || typeToConvert == typeof(global::Ideogram.GenerateImageGptImage25FlareRequestQuality?) + || typeToConvert == typeof(global::Ideogram.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType?) - || typeToConvert == typeof(global::Ideogram.GenerateImageGptImage25SunburstRequestBackground) + || typeToConvert == typeof(global::Ideogram.V2ImageGenerateIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed) - || typeToConvert == typeof(global::Ideogram.GenerateImageGptImage25SunburstRequestBackground?) + || typeToConvert == typeof(global::Ideogram.V2ImageGenerateIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed?) - || typeToConvert == typeof(global::Ideogram.GenerateImageGptImage25SunburstRequestQuality) + || typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV3TransparentRequestUpscaleFactor) - || typeToConvert == typeof(global::Ideogram.GenerateImageGptImage25SunburstRequestQuality?) + || typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV3TransparentRequestUpscaleFactor?) - || typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV2RequestRenderingSpeed) + || typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV3TransparentRequestRenderingSpeed) - || typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV2RequestRenderingSpeed?) + || typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV3TransparentRequestRenderingSpeed?) || typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV2ARequestRenderingSpeed) || typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV2ARequestRenderingSpeed?) - || typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV3CharacterRequestRenderingSpeed) + || typeToConvert == typeof(global::Ideogram.IdeogramV2StyleType) - || typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV3CharacterRequestRenderingSpeed?) + || typeToConvert == typeof(global::Ideogram.IdeogramV2StyleType?) - || typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV3CharacterRequestStyleType) + || typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV2RequestRenderingSpeed) - || typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV3CharacterRequestStyleType?) + || typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV2RequestRenderingSpeed?) - || typeToConvert == typeof(global::Ideogram.ResolutionV4) + || typeToConvert == typeof(global::Ideogram.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaBackground) - || typeToConvert == typeof(global::Ideogram.ResolutionV4?) + || typeToConvert == typeof(global::Ideogram.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaBackground?) - || typeToConvert == typeof(global::Ideogram.AspectRatioV3) + || typeToConvert == typeof(global::Ideogram.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaQuality) - || typeToConvert == typeof(global::Ideogram.AspectRatioV3?) + || typeToConvert == typeof(global::Ideogram.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaQuality?) - || typeToConvert == typeof(global::Ideogram.ResolutionV3) + || typeToConvert == typeof(global::Ideogram.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaBackground) - || typeToConvert == typeof(global::Ideogram.ResolutionV3?) + || typeToConvert == typeof(global::Ideogram.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaBackground?) - || typeToConvert == typeof(global::Ideogram.AssetType) + || typeToConvert == typeof(global::Ideogram.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaQuality) - || typeToConvert == typeof(global::Ideogram.AssetType?) + || typeToConvert == typeof(global::Ideogram.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaQuality?) - || typeToConvert == typeof(global::Ideogram.IdeogramV3AspectRatio) + || typeToConvert == typeof(global::Ideogram.NanoBanana2AspectRatio) - || typeToConvert == typeof(global::Ideogram.IdeogramV3AspectRatio?) + || typeToConvert == typeof(global::Ideogram.NanoBanana2AspectRatio?) - || typeToConvert == typeof(global::Ideogram.MagicPromptMode) + || typeToConvert == typeof(global::Ideogram.V2ImageGenerateNanoBanana2PostRequestBodyContentMultipartFormDataSchemaResolutionTier) - || typeToConvert == typeof(global::Ideogram.MagicPromptMode?) + || typeToConvert == typeof(global::Ideogram.V2ImageGenerateNanoBanana2PostRequestBodyContentMultipartFormDataSchemaResolutionTier?) - || typeToConvert == typeof(global::Ideogram.IdeogramColorPalettePresetName) + || typeToConvert == typeof(global::Ideogram.NanoBanana21AspectRatio) - || typeToConvert == typeof(global::Ideogram.IdeogramColorPalettePresetName?) + || typeToConvert == typeof(global::Ideogram.NanoBanana21AspectRatio?) - || typeToConvert == typeof(global::Ideogram.IdeogramV3StyleType) + || typeToConvert == typeof(global::Ideogram.V2ImageGenerateNanoBanana21PostRequestBodyContentMultipartFormDataSchemaResolutionTier) - || typeToConvert == typeof(global::Ideogram.IdeogramV3StyleType?) + || typeToConvert == typeof(global::Ideogram.V2ImageGenerateNanoBanana21PostRequestBodyContentMultipartFormDataSchemaResolutionTier?) - || typeToConvert == typeof(global::Ideogram.IdeogramV3StylePreset) + || typeToConvert == typeof(global::Ideogram.NanoBananaProAspectRatio) - || typeToConvert == typeof(global::Ideogram.IdeogramV3StylePreset?) + || typeToConvert == typeof(global::Ideogram.NanoBananaProAspectRatio?) - || typeToConvert == typeof(global::Ideogram.IdeogramV4AspectRatio) + || typeToConvert == typeof(global::Ideogram.V2ImageGenerateNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier) - || typeToConvert == typeof(global::Ideogram.IdeogramV4AspectRatio?) + || typeToConvert == typeof(global::Ideogram.V2ImageGenerateNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier?) || typeToConvert == typeof(global::Ideogram.GenerationQuality) || typeToConvert == typeof(global::Ideogram.GenerationQuality?) - || typeToConvert == typeof(global::Ideogram.GenerationKind) - - || typeToConvert == typeof(global::Ideogram.GenerationKind?) - - || typeToConvert == typeof(global::Ideogram.NanoBanana2AspectRatio) - - || typeToConvert == typeof(global::Ideogram.NanoBanana2AspectRatio?) - - || typeToConvert == typeof(global::Ideogram.NanoBanana21AspectRatio) - - || typeToConvert == typeof(global::Ideogram.NanoBanana21AspectRatio?) - - || typeToConvert == typeof(global::Ideogram.NanoBananaProAspectRatio) + || typeToConvert == typeof(global::Ideogram.GenerateImagePImageIdeogramRequestResolution) - || typeToConvert == typeof(global::Ideogram.NanoBananaProAspectRatio?) + || typeToConvert == typeof(global::Ideogram.GenerateImagePImageIdeogramRequestResolution?) - || typeToConvert == typeof(global::Ideogram.IdeogramV2StyleType) + || typeToConvert == typeof(global::Ideogram.AspectRatioV3) - || typeToConvert == typeof(global::Ideogram.IdeogramV2StyleType?); + || typeToConvert == typeof(global::Ideogram.AspectRatioV3?); } public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) { - if (typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed)) + if (typeToConvert == typeof(global::Ideogram.GenerationKind)) { - return new global::Ideogram.JsonConverters.GenerationErrorResponseTaskCompletionSpeedJsonConverter(); + return new global::Ideogram.JsonConverters.GenerationKindJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?)) + if (typeToConvert == typeof(global::Ideogram.GenerationKind?)) { - return new global::Ideogram.JsonConverters.GenerationErrorResponseTaskCompletionSpeedNullableJsonConverter(); + return new global::Ideogram.JsonConverters.GenerationKindNullableJsonConverter(); } if (typeToConvert == typeof(global::Ideogram.GenerationRejectReason)) @@ -413,24 +402,54 @@ public override bool CanConvert(global::System.Type typeToConvert) return new global::Ideogram.JsonConverters.GenerationRejectReasonNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV3RequestRenderingSpeed)) + if (typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed)) { - return new global::Ideogram.JsonConverters.GenerateImageIdeogramV3RequestRenderingSpeedJsonConverter(); + return new global::Ideogram.JsonConverters.GenerationErrorResponseTaskCompletionSpeedJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV3RequestRenderingSpeed?)) + if (typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?)) + { + return new global::Ideogram.JsonConverters.GenerationErrorResponseTaskCompletionSpeedNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::Ideogram.MagicPromptMode)) + { + return new global::Ideogram.JsonConverters.MagicPromptModeJsonConverter(); + } + + if (typeToConvert == typeof(global::Ideogram.MagicPromptMode?)) + { + return new global::Ideogram.JsonConverters.MagicPromptModeNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::Ideogram.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaBackground)) { - return new global::Ideogram.JsonConverters.GenerateImageIdeogramV3RequestRenderingSpeedNullableJsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaBackgroundJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV3CustomModelRequestRenderingSpeed)) + if (typeToConvert == typeof(global::Ideogram.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaBackground?)) { - return new global::Ideogram.JsonConverters.GenerateImageIdeogramV3CustomModelRequestRenderingSpeedJsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaBackgroundNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::Ideogram.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality)) + { + return new global::Ideogram.JsonConverters.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaQualityJsonConverter(); + } + + if (typeToConvert == typeof(global::Ideogram.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality?)) + { + return new global::Ideogram.JsonConverters.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaQualityNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::Ideogram.ResolutionV4)) + { + return new global::Ideogram.JsonConverters.ResolutionV4JsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV3CustomModelRequestRenderingSpeed?)) + if (typeToConvert == typeof(global::Ideogram.ResolutionV4?)) { - return new global::Ideogram.JsonConverters.GenerateImageIdeogramV3CustomModelRequestRenderingSpeedNullableJsonConverter(); + return new global::Ideogram.JsonConverters.ResolutionV4NullableJsonConverter(); } if (typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV4RequestRenderingSpeed)) @@ -453,24 +472,14 @@ public override bool CanConvert(global::System.Type typeToConvert) return new global::Ideogram.JsonConverters.GenerateImageIdeogramV4CustomModelRequestRenderingSpeedNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV3TransparentRequestUpscaleFactor)) - { - return new global::Ideogram.JsonConverters.GenerateImageIdeogramV3TransparentRequestUpscaleFactorJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV3TransparentRequestUpscaleFactor?)) - { - return new global::Ideogram.JsonConverters.GenerateImageIdeogramV3TransparentRequestUpscaleFactorNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV3TransparentRequestRenderingSpeed)) + if (typeToConvert == typeof(global::Ideogram.IdeogramV4AspectRatio)) { - return new global::Ideogram.JsonConverters.GenerateImageIdeogramV3TransparentRequestRenderingSpeedJsonConverter(); + return new global::Ideogram.JsonConverters.IdeogramV4AspectRatioJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV3TransparentRequestRenderingSpeed?)) + if (typeToConvert == typeof(global::Ideogram.IdeogramV4AspectRatio?)) { - return new global::Ideogram.JsonConverters.GenerateImageIdeogramV3TransparentRequestRenderingSpeedNullableJsonConverter(); + return new global::Ideogram.JsonConverters.IdeogramV4AspectRatioNullableJsonConverter(); } if (typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV4TransparentRequestOutputResolution)) @@ -493,114 +502,114 @@ public override bool CanConvert(global::System.Type typeToConvert) return new global::Ideogram.JsonConverters.GenerateImageIdeogramV4TransparentRequestRenderingSpeedNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.GenerateImagePImageIdeogramRequestResolution)) + if (typeToConvert == typeof(global::Ideogram.ResolutionV3)) { - return new global::Ideogram.JsonConverters.GenerateImagePImageIdeogramRequestResolutionJsonConverter(); + return new global::Ideogram.JsonConverters.ResolutionV3JsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.GenerateImagePImageIdeogramRequestResolution?)) + if (typeToConvert == typeof(global::Ideogram.ResolutionV3?)) { - return new global::Ideogram.JsonConverters.GenerateImagePImageIdeogramRequestResolutionNullableJsonConverter(); + return new global::Ideogram.JsonConverters.ResolutionV3NullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.GenerateImageIdeogram45RequestBackground)) + if (typeToConvert == typeof(global::Ideogram.IdeogramV3AspectRatio)) { - return new global::Ideogram.JsonConverters.GenerateImageIdeogram45RequestBackgroundJsonConverter(); + return new global::Ideogram.JsonConverters.IdeogramV3AspectRatioJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.GenerateImageIdeogram45RequestBackground?)) + if (typeToConvert == typeof(global::Ideogram.IdeogramV3AspectRatio?)) { - return new global::Ideogram.JsonConverters.GenerateImageIdeogram45RequestBackgroundNullableJsonConverter(); + return new global::Ideogram.JsonConverters.IdeogramV3AspectRatioNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.GenerateImageIdeogram45RequestQuality)) + if (typeToConvert == typeof(global::Ideogram.V2ImageGenerateIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed)) { - return new global::Ideogram.JsonConverters.GenerateImageIdeogram45RequestQualityJsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageGenerateIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.GenerateImageIdeogram45RequestQuality?)) + if (typeToConvert == typeof(global::Ideogram.V2ImageGenerateIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed?)) { - return new global::Ideogram.JsonConverters.GenerateImageIdeogram45RequestQualityNullableJsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageGenerateIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.GenerateImageNanoBanana2RequestResolutionTier)) + if (typeToConvert == typeof(global::Ideogram.IdeogramColorPalettePresetName)) { - return new global::Ideogram.JsonConverters.GenerateImageNanoBanana2RequestResolutionTierJsonConverter(); + return new global::Ideogram.JsonConverters.IdeogramColorPalettePresetNameJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.GenerateImageNanoBanana2RequestResolutionTier?)) + if (typeToConvert == typeof(global::Ideogram.IdeogramColorPalettePresetName?)) { - return new global::Ideogram.JsonConverters.GenerateImageNanoBanana2RequestResolutionTierNullableJsonConverter(); + return new global::Ideogram.JsonConverters.IdeogramColorPalettePresetNameNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.GenerateImageNanoBanana21RequestResolutionTier)) + if (typeToConvert == typeof(global::Ideogram.IdeogramV3StyleType)) { - return new global::Ideogram.JsonConverters.GenerateImageNanoBanana21RequestResolutionTierJsonConverter(); + return new global::Ideogram.JsonConverters.IdeogramV3StyleTypeJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.GenerateImageNanoBanana21RequestResolutionTier?)) + if (typeToConvert == typeof(global::Ideogram.IdeogramV3StyleType?)) { - return new global::Ideogram.JsonConverters.GenerateImageNanoBanana21RequestResolutionTierNullableJsonConverter(); + return new global::Ideogram.JsonConverters.IdeogramV3StyleTypeNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.GenerateImageNanoBananaProRequestResolutionTier)) + if (typeToConvert == typeof(global::Ideogram.IdeogramV3StylePreset)) { - return new global::Ideogram.JsonConverters.GenerateImageNanoBananaProRequestResolutionTierJsonConverter(); + return new global::Ideogram.JsonConverters.IdeogramV3StylePresetJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.GenerateImageNanoBananaProRequestResolutionTier?)) + if (typeToConvert == typeof(global::Ideogram.IdeogramV3StylePreset?)) { - return new global::Ideogram.JsonConverters.GenerateImageNanoBananaProRequestResolutionTierNullableJsonConverter(); + return new global::Ideogram.JsonConverters.IdeogramV3StylePresetNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.GenerateImageGptImage25FlareRequestBackground)) + if (typeToConvert == typeof(global::Ideogram.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed)) { - return new global::Ideogram.JsonConverters.GenerateImageGptImage25FlareRequestBackgroundJsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.GenerateImageGptImage25FlareRequestBackground?)) + if (typeToConvert == typeof(global::Ideogram.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed?)) { - return new global::Ideogram.JsonConverters.GenerateImageGptImage25FlareRequestBackgroundNullableJsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.GenerateImageGptImage25FlareRequestQuality)) + if (typeToConvert == typeof(global::Ideogram.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType)) { - return new global::Ideogram.JsonConverters.GenerateImageGptImage25FlareRequestQualityJsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleTypeJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.GenerateImageGptImage25FlareRequestQuality?)) + if (typeToConvert == typeof(global::Ideogram.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType?)) { - return new global::Ideogram.JsonConverters.GenerateImageGptImage25FlareRequestQualityNullableJsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleTypeNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.GenerateImageGptImage25SunburstRequestBackground)) + if (typeToConvert == typeof(global::Ideogram.V2ImageGenerateIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed)) { - return new global::Ideogram.JsonConverters.GenerateImageGptImage25SunburstRequestBackgroundJsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageGenerateIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.GenerateImageGptImage25SunburstRequestBackground?)) + if (typeToConvert == typeof(global::Ideogram.V2ImageGenerateIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed?)) { - return new global::Ideogram.JsonConverters.GenerateImageGptImage25SunburstRequestBackgroundNullableJsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageGenerateIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.GenerateImageGptImage25SunburstRequestQuality)) + if (typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV3TransparentRequestUpscaleFactor)) { - return new global::Ideogram.JsonConverters.GenerateImageGptImage25SunburstRequestQualityJsonConverter(); + return new global::Ideogram.JsonConverters.GenerateImageIdeogramV3TransparentRequestUpscaleFactorJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.GenerateImageGptImage25SunburstRequestQuality?)) + if (typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV3TransparentRequestUpscaleFactor?)) { - return new global::Ideogram.JsonConverters.GenerateImageGptImage25SunburstRequestQualityNullableJsonConverter(); + return new global::Ideogram.JsonConverters.GenerateImageIdeogramV3TransparentRequestUpscaleFactorNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV2RequestRenderingSpeed)) + if (typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV3TransparentRequestRenderingSpeed)) { - return new global::Ideogram.JsonConverters.GenerateImageIdeogramV2RequestRenderingSpeedJsonConverter(); + return new global::Ideogram.JsonConverters.GenerateImageIdeogramV3TransparentRequestRenderingSpeedJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV2RequestRenderingSpeed?)) + if (typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV3TransparentRequestRenderingSpeed?)) { - return new global::Ideogram.JsonConverters.GenerateImageIdeogramV2RequestRenderingSpeedNullableJsonConverter(); + return new global::Ideogram.JsonConverters.GenerateImageIdeogramV3TransparentRequestRenderingSpeedNullableJsonConverter(); } if (typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV2ARequestRenderingSpeed)) @@ -613,124 +622,124 @@ public override bool CanConvert(global::System.Type typeToConvert) return new global::Ideogram.JsonConverters.GenerateImageIdeogramV2ARequestRenderingSpeedNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV3CharacterRequestRenderingSpeed)) + if (typeToConvert == typeof(global::Ideogram.IdeogramV2StyleType)) { - return new global::Ideogram.JsonConverters.GenerateImageIdeogramV3CharacterRequestRenderingSpeedJsonConverter(); + return new global::Ideogram.JsonConverters.IdeogramV2StyleTypeJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV3CharacterRequestRenderingSpeed?)) + if (typeToConvert == typeof(global::Ideogram.IdeogramV2StyleType?)) { - return new global::Ideogram.JsonConverters.GenerateImageIdeogramV3CharacterRequestRenderingSpeedNullableJsonConverter(); + return new global::Ideogram.JsonConverters.IdeogramV2StyleTypeNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV3CharacterRequestStyleType)) + if (typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV2RequestRenderingSpeed)) { - return new global::Ideogram.JsonConverters.GenerateImageIdeogramV3CharacterRequestStyleTypeJsonConverter(); + return new global::Ideogram.JsonConverters.GenerateImageIdeogramV2RequestRenderingSpeedJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV3CharacterRequestStyleType?)) + if (typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV2RequestRenderingSpeed?)) { - return new global::Ideogram.JsonConverters.GenerateImageIdeogramV3CharacterRequestStyleTypeNullableJsonConverter(); + return new global::Ideogram.JsonConverters.GenerateImageIdeogramV2RequestRenderingSpeedNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.ResolutionV4)) + if (typeToConvert == typeof(global::Ideogram.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaBackground)) { - return new global::Ideogram.JsonConverters.ResolutionV4JsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaBackgroundJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.ResolutionV4?)) + if (typeToConvert == typeof(global::Ideogram.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaBackground?)) { - return new global::Ideogram.JsonConverters.ResolutionV4NullableJsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaBackgroundNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.AspectRatioV3)) + if (typeToConvert == typeof(global::Ideogram.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaQuality)) { - return new global::Ideogram.JsonConverters.AspectRatioV3JsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaQualityJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.AspectRatioV3?)) + if (typeToConvert == typeof(global::Ideogram.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaQuality?)) { - return new global::Ideogram.JsonConverters.AspectRatioV3NullableJsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaQualityNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.ResolutionV3)) + if (typeToConvert == typeof(global::Ideogram.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaBackground)) { - return new global::Ideogram.JsonConverters.ResolutionV3JsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaBackgroundJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.ResolutionV3?)) + if (typeToConvert == typeof(global::Ideogram.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaBackground?)) { - return new global::Ideogram.JsonConverters.ResolutionV3NullableJsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaBackgroundNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.AssetType)) + if (typeToConvert == typeof(global::Ideogram.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaQuality)) { - return new global::Ideogram.JsonConverters.AssetTypeJsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaQualityJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.AssetType?)) + if (typeToConvert == typeof(global::Ideogram.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaQuality?)) { - return new global::Ideogram.JsonConverters.AssetTypeNullableJsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaQualityNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.IdeogramV3AspectRatio)) + if (typeToConvert == typeof(global::Ideogram.NanoBanana2AspectRatio)) { - return new global::Ideogram.JsonConverters.IdeogramV3AspectRatioJsonConverter(); + return new global::Ideogram.JsonConverters.NanoBanana2AspectRatioJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.IdeogramV3AspectRatio?)) + if (typeToConvert == typeof(global::Ideogram.NanoBanana2AspectRatio?)) { - return new global::Ideogram.JsonConverters.IdeogramV3AspectRatioNullableJsonConverter(); + return new global::Ideogram.JsonConverters.NanoBanana2AspectRatioNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.MagicPromptMode)) + if (typeToConvert == typeof(global::Ideogram.V2ImageGenerateNanoBanana2PostRequestBodyContentMultipartFormDataSchemaResolutionTier)) { - return new global::Ideogram.JsonConverters.MagicPromptModeJsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageGenerateNanoBanana2PostRequestBodyContentMultipartFormDataSchemaResolutionTierJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.MagicPromptMode?)) + if (typeToConvert == typeof(global::Ideogram.V2ImageGenerateNanoBanana2PostRequestBodyContentMultipartFormDataSchemaResolutionTier?)) { - return new global::Ideogram.JsonConverters.MagicPromptModeNullableJsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageGenerateNanoBanana2PostRequestBodyContentMultipartFormDataSchemaResolutionTierNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.IdeogramColorPalettePresetName)) + if (typeToConvert == typeof(global::Ideogram.NanoBanana21AspectRatio)) { - return new global::Ideogram.JsonConverters.IdeogramColorPalettePresetNameJsonConverter(); + return new global::Ideogram.JsonConverters.NanoBanana21AspectRatioJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.IdeogramColorPalettePresetName?)) + if (typeToConvert == typeof(global::Ideogram.NanoBanana21AspectRatio?)) { - return new global::Ideogram.JsonConverters.IdeogramColorPalettePresetNameNullableJsonConverter(); + return new global::Ideogram.JsonConverters.NanoBanana21AspectRatioNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.IdeogramV3StyleType)) + if (typeToConvert == typeof(global::Ideogram.V2ImageGenerateNanoBanana21PostRequestBodyContentMultipartFormDataSchemaResolutionTier)) { - return new global::Ideogram.JsonConverters.IdeogramV3StyleTypeJsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageGenerateNanoBanana21PostRequestBodyContentMultipartFormDataSchemaResolutionTierJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.IdeogramV3StyleType?)) + if (typeToConvert == typeof(global::Ideogram.V2ImageGenerateNanoBanana21PostRequestBodyContentMultipartFormDataSchemaResolutionTier?)) { - return new global::Ideogram.JsonConverters.IdeogramV3StyleTypeNullableJsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageGenerateNanoBanana21PostRequestBodyContentMultipartFormDataSchemaResolutionTierNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.IdeogramV3StylePreset)) + if (typeToConvert == typeof(global::Ideogram.NanoBananaProAspectRatio)) { - return new global::Ideogram.JsonConverters.IdeogramV3StylePresetJsonConverter(); + return new global::Ideogram.JsonConverters.NanoBananaProAspectRatioJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.IdeogramV3StylePreset?)) + if (typeToConvert == typeof(global::Ideogram.NanoBananaProAspectRatio?)) { - return new global::Ideogram.JsonConverters.IdeogramV3StylePresetNullableJsonConverter(); + return new global::Ideogram.JsonConverters.NanoBananaProAspectRatioNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.IdeogramV4AspectRatio)) + if (typeToConvert == typeof(global::Ideogram.V2ImageGenerateNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier)) { - return new global::Ideogram.JsonConverters.IdeogramV4AspectRatioJsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageGenerateNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTierJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.IdeogramV4AspectRatio?)) + if (typeToConvert == typeof(global::Ideogram.V2ImageGenerateNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier?)) { - return new global::Ideogram.JsonConverters.IdeogramV4AspectRatioNullableJsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageGenerateNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTierNullableJsonConverter(); } if (typeToConvert == typeof(global::Ideogram.GenerationQuality)) @@ -743,54 +752,24 @@ public override bool CanConvert(global::System.Type typeToConvert) return new global::Ideogram.JsonConverters.GenerationQualityNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.GenerationKind)) - { - return new global::Ideogram.JsonConverters.GenerationKindJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerationKind?)) - { - return new global::Ideogram.JsonConverters.GenerationKindNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.NanoBanana2AspectRatio)) - { - return new global::Ideogram.JsonConverters.NanoBanana2AspectRatioJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.NanoBanana2AspectRatio?)) - { - return new global::Ideogram.JsonConverters.NanoBanana2AspectRatioNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.NanoBanana21AspectRatio)) - { - return new global::Ideogram.JsonConverters.NanoBanana21AspectRatioJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.NanoBanana21AspectRatio?)) - { - return new global::Ideogram.JsonConverters.NanoBanana21AspectRatioNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.NanoBananaProAspectRatio)) + if (typeToConvert == typeof(global::Ideogram.GenerateImagePImageIdeogramRequestResolution)) { - return new global::Ideogram.JsonConverters.NanoBananaProAspectRatioJsonConverter(); + return new global::Ideogram.JsonConverters.GenerateImagePImageIdeogramRequestResolutionJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.NanoBananaProAspectRatio?)) + if (typeToConvert == typeof(global::Ideogram.GenerateImagePImageIdeogramRequestResolution?)) { - return new global::Ideogram.JsonConverters.NanoBananaProAspectRatioNullableJsonConverter(); + return new global::Ideogram.JsonConverters.GenerateImagePImageIdeogramRequestResolutionNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.IdeogramV2StyleType)) + if (typeToConvert == typeof(global::Ideogram.AspectRatioV3)) { - return new global::Ideogram.JsonConverters.IdeogramV2StyleTypeJsonConverter(); + return new global::Ideogram.JsonConverters.AspectRatioV3JsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.IdeogramV2StyleType?)) + if (typeToConvert == typeof(global::Ideogram.AspectRatioV3?)) { - return new global::Ideogram.JsonConverters.IdeogramV2StyleTypeNullableJsonConverter(); + return new global::Ideogram.JsonConverters.AspectRatioV3NullableJsonConverter(); } throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); } diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2GptImage2.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2GptImage2.g.cs new file mode 100644 index 00000000..fa9267b9 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2GptImage2.g.cs @@ -0,0 +1,872 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class ImagesGenerateClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_ImagesGeneratePostGenerateImageV2GptImage2SecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_ImagesGeneratePostGenerateImageV2GptImage2SecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_ImagesGeneratePostGenerateImageV2GptImage2SecurityRequirement0, + }; + partial void PrepareImagesGeneratePostGenerateImageV2GptImage2Arguments( + global::System.Net.Http.HttpClient httpClient, + ref bool? dryRun, + global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage2Request request); + partial void PrepareImagesGeneratePostGenerateImageV2GptImage2Request( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + bool? dryRun, + global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage2Request request); + partial void ProcessImagesGeneratePostGenerateImageV2GptImage2Response( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessImagesGeneratePostGenerateImageV2GptImage2ResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Generate with GPT Image 2
+ /// Generate images with GPT Image 2. Optionally upload source images as
+ /// `images` using `multipart/form-data` to edit them with the prompt.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2GptImage2Async( + + global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage2Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ImagesGeneratePostGenerateImageV2GptImage2AsResponseAsync( + + request: request, + dryRun: dryRun, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Generate with GPT Image 2
+ /// Generate images with GPT Image 2. Optionally upload source images as
+ /// `images` using `multipart/form-data` to edit them with the prompt.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ImagesGeneratePostGenerateImageV2GptImage2AsResponseAsync( + + global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage2Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareImagesGeneratePostGenerateImageV2GptImage2Arguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImagesGeneratePostGenerateImageV2GptImage2SecurityRequirements, + operationName: "ImagesGeneratePostGenerateImageV2GptImage2Async"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/generate/gpt-image-2", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + if (request.Images != default) + { + + for (var __iImages = 0; __iImages < request.Images.Count; __iImages++) + { + var __contentImages = new global::System.Net.Http.ByteArrayContent(request.Images[__iImages]); + __contentImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); + __httpRequestContent.Add( + content: __contentImages, + name: "\"images\"", + fileName: $"\"file{__iImages}.bin\""); + if (__contentImages.Headers.ContentDisposition != null) + { + __contentImages.Headers.ContentDisposition.FileNameStar = null; + } + } + + } + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (request.AspectRatio != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.AspectRatio ?? string.Empty), + name: "\"aspect_ratio\""); + + } + if (request.Resolution != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Resolution ?? string.Empty), + name: "\"resolution\""); + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImagesGeneratePostGenerateImageV2GptImage2Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2GptImage2", + methodName: "ImagesGeneratePostGenerateImageV2GptImage2Async", + pathTemplate: "\"/v2/image/generate/gpt-image-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2GptImage2", + methodName: "ImagesGeneratePostGenerateImageV2GptImage2Async", + pathTemplate: "\"/v2/image/generate/gpt-image-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2GptImage2", + methodName: "ImagesGeneratePostGenerateImageV2GptImage2Async", + pathTemplate: "\"/v2/image/generate/gpt-image-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImagesGeneratePostGenerateImageV2GptImage2Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2GptImage2", + methodName: "ImagesGeneratePostGenerateImageV2GptImage2Async", + pathTemplate: "\"/v2/image/generate/gpt-image-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2GptImage2", + methodName: "ImagesGeneratePostGenerateImageV2GptImage2Async", + pathTemplate: "\"/v2/image/generate/gpt-image-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImagesGeneratePostGenerateImageV2GptImage2ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.GenerateImageGptImage2Response.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.GenerateImageGptImage2Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Generate with GPT Image 2
+ /// Generate images with GPT Image 2. Optionally upload source images as
+ /// `images` using `multipart/form-data` to edit them with the prompt.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt to generate images from, or the edit instruction to apply when source images are supplied. It is passed to the model as written. + /// + /// + /// Optional source images to edit (max 16, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only. + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The requested output aspect ratio, for example "1:1", "16:9", or "9:16". Ignored when `resolution` is provided. Defaults to "1:1". + /// + /// + /// Exact output resolution, formatted as "WIDTHxHEIGHT", for example
+ /// "2048x2048" or "1920x1088". When provided, this takes precedence
+ /// over `aspect_ratio`. The dimensions must satisfy GPT Image 2
+ /// constraints: each side is a multiple of 16, the largest side is at
+ /// most 3840px, the long:short ratio is at most 3:1, and total pixels
+ /// are between 655360 and 8294400 inclusive. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2GptImage2Async( + string prompt, + bool? dryRun = default, + global::System.Collections.Generic.IList? images = default, + int? numImages = default, + int? seed = default, + string? aspectRatio = default, + string? resolution = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage2Request + { + Prompt = prompt, + Images = images, + NumImages = numImages, + Seed = seed, + AspectRatio = aspectRatio, + Resolution = resolution, + Async = async, + WebhookUrl = webhookUrl, + }; + + return await ImagesGeneratePostGenerateImageV2GptImage2Async( + dryRun: dryRun, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2GptImage25Flare.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2GptImage25Flare.g.cs new file mode 100644 index 00000000..63839076 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2GptImage25Flare.g.cs @@ -0,0 +1,952 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class ImagesGenerateClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_ImagesGeneratePostGenerateImageV2GptImage25FlareSecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_ImagesGeneratePostGenerateImageV2GptImage25FlareSecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_ImagesGeneratePostGenerateImageV2GptImage25FlareSecurityRequirement0, + }; + partial void PrepareImagesGeneratePostGenerateImageV2GptImage25FlareArguments( + global::System.Net.Http.HttpClient httpClient, + ref bool? dryRun, + global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25FlareRequest request); + partial void PrepareImagesGeneratePostGenerateImageV2GptImage25FlareRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + bool? dryRun, + global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25FlareRequest request); + partial void ProcessImagesGeneratePostGenerateImageV2GptImage25FlareResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessImagesGeneratePostGenerateImageV2GptImage25FlareResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Generate with GPT Image 2.5 Flare
+ /// Generate images with GPT Image 2.5 Flare, the fast variant of GPT Image
+ /// 2.5. Optionally upload source images as `images` using
+ /// `multipart/form-data` to edit them with the prompt. Returns results
+ /// directly by default; set `async` or supply a `webhook_url` to get a
+ /// `generation_id` and poll `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2GptImage25FlareAsync( + + global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25FlareRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ImagesGeneratePostGenerateImageV2GptImage25FlareAsResponseAsync( + + request: request, + dryRun: dryRun, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Generate with GPT Image 2.5 Flare
+ /// Generate images with GPT Image 2.5 Flare, the fast variant of GPT Image
+ /// 2.5. Optionally upload source images as `images` using
+ /// `multipart/form-data` to edit them with the prompt. Returns results
+ /// directly by default; set `async` or supply a `webhook_url` to get a
+ /// `generation_id` and poll `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ImagesGeneratePostGenerateImageV2GptImage25FlareAsResponseAsync( + + global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25FlareRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareImagesGeneratePostGenerateImageV2GptImage25FlareArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImagesGeneratePostGenerateImageV2GptImage25FlareSecurityRequirements, + operationName: "ImagesGeneratePostGenerateImageV2GptImage25FlareAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/generate/gpt-image-2-5-flare", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + if (request.Images != default) + { + + for (var __iImages = 0; __iImages < request.Images.Count; __iImages++) + { + var __contentImages = new global::System.Net.Http.ByteArrayContent(request.Images[__iImages]); + __contentImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); + __httpRequestContent.Add( + content: __contentImages, + name: "\"images\"", + fileName: $"\"file{__iImages}.bin\""); + if (__contentImages.Headers.ContentDisposition != null) + { + __contentImages.Headers.ContentDisposition.FileNameStar = null; + } + } + + } + if (request.Mask != default) + { + + var __contentMask = new global::System.Net.Http.ByteArrayContent(request.Mask ?? global::System.Array.Empty()); + __contentMask.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Maskname is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Maskname) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentMask, + name: "\"mask\"", + fileName: request.Maskname != null ? $"\"{request.Maskname}\"" : string.Empty); + if (__contentMask.Headers.ContentDisposition != null) + { + __contentMask.Headers.ContentDisposition.FileNameStar = null; + } + + } + if (request.Background != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Background).HasValue ? (request.Background).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"background\""); + + } + if (request.Quality != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Quality).HasValue ? (request.Quality).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"quality\""); + + } + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (request.AspectRatio != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.AspectRatio ?? string.Empty), + name: "\"aspect_ratio\""); + + } + if (request.Resolution != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Resolution ?? string.Empty), + name: "\"resolution\""); + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImagesGeneratePostGenerateImageV2GptImage25FlareRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2GptImage25Flare", + methodName: "ImagesGeneratePostGenerateImageV2GptImage25FlareAsync", + pathTemplate: "\"/v2/image/generate/gpt-image-2-5-flare\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2GptImage25Flare", + methodName: "ImagesGeneratePostGenerateImageV2GptImage25FlareAsync", + pathTemplate: "\"/v2/image/generate/gpt-image-2-5-flare\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2GptImage25Flare", + methodName: "ImagesGeneratePostGenerateImageV2GptImage25FlareAsync", + pathTemplate: "\"/v2/image/generate/gpt-image-2-5-flare\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImagesGeneratePostGenerateImageV2GptImage25FlareResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2GptImage25Flare", + methodName: "ImagesGeneratePostGenerateImageV2GptImage25FlareAsync", + pathTemplate: "\"/v2/image/generate/gpt-image-2-5-flare\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2GptImage25Flare", + methodName: "ImagesGeneratePostGenerateImageV2GptImage25FlareAsync", + pathTemplate: "\"/v2/image/generate/gpt-image-2-5-flare\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImagesGeneratePostGenerateImageV2GptImage25FlareResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.GenerateImageGptImage25FlareResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.GenerateImageGptImage25FlareResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Generate with GPT Image 2.5 Flare
+ /// Generate images with GPT Image 2.5 Flare, the fast variant of GPT Image
+ /// 2.5. Optionally upload source images as `images` using
+ /// `multipart/form-data` to edit them with the prompt. Returns results
+ /// directly by default; set `async` or supply a `webhook_url` to get a
+ /// `generation_id` and poll `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt to generate images from, or the edit instruction to apply when source images are supplied. It is passed to the model as written. + /// + /// + /// Optional source images to edit (max 16, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only. + /// + /// + /// An optional mask for the first source image (max 25MB; JPEG, PNG, or WEBP). Multipart requests only. Fully transparent pixels mark the areas to edit. The mask must have the same dimensions as the first source image, and requires source images in the same request. + /// + /// + /// An optional mask for the first source image (max 25MB; JPEG, PNG, or WEBP). Multipart requests only. Fully transparent pixels mark the areas to edit. The mask must have the same dimensions as the first source image, and requires source images in the same request. + /// + /// + /// The output background. `transparent` returns images with an alpha channel, `opaque` forces a solid background, and `auto` lets the model decide from the prompt.
+ /// Default Value: auto + /// + /// + /// How much rendering effort the model spends. Lower tiers return sooner and cost less; `auto` lets the model choose, which it currently renders at `high`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The requested output aspect ratio, for example "1:1", "16:9", or "9:16". Ignored when `resolution` is provided. Defaults to "1:1". + /// + /// + /// Exact output resolution, formatted as "WIDTHxHEIGHT", for example
+ /// "2048x2048" or "1920x1088". When provided, this takes precedence
+ /// over `aspect_ratio`. The dimensions must satisfy GPT Image 2.5 Flare
+ /// constraints: each side is a multiple of 16, the largest side is at
+ /// most 3840px, the long:short ratio is at most 3:1, and total pixels
+ /// are between 655360 and 8294400 inclusive. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2GptImage25FlareAsync( + string prompt, + bool? dryRun = default, + global::System.Collections.Generic.IList? images = default, + byte[]? mask = default, + string? maskname = default, + global::Ideogram.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaBackground? background = default, + global::Ideogram.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaQuality? quality = default, + int? numImages = default, + int? seed = default, + string? aspectRatio = default, + string? resolution = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25FlareRequest + { + Prompt = prompt, + Images = images, + Mask = mask, + Maskname = maskname, + Background = background, + Quality = quality, + NumImages = numImages, + Seed = seed, + AspectRatio = aspectRatio, + Resolution = resolution, + Async = async, + WebhookUrl = webhookUrl, + }; + + return await ImagesGeneratePostGenerateImageV2GptImage25FlareAsync( + dryRun: dryRun, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2GptImage25Sunburst.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2GptImage25Sunburst.g.cs new file mode 100644 index 00000000..cedd342b --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2GptImage25Sunburst.g.cs @@ -0,0 +1,955 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class ImagesGenerateClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_ImagesGeneratePostGenerateImageV2GptImage25SunburstSecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_ImagesGeneratePostGenerateImageV2GptImage25SunburstSecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_ImagesGeneratePostGenerateImageV2GptImage25SunburstSecurityRequirement0, + }; + partial void PrepareImagesGeneratePostGenerateImageV2GptImage25SunburstArguments( + global::System.Net.Http.HttpClient httpClient, + ref bool? dryRun, + global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25SunburstRequest request); + partial void PrepareImagesGeneratePostGenerateImageV2GptImage25SunburstRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + bool? dryRun, + global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25SunburstRequest request); + partial void ProcessImagesGeneratePostGenerateImageV2GptImage25SunburstResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessImagesGeneratePostGenerateImageV2GptImage25SunburstResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Generate with GPT Image 2.5 Sunburst
+ /// Generate images with GPT Image 2.5 Sunburst, the quality variant of GPT
+ /// Image 2.5, with finer detail at higher latency than Flare. Optionally
+ /// upload source images as `images` using `multipart/form-data` to edit
+ /// them with the prompt. Returns results directly by default; set `async`
+ /// or supply a `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2GptImage25SunburstAsync( + + global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25SunburstRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ImagesGeneratePostGenerateImageV2GptImage25SunburstAsResponseAsync( + + request: request, + dryRun: dryRun, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Generate with GPT Image 2.5 Sunburst
+ /// Generate images with GPT Image 2.5 Sunburst, the quality variant of GPT
+ /// Image 2.5, with finer detail at higher latency than Flare. Optionally
+ /// upload source images as `images` using `multipart/form-data` to edit
+ /// them with the prompt. Returns results directly by default; set `async`
+ /// or supply a `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ImagesGeneratePostGenerateImageV2GptImage25SunburstAsResponseAsync( + + global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25SunburstRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareImagesGeneratePostGenerateImageV2GptImage25SunburstArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImagesGeneratePostGenerateImageV2GptImage25SunburstSecurityRequirements, + operationName: "ImagesGeneratePostGenerateImageV2GptImage25SunburstAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/generate/gpt-image-2-5-sunburst", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + if (request.Images != default) + { + + for (var __iImages = 0; __iImages < request.Images.Count; __iImages++) + { + var __contentImages = new global::System.Net.Http.ByteArrayContent(request.Images[__iImages]); + __contentImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); + __httpRequestContent.Add( + content: __contentImages, + name: "\"images\"", + fileName: $"\"file{__iImages}.bin\""); + if (__contentImages.Headers.ContentDisposition != null) + { + __contentImages.Headers.ContentDisposition.FileNameStar = null; + } + } + + } + if (request.Mask != default) + { + + var __contentMask = new global::System.Net.Http.ByteArrayContent(request.Mask ?? global::System.Array.Empty()); + __contentMask.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Maskname is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Maskname) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentMask, + name: "\"mask\"", + fileName: request.Maskname != null ? $"\"{request.Maskname}\"" : string.Empty); + if (__contentMask.Headers.ContentDisposition != null) + { + __contentMask.Headers.ContentDisposition.FileNameStar = null; + } + + } + if (request.Background != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Background).HasValue ? (request.Background).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"background\""); + + } + if (request.Quality != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Quality).HasValue ? (request.Quality).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"quality\""); + + } + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (request.AspectRatio != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.AspectRatio ?? string.Empty), + name: "\"aspect_ratio\""); + + } + if (request.Resolution != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Resolution ?? string.Empty), + name: "\"resolution\""); + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImagesGeneratePostGenerateImageV2GptImage25SunburstRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2GptImage25Sunburst", + methodName: "ImagesGeneratePostGenerateImageV2GptImage25SunburstAsync", + pathTemplate: "\"/v2/image/generate/gpt-image-2-5-sunburst\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2GptImage25Sunburst", + methodName: "ImagesGeneratePostGenerateImageV2GptImage25SunburstAsync", + pathTemplate: "\"/v2/image/generate/gpt-image-2-5-sunburst\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2GptImage25Sunburst", + methodName: "ImagesGeneratePostGenerateImageV2GptImage25SunburstAsync", + pathTemplate: "\"/v2/image/generate/gpt-image-2-5-sunburst\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImagesGeneratePostGenerateImageV2GptImage25SunburstResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2GptImage25Sunburst", + methodName: "ImagesGeneratePostGenerateImageV2GptImage25SunburstAsync", + pathTemplate: "\"/v2/image/generate/gpt-image-2-5-sunburst\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2GptImage25Sunburst", + methodName: "ImagesGeneratePostGenerateImageV2GptImage25SunburstAsync", + pathTemplate: "\"/v2/image/generate/gpt-image-2-5-sunburst\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImagesGeneratePostGenerateImageV2GptImage25SunburstResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.GenerateImageGptImage25SunburstResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.GenerateImageGptImage25SunburstResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Generate with GPT Image 2.5 Sunburst
+ /// Generate images with GPT Image 2.5 Sunburst, the quality variant of GPT
+ /// Image 2.5, with finer detail at higher latency than Flare. Optionally
+ /// upload source images as `images` using `multipart/form-data` to edit
+ /// them with the prompt. Returns results directly by default; set `async`
+ /// or supply a `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt to generate images from, or the edit instruction to apply when source images are supplied. It is passed to the model as written. + /// + /// + /// Optional source images to edit (max 16, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only. + /// + /// + /// An optional mask for the first source image (max 25MB; JPEG, PNG, or WEBP). Multipart requests only. Fully transparent pixels mark the areas to edit. The mask must have the same dimensions as the first source image, and requires source images in the same request. + /// + /// + /// An optional mask for the first source image (max 25MB; JPEG, PNG, or WEBP). Multipart requests only. Fully transparent pixels mark the areas to edit. The mask must have the same dimensions as the first source image, and requires source images in the same request. + /// + /// + /// The output background. `transparent` returns images with an alpha channel, `opaque` forces a solid background, and `auto` lets the model decide from the prompt.
+ /// Default Value: auto + /// + /// + /// How much rendering effort the model spends. Lower tiers return sooner and cost less; `auto` lets the model choose, which it currently renders at `high`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The requested output aspect ratio, for example "1:1", "16:9", or "9:16". Ignored when `resolution` is provided. Defaults to "1:1". + /// + /// + /// Exact output resolution, formatted as "WIDTHxHEIGHT", for example
+ /// "2048x2048" or "1920x1088". When provided, this takes precedence
+ /// over `aspect_ratio`. The dimensions must satisfy GPT Image 2.5 Sunburst
+ /// constraints: each side is a multiple of 16, the largest side is at
+ /// most 3840px, the long:short ratio is at most 3:1, and total pixels
+ /// are between 655360 and 8294400 inclusive. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2GptImage25SunburstAsync( + string prompt, + bool? dryRun = default, + global::System.Collections.Generic.IList? images = default, + byte[]? mask = default, + string? maskname = default, + global::Ideogram.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaBackground? background = default, + global::Ideogram.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaQuality? quality = default, + int? numImages = default, + int? seed = default, + string? aspectRatio = default, + string? resolution = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25SunburstRequest + { + Prompt = prompt, + Images = images, + Mask = mask, + Maskname = maskname, + Background = background, + Quality = quality, + NumImages = numImages, + Seed = seed, + AspectRatio = aspectRatio, + Resolution = resolution, + Async = async, + WebhookUrl = webhookUrl, + }; + + return await ImagesGeneratePostGenerateImageV2GptImage25SunburstAsync( + dryRun: dryRun, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2Ideogram45.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2Ideogram45.g.cs new file mode 100644 index 00000000..8e083361 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2Ideogram45.g.cs @@ -0,0 +1,983 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class ImagesGenerateClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_ImagesGeneratePostGenerateImageV2Ideogram45SecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_ImagesGeneratePostGenerateImageV2Ideogram45SecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_ImagesGeneratePostGenerateImageV2Ideogram45SecurityRequirement0, + }; + partial void PrepareImagesGeneratePostGenerateImageV2Ideogram45Arguments( + global::System.Net.Http.HttpClient httpClient, + ref bool? dryRun, + global::Ideogram.ImagesGeneratePostGenerateImageV2Ideogram45Request request); + partial void PrepareImagesGeneratePostGenerateImageV2Ideogram45Request( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + bool? dryRun, + global::Ideogram.ImagesGeneratePostGenerateImageV2Ideogram45Request request); + partial void ProcessImagesGeneratePostGenerateImageV2Ideogram45Response( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessImagesGeneratePostGenerateImageV2Ideogram45ResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Generate with Ideogram 4.5
+ /// Generate images with Ideogram 4.5 from a natural-language or structured
+ /// JSON prompt. Optionally upload source images as `images` using
+ /// `multipart/form-data` to edit them with the prompt. Returns results
+ /// directly by default; set `async` or supply a `webhook_url` to get a
+ /// `generation_id` and poll `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2Ideogram45Async( + + global::Ideogram.ImagesGeneratePostGenerateImageV2Ideogram45Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ImagesGeneratePostGenerateImageV2Ideogram45AsResponseAsync( + + request: request, + dryRun: dryRun, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Generate with Ideogram 4.5
+ /// Generate images with Ideogram 4.5 from a natural-language or structured
+ /// JSON prompt. Optionally upload source images as `images` using
+ /// `multipart/form-data` to edit them with the prompt. Returns results
+ /// directly by default; set `async` or supply a `webhook_url` to get a
+ /// `generation_id` and poll `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ImagesGeneratePostGenerateImageV2Ideogram45AsResponseAsync( + + global::Ideogram.ImagesGeneratePostGenerateImageV2Ideogram45Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareImagesGeneratePostGenerateImageV2Ideogram45Arguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImagesGeneratePostGenerateImageV2Ideogram45SecurityRequirements, + operationName: "ImagesGeneratePostGenerateImageV2Ideogram45Async"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/generate/ideogram-4-5", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + if (request.MagicPrompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.MagicPrompt).HasValue ? (request.MagicPrompt).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"magic_prompt\""); + + } + if (request.Images != default) + { + + for (var __iImages = 0; __iImages < request.Images.Count; __iImages++) + { + var __contentImages = new global::System.Net.Http.ByteArrayContent(request.Images[__iImages]); + __contentImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); + __httpRequestContent.Add( + content: __contentImages, + name: "\"images\"", + fileName: $"\"file{__iImages}.bin\""); + if (__contentImages.Headers.ContentDisposition != null) + { + __contentImages.Headers.ContentDisposition.FileNameStar = null; + } + } + + } + if (request.Mask != default) + { + + var __contentMask = new global::System.Net.Http.ByteArrayContent(request.Mask ?? global::System.Array.Empty()); + __contentMask.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Maskname is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Maskname) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentMask, + name: "\"mask\"", + fileName: request.Maskname != null ? $"\"{request.Maskname}\"" : string.Empty); + if (__contentMask.Headers.ContentDisposition != null) + { + __contentMask.Headers.ContentDisposition.FileNameStar = null; + } + + } + if (request.Size != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Size ?? string.Empty), + name: "\"size\""); + + } + if (request.Background != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Background).HasValue ? (request.Background).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"background\""); + + } + if (request.Quality != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Quality).HasValue ? (request.Quality).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"quality\""); + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.EnableCopyrightDetection != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"enable_copyright_detection\""); + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImagesGeneratePostGenerateImageV2Ideogram45Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2Ideogram45", + methodName: "ImagesGeneratePostGenerateImageV2Ideogram45Async", + pathTemplate: "\"/v2/image/generate/ideogram-4-5\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2Ideogram45", + methodName: "ImagesGeneratePostGenerateImageV2Ideogram45Async", + pathTemplate: "\"/v2/image/generate/ideogram-4-5\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2Ideogram45", + methodName: "ImagesGeneratePostGenerateImageV2Ideogram45Async", + pathTemplate: "\"/v2/image/generate/ideogram-4-5\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImagesGeneratePostGenerateImageV2Ideogram45Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2Ideogram45", + methodName: "ImagesGeneratePostGenerateImageV2Ideogram45Async", + pathTemplate: "\"/v2/image/generate/ideogram-4-5\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2Ideogram45", + methodName: "ImagesGeneratePostGenerateImageV2Ideogram45Async", + pathTemplate: "\"/v2/image/generate/ideogram-4-5\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImagesGeneratePostGenerateImageV2Ideogram45ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.GenerateImageIdeogram45Response.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.GenerateImageIdeogram45Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Generate with Ideogram 4.5
+ /// Generate images with Ideogram 4.5 from a natural-language or structured
+ /// JSON prompt. Optionally upload source images as `images` using
+ /// `multipart/form-data` to edit them with the prompt. Returns results
+ /// directly by default; set `async` or supply a `webhook_url` to get a
+ /// `generation_id` and poll `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt to generate images from, or the edit instruction when
+ /// source images are supplied. Natural language or a structured
+ /// Ideogram 4.0 JSON prompt. + /// + /// + /// Controls how a natural-language prompt is prepared. `auto` (the
+ /// default) and `on` rewrite and expand the prompt before generation.
+ /// `off` keeps your wording and only converts it into a structured
+ /// prompt. A valid structured JSON prompt skips magic prompt unless
+ /// `magic_prompt` is `on`. With source images, every mode converts
+ /// the edit instruction into a structured edit prompt.
+ /// Default Value: auto + /// + /// + /// Optional source images to edit (max 5, max 25MB each; JPEG, PNG, or WEBP). The first image is the one being edited; any others are extra references. Multipart requests only. + /// + /// + /// An optional mask that limits the edit to part of the first source image (max 25MB; JPEG, PNG, or WEBP). Multipart requests only. Black marks the area to edit and white the area to keep; values in between are rounded to the nearer of the two. The mask must have the same width and height as the first source image and contain both black and white areas. A masked request can include at most three other source images. With a mask, the output is always the first source image's own size, so `size` cannot be set. + /// + /// + /// An optional mask that limits the edit to part of the first source image (max 25MB; JPEG, PNG, or WEBP). Multipart requests only. Black marks the area to edit and white the area to keep; values in between are rounded to the nearer of the two. The mask must have the same width and height as the first source image and contain both black and white areas. A masked request can include at most three other source images. With a mask, the output is always the first source image's own size, so `size` cannot be set. + /// + /// + /// The output size: "auto", "source" or an exact "WIDTHxHEIGHT".
+ /// Without source images, an exact size must be one of the supported
+ /// 1K/2K presets (for example 1024x1024, 2048x2048 or 1440x2880);
+ /// "auto" or omitted picks a supported size based on the prompt.
+ /// "source" is rejected.
+ /// With source images, "auto" (the default) picks a supported 2K size
+ /// based on the source images and the prompt, and "source" returns the
+ /// output at the first source image's own width and height (scaled
+ /// down, keeping its proportions, if it is too large for the model).
+ /// Every source image's aspect ratio must be between 1:6 and 6:1.
+ /// An exact size must have both sides a multiple of 32 and at least
+ /// 256px, a total of at most 2048x2048 pixels, and an aspect ratio of
+ /// at most 6:1. With source images, an exact size reshapes the source
+ /// to it.
+ /// Pricing is tiered by the resolved output pixels: up to 1024x1024
+ /// bills as 1K, above that as 2K. An "auto" size bills as 2K.
+ /// Default Value: auto + /// + /// + /// The output background. `transparent` returns images with an alpha channel, `opaque` returns a solid one, and `auto` decides for you.
+ /// Default Value: auto + /// + /// + /// The rendering quality to use. Higher quality takes longer and costs more. Defaults to `medium` with source images and `high` without. `very_low`, the fastest and cheapest, requires source images. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2Ideogram45Async( + string prompt, + bool? dryRun = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + global::System.Collections.Generic.IList? images = default, + byte[]? mask = default, + string? maskname = default, + string? size = default, + global::Ideogram.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaBackground? background = default, + global::Ideogram.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality? quality = default, + int? seed = default, + int? numImages = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Ideogram.ImagesGeneratePostGenerateImageV2Ideogram45Request + { + Prompt = prompt, + MagicPrompt = magicPrompt, + Images = images, + Mask = mask, + Maskname = maskname, + Size = size, + Background = background, + Quality = quality, + Seed = seed, + NumImages = numImages, + EnableCopyrightDetection = enableCopyrightDetection, + Async = async, + WebhookUrl = webhookUrl, + }; + + return await ImagesGeneratePostGenerateImageV2Ideogram45Async( + dryRun: dryRun, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV2.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV2.g.cs new file mode 100644 index 00000000..bdb8a350 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV2.g.cs @@ -0,0 +1,812 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class ImagesGenerateClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_ImagesGeneratePostGenerateImageV2IdeogramV2SecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_ImagesGeneratePostGenerateImageV2IdeogramV2SecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_ImagesGeneratePostGenerateImageV2IdeogramV2SecurityRequirement0, + }; + partial void PrepareImagesGeneratePostGenerateImageV2IdeogramV2Arguments( + global::System.Net.Http.HttpClient httpClient, + ref bool? dryRun, + global::Ideogram.GenerateImageIdeogramV2Request request); + partial void PrepareImagesGeneratePostGenerateImageV2IdeogramV2Request( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + bool? dryRun, + global::Ideogram.GenerateImageIdeogramV2Request request); + partial void ProcessImagesGeneratePostGenerateImageV2IdeogramV2Response( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessImagesGeneratePostGenerateImageV2IdeogramV2ResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Generate with Ideogram 2.0
+ /// Generate images from a text prompt with Ideogram 2.0. Returns results
+ /// directly by default; set `async` or supply a `webhook_url` to get a
+ /// `generation_id` and poll `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2IdeogramV2Async( + + global::Ideogram.GenerateImageIdeogramV2Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ImagesGeneratePostGenerateImageV2IdeogramV2AsResponseAsync( + + request: request, + dryRun: dryRun, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Generate with Ideogram 2.0
+ /// Generate images from a text prompt with Ideogram 2.0. Returns results
+ /// directly by default; set `async` or supply a `webhook_url` to get a
+ /// `generation_id` and poll `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ImagesGeneratePostGenerateImageV2IdeogramV2AsResponseAsync( + + global::Ideogram.GenerateImageIdeogramV2Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareImagesGeneratePostGenerateImageV2IdeogramV2Arguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImagesGeneratePostGenerateImageV2IdeogramV2SecurityRequirements, + operationName: "ImagesGeneratePostGenerateImageV2IdeogramV2Async"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/generate/ideogram-2", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImagesGeneratePostGenerateImageV2IdeogramV2Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2IdeogramV2", + methodName: "ImagesGeneratePostGenerateImageV2IdeogramV2Async", + pathTemplate: "\"/v2/image/generate/ideogram-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2IdeogramV2", + methodName: "ImagesGeneratePostGenerateImageV2IdeogramV2Async", + pathTemplate: "\"/v2/image/generate/ideogram-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2IdeogramV2", + methodName: "ImagesGeneratePostGenerateImageV2IdeogramV2Async", + pathTemplate: "\"/v2/image/generate/ideogram-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImagesGeneratePostGenerateImageV2IdeogramV2Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2IdeogramV2", + methodName: "ImagesGeneratePostGenerateImageV2IdeogramV2Async", + pathTemplate: "\"/v2/image/generate/ideogram-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2IdeogramV2", + methodName: "ImagesGeneratePostGenerateImageV2IdeogramV2Async", + pathTemplate: "\"/v2/image/generate/ideogram-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImagesGeneratePostGenerateImageV2IdeogramV2ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.GenerateImageIdeogramV2Response.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.GenerateImageIdeogramV2Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Generate with Ideogram 2.0
+ /// Generate images from a text prompt with Ideogram 2.0. Returns results
+ /// directly by default; set `async` or supply a `webhook_url` to get a
+ /// `generation_id` and poll `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt to generate images from. + /// + /// + /// Description of what to exclude from the images. The prompt takes precedence over the negative prompt. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The aspect ratio for an Ideogram 3.x or 2.x generation. `auto` lets the
+ /// model select a ratio from the prompt; any other value pins the ratio.
+ /// Cannot be combined with `resolution`. Omitting the field is not `auto`:
+ /// it uses `1x1`. + /// + /// + /// The rendering speed to use. `turbo` generates faster at a lower cost, while `quality` prioritizes the highest-quality result.
+ /// Default Value: default + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// The style type to generate with. When omitted, the model's default styling is used; pass `auto` to have a style selected automatically from the prompt. + /// + /// + /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2IdeogramV2Async( + string prompt, + bool? dryRun = default, + string? negativePrompt = default, + int? seed = default, + global::Ideogram.IdeogramV3AspectRatio? aspectRatio = default, + global::Ideogram.GenerateImageIdeogramV2RequestRenderingSpeed? renderingSpeed = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + int? numImages = default, + global::Ideogram.IdeogramV2StyleType? styleType = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Ideogram.GenerateImageIdeogramV2Request + { + Prompt = prompt, + NegativePrompt = negativePrompt, + Seed = seed, + AspectRatio = aspectRatio, + RenderingSpeed = renderingSpeed, + MagicPrompt = magicPrompt, + NumImages = numImages, + StyleType = styleType, + EnableCopyrightDetection = enableCopyrightDetection, + Async = async, + WebhookUrl = webhookUrl, + }; + + return await ImagesGeneratePostGenerateImageV2IdeogramV2Async( + dryRun: dryRun, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV2A.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV2A.g.cs new file mode 100644 index 00000000..ef187185 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV2A.g.cs @@ -0,0 +1,810 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class ImagesGenerateClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_ImagesGeneratePostGenerateImageV2IdeogramV2ASecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_ImagesGeneratePostGenerateImageV2IdeogramV2ASecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_ImagesGeneratePostGenerateImageV2IdeogramV2ASecurityRequirement0, + }; + partial void PrepareImagesGeneratePostGenerateImageV2IdeogramV2AArguments( + global::System.Net.Http.HttpClient httpClient, + ref bool? dryRun, + global::Ideogram.GenerateImageIdeogramV2ARequest request); + partial void PrepareImagesGeneratePostGenerateImageV2IdeogramV2ARequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + bool? dryRun, + global::Ideogram.GenerateImageIdeogramV2ARequest request); + partial void ProcessImagesGeneratePostGenerateImageV2IdeogramV2AResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessImagesGeneratePostGenerateImageV2IdeogramV2AResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Generate with Ideogram 2a
+ /// Generate images from a text prompt with Ideogram 2a, a fast, lower-cost
+ /// model. Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2IdeogramV2AAsync( + + global::Ideogram.GenerateImageIdeogramV2ARequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ImagesGeneratePostGenerateImageV2IdeogramV2AAsResponseAsync( + + request: request, + dryRun: dryRun, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Generate with Ideogram 2a
+ /// Generate images from a text prompt with Ideogram 2a, a fast, lower-cost
+ /// model. Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ImagesGeneratePostGenerateImageV2IdeogramV2AAsResponseAsync( + + global::Ideogram.GenerateImageIdeogramV2ARequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareImagesGeneratePostGenerateImageV2IdeogramV2AArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImagesGeneratePostGenerateImageV2IdeogramV2ASecurityRequirements, + operationName: "ImagesGeneratePostGenerateImageV2IdeogramV2AAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/generate/ideogram-2a", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImagesGeneratePostGenerateImageV2IdeogramV2ARequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2IdeogramV2A", + methodName: "ImagesGeneratePostGenerateImageV2IdeogramV2AAsync", + pathTemplate: "\"/v2/image/generate/ideogram-2a\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2IdeogramV2A", + methodName: "ImagesGeneratePostGenerateImageV2IdeogramV2AAsync", + pathTemplate: "\"/v2/image/generate/ideogram-2a\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2IdeogramV2A", + methodName: "ImagesGeneratePostGenerateImageV2IdeogramV2AAsync", + pathTemplate: "\"/v2/image/generate/ideogram-2a\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImagesGeneratePostGenerateImageV2IdeogramV2AResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2IdeogramV2A", + methodName: "ImagesGeneratePostGenerateImageV2IdeogramV2AAsync", + pathTemplate: "\"/v2/image/generate/ideogram-2a\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2IdeogramV2A", + methodName: "ImagesGeneratePostGenerateImageV2IdeogramV2AAsync", + pathTemplate: "\"/v2/image/generate/ideogram-2a\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImagesGeneratePostGenerateImageV2IdeogramV2AResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.GenerateImageIdeogramV2AResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.GenerateImageIdeogramV2AResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Generate with Ideogram 2a
+ /// Generate images from a text prompt with Ideogram 2a, a fast, lower-cost
+ /// model. Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt to generate images from. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The aspect ratio for an Ideogram 3.x or 2.x generation. `auto` lets the
+ /// model select a ratio from the prompt; any other value pins the ratio.
+ /// Cannot be combined with `resolution`. Omitting the field is not `auto`:
+ /// it uses `1x1`. + /// + /// + /// The rendering speed to use. `turbo` generates faster at a lower cost, while `quality` prioritizes the highest-quality result.
+ /// Default Value: default + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// The style type to generate with. When omitted, the model's default styling is used; pass `auto` to have a style selected automatically from the prompt. + /// + /// + /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2IdeogramV2AAsync( + string prompt, + bool? dryRun = default, + int? seed = default, + global::Ideogram.IdeogramV3AspectRatio? aspectRatio = default, + global::Ideogram.GenerateImageIdeogramV2ARequestRenderingSpeed? renderingSpeed = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + int? numImages = default, + global::Ideogram.IdeogramV2StyleType? styleType = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Ideogram.GenerateImageIdeogramV2ARequest + { + Prompt = prompt, + Seed = seed, + AspectRatio = aspectRatio, + RenderingSpeed = renderingSpeed, + MagicPrompt = magicPrompt, + NumImages = numImages, + StyleType = styleType, + EnableCopyrightDetection = enableCopyrightDetection, + Async = async, + WebhookUrl = webhookUrl, + }; + + return await ImagesGeneratePostGenerateImageV2IdeogramV2AAsync( + dryRun: dryRun, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV3.g.cs new file mode 100644 index 00000000..821e11fc --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV3.g.cs @@ -0,0 +1,1014 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class ImagesGenerateClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_ImagesGeneratePostGenerateImageV2IdeogramV3SecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_ImagesGeneratePostGenerateImageV2IdeogramV3SecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_ImagesGeneratePostGenerateImageV2IdeogramV3SecurityRequirement0, + }; + partial void PrepareImagesGeneratePostGenerateImageV2IdeogramV3Arguments( + global::System.Net.Http.HttpClient httpClient, + ref bool? dryRun, + global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3Request request); + partial void PrepareImagesGeneratePostGenerateImageV2IdeogramV3Request( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + bool? dryRun, + global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3Request request); + partial void ProcessImagesGeneratePostGenerateImageV2IdeogramV3Response( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessImagesGeneratePostGenerateImageV2IdeogramV3ResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Generate with Ideogram 3.0
+ /// Generate images from a text prompt with Ideogram 3.0. Optional style
+ /// controls include style codes, a style preset, a color palette, and style
+ /// references (uploaded `style_reference_images`). Returns
+ /// results directly by default; set `async` or supply a `webhook_url` to
+ /// get a `generation_id` and poll `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2IdeogramV3Async( + + global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ImagesGeneratePostGenerateImageV2IdeogramV3AsResponseAsync( + + request: request, + dryRun: dryRun, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Generate with Ideogram 3.0
+ /// Generate images from a text prompt with Ideogram 3.0. Optional style
+ /// controls include style codes, a style preset, a color palette, and style
+ /// references (uploaded `style_reference_images`). Returns
+ /// results directly by default; set `async` or supply a `webhook_url` to
+ /// get a `generation_id` and poll `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ImagesGeneratePostGenerateImageV2IdeogramV3AsResponseAsync( + + global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareImagesGeneratePostGenerateImageV2IdeogramV3Arguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImagesGeneratePostGenerateImageV2IdeogramV3SecurityRequirements, + operationName: "ImagesGeneratePostGenerateImageV2IdeogramV3Async"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/generate/ideogram-3", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + if (request.NegativePrompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.NegativePrompt ?? string.Empty), + name: "\"negative_prompt\""); + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (request.Resolution != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"resolution\""); + + } + if (request.AspectRatio != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.AspectRatio).HasValue ? (request.AspectRatio).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"aspect_ratio\""); + + } + if (request.RenderingSpeed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"rendering_speed\""); + + } + if (request.MagicPrompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.MagicPrompt).HasValue ? (request.MagicPrompt).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"magic_prompt\""); + + } + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.ColorPalette != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.ColorPalette.ToString() ?? string.Empty), + name: "\"color_palette\""); + + } + if (request.StyleCodes != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.StyleCodes!, x => x))}]"), + name: "\"style_codes\""); + + } + if (request.StyleType != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.StyleType).HasValue ? (request.StyleType).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"style_type\""); + + } + if (request.StylePreset != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.StylePreset).HasValue ? (request.StylePreset).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"style_preset\""); + + } + if (request.StyleReferenceImages != default) + { + + for (var __iStyleReferenceImages = 0; __iStyleReferenceImages < request.StyleReferenceImages.Count; __iStyleReferenceImages++) + { + var __contentStyleReferenceImages = new global::System.Net.Http.ByteArrayContent(request.StyleReferenceImages[__iStyleReferenceImages]); + __contentStyleReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); + __httpRequestContent.Add( + content: __contentStyleReferenceImages, + name: "\"style_reference_images\"", + fileName: $"\"file{__iStyleReferenceImages}.bin\""); + if (__contentStyleReferenceImages.Headers.ContentDisposition != null) + { + __contentStyleReferenceImages.Headers.ContentDisposition.FileNameStar = null; + } + } + + } + if (request.EnableCopyrightDetection != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"enable_copyright_detection\""); + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImagesGeneratePostGenerateImageV2IdeogramV3Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2IdeogramV3", + methodName: "ImagesGeneratePostGenerateImageV2IdeogramV3Async", + pathTemplate: "\"/v2/image/generate/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2IdeogramV3", + methodName: "ImagesGeneratePostGenerateImageV2IdeogramV3Async", + pathTemplate: "\"/v2/image/generate/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2IdeogramV3", + methodName: "ImagesGeneratePostGenerateImageV2IdeogramV3Async", + pathTemplate: "\"/v2/image/generate/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImagesGeneratePostGenerateImageV2IdeogramV3Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2IdeogramV3", + methodName: "ImagesGeneratePostGenerateImageV2IdeogramV3Async", + pathTemplate: "\"/v2/image/generate/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2IdeogramV3", + methodName: "ImagesGeneratePostGenerateImageV2IdeogramV3Async", + pathTemplate: "\"/v2/image/generate/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // A referenced resource was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImagesGeneratePostGenerateImageV2IdeogramV3ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.GenerateImageIdeogramV3Response.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.GenerateImageIdeogramV3Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Generate with Ideogram 3.0
+ /// Generate images from a text prompt with Ideogram 3.0. Optional style
+ /// controls include style codes, a style preset, a color palette, and style
+ /// references (uploaded `style_reference_images`). Returns
+ /// results directly by default; set `async` or supply a `webhook_url` to
+ /// get a `generation_id` and poll `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt to generate images from. + /// + /// + /// Description of what to exclude from the images. The prompt takes precedence over the negative prompt. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The resolutions supported for Ideogram 3.0. + /// + /// + /// The aspect ratio for an Ideogram 3.x or 2.x generation. `auto` lets the
+ /// model select a ratio from the prompt; any other value pins the ratio.
+ /// Cannot be combined with `resolution`. Omitting the field is not `auto`:
+ /// it uses `1x1`. + /// + /// + /// The rendering speed to use.
+ /// Default Value: default + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). + /// + /// + /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images. + /// + /// + /// The style type to generate with.
+ /// Default Value: general + /// + /// + /// A predefined style preset to apply to the generated images. Cannot be combined with style codes or style references. + /// + /// + /// Images to use as style references (max 10, max 25MB each; JPEG, PNG, or WEBP). + /// + /// + /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2IdeogramV3Async( + string prompt, + bool? dryRun = default, + string? negativePrompt = default, + int? seed = default, + global::Ideogram.ResolutionV3? resolution = default, + global::Ideogram.IdeogramV3AspectRatio? aspectRatio = default, + global::Ideogram.V2ImageGenerateIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + int? numImages = default, + global::Ideogram.IdeogramColorPalette? colorPalette = default, + global::System.Collections.Generic.IList? styleCodes = default, + global::Ideogram.IdeogramV3StyleType? styleType = default, + global::Ideogram.IdeogramV3StylePreset? stylePreset = default, + global::System.Collections.Generic.IList? styleReferenceImages = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3Request + { + Prompt = prompt, + NegativePrompt = negativePrompt, + Seed = seed, + Resolution = resolution, + AspectRatio = aspectRatio, + RenderingSpeed = renderingSpeed, + MagicPrompt = magicPrompt, + NumImages = numImages, + ColorPalette = colorPalette, + StyleCodes = styleCodes, + StyleType = styleType, + StylePreset = stylePreset, + StyleReferenceImages = styleReferenceImages, + EnableCopyrightDetection = enableCopyrightDetection, + Async = async, + WebhookUrl = webhookUrl, + }; + + return await ImagesGeneratePostGenerateImageV2IdeogramV3Async( + dryRun: dryRun, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV3Character.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV3Character.g.cs new file mode 100644 index 00000000..9ee4cba3 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV3Character.g.cs @@ -0,0 +1,3059 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class ImagesGenerateClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_ImagesGeneratePostGenerateImageV2IdeogramV3CharacterSecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_ImagesGeneratePostGenerateImageV2IdeogramV3CharacterSecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_ImagesGeneratePostGenerateImageV2IdeogramV3CharacterSecurityRequirement0, + }; + partial void PrepareImagesGeneratePostGenerateImageV2IdeogramV3CharacterArguments( + global::System.Net.Http.HttpClient httpClient, + ref bool? dryRun, + global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterRequest request); + partial void PrepareImagesGeneratePostGenerateImageV2IdeogramV3CharacterRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + bool? dryRun, + global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterRequest request); + partial void ProcessImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Generate a consistent character with Ideogram 3.0
+ /// Generate images featuring a consistent character with Ideogram 3.0.
+ /// Upload the character as `character_reference_images` using
+ /// `multipart/form-data`. Returns
+ /// results directly by default; set `async` or supply a `webhook_url` to
+ /// get a `generation_id` and poll `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2IdeogramV3CharacterAsync( + + global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ImagesGeneratePostGenerateImageV2IdeogramV3CharacterAsResponseAsync( + + request: request, + dryRun: dryRun, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Generate a consistent character with Ideogram 3.0
+ /// Generate images featuring a consistent character with Ideogram 3.0.
+ /// Upload the character as `character_reference_images` using
+ /// `multipart/form-data`. Returns
+ /// results directly by default; set `async` or supply a `webhook_url` to
+ /// get a `generation_id` and poll `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ImagesGeneratePostGenerateImageV2IdeogramV3CharacterAsResponseAsync( + + global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareImagesGeneratePostGenerateImageV2IdeogramV3CharacterArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImagesGeneratePostGenerateImageV2IdeogramV3CharacterSecurityRequirements, + operationName: "ImagesGeneratePostGenerateImageV2IdeogramV3CharacterAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/generate/ideogram-3-character", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + if (request.NegativePrompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.NegativePrompt ?? string.Empty), + name: "\"negative_prompt\""); + + } + for (var __iCharacterReferenceImages = 0; __iCharacterReferenceImages < request.CharacterReferenceImages.Count; __iCharacterReferenceImages++) + { + var __contentCharacterReferenceImages = new global::System.Net.Http.ByteArrayContent(request.CharacterReferenceImages[__iCharacterReferenceImages]); + __contentCharacterReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); + __httpRequestContent.Add( + content: __contentCharacterReferenceImages, + name: "\"character_reference_images\"", + fileName: $"\"file{__iCharacterReferenceImages}.bin\""); + if (__contentCharacterReferenceImages.Headers.ContentDisposition != null) + { + __contentCharacterReferenceImages.Headers.ContentDisposition.FileNameStar = null; + } + } + + if (request.CharacterReferenceMask != default) + { + + var __contentCharacterReferenceMask = new global::System.Net.Http.ByteArrayContent(request.CharacterReferenceMask ?? global::System.Array.Empty()); + __contentCharacterReferenceMask.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.CharacterReferenceMaskname is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.CharacterReferenceMaskname) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentCharacterReferenceMask, + name: "\"character_reference_mask\"", + fileName: request.CharacterReferenceMaskname != null ? $"\"{request.CharacterReferenceMaskname}\"" : string.Empty); + if (__contentCharacterReferenceMask.Headers.ContentDisposition != null) + { + __contentCharacterReferenceMask.Headers.ContentDisposition.FileNameStar = null; + } + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (request.Resolution != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"resolution\""); + + } + if (request.AspectRatio != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.AspectRatio).HasValue ? (request.AspectRatio).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"aspect_ratio\""); + + } + if (request.RenderingSpeed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"rendering_speed\""); + + } + if (request.MagicPrompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.MagicPrompt).HasValue ? (request.MagicPrompt).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"magic_prompt\""); + + } + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.StyleType != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.StyleType).HasValue ? (request.StyleType).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"style_type\""); + + } + if (request.StyleReferenceImages != default) + { + + for (var __iStyleReferenceImages = 0; __iStyleReferenceImages < request.StyleReferenceImages.Count; __iStyleReferenceImages++) + { + var __contentStyleReferenceImages = new global::System.Net.Http.ByteArrayContent(request.StyleReferenceImages[__iStyleReferenceImages]); + __contentStyleReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); + __httpRequestContent.Add( + content: __contentStyleReferenceImages, + name: "\"style_reference_images\"", + fileName: $"\"file{__iStyleReferenceImages}.bin\""); + if (__contentStyleReferenceImages.Headers.ContentDisposition != null) + { + __contentStyleReferenceImages.Headers.ContentDisposition.FileNameStar = null; + } + } + + } + if (request.EnableCopyrightDetection != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"enable_copyright_detection\""); + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImagesGeneratePostGenerateImageV2IdeogramV3CharacterRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2IdeogramV3Character", + methodName: "ImagesGeneratePostGenerateImageV2IdeogramV3CharacterAsync", + pathTemplate: "\"/v2/image/generate/ideogram-3-character\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2IdeogramV3Character", + methodName: "ImagesGeneratePostGenerateImageV2IdeogramV3CharacterAsync", + pathTemplate: "\"/v2/image/generate/ideogram-3-character\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2IdeogramV3Character", + methodName: "ImagesGeneratePostGenerateImageV2IdeogramV3CharacterAsync", + pathTemplate: "\"/v2/image/generate/ideogram-3-character\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2IdeogramV3Character", + methodName: "ImagesGeneratePostGenerateImageV2IdeogramV3CharacterAsync", + pathTemplate: "\"/v2/image/generate/ideogram-3-character\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2IdeogramV3Character", + methodName: "ImagesGeneratePostGenerateImageV2IdeogramV3CharacterAsync", + pathTemplate: "\"/v2/image/generate/ideogram-3-character\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // A referenced resource was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.GenerateImageIdeogramV3CharacterResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.GenerateImageIdeogramV3CharacterResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Generate a consistent character with Ideogram 3.0
+ /// Generate images featuring a consistent character with Ideogram 3.0.
+ /// Upload the character as `character_reference_images` using
+ /// `multipart/form-data`. Returns
+ /// results directly by default; set `async` or supply a `webhook_url` to
+ /// get a `generation_id` and poll `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt to generate images from. + /// + /// + /// Description of what to exclude from the images. The prompt takes precedence over the negative prompt. + /// + /// + /// An image of the character to feature (max 25MB; JPEG, PNG, or WEBP). + /// + /// + /// Optional grayscale mask marking where the character is in the character reference image, at the same size as that image (JPEG, PNG, or WEBP). Multipart requests only. + /// + /// + /// Optional grayscale mask marking where the character is in the character reference image, at the same size as that image (JPEG, PNG, or WEBP). Multipart requests only. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The resolutions supported for Ideogram 3.0. + /// + /// + /// The aspect ratio for an Ideogram 3.x or 2.x generation. `auto` lets the
+ /// model select a ratio from the prompt; any other value pins the ratio.
+ /// Cannot be combined with `resolution`. Omitting the field is not `auto`:
+ /// it uses `1x1`. + /// + /// + /// The rendering speed to use.
+ /// Default Value: default + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// The style type to generate the character with. Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// Images to use as style references (max 10, max 25MB each; JPEG, PNG, or WEBP). + /// + /// + /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2IdeogramV3CharacterAsync( + string prompt, + global::System.Collections.Generic.IList characterReferenceImages, + bool? dryRun = default, + string? negativePrompt = default, + byte[]? characterReferenceMask = default, + string? characterReferenceMaskname = default, + int? seed = default, + global::Ideogram.ResolutionV3? resolution = default, + global::Ideogram.IdeogramV3AspectRatio? aspectRatio = default, + global::Ideogram.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + int? numImages = default, + global::Ideogram.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType? styleType = default, + global::System.Collections.Generic.IList? styleReferenceImages = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterRequest + { + Prompt = prompt, + NegativePrompt = negativePrompt, + CharacterReferenceImages = characterReferenceImages, + CharacterReferenceMask = characterReferenceMask, + CharacterReferenceMaskname = characterReferenceMaskname, + Seed = seed, + Resolution = resolution, + AspectRatio = aspectRatio, + RenderingSpeed = renderingSpeed, + MagicPrompt = magicPrompt, + NumImages = numImages, + StyleType = styleType, + StyleReferenceImages = styleReferenceImages, + EnableCopyrightDetection = enableCopyrightDetection, + Async = async, + WebhookUrl = webhookUrl, + }; + + return await ImagesGeneratePostGenerateImageV2IdeogramV3CharacterAsync( + dryRun: dryRun, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// Generate a consistent character with Ideogram 3.0
+ /// Generate images featuring a consistent character with Ideogram 3.0.
+ /// Upload the character as `character_reference_images` using
+ /// `multipart/form-data`. Returns
+ /// results directly by default; set `async` or supply a `webhook_url` to
+ /// get a `generation_id` and poll `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt to generate images from. + /// + /// + /// Description of what to exclude from the images. The prompt takes precedence over the negative prompt. + /// + /// + /// An image of the character to feature (max 25MB; JPEG, PNG, or WEBP). + /// + /// + /// Optional file names to use for the multipart 'character_reference_images' file parts. + /// + /// + /// Optional grayscale mask marking where the character is in the character reference image, at the same size as that image (JPEG, PNG, or WEBP). Multipart requests only. + /// + /// + /// Optional grayscale mask marking where the character is in the character reference image, at the same size as that image (JPEG, PNG, or WEBP). Multipart requests only. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The resolutions supported for Ideogram 3.0. + /// + /// + /// The aspect ratio for an Ideogram 3.x or 2.x generation. `auto` lets the
+ /// model select a ratio from the prompt; any other value pins the ratio.
+ /// Cannot be combined with `resolution`. Omitting the field is not `auto`:
+ /// it uses `1x1`. + /// + /// + /// The rendering speed to use.
+ /// Default Value: default + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// The style type to generate the character with. Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// Images to use as style references (max 10, max 25MB each; JPEG, PNG, or WEBP). + /// + /// + /// Optional file names to use for the multipart 'style_reference_images' file parts. + /// + /// + /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2IdeogramV3CharacterAsync( + string prompt, + global::System.Collections.Generic.IReadOnlyList characterReferenceImages, + bool? dryRun = default, + string? negativePrompt = default, + global::System.Collections.Generic.IReadOnlyList? characterReferenceImagesFileNames = default, + global::System.IO.Stream? characterReferenceMask = default, + string? characterReferenceMaskname = default, + int? seed = default, + global::Ideogram.ResolutionV3? resolution = default, + global::Ideogram.IdeogramV3AspectRatio? aspectRatio = default, + global::Ideogram.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + int? numImages = default, + global::Ideogram.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType? styleType = default, + global::System.Collections.Generic.IReadOnlyList? styleReferenceImages = default, + global::System.Collections.Generic.IReadOnlyList? styleReferenceImagesFileNames = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + characterReferenceImages = characterReferenceImages ?? throw new global::System.ArgumentNullException(nameof(characterReferenceImages)); + var request = new global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterRequest + { + Prompt = prompt, + NegativePrompt = negativePrompt, + CharacterReferenceImages = new global::System.Collections.Generic.List(), + CharacterReferenceMask = global::System.Array.Empty(), + CharacterReferenceMaskname = characterReferenceMaskname, + Seed = seed, + Resolution = resolution, + AspectRatio = aspectRatio, + RenderingSpeed = renderingSpeed, + MagicPrompt = magicPrompt, + NumImages = numImages, + StyleType = styleType, + StyleReferenceImages = new global::System.Collections.Generic.List(), + EnableCopyrightDetection = enableCopyrightDetection, + Async = async, + WebhookUrl = webhookUrl, + }; + PrepareArguments( + client: HttpClient); + PrepareImagesGeneratePostGenerateImageV2IdeogramV3CharacterArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImagesGeneratePostGenerateImageV2IdeogramV3CharacterSecurityRequirements, + operationName: "ImagesGeneratePostGenerateImageV2IdeogramV3CharacterAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/generate/ideogram-3-character", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + if (request.NegativePrompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.NegativePrompt ?? string.Empty), + name: "\"negative_prompt\""); + + } + for (var __iCharacterReferenceImages = 0; __iCharacterReferenceImages < characterReferenceImages.Count; __iCharacterReferenceImages++) + { + var __fileNameCharacterReferenceImages = characterReferenceImagesFileNames != null && + __iCharacterReferenceImages < characterReferenceImagesFileNames.Count && + characterReferenceImagesFileNames[__iCharacterReferenceImages] != null + ? characterReferenceImagesFileNames[__iCharacterReferenceImages] + : $"file{__iCharacterReferenceImages}.bin"; + var __contentCharacterReferenceImages = new global::System.Net.Http.StreamContent(characterReferenceImages[__iCharacterReferenceImages]); + __contentCharacterReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + __fileNameCharacterReferenceImages is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(__fileNameCharacterReferenceImages) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentCharacterReferenceImages, + name: "\"character_reference_images\"", + fileName: $"\"{__fileNameCharacterReferenceImages}\""); + if (__contentCharacterReferenceImages.Headers.ContentDisposition != null) + { + __contentCharacterReferenceImages.Headers.ContentDisposition.FileNameStar = null; + } + } + + if (characterReferenceMask != default) + { + + var __contentCharacterReferenceMask = new global::System.Net.Http.StreamContent(characterReferenceMask); + __contentCharacterReferenceMask.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.CharacterReferenceMaskname is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.CharacterReferenceMaskname) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentCharacterReferenceMask, + name: "\"character_reference_mask\"", + fileName: request.CharacterReferenceMaskname != null ? $"\"{request.CharacterReferenceMaskname}\"" : string.Empty); + if (__contentCharacterReferenceMask.Headers.ContentDisposition != null) + { + __contentCharacterReferenceMask.Headers.ContentDisposition.FileNameStar = null; + } + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (request.Resolution != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"resolution\""); + + } + if (request.AspectRatio != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.AspectRatio).HasValue ? (request.AspectRatio).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"aspect_ratio\""); + + } + if (request.RenderingSpeed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"rendering_speed\""); + + } + if (request.MagicPrompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.MagicPrompt).HasValue ? (request.MagicPrompt).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"magic_prompt\""); + + } + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.StyleType != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.StyleType).HasValue ? (request.StyleType).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"style_type\""); + + } + if (styleReferenceImages != default) + { + + for (var __iStyleReferenceImages = 0; __iStyleReferenceImages < styleReferenceImages.Count; __iStyleReferenceImages++) + { + var __fileNameStyleReferenceImages = styleReferenceImagesFileNames != null && + __iStyleReferenceImages < styleReferenceImagesFileNames.Count && + styleReferenceImagesFileNames[__iStyleReferenceImages] != null + ? styleReferenceImagesFileNames[__iStyleReferenceImages] + : $"file{__iStyleReferenceImages}.bin"; + var __contentStyleReferenceImages = new global::System.Net.Http.StreamContent(styleReferenceImages[__iStyleReferenceImages]); + __contentStyleReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + __fileNameStyleReferenceImages is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(__fileNameStyleReferenceImages) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentStyleReferenceImages, + name: "\"style_reference_images\"", + fileName: $"\"{__fileNameStyleReferenceImages}\""); + if (__contentStyleReferenceImages.Headers.ContentDisposition != null) + { + __contentStyleReferenceImages.Headers.ContentDisposition.FileNameStar = null; + } + } + + } + if (request.EnableCopyrightDetection != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"enable_copyright_detection\""); + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImagesGeneratePostGenerateImageV2IdeogramV3CharacterRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2IdeogramV3Character", + methodName: "ImagesGeneratePostGenerateImageV2IdeogramV3CharacterAsync", + pathTemplate: "\"/v2/image/generate/ideogram-3-character\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2IdeogramV3Character", + methodName: "ImagesGeneratePostGenerateImageV2IdeogramV3CharacterAsync", + pathTemplate: "\"/v2/image/generate/ideogram-3-character\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2IdeogramV3Character", + methodName: "ImagesGeneratePostGenerateImageV2IdeogramV3CharacterAsync", + pathTemplate: "\"/v2/image/generate/ideogram-3-character\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2IdeogramV3Character", + methodName: "ImagesGeneratePostGenerateImageV2IdeogramV3CharacterAsync", + pathTemplate: "\"/v2/image/generate/ideogram-3-character\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2IdeogramV3Character", + methodName: "ImagesGeneratePostGenerateImageV2IdeogramV3CharacterAsync", + pathTemplate: "\"/v2/image/generate/ideogram-3-character\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // A referenced resource was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::Ideogram.GenerateImageIdeogramV3CharacterResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::Ideogram.GenerateImageIdeogramV3CharacterResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Generate a consistent character with Ideogram 3.0
+ /// Generate images featuring a consistent character with Ideogram 3.0.
+ /// Upload the character as `character_reference_images` using
+ /// `multipart/form-data`. Returns
+ /// results directly by default; set `async` or supply a `webhook_url` to
+ /// get a `generation_id` and poll `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt to generate images from. + /// + /// + /// Description of what to exclude from the images. The prompt takes precedence over the negative prompt. + /// + /// + /// An image of the character to feature (max 25MB; JPEG, PNG, or WEBP). + /// + /// + /// Optional file names to use for the multipart 'character_reference_images' file parts. + /// + /// + /// Optional grayscale mask marking where the character is in the character reference image, at the same size as that image (JPEG, PNG, or WEBP). Multipart requests only. + /// + /// + /// Optional grayscale mask marking where the character is in the character reference image, at the same size as that image (JPEG, PNG, or WEBP). Multipart requests only. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The resolutions supported for Ideogram 3.0. + /// + /// + /// The aspect ratio for an Ideogram 3.x or 2.x generation. `auto` lets the
+ /// model select a ratio from the prompt; any other value pins the ratio.
+ /// Cannot be combined with `resolution`. Omitting the field is not `auto`:
+ /// it uses `1x1`. + /// + /// + /// The rendering speed to use.
+ /// Default Value: default + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// The style type to generate the character with. Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// Images to use as style references (max 10, max 25MB each; JPEG, PNG, or WEBP). + /// + /// + /// Optional file names to use for the multipart 'style_reference_images' file parts. + /// + /// + /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ImagesGeneratePostGenerateImageV2IdeogramV3CharacterAsResponseAsync( + string prompt, + global::System.Collections.Generic.IReadOnlyList characterReferenceImages, + bool? dryRun = default, + string? negativePrompt = default, + global::System.Collections.Generic.IReadOnlyList? characterReferenceImagesFileNames = default, + global::System.IO.Stream? characterReferenceMask = default, + string? characterReferenceMaskname = default, + int? seed = default, + global::Ideogram.ResolutionV3? resolution = default, + global::Ideogram.IdeogramV3AspectRatio? aspectRatio = default, + global::Ideogram.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + int? numImages = default, + global::Ideogram.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType? styleType = default, + global::System.Collections.Generic.IReadOnlyList? styleReferenceImages = default, + global::System.Collections.Generic.IReadOnlyList? styleReferenceImagesFileNames = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + characterReferenceImages = characterReferenceImages ?? throw new global::System.ArgumentNullException(nameof(characterReferenceImages)); + var request = new global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterRequest + { + Prompt = prompt, + NegativePrompt = negativePrompt, + CharacterReferenceImages = new global::System.Collections.Generic.List(), + CharacterReferenceMask = global::System.Array.Empty(), + CharacterReferenceMaskname = characterReferenceMaskname, + Seed = seed, + Resolution = resolution, + AspectRatio = aspectRatio, + RenderingSpeed = renderingSpeed, + MagicPrompt = magicPrompt, + NumImages = numImages, + StyleType = styleType, + StyleReferenceImages = new global::System.Collections.Generic.List(), + EnableCopyrightDetection = enableCopyrightDetection, + Async = async, + WebhookUrl = webhookUrl, + }; + PrepareArguments( + client: HttpClient); + PrepareImagesGeneratePostGenerateImageV2IdeogramV3CharacterArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImagesGeneratePostGenerateImageV2IdeogramV3CharacterSecurityRequirements, + operationName: "ImagesGeneratePostGenerateImageV2IdeogramV3CharacterAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/generate/ideogram-3-character", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + if (request.NegativePrompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.NegativePrompt ?? string.Empty), + name: "\"negative_prompt\""); + + } + for (var __iCharacterReferenceImages = 0; __iCharacterReferenceImages < characterReferenceImages.Count; __iCharacterReferenceImages++) + { + var __fileNameCharacterReferenceImages = characterReferenceImagesFileNames != null && + __iCharacterReferenceImages < characterReferenceImagesFileNames.Count && + characterReferenceImagesFileNames[__iCharacterReferenceImages] != null + ? characterReferenceImagesFileNames[__iCharacterReferenceImages] + : $"file{__iCharacterReferenceImages}.bin"; + var __contentCharacterReferenceImages = new global::System.Net.Http.StreamContent(characterReferenceImages[__iCharacterReferenceImages]); + __contentCharacterReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + __fileNameCharacterReferenceImages is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(__fileNameCharacterReferenceImages) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentCharacterReferenceImages, + name: "\"character_reference_images\"", + fileName: $"\"{__fileNameCharacterReferenceImages}\""); + if (__contentCharacterReferenceImages.Headers.ContentDisposition != null) + { + __contentCharacterReferenceImages.Headers.ContentDisposition.FileNameStar = null; + } + } + + if (characterReferenceMask != default) + { + + var __contentCharacterReferenceMask = new global::System.Net.Http.StreamContent(characterReferenceMask); + __contentCharacterReferenceMask.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.CharacterReferenceMaskname is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.CharacterReferenceMaskname) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentCharacterReferenceMask, + name: "\"character_reference_mask\"", + fileName: request.CharacterReferenceMaskname != null ? $"\"{request.CharacterReferenceMaskname}\"" : string.Empty); + if (__contentCharacterReferenceMask.Headers.ContentDisposition != null) + { + __contentCharacterReferenceMask.Headers.ContentDisposition.FileNameStar = null; + } + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (request.Resolution != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"resolution\""); + + } + if (request.AspectRatio != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.AspectRatio).HasValue ? (request.AspectRatio).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"aspect_ratio\""); + + } + if (request.RenderingSpeed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"rendering_speed\""); + + } + if (request.MagicPrompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.MagicPrompt).HasValue ? (request.MagicPrompt).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"magic_prompt\""); + + } + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.StyleType != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.StyleType).HasValue ? (request.StyleType).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"style_type\""); + + } + if (styleReferenceImages != default) + { + + for (var __iStyleReferenceImages = 0; __iStyleReferenceImages < styleReferenceImages.Count; __iStyleReferenceImages++) + { + var __fileNameStyleReferenceImages = styleReferenceImagesFileNames != null && + __iStyleReferenceImages < styleReferenceImagesFileNames.Count && + styleReferenceImagesFileNames[__iStyleReferenceImages] != null + ? styleReferenceImagesFileNames[__iStyleReferenceImages] + : $"file{__iStyleReferenceImages}.bin"; + var __contentStyleReferenceImages = new global::System.Net.Http.StreamContent(styleReferenceImages[__iStyleReferenceImages]); + __contentStyleReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + __fileNameStyleReferenceImages is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(__fileNameStyleReferenceImages) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentStyleReferenceImages, + name: "\"style_reference_images\"", + fileName: $"\"{__fileNameStyleReferenceImages}\""); + if (__contentStyleReferenceImages.Headers.ContentDisposition != null) + { + __contentStyleReferenceImages.Headers.ContentDisposition.FileNameStar = null; + } + } + + } + if (request.EnableCopyrightDetection != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"enable_copyright_detection\""); + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImagesGeneratePostGenerateImageV2IdeogramV3CharacterRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2IdeogramV3Character", + methodName: "ImagesGeneratePostGenerateImageV2IdeogramV3CharacterAsync", + pathTemplate: "\"/v2/image/generate/ideogram-3-character\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2IdeogramV3Character", + methodName: "ImagesGeneratePostGenerateImageV2IdeogramV3CharacterAsync", + pathTemplate: "\"/v2/image/generate/ideogram-3-character\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2IdeogramV3Character", + methodName: "ImagesGeneratePostGenerateImageV2IdeogramV3CharacterAsync", + pathTemplate: "\"/v2/image/generate/ideogram-3-character\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2IdeogramV3Character", + methodName: "ImagesGeneratePostGenerateImageV2IdeogramV3CharacterAsync", + pathTemplate: "\"/v2/image/generate/ideogram-3-character\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2IdeogramV3Character", + methodName: "ImagesGeneratePostGenerateImageV2IdeogramV3CharacterAsync", + pathTemplate: "\"/v2/image/generate/ideogram-3-character\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // A referenced resource was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.GenerateImageIdeogramV3CharacterResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.GenerateImageIdeogramV3CharacterResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModel.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModel.g.cs new file mode 100644 index 00000000..18c41706 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModel.g.cs @@ -0,0 +1,1056 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class ImagesGenerateClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelSecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelSecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelSecurityRequirement0, + }; + partial void PrepareImagesGeneratePostGenerateImageV2IdeogramV3CustomModelArguments( + global::System.Net.Http.HttpClient httpClient, + ref bool? dryRun, + global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelRequest request); + partial void PrepareImagesGeneratePostGenerateImageV2IdeogramV3CustomModelRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + bool? dryRun, + global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelRequest request); + partial void ProcessImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Generate with a custom Ideogram 3.0 model
+ /// Generate images with a custom Ideogram 3.0 model that you or your
+ /// organization can access, selected by `custom_model_uri`. Returns results
+ /// directly by default; set `async` or supply a `webhook_url` to get a
+ /// `generation_id` and poll `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelAsync( + + global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelAsResponseAsync( + + request: request, + dryRun: dryRun, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Generate with a custom Ideogram 3.0 model
+ /// Generate images with a custom Ideogram 3.0 model that you or your
+ /// organization can access, selected by `custom_model_uri`. Returns results
+ /// directly by default; set `async` or supply a `webhook_url` to get a
+ /// `generation_id` and poll `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelAsResponseAsync( + + global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareImagesGeneratePostGenerateImageV2IdeogramV3CustomModelArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelSecurityRequirements, + operationName: "ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/generate/ideogram-3-custom-model", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.CustomModelUri ?? string.Empty), + name: "\"custom_model_uri\""); + + if (request.TransparentBackground != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.TransparentBackground, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"transparent_background\""); + + } + if (request.NegativePrompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.NegativePrompt ?? string.Empty), + name: "\"negative_prompt\""); + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (request.Resolution != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"resolution\""); + + } + if (request.AspectRatio != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.AspectRatio).HasValue ? (request.AspectRatio).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"aspect_ratio\""); + + } + if (request.RenderingSpeed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"rendering_speed\""); + + } + if (request.MagicPrompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.MagicPrompt).HasValue ? (request.MagicPrompt).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"magic_prompt\""); + + } + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.ColorPalette != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.ColorPalette.ToString() ?? string.Empty), + name: "\"color_palette\""); + + } + if (request.StyleCodes != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.StyleCodes!, x => x))}]"), + name: "\"style_codes\""); + + } + if (request.StylePreset != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.StylePreset).HasValue ? (request.StylePreset).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"style_preset\""); + + } + if (request.StyleReferenceImages != default) + { + + for (var __iStyleReferenceImages = 0; __iStyleReferenceImages < request.StyleReferenceImages.Count; __iStyleReferenceImages++) + { + var __contentStyleReferenceImages = new global::System.Net.Http.ByteArrayContent(request.StyleReferenceImages[__iStyleReferenceImages]); + __contentStyleReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); + __httpRequestContent.Add( + content: __contentStyleReferenceImages, + name: "\"style_reference_images\"", + fileName: $"\"file{__iStyleReferenceImages}.bin\""); + if (__contentStyleReferenceImages.Headers.ContentDisposition != null) + { + __contentStyleReferenceImages.Headers.ContentDisposition.FileNameStar = null; + } + } + + } + if (request.EnableCopyrightDetection != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"enable_copyright_detection\""); + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImagesGeneratePostGenerateImageV2IdeogramV3CustomModelRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2IdeogramV3CustomModel", + methodName: "ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelAsync", + pathTemplate: "\"/v2/image/generate/ideogram-3-custom-model\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2IdeogramV3CustomModel", + methodName: "ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelAsync", + pathTemplate: "\"/v2/image/generate/ideogram-3-custom-model\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2IdeogramV3CustomModel", + methodName: "ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelAsync", + pathTemplate: "\"/v2/image/generate/ideogram-3-custom-model\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2IdeogramV3CustomModel", + methodName: "ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelAsync", + pathTemplate: "\"/v2/image/generate/ideogram-3-custom-model\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2IdeogramV3CustomModel", + methodName: "ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelAsync", + pathTemplate: "\"/v2/image/generate/ideogram-3-custom-model\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input or an unsupported model option. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The custom model does not exist or is not accessible to this user or organization. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // A requested resource was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.GenerateImageIdeogramV3CustomModelResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.GenerateImageIdeogramV3CustomModelResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Generate with a custom Ideogram 3.0 model
+ /// Generate images with a custom Ideogram 3.0 model that you or your
+ /// organization can access, selected by `custom_model_uri`. Returns results
+ /// directly by default; set `async` or supply a `webhook_url` to get a
+ /// `generation_id` and poll `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt to generate images from. + /// + /// + /// The custom model URI, in the form `model/<model_name>/version/<version_name>`. You or your organization must have access to the model. The model determines which rendering speeds are supported and whether backgrounds are removed automatically. + /// + /// + /// Remove the background after generation and return transparent PNG images. Included in the custom model generation price at no extra charge. When false, the model's automatic background removal behavior still applies.
+ /// Default Value: false + /// + /// + /// Description of what to exclude from the images. The prompt takes precedence over the negative prompt. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The resolutions supported for Ideogram 3.0. + /// + /// + /// The aspect ratio for an Ideogram 3.x or 2.x generation. `auto` lets the
+ /// model select a ratio from the prompt; any other value pins the ratio.
+ /// Cannot be combined with `resolution`. Omitting the field is not `auto`:
+ /// it uses `1x1`. + /// + /// + /// The rendering speed to use. When omitted, a speed supported by the custom model is used. + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). + /// + /// + /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images. + /// + /// + /// A predefined style preset to apply to the generated images. Cannot be combined with style codes or style references. + /// + /// + /// Images to use as style references (max 10, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only. + /// + /// + /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelAsync( + string prompt, + string customModelUri, + bool? dryRun = default, + bool? transparentBackground = default, + string? negativePrompt = default, + int? seed = default, + global::Ideogram.ResolutionV3? resolution = default, + global::Ideogram.IdeogramV3AspectRatio? aspectRatio = default, + global::Ideogram.V2ImageGenerateIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + int? numImages = default, + global::Ideogram.IdeogramColorPalette? colorPalette = default, + global::System.Collections.Generic.IList? styleCodes = default, + global::Ideogram.IdeogramV3StylePreset? stylePreset = default, + global::System.Collections.Generic.IList? styleReferenceImages = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelRequest + { + Prompt = prompt, + CustomModelUri = customModelUri, + TransparentBackground = transparentBackground, + NegativePrompt = negativePrompt, + Seed = seed, + Resolution = resolution, + AspectRatio = aspectRatio, + RenderingSpeed = renderingSpeed, + MagicPrompt = magicPrompt, + NumImages = numImages, + ColorPalette = colorPalette, + StyleCodes = styleCodes, + StylePreset = stylePreset, + StyleReferenceImages = styleReferenceImages, + EnableCopyrightDetection = enableCopyrightDetection, + Async = async, + WebhookUrl = webhookUrl, + }; + + return await ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelAsync( + dryRun: dryRun, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV3Transparent.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV3Transparent.g.cs new file mode 100644 index 00000000..a26512b3 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV3Transparent.g.cs @@ -0,0 +1,816 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class ImagesGenerateClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_ImagesGeneratePostGenerateImageV2IdeogramV3TransparentSecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_ImagesGeneratePostGenerateImageV2IdeogramV3TransparentSecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_ImagesGeneratePostGenerateImageV2IdeogramV3TransparentSecurityRequirement0, + }; + partial void PrepareImagesGeneratePostGenerateImageV2IdeogramV3TransparentArguments( + global::System.Net.Http.HttpClient httpClient, + ref bool? dryRun, + global::Ideogram.GenerateImageIdeogramV3TransparentRequest request); + partial void PrepareImagesGeneratePostGenerateImageV2IdeogramV3TransparentRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + bool? dryRun, + global::Ideogram.GenerateImageIdeogramV3TransparentRequest request); + partial void ProcessImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Generate transparent images with Ideogram 3.0
+ /// Generate images on a transparent background with Ideogram 3.0, delivered
+ /// as PNGs with alpha. Returns results directly by default; set `async` or
+ /// supply a `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2IdeogramV3TransparentAsync( + + global::Ideogram.GenerateImageIdeogramV3TransparentRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ImagesGeneratePostGenerateImageV2IdeogramV3TransparentAsResponseAsync( + + request: request, + dryRun: dryRun, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Generate transparent images with Ideogram 3.0
+ /// Generate images on a transparent background with Ideogram 3.0, delivered
+ /// as PNGs with alpha. Returns results directly by default; set `async` or
+ /// supply a `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ImagesGeneratePostGenerateImageV2IdeogramV3TransparentAsResponseAsync( + + global::Ideogram.GenerateImageIdeogramV3TransparentRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareImagesGeneratePostGenerateImageV2IdeogramV3TransparentArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImagesGeneratePostGenerateImageV2IdeogramV3TransparentSecurityRequirements, + operationName: "ImagesGeneratePostGenerateImageV2IdeogramV3TransparentAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/generate/ideogram-3-transparent", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImagesGeneratePostGenerateImageV2IdeogramV3TransparentRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2IdeogramV3Transparent", + methodName: "ImagesGeneratePostGenerateImageV2IdeogramV3TransparentAsync", + pathTemplate: "\"/v2/image/generate/ideogram-3-transparent\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2IdeogramV3Transparent", + methodName: "ImagesGeneratePostGenerateImageV2IdeogramV3TransparentAsync", + pathTemplate: "\"/v2/image/generate/ideogram-3-transparent\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2IdeogramV3Transparent", + methodName: "ImagesGeneratePostGenerateImageV2IdeogramV3TransparentAsync", + pathTemplate: "\"/v2/image/generate/ideogram-3-transparent\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2IdeogramV3Transparent", + methodName: "ImagesGeneratePostGenerateImageV2IdeogramV3TransparentAsync", + pathTemplate: "\"/v2/image/generate/ideogram-3-transparent\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2IdeogramV3Transparent", + methodName: "ImagesGeneratePostGenerateImageV2IdeogramV3TransparentAsync", + pathTemplate: "\"/v2/image/generate/ideogram-3-transparent\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.GenerateImageIdeogramV3TransparentResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.GenerateImageIdeogramV3TransparentResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Generate transparent images with Ideogram 3.0
+ /// Generate images on a transparent background with Ideogram 3.0, delivered
+ /// as PNGs with alpha. Returns results directly by default; set `async` or
+ /// supply a `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt to generate images from. + /// + /// + /// Description of what to exclude from the images. The prompt takes precedence over the negative prompt. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// Optional enhancement factor applied after generation. `x1` (the default) delivers the base render.
+ /// Default Value: x1 + /// + /// + /// The aspect ratio for an Ideogram 3.x or 2.x generation. `auto` lets the
+ /// model select a ratio from the prompt; any other value pins the ratio.
+ /// Cannot be combined with `resolution`. Omitting the field is not `auto`:
+ /// it uses `1x1`. + /// + /// + /// The rendering speed to use.
+ /// Default Value: default + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2IdeogramV3TransparentAsync( + string prompt, + bool? dryRun = default, + string? negativePrompt = default, + int? seed = default, + global::Ideogram.GenerateImageIdeogramV3TransparentRequestUpscaleFactor? upscaleFactor = default, + global::Ideogram.IdeogramV3AspectRatio? aspectRatio = default, + global::Ideogram.GenerateImageIdeogramV3TransparentRequestRenderingSpeed? renderingSpeed = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + int? numImages = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Ideogram.GenerateImageIdeogramV3TransparentRequest + { + Prompt = prompt, + NegativePrompt = negativePrompt, + Seed = seed, + UpscaleFactor = upscaleFactor, + AspectRatio = aspectRatio, + RenderingSpeed = renderingSpeed, + MagicPrompt = magicPrompt, + NumImages = numImages, + EnableCopyrightDetection = enableCopyrightDetection, + Async = async, + WebhookUrl = webhookUrl, + }; + + return await ImagesGeneratePostGenerateImageV2IdeogramV3TransparentAsync( + dryRun: dryRun, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV4.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV4.g.cs new file mode 100644 index 00000000..2b665af2 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV4.g.cs @@ -0,0 +1,810 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class ImagesGenerateClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_ImagesGeneratePostGenerateImageV2IdeogramV4SecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_ImagesGeneratePostGenerateImageV2IdeogramV4SecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_ImagesGeneratePostGenerateImageV2IdeogramV4SecurityRequirement0, + }; + partial void PrepareImagesGeneratePostGenerateImageV2IdeogramV4Arguments( + global::System.Net.Http.HttpClient httpClient, + ref bool? dryRun, + global::Ideogram.GenerateImageIdeogramV4Request request); + partial void PrepareImagesGeneratePostGenerateImageV2IdeogramV4Request( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + bool? dryRun, + global::Ideogram.GenerateImageIdeogramV4Request request); + partial void ProcessImagesGeneratePostGenerateImageV2IdeogramV4Response( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessImagesGeneratePostGenerateImageV2IdeogramV4ResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Generate with Ideogram 4.0
+ /// Generate images with Ideogram 4.0 from a natural-language or structured
+ /// JSON prompt. Returns results directly by default; set `async` or supply
+ /// a `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2IdeogramV4Async( + + global::Ideogram.GenerateImageIdeogramV4Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ImagesGeneratePostGenerateImageV2IdeogramV4AsResponseAsync( + + request: request, + dryRun: dryRun, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Generate with Ideogram 4.0
+ /// Generate images with Ideogram 4.0 from a natural-language or structured
+ /// JSON prompt. Returns results directly by default; set `async` or supply
+ /// a `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ImagesGeneratePostGenerateImageV2IdeogramV4AsResponseAsync( + + global::Ideogram.GenerateImageIdeogramV4Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareImagesGeneratePostGenerateImageV2IdeogramV4Arguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImagesGeneratePostGenerateImageV2IdeogramV4SecurityRequirements, + operationName: "ImagesGeneratePostGenerateImageV2IdeogramV4Async"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/generate/ideogram-4", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImagesGeneratePostGenerateImageV2IdeogramV4Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2IdeogramV4", + methodName: "ImagesGeneratePostGenerateImageV2IdeogramV4Async", + pathTemplate: "\"/v2/image/generate/ideogram-4\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2IdeogramV4", + methodName: "ImagesGeneratePostGenerateImageV2IdeogramV4Async", + pathTemplate: "\"/v2/image/generate/ideogram-4\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2IdeogramV4", + methodName: "ImagesGeneratePostGenerateImageV2IdeogramV4Async", + pathTemplate: "\"/v2/image/generate/ideogram-4\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImagesGeneratePostGenerateImageV2IdeogramV4Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2IdeogramV4", + methodName: "ImagesGeneratePostGenerateImageV2IdeogramV4Async", + pathTemplate: "\"/v2/image/generate/ideogram-4\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2IdeogramV4", + methodName: "ImagesGeneratePostGenerateImageV2IdeogramV4Async", + pathTemplate: "\"/v2/image/generate/ideogram-4\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImagesGeneratePostGenerateImageV2IdeogramV4ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.GenerateImageIdeogramV4Response.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.GenerateImageIdeogramV4Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Generate with Ideogram 4.0
+ /// Generate images with Ideogram 4.0 from a natural-language or structured
+ /// JSON prompt. Returns results directly by default; set `async` or supply
+ /// a `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt to generate images from, in natural language or as a
+ /// structured Ideogram 4.0 JSON prompt. A structured JSON prompt is
+ /// used as is and skips magic prompt unless `magic_prompt` is `on`. + /// + /// + /// Controls how a natural-language prompt is prepared. `auto` (the
+ /// default) and `on` rewrite and expand the prompt before generation.
+ /// `off` keeps your wording and only converts it into a structured
+ /// prompt. A valid structured JSON prompt skips magic prompt unless
+ /// `magic_prompt` is `on`.
+ /// Default Value: auto + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Optional. When supplied, the images are generated at this
+ /// resolution. When omitted, an aspect ratio is picked automatically
+ /// based on the prompt. + /// + /// + /// The rendering speed to use.
+ /// Default Value: default + /// + /// + /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2IdeogramV4Async( + string prompt, + bool? dryRun = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + int? seed = default, + int? numImages = default, + global::Ideogram.ResolutionV4? resolution = default, + global::Ideogram.GenerateImageIdeogramV4RequestRenderingSpeed? renderingSpeed = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Ideogram.GenerateImageIdeogramV4Request + { + Prompt = prompt, + MagicPrompt = magicPrompt, + Seed = seed, + NumImages = numImages, + Resolution = resolution, + RenderingSpeed = renderingSpeed, + EnableCopyrightDetection = enableCopyrightDetection, + Async = async, + WebhookUrl = webhookUrl, + }; + + return await ImagesGeneratePostGenerateImageV2IdeogramV4Async( + dryRun: dryRun, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModel.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModel.g.cs new file mode 100644 index 00000000..ba4d894c --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModel.g.cs @@ -0,0 +1,857 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class ImagesGenerateClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelSecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelSecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelSecurityRequirement0, + }; + partial void PrepareImagesGeneratePostGenerateImageV2IdeogramV4CustomModelArguments( + global::System.Net.Http.HttpClient httpClient, + ref bool? dryRun, + global::Ideogram.GenerateImageIdeogramV4CustomModelRequest request); + partial void PrepareImagesGeneratePostGenerateImageV2IdeogramV4CustomModelRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + bool? dryRun, + global::Ideogram.GenerateImageIdeogramV4CustomModelRequest request); + partial void ProcessImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Generate with a custom Ideogram 4.0 model
+ /// Generate images with a custom Ideogram 4.0 model that you or your
+ /// organization can access, selected by `custom_model_uri`. Returns results
+ /// directly by default; set `async` or supply a `webhook_url` to get a
+ /// `generation_id` and poll `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelAsync( + + global::Ideogram.GenerateImageIdeogramV4CustomModelRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelAsResponseAsync( + + request: request, + dryRun: dryRun, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Generate with a custom Ideogram 4.0 model
+ /// Generate images with a custom Ideogram 4.0 model that you or your
+ /// organization can access, selected by `custom_model_uri`. Returns results
+ /// directly by default; set `async` or supply a `webhook_url` to get a
+ /// `generation_id` and poll `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelAsResponseAsync( + + global::Ideogram.GenerateImageIdeogramV4CustomModelRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareImagesGeneratePostGenerateImageV2IdeogramV4CustomModelArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelSecurityRequirements, + operationName: "ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/generate/ideogram-4-custom-model", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImagesGeneratePostGenerateImageV2IdeogramV4CustomModelRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2IdeogramV4CustomModel", + methodName: "ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelAsync", + pathTemplate: "\"/v2/image/generate/ideogram-4-custom-model\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2IdeogramV4CustomModel", + methodName: "ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelAsync", + pathTemplate: "\"/v2/image/generate/ideogram-4-custom-model\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2IdeogramV4CustomModel", + methodName: "ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelAsync", + pathTemplate: "\"/v2/image/generate/ideogram-4-custom-model\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2IdeogramV4CustomModel", + methodName: "ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelAsync", + pathTemplate: "\"/v2/image/generate/ideogram-4-custom-model\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2IdeogramV4CustomModel", + methodName: "ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelAsync", + pathTemplate: "\"/v2/image/generate/ideogram-4-custom-model\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input or an unsupported model option. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The custom model does not exist or is not accessible to this user or organization. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.GenerateImageIdeogramV4CustomModelResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.GenerateImageIdeogramV4CustomModelResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Generate with a custom Ideogram 4.0 model
+ /// Generate images with a custom Ideogram 4.0 model that you or your
+ /// organization can access, selected by `custom_model_uri`. Returns results
+ /// directly by default; set `async` or supply a `webhook_url` to get a
+ /// `generation_id` and poll `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt to generate images from, in natural language or as a
+ /// structured Ideogram 4.0 JSON prompt. A structured JSON prompt is
+ /// used as is and skips magic prompt unless `magic_prompt` is `on`. + /// + /// + /// The custom model URI, in the form `model/<model_name>/version/<version_name>`. You or your organization must have access to the model. The model determines which rendering speeds are supported. + /// + /// + /// Remove the background after generation and return transparent PNG images. Included in the custom model generation price at no extra charge. When false, the model's automatic background removal behavior still applies.
+ /// Default Value: false + /// + /// + /// Controls how a natural-language prompt is prepared. `auto` (the
+ /// default) and `on` rewrite and expand the prompt before generation.
+ /// `off` keeps your wording and only converts it into a structured
+ /// prompt. A valid structured JSON prompt skips magic prompt unless
+ /// `magic_prompt` is `on`.
+ /// Default Value: auto + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Optional. When supplied, the images are generated at this
+ /// resolution. When omitted, an aspect ratio is picked automatically
+ /// based on the prompt. + /// + /// + /// The rendering speed to use. When omitted, a speed supported by the custom model is used. + /// + /// + /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelAsync( + string prompt, + string customModelUri, + bool? dryRun = default, + bool? transparentBackground = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + int? seed = default, + int? numImages = default, + global::Ideogram.ResolutionV4? resolution = default, + global::Ideogram.GenerateImageIdeogramV4CustomModelRequestRenderingSpeed? renderingSpeed = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Ideogram.GenerateImageIdeogramV4CustomModelRequest + { + Prompt = prompt, + CustomModelUri = customModelUri, + TransparentBackground = transparentBackground, + MagicPrompt = magicPrompt, + Seed = seed, + NumImages = numImages, + Resolution = resolution, + RenderingSpeed = renderingSpeed, + EnableCopyrightDetection = enableCopyrightDetection, + Async = async, + WebhookUrl = webhookUrl, + }; + + return await ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelAsync( + dryRun: dryRun, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV4Transparent.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV4Transparent.g.cs new file mode 100644 index 00000000..8af281d5 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2IdeogramV4Transparent.g.cs @@ -0,0 +1,821 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class ImagesGenerateClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_ImagesGeneratePostGenerateImageV2IdeogramV4TransparentSecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_ImagesGeneratePostGenerateImageV2IdeogramV4TransparentSecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_ImagesGeneratePostGenerateImageV2IdeogramV4TransparentSecurityRequirement0, + }; + partial void PrepareImagesGeneratePostGenerateImageV2IdeogramV4TransparentArguments( + global::System.Net.Http.HttpClient httpClient, + ref bool? dryRun, + global::Ideogram.GenerateImageIdeogramV4TransparentRequest request); + partial void PrepareImagesGeneratePostGenerateImageV2IdeogramV4TransparentRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + bool? dryRun, + global::Ideogram.GenerateImageIdeogramV4TransparentRequest request); + partial void ProcessImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Generate transparent images with Ideogram 4.0
+ /// Generate images on a transparent background with Ideogram 4.0, delivered
+ /// as PNGs with alpha. Returns results directly by default; set `async` or
+ /// supply a `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2IdeogramV4TransparentAsync( + + global::Ideogram.GenerateImageIdeogramV4TransparentRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ImagesGeneratePostGenerateImageV2IdeogramV4TransparentAsResponseAsync( + + request: request, + dryRun: dryRun, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Generate transparent images with Ideogram 4.0
+ /// Generate images on a transparent background with Ideogram 4.0, delivered
+ /// as PNGs with alpha. Returns results directly by default; set `async` or
+ /// supply a `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ImagesGeneratePostGenerateImageV2IdeogramV4TransparentAsResponseAsync( + + global::Ideogram.GenerateImageIdeogramV4TransparentRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareImagesGeneratePostGenerateImageV2IdeogramV4TransparentArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImagesGeneratePostGenerateImageV2IdeogramV4TransparentSecurityRequirements, + operationName: "ImagesGeneratePostGenerateImageV2IdeogramV4TransparentAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/generate/ideogram-4-transparent", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImagesGeneratePostGenerateImageV2IdeogramV4TransparentRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2IdeogramV4Transparent", + methodName: "ImagesGeneratePostGenerateImageV2IdeogramV4TransparentAsync", + pathTemplate: "\"/v2/image/generate/ideogram-4-transparent\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2IdeogramV4Transparent", + methodName: "ImagesGeneratePostGenerateImageV2IdeogramV4TransparentAsync", + pathTemplate: "\"/v2/image/generate/ideogram-4-transparent\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2IdeogramV4Transparent", + methodName: "ImagesGeneratePostGenerateImageV2IdeogramV4TransparentAsync", + pathTemplate: "\"/v2/image/generate/ideogram-4-transparent\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2IdeogramV4Transparent", + methodName: "ImagesGeneratePostGenerateImageV2IdeogramV4TransparentAsync", + pathTemplate: "\"/v2/image/generate/ideogram-4-transparent\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2IdeogramV4Transparent", + methodName: "ImagesGeneratePostGenerateImageV2IdeogramV4TransparentAsync", + pathTemplate: "\"/v2/image/generate/ideogram-4-transparent\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.GenerateImageIdeogramV4TransparentResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.GenerateImageIdeogramV4TransparentResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Generate transparent images with Ideogram 4.0
+ /// Generate images on a transparent background with Ideogram 4.0, delivered
+ /// as PNGs with alpha. Returns results directly by default; set `async` or
+ /// supply a `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt to generate images from, in natural language or as a
+ /// structured Ideogram 4.0 JSON prompt. A structured JSON prompt is
+ /// used as is and skips magic prompt, except that its background
+ /// description is replaced with a transparent background. + /// + /// + /// Controls how a natural-language prompt is prepared. `auto` (the
+ /// default) and `on` rewrite and expand the prompt before generation.
+ /// `off` keeps your wording and only converts it into a structured
+ /// prompt. A valid structured JSON prompt skips magic prompt unless
+ /// `magic_prompt` is `on`.
+ /// Default Value: auto + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Supported output aspect ratios. The operation defines whether `auto`
+ /// preserves the source shape or selects a shape from the prompt.
+ /// Default Value: auto + /// + /// + /// The output resolution tier. Each tier is a total pixel budget equal
+ /// to a square of the named size (for example, `8k` delivers at most
+ /// 8192x8192 pixels in total). Wide and tall aspect ratios keep the
+ /// same budget, so one side may exceed the named size. Tiers above
+ /// 2k are produced by upscaling after generation. Defaults to 1k.
+ /// Default Value: 1k + /// + /// + /// The rendering speed to use.
+ /// Default Value: default + /// + /// + /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2IdeogramV4TransparentAsync( + string prompt, + bool? dryRun = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + int? seed = default, + int? numImages = default, + global::Ideogram.IdeogramV4AspectRatio? aspectRatio = default, + global::Ideogram.GenerateImageIdeogramV4TransparentRequestOutputResolution? outputResolution = default, + global::Ideogram.GenerateImageIdeogramV4TransparentRequestRenderingSpeed? renderingSpeed = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Ideogram.GenerateImageIdeogramV4TransparentRequest + { + Prompt = prompt, + MagicPrompt = magicPrompt, + Seed = seed, + NumImages = numImages, + AspectRatio = aspectRatio, + OutputResolution = outputResolution, + RenderingSpeed = renderingSpeed, + EnableCopyrightDetection = enableCopyrightDetection, + Async = async, + WebhookUrl = webhookUrl, + }; + + return await ImagesGeneratePostGenerateImageV2IdeogramV4TransparentAsync( + dryRun: dryRun, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2NanoBanana2.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2NanoBanana2.g.cs new file mode 100644 index 00000000..2d1c91d7 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2NanoBanana2.g.cs @@ -0,0 +1,869 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class ImagesGenerateClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_ImagesGeneratePostGenerateImageV2NanoBanana2SecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_ImagesGeneratePostGenerateImageV2NanoBanana2SecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_ImagesGeneratePostGenerateImageV2NanoBanana2SecurityRequirement0, + }; + partial void PrepareImagesGeneratePostGenerateImageV2NanoBanana2Arguments( + global::System.Net.Http.HttpClient httpClient, + ref bool? dryRun, + global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana2Request request); + partial void PrepareImagesGeneratePostGenerateImageV2NanoBanana2Request( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + bool? dryRun, + global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana2Request request); + partial void ProcessImagesGeneratePostGenerateImageV2NanoBanana2Response( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessImagesGeneratePostGenerateImageV2NanoBanana2ResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Generate with Nano Banana 2
+ /// Generate images with Nano Banana 2. Optionally upload source images as
+ /// `images` using `multipart/form-data` to edit them with the prompt.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2NanoBanana2Async( + + global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana2Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ImagesGeneratePostGenerateImageV2NanoBanana2AsResponseAsync( + + request: request, + dryRun: dryRun, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Generate with Nano Banana 2
+ /// Generate images with Nano Banana 2. Optionally upload source images as
+ /// `images` using `multipart/form-data` to edit them with the prompt.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ImagesGeneratePostGenerateImageV2NanoBanana2AsResponseAsync( + + global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana2Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareImagesGeneratePostGenerateImageV2NanoBanana2Arguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImagesGeneratePostGenerateImageV2NanoBanana2SecurityRequirements, + operationName: "ImagesGeneratePostGenerateImageV2NanoBanana2Async"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/generate/nano-banana-2", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + if (request.Images != default) + { + + for (var __iImages = 0; __iImages < request.Images.Count; __iImages++) + { + var __contentImages = new global::System.Net.Http.ByteArrayContent(request.Images[__iImages]); + __contentImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); + __httpRequestContent.Add( + content: __contentImages, + name: "\"images\"", + fileName: $"\"file{__iImages}.bin\""); + if (__contentImages.Headers.ContentDisposition != null) + { + __contentImages.Headers.ContentDisposition.FileNameStar = null; + } + } + + } + if (request.AspectRatio != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.AspectRatio).HasValue ? (request.AspectRatio).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"aspect_ratio\""); + + } + if (request.ResolutionTier != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.ResolutionTier).HasValue ? (request.ResolutionTier).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"resolution_tier\""); + + } + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImagesGeneratePostGenerateImageV2NanoBanana2Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2NanoBanana2", + methodName: "ImagesGeneratePostGenerateImageV2NanoBanana2Async", + pathTemplate: "\"/v2/image/generate/nano-banana-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2NanoBanana2", + methodName: "ImagesGeneratePostGenerateImageV2NanoBanana2Async", + pathTemplate: "\"/v2/image/generate/nano-banana-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2NanoBanana2", + methodName: "ImagesGeneratePostGenerateImageV2NanoBanana2Async", + pathTemplate: "\"/v2/image/generate/nano-banana-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImagesGeneratePostGenerateImageV2NanoBanana2Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2NanoBanana2", + methodName: "ImagesGeneratePostGenerateImageV2NanoBanana2Async", + pathTemplate: "\"/v2/image/generate/nano-banana-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2NanoBanana2", + methodName: "ImagesGeneratePostGenerateImageV2NanoBanana2Async", + pathTemplate: "\"/v2/image/generate/nano-banana-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImagesGeneratePostGenerateImageV2NanoBanana2ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.GenerateImageNanoBanana2Response.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.GenerateImageNanoBanana2Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Generate with Nano Banana 2
+ /// Generate images with Nano Banana 2. Optionally upload source images as
+ /// `images` using `multipart/form-data` to edit them with the prompt.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt to generate images from, or the edit instruction to apply when source images are supplied. It is passed to the model as written. + /// + /// + /// Optional source images to edit (max 10, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only. + /// + /// + /// Output aspect ratios Nano Banana 2 serves. `auto` lets the model choose the shape; an edit keeps its source image's shape.
+ /// Default Value: auto + /// + /// + /// The output resolution tier.
+ /// Default Value: 1K + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2NanoBanana2Async( + string prompt, + bool? dryRun = default, + global::System.Collections.Generic.IList? images = default, + global::Ideogram.NanoBanana2AspectRatio? aspectRatio = default, + global::Ideogram.V2ImageGenerateNanoBanana2PostRequestBodyContentMultipartFormDataSchemaResolutionTier? resolutionTier = default, + int? numImages = default, + int? seed = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana2Request + { + Prompt = prompt, + Images = images, + AspectRatio = aspectRatio, + ResolutionTier = resolutionTier, + NumImages = numImages, + Seed = seed, + Async = async, + WebhookUrl = webhookUrl, + }; + + return await ImagesGeneratePostGenerateImageV2NanoBanana2Async( + dryRun: dryRun, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2NanoBanana21.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2NanoBanana21.g.cs new file mode 100644 index 00000000..7076937d --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2NanoBanana21.g.cs @@ -0,0 +1,869 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class ImagesGenerateClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_ImagesGeneratePostGenerateImageV2NanoBanana21SecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_ImagesGeneratePostGenerateImageV2NanoBanana21SecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_ImagesGeneratePostGenerateImageV2NanoBanana21SecurityRequirement0, + }; + partial void PrepareImagesGeneratePostGenerateImageV2NanoBanana21Arguments( + global::System.Net.Http.HttpClient httpClient, + ref bool? dryRun, + global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana21Request request); + partial void PrepareImagesGeneratePostGenerateImageV2NanoBanana21Request( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + bool? dryRun, + global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana21Request request); + partial void ProcessImagesGeneratePostGenerateImageV2NanoBanana21Response( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessImagesGeneratePostGenerateImageV2NanoBanana21ResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Generate with Nano Banana 2.1
+ /// Generate images with Nano Banana 2.1. Optionally upload source images as
+ /// `images` using `multipart/form-data` to edit them with the prompt.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2NanoBanana21Async( + + global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana21Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ImagesGeneratePostGenerateImageV2NanoBanana21AsResponseAsync( + + request: request, + dryRun: dryRun, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Generate with Nano Banana 2.1
+ /// Generate images with Nano Banana 2.1. Optionally upload source images as
+ /// `images` using `multipart/form-data` to edit them with the prompt.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ImagesGeneratePostGenerateImageV2NanoBanana21AsResponseAsync( + + global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana21Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareImagesGeneratePostGenerateImageV2NanoBanana21Arguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImagesGeneratePostGenerateImageV2NanoBanana21SecurityRequirements, + operationName: "ImagesGeneratePostGenerateImageV2NanoBanana21Async"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/generate/nano-banana-2-1", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + if (request.Images != default) + { + + for (var __iImages = 0; __iImages < request.Images.Count; __iImages++) + { + var __contentImages = new global::System.Net.Http.ByteArrayContent(request.Images[__iImages]); + __contentImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); + __httpRequestContent.Add( + content: __contentImages, + name: "\"images\"", + fileName: $"\"file{__iImages}.bin\""); + if (__contentImages.Headers.ContentDisposition != null) + { + __contentImages.Headers.ContentDisposition.FileNameStar = null; + } + } + + } + if (request.AspectRatio != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.AspectRatio).HasValue ? (request.AspectRatio).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"aspect_ratio\""); + + } + if (request.ResolutionTier != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.ResolutionTier).HasValue ? (request.ResolutionTier).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"resolution_tier\""); + + } + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImagesGeneratePostGenerateImageV2NanoBanana21Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2NanoBanana21", + methodName: "ImagesGeneratePostGenerateImageV2NanoBanana21Async", + pathTemplate: "\"/v2/image/generate/nano-banana-2-1\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2NanoBanana21", + methodName: "ImagesGeneratePostGenerateImageV2NanoBanana21Async", + pathTemplate: "\"/v2/image/generate/nano-banana-2-1\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2NanoBanana21", + methodName: "ImagesGeneratePostGenerateImageV2NanoBanana21Async", + pathTemplate: "\"/v2/image/generate/nano-banana-2-1\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImagesGeneratePostGenerateImageV2NanoBanana21Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2NanoBanana21", + methodName: "ImagesGeneratePostGenerateImageV2NanoBanana21Async", + pathTemplate: "\"/v2/image/generate/nano-banana-2-1\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2NanoBanana21", + methodName: "ImagesGeneratePostGenerateImageV2NanoBanana21Async", + pathTemplate: "\"/v2/image/generate/nano-banana-2-1\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImagesGeneratePostGenerateImageV2NanoBanana21ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.GenerateImageNanoBanana21Response.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.GenerateImageNanoBanana21Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Generate with Nano Banana 2.1
+ /// Generate images with Nano Banana 2.1. Optionally upload source images as
+ /// `images` using `multipart/form-data` to edit them with the prompt.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt to generate images from, or the edit instruction to apply when source images are supplied. It is passed to the model as written. + /// + /// + /// Optional source images to edit (max 10, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only. + /// + /// + /// Output aspect ratios Nano Banana 2.1 serves. `auto` lets the model choose the shape; an edit keeps its source image's shape.
+ /// Default Value: auto + /// + /// + /// The output resolution tier.
+ /// Default Value: 1K + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2NanoBanana21Async( + string prompt, + bool? dryRun = default, + global::System.Collections.Generic.IList? images = default, + global::Ideogram.NanoBanana21AspectRatio? aspectRatio = default, + global::Ideogram.V2ImageGenerateNanoBanana21PostRequestBodyContentMultipartFormDataSchemaResolutionTier? resolutionTier = default, + int? numImages = default, + int? seed = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana21Request + { + Prompt = prompt, + Images = images, + AspectRatio = aspectRatio, + ResolutionTier = resolutionTier, + NumImages = numImages, + Seed = seed, + Async = async, + WebhookUrl = webhookUrl, + }; + + return await ImagesGeneratePostGenerateImageV2NanoBanana21Async( + dryRun: dryRun, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2NanoBananaPro.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2NanoBananaPro.g.cs new file mode 100644 index 00000000..a4a4e8ac --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2NanoBananaPro.g.cs @@ -0,0 +1,869 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class ImagesGenerateClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_ImagesGeneratePostGenerateImageV2NanoBananaProSecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_ImagesGeneratePostGenerateImageV2NanoBananaProSecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_ImagesGeneratePostGenerateImageV2NanoBananaProSecurityRequirement0, + }; + partial void PrepareImagesGeneratePostGenerateImageV2NanoBananaProArguments( + global::System.Net.Http.HttpClient httpClient, + ref bool? dryRun, + global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBananaProRequest request); + partial void PrepareImagesGeneratePostGenerateImageV2NanoBananaProRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + bool? dryRun, + global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBananaProRequest request); + partial void ProcessImagesGeneratePostGenerateImageV2NanoBananaProResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessImagesGeneratePostGenerateImageV2NanoBananaProResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Generate with Nano Banana Pro
+ /// Generate images with Nano Banana Pro. Optionally upload source images as
+ /// `images` using `multipart/form-data` to edit them with the prompt.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2NanoBananaProAsync( + + global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBananaProRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ImagesGeneratePostGenerateImageV2NanoBananaProAsResponseAsync( + + request: request, + dryRun: dryRun, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Generate with Nano Banana Pro
+ /// Generate images with Nano Banana Pro. Optionally upload source images as
+ /// `images` using `multipart/form-data` to edit them with the prompt.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ImagesGeneratePostGenerateImageV2NanoBananaProAsResponseAsync( + + global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBananaProRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareImagesGeneratePostGenerateImageV2NanoBananaProArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImagesGeneratePostGenerateImageV2NanoBananaProSecurityRequirements, + operationName: "ImagesGeneratePostGenerateImageV2NanoBananaProAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/generate/nano-banana-pro", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + if (request.Images != default) + { + + for (var __iImages = 0; __iImages < request.Images.Count; __iImages++) + { + var __contentImages = new global::System.Net.Http.ByteArrayContent(request.Images[__iImages]); + __contentImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); + __httpRequestContent.Add( + content: __contentImages, + name: "\"images\"", + fileName: $"\"file{__iImages}.bin\""); + if (__contentImages.Headers.ContentDisposition != null) + { + __contentImages.Headers.ContentDisposition.FileNameStar = null; + } + } + + } + if (request.AspectRatio != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.AspectRatio).HasValue ? (request.AspectRatio).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"aspect_ratio\""); + + } + if (request.ResolutionTier != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.ResolutionTier).HasValue ? (request.ResolutionTier).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"resolution_tier\""); + + } + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImagesGeneratePostGenerateImageV2NanoBananaProRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2NanoBananaPro", + methodName: "ImagesGeneratePostGenerateImageV2NanoBananaProAsync", + pathTemplate: "\"/v2/image/generate/nano-banana-pro\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2NanoBananaPro", + methodName: "ImagesGeneratePostGenerateImageV2NanoBananaProAsync", + pathTemplate: "\"/v2/image/generate/nano-banana-pro\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2NanoBananaPro", + methodName: "ImagesGeneratePostGenerateImageV2NanoBananaProAsync", + pathTemplate: "\"/v2/image/generate/nano-banana-pro\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImagesGeneratePostGenerateImageV2NanoBananaProResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2NanoBananaPro", + methodName: "ImagesGeneratePostGenerateImageV2NanoBananaProAsync", + pathTemplate: "\"/v2/image/generate/nano-banana-pro\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2NanoBananaPro", + methodName: "ImagesGeneratePostGenerateImageV2NanoBananaProAsync", + pathTemplate: "\"/v2/image/generate/nano-banana-pro\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImagesGeneratePostGenerateImageV2NanoBananaProResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.GenerateImageNanoBananaProResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.GenerateImageNanoBananaProResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Generate with Nano Banana Pro
+ /// Generate images with Nano Banana Pro. Optionally upload source images as
+ /// `images` using `multipart/form-data` to edit them with the prompt.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt to generate images from, or the edit instruction to apply when source images are supplied. It is passed to the model as written. + /// + /// + /// Optional source images to edit (max 10, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only. + /// + /// + /// Output aspect ratios Nano Banana Pro serves. `auto` lets the model choose the shape; an edit keeps its source image's shape.
+ /// Default Value: auto + /// + /// + /// The output resolution tier.
+ /// Default Value: 1K + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2NanoBananaProAsync( + string prompt, + bool? dryRun = default, + global::System.Collections.Generic.IList? images = default, + global::Ideogram.NanoBananaProAspectRatio? aspectRatio = default, + global::Ideogram.V2ImageGenerateNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier? resolutionTier = default, + int? numImages = default, + int? seed = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBananaProRequest + { + Prompt = prompt, + Images = images, + AspectRatio = aspectRatio, + ResolutionTier = resolutionTier, + NumImages = numImages, + Seed = seed, + Async = async, + WebhookUrl = webhookUrl, + }; + + return await ImagesGeneratePostGenerateImageV2NanoBananaProAsync( + dryRun: dryRun, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2PImageIdeogram.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2PImageIdeogram.g.cs new file mode 100644 index 00000000..f78fb894 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2PImageIdeogram.g.cs @@ -0,0 +1,827 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class ImagesGenerateClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_ImagesGeneratePostGenerateImageV2PImageIdeogramSecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_ImagesGeneratePostGenerateImageV2PImageIdeogramSecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_ImagesGeneratePostGenerateImageV2PImageIdeogramSecurityRequirement0, + }; + partial void PrepareImagesGeneratePostGenerateImageV2PImageIdeogramArguments( + global::System.Net.Http.HttpClient httpClient, + ref bool? dryRun, + global::Ideogram.GenerateImagePImageIdeogramRequest request); + partial void PrepareImagesGeneratePostGenerateImageV2PImageIdeogramRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + bool? dryRun, + global::Ideogram.GenerateImagePImageIdeogramRequest request); + partial void ProcessImagesGeneratePostGenerateImageV2PImageIdeogramResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessImagesGeneratePostGenerateImageV2PImageIdeogramResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Generate with P-Image Ideogram
+ /// Generate images with P-Image Ideogram, a fast model with selectable
+ /// quality and resolution tiers. Returns results directly by default; set
+ /// `async` or supply a `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2PImageIdeogramAsync( + + global::Ideogram.GenerateImagePImageIdeogramRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ImagesGeneratePostGenerateImageV2PImageIdeogramAsResponseAsync( + + request: request, + dryRun: dryRun, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Generate with P-Image Ideogram
+ /// Generate images with P-Image Ideogram, a fast model with selectable
+ /// quality and resolution tiers. Returns results directly by default; set
+ /// `async` or supply a `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ImagesGeneratePostGenerateImageV2PImageIdeogramAsResponseAsync( + + global::Ideogram.GenerateImagePImageIdeogramRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareImagesGeneratePostGenerateImageV2PImageIdeogramArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImagesGeneratePostGenerateImageV2PImageIdeogramSecurityRequirements, + operationName: "ImagesGeneratePostGenerateImageV2PImageIdeogramAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/generate/p-image-ideogram", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImagesGeneratePostGenerateImageV2PImageIdeogramRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2PImageIdeogram", + methodName: "ImagesGeneratePostGenerateImageV2PImageIdeogramAsync", + pathTemplate: "\"/v2/image/generate/p-image-ideogram\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2PImageIdeogram", + methodName: "ImagesGeneratePostGenerateImageV2PImageIdeogramAsync", + pathTemplate: "\"/v2/image/generate/p-image-ideogram\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2PImageIdeogram", + methodName: "ImagesGeneratePostGenerateImageV2PImageIdeogramAsync", + pathTemplate: "\"/v2/image/generate/p-image-ideogram\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImagesGeneratePostGenerateImageV2PImageIdeogramResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2PImageIdeogram", + methodName: "ImagesGeneratePostGenerateImageV2PImageIdeogramAsync", + pathTemplate: "\"/v2/image/generate/p-image-ideogram\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2PImageIdeogram", + methodName: "ImagesGeneratePostGenerateImageV2PImageIdeogramAsync", + pathTemplate: "\"/v2/image/generate/p-image-ideogram\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImagesGeneratePostGenerateImageV2PImageIdeogramResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.GenerateImagePImageIdeogramResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.GenerateImagePImageIdeogramResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Generate with P-Image Ideogram
+ /// Generate images with P-Image Ideogram, a fast model with selectable
+ /// quality and resolution tiers. Returns results directly by default; set
+ /// `async` or supply a `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt to generate images from, in natural language or as a
+ /// structured Ideogram 4.0 JSON prompt. + /// + /// + /// Controls magic prompt (automatic prompt rewriting). `off` disables magic prompt entirely. Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// The generation quality level. Defaults to `medium`.
+ /// Default Value: medium + /// + /// + /// The output size tier. Defaults to `1k`. Cannot be combined with `custom_width`/`custom_height`. + /// + /// + /// The output aspect ratio. Defaults to `1x1`.
+ /// Default Value: 1x1 + /// + /// + /// Optional. An exact output width in pixels, used together with
+ /// `custom_height` for output sizes outside the preset tiers. Must
+ /// be a positive multiple of 16 between 16 and 4096, and
+ /// `custom_width` × `custom_height` must not exceed 4,194,304 pixels
+ /// (2048×2048). Cannot be combined with `resolution` or
+ /// `aspect_ratio`; the request is billed at the resolution tier
+ /// matching its total pixel count. + /// + /// + /// Optional. An exact output height in pixels, used together with
+ /// `custom_width`. See `custom_width` for the accepted range and
+ /// billing behavior. + /// + /// + /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2PImageIdeogramAsync( + string prompt, + bool? dryRun = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + int? seed = default, + int? numImages = default, + global::Ideogram.GenerationQuality? quality = default, + global::Ideogram.GenerateImagePImageIdeogramRequestResolution? resolution = default, + global::Ideogram.AspectRatioV3? aspectRatio = default, + int? customWidth = default, + int? customHeight = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Ideogram.GenerateImagePImageIdeogramRequest + { + Prompt = prompt, + MagicPrompt = magicPrompt, + Seed = seed, + NumImages = numImages, + Quality = quality, + Resolution = resolution, + AspectRatio = aspectRatio, + CustomWidth = customWidth, + CustomHeight = customHeight, + EnableCopyrightDetection = enableCopyrightDetection, + Async = async, + WebhookUrl = webhookUrl, + }; + + return await ImagesGeneratePostGenerateImageV2PImageIdeogramAsync( + dryRun: dryRun, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2ZImage.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2ZImage.g.cs new file mode 100644 index 00000000..8766ecd9 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.ImagesGeneratePostGenerateImageV2ZImage.g.cs @@ -0,0 +1,788 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class ImagesGenerateClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_ImagesGeneratePostGenerateImageV2ZImageSecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_ImagesGeneratePostGenerateImageV2ZImageSecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_ImagesGeneratePostGenerateImageV2ZImageSecurityRequirement0, + }; + partial void PrepareImagesGeneratePostGenerateImageV2ZImageArguments( + global::System.Net.Http.HttpClient httpClient, + ref bool? dryRun, + global::Ideogram.GenerateImageZImageRequest request); + partial void PrepareImagesGeneratePostGenerateImageV2ZImageRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + bool? dryRun, + global::Ideogram.GenerateImageZImageRequest request); + partial void ProcessImagesGeneratePostGenerateImageV2ZImageResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessImagesGeneratePostGenerateImageV2ZImageResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Generate with Z-Image
+ /// Generate images from a text prompt with Z-Image. Returns results
+ /// directly by default; set `async` or supply a `webhook_url` to get a
+ /// `generation_id` and poll `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2ZImageAsync( + + global::Ideogram.GenerateImageZImageRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ImagesGeneratePostGenerateImageV2ZImageAsResponseAsync( + + request: request, + dryRun: dryRun, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Generate with Z-Image
+ /// Generate images from a text prompt with Z-Image. Returns results
+ /// directly by default; set `async` or supply a `webhook_url` to get a
+ /// `generation_id` and poll `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ImagesGeneratePostGenerateImageV2ZImageAsResponseAsync( + + global::Ideogram.GenerateImageZImageRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareImagesGeneratePostGenerateImageV2ZImageArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImagesGeneratePostGenerateImageV2ZImageSecurityRequirements, + operationName: "ImagesGeneratePostGenerateImageV2ZImageAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/generate/z-image", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImagesGeneratePostGenerateImageV2ZImageRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2ZImage", + methodName: "ImagesGeneratePostGenerateImageV2ZImageAsync", + pathTemplate: "\"/v2/image/generate/z-image\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2ZImage", + methodName: "ImagesGeneratePostGenerateImageV2ZImageAsync", + pathTemplate: "\"/v2/image/generate/z-image\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2ZImage", + methodName: "ImagesGeneratePostGenerateImageV2ZImageAsync", + pathTemplate: "\"/v2/image/generate/z-image\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImagesGeneratePostGenerateImageV2ZImageResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2ZImage", + methodName: "ImagesGeneratePostGenerateImageV2ZImageAsync", + pathTemplate: "\"/v2/image/generate/z-image\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesGeneratePostGenerateImageV2ZImage", + methodName: "ImagesGeneratePostGenerateImageV2ZImageAsync", + pathTemplate: "\"/v2/image/generate/z-image\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImagesGeneratePostGenerateImageV2ZImageResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.GenerateImageZImageResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.GenerateImageZImageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Generate with Z-Image
+ /// Generate images from a text prompt with Z-Image. Returns results
+ /// directly by default; set `async` or supply a `webhook_url` to get a
+ /// `generation_id` and poll `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt to generate images from. + /// + /// + /// Exact output resolution, formatted as "WIDTHxHEIGHT". Each side must be a positive multiple of 16 and the total area must not exceed 1,048,576 pixels (1024×1024). When omitted, the model's default 1024×1024 is used. + /// + /// + /// Optional number of diffusion steps. When omitted, the model's
+ /// default is used. Higher values improve quality but take longer. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesGeneratePostGenerateImageV2ZImageAsync( + string prompt, + bool? dryRun = default, + string? resolution = default, + int? numInferenceSteps = default, + int? seed = default, + int? numImages = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Ideogram.GenerateImageZImageRequest + { + Prompt = prompt, + Resolution = resolution, + NumInferenceSteps = numInferenceSteps, + Seed = seed, + NumImages = numImages, + Async = async, + WebhookUrl = webhookUrl, + }; + + return await ImagesGeneratePostGenerateImageV2ZImageAsync( + dryRun: dryRun, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2GptImage2.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2GptImage2.g.cs deleted file mode 100644 index 35ab60ff..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2GptImage2.g.cs +++ /dev/null @@ -1,888 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ImagesGenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostGenerateImageV2GptImage2SecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostGenerateImageV2GptImage2SecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostGenerateImageV2GptImage2SecurityRequirement0, - }; - partial void PreparePostGenerateImageV2GptImage2Arguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? dryRun, - global::Ideogram.GenerateImageGptImage2Request request); - partial void PreparePostGenerateImageV2GptImage2Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? dryRun, - global::Ideogram.GenerateImageGptImage2Request request); - partial void ProcessPostGenerateImageV2GptImage2Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostGenerateImageV2GptImage2ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Generate with GPT Image 2
- /// Generate images with GPT Image 2. Optionally upload source images as
- /// `images` using `multipart/form-data` to edit them with the prompt.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageV2GptImage2Async( - - global::Ideogram.GenerateImageGptImage2Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostGenerateImageV2GptImage2AsResponseAsync( - - request: request, - dryRun: dryRun, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Generate with GPT Image 2
- /// Generate images with GPT Image 2. Optionally upload source images as
- /// `images` using `multipart/form-data` to edit them with the prompt.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostGenerateImageV2GptImage2AsResponseAsync( - - global::Ideogram.GenerateImageGptImage2Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostGenerateImageV2GptImage2Arguments( - httpClient: HttpClient, - dryRun: ref dryRun, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostGenerateImageV2GptImage2SecurityRequirements, - operationName: "PostGenerateImageV2GptImage2Async"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/image/generate/gpt-image-2", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - if (request.ImageAssetIdentifiers != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.ImageAssetIdentifiers!, x => x.ToJson(JsonSerializerContext)))}]"), - name: "\"image_asset_identifiers\""); - - } - if (request.Images != default) - { - - for (var __iImages = 0; __iImages < request.Images.Count; __iImages++) - { - var __contentImages = new global::System.Net.Http.ByteArrayContent(request.Images[__iImages]); - __contentImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); - __httpRequestContent.Add( - content: __contentImages, - name: "\"images\"", - fileName: $"\"file{__iImages}.bin\""); - if (__contentImages.Headers.ContentDisposition != null) - { - __contentImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.AspectRatio != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.AspectRatio ?? string.Empty), - name: "\"aspect_ratio\""); - - } - if (request.Resolution != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Resolution ?? string.Empty), - name: "\"resolution\""); - - } - if (request.Async != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"async\""); - - } - if (request.WebhookUrl != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), - name: "\"webhook_url\""); - - } - if (request.Private != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"private\""); - - } - if (request.TargetCollectionId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.TargetCollectionId ?? string.Empty), - name: "\"target_collection_id\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostGenerateImageV2GptImage2Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - dryRun: dryRun, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2GptImage2", - methodName: "PostGenerateImageV2GptImage2Async", - pathTemplate: "\"/v2/image/generate/gpt-image-2\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2GptImage2", - methodName: "PostGenerateImageV2GptImage2Async", - pathTemplate: "\"/v2/image/generate/gpt-image-2\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2GptImage2", - methodName: "PostGenerateImageV2GptImage2Async", - pathTemplate: "\"/v2/image/generate/gpt-image-2\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostGenerateImageV2GptImage2Response( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2GptImage2", - methodName: "PostGenerateImageV2GptImage2Async", - pathTemplate: "\"/v2/image/generate/gpt-image-2\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2GptImage2", - methodName: "PostGenerateImageV2GptImage2Async", - pathTemplate: "\"/v2/image/generate/gpt-image-2\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 500) - { - string? __content_500 = null; - global::System.Exception? __exception_500 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_500 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_500, - responseBody: __content_500, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostGenerateImageV2GptImage2ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.GenerateImageGptImage2Response.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.GenerateImageGptImage2Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Generate with GPT Image 2
- /// Generate images with GPT Image 2. Optionally upload source images as
- /// `images` using `multipart/form-data` to edit them with the prompt.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// The prompt to generate images from, or the edit instruction to apply when source images are supplied. It is passed to the model as written. - /// - /// - /// Existing upload or generated image assets to edit, by reference. Takes priority over `images` if both are supplied. - /// - /// - /// Optional source images to edit (max 16, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only. - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The requested output aspect ratio, for example "1:1", "16:9", or "9:16". Ignored when `resolution` is provided. Defaults to "1:1". - /// - /// - /// Exact output resolution, formatted as "WIDTHxHEIGHT", for example
- /// "2048x2048" or "1920x1088". When provided, this takes precedence
- /// over `aspect_ratio`. The dimensions must satisfy GPT Image 2
- /// constraints: each side is a multiple of 16, the largest side is at
- /// most 3840px, the long:short ratio is at most 3:1, and total pixels
- /// are between 655360 and 8294400 inclusive. - /// - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageV2GptImage2Async( - string prompt, - bool? dryRun = default, - global::System.Collections.Generic.IList? imageAssetIdentifiers = default, - global::System.Collections.Generic.IList? images = default, - int? numImages = default, - int? seed = default, - string? aspectRatio = default, - string? resolution = default, - bool? async = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.GenerateImageGptImage2Request - { - Prompt = prompt, - ImageAssetIdentifiers = imageAssetIdentifiers, - Images = images, - NumImages = numImages, - Seed = seed, - AspectRatio = aspectRatio, - Resolution = resolution, - Async = async, - WebhookUrl = webhookUrl, - Private = @private, - TargetCollectionId = targetCollectionId, - }; - - return await PostGenerateImageV2GptImage2Async( - dryRun: dryRun, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2GptImage25Flare.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2GptImage25Flare.g.cs deleted file mode 100644 index 035eb306..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2GptImage25Flare.g.cs +++ /dev/null @@ -1,981 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ImagesGenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostGenerateImageV2GptImage25FlareSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostGenerateImageV2GptImage25FlareSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostGenerateImageV2GptImage25FlareSecurityRequirement0, - }; - partial void PreparePostGenerateImageV2GptImage25FlareArguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? dryRun, - global::Ideogram.GenerateImageGptImage25FlareRequest request); - partial void PreparePostGenerateImageV2GptImage25FlareRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? dryRun, - global::Ideogram.GenerateImageGptImage25FlareRequest request); - partial void ProcessPostGenerateImageV2GptImage25FlareResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostGenerateImageV2GptImage25FlareResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Generate with GPT Image 2.5 Flare
- /// Generate images with GPT Image 2.5 Flare, the fast variant of GPT Image
- /// 2.5. Optionally upload source images as `images` using
- /// `multipart/form-data` to edit them with the prompt. Returns results
- /// directly by default; set `async` or supply a `webhook_url` to get a
- /// `generation_id` and poll `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageV2GptImage25FlareAsync( - - global::Ideogram.GenerateImageGptImage25FlareRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostGenerateImageV2GptImage25FlareAsResponseAsync( - - request: request, - dryRun: dryRun, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Generate with GPT Image 2.5 Flare
- /// Generate images with GPT Image 2.5 Flare, the fast variant of GPT Image
- /// 2.5. Optionally upload source images as `images` using
- /// `multipart/form-data` to edit them with the prompt. Returns results
- /// directly by default; set `async` or supply a `webhook_url` to get a
- /// `generation_id` and poll `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostGenerateImageV2GptImage25FlareAsResponseAsync( - - global::Ideogram.GenerateImageGptImage25FlareRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostGenerateImageV2GptImage25FlareArguments( - httpClient: HttpClient, - dryRun: ref dryRun, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostGenerateImageV2GptImage25FlareSecurityRequirements, - operationName: "PostGenerateImageV2GptImage25FlareAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/image/generate/gpt-image-2-5-flare", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - if (request.ImageAssetIdentifiers != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.ImageAssetIdentifiers!, x => x.ToJson(JsonSerializerContext)))}]"), - name: "\"image_asset_identifiers\""); - - } - if (request.Images != default) - { - - for (var __iImages = 0; __iImages < request.Images.Count; __iImages++) - { - var __contentImages = new global::System.Net.Http.ByteArrayContent(request.Images[__iImages]); - __contentImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); - __httpRequestContent.Add( - content: __contentImages, - name: "\"images\"", - fileName: $"\"file{__iImages}.bin\""); - if (__contentImages.Headers.ContentDisposition != null) - { - __contentImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - if (request.MaskAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.MaskAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"mask_asset_identifier\""); - - } - if (request.Mask != default) - { - - var __contentMask = new global::System.Net.Http.ByteArrayContent(request.Mask ?? global::System.Array.Empty()); - __contentMask.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Maskname is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Maskname) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentMask, - name: "\"mask\"", - fileName: request.Maskname != null ? $"\"{request.Maskname}\"" : string.Empty); - if (__contentMask.Headers.ContentDisposition != null) - { - __contentMask.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.Background != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Background).HasValue ? (request.Background).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"background\""); - - } - if (request.Quality != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Quality).HasValue ? (request.Quality).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"quality\""); - - } - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.AspectRatio != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.AspectRatio ?? string.Empty), - name: "\"aspect_ratio\""); - - } - if (request.Resolution != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Resolution ?? string.Empty), - name: "\"resolution\""); - - } - if (request.Async != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"async\""); - - } - if (request.WebhookUrl != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), - name: "\"webhook_url\""); - - } - if (request.Private != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"private\""); - - } - if (request.TargetCollectionId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.TargetCollectionId ?? string.Empty), - name: "\"target_collection_id\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostGenerateImageV2GptImage25FlareRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - dryRun: dryRun, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2GptImage25Flare", - methodName: "PostGenerateImageV2GptImage25FlareAsync", - pathTemplate: "\"/v2/image/generate/gpt-image-2-5-flare\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2GptImage25Flare", - methodName: "PostGenerateImageV2GptImage25FlareAsync", - pathTemplate: "\"/v2/image/generate/gpt-image-2-5-flare\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2GptImage25Flare", - methodName: "PostGenerateImageV2GptImage25FlareAsync", - pathTemplate: "\"/v2/image/generate/gpt-image-2-5-flare\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostGenerateImageV2GptImage25FlareResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2GptImage25Flare", - methodName: "PostGenerateImageV2GptImage25FlareAsync", - pathTemplate: "\"/v2/image/generate/gpt-image-2-5-flare\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2GptImage25Flare", - methodName: "PostGenerateImageV2GptImage25FlareAsync", - pathTemplate: "\"/v2/image/generate/gpt-image-2-5-flare\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 500) - { - string? __content_500 = null; - global::System.Exception? __exception_500 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_500 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_500, - responseBody: __content_500, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostGenerateImageV2GptImage25FlareResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.GenerateImageGptImage25FlareResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.GenerateImageGptImage25FlareResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Generate with GPT Image 2.5 Flare
- /// Generate images with GPT Image 2.5 Flare, the fast variant of GPT Image
- /// 2.5. Optionally upload source images as `images` using
- /// `multipart/form-data` to edit them with the prompt. Returns results
- /// directly by default; set `async` or supply a `webhook_url` to get a
- /// `generation_id` and poll `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// The prompt to generate images from, or the edit instruction to apply when source images are supplied. It is passed to the model as written. - /// - /// - /// Existing upload or generated image assets to edit, by reference. Takes priority over `images` if both are supplied. - /// - /// - /// Optional source images to edit (max 16, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only. - /// - /// - /// An existing upload or generated image asset to use as the mask, by reference. The same rules as `mask` apply. Takes priority over `mask` if both are supplied. - /// - /// - /// An optional mask for the first source image (max 25MB; JPEG, PNG, or WEBP). Multipart requests only. Fully transparent pixels mark the areas to edit. The mask must have the same dimensions as the first source image, and requires source images in the same request. - /// - /// - /// An optional mask for the first source image (max 25MB; JPEG, PNG, or WEBP). Multipart requests only. Fully transparent pixels mark the areas to edit. The mask must have the same dimensions as the first source image, and requires source images in the same request. - /// - /// - /// The output background. `transparent` returns images with an alpha channel, `opaque` forces a solid background, and `auto` lets the model decide from the prompt.
- /// Default Value: auto - /// - /// - /// How much rendering effort the model spends. Lower tiers return sooner and cost less; `auto` lets the model choose, which it currently renders at `high`.
- /// Default Value: auto - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The requested output aspect ratio, for example "1:1", "16:9", or "9:16". Ignored when `resolution` is provided. Defaults to "1:1". - /// - /// - /// Exact output resolution, formatted as "WIDTHxHEIGHT", for example
- /// "2048x2048" or "1920x1088". When provided, this takes precedence
- /// over `aspect_ratio`. The dimensions must satisfy GPT Image 2.5 Flare
- /// constraints: each side is a multiple of 16, the largest side is at
- /// most 3840px, the long:short ratio is at most 3:1, and total pixels
- /// are between 655360 and 8294400 inclusive. - /// - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageV2GptImage25FlareAsync( - string prompt, - bool? dryRun = default, - global::System.Collections.Generic.IList? imageAssetIdentifiers = default, - global::System.Collections.Generic.IList? images = default, - global::Ideogram.AssetIdentifier? maskAssetIdentifier = default, - byte[]? mask = default, - string? maskname = default, - global::Ideogram.GenerateImageGptImage25FlareRequestBackground? background = default, - global::Ideogram.GenerateImageGptImage25FlareRequestQuality? quality = default, - int? numImages = default, - int? seed = default, - string? aspectRatio = default, - string? resolution = default, - bool? async = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.GenerateImageGptImage25FlareRequest - { - Prompt = prompt, - ImageAssetIdentifiers = imageAssetIdentifiers, - Images = images, - MaskAssetIdentifier = maskAssetIdentifier, - Mask = mask, - Maskname = maskname, - Background = background, - Quality = quality, - NumImages = numImages, - Seed = seed, - AspectRatio = aspectRatio, - Resolution = resolution, - Async = async, - WebhookUrl = webhookUrl, - Private = @private, - TargetCollectionId = targetCollectionId, - }; - - return await PostGenerateImageV2GptImage25FlareAsync( - dryRun: dryRun, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2GptImage25Sunburst.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2GptImage25Sunburst.g.cs deleted file mode 100644 index 73906679..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2GptImage25Sunburst.g.cs +++ /dev/null @@ -1,984 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ImagesGenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostGenerateImageV2GptImage25SunburstSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostGenerateImageV2GptImage25SunburstSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostGenerateImageV2GptImage25SunburstSecurityRequirement0, - }; - partial void PreparePostGenerateImageV2GptImage25SunburstArguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? dryRun, - global::Ideogram.GenerateImageGptImage25SunburstRequest request); - partial void PreparePostGenerateImageV2GptImage25SunburstRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? dryRun, - global::Ideogram.GenerateImageGptImage25SunburstRequest request); - partial void ProcessPostGenerateImageV2GptImage25SunburstResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostGenerateImageV2GptImage25SunburstResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Generate with GPT Image 2.5 Sunburst
- /// Generate images with GPT Image 2.5 Sunburst, the quality variant of GPT
- /// Image 2.5, with finer detail at higher latency than Flare. Optionally
- /// upload source images as `images` using `multipart/form-data` to edit
- /// them with the prompt. Returns results directly by default; set `async`
- /// or supply a `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageV2GptImage25SunburstAsync( - - global::Ideogram.GenerateImageGptImage25SunburstRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostGenerateImageV2GptImage25SunburstAsResponseAsync( - - request: request, - dryRun: dryRun, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Generate with GPT Image 2.5 Sunburst
- /// Generate images with GPT Image 2.5 Sunburst, the quality variant of GPT
- /// Image 2.5, with finer detail at higher latency than Flare. Optionally
- /// upload source images as `images` using `multipart/form-data` to edit
- /// them with the prompt. Returns results directly by default; set `async`
- /// or supply a `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostGenerateImageV2GptImage25SunburstAsResponseAsync( - - global::Ideogram.GenerateImageGptImage25SunburstRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostGenerateImageV2GptImage25SunburstArguments( - httpClient: HttpClient, - dryRun: ref dryRun, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostGenerateImageV2GptImage25SunburstSecurityRequirements, - operationName: "PostGenerateImageV2GptImage25SunburstAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/image/generate/gpt-image-2-5-sunburst", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - if (request.ImageAssetIdentifiers != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.ImageAssetIdentifiers!, x => x.ToJson(JsonSerializerContext)))}]"), - name: "\"image_asset_identifiers\""); - - } - if (request.Images != default) - { - - for (var __iImages = 0; __iImages < request.Images.Count; __iImages++) - { - var __contentImages = new global::System.Net.Http.ByteArrayContent(request.Images[__iImages]); - __contentImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); - __httpRequestContent.Add( - content: __contentImages, - name: "\"images\"", - fileName: $"\"file{__iImages}.bin\""); - if (__contentImages.Headers.ContentDisposition != null) - { - __contentImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - if (request.MaskAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.MaskAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"mask_asset_identifier\""); - - } - if (request.Mask != default) - { - - var __contentMask = new global::System.Net.Http.ByteArrayContent(request.Mask ?? global::System.Array.Empty()); - __contentMask.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Maskname is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Maskname) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentMask, - name: "\"mask\"", - fileName: request.Maskname != null ? $"\"{request.Maskname}\"" : string.Empty); - if (__contentMask.Headers.ContentDisposition != null) - { - __contentMask.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.Background != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Background).HasValue ? (request.Background).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"background\""); - - } - if (request.Quality != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Quality).HasValue ? (request.Quality).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"quality\""); - - } - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.AspectRatio != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.AspectRatio ?? string.Empty), - name: "\"aspect_ratio\""); - - } - if (request.Resolution != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Resolution ?? string.Empty), - name: "\"resolution\""); - - } - if (request.Async != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"async\""); - - } - if (request.WebhookUrl != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), - name: "\"webhook_url\""); - - } - if (request.Private != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"private\""); - - } - if (request.TargetCollectionId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.TargetCollectionId ?? string.Empty), - name: "\"target_collection_id\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostGenerateImageV2GptImage25SunburstRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - dryRun: dryRun, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2GptImage25Sunburst", - methodName: "PostGenerateImageV2GptImage25SunburstAsync", - pathTemplate: "\"/v2/image/generate/gpt-image-2-5-sunburst\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2GptImage25Sunburst", - methodName: "PostGenerateImageV2GptImage25SunburstAsync", - pathTemplate: "\"/v2/image/generate/gpt-image-2-5-sunburst\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2GptImage25Sunburst", - methodName: "PostGenerateImageV2GptImage25SunburstAsync", - pathTemplate: "\"/v2/image/generate/gpt-image-2-5-sunburst\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostGenerateImageV2GptImage25SunburstResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2GptImage25Sunburst", - methodName: "PostGenerateImageV2GptImage25SunburstAsync", - pathTemplate: "\"/v2/image/generate/gpt-image-2-5-sunburst\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2GptImage25Sunburst", - methodName: "PostGenerateImageV2GptImage25SunburstAsync", - pathTemplate: "\"/v2/image/generate/gpt-image-2-5-sunburst\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 500) - { - string? __content_500 = null; - global::System.Exception? __exception_500 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_500 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_500, - responseBody: __content_500, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostGenerateImageV2GptImage25SunburstResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.GenerateImageGptImage25SunburstResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.GenerateImageGptImage25SunburstResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Generate with GPT Image 2.5 Sunburst
- /// Generate images with GPT Image 2.5 Sunburst, the quality variant of GPT
- /// Image 2.5, with finer detail at higher latency than Flare. Optionally
- /// upload source images as `images` using `multipart/form-data` to edit
- /// them with the prompt. Returns results directly by default; set `async`
- /// or supply a `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// The prompt to generate images from, or the edit instruction to apply when source images are supplied. It is passed to the model as written. - /// - /// - /// Existing upload or generated image assets to edit, by reference. Takes priority over `images` if both are supplied. - /// - /// - /// Optional source images to edit (max 16, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only. - /// - /// - /// An existing upload or generated image asset to use as the mask, by reference. The same rules as `mask` apply. Takes priority over `mask` if both are supplied. - /// - /// - /// An optional mask for the first source image (max 25MB; JPEG, PNG, or WEBP). Multipart requests only. Fully transparent pixels mark the areas to edit. The mask must have the same dimensions as the first source image, and requires source images in the same request. - /// - /// - /// An optional mask for the first source image (max 25MB; JPEG, PNG, or WEBP). Multipart requests only. Fully transparent pixels mark the areas to edit. The mask must have the same dimensions as the first source image, and requires source images in the same request. - /// - /// - /// The output background. `transparent` returns images with an alpha channel, `opaque` forces a solid background, and `auto` lets the model decide from the prompt.
- /// Default Value: auto - /// - /// - /// How much rendering effort the model spends. Lower tiers return sooner and cost less; `auto` lets the model choose, which it currently renders at `high`.
- /// Default Value: auto - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The requested output aspect ratio, for example "1:1", "16:9", or "9:16". Ignored when `resolution` is provided. Defaults to "1:1". - /// - /// - /// Exact output resolution, formatted as "WIDTHxHEIGHT", for example
- /// "2048x2048" or "1920x1088". When provided, this takes precedence
- /// over `aspect_ratio`. The dimensions must satisfy GPT Image 2.5 Sunburst
- /// constraints: each side is a multiple of 16, the largest side is at
- /// most 3840px, the long:short ratio is at most 3:1, and total pixels
- /// are between 655360 and 8294400 inclusive. - /// - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageV2GptImage25SunburstAsync( - string prompt, - bool? dryRun = default, - global::System.Collections.Generic.IList? imageAssetIdentifiers = default, - global::System.Collections.Generic.IList? images = default, - global::Ideogram.AssetIdentifier? maskAssetIdentifier = default, - byte[]? mask = default, - string? maskname = default, - global::Ideogram.GenerateImageGptImage25SunburstRequestBackground? background = default, - global::Ideogram.GenerateImageGptImage25SunburstRequestQuality? quality = default, - int? numImages = default, - int? seed = default, - string? aspectRatio = default, - string? resolution = default, - bool? async = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.GenerateImageGptImage25SunburstRequest - { - Prompt = prompt, - ImageAssetIdentifiers = imageAssetIdentifiers, - Images = images, - MaskAssetIdentifier = maskAssetIdentifier, - Mask = mask, - Maskname = maskname, - Background = background, - Quality = quality, - NumImages = numImages, - Seed = seed, - AspectRatio = aspectRatio, - Resolution = resolution, - Async = async, - WebhookUrl = webhookUrl, - Private = @private, - TargetCollectionId = targetCollectionId, - }; - - return await PostGenerateImageV2GptImage25SunburstAsync( - dryRun: dryRun, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2Ideogram45.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2Ideogram45.g.cs deleted file mode 100644 index a36185d2..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2Ideogram45.g.cs +++ /dev/null @@ -1,1013 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ImagesGenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostGenerateImageV2Ideogram45SecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostGenerateImageV2Ideogram45SecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostGenerateImageV2Ideogram45SecurityRequirement0, - }; - partial void PreparePostGenerateImageV2Ideogram45Arguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? dryRun, - global::Ideogram.GenerateImageIdeogram45Request request); - partial void PreparePostGenerateImageV2Ideogram45Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? dryRun, - global::Ideogram.GenerateImageIdeogram45Request request); - partial void ProcessPostGenerateImageV2Ideogram45Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostGenerateImageV2Ideogram45ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Generate with Ideogram 4.5
- /// Generate images with Ideogram 4.5 from a natural-language or structured
- /// JSON prompt. Optionally upload source images as `images` using
- /// `multipart/form-data` to edit them with the prompt. Returns results
- /// directly by default; set `async` or supply a `webhook_url` to get a
- /// `generation_id` and poll `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageV2Ideogram45Async( - - global::Ideogram.GenerateImageIdeogram45Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostGenerateImageV2Ideogram45AsResponseAsync( - - request: request, - dryRun: dryRun, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Generate with Ideogram 4.5
- /// Generate images with Ideogram 4.5 from a natural-language or structured
- /// JSON prompt. Optionally upload source images as `images` using
- /// `multipart/form-data` to edit them with the prompt. Returns results
- /// directly by default; set `async` or supply a `webhook_url` to get a
- /// `generation_id` and poll `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostGenerateImageV2Ideogram45AsResponseAsync( - - global::Ideogram.GenerateImageIdeogram45Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostGenerateImageV2Ideogram45Arguments( - httpClient: HttpClient, - dryRun: ref dryRun, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostGenerateImageV2Ideogram45SecurityRequirements, - operationName: "PostGenerateImageV2Ideogram45Async"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/image/generate/ideogram-4-5", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - if (request.MagicPrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.MagicPrompt).HasValue ? (request.MagicPrompt).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"magic_prompt\""); - - } - if (request.ImageAssetIdentifiers != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.ImageAssetIdentifiers!, x => x.ToJson(JsonSerializerContext)))}]"), - name: "\"image_asset_identifiers\""); - - } - if (request.Images != default) - { - - for (var __iImages = 0; __iImages < request.Images.Count; __iImages++) - { - var __contentImages = new global::System.Net.Http.ByteArrayContent(request.Images[__iImages]); - __contentImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); - __httpRequestContent.Add( - content: __contentImages, - name: "\"images\"", - fileName: $"\"file{__iImages}.bin\""); - if (__contentImages.Headers.ContentDisposition != null) - { - __contentImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - if (request.MaskAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.MaskAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"mask_asset_identifier\""); - - } - if (request.Mask != default) - { - - var __contentMask = new global::System.Net.Http.ByteArrayContent(request.Mask ?? global::System.Array.Empty()); - __contentMask.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Maskname is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Maskname) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentMask, - name: "\"mask\"", - fileName: request.Maskname != null ? $"\"{request.Maskname}\"" : string.Empty); - if (__contentMask.Headers.ContentDisposition != null) - { - __contentMask.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.Size != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Size ?? string.Empty), - name: "\"size\""); - - } - if (request.Background != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Background).HasValue ? (request.Background).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"background\""); - - } - if (request.Quality != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Quality).HasValue ? (request.Quality).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"quality\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.EnableCopyrightDetection != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"enable_copyright_detection\""); - - } - if (request.Async != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"async\""); - - } - if (request.WebhookUrl != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), - name: "\"webhook_url\""); - - } - if (request.Private != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"private\""); - - } - if (request.TargetCollectionId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.TargetCollectionId ?? string.Empty), - name: "\"target_collection_id\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostGenerateImageV2Ideogram45Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - dryRun: dryRun, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2Ideogram45", - methodName: "PostGenerateImageV2Ideogram45Async", - pathTemplate: "\"/v2/image/generate/ideogram-4-5\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2Ideogram45", - methodName: "PostGenerateImageV2Ideogram45Async", - pathTemplate: "\"/v2/image/generate/ideogram-4-5\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2Ideogram45", - methodName: "PostGenerateImageV2Ideogram45Async", - pathTemplate: "\"/v2/image/generate/ideogram-4-5\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostGenerateImageV2Ideogram45Response( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2Ideogram45", - methodName: "PostGenerateImageV2Ideogram45Async", - pathTemplate: "\"/v2/image/generate/ideogram-4-5\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2Ideogram45", - methodName: "PostGenerateImageV2Ideogram45Async", - pathTemplate: "\"/v2/image/generate/ideogram-4-5\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 500) - { - string? __content_500 = null; - global::System.Exception? __exception_500 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_500 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_500, - responseBody: __content_500, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostGenerateImageV2Ideogram45ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.GenerateImageIdeogram45Response.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.GenerateImageIdeogram45Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Generate with Ideogram 4.5
- /// Generate images with Ideogram 4.5 from a natural-language or structured
- /// JSON prompt. Optionally upload source images as `images` using
- /// `multipart/form-data` to edit them with the prompt. Returns results
- /// directly by default; set `async` or supply a `webhook_url` to get a
- /// `generation_id` and poll `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// The prompt to generate images from, or the edit instruction when
- /// source images are supplied. Natural language or a structured
- /// Ideogram 4.0 JSON prompt. - /// - /// - /// Controls how a natural-language prompt is prepared. `auto` (the
- /// default) and `on` rewrite and expand the prompt before generation.
- /// `off` keeps your wording and only converts it into a structured
- /// prompt. A valid structured JSON prompt skips magic prompt unless
- /// `magic_prompt` is `on`. With source images, every mode converts
- /// the edit instruction into a structured edit prompt.
- /// Default Value: auto - /// - /// - /// Existing upload or generated image assets to transform, by reference. Takes priority over `images` if both are supplied. The first source is the primary image; any further sources are additional references. Supplying sources turns the request into an image-to-image transform. - /// - /// - /// Optional source images to edit (max 5, max 25MB each; JPEG, PNG, or WEBP). The first image is the one being edited; any others are extra references. Multipart requests only. - /// - /// - /// An existing upload or generated image asset to use as the mask, by reference. The same rules as `mask` apply. Takes priority over `mask` if both are supplied. - /// - /// - /// An optional mask that limits the edit to part of the first source image (max 25MB; JPEG, PNG, or WEBP). Multipart requests only. Black marks the area to edit and white the area to keep; values in between are rounded to the nearer of the two. The mask must have the same width and height as the first source image and contain both black and white areas. A masked request can include at most three other source images. With a mask, the output is always the first source image's own size, so `size` cannot be set. - /// - /// - /// An optional mask that limits the edit to part of the first source image (max 25MB; JPEG, PNG, or WEBP). Multipart requests only. Black marks the area to edit and white the area to keep; values in between are rounded to the nearer of the two. The mask must have the same width and height as the first source image and contain both black and white areas. A masked request can include at most three other source images. With a mask, the output is always the first source image's own size, so `size` cannot be set. - /// - /// - /// The output size: "auto", "source" or an exact "WIDTHxHEIGHT".
- /// Without source images, an exact size must be one of the supported
- /// 1K/2K presets (for example 1024x1024, 2048x2048 or 1440x2880);
- /// "auto" or omitted picks a supported size based on the prompt.
- /// "source" is rejected.
- /// With source images, "auto" (the default) picks a supported 2K size
- /// based on the source images and the prompt, and "source" returns the
- /// output at the first source image's own width and height (scaled
- /// down, keeping its proportions, if it is too large for the model).
- /// Every source image's aspect ratio must be between 1:6 and 6:1.
- /// An exact size must have both sides a multiple of 32 and at least
- /// 256px, a total of at most 2048x2048 pixels, and an aspect ratio of
- /// at most 6:1. With source images, an exact size reshapes the source
- /// to it.
- /// Pricing is tiered by the resolved output pixels: up to 1024x1024
- /// bills as 1K, above that as 2K. An "auto" size bills as 2K.
- /// Default Value: auto
- /// Example: 2048x2048 - /// - /// - /// The output background. `transparent` returns images with an alpha channel, `opaque` returns a solid one, and `auto` decides for you.
- /// Default Value: auto - /// - /// - /// The rendering quality to use. Higher quality takes longer and costs more. Defaults to `medium` with source images and `high` without. `very_low`, the fastest and cheapest, requires source images. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. - /// - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageV2Ideogram45Async( - string prompt, - bool? dryRun = default, - global::Ideogram.MagicPromptMode? magicPrompt = default, - global::System.Collections.Generic.IList? imageAssetIdentifiers = default, - global::System.Collections.Generic.IList? images = default, - global::Ideogram.AssetIdentifier? maskAssetIdentifier = default, - byte[]? mask = default, - string? maskname = default, - string? size = default, - global::Ideogram.GenerateImageIdeogram45RequestBackground? background = default, - global::Ideogram.GenerateImageIdeogram45RequestQuality? quality = default, - int? seed = default, - int? numImages = default, - bool? enableCopyrightDetection = default, - bool? async = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.GenerateImageIdeogram45Request - { - Prompt = prompt, - MagicPrompt = magicPrompt, - ImageAssetIdentifiers = imageAssetIdentifiers, - Images = images, - MaskAssetIdentifier = maskAssetIdentifier, - Mask = mask, - Maskname = maskname, - Size = size, - Background = background, - Quality = quality, - Seed = seed, - NumImages = numImages, - EnableCopyrightDetection = enableCopyrightDetection, - Async = async, - WebhookUrl = webhookUrl, - Private = @private, - TargetCollectionId = targetCollectionId, - }; - - return await PostGenerateImageV2Ideogram45Async( - dryRun: dryRun, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2IdeogramV2.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2IdeogramV2.g.cs deleted file mode 100644 index 35cfe0fd..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2IdeogramV2.g.cs +++ /dev/null @@ -1,800 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ImagesGenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostGenerateImageV2IdeogramV2SecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostGenerateImageV2IdeogramV2SecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostGenerateImageV2IdeogramV2SecurityRequirement0, - }; - partial void PreparePostGenerateImageV2IdeogramV2Arguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? dryRun, - global::Ideogram.GenerateImageIdeogramV2Request request); - partial void PreparePostGenerateImageV2IdeogramV2Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? dryRun, - global::Ideogram.GenerateImageIdeogramV2Request request); - partial void ProcessPostGenerateImageV2IdeogramV2Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostGenerateImageV2IdeogramV2ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Generate with Ideogram 2.0
- /// Generate images from a text prompt with Ideogram 2.0. Returns results
- /// directly by default; set `async` or supply a `webhook_url` to get a
- /// `generation_id` and poll `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageV2IdeogramV2Async( - - global::Ideogram.GenerateImageIdeogramV2Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostGenerateImageV2IdeogramV2AsResponseAsync( - - request: request, - dryRun: dryRun, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Generate with Ideogram 2.0
- /// Generate images from a text prompt with Ideogram 2.0. Returns results
- /// directly by default; set `async` or supply a `webhook_url` to get a
- /// `generation_id` and poll `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostGenerateImageV2IdeogramV2AsResponseAsync( - - global::Ideogram.GenerateImageIdeogramV2Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostGenerateImageV2IdeogramV2Arguments( - httpClient: HttpClient, - dryRun: ref dryRun, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostGenerateImageV2IdeogramV2SecurityRequirements, - operationName: "PostGenerateImageV2IdeogramV2Async"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/image/generate/ideogram-2", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostGenerateImageV2IdeogramV2Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - dryRun: dryRun, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2IdeogramV2", - methodName: "PostGenerateImageV2IdeogramV2Async", - pathTemplate: "\"/v2/image/generate/ideogram-2\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2IdeogramV2", - methodName: "PostGenerateImageV2IdeogramV2Async", - pathTemplate: "\"/v2/image/generate/ideogram-2\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2IdeogramV2", - methodName: "PostGenerateImageV2IdeogramV2Async", - pathTemplate: "\"/v2/image/generate/ideogram-2\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostGenerateImageV2IdeogramV2Response( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2IdeogramV2", - methodName: "PostGenerateImageV2IdeogramV2Async", - pathTemplate: "\"/v2/image/generate/ideogram-2\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2IdeogramV2", - methodName: "PostGenerateImageV2IdeogramV2Async", - pathTemplate: "\"/v2/image/generate/ideogram-2\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 500) - { - string? __content_500 = null; - global::System.Exception? __exception_500 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_500 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_500, - responseBody: __content_500, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostGenerateImageV2IdeogramV2ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.GenerateImageIdeogramV2Response.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.GenerateImageIdeogramV2Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Generate with Ideogram 2.0
- /// Generate images from a text prompt with Ideogram 2.0. Returns results
- /// directly by default; set `async` or supply a `webhook_url` to get a
- /// `generation_id` and poll `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// The prompt to generate images from. - /// - /// - /// Description of what to exclude from the images. The prompt takes precedence over the negative prompt. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The aspect ratio for an Ideogram 3.x or 2.x generation. `auto` lets the
- /// model select a ratio from the prompt; any other value pins the ratio.
- /// Cannot be combined with `resolution`. Omitting the field is not `auto`:
- /// it uses `1x1`. - /// - /// - /// The rendering speed to use. `turbo` generates faster at a lower cost, while `quality` prioritizes the highest-quality result.
- /// Default Value: default - /// - /// - /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
- /// Default Value: auto - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// The style type to generate with. When omitted, the model's default styling is used; pass `auto` to have a style selected automatically from the prompt.
- /// Example: realistic - /// - /// - /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. - /// - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageV2IdeogramV2Async( - string prompt, - bool? dryRun = default, - string? negativePrompt = default, - int? seed = default, - global::Ideogram.IdeogramV3AspectRatio? aspectRatio = default, - global::Ideogram.GenerateImageIdeogramV2RequestRenderingSpeed? renderingSpeed = default, - global::Ideogram.MagicPromptMode? magicPrompt = default, - int? numImages = default, - global::Ideogram.IdeogramV2StyleType? styleType = default, - bool? enableCopyrightDetection = default, - bool? async = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.GenerateImageIdeogramV2Request - { - Prompt = prompt, - NegativePrompt = negativePrompt, - Seed = seed, - AspectRatio = aspectRatio, - RenderingSpeed = renderingSpeed, - MagicPrompt = magicPrompt, - NumImages = numImages, - StyleType = styleType, - EnableCopyrightDetection = enableCopyrightDetection, - Async = async, - WebhookUrl = webhookUrl, - Private = @private, - TargetCollectionId = targetCollectionId, - }; - - return await PostGenerateImageV2IdeogramV2Async( - dryRun: dryRun, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2IdeogramV2A.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2IdeogramV2A.g.cs deleted file mode 100644 index 7d789f71..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2IdeogramV2A.g.cs +++ /dev/null @@ -1,798 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ImagesGenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostGenerateImageV2IdeogramV2ASecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostGenerateImageV2IdeogramV2ASecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostGenerateImageV2IdeogramV2ASecurityRequirement0, - }; - partial void PreparePostGenerateImageV2IdeogramV2AArguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? dryRun, - global::Ideogram.GenerateImageIdeogramV2ARequest request); - partial void PreparePostGenerateImageV2IdeogramV2ARequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? dryRun, - global::Ideogram.GenerateImageIdeogramV2ARequest request); - partial void ProcessPostGenerateImageV2IdeogramV2AResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostGenerateImageV2IdeogramV2AResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Generate with Ideogram 2a
- /// Generate images from a text prompt with Ideogram 2a, a fast, lower-cost
- /// model. Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageV2IdeogramV2AAsync( - - global::Ideogram.GenerateImageIdeogramV2ARequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostGenerateImageV2IdeogramV2AAsResponseAsync( - - request: request, - dryRun: dryRun, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Generate with Ideogram 2a
- /// Generate images from a text prompt with Ideogram 2a, a fast, lower-cost
- /// model. Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostGenerateImageV2IdeogramV2AAsResponseAsync( - - global::Ideogram.GenerateImageIdeogramV2ARequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostGenerateImageV2IdeogramV2AArguments( - httpClient: HttpClient, - dryRun: ref dryRun, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostGenerateImageV2IdeogramV2ASecurityRequirements, - operationName: "PostGenerateImageV2IdeogramV2AAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/image/generate/ideogram-2a", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostGenerateImageV2IdeogramV2ARequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - dryRun: dryRun, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2IdeogramV2A", - methodName: "PostGenerateImageV2IdeogramV2AAsync", - pathTemplate: "\"/v2/image/generate/ideogram-2a\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2IdeogramV2A", - methodName: "PostGenerateImageV2IdeogramV2AAsync", - pathTemplate: "\"/v2/image/generate/ideogram-2a\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2IdeogramV2A", - methodName: "PostGenerateImageV2IdeogramV2AAsync", - pathTemplate: "\"/v2/image/generate/ideogram-2a\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostGenerateImageV2IdeogramV2AResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2IdeogramV2A", - methodName: "PostGenerateImageV2IdeogramV2AAsync", - pathTemplate: "\"/v2/image/generate/ideogram-2a\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2IdeogramV2A", - methodName: "PostGenerateImageV2IdeogramV2AAsync", - pathTemplate: "\"/v2/image/generate/ideogram-2a\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 500) - { - string? __content_500 = null; - global::System.Exception? __exception_500 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_500 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_500, - responseBody: __content_500, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostGenerateImageV2IdeogramV2AResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.GenerateImageIdeogramV2AResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.GenerateImageIdeogramV2AResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Generate with Ideogram 2a
- /// Generate images from a text prompt with Ideogram 2a, a fast, lower-cost
- /// model. Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// The prompt to generate images from. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The aspect ratio for an Ideogram 3.x or 2.x generation. `auto` lets the
- /// model select a ratio from the prompt; any other value pins the ratio.
- /// Cannot be combined with `resolution`. Omitting the field is not `auto`:
- /// it uses `1x1`. - /// - /// - /// The rendering speed to use. `turbo` generates faster at a lower cost, while `quality` prioritizes the highest-quality result.
- /// Default Value: default - /// - /// - /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
- /// Default Value: auto - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// The style type to generate with. When omitted, the model's default styling is used; pass `auto` to have a style selected automatically from the prompt.
- /// Example: realistic - /// - /// - /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. - /// - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageV2IdeogramV2AAsync( - string prompt, - bool? dryRun = default, - int? seed = default, - global::Ideogram.IdeogramV3AspectRatio? aspectRatio = default, - global::Ideogram.GenerateImageIdeogramV2ARequestRenderingSpeed? renderingSpeed = default, - global::Ideogram.MagicPromptMode? magicPrompt = default, - int? numImages = default, - global::Ideogram.IdeogramV2StyleType? styleType = default, - bool? enableCopyrightDetection = default, - bool? async = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.GenerateImageIdeogramV2ARequest - { - Prompt = prompt, - Seed = seed, - AspectRatio = aspectRatio, - RenderingSpeed = renderingSpeed, - MagicPrompt = magicPrompt, - NumImages = numImages, - StyleType = styleType, - EnableCopyrightDetection = enableCopyrightDetection, - Async = async, - WebhookUrl = webhookUrl, - Private = @private, - TargetCollectionId = targetCollectionId, - }; - - return await PostGenerateImageV2IdeogramV2AAsync( - dryRun: dryRun, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2IdeogramV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2IdeogramV3.g.cs deleted file mode 100644 index 97aea0da..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2IdeogramV3.g.cs +++ /dev/null @@ -1,1054 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ImagesGenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostGenerateImageV2IdeogramV3SecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostGenerateImageV2IdeogramV3SecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostGenerateImageV2IdeogramV3SecurityRequirement0, - }; - partial void PreparePostGenerateImageV2IdeogramV3Arguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? dryRun, - global::Ideogram.GenerateImageIdeogramV3Request request); - partial void PreparePostGenerateImageV2IdeogramV3Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? dryRun, - global::Ideogram.GenerateImageIdeogramV3Request request); - partial void ProcessPostGenerateImageV2IdeogramV3Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostGenerateImageV2IdeogramV3ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Generate with Ideogram 3.0
- /// Generate images from a text prompt with Ideogram 3.0. Optional style
- /// controls include style codes, a style preset, a color palette, and style
- /// references (uploaded `style_reference_images`). Returns
- /// results directly by default; set `async` or supply a `webhook_url` to
- /// get a `generation_id` and poll `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageV2IdeogramV3Async( - - global::Ideogram.GenerateImageIdeogramV3Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostGenerateImageV2IdeogramV3AsResponseAsync( - - request: request, - dryRun: dryRun, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Generate with Ideogram 3.0
- /// Generate images from a text prompt with Ideogram 3.0. Optional style
- /// controls include style codes, a style preset, a color palette, and style
- /// references (uploaded `style_reference_images`). Returns
- /// results directly by default; set `async` or supply a `webhook_url` to
- /// get a `generation_id` and poll `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostGenerateImageV2IdeogramV3AsResponseAsync( - - global::Ideogram.GenerateImageIdeogramV3Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostGenerateImageV2IdeogramV3Arguments( - httpClient: HttpClient, - dryRun: ref dryRun, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostGenerateImageV2IdeogramV3SecurityRequirements, - operationName: "PostGenerateImageV2IdeogramV3Async"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/image/generate/ideogram-3", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - if (request.NegativePrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.NegativePrompt ?? string.Empty), - name: "\"negative_prompt\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.Resolution != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"resolution\""); - - } - if (request.AspectRatio != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.AspectRatio).HasValue ? (request.AspectRatio).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"aspect_ratio\""); - - } - if (request.RenderingSpeed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"rendering_speed\""); - - } - if (request.MagicPrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.MagicPrompt).HasValue ? (request.MagicPrompt).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"magic_prompt\""); - - } - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.ColorPalette != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ColorPalette.ToString() ?? string.Empty), - name: "\"color_palette\""); - - } - if (request.StyleCodes != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.StyleCodes!, x => x))}]"), - name: "\"style_codes\""); - - } - if (request.StyleType != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.StyleType).HasValue ? (request.StyleType).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"style_type\""); - - } - if (request.StylePreset != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.StylePreset).HasValue ? (request.StylePreset).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"style_preset\""); - - } - if (request.StyleReferenceCollectionId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.StyleReferenceCollectionId ?? string.Empty), - name: "\"style_reference_collection_id\""); - - } - if (request.StyleReferenceCollectionVersionId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.StyleReferenceCollectionVersionId ?? string.Empty), - name: "\"style_reference_collection_version_id\""); - - } - if (request.StyleReferenceAssetIdentifiers != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.StyleReferenceAssetIdentifiers!, x => x.ToJson(JsonSerializerContext)))}]"), - name: "\"style_reference_asset_identifiers\""); - - } - if (request.StyleReferenceImages != default) - { - - for (var __iStyleReferenceImages = 0; __iStyleReferenceImages < request.StyleReferenceImages.Count; __iStyleReferenceImages++) - { - var __contentStyleReferenceImages = new global::System.Net.Http.ByteArrayContent(request.StyleReferenceImages[__iStyleReferenceImages]); - __contentStyleReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); - __httpRequestContent.Add( - content: __contentStyleReferenceImages, - name: "\"style_reference_images\"", - fileName: $"\"file{__iStyleReferenceImages}.bin\""); - if (__contentStyleReferenceImages.Headers.ContentDisposition != null) - { - __contentStyleReferenceImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - if (request.EnableCopyrightDetection != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"enable_copyright_detection\""); - - } - if (request.Async != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"async\""); - - } - if (request.WebhookUrl != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), - name: "\"webhook_url\""); - - } - if (request.Private != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"private\""); - - } - if (request.TargetCollectionId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.TargetCollectionId ?? string.Empty), - name: "\"target_collection_id\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostGenerateImageV2IdeogramV3Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - dryRun: dryRun, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2IdeogramV3", - methodName: "PostGenerateImageV2IdeogramV3Async", - pathTemplate: "\"/v2/image/generate/ideogram-3\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2IdeogramV3", - methodName: "PostGenerateImageV2IdeogramV3Async", - pathTemplate: "\"/v2/image/generate/ideogram-3\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2IdeogramV3", - methodName: "PostGenerateImageV2IdeogramV3Async", - pathTemplate: "\"/v2/image/generate/ideogram-3\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostGenerateImageV2IdeogramV3Response( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2IdeogramV3", - methodName: "PostGenerateImageV2IdeogramV3Async", - pathTemplate: "\"/v2/image/generate/ideogram-3\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2IdeogramV3", - methodName: "PostGenerateImageV2IdeogramV3Async", - pathTemplate: "\"/v2/image/generate/ideogram-3\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 500) - { - string? __content_500 = null; - global::System.Exception? __exception_500 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_500 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_500, - responseBody: __content_500, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostGenerateImageV2IdeogramV3ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.GenerateImageIdeogramV3Response.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.GenerateImageIdeogramV3Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Generate with Ideogram 3.0
- /// Generate images from a text prompt with Ideogram 3.0. Optional style
- /// controls include style codes, a style preset, a color palette, and style
- /// references (uploaded `style_reference_images`). Returns
- /// results directly by default; set `async` or supply a `webhook_url` to
- /// get a `generation_id` and poll `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// The prompt to generate images from. - /// - /// - /// Description of what to exclude from the images. The prompt takes precedence over the negative prompt. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The resolutions supported for Ideogram 3.0.
- /// Example: 1280x800 - /// - /// - /// The aspect ratio for an Ideogram 3.x or 2.x generation. `auto` lets the
- /// model select a ratio from the prompt; any other value pins the ratio.
- /// Cannot be combined with `resolution`. Omitting the field is not `auto`:
- /// it uses `1x1`. - /// - /// - /// The rendering speed to use.
- /// Default Value: default - /// - /// - /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
- /// Default Value: auto - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). - /// - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - /// - /// - /// The style type to generate with.
- /// Default Value: general
- /// Example: general - /// - /// - /// A predefined style preset to apply to the generated images. Cannot be combined with style codes or style references. - /// - /// - /// A saved style to apply, by its URL-safe base64 collection id. Cannot be combined with `style_reference_images`. - /// - /// - /// Optional URL-safe base64 version id of the saved style in `style_reference_collection_id`. Ignored without it. - /// - /// - /// Existing upload or generated image assets to use as style references, by reference. Cannot be combined with `style_reference_collection_id` or `style_reference_images`. - /// - /// - /// Images to use as style references (max 10, max 25MB each; JPEG, PNG, or WEBP). - /// - /// - /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. - /// - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageV2IdeogramV3Async( - string prompt, - bool? dryRun = default, - string? negativePrompt = default, - int? seed = default, - global::Ideogram.ResolutionV3? resolution = default, - global::Ideogram.IdeogramV3AspectRatio? aspectRatio = default, - global::Ideogram.GenerateImageIdeogramV3RequestRenderingSpeed? renderingSpeed = default, - global::Ideogram.MagicPromptMode? magicPrompt = default, - int? numImages = default, - global::Ideogram.IdeogramColorPalette? colorPalette = default, - global::System.Collections.Generic.IList? styleCodes = default, - global::Ideogram.IdeogramV3StyleType? styleType = default, - global::Ideogram.IdeogramV3StylePreset? stylePreset = default, - string? styleReferenceCollectionId = default, - string? styleReferenceCollectionVersionId = default, - global::System.Collections.Generic.IList? styleReferenceAssetIdentifiers = default, - global::System.Collections.Generic.IList? styleReferenceImages = default, - bool? enableCopyrightDetection = default, - bool? async = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.GenerateImageIdeogramV3Request - { - Prompt = prompt, - NegativePrompt = negativePrompt, - Seed = seed, - Resolution = resolution, - AspectRatio = aspectRatio, - RenderingSpeed = renderingSpeed, - MagicPrompt = magicPrompt, - NumImages = numImages, - ColorPalette = colorPalette, - StyleCodes = styleCodes, - StyleType = styleType, - StylePreset = stylePreset, - StyleReferenceCollectionId = styleReferenceCollectionId, - StyleReferenceCollectionVersionId = styleReferenceCollectionVersionId, - StyleReferenceAssetIdentifiers = styleReferenceAssetIdentifiers, - StyleReferenceImages = styleReferenceImages, - EnableCopyrightDetection = enableCopyrightDetection, - Async = async, - WebhookUrl = webhookUrl, - Private = @private, - TargetCollectionId = targetCollectionId, - }; - - return await PostGenerateImageV2IdeogramV3Async( - dryRun: dryRun, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2IdeogramV3Character.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2IdeogramV3Character.g.cs deleted file mode 100644 index 05efdac5..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2IdeogramV3Character.g.cs +++ /dev/null @@ -1,1140 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ImagesGenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostGenerateImageV2IdeogramV3CharacterSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostGenerateImageV2IdeogramV3CharacterSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostGenerateImageV2IdeogramV3CharacterSecurityRequirement0, - }; - partial void PreparePostGenerateImageV2IdeogramV3CharacterArguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? dryRun, - global::Ideogram.GenerateImageIdeogramV3CharacterRequest request); - partial void PreparePostGenerateImageV2IdeogramV3CharacterRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? dryRun, - global::Ideogram.GenerateImageIdeogramV3CharacterRequest request); - partial void ProcessPostGenerateImageV2IdeogramV3CharacterResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostGenerateImageV2IdeogramV3CharacterResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Generate a consistent character with Ideogram 3.0
- /// Generate images featuring a consistent character with Ideogram 3.0.
- /// Upload the character as `character_reference_images` using
- /// `multipart/form-data`. Returns
- /// results directly by default; set `async` or supply a `webhook_url` to
- /// get a `generation_id` and poll `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageV2IdeogramV3CharacterAsync( - - global::Ideogram.GenerateImageIdeogramV3CharacterRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostGenerateImageV2IdeogramV3CharacterAsResponseAsync( - - request: request, - dryRun: dryRun, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Generate a consistent character with Ideogram 3.0
- /// Generate images featuring a consistent character with Ideogram 3.0.
- /// Upload the character as `character_reference_images` using
- /// `multipart/form-data`. Returns
- /// results directly by default; set `async` or supply a `webhook_url` to
- /// get a `generation_id` and poll `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostGenerateImageV2IdeogramV3CharacterAsResponseAsync( - - global::Ideogram.GenerateImageIdeogramV3CharacterRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostGenerateImageV2IdeogramV3CharacterArguments( - httpClient: HttpClient, - dryRun: ref dryRun, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostGenerateImageV2IdeogramV3CharacterSecurityRequirements, - operationName: "PostGenerateImageV2IdeogramV3CharacterAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/image/generate/ideogram-3-character", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - if (request.NegativePrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.NegativePrompt ?? string.Empty), - name: "\"negative_prompt\""); - - } - if (request.CharacterReferenceCollectionId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.CharacterReferenceCollectionId ?? string.Empty), - name: "\"character_reference_collection_id\""); - - } - if (request.CharacterReferenceCollectionVersionId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.CharacterReferenceCollectionVersionId ?? string.Empty), - name: "\"character_reference_collection_version_id\""); - - } - if (request.CharacterReferenceAssetIdentifiers != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.CharacterReferenceAssetIdentifiers!, x => x.ToJson(JsonSerializerContext)))}]"), - name: "\"character_reference_asset_identifiers\""); - - } - if (request.CharacterReferenceImages != default) - { - - for (var __iCharacterReferenceImages = 0; __iCharacterReferenceImages < request.CharacterReferenceImages.Count; __iCharacterReferenceImages++) - { - var __contentCharacterReferenceImages = new global::System.Net.Http.ByteArrayContent(request.CharacterReferenceImages[__iCharacterReferenceImages]); - __contentCharacterReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); - __httpRequestContent.Add( - content: __contentCharacterReferenceImages, - name: "\"character_reference_images\"", - fileName: $"\"file{__iCharacterReferenceImages}.bin\""); - if (__contentCharacterReferenceImages.Headers.ContentDisposition != null) - { - __contentCharacterReferenceImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - if (request.CharacterReferenceMaskAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.CharacterReferenceMaskAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"character_reference_mask_asset_identifier\""); - - } - if (request.CharacterReferenceMask != default) - { - - var __contentCharacterReferenceMask = new global::System.Net.Http.ByteArrayContent(request.CharacterReferenceMask ?? global::System.Array.Empty()); - __contentCharacterReferenceMask.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.CharacterReferenceMaskname is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.CharacterReferenceMaskname) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentCharacterReferenceMask, - name: "\"character_reference_mask\"", - fileName: request.CharacterReferenceMaskname != null ? $"\"{request.CharacterReferenceMaskname}\"" : string.Empty); - if (__contentCharacterReferenceMask.Headers.ContentDisposition != null) - { - __contentCharacterReferenceMask.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.Resolution != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"resolution\""); - - } - if (request.AspectRatio != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.AspectRatio).HasValue ? (request.AspectRatio).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"aspect_ratio\""); - - } - if (request.RenderingSpeed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"rendering_speed\""); - - } - if (request.MagicPrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.MagicPrompt).HasValue ? (request.MagicPrompt).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"magic_prompt\""); - - } - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.StyleType != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.StyleType).HasValue ? (request.StyleType).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"style_type\""); - - } - if (request.StyleReferenceCollectionId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.StyleReferenceCollectionId ?? string.Empty), - name: "\"style_reference_collection_id\""); - - } - if (request.StyleReferenceCollectionVersionId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.StyleReferenceCollectionVersionId ?? string.Empty), - name: "\"style_reference_collection_version_id\""); - - } - if (request.StyleReferenceAssetIdentifiers != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.StyleReferenceAssetIdentifiers!, x => x.ToJson(JsonSerializerContext)))}]"), - name: "\"style_reference_asset_identifiers\""); - - } - if (request.StyleReferenceImages != default) - { - - for (var __iStyleReferenceImages = 0; __iStyleReferenceImages < request.StyleReferenceImages.Count; __iStyleReferenceImages++) - { - var __contentStyleReferenceImages = new global::System.Net.Http.ByteArrayContent(request.StyleReferenceImages[__iStyleReferenceImages]); - __contentStyleReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); - __httpRequestContent.Add( - content: __contentStyleReferenceImages, - name: "\"style_reference_images\"", - fileName: $"\"file{__iStyleReferenceImages}.bin\""); - if (__contentStyleReferenceImages.Headers.ContentDisposition != null) - { - __contentStyleReferenceImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - if (request.EnableCopyrightDetection != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"enable_copyright_detection\""); - - } - if (request.Async != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"async\""); - - } - if (request.WebhookUrl != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), - name: "\"webhook_url\""); - - } - if (request.Private != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"private\""); - - } - if (request.TargetCollectionId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.TargetCollectionId ?? string.Empty), - name: "\"target_collection_id\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostGenerateImageV2IdeogramV3CharacterRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - dryRun: dryRun, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2IdeogramV3Character", - methodName: "PostGenerateImageV2IdeogramV3CharacterAsync", - pathTemplate: "\"/v2/image/generate/ideogram-3-character\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2IdeogramV3Character", - methodName: "PostGenerateImageV2IdeogramV3CharacterAsync", - pathTemplate: "\"/v2/image/generate/ideogram-3-character\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2IdeogramV3Character", - methodName: "PostGenerateImageV2IdeogramV3CharacterAsync", - pathTemplate: "\"/v2/image/generate/ideogram-3-character\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostGenerateImageV2IdeogramV3CharacterResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2IdeogramV3Character", - methodName: "PostGenerateImageV2IdeogramV3CharacterAsync", - pathTemplate: "\"/v2/image/generate/ideogram-3-character\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2IdeogramV3Character", - methodName: "PostGenerateImageV2IdeogramV3CharacterAsync", - pathTemplate: "\"/v2/image/generate/ideogram-3-character\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 500) - { - string? __content_500 = null; - global::System.Exception? __exception_500 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_500 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_500, - responseBody: __content_500, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostGenerateImageV2IdeogramV3CharacterResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.GenerateImageIdeogramV3CharacterResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.GenerateImageIdeogramV3CharacterResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Generate a consistent character with Ideogram 3.0
- /// Generate images featuring a consistent character with Ideogram 3.0.
- /// Upload the character as `character_reference_images` using
- /// `multipart/form-data`. Returns
- /// results directly by default; set `async` or supply a `webhook_url` to
- /// get a `generation_id` and poll `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// The prompt to generate images from. - /// - /// - /// Description of what to exclude from the images. The prompt takes precedence over the negative prompt. - /// - /// - /// A saved character to feature, by its URL-safe base64 collection id. Takes priority over `character_reference_images` if both are supplied. - /// - /// - /// Optional URL-safe base64 version id of the saved character in `character_reference_collection_id`. Ignored without it. - /// - /// - /// An existing upload or generated image asset to use as the character reference, by reference. Takes priority over `character_reference_images` if both are supplied. - /// - /// - /// An image of the character to feature (max 25MB; JPEG, PNG, or WEBP). - /// - /// - /// An existing upload or generated image asset to use as the character reference mask, by reference. The same rules as `character_reference_mask` apply. Takes priority over `character_reference_mask` if both are supplied. - /// - /// - /// Optional grayscale mask marking where the character is in the character reference image, at the same size as that image (JPEG, PNG, or WEBP). Multipart requests only. - /// - /// - /// Optional grayscale mask marking where the character is in the character reference image, at the same size as that image (JPEG, PNG, or WEBP). Multipart requests only. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The resolutions supported for Ideogram 3.0.
- /// Example: 1280x800 - /// - /// - /// The aspect ratio for an Ideogram 3.x or 2.x generation. `auto` lets the
- /// model select a ratio from the prompt; any other value pins the ratio.
- /// Cannot be combined with `resolution`. Omitting the field is not `auto`:
- /// it uses `1x1`. - /// - /// - /// The rendering speed to use.
- /// Default Value: default - /// - /// - /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
- /// Default Value: auto - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// The style type to generate the character with. Defaults to `auto`.
- /// Default Value: auto - /// - /// - /// A saved style to apply, by its URL-safe base64 collection id. Takes priority over `style_reference_images` if both are supplied. - /// - /// - /// Optional URL-safe base64 version id of the saved style in `style_reference_collection_id`. Ignored without it. - /// - /// - /// Existing upload or generated image assets to use as style references, by reference. Takes priority over `style_reference_images` if both are supplied. - /// - /// - /// Images to use as style references (max 10, max 25MB each; JPEG, PNG, or WEBP). - /// - /// - /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. - /// - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageV2IdeogramV3CharacterAsync( - string prompt, - bool? dryRun = default, - string? negativePrompt = default, - string? characterReferenceCollectionId = default, - string? characterReferenceCollectionVersionId = default, - global::System.Collections.Generic.IList? characterReferenceAssetIdentifiers = default, - global::System.Collections.Generic.IList? characterReferenceImages = default, - global::Ideogram.AssetIdentifier? characterReferenceMaskAssetIdentifier = default, - byte[]? characterReferenceMask = default, - string? characterReferenceMaskname = default, - int? seed = default, - global::Ideogram.ResolutionV3? resolution = default, - global::Ideogram.IdeogramV3AspectRatio? aspectRatio = default, - global::Ideogram.GenerateImageIdeogramV3CharacterRequestRenderingSpeed? renderingSpeed = default, - global::Ideogram.MagicPromptMode? magicPrompt = default, - int? numImages = default, - global::Ideogram.GenerateImageIdeogramV3CharacterRequestStyleType? styleType = default, - string? styleReferenceCollectionId = default, - string? styleReferenceCollectionVersionId = default, - global::System.Collections.Generic.IList? styleReferenceAssetIdentifiers = default, - global::System.Collections.Generic.IList? styleReferenceImages = default, - bool? enableCopyrightDetection = default, - bool? async = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.GenerateImageIdeogramV3CharacterRequest - { - Prompt = prompt, - NegativePrompt = negativePrompt, - CharacterReferenceCollectionId = characterReferenceCollectionId, - CharacterReferenceCollectionVersionId = characterReferenceCollectionVersionId, - CharacterReferenceAssetIdentifiers = characterReferenceAssetIdentifiers, - CharacterReferenceImages = characterReferenceImages, - CharacterReferenceMaskAssetIdentifier = characterReferenceMaskAssetIdentifier, - CharacterReferenceMask = characterReferenceMask, - CharacterReferenceMaskname = characterReferenceMaskname, - Seed = seed, - Resolution = resolution, - AspectRatio = aspectRatio, - RenderingSpeed = renderingSpeed, - MagicPrompt = magicPrompt, - NumImages = numImages, - StyleType = styleType, - StyleReferenceCollectionId = styleReferenceCollectionId, - StyleReferenceCollectionVersionId = styleReferenceCollectionVersionId, - StyleReferenceAssetIdentifiers = styleReferenceAssetIdentifiers, - StyleReferenceImages = styleReferenceImages, - EnableCopyrightDetection = enableCopyrightDetection, - Async = async, - WebhookUrl = webhookUrl, - Private = @private, - TargetCollectionId = targetCollectionId, - }; - - return await PostGenerateImageV2IdeogramV3CharacterAsync( - dryRun: dryRun, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2IdeogramV3CustomModel.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2IdeogramV3CustomModel.g.cs deleted file mode 100644 index b780aaf5..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2IdeogramV3CustomModel.g.cs +++ /dev/null @@ -1,1065 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ImagesGenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostGenerateImageV2IdeogramV3CustomModelSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostGenerateImageV2IdeogramV3CustomModelSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostGenerateImageV2IdeogramV3CustomModelSecurityRequirement0, - }; - partial void PreparePostGenerateImageV2IdeogramV3CustomModelArguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? dryRun, - global::Ideogram.GenerateImageIdeogramV3CustomModelRequest request); - partial void PreparePostGenerateImageV2IdeogramV3CustomModelRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? dryRun, - global::Ideogram.GenerateImageIdeogramV3CustomModelRequest request); - partial void ProcessPostGenerateImageV2IdeogramV3CustomModelResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostGenerateImageV2IdeogramV3CustomModelResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Generate with a custom Ideogram 3.0 model
- /// Generate images with a custom Ideogram 3.0 model that you or your
- /// organization can access, selected by `custom_model_uri`. Returns results
- /// directly by default; set `async` or supply a `webhook_url` to get a
- /// `generation_id` and poll `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageV2IdeogramV3CustomModelAsync( - - global::Ideogram.GenerateImageIdeogramV3CustomModelRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostGenerateImageV2IdeogramV3CustomModelAsResponseAsync( - - request: request, - dryRun: dryRun, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Generate with a custom Ideogram 3.0 model
- /// Generate images with a custom Ideogram 3.0 model that you or your
- /// organization can access, selected by `custom_model_uri`. Returns results
- /// directly by default; set `async` or supply a `webhook_url` to get a
- /// `generation_id` and poll `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostGenerateImageV2IdeogramV3CustomModelAsResponseAsync( - - global::Ideogram.GenerateImageIdeogramV3CustomModelRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostGenerateImageV2IdeogramV3CustomModelArguments( - httpClient: HttpClient, - dryRun: ref dryRun, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostGenerateImageV2IdeogramV3CustomModelSecurityRequirements, - operationName: "PostGenerateImageV2IdeogramV3CustomModelAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/image/generate/ideogram-3-custom-model", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.CustomModelUri ?? string.Empty), - name: "\"custom_model_uri\""); - - if (request.TransparentBackground != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.TransparentBackground, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"transparent_background\""); - - } - if (request.NegativePrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.NegativePrompt ?? string.Empty), - name: "\"negative_prompt\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.Resolution != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"resolution\""); - - } - if (request.AspectRatio != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.AspectRatio).HasValue ? (request.AspectRatio).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"aspect_ratio\""); - - } - if (request.RenderingSpeed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"rendering_speed\""); - - } - if (request.MagicPrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.MagicPrompt).HasValue ? (request.MagicPrompt).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"magic_prompt\""); - - } - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.ColorPalette != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ColorPalette.ToString() ?? string.Empty), - name: "\"color_palette\""); - - } - if (request.StyleCodes != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.StyleCodes!, x => x))}]"), - name: "\"style_codes\""); - - } - if (request.StylePreset != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.StylePreset).HasValue ? (request.StylePreset).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"style_preset\""); - - } - if (request.StyleReferenceAssetIdentifiers != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.StyleReferenceAssetIdentifiers!, x => x.ToJson(JsonSerializerContext)))}]"), - name: "\"style_reference_asset_identifiers\""); - - } - if (request.StyleReferenceImages != default) - { - - for (var __iStyleReferenceImages = 0; __iStyleReferenceImages < request.StyleReferenceImages.Count; __iStyleReferenceImages++) - { - var __contentStyleReferenceImages = new global::System.Net.Http.ByteArrayContent(request.StyleReferenceImages[__iStyleReferenceImages]); - __contentStyleReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); - __httpRequestContent.Add( - content: __contentStyleReferenceImages, - name: "\"style_reference_images\"", - fileName: $"\"file{__iStyleReferenceImages}.bin\""); - if (__contentStyleReferenceImages.Headers.ContentDisposition != null) - { - __contentStyleReferenceImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - if (request.EnableCopyrightDetection != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"enable_copyright_detection\""); - - } - if (request.Async != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"async\""); - - } - if (request.WebhookUrl != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), - name: "\"webhook_url\""); - - } - if (request.Private != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"private\""); - - } - if (request.TargetCollectionId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.TargetCollectionId ?? string.Empty), - name: "\"target_collection_id\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostGenerateImageV2IdeogramV3CustomModelRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - dryRun: dryRun, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2IdeogramV3CustomModel", - methodName: "PostGenerateImageV2IdeogramV3CustomModelAsync", - pathTemplate: "\"/v2/image/generate/ideogram-3-custom-model\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2IdeogramV3CustomModel", - methodName: "PostGenerateImageV2IdeogramV3CustomModelAsync", - pathTemplate: "\"/v2/image/generate/ideogram-3-custom-model\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2IdeogramV3CustomModel", - methodName: "PostGenerateImageV2IdeogramV3CustomModelAsync", - pathTemplate: "\"/v2/image/generate/ideogram-3-custom-model\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostGenerateImageV2IdeogramV3CustomModelResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2IdeogramV3CustomModel", - methodName: "PostGenerateImageV2IdeogramV3CustomModelAsync", - pathTemplate: "\"/v2/image/generate/ideogram-3-custom-model\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2IdeogramV3CustomModel", - methodName: "PostGenerateImageV2IdeogramV3CustomModelAsync", - pathTemplate: "\"/v2/image/generate/ideogram-3-custom-model\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 500) - { - string? __content_500 = null; - global::System.Exception? __exception_500 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_500 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_500, - responseBody: __content_500, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostGenerateImageV2IdeogramV3CustomModelResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.GenerateImageIdeogramV3CustomModelResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.GenerateImageIdeogramV3CustomModelResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Generate with a custom Ideogram 3.0 model
- /// Generate images with a custom Ideogram 3.0 model that you or your
- /// organization can access, selected by `custom_model_uri`. Returns results
- /// directly by default; set `async` or supply a `webhook_url` to get a
- /// `generation_id` and poll `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// The prompt to generate images from. - /// - /// - /// The custom model URI, in the form `model/<model_name>/version/<version_name>`. You or your organization must have access to the model. The model determines which rendering speeds are supported and whether backgrounds are removed automatically.
- /// Example: model/my-custom-model/version/1 - /// - /// - /// Remove the background after generation and return transparent PNG images. Included in the custom model generation price at no extra charge. When false, the model's automatic background removal behavior still applies.
- /// Default Value: false - /// - /// - /// Description of what to exclude from the images. The prompt takes precedence over the negative prompt. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The resolutions supported for Ideogram 3.0.
- /// Example: 1280x800 - /// - /// - /// The aspect ratio for an Ideogram 3.x or 2.x generation. `auto` lets the
- /// model select a ratio from the prompt; any other value pins the ratio.
- /// Cannot be combined with `resolution`. Omitting the field is not `auto`:
- /// it uses `1x1`. - /// - /// - /// The rendering speed to use. When omitted, a speed supported by the custom model is used. - /// - /// - /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
- /// Default Value: auto - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). - /// - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - /// - /// - /// A predefined style preset to apply to the generated images. Cannot be combined with style codes or style references. - /// - /// - /// Existing upload or generated image assets to use as style references, by reference. Cannot be combined with `style_reference_images`. - /// - /// - /// Images to use as style references (max 10, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only. - /// - /// - /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. - /// - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageV2IdeogramV3CustomModelAsync( - string prompt, - string customModelUri, - bool? dryRun = default, - bool? transparentBackground = default, - string? negativePrompt = default, - int? seed = default, - global::Ideogram.ResolutionV3? resolution = default, - global::Ideogram.IdeogramV3AspectRatio? aspectRatio = default, - global::Ideogram.GenerateImageIdeogramV3CustomModelRequestRenderingSpeed? renderingSpeed = default, - global::Ideogram.MagicPromptMode? magicPrompt = default, - int? numImages = default, - global::Ideogram.IdeogramColorPalette? colorPalette = default, - global::System.Collections.Generic.IList? styleCodes = default, - global::Ideogram.IdeogramV3StylePreset? stylePreset = default, - global::System.Collections.Generic.IList? styleReferenceAssetIdentifiers = default, - global::System.Collections.Generic.IList? styleReferenceImages = default, - bool? enableCopyrightDetection = default, - bool? async = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.GenerateImageIdeogramV3CustomModelRequest - { - Prompt = prompt, - CustomModelUri = customModelUri, - TransparentBackground = transparentBackground, - NegativePrompt = negativePrompt, - Seed = seed, - Resolution = resolution, - AspectRatio = aspectRatio, - RenderingSpeed = renderingSpeed, - MagicPrompt = magicPrompt, - NumImages = numImages, - ColorPalette = colorPalette, - StyleCodes = styleCodes, - StylePreset = stylePreset, - StyleReferenceAssetIdentifiers = styleReferenceAssetIdentifiers, - StyleReferenceImages = styleReferenceImages, - EnableCopyrightDetection = enableCopyrightDetection, - Async = async, - WebhookUrl = webhookUrl, - Private = @private, - TargetCollectionId = targetCollectionId, - }; - - return await PostGenerateImageV2IdeogramV3CustomModelAsync( - dryRun: dryRun, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2IdeogramV3Transparent.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2IdeogramV3Transparent.g.cs deleted file mode 100644 index adf4f9c1..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2IdeogramV3Transparent.g.cs +++ /dev/null @@ -1,803 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ImagesGenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostGenerateImageV2IdeogramV3TransparentSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostGenerateImageV2IdeogramV3TransparentSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostGenerateImageV2IdeogramV3TransparentSecurityRequirement0, - }; - partial void PreparePostGenerateImageV2IdeogramV3TransparentArguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? dryRun, - global::Ideogram.GenerateImageIdeogramV3TransparentRequest request); - partial void PreparePostGenerateImageV2IdeogramV3TransparentRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? dryRun, - global::Ideogram.GenerateImageIdeogramV3TransparentRequest request); - partial void ProcessPostGenerateImageV2IdeogramV3TransparentResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostGenerateImageV2IdeogramV3TransparentResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Generate transparent images with Ideogram 3.0
- /// Generate images on a transparent background with Ideogram 3.0, delivered
- /// as PNGs with alpha. Returns results directly by default; set `async` or
- /// supply a `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageV2IdeogramV3TransparentAsync( - - global::Ideogram.GenerateImageIdeogramV3TransparentRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostGenerateImageV2IdeogramV3TransparentAsResponseAsync( - - request: request, - dryRun: dryRun, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Generate transparent images with Ideogram 3.0
- /// Generate images on a transparent background with Ideogram 3.0, delivered
- /// as PNGs with alpha. Returns results directly by default; set `async` or
- /// supply a `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostGenerateImageV2IdeogramV3TransparentAsResponseAsync( - - global::Ideogram.GenerateImageIdeogramV3TransparentRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostGenerateImageV2IdeogramV3TransparentArguments( - httpClient: HttpClient, - dryRun: ref dryRun, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostGenerateImageV2IdeogramV3TransparentSecurityRequirements, - operationName: "PostGenerateImageV2IdeogramV3TransparentAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/image/generate/ideogram-3-transparent", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostGenerateImageV2IdeogramV3TransparentRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - dryRun: dryRun, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2IdeogramV3Transparent", - methodName: "PostGenerateImageV2IdeogramV3TransparentAsync", - pathTemplate: "\"/v2/image/generate/ideogram-3-transparent\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2IdeogramV3Transparent", - methodName: "PostGenerateImageV2IdeogramV3TransparentAsync", - pathTemplate: "\"/v2/image/generate/ideogram-3-transparent\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2IdeogramV3Transparent", - methodName: "PostGenerateImageV2IdeogramV3TransparentAsync", - pathTemplate: "\"/v2/image/generate/ideogram-3-transparent\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostGenerateImageV2IdeogramV3TransparentResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2IdeogramV3Transparent", - methodName: "PostGenerateImageV2IdeogramV3TransparentAsync", - pathTemplate: "\"/v2/image/generate/ideogram-3-transparent\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2IdeogramV3Transparent", - methodName: "PostGenerateImageV2IdeogramV3TransparentAsync", - pathTemplate: "\"/v2/image/generate/ideogram-3-transparent\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 500) - { - string? __content_500 = null; - global::System.Exception? __exception_500 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_500 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_500, - responseBody: __content_500, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostGenerateImageV2IdeogramV3TransparentResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.GenerateImageIdeogramV3TransparentResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.GenerateImageIdeogramV3TransparentResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Generate transparent images with Ideogram 3.0
- /// Generate images on a transparent background with Ideogram 3.0, delivered
- /// as PNGs with alpha. Returns results directly by default; set `async` or
- /// supply a `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// The prompt to generate images from. - /// - /// - /// Description of what to exclude from the images. The prompt takes precedence over the negative prompt. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// Optional enhancement factor applied after generation. `x1` (the default) delivers the base render.
- /// Default Value: x1 - /// - /// - /// The aspect ratio for an Ideogram 3.x or 2.x generation. `auto` lets the
- /// model select a ratio from the prompt; any other value pins the ratio.
- /// Cannot be combined with `resolution`. Omitting the field is not `auto`:
- /// it uses `1x1`. - /// - /// - /// The rendering speed to use.
- /// Default Value: default - /// - /// - /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
- /// Default Value: auto - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. - /// - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageV2IdeogramV3TransparentAsync( - string prompt, - bool? dryRun = default, - string? negativePrompt = default, - int? seed = default, - global::Ideogram.GenerateImageIdeogramV3TransparentRequestUpscaleFactor? upscaleFactor = default, - global::Ideogram.IdeogramV3AspectRatio? aspectRatio = default, - global::Ideogram.GenerateImageIdeogramV3TransparentRequestRenderingSpeed? renderingSpeed = default, - global::Ideogram.MagicPromptMode? magicPrompt = default, - int? numImages = default, - bool? enableCopyrightDetection = default, - bool? async = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.GenerateImageIdeogramV3TransparentRequest - { - Prompt = prompt, - NegativePrompt = negativePrompt, - Seed = seed, - UpscaleFactor = upscaleFactor, - AspectRatio = aspectRatio, - RenderingSpeed = renderingSpeed, - MagicPrompt = magicPrompt, - NumImages = numImages, - EnableCopyrightDetection = enableCopyrightDetection, - Async = async, - WebhookUrl = webhookUrl, - Private = @private, - TargetCollectionId = targetCollectionId, - }; - - return await PostGenerateImageV2IdeogramV3TransparentAsync( - dryRun: dryRun, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2IdeogramV4.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2IdeogramV4.g.cs deleted file mode 100644 index b7fc36b9..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2IdeogramV4.g.cs +++ /dev/null @@ -1,797 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ImagesGenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostGenerateImageV2IdeogramV4SecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostGenerateImageV2IdeogramV4SecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostGenerateImageV2IdeogramV4SecurityRequirement0, - }; - partial void PreparePostGenerateImageV2IdeogramV4Arguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? dryRun, - global::Ideogram.GenerateImageIdeogramV4Request request); - partial void PreparePostGenerateImageV2IdeogramV4Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? dryRun, - global::Ideogram.GenerateImageIdeogramV4Request request); - partial void ProcessPostGenerateImageV2IdeogramV4Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostGenerateImageV2IdeogramV4ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Generate with Ideogram 4.0
- /// Generate images with Ideogram 4.0 from a natural-language or structured
- /// JSON prompt. Returns results directly by default; set `async` or supply
- /// a `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageV2IdeogramV4Async( - - global::Ideogram.GenerateImageIdeogramV4Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostGenerateImageV2IdeogramV4AsResponseAsync( - - request: request, - dryRun: dryRun, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Generate with Ideogram 4.0
- /// Generate images with Ideogram 4.0 from a natural-language or structured
- /// JSON prompt. Returns results directly by default; set `async` or supply
- /// a `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostGenerateImageV2IdeogramV4AsResponseAsync( - - global::Ideogram.GenerateImageIdeogramV4Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostGenerateImageV2IdeogramV4Arguments( - httpClient: HttpClient, - dryRun: ref dryRun, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostGenerateImageV2IdeogramV4SecurityRequirements, - operationName: "PostGenerateImageV2IdeogramV4Async"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/image/generate/ideogram-4", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostGenerateImageV2IdeogramV4Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - dryRun: dryRun, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2IdeogramV4", - methodName: "PostGenerateImageV2IdeogramV4Async", - pathTemplate: "\"/v2/image/generate/ideogram-4\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2IdeogramV4", - methodName: "PostGenerateImageV2IdeogramV4Async", - pathTemplate: "\"/v2/image/generate/ideogram-4\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2IdeogramV4", - methodName: "PostGenerateImageV2IdeogramV4Async", - pathTemplate: "\"/v2/image/generate/ideogram-4\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostGenerateImageV2IdeogramV4Response( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2IdeogramV4", - methodName: "PostGenerateImageV2IdeogramV4Async", - pathTemplate: "\"/v2/image/generate/ideogram-4\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2IdeogramV4", - methodName: "PostGenerateImageV2IdeogramV4Async", - pathTemplate: "\"/v2/image/generate/ideogram-4\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 500) - { - string? __content_500 = null; - global::System.Exception? __exception_500 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_500 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_500, - responseBody: __content_500, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostGenerateImageV2IdeogramV4ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.GenerateImageIdeogramV4Response.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.GenerateImageIdeogramV4Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Generate with Ideogram 4.0
- /// Generate images with Ideogram 4.0 from a natural-language or structured
- /// JSON prompt. Returns results directly by default; set `async` or supply
- /// a `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// The prompt to generate images from, in natural language or as a
- /// structured Ideogram 4.0 JSON prompt. A structured JSON prompt is
- /// used as is and skips magic prompt unless `magic_prompt` is `on`. - /// - /// - /// Controls how a natural-language prompt is prepared. `auto` (the
- /// default) and `on` rewrite and expand the prompt before generation.
- /// `off` keeps your wording and only converts it into a structured
- /// prompt. A valid structured JSON prompt skips magic prompt unless
- /// `magic_prompt` is `on`.
- /// Default Value: auto - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Optional. When supplied, the images are generated at this
- /// resolution. When omitted, an aspect ratio is picked automatically
- /// based on the prompt. - /// - /// - /// The rendering speed to use.
- /// Default Value: default - /// - /// - /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. - /// - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageV2IdeogramV4Async( - string prompt, - bool? dryRun = default, - global::Ideogram.MagicPromptMode? magicPrompt = default, - int? seed = default, - int? numImages = default, - global::Ideogram.ResolutionV4? resolution = default, - global::Ideogram.GenerateImageIdeogramV4RequestRenderingSpeed? renderingSpeed = default, - bool? enableCopyrightDetection = default, - bool? async = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.GenerateImageIdeogramV4Request - { - Prompt = prompt, - MagicPrompt = magicPrompt, - Seed = seed, - NumImages = numImages, - Resolution = resolution, - RenderingSpeed = renderingSpeed, - EnableCopyrightDetection = enableCopyrightDetection, - Async = async, - WebhookUrl = webhookUrl, - Private = @private, - TargetCollectionId = targetCollectionId, - }; - - return await PostGenerateImageV2IdeogramV4Async( - dryRun: dryRun, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2IdeogramV4CustomModel.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2IdeogramV4CustomModel.g.cs deleted file mode 100644 index 7da471a4..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2IdeogramV4CustomModel.g.cs +++ /dev/null @@ -1,846 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ImagesGenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostGenerateImageV2IdeogramV4CustomModelSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostGenerateImageV2IdeogramV4CustomModelSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostGenerateImageV2IdeogramV4CustomModelSecurityRequirement0, - }; - partial void PreparePostGenerateImageV2IdeogramV4CustomModelArguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? dryRun, - global::Ideogram.GenerateImageIdeogramV4CustomModelRequest request); - partial void PreparePostGenerateImageV2IdeogramV4CustomModelRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? dryRun, - global::Ideogram.GenerateImageIdeogramV4CustomModelRequest request); - partial void ProcessPostGenerateImageV2IdeogramV4CustomModelResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostGenerateImageV2IdeogramV4CustomModelResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Generate with a custom Ideogram 4.0 model
- /// Generate images with a custom Ideogram 4.0 model that you or your
- /// organization can access, selected by `custom_model_uri`. Returns results
- /// directly by default; set `async` or supply a `webhook_url` to get a
- /// `generation_id` and poll `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageV2IdeogramV4CustomModelAsync( - - global::Ideogram.GenerateImageIdeogramV4CustomModelRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostGenerateImageV2IdeogramV4CustomModelAsResponseAsync( - - request: request, - dryRun: dryRun, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Generate with a custom Ideogram 4.0 model
- /// Generate images with a custom Ideogram 4.0 model that you or your
- /// organization can access, selected by `custom_model_uri`. Returns results
- /// directly by default; set `async` or supply a `webhook_url` to get a
- /// `generation_id` and poll `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostGenerateImageV2IdeogramV4CustomModelAsResponseAsync( - - global::Ideogram.GenerateImageIdeogramV4CustomModelRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostGenerateImageV2IdeogramV4CustomModelArguments( - httpClient: HttpClient, - dryRun: ref dryRun, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostGenerateImageV2IdeogramV4CustomModelSecurityRequirements, - operationName: "PostGenerateImageV2IdeogramV4CustomModelAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/image/generate/ideogram-4-custom-model", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostGenerateImageV2IdeogramV4CustomModelRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - dryRun: dryRun, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2IdeogramV4CustomModel", - methodName: "PostGenerateImageV2IdeogramV4CustomModelAsync", - pathTemplate: "\"/v2/image/generate/ideogram-4-custom-model\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2IdeogramV4CustomModel", - methodName: "PostGenerateImageV2IdeogramV4CustomModelAsync", - pathTemplate: "\"/v2/image/generate/ideogram-4-custom-model\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2IdeogramV4CustomModel", - methodName: "PostGenerateImageV2IdeogramV4CustomModelAsync", - pathTemplate: "\"/v2/image/generate/ideogram-4-custom-model\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostGenerateImageV2IdeogramV4CustomModelResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2IdeogramV4CustomModel", - methodName: "PostGenerateImageV2IdeogramV4CustomModelAsync", - pathTemplate: "\"/v2/image/generate/ideogram-4-custom-model\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2IdeogramV4CustomModel", - methodName: "PostGenerateImageV2IdeogramV4CustomModelAsync", - pathTemplate: "\"/v2/image/generate/ideogram-4-custom-model\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 500) - { - string? __content_500 = null; - global::System.Exception? __exception_500 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_500 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_500, - responseBody: __content_500, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostGenerateImageV2IdeogramV4CustomModelResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.GenerateImageIdeogramV4CustomModelResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.GenerateImageIdeogramV4CustomModelResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Generate with a custom Ideogram 4.0 model
- /// Generate images with a custom Ideogram 4.0 model that you or your
- /// organization can access, selected by `custom_model_uri`. Returns results
- /// directly by default; set `async` or supply a `webhook_url` to get a
- /// `generation_id` and poll `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// The prompt to generate images from, in natural language or as a
- /// structured Ideogram 4.0 JSON prompt. A structured JSON prompt is
- /// used as is and skips magic prompt unless `magic_prompt` is `on`. - /// - /// - /// The custom model URI, in the form `model/<model_name>/version/<version_name>`. You or your organization must have access to the model. The model determines which rendering speeds are supported.
- /// Example: model/my-custom-v4-model/version/1 - /// - /// - /// Remove the background after generation and return transparent PNG images. Included in the custom model generation price at no extra charge. When false, the model's automatic background removal behavior still applies.
- /// Default Value: false - /// - /// - /// Custom models whose pLoRA checkpoints are fused beneath the `custom_model_uri` model, in list order: the first entry is applied first and `custom_model_uri` last. Every entry must be an accessible Ideogram 4.0 LoRA with a registered checkpoint and must not repeat `custom_model_uri`.
- /// Example: [{"custom_model_uri":"model/my-base-plora/version/1","weight":0.5}] - /// - /// - /// Controls how a natural-language prompt is prepared. `auto` (the
- /// default) and `on` rewrite and expand the prompt before generation.
- /// `off` keeps your wording and only converts it into a structured
- /// prompt. A valid structured JSON prompt skips magic prompt unless
- /// `magic_prompt` is `on`.
- /// Default Value: auto - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Optional. When supplied, the images are generated at this
- /// resolution. When omitted, an aspect ratio is picked automatically
- /// based on the prompt. - /// - /// - /// The rendering speed to use. When omitted, a speed supported by the custom model is used. - /// - /// - /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. - /// - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageV2IdeogramV4CustomModelAsync( - string prompt, - string customModelUri, - bool? dryRun = default, - bool? transparentBackground = default, - global::System.Collections.Generic.IList? stackedCustomModels = default, - global::Ideogram.MagicPromptMode? magicPrompt = default, - int? seed = default, - int? numImages = default, - global::Ideogram.ResolutionV4? resolution = default, - global::Ideogram.GenerateImageIdeogramV4CustomModelRequestRenderingSpeed? renderingSpeed = default, - bool? enableCopyrightDetection = default, - bool? async = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.GenerateImageIdeogramV4CustomModelRequest - { - Prompt = prompt, - CustomModelUri = customModelUri, - TransparentBackground = transparentBackground, - StackedCustomModels = stackedCustomModels, - MagicPrompt = magicPrompt, - Seed = seed, - NumImages = numImages, - Resolution = resolution, - RenderingSpeed = renderingSpeed, - EnableCopyrightDetection = enableCopyrightDetection, - Async = async, - WebhookUrl = webhookUrl, - Private = @private, - TargetCollectionId = targetCollectionId, - }; - - return await PostGenerateImageV2IdeogramV4CustomModelAsync( - dryRun: dryRun, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2IdeogramV4Transparent.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2IdeogramV4Transparent.g.cs deleted file mode 100644 index 612eccc8..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2IdeogramV4Transparent.g.cs +++ /dev/null @@ -1,808 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ImagesGenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostGenerateImageV2IdeogramV4TransparentSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostGenerateImageV2IdeogramV4TransparentSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostGenerateImageV2IdeogramV4TransparentSecurityRequirement0, - }; - partial void PreparePostGenerateImageV2IdeogramV4TransparentArguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? dryRun, - global::Ideogram.GenerateImageIdeogramV4TransparentRequest request); - partial void PreparePostGenerateImageV2IdeogramV4TransparentRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? dryRun, - global::Ideogram.GenerateImageIdeogramV4TransparentRequest request); - partial void ProcessPostGenerateImageV2IdeogramV4TransparentResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostGenerateImageV2IdeogramV4TransparentResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Generate transparent images with Ideogram 4.0
- /// Generate images on a transparent background with Ideogram 4.0, delivered
- /// as PNGs with alpha. Returns results directly by default; set `async` or
- /// supply a `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageV2IdeogramV4TransparentAsync( - - global::Ideogram.GenerateImageIdeogramV4TransparentRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostGenerateImageV2IdeogramV4TransparentAsResponseAsync( - - request: request, - dryRun: dryRun, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Generate transparent images with Ideogram 4.0
- /// Generate images on a transparent background with Ideogram 4.0, delivered
- /// as PNGs with alpha. Returns results directly by default; set `async` or
- /// supply a `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostGenerateImageV2IdeogramV4TransparentAsResponseAsync( - - global::Ideogram.GenerateImageIdeogramV4TransparentRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostGenerateImageV2IdeogramV4TransparentArguments( - httpClient: HttpClient, - dryRun: ref dryRun, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostGenerateImageV2IdeogramV4TransparentSecurityRequirements, - operationName: "PostGenerateImageV2IdeogramV4TransparentAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/image/generate/ideogram-4-transparent", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostGenerateImageV2IdeogramV4TransparentRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - dryRun: dryRun, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2IdeogramV4Transparent", - methodName: "PostGenerateImageV2IdeogramV4TransparentAsync", - pathTemplate: "\"/v2/image/generate/ideogram-4-transparent\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2IdeogramV4Transparent", - methodName: "PostGenerateImageV2IdeogramV4TransparentAsync", - pathTemplate: "\"/v2/image/generate/ideogram-4-transparent\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2IdeogramV4Transparent", - methodName: "PostGenerateImageV2IdeogramV4TransparentAsync", - pathTemplate: "\"/v2/image/generate/ideogram-4-transparent\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostGenerateImageV2IdeogramV4TransparentResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2IdeogramV4Transparent", - methodName: "PostGenerateImageV2IdeogramV4TransparentAsync", - pathTemplate: "\"/v2/image/generate/ideogram-4-transparent\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2IdeogramV4Transparent", - methodName: "PostGenerateImageV2IdeogramV4TransparentAsync", - pathTemplate: "\"/v2/image/generate/ideogram-4-transparent\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 500) - { - string? __content_500 = null; - global::System.Exception? __exception_500 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_500 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_500, - responseBody: __content_500, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostGenerateImageV2IdeogramV4TransparentResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.GenerateImageIdeogramV4TransparentResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.GenerateImageIdeogramV4TransparentResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Generate transparent images with Ideogram 4.0
- /// Generate images on a transparent background with Ideogram 4.0, delivered
- /// as PNGs with alpha. Returns results directly by default; set `async` or
- /// supply a `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// The prompt to generate images from, in natural language or as a
- /// structured Ideogram 4.0 JSON prompt. A structured JSON prompt is
- /// used as is and skips magic prompt, except that its background
- /// description is replaced with a transparent background. - /// - /// - /// Controls how a natural-language prompt is prepared. `auto` (the
- /// default) and `on` rewrite and expand the prompt before generation.
- /// `off` keeps your wording and only converts it into a structured
- /// prompt. A valid structured JSON prompt skips magic prompt unless
- /// `magic_prompt` is `on`.
- /// Default Value: auto - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Supported output aspect ratios. The operation defines whether `auto`
- /// preserves the source shape or selects a shape from the prompt.
- /// Default Value: auto - /// - /// - /// The output resolution tier. Each tier is a total pixel budget equal
- /// to a square of the named size (for example, `8k` delivers at most
- /// 8192x8192 pixels in total). Wide and tall aspect ratios keep the
- /// same budget, so one side may exceed the named size. Tiers above
- /// 2k are produced by upscaling after generation. Defaults to 1k.
- /// Default Value: 1k - /// - /// - /// The rendering speed to use.
- /// Default Value: default - /// - /// - /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. - /// - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageV2IdeogramV4TransparentAsync( - string prompt, - bool? dryRun = default, - global::Ideogram.MagicPromptMode? magicPrompt = default, - int? seed = default, - int? numImages = default, - global::Ideogram.IdeogramV4AspectRatio? aspectRatio = default, - global::Ideogram.GenerateImageIdeogramV4TransparentRequestOutputResolution? outputResolution = default, - global::Ideogram.GenerateImageIdeogramV4TransparentRequestRenderingSpeed? renderingSpeed = default, - bool? enableCopyrightDetection = default, - bool? async = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.GenerateImageIdeogramV4TransparentRequest - { - Prompt = prompt, - MagicPrompt = magicPrompt, - Seed = seed, - NumImages = numImages, - AspectRatio = aspectRatio, - OutputResolution = outputResolution, - RenderingSpeed = renderingSpeed, - EnableCopyrightDetection = enableCopyrightDetection, - Async = async, - WebhookUrl = webhookUrl, - Private = @private, - TargetCollectionId = targetCollectionId, - }; - - return await PostGenerateImageV2IdeogramV4TransparentAsync( - dryRun: dryRun, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2NanoBanana2.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2NanoBanana2.g.cs deleted file mode 100644 index d3381661..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2NanoBanana2.g.cs +++ /dev/null @@ -1,885 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ImagesGenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostGenerateImageV2NanoBanana2SecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostGenerateImageV2NanoBanana2SecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostGenerateImageV2NanoBanana2SecurityRequirement0, - }; - partial void PreparePostGenerateImageV2NanoBanana2Arguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? dryRun, - global::Ideogram.GenerateImageNanoBanana2Request request); - partial void PreparePostGenerateImageV2NanoBanana2Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? dryRun, - global::Ideogram.GenerateImageNanoBanana2Request request); - partial void ProcessPostGenerateImageV2NanoBanana2Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostGenerateImageV2NanoBanana2ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Generate with Nano Banana 2
- /// Generate images with Nano Banana 2. Optionally upload source images as
- /// `images` using `multipart/form-data` to edit them with the prompt.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageV2NanoBanana2Async( - - global::Ideogram.GenerateImageNanoBanana2Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostGenerateImageV2NanoBanana2AsResponseAsync( - - request: request, - dryRun: dryRun, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Generate with Nano Banana 2
- /// Generate images with Nano Banana 2. Optionally upload source images as
- /// `images` using `multipart/form-data` to edit them with the prompt.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostGenerateImageV2NanoBanana2AsResponseAsync( - - global::Ideogram.GenerateImageNanoBanana2Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostGenerateImageV2NanoBanana2Arguments( - httpClient: HttpClient, - dryRun: ref dryRun, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostGenerateImageV2NanoBanana2SecurityRequirements, - operationName: "PostGenerateImageV2NanoBanana2Async"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/image/generate/nano-banana-2", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - if (request.ImageAssetIdentifiers != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.ImageAssetIdentifiers!, x => x.ToJson(JsonSerializerContext)))}]"), - name: "\"image_asset_identifiers\""); - - } - if (request.Images != default) - { - - for (var __iImages = 0; __iImages < request.Images.Count; __iImages++) - { - var __contentImages = new global::System.Net.Http.ByteArrayContent(request.Images[__iImages]); - __contentImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); - __httpRequestContent.Add( - content: __contentImages, - name: "\"images\"", - fileName: $"\"file{__iImages}.bin\""); - if (__contentImages.Headers.ContentDisposition != null) - { - __contentImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - if (request.AspectRatio != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.AspectRatio).HasValue ? (request.AspectRatio).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"aspect_ratio\""); - - } - if (request.ResolutionTier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.ResolutionTier).HasValue ? (request.ResolutionTier).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"resolution_tier\""); - - } - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.Async != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"async\""); - - } - if (request.WebhookUrl != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), - name: "\"webhook_url\""); - - } - if (request.Private != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"private\""); - - } - if (request.TargetCollectionId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.TargetCollectionId ?? string.Empty), - name: "\"target_collection_id\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostGenerateImageV2NanoBanana2Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - dryRun: dryRun, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2NanoBanana2", - methodName: "PostGenerateImageV2NanoBanana2Async", - pathTemplate: "\"/v2/image/generate/nano-banana-2\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2NanoBanana2", - methodName: "PostGenerateImageV2NanoBanana2Async", - pathTemplate: "\"/v2/image/generate/nano-banana-2\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2NanoBanana2", - methodName: "PostGenerateImageV2NanoBanana2Async", - pathTemplate: "\"/v2/image/generate/nano-banana-2\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostGenerateImageV2NanoBanana2Response( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2NanoBanana2", - methodName: "PostGenerateImageV2NanoBanana2Async", - pathTemplate: "\"/v2/image/generate/nano-banana-2\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2NanoBanana2", - methodName: "PostGenerateImageV2NanoBanana2Async", - pathTemplate: "\"/v2/image/generate/nano-banana-2\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 500) - { - string? __content_500 = null; - global::System.Exception? __exception_500 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_500 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_500, - responseBody: __content_500, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostGenerateImageV2NanoBanana2ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.GenerateImageNanoBanana2Response.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.GenerateImageNanoBanana2Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Generate with Nano Banana 2
- /// Generate images with Nano Banana 2. Optionally upload source images as
- /// `images` using `multipart/form-data` to edit them with the prompt.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// The prompt to generate images from, or the edit instruction to apply when source images are supplied. It is passed to the model as written. - /// - /// - /// Existing upload or generated image assets to edit, by reference. Takes priority over `images` if both are supplied. - /// - /// - /// Optional source images to edit (max 10, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only. - /// - /// - /// Output aspect ratios Nano Banana 2 serves. `auto` lets the model choose the shape; an edit keeps its source image's shape.
- /// Default Value: auto - /// - /// - /// The output resolution tier.
- /// Default Value: 1K - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageV2NanoBanana2Async( - string prompt, - bool? dryRun = default, - global::System.Collections.Generic.IList? imageAssetIdentifiers = default, - global::System.Collections.Generic.IList? images = default, - global::Ideogram.NanoBanana2AspectRatio? aspectRatio = default, - global::Ideogram.GenerateImageNanoBanana2RequestResolutionTier? resolutionTier = default, - int? numImages = default, - int? seed = default, - bool? async = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.GenerateImageNanoBanana2Request - { - Prompt = prompt, - ImageAssetIdentifiers = imageAssetIdentifiers, - Images = images, - AspectRatio = aspectRatio, - ResolutionTier = resolutionTier, - NumImages = numImages, - Seed = seed, - Async = async, - WebhookUrl = webhookUrl, - Private = @private, - TargetCollectionId = targetCollectionId, - }; - - return await PostGenerateImageV2NanoBanana2Async( - dryRun: dryRun, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2NanoBanana21.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2NanoBanana21.g.cs deleted file mode 100644 index 6fd2f84c..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2NanoBanana21.g.cs +++ /dev/null @@ -1,885 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ImagesGenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostGenerateImageV2NanoBanana21SecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostGenerateImageV2NanoBanana21SecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostGenerateImageV2NanoBanana21SecurityRequirement0, - }; - partial void PreparePostGenerateImageV2NanoBanana21Arguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? dryRun, - global::Ideogram.GenerateImageNanoBanana21Request request); - partial void PreparePostGenerateImageV2NanoBanana21Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? dryRun, - global::Ideogram.GenerateImageNanoBanana21Request request); - partial void ProcessPostGenerateImageV2NanoBanana21Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostGenerateImageV2NanoBanana21ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Generate with Nano Banana 2.1
- /// Generate images with Nano Banana 2.1. Optionally upload source images as
- /// `images` using `multipart/form-data` to edit them with the prompt.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageV2NanoBanana21Async( - - global::Ideogram.GenerateImageNanoBanana21Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostGenerateImageV2NanoBanana21AsResponseAsync( - - request: request, - dryRun: dryRun, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Generate with Nano Banana 2.1
- /// Generate images with Nano Banana 2.1. Optionally upload source images as
- /// `images` using `multipart/form-data` to edit them with the prompt.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostGenerateImageV2NanoBanana21AsResponseAsync( - - global::Ideogram.GenerateImageNanoBanana21Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostGenerateImageV2NanoBanana21Arguments( - httpClient: HttpClient, - dryRun: ref dryRun, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostGenerateImageV2NanoBanana21SecurityRequirements, - operationName: "PostGenerateImageV2NanoBanana21Async"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/image/generate/nano-banana-2-1", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - if (request.ImageAssetIdentifiers != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.ImageAssetIdentifiers!, x => x.ToJson(JsonSerializerContext)))}]"), - name: "\"image_asset_identifiers\""); - - } - if (request.Images != default) - { - - for (var __iImages = 0; __iImages < request.Images.Count; __iImages++) - { - var __contentImages = new global::System.Net.Http.ByteArrayContent(request.Images[__iImages]); - __contentImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); - __httpRequestContent.Add( - content: __contentImages, - name: "\"images\"", - fileName: $"\"file{__iImages}.bin\""); - if (__contentImages.Headers.ContentDisposition != null) - { - __contentImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - if (request.AspectRatio != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.AspectRatio).HasValue ? (request.AspectRatio).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"aspect_ratio\""); - - } - if (request.ResolutionTier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.ResolutionTier).HasValue ? (request.ResolutionTier).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"resolution_tier\""); - - } - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.Async != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"async\""); - - } - if (request.WebhookUrl != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), - name: "\"webhook_url\""); - - } - if (request.Private != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"private\""); - - } - if (request.TargetCollectionId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.TargetCollectionId ?? string.Empty), - name: "\"target_collection_id\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostGenerateImageV2NanoBanana21Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - dryRun: dryRun, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2NanoBanana21", - methodName: "PostGenerateImageV2NanoBanana21Async", - pathTemplate: "\"/v2/image/generate/nano-banana-2-1\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2NanoBanana21", - methodName: "PostGenerateImageV2NanoBanana21Async", - pathTemplate: "\"/v2/image/generate/nano-banana-2-1\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2NanoBanana21", - methodName: "PostGenerateImageV2NanoBanana21Async", - pathTemplate: "\"/v2/image/generate/nano-banana-2-1\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostGenerateImageV2NanoBanana21Response( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2NanoBanana21", - methodName: "PostGenerateImageV2NanoBanana21Async", - pathTemplate: "\"/v2/image/generate/nano-banana-2-1\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2NanoBanana21", - methodName: "PostGenerateImageV2NanoBanana21Async", - pathTemplate: "\"/v2/image/generate/nano-banana-2-1\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 500) - { - string? __content_500 = null; - global::System.Exception? __exception_500 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_500 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_500, - responseBody: __content_500, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostGenerateImageV2NanoBanana21ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.GenerateImageNanoBanana21Response.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.GenerateImageNanoBanana21Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Generate with Nano Banana 2.1
- /// Generate images with Nano Banana 2.1. Optionally upload source images as
- /// `images` using `multipart/form-data` to edit them with the prompt.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// The prompt to generate images from, or the edit instruction to apply when source images are supplied. It is passed to the model as written. - /// - /// - /// Existing upload or generated image assets to edit, by reference. Takes priority over `images` if both are supplied. - /// - /// - /// Optional source images to edit (max 10, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only. - /// - /// - /// Output aspect ratios Nano Banana 2.1 serves. `auto` lets the model choose the shape; an edit keeps its source image's shape.
- /// Default Value: auto - /// - /// - /// The output resolution tier.
- /// Default Value: 1K - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageV2NanoBanana21Async( - string prompt, - bool? dryRun = default, - global::System.Collections.Generic.IList? imageAssetIdentifiers = default, - global::System.Collections.Generic.IList? images = default, - global::Ideogram.NanoBanana21AspectRatio? aspectRatio = default, - global::Ideogram.GenerateImageNanoBanana21RequestResolutionTier? resolutionTier = default, - int? numImages = default, - int? seed = default, - bool? async = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.GenerateImageNanoBanana21Request - { - Prompt = prompt, - ImageAssetIdentifiers = imageAssetIdentifiers, - Images = images, - AspectRatio = aspectRatio, - ResolutionTier = resolutionTier, - NumImages = numImages, - Seed = seed, - Async = async, - WebhookUrl = webhookUrl, - Private = @private, - TargetCollectionId = targetCollectionId, - }; - - return await PostGenerateImageV2NanoBanana21Async( - dryRun: dryRun, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2NanoBananaPro.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2NanoBananaPro.g.cs deleted file mode 100644 index 2580f93a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2NanoBananaPro.g.cs +++ /dev/null @@ -1,885 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ImagesGenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostGenerateImageV2NanoBananaProSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostGenerateImageV2NanoBananaProSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostGenerateImageV2NanoBananaProSecurityRequirement0, - }; - partial void PreparePostGenerateImageV2NanoBananaProArguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? dryRun, - global::Ideogram.GenerateImageNanoBananaProRequest request); - partial void PreparePostGenerateImageV2NanoBananaProRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? dryRun, - global::Ideogram.GenerateImageNanoBananaProRequest request); - partial void ProcessPostGenerateImageV2NanoBananaProResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostGenerateImageV2NanoBananaProResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Generate with Nano Banana Pro
- /// Generate images with Nano Banana Pro. Optionally upload source images as
- /// `images` using `multipart/form-data` to edit them with the prompt.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageV2NanoBananaProAsync( - - global::Ideogram.GenerateImageNanoBananaProRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostGenerateImageV2NanoBananaProAsResponseAsync( - - request: request, - dryRun: dryRun, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Generate with Nano Banana Pro
- /// Generate images with Nano Banana Pro. Optionally upload source images as
- /// `images` using `multipart/form-data` to edit them with the prompt.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostGenerateImageV2NanoBananaProAsResponseAsync( - - global::Ideogram.GenerateImageNanoBananaProRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostGenerateImageV2NanoBananaProArguments( - httpClient: HttpClient, - dryRun: ref dryRun, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostGenerateImageV2NanoBananaProSecurityRequirements, - operationName: "PostGenerateImageV2NanoBananaProAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/image/generate/nano-banana-pro", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - if (request.ImageAssetIdentifiers != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.ImageAssetIdentifiers!, x => x.ToJson(JsonSerializerContext)))}]"), - name: "\"image_asset_identifiers\""); - - } - if (request.Images != default) - { - - for (var __iImages = 0; __iImages < request.Images.Count; __iImages++) - { - var __contentImages = new global::System.Net.Http.ByteArrayContent(request.Images[__iImages]); - __contentImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); - __httpRequestContent.Add( - content: __contentImages, - name: "\"images\"", - fileName: $"\"file{__iImages}.bin\""); - if (__contentImages.Headers.ContentDisposition != null) - { - __contentImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - if (request.AspectRatio != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.AspectRatio).HasValue ? (request.AspectRatio).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"aspect_ratio\""); - - } - if (request.ResolutionTier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.ResolutionTier).HasValue ? (request.ResolutionTier).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"resolution_tier\""); - - } - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.Async != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"async\""); - - } - if (request.WebhookUrl != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), - name: "\"webhook_url\""); - - } - if (request.Private != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"private\""); - - } - if (request.TargetCollectionId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.TargetCollectionId ?? string.Empty), - name: "\"target_collection_id\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostGenerateImageV2NanoBananaProRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - dryRun: dryRun, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2NanoBananaPro", - methodName: "PostGenerateImageV2NanoBananaProAsync", - pathTemplate: "\"/v2/image/generate/nano-banana-pro\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2NanoBananaPro", - methodName: "PostGenerateImageV2NanoBananaProAsync", - pathTemplate: "\"/v2/image/generate/nano-banana-pro\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2NanoBananaPro", - methodName: "PostGenerateImageV2NanoBananaProAsync", - pathTemplate: "\"/v2/image/generate/nano-banana-pro\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostGenerateImageV2NanoBananaProResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2NanoBananaPro", - methodName: "PostGenerateImageV2NanoBananaProAsync", - pathTemplate: "\"/v2/image/generate/nano-banana-pro\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2NanoBananaPro", - methodName: "PostGenerateImageV2NanoBananaProAsync", - pathTemplate: "\"/v2/image/generate/nano-banana-pro\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 500) - { - string? __content_500 = null; - global::System.Exception? __exception_500 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_500 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_500, - responseBody: __content_500, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostGenerateImageV2NanoBananaProResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.GenerateImageNanoBananaProResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.GenerateImageNanoBananaProResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Generate with Nano Banana Pro
- /// Generate images with Nano Banana Pro. Optionally upload source images as
- /// `images` using `multipart/form-data` to edit them with the prompt.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// The prompt to generate images from, or the edit instruction to apply when source images are supplied. It is passed to the model as written. - /// - /// - /// Existing upload or generated image assets to edit, by reference. Takes priority over `images` if both are supplied. - /// - /// - /// Optional source images to edit (max 10, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only. - /// - /// - /// Output aspect ratios Nano Banana Pro serves. `auto` lets the model choose the shape; an edit keeps its source image's shape.
- /// Default Value: auto - /// - /// - /// The output resolution tier.
- /// Default Value: 1K - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageV2NanoBananaProAsync( - string prompt, - bool? dryRun = default, - global::System.Collections.Generic.IList? imageAssetIdentifiers = default, - global::System.Collections.Generic.IList? images = default, - global::Ideogram.NanoBananaProAspectRatio? aspectRatio = default, - global::Ideogram.GenerateImageNanoBananaProRequestResolutionTier? resolutionTier = default, - int? numImages = default, - int? seed = default, - bool? async = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.GenerateImageNanoBananaProRequest - { - Prompt = prompt, - ImageAssetIdentifiers = imageAssetIdentifiers, - Images = images, - AspectRatio = aspectRatio, - ResolutionTier = resolutionTier, - NumImages = numImages, - Seed = seed, - Async = async, - WebhookUrl = webhookUrl, - Private = @private, - TargetCollectionId = targetCollectionId, - }; - - return await PostGenerateImageV2NanoBananaProAsync( - dryRun: dryRun, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2PImageIdeogram.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2PImageIdeogram.g.cs deleted file mode 100644 index 39a1d2ad..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2PImageIdeogram.g.cs +++ /dev/null @@ -1,814 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ImagesGenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostGenerateImageV2PImageIdeogramSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostGenerateImageV2PImageIdeogramSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostGenerateImageV2PImageIdeogramSecurityRequirement0, - }; - partial void PreparePostGenerateImageV2PImageIdeogramArguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? dryRun, - global::Ideogram.GenerateImagePImageIdeogramRequest request); - partial void PreparePostGenerateImageV2PImageIdeogramRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? dryRun, - global::Ideogram.GenerateImagePImageIdeogramRequest request); - partial void ProcessPostGenerateImageV2PImageIdeogramResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostGenerateImageV2PImageIdeogramResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Generate with P-Image Ideogram
- /// Generate images with P-Image Ideogram, a fast model with selectable
- /// quality and resolution tiers. Returns results directly by default; set
- /// `async` or supply a `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageV2PImageIdeogramAsync( - - global::Ideogram.GenerateImagePImageIdeogramRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostGenerateImageV2PImageIdeogramAsResponseAsync( - - request: request, - dryRun: dryRun, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Generate with P-Image Ideogram
- /// Generate images with P-Image Ideogram, a fast model with selectable
- /// quality and resolution tiers. Returns results directly by default; set
- /// `async` or supply a `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostGenerateImageV2PImageIdeogramAsResponseAsync( - - global::Ideogram.GenerateImagePImageIdeogramRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostGenerateImageV2PImageIdeogramArguments( - httpClient: HttpClient, - dryRun: ref dryRun, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostGenerateImageV2PImageIdeogramSecurityRequirements, - operationName: "PostGenerateImageV2PImageIdeogramAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/image/generate/p-image-ideogram", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostGenerateImageV2PImageIdeogramRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - dryRun: dryRun, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2PImageIdeogram", - methodName: "PostGenerateImageV2PImageIdeogramAsync", - pathTemplate: "\"/v2/image/generate/p-image-ideogram\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2PImageIdeogram", - methodName: "PostGenerateImageV2PImageIdeogramAsync", - pathTemplate: "\"/v2/image/generate/p-image-ideogram\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2PImageIdeogram", - methodName: "PostGenerateImageV2PImageIdeogramAsync", - pathTemplate: "\"/v2/image/generate/p-image-ideogram\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostGenerateImageV2PImageIdeogramResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2PImageIdeogram", - methodName: "PostGenerateImageV2PImageIdeogramAsync", - pathTemplate: "\"/v2/image/generate/p-image-ideogram\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2PImageIdeogram", - methodName: "PostGenerateImageV2PImageIdeogramAsync", - pathTemplate: "\"/v2/image/generate/p-image-ideogram\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 500) - { - string? __content_500 = null; - global::System.Exception? __exception_500 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_500 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_500, - responseBody: __content_500, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostGenerateImageV2PImageIdeogramResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.GenerateImagePImageIdeogramResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.GenerateImagePImageIdeogramResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Generate with P-Image Ideogram
- /// Generate images with P-Image Ideogram, a fast model with selectable
- /// quality and resolution tiers. Returns results directly by default; set
- /// `async` or supply a `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// The prompt to generate images from, in natural language or as a
- /// structured Ideogram 4.0 JSON prompt. - /// - /// - /// Controls magic prompt (automatic prompt rewriting). `off` disables magic prompt entirely. Defaults to `auto`.
- /// Default Value: auto - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// The generation quality level. Defaults to `medium`.
- /// Default Value: medium - /// - /// - /// The output size tier. Defaults to `1k`. Cannot be combined with `custom_width`/`custom_height`. - /// - /// - /// The output aspect ratio. Defaults to `1x1`.
- /// Default Value: 1x1 - /// - /// - /// Optional. An exact output width in pixels, used together with
- /// `custom_height` for output sizes outside the preset tiers. Must
- /// be a positive multiple of 16 between 16 and 4096, and
- /// `custom_width` × `custom_height` must not exceed 4,194,304 pixels
- /// (2048×2048). Cannot be combined with `resolution` or
- /// `aspect_ratio`; the request is billed at the resolution tier
- /// matching its total pixel count. - /// - /// - /// Optional. An exact output height in pixels, used together with
- /// `custom_width`. See `custom_width` for the accepted range and
- /// billing behavior. - /// - /// - /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. - /// - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageV2PImageIdeogramAsync( - string prompt, - bool? dryRun = default, - global::Ideogram.MagicPromptMode? magicPrompt = default, - int? seed = default, - int? numImages = default, - global::Ideogram.GenerationQuality? quality = default, - global::Ideogram.GenerateImagePImageIdeogramRequestResolution? resolution = default, - global::Ideogram.AspectRatioV3? aspectRatio = default, - int? customWidth = default, - int? customHeight = default, - bool? enableCopyrightDetection = default, - bool? async = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.GenerateImagePImageIdeogramRequest - { - Prompt = prompt, - MagicPrompt = magicPrompt, - Seed = seed, - NumImages = numImages, - Quality = quality, - Resolution = resolution, - AspectRatio = aspectRatio, - CustomWidth = customWidth, - CustomHeight = customHeight, - EnableCopyrightDetection = enableCopyrightDetection, - Async = async, - WebhookUrl = webhookUrl, - Private = @private, - TargetCollectionId = targetCollectionId, - }; - - return await PostGenerateImageV2PImageIdeogramAsync( - dryRun: dryRun, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2ZImage.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2ZImage.g.cs deleted file mode 100644 index 10c0d9c0..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.PostGenerateImageV2ZImage.g.cs +++ /dev/null @@ -1,778 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ImagesGenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostGenerateImageV2ZImageSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostGenerateImageV2ZImageSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostGenerateImageV2ZImageSecurityRequirement0, - }; - partial void PreparePostGenerateImageV2ZImageArguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? dryRun, - global::Ideogram.GenerateImageZImageRequest request); - partial void PreparePostGenerateImageV2ZImageRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? dryRun, - global::Ideogram.GenerateImageZImageRequest request); - partial void ProcessPostGenerateImageV2ZImageResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostGenerateImageV2ZImageResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Generate with Z-Image
- /// Generate images from a text prompt with Z-Image. Returns results
- /// directly by default; set `async` or supply a `webhook_url` to get a
- /// `generation_id` and poll `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageV2ZImageAsync( - - global::Ideogram.GenerateImageZImageRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostGenerateImageV2ZImageAsResponseAsync( - - request: request, - dryRun: dryRun, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Generate with Z-Image
- /// Generate images from a text prompt with Z-Image. Returns results
- /// directly by default; set `async` or supply a `webhook_url` to get a
- /// `generation_id` and poll `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostGenerateImageV2ZImageAsResponseAsync( - - global::Ideogram.GenerateImageZImageRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostGenerateImageV2ZImageArguments( - httpClient: HttpClient, - dryRun: ref dryRun, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostGenerateImageV2ZImageSecurityRequirements, - operationName: "PostGenerateImageV2ZImageAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/image/generate/z-image", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostGenerateImageV2ZImageRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - dryRun: dryRun, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2ZImage", - methodName: "PostGenerateImageV2ZImageAsync", - pathTemplate: "\"/v2/image/generate/z-image\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2ZImage", - methodName: "PostGenerateImageV2ZImageAsync", - pathTemplate: "\"/v2/image/generate/z-image\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2ZImage", - methodName: "PostGenerateImageV2ZImageAsync", - pathTemplate: "\"/v2/image/generate/z-image\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostGenerateImageV2ZImageResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2ZImage", - methodName: "PostGenerateImageV2ZImageAsync", - pathTemplate: "\"/v2/image/generate/z-image\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateImageV2ZImage", - methodName: "PostGenerateImageV2ZImageAsync", - pathTemplate: "\"/v2/image/generate/z-image\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 500) - { - string? __content_500 = null; - global::System.Exception? __exception_500 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_500 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_500, - responseBody: __content_500, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostGenerateImageV2ZImageResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.GenerateImageZImageResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.GenerateImageZImageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Generate with Z-Image
- /// Generate images from a text prompt with Z-Image. Returns results
- /// directly by default; set `async` or supply a `webhook_url` to get a
- /// `generation_id` and poll `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// The prompt to generate images from.
- /// Example: A futuristic cityscape at golden hour, highly detailed. - /// - /// - /// Exact output resolution, formatted as "WIDTHxHEIGHT". Each side must be a positive multiple of 16 and the total area must not exceed 1,048,576 pixels (1024×1024). When omitted, the model's default 1024×1024 is used.
- /// Example: 1024x1024 - /// - /// - /// Optional number of diffusion steps. When omitted, the model's
- /// default is used. Higher values improve quality but take longer.
- /// Example: 8 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateImageV2ZImageAsync( - string prompt, - bool? dryRun = default, - string? resolution = default, - int? numInferenceSteps = default, - int? seed = default, - int? numImages = default, - bool? async = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.GenerateImageZImageRequest - { - Prompt = prompt, - Resolution = resolution, - NumInferenceSteps = numInferenceSteps, - Seed = seed, - NumImages = numImages, - Async = async, - WebhookUrl = webhookUrl, - Private = @private, - TargetCollectionId = targetCollectionId, - }; - - return await PostGenerateImageV2ZImageAsync( - dryRun: dryRun, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.g.cs index 89423e09..e602312d 100644 --- a/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.ImagesGenerateClient.g.cs @@ -4,10 +4,6 @@ namespace Ideogram { /// - /// Generate images with a specific model contract. Requests are JSON
- /// (Ideogram 3.0 also accepts multipart for style reference bytes) and
- /// return a generation id that can be polled via
- /// `GET /v2/generations/{generation_id}`.
/// If no httpClient is provided, a new one will be created.
/// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. ///
diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesInpaint.JsonSerializerContext.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesInpaint.JsonSerializerContext.g.cs index 345d79df..5fdb5940 100644 --- a/src/libs/Ideogram/Generated/Ideogram.ImagesInpaint.JsonSerializerContext.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.ImagesInpaint.JsonSerializerContext.g.cs @@ -14,48 +14,44 @@ namespace Ideogram [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(byte[]))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AssetIdentifier))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationErrorResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationRejectReason), TypeInfoPropertyName = "GenerationRejectReason2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed), TypeInfoPropertyName = "GenerationErrorResponseTaskCompletionSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationErrorResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MagicPromptMode), TypeInfoPropertyName = "MagicPromptMode2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramV3StyleType), TypeInfoPropertyName = "IdeogramV3StyleType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramV3StylePreset), TypeInfoPropertyName = "IdeogramV3StylePreset2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageInpaintIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed), TypeInfoPropertyName = "V2ImageInpaintIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.InpaintedImageObject))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.InpaintImageIdeogramV3Response))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.InpaintedImageObject))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.InpaintImageIdeogramV3Request))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.InpaintImageIdeogramV3RequestRenderingSpeed), TypeInfoPropertyName = "InpaintImageIdeogramV3RequestRenderingSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.InpaintImageIdeogramV3CustomModelResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.InpaintImageIdeogramV3CustomModelRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.InpaintImageIdeogramV3CustomModelRequestRenderingSpeed), TypeInfoPropertyName = "InpaintImageIdeogramV3CustomModelRequestRenderingSpeed2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed), TypeInfoPropertyName = "V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType), TypeInfoPropertyName = "V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.InpaintImageIdeogramV3CharacterResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.InpaintImageIdeogramV3CharacterRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.InpaintImageIdeogramV3CharacterRequestRenderingSpeed), TypeInfoPropertyName = "InpaintImageIdeogramV3CharacterRequestRenderingSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.InpaintImageIdeogramV3CharacterRequestStyleType), TypeInfoPropertyName = "InpaintImageIdeogramV3CharacterRequestStyleType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AssetType), TypeInfoPropertyName = "AssetType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageInpaintIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed), TypeInfoPropertyName = "V2ImageInpaintIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.InpaintImageIdeogramV3CustomModelResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(byte[]))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3Request))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelRequest))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationRejectReason?), TypeInfoPropertyName = "NullableGenerationRejectReason2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?), TypeInfoPropertyName = "NullableGenerationErrorResponseTaskCompletionSpeed2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MagicPromptMode?), TypeInfoPropertyName = "NullableMagicPromptMode2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramV3StyleType?), TypeInfoPropertyName = "NullableIdeogramV3StyleType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramV3StylePreset?), TypeInfoPropertyName = "NullableIdeogramV3StylePreset2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.InpaintImageIdeogramV3RequestRenderingSpeed?), TypeInfoPropertyName = "NullableInpaintImageIdeogramV3RequestRenderingSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.InpaintImageIdeogramV3CustomModelRequestRenderingSpeed?), TypeInfoPropertyName = "NullableInpaintImageIdeogramV3CustomModelRequestRenderingSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.InpaintImageIdeogramV3CharacterRequestRenderingSpeed?), TypeInfoPropertyName = "NullableInpaintImageIdeogramV3CharacterRequestRenderingSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.InpaintImageIdeogramV3CharacterRequestStyleType?), TypeInfoPropertyName = "NullableInpaintImageIdeogramV3CharacterRequestStyleType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AssetType?), TypeInfoPropertyName = "NullableAssetType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageInpaintIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed?), TypeInfoPropertyName = "NullableV2ImageInpaintIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed?), TypeInfoPropertyName = "NullableV2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType?), TypeInfoPropertyName = "NullableV2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageInpaintIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed?), TypeInfoPropertyName = "NullableV2ImageInpaintIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] internal sealed partial class ImagesInpaintSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext { } @@ -125,61 +121,47 @@ private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Ser public override bool CanConvert(global::System.Type typeToConvert) { return - typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed) - - || typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?) - - || typeToConvert == typeof(global::Ideogram.GenerationRejectReason) + typeToConvert == typeof(global::Ideogram.GenerationRejectReason) || typeToConvert == typeof(global::Ideogram.GenerationRejectReason?) - || typeToConvert == typeof(global::Ideogram.InpaintImageIdeogramV3RequestRenderingSpeed) + || typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed) - || typeToConvert == typeof(global::Ideogram.InpaintImageIdeogramV3RequestRenderingSpeed?) + || typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?) - || typeToConvert == typeof(global::Ideogram.InpaintImageIdeogramV3CustomModelRequestRenderingSpeed) + || typeToConvert == typeof(global::Ideogram.MagicPromptMode) - || typeToConvert == typeof(global::Ideogram.InpaintImageIdeogramV3CustomModelRequestRenderingSpeed?) + || typeToConvert == typeof(global::Ideogram.MagicPromptMode?) - || typeToConvert == typeof(global::Ideogram.InpaintImageIdeogramV3CharacterRequestRenderingSpeed) + || typeToConvert == typeof(global::Ideogram.IdeogramV3StyleType) - || typeToConvert == typeof(global::Ideogram.InpaintImageIdeogramV3CharacterRequestRenderingSpeed?) + || typeToConvert == typeof(global::Ideogram.IdeogramV3StyleType?) - || typeToConvert == typeof(global::Ideogram.InpaintImageIdeogramV3CharacterRequestStyleType) + || typeToConvert == typeof(global::Ideogram.IdeogramV3StylePreset) - || typeToConvert == typeof(global::Ideogram.InpaintImageIdeogramV3CharacterRequestStyleType?) + || typeToConvert == typeof(global::Ideogram.IdeogramV3StylePreset?) - || typeToConvert == typeof(global::Ideogram.AssetType) + || typeToConvert == typeof(global::Ideogram.V2ImageInpaintIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed) - || typeToConvert == typeof(global::Ideogram.AssetType?) + || typeToConvert == typeof(global::Ideogram.V2ImageInpaintIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed?) - || typeToConvert == typeof(global::Ideogram.MagicPromptMode) + || typeToConvert == typeof(global::Ideogram.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed) - || typeToConvert == typeof(global::Ideogram.MagicPromptMode?) + || typeToConvert == typeof(global::Ideogram.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed?) - || typeToConvert == typeof(global::Ideogram.IdeogramV3StyleType) + || typeToConvert == typeof(global::Ideogram.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType) - || typeToConvert == typeof(global::Ideogram.IdeogramV3StyleType?) + || typeToConvert == typeof(global::Ideogram.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType?) - || typeToConvert == typeof(global::Ideogram.IdeogramV3StylePreset) + || typeToConvert == typeof(global::Ideogram.V2ImageInpaintIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed) - || typeToConvert == typeof(global::Ideogram.IdeogramV3StylePreset?); + || typeToConvert == typeof(global::Ideogram.V2ImageInpaintIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed?); } public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) { - if (typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed)) - { - return new global::Ideogram.JsonConverters.GenerationErrorResponseTaskCompletionSpeedJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?)) - { - return new global::Ideogram.JsonConverters.GenerationErrorResponseTaskCompletionSpeedNullableJsonConverter(); - } - if (typeToConvert == typeof(global::Ideogram.GenerationRejectReason)) { return new global::Ideogram.JsonConverters.GenerationRejectReasonJsonConverter(); @@ -190,84 +172,84 @@ public override bool CanConvert(global::System.Type typeToConvert) return new global::Ideogram.JsonConverters.GenerationRejectReasonNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.InpaintImageIdeogramV3RequestRenderingSpeed)) + if (typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed)) { - return new global::Ideogram.JsonConverters.InpaintImageIdeogramV3RequestRenderingSpeedJsonConverter(); + return new global::Ideogram.JsonConverters.GenerationErrorResponseTaskCompletionSpeedJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.InpaintImageIdeogramV3RequestRenderingSpeed?)) + if (typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?)) { - return new global::Ideogram.JsonConverters.InpaintImageIdeogramV3RequestRenderingSpeedNullableJsonConverter(); + return new global::Ideogram.JsonConverters.GenerationErrorResponseTaskCompletionSpeedNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.InpaintImageIdeogramV3CustomModelRequestRenderingSpeed)) + if (typeToConvert == typeof(global::Ideogram.MagicPromptMode)) { - return new global::Ideogram.JsonConverters.InpaintImageIdeogramV3CustomModelRequestRenderingSpeedJsonConverter(); + return new global::Ideogram.JsonConverters.MagicPromptModeJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.InpaintImageIdeogramV3CustomModelRequestRenderingSpeed?)) + if (typeToConvert == typeof(global::Ideogram.MagicPromptMode?)) { - return new global::Ideogram.JsonConverters.InpaintImageIdeogramV3CustomModelRequestRenderingSpeedNullableJsonConverter(); + return new global::Ideogram.JsonConverters.MagicPromptModeNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.InpaintImageIdeogramV3CharacterRequestRenderingSpeed)) + if (typeToConvert == typeof(global::Ideogram.IdeogramV3StyleType)) { - return new global::Ideogram.JsonConverters.InpaintImageIdeogramV3CharacterRequestRenderingSpeedJsonConverter(); + return new global::Ideogram.JsonConverters.IdeogramV3StyleTypeJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.InpaintImageIdeogramV3CharacterRequestRenderingSpeed?)) + if (typeToConvert == typeof(global::Ideogram.IdeogramV3StyleType?)) { - return new global::Ideogram.JsonConverters.InpaintImageIdeogramV3CharacterRequestRenderingSpeedNullableJsonConverter(); + return new global::Ideogram.JsonConverters.IdeogramV3StyleTypeNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.InpaintImageIdeogramV3CharacterRequestStyleType)) + if (typeToConvert == typeof(global::Ideogram.IdeogramV3StylePreset)) { - return new global::Ideogram.JsonConverters.InpaintImageIdeogramV3CharacterRequestStyleTypeJsonConverter(); + return new global::Ideogram.JsonConverters.IdeogramV3StylePresetJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.InpaintImageIdeogramV3CharacterRequestStyleType?)) + if (typeToConvert == typeof(global::Ideogram.IdeogramV3StylePreset?)) { - return new global::Ideogram.JsonConverters.InpaintImageIdeogramV3CharacterRequestStyleTypeNullableJsonConverter(); + return new global::Ideogram.JsonConverters.IdeogramV3StylePresetNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.AssetType)) + if (typeToConvert == typeof(global::Ideogram.V2ImageInpaintIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed)) { - return new global::Ideogram.JsonConverters.AssetTypeJsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageInpaintIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.AssetType?)) + if (typeToConvert == typeof(global::Ideogram.V2ImageInpaintIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed?)) { - return new global::Ideogram.JsonConverters.AssetTypeNullableJsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageInpaintIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.MagicPromptMode)) + if (typeToConvert == typeof(global::Ideogram.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed)) { - return new global::Ideogram.JsonConverters.MagicPromptModeJsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.MagicPromptMode?)) + if (typeToConvert == typeof(global::Ideogram.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed?)) { - return new global::Ideogram.JsonConverters.MagicPromptModeNullableJsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.IdeogramV3StyleType)) + if (typeToConvert == typeof(global::Ideogram.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType)) { - return new global::Ideogram.JsonConverters.IdeogramV3StyleTypeJsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleTypeJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.IdeogramV3StyleType?)) + if (typeToConvert == typeof(global::Ideogram.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType?)) { - return new global::Ideogram.JsonConverters.IdeogramV3StyleTypeNullableJsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleTypeNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.IdeogramV3StylePreset)) + if (typeToConvert == typeof(global::Ideogram.V2ImageInpaintIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed)) { - return new global::Ideogram.JsonConverters.IdeogramV3StylePresetJsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageInpaintIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.IdeogramV3StylePreset?)) + if (typeToConvert == typeof(global::Ideogram.V2ImageInpaintIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed?)) { - return new global::Ideogram.JsonConverters.IdeogramV3StylePresetNullableJsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageInpaintIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullableJsonConverter(); } throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); } diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesInpaintClient.ImagesInpaintPostInpaintImageV2IdeogramV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesInpaintClient.ImagesInpaintPostInpaintImageV2IdeogramV3.g.cs new file mode 100644 index 00000000..79039b2d --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.ImagesInpaintClient.ImagesInpaintPostInpaintImageV2IdeogramV3.g.cs @@ -0,0 +1,3021 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class ImagesInpaintClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_ImagesInpaintPostInpaintImageV2IdeogramV3SecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_ImagesInpaintPostInpaintImageV2IdeogramV3SecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_ImagesInpaintPostInpaintImageV2IdeogramV3SecurityRequirement0, + }; + partial void PrepareImagesInpaintPostInpaintImageV2IdeogramV3Arguments( + global::System.Net.Http.HttpClient httpClient, + ref bool? dryRun, + global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3Request request); + partial void PrepareImagesInpaintPostInpaintImageV2IdeogramV3Request( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + bool? dryRun, + global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3Request request); + partial void ProcessImagesInpaintPostInpaintImageV2IdeogramV3Response( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessImagesInpaintPostInpaintImageV2IdeogramV3ResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Inpaint with Ideogram 3.0
+ /// Repaint the masked region of a source image with Ideogram 3.0, guided
+ /// by a text prompt. Upload the source `image` and its `mask` using
+ /// `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesInpaintPostInpaintImageV2IdeogramV3Async( + + global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ImagesInpaintPostInpaintImageV2IdeogramV3AsResponseAsync( + + request: request, + dryRun: dryRun, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Inpaint with Ideogram 3.0
+ /// Repaint the masked region of a source image with Ideogram 3.0, guided
+ /// by a text prompt. Upload the source `image` and its `mask` using
+ /// `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ImagesInpaintPostInpaintImageV2IdeogramV3AsResponseAsync( + + global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareImagesInpaintPostInpaintImageV2IdeogramV3Arguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImagesInpaintPostInpaintImageV2IdeogramV3SecurityRequirements, + operationName: "ImagesInpaintPostInpaintImageV2IdeogramV3Async"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/inpaint/ideogram-3", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + var __contentMask = new global::System.Net.Http.ByteArrayContent(request.Mask ?? global::System.Array.Empty()); + __contentMask.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Maskname is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Maskname) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentMask, + name: "\"mask\"", + fileName: request.Maskname != null ? $"\"{request.Maskname}\"" : string.Empty); + if (__contentMask.Headers.ContentDisposition != null) + { + __contentMask.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.MagicPrompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.MagicPrompt).HasValue ? (request.MagicPrompt).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"magic_prompt\""); + + } + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (request.RenderingSpeed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"rendering_speed\""); + + } + if (request.StyleType != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.StyleType).HasValue ? (request.StyleType).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"style_type\""); + + } + if (request.StylePreset != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.StylePreset).HasValue ? (request.StylePreset).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"style_preset\""); + + } + if (request.StyleCodes != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.StyleCodes!, x => x))}]"), + name: "\"style_codes\""); + + } + if (request.StyleReferenceImages != default) + { + + for (var __iStyleReferenceImages = 0; __iStyleReferenceImages < request.StyleReferenceImages.Count; __iStyleReferenceImages++) + { + var __contentStyleReferenceImages = new global::System.Net.Http.ByteArrayContent(request.StyleReferenceImages[__iStyleReferenceImages]); + __contentStyleReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); + __httpRequestContent.Add( + content: __contentStyleReferenceImages, + name: "\"style_reference_images\"", + fileName: $"\"file{__iStyleReferenceImages}.bin\""); + if (__contentStyleReferenceImages.Headers.ContentDisposition != null) + { + __contentStyleReferenceImages.Headers.ContentDisposition.FileNameStar = null; + } + } + + } + if (request.EnableCopyrightDetection != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"enable_copyright_detection\""); + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImagesInpaintPostInpaintImageV2IdeogramV3Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesInpaintPostInpaintImageV2IdeogramV3", + methodName: "ImagesInpaintPostInpaintImageV2IdeogramV3Async", + pathTemplate: "\"/v2/image/inpaint/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesInpaintPostInpaintImageV2IdeogramV3", + methodName: "ImagesInpaintPostInpaintImageV2IdeogramV3Async", + pathTemplate: "\"/v2/image/inpaint/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesInpaintPostInpaintImageV2IdeogramV3", + methodName: "ImagesInpaintPostInpaintImageV2IdeogramV3Async", + pathTemplate: "\"/v2/image/inpaint/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImagesInpaintPostInpaintImageV2IdeogramV3Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesInpaintPostInpaintImageV2IdeogramV3", + methodName: "ImagesInpaintPostInpaintImageV2IdeogramV3Async", + pathTemplate: "\"/v2/image/inpaint/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesInpaintPostInpaintImageV2IdeogramV3", + methodName: "ImagesInpaintPostInpaintImageV2IdeogramV3Async", + pathTemplate: "\"/v2/image/inpaint/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // A referenced resource was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImagesInpaintPostInpaintImageV2IdeogramV3ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.InpaintImageIdeogramV3Response.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.InpaintImageIdeogramV3Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Inpaint with Ideogram 3.0
+ /// Repaint the masked region of a source image with Ideogram 3.0, guided
+ /// by a text prompt. Upload the source `image` and its `mask` using
+ /// `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt describing the repainted result. + /// + /// + /// The source image to repaint (max 25MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The output matches its size, snapped to the nearest supported resolution. + /// + /// + /// The source image to repaint (max 25MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The output matches its size, snapped to the nearest supported resolution. + /// + /// + /// A black-and-white mask the same size as the source image. Black marks the region to repaint. JPEG, PNG, and WEBP are supported. Multipart requests only. + /// + /// + /// A black-and-white mask the same size as the source image. Black marks the region to repaint. JPEG, PNG, and WEBP are supported. Multipart requests only. + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The rendering speed to use.
+ /// Default Value: default + /// + /// + /// The style type to generate with.
+ /// Default Value: general + /// + /// + /// A predefined style preset to apply to the repainted images. Cannot be combined with style codes or style references. + /// + /// + /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images. + /// + /// + /// Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported. + /// + /// + /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the repainted images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesInpaintPostInpaintImageV2IdeogramV3Async( + string prompt, + byte[] image, + string imagename, + byte[] mask, + string maskname, + bool? dryRun = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + int? numImages = default, + int? seed = default, + global::Ideogram.V2ImageInpaintIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed = default, + global::Ideogram.IdeogramV3StyleType? styleType = default, + global::Ideogram.IdeogramV3StylePreset? stylePreset = default, + global::System.Collections.Generic.IList? styleCodes = default, + global::System.Collections.Generic.IList? styleReferenceImages = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3Request + { + Prompt = prompt, + Image = image, + Imagename = imagename, + Mask = mask, + Maskname = maskname, + MagicPrompt = magicPrompt, + NumImages = numImages, + Seed = seed, + RenderingSpeed = renderingSpeed, + StyleType = styleType, + StylePreset = stylePreset, + StyleCodes = styleCodes, + StyleReferenceImages = styleReferenceImages, + EnableCopyrightDetection = enableCopyrightDetection, + Async = async, + WebhookUrl = webhookUrl, + }; + + return await ImagesInpaintPostInpaintImageV2IdeogramV3Async( + dryRun: dryRun, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// Inpaint with Ideogram 3.0
+ /// Repaint the masked region of a source image with Ideogram 3.0, guided
+ /// by a text prompt. Upload the source `image` and its `mask` using
+ /// `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt describing the repainted result. + /// + /// + /// The source image to repaint (max 25MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The output matches its size, snapped to the nearest supported resolution. + /// + /// + /// The source image to repaint (max 25MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The output matches its size, snapped to the nearest supported resolution. + /// + /// + /// A black-and-white mask the same size as the source image. Black marks the region to repaint. JPEG, PNG, and WEBP are supported. Multipart requests only. + /// + /// + /// A black-and-white mask the same size as the source image. Black marks the region to repaint. JPEG, PNG, and WEBP are supported. Multipart requests only. + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The rendering speed to use.
+ /// Default Value: default + /// + /// + /// The style type to generate with.
+ /// Default Value: general + /// + /// + /// A predefined style preset to apply to the repainted images. Cannot be combined with style codes or style references. + /// + /// + /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images. + /// + /// + /// Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported. + /// + /// + /// Optional file names to use for the multipart 'style_reference_images' file parts. + /// + /// + /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the repainted images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesInpaintPostInpaintImageV2IdeogramV3Async( + string prompt, + global::System.IO.Stream image, + string imagename, + global::System.IO.Stream mask, + string maskname, + bool? dryRun = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + int? numImages = default, + int? seed = default, + global::Ideogram.V2ImageInpaintIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed = default, + global::Ideogram.IdeogramV3StyleType? styleType = default, + global::Ideogram.IdeogramV3StylePreset? stylePreset = default, + global::System.Collections.Generic.IList? styleCodes = default, + global::System.Collections.Generic.IReadOnlyList? styleReferenceImages = default, + global::System.Collections.Generic.IReadOnlyList? styleReferenceImagesFileNames = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + mask = mask ?? throw new global::System.ArgumentNullException(nameof(mask)); + var request = new global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3Request + { + Prompt = prompt, + Image = global::System.Array.Empty(), + Imagename = imagename, + Mask = global::System.Array.Empty(), + Maskname = maskname, + MagicPrompt = magicPrompt, + NumImages = numImages, + Seed = seed, + RenderingSpeed = renderingSpeed, + StyleType = styleType, + StylePreset = stylePreset, + StyleCodes = styleCodes, + StyleReferenceImages = new global::System.Collections.Generic.List(), + EnableCopyrightDetection = enableCopyrightDetection, + Async = async, + WebhookUrl = webhookUrl, + }; + PrepareArguments( + client: HttpClient); + PrepareImagesInpaintPostInpaintImageV2IdeogramV3Arguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImagesInpaintPostInpaintImageV2IdeogramV3SecurityRequirements, + operationName: "ImagesInpaintPostInpaintImageV2IdeogramV3Async"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/inpaint/ideogram-3", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + var __contentMask = new global::System.Net.Http.StreamContent(mask); + __contentMask.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Maskname is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Maskname) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentMask, + name: "\"mask\"", + fileName: request.Maskname != null ? $"\"{request.Maskname}\"" : string.Empty); + if (__contentMask.Headers.ContentDisposition != null) + { + __contentMask.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.MagicPrompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.MagicPrompt).HasValue ? (request.MagicPrompt).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"magic_prompt\""); + + } + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (request.RenderingSpeed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"rendering_speed\""); + + } + if (request.StyleType != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.StyleType).HasValue ? (request.StyleType).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"style_type\""); + + } + if (request.StylePreset != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.StylePreset).HasValue ? (request.StylePreset).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"style_preset\""); + + } + if (request.StyleCodes != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.StyleCodes!, x => x))}]"), + name: "\"style_codes\""); + + } + if (styleReferenceImages != default) + { + + for (var __iStyleReferenceImages = 0; __iStyleReferenceImages < styleReferenceImages.Count; __iStyleReferenceImages++) + { + var __fileNameStyleReferenceImages = styleReferenceImagesFileNames != null && + __iStyleReferenceImages < styleReferenceImagesFileNames.Count && + styleReferenceImagesFileNames[__iStyleReferenceImages] != null + ? styleReferenceImagesFileNames[__iStyleReferenceImages] + : $"file{__iStyleReferenceImages}.bin"; + var __contentStyleReferenceImages = new global::System.Net.Http.StreamContent(styleReferenceImages[__iStyleReferenceImages]); + __contentStyleReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + __fileNameStyleReferenceImages is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(__fileNameStyleReferenceImages) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentStyleReferenceImages, + name: "\"style_reference_images\"", + fileName: $"\"{__fileNameStyleReferenceImages}\""); + if (__contentStyleReferenceImages.Headers.ContentDisposition != null) + { + __contentStyleReferenceImages.Headers.ContentDisposition.FileNameStar = null; + } + } + + } + if (request.EnableCopyrightDetection != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"enable_copyright_detection\""); + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImagesInpaintPostInpaintImageV2IdeogramV3Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesInpaintPostInpaintImageV2IdeogramV3", + methodName: "ImagesInpaintPostInpaintImageV2IdeogramV3Async", + pathTemplate: "\"/v2/image/inpaint/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesInpaintPostInpaintImageV2IdeogramV3", + methodName: "ImagesInpaintPostInpaintImageV2IdeogramV3Async", + pathTemplate: "\"/v2/image/inpaint/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesInpaintPostInpaintImageV2IdeogramV3", + methodName: "ImagesInpaintPostInpaintImageV2IdeogramV3Async", + pathTemplate: "\"/v2/image/inpaint/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImagesInpaintPostInpaintImageV2IdeogramV3Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesInpaintPostInpaintImageV2IdeogramV3", + methodName: "ImagesInpaintPostInpaintImageV2IdeogramV3Async", + pathTemplate: "\"/v2/image/inpaint/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesInpaintPostInpaintImageV2IdeogramV3", + methodName: "ImagesInpaintPostInpaintImageV2IdeogramV3Async", + pathTemplate: "\"/v2/image/inpaint/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // A referenced resource was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImagesInpaintPostInpaintImageV2IdeogramV3ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::Ideogram.InpaintImageIdeogramV3Response.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::Ideogram.InpaintImageIdeogramV3Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Inpaint with Ideogram 3.0
+ /// Repaint the masked region of a source image with Ideogram 3.0, guided
+ /// by a text prompt. Upload the source `image` and its `mask` using
+ /// `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt describing the repainted result. + /// + /// + /// The source image to repaint (max 25MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The output matches its size, snapped to the nearest supported resolution. + /// + /// + /// The source image to repaint (max 25MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The output matches its size, snapped to the nearest supported resolution. + /// + /// + /// A black-and-white mask the same size as the source image. Black marks the region to repaint. JPEG, PNG, and WEBP are supported. Multipart requests only. + /// + /// + /// A black-and-white mask the same size as the source image. Black marks the region to repaint. JPEG, PNG, and WEBP are supported. Multipart requests only. + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The rendering speed to use.
+ /// Default Value: default + /// + /// + /// The style type to generate with.
+ /// Default Value: general + /// + /// + /// A predefined style preset to apply to the repainted images. Cannot be combined with style codes or style references. + /// + /// + /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images. + /// + /// + /// Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported. + /// + /// + /// Optional file names to use for the multipart 'style_reference_images' file parts. + /// + /// + /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the repainted images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ImagesInpaintPostInpaintImageV2IdeogramV3AsResponseAsync( + string prompt, + global::System.IO.Stream image, + string imagename, + global::System.IO.Stream mask, + string maskname, + bool? dryRun = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + int? numImages = default, + int? seed = default, + global::Ideogram.V2ImageInpaintIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed = default, + global::Ideogram.IdeogramV3StyleType? styleType = default, + global::Ideogram.IdeogramV3StylePreset? stylePreset = default, + global::System.Collections.Generic.IList? styleCodes = default, + global::System.Collections.Generic.IReadOnlyList? styleReferenceImages = default, + global::System.Collections.Generic.IReadOnlyList? styleReferenceImagesFileNames = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + mask = mask ?? throw new global::System.ArgumentNullException(nameof(mask)); + var request = new global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3Request + { + Prompt = prompt, + Image = global::System.Array.Empty(), + Imagename = imagename, + Mask = global::System.Array.Empty(), + Maskname = maskname, + MagicPrompt = magicPrompt, + NumImages = numImages, + Seed = seed, + RenderingSpeed = renderingSpeed, + StyleType = styleType, + StylePreset = stylePreset, + StyleCodes = styleCodes, + StyleReferenceImages = new global::System.Collections.Generic.List(), + EnableCopyrightDetection = enableCopyrightDetection, + Async = async, + WebhookUrl = webhookUrl, + }; + PrepareArguments( + client: HttpClient); + PrepareImagesInpaintPostInpaintImageV2IdeogramV3Arguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImagesInpaintPostInpaintImageV2IdeogramV3SecurityRequirements, + operationName: "ImagesInpaintPostInpaintImageV2IdeogramV3Async"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/inpaint/ideogram-3", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + var __contentMask = new global::System.Net.Http.StreamContent(mask); + __contentMask.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Maskname is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Maskname) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentMask, + name: "\"mask\"", + fileName: request.Maskname != null ? $"\"{request.Maskname}\"" : string.Empty); + if (__contentMask.Headers.ContentDisposition != null) + { + __contentMask.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.MagicPrompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.MagicPrompt).HasValue ? (request.MagicPrompt).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"magic_prompt\""); + + } + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (request.RenderingSpeed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"rendering_speed\""); + + } + if (request.StyleType != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.StyleType).HasValue ? (request.StyleType).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"style_type\""); + + } + if (request.StylePreset != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.StylePreset).HasValue ? (request.StylePreset).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"style_preset\""); + + } + if (request.StyleCodes != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.StyleCodes!, x => x))}]"), + name: "\"style_codes\""); + + } + if (styleReferenceImages != default) + { + + for (var __iStyleReferenceImages = 0; __iStyleReferenceImages < styleReferenceImages.Count; __iStyleReferenceImages++) + { + var __fileNameStyleReferenceImages = styleReferenceImagesFileNames != null && + __iStyleReferenceImages < styleReferenceImagesFileNames.Count && + styleReferenceImagesFileNames[__iStyleReferenceImages] != null + ? styleReferenceImagesFileNames[__iStyleReferenceImages] + : $"file{__iStyleReferenceImages}.bin"; + var __contentStyleReferenceImages = new global::System.Net.Http.StreamContent(styleReferenceImages[__iStyleReferenceImages]); + __contentStyleReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + __fileNameStyleReferenceImages is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(__fileNameStyleReferenceImages) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentStyleReferenceImages, + name: "\"style_reference_images\"", + fileName: $"\"{__fileNameStyleReferenceImages}\""); + if (__contentStyleReferenceImages.Headers.ContentDisposition != null) + { + __contentStyleReferenceImages.Headers.ContentDisposition.FileNameStar = null; + } + } + + } + if (request.EnableCopyrightDetection != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"enable_copyright_detection\""); + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImagesInpaintPostInpaintImageV2IdeogramV3Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesInpaintPostInpaintImageV2IdeogramV3", + methodName: "ImagesInpaintPostInpaintImageV2IdeogramV3Async", + pathTemplate: "\"/v2/image/inpaint/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesInpaintPostInpaintImageV2IdeogramV3", + methodName: "ImagesInpaintPostInpaintImageV2IdeogramV3Async", + pathTemplate: "\"/v2/image/inpaint/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesInpaintPostInpaintImageV2IdeogramV3", + methodName: "ImagesInpaintPostInpaintImageV2IdeogramV3Async", + pathTemplate: "\"/v2/image/inpaint/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImagesInpaintPostInpaintImageV2IdeogramV3Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesInpaintPostInpaintImageV2IdeogramV3", + methodName: "ImagesInpaintPostInpaintImageV2IdeogramV3Async", + pathTemplate: "\"/v2/image/inpaint/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesInpaintPostInpaintImageV2IdeogramV3", + methodName: "ImagesInpaintPostInpaintImageV2IdeogramV3Async", + pathTemplate: "\"/v2/image/inpaint/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // A referenced resource was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImagesInpaintPostInpaintImageV2IdeogramV3ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.InpaintImageIdeogramV3Response.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.InpaintImageIdeogramV3Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesInpaintClient.ImagesInpaintPostInpaintImageV2IdeogramV3Character.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesInpaintClient.ImagesInpaintPostInpaintImageV2IdeogramV3Character.g.cs new file mode 100644 index 00000000..21c62e53 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.ImagesInpaintClient.ImagesInpaintPostInpaintImageV2IdeogramV3Character.g.cs @@ -0,0 +1,3274 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class ImagesInpaintClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_ImagesInpaintPostInpaintImageV2IdeogramV3CharacterSecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_ImagesInpaintPostInpaintImageV2IdeogramV3CharacterSecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_ImagesInpaintPostInpaintImageV2IdeogramV3CharacterSecurityRequirement0, + }; + partial void PrepareImagesInpaintPostInpaintImageV2IdeogramV3CharacterArguments( + global::System.Net.Http.HttpClient httpClient, + ref bool? dryRun, + global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterRequest request); + partial void PrepareImagesInpaintPostInpaintImageV2IdeogramV3CharacterRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + bool? dryRun, + global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterRequest request); + partial void ProcessImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Inpaint a consistent character with Ideogram 3.0
+ /// Repaint the masked region of a source image with Ideogram 3.0 so it
+ /// features a consistent character. Upload the source `image`, its
+ /// `mask`, and a `character_reference_images` image (or use a saved
+ /// character) using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesInpaintPostInpaintImageV2IdeogramV3CharacterAsync( + + global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ImagesInpaintPostInpaintImageV2IdeogramV3CharacterAsResponseAsync( + + request: request, + dryRun: dryRun, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Inpaint a consistent character with Ideogram 3.0
+ /// Repaint the masked region of a source image with Ideogram 3.0 so it
+ /// features a consistent character. Upload the source `image`, its
+ /// `mask`, and a `character_reference_images` image (or use a saved
+ /// character) using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ImagesInpaintPostInpaintImageV2IdeogramV3CharacterAsResponseAsync( + + global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareImagesInpaintPostInpaintImageV2IdeogramV3CharacterArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImagesInpaintPostInpaintImageV2IdeogramV3CharacterSecurityRequirements, + operationName: "ImagesInpaintPostInpaintImageV2IdeogramV3CharacterAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/inpaint/ideogram-3-character", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + var __contentMask = new global::System.Net.Http.ByteArrayContent(request.Mask ?? global::System.Array.Empty()); + __contentMask.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Maskname is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Maskname) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentMask, + name: "\"mask\"", + fileName: request.Maskname != null ? $"\"{request.Maskname}\"" : string.Empty); + if (__contentMask.Headers.ContentDisposition != null) + { + __contentMask.Headers.ContentDisposition.FileNameStar = null; + } + + for (var __iCharacterReferenceImages = 0; __iCharacterReferenceImages < request.CharacterReferenceImages.Count; __iCharacterReferenceImages++) + { + var __contentCharacterReferenceImages = new global::System.Net.Http.ByteArrayContent(request.CharacterReferenceImages[__iCharacterReferenceImages]); + __contentCharacterReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); + __httpRequestContent.Add( + content: __contentCharacterReferenceImages, + name: "\"character_reference_images\"", + fileName: $"\"file{__iCharacterReferenceImages}.bin\""); + if (__contentCharacterReferenceImages.Headers.ContentDisposition != null) + { + __contentCharacterReferenceImages.Headers.ContentDisposition.FileNameStar = null; + } + } + + if (request.CharacterReferenceMask != default) + { + + var __contentCharacterReferenceMask = new global::System.Net.Http.ByteArrayContent(request.CharacterReferenceMask ?? global::System.Array.Empty()); + __contentCharacterReferenceMask.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.CharacterReferenceMaskname is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.CharacterReferenceMaskname) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentCharacterReferenceMask, + name: "\"character_reference_mask\"", + fileName: request.CharacterReferenceMaskname != null ? $"\"{request.CharacterReferenceMaskname}\"" : string.Empty); + if (__contentCharacterReferenceMask.Headers.ContentDisposition != null) + { + __contentCharacterReferenceMask.Headers.ContentDisposition.FileNameStar = null; + } + + } + if (request.MagicPrompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.MagicPrompt).HasValue ? (request.MagicPrompt).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"magic_prompt\""); + + } + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (request.RenderingSpeed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"rendering_speed\""); + + } + if (request.StyleType != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.StyleType).HasValue ? (request.StyleType).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"style_type\""); + + } + if (request.StyleCodes != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.StyleCodes!, x => x))}]"), + name: "\"style_codes\""); + + } + if (request.StyleReferenceImages != default) + { + + for (var __iStyleReferenceImages = 0; __iStyleReferenceImages < request.StyleReferenceImages.Count; __iStyleReferenceImages++) + { + var __contentStyleReferenceImages = new global::System.Net.Http.ByteArrayContent(request.StyleReferenceImages[__iStyleReferenceImages]); + __contentStyleReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); + __httpRequestContent.Add( + content: __contentStyleReferenceImages, + name: "\"style_reference_images\"", + fileName: $"\"file{__iStyleReferenceImages}.bin\""); + if (__contentStyleReferenceImages.Headers.ContentDisposition != null) + { + __contentStyleReferenceImages.Headers.ContentDisposition.FileNameStar = null; + } + } + + } + if (request.EnableCopyrightDetection != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"enable_copyright_detection\""); + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImagesInpaintPostInpaintImageV2IdeogramV3CharacterRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesInpaintPostInpaintImageV2IdeogramV3Character", + methodName: "ImagesInpaintPostInpaintImageV2IdeogramV3CharacterAsync", + pathTemplate: "\"/v2/image/inpaint/ideogram-3-character\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesInpaintPostInpaintImageV2IdeogramV3Character", + methodName: "ImagesInpaintPostInpaintImageV2IdeogramV3CharacterAsync", + pathTemplate: "\"/v2/image/inpaint/ideogram-3-character\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesInpaintPostInpaintImageV2IdeogramV3Character", + methodName: "ImagesInpaintPostInpaintImageV2IdeogramV3CharacterAsync", + pathTemplate: "\"/v2/image/inpaint/ideogram-3-character\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesInpaintPostInpaintImageV2IdeogramV3Character", + methodName: "ImagesInpaintPostInpaintImageV2IdeogramV3CharacterAsync", + pathTemplate: "\"/v2/image/inpaint/ideogram-3-character\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesInpaintPostInpaintImageV2IdeogramV3Character", + methodName: "ImagesInpaintPostInpaintImageV2IdeogramV3CharacterAsync", + pathTemplate: "\"/v2/image/inpaint/ideogram-3-character\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // A referenced resource was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.InpaintImageIdeogramV3CharacterResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.InpaintImageIdeogramV3CharacterResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Inpaint a consistent character with Ideogram 3.0
+ /// Repaint the masked region of a source image with Ideogram 3.0 so it
+ /// features a consistent character. Upload the source `image`, its
+ /// `mask`, and a `character_reference_images` image (or use a saved
+ /// character) using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt describing the repainted result. + /// + /// + /// The source image to repaint (max 25MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The output matches its size, snapped to the nearest supported resolution. + /// + /// + /// The source image to repaint (max 25MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The output matches its size, snapped to the nearest supported resolution. + /// + /// + /// A black-and-white mask the same size as the source image. Black marks the region to repaint. JPEG, PNG, and WEBP are supported. Multipart requests only. + /// + /// + /// A black-and-white mask the same size as the source image. Black marks the region to repaint. JPEG, PNG, and WEBP are supported. Multipart requests only. + /// + /// + /// An image to use as the character reference (max 25MB). JPEG, PNG, and WEBP are supported. + /// + /// + /// Optional grayscale mask for the character reference image, the same size as that image, marking where the character is. Only JPEG, PNG, and WEBP formats are supported. Multipart requests only; cannot be combined with `character_reference_collection_id`. + /// + /// + /// Optional grayscale mask for the character reference image, the same size as that image, marking where the character is. Only JPEG, PNG, and WEBP formats are supported. Multipart requests only; cannot be combined with `character_reference_collection_id`. + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The rendering speed to use.
+ /// Default Value: default + /// + /// + /// The style type to repaint the character with. Defaults to `auto`. `realistic` and `fiction` are supported for character-only requests; style codes or style references (not both) require `auto`. For API-key callers, combining a style with a character requires that feature to be enabled for their account.
+ /// Default Value: auto + /// + /// + /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images. + /// + /// + /// Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported. Cannot be combined with `style_codes`. + /// + /// + /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the repainted images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesInpaintPostInpaintImageV2IdeogramV3CharacterAsync( + string prompt, + byte[] image, + string imagename, + byte[] mask, + string maskname, + global::System.Collections.Generic.IList characterReferenceImages, + bool? dryRun = default, + byte[]? characterReferenceMask = default, + string? characterReferenceMaskname = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + int? numImages = default, + int? seed = default, + global::Ideogram.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed = default, + global::Ideogram.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType? styleType = default, + global::System.Collections.Generic.IList? styleCodes = default, + global::System.Collections.Generic.IList? styleReferenceImages = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterRequest + { + Prompt = prompt, + Image = image, + Imagename = imagename, + Mask = mask, + Maskname = maskname, + CharacterReferenceImages = characterReferenceImages, + CharacterReferenceMask = characterReferenceMask, + CharacterReferenceMaskname = characterReferenceMaskname, + MagicPrompt = magicPrompt, + NumImages = numImages, + Seed = seed, + RenderingSpeed = renderingSpeed, + StyleType = styleType, + StyleCodes = styleCodes, + StyleReferenceImages = styleReferenceImages, + EnableCopyrightDetection = enableCopyrightDetection, + Async = async, + WebhookUrl = webhookUrl, + }; + + return await ImagesInpaintPostInpaintImageV2IdeogramV3CharacterAsync( + dryRun: dryRun, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// Inpaint a consistent character with Ideogram 3.0
+ /// Repaint the masked region of a source image with Ideogram 3.0 so it
+ /// features a consistent character. Upload the source `image`, its
+ /// `mask`, and a `character_reference_images` image (or use a saved
+ /// character) using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt describing the repainted result. + /// + /// + /// The source image to repaint (max 25MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The output matches its size, snapped to the nearest supported resolution. + /// + /// + /// The source image to repaint (max 25MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The output matches its size, snapped to the nearest supported resolution. + /// + /// + /// A black-and-white mask the same size as the source image. Black marks the region to repaint. JPEG, PNG, and WEBP are supported. Multipart requests only. + /// + /// + /// A black-and-white mask the same size as the source image. Black marks the region to repaint. JPEG, PNG, and WEBP are supported. Multipart requests only. + /// + /// + /// An image to use as the character reference (max 25MB). JPEG, PNG, and WEBP are supported. + /// + /// + /// Optional file names to use for the multipart 'character_reference_images' file parts. + /// + /// + /// Optional grayscale mask for the character reference image, the same size as that image, marking where the character is. Only JPEG, PNG, and WEBP formats are supported. Multipart requests only; cannot be combined with `character_reference_collection_id`. + /// + /// + /// Optional grayscale mask for the character reference image, the same size as that image, marking where the character is. Only JPEG, PNG, and WEBP formats are supported. Multipart requests only; cannot be combined with `character_reference_collection_id`. + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The rendering speed to use.
+ /// Default Value: default + /// + /// + /// The style type to repaint the character with. Defaults to `auto`. `realistic` and `fiction` are supported for character-only requests; style codes or style references (not both) require `auto`. For API-key callers, combining a style with a character requires that feature to be enabled for their account.
+ /// Default Value: auto + /// + /// + /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images. + /// + /// + /// Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported. Cannot be combined with `style_codes`. + /// + /// + /// Optional file names to use for the multipart 'style_reference_images' file parts. + /// + /// + /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the repainted images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesInpaintPostInpaintImageV2IdeogramV3CharacterAsync( + string prompt, + global::System.IO.Stream image, + string imagename, + global::System.IO.Stream mask, + string maskname, + global::System.Collections.Generic.IReadOnlyList characterReferenceImages, + bool? dryRun = default, + global::System.Collections.Generic.IReadOnlyList? characterReferenceImagesFileNames = default, + global::System.IO.Stream? characterReferenceMask = default, + string? characterReferenceMaskname = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + int? numImages = default, + int? seed = default, + global::Ideogram.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed = default, + global::Ideogram.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType? styleType = default, + global::System.Collections.Generic.IList? styleCodes = default, + global::System.Collections.Generic.IReadOnlyList? styleReferenceImages = default, + global::System.Collections.Generic.IReadOnlyList? styleReferenceImagesFileNames = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + mask = mask ?? throw new global::System.ArgumentNullException(nameof(mask)); + characterReferenceImages = characterReferenceImages ?? throw new global::System.ArgumentNullException(nameof(characterReferenceImages)); + var request = new global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterRequest + { + Prompt = prompt, + Image = global::System.Array.Empty(), + Imagename = imagename, + Mask = global::System.Array.Empty(), + Maskname = maskname, + CharacterReferenceImages = new global::System.Collections.Generic.List(), + CharacterReferenceMask = global::System.Array.Empty(), + CharacterReferenceMaskname = characterReferenceMaskname, + MagicPrompt = magicPrompt, + NumImages = numImages, + Seed = seed, + RenderingSpeed = renderingSpeed, + StyleType = styleType, + StyleCodes = styleCodes, + StyleReferenceImages = new global::System.Collections.Generic.List(), + EnableCopyrightDetection = enableCopyrightDetection, + Async = async, + WebhookUrl = webhookUrl, + }; + PrepareArguments( + client: HttpClient); + PrepareImagesInpaintPostInpaintImageV2IdeogramV3CharacterArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImagesInpaintPostInpaintImageV2IdeogramV3CharacterSecurityRequirements, + operationName: "ImagesInpaintPostInpaintImageV2IdeogramV3CharacterAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/inpaint/ideogram-3-character", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + var __contentMask = new global::System.Net.Http.StreamContent(mask); + __contentMask.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Maskname is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Maskname) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentMask, + name: "\"mask\"", + fileName: request.Maskname != null ? $"\"{request.Maskname}\"" : string.Empty); + if (__contentMask.Headers.ContentDisposition != null) + { + __contentMask.Headers.ContentDisposition.FileNameStar = null; + } + + for (var __iCharacterReferenceImages = 0; __iCharacterReferenceImages < characterReferenceImages.Count; __iCharacterReferenceImages++) + { + var __fileNameCharacterReferenceImages = characterReferenceImagesFileNames != null && + __iCharacterReferenceImages < characterReferenceImagesFileNames.Count && + characterReferenceImagesFileNames[__iCharacterReferenceImages] != null + ? characterReferenceImagesFileNames[__iCharacterReferenceImages] + : $"file{__iCharacterReferenceImages}.bin"; + var __contentCharacterReferenceImages = new global::System.Net.Http.StreamContent(characterReferenceImages[__iCharacterReferenceImages]); + __contentCharacterReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + __fileNameCharacterReferenceImages is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(__fileNameCharacterReferenceImages) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentCharacterReferenceImages, + name: "\"character_reference_images\"", + fileName: $"\"{__fileNameCharacterReferenceImages}\""); + if (__contentCharacterReferenceImages.Headers.ContentDisposition != null) + { + __contentCharacterReferenceImages.Headers.ContentDisposition.FileNameStar = null; + } + } + + if (characterReferenceMask != default) + { + + var __contentCharacterReferenceMask = new global::System.Net.Http.StreamContent(characterReferenceMask); + __contentCharacterReferenceMask.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.CharacterReferenceMaskname is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.CharacterReferenceMaskname) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentCharacterReferenceMask, + name: "\"character_reference_mask\"", + fileName: request.CharacterReferenceMaskname != null ? $"\"{request.CharacterReferenceMaskname}\"" : string.Empty); + if (__contentCharacterReferenceMask.Headers.ContentDisposition != null) + { + __contentCharacterReferenceMask.Headers.ContentDisposition.FileNameStar = null; + } + + } + if (request.MagicPrompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.MagicPrompt).HasValue ? (request.MagicPrompt).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"magic_prompt\""); + + } + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (request.RenderingSpeed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"rendering_speed\""); + + } + if (request.StyleType != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.StyleType).HasValue ? (request.StyleType).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"style_type\""); + + } + if (request.StyleCodes != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.StyleCodes!, x => x))}]"), + name: "\"style_codes\""); + + } + if (styleReferenceImages != default) + { + + for (var __iStyleReferenceImages = 0; __iStyleReferenceImages < styleReferenceImages.Count; __iStyleReferenceImages++) + { + var __fileNameStyleReferenceImages = styleReferenceImagesFileNames != null && + __iStyleReferenceImages < styleReferenceImagesFileNames.Count && + styleReferenceImagesFileNames[__iStyleReferenceImages] != null + ? styleReferenceImagesFileNames[__iStyleReferenceImages] + : $"file{__iStyleReferenceImages}.bin"; + var __contentStyleReferenceImages = new global::System.Net.Http.StreamContent(styleReferenceImages[__iStyleReferenceImages]); + __contentStyleReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + __fileNameStyleReferenceImages is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(__fileNameStyleReferenceImages) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentStyleReferenceImages, + name: "\"style_reference_images\"", + fileName: $"\"{__fileNameStyleReferenceImages}\""); + if (__contentStyleReferenceImages.Headers.ContentDisposition != null) + { + __contentStyleReferenceImages.Headers.ContentDisposition.FileNameStar = null; + } + } + + } + if (request.EnableCopyrightDetection != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"enable_copyright_detection\""); + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImagesInpaintPostInpaintImageV2IdeogramV3CharacterRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesInpaintPostInpaintImageV2IdeogramV3Character", + methodName: "ImagesInpaintPostInpaintImageV2IdeogramV3CharacterAsync", + pathTemplate: "\"/v2/image/inpaint/ideogram-3-character\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesInpaintPostInpaintImageV2IdeogramV3Character", + methodName: "ImagesInpaintPostInpaintImageV2IdeogramV3CharacterAsync", + pathTemplate: "\"/v2/image/inpaint/ideogram-3-character\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesInpaintPostInpaintImageV2IdeogramV3Character", + methodName: "ImagesInpaintPostInpaintImageV2IdeogramV3CharacterAsync", + pathTemplate: "\"/v2/image/inpaint/ideogram-3-character\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesInpaintPostInpaintImageV2IdeogramV3Character", + methodName: "ImagesInpaintPostInpaintImageV2IdeogramV3CharacterAsync", + pathTemplate: "\"/v2/image/inpaint/ideogram-3-character\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesInpaintPostInpaintImageV2IdeogramV3Character", + methodName: "ImagesInpaintPostInpaintImageV2IdeogramV3CharacterAsync", + pathTemplate: "\"/v2/image/inpaint/ideogram-3-character\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // A referenced resource was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::Ideogram.InpaintImageIdeogramV3CharacterResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::Ideogram.InpaintImageIdeogramV3CharacterResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Inpaint a consistent character with Ideogram 3.0
+ /// Repaint the masked region of a source image with Ideogram 3.0 so it
+ /// features a consistent character. Upload the source `image`, its
+ /// `mask`, and a `character_reference_images` image (or use a saved
+ /// character) using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt describing the repainted result. + /// + /// + /// The source image to repaint (max 25MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The output matches its size, snapped to the nearest supported resolution. + /// + /// + /// The source image to repaint (max 25MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The output matches its size, snapped to the nearest supported resolution. + /// + /// + /// A black-and-white mask the same size as the source image. Black marks the region to repaint. JPEG, PNG, and WEBP are supported. Multipart requests only. + /// + /// + /// A black-and-white mask the same size as the source image. Black marks the region to repaint. JPEG, PNG, and WEBP are supported. Multipart requests only. + /// + /// + /// An image to use as the character reference (max 25MB). JPEG, PNG, and WEBP are supported. + /// + /// + /// Optional file names to use for the multipart 'character_reference_images' file parts. + /// + /// + /// Optional grayscale mask for the character reference image, the same size as that image, marking where the character is. Only JPEG, PNG, and WEBP formats are supported. Multipart requests only; cannot be combined with `character_reference_collection_id`. + /// + /// + /// Optional grayscale mask for the character reference image, the same size as that image, marking where the character is. Only JPEG, PNG, and WEBP formats are supported. Multipart requests only; cannot be combined with `character_reference_collection_id`. + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The rendering speed to use.
+ /// Default Value: default + /// + /// + /// The style type to repaint the character with. Defaults to `auto`. `realistic` and `fiction` are supported for character-only requests; style codes or style references (not both) require `auto`. For API-key callers, combining a style with a character requires that feature to be enabled for their account.
+ /// Default Value: auto + /// + /// + /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images. + /// + /// + /// Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported. Cannot be combined with `style_codes`. + /// + /// + /// Optional file names to use for the multipart 'style_reference_images' file parts. + /// + /// + /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the repainted images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ImagesInpaintPostInpaintImageV2IdeogramV3CharacterAsResponseAsync( + string prompt, + global::System.IO.Stream image, + string imagename, + global::System.IO.Stream mask, + string maskname, + global::System.Collections.Generic.IReadOnlyList characterReferenceImages, + bool? dryRun = default, + global::System.Collections.Generic.IReadOnlyList? characterReferenceImagesFileNames = default, + global::System.IO.Stream? characterReferenceMask = default, + string? characterReferenceMaskname = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + int? numImages = default, + int? seed = default, + global::Ideogram.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed = default, + global::Ideogram.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType? styleType = default, + global::System.Collections.Generic.IList? styleCodes = default, + global::System.Collections.Generic.IReadOnlyList? styleReferenceImages = default, + global::System.Collections.Generic.IReadOnlyList? styleReferenceImagesFileNames = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + mask = mask ?? throw new global::System.ArgumentNullException(nameof(mask)); + characterReferenceImages = characterReferenceImages ?? throw new global::System.ArgumentNullException(nameof(characterReferenceImages)); + var request = new global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterRequest + { + Prompt = prompt, + Image = global::System.Array.Empty(), + Imagename = imagename, + Mask = global::System.Array.Empty(), + Maskname = maskname, + CharacterReferenceImages = new global::System.Collections.Generic.List(), + CharacterReferenceMask = global::System.Array.Empty(), + CharacterReferenceMaskname = characterReferenceMaskname, + MagicPrompt = magicPrompt, + NumImages = numImages, + Seed = seed, + RenderingSpeed = renderingSpeed, + StyleType = styleType, + StyleCodes = styleCodes, + StyleReferenceImages = new global::System.Collections.Generic.List(), + EnableCopyrightDetection = enableCopyrightDetection, + Async = async, + WebhookUrl = webhookUrl, + }; + PrepareArguments( + client: HttpClient); + PrepareImagesInpaintPostInpaintImageV2IdeogramV3CharacterArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImagesInpaintPostInpaintImageV2IdeogramV3CharacterSecurityRequirements, + operationName: "ImagesInpaintPostInpaintImageV2IdeogramV3CharacterAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/inpaint/ideogram-3-character", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + var __contentMask = new global::System.Net.Http.StreamContent(mask); + __contentMask.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Maskname is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Maskname) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentMask, + name: "\"mask\"", + fileName: request.Maskname != null ? $"\"{request.Maskname}\"" : string.Empty); + if (__contentMask.Headers.ContentDisposition != null) + { + __contentMask.Headers.ContentDisposition.FileNameStar = null; + } + + for (var __iCharacterReferenceImages = 0; __iCharacterReferenceImages < characterReferenceImages.Count; __iCharacterReferenceImages++) + { + var __fileNameCharacterReferenceImages = characterReferenceImagesFileNames != null && + __iCharacterReferenceImages < characterReferenceImagesFileNames.Count && + characterReferenceImagesFileNames[__iCharacterReferenceImages] != null + ? characterReferenceImagesFileNames[__iCharacterReferenceImages] + : $"file{__iCharacterReferenceImages}.bin"; + var __contentCharacterReferenceImages = new global::System.Net.Http.StreamContent(characterReferenceImages[__iCharacterReferenceImages]); + __contentCharacterReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + __fileNameCharacterReferenceImages is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(__fileNameCharacterReferenceImages) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentCharacterReferenceImages, + name: "\"character_reference_images\"", + fileName: $"\"{__fileNameCharacterReferenceImages}\""); + if (__contentCharacterReferenceImages.Headers.ContentDisposition != null) + { + __contentCharacterReferenceImages.Headers.ContentDisposition.FileNameStar = null; + } + } + + if (characterReferenceMask != default) + { + + var __contentCharacterReferenceMask = new global::System.Net.Http.StreamContent(characterReferenceMask); + __contentCharacterReferenceMask.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.CharacterReferenceMaskname is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.CharacterReferenceMaskname) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentCharacterReferenceMask, + name: "\"character_reference_mask\"", + fileName: request.CharacterReferenceMaskname != null ? $"\"{request.CharacterReferenceMaskname}\"" : string.Empty); + if (__contentCharacterReferenceMask.Headers.ContentDisposition != null) + { + __contentCharacterReferenceMask.Headers.ContentDisposition.FileNameStar = null; + } + + } + if (request.MagicPrompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.MagicPrompt).HasValue ? (request.MagicPrompt).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"magic_prompt\""); + + } + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (request.RenderingSpeed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"rendering_speed\""); + + } + if (request.StyleType != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.StyleType).HasValue ? (request.StyleType).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"style_type\""); + + } + if (request.StyleCodes != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.StyleCodes!, x => x))}]"), + name: "\"style_codes\""); + + } + if (styleReferenceImages != default) + { + + for (var __iStyleReferenceImages = 0; __iStyleReferenceImages < styleReferenceImages.Count; __iStyleReferenceImages++) + { + var __fileNameStyleReferenceImages = styleReferenceImagesFileNames != null && + __iStyleReferenceImages < styleReferenceImagesFileNames.Count && + styleReferenceImagesFileNames[__iStyleReferenceImages] != null + ? styleReferenceImagesFileNames[__iStyleReferenceImages] + : $"file{__iStyleReferenceImages}.bin"; + var __contentStyleReferenceImages = new global::System.Net.Http.StreamContent(styleReferenceImages[__iStyleReferenceImages]); + __contentStyleReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + __fileNameStyleReferenceImages is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(__fileNameStyleReferenceImages) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentStyleReferenceImages, + name: "\"style_reference_images\"", + fileName: $"\"{__fileNameStyleReferenceImages}\""); + if (__contentStyleReferenceImages.Headers.ContentDisposition != null) + { + __contentStyleReferenceImages.Headers.ContentDisposition.FileNameStar = null; + } + } + + } + if (request.EnableCopyrightDetection != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"enable_copyright_detection\""); + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImagesInpaintPostInpaintImageV2IdeogramV3CharacterRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesInpaintPostInpaintImageV2IdeogramV3Character", + methodName: "ImagesInpaintPostInpaintImageV2IdeogramV3CharacterAsync", + pathTemplate: "\"/v2/image/inpaint/ideogram-3-character\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesInpaintPostInpaintImageV2IdeogramV3Character", + methodName: "ImagesInpaintPostInpaintImageV2IdeogramV3CharacterAsync", + pathTemplate: "\"/v2/image/inpaint/ideogram-3-character\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesInpaintPostInpaintImageV2IdeogramV3Character", + methodName: "ImagesInpaintPostInpaintImageV2IdeogramV3CharacterAsync", + pathTemplate: "\"/v2/image/inpaint/ideogram-3-character\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesInpaintPostInpaintImageV2IdeogramV3Character", + methodName: "ImagesInpaintPostInpaintImageV2IdeogramV3CharacterAsync", + pathTemplate: "\"/v2/image/inpaint/ideogram-3-character\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesInpaintPostInpaintImageV2IdeogramV3Character", + methodName: "ImagesInpaintPostInpaintImageV2IdeogramV3CharacterAsync", + pathTemplate: "\"/v2/image/inpaint/ideogram-3-character\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // A referenced resource was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.InpaintImageIdeogramV3CharacterResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.InpaintImageIdeogramV3CharacterResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesInpaintClient.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModel.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesInpaintClient.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModel.g.cs new file mode 100644 index 00000000..38956d4f --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.ImagesInpaintClient.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModel.g.cs @@ -0,0 +1,3049 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class ImagesInpaintClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelSecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelSecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelSecurityRequirement0, + }; + partial void PrepareImagesInpaintPostInpaintImageV2IdeogramV3CustomModelArguments( + global::System.Net.Http.HttpClient httpClient, + ref bool? dryRun, + global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelRequest request); + partial void PrepareImagesInpaintPostInpaintImageV2IdeogramV3CustomModelRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + bool? dryRun, + global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelRequest request); + partial void ProcessImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Inpaint with a custom Ideogram 3.0 model
+ /// Repaint the masked region of a source image with a custom Ideogram 3.0
+ /// model, passed as `custom_model_uri`. Upload the source `image` and its
+ /// `mask` using `multipart/form-data`. Returns results directly by
+ /// default; set `async` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelAsync( + + global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelAsResponseAsync( + + request: request, + dryRun: dryRun, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Inpaint with a custom Ideogram 3.0 model
+ /// Repaint the masked region of a source image with a custom Ideogram 3.0
+ /// model, passed as `custom_model_uri`. Upload the source `image` and its
+ /// `mask` using `multipart/form-data`. Returns results directly by
+ /// default; set `async` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelAsResponseAsync( + + global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareImagesInpaintPostInpaintImageV2IdeogramV3CustomModelArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelSecurityRequirements, + operationName: "ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/inpaint/ideogram-3-custom-model", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.CustomModelUri ?? string.Empty), + name: "\"custom_model_uri\""); + + var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + var __contentMask = new global::System.Net.Http.ByteArrayContent(request.Mask ?? global::System.Array.Empty()); + __contentMask.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Maskname is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Maskname) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentMask, + name: "\"mask\"", + fileName: request.Maskname != null ? $"\"{request.Maskname}\"" : string.Empty); + if (__contentMask.Headers.ContentDisposition != null) + { + __contentMask.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.MagicPrompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.MagicPrompt).HasValue ? (request.MagicPrompt).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"magic_prompt\""); + + } + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (request.RenderingSpeed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"rendering_speed\""); + + } + if (request.StylePreset != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.StylePreset).HasValue ? (request.StylePreset).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"style_preset\""); + + } + if (request.StyleCodes != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.StyleCodes!, x => x))}]"), + name: "\"style_codes\""); + + } + if (request.StyleReferenceImages != default) + { + + for (var __iStyleReferenceImages = 0; __iStyleReferenceImages < request.StyleReferenceImages.Count; __iStyleReferenceImages++) + { + var __contentStyleReferenceImages = new global::System.Net.Http.ByteArrayContent(request.StyleReferenceImages[__iStyleReferenceImages]); + __contentStyleReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); + __httpRequestContent.Add( + content: __contentStyleReferenceImages, + name: "\"style_reference_images\"", + fileName: $"\"file{__iStyleReferenceImages}.bin\""); + if (__contentStyleReferenceImages.Headers.ContentDisposition != null) + { + __contentStyleReferenceImages.Headers.ContentDisposition.FileNameStar = null; + } + } + + } + if (request.EnableCopyrightDetection != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"enable_copyright_detection\""); + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImagesInpaintPostInpaintImageV2IdeogramV3CustomModelRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesInpaintPostInpaintImageV2IdeogramV3CustomModel", + methodName: "ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelAsync", + pathTemplate: "\"/v2/image/inpaint/ideogram-3-custom-model\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesInpaintPostInpaintImageV2IdeogramV3CustomModel", + methodName: "ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelAsync", + pathTemplate: "\"/v2/image/inpaint/ideogram-3-custom-model\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesInpaintPostInpaintImageV2IdeogramV3CustomModel", + methodName: "ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelAsync", + pathTemplate: "\"/v2/image/inpaint/ideogram-3-custom-model\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesInpaintPostInpaintImageV2IdeogramV3CustomModel", + methodName: "ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelAsync", + pathTemplate: "\"/v2/image/inpaint/ideogram-3-custom-model\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesInpaintPostInpaintImageV2IdeogramV3CustomModel", + methodName: "ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelAsync", + pathTemplate: "\"/v2/image/inpaint/ideogram-3-custom-model\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The caller cannot use the requested custom model. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // A referenced resource was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.InpaintImageIdeogramV3CustomModelResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.InpaintImageIdeogramV3CustomModelResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Inpaint with a custom Ideogram 3.0 model
+ /// Repaint the masked region of a source image with a custom Ideogram 3.0
+ /// model, passed as `custom_model_uri`. Upload the source `image` and its
+ /// `mask` using `multipart/form-data`. Returns results directly by
+ /// default; set `async` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt describing the repainted result. + /// + /// + /// The custom model URI returned by the custom-model API, in the form `model/<model_name>/version/<version_name>`. The authenticated user or organization must have access to the model. + /// + /// + /// The source image to repaint (max 25MB), as JPEG, PNG, or WEBP. Multipart requests only. + /// + /// + /// The source image to repaint (max 25MB), as JPEG, PNG, or WEBP. Multipart requests only. + /// + /// + /// A black-and-white mask the same size as the source image, as JPEG, PNG, or WEBP. Black marks the region to repaint. Multipart requests only. + /// + /// + /// A black-and-white mask the same size as the source image, as JPEG, PNG, or WEBP. Black marks the region to repaint. Multipart requests only. + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The rendering speed to use. When omitted, the server chooses a speed supported by the selected custom model. + /// + /// + /// A predefined style preset. Cannot be combined with style codes or style references. + /// + /// + /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images. + /// + /// + /// Images to use as style references (max 10, max 25MB each), as JPEG, PNG, or WEBP. + /// + /// + /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images return `is_image_safe: false`. + /// + /// + /// When false, wait until the images are ready. When true, return as soon as the request is accepted and poll `GET /v2/generations/{generation_id}`.
+ /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelAsync( + string prompt, + string customModelUri, + byte[] image, + string imagename, + byte[] mask, + string maskname, + bool? dryRun = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + int? numImages = default, + int? seed = default, + global::Ideogram.V2ImageInpaintIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed = default, + global::Ideogram.IdeogramV3StylePreset? stylePreset = default, + global::System.Collections.Generic.IList? styleCodes = default, + global::System.Collections.Generic.IList? styleReferenceImages = default, + bool? enableCopyrightDetection = default, + bool? async = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelRequest + { + Prompt = prompt, + CustomModelUri = customModelUri, + Image = image, + Imagename = imagename, + Mask = mask, + Maskname = maskname, + MagicPrompt = magicPrompt, + NumImages = numImages, + Seed = seed, + RenderingSpeed = renderingSpeed, + StylePreset = stylePreset, + StyleCodes = styleCodes, + StyleReferenceImages = styleReferenceImages, + EnableCopyrightDetection = enableCopyrightDetection, + Async = async, + }; + + return await ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelAsync( + dryRun: dryRun, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// Inpaint with a custom Ideogram 3.0 model
+ /// Repaint the masked region of a source image with a custom Ideogram 3.0
+ /// model, passed as `custom_model_uri`. Upload the source `image` and its
+ /// `mask` using `multipart/form-data`. Returns results directly by
+ /// default; set `async` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt describing the repainted result. + /// + /// + /// The custom model URI returned by the custom-model API, in the form `model/<model_name>/version/<version_name>`. The authenticated user or organization must have access to the model. + /// + /// + /// The source image to repaint (max 25MB), as JPEG, PNG, or WEBP. Multipart requests only. + /// + /// + /// The source image to repaint (max 25MB), as JPEG, PNG, or WEBP. Multipart requests only. + /// + /// + /// A black-and-white mask the same size as the source image, as JPEG, PNG, or WEBP. Black marks the region to repaint. Multipart requests only. + /// + /// + /// A black-and-white mask the same size as the source image, as JPEG, PNG, or WEBP. Black marks the region to repaint. Multipart requests only. + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The rendering speed to use. When omitted, the server chooses a speed supported by the selected custom model. + /// + /// + /// A predefined style preset. Cannot be combined with style codes or style references. + /// + /// + /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images. + /// + /// + /// Images to use as style references (max 10, max 25MB each), as JPEG, PNG, or WEBP. + /// + /// + /// Optional file names to use for the multipart 'style_reference_images' file parts. + /// + /// + /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images return `is_image_safe: false`. + /// + /// + /// When false, wait until the images are ready. When true, return as soon as the request is accepted and poll `GET /v2/generations/{generation_id}`.
+ /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelAsync( + string prompt, + string customModelUri, + global::System.IO.Stream image, + string imagename, + global::System.IO.Stream mask, + string maskname, + bool? dryRun = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + int? numImages = default, + int? seed = default, + global::Ideogram.V2ImageInpaintIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed = default, + global::Ideogram.IdeogramV3StylePreset? stylePreset = default, + global::System.Collections.Generic.IList? styleCodes = default, + global::System.Collections.Generic.IReadOnlyList? styleReferenceImages = default, + global::System.Collections.Generic.IReadOnlyList? styleReferenceImagesFileNames = default, + bool? enableCopyrightDetection = default, + bool? async = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + mask = mask ?? throw new global::System.ArgumentNullException(nameof(mask)); + var request = new global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelRequest + { + Prompt = prompt, + CustomModelUri = customModelUri, + Image = global::System.Array.Empty(), + Imagename = imagename, + Mask = global::System.Array.Empty(), + Maskname = maskname, + MagicPrompt = magicPrompt, + NumImages = numImages, + Seed = seed, + RenderingSpeed = renderingSpeed, + StylePreset = stylePreset, + StyleCodes = styleCodes, + StyleReferenceImages = new global::System.Collections.Generic.List(), + EnableCopyrightDetection = enableCopyrightDetection, + Async = async, + }; + PrepareArguments( + client: HttpClient); + PrepareImagesInpaintPostInpaintImageV2IdeogramV3CustomModelArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelSecurityRequirements, + operationName: "ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/inpaint/ideogram-3-custom-model", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.CustomModelUri ?? string.Empty), + name: "\"custom_model_uri\""); + + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + var __contentMask = new global::System.Net.Http.StreamContent(mask); + __contentMask.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Maskname is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Maskname) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentMask, + name: "\"mask\"", + fileName: request.Maskname != null ? $"\"{request.Maskname}\"" : string.Empty); + if (__contentMask.Headers.ContentDisposition != null) + { + __contentMask.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.MagicPrompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.MagicPrompt).HasValue ? (request.MagicPrompt).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"magic_prompt\""); + + } + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (request.RenderingSpeed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"rendering_speed\""); + + } + if (request.StylePreset != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.StylePreset).HasValue ? (request.StylePreset).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"style_preset\""); + + } + if (request.StyleCodes != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.StyleCodes!, x => x))}]"), + name: "\"style_codes\""); + + } + if (styleReferenceImages != default) + { + + for (var __iStyleReferenceImages = 0; __iStyleReferenceImages < styleReferenceImages.Count; __iStyleReferenceImages++) + { + var __fileNameStyleReferenceImages = styleReferenceImagesFileNames != null && + __iStyleReferenceImages < styleReferenceImagesFileNames.Count && + styleReferenceImagesFileNames[__iStyleReferenceImages] != null + ? styleReferenceImagesFileNames[__iStyleReferenceImages] + : $"file{__iStyleReferenceImages}.bin"; + var __contentStyleReferenceImages = new global::System.Net.Http.StreamContent(styleReferenceImages[__iStyleReferenceImages]); + __contentStyleReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + __fileNameStyleReferenceImages is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(__fileNameStyleReferenceImages) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentStyleReferenceImages, + name: "\"style_reference_images\"", + fileName: $"\"{__fileNameStyleReferenceImages}\""); + if (__contentStyleReferenceImages.Headers.ContentDisposition != null) + { + __contentStyleReferenceImages.Headers.ContentDisposition.FileNameStar = null; + } + } + + } + if (request.EnableCopyrightDetection != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"enable_copyright_detection\""); + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImagesInpaintPostInpaintImageV2IdeogramV3CustomModelRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesInpaintPostInpaintImageV2IdeogramV3CustomModel", + methodName: "ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelAsync", + pathTemplate: "\"/v2/image/inpaint/ideogram-3-custom-model\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesInpaintPostInpaintImageV2IdeogramV3CustomModel", + methodName: "ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelAsync", + pathTemplate: "\"/v2/image/inpaint/ideogram-3-custom-model\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesInpaintPostInpaintImageV2IdeogramV3CustomModel", + methodName: "ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelAsync", + pathTemplate: "\"/v2/image/inpaint/ideogram-3-custom-model\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesInpaintPostInpaintImageV2IdeogramV3CustomModel", + methodName: "ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelAsync", + pathTemplate: "\"/v2/image/inpaint/ideogram-3-custom-model\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesInpaintPostInpaintImageV2IdeogramV3CustomModel", + methodName: "ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelAsync", + pathTemplate: "\"/v2/image/inpaint/ideogram-3-custom-model\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The caller cannot use the requested custom model. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // A referenced resource was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::Ideogram.InpaintImageIdeogramV3CustomModelResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::Ideogram.InpaintImageIdeogramV3CustomModelResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Inpaint with a custom Ideogram 3.0 model
+ /// Repaint the masked region of a source image with a custom Ideogram 3.0
+ /// model, passed as `custom_model_uri`. Upload the source `image` and its
+ /// `mask` using `multipart/form-data`. Returns results directly by
+ /// default; set `async` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt describing the repainted result. + /// + /// + /// The custom model URI returned by the custom-model API, in the form `model/<model_name>/version/<version_name>`. The authenticated user or organization must have access to the model. + /// + /// + /// The source image to repaint (max 25MB), as JPEG, PNG, or WEBP. Multipart requests only. + /// + /// + /// The source image to repaint (max 25MB), as JPEG, PNG, or WEBP. Multipart requests only. + /// + /// + /// A black-and-white mask the same size as the source image, as JPEG, PNG, or WEBP. Black marks the region to repaint. Multipart requests only. + /// + /// + /// A black-and-white mask the same size as the source image, as JPEG, PNG, or WEBP. Black marks the region to repaint. Multipart requests only. + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The rendering speed to use. When omitted, the server chooses a speed supported by the selected custom model. + /// + /// + /// A predefined style preset. Cannot be combined with style codes or style references. + /// + /// + /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images. + /// + /// + /// Images to use as style references (max 10, max 25MB each), as JPEG, PNG, or WEBP. + /// + /// + /// Optional file names to use for the multipart 'style_reference_images' file parts. + /// + /// + /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images return `is_image_safe: false`. + /// + /// + /// When false, wait until the images are ready. When true, return as soon as the request is accepted and poll `GET /v2/generations/{generation_id}`.
+ /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelAsResponseAsync( + string prompt, + string customModelUri, + global::System.IO.Stream image, + string imagename, + global::System.IO.Stream mask, + string maskname, + bool? dryRun = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + int? numImages = default, + int? seed = default, + global::Ideogram.V2ImageInpaintIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed = default, + global::Ideogram.IdeogramV3StylePreset? stylePreset = default, + global::System.Collections.Generic.IList? styleCodes = default, + global::System.Collections.Generic.IReadOnlyList? styleReferenceImages = default, + global::System.Collections.Generic.IReadOnlyList? styleReferenceImagesFileNames = default, + bool? enableCopyrightDetection = default, + bool? async = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + mask = mask ?? throw new global::System.ArgumentNullException(nameof(mask)); + var request = new global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelRequest + { + Prompt = prompt, + CustomModelUri = customModelUri, + Image = global::System.Array.Empty(), + Imagename = imagename, + Mask = global::System.Array.Empty(), + Maskname = maskname, + MagicPrompt = magicPrompt, + NumImages = numImages, + Seed = seed, + RenderingSpeed = renderingSpeed, + StylePreset = stylePreset, + StyleCodes = styleCodes, + StyleReferenceImages = new global::System.Collections.Generic.List(), + EnableCopyrightDetection = enableCopyrightDetection, + Async = async, + }; + PrepareArguments( + client: HttpClient); + PrepareImagesInpaintPostInpaintImageV2IdeogramV3CustomModelArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelSecurityRequirements, + operationName: "ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/inpaint/ideogram-3-custom-model", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.CustomModelUri ?? string.Empty), + name: "\"custom_model_uri\""); + + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + var __contentMask = new global::System.Net.Http.StreamContent(mask); + __contentMask.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Maskname is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Maskname) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentMask, + name: "\"mask\"", + fileName: request.Maskname != null ? $"\"{request.Maskname}\"" : string.Empty); + if (__contentMask.Headers.ContentDisposition != null) + { + __contentMask.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.MagicPrompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.MagicPrompt).HasValue ? (request.MagicPrompt).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"magic_prompt\""); + + } + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (request.RenderingSpeed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"rendering_speed\""); + + } + if (request.StylePreset != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.StylePreset).HasValue ? (request.StylePreset).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"style_preset\""); + + } + if (request.StyleCodes != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.StyleCodes!, x => x))}]"), + name: "\"style_codes\""); + + } + if (styleReferenceImages != default) + { + + for (var __iStyleReferenceImages = 0; __iStyleReferenceImages < styleReferenceImages.Count; __iStyleReferenceImages++) + { + var __fileNameStyleReferenceImages = styleReferenceImagesFileNames != null && + __iStyleReferenceImages < styleReferenceImagesFileNames.Count && + styleReferenceImagesFileNames[__iStyleReferenceImages] != null + ? styleReferenceImagesFileNames[__iStyleReferenceImages] + : $"file{__iStyleReferenceImages}.bin"; + var __contentStyleReferenceImages = new global::System.Net.Http.StreamContent(styleReferenceImages[__iStyleReferenceImages]); + __contentStyleReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + __fileNameStyleReferenceImages is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(__fileNameStyleReferenceImages) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentStyleReferenceImages, + name: "\"style_reference_images\"", + fileName: $"\"{__fileNameStyleReferenceImages}\""); + if (__contentStyleReferenceImages.Headers.ContentDisposition != null) + { + __contentStyleReferenceImages.Headers.ContentDisposition.FileNameStar = null; + } + } + + } + if (request.EnableCopyrightDetection != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"enable_copyright_detection\""); + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImagesInpaintPostInpaintImageV2IdeogramV3CustomModelRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesInpaintPostInpaintImageV2IdeogramV3CustomModel", + methodName: "ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelAsync", + pathTemplate: "\"/v2/image/inpaint/ideogram-3-custom-model\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesInpaintPostInpaintImageV2IdeogramV3CustomModel", + methodName: "ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelAsync", + pathTemplate: "\"/v2/image/inpaint/ideogram-3-custom-model\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesInpaintPostInpaintImageV2IdeogramV3CustomModel", + methodName: "ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelAsync", + pathTemplate: "\"/v2/image/inpaint/ideogram-3-custom-model\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesInpaintPostInpaintImageV2IdeogramV3CustomModel", + methodName: "ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelAsync", + pathTemplate: "\"/v2/image/inpaint/ideogram-3-custom-model\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesInpaintPostInpaintImageV2IdeogramV3CustomModel", + methodName: "ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelAsync", + pathTemplate: "\"/v2/image/inpaint/ideogram-3-custom-model\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The caller cannot use the requested custom model. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // A referenced resource was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.InpaintImageIdeogramV3CustomModelResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.InpaintImageIdeogramV3CustomModelResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesInpaintClient.PostInpaintImageV2IdeogramV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesInpaintClient.PostInpaintImageV2IdeogramV3.g.cs deleted file mode 100644 index 6854ca92..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ImagesInpaintClient.PostInpaintImageV2IdeogramV3.g.cs +++ /dev/null @@ -1,1133 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ImagesInpaintClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostInpaintImageV2IdeogramV3SecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostInpaintImageV2IdeogramV3SecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostInpaintImageV2IdeogramV3SecurityRequirement0, - }; - partial void PreparePostInpaintImageV2IdeogramV3Arguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? dryRun, - global::Ideogram.InpaintImageIdeogramV3Request request); - partial void PreparePostInpaintImageV2IdeogramV3Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? dryRun, - global::Ideogram.InpaintImageIdeogramV3Request request); - partial void ProcessPostInpaintImageV2IdeogramV3Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostInpaintImageV2IdeogramV3ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Inpaint with Ideogram 3.0
- /// Repaint the masked region of a source image with Ideogram 3.0, guided
- /// by a text prompt. Upload the source `image` and its `mask` using
- /// `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostInpaintImageV2IdeogramV3Async( - - global::Ideogram.InpaintImageIdeogramV3Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostInpaintImageV2IdeogramV3AsResponseAsync( - - request: request, - dryRun: dryRun, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Inpaint with Ideogram 3.0
- /// Repaint the masked region of a source image with Ideogram 3.0, guided
- /// by a text prompt. Upload the source `image` and its `mask` using
- /// `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostInpaintImageV2IdeogramV3AsResponseAsync( - - global::Ideogram.InpaintImageIdeogramV3Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostInpaintImageV2IdeogramV3Arguments( - httpClient: HttpClient, - dryRun: ref dryRun, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostInpaintImageV2IdeogramV3SecurityRequirements, - operationName: "PostInpaintImageV2IdeogramV3Async"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/image/inpaint/ideogram-3", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - if (request.ImageAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ImageAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"image_asset_identifier\""); - - } - if (request.Image != default) - { - - var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.MaskAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.MaskAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"mask_asset_identifier\""); - - } - if (request.Mask != default) - { - - var __contentMask = new global::System.Net.Http.ByteArrayContent(request.Mask ?? global::System.Array.Empty()); - __contentMask.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Maskname is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Maskname) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentMask, - name: "\"mask\"", - fileName: request.Maskname != null ? $"\"{request.Maskname}\"" : string.Empty); - if (__contentMask.Headers.ContentDisposition != null) - { - __contentMask.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.MagicPrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.MagicPrompt).HasValue ? (request.MagicPrompt).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"magic_prompt\""); - - } - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.RenderingSpeed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"rendering_speed\""); - - } - if (request.StyleType != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.StyleType).HasValue ? (request.StyleType).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"style_type\""); - - } - if (request.StylePreset != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.StylePreset).HasValue ? (request.StylePreset).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"style_preset\""); - - } - if (request.StyleCodes != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.StyleCodes!, x => x))}]"), - name: "\"style_codes\""); - - } - if (request.StyleReferenceCollectionId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.StyleReferenceCollectionId ?? string.Empty), - name: "\"style_reference_collection_id\""); - - } - if (request.StyleReferenceCollectionVersionId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.StyleReferenceCollectionVersionId ?? string.Empty), - name: "\"style_reference_collection_version_id\""); - - } - if (request.StyleReferenceAssetIdentifiers != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.StyleReferenceAssetIdentifiers!, x => x.ToJson(JsonSerializerContext)))}]"), - name: "\"style_reference_asset_identifiers\""); - - } - if (request.StyleReferenceImages != default) - { - - for (var __iStyleReferenceImages = 0; __iStyleReferenceImages < request.StyleReferenceImages.Count; __iStyleReferenceImages++) - { - var __contentStyleReferenceImages = new global::System.Net.Http.ByteArrayContent(request.StyleReferenceImages[__iStyleReferenceImages]); - __contentStyleReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); - __httpRequestContent.Add( - content: __contentStyleReferenceImages, - name: "\"style_reference_images\"", - fileName: $"\"file{__iStyleReferenceImages}.bin\""); - if (__contentStyleReferenceImages.Headers.ContentDisposition != null) - { - __contentStyleReferenceImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - if (request.EnableCopyrightDetection != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"enable_copyright_detection\""); - - } - if (request.Async != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"async\""); - - } - if (request.WebhookUrl != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), - name: "\"webhook_url\""); - - } - if (request.Private != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"private\""); - - } - if (request.TargetCollectionId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.TargetCollectionId ?? string.Empty), - name: "\"target_collection_id\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostInpaintImageV2IdeogramV3Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - dryRun: dryRun, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostInpaintImageV2IdeogramV3", - methodName: "PostInpaintImageV2IdeogramV3Async", - pathTemplate: "\"/v2/image/inpaint/ideogram-3\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostInpaintImageV2IdeogramV3", - methodName: "PostInpaintImageV2IdeogramV3Async", - pathTemplate: "\"/v2/image/inpaint/ideogram-3\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostInpaintImageV2IdeogramV3", - methodName: "PostInpaintImageV2IdeogramV3Async", - pathTemplate: "\"/v2/image/inpaint/ideogram-3\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostInpaintImageV2IdeogramV3Response( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostInpaintImageV2IdeogramV3", - methodName: "PostInpaintImageV2IdeogramV3Async", - pathTemplate: "\"/v2/image/inpaint/ideogram-3\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostInpaintImageV2IdeogramV3", - methodName: "PostInpaintImageV2IdeogramV3Async", - pathTemplate: "\"/v2/image/inpaint/ideogram-3\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 500) - { - string? __content_500 = null; - global::System.Exception? __exception_500 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_500 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_500, - responseBody: __content_500, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostInpaintImageV2IdeogramV3ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.InpaintImageIdeogramV3Response.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.InpaintImageIdeogramV3Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Inpaint with Ideogram 3.0
- /// Repaint the masked region of a source image with Ideogram 3.0, guided
- /// by a text prompt. Upload the source `image` and its `mask` using
- /// `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// The prompt describing the repainted result. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The source image to repaint (max 25MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The output matches its size, snapped to the nearest supported resolution. - /// - /// - /// The source image to repaint (max 25MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The output matches its size, snapped to the nearest supported resolution. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// A black-and-white mask the same size as the source image. Black marks the region to repaint. JPEG, PNG, and WEBP are supported. Multipart requests only. - /// - /// - /// A black-and-white mask the same size as the source image. Black marks the region to repaint. JPEG, PNG, and WEBP are supported. Multipart requests only. - /// - /// - /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
- /// Default Value: auto - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The rendering speed to use.
- /// Default Value: default - /// - /// - /// The style type to generate with.
- /// Default Value: general
- /// Example: general - /// - /// - /// A predefined style preset to apply to the repainted images. Cannot be combined with style codes or style references. - /// - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - /// - /// - /// A saved style to apply, by its URL-safe base64 collection id. Takes priority over `style_reference_images` if both are supplied. - /// - /// - /// Optional URL-safe base64 version id pinning a specific version of the `style_reference_collection_id` collection. Ignored without it. - /// - /// - /// Existing upload or generated image assets to use as style references, by reference. Takes priority over `style_reference_images` if both are supplied. - /// - /// - /// Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported. - /// - /// - /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. - /// - /// - /// When false (the default), the request waits until the repainted images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostInpaintImageV2IdeogramV3Async( - string prompt, - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - global::Ideogram.AssetIdentifier? maskAssetIdentifier = default, - byte[]? mask = default, - string? maskname = default, - global::Ideogram.MagicPromptMode? magicPrompt = default, - int? numImages = default, - int? seed = default, - global::Ideogram.InpaintImageIdeogramV3RequestRenderingSpeed? renderingSpeed = default, - global::Ideogram.IdeogramV3StyleType? styleType = default, - global::Ideogram.IdeogramV3StylePreset? stylePreset = default, - global::System.Collections.Generic.IList? styleCodes = default, - string? styleReferenceCollectionId = default, - string? styleReferenceCollectionVersionId = default, - global::System.Collections.Generic.IList? styleReferenceAssetIdentifiers = default, - global::System.Collections.Generic.IList? styleReferenceImages = default, - bool? enableCopyrightDetection = default, - bool? async = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.InpaintImageIdeogramV3Request - { - Prompt = prompt, - ImageAssetIdentifier = imageAssetIdentifier, - Image = image, - Imagename = imagename, - MaskAssetIdentifier = maskAssetIdentifier, - Mask = mask, - Maskname = maskname, - MagicPrompt = magicPrompt, - NumImages = numImages, - Seed = seed, - RenderingSpeed = renderingSpeed, - StyleType = styleType, - StylePreset = stylePreset, - StyleCodes = styleCodes, - StyleReferenceCollectionId = styleReferenceCollectionId, - StyleReferenceCollectionVersionId = styleReferenceCollectionVersionId, - StyleReferenceAssetIdentifiers = styleReferenceAssetIdentifiers, - StyleReferenceImages = styleReferenceImages, - EnableCopyrightDetection = enableCopyrightDetection, - Async = async, - WebhookUrl = webhookUrl, - Private = @private, - TargetCollectionId = targetCollectionId, - }; - - return await PostInpaintImageV2IdeogramV3Async( - dryRun: dryRun, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesInpaintClient.PostInpaintImageV2IdeogramV3Character.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesInpaintClient.PostInpaintImageV2IdeogramV3Character.g.cs deleted file mode 100644 index cc4fdd01..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ImagesInpaintClient.PostInpaintImageV2IdeogramV3Character.g.cs +++ /dev/null @@ -1,1249 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ImagesInpaintClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostInpaintImageV2IdeogramV3CharacterSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostInpaintImageV2IdeogramV3CharacterSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostInpaintImageV2IdeogramV3CharacterSecurityRequirement0, - }; - partial void PreparePostInpaintImageV2IdeogramV3CharacterArguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? dryRun, - global::Ideogram.InpaintImageIdeogramV3CharacterRequest request); - partial void PreparePostInpaintImageV2IdeogramV3CharacterRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? dryRun, - global::Ideogram.InpaintImageIdeogramV3CharacterRequest request); - partial void ProcessPostInpaintImageV2IdeogramV3CharacterResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostInpaintImageV2IdeogramV3CharacterResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Inpaint a consistent character with Ideogram 3.0
- /// Repaint the masked region of a source image with Ideogram 3.0 so it
- /// features a consistent character. Upload the source `image`, its
- /// `mask`, and a `character_reference_images` image (or use a saved
- /// character) using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostInpaintImageV2IdeogramV3CharacterAsync( - - global::Ideogram.InpaintImageIdeogramV3CharacterRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostInpaintImageV2IdeogramV3CharacterAsResponseAsync( - - request: request, - dryRun: dryRun, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Inpaint a consistent character with Ideogram 3.0
- /// Repaint the masked region of a source image with Ideogram 3.0 so it
- /// features a consistent character. Upload the source `image`, its
- /// `mask`, and a `character_reference_images` image (or use a saved
- /// character) using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostInpaintImageV2IdeogramV3CharacterAsResponseAsync( - - global::Ideogram.InpaintImageIdeogramV3CharacterRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostInpaintImageV2IdeogramV3CharacterArguments( - httpClient: HttpClient, - dryRun: ref dryRun, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostInpaintImageV2IdeogramV3CharacterSecurityRequirements, - operationName: "PostInpaintImageV2IdeogramV3CharacterAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/image/inpaint/ideogram-3-character", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - if (request.ImageAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ImageAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"image_asset_identifier\""); - - } - if (request.Image != default) - { - - var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.MaskAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.MaskAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"mask_asset_identifier\""); - - } - if (request.Mask != default) - { - - var __contentMask = new global::System.Net.Http.ByteArrayContent(request.Mask ?? global::System.Array.Empty()); - __contentMask.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Maskname is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Maskname) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentMask, - name: "\"mask\"", - fileName: request.Maskname != null ? $"\"{request.Maskname}\"" : string.Empty); - if (__contentMask.Headers.ContentDisposition != null) - { - __contentMask.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.CharacterReferenceCollectionId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.CharacterReferenceCollectionId ?? string.Empty), - name: "\"character_reference_collection_id\""); - - } - if (request.CharacterReferenceCollectionVersionId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.CharacterReferenceCollectionVersionId ?? string.Empty), - name: "\"character_reference_collection_version_id\""); - - } - if (request.CharacterReferenceAssetIdentifiers != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.CharacterReferenceAssetIdentifiers!, x => x.ToJson(JsonSerializerContext)))}]"), - name: "\"character_reference_asset_identifiers\""); - - } - if (request.CharacterReferenceImages != default) - { - - for (var __iCharacterReferenceImages = 0; __iCharacterReferenceImages < request.CharacterReferenceImages.Count; __iCharacterReferenceImages++) - { - var __contentCharacterReferenceImages = new global::System.Net.Http.ByteArrayContent(request.CharacterReferenceImages[__iCharacterReferenceImages]); - __contentCharacterReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); - __httpRequestContent.Add( - content: __contentCharacterReferenceImages, - name: "\"character_reference_images\"", - fileName: $"\"file{__iCharacterReferenceImages}.bin\""); - if (__contentCharacterReferenceImages.Headers.ContentDisposition != null) - { - __contentCharacterReferenceImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - if (request.CharacterReferenceMaskAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.CharacterReferenceMaskAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"character_reference_mask_asset_identifier\""); - - } - if (request.CharacterReferenceMask != default) - { - - var __contentCharacterReferenceMask = new global::System.Net.Http.ByteArrayContent(request.CharacterReferenceMask ?? global::System.Array.Empty()); - __contentCharacterReferenceMask.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.CharacterReferenceMaskname is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.CharacterReferenceMaskname) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentCharacterReferenceMask, - name: "\"character_reference_mask\"", - fileName: request.CharacterReferenceMaskname != null ? $"\"{request.CharacterReferenceMaskname}\"" : string.Empty); - if (__contentCharacterReferenceMask.Headers.ContentDisposition != null) - { - __contentCharacterReferenceMask.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.MagicPrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.MagicPrompt).HasValue ? (request.MagicPrompt).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"magic_prompt\""); - - } - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.RenderingSpeed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"rendering_speed\""); - - } - if (request.StyleType != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.StyleType).HasValue ? (request.StyleType).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"style_type\""); - - } - if (request.StyleCodes != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.StyleCodes!, x => x))}]"), - name: "\"style_codes\""); - - } - if (request.StyleReferenceCollectionId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.StyleReferenceCollectionId ?? string.Empty), - name: "\"style_reference_collection_id\""); - - } - if (request.StyleReferenceCollectionVersionId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.StyleReferenceCollectionVersionId ?? string.Empty), - name: "\"style_reference_collection_version_id\""); - - } - if (request.StyleReferenceAssetIdentifiers != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.StyleReferenceAssetIdentifiers!, x => x.ToJson(JsonSerializerContext)))}]"), - name: "\"style_reference_asset_identifiers\""); - - } - if (request.StyleReferenceImages != default) - { - - for (var __iStyleReferenceImages = 0; __iStyleReferenceImages < request.StyleReferenceImages.Count; __iStyleReferenceImages++) - { - var __contentStyleReferenceImages = new global::System.Net.Http.ByteArrayContent(request.StyleReferenceImages[__iStyleReferenceImages]); - __contentStyleReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); - __httpRequestContent.Add( - content: __contentStyleReferenceImages, - name: "\"style_reference_images\"", - fileName: $"\"file{__iStyleReferenceImages}.bin\""); - if (__contentStyleReferenceImages.Headers.ContentDisposition != null) - { - __contentStyleReferenceImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - if (request.EnableCopyrightDetection != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"enable_copyright_detection\""); - - } - if (request.Async != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"async\""); - - } - if (request.WebhookUrl != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), - name: "\"webhook_url\""); - - } - if (request.Private != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"private\""); - - } - if (request.TargetCollectionId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.TargetCollectionId ?? string.Empty), - name: "\"target_collection_id\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostInpaintImageV2IdeogramV3CharacterRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - dryRun: dryRun, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostInpaintImageV2IdeogramV3Character", - methodName: "PostInpaintImageV2IdeogramV3CharacterAsync", - pathTemplate: "\"/v2/image/inpaint/ideogram-3-character\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostInpaintImageV2IdeogramV3Character", - methodName: "PostInpaintImageV2IdeogramV3CharacterAsync", - pathTemplate: "\"/v2/image/inpaint/ideogram-3-character\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostInpaintImageV2IdeogramV3Character", - methodName: "PostInpaintImageV2IdeogramV3CharacterAsync", - pathTemplate: "\"/v2/image/inpaint/ideogram-3-character\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostInpaintImageV2IdeogramV3CharacterResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostInpaintImageV2IdeogramV3Character", - methodName: "PostInpaintImageV2IdeogramV3CharacterAsync", - pathTemplate: "\"/v2/image/inpaint/ideogram-3-character\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostInpaintImageV2IdeogramV3Character", - methodName: "PostInpaintImageV2IdeogramV3CharacterAsync", - pathTemplate: "\"/v2/image/inpaint/ideogram-3-character\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 500) - { - string? __content_500 = null; - global::System.Exception? __exception_500 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_500 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_500, - responseBody: __content_500, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostInpaintImageV2IdeogramV3CharacterResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.InpaintImageIdeogramV3CharacterResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.InpaintImageIdeogramV3CharacterResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Inpaint a consistent character with Ideogram 3.0
- /// Repaint the masked region of a source image with Ideogram 3.0 so it
- /// features a consistent character. Upload the source `image`, its
- /// `mask`, and a `character_reference_images` image (or use a saved
- /// character) using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// The prompt describing the repainted result. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The source image to repaint (max 25MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The output matches its size, snapped to the nearest supported resolution. - /// - /// - /// The source image to repaint (max 25MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The output matches its size, snapped to the nearest supported resolution. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// A black-and-white mask the same size as the source image. Black marks the region to repaint. JPEG, PNG, and WEBP are supported. Multipart requests only. - /// - /// - /// A black-and-white mask the same size as the source image. Black marks the region to repaint. JPEG, PNG, and WEBP are supported. Multipart requests only. - /// - /// - /// A saved character to feature, by its URL-safe base64 collection id. Takes priority over `character_reference_images` if both are supplied. - /// - /// - /// Optional URL-safe base64 version id pinning a specific version of the `character_reference_collection_id` collection. Ignored without it. - /// - /// - /// An existing upload or generated image asset to use as the character reference, by reference. Takes priority over `character_reference_images` if both are supplied. - /// - /// - /// An image to use as the character reference (max 25MB). JPEG, PNG, and WEBP are supported. - /// - /// - /// An existing upload or generated image asset to use as the character reference mask, by reference. The same rules as `character_reference_mask` apply. Takes priority over `character_reference_mask` if both are supplied. - /// - /// - /// Optional grayscale mask for the character reference image, the same size as that image, marking where the character is. Only JPEG, PNG, and WEBP formats are supported. Multipart requests only; cannot be combined with `character_reference_collection_id`. - /// - /// - /// Optional grayscale mask for the character reference image, the same size as that image, marking where the character is. Only JPEG, PNG, and WEBP formats are supported. Multipart requests only; cannot be combined with `character_reference_collection_id`. - /// - /// - /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
- /// Default Value: auto - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The rendering speed to use.
- /// Default Value: default - /// - /// - /// The style type to repaint the character with. Defaults to `auto`. `realistic` and `fiction` are supported for character-only requests; style codes or style references (not both) require `auto`. For API-key callers, combining a style with a character requires that feature to be enabled for their account.
- /// Default Value: auto - /// - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - /// - /// - /// A saved style to apply, by its URL-safe base64 collection id. Takes priority over `style_reference_images` if both are supplied. Cannot be combined with `style_codes`. - /// - /// - /// Optional URL-safe base64 version id pinning a specific version of the `style_reference_collection_id` collection. Ignored without it. - /// - /// - /// Existing upload or generated image assets to use as style references, by reference. Takes priority over `style_reference_images` if both are supplied. Cannot be combined with `style_codes`. - /// - /// - /// Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported. Cannot be combined with `style_codes`. - /// - /// - /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. - /// - /// - /// When false (the default), the request waits until the repainted images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostInpaintImageV2IdeogramV3CharacterAsync( - string prompt, - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - global::Ideogram.AssetIdentifier? maskAssetIdentifier = default, - byte[]? mask = default, - string? maskname = default, - string? characterReferenceCollectionId = default, - string? characterReferenceCollectionVersionId = default, - global::System.Collections.Generic.IList? characterReferenceAssetIdentifiers = default, - global::System.Collections.Generic.IList? characterReferenceImages = default, - global::Ideogram.AssetIdentifier? characterReferenceMaskAssetIdentifier = default, - byte[]? characterReferenceMask = default, - string? characterReferenceMaskname = default, - global::Ideogram.MagicPromptMode? magicPrompt = default, - int? numImages = default, - int? seed = default, - global::Ideogram.InpaintImageIdeogramV3CharacterRequestRenderingSpeed? renderingSpeed = default, - global::Ideogram.InpaintImageIdeogramV3CharacterRequestStyleType? styleType = default, - global::System.Collections.Generic.IList? styleCodes = default, - string? styleReferenceCollectionId = default, - string? styleReferenceCollectionVersionId = default, - global::System.Collections.Generic.IList? styleReferenceAssetIdentifiers = default, - global::System.Collections.Generic.IList? styleReferenceImages = default, - bool? enableCopyrightDetection = default, - bool? async = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.InpaintImageIdeogramV3CharacterRequest - { - Prompt = prompt, - ImageAssetIdentifier = imageAssetIdentifier, - Image = image, - Imagename = imagename, - MaskAssetIdentifier = maskAssetIdentifier, - Mask = mask, - Maskname = maskname, - CharacterReferenceCollectionId = characterReferenceCollectionId, - CharacterReferenceCollectionVersionId = characterReferenceCollectionVersionId, - CharacterReferenceAssetIdentifiers = characterReferenceAssetIdentifiers, - CharacterReferenceImages = characterReferenceImages, - CharacterReferenceMaskAssetIdentifier = characterReferenceMaskAssetIdentifier, - CharacterReferenceMask = characterReferenceMask, - CharacterReferenceMaskname = characterReferenceMaskname, - MagicPrompt = magicPrompt, - NumImages = numImages, - Seed = seed, - RenderingSpeed = renderingSpeed, - StyleType = styleType, - StyleCodes = styleCodes, - StyleReferenceCollectionId = styleReferenceCollectionId, - StyleReferenceCollectionVersionId = styleReferenceCollectionVersionId, - StyleReferenceAssetIdentifiers = styleReferenceAssetIdentifiers, - StyleReferenceImages = styleReferenceImages, - EnableCopyrightDetection = enableCopyrightDetection, - Async = async, - WebhookUrl = webhookUrl, - Private = @private, - TargetCollectionId = targetCollectionId, - }; - - return await PostInpaintImageV2IdeogramV3CharacterAsync( - dryRun: dryRun, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesInpaintClient.PostInpaintImageV2IdeogramV3CustomModel.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesInpaintClient.PostInpaintImageV2IdeogramV3CustomModel.g.cs deleted file mode 100644 index a2b2805e..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ImagesInpaintClient.PostInpaintImageV2IdeogramV3CustomModel.g.cs +++ /dev/null @@ -1,1133 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ImagesInpaintClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostInpaintImageV2IdeogramV3CustomModelSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostInpaintImageV2IdeogramV3CustomModelSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostInpaintImageV2IdeogramV3CustomModelSecurityRequirement0, - }; - partial void PreparePostInpaintImageV2IdeogramV3CustomModelArguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? dryRun, - global::Ideogram.InpaintImageIdeogramV3CustomModelRequest request); - partial void PreparePostInpaintImageV2IdeogramV3CustomModelRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? dryRun, - global::Ideogram.InpaintImageIdeogramV3CustomModelRequest request); - partial void ProcessPostInpaintImageV2IdeogramV3CustomModelResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostInpaintImageV2IdeogramV3CustomModelResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Inpaint with a custom Ideogram 3.0 model
- /// Repaint the masked region of a source image with a custom Ideogram 3.0
- /// model, passed as `custom_model_uri`. Upload the source `image` and its
- /// `mask` using `multipart/form-data`. Returns results directly by
- /// default; set `async` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostInpaintImageV2IdeogramV3CustomModelAsync( - - global::Ideogram.InpaintImageIdeogramV3CustomModelRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostInpaintImageV2IdeogramV3CustomModelAsResponseAsync( - - request: request, - dryRun: dryRun, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Inpaint with a custom Ideogram 3.0 model
- /// Repaint the masked region of a source image with a custom Ideogram 3.0
- /// model, passed as `custom_model_uri`. Upload the source `image` and its
- /// `mask` using `multipart/form-data`. Returns results directly by
- /// default; set `async` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostInpaintImageV2IdeogramV3CustomModelAsResponseAsync( - - global::Ideogram.InpaintImageIdeogramV3CustomModelRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostInpaintImageV2IdeogramV3CustomModelArguments( - httpClient: HttpClient, - dryRun: ref dryRun, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostInpaintImageV2IdeogramV3CustomModelSecurityRequirements, - operationName: "PostInpaintImageV2IdeogramV3CustomModelAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/image/inpaint/ideogram-3-custom-model", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.CustomModelUri ?? string.Empty), - name: "\"custom_model_uri\""); - - if (request.ImageAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ImageAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"image_asset_identifier\""); - - } - if (request.Image != default) - { - - var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.MaskAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.MaskAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"mask_asset_identifier\""); - - } - if (request.Mask != default) - { - - var __contentMask = new global::System.Net.Http.ByteArrayContent(request.Mask ?? global::System.Array.Empty()); - __contentMask.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Maskname is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Maskname) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentMask, - name: "\"mask\"", - fileName: request.Maskname != null ? $"\"{request.Maskname}\"" : string.Empty); - if (__contentMask.Headers.ContentDisposition != null) - { - __contentMask.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.MagicPrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.MagicPrompt).HasValue ? (request.MagicPrompt).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"magic_prompt\""); - - } - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.RenderingSpeed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"rendering_speed\""); - - } - if (request.StylePreset != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.StylePreset).HasValue ? (request.StylePreset).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"style_preset\""); - - } - if (request.StyleCodes != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.StyleCodes!, x => x))}]"), - name: "\"style_codes\""); - - } - if (request.StyleReferenceCollectionId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.StyleReferenceCollectionId ?? string.Empty), - name: "\"style_reference_collection_id\""); - - } - if (request.StyleReferenceCollectionVersionId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.StyleReferenceCollectionVersionId ?? string.Empty), - name: "\"style_reference_collection_version_id\""); - - } - if (request.StyleReferenceAssetIdentifiers != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.StyleReferenceAssetIdentifiers!, x => x.ToJson(JsonSerializerContext)))}]"), - name: "\"style_reference_asset_identifiers\""); - - } - if (request.StyleReferenceImages != default) - { - - for (var __iStyleReferenceImages = 0; __iStyleReferenceImages < request.StyleReferenceImages.Count; __iStyleReferenceImages++) - { - var __contentStyleReferenceImages = new global::System.Net.Http.ByteArrayContent(request.StyleReferenceImages[__iStyleReferenceImages]); - __contentStyleReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); - __httpRequestContent.Add( - content: __contentStyleReferenceImages, - name: "\"style_reference_images\"", - fileName: $"\"file{__iStyleReferenceImages}.bin\""); - if (__contentStyleReferenceImages.Headers.ContentDisposition != null) - { - __contentStyleReferenceImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - if (request.EnableCopyrightDetection != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"enable_copyright_detection\""); - - } - if (request.Async != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"async\""); - - } - if (request.Private != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"private\""); - - } - if (request.TargetCollectionId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.TargetCollectionId ?? string.Empty), - name: "\"target_collection_id\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostInpaintImageV2IdeogramV3CustomModelRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - dryRun: dryRun, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostInpaintImageV2IdeogramV3CustomModel", - methodName: "PostInpaintImageV2IdeogramV3CustomModelAsync", - pathTemplate: "\"/v2/image/inpaint/ideogram-3-custom-model\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostInpaintImageV2IdeogramV3CustomModel", - methodName: "PostInpaintImageV2IdeogramV3CustomModelAsync", - pathTemplate: "\"/v2/image/inpaint/ideogram-3-custom-model\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostInpaintImageV2IdeogramV3CustomModel", - methodName: "PostInpaintImageV2IdeogramV3CustomModelAsync", - pathTemplate: "\"/v2/image/inpaint/ideogram-3-custom-model\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostInpaintImageV2IdeogramV3CustomModelResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostInpaintImageV2IdeogramV3CustomModel", - methodName: "PostInpaintImageV2IdeogramV3CustomModelAsync", - pathTemplate: "\"/v2/image/inpaint/ideogram-3-custom-model\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostInpaintImageV2IdeogramV3CustomModel", - methodName: "PostInpaintImageV2IdeogramV3CustomModelAsync", - pathTemplate: "\"/v2/image/inpaint/ideogram-3-custom-model\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 500) - { - string? __content_500 = null; - global::System.Exception? __exception_500 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_500 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_500, - responseBody: __content_500, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostInpaintImageV2IdeogramV3CustomModelResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.InpaintImageIdeogramV3CustomModelResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.InpaintImageIdeogramV3CustomModelResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Inpaint with a custom Ideogram 3.0 model
- /// Repaint the masked region of a source image with a custom Ideogram 3.0
- /// model, passed as `custom_model_uri`. Upload the source `image` and its
- /// `mask` using `multipart/form-data`. Returns results directly by
- /// default; set `async` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// The prompt describing the repainted result. - /// - /// - /// The custom model URI returned by the custom-model API, in the form `model/<model_name>/version/<version_name>`. The authenticated user or organization must have access to the model.
- /// Example: model/my-custom-model/version/1 - /// - /// - /// The source image asset to repaint. Takes priority over `image`. - /// - /// - /// The source image to repaint (max 25MB), as JPEG, PNG, or WEBP. Multipart requests only. - /// - /// - /// The source image to repaint (max 25MB), as JPEG, PNG, or WEBP. Multipart requests only. - /// - /// - /// A black-and-white mask asset the same size as the source image. Black marks the region to repaint. Takes priority over `mask`. - /// - /// - /// A black-and-white mask the same size as the source image, as JPEG, PNG, or WEBP. Black marks the region to repaint. Multipart requests only. - /// - /// - /// A black-and-white mask the same size as the source image, as JPEG, PNG, or WEBP. Black marks the region to repaint. Multipart requests only. - /// - /// - /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
- /// Default Value: auto - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The rendering speed to use. When omitted, the server chooses a speed supported by the selected custom model. - /// - /// - /// A predefined style preset. Cannot be combined with style codes or style references. - /// - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - /// - /// - /// A saved style, by its URL-safe base64 collection id. Takes priority over `style_reference_images` if both are supplied. - /// - /// - /// Optional URL-safe base64 version id for the saved style. Ignored without `style_reference_collection_id`. - /// - /// - /// Existing upload or generated image assets to use as style references. Takes priority over raw style reference images. - /// - /// - /// Images to use as style references (max 10, max 25MB each), as JPEG, PNG, or WEBP. - /// - /// - /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images return `is_image_safe: false`. - /// - /// - /// When false, wait until the images are ready. When true, return as soon as the request is accepted and poll `GET /v2/generations/{generation_id}`.
- /// Default Value: false - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish it. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. Completed images are added to it. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostInpaintImageV2IdeogramV3CustomModelAsync( - string prompt, - string customModelUri, - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - global::Ideogram.AssetIdentifier? maskAssetIdentifier = default, - byte[]? mask = default, - string? maskname = default, - global::Ideogram.MagicPromptMode? magicPrompt = default, - int? numImages = default, - int? seed = default, - global::Ideogram.InpaintImageIdeogramV3CustomModelRequestRenderingSpeed? renderingSpeed = default, - global::Ideogram.IdeogramV3StylePreset? stylePreset = default, - global::System.Collections.Generic.IList? styleCodes = default, - string? styleReferenceCollectionId = default, - string? styleReferenceCollectionVersionId = default, - global::System.Collections.Generic.IList? styleReferenceAssetIdentifiers = default, - global::System.Collections.Generic.IList? styleReferenceImages = default, - bool? enableCopyrightDetection = default, - bool? async = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.InpaintImageIdeogramV3CustomModelRequest - { - Prompt = prompt, - CustomModelUri = customModelUri, - ImageAssetIdentifier = imageAssetIdentifier, - Image = image, - Imagename = imagename, - MaskAssetIdentifier = maskAssetIdentifier, - Mask = mask, - Maskname = maskname, - MagicPrompt = magicPrompt, - NumImages = numImages, - Seed = seed, - RenderingSpeed = renderingSpeed, - StylePreset = stylePreset, - StyleCodes = styleCodes, - StyleReferenceCollectionId = styleReferenceCollectionId, - StyleReferenceCollectionVersionId = styleReferenceCollectionVersionId, - StyleReferenceAssetIdentifiers = styleReferenceAssetIdentifiers, - StyleReferenceImages = styleReferenceImages, - EnableCopyrightDetection = enableCopyrightDetection, - Async = async, - Private = @private, - TargetCollectionId = targetCollectionId, - }; - - return await PostInpaintImageV2IdeogramV3CustomModelAsync( - dryRun: dryRun, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesInpaintClient.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesInpaintClient.g.cs index 68f24c84..73d00c2d 100644 --- a/src/libs/Ideogram/Generated/Ideogram.ImagesInpaintClient.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.ImagesInpaintClient.g.cs @@ -4,7 +4,6 @@ namespace Ideogram { /// - /// Repaint a masked region of an image with a specific model.
/// If no httpClient is provided, a new one will be created.
/// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. ///
diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesPreciseEdit.JsonSerializerContext.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesPreciseEdit.JsonSerializerContext.g.cs index 5f754f8c..b339420b 100644 --- a/src/libs/Ideogram/Generated/Ideogram.ImagesPreciseEdit.JsonSerializerContext.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.ImagesPreciseEdit.JsonSerializerContext.g.cs @@ -13,33 +13,29 @@ namespace Ideogram [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImagePreciseEditIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality), TypeInfoPropertyName = "V2ImagePreciseEditIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationKind), TypeInfoPropertyName = "GenerationKind2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GeneratedImageObject))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(byte[]))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AssetIdentifier))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationErrorResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PreciseEditImageIdeogram45Response))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationRejectReason), TypeInfoPropertyName = "GenerationRejectReason2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed), TypeInfoPropertyName = "GenerationErrorResponseTaskCompletionSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GeneratedImageObject))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationKind), TypeInfoPropertyName = "GenerationKind2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PreciseEditImageIdeogram45Response))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PreciseEditImageIdeogram45Request))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PreciseEditImageIdeogram45RequestQuality), TypeInfoPropertyName = "PreciseEditImageIdeogram45RequestQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AssetType), TypeInfoPropertyName = "AssetType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationErrorResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Request))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(byte[]))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImagePreciseEditIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality?), TypeInfoPropertyName = "NullableV2ImagePreciseEditIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationKind?), TypeInfoPropertyName = "NullableGenerationKind2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationRejectReason?), TypeInfoPropertyName = "NullableGenerationRejectReason2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?), TypeInfoPropertyName = "NullableGenerationErrorResponseTaskCompletionSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationKind?), TypeInfoPropertyName = "NullableGenerationKind2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PreciseEditImageIdeogram45RequestQuality?), TypeInfoPropertyName = "NullablePreciseEditImageIdeogram45RequestQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AssetType?), TypeInfoPropertyName = "NullableAssetType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] internal sealed partial class ImagesPreciseEditSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext { } @@ -109,79 +105,65 @@ private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Ser public override bool CanConvert(global::System.Type typeToConvert) { return - typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed) + typeToConvert == typeof(global::Ideogram.V2ImagePreciseEditIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality) - || typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?) + || typeToConvert == typeof(global::Ideogram.V2ImagePreciseEditIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality?) - || typeToConvert == typeof(global::Ideogram.GenerationRejectReason) - - || typeToConvert == typeof(global::Ideogram.GenerationRejectReason?) - - || typeToConvert == typeof(global::Ideogram.PreciseEditImageIdeogram45RequestQuality) + || typeToConvert == typeof(global::Ideogram.GenerationKind) - || typeToConvert == typeof(global::Ideogram.PreciseEditImageIdeogram45RequestQuality?) + || typeToConvert == typeof(global::Ideogram.GenerationKind?) - || typeToConvert == typeof(global::Ideogram.AssetType) + || typeToConvert == typeof(global::Ideogram.GenerationRejectReason) - || typeToConvert == typeof(global::Ideogram.AssetType?) + || typeToConvert == typeof(global::Ideogram.GenerationRejectReason?) - || typeToConvert == typeof(global::Ideogram.GenerationKind) + || typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed) - || typeToConvert == typeof(global::Ideogram.GenerationKind?); + || typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?); } public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) { - if (typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed)) + if (typeToConvert == typeof(global::Ideogram.V2ImagePreciseEditIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality)) { - return new global::Ideogram.JsonConverters.GenerationErrorResponseTaskCompletionSpeedJsonConverter(); + return new global::Ideogram.JsonConverters.V2ImagePreciseEditIdeogram45PostRequestBodyContentMultipartFormDataSchemaQualityJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?)) + if (typeToConvert == typeof(global::Ideogram.V2ImagePreciseEditIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality?)) { - return new global::Ideogram.JsonConverters.GenerationErrorResponseTaskCompletionSpeedNullableJsonConverter(); + return new global::Ideogram.JsonConverters.V2ImagePreciseEditIdeogram45PostRequestBodyContentMultipartFormDataSchemaQualityNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.GenerationRejectReason)) - { - return new global::Ideogram.JsonConverters.GenerationRejectReasonJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerationRejectReason?)) - { - return new global::Ideogram.JsonConverters.GenerationRejectReasonNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.PreciseEditImageIdeogram45RequestQuality)) + if (typeToConvert == typeof(global::Ideogram.GenerationKind)) { - return new global::Ideogram.JsonConverters.PreciseEditImageIdeogram45RequestQualityJsonConverter(); + return new global::Ideogram.JsonConverters.GenerationKindJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.PreciseEditImageIdeogram45RequestQuality?)) + if (typeToConvert == typeof(global::Ideogram.GenerationKind?)) { - return new global::Ideogram.JsonConverters.PreciseEditImageIdeogram45RequestQualityNullableJsonConverter(); + return new global::Ideogram.JsonConverters.GenerationKindNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.AssetType)) + if (typeToConvert == typeof(global::Ideogram.GenerationRejectReason)) { - return new global::Ideogram.JsonConverters.AssetTypeJsonConverter(); + return new global::Ideogram.JsonConverters.GenerationRejectReasonJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.AssetType?)) + if (typeToConvert == typeof(global::Ideogram.GenerationRejectReason?)) { - return new global::Ideogram.JsonConverters.AssetTypeNullableJsonConverter(); + return new global::Ideogram.JsonConverters.GenerationRejectReasonNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.GenerationKind)) + if (typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed)) { - return new global::Ideogram.JsonConverters.GenerationKindJsonConverter(); + return new global::Ideogram.JsonConverters.GenerationErrorResponseTaskCompletionSpeedJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.GenerationKind?)) + if (typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?)) { - return new global::Ideogram.JsonConverters.GenerationKindNullableJsonConverter(); + return new global::Ideogram.JsonConverters.GenerationErrorResponseTaskCompletionSpeedNullableJsonConverter(); } throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); } diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesPreciseEditClient.ImagesPreciseEditPostPreciseEditImageV2Ideogram45.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesPreciseEditClient.ImagesPreciseEditPostPreciseEditImageV2Ideogram45.g.cs new file mode 100644 index 00000000..cd964e2d --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.ImagesPreciseEditClient.ImagesPreciseEditPostPreciseEditImageV2Ideogram45.g.cs @@ -0,0 +1,2838 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class ImagesPreciseEditClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_ImagesPreciseEditPostPreciseEditImageV2Ideogram45SecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_ImagesPreciseEditPostPreciseEditImageV2Ideogram45SecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_ImagesPreciseEditPostPreciseEditImageV2Ideogram45SecurityRequirement0, + }; + partial void PrepareImagesPreciseEditPostPreciseEditImageV2Ideogram45Arguments( + global::System.Net.Http.HttpClient httpClient, + ref bool? dryRun, + global::Ideogram.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Request request); + partial void PrepareImagesPreciseEditPostPreciseEditImageV2Ideogram45Request( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + bool? dryRun, + global::Ideogram.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Request request); + partial void ProcessImagesPreciseEditPostPreciseEditImageV2Ideogram45Response( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessImagesPreciseEditPostPreciseEditImageV2Ideogram45ResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Precise edit with Ideogram 4.5
+ /// Edit an image with Ideogram 4.5 and get the result back at that image's
+ /// exact width and height. Upload the image as `image` using
+ /// `multipart/form-data`, with optional `reference_images` and a `mask`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`.
+ /// `context_window` confines the edit to one region of the image, so a
+ /// large image keeps its detail: pass `y_min,x_min,y_max,x_max`, or `auto`
+ /// together with a `mask`. The result always keeps the image's own width
+ /// and height. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesPreciseEditPostPreciseEditImageV2Ideogram45Async( + + global::Ideogram.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ImagesPreciseEditPostPreciseEditImageV2Ideogram45AsResponseAsync( + + request: request, + dryRun: dryRun, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Precise edit with Ideogram 4.5
+ /// Edit an image with Ideogram 4.5 and get the result back at that image's
+ /// exact width and height. Upload the image as `image` using
+ /// `multipart/form-data`, with optional `reference_images` and a `mask`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`.
+ /// `context_window` confines the edit to one region of the image, so a
+ /// large image keeps its detail: pass `y_min,x_min,y_max,x_max`, or `auto`
+ /// together with a `mask`. The result always keeps the image's own width
+ /// and height. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ImagesPreciseEditPostPreciseEditImageV2Ideogram45AsResponseAsync( + + global::Ideogram.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareImagesPreciseEditPostPreciseEditImageV2Ideogram45Arguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImagesPreciseEditPostPreciseEditImageV2Ideogram45SecurityRequirements, + operationName: "ImagesPreciseEditPostPreciseEditImageV2Ideogram45Async"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/precise-edit/ideogram-4-5", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.ReferenceImages != default) + { + + for (var __iReferenceImages = 0; __iReferenceImages < request.ReferenceImages.Count; __iReferenceImages++) + { + var __contentReferenceImages = new global::System.Net.Http.ByteArrayContent(request.ReferenceImages[__iReferenceImages]); + __contentReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); + __httpRequestContent.Add( + content: __contentReferenceImages, + name: "\"reference_images\"", + fileName: $"\"file{__iReferenceImages}.bin\""); + if (__contentReferenceImages.Headers.ContentDisposition != null) + { + __contentReferenceImages.Headers.ContentDisposition.FileNameStar = null; + } + } + + } + if (request.Mask != default) + { + + var __contentMask = new global::System.Net.Http.ByteArrayContent(request.Mask ?? global::System.Array.Empty()); + __contentMask.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Maskname is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Maskname) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentMask, + name: "\"mask\"", + fileName: request.Maskname != null ? $"\"{request.Maskname}\"" : string.Empty); + if (__contentMask.Headers.ContentDisposition != null) + { + __contentMask.Headers.ContentDisposition.FileNameStar = null; + } + + } + if (request.ContextWindow != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.ContextWindow ?? string.Empty), + name: "\"context_window\""); + + } + if (request.Quality != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Quality).HasValue ? (request.Quality).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"quality\""); + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.EnableCopyrightDetection != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"enable_copyright_detection\""); + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImagesPreciseEditPostPreciseEditImageV2Ideogram45Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesPreciseEditPostPreciseEditImageV2Ideogram45", + methodName: "ImagesPreciseEditPostPreciseEditImageV2Ideogram45Async", + pathTemplate: "\"/v2/image/precise-edit/ideogram-4-5\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesPreciseEditPostPreciseEditImageV2Ideogram45", + methodName: "ImagesPreciseEditPostPreciseEditImageV2Ideogram45Async", + pathTemplate: "\"/v2/image/precise-edit/ideogram-4-5\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesPreciseEditPostPreciseEditImageV2Ideogram45", + methodName: "ImagesPreciseEditPostPreciseEditImageV2Ideogram45Async", + pathTemplate: "\"/v2/image/precise-edit/ideogram-4-5\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImagesPreciseEditPostPreciseEditImageV2Ideogram45Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesPreciseEditPostPreciseEditImageV2Ideogram45", + methodName: "ImagesPreciseEditPostPreciseEditImageV2Ideogram45Async", + pathTemplate: "\"/v2/image/precise-edit/ideogram-4-5\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesPreciseEditPostPreciseEditImageV2Ideogram45", + methodName: "ImagesPreciseEditPostPreciseEditImageV2Ideogram45Async", + pathTemplate: "\"/v2/image/precise-edit/ideogram-4-5\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImagesPreciseEditPostPreciseEditImageV2Ideogram45ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.PreciseEditImageIdeogram45Response.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.PreciseEditImageIdeogram45Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Precise edit with Ideogram 4.5
+ /// Edit an image with Ideogram 4.5 and get the result back at that image's
+ /// exact width and height. Upload the image as `image` using
+ /// `multipart/form-data`, with optional `reference_images` and a `mask`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`.
+ /// `context_window` confines the edit to one region of the image, so a
+ /// large image keeps its detail: pass `y_min,x_min,y_max,x_max`, or `auto`
+ /// together with a `mask`. The result always keeps the image's own width
+ /// and height. + ///
+ /// + /// Default Value: false + /// + /// + /// The edit instruction, in natural language or as a structured JSON
+ /// prompt. Natural language is automatically converted into a
+ /// structured prompt; valid structured JSON is used as is. + /// + /// + /// The image to edit, as raw bytes (max 50MB; JPEG, PNG, or WEBP). Multipart requests only; ignored if `image_asset_identifier` is also supplied. The output always matches this image's width and height, and pixels the edit did not meaningfully change are copied exactly from it. + /// + /// + /// The image to edit, as raw bytes (max 50MB; JPEG, PNG, or WEBP). Multipart requests only; ignored if `image_asset_identifier` is also supplied. The output always matches this image's width and height, and pixels the edit did not meaningfully change are copied exactly from it. + /// + /// + /// Optional images to guide the edit (max 4, max 50MB each; JPEG, PNG, or WEBP). They are never edited themselves; only `image` is. Multipart requests only; ignored if `reference_image_asset_identifiers` is also supplied. A request with a `mask` can include at most three, because the mask takes up one reference slot. + /// + /// + /// An optional mask that limits the edit to part of `image` (max 50MB; JPEG, PNG, or WEBP). Multipart requests only. Black marks the area to edit and white the area to keep; values in between are rounded to the nearer of the two. The mask must have the same width and height as the image being edited and contain both black and white areas. A masked request can include at most three reference images. + /// + /// + /// An optional mask that limits the edit to part of `image` (max 50MB; JPEG, PNG, or WEBP). Multipart requests only. Black marks the area to edit and white the area to keep; values in between are rounded to the nearer of the two. The mask must have the same width and height as the image being edited and contain both black and white areas. A masked request can include at most three reference images. + /// + /// + /// Which region of the image to edit.
+ /// `none`, the default, edits the whole image. A large image may come back smaller than it was sent.
+ /// `auto` requires a `mask` and automatically selects an appropriate context region around the masked area.
+ /// `y_min,x_min,y_max,x_max` names the region explicitly, by its corners. Rows come first, matching the `bbox` ordering used elsewhere in this API, and the values are the edited image's own pixels with the origin at its top-left corner. For example `512,1024,2048,3072` is the region 2048 pixels wide and 1536 tall whose top-left corner is 1024 across and 512 down. The maximum edges are exclusive, so the region measures `x_max - x_min` by `y_max - y_min`. It must lie inside the image, measure at least 256px on each side, have an aspect ratio between 1:6 and 6:1, and cover no more than 4194304 pixels. A `mask` may select only pixels inside it.
+ /// With `auto` or an explicit region, only that region changes and the output keeps the image's own width and height.
+ /// Default Value: none + /// + /// + /// The rendering quality to use. `very_low` is the fastest and cheapest, and `high` takes longer and is priced higher.
+ /// Default Value: medium + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesPreciseEditPostPreciseEditImageV2Ideogram45Async( + string prompt, + byte[] image, + string imagename, + bool? dryRun = default, + global::System.Collections.Generic.IList? referenceImages = default, + byte[]? mask = default, + string? maskname = default, + string? contextWindow = default, + global::Ideogram.V2ImagePreciseEditIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality? quality = default, + int? seed = default, + int? numImages = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Ideogram.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Request + { + Prompt = prompt, + Image = image, + Imagename = imagename, + ReferenceImages = referenceImages, + Mask = mask, + Maskname = maskname, + ContextWindow = contextWindow, + Quality = quality, + Seed = seed, + NumImages = numImages, + EnableCopyrightDetection = enableCopyrightDetection, + Async = async, + WebhookUrl = webhookUrl, + }; + + return await ImagesPreciseEditPostPreciseEditImageV2Ideogram45Async( + dryRun: dryRun, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// Precise edit with Ideogram 4.5
+ /// Edit an image with Ideogram 4.5 and get the result back at that image's
+ /// exact width and height. Upload the image as `image` using
+ /// `multipart/form-data`, with optional `reference_images` and a `mask`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`.
+ /// `context_window` confines the edit to one region of the image, so a
+ /// large image keeps its detail: pass `y_min,x_min,y_max,x_max`, or `auto`
+ /// together with a `mask`. The result always keeps the image's own width
+ /// and height. + ///
+ /// + /// Default Value: false + /// + /// + /// The edit instruction, in natural language or as a structured JSON
+ /// prompt. Natural language is automatically converted into a
+ /// structured prompt; valid structured JSON is used as is. + /// + /// + /// The image to edit, as raw bytes (max 50MB; JPEG, PNG, or WEBP). Multipart requests only; ignored if `image_asset_identifier` is also supplied. The output always matches this image's width and height, and pixels the edit did not meaningfully change are copied exactly from it. + /// + /// + /// The image to edit, as raw bytes (max 50MB; JPEG, PNG, or WEBP). Multipart requests only; ignored if `image_asset_identifier` is also supplied. The output always matches this image's width and height, and pixels the edit did not meaningfully change are copied exactly from it. + /// + /// + /// Optional images to guide the edit (max 4, max 50MB each; JPEG, PNG, or WEBP). They are never edited themselves; only `image` is. Multipart requests only; ignored if `reference_image_asset_identifiers` is also supplied. A request with a `mask` can include at most three, because the mask takes up one reference slot. + /// + /// + /// Optional file names to use for the multipart 'reference_images' file parts. + /// + /// + /// An optional mask that limits the edit to part of `image` (max 50MB; JPEG, PNG, or WEBP). Multipart requests only. Black marks the area to edit and white the area to keep; values in between are rounded to the nearer of the two. The mask must have the same width and height as the image being edited and contain both black and white areas. A masked request can include at most three reference images. + /// + /// + /// An optional mask that limits the edit to part of `image` (max 50MB; JPEG, PNG, or WEBP). Multipart requests only. Black marks the area to edit and white the area to keep; values in between are rounded to the nearer of the two. The mask must have the same width and height as the image being edited and contain both black and white areas. A masked request can include at most three reference images. + /// + /// + /// Which region of the image to edit.
+ /// `none`, the default, edits the whole image. A large image may come back smaller than it was sent.
+ /// `auto` requires a `mask` and automatically selects an appropriate context region around the masked area.
+ /// `y_min,x_min,y_max,x_max` names the region explicitly, by its corners. Rows come first, matching the `bbox` ordering used elsewhere in this API, and the values are the edited image's own pixels with the origin at its top-left corner. For example `512,1024,2048,3072` is the region 2048 pixels wide and 1536 tall whose top-left corner is 1024 across and 512 down. The maximum edges are exclusive, so the region measures `x_max - x_min` by `y_max - y_min`. It must lie inside the image, measure at least 256px on each side, have an aspect ratio between 1:6 and 6:1, and cover no more than 4194304 pixels. A `mask` may select only pixels inside it.
+ /// With `auto` or an explicit region, only that region changes and the output keeps the image's own width and height.
+ /// Default Value: none + /// + /// + /// The rendering quality to use. `very_low` is the fastest and cheapest, and `high` takes longer and is priced higher.
+ /// Default Value: medium + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesPreciseEditPostPreciseEditImageV2Ideogram45Async( + string prompt, + global::System.IO.Stream image, + string imagename, + bool? dryRun = default, + global::System.Collections.Generic.IReadOnlyList? referenceImages = default, + global::System.Collections.Generic.IReadOnlyList? referenceImagesFileNames = default, + global::System.IO.Stream? mask = default, + string? maskname = default, + string? contextWindow = default, + global::Ideogram.V2ImagePreciseEditIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality? quality = default, + int? seed = default, + int? numImages = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + var request = new global::Ideogram.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Request + { + Prompt = prompt, + Image = global::System.Array.Empty(), + Imagename = imagename, + ReferenceImages = new global::System.Collections.Generic.List(), + Mask = global::System.Array.Empty(), + Maskname = maskname, + ContextWindow = contextWindow, + Quality = quality, + Seed = seed, + NumImages = numImages, + EnableCopyrightDetection = enableCopyrightDetection, + Async = async, + WebhookUrl = webhookUrl, + }; + PrepareArguments( + client: HttpClient); + PrepareImagesPreciseEditPostPreciseEditImageV2Ideogram45Arguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImagesPreciseEditPostPreciseEditImageV2Ideogram45SecurityRequirements, + operationName: "ImagesPreciseEditPostPreciseEditImageV2Ideogram45Async"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/precise-edit/ideogram-4-5", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (referenceImages != default) + { + + for (var __iReferenceImages = 0; __iReferenceImages < referenceImages.Count; __iReferenceImages++) + { + var __fileNameReferenceImages = referenceImagesFileNames != null && + __iReferenceImages < referenceImagesFileNames.Count && + referenceImagesFileNames[__iReferenceImages] != null + ? referenceImagesFileNames[__iReferenceImages] + : $"file{__iReferenceImages}.bin"; + var __contentReferenceImages = new global::System.Net.Http.StreamContent(referenceImages[__iReferenceImages]); + __contentReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + __fileNameReferenceImages is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(__fileNameReferenceImages) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentReferenceImages, + name: "\"reference_images\"", + fileName: $"\"{__fileNameReferenceImages}\""); + if (__contentReferenceImages.Headers.ContentDisposition != null) + { + __contentReferenceImages.Headers.ContentDisposition.FileNameStar = null; + } + } + + } + if (mask != default) + { + + var __contentMask = new global::System.Net.Http.StreamContent(mask); + __contentMask.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Maskname is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Maskname) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentMask, + name: "\"mask\"", + fileName: request.Maskname != null ? $"\"{request.Maskname}\"" : string.Empty); + if (__contentMask.Headers.ContentDisposition != null) + { + __contentMask.Headers.ContentDisposition.FileNameStar = null; + } + + } + if (request.ContextWindow != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.ContextWindow ?? string.Empty), + name: "\"context_window\""); + + } + if (request.Quality != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Quality).HasValue ? (request.Quality).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"quality\""); + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.EnableCopyrightDetection != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"enable_copyright_detection\""); + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImagesPreciseEditPostPreciseEditImageV2Ideogram45Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesPreciseEditPostPreciseEditImageV2Ideogram45", + methodName: "ImagesPreciseEditPostPreciseEditImageV2Ideogram45Async", + pathTemplate: "\"/v2/image/precise-edit/ideogram-4-5\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesPreciseEditPostPreciseEditImageV2Ideogram45", + methodName: "ImagesPreciseEditPostPreciseEditImageV2Ideogram45Async", + pathTemplate: "\"/v2/image/precise-edit/ideogram-4-5\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesPreciseEditPostPreciseEditImageV2Ideogram45", + methodName: "ImagesPreciseEditPostPreciseEditImageV2Ideogram45Async", + pathTemplate: "\"/v2/image/precise-edit/ideogram-4-5\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImagesPreciseEditPostPreciseEditImageV2Ideogram45Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesPreciseEditPostPreciseEditImageV2Ideogram45", + methodName: "ImagesPreciseEditPostPreciseEditImageV2Ideogram45Async", + pathTemplate: "\"/v2/image/precise-edit/ideogram-4-5\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesPreciseEditPostPreciseEditImageV2Ideogram45", + methodName: "ImagesPreciseEditPostPreciseEditImageV2Ideogram45Async", + pathTemplate: "\"/v2/image/precise-edit/ideogram-4-5\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImagesPreciseEditPostPreciseEditImageV2Ideogram45ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::Ideogram.PreciseEditImageIdeogram45Response.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::Ideogram.PreciseEditImageIdeogram45Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Precise edit with Ideogram 4.5
+ /// Edit an image with Ideogram 4.5 and get the result back at that image's
+ /// exact width and height. Upload the image as `image` using
+ /// `multipart/form-data`, with optional `reference_images` and a `mask`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`.
+ /// `context_window` confines the edit to one region of the image, so a
+ /// large image keeps its detail: pass `y_min,x_min,y_max,x_max`, or `auto`
+ /// together with a `mask`. The result always keeps the image's own width
+ /// and height. + ///
+ /// + /// Default Value: false + /// + /// + /// The edit instruction, in natural language or as a structured JSON
+ /// prompt. Natural language is automatically converted into a
+ /// structured prompt; valid structured JSON is used as is. + /// + /// + /// The image to edit, as raw bytes (max 50MB; JPEG, PNG, or WEBP). Multipart requests only; ignored if `image_asset_identifier` is also supplied. The output always matches this image's width and height, and pixels the edit did not meaningfully change are copied exactly from it. + /// + /// + /// The image to edit, as raw bytes (max 50MB; JPEG, PNG, or WEBP). Multipart requests only; ignored if `image_asset_identifier` is also supplied. The output always matches this image's width and height, and pixels the edit did not meaningfully change are copied exactly from it. + /// + /// + /// Optional images to guide the edit (max 4, max 50MB each; JPEG, PNG, or WEBP). They are never edited themselves; only `image` is. Multipart requests only; ignored if `reference_image_asset_identifiers` is also supplied. A request with a `mask` can include at most three, because the mask takes up one reference slot. + /// + /// + /// Optional file names to use for the multipart 'reference_images' file parts. + /// + /// + /// An optional mask that limits the edit to part of `image` (max 50MB; JPEG, PNG, or WEBP). Multipart requests only. Black marks the area to edit and white the area to keep; values in between are rounded to the nearer of the two. The mask must have the same width and height as the image being edited and contain both black and white areas. A masked request can include at most three reference images. + /// + /// + /// An optional mask that limits the edit to part of `image` (max 50MB; JPEG, PNG, or WEBP). Multipart requests only. Black marks the area to edit and white the area to keep; values in between are rounded to the nearer of the two. The mask must have the same width and height as the image being edited and contain both black and white areas. A masked request can include at most three reference images. + /// + /// + /// Which region of the image to edit.
+ /// `none`, the default, edits the whole image. A large image may come back smaller than it was sent.
+ /// `auto` requires a `mask` and automatically selects an appropriate context region around the masked area.
+ /// `y_min,x_min,y_max,x_max` names the region explicitly, by its corners. Rows come first, matching the `bbox` ordering used elsewhere in this API, and the values are the edited image's own pixels with the origin at its top-left corner. For example `512,1024,2048,3072` is the region 2048 pixels wide and 1536 tall whose top-left corner is 1024 across and 512 down. The maximum edges are exclusive, so the region measures `x_max - x_min` by `y_max - y_min`. It must lie inside the image, measure at least 256px on each side, have an aspect ratio between 1:6 and 6:1, and cover no more than 4194304 pixels. A `mask` may select only pixels inside it.
+ /// With `auto` or an explicit region, only that region changes and the output keeps the image's own width and height.
+ /// Default Value: none + /// + /// + /// The rendering quality to use. `very_low` is the fastest and cheapest, and `high` takes longer and is priced higher.
+ /// Default Value: medium + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ImagesPreciseEditPostPreciseEditImageV2Ideogram45AsResponseAsync( + string prompt, + global::System.IO.Stream image, + string imagename, + bool? dryRun = default, + global::System.Collections.Generic.IReadOnlyList? referenceImages = default, + global::System.Collections.Generic.IReadOnlyList? referenceImagesFileNames = default, + global::System.IO.Stream? mask = default, + string? maskname = default, + string? contextWindow = default, + global::Ideogram.V2ImagePreciseEditIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality? quality = default, + int? seed = default, + int? numImages = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + var request = new global::Ideogram.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Request + { + Prompt = prompt, + Image = global::System.Array.Empty(), + Imagename = imagename, + ReferenceImages = new global::System.Collections.Generic.List(), + Mask = global::System.Array.Empty(), + Maskname = maskname, + ContextWindow = contextWindow, + Quality = quality, + Seed = seed, + NumImages = numImages, + EnableCopyrightDetection = enableCopyrightDetection, + Async = async, + WebhookUrl = webhookUrl, + }; + PrepareArguments( + client: HttpClient); + PrepareImagesPreciseEditPostPreciseEditImageV2Ideogram45Arguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImagesPreciseEditPostPreciseEditImageV2Ideogram45SecurityRequirements, + operationName: "ImagesPreciseEditPostPreciseEditImageV2Ideogram45Async"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/precise-edit/ideogram-4-5", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (referenceImages != default) + { + + for (var __iReferenceImages = 0; __iReferenceImages < referenceImages.Count; __iReferenceImages++) + { + var __fileNameReferenceImages = referenceImagesFileNames != null && + __iReferenceImages < referenceImagesFileNames.Count && + referenceImagesFileNames[__iReferenceImages] != null + ? referenceImagesFileNames[__iReferenceImages] + : $"file{__iReferenceImages}.bin"; + var __contentReferenceImages = new global::System.Net.Http.StreamContent(referenceImages[__iReferenceImages]); + __contentReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + __fileNameReferenceImages is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(__fileNameReferenceImages) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentReferenceImages, + name: "\"reference_images\"", + fileName: $"\"{__fileNameReferenceImages}\""); + if (__contentReferenceImages.Headers.ContentDisposition != null) + { + __contentReferenceImages.Headers.ContentDisposition.FileNameStar = null; + } + } + + } + if (mask != default) + { + + var __contentMask = new global::System.Net.Http.StreamContent(mask); + __contentMask.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Maskname is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Maskname) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentMask, + name: "\"mask\"", + fileName: request.Maskname != null ? $"\"{request.Maskname}\"" : string.Empty); + if (__contentMask.Headers.ContentDisposition != null) + { + __contentMask.Headers.ContentDisposition.FileNameStar = null; + } + + } + if (request.ContextWindow != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.ContextWindow ?? string.Empty), + name: "\"context_window\""); + + } + if (request.Quality != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Quality).HasValue ? (request.Quality).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"quality\""); + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.EnableCopyrightDetection != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"enable_copyright_detection\""); + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImagesPreciseEditPostPreciseEditImageV2Ideogram45Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesPreciseEditPostPreciseEditImageV2Ideogram45", + methodName: "ImagesPreciseEditPostPreciseEditImageV2Ideogram45Async", + pathTemplate: "\"/v2/image/precise-edit/ideogram-4-5\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesPreciseEditPostPreciseEditImageV2Ideogram45", + methodName: "ImagesPreciseEditPostPreciseEditImageV2Ideogram45Async", + pathTemplate: "\"/v2/image/precise-edit/ideogram-4-5\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesPreciseEditPostPreciseEditImageV2Ideogram45", + methodName: "ImagesPreciseEditPostPreciseEditImageV2Ideogram45Async", + pathTemplate: "\"/v2/image/precise-edit/ideogram-4-5\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImagesPreciseEditPostPreciseEditImageV2Ideogram45Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesPreciseEditPostPreciseEditImageV2Ideogram45", + methodName: "ImagesPreciseEditPostPreciseEditImageV2Ideogram45Async", + pathTemplate: "\"/v2/image/precise-edit/ideogram-4-5\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesPreciseEditPostPreciseEditImageV2Ideogram45", + methodName: "ImagesPreciseEditPostPreciseEditImageV2Ideogram45Async", + pathTemplate: "\"/v2/image/precise-edit/ideogram-4-5\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImagesPreciseEditPostPreciseEditImageV2Ideogram45ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.PreciseEditImageIdeogram45Response.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.PreciseEditImageIdeogram45Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesPreciseEditClient.PostPreciseEditImageV2Ideogram45.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesPreciseEditClient.PostPreciseEditImageV2Ideogram45.g.cs deleted file mode 100644 index d924a373..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ImagesPreciseEditClient.PostPreciseEditImageV2Ideogram45.g.cs +++ /dev/null @@ -1,1049 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ImagesPreciseEditClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostPreciseEditImageV2Ideogram45SecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostPreciseEditImageV2Ideogram45SecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostPreciseEditImageV2Ideogram45SecurityRequirement0, - }; - partial void PreparePostPreciseEditImageV2Ideogram45Arguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? dryRun, - global::Ideogram.PreciseEditImageIdeogram45Request request); - partial void PreparePostPreciseEditImageV2Ideogram45Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? dryRun, - global::Ideogram.PreciseEditImageIdeogram45Request request); - partial void ProcessPostPreciseEditImageV2Ideogram45Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostPreciseEditImageV2Ideogram45ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Precise edit with Ideogram 4.5
- /// Edit an image with Ideogram 4.5 and get the result back at that image's
- /// exact width and height. Upload the image as `image` using
- /// `multipart/form-data`, with optional `reference_images` and a `mask`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`.
- /// `context_window` confines the edit to one region of the image, so a
- /// large image keeps its detail: pass `y_min,x_min,y_max,x_max`, or `auto`
- /// together with a `mask`. The result always keeps the image's own width
- /// and height. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostPreciseEditImageV2Ideogram45Async( - - global::Ideogram.PreciseEditImageIdeogram45Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostPreciseEditImageV2Ideogram45AsResponseAsync( - - request: request, - dryRun: dryRun, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Precise edit with Ideogram 4.5
- /// Edit an image with Ideogram 4.5 and get the result back at that image's
- /// exact width and height. Upload the image as `image` using
- /// `multipart/form-data`, with optional `reference_images` and a `mask`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`.
- /// `context_window` confines the edit to one region of the image, so a
- /// large image keeps its detail: pass `y_min,x_min,y_max,x_max`, or `auto`
- /// together with a `mask`. The result always keeps the image's own width
- /// and height. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostPreciseEditImageV2Ideogram45AsResponseAsync( - - global::Ideogram.PreciseEditImageIdeogram45Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostPreciseEditImageV2Ideogram45Arguments( - httpClient: HttpClient, - dryRun: ref dryRun, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostPreciseEditImageV2Ideogram45SecurityRequirements, - operationName: "PostPreciseEditImageV2Ideogram45Async"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/image/precise-edit/ideogram-4-5", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - if (request.ImageAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ImageAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"image_asset_identifier\""); - - } - if (request.Image != default) - { - - var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.ReferenceImageAssetIdentifiers != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.ReferenceImageAssetIdentifiers!, x => x.ToJson(JsonSerializerContext)))}]"), - name: "\"reference_image_asset_identifiers\""); - - } - if (request.ReferenceImages != default) - { - - for (var __iReferenceImages = 0; __iReferenceImages < request.ReferenceImages.Count; __iReferenceImages++) - { - var __contentReferenceImages = new global::System.Net.Http.ByteArrayContent(request.ReferenceImages[__iReferenceImages]); - __contentReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); - __httpRequestContent.Add( - content: __contentReferenceImages, - name: "\"reference_images\"", - fileName: $"\"file{__iReferenceImages}.bin\""); - if (__contentReferenceImages.Headers.ContentDisposition != null) - { - __contentReferenceImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - if (request.MaskAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.MaskAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"mask_asset_identifier\""); - - } - if (request.Mask != default) - { - - var __contentMask = new global::System.Net.Http.ByteArrayContent(request.Mask ?? global::System.Array.Empty()); - __contentMask.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Maskname is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Maskname) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentMask, - name: "\"mask\"", - fileName: request.Maskname != null ? $"\"{request.Maskname}\"" : string.Empty); - if (__contentMask.Headers.ContentDisposition != null) - { - __contentMask.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.ContextWindow != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ContextWindow ?? string.Empty), - name: "\"context_window\""); - - } - if (request.Quality != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Quality).HasValue ? (request.Quality).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"quality\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.EnableCopyrightDetection != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"enable_copyright_detection\""); - - } - if (request.Async != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"async\""); - - } - if (request.WebhookUrl != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), - name: "\"webhook_url\""); - - } - if (request.Private != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"private\""); - - } - if (request.TargetCollectionId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.TargetCollectionId ?? string.Empty), - name: "\"target_collection_id\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostPreciseEditImageV2Ideogram45Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - dryRun: dryRun, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostPreciseEditImageV2Ideogram45", - methodName: "PostPreciseEditImageV2Ideogram45Async", - pathTemplate: "\"/v2/image/precise-edit/ideogram-4-5\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostPreciseEditImageV2Ideogram45", - methodName: "PostPreciseEditImageV2Ideogram45Async", - pathTemplate: "\"/v2/image/precise-edit/ideogram-4-5\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostPreciseEditImageV2Ideogram45", - methodName: "PostPreciseEditImageV2Ideogram45Async", - pathTemplate: "\"/v2/image/precise-edit/ideogram-4-5\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostPreciseEditImageV2Ideogram45Response( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostPreciseEditImageV2Ideogram45", - methodName: "PostPreciseEditImageV2Ideogram45Async", - pathTemplate: "\"/v2/image/precise-edit/ideogram-4-5\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostPreciseEditImageV2Ideogram45", - methodName: "PostPreciseEditImageV2Ideogram45Async", - pathTemplate: "\"/v2/image/precise-edit/ideogram-4-5\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 500) - { - string? __content_500 = null; - global::System.Exception? __exception_500 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_500 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_500, - responseBody: __content_500, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostPreciseEditImageV2Ideogram45ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.PreciseEditImageIdeogram45Response.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.PreciseEditImageIdeogram45Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Precise edit with Ideogram 4.5
- /// Edit an image with Ideogram 4.5 and get the result back at that image's
- /// exact width and height. Upload the image as `image` using
- /// `multipart/form-data`, with optional `reference_images` and a `mask`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`.
- /// `context_window` confines the edit to one region of the image, so a
- /// large image keeps its detail: pass `y_min,x_min,y_max,x_max`, or `auto`
- /// together with a `mask`. The result always keeps the image's own width
- /// and height. - ///
- /// - /// Default Value: false - /// - /// - /// The edit instruction, in natural language or as a structured JSON
- /// prompt. Natural language is automatically converted into a
- /// structured prompt; valid structured JSON is used as is. - /// - /// - /// The image to edit, as an existing upload or generated image asset. Supply this or `image`, never both. Takes priority over `image` if both are supplied. - /// - /// - /// The image to edit, as raw bytes (max 50MB; JPEG, PNG, or WEBP). Multipart requests only; ignored if `image_asset_identifier` is also supplied. The output always matches this image's width and height, and pixels the edit did not meaningfully change are copied exactly from it. - /// - /// - /// The image to edit, as raw bytes (max 50MB; JPEG, PNG, or WEBP). Multipart requests only; ignored if `image_asset_identifier` is also supplied. The output always matches this image's width and height, and pixels the edit did not meaningfully change are copied exactly from it. - /// - /// - /// Optional additional images to guide the edit, by reference. These are never edited themselves; only `image_asset_identifier` or `image` is. Requires the image being edited to be supplied by reference too. A request with a mask can include at most three. - /// - /// - /// Optional images to guide the edit (max 4, max 50MB each; JPEG, PNG, or WEBP). They are never edited themselves; only `image` is. Multipart requests only; ignored if `reference_image_asset_identifiers` is also supplied. A request with a `mask` can include at most three, because the mask takes up one reference slot. - /// - /// - /// An existing upload or generated image asset to use as the mask, by reference. The same rules as `mask` apply. Takes priority over `mask` if both are supplied. - /// - /// - /// An optional mask that limits the edit to part of `image` (max 50MB; JPEG, PNG, or WEBP). Multipart requests only. Black marks the area to edit and white the area to keep; values in between are rounded to the nearer of the two. The mask must have the same width and height as the image being edited and contain both black and white areas. A masked request can include at most three reference images. - /// - /// - /// An optional mask that limits the edit to part of `image` (max 50MB; JPEG, PNG, or WEBP). Multipart requests only. Black marks the area to edit and white the area to keep; values in between are rounded to the nearer of the two. The mask must have the same width and height as the image being edited and contain both black and white areas. A masked request can include at most three reference images. - /// - /// - /// Which region of the image to edit.
- /// `none`, the default, edits the whole image. A large image may come back smaller than it was sent.
- /// `auto` requires a `mask` and automatically selects an appropriate context region around the masked area.
- /// `y_min,x_min,y_max,x_max` names the region explicitly, by its corners. Rows come first, matching the `bbox` ordering used elsewhere in this API, and the values are the edited image's own pixels with the origin at its top-left corner. For example `512,1024,2048,3072` is the region 2048 pixels wide and 1536 tall whose top-left corner is 1024 across and 512 down. The maximum edges are exclusive, so the region measures `x_max - x_min` by `y_max - y_min`. It must lie inside the image, measure at least 256px on each side, have an aspect ratio between 1:6 and 6:1, and cover no more than 4194304 pixels. A `mask` may select only pixels inside it.
- /// With `auto` or an explicit region, only that region changes and the output keeps the image's own width and height.
- /// Default Value: none - /// - /// - /// The rendering quality to use. `very_low` is the fastest and cheapest, and `high` takes longer and is priced higher.
- /// Default Value: medium - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. - /// - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostPreciseEditImageV2Ideogram45Async( - string prompt, - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - global::System.Collections.Generic.IList? referenceImageAssetIdentifiers = default, - global::System.Collections.Generic.IList? referenceImages = default, - global::Ideogram.AssetIdentifier? maskAssetIdentifier = default, - byte[]? mask = default, - string? maskname = default, - string? contextWindow = default, - global::Ideogram.PreciseEditImageIdeogram45RequestQuality? quality = default, - int? seed = default, - int? numImages = default, - bool? enableCopyrightDetection = default, - bool? async = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.PreciseEditImageIdeogram45Request - { - Prompt = prompt, - ImageAssetIdentifier = imageAssetIdentifier, - Image = image, - Imagename = imagename, - ReferenceImageAssetIdentifiers = referenceImageAssetIdentifiers, - ReferenceImages = referenceImages, - MaskAssetIdentifier = maskAssetIdentifier, - Mask = mask, - Maskname = maskname, - ContextWindow = contextWindow, - Quality = quality, - Seed = seed, - NumImages = numImages, - EnableCopyrightDetection = enableCopyrightDetection, - Async = async, - WebhookUrl = webhookUrl, - Private = @private, - TargetCollectionId = targetCollectionId, - }; - - return await PostPreciseEditImageV2Ideogram45Async( - dryRun: dryRun, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesPreciseEditClient.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesPreciseEditClient.g.cs index 0f9a33bb..9b8c6eb0 100644 --- a/src/libs/Ideogram/Generated/Ideogram.ImagesPreciseEditClient.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.ImagesPreciseEditClient.g.cs @@ -4,7 +4,6 @@ namespace Ideogram { /// - /// Edit source images at the source's own width and height. These endpoints never reframe: the output always matches the image you sent.
/// If no httpClient is provided, a new one will be created.
/// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. ///
diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesReframe.JsonSerializerContext.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesReframe.JsonSerializerContext.g.cs deleted file mode 100644 index f4f8c82e..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ImagesReframe.JsonSerializerContext.g.cs +++ /dev/null @@ -1,353 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull - )] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(byte[]))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ResolutionV3), TypeInfoPropertyName = "ResolutionV32")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AssetIdentifier))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationErrorResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationRejectReason), TypeInfoPropertyName = "GenerationRejectReason2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed), TypeInfoPropertyName = "GenerationErrorResponseTaskCompletionSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GeneratedImageObject))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramColorPalette), TypeInfoPropertyName = "IdeogramColorPalette2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramV3StylePreset), TypeInfoPropertyName = "IdeogramV3StylePreset2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReframeImageIdeogramV3Response))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReframeImageIdeogramV3Request))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReframeImageIdeogramV3RequestRenderingSpeed), TypeInfoPropertyName = "ReframeImageIdeogramV3RequestRenderingSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReframeImageNanoBanana2Response))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReframeImageNanoBanana2Request))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.NanoBanana2ReframeAspectRatio), TypeInfoPropertyName = "NanoBanana2ReframeAspectRatio2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReframeImageNanoBananaProResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReframeImageNanoBananaProRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.NanoBananaProReframeAspectRatio), TypeInfoPropertyName = "NanoBananaProReframeAspectRatio2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReframeImageNanoBananaProRequestResolutionTier), TypeInfoPropertyName = "ReframeImageNanoBananaProRequestResolutionTier2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReframeImageGptImage25FlareResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReframeImageGptImage25FlareRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReframeImageGptImage25FlareRequestQuality), TypeInfoPropertyName = "ReframeImageGptImage25FlareRequestQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReframeImageBriaExpandResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReframeImageBriaExpandRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReframeImageAutoResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReframeImageAutoRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ColorPaletteWithMembers))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ColorPaletteMember))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AssetType), TypeInfoPropertyName = "AssetType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramColorPaletteWithPresetName))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramColorPalettePresetName), TypeInfoPropertyName = "IdeogramColorPalettePresetName2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ResolutionV3?), TypeInfoPropertyName = "NullableResolutionV32")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationRejectReason?), TypeInfoPropertyName = "NullableGenerationRejectReason2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?), TypeInfoPropertyName = "NullableGenerationErrorResponseTaskCompletionSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramColorPalette?), TypeInfoPropertyName = "NullableIdeogramColorPalette2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramV3StylePreset?), TypeInfoPropertyName = "NullableIdeogramV3StylePreset2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(double?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReframeImageIdeogramV3RequestRenderingSpeed?), TypeInfoPropertyName = "NullableReframeImageIdeogramV3RequestRenderingSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.NanoBanana2ReframeAspectRatio?), TypeInfoPropertyName = "NullableNanoBanana2ReframeAspectRatio2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.NanoBananaProReframeAspectRatio?), TypeInfoPropertyName = "NullableNanoBananaProReframeAspectRatio2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReframeImageNanoBananaProRequestResolutionTier?), TypeInfoPropertyName = "NullableReframeImageNanoBananaProRequestResolutionTier2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReframeImageGptImage25FlareRequestQuality?), TypeInfoPropertyName = "NullableReframeImageGptImage25FlareRequestQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AssetType?), TypeInfoPropertyName = "NullableAssetType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramColorPalettePresetName?), TypeInfoPropertyName = "NullableIdeogramColorPalettePresetName2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - internal sealed partial class ImagesReframeSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext - { - } - /// - /// - /// - public sealed partial class ImagesReframeSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext - { - private static readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver Resolver = new LazyChunkResolver(); - - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - internal static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver TypeInfoResolver => Resolver; - - - private static readonly global::System.Text.Json.JsonSerializerOptions DefaultOptions = CreateDefaultOptions(); - - /// - /// - /// - public static ImagesReframeSourceGenerationContext Default { get; } = new(DefaultOptions); - - private ImagesReframeSourceGenerationContext(global::System.Text.Json.JsonSerializerOptions options) - : base(options) - { - } - - /// - protected override global::System.Text.Json.JsonSerializerOptions? GeneratedSerializerOptions => DefaultOptions; - - /// - public override global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo(global::System.Type type) - { - return Resolver.GetTypeInfo(type, Options); - } - - /// - /// Adds this package's converters to . - /// - /// - /// A converter has to be on the options a chained resolver builds its JsonTypeInfo against, - /// and a context resolves types from every package below it. Each package contributes only - /// what it owns and calls down the chain for the rest, so the family's converter table is - /// written once rather than copied into all of them. - /// - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) - { - options.Converters.Add(new global::Ideogram.JsonConverters.IdeogramColorPaletteJsonConverter()); - options.Converters.Add(new global::Ideogram.JsonConverters.UnixTimestampJsonConverter()); - options.Converters.Add(new LazyEnumJsonConverterFactory()); - } - - private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() - { - var options = new global::System.Text.Json.JsonSerializerOptions - { - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, - TypeInfoResolver = Resolver, - }; - AddConverters(options); - - return options; - } - - - private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory - { - public override bool CanConvert(global::System.Type typeToConvert) - { - return - typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed) - - || typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?) - - || typeToConvert == typeof(global::Ideogram.GenerationRejectReason) - - || typeToConvert == typeof(global::Ideogram.GenerationRejectReason?) - - || typeToConvert == typeof(global::Ideogram.ReframeImageIdeogramV3RequestRenderingSpeed) - - || typeToConvert == typeof(global::Ideogram.ReframeImageIdeogramV3RequestRenderingSpeed?) - - || typeToConvert == typeof(global::Ideogram.ReframeImageNanoBananaProRequestResolutionTier) - - || typeToConvert == typeof(global::Ideogram.ReframeImageNanoBananaProRequestResolutionTier?) - - || typeToConvert == typeof(global::Ideogram.ReframeImageGptImage25FlareRequestQuality) - - || typeToConvert == typeof(global::Ideogram.ReframeImageGptImage25FlareRequestQuality?) - - || typeToConvert == typeof(global::Ideogram.ResolutionV3) - - || typeToConvert == typeof(global::Ideogram.ResolutionV3?) - - || typeToConvert == typeof(global::Ideogram.AssetType) - - || typeToConvert == typeof(global::Ideogram.AssetType?) - - || typeToConvert == typeof(global::Ideogram.IdeogramColorPalettePresetName) - - || typeToConvert == typeof(global::Ideogram.IdeogramColorPalettePresetName?) - - || typeToConvert == typeof(global::Ideogram.IdeogramV3StylePreset) - - || typeToConvert == typeof(global::Ideogram.IdeogramV3StylePreset?) - - || typeToConvert == typeof(global::Ideogram.NanoBanana2ReframeAspectRatio) - - || typeToConvert == typeof(global::Ideogram.NanoBanana2ReframeAspectRatio?) - - || typeToConvert == typeof(global::Ideogram.NanoBananaProReframeAspectRatio) - - || typeToConvert == typeof(global::Ideogram.NanoBananaProReframeAspectRatio?); - } - - public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - if (typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed)) - { - return new global::Ideogram.JsonConverters.GenerationErrorResponseTaskCompletionSpeedJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?)) - { - return new global::Ideogram.JsonConverters.GenerationErrorResponseTaskCompletionSpeedNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerationRejectReason)) - { - return new global::Ideogram.JsonConverters.GenerationRejectReasonJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerationRejectReason?)) - { - return new global::Ideogram.JsonConverters.GenerationRejectReasonNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ReframeImageIdeogramV3RequestRenderingSpeed)) - { - return new global::Ideogram.JsonConverters.ReframeImageIdeogramV3RequestRenderingSpeedJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ReframeImageIdeogramV3RequestRenderingSpeed?)) - { - return new global::Ideogram.JsonConverters.ReframeImageIdeogramV3RequestRenderingSpeedNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ReframeImageNanoBananaProRequestResolutionTier)) - { - return new global::Ideogram.JsonConverters.ReframeImageNanoBananaProRequestResolutionTierJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ReframeImageNanoBananaProRequestResolutionTier?)) - { - return new global::Ideogram.JsonConverters.ReframeImageNanoBananaProRequestResolutionTierNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ReframeImageGptImage25FlareRequestQuality)) - { - return new global::Ideogram.JsonConverters.ReframeImageGptImage25FlareRequestQualityJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ReframeImageGptImage25FlareRequestQuality?)) - { - return new global::Ideogram.JsonConverters.ReframeImageGptImage25FlareRequestQualityNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ResolutionV3)) - { - return new global::Ideogram.JsonConverters.ResolutionV3JsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ResolutionV3?)) - { - return new global::Ideogram.JsonConverters.ResolutionV3NullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.AssetType)) - { - return new global::Ideogram.JsonConverters.AssetTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.AssetType?)) - { - return new global::Ideogram.JsonConverters.AssetTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.IdeogramColorPalettePresetName)) - { - return new global::Ideogram.JsonConverters.IdeogramColorPalettePresetNameJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.IdeogramColorPalettePresetName?)) - { - return new global::Ideogram.JsonConverters.IdeogramColorPalettePresetNameNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.IdeogramV3StylePreset)) - { - return new global::Ideogram.JsonConverters.IdeogramV3StylePresetJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.IdeogramV3StylePreset?)) - { - return new global::Ideogram.JsonConverters.IdeogramV3StylePresetNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.NanoBanana2ReframeAspectRatio)) - { - return new global::Ideogram.JsonConverters.NanoBanana2ReframeAspectRatioJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.NanoBanana2ReframeAspectRatio?)) - { - return new global::Ideogram.JsonConverters.NanoBanana2ReframeAspectRatioNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.NanoBananaProReframeAspectRatio)) - { - return new global::Ideogram.JsonConverters.NanoBananaProReframeAspectRatioJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.NanoBananaProReframeAspectRatio?)) - { - return new global::Ideogram.JsonConverters.NanoBananaProReframeAspectRatioNullableJsonConverter(); - } - throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); - } - } - - private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver - { - private readonly object _gate = new(); - private readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[] _resolvers = new global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[1]; - - public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo( - global::System.Type type, - global::System.Text.Json.JsonSerializerOptions options) - { - for (var index = 0; index < _resolvers.Length; index++) - { - var typeInfo = GetResolver(index).GetTypeInfo(type, options); - if (typeInfo is not null) - { - return typeInfo; - } - } - - return null; - } - - private global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver GetResolver(int index) - { - var resolver = global::System.Threading.Volatile.Read(ref _resolvers[index]); - if (resolver is not null) - { - return resolver; - } - - lock (_gate) - { - return _resolvers[index] ??= CreateResolver(index); - } - } - - private static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver CreateResolver(int index) - { - return index switch - { - 0 => new ImagesReframeSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), - _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), - }; - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesReframeClient.Authorizations.Bearer.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesReframeClient.Authorizations.Bearer.g.cs deleted file mode 100644 index 6837bdcb..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ImagesReframeClient.Authorizations.Bearer.g.cs +++ /dev/null @@ -1,35 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public sealed partial class ImagesReframeClient - { - - /// - public void AuthorizeUsingBearer( - string apiKey) - { - apiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey)); - - for (var i = Authorizations.Count - 1; i >= 0; i--) - { - var __authorization = Authorizations[i]; - if (__authorization.Type == "Http" && - __authorization.Name == "Bearer") - { - Authorizations.RemoveAt(i); - } - } - - Authorizations.Add(new global::Ideogram.EndPointAuthorization - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - Value = apiKey, - }); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesReframeClient.Auto.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesReframeClient.Auto.g.cs deleted file mode 100644 index 3c19e6c6..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ImagesReframeClient.Auto.g.cs +++ /dev/null @@ -1,852 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ImagesReframeClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_AutoSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_AutoSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_AutoSecurityRequirement0, - }; - partial void PrepareAutoArguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? dryRun, - global::Ideogram.ReframeImageAutoRequest request); - partial void PrepareAutoRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? dryRun, - global::Ideogram.ReframeImageAutoRequest request); - partial void ProcessAutoResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessAutoResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Reframe an image, letting Ideogram pick the model
- /// Reframe one image to a new aspect ratio without choosing a model.
- /// Ideogram selects the model best suited to the source and may route
- /// different requests to different models; the request is billed at the
- /// chosen model's price. Supply either an existing Ideogram image asset
- /// or raw image bytes, but not both.
- /// This operation is asynchronous. It returns as soon as the request is
- /// accepted; poll `GET /v2/generations/{generation_id}` for completion
- /// and results. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task AutoAsync( - - global::Ideogram.ReframeImageAutoRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await AutoAsResponseAsync( - - request: request, - dryRun: dryRun, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Reframe an image, letting Ideogram pick the model
- /// Reframe one image to a new aspect ratio without choosing a model.
- /// Ideogram selects the model best suited to the source and may route
- /// different requests to different models; the request is billed at the
- /// chosen model's price. Supply either an existing Ideogram image asset
- /// or raw image bytes, but not both.
- /// This operation is asynchronous. It returns as soon as the request is
- /// accepted; poll `GET /v2/generations/{generation_id}` for completion
- /// and results. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> AutoAsResponseAsync( - - global::Ideogram.ReframeImageAutoRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareAutoArguments( - httpClient: HttpClient, - dryRun: ref dryRun, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_AutoSecurityRequirements, - operationName: "AutoAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/image/reframe/auto", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (request.ImageAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ImageAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"image_asset_identifier\""); - - } - if (request.Image != default) - { - - var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - } - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.AspectRatio ?? string.Empty), - name: "\"aspect_ratio\""); - - if (request.Private != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"private\""); - - } - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareAutoRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - dryRun: dryRun, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "Auto", - methodName: "AutoAsync", - pathTemplate: "\"/v2/image/reframe/auto\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "Auto", - methodName: "AutoAsync", - pathTemplate: "\"/v2/image/reframe/auto\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "Auto", - methodName: "AutoAsync", - pathTemplate: "\"/v2/image/reframe/auto\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessAutoResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "Auto", - methodName: "AutoAsync", - pathTemplate: "\"/v2/image/reframe/auto\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "Auto", - methodName: "AutoAsync", - pathTemplate: "\"/v2/image/reframe/auto\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 500) - { - string? __content_500 = null; - global::System.Exception? __exception_500 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_500 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_500, - responseBody: __content_500, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessAutoResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.ReframeImageAutoResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.ReframeImageAutoResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Reframe an image, letting Ideogram pick the model
- /// Reframe one image to a new aspect ratio without choosing a model.
- /// Ideogram selects the model best suited to the source and may route
- /// different requests to different models; the request is billed at the
- /// chosen model's price. Supply either an existing Ideogram image asset
- /// or raw image bytes, but not both.
- /// This operation is asynchronous. It returns as soon as the request is
- /// accepted; poll `GET /v2/generations/{generation_id}` for completion
- /// and results. - ///
- /// - /// Default Value: false - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The JPEG, PNG, or WEBP image to reframe (max 50MB). - /// - /// - /// The JPEG, PNG, or WEBP image to reframe (max 50MB). - /// - /// - /// The requested output aspect ratio, as `width:height`.
- /// Example: 16:9 - /// - /// - /// API-key requests are always private. For bearer-authenticated
- /// requests, this controls whether the result is private; when
- /// omitted, it follows the caller's plan entitlement. Enterprise
- /// generations are always private. - /// - /// - /// The number of output images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task AutoAsync( - string aspectRatio, - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - bool? @private = default, - int? numImages = default, - int? seed = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.ReframeImageAutoRequest - { - ImageAssetIdentifier = imageAssetIdentifier, - Image = image, - Imagename = imagename, - AspectRatio = aspectRatio, - Private = @private, - NumImages = numImages, - Seed = seed, - }; - - return await AutoAsync( - dryRun: dryRun, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesReframeClient.BriaExpand.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesReframeClient.BriaExpand.g.cs deleted file mode 100644 index fb8212ec..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ImagesReframeClient.BriaExpand.g.cs +++ /dev/null @@ -1,838 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ImagesReframeClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_BriaExpandSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_BriaExpandSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_BriaExpandSecurityRequirement0, - }; - partial void PrepareBriaExpandArguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? dryRun, - global::Ideogram.ReframeImageBriaExpandRequest request); - partial void PrepareBriaExpandRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? dryRun, - global::Ideogram.ReframeImageBriaExpandRequest request); - partial void ProcessBriaExpandResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessBriaExpandResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Reframe an image with Bria Expand
- /// Extend one image to a new aspect ratio with Bria Expand. The source
- /// pixels are kept exactly as they are, centered on the new canvas, and
- /// the model paints only the added area. Supply either an existing
- /// Ideogram image asset or raw image bytes, but not both. The canvas is
- /// sized from the source so that the whole source fits.
- /// This operation is asynchronous. It returns as soon as the request is
- /// accepted; poll `GET /v2/generations/{generation_id}` for completion
- /// and results. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task BriaExpandAsync( - - global::Ideogram.ReframeImageBriaExpandRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await BriaExpandAsResponseAsync( - - request: request, - dryRun: dryRun, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Reframe an image with Bria Expand
- /// Extend one image to a new aspect ratio with Bria Expand. The source
- /// pixels are kept exactly as they are, centered on the new canvas, and
- /// the model paints only the added area. Supply either an existing
- /// Ideogram image asset or raw image bytes, but not both. The canvas is
- /// sized from the source so that the whole source fits.
- /// This operation is asynchronous. It returns as soon as the request is
- /// accepted; poll `GET /v2/generations/{generation_id}` for completion
- /// and results. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> BriaExpandAsResponseAsync( - - global::Ideogram.ReframeImageBriaExpandRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareBriaExpandArguments( - httpClient: HttpClient, - dryRun: ref dryRun, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_BriaExpandSecurityRequirements, - operationName: "BriaExpandAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/image/reframe/bria-expand", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (request.ImageAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ImageAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"image_asset_identifier\""); - - } - if (request.Image != default) - { - - var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - } - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.AspectRatio ?? string.Empty), - name: "\"aspect_ratio\""); - - if (request.Private != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"private\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareBriaExpandRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - dryRun: dryRun, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "BriaExpand", - methodName: "BriaExpandAsync", - pathTemplate: "\"/v2/image/reframe/bria-expand\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "BriaExpand", - methodName: "BriaExpandAsync", - pathTemplate: "\"/v2/image/reframe/bria-expand\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "BriaExpand", - methodName: "BriaExpandAsync", - pathTemplate: "\"/v2/image/reframe/bria-expand\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessBriaExpandResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "BriaExpand", - methodName: "BriaExpandAsync", - pathTemplate: "\"/v2/image/reframe/bria-expand\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "BriaExpand", - methodName: "BriaExpandAsync", - pathTemplate: "\"/v2/image/reframe/bria-expand\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 500) - { - string? __content_500 = null; - global::System.Exception? __exception_500 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_500 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_500, - responseBody: __content_500, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessBriaExpandResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.ReframeImageBriaExpandResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.ReframeImageBriaExpandResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Reframe an image with Bria Expand
- /// Extend one image to a new aspect ratio with Bria Expand. The source
- /// pixels are kept exactly as they are, centered on the new canvas, and
- /// the model paints only the added area. Supply either an existing
- /// Ideogram image asset or raw image bytes, but not both. The canvas is
- /// sized from the source so that the whole source fits.
- /// This operation is asynchronous. It returns as soon as the request is
- /// accepted; poll `GET /v2/generations/{generation_id}` for completion
- /// and results. - ///
- /// - /// Default Value: false - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The JPEG, PNG, or WEBP image to reframe (max 50MB). - /// - /// - /// The JPEG, PNG, or WEBP image to reframe (max 50MB). - /// - /// - /// The requested output aspect ratio, as `width:height`.
- /// Example: 16:9 - /// - /// - /// API-key requests are always private. For bearer-authenticated
- /// requests, this controls whether the result is private; when
- /// omitted, it follows the caller's plan entitlement. Enterprise
- /// generations are always private. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task BriaExpandAsync( - string aspectRatio, - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - bool? @private = default, - int? seed = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.ReframeImageBriaExpandRequest - { - ImageAssetIdentifier = imageAssetIdentifier, - Image = image, - Imagename = imagename, - AspectRatio = aspectRatio, - Private = @private, - Seed = seed, - }; - - return await BriaExpandAsync( - dryRun: dryRun, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesReframeClient.Constructors.Bearer.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesReframeClient.Constructors.Bearer.g.cs deleted file mode 100644 index b7d1cffb..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ImagesReframeClient.Constructors.Bearer.g.cs +++ /dev/null @@ -1,31 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public sealed partial class ImagesReframeClient - { - /// - - public ImagesReframeClient( - string apiKey, - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - bool disposeHttpClient = true) : this(httpClient, baseUri, authorizations, disposeHttpClient) - { - Authorizing(HttpClient, ref apiKey); - - AuthorizeUsingBearer(apiKey); - - Authorized(HttpClient); - } - - partial void Authorizing( - global::System.Net.Http.HttpClient client, - ref string apiKey); - partial void Authorized( - global::System.Net.Http.HttpClient client); - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesReframeClient.GptImage25Flare.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesReframeClient.GptImage25Flare.g.cs deleted file mode 100644 index 2d46b31d..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ImagesReframeClient.GptImage25Flare.g.cs +++ /dev/null @@ -1,863 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ImagesReframeClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_GptImage25FlareSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_GptImage25FlareSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_GptImage25FlareSecurityRequirement0, - }; - partial void PrepareGptImage25FlareArguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? dryRun, - global::Ideogram.ReframeImageGptImage25FlareRequest request); - partial void PrepareGptImage25FlareRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? dryRun, - global::Ideogram.ReframeImageGptImage25FlareRequest request); - partial void ProcessGptImage25FlareResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessGptImage25FlareResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Reframe an image with GPT Image 2.5 Flare
- /// Recompose one image for a new aspect ratio with GPT Image 2.5 Flare.
- /// Supply either an existing Ideogram image asset or raw image bytes, but
- /// not both. The requested aspect ratio is resolved to the closest output
- /// size the model supports.
- /// This operation is asynchronous. It returns as soon as the request is
- /// accepted; poll `GET /v2/generations/{generation_id}` for completion
- /// and results. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task GptImage25FlareAsync( - - global::Ideogram.ReframeImageGptImage25FlareRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await GptImage25FlareAsResponseAsync( - - request: request, - dryRun: dryRun, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Reframe an image with GPT Image 2.5 Flare
- /// Recompose one image for a new aspect ratio with GPT Image 2.5 Flare.
- /// Supply either an existing Ideogram image asset or raw image bytes, but
- /// not both. The requested aspect ratio is resolved to the closest output
- /// size the model supports.
- /// This operation is asynchronous. It returns as soon as the request is
- /// accepted; poll `GET /v2/generations/{generation_id}` for completion
- /// and results. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> GptImage25FlareAsResponseAsync( - - global::Ideogram.ReframeImageGptImage25FlareRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareGptImage25FlareArguments( - httpClient: HttpClient, - dryRun: ref dryRun, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_GptImage25FlareSecurityRequirements, - operationName: "GptImage25FlareAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/image/reframe/gpt-image-2-5-flare", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (request.ImageAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ImageAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"image_asset_identifier\""); - - } - if (request.Image != default) - { - - var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - } - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.AspectRatio ?? string.Empty), - name: "\"aspect_ratio\""); - - if (request.Quality != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Quality).HasValue ? (request.Quality).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"quality\""); - - } - if (request.Private != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"private\""); - - } - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGptImage25FlareRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - dryRun: dryRun, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GptImage25Flare", - methodName: "GptImage25FlareAsync", - pathTemplate: "\"/v2/image/reframe/gpt-image-2-5-flare\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GptImage25Flare", - methodName: "GptImage25FlareAsync", - pathTemplate: "\"/v2/image/reframe/gpt-image-2-5-flare\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GptImage25Flare", - methodName: "GptImage25FlareAsync", - pathTemplate: "\"/v2/image/reframe/gpt-image-2-5-flare\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGptImage25FlareResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GptImage25Flare", - methodName: "GptImage25FlareAsync", - pathTemplate: "\"/v2/image/reframe/gpt-image-2-5-flare\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GptImage25Flare", - methodName: "GptImage25FlareAsync", - pathTemplate: "\"/v2/image/reframe/gpt-image-2-5-flare\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 500) - { - string? __content_500 = null; - global::System.Exception? __exception_500 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_500 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_500, - responseBody: __content_500, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGptImage25FlareResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.ReframeImageGptImage25FlareResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.ReframeImageGptImage25FlareResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Reframe an image with GPT Image 2.5 Flare
- /// Recompose one image for a new aspect ratio with GPT Image 2.5 Flare.
- /// Supply either an existing Ideogram image asset or raw image bytes, but
- /// not both. The requested aspect ratio is resolved to the closest output
- /// size the model supports.
- /// This operation is asynchronous. It returns as soon as the request is
- /// accepted; poll `GET /v2/generations/{generation_id}` for completion
- /// and results. - ///
- /// - /// Default Value: false - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The JPEG, PNG, or WEBP image to reframe (max 50MB). - /// - /// - /// The JPEG, PNG, or WEBP image to reframe (max 50MB). - /// - /// - /// The requested output aspect ratio, as `width:height`.
- /// Example: 16:9 - /// - /// - /// How much rendering effort the model spends. Lower tiers return sooner and cost less; `auto` lets the model choose.
- /// Default Value: auto - /// - /// - /// API-key requests are always private. For bearer-authenticated
- /// requests, this controls whether the result is private; when
- /// omitted, it follows the caller's plan entitlement. Enterprise
- /// generations are always private. - /// - /// - /// The number of output images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task GptImage25FlareAsync( - string aspectRatio, - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - global::Ideogram.ReframeImageGptImage25FlareRequestQuality? quality = default, - bool? @private = default, - int? numImages = default, - int? seed = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.ReframeImageGptImage25FlareRequest - { - ImageAssetIdentifier = imageAssetIdentifier, - Image = image, - Imagename = imagename, - AspectRatio = aspectRatio, - Quality = quality, - Private = @private, - NumImages = numImages, - Seed = seed, - }; - - return await GptImage25FlareAsync( - dryRun: dryRun, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesReframeClient.IdeogramV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesReframeClient.IdeogramV3.g.cs deleted file mode 100644 index 1a9acfae..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ImagesReframeClient.IdeogramV3.g.cs +++ /dev/null @@ -1,931 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ImagesReframeClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_IdeogramV3SecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_IdeogramV3SecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_IdeogramV3SecurityRequirement0, - }; - partial void PrepareIdeogramV3Arguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? dryRun, - global::Ideogram.ReframeImageIdeogramV3Request request); - partial void PrepareIdeogramV3Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? dryRun, - global::Ideogram.ReframeImageIdeogramV3Request request); - partial void ProcessIdeogramV3Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessIdeogramV3ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Reframe with Ideogram 3.0
- /// Expand an image to a new Ideogram 3.0 resolution, keeping the source
- /// pixels in the center and filling the new area. Upload the source
- /// `image` using `multipart/form-data`. Returns results directly by
- /// default; set `async` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task IdeogramV3Async( - - global::Ideogram.ReframeImageIdeogramV3Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await IdeogramV3AsResponseAsync( - - request: request, - dryRun: dryRun, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Reframe with Ideogram 3.0
- /// Expand an image to a new Ideogram 3.0 resolution, keeping the source
- /// pixels in the center and filling the new area. Upload the source
- /// `image` using `multipart/form-data`. Returns results directly by
- /// default; set `async` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> IdeogramV3AsResponseAsync( - - global::Ideogram.ReframeImageIdeogramV3Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareIdeogramV3Arguments( - httpClient: HttpClient, - dryRun: ref dryRun, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_IdeogramV3SecurityRequirements, - operationName: "IdeogramV3Async"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/image/reframe/ideogram-3", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (request.ImageAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ImageAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"image_asset_identifier\""); - - } - if (request.Image != default) - { - - var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - } - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Resolution.ToValueString()), - name: "\"resolution\""); - - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.RenderingSpeed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"rendering_speed\""); - - } - if (request.StylePreset != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.StylePreset).HasValue ? (request.StylePreset).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"style_preset\""); - - } - if (request.ColorPalette != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ColorPalette.ToString() ?? string.Empty), - name: "\"color_palette\""); - - } - if (request.StyleCodes != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.StyleCodes!, x => x))}]"), - name: "\"style_codes\""); - - } - if (request.StyleReferenceAssetIdentifiers != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.StyleReferenceAssetIdentifiers!, x => x.ToJson(JsonSerializerContext)))}]"), - name: "\"style_reference_asset_identifiers\""); - - } - if (request.StyleReferenceImages != default) - { - - for (var __iStyleReferenceImages = 0; __iStyleReferenceImages < request.StyleReferenceImages.Count; __iStyleReferenceImages++) - { - var __contentStyleReferenceImages = new global::System.Net.Http.ByteArrayContent(request.StyleReferenceImages[__iStyleReferenceImages]); - __contentStyleReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); - __httpRequestContent.Add( - content: __contentStyleReferenceImages, - name: "\"style_reference_images\"", - fileName: $"\"file{__iStyleReferenceImages}.bin\""); - if (__contentStyleReferenceImages.Headers.ContentDisposition != null) - { - __contentStyleReferenceImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - if (request.Async != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"async\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareIdeogramV3Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - dryRun: dryRun, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "IdeogramV3", - methodName: "IdeogramV3Async", - pathTemplate: "\"/v2/image/reframe/ideogram-3\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "IdeogramV3", - methodName: "IdeogramV3Async", - pathTemplate: "\"/v2/image/reframe/ideogram-3\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "IdeogramV3", - methodName: "IdeogramV3Async", - pathTemplate: "\"/v2/image/reframe/ideogram-3\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessIdeogramV3Response( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "IdeogramV3", - methodName: "IdeogramV3Async", - pathTemplate: "\"/v2/image/reframe/ideogram-3\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "IdeogramV3", - methodName: "IdeogramV3Async", - pathTemplate: "\"/v2/image/reframe/ideogram-3\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 500) - { - string? __content_500 = null; - global::System.Exception? __exception_500 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_500 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_500, - responseBody: __content_500, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessIdeogramV3ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.ReframeImageIdeogramV3Response.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.ReframeImageIdeogramV3Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Reframe with Ideogram 3.0
- /// Expand an image to a new Ideogram 3.0 resolution, keeping the source
- /// pixels in the center and filling the new area. Upload the source
- /// `image` using `multipart/form-data`. Returns results directly by
- /// default; set `async` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The JPEG, PNG, or WEBP image to reframe (max 25MB). Multipart requests only. - /// - /// - /// The JPEG, PNG, or WEBP image to reframe (max 25MB). Multipart requests only. - /// - /// - /// The resolutions supported for Ideogram 3.0.
- /// Example: 1280x800 - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// Default Value: default - /// - /// - /// A predefined style preset that applies a specific artistic style to the generated image.
- /// Example: bright_art - /// - /// - /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). - /// - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - /// - /// - /// Existing upload or generated image assets to use as style references. Cannot be combined with a style preset, style codes, or uploaded style reference images. - /// - /// - /// JPEG, PNG, or WEBP style reference images (max 10, max 25MB each). Multipart requests only. Cannot be combined with `style_preset` or `style_codes`. - /// - /// - /// Return immediately instead of waiting for reframed images.
- /// Default Value: false - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task IdeogramV3Async( - global::Ideogram.ResolutionV3 resolution, - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - int? numImages = default, - int? seed = default, - global::Ideogram.ReframeImageIdeogramV3RequestRenderingSpeed? renderingSpeed = default, - global::Ideogram.IdeogramV3StylePreset? stylePreset = default, - global::Ideogram.IdeogramColorPalette? colorPalette = default, - global::System.Collections.Generic.IList? styleCodes = default, - global::System.Collections.Generic.IList? styleReferenceAssetIdentifiers = default, - global::System.Collections.Generic.IList? styleReferenceImages = default, - bool? async = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.ReframeImageIdeogramV3Request - { - ImageAssetIdentifier = imageAssetIdentifier, - Image = image, - Imagename = imagename, - Resolution = resolution, - NumImages = numImages, - Seed = seed, - RenderingSpeed = renderingSpeed, - StylePreset = stylePreset, - ColorPalette = colorPalette, - StyleCodes = styleCodes, - StyleReferenceAssetIdentifiers = styleReferenceAssetIdentifiers, - StyleReferenceImages = styleReferenceImages, - Async = async, - }; - - return await IdeogramV3Async( - dryRun: dryRun, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesReframeClient.NanoBanana2.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesReframeClient.NanoBanana2.g.cs deleted file mode 100644 index 3da7897c..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ImagesReframeClient.NanoBanana2.g.cs +++ /dev/null @@ -1,839 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ImagesReframeClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_NanoBanana2SecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_NanoBanana2SecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_NanoBanana2SecurityRequirement0, - }; - partial void PrepareNanoBanana2Arguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? dryRun, - global::Ideogram.ReframeImageNanoBanana2Request request); - partial void PrepareNanoBanana2Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? dryRun, - global::Ideogram.ReframeImageNanoBanana2Request request); - partial void ProcessNanoBanana2Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessNanoBanana2ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Reframe with Nano Banana 2
- /// Expand an image to a new aspect ratio with Nano Banana 2. Upload the
- /// source `image` using `multipart/form-data`. Always asynchronous:
- /// returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// for results. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task NanoBanana2Async( - - global::Ideogram.ReframeImageNanoBanana2Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await NanoBanana2AsResponseAsync( - - request: request, - dryRun: dryRun, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Reframe with Nano Banana 2
- /// Expand an image to a new aspect ratio with Nano Banana 2. Upload the
- /// source `image` using `multipart/form-data`. Always asynchronous:
- /// returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// for results. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> NanoBanana2AsResponseAsync( - - global::Ideogram.ReframeImageNanoBanana2Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareNanoBanana2Arguments( - httpClient: HttpClient, - dryRun: ref dryRun, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_NanoBanana2SecurityRequirements, - operationName: "NanoBanana2Async"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/image/reframe/nano-banana-2", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (request.ImageAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ImageAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"image_asset_identifier\""); - - } - if (request.Image != default) - { - - var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - } - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.AspectRatio.ToValueString()), - name: "\"aspect_ratio\""); - - if (request.Private != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"private\""); - - } - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareNanoBanana2Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - dryRun: dryRun, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "NanoBanana2", - methodName: "NanoBanana2Async", - pathTemplate: "\"/v2/image/reframe/nano-banana-2\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "NanoBanana2", - methodName: "NanoBanana2Async", - pathTemplate: "\"/v2/image/reframe/nano-banana-2\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "NanoBanana2", - methodName: "NanoBanana2Async", - pathTemplate: "\"/v2/image/reframe/nano-banana-2\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessNanoBanana2Response( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "NanoBanana2", - methodName: "NanoBanana2Async", - pathTemplate: "\"/v2/image/reframe/nano-banana-2\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "NanoBanana2", - methodName: "NanoBanana2Async", - pathTemplate: "\"/v2/image/reframe/nano-banana-2\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 500) - { - string? __content_500 = null; - global::System.Exception? __exception_500 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_500 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_500, - responseBody: __content_500, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessNanoBanana2ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.ReframeImageNanoBanana2Response.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.ReframeImageNanoBanana2Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Reframe with Nano Banana 2
- /// Expand an image to a new aspect ratio with Nano Banana 2. Upload the
- /// source `image` using `multipart/form-data`. Always asynchronous:
- /// returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// for results. - ///
- /// - /// Default Value: false - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The JPEG, PNG, or WEBP image to reframe (max 50MB). - /// - /// - /// The JPEG, PNG, or WEBP image to reframe (max 50MB). - /// - /// - /// Aspect ratios Nano Banana 2 can reframe an image to. - /// - /// - /// API-key requests are always private. For bearer-authenticated
- /// requests, this controls whether the result is private; when
- /// omitted, it follows the caller's plan entitlement. Enterprise
- /// generations are always private. - /// - /// - /// The number of output images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task NanoBanana2Async( - global::Ideogram.NanoBanana2ReframeAspectRatio aspectRatio, - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - bool? @private = default, - int? numImages = default, - int? seed = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.ReframeImageNanoBanana2Request - { - ImageAssetIdentifier = imageAssetIdentifier, - Image = image, - Imagename = imagename, - AspectRatio = aspectRatio, - Private = @private, - NumImages = numImages, - Seed = seed, - }; - - return await NanoBanana2Async( - dryRun: dryRun, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesReframeClient.NanoBananaPro.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesReframeClient.NanoBananaPro.g.cs deleted file mode 100644 index c28eacdc..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ImagesReframeClient.NanoBananaPro.g.cs +++ /dev/null @@ -1,862 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ImagesReframeClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_NanoBananaProSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_NanoBananaProSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_NanoBananaProSecurityRequirement0, - }; - partial void PrepareNanoBananaProArguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? dryRun, - global::Ideogram.ReframeImageNanoBananaProRequest request); - partial void PrepareNanoBananaProRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? dryRun, - global::Ideogram.ReframeImageNanoBananaProRequest request); - partial void ProcessNanoBananaProResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessNanoBananaProResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Reframe an image with Nano Banana Pro
- /// Recompose one image for a new aspect ratio with Nano Banana Pro, at a
- /// 1K, 2K, or 4K output tier. Supply either an existing Ideogram image
- /// asset or raw image bytes, but not both. The requested aspect ratio is
- /// resolved to the closest dimensions the model supports at that tier.
- /// This operation is asynchronous. It returns as soon as the request is
- /// accepted; poll `GET /v2/generations/{generation_id}` for completion
- /// and results. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task NanoBananaProAsync( - - global::Ideogram.ReframeImageNanoBananaProRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await NanoBananaProAsResponseAsync( - - request: request, - dryRun: dryRun, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Reframe an image with Nano Banana Pro
- /// Recompose one image for a new aspect ratio with Nano Banana Pro, at a
- /// 1K, 2K, or 4K output tier. Supply either an existing Ideogram image
- /// asset or raw image bytes, but not both. The requested aspect ratio is
- /// resolved to the closest dimensions the model supports at that tier.
- /// This operation is asynchronous. It returns as soon as the request is
- /// accepted; poll `GET /v2/generations/{generation_id}` for completion
- /// and results. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> NanoBananaProAsResponseAsync( - - global::Ideogram.ReframeImageNanoBananaProRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareNanoBananaProArguments( - httpClient: HttpClient, - dryRun: ref dryRun, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_NanoBananaProSecurityRequirements, - operationName: "NanoBananaProAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/image/reframe/nano-banana-pro", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (request.ImageAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ImageAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"image_asset_identifier\""); - - } - if (request.Image != default) - { - - var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - } - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.AspectRatio.ToValueString()), - name: "\"aspect_ratio\""); - - if (request.ResolutionTier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.ResolutionTier).HasValue ? (request.ResolutionTier).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"resolution_tier\""); - - } - if (request.Private != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"private\""); - - } - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareNanoBananaProRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - dryRun: dryRun, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "NanoBananaPro", - methodName: "NanoBananaProAsync", - pathTemplate: "\"/v2/image/reframe/nano-banana-pro\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "NanoBananaPro", - methodName: "NanoBananaProAsync", - pathTemplate: "\"/v2/image/reframe/nano-banana-pro\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "NanoBananaPro", - methodName: "NanoBananaProAsync", - pathTemplate: "\"/v2/image/reframe/nano-banana-pro\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessNanoBananaProResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "NanoBananaPro", - methodName: "NanoBananaProAsync", - pathTemplate: "\"/v2/image/reframe/nano-banana-pro\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "NanoBananaPro", - methodName: "NanoBananaProAsync", - pathTemplate: "\"/v2/image/reframe/nano-banana-pro\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 500) - { - string? __content_500 = null; - global::System.Exception? __exception_500 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_500 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_500, - responseBody: __content_500, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessNanoBananaProResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.ReframeImageNanoBananaProResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.ReframeImageNanoBananaProResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Reframe an image with Nano Banana Pro
- /// Recompose one image for a new aspect ratio with Nano Banana Pro, at a
- /// 1K, 2K, or 4K output tier. Supply either an existing Ideogram image
- /// asset or raw image bytes, but not both. The requested aspect ratio is
- /// resolved to the closest dimensions the model supports at that tier.
- /// This operation is asynchronous. It returns as soon as the request is
- /// accepted; poll `GET /v2/generations/{generation_id}` for completion
- /// and results. - ///
- /// - /// Default Value: false - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The JPEG, PNG, or WEBP image to reframe (max 50MB). - /// - /// - /// The JPEG, PNG, or WEBP image to reframe (max 50MB). - /// - /// - /// Aspect ratios Nano Banana Pro can reframe an image to. - /// - /// - /// The output resolution tier. The model sizes its output by tier at the requested aspect ratio; exact pixel dimensions cannot be requested.
- /// Default Value: 1K - /// - /// - /// API-key requests are always private. For bearer-authenticated
- /// requests, this controls whether the result is private; when
- /// omitted, it follows the caller's plan entitlement. Enterprise
- /// generations are always private. - /// - /// - /// The number of output images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task NanoBananaProAsync( - global::Ideogram.NanoBananaProReframeAspectRatio aspectRatio, - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - global::Ideogram.ReframeImageNanoBananaProRequestResolutionTier? resolutionTier = default, - bool? @private = default, - int? numImages = default, - int? seed = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.ReframeImageNanoBananaProRequest - { - ImageAssetIdentifier = imageAssetIdentifier, - Image = image, - Imagename = imagename, - AspectRatio = aspectRatio, - ResolutionTier = resolutionTier, - Private = @private, - NumImages = numImages, - Seed = seed, - }; - - return await NanoBananaProAsync( - dryRun: dryRun, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesReframeClient.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesReframeClient.g.cs deleted file mode 100644 index 411abab4..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ImagesReframeClient.g.cs +++ /dev/null @@ -1,145 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Expand an existing image to a new model-specific output shape while
- /// preserving the source content and filling the new area.
- /// If no httpClient is provided, a new one will be created.
- /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. - ///
- public sealed partial class ImagesReframeClient : global::Ideogram.IImagesReframeClient, global::System.IDisposable - { - /// - /// - /// - public const string DefaultBaseUrl = "https://api.ideogram.ai/"; - - private bool _disposeHttpClient = true; - - /// - public global::System.Net.Http.HttpClient HttpClient { get; } - - /// - public System.Uri? BaseUri => HttpClient.BaseAddress; - - /// - public global::System.Collections.Generic.List Authorizations { get; } - - /// - public bool ReadResponseAsString { get; set; } -#if DEBUG - = true; -#endif - - /// - public global::Ideogram.AutoSDKClientOptions Options { get; } - - internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::Ideogram.ImagesReframeSourceGenerationContext.Default); - - /// - /// - /// - public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext - { - get => JsonSerializerContextProvider.Value; - set => JsonSerializerContextProvider = new(() => value); - } - - - /// - /// Creates a new instance of the ImagesReframeClient. - /// If no httpClient is provided, a new one will be created. - /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. - /// - /// The HttpClient instance. If not provided, a new one will be created. - /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. - /// The authorizations to use for the requests. - /// Dispose the HttpClient when the instance is disposed. True by default. - public ImagesReframeClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - bool disposeHttpClient = true) : this( - httpClient, - baseUri, - authorizations, - options: null, - disposeHttpClient: disposeHttpClient) - { - } - - /// - /// Creates a new instance of the ImagesReframeClient with explicit options but no base URL override. - /// Skips passing baseUri so the default base URL from the OpenAPI spec applies. - /// - /// The HttpClient instance. If not provided, a new one will be created. - /// The authorizations to use for the requests. - /// Client-wide request defaults such as headers, query parameters, retries, and timeout. - /// Dispose the HttpClient when the instance is disposed. True by default. - public ImagesReframeClient( - global::System.Net.Http.HttpClient? httpClient, - global::System.Collections.Generic.List? authorizations, - global::Ideogram.AutoSDKClientOptions? options, - bool disposeHttpClient = true) : this( - httpClient, - baseUri: null, - authorizations, - options, - disposeHttpClient: disposeHttpClient) - { - } - - /// - /// Creates a new instance of the ImagesReframeClient. - /// If no httpClient is provided, a new one will be created. - /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. - /// - /// The HttpClient instance. If not provided, a new one will be created. - /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. - /// The authorizations to use for the requests. - /// Client-wide request defaults such as headers, query parameters, retries, and timeout. - /// Dispose the HttpClient when the instance is disposed. True by default. - public ImagesReframeClient( - global::System.Net.Http.HttpClient? httpClient, - global::System.Uri? baseUri, - global::System.Collections.Generic.List? authorizations, - global::Ideogram.AutoSDKClientOptions? options, - bool disposeHttpClient = true) - { - - HttpClient = httpClient ?? new global::System.Net.Http.HttpClient(); - HttpClient.BaseAddress ??= baseUri ?? new global::System.Uri(DefaultBaseUrl); - Authorizations = authorizations ?? new global::System.Collections.Generic.List(); - Options = options ?? new global::Ideogram.AutoSDKClientOptions(); - _disposeHttpClient = disposeHttpClient; - - Initialized(HttpClient); - } - - /// - public void Dispose() - { - if (_disposeHttpClient) - { - HttpClient.Dispose(); - } - } - - partial void Initialized( - global::System.Net.Http.HttpClient client); - partial void PrepareArguments( - global::System.Net.Http.HttpClient client); - partial void PrepareRequest( - global::System.Net.Http.HttpClient client, - global::System.Net.Http.HttpRequestMessage request); - partial void ProcessResponse( - global::System.Net.Http.HttpClient client, - global::System.Net.Http.HttpResponseMessage response); - partial void ProcessResponseContent( - global::System.Net.Http.HttpClient client, - global::System.Net.Http.HttpResponseMessage response, - ref string content); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesRemix.JsonSerializerContext.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesRemix.JsonSerializerContext.g.cs index c60d8c00..7f07c176 100644 --- a/src/libs/Ideogram/Generated/Ideogram.ImagesRemix.JsonSerializerContext.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.ImagesRemix.JsonSerializerContext.g.cs @@ -14,69 +14,65 @@ namespace Ideogram [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ResolutionV4), TypeInfoPropertyName = "ResolutionV42")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AspectRatioV3), TypeInfoPropertyName = "AspectRatioV32")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(byte[]))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ResolutionV3), TypeInfoPropertyName = "ResolutionV32")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AssetIdentifier))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationErrorResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationRejectReason), TypeInfoPropertyName = "GenerationRejectReason2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed), TypeInfoPropertyName = "GenerationErrorResponseTaskCompletionSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationErrorResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MagicPromptMode), TypeInfoPropertyName = "MagicPromptMode2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ResolutionV4), TypeInfoPropertyName = "ResolutionV42")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ResolutionV3), TypeInfoPropertyName = "ResolutionV32")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramColorPalettePresetName), TypeInfoPropertyName = "IdeogramColorPalettePresetName2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramColorPaletteWithPresetName))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ColorPaletteMember))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ColorPaletteWithMembers))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramColorPalette), TypeInfoPropertyName = "IdeogramColorPalette2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramV3StyleType), TypeInfoPropertyName = "IdeogramV3StyleType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramV3StylePreset), TypeInfoPropertyName = "IdeogramV3StylePreset2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemixImageIdeogramV3Response))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AspectRatioV3), TypeInfoPropertyName = "AspectRatioV32")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageRemixIdeogram4PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed), TypeInfoPropertyName = "V2ImageRemixIdeogram4PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemixedImageObject))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemixImageIdeogramV3Request))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemixImageIdeogramV3RequestRenderingSpeed), TypeInfoPropertyName = "RemixImageIdeogramV3RequestRenderingSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemixImageIdeogramV3CustomModelResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemixImageIdeogramV3CustomModelRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemixImageIdeogramV3CustomModelRequestRenderingSpeed), TypeInfoPropertyName = "RemixImageIdeogramV3CustomModelRequestRenderingSpeed2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemixImageIdeogramV4Response))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemixImageIdeogramV4Request))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemixImageIdeogramV4RequestRenderingSpeed), TypeInfoPropertyName = "RemixImageIdeogramV4RequestRenderingSpeed2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageRemixIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed), TypeInfoPropertyName = "V2ImageRemixIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemixImageIdeogramV3Response))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed), TypeInfoPropertyName = "V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType), TypeInfoPropertyName = "V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemixImageIdeogramV3CharacterResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemixImageIdeogramV3CharacterRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemixImageIdeogramV3CharacterRequestRenderingSpeed), TypeInfoPropertyName = "RemixImageIdeogramV3CharacterRequestRenderingSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemixImageIdeogramV3CharacterRequestStyleType), TypeInfoPropertyName = "RemixImageIdeogramV3CharacterRequestStyleType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ColorPaletteWithMembers))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ColorPaletteMember))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AssetType), TypeInfoPropertyName = "AssetType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramColorPaletteWithPresetName))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramColorPalettePresetName), TypeInfoPropertyName = "IdeogramColorPalettePresetName2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ResolutionV4?), TypeInfoPropertyName = "NullableResolutionV42")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageRemixIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed), TypeInfoPropertyName = "V2ImageRemixIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemixImageIdeogramV3CustomModelResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(byte[]))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV4Request))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3Request))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CharacterRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CustomModelRequest))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AspectRatioV3?), TypeInfoPropertyName = "NullableAspectRatioV32")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ResolutionV3?), TypeInfoPropertyName = "NullableResolutionV32")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationRejectReason?), TypeInfoPropertyName = "NullableGenerationRejectReason2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?), TypeInfoPropertyName = "NullableGenerationErrorResponseTaskCompletionSpeed2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MagicPromptMode?), TypeInfoPropertyName = "NullableMagicPromptMode2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ResolutionV4?), TypeInfoPropertyName = "NullableResolutionV42")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ResolutionV3?), TypeInfoPropertyName = "NullableResolutionV32")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramColorPalettePresetName?), TypeInfoPropertyName = "NullableIdeogramColorPalettePresetName2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(double?))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramColorPalette?), TypeInfoPropertyName = "NullableIdeogramColorPalette2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramV3StyleType?), TypeInfoPropertyName = "NullableIdeogramV3StyleType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramV3StylePreset?), TypeInfoPropertyName = "NullableIdeogramV3StylePreset2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(double?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemixImageIdeogramV3RequestRenderingSpeed?), TypeInfoPropertyName = "NullableRemixImageIdeogramV3RequestRenderingSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemixImageIdeogramV3CustomModelRequestRenderingSpeed?), TypeInfoPropertyName = "NullableRemixImageIdeogramV3CustomModelRequestRenderingSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemixImageIdeogramV4RequestRenderingSpeed?), TypeInfoPropertyName = "NullableRemixImageIdeogramV4RequestRenderingSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemixImageIdeogramV3CharacterRequestRenderingSpeed?), TypeInfoPropertyName = "NullableRemixImageIdeogramV3CharacterRequestRenderingSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemixImageIdeogramV3CharacterRequestStyleType?), TypeInfoPropertyName = "NullableRemixImageIdeogramV3CharacterRequestStyleType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AssetType?), TypeInfoPropertyName = "NullableAssetType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramColorPalettePresetName?), TypeInfoPropertyName = "NullableIdeogramColorPalettePresetName2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AspectRatioV3?), TypeInfoPropertyName = "NullableAspectRatioV32")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageRemixIdeogram4PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed?), TypeInfoPropertyName = "NullableV2ImageRemixIdeogram4PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageRemixIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed?), TypeInfoPropertyName = "NullableV2ImageRemixIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed?), TypeInfoPropertyName = "NullableV2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType?), TypeInfoPropertyName = "NullableV2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageRemixIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed?), TypeInfoPropertyName = "NullableV2ImageRemixIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] internal sealed partial class ImagesRemixSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext { } @@ -147,81 +143,67 @@ private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Ser public override bool CanConvert(global::System.Type typeToConvert) { return - typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed) + typeToConvert == typeof(global::Ideogram.GenerationRejectReason) - || typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?) + || typeToConvert == typeof(global::Ideogram.GenerationRejectReason?) - || typeToConvert == typeof(global::Ideogram.GenerationRejectReason) + || typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed) - || typeToConvert == typeof(global::Ideogram.GenerationRejectReason?) + || typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?) - || typeToConvert == typeof(global::Ideogram.RemixImageIdeogramV3RequestRenderingSpeed) + || typeToConvert == typeof(global::Ideogram.MagicPromptMode) - || typeToConvert == typeof(global::Ideogram.RemixImageIdeogramV3RequestRenderingSpeed?) + || typeToConvert == typeof(global::Ideogram.MagicPromptMode?) - || typeToConvert == typeof(global::Ideogram.RemixImageIdeogramV3CustomModelRequestRenderingSpeed) + || typeToConvert == typeof(global::Ideogram.ResolutionV4) - || typeToConvert == typeof(global::Ideogram.RemixImageIdeogramV3CustomModelRequestRenderingSpeed?) + || typeToConvert == typeof(global::Ideogram.ResolutionV4?) - || typeToConvert == typeof(global::Ideogram.RemixImageIdeogramV4RequestRenderingSpeed) + || typeToConvert == typeof(global::Ideogram.ResolutionV3) - || typeToConvert == typeof(global::Ideogram.RemixImageIdeogramV4RequestRenderingSpeed?) + || typeToConvert == typeof(global::Ideogram.ResolutionV3?) - || typeToConvert == typeof(global::Ideogram.RemixImageIdeogramV3CharacterRequestRenderingSpeed) + || typeToConvert == typeof(global::Ideogram.IdeogramColorPalettePresetName) - || typeToConvert == typeof(global::Ideogram.RemixImageIdeogramV3CharacterRequestRenderingSpeed?) + || typeToConvert == typeof(global::Ideogram.IdeogramColorPalettePresetName?) - || typeToConvert == typeof(global::Ideogram.RemixImageIdeogramV3CharacterRequestStyleType) + || typeToConvert == typeof(global::Ideogram.IdeogramV3StyleType) - || typeToConvert == typeof(global::Ideogram.RemixImageIdeogramV3CharacterRequestStyleType?) + || typeToConvert == typeof(global::Ideogram.IdeogramV3StyleType?) - || typeToConvert == typeof(global::Ideogram.ResolutionV4) + || typeToConvert == typeof(global::Ideogram.IdeogramV3StylePreset) - || typeToConvert == typeof(global::Ideogram.ResolutionV4?) + || typeToConvert == typeof(global::Ideogram.IdeogramV3StylePreset?) || typeToConvert == typeof(global::Ideogram.AspectRatioV3) || typeToConvert == typeof(global::Ideogram.AspectRatioV3?) - || typeToConvert == typeof(global::Ideogram.ResolutionV3) + || typeToConvert == typeof(global::Ideogram.V2ImageRemixIdeogram4PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed) - || typeToConvert == typeof(global::Ideogram.ResolutionV3?) + || typeToConvert == typeof(global::Ideogram.V2ImageRemixIdeogram4PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed?) - || typeToConvert == typeof(global::Ideogram.AssetType) + || typeToConvert == typeof(global::Ideogram.V2ImageRemixIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed) - || typeToConvert == typeof(global::Ideogram.AssetType?) - - || typeToConvert == typeof(global::Ideogram.MagicPromptMode) - - || typeToConvert == typeof(global::Ideogram.MagicPromptMode?) + || typeToConvert == typeof(global::Ideogram.V2ImageRemixIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed?) - || typeToConvert == typeof(global::Ideogram.IdeogramColorPalettePresetName) + || typeToConvert == typeof(global::Ideogram.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed) - || typeToConvert == typeof(global::Ideogram.IdeogramColorPalettePresetName?) + || typeToConvert == typeof(global::Ideogram.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed?) - || typeToConvert == typeof(global::Ideogram.IdeogramV3StyleType) + || typeToConvert == typeof(global::Ideogram.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType) - || typeToConvert == typeof(global::Ideogram.IdeogramV3StyleType?) + || typeToConvert == typeof(global::Ideogram.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType?) - || typeToConvert == typeof(global::Ideogram.IdeogramV3StylePreset) + || typeToConvert == typeof(global::Ideogram.V2ImageRemixIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed) - || typeToConvert == typeof(global::Ideogram.IdeogramV3StylePreset?); + || typeToConvert == typeof(global::Ideogram.V2ImageRemixIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed?); } public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) { - if (typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed)) - { - return new global::Ideogram.JsonConverters.GenerationErrorResponseTaskCompletionSpeedJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?)) - { - return new global::Ideogram.JsonConverters.GenerationErrorResponseTaskCompletionSpeedNullableJsonConverter(); - } - if (typeToConvert == typeof(global::Ideogram.GenerationRejectReason)) { return new global::Ideogram.JsonConverters.GenerationRejectReasonJsonConverter(); @@ -232,134 +214,134 @@ public override bool CanConvert(global::System.Type typeToConvert) return new global::Ideogram.JsonConverters.GenerationRejectReasonNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.RemixImageIdeogramV3RequestRenderingSpeed)) + if (typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed)) { - return new global::Ideogram.JsonConverters.RemixImageIdeogramV3RequestRenderingSpeedJsonConverter(); + return new global::Ideogram.JsonConverters.GenerationErrorResponseTaskCompletionSpeedJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.RemixImageIdeogramV3RequestRenderingSpeed?)) + if (typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?)) { - return new global::Ideogram.JsonConverters.RemixImageIdeogramV3RequestRenderingSpeedNullableJsonConverter(); + return new global::Ideogram.JsonConverters.GenerationErrorResponseTaskCompletionSpeedNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.RemixImageIdeogramV3CustomModelRequestRenderingSpeed)) + if (typeToConvert == typeof(global::Ideogram.MagicPromptMode)) { - return new global::Ideogram.JsonConverters.RemixImageIdeogramV3CustomModelRequestRenderingSpeedJsonConverter(); + return new global::Ideogram.JsonConverters.MagicPromptModeJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.RemixImageIdeogramV3CustomModelRequestRenderingSpeed?)) + if (typeToConvert == typeof(global::Ideogram.MagicPromptMode?)) { - return new global::Ideogram.JsonConverters.RemixImageIdeogramV3CustomModelRequestRenderingSpeedNullableJsonConverter(); + return new global::Ideogram.JsonConverters.MagicPromptModeNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.RemixImageIdeogramV4RequestRenderingSpeed)) + if (typeToConvert == typeof(global::Ideogram.ResolutionV4)) { - return new global::Ideogram.JsonConverters.RemixImageIdeogramV4RequestRenderingSpeedJsonConverter(); + return new global::Ideogram.JsonConverters.ResolutionV4JsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.RemixImageIdeogramV4RequestRenderingSpeed?)) + if (typeToConvert == typeof(global::Ideogram.ResolutionV4?)) { - return new global::Ideogram.JsonConverters.RemixImageIdeogramV4RequestRenderingSpeedNullableJsonConverter(); + return new global::Ideogram.JsonConverters.ResolutionV4NullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.RemixImageIdeogramV3CharacterRequestRenderingSpeed)) + if (typeToConvert == typeof(global::Ideogram.ResolutionV3)) { - return new global::Ideogram.JsonConverters.RemixImageIdeogramV3CharacterRequestRenderingSpeedJsonConverter(); + return new global::Ideogram.JsonConverters.ResolutionV3JsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.RemixImageIdeogramV3CharacterRequestRenderingSpeed?)) + if (typeToConvert == typeof(global::Ideogram.ResolutionV3?)) { - return new global::Ideogram.JsonConverters.RemixImageIdeogramV3CharacterRequestRenderingSpeedNullableJsonConverter(); + return new global::Ideogram.JsonConverters.ResolutionV3NullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.RemixImageIdeogramV3CharacterRequestStyleType)) + if (typeToConvert == typeof(global::Ideogram.IdeogramColorPalettePresetName)) { - return new global::Ideogram.JsonConverters.RemixImageIdeogramV3CharacterRequestStyleTypeJsonConverter(); + return new global::Ideogram.JsonConverters.IdeogramColorPalettePresetNameJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.RemixImageIdeogramV3CharacterRequestStyleType?)) + if (typeToConvert == typeof(global::Ideogram.IdeogramColorPalettePresetName?)) { - return new global::Ideogram.JsonConverters.RemixImageIdeogramV3CharacterRequestStyleTypeNullableJsonConverter(); + return new global::Ideogram.JsonConverters.IdeogramColorPalettePresetNameNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.ResolutionV4)) + if (typeToConvert == typeof(global::Ideogram.IdeogramV3StyleType)) { - return new global::Ideogram.JsonConverters.ResolutionV4JsonConverter(); + return new global::Ideogram.JsonConverters.IdeogramV3StyleTypeJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.ResolutionV4?)) + if (typeToConvert == typeof(global::Ideogram.IdeogramV3StyleType?)) { - return new global::Ideogram.JsonConverters.ResolutionV4NullableJsonConverter(); + return new global::Ideogram.JsonConverters.IdeogramV3StyleTypeNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.AspectRatioV3)) + if (typeToConvert == typeof(global::Ideogram.IdeogramV3StylePreset)) { - return new global::Ideogram.JsonConverters.AspectRatioV3JsonConverter(); + return new global::Ideogram.JsonConverters.IdeogramV3StylePresetJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.AspectRatioV3?)) + if (typeToConvert == typeof(global::Ideogram.IdeogramV3StylePreset?)) { - return new global::Ideogram.JsonConverters.AspectRatioV3NullableJsonConverter(); + return new global::Ideogram.JsonConverters.IdeogramV3StylePresetNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.ResolutionV3)) + if (typeToConvert == typeof(global::Ideogram.AspectRatioV3)) { - return new global::Ideogram.JsonConverters.ResolutionV3JsonConverter(); + return new global::Ideogram.JsonConverters.AspectRatioV3JsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.ResolutionV3?)) + if (typeToConvert == typeof(global::Ideogram.AspectRatioV3?)) { - return new global::Ideogram.JsonConverters.ResolutionV3NullableJsonConverter(); + return new global::Ideogram.JsonConverters.AspectRatioV3NullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.AssetType)) + if (typeToConvert == typeof(global::Ideogram.V2ImageRemixIdeogram4PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed)) { - return new global::Ideogram.JsonConverters.AssetTypeJsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageRemixIdeogram4PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.AssetType?)) + if (typeToConvert == typeof(global::Ideogram.V2ImageRemixIdeogram4PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed?)) { - return new global::Ideogram.JsonConverters.AssetTypeNullableJsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageRemixIdeogram4PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.MagicPromptMode)) + if (typeToConvert == typeof(global::Ideogram.V2ImageRemixIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed)) { - return new global::Ideogram.JsonConverters.MagicPromptModeJsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageRemixIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.MagicPromptMode?)) + if (typeToConvert == typeof(global::Ideogram.V2ImageRemixIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed?)) { - return new global::Ideogram.JsonConverters.MagicPromptModeNullableJsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageRemixIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.IdeogramColorPalettePresetName)) + if (typeToConvert == typeof(global::Ideogram.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed)) { - return new global::Ideogram.JsonConverters.IdeogramColorPalettePresetNameJsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.IdeogramColorPalettePresetName?)) + if (typeToConvert == typeof(global::Ideogram.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed?)) { - return new global::Ideogram.JsonConverters.IdeogramColorPalettePresetNameNullableJsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.IdeogramV3StyleType)) + if (typeToConvert == typeof(global::Ideogram.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType)) { - return new global::Ideogram.JsonConverters.IdeogramV3StyleTypeJsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleTypeJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.IdeogramV3StyleType?)) + if (typeToConvert == typeof(global::Ideogram.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType?)) { - return new global::Ideogram.JsonConverters.IdeogramV3StyleTypeNullableJsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleTypeNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.IdeogramV3StylePreset)) + if (typeToConvert == typeof(global::Ideogram.V2ImageRemixIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed)) { - return new global::Ideogram.JsonConverters.IdeogramV3StylePresetJsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageRemixIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.IdeogramV3StylePreset?)) + if (typeToConvert == typeof(global::Ideogram.V2ImageRemixIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed?)) { - return new global::Ideogram.JsonConverters.IdeogramV3StylePresetNullableJsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageRemixIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullableJsonConverter(); } throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); } diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesRemixClient.ImagesRemixPostRemixImageV2IdeogramV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesRemixClient.ImagesRemixPostRemixImageV2IdeogramV3.g.cs new file mode 100644 index 00000000..c1d587d9 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.ImagesRemixClient.ImagesRemixPostRemixImageV2IdeogramV3.g.cs @@ -0,0 +1,3065 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class ImagesRemixClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_ImagesRemixPostRemixImageV2IdeogramV3SecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_ImagesRemixPostRemixImageV2IdeogramV3SecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_ImagesRemixPostRemixImageV2IdeogramV3SecurityRequirement0, + }; + partial void PrepareImagesRemixPostRemixImageV2IdeogramV3Arguments( + global::System.Net.Http.HttpClient httpClient, + ref bool? dryRun, + global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3Request request); + partial void PrepareImagesRemixPostRemixImageV2IdeogramV3Request( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + bool? dryRun, + global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3Request request); + partial void ProcessImagesRemixPostRemixImageV2IdeogramV3Response( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessImagesRemixPostRemixImageV2IdeogramV3ResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Remix with Ideogram 3.0
+ /// Transform an existing image with Ideogram 3.0, guided by a text
+ /// prompt. Upload the source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesRemixPostRemixImageV2IdeogramV3Async( + + global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ImagesRemixPostRemixImageV2IdeogramV3AsResponseAsync( + + request: request, + dryRun: dryRun, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Remix with Ideogram 3.0
+ /// Transform an existing image with Ideogram 3.0, guided by a text
+ /// prompt. Upload the source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ImagesRemixPostRemixImageV2IdeogramV3AsResponseAsync( + + global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareImagesRemixPostRemixImageV2IdeogramV3Arguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImagesRemixPostRemixImageV2IdeogramV3SecurityRequirements, + operationName: "ImagesRemixPostRemixImageV2IdeogramV3Async"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/remix/ideogram-3", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.ImageWeight != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.ImageWeight, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"image_weight\""); + + } + if (request.NegativePrompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.NegativePrompt ?? string.Empty), + name: "\"negative_prompt\""); + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (request.Resolution != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"resolution\""); + + } + if (request.AspectRatio != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.AspectRatio).HasValue ? (request.AspectRatio).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"aspect_ratio\""); + + } + if (request.RenderingSpeed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"rendering_speed\""); + + } + if (request.MagicPrompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.MagicPrompt).HasValue ? (request.MagicPrompt).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"magic_prompt\""); + + } + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.ColorPalette != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.ColorPalette.ToString() ?? string.Empty), + name: "\"color_palette\""); + + } + if (request.StyleCodes != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.StyleCodes!, x => x))}]"), + name: "\"style_codes\""); + + } + if (request.StyleType != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.StyleType).HasValue ? (request.StyleType).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"style_type\""); + + } + if (request.StylePreset != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.StylePreset).HasValue ? (request.StylePreset).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"style_preset\""); + + } + if (request.StyleReferenceImages != default) + { + + for (var __iStyleReferenceImages = 0; __iStyleReferenceImages < request.StyleReferenceImages.Count; __iStyleReferenceImages++) + { + var __contentStyleReferenceImages = new global::System.Net.Http.ByteArrayContent(request.StyleReferenceImages[__iStyleReferenceImages]); + __contentStyleReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); + __httpRequestContent.Add( + content: __contentStyleReferenceImages, + name: "\"style_reference_images\"", + fileName: $"\"file{__iStyleReferenceImages}.bin\""); + if (__contentStyleReferenceImages.Headers.ContentDisposition != null) + { + __contentStyleReferenceImages.Headers.ContentDisposition.FileNameStar = null; + } + } + + } + if (request.EnableCopyrightDetection != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"enable_copyright_detection\""); + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImagesRemixPostRemixImageV2IdeogramV3Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesRemixPostRemixImageV2IdeogramV3", + methodName: "ImagesRemixPostRemixImageV2IdeogramV3Async", + pathTemplate: "\"/v2/image/remix/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesRemixPostRemixImageV2IdeogramV3", + methodName: "ImagesRemixPostRemixImageV2IdeogramV3Async", + pathTemplate: "\"/v2/image/remix/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesRemixPostRemixImageV2IdeogramV3", + methodName: "ImagesRemixPostRemixImageV2IdeogramV3Async", + pathTemplate: "\"/v2/image/remix/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImagesRemixPostRemixImageV2IdeogramV3Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesRemixPostRemixImageV2IdeogramV3", + methodName: "ImagesRemixPostRemixImageV2IdeogramV3Async", + pathTemplate: "\"/v2/image/remix/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesRemixPostRemixImageV2IdeogramV3", + methodName: "ImagesRemixPostRemixImageV2IdeogramV3Async", + pathTemplate: "\"/v2/image/remix/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // A referenced resource was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImagesRemixPostRemixImageV2IdeogramV3ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.RemixImageIdeogramV3Response.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.RemixImageIdeogramV3Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Remix with Ideogram 3.0
+ /// Transform an existing image with Ideogram 3.0, guided by a text
+ /// prompt. Upload the source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt that guides the remix. + /// + /// + /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. + /// + /// + /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. + /// + /// + /// Optional. How closely the result should follow the source image, from 1 to 100. When omitted the server chooses a value from your prompt, which is the usual case. + /// + /// + /// Description of what to exclude from the images. Descriptions in the prompt take precedence over descriptions in the negative prompt. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The resolutions supported for Ideogram 3.0. + /// + /// + /// Output aspect ratio. Cannot be combined with resolution. Generation defaults to 1x1; remix keeps the source ratio when both fields are omitted. + /// + /// + /// The rendering speed to use.
+ /// Default Value: default + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). + /// + /// + /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images. + /// + /// + /// The style type to generate with.
+ /// Default Value: general + /// + /// + /// A predefined style preset to apply to the remixed images. Cannot be combined with style codes or style references. + /// + /// + /// Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported. + /// + /// + /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesRemixPostRemixImageV2IdeogramV3Async( + string prompt, + byte[] image, + string imagename, + bool? dryRun = default, + int? imageWeight = default, + string? negativePrompt = default, + int? seed = default, + global::Ideogram.ResolutionV3? resolution = default, + global::Ideogram.AspectRatioV3? aspectRatio = default, + global::Ideogram.V2ImageRemixIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + int? numImages = default, + global::Ideogram.IdeogramColorPalette? colorPalette = default, + global::System.Collections.Generic.IList? styleCodes = default, + global::Ideogram.IdeogramV3StyleType? styleType = default, + global::Ideogram.IdeogramV3StylePreset? stylePreset = default, + global::System.Collections.Generic.IList? styleReferenceImages = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3Request + { + Prompt = prompt, + Image = image, + Imagename = imagename, + ImageWeight = imageWeight, + NegativePrompt = negativePrompt, + Seed = seed, + Resolution = resolution, + AspectRatio = aspectRatio, + RenderingSpeed = renderingSpeed, + MagicPrompt = magicPrompt, + NumImages = numImages, + ColorPalette = colorPalette, + StyleCodes = styleCodes, + StyleType = styleType, + StylePreset = stylePreset, + StyleReferenceImages = styleReferenceImages, + EnableCopyrightDetection = enableCopyrightDetection, + Async = async, + WebhookUrl = webhookUrl, + }; + + return await ImagesRemixPostRemixImageV2IdeogramV3Async( + dryRun: dryRun, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// Remix with Ideogram 3.0
+ /// Transform an existing image with Ideogram 3.0, guided by a text
+ /// prompt. Upload the source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt that guides the remix. + /// + /// + /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. + /// + /// + /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. + /// + /// + /// Optional. How closely the result should follow the source image, from 1 to 100. When omitted the server chooses a value from your prompt, which is the usual case. + /// + /// + /// Description of what to exclude from the images. Descriptions in the prompt take precedence over descriptions in the negative prompt. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The resolutions supported for Ideogram 3.0. + /// + /// + /// Output aspect ratio. Cannot be combined with resolution. Generation defaults to 1x1; remix keeps the source ratio when both fields are omitted. + /// + /// + /// The rendering speed to use.
+ /// Default Value: default + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). + /// + /// + /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images. + /// + /// + /// The style type to generate with.
+ /// Default Value: general + /// + /// + /// A predefined style preset to apply to the remixed images. Cannot be combined with style codes or style references. + /// + /// + /// Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported. + /// + /// + /// Optional file names to use for the multipart 'style_reference_images' file parts. + /// + /// + /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesRemixPostRemixImageV2IdeogramV3Async( + string prompt, + global::System.IO.Stream image, + string imagename, + bool? dryRun = default, + int? imageWeight = default, + string? negativePrompt = default, + int? seed = default, + global::Ideogram.ResolutionV3? resolution = default, + global::Ideogram.AspectRatioV3? aspectRatio = default, + global::Ideogram.V2ImageRemixIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + int? numImages = default, + global::Ideogram.IdeogramColorPalette? colorPalette = default, + global::System.Collections.Generic.IList? styleCodes = default, + global::Ideogram.IdeogramV3StyleType? styleType = default, + global::Ideogram.IdeogramV3StylePreset? stylePreset = default, + global::System.Collections.Generic.IReadOnlyList? styleReferenceImages = default, + global::System.Collections.Generic.IReadOnlyList? styleReferenceImagesFileNames = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + var request = new global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3Request + { + Prompt = prompt, + Image = global::System.Array.Empty(), + Imagename = imagename, + ImageWeight = imageWeight, + NegativePrompt = negativePrompt, + Seed = seed, + Resolution = resolution, + AspectRatio = aspectRatio, + RenderingSpeed = renderingSpeed, + MagicPrompt = magicPrompt, + NumImages = numImages, + ColorPalette = colorPalette, + StyleCodes = styleCodes, + StyleType = styleType, + StylePreset = stylePreset, + StyleReferenceImages = new global::System.Collections.Generic.List(), + EnableCopyrightDetection = enableCopyrightDetection, + Async = async, + WebhookUrl = webhookUrl, + }; + PrepareArguments( + client: HttpClient); + PrepareImagesRemixPostRemixImageV2IdeogramV3Arguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImagesRemixPostRemixImageV2IdeogramV3SecurityRequirements, + operationName: "ImagesRemixPostRemixImageV2IdeogramV3Async"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/remix/ideogram-3", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.ImageWeight != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.ImageWeight, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"image_weight\""); + + } + if (request.NegativePrompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.NegativePrompt ?? string.Empty), + name: "\"negative_prompt\""); + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (request.Resolution != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"resolution\""); + + } + if (request.AspectRatio != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.AspectRatio).HasValue ? (request.AspectRatio).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"aspect_ratio\""); + + } + if (request.RenderingSpeed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"rendering_speed\""); + + } + if (request.MagicPrompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.MagicPrompt).HasValue ? (request.MagicPrompt).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"magic_prompt\""); + + } + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.ColorPalette != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.ColorPalette.ToString() ?? string.Empty), + name: "\"color_palette\""); + + } + if (request.StyleCodes != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.StyleCodes!, x => x))}]"), + name: "\"style_codes\""); + + } + if (request.StyleType != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.StyleType).HasValue ? (request.StyleType).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"style_type\""); + + } + if (request.StylePreset != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.StylePreset).HasValue ? (request.StylePreset).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"style_preset\""); + + } + if (styleReferenceImages != default) + { + + for (var __iStyleReferenceImages = 0; __iStyleReferenceImages < styleReferenceImages.Count; __iStyleReferenceImages++) + { + var __fileNameStyleReferenceImages = styleReferenceImagesFileNames != null && + __iStyleReferenceImages < styleReferenceImagesFileNames.Count && + styleReferenceImagesFileNames[__iStyleReferenceImages] != null + ? styleReferenceImagesFileNames[__iStyleReferenceImages] + : $"file{__iStyleReferenceImages}.bin"; + var __contentStyleReferenceImages = new global::System.Net.Http.StreamContent(styleReferenceImages[__iStyleReferenceImages]); + __contentStyleReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + __fileNameStyleReferenceImages is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(__fileNameStyleReferenceImages) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentStyleReferenceImages, + name: "\"style_reference_images\"", + fileName: $"\"{__fileNameStyleReferenceImages}\""); + if (__contentStyleReferenceImages.Headers.ContentDisposition != null) + { + __contentStyleReferenceImages.Headers.ContentDisposition.FileNameStar = null; + } + } + + } + if (request.EnableCopyrightDetection != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"enable_copyright_detection\""); + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImagesRemixPostRemixImageV2IdeogramV3Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesRemixPostRemixImageV2IdeogramV3", + methodName: "ImagesRemixPostRemixImageV2IdeogramV3Async", + pathTemplate: "\"/v2/image/remix/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesRemixPostRemixImageV2IdeogramV3", + methodName: "ImagesRemixPostRemixImageV2IdeogramV3Async", + pathTemplate: "\"/v2/image/remix/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesRemixPostRemixImageV2IdeogramV3", + methodName: "ImagesRemixPostRemixImageV2IdeogramV3Async", + pathTemplate: "\"/v2/image/remix/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImagesRemixPostRemixImageV2IdeogramV3Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesRemixPostRemixImageV2IdeogramV3", + methodName: "ImagesRemixPostRemixImageV2IdeogramV3Async", + pathTemplate: "\"/v2/image/remix/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesRemixPostRemixImageV2IdeogramV3", + methodName: "ImagesRemixPostRemixImageV2IdeogramV3Async", + pathTemplate: "\"/v2/image/remix/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // A referenced resource was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImagesRemixPostRemixImageV2IdeogramV3ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::Ideogram.RemixImageIdeogramV3Response.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::Ideogram.RemixImageIdeogramV3Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Remix with Ideogram 3.0
+ /// Transform an existing image with Ideogram 3.0, guided by a text
+ /// prompt. Upload the source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt that guides the remix. + /// + /// + /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. + /// + /// + /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. + /// + /// + /// Optional. How closely the result should follow the source image, from 1 to 100. When omitted the server chooses a value from your prompt, which is the usual case. + /// + /// + /// Description of what to exclude from the images. Descriptions in the prompt take precedence over descriptions in the negative prompt. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The resolutions supported for Ideogram 3.0. + /// + /// + /// Output aspect ratio. Cannot be combined with resolution. Generation defaults to 1x1; remix keeps the source ratio when both fields are omitted. + /// + /// + /// The rendering speed to use.
+ /// Default Value: default + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). + /// + /// + /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images. + /// + /// + /// The style type to generate with.
+ /// Default Value: general + /// + /// + /// A predefined style preset to apply to the remixed images. Cannot be combined with style codes or style references. + /// + /// + /// Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported. + /// + /// + /// Optional file names to use for the multipart 'style_reference_images' file parts. + /// + /// + /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ImagesRemixPostRemixImageV2IdeogramV3AsResponseAsync( + string prompt, + global::System.IO.Stream image, + string imagename, + bool? dryRun = default, + int? imageWeight = default, + string? negativePrompt = default, + int? seed = default, + global::Ideogram.ResolutionV3? resolution = default, + global::Ideogram.AspectRatioV3? aspectRatio = default, + global::Ideogram.V2ImageRemixIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + int? numImages = default, + global::Ideogram.IdeogramColorPalette? colorPalette = default, + global::System.Collections.Generic.IList? styleCodes = default, + global::Ideogram.IdeogramV3StyleType? styleType = default, + global::Ideogram.IdeogramV3StylePreset? stylePreset = default, + global::System.Collections.Generic.IReadOnlyList? styleReferenceImages = default, + global::System.Collections.Generic.IReadOnlyList? styleReferenceImagesFileNames = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + var request = new global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3Request + { + Prompt = prompt, + Image = global::System.Array.Empty(), + Imagename = imagename, + ImageWeight = imageWeight, + NegativePrompt = negativePrompt, + Seed = seed, + Resolution = resolution, + AspectRatio = aspectRatio, + RenderingSpeed = renderingSpeed, + MagicPrompt = magicPrompt, + NumImages = numImages, + ColorPalette = colorPalette, + StyleCodes = styleCodes, + StyleType = styleType, + StylePreset = stylePreset, + StyleReferenceImages = new global::System.Collections.Generic.List(), + EnableCopyrightDetection = enableCopyrightDetection, + Async = async, + WebhookUrl = webhookUrl, + }; + PrepareArguments( + client: HttpClient); + PrepareImagesRemixPostRemixImageV2IdeogramV3Arguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImagesRemixPostRemixImageV2IdeogramV3SecurityRequirements, + operationName: "ImagesRemixPostRemixImageV2IdeogramV3Async"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/remix/ideogram-3", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.ImageWeight != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.ImageWeight, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"image_weight\""); + + } + if (request.NegativePrompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.NegativePrompt ?? string.Empty), + name: "\"negative_prompt\""); + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (request.Resolution != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"resolution\""); + + } + if (request.AspectRatio != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.AspectRatio).HasValue ? (request.AspectRatio).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"aspect_ratio\""); + + } + if (request.RenderingSpeed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"rendering_speed\""); + + } + if (request.MagicPrompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.MagicPrompt).HasValue ? (request.MagicPrompt).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"magic_prompt\""); + + } + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.ColorPalette != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.ColorPalette.ToString() ?? string.Empty), + name: "\"color_palette\""); + + } + if (request.StyleCodes != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.StyleCodes!, x => x))}]"), + name: "\"style_codes\""); + + } + if (request.StyleType != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.StyleType).HasValue ? (request.StyleType).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"style_type\""); + + } + if (request.StylePreset != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.StylePreset).HasValue ? (request.StylePreset).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"style_preset\""); + + } + if (styleReferenceImages != default) + { + + for (var __iStyleReferenceImages = 0; __iStyleReferenceImages < styleReferenceImages.Count; __iStyleReferenceImages++) + { + var __fileNameStyleReferenceImages = styleReferenceImagesFileNames != null && + __iStyleReferenceImages < styleReferenceImagesFileNames.Count && + styleReferenceImagesFileNames[__iStyleReferenceImages] != null + ? styleReferenceImagesFileNames[__iStyleReferenceImages] + : $"file{__iStyleReferenceImages}.bin"; + var __contentStyleReferenceImages = new global::System.Net.Http.StreamContent(styleReferenceImages[__iStyleReferenceImages]); + __contentStyleReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + __fileNameStyleReferenceImages is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(__fileNameStyleReferenceImages) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentStyleReferenceImages, + name: "\"style_reference_images\"", + fileName: $"\"{__fileNameStyleReferenceImages}\""); + if (__contentStyleReferenceImages.Headers.ContentDisposition != null) + { + __contentStyleReferenceImages.Headers.ContentDisposition.FileNameStar = null; + } + } + + } + if (request.EnableCopyrightDetection != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"enable_copyright_detection\""); + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImagesRemixPostRemixImageV2IdeogramV3Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesRemixPostRemixImageV2IdeogramV3", + methodName: "ImagesRemixPostRemixImageV2IdeogramV3Async", + pathTemplate: "\"/v2/image/remix/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesRemixPostRemixImageV2IdeogramV3", + methodName: "ImagesRemixPostRemixImageV2IdeogramV3Async", + pathTemplate: "\"/v2/image/remix/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesRemixPostRemixImageV2IdeogramV3", + methodName: "ImagesRemixPostRemixImageV2IdeogramV3Async", + pathTemplate: "\"/v2/image/remix/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImagesRemixPostRemixImageV2IdeogramV3Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesRemixPostRemixImageV2IdeogramV3", + methodName: "ImagesRemixPostRemixImageV2IdeogramV3Async", + pathTemplate: "\"/v2/image/remix/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesRemixPostRemixImageV2IdeogramV3", + methodName: "ImagesRemixPostRemixImageV2IdeogramV3Async", + pathTemplate: "\"/v2/image/remix/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // A referenced resource was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImagesRemixPostRemixImageV2IdeogramV3ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.RemixImageIdeogramV3Response.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.RemixImageIdeogramV3Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesRemixClient.ImagesRemixPostRemixImageV2IdeogramV3Character.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesRemixClient.ImagesRemixPostRemixImageV2IdeogramV3Character.g.cs new file mode 100644 index 00000000..208f8c46 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.ImagesRemixClient.ImagesRemixPostRemixImageV2IdeogramV3Character.g.cs @@ -0,0 +1,3245 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class ImagesRemixClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_ImagesRemixPostRemixImageV2IdeogramV3CharacterSecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_ImagesRemixPostRemixImageV2IdeogramV3CharacterSecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_ImagesRemixPostRemixImageV2IdeogramV3CharacterSecurityRequirement0, + }; + partial void PrepareImagesRemixPostRemixImageV2IdeogramV3CharacterArguments( + global::System.Net.Http.HttpClient httpClient, + ref bool? dryRun, + global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CharacterRequest request); + partial void PrepareImagesRemixPostRemixImageV2IdeogramV3CharacterRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + bool? dryRun, + global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CharacterRequest request); + partial void ProcessImagesRemixPostRemixImageV2IdeogramV3CharacterResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessImagesRemixPostRemixImageV2IdeogramV3CharacterResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Remix a consistent character with Ideogram 3.0
+ /// Transform an existing image with Ideogram 3.0 so it features a
+ /// consistent character, guided by a text prompt. Upload the source
+ /// `image` and a `character_reference_images` image (or use a saved
+ /// character) using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesRemixPostRemixImageV2IdeogramV3CharacterAsync( + + global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CharacterRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ImagesRemixPostRemixImageV2IdeogramV3CharacterAsResponseAsync( + + request: request, + dryRun: dryRun, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Remix a consistent character with Ideogram 3.0
+ /// Transform an existing image with Ideogram 3.0 so it features a
+ /// consistent character, guided by a text prompt. Upload the source
+ /// `image` and a `character_reference_images` image (or use a saved
+ /// character) using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ImagesRemixPostRemixImageV2IdeogramV3CharacterAsResponseAsync( + + global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CharacterRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareImagesRemixPostRemixImageV2IdeogramV3CharacterArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImagesRemixPostRemixImageV2IdeogramV3CharacterSecurityRequirements, + operationName: "ImagesRemixPostRemixImageV2IdeogramV3CharacterAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/remix/ideogram-3-character", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.ImageWeight != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.ImageWeight, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"image_weight\""); + + } + if (request.NegativePrompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.NegativePrompt ?? string.Empty), + name: "\"negative_prompt\""); + + } + for (var __iCharacterReferenceImages = 0; __iCharacterReferenceImages < request.CharacterReferenceImages.Count; __iCharacterReferenceImages++) + { + var __contentCharacterReferenceImages = new global::System.Net.Http.ByteArrayContent(request.CharacterReferenceImages[__iCharacterReferenceImages]); + __contentCharacterReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); + __httpRequestContent.Add( + content: __contentCharacterReferenceImages, + name: "\"character_reference_images\"", + fileName: $"\"file{__iCharacterReferenceImages}.bin\""); + if (__contentCharacterReferenceImages.Headers.ContentDisposition != null) + { + __contentCharacterReferenceImages.Headers.ContentDisposition.FileNameStar = null; + } + } + + if (request.CharacterReferenceMask != default) + { + + var __contentCharacterReferenceMask = new global::System.Net.Http.ByteArrayContent(request.CharacterReferenceMask ?? global::System.Array.Empty()); + __contentCharacterReferenceMask.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.CharacterReferenceMaskname is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.CharacterReferenceMaskname) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentCharacterReferenceMask, + name: "\"character_reference_mask\"", + fileName: request.CharacterReferenceMaskname != null ? $"\"{request.CharacterReferenceMaskname}\"" : string.Empty); + if (__contentCharacterReferenceMask.Headers.ContentDisposition != null) + { + __contentCharacterReferenceMask.Headers.ContentDisposition.FileNameStar = null; + } + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (request.Resolution != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"resolution\""); + + } + if (request.AspectRatio != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.AspectRatio).HasValue ? (request.AspectRatio).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"aspect_ratio\""); + + } + if (request.RenderingSpeed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"rendering_speed\""); + + } + if (request.MagicPrompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.MagicPrompt).HasValue ? (request.MagicPrompt).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"magic_prompt\""); + + } + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.StyleType != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.StyleType).HasValue ? (request.StyleType).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"style_type\""); + + } + if (request.StyleReferenceImages != default) + { + + for (var __iStyleReferenceImages = 0; __iStyleReferenceImages < request.StyleReferenceImages.Count; __iStyleReferenceImages++) + { + var __contentStyleReferenceImages = new global::System.Net.Http.ByteArrayContent(request.StyleReferenceImages[__iStyleReferenceImages]); + __contentStyleReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); + __httpRequestContent.Add( + content: __contentStyleReferenceImages, + name: "\"style_reference_images\"", + fileName: $"\"file{__iStyleReferenceImages}.bin\""); + if (__contentStyleReferenceImages.Headers.ContentDisposition != null) + { + __contentStyleReferenceImages.Headers.ContentDisposition.FileNameStar = null; + } + } + + } + if (request.EnableCopyrightDetection != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"enable_copyright_detection\""); + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImagesRemixPostRemixImageV2IdeogramV3CharacterRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesRemixPostRemixImageV2IdeogramV3Character", + methodName: "ImagesRemixPostRemixImageV2IdeogramV3CharacterAsync", + pathTemplate: "\"/v2/image/remix/ideogram-3-character\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesRemixPostRemixImageV2IdeogramV3Character", + methodName: "ImagesRemixPostRemixImageV2IdeogramV3CharacterAsync", + pathTemplate: "\"/v2/image/remix/ideogram-3-character\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesRemixPostRemixImageV2IdeogramV3Character", + methodName: "ImagesRemixPostRemixImageV2IdeogramV3CharacterAsync", + pathTemplate: "\"/v2/image/remix/ideogram-3-character\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImagesRemixPostRemixImageV2IdeogramV3CharacterResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesRemixPostRemixImageV2IdeogramV3Character", + methodName: "ImagesRemixPostRemixImageV2IdeogramV3CharacterAsync", + pathTemplate: "\"/v2/image/remix/ideogram-3-character\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesRemixPostRemixImageV2IdeogramV3Character", + methodName: "ImagesRemixPostRemixImageV2IdeogramV3CharacterAsync", + pathTemplate: "\"/v2/image/remix/ideogram-3-character\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // A referenced resource was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImagesRemixPostRemixImageV2IdeogramV3CharacterResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.RemixImageIdeogramV3CharacterResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.RemixImageIdeogramV3CharacterResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Remix a consistent character with Ideogram 3.0
+ /// Transform an existing image with Ideogram 3.0 so it features a
+ /// consistent character, guided by a text prompt. Upload the source
+ /// `image` and a `character_reference_images` image (or use a saved
+ /// character) using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt that guides the remix. + /// + /// + /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. + /// + /// + /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. + /// + /// + /// Optional. How closely the result should follow the source image, from 1 to 100. When omitted the server chooses a value from your prompt, which is the usual case. + /// + /// + /// Description of what to exclude from the images. Descriptions in the prompt take precedence over descriptions in the negative prompt. + /// + /// + /// An image to use as the character reference (max 25MB). JPEG, PNG, and WEBP are supported. + /// + /// + /// Optional grayscale mask for the character reference image, the same size as that image, marking where the character is. Only JPEG, PNG, and WEBP formats are supported. Multipart requests only; cannot be combined with `character_reference_collection_id`. + /// + /// + /// Optional grayscale mask for the character reference image, the same size as that image, marking where the character is. Only JPEG, PNG, and WEBP formats are supported. Multipart requests only; cannot be combined with `character_reference_collection_id`. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The resolutions supported for Ideogram 3.0. + /// + /// + /// Output aspect ratio. Cannot be combined with resolution. Generation defaults to 1x1; remix keeps the source ratio when both fields are omitted. + /// + /// + /// The rendering speed to use.
+ /// Default Value: default + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// The style type to remix the character with. Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported. + /// + /// + /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesRemixPostRemixImageV2IdeogramV3CharacterAsync( + string prompt, + byte[] image, + string imagename, + global::System.Collections.Generic.IList characterReferenceImages, + bool? dryRun = default, + int? imageWeight = default, + string? negativePrompt = default, + byte[]? characterReferenceMask = default, + string? characterReferenceMaskname = default, + int? seed = default, + global::Ideogram.ResolutionV3? resolution = default, + global::Ideogram.AspectRatioV3? aspectRatio = default, + global::Ideogram.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + int? numImages = default, + global::Ideogram.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType? styleType = default, + global::System.Collections.Generic.IList? styleReferenceImages = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CharacterRequest + { + Prompt = prompt, + Image = image, + Imagename = imagename, + ImageWeight = imageWeight, + NegativePrompt = negativePrompt, + CharacterReferenceImages = characterReferenceImages, + CharacterReferenceMask = characterReferenceMask, + CharacterReferenceMaskname = characterReferenceMaskname, + Seed = seed, + Resolution = resolution, + AspectRatio = aspectRatio, + RenderingSpeed = renderingSpeed, + MagicPrompt = magicPrompt, + NumImages = numImages, + StyleType = styleType, + StyleReferenceImages = styleReferenceImages, + EnableCopyrightDetection = enableCopyrightDetection, + Async = async, + WebhookUrl = webhookUrl, + }; + + return await ImagesRemixPostRemixImageV2IdeogramV3CharacterAsync( + dryRun: dryRun, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// Remix a consistent character with Ideogram 3.0
+ /// Transform an existing image with Ideogram 3.0 so it features a
+ /// consistent character, guided by a text prompt. Upload the source
+ /// `image` and a `character_reference_images` image (or use a saved
+ /// character) using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt that guides the remix. + /// + /// + /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. + /// + /// + /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. + /// + /// + /// Optional. How closely the result should follow the source image, from 1 to 100. When omitted the server chooses a value from your prompt, which is the usual case. + /// + /// + /// Description of what to exclude from the images. Descriptions in the prompt take precedence over descriptions in the negative prompt. + /// + /// + /// An image to use as the character reference (max 25MB). JPEG, PNG, and WEBP are supported. + /// + /// + /// Optional file names to use for the multipart 'character_reference_images' file parts. + /// + /// + /// Optional grayscale mask for the character reference image, the same size as that image, marking where the character is. Only JPEG, PNG, and WEBP formats are supported. Multipart requests only; cannot be combined with `character_reference_collection_id`. + /// + /// + /// Optional grayscale mask for the character reference image, the same size as that image, marking where the character is. Only JPEG, PNG, and WEBP formats are supported. Multipart requests only; cannot be combined with `character_reference_collection_id`. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The resolutions supported for Ideogram 3.0. + /// + /// + /// Output aspect ratio. Cannot be combined with resolution. Generation defaults to 1x1; remix keeps the source ratio when both fields are omitted. + /// + /// + /// The rendering speed to use.
+ /// Default Value: default + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// The style type to remix the character with. Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported. + /// + /// + /// Optional file names to use for the multipart 'style_reference_images' file parts. + /// + /// + /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesRemixPostRemixImageV2IdeogramV3CharacterAsync( + string prompt, + global::System.IO.Stream image, + string imagename, + global::System.Collections.Generic.IReadOnlyList characterReferenceImages, + bool? dryRun = default, + int? imageWeight = default, + string? negativePrompt = default, + global::System.Collections.Generic.IReadOnlyList? characterReferenceImagesFileNames = default, + global::System.IO.Stream? characterReferenceMask = default, + string? characterReferenceMaskname = default, + int? seed = default, + global::Ideogram.ResolutionV3? resolution = default, + global::Ideogram.AspectRatioV3? aspectRatio = default, + global::Ideogram.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + int? numImages = default, + global::Ideogram.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType? styleType = default, + global::System.Collections.Generic.IReadOnlyList? styleReferenceImages = default, + global::System.Collections.Generic.IReadOnlyList? styleReferenceImagesFileNames = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + characterReferenceImages = characterReferenceImages ?? throw new global::System.ArgumentNullException(nameof(characterReferenceImages)); + var request = new global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CharacterRequest + { + Prompt = prompt, + Image = global::System.Array.Empty(), + Imagename = imagename, + ImageWeight = imageWeight, + NegativePrompt = negativePrompt, + CharacterReferenceImages = new global::System.Collections.Generic.List(), + CharacterReferenceMask = global::System.Array.Empty(), + CharacterReferenceMaskname = characterReferenceMaskname, + Seed = seed, + Resolution = resolution, + AspectRatio = aspectRatio, + RenderingSpeed = renderingSpeed, + MagicPrompt = magicPrompt, + NumImages = numImages, + StyleType = styleType, + StyleReferenceImages = new global::System.Collections.Generic.List(), + EnableCopyrightDetection = enableCopyrightDetection, + Async = async, + WebhookUrl = webhookUrl, + }; + PrepareArguments( + client: HttpClient); + PrepareImagesRemixPostRemixImageV2IdeogramV3CharacterArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImagesRemixPostRemixImageV2IdeogramV3CharacterSecurityRequirements, + operationName: "ImagesRemixPostRemixImageV2IdeogramV3CharacterAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/remix/ideogram-3-character", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.ImageWeight != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.ImageWeight, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"image_weight\""); + + } + if (request.NegativePrompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.NegativePrompt ?? string.Empty), + name: "\"negative_prompt\""); + + } + for (var __iCharacterReferenceImages = 0; __iCharacterReferenceImages < characterReferenceImages.Count; __iCharacterReferenceImages++) + { + var __fileNameCharacterReferenceImages = characterReferenceImagesFileNames != null && + __iCharacterReferenceImages < characterReferenceImagesFileNames.Count && + characterReferenceImagesFileNames[__iCharacterReferenceImages] != null + ? characterReferenceImagesFileNames[__iCharacterReferenceImages] + : $"file{__iCharacterReferenceImages}.bin"; + var __contentCharacterReferenceImages = new global::System.Net.Http.StreamContent(characterReferenceImages[__iCharacterReferenceImages]); + __contentCharacterReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + __fileNameCharacterReferenceImages is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(__fileNameCharacterReferenceImages) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentCharacterReferenceImages, + name: "\"character_reference_images\"", + fileName: $"\"{__fileNameCharacterReferenceImages}\""); + if (__contentCharacterReferenceImages.Headers.ContentDisposition != null) + { + __contentCharacterReferenceImages.Headers.ContentDisposition.FileNameStar = null; + } + } + + if (characterReferenceMask != default) + { + + var __contentCharacterReferenceMask = new global::System.Net.Http.StreamContent(characterReferenceMask); + __contentCharacterReferenceMask.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.CharacterReferenceMaskname is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.CharacterReferenceMaskname) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentCharacterReferenceMask, + name: "\"character_reference_mask\"", + fileName: request.CharacterReferenceMaskname != null ? $"\"{request.CharacterReferenceMaskname}\"" : string.Empty); + if (__contentCharacterReferenceMask.Headers.ContentDisposition != null) + { + __contentCharacterReferenceMask.Headers.ContentDisposition.FileNameStar = null; + } + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (request.Resolution != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"resolution\""); + + } + if (request.AspectRatio != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.AspectRatio).HasValue ? (request.AspectRatio).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"aspect_ratio\""); + + } + if (request.RenderingSpeed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"rendering_speed\""); + + } + if (request.MagicPrompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.MagicPrompt).HasValue ? (request.MagicPrompt).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"magic_prompt\""); + + } + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.StyleType != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.StyleType).HasValue ? (request.StyleType).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"style_type\""); + + } + if (styleReferenceImages != default) + { + + for (var __iStyleReferenceImages = 0; __iStyleReferenceImages < styleReferenceImages.Count; __iStyleReferenceImages++) + { + var __fileNameStyleReferenceImages = styleReferenceImagesFileNames != null && + __iStyleReferenceImages < styleReferenceImagesFileNames.Count && + styleReferenceImagesFileNames[__iStyleReferenceImages] != null + ? styleReferenceImagesFileNames[__iStyleReferenceImages] + : $"file{__iStyleReferenceImages}.bin"; + var __contentStyleReferenceImages = new global::System.Net.Http.StreamContent(styleReferenceImages[__iStyleReferenceImages]); + __contentStyleReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + __fileNameStyleReferenceImages is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(__fileNameStyleReferenceImages) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentStyleReferenceImages, + name: "\"style_reference_images\"", + fileName: $"\"{__fileNameStyleReferenceImages}\""); + if (__contentStyleReferenceImages.Headers.ContentDisposition != null) + { + __contentStyleReferenceImages.Headers.ContentDisposition.FileNameStar = null; + } + } + + } + if (request.EnableCopyrightDetection != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"enable_copyright_detection\""); + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImagesRemixPostRemixImageV2IdeogramV3CharacterRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesRemixPostRemixImageV2IdeogramV3Character", + methodName: "ImagesRemixPostRemixImageV2IdeogramV3CharacterAsync", + pathTemplate: "\"/v2/image/remix/ideogram-3-character\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesRemixPostRemixImageV2IdeogramV3Character", + methodName: "ImagesRemixPostRemixImageV2IdeogramV3CharacterAsync", + pathTemplate: "\"/v2/image/remix/ideogram-3-character\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesRemixPostRemixImageV2IdeogramV3Character", + methodName: "ImagesRemixPostRemixImageV2IdeogramV3CharacterAsync", + pathTemplate: "\"/v2/image/remix/ideogram-3-character\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImagesRemixPostRemixImageV2IdeogramV3CharacterResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesRemixPostRemixImageV2IdeogramV3Character", + methodName: "ImagesRemixPostRemixImageV2IdeogramV3CharacterAsync", + pathTemplate: "\"/v2/image/remix/ideogram-3-character\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesRemixPostRemixImageV2IdeogramV3Character", + methodName: "ImagesRemixPostRemixImageV2IdeogramV3CharacterAsync", + pathTemplate: "\"/v2/image/remix/ideogram-3-character\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // A referenced resource was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImagesRemixPostRemixImageV2IdeogramV3CharacterResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::Ideogram.RemixImageIdeogramV3CharacterResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::Ideogram.RemixImageIdeogramV3CharacterResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Remix a consistent character with Ideogram 3.0
+ /// Transform an existing image with Ideogram 3.0 so it features a
+ /// consistent character, guided by a text prompt. Upload the source
+ /// `image` and a `character_reference_images` image (or use a saved
+ /// character) using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt that guides the remix. + /// + /// + /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. + /// + /// + /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. + /// + /// + /// Optional. How closely the result should follow the source image, from 1 to 100. When omitted the server chooses a value from your prompt, which is the usual case. + /// + /// + /// Description of what to exclude from the images. Descriptions in the prompt take precedence over descriptions in the negative prompt. + /// + /// + /// An image to use as the character reference (max 25MB). JPEG, PNG, and WEBP are supported. + /// + /// + /// Optional file names to use for the multipart 'character_reference_images' file parts. + /// + /// + /// Optional grayscale mask for the character reference image, the same size as that image, marking where the character is. Only JPEG, PNG, and WEBP formats are supported. Multipart requests only; cannot be combined with `character_reference_collection_id`. + /// + /// + /// Optional grayscale mask for the character reference image, the same size as that image, marking where the character is. Only JPEG, PNG, and WEBP formats are supported. Multipart requests only; cannot be combined with `character_reference_collection_id`. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The resolutions supported for Ideogram 3.0. + /// + /// + /// Output aspect ratio. Cannot be combined with resolution. Generation defaults to 1x1; remix keeps the source ratio when both fields are omitted. + /// + /// + /// The rendering speed to use.
+ /// Default Value: default + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// The style type to remix the character with. Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported. + /// + /// + /// Optional file names to use for the multipart 'style_reference_images' file parts. + /// + /// + /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ImagesRemixPostRemixImageV2IdeogramV3CharacterAsResponseAsync( + string prompt, + global::System.IO.Stream image, + string imagename, + global::System.Collections.Generic.IReadOnlyList characterReferenceImages, + bool? dryRun = default, + int? imageWeight = default, + string? negativePrompt = default, + global::System.Collections.Generic.IReadOnlyList? characterReferenceImagesFileNames = default, + global::System.IO.Stream? characterReferenceMask = default, + string? characterReferenceMaskname = default, + int? seed = default, + global::Ideogram.ResolutionV3? resolution = default, + global::Ideogram.AspectRatioV3? aspectRatio = default, + global::Ideogram.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + int? numImages = default, + global::Ideogram.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType? styleType = default, + global::System.Collections.Generic.IReadOnlyList? styleReferenceImages = default, + global::System.Collections.Generic.IReadOnlyList? styleReferenceImagesFileNames = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + characterReferenceImages = characterReferenceImages ?? throw new global::System.ArgumentNullException(nameof(characterReferenceImages)); + var request = new global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CharacterRequest + { + Prompt = prompt, + Image = global::System.Array.Empty(), + Imagename = imagename, + ImageWeight = imageWeight, + NegativePrompt = negativePrompt, + CharacterReferenceImages = new global::System.Collections.Generic.List(), + CharacterReferenceMask = global::System.Array.Empty(), + CharacterReferenceMaskname = characterReferenceMaskname, + Seed = seed, + Resolution = resolution, + AspectRatio = aspectRatio, + RenderingSpeed = renderingSpeed, + MagicPrompt = magicPrompt, + NumImages = numImages, + StyleType = styleType, + StyleReferenceImages = new global::System.Collections.Generic.List(), + EnableCopyrightDetection = enableCopyrightDetection, + Async = async, + WebhookUrl = webhookUrl, + }; + PrepareArguments( + client: HttpClient); + PrepareImagesRemixPostRemixImageV2IdeogramV3CharacterArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImagesRemixPostRemixImageV2IdeogramV3CharacterSecurityRequirements, + operationName: "ImagesRemixPostRemixImageV2IdeogramV3CharacterAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/remix/ideogram-3-character", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.ImageWeight != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.ImageWeight, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"image_weight\""); + + } + if (request.NegativePrompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.NegativePrompt ?? string.Empty), + name: "\"negative_prompt\""); + + } + for (var __iCharacterReferenceImages = 0; __iCharacterReferenceImages < characterReferenceImages.Count; __iCharacterReferenceImages++) + { + var __fileNameCharacterReferenceImages = characterReferenceImagesFileNames != null && + __iCharacterReferenceImages < characterReferenceImagesFileNames.Count && + characterReferenceImagesFileNames[__iCharacterReferenceImages] != null + ? characterReferenceImagesFileNames[__iCharacterReferenceImages] + : $"file{__iCharacterReferenceImages}.bin"; + var __contentCharacterReferenceImages = new global::System.Net.Http.StreamContent(characterReferenceImages[__iCharacterReferenceImages]); + __contentCharacterReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + __fileNameCharacterReferenceImages is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(__fileNameCharacterReferenceImages) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentCharacterReferenceImages, + name: "\"character_reference_images\"", + fileName: $"\"{__fileNameCharacterReferenceImages}\""); + if (__contentCharacterReferenceImages.Headers.ContentDisposition != null) + { + __contentCharacterReferenceImages.Headers.ContentDisposition.FileNameStar = null; + } + } + + if (characterReferenceMask != default) + { + + var __contentCharacterReferenceMask = new global::System.Net.Http.StreamContent(characterReferenceMask); + __contentCharacterReferenceMask.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.CharacterReferenceMaskname is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.CharacterReferenceMaskname) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentCharacterReferenceMask, + name: "\"character_reference_mask\"", + fileName: request.CharacterReferenceMaskname != null ? $"\"{request.CharacterReferenceMaskname}\"" : string.Empty); + if (__contentCharacterReferenceMask.Headers.ContentDisposition != null) + { + __contentCharacterReferenceMask.Headers.ContentDisposition.FileNameStar = null; + } + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (request.Resolution != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"resolution\""); + + } + if (request.AspectRatio != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.AspectRatio).HasValue ? (request.AspectRatio).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"aspect_ratio\""); + + } + if (request.RenderingSpeed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"rendering_speed\""); + + } + if (request.MagicPrompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.MagicPrompt).HasValue ? (request.MagicPrompt).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"magic_prompt\""); + + } + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.StyleType != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.StyleType).HasValue ? (request.StyleType).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"style_type\""); + + } + if (styleReferenceImages != default) + { + + for (var __iStyleReferenceImages = 0; __iStyleReferenceImages < styleReferenceImages.Count; __iStyleReferenceImages++) + { + var __fileNameStyleReferenceImages = styleReferenceImagesFileNames != null && + __iStyleReferenceImages < styleReferenceImagesFileNames.Count && + styleReferenceImagesFileNames[__iStyleReferenceImages] != null + ? styleReferenceImagesFileNames[__iStyleReferenceImages] + : $"file{__iStyleReferenceImages}.bin"; + var __contentStyleReferenceImages = new global::System.Net.Http.StreamContent(styleReferenceImages[__iStyleReferenceImages]); + __contentStyleReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + __fileNameStyleReferenceImages is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(__fileNameStyleReferenceImages) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentStyleReferenceImages, + name: "\"style_reference_images\"", + fileName: $"\"{__fileNameStyleReferenceImages}\""); + if (__contentStyleReferenceImages.Headers.ContentDisposition != null) + { + __contentStyleReferenceImages.Headers.ContentDisposition.FileNameStar = null; + } + } + + } + if (request.EnableCopyrightDetection != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"enable_copyright_detection\""); + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImagesRemixPostRemixImageV2IdeogramV3CharacterRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesRemixPostRemixImageV2IdeogramV3Character", + methodName: "ImagesRemixPostRemixImageV2IdeogramV3CharacterAsync", + pathTemplate: "\"/v2/image/remix/ideogram-3-character\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesRemixPostRemixImageV2IdeogramV3Character", + methodName: "ImagesRemixPostRemixImageV2IdeogramV3CharacterAsync", + pathTemplate: "\"/v2/image/remix/ideogram-3-character\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesRemixPostRemixImageV2IdeogramV3Character", + methodName: "ImagesRemixPostRemixImageV2IdeogramV3CharacterAsync", + pathTemplate: "\"/v2/image/remix/ideogram-3-character\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImagesRemixPostRemixImageV2IdeogramV3CharacterResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesRemixPostRemixImageV2IdeogramV3Character", + methodName: "ImagesRemixPostRemixImageV2IdeogramV3CharacterAsync", + pathTemplate: "\"/v2/image/remix/ideogram-3-character\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesRemixPostRemixImageV2IdeogramV3Character", + methodName: "ImagesRemixPostRemixImageV2IdeogramV3CharacterAsync", + pathTemplate: "\"/v2/image/remix/ideogram-3-character\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // A referenced resource was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImagesRemixPostRemixImageV2IdeogramV3CharacterResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.RemixImageIdeogramV3CharacterResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.RemixImageIdeogramV3CharacterResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesRemixClient.ImagesRemixPostRemixImageV2IdeogramV3CustomModel.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesRemixClient.ImagesRemixPostRemixImageV2IdeogramV3CustomModel.g.cs new file mode 100644 index 00000000..527e4da7 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.ImagesRemixClient.ImagesRemixPostRemixImageV2IdeogramV3CustomModel.g.cs @@ -0,0 +1,3163 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class ImagesRemixClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_ImagesRemixPostRemixImageV2IdeogramV3CustomModelSecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_ImagesRemixPostRemixImageV2IdeogramV3CustomModelSecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_ImagesRemixPostRemixImageV2IdeogramV3CustomModelSecurityRequirement0, + }; + partial void PrepareImagesRemixPostRemixImageV2IdeogramV3CustomModelArguments( + global::System.Net.Http.HttpClient httpClient, + ref bool? dryRun, + global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CustomModelRequest request); + partial void PrepareImagesRemixPostRemixImageV2IdeogramV3CustomModelRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + bool? dryRun, + global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CustomModelRequest request); + partial void ProcessImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessImagesRemixPostRemixImageV2IdeogramV3CustomModelResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Remix with a custom Ideogram 3.0 model
+ /// Transform an existing image with a custom Ideogram 3.0 model that your
+ /// user or organization can access, guided by a text prompt. Upload the
+ /// source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesRemixPostRemixImageV2IdeogramV3CustomModelAsync( + + global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CustomModelRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ImagesRemixPostRemixImageV2IdeogramV3CustomModelAsResponseAsync( + + request: request, + dryRun: dryRun, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Remix with a custom Ideogram 3.0 model
+ /// Transform an existing image with a custom Ideogram 3.0 model that your
+ /// user or organization can access, guided by a text prompt. Upload the
+ /// source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ImagesRemixPostRemixImageV2IdeogramV3CustomModelAsResponseAsync( + + global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CustomModelRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareImagesRemixPostRemixImageV2IdeogramV3CustomModelArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImagesRemixPostRemixImageV2IdeogramV3CustomModelSecurityRequirements, + operationName: "ImagesRemixPostRemixImageV2IdeogramV3CustomModelAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/remix/ideogram-3-custom-model", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.CustomModelUri ?? string.Empty), + name: "\"custom_model_uri\""); + + var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.ImageWeight != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.ImageWeight, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"image_weight\""); + + } + if (request.NegativePrompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.NegativePrompt ?? string.Empty), + name: "\"negative_prompt\""); + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (request.Resolution != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"resolution\""); + + } + if (request.AspectRatio != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.AspectRatio).HasValue ? (request.AspectRatio).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"aspect_ratio\""); + + } + if (request.RenderingSpeed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"rendering_speed\""); + + } + if (request.MagicPrompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.MagicPrompt).HasValue ? (request.MagicPrompt).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"magic_prompt\""); + + } + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.ColorPalette != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.ColorPalette.ToString() ?? string.Empty), + name: "\"color_palette\""); + + } + if (request.StyleCodes != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.StyleCodes!, x => x))}]"), + name: "\"style_codes\""); + + } + if (request.StylePreset != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.StylePreset).HasValue ? (request.StylePreset).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"style_preset\""); + + } + if (request.StyleReferenceImages != default) + { + + for (var __iStyleReferenceImages = 0; __iStyleReferenceImages < request.StyleReferenceImages.Count; __iStyleReferenceImages++) + { + var __contentStyleReferenceImages = new global::System.Net.Http.ByteArrayContent(request.StyleReferenceImages[__iStyleReferenceImages]); + __contentStyleReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); + __httpRequestContent.Add( + content: __contentStyleReferenceImages, + name: "\"style_reference_images\"", + fileName: $"\"file{__iStyleReferenceImages}.bin\""); + if (__contentStyleReferenceImages.Headers.ContentDisposition != null) + { + __contentStyleReferenceImages.Headers.ContentDisposition.FileNameStar = null; + } + } + + } + if (request.EnableCopyrightDetection != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"enable_copyright_detection\""); + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImagesRemixPostRemixImageV2IdeogramV3CustomModelRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesRemixPostRemixImageV2IdeogramV3CustomModel", + methodName: "ImagesRemixPostRemixImageV2IdeogramV3CustomModelAsync", + pathTemplate: "\"/v2/image/remix/ideogram-3-custom-model\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesRemixPostRemixImageV2IdeogramV3CustomModel", + methodName: "ImagesRemixPostRemixImageV2IdeogramV3CustomModelAsync", + pathTemplate: "\"/v2/image/remix/ideogram-3-custom-model\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesRemixPostRemixImageV2IdeogramV3CustomModel", + methodName: "ImagesRemixPostRemixImageV2IdeogramV3CustomModelAsync", + pathTemplate: "\"/v2/image/remix/ideogram-3-custom-model\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesRemixPostRemixImageV2IdeogramV3CustomModel", + methodName: "ImagesRemixPostRemixImageV2IdeogramV3CustomModelAsync", + pathTemplate: "\"/v2/image/remix/ideogram-3-custom-model\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesRemixPostRemixImageV2IdeogramV3CustomModel", + methodName: "ImagesRemixPostRemixImageV2IdeogramV3CustomModelAsync", + pathTemplate: "\"/v2/image/remix/ideogram-3-custom-model\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input or an unsupported model option. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The custom model does not exist or is not accessible to this user or organization. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // A referenced resource was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImagesRemixPostRemixImageV2IdeogramV3CustomModelResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.RemixImageIdeogramV3CustomModelResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.RemixImageIdeogramV3CustomModelResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Remix with a custom Ideogram 3.0 model
+ /// Transform an existing image with a custom Ideogram 3.0 model that your
+ /// user or organization can access, guided by a text prompt. Upload the
+ /// source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt that guides the remix. + /// + /// + /// The custom model URI returned by the custom-model API, in the form `model/<model_name>/version/<version_name>`. The authenticated user or organization must have access to the model. + /// + /// + /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. + /// + /// + /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. + /// + /// + /// Optional. How closely the result should follow the source image, from 1 to 100. When omitted the server chooses a value from your prompt, which is the usual case. + /// + /// + /// Description of what to exclude from the images. Descriptions in the prompt take precedence over descriptions in the negative prompt. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The resolutions supported for Ideogram 3.0. + /// + /// + /// Output aspect ratio. Cannot be combined with resolution. Generation defaults to 1x1; remix keeps the source ratio when both fields are omitted. + /// + /// + /// The rendering speed to use. When omitted, the server chooses a speed supported by the selected custom model. + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). + /// + /// + /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images. + /// + /// + /// A predefined style preset to apply to the remixed images. Cannot be combined with style codes or style references. + /// + /// + /// Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported. Multipart requests only. + /// + /// + /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesRemixPostRemixImageV2IdeogramV3CustomModelAsync( + string prompt, + string customModelUri, + byte[] image, + string imagename, + bool? dryRun = default, + int? imageWeight = default, + string? negativePrompt = default, + int? seed = default, + global::Ideogram.ResolutionV3? resolution = default, + global::Ideogram.AspectRatioV3? aspectRatio = default, + global::Ideogram.V2ImageRemixIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + int? numImages = default, + global::Ideogram.IdeogramColorPalette? colorPalette = default, + global::System.Collections.Generic.IList? styleCodes = default, + global::Ideogram.IdeogramV3StylePreset? stylePreset = default, + global::System.Collections.Generic.IList? styleReferenceImages = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CustomModelRequest + { + Prompt = prompt, + CustomModelUri = customModelUri, + Image = image, + Imagename = imagename, + ImageWeight = imageWeight, + NegativePrompt = negativePrompt, + Seed = seed, + Resolution = resolution, + AspectRatio = aspectRatio, + RenderingSpeed = renderingSpeed, + MagicPrompt = magicPrompt, + NumImages = numImages, + ColorPalette = colorPalette, + StyleCodes = styleCodes, + StylePreset = stylePreset, + StyleReferenceImages = styleReferenceImages, + EnableCopyrightDetection = enableCopyrightDetection, + Async = async, + WebhookUrl = webhookUrl, + }; + + return await ImagesRemixPostRemixImageV2IdeogramV3CustomModelAsync( + dryRun: dryRun, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// Remix with a custom Ideogram 3.0 model
+ /// Transform an existing image with a custom Ideogram 3.0 model that your
+ /// user or organization can access, guided by a text prompt. Upload the
+ /// source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt that guides the remix. + /// + /// + /// The custom model URI returned by the custom-model API, in the form `model/<model_name>/version/<version_name>`. The authenticated user or organization must have access to the model. + /// + /// + /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. + /// + /// + /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. + /// + /// + /// Optional. How closely the result should follow the source image, from 1 to 100. When omitted the server chooses a value from your prompt, which is the usual case. + /// + /// + /// Description of what to exclude from the images. Descriptions in the prompt take precedence over descriptions in the negative prompt. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The resolutions supported for Ideogram 3.0. + /// + /// + /// Output aspect ratio. Cannot be combined with resolution. Generation defaults to 1x1; remix keeps the source ratio when both fields are omitted. + /// + /// + /// The rendering speed to use. When omitted, the server chooses a speed supported by the selected custom model. + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). + /// + /// + /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images. + /// + /// + /// A predefined style preset to apply to the remixed images. Cannot be combined with style codes or style references. + /// + /// + /// Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported. Multipart requests only. + /// + /// + /// Optional file names to use for the multipart 'style_reference_images' file parts. + /// + /// + /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesRemixPostRemixImageV2IdeogramV3CustomModelAsync( + string prompt, + string customModelUri, + global::System.IO.Stream image, + string imagename, + bool? dryRun = default, + int? imageWeight = default, + string? negativePrompt = default, + int? seed = default, + global::Ideogram.ResolutionV3? resolution = default, + global::Ideogram.AspectRatioV3? aspectRatio = default, + global::Ideogram.V2ImageRemixIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + int? numImages = default, + global::Ideogram.IdeogramColorPalette? colorPalette = default, + global::System.Collections.Generic.IList? styleCodes = default, + global::Ideogram.IdeogramV3StylePreset? stylePreset = default, + global::System.Collections.Generic.IReadOnlyList? styleReferenceImages = default, + global::System.Collections.Generic.IReadOnlyList? styleReferenceImagesFileNames = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + var request = new global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CustomModelRequest + { + Prompt = prompt, + CustomModelUri = customModelUri, + Image = global::System.Array.Empty(), + Imagename = imagename, + ImageWeight = imageWeight, + NegativePrompt = negativePrompt, + Seed = seed, + Resolution = resolution, + AspectRatio = aspectRatio, + RenderingSpeed = renderingSpeed, + MagicPrompt = magicPrompt, + NumImages = numImages, + ColorPalette = colorPalette, + StyleCodes = styleCodes, + StylePreset = stylePreset, + StyleReferenceImages = new global::System.Collections.Generic.List(), + EnableCopyrightDetection = enableCopyrightDetection, + Async = async, + WebhookUrl = webhookUrl, + }; + PrepareArguments( + client: HttpClient); + PrepareImagesRemixPostRemixImageV2IdeogramV3CustomModelArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImagesRemixPostRemixImageV2IdeogramV3CustomModelSecurityRequirements, + operationName: "ImagesRemixPostRemixImageV2IdeogramV3CustomModelAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/remix/ideogram-3-custom-model", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.CustomModelUri ?? string.Empty), + name: "\"custom_model_uri\""); + + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.ImageWeight != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.ImageWeight, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"image_weight\""); + + } + if (request.NegativePrompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.NegativePrompt ?? string.Empty), + name: "\"negative_prompt\""); + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (request.Resolution != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"resolution\""); + + } + if (request.AspectRatio != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.AspectRatio).HasValue ? (request.AspectRatio).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"aspect_ratio\""); + + } + if (request.RenderingSpeed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"rendering_speed\""); + + } + if (request.MagicPrompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.MagicPrompt).HasValue ? (request.MagicPrompt).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"magic_prompt\""); + + } + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.ColorPalette != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.ColorPalette.ToString() ?? string.Empty), + name: "\"color_palette\""); + + } + if (request.StyleCodes != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.StyleCodes!, x => x))}]"), + name: "\"style_codes\""); + + } + if (request.StylePreset != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.StylePreset).HasValue ? (request.StylePreset).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"style_preset\""); + + } + if (styleReferenceImages != default) + { + + for (var __iStyleReferenceImages = 0; __iStyleReferenceImages < styleReferenceImages.Count; __iStyleReferenceImages++) + { + var __fileNameStyleReferenceImages = styleReferenceImagesFileNames != null && + __iStyleReferenceImages < styleReferenceImagesFileNames.Count && + styleReferenceImagesFileNames[__iStyleReferenceImages] != null + ? styleReferenceImagesFileNames[__iStyleReferenceImages] + : $"file{__iStyleReferenceImages}.bin"; + var __contentStyleReferenceImages = new global::System.Net.Http.StreamContent(styleReferenceImages[__iStyleReferenceImages]); + __contentStyleReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + __fileNameStyleReferenceImages is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(__fileNameStyleReferenceImages) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentStyleReferenceImages, + name: "\"style_reference_images\"", + fileName: $"\"{__fileNameStyleReferenceImages}\""); + if (__contentStyleReferenceImages.Headers.ContentDisposition != null) + { + __contentStyleReferenceImages.Headers.ContentDisposition.FileNameStar = null; + } + } + + } + if (request.EnableCopyrightDetection != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"enable_copyright_detection\""); + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImagesRemixPostRemixImageV2IdeogramV3CustomModelRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesRemixPostRemixImageV2IdeogramV3CustomModel", + methodName: "ImagesRemixPostRemixImageV2IdeogramV3CustomModelAsync", + pathTemplate: "\"/v2/image/remix/ideogram-3-custom-model\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesRemixPostRemixImageV2IdeogramV3CustomModel", + methodName: "ImagesRemixPostRemixImageV2IdeogramV3CustomModelAsync", + pathTemplate: "\"/v2/image/remix/ideogram-3-custom-model\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesRemixPostRemixImageV2IdeogramV3CustomModel", + methodName: "ImagesRemixPostRemixImageV2IdeogramV3CustomModelAsync", + pathTemplate: "\"/v2/image/remix/ideogram-3-custom-model\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesRemixPostRemixImageV2IdeogramV3CustomModel", + methodName: "ImagesRemixPostRemixImageV2IdeogramV3CustomModelAsync", + pathTemplate: "\"/v2/image/remix/ideogram-3-custom-model\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesRemixPostRemixImageV2IdeogramV3CustomModel", + methodName: "ImagesRemixPostRemixImageV2IdeogramV3CustomModelAsync", + pathTemplate: "\"/v2/image/remix/ideogram-3-custom-model\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input or an unsupported model option. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The custom model does not exist or is not accessible to this user or organization. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // A referenced resource was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImagesRemixPostRemixImageV2IdeogramV3CustomModelResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::Ideogram.RemixImageIdeogramV3CustomModelResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::Ideogram.RemixImageIdeogramV3CustomModelResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Remix with a custom Ideogram 3.0 model
+ /// Transform an existing image with a custom Ideogram 3.0 model that your
+ /// user or organization can access, guided by a text prompt. Upload the
+ /// source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt that guides the remix. + /// + /// + /// The custom model URI returned by the custom-model API, in the form `model/<model_name>/version/<version_name>`. The authenticated user or organization must have access to the model. + /// + /// + /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. + /// + /// + /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. + /// + /// + /// Optional. How closely the result should follow the source image, from 1 to 100. When omitted the server chooses a value from your prompt, which is the usual case. + /// + /// + /// Description of what to exclude from the images. Descriptions in the prompt take precedence over descriptions in the negative prompt. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The resolutions supported for Ideogram 3.0. + /// + /// + /// Output aspect ratio. Cannot be combined with resolution. Generation defaults to 1x1; remix keeps the source ratio when both fields are omitted. + /// + /// + /// The rendering speed to use. When omitted, the server chooses a speed supported by the selected custom model. + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). + /// + /// + /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images. + /// + /// + /// A predefined style preset to apply to the remixed images. Cannot be combined with style codes or style references. + /// + /// + /// Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported. Multipart requests only. + /// + /// + /// Optional file names to use for the multipart 'style_reference_images' file parts. + /// + /// + /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ImagesRemixPostRemixImageV2IdeogramV3CustomModelAsResponseAsync( + string prompt, + string customModelUri, + global::System.IO.Stream image, + string imagename, + bool? dryRun = default, + int? imageWeight = default, + string? negativePrompt = default, + int? seed = default, + global::Ideogram.ResolutionV3? resolution = default, + global::Ideogram.AspectRatioV3? aspectRatio = default, + global::Ideogram.V2ImageRemixIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed = default, + global::Ideogram.MagicPromptMode? magicPrompt = default, + int? numImages = default, + global::Ideogram.IdeogramColorPalette? colorPalette = default, + global::System.Collections.Generic.IList? styleCodes = default, + global::Ideogram.IdeogramV3StylePreset? stylePreset = default, + global::System.Collections.Generic.IReadOnlyList? styleReferenceImages = default, + global::System.Collections.Generic.IReadOnlyList? styleReferenceImagesFileNames = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + var request = new global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CustomModelRequest + { + Prompt = prompt, + CustomModelUri = customModelUri, + Image = global::System.Array.Empty(), + Imagename = imagename, + ImageWeight = imageWeight, + NegativePrompt = negativePrompt, + Seed = seed, + Resolution = resolution, + AspectRatio = aspectRatio, + RenderingSpeed = renderingSpeed, + MagicPrompt = magicPrompt, + NumImages = numImages, + ColorPalette = colorPalette, + StyleCodes = styleCodes, + StylePreset = stylePreset, + StyleReferenceImages = new global::System.Collections.Generic.List(), + EnableCopyrightDetection = enableCopyrightDetection, + Async = async, + WebhookUrl = webhookUrl, + }; + PrepareArguments( + client: HttpClient); + PrepareImagesRemixPostRemixImageV2IdeogramV3CustomModelArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImagesRemixPostRemixImageV2IdeogramV3CustomModelSecurityRequirements, + operationName: "ImagesRemixPostRemixImageV2IdeogramV3CustomModelAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/remix/ideogram-3-custom-model", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.CustomModelUri ?? string.Empty), + name: "\"custom_model_uri\""); + + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.ImageWeight != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.ImageWeight, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"image_weight\""); + + } + if (request.NegativePrompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.NegativePrompt ?? string.Empty), + name: "\"negative_prompt\""); + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (request.Resolution != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"resolution\""); + + } + if (request.AspectRatio != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.AspectRatio).HasValue ? (request.AspectRatio).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"aspect_ratio\""); + + } + if (request.RenderingSpeed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"rendering_speed\""); + + } + if (request.MagicPrompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.MagicPrompt).HasValue ? (request.MagicPrompt).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"magic_prompt\""); + + } + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.ColorPalette != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.ColorPalette.ToString() ?? string.Empty), + name: "\"color_palette\""); + + } + if (request.StyleCodes != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.StyleCodes!, x => x))}]"), + name: "\"style_codes\""); + + } + if (request.StylePreset != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.StylePreset).HasValue ? (request.StylePreset).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"style_preset\""); + + } + if (styleReferenceImages != default) + { + + for (var __iStyleReferenceImages = 0; __iStyleReferenceImages < styleReferenceImages.Count; __iStyleReferenceImages++) + { + var __fileNameStyleReferenceImages = styleReferenceImagesFileNames != null && + __iStyleReferenceImages < styleReferenceImagesFileNames.Count && + styleReferenceImagesFileNames[__iStyleReferenceImages] != null + ? styleReferenceImagesFileNames[__iStyleReferenceImages] + : $"file{__iStyleReferenceImages}.bin"; + var __contentStyleReferenceImages = new global::System.Net.Http.StreamContent(styleReferenceImages[__iStyleReferenceImages]); + __contentStyleReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + __fileNameStyleReferenceImages is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(__fileNameStyleReferenceImages) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentStyleReferenceImages, + name: "\"style_reference_images\"", + fileName: $"\"{__fileNameStyleReferenceImages}\""); + if (__contentStyleReferenceImages.Headers.ContentDisposition != null) + { + __contentStyleReferenceImages.Headers.ContentDisposition.FileNameStar = null; + } + } + + } + if (request.EnableCopyrightDetection != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"enable_copyright_detection\""); + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImagesRemixPostRemixImageV2IdeogramV3CustomModelRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesRemixPostRemixImageV2IdeogramV3CustomModel", + methodName: "ImagesRemixPostRemixImageV2IdeogramV3CustomModelAsync", + pathTemplate: "\"/v2/image/remix/ideogram-3-custom-model\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesRemixPostRemixImageV2IdeogramV3CustomModel", + methodName: "ImagesRemixPostRemixImageV2IdeogramV3CustomModelAsync", + pathTemplate: "\"/v2/image/remix/ideogram-3-custom-model\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesRemixPostRemixImageV2IdeogramV3CustomModel", + methodName: "ImagesRemixPostRemixImageV2IdeogramV3CustomModelAsync", + pathTemplate: "\"/v2/image/remix/ideogram-3-custom-model\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesRemixPostRemixImageV2IdeogramV3CustomModel", + methodName: "ImagesRemixPostRemixImageV2IdeogramV3CustomModelAsync", + pathTemplate: "\"/v2/image/remix/ideogram-3-custom-model\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesRemixPostRemixImageV2IdeogramV3CustomModel", + methodName: "ImagesRemixPostRemixImageV2IdeogramV3CustomModelAsync", + pathTemplate: "\"/v2/image/remix/ideogram-3-custom-model\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input or an unsupported model option. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The custom model does not exist or is not accessible to this user or organization. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // A referenced resource was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImagesRemixPostRemixImageV2IdeogramV3CustomModelResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.RemixImageIdeogramV3CustomModelResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.RemixImageIdeogramV3CustomModelResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesRemixClient.ImagesRemixPostRemixImageV2IdeogramV4.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesRemixClient.ImagesRemixPostRemixImageV2IdeogramV4.g.cs new file mode 100644 index 00000000..c9878c4c --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.ImagesRemixClient.ImagesRemixPostRemixImageV2IdeogramV4.g.cs @@ -0,0 +1,2615 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class ImagesRemixClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_ImagesRemixPostRemixImageV2IdeogramV4SecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_ImagesRemixPostRemixImageV2IdeogramV4SecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_ImagesRemixPostRemixImageV2IdeogramV4SecurityRequirement0, + }; + partial void PrepareImagesRemixPostRemixImageV2IdeogramV4Arguments( + global::System.Net.Http.HttpClient httpClient, + ref bool? dryRun, + global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV4Request request); + partial void PrepareImagesRemixPostRemixImageV2IdeogramV4Request( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + bool? dryRun, + global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV4Request request); + partial void ProcessImagesRemixPostRemixImageV2IdeogramV4Response( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessImagesRemixPostRemixImageV2IdeogramV4ResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Remix with Ideogram 4.0
+ /// Transform an existing image with Ideogram 4.0, guided by a text
+ /// prompt. Upload the source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesRemixPostRemixImageV2IdeogramV4Async( + + global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV4Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ImagesRemixPostRemixImageV2IdeogramV4AsResponseAsync( + + request: request, + dryRun: dryRun, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Remix with Ideogram 4.0
+ /// Transform an existing image with Ideogram 4.0, guided by a text
+ /// prompt. Upload the source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ImagesRemixPostRemixImageV2IdeogramV4AsResponseAsync( + + global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV4Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareImagesRemixPostRemixImageV2IdeogramV4Arguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImagesRemixPostRemixImageV2IdeogramV4SecurityRequirements, + operationName: "ImagesRemixPostRemixImageV2IdeogramV4Async"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/remix/ideogram-4", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.ImageWeight != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.ImageWeight, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"image_weight\""); + + } + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.Resolution != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"resolution\""); + + } + if (request.RenderingSpeed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"rendering_speed\""); + + } + if (request.EnableCopyrightDetection != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"enable_copyright_detection\""); + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImagesRemixPostRemixImageV2IdeogramV4Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesRemixPostRemixImageV2IdeogramV4", + methodName: "ImagesRemixPostRemixImageV2IdeogramV4Async", + pathTemplate: "\"/v2/image/remix/ideogram-4\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesRemixPostRemixImageV2IdeogramV4", + methodName: "ImagesRemixPostRemixImageV2IdeogramV4Async", + pathTemplate: "\"/v2/image/remix/ideogram-4\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesRemixPostRemixImageV2IdeogramV4", + methodName: "ImagesRemixPostRemixImageV2IdeogramV4Async", + pathTemplate: "\"/v2/image/remix/ideogram-4\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImagesRemixPostRemixImageV2IdeogramV4Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesRemixPostRemixImageV2IdeogramV4", + methodName: "ImagesRemixPostRemixImageV2IdeogramV4Async", + pathTemplate: "\"/v2/image/remix/ideogram-4\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesRemixPostRemixImageV2IdeogramV4", + methodName: "ImagesRemixPostRemixImageV2IdeogramV4Async", + pathTemplate: "\"/v2/image/remix/ideogram-4\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // A referenced resource was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImagesRemixPostRemixImageV2IdeogramV4ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.RemixImageIdeogramV4Response.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.RemixImageIdeogramV4Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Remix with Ideogram 4.0
+ /// Transform an existing image with Ideogram 4.0, guided by a text
+ /// prompt. Upload the source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt that guides the remix. It is always read as an editing instruction, so there is no `magic_prompt` option. + /// + /// + /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` to keep its shape. + /// + /// + /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` to keep its shape. + /// + /// + /// Optional. How closely the result should follow the source image, from 1 to 100. When omitted the server chooses a value from your prompt, which is the usual case. Only accepted when the output keeps the source image's shape: combining `image_weight` with a `resolution` whose aspect ratio differs from the source's is rejected with a 400. + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Optional. When supplied, the images are generated at this
+ /// resolution. When omitted, the source image's shape is kept. A
+ /// resolution whose aspect ratio differs from the source's cannot
+ /// be combined with `image_weight`. + /// + /// + /// The rendering speed to use.
+ /// Default Value: default + /// + /// + /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesRemixPostRemixImageV2IdeogramV4Async( + string prompt, + byte[] image, + string imagename, + bool? dryRun = default, + int? imageWeight = default, + int? numImages = default, + global::Ideogram.ResolutionV4? resolution = default, + global::Ideogram.V2ImageRemixIdeogram4PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV4Request + { + Prompt = prompt, + Image = image, + Imagename = imagename, + ImageWeight = imageWeight, + NumImages = numImages, + Resolution = resolution, + RenderingSpeed = renderingSpeed, + EnableCopyrightDetection = enableCopyrightDetection, + Async = async, + WebhookUrl = webhookUrl, + }; + + return await ImagesRemixPostRemixImageV2IdeogramV4Async( + dryRun: dryRun, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// Remix with Ideogram 4.0
+ /// Transform an existing image with Ideogram 4.0, guided by a text
+ /// prompt. Upload the source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt that guides the remix. It is always read as an editing instruction, so there is no `magic_prompt` option. + /// + /// + /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` to keep its shape. + /// + /// + /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` to keep its shape. + /// + /// + /// Optional. How closely the result should follow the source image, from 1 to 100. When omitted the server chooses a value from your prompt, which is the usual case. Only accepted when the output keeps the source image's shape: combining `image_weight` with a `resolution` whose aspect ratio differs from the source's is rejected with a 400. + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Optional. When supplied, the images are generated at this
+ /// resolution. When omitted, the source image's shape is kept. A
+ /// resolution whose aspect ratio differs from the source's cannot
+ /// be combined with `image_weight`. + /// + /// + /// The rendering speed to use.
+ /// Default Value: default + /// + /// + /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesRemixPostRemixImageV2IdeogramV4Async( + string prompt, + global::System.IO.Stream image, + string imagename, + bool? dryRun = default, + int? imageWeight = default, + int? numImages = default, + global::Ideogram.ResolutionV4? resolution = default, + global::Ideogram.V2ImageRemixIdeogram4PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + var request = new global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV4Request + { + Prompt = prompt, + Image = global::System.Array.Empty(), + Imagename = imagename, + ImageWeight = imageWeight, + NumImages = numImages, + Resolution = resolution, + RenderingSpeed = renderingSpeed, + EnableCopyrightDetection = enableCopyrightDetection, + Async = async, + WebhookUrl = webhookUrl, + }; + PrepareArguments( + client: HttpClient); + PrepareImagesRemixPostRemixImageV2IdeogramV4Arguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImagesRemixPostRemixImageV2IdeogramV4SecurityRequirements, + operationName: "ImagesRemixPostRemixImageV2IdeogramV4Async"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/remix/ideogram-4", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.ImageWeight != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.ImageWeight, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"image_weight\""); + + } + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.Resolution != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"resolution\""); + + } + if (request.RenderingSpeed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"rendering_speed\""); + + } + if (request.EnableCopyrightDetection != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"enable_copyright_detection\""); + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImagesRemixPostRemixImageV2IdeogramV4Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesRemixPostRemixImageV2IdeogramV4", + methodName: "ImagesRemixPostRemixImageV2IdeogramV4Async", + pathTemplate: "\"/v2/image/remix/ideogram-4\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesRemixPostRemixImageV2IdeogramV4", + methodName: "ImagesRemixPostRemixImageV2IdeogramV4Async", + pathTemplate: "\"/v2/image/remix/ideogram-4\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesRemixPostRemixImageV2IdeogramV4", + methodName: "ImagesRemixPostRemixImageV2IdeogramV4Async", + pathTemplate: "\"/v2/image/remix/ideogram-4\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImagesRemixPostRemixImageV2IdeogramV4Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesRemixPostRemixImageV2IdeogramV4", + methodName: "ImagesRemixPostRemixImageV2IdeogramV4Async", + pathTemplate: "\"/v2/image/remix/ideogram-4\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesRemixPostRemixImageV2IdeogramV4", + methodName: "ImagesRemixPostRemixImageV2IdeogramV4Async", + pathTemplate: "\"/v2/image/remix/ideogram-4\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // A referenced resource was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImagesRemixPostRemixImageV2IdeogramV4ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::Ideogram.RemixImageIdeogramV4Response.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::Ideogram.RemixImageIdeogramV4Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Remix with Ideogram 4.0
+ /// Transform an existing image with Ideogram 4.0, guided by a text
+ /// prompt. Upload the source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The prompt that guides the remix. It is always read as an editing instruction, so there is no `magic_prompt` option. + /// + /// + /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` to keep its shape. + /// + /// + /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` to keep its shape. + /// + /// + /// Optional. How closely the result should follow the source image, from 1 to 100. When omitted the server chooses a value from your prompt, which is the usual case. Only accepted when the output keeps the source image's shape: combining `image_weight` with a `resolution` whose aspect ratio differs from the source's is rejected with a 400. + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Optional. When supplied, the images are generated at this
+ /// resolution. When omitted, the source image's shape is kept. A
+ /// resolution whose aspect ratio differs from the source's cannot
+ /// be combined with `image_weight`. + /// + /// + /// The rendering speed to use.
+ /// Default Value: default + /// + /// + /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ImagesRemixPostRemixImageV2IdeogramV4AsResponseAsync( + string prompt, + global::System.IO.Stream image, + string imagename, + bool? dryRun = default, + int? imageWeight = default, + int? numImages = default, + global::Ideogram.ResolutionV4? resolution = default, + global::Ideogram.V2ImageRemixIdeogram4PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed = default, + bool? enableCopyrightDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + var request = new global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV4Request + { + Prompt = prompt, + Image = global::System.Array.Empty(), + Imagename = imagename, + ImageWeight = imageWeight, + NumImages = numImages, + Resolution = resolution, + RenderingSpeed = renderingSpeed, + EnableCopyrightDetection = enableCopyrightDetection, + Async = async, + WebhookUrl = webhookUrl, + }; + PrepareArguments( + client: HttpClient); + PrepareImagesRemixPostRemixImageV2IdeogramV4Arguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImagesRemixPostRemixImageV2IdeogramV4SecurityRequirements, + operationName: "ImagesRemixPostRemixImageV2IdeogramV4Async"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/remix/ideogram-4", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.ImageWeight != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.ImageWeight, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"image_weight\""); + + } + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.Resolution != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"resolution\""); + + } + if (request.RenderingSpeed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"rendering_speed\""); + + } + if (request.EnableCopyrightDetection != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"enable_copyright_detection\""); + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImagesRemixPostRemixImageV2IdeogramV4Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesRemixPostRemixImageV2IdeogramV4", + methodName: "ImagesRemixPostRemixImageV2IdeogramV4Async", + pathTemplate: "\"/v2/image/remix/ideogram-4\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesRemixPostRemixImageV2IdeogramV4", + methodName: "ImagesRemixPostRemixImageV2IdeogramV4Async", + pathTemplate: "\"/v2/image/remix/ideogram-4\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesRemixPostRemixImageV2IdeogramV4", + methodName: "ImagesRemixPostRemixImageV2IdeogramV4Async", + pathTemplate: "\"/v2/image/remix/ideogram-4\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImagesRemixPostRemixImageV2IdeogramV4Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesRemixPostRemixImageV2IdeogramV4", + methodName: "ImagesRemixPostRemixImageV2IdeogramV4Async", + pathTemplate: "\"/v2/image/remix/ideogram-4\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesRemixPostRemixImageV2IdeogramV4", + methodName: "ImagesRemixPostRemixImageV2IdeogramV4Async", + pathTemplate: "\"/v2/image/remix/ideogram-4\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // A referenced resource was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImagesRemixPostRemixImageV2IdeogramV4ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.RemixImageIdeogramV4Response.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.RemixImageIdeogramV4Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesRemixClient.PostRemixImageV2IdeogramV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesRemixClient.PostRemixImageV2IdeogramV3.g.cs deleted file mode 100644 index cbd8568c..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ImagesRemixClient.PostRemixImageV2IdeogramV3.g.cs +++ /dev/null @@ -1,1129 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ImagesRemixClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostRemixImageV2IdeogramV3SecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostRemixImageV2IdeogramV3SecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostRemixImageV2IdeogramV3SecurityRequirement0, - }; - partial void PreparePostRemixImageV2IdeogramV3Arguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? dryRun, - global::Ideogram.RemixImageIdeogramV3Request request); - partial void PreparePostRemixImageV2IdeogramV3Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? dryRun, - global::Ideogram.RemixImageIdeogramV3Request request); - partial void ProcessPostRemixImageV2IdeogramV3Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostRemixImageV2IdeogramV3ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Remix with Ideogram 3.0
- /// Transform an existing image with Ideogram 3.0, guided by a text
- /// prompt. Upload the source `image` using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostRemixImageV2IdeogramV3Async( - - global::Ideogram.RemixImageIdeogramV3Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostRemixImageV2IdeogramV3AsResponseAsync( - - request: request, - dryRun: dryRun, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Remix with Ideogram 3.0
- /// Transform an existing image with Ideogram 3.0, guided by a text
- /// prompt. Upload the source `image` using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostRemixImageV2IdeogramV3AsResponseAsync( - - global::Ideogram.RemixImageIdeogramV3Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostRemixImageV2IdeogramV3Arguments( - httpClient: HttpClient, - dryRun: ref dryRun, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostRemixImageV2IdeogramV3SecurityRequirements, - operationName: "PostRemixImageV2IdeogramV3Async"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/image/remix/ideogram-3", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - if (request.ImageAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ImageAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"image_asset_identifier\""); - - } - if (request.Image != default) - { - - var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.ImageWeight != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.ImageWeight, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"image_weight\""); - - } - if (request.NegativePrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.NegativePrompt ?? string.Empty), - name: "\"negative_prompt\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.Resolution != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"resolution\""); - - } - if (request.AspectRatio != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.AspectRatio).HasValue ? (request.AspectRatio).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"aspect_ratio\""); - - } - if (request.RenderingSpeed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"rendering_speed\""); - - } - if (request.MagicPrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.MagicPrompt).HasValue ? (request.MagicPrompt).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"magic_prompt\""); - - } - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.ColorPalette != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ColorPalette.ToString() ?? string.Empty), - name: "\"color_palette\""); - - } - if (request.StyleCodes != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.StyleCodes!, x => x))}]"), - name: "\"style_codes\""); - - } - if (request.StyleType != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.StyleType).HasValue ? (request.StyleType).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"style_type\""); - - } - if (request.StylePreset != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.StylePreset).HasValue ? (request.StylePreset).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"style_preset\""); - - } - if (request.StyleReferenceCollectionId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.StyleReferenceCollectionId ?? string.Empty), - name: "\"style_reference_collection_id\""); - - } - if (request.StyleReferenceCollectionVersionId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.StyleReferenceCollectionVersionId ?? string.Empty), - name: "\"style_reference_collection_version_id\""); - - } - if (request.StyleReferenceAssetIdentifiers != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.StyleReferenceAssetIdentifiers!, x => x.ToJson(JsonSerializerContext)))}]"), - name: "\"style_reference_asset_identifiers\""); - - } - if (request.StyleReferenceImages != default) - { - - for (var __iStyleReferenceImages = 0; __iStyleReferenceImages < request.StyleReferenceImages.Count; __iStyleReferenceImages++) - { - var __contentStyleReferenceImages = new global::System.Net.Http.ByteArrayContent(request.StyleReferenceImages[__iStyleReferenceImages]); - __contentStyleReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); - __httpRequestContent.Add( - content: __contentStyleReferenceImages, - name: "\"style_reference_images\"", - fileName: $"\"file{__iStyleReferenceImages}.bin\""); - if (__contentStyleReferenceImages.Headers.ContentDisposition != null) - { - __contentStyleReferenceImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - if (request.EnableCopyrightDetection != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"enable_copyright_detection\""); - - } - if (request.Async != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"async\""); - - } - if (request.WebhookUrl != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), - name: "\"webhook_url\""); - - } - if (request.Private != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"private\""); - - } - if (request.TargetCollectionId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.TargetCollectionId ?? string.Empty), - name: "\"target_collection_id\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostRemixImageV2IdeogramV3Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - dryRun: dryRun, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImageV2IdeogramV3", - methodName: "PostRemixImageV2IdeogramV3Async", - pathTemplate: "\"/v2/image/remix/ideogram-3\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImageV2IdeogramV3", - methodName: "PostRemixImageV2IdeogramV3Async", - pathTemplate: "\"/v2/image/remix/ideogram-3\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImageV2IdeogramV3", - methodName: "PostRemixImageV2IdeogramV3Async", - pathTemplate: "\"/v2/image/remix/ideogram-3\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostRemixImageV2IdeogramV3Response( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImageV2IdeogramV3", - methodName: "PostRemixImageV2IdeogramV3Async", - pathTemplate: "\"/v2/image/remix/ideogram-3\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImageV2IdeogramV3", - methodName: "PostRemixImageV2IdeogramV3Async", - pathTemplate: "\"/v2/image/remix/ideogram-3\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 500) - { - string? __content_500 = null; - global::System.Exception? __exception_500 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_500 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_500, - responseBody: __content_500, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostRemixImageV2IdeogramV3ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.RemixImageIdeogramV3Response.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.RemixImageIdeogramV3Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Remix with Ideogram 3.0
- /// Transform an existing image with Ideogram 3.0, guided by a text
- /// prompt. Upload the source `image` using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// The prompt that guides the remix. - /// - /// - /// The existing upload or generated image to transform. Supply this or `image`, never both. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. - /// - /// - /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. - /// - /// - /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. - /// - /// - /// Optional. How closely the result should follow the source image, from 1 to 100. When omitted the server chooses a value from your prompt, which is the usual case. - /// - /// - /// Description of what to exclude from the images. Descriptions in the prompt take precedence over descriptions in the negative prompt. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The resolutions supported for Ideogram 3.0.
- /// Example: 1280x800 - /// - /// - /// Output aspect ratio. Cannot be combined with resolution. Generation defaults to 1x1; remix keeps the source ratio when both fields are omitted. - /// - /// - /// The rendering speed to use.
- /// Default Value: default - /// - /// - /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
- /// Default Value: auto - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). - /// - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - /// - /// - /// The style type to generate with.
- /// Default Value: general
- /// Example: general - /// - /// - /// A predefined style preset to apply to the remixed images. Cannot be combined with style codes or style references. - /// - /// - /// A saved style to apply, by its URL-safe base64 collection id. Cannot be combined with `style_reference_images`. - /// - /// - /// Optional URL-safe base64 version id pinning a specific version of the `style_reference_collection_id` collection. Ignored without it. - /// - /// - /// Existing upload or generated image assets to use as style references, by reference. Cannot be combined with `style_reference_collection_id` or `style_reference_images`. - /// - /// - /// Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported. - /// - /// - /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. - /// - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostRemixImageV2IdeogramV3Async( - string prompt, - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - int? imageWeight = default, - string? negativePrompt = default, - int? seed = default, - global::Ideogram.ResolutionV3? resolution = default, - global::Ideogram.AspectRatioV3? aspectRatio = default, - global::Ideogram.RemixImageIdeogramV3RequestRenderingSpeed? renderingSpeed = default, - global::Ideogram.MagicPromptMode? magicPrompt = default, - int? numImages = default, - global::Ideogram.IdeogramColorPalette? colorPalette = default, - global::System.Collections.Generic.IList? styleCodes = default, - global::Ideogram.IdeogramV3StyleType? styleType = default, - global::Ideogram.IdeogramV3StylePreset? stylePreset = default, - string? styleReferenceCollectionId = default, - string? styleReferenceCollectionVersionId = default, - global::System.Collections.Generic.IList? styleReferenceAssetIdentifiers = default, - global::System.Collections.Generic.IList? styleReferenceImages = default, - bool? enableCopyrightDetection = default, - bool? async = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.RemixImageIdeogramV3Request - { - Prompt = prompt, - ImageAssetIdentifier = imageAssetIdentifier, - Image = image, - Imagename = imagename, - ImageWeight = imageWeight, - NegativePrompt = negativePrompt, - Seed = seed, - Resolution = resolution, - AspectRatio = aspectRatio, - RenderingSpeed = renderingSpeed, - MagicPrompt = magicPrompt, - NumImages = numImages, - ColorPalette = colorPalette, - StyleCodes = styleCodes, - StyleType = styleType, - StylePreset = stylePreset, - StyleReferenceCollectionId = styleReferenceCollectionId, - StyleReferenceCollectionVersionId = styleReferenceCollectionVersionId, - StyleReferenceAssetIdentifiers = styleReferenceAssetIdentifiers, - StyleReferenceImages = styleReferenceImages, - EnableCopyrightDetection = enableCopyrightDetection, - Async = async, - WebhookUrl = webhookUrl, - Private = @private, - TargetCollectionId = targetCollectionId, - }; - - return await PostRemixImageV2IdeogramV3Async( - dryRun: dryRun, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesRemixClient.PostRemixImageV2IdeogramV3Character.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesRemixClient.PostRemixImageV2IdeogramV3Character.g.cs deleted file mode 100644 index 8be2fced..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ImagesRemixClient.PostRemixImageV2IdeogramV3Character.g.cs +++ /dev/null @@ -1,1221 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ImagesRemixClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostRemixImageV2IdeogramV3CharacterSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostRemixImageV2IdeogramV3CharacterSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostRemixImageV2IdeogramV3CharacterSecurityRequirement0, - }; - partial void PreparePostRemixImageV2IdeogramV3CharacterArguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? dryRun, - global::Ideogram.RemixImageIdeogramV3CharacterRequest request); - partial void PreparePostRemixImageV2IdeogramV3CharacterRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? dryRun, - global::Ideogram.RemixImageIdeogramV3CharacterRequest request); - partial void ProcessPostRemixImageV2IdeogramV3CharacterResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostRemixImageV2IdeogramV3CharacterResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Remix a consistent character with Ideogram 3.0
- /// Transform an existing image with Ideogram 3.0 so it features a
- /// consistent character, guided by a text prompt. Upload the source
- /// `image` and a `character_reference_images` image (or use a saved
- /// character) using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostRemixImageV2IdeogramV3CharacterAsync( - - global::Ideogram.RemixImageIdeogramV3CharacterRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostRemixImageV2IdeogramV3CharacterAsResponseAsync( - - request: request, - dryRun: dryRun, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Remix a consistent character with Ideogram 3.0
- /// Transform an existing image with Ideogram 3.0 so it features a
- /// consistent character, guided by a text prompt. Upload the source
- /// `image` and a `character_reference_images` image (or use a saved
- /// character) using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostRemixImageV2IdeogramV3CharacterAsResponseAsync( - - global::Ideogram.RemixImageIdeogramV3CharacterRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostRemixImageV2IdeogramV3CharacterArguments( - httpClient: HttpClient, - dryRun: ref dryRun, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostRemixImageV2IdeogramV3CharacterSecurityRequirements, - operationName: "PostRemixImageV2IdeogramV3CharacterAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/image/remix/ideogram-3-character", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - if (request.ImageAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ImageAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"image_asset_identifier\""); - - } - if (request.Image != default) - { - - var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.ImageWeight != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.ImageWeight, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"image_weight\""); - - } - if (request.NegativePrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.NegativePrompt ?? string.Empty), - name: "\"negative_prompt\""); - - } - if (request.CharacterReferenceCollectionId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.CharacterReferenceCollectionId ?? string.Empty), - name: "\"character_reference_collection_id\""); - - } - if (request.CharacterReferenceCollectionVersionId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.CharacterReferenceCollectionVersionId ?? string.Empty), - name: "\"character_reference_collection_version_id\""); - - } - if (request.CharacterReferenceAssetIdentifiers != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.CharacterReferenceAssetIdentifiers!, x => x.ToJson(JsonSerializerContext)))}]"), - name: "\"character_reference_asset_identifiers\""); - - } - if (request.CharacterReferenceImages != default) - { - - for (var __iCharacterReferenceImages = 0; __iCharacterReferenceImages < request.CharacterReferenceImages.Count; __iCharacterReferenceImages++) - { - var __contentCharacterReferenceImages = new global::System.Net.Http.ByteArrayContent(request.CharacterReferenceImages[__iCharacterReferenceImages]); - __contentCharacterReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); - __httpRequestContent.Add( - content: __contentCharacterReferenceImages, - name: "\"character_reference_images\"", - fileName: $"\"file{__iCharacterReferenceImages}.bin\""); - if (__contentCharacterReferenceImages.Headers.ContentDisposition != null) - { - __contentCharacterReferenceImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - if (request.CharacterReferenceMaskAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.CharacterReferenceMaskAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"character_reference_mask_asset_identifier\""); - - } - if (request.CharacterReferenceMask != default) - { - - var __contentCharacterReferenceMask = new global::System.Net.Http.ByteArrayContent(request.CharacterReferenceMask ?? global::System.Array.Empty()); - __contentCharacterReferenceMask.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.CharacterReferenceMaskname is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.CharacterReferenceMaskname) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentCharacterReferenceMask, - name: "\"character_reference_mask\"", - fileName: request.CharacterReferenceMaskname != null ? $"\"{request.CharacterReferenceMaskname}\"" : string.Empty); - if (__contentCharacterReferenceMask.Headers.ContentDisposition != null) - { - __contentCharacterReferenceMask.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.Resolution != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"resolution\""); - - } - if (request.AspectRatio != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.AspectRatio).HasValue ? (request.AspectRatio).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"aspect_ratio\""); - - } - if (request.RenderingSpeed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"rendering_speed\""); - - } - if (request.MagicPrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.MagicPrompt).HasValue ? (request.MagicPrompt).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"magic_prompt\""); - - } - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.StyleType != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.StyleType).HasValue ? (request.StyleType).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"style_type\""); - - } - if (request.StyleReferenceCollectionId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.StyleReferenceCollectionId ?? string.Empty), - name: "\"style_reference_collection_id\""); - - } - if (request.StyleReferenceCollectionVersionId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.StyleReferenceCollectionVersionId ?? string.Empty), - name: "\"style_reference_collection_version_id\""); - - } - if (request.StyleReferenceAssetIdentifiers != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.StyleReferenceAssetIdentifiers!, x => x.ToJson(JsonSerializerContext)))}]"), - name: "\"style_reference_asset_identifiers\""); - - } - if (request.StyleReferenceImages != default) - { - - for (var __iStyleReferenceImages = 0; __iStyleReferenceImages < request.StyleReferenceImages.Count; __iStyleReferenceImages++) - { - var __contentStyleReferenceImages = new global::System.Net.Http.ByteArrayContent(request.StyleReferenceImages[__iStyleReferenceImages]); - __contentStyleReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); - __httpRequestContent.Add( - content: __contentStyleReferenceImages, - name: "\"style_reference_images\"", - fileName: $"\"file{__iStyleReferenceImages}.bin\""); - if (__contentStyleReferenceImages.Headers.ContentDisposition != null) - { - __contentStyleReferenceImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - if (request.EnableCopyrightDetection != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"enable_copyright_detection\""); - - } - if (request.Async != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"async\""); - - } - if (request.WebhookUrl != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), - name: "\"webhook_url\""); - - } - if (request.Private != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"private\""); - - } - if (request.TargetCollectionId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.TargetCollectionId ?? string.Empty), - name: "\"target_collection_id\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostRemixImageV2IdeogramV3CharacterRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - dryRun: dryRun, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImageV2IdeogramV3Character", - methodName: "PostRemixImageV2IdeogramV3CharacterAsync", - pathTemplate: "\"/v2/image/remix/ideogram-3-character\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImageV2IdeogramV3Character", - methodName: "PostRemixImageV2IdeogramV3CharacterAsync", - pathTemplate: "\"/v2/image/remix/ideogram-3-character\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImageV2IdeogramV3Character", - methodName: "PostRemixImageV2IdeogramV3CharacterAsync", - pathTemplate: "\"/v2/image/remix/ideogram-3-character\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostRemixImageV2IdeogramV3CharacterResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImageV2IdeogramV3Character", - methodName: "PostRemixImageV2IdeogramV3CharacterAsync", - pathTemplate: "\"/v2/image/remix/ideogram-3-character\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImageV2IdeogramV3Character", - methodName: "PostRemixImageV2IdeogramV3CharacterAsync", - pathTemplate: "\"/v2/image/remix/ideogram-3-character\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 500) - { - string? __content_500 = null; - global::System.Exception? __exception_500 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_500 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_500, - responseBody: __content_500, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostRemixImageV2IdeogramV3CharacterResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.RemixImageIdeogramV3CharacterResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.RemixImageIdeogramV3CharacterResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Remix a consistent character with Ideogram 3.0
- /// Transform an existing image with Ideogram 3.0 so it features a
- /// consistent character, guided by a text prompt. Upload the source
- /// `image` and a `character_reference_images` image (or use a saved
- /// character) using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// The prompt that guides the remix. - /// - /// - /// The existing upload or generated image to transform. Supply this or `image`, never both. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. - /// - /// - /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. - /// - /// - /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. - /// - /// - /// Optional. How closely the result should follow the source image, from 1 to 100. When omitted the server chooses a value from your prompt, which is the usual case. - /// - /// - /// Description of what to exclude from the images. Descriptions in the prompt take precedence over descriptions in the negative prompt. - /// - /// - /// A saved character to feature, by its URL-safe base64 collection id. Takes priority over `character_reference_images` if both are supplied. - /// - /// - /// Optional URL-safe base64 version id pinning a specific version of the `character_reference_collection_id` collection. Ignored without it. - /// - /// - /// An existing upload or generated image asset to use as the character reference, by reference. Takes priority over `character_reference_images` if both are supplied. - /// - /// - /// An image to use as the character reference (max 25MB). JPEG, PNG, and WEBP are supported. - /// - /// - /// An existing upload or generated image asset to use as the character reference mask, by reference. The same rules as `character_reference_mask` apply. Takes priority over `character_reference_mask` if both are supplied. - /// - /// - /// Optional grayscale mask for the character reference image, the same size as that image, marking where the character is. Only JPEG, PNG, and WEBP formats are supported. Multipart requests only; cannot be combined with `character_reference_collection_id`. - /// - /// - /// Optional grayscale mask for the character reference image, the same size as that image, marking where the character is. Only JPEG, PNG, and WEBP formats are supported. Multipart requests only; cannot be combined with `character_reference_collection_id`. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The resolutions supported for Ideogram 3.0.
- /// Example: 1280x800 - /// - /// - /// Output aspect ratio. Cannot be combined with resolution. Generation defaults to 1x1; remix keeps the source ratio when both fields are omitted. - /// - /// - /// The rendering speed to use.
- /// Default Value: default - /// - /// - /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
- /// Default Value: auto - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// The style type to remix the character with. Defaults to `auto`.
- /// Default Value: auto - /// - /// - /// A saved style to apply, by its URL-safe base64 collection id. Takes priority over `style_reference_images` if both are supplied. - /// - /// - /// Optional URL-safe base64 version id pinning a specific version of the `style_reference_collection_id` collection. Ignored without it. - /// - /// - /// Existing upload or generated image assets to use as style references, by reference. Takes priority over `style_reference_images` if both are supplied. - /// - /// - /// Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported. - /// - /// - /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. - /// - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostRemixImageV2IdeogramV3CharacterAsync( - string prompt, - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - int? imageWeight = default, - string? negativePrompt = default, - string? characterReferenceCollectionId = default, - string? characterReferenceCollectionVersionId = default, - global::System.Collections.Generic.IList? characterReferenceAssetIdentifiers = default, - global::System.Collections.Generic.IList? characterReferenceImages = default, - global::Ideogram.AssetIdentifier? characterReferenceMaskAssetIdentifier = default, - byte[]? characterReferenceMask = default, - string? characterReferenceMaskname = default, - int? seed = default, - global::Ideogram.ResolutionV3? resolution = default, - global::Ideogram.AspectRatioV3? aspectRatio = default, - global::Ideogram.RemixImageIdeogramV3CharacterRequestRenderingSpeed? renderingSpeed = default, - global::Ideogram.MagicPromptMode? magicPrompt = default, - int? numImages = default, - global::Ideogram.RemixImageIdeogramV3CharacterRequestStyleType? styleType = default, - string? styleReferenceCollectionId = default, - string? styleReferenceCollectionVersionId = default, - global::System.Collections.Generic.IList? styleReferenceAssetIdentifiers = default, - global::System.Collections.Generic.IList? styleReferenceImages = default, - bool? enableCopyrightDetection = default, - bool? async = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.RemixImageIdeogramV3CharacterRequest - { - Prompt = prompt, - ImageAssetIdentifier = imageAssetIdentifier, - Image = image, - Imagename = imagename, - ImageWeight = imageWeight, - NegativePrompt = negativePrompt, - CharacterReferenceCollectionId = characterReferenceCollectionId, - CharacterReferenceCollectionVersionId = characterReferenceCollectionVersionId, - CharacterReferenceAssetIdentifiers = characterReferenceAssetIdentifiers, - CharacterReferenceImages = characterReferenceImages, - CharacterReferenceMaskAssetIdentifier = characterReferenceMaskAssetIdentifier, - CharacterReferenceMask = characterReferenceMask, - CharacterReferenceMaskname = characterReferenceMaskname, - Seed = seed, - Resolution = resolution, - AspectRatio = aspectRatio, - RenderingSpeed = renderingSpeed, - MagicPrompt = magicPrompt, - NumImages = numImages, - StyleType = styleType, - StyleReferenceCollectionId = styleReferenceCollectionId, - StyleReferenceCollectionVersionId = styleReferenceCollectionVersionId, - StyleReferenceAssetIdentifiers = styleReferenceAssetIdentifiers, - StyleReferenceImages = styleReferenceImages, - EnableCopyrightDetection = enableCopyrightDetection, - Async = async, - WebhookUrl = webhookUrl, - Private = @private, - TargetCollectionId = targetCollectionId, - }; - - return await PostRemixImageV2IdeogramV3CharacterAsync( - dryRun: dryRun, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesRemixClient.PostRemixImageV2IdeogramV3CustomModel.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesRemixClient.PostRemixImageV2IdeogramV3CustomModel.g.cs deleted file mode 100644 index 5c865c86..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ImagesRemixClient.PostRemixImageV2IdeogramV3CustomModel.g.cs +++ /dev/null @@ -1,1132 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ImagesRemixClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostRemixImageV2IdeogramV3CustomModelSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostRemixImageV2IdeogramV3CustomModelSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostRemixImageV2IdeogramV3CustomModelSecurityRequirement0, - }; - partial void PreparePostRemixImageV2IdeogramV3CustomModelArguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? dryRun, - global::Ideogram.RemixImageIdeogramV3CustomModelRequest request); - partial void PreparePostRemixImageV2IdeogramV3CustomModelRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? dryRun, - global::Ideogram.RemixImageIdeogramV3CustomModelRequest request); - partial void ProcessPostRemixImageV2IdeogramV3CustomModelResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostRemixImageV2IdeogramV3CustomModelResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Remix with a custom Ideogram 3.0 model
- /// Transform an existing image with a custom Ideogram 3.0 model that your
- /// user or organization can access, guided by a text prompt. Upload the
- /// source `image` using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostRemixImageV2IdeogramV3CustomModelAsync( - - global::Ideogram.RemixImageIdeogramV3CustomModelRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostRemixImageV2IdeogramV3CustomModelAsResponseAsync( - - request: request, - dryRun: dryRun, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Remix with a custom Ideogram 3.0 model
- /// Transform an existing image with a custom Ideogram 3.0 model that your
- /// user or organization can access, guided by a text prompt. Upload the
- /// source `image` using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostRemixImageV2IdeogramV3CustomModelAsResponseAsync( - - global::Ideogram.RemixImageIdeogramV3CustomModelRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostRemixImageV2IdeogramV3CustomModelArguments( - httpClient: HttpClient, - dryRun: ref dryRun, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostRemixImageV2IdeogramV3CustomModelSecurityRequirements, - operationName: "PostRemixImageV2IdeogramV3CustomModelAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/image/remix/ideogram-3-custom-model", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.CustomModelUri ?? string.Empty), - name: "\"custom_model_uri\""); - - if (request.ImageAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ImageAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"image_asset_identifier\""); - - } - if (request.Image != default) - { - - var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.ImageWeight != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.ImageWeight, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"image_weight\""); - - } - if (request.NegativePrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.NegativePrompt ?? string.Empty), - name: "\"negative_prompt\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.Resolution != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"resolution\""); - - } - if (request.AspectRatio != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.AspectRatio).HasValue ? (request.AspectRatio).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"aspect_ratio\""); - - } - if (request.RenderingSpeed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"rendering_speed\""); - - } - if (request.MagicPrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.MagicPrompt).HasValue ? (request.MagicPrompt).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"magic_prompt\""); - - } - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.ColorPalette != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ColorPalette.ToString() ?? string.Empty), - name: "\"color_palette\""); - - } - if (request.StyleCodes != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.StyleCodes!, x => x))}]"), - name: "\"style_codes\""); - - } - if (request.StylePreset != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.StylePreset).HasValue ? (request.StylePreset).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"style_preset\""); - - } - if (request.StyleReferenceAssetIdentifiers != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.StyleReferenceAssetIdentifiers!, x => x.ToJson(JsonSerializerContext)))}]"), - name: "\"style_reference_asset_identifiers\""); - - } - if (request.StyleReferenceImages != default) - { - - for (var __iStyleReferenceImages = 0; __iStyleReferenceImages < request.StyleReferenceImages.Count; __iStyleReferenceImages++) - { - var __contentStyleReferenceImages = new global::System.Net.Http.ByteArrayContent(request.StyleReferenceImages[__iStyleReferenceImages]); - __contentStyleReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); - __httpRequestContent.Add( - content: __contentStyleReferenceImages, - name: "\"style_reference_images\"", - fileName: $"\"file{__iStyleReferenceImages}.bin\""); - if (__contentStyleReferenceImages.Headers.ContentDisposition != null) - { - __contentStyleReferenceImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - if (request.EnableCopyrightDetection != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"enable_copyright_detection\""); - - } - if (request.Async != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"async\""); - - } - if (request.WebhookUrl != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), - name: "\"webhook_url\""); - - } - if (request.Private != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"private\""); - - } - if (request.TargetCollectionId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.TargetCollectionId ?? string.Empty), - name: "\"target_collection_id\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostRemixImageV2IdeogramV3CustomModelRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - dryRun: dryRun, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImageV2IdeogramV3CustomModel", - methodName: "PostRemixImageV2IdeogramV3CustomModelAsync", - pathTemplate: "\"/v2/image/remix/ideogram-3-custom-model\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImageV2IdeogramV3CustomModel", - methodName: "PostRemixImageV2IdeogramV3CustomModelAsync", - pathTemplate: "\"/v2/image/remix/ideogram-3-custom-model\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImageV2IdeogramV3CustomModel", - methodName: "PostRemixImageV2IdeogramV3CustomModelAsync", - pathTemplate: "\"/v2/image/remix/ideogram-3-custom-model\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostRemixImageV2IdeogramV3CustomModelResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImageV2IdeogramV3CustomModel", - methodName: "PostRemixImageV2IdeogramV3CustomModelAsync", - pathTemplate: "\"/v2/image/remix/ideogram-3-custom-model\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImageV2IdeogramV3CustomModel", - methodName: "PostRemixImageV2IdeogramV3CustomModelAsync", - pathTemplate: "\"/v2/image/remix/ideogram-3-custom-model\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 500) - { - string? __content_500 = null; - global::System.Exception? __exception_500 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_500 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_500, - responseBody: __content_500, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostRemixImageV2IdeogramV3CustomModelResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.RemixImageIdeogramV3CustomModelResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.RemixImageIdeogramV3CustomModelResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Remix with a custom Ideogram 3.0 model
- /// Transform an existing image with a custom Ideogram 3.0 model that your
- /// user or organization can access, guided by a text prompt. Upload the
- /// source `image` using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// The prompt that guides the remix. - /// - /// - /// The custom model URI returned by the custom-model API, in the form `model/<model_name>/version/<version_name>`. The authenticated user or organization must have access to the model.
- /// Example: model/my-custom-model/version/1 - /// - /// - /// The existing upload or generated image to transform. Supply this or `image`, never both. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. - /// - /// - /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. - /// - /// - /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. - /// - /// - /// Optional. How closely the result should follow the source image, from 1 to 100. When omitted the server chooses a value from your prompt, which is the usual case. - /// - /// - /// Description of what to exclude from the images. Descriptions in the prompt take precedence over descriptions in the negative prompt. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The resolutions supported for Ideogram 3.0.
- /// Example: 1280x800 - /// - /// - /// Output aspect ratio. Cannot be combined with resolution. Generation defaults to 1x1; remix keeps the source ratio when both fields are omitted. - /// - /// - /// The rendering speed to use. When omitted, the server chooses a speed supported by the selected custom model. - /// - /// - /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
- /// Default Value: auto - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). - /// - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - /// - /// - /// A predefined style preset to apply to the remixed images. Cannot be combined with style codes or style references. - /// - /// - /// Existing upload or generated image assets to use as style references, by reference. Takes priority over `style_reference_images` if both are supplied. - /// - /// - /// Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported. Multipart requests only. - /// - /// - /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. - /// - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostRemixImageV2IdeogramV3CustomModelAsync( - string prompt, - string customModelUri, - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - int? imageWeight = default, - string? negativePrompt = default, - int? seed = default, - global::Ideogram.ResolutionV3? resolution = default, - global::Ideogram.AspectRatioV3? aspectRatio = default, - global::Ideogram.RemixImageIdeogramV3CustomModelRequestRenderingSpeed? renderingSpeed = default, - global::Ideogram.MagicPromptMode? magicPrompt = default, - int? numImages = default, - global::Ideogram.IdeogramColorPalette? colorPalette = default, - global::System.Collections.Generic.IList? styleCodes = default, - global::Ideogram.IdeogramV3StylePreset? stylePreset = default, - global::System.Collections.Generic.IList? styleReferenceAssetIdentifiers = default, - global::System.Collections.Generic.IList? styleReferenceImages = default, - bool? enableCopyrightDetection = default, - bool? async = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.RemixImageIdeogramV3CustomModelRequest - { - Prompt = prompt, - CustomModelUri = customModelUri, - ImageAssetIdentifier = imageAssetIdentifier, - Image = image, - Imagename = imagename, - ImageWeight = imageWeight, - NegativePrompt = negativePrompt, - Seed = seed, - Resolution = resolution, - AspectRatio = aspectRatio, - RenderingSpeed = renderingSpeed, - MagicPrompt = magicPrompt, - NumImages = numImages, - ColorPalette = colorPalette, - StyleCodes = styleCodes, - StylePreset = stylePreset, - StyleReferenceAssetIdentifiers = styleReferenceAssetIdentifiers, - StyleReferenceImages = styleReferenceImages, - EnableCopyrightDetection = enableCopyrightDetection, - Async = async, - WebhookUrl = webhookUrl, - Private = @private, - TargetCollectionId = targetCollectionId, - }; - - return await PostRemixImageV2IdeogramV3CustomModelAsync( - dryRun: dryRun, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesRemixClient.PostRemixImageV2IdeogramV4.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesRemixClient.PostRemixImageV2IdeogramV4.g.cs deleted file mode 100644 index a193f04b..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ImagesRemixClient.PostRemixImageV2IdeogramV4.g.cs +++ /dev/null @@ -1,960 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ImagesRemixClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostRemixImageV2IdeogramV4SecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostRemixImageV2IdeogramV4SecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostRemixImageV2IdeogramV4SecurityRequirement0, - }; - partial void PreparePostRemixImageV2IdeogramV4Arguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? dryRun, - global::Ideogram.RemixImageIdeogramV4Request request); - partial void PreparePostRemixImageV2IdeogramV4Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? dryRun, - global::Ideogram.RemixImageIdeogramV4Request request); - partial void ProcessPostRemixImageV2IdeogramV4Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostRemixImageV2IdeogramV4ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Remix with Ideogram 4.0
- /// Transform an existing image with Ideogram 4.0, guided by a text
- /// prompt. Upload the source `image` using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostRemixImageV2IdeogramV4Async( - - global::Ideogram.RemixImageIdeogramV4Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostRemixImageV2IdeogramV4AsResponseAsync( - - request: request, - dryRun: dryRun, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Remix with Ideogram 4.0
- /// Transform an existing image with Ideogram 4.0, guided by a text
- /// prompt. Upload the source `image` using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostRemixImageV2IdeogramV4AsResponseAsync( - - global::Ideogram.RemixImageIdeogramV4Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostRemixImageV2IdeogramV4Arguments( - httpClient: HttpClient, - dryRun: ref dryRun, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostRemixImageV2IdeogramV4SecurityRequirements, - operationName: "PostRemixImageV2IdeogramV4Async"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/image/remix/ideogram-4", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - if (request.ImageAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ImageAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"image_asset_identifier\""); - - } - if (request.Image != default) - { - - var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.ImageWeight != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.ImageWeight, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"image_weight\""); - - } - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.Resolution != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"resolution\""); - - } - if (request.RenderingSpeed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"rendering_speed\""); - - } - if (request.EnableCopyrightDetection != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.EnableCopyrightDetection, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"enable_copyright_detection\""); - - } - if (request.Async != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"async\""); - - } - if (request.WebhookUrl != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), - name: "\"webhook_url\""); - - } - if (request.Private != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"private\""); - - } - if (request.TargetCollectionId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.TargetCollectionId ?? string.Empty), - name: "\"target_collection_id\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostRemixImageV2IdeogramV4Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - dryRun: dryRun, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImageV2IdeogramV4", - methodName: "PostRemixImageV2IdeogramV4Async", - pathTemplate: "\"/v2/image/remix/ideogram-4\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImageV2IdeogramV4", - methodName: "PostRemixImageV2IdeogramV4Async", - pathTemplate: "\"/v2/image/remix/ideogram-4\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImageV2IdeogramV4", - methodName: "PostRemixImageV2IdeogramV4Async", - pathTemplate: "\"/v2/image/remix/ideogram-4\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostRemixImageV2IdeogramV4Response( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImageV2IdeogramV4", - methodName: "PostRemixImageV2IdeogramV4Async", - pathTemplate: "\"/v2/image/remix/ideogram-4\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemixImageV2IdeogramV4", - methodName: "PostRemixImageV2IdeogramV4Async", - pathTemplate: "\"/v2/image/remix/ideogram-4\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 500) - { - string? __content_500 = null; - global::System.Exception? __exception_500 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_500 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_500, - responseBody: __content_500, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostRemixImageV2IdeogramV4ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.RemixImageIdeogramV4Response.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.RemixImageIdeogramV4Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Remix with Ideogram 4.0
- /// Transform an existing image with Ideogram 4.0, guided by a text
- /// prompt. Upload the source `image` using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// The prompt that guides the remix. It is always read as an editing instruction, so there is no `magic_prompt` option. - /// - /// - /// The existing upload or generated image to transform. Supply this or `image`, never both. Omit `resolution` to keep its shape. - /// - /// - /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` to keep its shape. - /// - /// - /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` to keep its shape. - /// - /// - /// Optional. How closely the result should follow the source image, from 1 to 100. When omitted the server chooses a value from your prompt, which is the usual case. Only accepted when the output keeps the source image's shape: combining `image_weight` with a `resolution` whose aspect ratio differs from the source's is rejected with a 400. - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Optional. When supplied, the images are generated at this
- /// resolution. When omitted, the source image's shape is kept. A
- /// resolution whose aspect ratio differs from the source's cannot
- /// be combined with `image_weight`. - /// - /// - /// The rendering speed to use.
- /// Default Value: default - /// - /// - /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. - /// - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostRemixImageV2IdeogramV4Async( - string prompt, - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - int? imageWeight = default, - int? numImages = default, - global::Ideogram.ResolutionV4? resolution = default, - global::Ideogram.RemixImageIdeogramV4RequestRenderingSpeed? renderingSpeed = default, - bool? enableCopyrightDetection = default, - bool? async = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.RemixImageIdeogramV4Request - { - Prompt = prompt, - ImageAssetIdentifier = imageAssetIdentifier, - Image = image, - Imagename = imagename, - ImageWeight = imageWeight, - NumImages = numImages, - Resolution = resolution, - RenderingSpeed = renderingSpeed, - EnableCopyrightDetection = enableCopyrightDetection, - Async = async, - WebhookUrl = webhookUrl, - Private = @private, - TargetCollectionId = targetCollectionId, - }; - - return await PostRemixImageV2IdeogramV4Async( - dryRun: dryRun, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesRemixClient.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesRemixClient.g.cs index a475837f..22f1200e 100644 --- a/src/libs/Ideogram/Generated/Ideogram.ImagesRemixClient.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.ImagesRemixClient.g.cs @@ -4,7 +4,6 @@ namespace Ideogram { /// - /// Transform an image with a specific model, guided by a prompt.
/// If no httpClient is provided, a new one will be created.
/// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. ///
diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesUpscale.JsonSerializerContext.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesUpscale.JsonSerializerContext.g.cs index e45a3f29..fbb13d2b 100644 --- a/src/libs/Ideogram/Generated/Ideogram.ImagesUpscale.JsonSerializerContext.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.ImagesUpscale.JsonSerializerContext.g.cs @@ -14,55 +14,51 @@ namespace Ideogram [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(byte[]))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(float))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AssetIdentifier))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationErrorResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationRejectReason), TypeInfoPropertyName = "GenerationRejectReason2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed), TypeInfoPropertyName = "GenerationErrorResponseTaskCompletionSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageTopazTextRefineResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationErrorResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageObject))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageTopazTextRefineRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageTopazTextRefineRequestUpscaleFactor), TypeInfoPropertyName = "UpscaleImageTopazTextRefineRequestUpscaleFactor2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageTopazTextRefineRequestSubjectDetection), TypeInfoPropertyName = "UpscaleImageTopazTextRefineRequestSubjectDetection2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageTopazWonder35Response))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageTopazWonder35Request))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageTopazWonder35RequestUpscaleFactor), TypeInfoPropertyName = "UpscaleImageTopazWonder35RequestUpscaleFactor2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageTopazWonder35RequestEnhancementStrength), TypeInfoPropertyName = "UpscaleImageTopazWonder35RequestEnhancementStrength2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageTopazStandardV2Response))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageTopazStandardV2Request))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageTopazStandardV2RequestUpscaleFactor), TypeInfoPropertyName = "UpscaleImageTopazStandardV2RequestUpscaleFactor2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageTopazStandardV2RequestSubjectDetection), TypeInfoPropertyName = "UpscaleImageTopazStandardV2RequestSubjectDetection2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageUpscaleNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier), TypeInfoPropertyName = "V2ImageUpscaleNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageNanoBananaProResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageUpscaleTopazBloom2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor), TypeInfoPropertyName = "V2ImageUpscaleTopazBloom2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageTopazBloom2Response))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageTopazBloom2Request))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageTopazBloom2RequestUpscaleFactor), TypeInfoPropertyName = "UpscaleImageTopazBloom2RequestUpscaleFactor2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor), TypeInfoPropertyName = "V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection), TypeInfoPropertyName = "V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageTopazRedefineResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageTopazRedefineRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageTopazRedefineRequestUpscaleFactor), TypeInfoPropertyName = "UpscaleImageTopazRedefineRequestUpscaleFactor2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageTopazRedefineRequestSubjectDetection), TypeInfoPropertyName = "UpscaleImageTopazRedefineRequestSubjectDetection2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageNanoBananaProResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageNanoBananaProRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageNanoBananaProRequestResolutionTier), TypeInfoPropertyName = "UpscaleImageNanoBananaProRequestResolutionTier2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AssetType), TypeInfoPropertyName = "AssetType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor), TypeInfoPropertyName = "V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaSubjectDetection), TypeInfoPropertyName = "V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaSubjectDetection2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageTopazStandardV2Response))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor), TypeInfoPropertyName = "V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection), TypeInfoPropertyName = "V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageTopazTextRefineResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor), TypeInfoPropertyName = "V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaEnhancementStrength), TypeInfoPropertyName = "V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaEnhancementStrength2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageTopazWonder35Response))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(byte[]))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImagesUpscalePostUpscaleImageNanoBananaProRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazBloom2Request))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazRedefineRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazStandardV2Request))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazTextRefineRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazWonder35Request))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(float?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationRejectReason?), TypeInfoPropertyName = "NullableGenerationRejectReason2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?), TypeInfoPropertyName = "NullableGenerationErrorResponseTaskCompletionSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageTopazTextRefineRequestUpscaleFactor?), TypeInfoPropertyName = "NullableUpscaleImageTopazTextRefineRequestUpscaleFactor2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageTopazTextRefineRequestSubjectDetection?), TypeInfoPropertyName = "NullableUpscaleImageTopazTextRefineRequestSubjectDetection2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageTopazWonder35RequestUpscaleFactor?), TypeInfoPropertyName = "NullableUpscaleImageTopazWonder35RequestUpscaleFactor2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageTopazWonder35RequestEnhancementStrength?), TypeInfoPropertyName = "NullableUpscaleImageTopazWonder35RequestEnhancementStrength2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageTopazStandardV2RequestUpscaleFactor?), TypeInfoPropertyName = "NullableUpscaleImageTopazStandardV2RequestUpscaleFactor2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageTopazStandardV2RequestSubjectDetection?), TypeInfoPropertyName = "NullableUpscaleImageTopazStandardV2RequestSubjectDetection2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageTopazBloom2RequestUpscaleFactor?), TypeInfoPropertyName = "NullableUpscaleImageTopazBloom2RequestUpscaleFactor2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageTopazRedefineRequestUpscaleFactor?), TypeInfoPropertyName = "NullableUpscaleImageTopazRedefineRequestUpscaleFactor2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageTopazRedefineRequestSubjectDetection?), TypeInfoPropertyName = "NullableUpscaleImageTopazRedefineRequestSubjectDetection2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageNanoBananaProRequestResolutionTier?), TypeInfoPropertyName = "NullableUpscaleImageNanoBananaProRequestResolutionTier2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AssetType?), TypeInfoPropertyName = "NullableAssetType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageUpscaleNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier?), TypeInfoPropertyName = "NullableV2ImageUpscaleNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageUpscaleTopazBloom2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor?), TypeInfoPropertyName = "NullableV2ImageUpscaleTopazBloom2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor?), TypeInfoPropertyName = "NullableV2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection?), TypeInfoPropertyName = "NullableV2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor?), TypeInfoPropertyName = "NullableV2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaSubjectDetection?), TypeInfoPropertyName = "NullableV2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaSubjectDetection2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor?), TypeInfoPropertyName = "NullableV2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection?), TypeInfoPropertyName = "NullableV2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor?), TypeInfoPropertyName = "NullableV2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaEnhancementStrength?), TypeInfoPropertyName = "NullableV2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaEnhancementStrength2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] internal sealed partial class ImagesUpscaleSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext { @@ -133,73 +129,59 @@ private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Ser public override bool CanConvert(global::System.Type typeToConvert) { return - typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed) - - || typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?) - - || typeToConvert == typeof(global::Ideogram.GenerationRejectReason) + typeToConvert == typeof(global::Ideogram.GenerationRejectReason) || typeToConvert == typeof(global::Ideogram.GenerationRejectReason?) - || typeToConvert == typeof(global::Ideogram.UpscaleImageTopazTextRefineRequestUpscaleFactor) + || typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed) - || typeToConvert == typeof(global::Ideogram.UpscaleImageTopazTextRefineRequestUpscaleFactor?) + || typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?) - || typeToConvert == typeof(global::Ideogram.UpscaleImageTopazTextRefineRequestSubjectDetection) + || typeToConvert == typeof(global::Ideogram.V2ImageUpscaleNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier) - || typeToConvert == typeof(global::Ideogram.UpscaleImageTopazTextRefineRequestSubjectDetection?) + || typeToConvert == typeof(global::Ideogram.V2ImageUpscaleNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier?) - || typeToConvert == typeof(global::Ideogram.UpscaleImageTopazWonder35RequestUpscaleFactor) + || typeToConvert == typeof(global::Ideogram.V2ImageUpscaleTopazBloom2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor) - || typeToConvert == typeof(global::Ideogram.UpscaleImageTopazWonder35RequestUpscaleFactor?) + || typeToConvert == typeof(global::Ideogram.V2ImageUpscaleTopazBloom2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor?) - || typeToConvert == typeof(global::Ideogram.UpscaleImageTopazWonder35RequestEnhancementStrength) + || typeToConvert == typeof(global::Ideogram.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor) - || typeToConvert == typeof(global::Ideogram.UpscaleImageTopazWonder35RequestEnhancementStrength?) + || typeToConvert == typeof(global::Ideogram.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor?) - || typeToConvert == typeof(global::Ideogram.UpscaleImageTopazStandardV2RequestUpscaleFactor) + || typeToConvert == typeof(global::Ideogram.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection) - || typeToConvert == typeof(global::Ideogram.UpscaleImageTopazStandardV2RequestUpscaleFactor?) + || typeToConvert == typeof(global::Ideogram.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection?) - || typeToConvert == typeof(global::Ideogram.UpscaleImageTopazStandardV2RequestSubjectDetection) + || typeToConvert == typeof(global::Ideogram.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor) - || typeToConvert == typeof(global::Ideogram.UpscaleImageTopazStandardV2RequestSubjectDetection?) + || typeToConvert == typeof(global::Ideogram.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor?) - || typeToConvert == typeof(global::Ideogram.UpscaleImageTopazBloom2RequestUpscaleFactor) + || typeToConvert == typeof(global::Ideogram.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaSubjectDetection) - || typeToConvert == typeof(global::Ideogram.UpscaleImageTopazBloom2RequestUpscaleFactor?) + || typeToConvert == typeof(global::Ideogram.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaSubjectDetection?) - || typeToConvert == typeof(global::Ideogram.UpscaleImageTopazRedefineRequestUpscaleFactor) + || typeToConvert == typeof(global::Ideogram.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor) - || typeToConvert == typeof(global::Ideogram.UpscaleImageTopazRedefineRequestUpscaleFactor?) + || typeToConvert == typeof(global::Ideogram.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor?) - || typeToConvert == typeof(global::Ideogram.UpscaleImageTopazRedefineRequestSubjectDetection) + || typeToConvert == typeof(global::Ideogram.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection) - || typeToConvert == typeof(global::Ideogram.UpscaleImageTopazRedefineRequestSubjectDetection?) + || typeToConvert == typeof(global::Ideogram.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection?) - || typeToConvert == typeof(global::Ideogram.UpscaleImageNanoBananaProRequestResolutionTier) + || typeToConvert == typeof(global::Ideogram.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor) - || typeToConvert == typeof(global::Ideogram.UpscaleImageNanoBananaProRequestResolutionTier?) + || typeToConvert == typeof(global::Ideogram.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor?) - || typeToConvert == typeof(global::Ideogram.AssetType) + || typeToConvert == typeof(global::Ideogram.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaEnhancementStrength) - || typeToConvert == typeof(global::Ideogram.AssetType?); + || typeToConvert == typeof(global::Ideogram.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaEnhancementStrength?); } public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) { - if (typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed)) - { - return new global::Ideogram.JsonConverters.GenerationErrorResponseTaskCompletionSpeedJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?)) - { - return new global::Ideogram.JsonConverters.GenerationErrorResponseTaskCompletionSpeedNullableJsonConverter(); - } - if (typeToConvert == typeof(global::Ideogram.GenerationRejectReason)) { return new global::Ideogram.JsonConverters.GenerationRejectReasonJsonConverter(); @@ -210,114 +192,114 @@ public override bool CanConvert(global::System.Type typeToConvert) return new global::Ideogram.JsonConverters.GenerationRejectReasonNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.UpscaleImageTopazTextRefineRequestUpscaleFactor)) + if (typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed)) { - return new global::Ideogram.JsonConverters.UpscaleImageTopazTextRefineRequestUpscaleFactorJsonConverter(); + return new global::Ideogram.JsonConverters.GenerationErrorResponseTaskCompletionSpeedJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.UpscaleImageTopazTextRefineRequestUpscaleFactor?)) + if (typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?)) { - return new global::Ideogram.JsonConverters.UpscaleImageTopazTextRefineRequestUpscaleFactorNullableJsonConverter(); + return new global::Ideogram.JsonConverters.GenerationErrorResponseTaskCompletionSpeedNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.UpscaleImageTopazTextRefineRequestSubjectDetection)) + if (typeToConvert == typeof(global::Ideogram.V2ImageUpscaleNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier)) { - return new global::Ideogram.JsonConverters.UpscaleImageTopazTextRefineRequestSubjectDetectionJsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageUpscaleNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTierJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.UpscaleImageTopazTextRefineRequestSubjectDetection?)) + if (typeToConvert == typeof(global::Ideogram.V2ImageUpscaleNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier?)) { - return new global::Ideogram.JsonConverters.UpscaleImageTopazTextRefineRequestSubjectDetectionNullableJsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageUpscaleNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTierNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.UpscaleImageTopazWonder35RequestUpscaleFactor)) + if (typeToConvert == typeof(global::Ideogram.V2ImageUpscaleTopazBloom2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor)) { - return new global::Ideogram.JsonConverters.UpscaleImageTopazWonder35RequestUpscaleFactorJsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageUpscaleTopazBloom2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactorJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.UpscaleImageTopazWonder35RequestUpscaleFactor?)) + if (typeToConvert == typeof(global::Ideogram.V2ImageUpscaleTopazBloom2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor?)) { - return new global::Ideogram.JsonConverters.UpscaleImageTopazWonder35RequestUpscaleFactorNullableJsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageUpscaleTopazBloom2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactorNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.UpscaleImageTopazWonder35RequestEnhancementStrength)) + if (typeToConvert == typeof(global::Ideogram.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor)) { - return new global::Ideogram.JsonConverters.UpscaleImageTopazWonder35RequestEnhancementStrengthJsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactorJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.UpscaleImageTopazWonder35RequestEnhancementStrength?)) + if (typeToConvert == typeof(global::Ideogram.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor?)) { - return new global::Ideogram.JsonConverters.UpscaleImageTopazWonder35RequestEnhancementStrengthNullableJsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactorNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.UpscaleImageTopazStandardV2RequestUpscaleFactor)) + if (typeToConvert == typeof(global::Ideogram.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection)) { - return new global::Ideogram.JsonConverters.UpscaleImageTopazStandardV2RequestUpscaleFactorJsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetectionJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.UpscaleImageTopazStandardV2RequestUpscaleFactor?)) + if (typeToConvert == typeof(global::Ideogram.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection?)) { - return new global::Ideogram.JsonConverters.UpscaleImageTopazStandardV2RequestUpscaleFactorNullableJsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetectionNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.UpscaleImageTopazStandardV2RequestSubjectDetection)) + if (typeToConvert == typeof(global::Ideogram.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor)) { - return new global::Ideogram.JsonConverters.UpscaleImageTopazStandardV2RequestSubjectDetectionJsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactorJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.UpscaleImageTopazStandardV2RequestSubjectDetection?)) + if (typeToConvert == typeof(global::Ideogram.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor?)) { - return new global::Ideogram.JsonConverters.UpscaleImageTopazStandardV2RequestSubjectDetectionNullableJsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactorNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.UpscaleImageTopazBloom2RequestUpscaleFactor)) + if (typeToConvert == typeof(global::Ideogram.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaSubjectDetection)) { - return new global::Ideogram.JsonConverters.UpscaleImageTopazBloom2RequestUpscaleFactorJsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaSubjectDetectionJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.UpscaleImageTopazBloom2RequestUpscaleFactor?)) + if (typeToConvert == typeof(global::Ideogram.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaSubjectDetection?)) { - return new global::Ideogram.JsonConverters.UpscaleImageTopazBloom2RequestUpscaleFactorNullableJsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaSubjectDetectionNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.UpscaleImageTopazRedefineRequestUpscaleFactor)) + if (typeToConvert == typeof(global::Ideogram.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor)) { - return new global::Ideogram.JsonConverters.UpscaleImageTopazRedefineRequestUpscaleFactorJsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactorJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.UpscaleImageTopazRedefineRequestUpscaleFactor?)) + if (typeToConvert == typeof(global::Ideogram.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor?)) { - return new global::Ideogram.JsonConverters.UpscaleImageTopazRedefineRequestUpscaleFactorNullableJsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactorNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.UpscaleImageTopazRedefineRequestSubjectDetection)) + if (typeToConvert == typeof(global::Ideogram.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection)) { - return new global::Ideogram.JsonConverters.UpscaleImageTopazRedefineRequestSubjectDetectionJsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetectionJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.UpscaleImageTopazRedefineRequestSubjectDetection?)) + if (typeToConvert == typeof(global::Ideogram.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection?)) { - return new global::Ideogram.JsonConverters.UpscaleImageTopazRedefineRequestSubjectDetectionNullableJsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetectionNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.UpscaleImageNanoBananaProRequestResolutionTier)) + if (typeToConvert == typeof(global::Ideogram.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor)) { - return new global::Ideogram.JsonConverters.UpscaleImageNanoBananaProRequestResolutionTierJsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaUpscaleFactorJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.UpscaleImageNanoBananaProRequestResolutionTier?)) + if (typeToConvert == typeof(global::Ideogram.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor?)) { - return new global::Ideogram.JsonConverters.UpscaleImageNanoBananaProRequestResolutionTierNullableJsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaUpscaleFactorNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.AssetType)) + if (typeToConvert == typeof(global::Ideogram.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaEnhancementStrength)) { - return new global::Ideogram.JsonConverters.AssetTypeJsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaEnhancementStrengthJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.AssetType?)) + if (typeToConvert == typeof(global::Ideogram.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaEnhancementStrength?)) { - return new global::Ideogram.JsonConverters.AssetTypeNullableJsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaEnhancementStrengthNullableJsonConverter(); } throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); } diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesUpscaleClient.ImagesUpscalePostUpscaleImageNanoBananaPro.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesUpscaleClient.ImagesUpscalePostUpscaleImageNanoBananaPro.g.cs new file mode 100644 index 00000000..6f6ec76e --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.ImagesUpscaleClient.ImagesUpscalePostUpscaleImageNanoBananaPro.g.cs @@ -0,0 +1,2503 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class ImagesUpscaleClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_ImagesUpscalePostUpscaleImageNanoBananaProSecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_ImagesUpscalePostUpscaleImageNanoBananaProSecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_ImagesUpscalePostUpscaleImageNanoBananaProSecurityRequirement0, + }; + partial void PrepareImagesUpscalePostUpscaleImageNanoBananaProArguments( + global::System.Net.Http.HttpClient httpClient, + ref bool? dryRun, + global::Ideogram.ImagesUpscalePostUpscaleImageNanoBananaProRequest request); + partial void PrepareImagesUpscalePostUpscaleImageNanoBananaProRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + bool? dryRun, + global::Ideogram.ImagesUpscalePostUpscaleImageNanoBananaProRequest request); + partial void ProcessImagesUpscalePostUpscaleImageNanoBananaProResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessImagesUpscalePostUpscaleImageNanoBananaProResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Upscale with Nano Banana Pro
+ /// Regenerate an image at a higher `resolution_tier` (1K, 2K, or 4K) while
+ /// preserving its content, composition, and style. Upload the source
+ /// `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesUpscalePostUpscaleImageNanoBananaProAsync( + + global::Ideogram.ImagesUpscalePostUpscaleImageNanoBananaProRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ImagesUpscalePostUpscaleImageNanoBananaProAsResponseAsync( + + request: request, + dryRun: dryRun, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Upscale with Nano Banana Pro
+ /// Regenerate an image at a higher `resolution_tier` (1K, 2K, or 4K) while
+ /// preserving its content, composition, and style. Upload the source
+ /// `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ImagesUpscalePostUpscaleImageNanoBananaProAsResponseAsync( + + global::Ideogram.ImagesUpscalePostUpscaleImageNanoBananaProRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareImagesUpscalePostUpscaleImageNanoBananaProArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImagesUpscalePostUpscaleImageNanoBananaProSecurityRequirements, + operationName: "ImagesUpscalePostUpscaleImageNanoBananaProAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/upscale/nano-banana-pro", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.Prompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + } + if (request.ResolutionTier != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.ResolutionTier).HasValue ? (request.ResolutionTier).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"resolution_tier\""); + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImagesUpscalePostUpscaleImageNanoBananaProRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageNanoBananaPro", + methodName: "ImagesUpscalePostUpscaleImageNanoBananaProAsync", + pathTemplate: "\"/v2/image/upscale/nano-banana-pro\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageNanoBananaPro", + methodName: "ImagesUpscalePostUpscaleImageNanoBananaProAsync", + pathTemplate: "\"/v2/image/upscale/nano-banana-pro\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageNanoBananaPro", + methodName: "ImagesUpscalePostUpscaleImageNanoBananaProAsync", + pathTemplate: "\"/v2/image/upscale/nano-banana-pro\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImagesUpscalePostUpscaleImageNanoBananaProResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageNanoBananaPro", + methodName: "ImagesUpscalePostUpscaleImageNanoBananaProAsync", + pathTemplate: "\"/v2/image/upscale/nano-banana-pro\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageNanoBananaPro", + methodName: "ImagesUpscalePostUpscaleImageNanoBananaProAsync", + pathTemplate: "\"/v2/image/upscale/nano-banana-pro\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The source image was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImagesUpscalePostUpscaleImageNanoBananaProResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.UpscaleImageNanoBananaProResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.UpscaleImageNanoBananaProResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Upscale with Nano Banana Pro
+ /// Regenerate an image at a higher `resolution_tier` (1K, 2K, or 4K) while
+ /// preserving its content, composition, and style. Upload the source
+ /// `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// Optional short guidance for the enhancement, appended to the model's upscaling instruction. When omitted, the image is upscaled as-is. + /// + /// + /// The output resolution tier. The model sizes its output by tier at the source image's aspect ratio; exact pixel dimensions cannot be requested. Rejected when the source is already at or above the requested tier. Defaults to "2K".
+ /// Default Value: 2K + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesUpscalePostUpscaleImageNanoBananaProAsync( + byte[] image, + string imagename, + bool? dryRun = default, + string? prompt = default, + global::Ideogram.V2ImageUpscaleNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier? resolutionTier = default, + int? seed = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Ideogram.ImagesUpscalePostUpscaleImageNanoBananaProRequest + { + Image = image, + Imagename = imagename, + Prompt = prompt, + ResolutionTier = resolutionTier, + Seed = seed, + Async = async, + WebhookUrl = webhookUrl, + }; + + return await ImagesUpscalePostUpscaleImageNanoBananaProAsync( + dryRun: dryRun, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// Upscale with Nano Banana Pro
+ /// Regenerate an image at a higher `resolution_tier` (1K, 2K, or 4K) while
+ /// preserving its content, composition, and style. Upload the source
+ /// `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// Optional short guidance for the enhancement, appended to the model's upscaling instruction. When omitted, the image is upscaled as-is. + /// + /// + /// The output resolution tier. The model sizes its output by tier at the source image's aspect ratio; exact pixel dimensions cannot be requested. Rejected when the source is already at or above the requested tier. Defaults to "2K".
+ /// Default Value: 2K + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesUpscalePostUpscaleImageNanoBananaProAsync( + global::System.IO.Stream image, + string imagename, + bool? dryRun = default, + string? prompt = default, + global::Ideogram.V2ImageUpscaleNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier? resolutionTier = default, + int? seed = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + var request = new global::Ideogram.ImagesUpscalePostUpscaleImageNanoBananaProRequest + { + Image = global::System.Array.Empty(), + Imagename = imagename, + Prompt = prompt, + ResolutionTier = resolutionTier, + Seed = seed, + Async = async, + WebhookUrl = webhookUrl, + }; + PrepareArguments( + client: HttpClient); + PrepareImagesUpscalePostUpscaleImageNanoBananaProArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImagesUpscalePostUpscaleImageNanoBananaProSecurityRequirements, + operationName: "ImagesUpscalePostUpscaleImageNanoBananaProAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/upscale/nano-banana-pro", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.Prompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + } + if (request.ResolutionTier != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.ResolutionTier).HasValue ? (request.ResolutionTier).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"resolution_tier\""); + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImagesUpscalePostUpscaleImageNanoBananaProRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageNanoBananaPro", + methodName: "ImagesUpscalePostUpscaleImageNanoBananaProAsync", + pathTemplate: "\"/v2/image/upscale/nano-banana-pro\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageNanoBananaPro", + methodName: "ImagesUpscalePostUpscaleImageNanoBananaProAsync", + pathTemplate: "\"/v2/image/upscale/nano-banana-pro\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageNanoBananaPro", + methodName: "ImagesUpscalePostUpscaleImageNanoBananaProAsync", + pathTemplate: "\"/v2/image/upscale/nano-banana-pro\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImagesUpscalePostUpscaleImageNanoBananaProResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageNanoBananaPro", + methodName: "ImagesUpscalePostUpscaleImageNanoBananaProAsync", + pathTemplate: "\"/v2/image/upscale/nano-banana-pro\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageNanoBananaPro", + methodName: "ImagesUpscalePostUpscaleImageNanoBananaProAsync", + pathTemplate: "\"/v2/image/upscale/nano-banana-pro\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The source image was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImagesUpscalePostUpscaleImageNanoBananaProResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::Ideogram.UpscaleImageNanoBananaProResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::Ideogram.UpscaleImageNanoBananaProResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Upscale with Nano Banana Pro
+ /// Regenerate an image at a higher `resolution_tier` (1K, 2K, or 4K) while
+ /// preserving its content, composition, and style. Upload the source
+ /// `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// Optional short guidance for the enhancement, appended to the model's upscaling instruction. When omitted, the image is upscaled as-is. + /// + /// + /// The output resolution tier. The model sizes its output by tier at the source image's aspect ratio; exact pixel dimensions cannot be requested. Rejected when the source is already at or above the requested tier. Defaults to "2K".
+ /// Default Value: 2K + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ImagesUpscalePostUpscaleImageNanoBananaProAsResponseAsync( + global::System.IO.Stream image, + string imagename, + bool? dryRun = default, + string? prompt = default, + global::Ideogram.V2ImageUpscaleNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier? resolutionTier = default, + int? seed = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + var request = new global::Ideogram.ImagesUpscalePostUpscaleImageNanoBananaProRequest + { + Image = global::System.Array.Empty(), + Imagename = imagename, + Prompt = prompt, + ResolutionTier = resolutionTier, + Seed = seed, + Async = async, + WebhookUrl = webhookUrl, + }; + PrepareArguments( + client: HttpClient); + PrepareImagesUpscalePostUpscaleImageNanoBananaProArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImagesUpscalePostUpscaleImageNanoBananaProSecurityRequirements, + operationName: "ImagesUpscalePostUpscaleImageNanoBananaProAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/upscale/nano-banana-pro", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.Prompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + } + if (request.ResolutionTier != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.ResolutionTier).HasValue ? (request.ResolutionTier).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"resolution_tier\""); + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImagesUpscalePostUpscaleImageNanoBananaProRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageNanoBananaPro", + methodName: "ImagesUpscalePostUpscaleImageNanoBananaProAsync", + pathTemplate: "\"/v2/image/upscale/nano-banana-pro\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageNanoBananaPro", + methodName: "ImagesUpscalePostUpscaleImageNanoBananaProAsync", + pathTemplate: "\"/v2/image/upscale/nano-banana-pro\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageNanoBananaPro", + methodName: "ImagesUpscalePostUpscaleImageNanoBananaProAsync", + pathTemplate: "\"/v2/image/upscale/nano-banana-pro\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImagesUpscalePostUpscaleImageNanoBananaProResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageNanoBananaPro", + methodName: "ImagesUpscalePostUpscaleImageNanoBananaProAsync", + pathTemplate: "\"/v2/image/upscale/nano-banana-pro\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageNanoBananaPro", + methodName: "ImagesUpscalePostUpscaleImageNanoBananaProAsync", + pathTemplate: "\"/v2/image/upscale/nano-banana-pro\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The source image was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImagesUpscalePostUpscaleImageNanoBananaProResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.UpscaleImageNanoBananaProResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.UpscaleImageNanoBananaProResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesUpscaleClient.ImagesUpscalePostUpscaleImageTopazBloom2.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesUpscaleClient.ImagesUpscalePostUpscaleImageTopazBloom2.g.cs new file mode 100644 index 00000000..71b49405 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.ImagesUpscaleClient.ImagesUpscalePostUpscaleImageTopazBloom2.g.cs @@ -0,0 +1,2587 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class ImagesUpscaleClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_ImagesUpscalePostUpscaleImageTopazBloom2SecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_ImagesUpscalePostUpscaleImageTopazBloom2SecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_ImagesUpscalePostUpscaleImageTopazBloom2SecurityRequirement0, + }; + partial void PrepareImagesUpscalePostUpscaleImageTopazBloom2Arguments( + global::System.Net.Http.HttpClient httpClient, + ref bool? dryRun, + global::Ideogram.ImagesUpscalePostUpscaleImageTopazBloom2Request request); + partial void PrepareImagesUpscalePostUpscaleImageTopazBloom2Request( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + bool? dryRun, + global::Ideogram.ImagesUpscalePostUpscaleImageTopazBloom2Request request); + partial void ProcessImagesUpscalePostUpscaleImageTopazBloom2Response( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessImagesUpscalePostUpscaleImageTopazBloom2ResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Upscale with Topaz Bloom 2
+ /// Creatively upscale an image to 2x, 4x, or 8x its original resolution,
+ /// optionally guided by a `prompt`. Upload the source `image` using
+ /// `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesUpscalePostUpscaleImageTopazBloom2Async( + + global::Ideogram.ImagesUpscalePostUpscaleImageTopazBloom2Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ImagesUpscalePostUpscaleImageTopazBloom2AsResponseAsync( + + request: request, + dryRun: dryRun, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Upscale with Topaz Bloom 2
+ /// Creatively upscale an image to 2x, 4x, or 8x its original resolution,
+ /// optionally guided by a `prompt`. Upload the source `image` using
+ /// `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ImagesUpscalePostUpscaleImageTopazBloom2AsResponseAsync( + + global::Ideogram.ImagesUpscalePostUpscaleImageTopazBloom2Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareImagesUpscalePostUpscaleImageTopazBloom2Arguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImagesUpscalePostUpscaleImageTopazBloom2SecurityRequirements, + operationName: "ImagesUpscalePostUpscaleImageTopazBloom2Async"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/upscale/topaz-bloom-2", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.UpscaleFactor != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.UpscaleFactor).HasValue ? (request.UpscaleFactor).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"upscale_factor\""); + + } + if (request.Prompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + } + if (request.Creativity != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Creativity, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"creativity\""); + + } + if (request.ColorPreservation != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.ColorPreservation, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"color_preservation\""); + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImagesUpscalePostUpscaleImageTopazBloom2Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazBloom2", + methodName: "ImagesUpscalePostUpscaleImageTopazBloom2Async", + pathTemplate: "\"/v2/image/upscale/topaz-bloom-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazBloom2", + methodName: "ImagesUpscalePostUpscaleImageTopazBloom2Async", + pathTemplate: "\"/v2/image/upscale/topaz-bloom-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazBloom2", + methodName: "ImagesUpscalePostUpscaleImageTopazBloom2Async", + pathTemplate: "\"/v2/image/upscale/topaz-bloom-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImagesUpscalePostUpscaleImageTopazBloom2Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazBloom2", + methodName: "ImagesUpscalePostUpscaleImageTopazBloom2Async", + pathTemplate: "\"/v2/image/upscale/topaz-bloom-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazBloom2", + methodName: "ImagesUpscalePostUpscaleImageTopazBloom2Async", + pathTemplate: "\"/v2/image/upscale/topaz-bloom-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided, or the output would exceed the 8K limit. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The source image was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImagesUpscalePostUpscaleImageTopazBloom2ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.UpscaleImageTopazBloom2Response.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.UpscaleImageTopazBloom2Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Upscale with Topaz Bloom 2
+ /// Creatively upscale an image to 2x, 4x, or 8x its original resolution,
+ /// optionally guided by a `prompt`. Upload the source `image` using
+ /// `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
+ /// Default Value: x2 + /// + /// + /// An optional prompt guiding the detail the model regenerates while enlarging the image. Leave empty to enhance the source image as-is. + /// + /// + /// How strongly the model reinterprets the source while enlarging it, from 1 (most faithful) to 9 (most creative).
+ /// Default Value: 3 + /// + /// + /// When true (the default), the output keeps the source image's colors. Set to false to let the model adjust colors while enhancing.
+ /// Default Value: true + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesUpscalePostUpscaleImageTopazBloom2Async( + byte[] image, + string imagename, + bool? dryRun = default, + global::Ideogram.V2ImageUpscaleTopazBloom2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? upscaleFactor = default, + string? prompt = default, + int? creativity = default, + bool? colorPreservation = default, + int? seed = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Ideogram.ImagesUpscalePostUpscaleImageTopazBloom2Request + { + Image = image, + Imagename = imagename, + UpscaleFactor = upscaleFactor, + Prompt = prompt, + Creativity = creativity, + ColorPreservation = colorPreservation, + Seed = seed, + Async = async, + WebhookUrl = webhookUrl, + }; + + return await ImagesUpscalePostUpscaleImageTopazBloom2Async( + dryRun: dryRun, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// Upscale with Topaz Bloom 2
+ /// Creatively upscale an image to 2x, 4x, or 8x its original resolution,
+ /// optionally guided by a `prompt`. Upload the source `image` using
+ /// `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
+ /// Default Value: x2 + /// + /// + /// An optional prompt guiding the detail the model regenerates while enlarging the image. Leave empty to enhance the source image as-is. + /// + /// + /// How strongly the model reinterprets the source while enlarging it, from 1 (most faithful) to 9 (most creative).
+ /// Default Value: 3 + /// + /// + /// When true (the default), the output keeps the source image's colors. Set to false to let the model adjust colors while enhancing.
+ /// Default Value: true + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesUpscalePostUpscaleImageTopazBloom2Async( + global::System.IO.Stream image, + string imagename, + bool? dryRun = default, + global::Ideogram.V2ImageUpscaleTopazBloom2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? upscaleFactor = default, + string? prompt = default, + int? creativity = default, + bool? colorPreservation = default, + int? seed = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + var request = new global::Ideogram.ImagesUpscalePostUpscaleImageTopazBloom2Request + { + Image = global::System.Array.Empty(), + Imagename = imagename, + UpscaleFactor = upscaleFactor, + Prompt = prompt, + Creativity = creativity, + ColorPreservation = colorPreservation, + Seed = seed, + Async = async, + WebhookUrl = webhookUrl, + }; + PrepareArguments( + client: HttpClient); + PrepareImagesUpscalePostUpscaleImageTopazBloom2Arguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImagesUpscalePostUpscaleImageTopazBloom2SecurityRequirements, + operationName: "ImagesUpscalePostUpscaleImageTopazBloom2Async"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/upscale/topaz-bloom-2", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.UpscaleFactor != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.UpscaleFactor).HasValue ? (request.UpscaleFactor).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"upscale_factor\""); + + } + if (request.Prompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + } + if (request.Creativity != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Creativity, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"creativity\""); + + } + if (request.ColorPreservation != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.ColorPreservation, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"color_preservation\""); + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImagesUpscalePostUpscaleImageTopazBloom2Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazBloom2", + methodName: "ImagesUpscalePostUpscaleImageTopazBloom2Async", + pathTemplate: "\"/v2/image/upscale/topaz-bloom-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazBloom2", + methodName: "ImagesUpscalePostUpscaleImageTopazBloom2Async", + pathTemplate: "\"/v2/image/upscale/topaz-bloom-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazBloom2", + methodName: "ImagesUpscalePostUpscaleImageTopazBloom2Async", + pathTemplate: "\"/v2/image/upscale/topaz-bloom-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImagesUpscalePostUpscaleImageTopazBloom2Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazBloom2", + methodName: "ImagesUpscalePostUpscaleImageTopazBloom2Async", + pathTemplate: "\"/v2/image/upscale/topaz-bloom-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazBloom2", + methodName: "ImagesUpscalePostUpscaleImageTopazBloom2Async", + pathTemplate: "\"/v2/image/upscale/topaz-bloom-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided, or the output would exceed the 8K limit. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The source image was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImagesUpscalePostUpscaleImageTopazBloom2ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::Ideogram.UpscaleImageTopazBloom2Response.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::Ideogram.UpscaleImageTopazBloom2Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Upscale with Topaz Bloom 2
+ /// Creatively upscale an image to 2x, 4x, or 8x its original resolution,
+ /// optionally guided by a `prompt`. Upload the source `image` using
+ /// `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
+ /// Default Value: x2 + /// + /// + /// An optional prompt guiding the detail the model regenerates while enlarging the image. Leave empty to enhance the source image as-is. + /// + /// + /// How strongly the model reinterprets the source while enlarging it, from 1 (most faithful) to 9 (most creative).
+ /// Default Value: 3 + /// + /// + /// When true (the default), the output keeps the source image's colors. Set to false to let the model adjust colors while enhancing.
+ /// Default Value: true + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ImagesUpscalePostUpscaleImageTopazBloom2AsResponseAsync( + global::System.IO.Stream image, + string imagename, + bool? dryRun = default, + global::Ideogram.V2ImageUpscaleTopazBloom2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? upscaleFactor = default, + string? prompt = default, + int? creativity = default, + bool? colorPreservation = default, + int? seed = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + var request = new global::Ideogram.ImagesUpscalePostUpscaleImageTopazBloom2Request + { + Image = global::System.Array.Empty(), + Imagename = imagename, + UpscaleFactor = upscaleFactor, + Prompt = prompt, + Creativity = creativity, + ColorPreservation = colorPreservation, + Seed = seed, + Async = async, + WebhookUrl = webhookUrl, + }; + PrepareArguments( + client: HttpClient); + PrepareImagesUpscalePostUpscaleImageTopazBloom2Arguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImagesUpscalePostUpscaleImageTopazBloom2SecurityRequirements, + operationName: "ImagesUpscalePostUpscaleImageTopazBloom2Async"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/upscale/topaz-bloom-2", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.UpscaleFactor != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.UpscaleFactor).HasValue ? (request.UpscaleFactor).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"upscale_factor\""); + + } + if (request.Prompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + } + if (request.Creativity != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Creativity, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"creativity\""); + + } + if (request.ColorPreservation != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.ColorPreservation, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"color_preservation\""); + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImagesUpscalePostUpscaleImageTopazBloom2Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazBloom2", + methodName: "ImagesUpscalePostUpscaleImageTopazBloom2Async", + pathTemplate: "\"/v2/image/upscale/topaz-bloom-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazBloom2", + methodName: "ImagesUpscalePostUpscaleImageTopazBloom2Async", + pathTemplate: "\"/v2/image/upscale/topaz-bloom-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazBloom2", + methodName: "ImagesUpscalePostUpscaleImageTopazBloom2Async", + pathTemplate: "\"/v2/image/upscale/topaz-bloom-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImagesUpscalePostUpscaleImageTopazBloom2Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazBloom2", + methodName: "ImagesUpscalePostUpscaleImageTopazBloom2Async", + pathTemplate: "\"/v2/image/upscale/topaz-bloom-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazBloom2", + methodName: "ImagesUpscalePostUpscaleImageTopazBloom2Async", + pathTemplate: "\"/v2/image/upscale/topaz-bloom-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided, or the output would exceed the 8K limit. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The source image was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImagesUpscalePostUpscaleImageTopazBloom2ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.UpscaleImageTopazBloom2Response.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.UpscaleImageTopazBloom2Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesUpscaleClient.ImagesUpscalePostUpscaleImageTopazRedefine.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesUpscaleClient.ImagesUpscalePostUpscaleImageTopazRedefine.g.cs new file mode 100644 index 00000000..11c02ec2 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.ImagesUpscaleClient.ImagesUpscalePostUpscaleImageTopazRedefine.g.cs @@ -0,0 +1,2944 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class ImagesUpscaleClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_ImagesUpscalePostUpscaleImageTopazRedefineSecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_ImagesUpscalePostUpscaleImageTopazRedefineSecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_ImagesUpscalePostUpscaleImageTopazRedefineSecurityRequirement0, + }; + partial void PrepareImagesUpscalePostUpscaleImageTopazRedefineArguments( + global::System.Net.Http.HttpClient httpClient, + ref bool? dryRun, + global::Ideogram.ImagesUpscalePostUpscaleImageTopazRedefineRequest request); + partial void PrepareImagesUpscalePostUpscaleImageTopazRedefineRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + bool? dryRun, + global::Ideogram.ImagesUpscalePostUpscaleImageTopazRedefineRequest request); + partial void ProcessImagesUpscalePostUpscaleImageTopazRedefineResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessImagesUpscalePostUpscaleImageTopazRedefineResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Upscale with Topaz Redefine
+ /// Creatively upscale an image to 2x, 4x, or 8x its original resolution,
+ /// guided by an optional `prompt` or `autoprompt`. Upload the source
+ /// `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesUpscalePostUpscaleImageTopazRedefineAsync( + + global::Ideogram.ImagesUpscalePostUpscaleImageTopazRedefineRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ImagesUpscalePostUpscaleImageTopazRedefineAsResponseAsync( + + request: request, + dryRun: dryRun, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Upscale with Topaz Redefine
+ /// Creatively upscale an image to 2x, 4x, or 8x its original resolution,
+ /// guided by an optional `prompt` or `autoprompt`. Upload the source
+ /// `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ImagesUpscalePostUpscaleImageTopazRedefineAsResponseAsync( + + global::Ideogram.ImagesUpscalePostUpscaleImageTopazRedefineRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareImagesUpscalePostUpscaleImageTopazRedefineArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImagesUpscalePostUpscaleImageTopazRedefineSecurityRequirements, + operationName: "ImagesUpscalePostUpscaleImageTopazRedefineAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/upscale/topaz-redefine", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.UpscaleFactor != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.UpscaleFactor).HasValue ? (request.UpscaleFactor).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"upscale_factor\""); + + } + if (request.Prompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + } + if (request.Creativity != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Creativity, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"creativity\""); + + } + if (request.Autoprompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Autoprompt, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"autoprompt\""); + + } + if (request.Texture != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Texture, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"texture\""); + + } + if (request.Detail != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Detail, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"detail\""); + + } + if (request.DetailStrength != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.DetailStrength ?? string.Empty), + name: "\"detail_strength\""); + + } + if (request.Sharpen != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Sharpen ?? string.Empty), + name: "\"sharpen\""); + + } + if (request.Denoise != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Denoise ?? string.Empty), + name: "\"denoise\""); + + } + if (request.FaceEnhancement != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.FaceEnhancement, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"face_enhancement\""); + + } + if (request.FaceEnhancementStrength != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.FaceEnhancementStrength ?? string.Empty), + name: "\"face_enhancement_strength\""); + + } + if (request.FaceEnhancementCreativity != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.FaceEnhancementCreativity ?? string.Empty), + name: "\"face_enhancement_creativity\""); + + } + if (request.SubjectDetection != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.SubjectDetection).HasValue ? (request.SubjectDetection).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"subject_detection\""); + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImagesUpscalePostUpscaleImageTopazRedefineRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazRedefine", + methodName: "ImagesUpscalePostUpscaleImageTopazRedefineAsync", + pathTemplate: "\"/v2/image/upscale/topaz-redefine\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazRedefine", + methodName: "ImagesUpscalePostUpscaleImageTopazRedefineAsync", + pathTemplate: "\"/v2/image/upscale/topaz-redefine\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazRedefine", + methodName: "ImagesUpscalePostUpscaleImageTopazRedefineAsync", + pathTemplate: "\"/v2/image/upscale/topaz-redefine\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImagesUpscalePostUpscaleImageTopazRedefineResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazRedefine", + methodName: "ImagesUpscalePostUpscaleImageTopazRedefineAsync", + pathTemplate: "\"/v2/image/upscale/topaz-redefine\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazRedefine", + methodName: "ImagesUpscalePostUpscaleImageTopazRedefineAsync", + pathTemplate: "\"/v2/image/upscale/topaz-redefine\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided, or the output would exceed the 8K limit. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The source image was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImagesUpscalePostUpscaleImageTopazRedefineResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.UpscaleImageTopazRedefineResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.UpscaleImageTopazRedefineResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Upscale with Topaz Redefine
+ /// Creatively upscale an image to 2x, 4x, or 8x its original resolution,
+ /// guided by an optional `prompt` or `autoprompt`. Upload the source
+ /// `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
+ /// Default Value: x2 + /// + /// + /// An optional prompt guiding the detail the model regenerates while enlarging the image. Leave empty to enhance the source image as-is. + /// + /// + /// How strongly the model reinterprets the source while enlarging it, from 1 (most faithful) to 9 (most creative).
+ /// Default Value: 3 + /// + /// + /// When true, the model describes the image itself and any `prompt` is ignored.
+ /// Default Value: false + /// + /// + /// How much fine texture the model adds, from 1 to 5. Keep it low at low creativity.
+ /// Default Value: 1 + /// + /// + /// Apply a detail adjustment after rendering. When true, `detail_strength` sets how much.
+ /// Default Value: false + /// + /// + /// Detail adjustment intensity, from 0 to 10. + /// + /// + /// Edge sharpening applied after enlarging, from 0 to 1. Omit to let the model choose per image. + /// + /// + /// Noise and grain reduction, from 0 to 1. Omit to let the model choose per image. + /// + /// + /// Recover detail in faces. When true, `face_enhancement_strength` and `face_enhancement_creativity` are required. + /// + /// + /// How strongly faces are recovered, from 0 to 1. + /// + /// + /// How freely face recovery may reinterpret features, from 0 (faithful) to 1 (creative). + /// + /// + /// Where enhancements apply. Omit to let the model choose per image. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesUpscalePostUpscaleImageTopazRedefineAsync( + byte[] image, + string imagename, + bool? dryRun = default, + global::Ideogram.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? upscaleFactor = default, + string? prompt = default, + int? creativity = default, + bool? autoprompt = default, + int? texture = default, + bool? detail = default, + string? detailStrength = default, + string? sharpen = default, + string? denoise = default, + bool? faceEnhancement = default, + string? faceEnhancementStrength = default, + string? faceEnhancementCreativity = default, + global::Ideogram.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection? subjectDetection = default, + int? seed = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Ideogram.ImagesUpscalePostUpscaleImageTopazRedefineRequest + { + Image = image, + Imagename = imagename, + UpscaleFactor = upscaleFactor, + Prompt = prompt, + Creativity = creativity, + Autoprompt = autoprompt, + Texture = texture, + Detail = detail, + DetailStrength = detailStrength, + Sharpen = sharpen, + Denoise = denoise, + FaceEnhancement = faceEnhancement, + FaceEnhancementStrength = faceEnhancementStrength, + FaceEnhancementCreativity = faceEnhancementCreativity, + SubjectDetection = subjectDetection, + Seed = seed, + Async = async, + WebhookUrl = webhookUrl, + }; + + return await ImagesUpscalePostUpscaleImageTopazRedefineAsync( + dryRun: dryRun, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// Upscale with Topaz Redefine
+ /// Creatively upscale an image to 2x, 4x, or 8x its original resolution,
+ /// guided by an optional `prompt` or `autoprompt`. Upload the source
+ /// `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
+ /// Default Value: x2 + /// + /// + /// An optional prompt guiding the detail the model regenerates while enlarging the image. Leave empty to enhance the source image as-is. + /// + /// + /// How strongly the model reinterprets the source while enlarging it, from 1 (most faithful) to 9 (most creative).
+ /// Default Value: 3 + /// + /// + /// When true, the model describes the image itself and any `prompt` is ignored.
+ /// Default Value: false + /// + /// + /// How much fine texture the model adds, from 1 to 5. Keep it low at low creativity.
+ /// Default Value: 1 + /// + /// + /// Apply a detail adjustment after rendering. When true, `detail_strength` sets how much.
+ /// Default Value: false + /// + /// + /// Detail adjustment intensity, from 0 to 10. + /// + /// + /// Edge sharpening applied after enlarging, from 0 to 1. Omit to let the model choose per image. + /// + /// + /// Noise and grain reduction, from 0 to 1. Omit to let the model choose per image. + /// + /// + /// Recover detail in faces. When true, `face_enhancement_strength` and `face_enhancement_creativity` are required. + /// + /// + /// How strongly faces are recovered, from 0 to 1. + /// + /// + /// How freely face recovery may reinterpret features, from 0 (faithful) to 1 (creative). + /// + /// + /// Where enhancements apply. Omit to let the model choose per image. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesUpscalePostUpscaleImageTopazRedefineAsync( + global::System.IO.Stream image, + string imagename, + bool? dryRun = default, + global::Ideogram.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? upscaleFactor = default, + string? prompt = default, + int? creativity = default, + bool? autoprompt = default, + int? texture = default, + bool? detail = default, + string? detailStrength = default, + string? sharpen = default, + string? denoise = default, + bool? faceEnhancement = default, + string? faceEnhancementStrength = default, + string? faceEnhancementCreativity = default, + global::Ideogram.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection? subjectDetection = default, + int? seed = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + var request = new global::Ideogram.ImagesUpscalePostUpscaleImageTopazRedefineRequest + { + Image = global::System.Array.Empty(), + Imagename = imagename, + UpscaleFactor = upscaleFactor, + Prompt = prompt, + Creativity = creativity, + Autoprompt = autoprompt, + Texture = texture, + Detail = detail, + DetailStrength = detailStrength, + Sharpen = sharpen, + Denoise = denoise, + FaceEnhancement = faceEnhancement, + FaceEnhancementStrength = faceEnhancementStrength, + FaceEnhancementCreativity = faceEnhancementCreativity, + SubjectDetection = subjectDetection, + Seed = seed, + Async = async, + WebhookUrl = webhookUrl, + }; + PrepareArguments( + client: HttpClient); + PrepareImagesUpscalePostUpscaleImageTopazRedefineArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImagesUpscalePostUpscaleImageTopazRedefineSecurityRequirements, + operationName: "ImagesUpscalePostUpscaleImageTopazRedefineAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/upscale/topaz-redefine", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.UpscaleFactor != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.UpscaleFactor).HasValue ? (request.UpscaleFactor).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"upscale_factor\""); + + } + if (request.Prompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + } + if (request.Creativity != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Creativity, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"creativity\""); + + } + if (request.Autoprompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Autoprompt, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"autoprompt\""); + + } + if (request.Texture != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Texture, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"texture\""); + + } + if (request.Detail != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Detail, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"detail\""); + + } + if (request.DetailStrength != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.DetailStrength ?? string.Empty), + name: "\"detail_strength\""); + + } + if (request.Sharpen != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Sharpen ?? string.Empty), + name: "\"sharpen\""); + + } + if (request.Denoise != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Denoise ?? string.Empty), + name: "\"denoise\""); + + } + if (request.FaceEnhancement != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.FaceEnhancement, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"face_enhancement\""); + + } + if (request.FaceEnhancementStrength != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.FaceEnhancementStrength ?? string.Empty), + name: "\"face_enhancement_strength\""); + + } + if (request.FaceEnhancementCreativity != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.FaceEnhancementCreativity ?? string.Empty), + name: "\"face_enhancement_creativity\""); + + } + if (request.SubjectDetection != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.SubjectDetection).HasValue ? (request.SubjectDetection).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"subject_detection\""); + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImagesUpscalePostUpscaleImageTopazRedefineRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazRedefine", + methodName: "ImagesUpscalePostUpscaleImageTopazRedefineAsync", + pathTemplate: "\"/v2/image/upscale/topaz-redefine\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazRedefine", + methodName: "ImagesUpscalePostUpscaleImageTopazRedefineAsync", + pathTemplate: "\"/v2/image/upscale/topaz-redefine\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazRedefine", + methodName: "ImagesUpscalePostUpscaleImageTopazRedefineAsync", + pathTemplate: "\"/v2/image/upscale/topaz-redefine\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImagesUpscalePostUpscaleImageTopazRedefineResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazRedefine", + methodName: "ImagesUpscalePostUpscaleImageTopazRedefineAsync", + pathTemplate: "\"/v2/image/upscale/topaz-redefine\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazRedefine", + methodName: "ImagesUpscalePostUpscaleImageTopazRedefineAsync", + pathTemplate: "\"/v2/image/upscale/topaz-redefine\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided, or the output would exceed the 8K limit. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The source image was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImagesUpscalePostUpscaleImageTopazRedefineResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::Ideogram.UpscaleImageTopazRedefineResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::Ideogram.UpscaleImageTopazRedefineResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Upscale with Topaz Redefine
+ /// Creatively upscale an image to 2x, 4x, or 8x its original resolution,
+ /// guided by an optional `prompt` or `autoprompt`. Upload the source
+ /// `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
+ /// Default Value: x2 + /// + /// + /// An optional prompt guiding the detail the model regenerates while enlarging the image. Leave empty to enhance the source image as-is. + /// + /// + /// How strongly the model reinterprets the source while enlarging it, from 1 (most faithful) to 9 (most creative).
+ /// Default Value: 3 + /// + /// + /// When true, the model describes the image itself and any `prompt` is ignored.
+ /// Default Value: false + /// + /// + /// How much fine texture the model adds, from 1 to 5. Keep it low at low creativity.
+ /// Default Value: 1 + /// + /// + /// Apply a detail adjustment after rendering. When true, `detail_strength` sets how much.
+ /// Default Value: false + /// + /// + /// Detail adjustment intensity, from 0 to 10. + /// + /// + /// Edge sharpening applied after enlarging, from 0 to 1. Omit to let the model choose per image. + /// + /// + /// Noise and grain reduction, from 0 to 1. Omit to let the model choose per image. + /// + /// + /// Recover detail in faces. When true, `face_enhancement_strength` and `face_enhancement_creativity` are required. + /// + /// + /// How strongly faces are recovered, from 0 to 1. + /// + /// + /// How freely face recovery may reinterpret features, from 0 (faithful) to 1 (creative). + /// + /// + /// Where enhancements apply. Omit to let the model choose per image. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ImagesUpscalePostUpscaleImageTopazRedefineAsResponseAsync( + global::System.IO.Stream image, + string imagename, + bool? dryRun = default, + global::Ideogram.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? upscaleFactor = default, + string? prompt = default, + int? creativity = default, + bool? autoprompt = default, + int? texture = default, + bool? detail = default, + string? detailStrength = default, + string? sharpen = default, + string? denoise = default, + bool? faceEnhancement = default, + string? faceEnhancementStrength = default, + string? faceEnhancementCreativity = default, + global::Ideogram.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection? subjectDetection = default, + int? seed = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + var request = new global::Ideogram.ImagesUpscalePostUpscaleImageTopazRedefineRequest + { + Image = global::System.Array.Empty(), + Imagename = imagename, + UpscaleFactor = upscaleFactor, + Prompt = prompt, + Creativity = creativity, + Autoprompt = autoprompt, + Texture = texture, + Detail = detail, + DetailStrength = detailStrength, + Sharpen = sharpen, + Denoise = denoise, + FaceEnhancement = faceEnhancement, + FaceEnhancementStrength = faceEnhancementStrength, + FaceEnhancementCreativity = faceEnhancementCreativity, + SubjectDetection = subjectDetection, + Seed = seed, + Async = async, + WebhookUrl = webhookUrl, + }; + PrepareArguments( + client: HttpClient); + PrepareImagesUpscalePostUpscaleImageTopazRedefineArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImagesUpscalePostUpscaleImageTopazRedefineSecurityRequirements, + operationName: "ImagesUpscalePostUpscaleImageTopazRedefineAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/upscale/topaz-redefine", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.UpscaleFactor != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.UpscaleFactor).HasValue ? (request.UpscaleFactor).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"upscale_factor\""); + + } + if (request.Prompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + } + if (request.Creativity != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Creativity, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"creativity\""); + + } + if (request.Autoprompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Autoprompt, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"autoprompt\""); + + } + if (request.Texture != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Texture, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"texture\""); + + } + if (request.Detail != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Detail, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"detail\""); + + } + if (request.DetailStrength != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.DetailStrength ?? string.Empty), + name: "\"detail_strength\""); + + } + if (request.Sharpen != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Sharpen ?? string.Empty), + name: "\"sharpen\""); + + } + if (request.Denoise != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Denoise ?? string.Empty), + name: "\"denoise\""); + + } + if (request.FaceEnhancement != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.FaceEnhancement, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"face_enhancement\""); + + } + if (request.FaceEnhancementStrength != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.FaceEnhancementStrength ?? string.Empty), + name: "\"face_enhancement_strength\""); + + } + if (request.FaceEnhancementCreativity != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.FaceEnhancementCreativity ?? string.Empty), + name: "\"face_enhancement_creativity\""); + + } + if (request.SubjectDetection != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.SubjectDetection).HasValue ? (request.SubjectDetection).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"subject_detection\""); + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImagesUpscalePostUpscaleImageTopazRedefineRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazRedefine", + methodName: "ImagesUpscalePostUpscaleImageTopazRedefineAsync", + pathTemplate: "\"/v2/image/upscale/topaz-redefine\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazRedefine", + methodName: "ImagesUpscalePostUpscaleImageTopazRedefineAsync", + pathTemplate: "\"/v2/image/upscale/topaz-redefine\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazRedefine", + methodName: "ImagesUpscalePostUpscaleImageTopazRedefineAsync", + pathTemplate: "\"/v2/image/upscale/topaz-redefine\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImagesUpscalePostUpscaleImageTopazRedefineResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazRedefine", + methodName: "ImagesUpscalePostUpscaleImageTopazRedefineAsync", + pathTemplate: "\"/v2/image/upscale/topaz-redefine\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazRedefine", + methodName: "ImagesUpscalePostUpscaleImageTopazRedefineAsync", + pathTemplate: "\"/v2/image/upscale/topaz-redefine\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided, or the output would exceed the 8K limit. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The source image was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImagesUpscalePostUpscaleImageTopazRedefineResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.UpscaleImageTopazRedefineResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.UpscaleImageTopazRedefineResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesUpscaleClient.ImagesUpscalePostUpscaleImageTopazStandardV2.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesUpscaleClient.ImagesUpscalePostUpscaleImageTopazStandardV2.g.cs new file mode 100644 index 00000000..f06f2492 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.ImagesUpscaleClient.ImagesUpscalePostUpscaleImageTopazStandardV2.g.cs @@ -0,0 +1,2621 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class ImagesUpscaleClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_ImagesUpscalePostUpscaleImageTopazStandardV2SecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_ImagesUpscalePostUpscaleImageTopazStandardV2SecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_ImagesUpscalePostUpscaleImageTopazStandardV2SecurityRequirement0, + }; + partial void PrepareImagesUpscalePostUpscaleImageTopazStandardV2Arguments( + global::System.Net.Http.HttpClient httpClient, + ref bool? dryRun, + global::Ideogram.ImagesUpscalePostUpscaleImageTopazStandardV2Request request); + partial void PrepareImagesUpscalePostUpscaleImageTopazStandardV2Request( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + bool? dryRun, + global::Ideogram.ImagesUpscalePostUpscaleImageTopazStandardV2Request request); + partial void ProcessImagesUpscalePostUpscaleImageTopazStandardV2Response( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessImagesUpscalePostUpscaleImageTopazStandardV2ResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Upscale with Topaz Standard V2
+ /// Upscale an image to 2x, 4x, or 8x its original resolution; no prompt is
+ /// needed. Upload the source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesUpscalePostUpscaleImageTopazStandardV2Async( + + global::Ideogram.ImagesUpscalePostUpscaleImageTopazStandardV2Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ImagesUpscalePostUpscaleImageTopazStandardV2AsResponseAsync( + + request: request, + dryRun: dryRun, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Upscale with Topaz Standard V2
+ /// Upscale an image to 2x, 4x, or 8x its original resolution; no prompt is
+ /// needed. Upload the source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ImagesUpscalePostUpscaleImageTopazStandardV2AsResponseAsync( + + global::Ideogram.ImagesUpscalePostUpscaleImageTopazStandardV2Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareImagesUpscalePostUpscaleImageTopazStandardV2Arguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImagesUpscalePostUpscaleImageTopazStandardV2SecurityRequirements, + operationName: "ImagesUpscalePostUpscaleImageTopazStandardV2Async"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/upscale/topaz-standard-2", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.UpscaleFactor != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.UpscaleFactor).HasValue ? (request.UpscaleFactor).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"upscale_factor\""); + + } + if (request.Strength != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Strength ?? string.Empty), + name: "\"strength\""); + + } + if (request.Sharpen != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Sharpen ?? string.Empty), + name: "\"sharpen\""); + + } + if (request.Denoise != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Denoise ?? string.Empty), + name: "\"denoise\""); + + } + if (request.FixCompression != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.FixCompression ?? string.Empty), + name: "\"fix_compression\""); + + } + if (request.FaceEnhancement != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.FaceEnhancement, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"face_enhancement\""); + + } + if (request.FaceEnhancementStrength != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.FaceEnhancementStrength ?? string.Empty), + name: "\"face_enhancement_strength\""); + + } + if (request.FaceEnhancementCreativity != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.FaceEnhancementCreativity ?? string.Empty), + name: "\"face_enhancement_creativity\""); + + } + if (request.SubjectDetection != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.SubjectDetection).HasValue ? (request.SubjectDetection).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"subject_detection\""); + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImagesUpscalePostUpscaleImageTopazStandardV2Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazStandardV2", + methodName: "ImagesUpscalePostUpscaleImageTopazStandardV2Async", + pathTemplate: "\"/v2/image/upscale/topaz-standard-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazStandardV2", + methodName: "ImagesUpscalePostUpscaleImageTopazStandardV2Async", + pathTemplate: "\"/v2/image/upscale/topaz-standard-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazStandardV2", + methodName: "ImagesUpscalePostUpscaleImageTopazStandardV2Async", + pathTemplate: "\"/v2/image/upscale/topaz-standard-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImagesUpscalePostUpscaleImageTopazStandardV2Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazStandardV2", + methodName: "ImagesUpscalePostUpscaleImageTopazStandardV2Async", + pathTemplate: "\"/v2/image/upscale/topaz-standard-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazStandardV2", + methodName: "ImagesUpscalePostUpscaleImageTopazStandardV2Async", + pathTemplate: "\"/v2/image/upscale/topaz-standard-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided, or the output would exceed the 8K limit. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The source image was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImagesUpscalePostUpscaleImageTopazStandardV2ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.UpscaleImageTopazStandardV2Response.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.UpscaleImageTopazStandardV2Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Upscale with Topaz Standard V2
+ /// Upscale an image to 2x, 4x, or 8x its original resolution; no prompt is
+ /// needed. Upload the source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
+ /// Default Value: x2 + /// + /// + /// Overall intensity of the enhancement model, from 0.01 to 1. Higher values look crisper but can turn unrealistic. Omit to let the model choose per image. + /// + /// + /// Edge sharpening applied after enlarging, from 0 to 1. Omit to let the model choose per image. + /// + /// + /// Noise and grain reduction, from 0 to 1. Omit to let the model choose per image. + /// + /// + /// Compression artifact removal, from 0 to 1. Omit to let the model choose per image. + /// + /// + /// Recover detail in faces. When true, `face_enhancement_strength` and `face_enhancement_creativity` are required. + /// + /// + /// How strongly faces are recovered, from 0 to 1. + /// + /// + /// How freely face recovery may reinterpret features, from 0 (faithful) to 1 (creative). + /// + /// + /// Where enhancements apply. Omit to let the model choose per image. + /// + /// + /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesUpscalePostUpscaleImageTopazStandardV2Async( + byte[] image, + string imagename, + bool? dryRun = default, + global::Ideogram.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? upscaleFactor = default, + string? strength = default, + string? sharpen = default, + string? denoise = default, + string? fixCompression = default, + bool? faceEnhancement = default, + string? faceEnhancementStrength = default, + string? faceEnhancementCreativity = default, + global::Ideogram.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaSubjectDetection? subjectDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Ideogram.ImagesUpscalePostUpscaleImageTopazStandardV2Request + { + Image = image, + Imagename = imagename, + UpscaleFactor = upscaleFactor, + Strength = strength, + Sharpen = sharpen, + Denoise = denoise, + FixCompression = fixCompression, + FaceEnhancement = faceEnhancement, + FaceEnhancementStrength = faceEnhancementStrength, + FaceEnhancementCreativity = faceEnhancementCreativity, + SubjectDetection = subjectDetection, + Async = async, + WebhookUrl = webhookUrl, + }; + + return await ImagesUpscalePostUpscaleImageTopazStandardV2Async( + dryRun: dryRun, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// Upscale with Topaz Standard V2
+ /// Upscale an image to 2x, 4x, or 8x its original resolution; no prompt is
+ /// needed. Upload the source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
+ /// Default Value: x2 + /// + /// + /// Overall intensity of the enhancement model, from 0.01 to 1. Higher values look crisper but can turn unrealistic. Omit to let the model choose per image. + /// + /// + /// Edge sharpening applied after enlarging, from 0 to 1. Omit to let the model choose per image. + /// + /// + /// Noise and grain reduction, from 0 to 1. Omit to let the model choose per image. + /// + /// + /// Compression artifact removal, from 0 to 1. Omit to let the model choose per image. + /// + /// + /// Recover detail in faces. When true, `face_enhancement_strength` and `face_enhancement_creativity` are required. + /// + /// + /// How strongly faces are recovered, from 0 to 1. + /// + /// + /// How freely face recovery may reinterpret features, from 0 (faithful) to 1 (creative). + /// + /// + /// Where enhancements apply. Omit to let the model choose per image. + /// + /// + /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesUpscalePostUpscaleImageTopazStandardV2Async( + global::System.IO.Stream image, + string imagename, + bool? dryRun = default, + global::Ideogram.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? upscaleFactor = default, + string? strength = default, + string? sharpen = default, + string? denoise = default, + string? fixCompression = default, + bool? faceEnhancement = default, + string? faceEnhancementStrength = default, + string? faceEnhancementCreativity = default, + global::Ideogram.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaSubjectDetection? subjectDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + var request = new global::Ideogram.ImagesUpscalePostUpscaleImageTopazStandardV2Request + { + Image = global::System.Array.Empty(), + Imagename = imagename, + UpscaleFactor = upscaleFactor, + Strength = strength, + Sharpen = sharpen, + Denoise = denoise, + FixCompression = fixCompression, + FaceEnhancement = faceEnhancement, + FaceEnhancementStrength = faceEnhancementStrength, + FaceEnhancementCreativity = faceEnhancementCreativity, + SubjectDetection = subjectDetection, + Async = async, + WebhookUrl = webhookUrl, + }; + PrepareArguments( + client: HttpClient); + PrepareImagesUpscalePostUpscaleImageTopazStandardV2Arguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImagesUpscalePostUpscaleImageTopazStandardV2SecurityRequirements, + operationName: "ImagesUpscalePostUpscaleImageTopazStandardV2Async"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/upscale/topaz-standard-2", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.UpscaleFactor != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.UpscaleFactor).HasValue ? (request.UpscaleFactor).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"upscale_factor\""); + + } + if (request.Strength != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Strength ?? string.Empty), + name: "\"strength\""); + + } + if (request.Sharpen != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Sharpen ?? string.Empty), + name: "\"sharpen\""); + + } + if (request.Denoise != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Denoise ?? string.Empty), + name: "\"denoise\""); + + } + if (request.FixCompression != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.FixCompression ?? string.Empty), + name: "\"fix_compression\""); + + } + if (request.FaceEnhancement != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.FaceEnhancement, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"face_enhancement\""); + + } + if (request.FaceEnhancementStrength != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.FaceEnhancementStrength ?? string.Empty), + name: "\"face_enhancement_strength\""); + + } + if (request.FaceEnhancementCreativity != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.FaceEnhancementCreativity ?? string.Empty), + name: "\"face_enhancement_creativity\""); + + } + if (request.SubjectDetection != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.SubjectDetection).HasValue ? (request.SubjectDetection).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"subject_detection\""); + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImagesUpscalePostUpscaleImageTopazStandardV2Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazStandardV2", + methodName: "ImagesUpscalePostUpscaleImageTopazStandardV2Async", + pathTemplate: "\"/v2/image/upscale/topaz-standard-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazStandardV2", + methodName: "ImagesUpscalePostUpscaleImageTopazStandardV2Async", + pathTemplate: "\"/v2/image/upscale/topaz-standard-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazStandardV2", + methodName: "ImagesUpscalePostUpscaleImageTopazStandardV2Async", + pathTemplate: "\"/v2/image/upscale/topaz-standard-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImagesUpscalePostUpscaleImageTopazStandardV2Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazStandardV2", + methodName: "ImagesUpscalePostUpscaleImageTopazStandardV2Async", + pathTemplate: "\"/v2/image/upscale/topaz-standard-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazStandardV2", + methodName: "ImagesUpscalePostUpscaleImageTopazStandardV2Async", + pathTemplate: "\"/v2/image/upscale/topaz-standard-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided, or the output would exceed the 8K limit. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The source image was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImagesUpscalePostUpscaleImageTopazStandardV2ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::Ideogram.UpscaleImageTopazStandardV2Response.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::Ideogram.UpscaleImageTopazStandardV2Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Upscale with Topaz Standard V2
+ /// Upscale an image to 2x, 4x, or 8x its original resolution; no prompt is
+ /// needed. Upload the source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
+ /// Default Value: x2 + /// + /// + /// Overall intensity of the enhancement model, from 0.01 to 1. Higher values look crisper but can turn unrealistic. Omit to let the model choose per image. + /// + /// + /// Edge sharpening applied after enlarging, from 0 to 1. Omit to let the model choose per image. + /// + /// + /// Noise and grain reduction, from 0 to 1. Omit to let the model choose per image. + /// + /// + /// Compression artifact removal, from 0 to 1. Omit to let the model choose per image. + /// + /// + /// Recover detail in faces. When true, `face_enhancement_strength` and `face_enhancement_creativity` are required. + /// + /// + /// How strongly faces are recovered, from 0 to 1. + /// + /// + /// How freely face recovery may reinterpret features, from 0 (faithful) to 1 (creative). + /// + /// + /// Where enhancements apply. Omit to let the model choose per image. + /// + /// + /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ImagesUpscalePostUpscaleImageTopazStandardV2AsResponseAsync( + global::System.IO.Stream image, + string imagename, + bool? dryRun = default, + global::Ideogram.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? upscaleFactor = default, + string? strength = default, + string? sharpen = default, + string? denoise = default, + string? fixCompression = default, + bool? faceEnhancement = default, + string? faceEnhancementStrength = default, + string? faceEnhancementCreativity = default, + global::Ideogram.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaSubjectDetection? subjectDetection = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + var request = new global::Ideogram.ImagesUpscalePostUpscaleImageTopazStandardV2Request + { + Image = global::System.Array.Empty(), + Imagename = imagename, + UpscaleFactor = upscaleFactor, + Strength = strength, + Sharpen = sharpen, + Denoise = denoise, + FixCompression = fixCompression, + FaceEnhancement = faceEnhancement, + FaceEnhancementStrength = faceEnhancementStrength, + FaceEnhancementCreativity = faceEnhancementCreativity, + SubjectDetection = subjectDetection, + Async = async, + WebhookUrl = webhookUrl, + }; + PrepareArguments( + client: HttpClient); + PrepareImagesUpscalePostUpscaleImageTopazStandardV2Arguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImagesUpscalePostUpscaleImageTopazStandardV2SecurityRequirements, + operationName: "ImagesUpscalePostUpscaleImageTopazStandardV2Async"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/upscale/topaz-standard-2", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.UpscaleFactor != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.UpscaleFactor).HasValue ? (request.UpscaleFactor).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"upscale_factor\""); + + } + if (request.Strength != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Strength ?? string.Empty), + name: "\"strength\""); + + } + if (request.Sharpen != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Sharpen ?? string.Empty), + name: "\"sharpen\""); + + } + if (request.Denoise != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Denoise ?? string.Empty), + name: "\"denoise\""); + + } + if (request.FixCompression != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.FixCompression ?? string.Empty), + name: "\"fix_compression\""); + + } + if (request.FaceEnhancement != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.FaceEnhancement, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"face_enhancement\""); + + } + if (request.FaceEnhancementStrength != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.FaceEnhancementStrength ?? string.Empty), + name: "\"face_enhancement_strength\""); + + } + if (request.FaceEnhancementCreativity != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.FaceEnhancementCreativity ?? string.Empty), + name: "\"face_enhancement_creativity\""); + + } + if (request.SubjectDetection != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.SubjectDetection).HasValue ? (request.SubjectDetection).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"subject_detection\""); + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImagesUpscalePostUpscaleImageTopazStandardV2Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazStandardV2", + methodName: "ImagesUpscalePostUpscaleImageTopazStandardV2Async", + pathTemplate: "\"/v2/image/upscale/topaz-standard-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazStandardV2", + methodName: "ImagesUpscalePostUpscaleImageTopazStandardV2Async", + pathTemplate: "\"/v2/image/upscale/topaz-standard-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazStandardV2", + methodName: "ImagesUpscalePostUpscaleImageTopazStandardV2Async", + pathTemplate: "\"/v2/image/upscale/topaz-standard-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImagesUpscalePostUpscaleImageTopazStandardV2Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazStandardV2", + methodName: "ImagesUpscalePostUpscaleImageTopazStandardV2Async", + pathTemplate: "\"/v2/image/upscale/topaz-standard-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazStandardV2", + methodName: "ImagesUpscalePostUpscaleImageTopazStandardV2Async", + pathTemplate: "\"/v2/image/upscale/topaz-standard-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided, or the output would exceed the 8K limit. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The source image was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImagesUpscalePostUpscaleImageTopazStandardV2ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.UpscaleImageTopazStandardV2Response.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.UpscaleImageTopazStandardV2Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesUpscaleClient.ImagesUpscalePostUpscaleImageTopazTextRefine.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesUpscaleClient.ImagesUpscalePostUpscaleImageTopazTextRefine.g.cs new file mode 100644 index 00000000..c81f8bbf --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.ImagesUpscaleClient.ImagesUpscalePostUpscaleImageTopazTextRefine.g.cs @@ -0,0 +1,2660 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class ImagesUpscaleClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_ImagesUpscalePostUpscaleImageTopazTextRefineSecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_ImagesUpscalePostUpscaleImageTopazTextRefineSecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_ImagesUpscalePostUpscaleImageTopazTextRefineSecurityRequirement0, + }; + partial void PrepareImagesUpscalePostUpscaleImageTopazTextRefineArguments( + global::System.Net.Http.HttpClient httpClient, + ref bool? dryRun, + global::Ideogram.ImagesUpscalePostUpscaleImageTopazTextRefineRequest request); + partial void PrepareImagesUpscalePostUpscaleImageTopazTextRefineRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + bool? dryRun, + global::Ideogram.ImagesUpscalePostUpscaleImageTopazTextRefineRequest request); + partial void ProcessImagesUpscalePostUpscaleImageTopazTextRefineResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessImagesUpscalePostUpscaleImageTopazTextRefineResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Upscale with Topaz Text Refine
+ /// Upscale an image to 2x, 4x, or 8x its original resolution; no prompt is
+ /// needed. Upload the source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesUpscalePostUpscaleImageTopazTextRefineAsync( + + global::Ideogram.ImagesUpscalePostUpscaleImageTopazTextRefineRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ImagesUpscalePostUpscaleImageTopazTextRefineAsResponseAsync( + + request: request, + dryRun: dryRun, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Upscale with Topaz Text Refine
+ /// Upscale an image to 2x, 4x, or 8x its original resolution; no prompt is
+ /// needed. Upload the source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ImagesUpscalePostUpscaleImageTopazTextRefineAsResponseAsync( + + global::Ideogram.ImagesUpscalePostUpscaleImageTopazTextRefineRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareImagesUpscalePostUpscaleImageTopazTextRefineArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImagesUpscalePostUpscaleImageTopazTextRefineSecurityRequirements, + operationName: "ImagesUpscalePostUpscaleImageTopazTextRefineAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/upscale/topaz-text-refine", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.UpscaleFactor != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.UpscaleFactor).HasValue ? (request.UpscaleFactor).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"upscale_factor\""); + + } + if (request.Strength != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Strength ?? string.Empty), + name: "\"strength\""); + + } + if (request.Sharpen != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Sharpen ?? string.Empty), + name: "\"sharpen\""); + + } + if (request.Denoise != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Denoise ?? string.Empty), + name: "\"denoise\""); + + } + if (request.FixCompression != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.FixCompression ?? string.Empty), + name: "\"fix_compression\""); + + } + if (request.FaceEnhancement != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.FaceEnhancement, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"face_enhancement\""); + + } + if (request.FaceEnhancementStrength != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.FaceEnhancementStrength ?? string.Empty), + name: "\"face_enhancement_strength\""); + + } + if (request.FaceEnhancementCreativity != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.FaceEnhancementCreativity ?? string.Empty), + name: "\"face_enhancement_creativity\""); + + } + if (request.SubjectDetection != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.SubjectDetection).HasValue ? (request.SubjectDetection).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"subject_detection\""); + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImagesUpscalePostUpscaleImageTopazTextRefineRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazTextRefine", + methodName: "ImagesUpscalePostUpscaleImageTopazTextRefineAsync", + pathTemplate: "\"/v2/image/upscale/topaz-text-refine\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazTextRefine", + methodName: "ImagesUpscalePostUpscaleImageTopazTextRefineAsync", + pathTemplate: "\"/v2/image/upscale/topaz-text-refine\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazTextRefine", + methodName: "ImagesUpscalePostUpscaleImageTopazTextRefineAsync", + pathTemplate: "\"/v2/image/upscale/topaz-text-refine\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImagesUpscalePostUpscaleImageTopazTextRefineResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazTextRefine", + methodName: "ImagesUpscalePostUpscaleImageTopazTextRefineAsync", + pathTemplate: "\"/v2/image/upscale/topaz-text-refine\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazTextRefine", + methodName: "ImagesUpscalePostUpscaleImageTopazTextRefineAsync", + pathTemplate: "\"/v2/image/upscale/topaz-text-refine\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided, or the output would exceed the 8K limit. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The source image was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImagesUpscalePostUpscaleImageTopazTextRefineResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.UpscaleImageTopazTextRefineResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.UpscaleImageTopazTextRefineResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Upscale with Topaz Text Refine
+ /// Upscale an image to 2x, 4x, or 8x its original resolution; no prompt is
+ /// needed. Upload the source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
+ /// Default Value: x2 + /// + /// + /// Overall intensity of the enhancement model, from 0.01 to 1. Higher values look crisper but can turn unrealistic. Omit to let the model choose per image. + /// + /// + /// Edge sharpening applied after enlarging, from 0 to 1. Omit to let the model choose per image. + /// + /// + /// Noise and grain reduction, from 0 to 1. Omit to let the model choose per image. + /// + /// + /// Compression artifact removal, from 0 to 1. Omit to let the model choose per image. + /// + /// + /// Recover detail in faces. When true, `face_enhancement_strength` and `face_enhancement_creativity` are required. + /// + /// + /// How strongly faces are recovered, from 0 to 1. + /// + /// + /// How freely face recovery may reinterpret features, from 0 (faithful) to 1 (creative). + /// + /// + /// Where enhancements apply. Omit to let the model choose per image. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesUpscalePostUpscaleImageTopazTextRefineAsync( + byte[] image, + string imagename, + bool? dryRun = default, + global::Ideogram.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? upscaleFactor = default, + string? strength = default, + string? sharpen = default, + string? denoise = default, + string? fixCompression = default, + bool? faceEnhancement = default, + string? faceEnhancementStrength = default, + string? faceEnhancementCreativity = default, + global::Ideogram.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection? subjectDetection = default, + int? seed = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Ideogram.ImagesUpscalePostUpscaleImageTopazTextRefineRequest + { + Image = image, + Imagename = imagename, + UpscaleFactor = upscaleFactor, + Strength = strength, + Sharpen = sharpen, + Denoise = denoise, + FixCompression = fixCompression, + FaceEnhancement = faceEnhancement, + FaceEnhancementStrength = faceEnhancementStrength, + FaceEnhancementCreativity = faceEnhancementCreativity, + SubjectDetection = subjectDetection, + Seed = seed, + Async = async, + WebhookUrl = webhookUrl, + }; + + return await ImagesUpscalePostUpscaleImageTopazTextRefineAsync( + dryRun: dryRun, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// Upscale with Topaz Text Refine
+ /// Upscale an image to 2x, 4x, or 8x its original resolution; no prompt is
+ /// needed. Upload the source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
+ /// Default Value: x2 + /// + /// + /// Overall intensity of the enhancement model, from 0.01 to 1. Higher values look crisper but can turn unrealistic. Omit to let the model choose per image. + /// + /// + /// Edge sharpening applied after enlarging, from 0 to 1. Omit to let the model choose per image. + /// + /// + /// Noise and grain reduction, from 0 to 1. Omit to let the model choose per image. + /// + /// + /// Compression artifact removal, from 0 to 1. Omit to let the model choose per image. + /// + /// + /// Recover detail in faces. When true, `face_enhancement_strength` and `face_enhancement_creativity` are required. + /// + /// + /// How strongly faces are recovered, from 0 to 1. + /// + /// + /// How freely face recovery may reinterpret features, from 0 (faithful) to 1 (creative). + /// + /// + /// Where enhancements apply. Omit to let the model choose per image. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesUpscalePostUpscaleImageTopazTextRefineAsync( + global::System.IO.Stream image, + string imagename, + bool? dryRun = default, + global::Ideogram.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? upscaleFactor = default, + string? strength = default, + string? sharpen = default, + string? denoise = default, + string? fixCompression = default, + bool? faceEnhancement = default, + string? faceEnhancementStrength = default, + string? faceEnhancementCreativity = default, + global::Ideogram.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection? subjectDetection = default, + int? seed = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + var request = new global::Ideogram.ImagesUpscalePostUpscaleImageTopazTextRefineRequest + { + Image = global::System.Array.Empty(), + Imagename = imagename, + UpscaleFactor = upscaleFactor, + Strength = strength, + Sharpen = sharpen, + Denoise = denoise, + FixCompression = fixCompression, + FaceEnhancement = faceEnhancement, + FaceEnhancementStrength = faceEnhancementStrength, + FaceEnhancementCreativity = faceEnhancementCreativity, + SubjectDetection = subjectDetection, + Seed = seed, + Async = async, + WebhookUrl = webhookUrl, + }; + PrepareArguments( + client: HttpClient); + PrepareImagesUpscalePostUpscaleImageTopazTextRefineArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImagesUpscalePostUpscaleImageTopazTextRefineSecurityRequirements, + operationName: "ImagesUpscalePostUpscaleImageTopazTextRefineAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/upscale/topaz-text-refine", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.UpscaleFactor != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.UpscaleFactor).HasValue ? (request.UpscaleFactor).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"upscale_factor\""); + + } + if (request.Strength != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Strength ?? string.Empty), + name: "\"strength\""); + + } + if (request.Sharpen != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Sharpen ?? string.Empty), + name: "\"sharpen\""); + + } + if (request.Denoise != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Denoise ?? string.Empty), + name: "\"denoise\""); + + } + if (request.FixCompression != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.FixCompression ?? string.Empty), + name: "\"fix_compression\""); + + } + if (request.FaceEnhancement != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.FaceEnhancement, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"face_enhancement\""); + + } + if (request.FaceEnhancementStrength != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.FaceEnhancementStrength ?? string.Empty), + name: "\"face_enhancement_strength\""); + + } + if (request.FaceEnhancementCreativity != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.FaceEnhancementCreativity ?? string.Empty), + name: "\"face_enhancement_creativity\""); + + } + if (request.SubjectDetection != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.SubjectDetection).HasValue ? (request.SubjectDetection).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"subject_detection\""); + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImagesUpscalePostUpscaleImageTopazTextRefineRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazTextRefine", + methodName: "ImagesUpscalePostUpscaleImageTopazTextRefineAsync", + pathTemplate: "\"/v2/image/upscale/topaz-text-refine\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazTextRefine", + methodName: "ImagesUpscalePostUpscaleImageTopazTextRefineAsync", + pathTemplate: "\"/v2/image/upscale/topaz-text-refine\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazTextRefine", + methodName: "ImagesUpscalePostUpscaleImageTopazTextRefineAsync", + pathTemplate: "\"/v2/image/upscale/topaz-text-refine\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImagesUpscalePostUpscaleImageTopazTextRefineResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazTextRefine", + methodName: "ImagesUpscalePostUpscaleImageTopazTextRefineAsync", + pathTemplate: "\"/v2/image/upscale/topaz-text-refine\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazTextRefine", + methodName: "ImagesUpscalePostUpscaleImageTopazTextRefineAsync", + pathTemplate: "\"/v2/image/upscale/topaz-text-refine\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided, or the output would exceed the 8K limit. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The source image was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImagesUpscalePostUpscaleImageTopazTextRefineResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::Ideogram.UpscaleImageTopazTextRefineResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::Ideogram.UpscaleImageTopazTextRefineResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Upscale with Topaz Text Refine
+ /// Upscale an image to 2x, 4x, or 8x its original resolution; no prompt is
+ /// needed. Upload the source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
+ /// Default Value: x2 + /// + /// + /// Overall intensity of the enhancement model, from 0.01 to 1. Higher values look crisper but can turn unrealistic. Omit to let the model choose per image. + /// + /// + /// Edge sharpening applied after enlarging, from 0 to 1. Omit to let the model choose per image. + /// + /// + /// Noise and grain reduction, from 0 to 1. Omit to let the model choose per image. + /// + /// + /// Compression artifact removal, from 0 to 1. Omit to let the model choose per image. + /// + /// + /// Recover detail in faces. When true, `face_enhancement_strength` and `face_enhancement_creativity` are required. + /// + /// + /// How strongly faces are recovered, from 0 to 1. + /// + /// + /// How freely face recovery may reinterpret features, from 0 (faithful) to 1 (creative). + /// + /// + /// Where enhancements apply. Omit to let the model choose per image. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ImagesUpscalePostUpscaleImageTopazTextRefineAsResponseAsync( + global::System.IO.Stream image, + string imagename, + bool? dryRun = default, + global::Ideogram.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? upscaleFactor = default, + string? strength = default, + string? sharpen = default, + string? denoise = default, + string? fixCompression = default, + bool? faceEnhancement = default, + string? faceEnhancementStrength = default, + string? faceEnhancementCreativity = default, + global::Ideogram.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection? subjectDetection = default, + int? seed = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + var request = new global::Ideogram.ImagesUpscalePostUpscaleImageTopazTextRefineRequest + { + Image = global::System.Array.Empty(), + Imagename = imagename, + UpscaleFactor = upscaleFactor, + Strength = strength, + Sharpen = sharpen, + Denoise = denoise, + FixCompression = fixCompression, + FaceEnhancement = faceEnhancement, + FaceEnhancementStrength = faceEnhancementStrength, + FaceEnhancementCreativity = faceEnhancementCreativity, + SubjectDetection = subjectDetection, + Seed = seed, + Async = async, + WebhookUrl = webhookUrl, + }; + PrepareArguments( + client: HttpClient); + PrepareImagesUpscalePostUpscaleImageTopazTextRefineArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImagesUpscalePostUpscaleImageTopazTextRefineSecurityRequirements, + operationName: "ImagesUpscalePostUpscaleImageTopazTextRefineAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/upscale/topaz-text-refine", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.UpscaleFactor != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.UpscaleFactor).HasValue ? (request.UpscaleFactor).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"upscale_factor\""); + + } + if (request.Strength != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Strength ?? string.Empty), + name: "\"strength\""); + + } + if (request.Sharpen != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Sharpen ?? string.Empty), + name: "\"sharpen\""); + + } + if (request.Denoise != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Denoise ?? string.Empty), + name: "\"denoise\""); + + } + if (request.FixCompression != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.FixCompression ?? string.Empty), + name: "\"fix_compression\""); + + } + if (request.FaceEnhancement != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.FaceEnhancement, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"face_enhancement\""); + + } + if (request.FaceEnhancementStrength != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.FaceEnhancementStrength ?? string.Empty), + name: "\"face_enhancement_strength\""); + + } + if (request.FaceEnhancementCreativity != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.FaceEnhancementCreativity ?? string.Empty), + name: "\"face_enhancement_creativity\""); + + } + if (request.SubjectDetection != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.SubjectDetection).HasValue ? (request.SubjectDetection).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"subject_detection\""); + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImagesUpscalePostUpscaleImageTopazTextRefineRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazTextRefine", + methodName: "ImagesUpscalePostUpscaleImageTopazTextRefineAsync", + pathTemplate: "\"/v2/image/upscale/topaz-text-refine\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazTextRefine", + methodName: "ImagesUpscalePostUpscaleImageTopazTextRefineAsync", + pathTemplate: "\"/v2/image/upscale/topaz-text-refine\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazTextRefine", + methodName: "ImagesUpscalePostUpscaleImageTopazTextRefineAsync", + pathTemplate: "\"/v2/image/upscale/topaz-text-refine\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImagesUpscalePostUpscaleImageTopazTextRefineResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazTextRefine", + methodName: "ImagesUpscalePostUpscaleImageTopazTextRefineAsync", + pathTemplate: "\"/v2/image/upscale/topaz-text-refine\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazTextRefine", + methodName: "ImagesUpscalePostUpscaleImageTopazTextRefineAsync", + pathTemplate: "\"/v2/image/upscale/topaz-text-refine\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided, or the output would exceed the 8K limit. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The source image was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImagesUpscalePostUpscaleImageTopazTextRefineResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.UpscaleImageTopazTextRefineResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.UpscaleImageTopazTextRefineResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesUpscaleClient.ImagesUpscalePostUpscaleImageTopazWonder35.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesUpscaleClient.ImagesUpscalePostUpscaleImageTopazWonder35.g.cs new file mode 100644 index 00000000..b2bc5462 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.ImagesUpscaleClient.ImagesUpscalePostUpscaleImageTopazWonder35.g.cs @@ -0,0 +1,2395 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class ImagesUpscaleClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_ImagesUpscalePostUpscaleImageTopazWonder35SecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_ImagesUpscalePostUpscaleImageTopazWonder35SecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_ImagesUpscalePostUpscaleImageTopazWonder35SecurityRequirement0, + }; + partial void PrepareImagesUpscalePostUpscaleImageTopazWonder35Arguments( + global::System.Net.Http.HttpClient httpClient, + ref bool? dryRun, + global::Ideogram.ImagesUpscalePostUpscaleImageTopazWonder35Request request); + partial void PrepareImagesUpscalePostUpscaleImageTopazWonder35Request( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + bool? dryRun, + global::Ideogram.ImagesUpscalePostUpscaleImageTopazWonder35Request request); + partial void ProcessImagesUpscalePostUpscaleImageTopazWonder35Response( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessImagesUpscalePostUpscaleImageTopazWonder35ResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Upscale with Topaz Wonder 3.5
+ /// Upscale an image to 2x, 4x, or 8x its original resolution, with
+ /// `enhancement_strength` controlling how strongly detail is reconstructed.
+ /// Upload the source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesUpscalePostUpscaleImageTopazWonder35Async( + + global::Ideogram.ImagesUpscalePostUpscaleImageTopazWonder35Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ImagesUpscalePostUpscaleImageTopazWonder35AsResponseAsync( + + request: request, + dryRun: dryRun, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Upscale with Topaz Wonder 3.5
+ /// Upscale an image to 2x, 4x, or 8x its original resolution, with
+ /// `enhancement_strength` controlling how strongly detail is reconstructed.
+ /// Upload the source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ImagesUpscalePostUpscaleImageTopazWonder35AsResponseAsync( + + global::Ideogram.ImagesUpscalePostUpscaleImageTopazWonder35Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareImagesUpscalePostUpscaleImageTopazWonder35Arguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImagesUpscalePostUpscaleImageTopazWonder35SecurityRequirements, + operationName: "ImagesUpscalePostUpscaleImageTopazWonder35Async"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/upscale/topaz-wonder-3-5", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.UpscaleFactor != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.UpscaleFactor).HasValue ? (request.UpscaleFactor).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"upscale_factor\""); + + } + if (request.EnhancementStrength != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.EnhancementStrength).HasValue ? (request.EnhancementStrength).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"enhancement_strength\""); + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImagesUpscalePostUpscaleImageTopazWonder35Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazWonder35", + methodName: "ImagesUpscalePostUpscaleImageTopazWonder35Async", + pathTemplate: "\"/v2/image/upscale/topaz-wonder-3-5\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazWonder35", + methodName: "ImagesUpscalePostUpscaleImageTopazWonder35Async", + pathTemplate: "\"/v2/image/upscale/topaz-wonder-3-5\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazWonder35", + methodName: "ImagesUpscalePostUpscaleImageTopazWonder35Async", + pathTemplate: "\"/v2/image/upscale/topaz-wonder-3-5\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImagesUpscalePostUpscaleImageTopazWonder35Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazWonder35", + methodName: "ImagesUpscalePostUpscaleImageTopazWonder35Async", + pathTemplate: "\"/v2/image/upscale/topaz-wonder-3-5\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazWonder35", + methodName: "ImagesUpscalePostUpscaleImageTopazWonder35Async", + pathTemplate: "\"/v2/image/upscale/topaz-wonder-3-5\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided, or the output would exceed the 8K limit. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The source image was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImagesUpscalePostUpscaleImageTopazWonder35ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.UpscaleImageTopazWonder35Response.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.UpscaleImageTopazWonder35Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Upscale with Topaz Wonder 3.5
+ /// Upscale an image to 2x, 4x, or 8x its original resolution, with
+ /// `enhancement_strength` controlling how strongly detail is reconstructed.
+ /// Upload the source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
+ /// Default Value: x2 + /// + /// + /// How strongly the generative model reconstructs detail while upscaling. Lower values stay closer to the source image; higher values produce a more enhanced result.
+ /// Default Value: high + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesUpscalePostUpscaleImageTopazWonder35Async( + byte[] image, + string imagename, + bool? dryRun = default, + global::Ideogram.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? upscaleFactor = default, + global::Ideogram.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaEnhancementStrength? enhancementStrength = default, + int? seed = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Ideogram.ImagesUpscalePostUpscaleImageTopazWonder35Request + { + Image = image, + Imagename = imagename, + UpscaleFactor = upscaleFactor, + EnhancementStrength = enhancementStrength, + Seed = seed, + Async = async, + WebhookUrl = webhookUrl, + }; + + return await ImagesUpscalePostUpscaleImageTopazWonder35Async( + dryRun: dryRun, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// Upscale with Topaz Wonder 3.5
+ /// Upscale an image to 2x, 4x, or 8x its original resolution, with
+ /// `enhancement_strength` controlling how strongly detail is reconstructed.
+ /// Upload the source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
+ /// Default Value: x2 + /// + /// + /// How strongly the generative model reconstructs detail while upscaling. Lower values stay closer to the source image; higher values produce a more enhanced result.
+ /// Default Value: high + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImagesUpscalePostUpscaleImageTopazWonder35Async( + global::System.IO.Stream image, + string imagename, + bool? dryRun = default, + global::Ideogram.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? upscaleFactor = default, + global::Ideogram.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaEnhancementStrength? enhancementStrength = default, + int? seed = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + var request = new global::Ideogram.ImagesUpscalePostUpscaleImageTopazWonder35Request + { + Image = global::System.Array.Empty(), + Imagename = imagename, + UpscaleFactor = upscaleFactor, + EnhancementStrength = enhancementStrength, + Seed = seed, + Async = async, + WebhookUrl = webhookUrl, + }; + PrepareArguments( + client: HttpClient); + PrepareImagesUpscalePostUpscaleImageTopazWonder35Arguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImagesUpscalePostUpscaleImageTopazWonder35SecurityRequirements, + operationName: "ImagesUpscalePostUpscaleImageTopazWonder35Async"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/upscale/topaz-wonder-3-5", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.UpscaleFactor != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.UpscaleFactor).HasValue ? (request.UpscaleFactor).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"upscale_factor\""); + + } + if (request.EnhancementStrength != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.EnhancementStrength).HasValue ? (request.EnhancementStrength).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"enhancement_strength\""); + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImagesUpscalePostUpscaleImageTopazWonder35Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazWonder35", + methodName: "ImagesUpscalePostUpscaleImageTopazWonder35Async", + pathTemplate: "\"/v2/image/upscale/topaz-wonder-3-5\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazWonder35", + methodName: "ImagesUpscalePostUpscaleImageTopazWonder35Async", + pathTemplate: "\"/v2/image/upscale/topaz-wonder-3-5\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazWonder35", + methodName: "ImagesUpscalePostUpscaleImageTopazWonder35Async", + pathTemplate: "\"/v2/image/upscale/topaz-wonder-3-5\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImagesUpscalePostUpscaleImageTopazWonder35Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazWonder35", + methodName: "ImagesUpscalePostUpscaleImageTopazWonder35Async", + pathTemplate: "\"/v2/image/upscale/topaz-wonder-3-5\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazWonder35", + methodName: "ImagesUpscalePostUpscaleImageTopazWonder35Async", + pathTemplate: "\"/v2/image/upscale/topaz-wonder-3-5\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided, or the output would exceed the 8K limit. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The source image was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImagesUpscalePostUpscaleImageTopazWonder35ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::Ideogram.UpscaleImageTopazWonder35Response.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::Ideogram.UpscaleImageTopazWonder35Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Upscale with Topaz Wonder 3.5
+ /// Upscale an image to 2x, 4x, or 8x its original resolution, with
+ /// `enhancement_strength` controlling how strongly detail is reconstructed.
+ /// Upload the source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
+ /// Default Value: x2 + /// + /// + /// How strongly the generative model reconstructs detail while upscaling. Lower values stay closer to the source image; higher values produce a more enhanced result.
+ /// Default Value: high + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ImagesUpscalePostUpscaleImageTopazWonder35AsResponseAsync( + global::System.IO.Stream image, + string imagename, + bool? dryRun = default, + global::Ideogram.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? upscaleFactor = default, + global::Ideogram.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaEnhancementStrength? enhancementStrength = default, + int? seed = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + var request = new global::Ideogram.ImagesUpscalePostUpscaleImageTopazWonder35Request + { + Image = global::System.Array.Empty(), + Imagename = imagename, + UpscaleFactor = upscaleFactor, + EnhancementStrength = enhancementStrength, + Seed = seed, + Async = async, + WebhookUrl = webhookUrl, + }; + PrepareArguments( + client: HttpClient); + PrepareImagesUpscalePostUpscaleImageTopazWonder35Arguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImagesUpscalePostUpscaleImageTopazWonder35SecurityRequirements, + operationName: "ImagesUpscalePostUpscaleImageTopazWonder35Async"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/upscale/topaz-wonder-3-5", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.UpscaleFactor != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.UpscaleFactor).HasValue ? (request.UpscaleFactor).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"upscale_factor\""); + + } + if (request.EnhancementStrength != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.EnhancementStrength).HasValue ? (request.EnhancementStrength).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"enhancement_strength\""); + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImagesUpscalePostUpscaleImageTopazWonder35Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazWonder35", + methodName: "ImagesUpscalePostUpscaleImageTopazWonder35Async", + pathTemplate: "\"/v2/image/upscale/topaz-wonder-3-5\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazWonder35", + methodName: "ImagesUpscalePostUpscaleImageTopazWonder35Async", + pathTemplate: "\"/v2/image/upscale/topaz-wonder-3-5\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazWonder35", + methodName: "ImagesUpscalePostUpscaleImageTopazWonder35Async", + pathTemplate: "\"/v2/image/upscale/topaz-wonder-3-5\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImagesUpscalePostUpscaleImageTopazWonder35Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazWonder35", + methodName: "ImagesUpscalePostUpscaleImageTopazWonder35Async", + pathTemplate: "\"/v2/image/upscale/topaz-wonder-3-5\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImagesUpscalePostUpscaleImageTopazWonder35", + methodName: "ImagesUpscalePostUpscaleImageTopazWonder35Async", + pathTemplate: "\"/v2/image/upscale/topaz-wonder-3-5\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided, or the output would exceed the 8K limit. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The source image was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImagesUpscalePostUpscaleImageTopazWonder35ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.UpscaleImageTopazWonder35Response.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.UpscaleImageTopazWonder35Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesUpscaleClient.PostUpscaleImageNanoBananaPro.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesUpscaleClient.PostUpscaleImageNanoBananaPro.g.cs deleted file mode 100644 index 8d1b6f81..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ImagesUpscaleClient.PostUpscaleImageNanoBananaPro.g.cs +++ /dev/null @@ -1,926 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ImagesUpscaleClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostUpscaleImageNanoBananaProSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostUpscaleImageNanoBananaProSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostUpscaleImageNanoBananaProSecurityRequirement0, - }; - partial void PreparePostUpscaleImageNanoBananaProArguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? dryRun, - global::Ideogram.UpscaleImageNanoBananaProRequest request); - partial void PreparePostUpscaleImageNanoBananaProRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? dryRun, - global::Ideogram.UpscaleImageNanoBananaProRequest request); - partial void ProcessPostUpscaleImageNanoBananaProResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostUpscaleImageNanoBananaProResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Upscale with Nano Banana Pro
- /// Regenerate an image at a higher `resolution_tier` (1K, 2K, or 4K) while
- /// preserving its content, composition, and style. Upload the source
- /// `image` using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostUpscaleImageNanoBananaProAsync( - - global::Ideogram.UpscaleImageNanoBananaProRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostUpscaleImageNanoBananaProAsResponseAsync( - - request: request, - dryRun: dryRun, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Upscale with Nano Banana Pro
- /// Regenerate an image at a higher `resolution_tier` (1K, 2K, or 4K) while
- /// preserving its content, composition, and style. Upload the source
- /// `image` using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostUpscaleImageNanoBananaProAsResponseAsync( - - global::Ideogram.UpscaleImageNanoBananaProRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostUpscaleImageNanoBananaProArguments( - httpClient: HttpClient, - dryRun: ref dryRun, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostUpscaleImageNanoBananaProSecurityRequirements, - operationName: "PostUpscaleImageNanoBananaProAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/image/upscale/nano-banana-pro", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (request.ImageAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ImageAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"image_asset_identifier\""); - - } - if (request.Image != default) - { - - var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.Prompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - } - if (request.ResolutionTier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.ResolutionTier).HasValue ? (request.ResolutionTier).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"resolution_tier\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.Async != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"async\""); - - } - if (request.WebhookUrl != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), - name: "\"webhook_url\""); - - } - if (request.Private != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"private\""); - - } - if (request.TargetCollectionId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.TargetCollectionId ?? string.Empty), - name: "\"target_collection_id\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostUpscaleImageNanoBananaProRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - dryRun: dryRun, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostUpscaleImageNanoBananaPro", - methodName: "PostUpscaleImageNanoBananaProAsync", - pathTemplate: "\"/v2/image/upscale/nano-banana-pro\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostUpscaleImageNanoBananaPro", - methodName: "PostUpscaleImageNanoBananaProAsync", - pathTemplate: "\"/v2/image/upscale/nano-banana-pro\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostUpscaleImageNanoBananaPro", - methodName: "PostUpscaleImageNanoBananaProAsync", - pathTemplate: "\"/v2/image/upscale/nano-banana-pro\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostUpscaleImageNanoBananaProResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostUpscaleImageNanoBananaPro", - methodName: "PostUpscaleImageNanoBananaProAsync", - pathTemplate: "\"/v2/image/upscale/nano-banana-pro\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostUpscaleImageNanoBananaPro", - methodName: "PostUpscaleImageNanoBananaProAsync", - pathTemplate: "\"/v2/image/upscale/nano-banana-pro\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 500) - { - string? __content_500 = null; - global::System.Exception? __exception_500 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_500 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_500, - responseBody: __content_500, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostUpscaleImageNanoBananaProResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.UpscaleImageNanoBananaProResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.UpscaleImageNanoBananaProResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Upscale with Nano Banana Pro
- /// Regenerate an image at a higher `resolution_tier` (1K, 2K, or 4K) while
- /// preserving its content, composition, and style. Upload the source
- /// `image` using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - /// - /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - /// - /// Optional short guidance for the enhancement, appended to the model's upscaling instruction. When omitted, the image is upscaled as-is. - /// - /// - /// The output resolution tier. The model sizes its output by tier at the source image's aspect ratio; exact pixel dimensions cannot be requested. Rejected when the source is already at or above the requested tier. Defaults to "2K".
- /// Default Value: 2K - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostUpscaleImageNanoBananaProAsync( - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - string? prompt = default, - global::Ideogram.UpscaleImageNanoBananaProRequestResolutionTier? resolutionTier = default, - int? seed = default, - bool? async = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.UpscaleImageNanoBananaProRequest - { - ImageAssetIdentifier = imageAssetIdentifier, - Image = image, - Imagename = imagename, - Prompt = prompt, - ResolutionTier = resolutionTier, - Seed = seed, - Async = async, - WebhookUrl = webhookUrl, - Private = @private, - TargetCollectionId = targetCollectionId, - }; - - return await PostUpscaleImageNanoBananaProAsync( - dryRun: dryRun, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesUpscaleClient.PostUpscaleImageTopazBloom2.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesUpscaleClient.PostUpscaleImageTopazBloom2.g.cs deleted file mode 100644 index 6e02a35c..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ImagesUpscaleClient.PostUpscaleImageTopazBloom2.g.cs +++ /dev/null @@ -1,954 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ImagesUpscaleClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostUpscaleImageTopazBloom2SecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostUpscaleImageTopazBloom2SecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostUpscaleImageTopazBloom2SecurityRequirement0, - }; - partial void PreparePostUpscaleImageTopazBloom2Arguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? dryRun, - global::Ideogram.UpscaleImageTopazBloom2Request request); - partial void PreparePostUpscaleImageTopazBloom2Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? dryRun, - global::Ideogram.UpscaleImageTopazBloom2Request request); - partial void ProcessPostUpscaleImageTopazBloom2Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostUpscaleImageTopazBloom2ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Upscale with Topaz Bloom 2
- /// Creatively upscale an image to 2x, 4x, or 8x its original resolution,
- /// optionally guided by a `prompt`. Upload the source `image` using
- /// `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostUpscaleImageTopazBloom2Async( - - global::Ideogram.UpscaleImageTopazBloom2Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostUpscaleImageTopazBloom2AsResponseAsync( - - request: request, - dryRun: dryRun, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Upscale with Topaz Bloom 2
- /// Creatively upscale an image to 2x, 4x, or 8x its original resolution,
- /// optionally guided by a `prompt`. Upload the source `image` using
- /// `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostUpscaleImageTopazBloom2AsResponseAsync( - - global::Ideogram.UpscaleImageTopazBloom2Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostUpscaleImageTopazBloom2Arguments( - httpClient: HttpClient, - dryRun: ref dryRun, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostUpscaleImageTopazBloom2SecurityRequirements, - operationName: "PostUpscaleImageTopazBloom2Async"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/image/upscale/topaz-bloom-2", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (request.ImageAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ImageAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"image_asset_identifier\""); - - } - if (request.Image != default) - { - - var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.UpscaleFactor != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.UpscaleFactor).HasValue ? (request.UpscaleFactor).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"upscale_factor\""); - - } - if (request.Prompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - } - if (request.Creativity != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Creativity, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"creativity\""); - - } - if (request.ColorPreservation != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.ColorPreservation, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"color_preservation\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.Async != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"async\""); - - } - if (request.WebhookUrl != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), - name: "\"webhook_url\""); - - } - if (request.Private != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"private\""); - - } - if (request.TargetCollectionId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.TargetCollectionId ?? string.Empty), - name: "\"target_collection_id\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostUpscaleImageTopazBloom2Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - dryRun: dryRun, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostUpscaleImageTopazBloom2", - methodName: "PostUpscaleImageTopazBloom2Async", - pathTemplate: "\"/v2/image/upscale/topaz-bloom-2\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostUpscaleImageTopazBloom2", - methodName: "PostUpscaleImageTopazBloom2Async", - pathTemplate: "\"/v2/image/upscale/topaz-bloom-2\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostUpscaleImageTopazBloom2", - methodName: "PostUpscaleImageTopazBloom2Async", - pathTemplate: "\"/v2/image/upscale/topaz-bloom-2\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostUpscaleImageTopazBloom2Response( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostUpscaleImageTopazBloom2", - methodName: "PostUpscaleImageTopazBloom2Async", - pathTemplate: "\"/v2/image/upscale/topaz-bloom-2\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostUpscaleImageTopazBloom2", - methodName: "PostUpscaleImageTopazBloom2Async", - pathTemplate: "\"/v2/image/upscale/topaz-bloom-2\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 500) - { - string? __content_500 = null; - global::System.Exception? __exception_500 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_500 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_500, - responseBody: __content_500, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostUpscaleImageTopazBloom2ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.UpscaleImageTopazBloom2Response.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.UpscaleImageTopazBloom2Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Upscale with Topaz Bloom 2
- /// Creatively upscale an image to 2x, 4x, or 8x its original resolution,
- /// optionally guided by a `prompt`. Upload the source `image` using
- /// `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - /// - /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - /// - /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
- /// Default Value: x2 - /// - /// - /// An optional prompt guiding the detail the model regenerates while enlarging the image. Leave empty to enhance the source image as-is. - /// - /// - /// How strongly the model reinterprets the source while enlarging it, from 1 (most faithful) to 9 (most creative).
- /// Default Value: 3 - /// - /// - /// When true (the default), the output keeps the source image's colors. Set to false to let the model adjust colors while enhancing.
- /// Default Value: true - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostUpscaleImageTopazBloom2Async( - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - global::Ideogram.UpscaleImageTopazBloom2RequestUpscaleFactor? upscaleFactor = default, - string? prompt = default, - int? creativity = default, - bool? colorPreservation = default, - int? seed = default, - bool? async = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.UpscaleImageTopazBloom2Request - { - ImageAssetIdentifier = imageAssetIdentifier, - Image = image, - Imagename = imagename, - UpscaleFactor = upscaleFactor, - Prompt = prompt, - Creativity = creativity, - ColorPreservation = colorPreservation, - Seed = seed, - Async = async, - WebhookUrl = webhookUrl, - Private = @private, - TargetCollectionId = targetCollectionId, - }; - - return await PostUpscaleImageTopazBloom2Async( - dryRun: dryRun, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesUpscaleClient.PostUpscaleImageTopazRedefine.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesUpscaleClient.PostUpscaleImageTopazRedefine.g.cs deleted file mode 100644 index b364b050..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ImagesUpscaleClient.PostUpscaleImageTopazRedefine.g.cs +++ /dev/null @@ -1,1073 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ImagesUpscaleClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostUpscaleImageTopazRedefineSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostUpscaleImageTopazRedefineSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostUpscaleImageTopazRedefineSecurityRequirement0, - }; - partial void PreparePostUpscaleImageTopazRedefineArguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? dryRun, - global::Ideogram.UpscaleImageTopazRedefineRequest request); - partial void PreparePostUpscaleImageTopazRedefineRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? dryRun, - global::Ideogram.UpscaleImageTopazRedefineRequest request); - partial void ProcessPostUpscaleImageTopazRedefineResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostUpscaleImageTopazRedefineResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Upscale with Topaz Redefine
- /// Creatively upscale an image to 2x, 4x, or 8x its original resolution,
- /// guided by an optional `prompt` or `autoprompt`. Upload the source
- /// `image` using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostUpscaleImageTopazRedefineAsync( - - global::Ideogram.UpscaleImageTopazRedefineRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostUpscaleImageTopazRedefineAsResponseAsync( - - request: request, - dryRun: dryRun, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Upscale with Topaz Redefine
- /// Creatively upscale an image to 2x, 4x, or 8x its original resolution,
- /// guided by an optional `prompt` or `autoprompt`. Upload the source
- /// `image` using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostUpscaleImageTopazRedefineAsResponseAsync( - - global::Ideogram.UpscaleImageTopazRedefineRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostUpscaleImageTopazRedefineArguments( - httpClient: HttpClient, - dryRun: ref dryRun, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostUpscaleImageTopazRedefineSecurityRequirements, - operationName: "PostUpscaleImageTopazRedefineAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/image/upscale/topaz-redefine", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (request.ImageAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ImageAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"image_asset_identifier\""); - - } - if (request.Image != default) - { - - var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.UpscaleFactor != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.UpscaleFactor).HasValue ? (request.UpscaleFactor).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"upscale_factor\""); - - } - if (request.Prompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - } - if (request.Creativity != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Creativity, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"creativity\""); - - } - if (request.Autoprompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Autoprompt, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"autoprompt\""); - - } - if (request.Texture != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Texture, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"texture\""); - - } - if (request.Detail != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Detail, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"detail\""); - - } - if (request.DetailStrength != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.DetailStrength, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"detail_strength\""); - - } - if (request.Sharpen != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Sharpen, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"sharpen\""); - - } - if (request.Denoise != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Denoise, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"denoise\""); - - } - if (request.FaceEnhancement != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.FaceEnhancement, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"face_enhancement\""); - - } - if (request.FaceEnhancementStrength != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.FaceEnhancementStrength, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"face_enhancement_strength\""); - - } - if (request.FaceEnhancementCreativity != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.FaceEnhancementCreativity, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"face_enhancement_creativity\""); - - } - if (request.SubjectDetection != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.SubjectDetection).HasValue ? (request.SubjectDetection).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"subject_detection\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.Async != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"async\""); - - } - if (request.WebhookUrl != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), - name: "\"webhook_url\""); - - } - if (request.Private != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"private\""); - - } - if (request.TargetCollectionId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.TargetCollectionId ?? string.Empty), - name: "\"target_collection_id\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostUpscaleImageTopazRedefineRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - dryRun: dryRun, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostUpscaleImageTopazRedefine", - methodName: "PostUpscaleImageTopazRedefineAsync", - pathTemplate: "\"/v2/image/upscale/topaz-redefine\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostUpscaleImageTopazRedefine", - methodName: "PostUpscaleImageTopazRedefineAsync", - pathTemplate: "\"/v2/image/upscale/topaz-redefine\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostUpscaleImageTopazRedefine", - methodName: "PostUpscaleImageTopazRedefineAsync", - pathTemplate: "\"/v2/image/upscale/topaz-redefine\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostUpscaleImageTopazRedefineResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostUpscaleImageTopazRedefine", - methodName: "PostUpscaleImageTopazRedefineAsync", - pathTemplate: "\"/v2/image/upscale/topaz-redefine\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostUpscaleImageTopazRedefine", - methodName: "PostUpscaleImageTopazRedefineAsync", - pathTemplate: "\"/v2/image/upscale/topaz-redefine\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 500) - { - string? __content_500 = null; - global::System.Exception? __exception_500 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_500 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_500, - responseBody: __content_500, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostUpscaleImageTopazRedefineResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.UpscaleImageTopazRedefineResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.UpscaleImageTopazRedefineResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Upscale with Topaz Redefine
- /// Creatively upscale an image to 2x, 4x, or 8x its original resolution,
- /// guided by an optional `prompt` or `autoprompt`. Upload the source
- /// `image` using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - /// - /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - /// - /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
- /// Default Value: x2 - /// - /// - /// An optional prompt guiding the detail the model regenerates while enlarging the image. Leave empty to enhance the source image as-is. - /// - /// - /// How strongly the model reinterprets the source while enlarging it, from 1 (most faithful) to 9 (most creative).
- /// Default Value: 3 - /// - /// - /// When true, the model describes the image itself and any `prompt` is ignored.
- /// Default Value: false - /// - /// - /// How much fine texture the model adds, from 1 to 5. Keep it low at low creativity.
- /// Default Value: 1 - /// - /// - /// Apply a detail adjustment after rendering. When true, `detail_strength` sets how much.
- /// Default Value: false - /// - /// - /// Detail adjustment intensity, from 0 to 10. - /// - /// - /// Edge sharpening applied after enlarging, from 0 to 1. Omit to let the model choose per image. - /// - /// - /// Noise and grain reduction, from 0 to 1. Omit to let the model choose per image. - /// - /// - /// Recover detail in faces. When true, `face_enhancement_strength` and `face_enhancement_creativity` are required. - /// - /// - /// How strongly faces are recovered, from 0 to 1. - /// - /// - /// How freely face recovery may reinterpret features, from 0 (faithful) to 1 (creative). - /// - /// - /// Where enhancements apply. Omit to let the model choose per image. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostUpscaleImageTopazRedefineAsync( - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - global::Ideogram.UpscaleImageTopazRedefineRequestUpscaleFactor? upscaleFactor = default, - string? prompt = default, - int? creativity = default, - bool? autoprompt = default, - int? texture = default, - bool? detail = default, - float? detailStrength = default, - float? sharpen = default, - float? denoise = default, - bool? faceEnhancement = default, - float? faceEnhancementStrength = default, - float? faceEnhancementCreativity = default, - global::Ideogram.UpscaleImageTopazRedefineRequestSubjectDetection? subjectDetection = default, - int? seed = default, - bool? async = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.UpscaleImageTopazRedefineRequest - { - ImageAssetIdentifier = imageAssetIdentifier, - Image = image, - Imagename = imagename, - UpscaleFactor = upscaleFactor, - Prompt = prompt, - Creativity = creativity, - Autoprompt = autoprompt, - Texture = texture, - Detail = detail, - DetailStrength = detailStrength, - Sharpen = sharpen, - Denoise = denoise, - FaceEnhancement = faceEnhancement, - FaceEnhancementStrength = faceEnhancementStrength, - FaceEnhancementCreativity = faceEnhancementCreativity, - SubjectDetection = subjectDetection, - Seed = seed, - Async = async, - WebhookUrl = webhookUrl, - Private = @private, - TargetCollectionId = targetCollectionId, - }; - - return await PostUpscaleImageTopazRedefineAsync( - dryRun: dryRun, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesUpscaleClient.PostUpscaleImageTopazStandardV2.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesUpscaleClient.PostUpscaleImageTopazStandardV2.g.cs deleted file mode 100644 index d1a470f1..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ImagesUpscaleClient.PostUpscaleImageTopazStandardV2.g.cs +++ /dev/null @@ -1,968 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ImagesUpscaleClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostUpscaleImageTopazStandardV2SecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostUpscaleImageTopazStandardV2SecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostUpscaleImageTopazStandardV2SecurityRequirement0, - }; - partial void PreparePostUpscaleImageTopazStandardV2Arguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? dryRun, - global::Ideogram.UpscaleImageTopazStandardV2Request request); - partial void PreparePostUpscaleImageTopazStandardV2Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? dryRun, - global::Ideogram.UpscaleImageTopazStandardV2Request request); - partial void ProcessPostUpscaleImageTopazStandardV2Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostUpscaleImageTopazStandardV2ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Upscale with Topaz Standard V2
- /// Upscale an image to 2x, 4x, or 8x its original resolution; no prompt is
- /// needed. Upload the source `image` using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostUpscaleImageTopazStandardV2Async( - - global::Ideogram.UpscaleImageTopazStandardV2Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostUpscaleImageTopazStandardV2AsResponseAsync( - - request: request, - dryRun: dryRun, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Upscale with Topaz Standard V2
- /// Upscale an image to 2x, 4x, or 8x its original resolution; no prompt is
- /// needed. Upload the source `image` using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostUpscaleImageTopazStandardV2AsResponseAsync( - - global::Ideogram.UpscaleImageTopazStandardV2Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostUpscaleImageTopazStandardV2Arguments( - httpClient: HttpClient, - dryRun: ref dryRun, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostUpscaleImageTopazStandardV2SecurityRequirements, - operationName: "PostUpscaleImageTopazStandardV2Async"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/image/upscale/topaz-standard-2", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (request.ImageAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ImageAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"image_asset_identifier\""); - - } - if (request.Image != default) - { - - var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.UpscaleFactor != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.UpscaleFactor).HasValue ? (request.UpscaleFactor).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"upscale_factor\""); - - } - if (request.Strength != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Strength, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"strength\""); - - } - if (request.Sharpen != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Sharpen, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"sharpen\""); - - } - if (request.Denoise != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Denoise, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"denoise\""); - - } - if (request.FixCompression != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.FixCompression, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"fix_compression\""); - - } - if (request.FaceEnhancement != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.FaceEnhancement, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"face_enhancement\""); - - } - if (request.FaceEnhancementStrength != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.FaceEnhancementStrength, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"face_enhancement_strength\""); - - } - if (request.FaceEnhancementCreativity != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.FaceEnhancementCreativity, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"face_enhancement_creativity\""); - - } - if (request.SubjectDetection != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.SubjectDetection).HasValue ? (request.SubjectDetection).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"subject_detection\""); - - } - if (request.Async != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"async\""); - - } - if (request.WebhookUrl != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), - name: "\"webhook_url\""); - - } - if (request.Private != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"private\""); - - } - if (request.TargetCollectionId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.TargetCollectionId ?? string.Empty), - name: "\"target_collection_id\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostUpscaleImageTopazStandardV2Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - dryRun: dryRun, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostUpscaleImageTopazStandardV2", - methodName: "PostUpscaleImageTopazStandardV2Async", - pathTemplate: "\"/v2/image/upscale/topaz-standard-2\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostUpscaleImageTopazStandardV2", - methodName: "PostUpscaleImageTopazStandardV2Async", - pathTemplate: "\"/v2/image/upscale/topaz-standard-2\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostUpscaleImageTopazStandardV2", - methodName: "PostUpscaleImageTopazStandardV2Async", - pathTemplate: "\"/v2/image/upscale/topaz-standard-2\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostUpscaleImageTopazStandardV2Response( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostUpscaleImageTopazStandardV2", - methodName: "PostUpscaleImageTopazStandardV2Async", - pathTemplate: "\"/v2/image/upscale/topaz-standard-2\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostUpscaleImageTopazStandardV2", - methodName: "PostUpscaleImageTopazStandardV2Async", - pathTemplate: "\"/v2/image/upscale/topaz-standard-2\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 500) - { - string? __content_500 = null; - global::System.Exception? __exception_500 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_500 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_500, - responseBody: __content_500, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostUpscaleImageTopazStandardV2ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.UpscaleImageTopazStandardV2Response.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.UpscaleImageTopazStandardV2Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Upscale with Topaz Standard V2
- /// Upscale an image to 2x, 4x, or 8x its original resolution; no prompt is
- /// needed. Upload the source `image` using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - /// - /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - /// - /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
- /// Default Value: x2 - /// - /// - /// Overall intensity of the enhancement model, from 0.01 to 1. Higher values look crisper but can turn unrealistic. Omit to let the model choose per image. - /// - /// - /// Edge sharpening applied after enlarging, from 0 to 1. Omit to let the model choose per image. - /// - /// - /// Noise and grain reduction, from 0 to 1. Omit to let the model choose per image. - /// - /// - /// Compression artifact removal, from 0 to 1. Omit to let the model choose per image. - /// - /// - /// Recover detail in faces. When true, `face_enhancement_strength` and `face_enhancement_creativity` are required. - /// - /// - /// How strongly faces are recovered, from 0 to 1. - /// - /// - /// How freely face recovery may reinterpret features, from 0 (faithful) to 1 (creative). - /// - /// - /// Where enhancements apply. Omit to let the model choose per image. - /// - /// - /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostUpscaleImageTopazStandardV2Async( - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - global::Ideogram.UpscaleImageTopazStandardV2RequestUpscaleFactor? upscaleFactor = default, - float? strength = default, - float? sharpen = default, - float? denoise = default, - float? fixCompression = default, - bool? faceEnhancement = default, - float? faceEnhancementStrength = default, - float? faceEnhancementCreativity = default, - global::Ideogram.UpscaleImageTopazStandardV2RequestSubjectDetection? subjectDetection = default, - bool? async = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.UpscaleImageTopazStandardV2Request - { - ImageAssetIdentifier = imageAssetIdentifier, - Image = image, - Imagename = imagename, - UpscaleFactor = upscaleFactor, - Strength = strength, - Sharpen = sharpen, - Denoise = denoise, - FixCompression = fixCompression, - FaceEnhancement = faceEnhancement, - FaceEnhancementStrength = faceEnhancementStrength, - FaceEnhancementCreativity = faceEnhancementCreativity, - SubjectDetection = subjectDetection, - Async = async, - WebhookUrl = webhookUrl, - Private = @private, - TargetCollectionId = targetCollectionId, - }; - - return await PostUpscaleImageTopazStandardV2Async( - dryRun: dryRun, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesUpscaleClient.PostUpscaleImageTopazTextRefine.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesUpscaleClient.PostUpscaleImageTopazTextRefine.g.cs deleted file mode 100644 index 0c90bcb3..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ImagesUpscaleClient.PostUpscaleImageTopazTextRefine.g.cs +++ /dev/null @@ -1,982 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ImagesUpscaleClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostUpscaleImageTopazTextRefineSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostUpscaleImageTopazTextRefineSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostUpscaleImageTopazTextRefineSecurityRequirement0, - }; - partial void PreparePostUpscaleImageTopazTextRefineArguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? dryRun, - global::Ideogram.UpscaleImageTopazTextRefineRequest request); - partial void PreparePostUpscaleImageTopazTextRefineRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? dryRun, - global::Ideogram.UpscaleImageTopazTextRefineRequest request); - partial void ProcessPostUpscaleImageTopazTextRefineResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostUpscaleImageTopazTextRefineResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Upscale with Topaz Text Refine
- /// Upscale an image to 2x, 4x, or 8x its original resolution; no prompt is
- /// needed. Upload the source `image` using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostUpscaleImageTopazTextRefineAsync( - - global::Ideogram.UpscaleImageTopazTextRefineRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostUpscaleImageTopazTextRefineAsResponseAsync( - - request: request, - dryRun: dryRun, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Upscale with Topaz Text Refine
- /// Upscale an image to 2x, 4x, or 8x its original resolution; no prompt is
- /// needed. Upload the source `image` using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostUpscaleImageTopazTextRefineAsResponseAsync( - - global::Ideogram.UpscaleImageTopazTextRefineRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostUpscaleImageTopazTextRefineArguments( - httpClient: HttpClient, - dryRun: ref dryRun, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostUpscaleImageTopazTextRefineSecurityRequirements, - operationName: "PostUpscaleImageTopazTextRefineAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/image/upscale/topaz-text-refine", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (request.ImageAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ImageAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"image_asset_identifier\""); - - } - if (request.Image != default) - { - - var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.UpscaleFactor != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.UpscaleFactor).HasValue ? (request.UpscaleFactor).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"upscale_factor\""); - - } - if (request.Strength != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Strength, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"strength\""); - - } - if (request.Sharpen != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Sharpen, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"sharpen\""); - - } - if (request.Denoise != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Denoise, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"denoise\""); - - } - if (request.FixCompression != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.FixCompression, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"fix_compression\""); - - } - if (request.FaceEnhancement != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.FaceEnhancement, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"face_enhancement\""); - - } - if (request.FaceEnhancementStrength != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.FaceEnhancementStrength, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"face_enhancement_strength\""); - - } - if (request.FaceEnhancementCreativity != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.FaceEnhancementCreativity, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"face_enhancement_creativity\""); - - } - if (request.SubjectDetection != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.SubjectDetection).HasValue ? (request.SubjectDetection).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"subject_detection\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.Async != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"async\""); - - } - if (request.WebhookUrl != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), - name: "\"webhook_url\""); - - } - if (request.Private != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"private\""); - - } - if (request.TargetCollectionId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.TargetCollectionId ?? string.Empty), - name: "\"target_collection_id\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostUpscaleImageTopazTextRefineRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - dryRun: dryRun, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostUpscaleImageTopazTextRefine", - methodName: "PostUpscaleImageTopazTextRefineAsync", - pathTemplate: "\"/v2/image/upscale/topaz-text-refine\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostUpscaleImageTopazTextRefine", - methodName: "PostUpscaleImageTopazTextRefineAsync", - pathTemplate: "\"/v2/image/upscale/topaz-text-refine\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostUpscaleImageTopazTextRefine", - methodName: "PostUpscaleImageTopazTextRefineAsync", - pathTemplate: "\"/v2/image/upscale/topaz-text-refine\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostUpscaleImageTopazTextRefineResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostUpscaleImageTopazTextRefine", - methodName: "PostUpscaleImageTopazTextRefineAsync", - pathTemplate: "\"/v2/image/upscale/topaz-text-refine\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostUpscaleImageTopazTextRefine", - methodName: "PostUpscaleImageTopazTextRefineAsync", - pathTemplate: "\"/v2/image/upscale/topaz-text-refine\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 500) - { - string? __content_500 = null; - global::System.Exception? __exception_500 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_500 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_500, - responseBody: __content_500, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostUpscaleImageTopazTextRefineResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.UpscaleImageTopazTextRefineResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.UpscaleImageTopazTextRefineResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Upscale with Topaz Text Refine
- /// Upscale an image to 2x, 4x, or 8x its original resolution; no prompt is
- /// needed. Upload the source `image` using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - /// - /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - /// - /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
- /// Default Value: x2 - /// - /// - /// Overall intensity of the enhancement model, from 0.01 to 1. Higher values look crisper but can turn unrealistic. Omit to let the model choose per image. - /// - /// - /// Edge sharpening applied after enlarging, from 0 to 1. Omit to let the model choose per image. - /// - /// - /// Noise and grain reduction, from 0 to 1. Omit to let the model choose per image. - /// - /// - /// Compression artifact removal, from 0 to 1. Omit to let the model choose per image. - /// - /// - /// Recover detail in faces. When true, `face_enhancement_strength` and `face_enhancement_creativity` are required. - /// - /// - /// How strongly faces are recovered, from 0 to 1. - /// - /// - /// How freely face recovery may reinterpret features, from 0 (faithful) to 1 (creative). - /// - /// - /// Where enhancements apply. Omit to let the model choose per image. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostUpscaleImageTopazTextRefineAsync( - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - global::Ideogram.UpscaleImageTopazTextRefineRequestUpscaleFactor? upscaleFactor = default, - float? strength = default, - float? sharpen = default, - float? denoise = default, - float? fixCompression = default, - bool? faceEnhancement = default, - float? faceEnhancementStrength = default, - float? faceEnhancementCreativity = default, - global::Ideogram.UpscaleImageTopazTextRefineRequestSubjectDetection? subjectDetection = default, - int? seed = default, - bool? async = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.UpscaleImageTopazTextRefineRequest - { - ImageAssetIdentifier = imageAssetIdentifier, - Image = image, - Imagename = imagename, - UpscaleFactor = upscaleFactor, - Strength = strength, - Sharpen = sharpen, - Denoise = denoise, - FixCompression = fixCompression, - FaceEnhancement = faceEnhancement, - FaceEnhancementStrength = faceEnhancementStrength, - FaceEnhancementCreativity = faceEnhancementCreativity, - SubjectDetection = subjectDetection, - Seed = seed, - Async = async, - WebhookUrl = webhookUrl, - Private = @private, - TargetCollectionId = targetCollectionId, - }; - - return await PostUpscaleImageTopazTextRefineAsync( - dryRun: dryRun, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ImagesUpscaleClient.PostUpscaleImageTopazWonder35.g.cs b/src/libs/Ideogram/Generated/Ideogram.ImagesUpscaleClient.PostUpscaleImageTopazWonder35.g.cs deleted file mode 100644 index 42abc596..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ImagesUpscaleClient.PostUpscaleImageTopazWonder35.g.cs +++ /dev/null @@ -1,895 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ImagesUpscaleClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostUpscaleImageTopazWonder35SecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostUpscaleImageTopazWonder35SecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostUpscaleImageTopazWonder35SecurityRequirement0, - }; - partial void PreparePostUpscaleImageTopazWonder35Arguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? dryRun, - global::Ideogram.UpscaleImageTopazWonder35Request request); - partial void PreparePostUpscaleImageTopazWonder35Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? dryRun, - global::Ideogram.UpscaleImageTopazWonder35Request request); - partial void ProcessPostUpscaleImageTopazWonder35Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostUpscaleImageTopazWonder35ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Upscale with Topaz Wonder 3.5
- /// Upscale an image to 2x, 4x, or 8x its original resolution, with
- /// `enhancement_strength` controlling how strongly detail is reconstructed.
- /// Upload the source `image` using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostUpscaleImageTopazWonder35Async( - - global::Ideogram.UpscaleImageTopazWonder35Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostUpscaleImageTopazWonder35AsResponseAsync( - - request: request, - dryRun: dryRun, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Upscale with Topaz Wonder 3.5
- /// Upscale an image to 2x, 4x, or 8x its original resolution, with
- /// `enhancement_strength` controlling how strongly detail is reconstructed.
- /// Upload the source `image` using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostUpscaleImageTopazWonder35AsResponseAsync( - - global::Ideogram.UpscaleImageTopazWonder35Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostUpscaleImageTopazWonder35Arguments( - httpClient: HttpClient, - dryRun: ref dryRun, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostUpscaleImageTopazWonder35SecurityRequirements, - operationName: "PostUpscaleImageTopazWonder35Async"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/image/upscale/topaz-wonder-3-5", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (request.ImageAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ImageAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"image_asset_identifier\""); - - } - if (request.Image != default) - { - - var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.UpscaleFactor != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.UpscaleFactor).HasValue ? (request.UpscaleFactor).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"upscale_factor\""); - - } - if (request.EnhancementStrength != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.EnhancementStrength).HasValue ? (request.EnhancementStrength).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"enhancement_strength\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.Async != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"async\""); - - } - if (request.WebhookUrl != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), - name: "\"webhook_url\""); - - } - if (request.Private != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"private\""); - - } - if (request.TargetCollectionId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.TargetCollectionId ?? string.Empty), - name: "\"target_collection_id\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostUpscaleImageTopazWonder35Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - dryRun: dryRun, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostUpscaleImageTopazWonder35", - methodName: "PostUpscaleImageTopazWonder35Async", - pathTemplate: "\"/v2/image/upscale/topaz-wonder-3-5\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostUpscaleImageTopazWonder35", - methodName: "PostUpscaleImageTopazWonder35Async", - pathTemplate: "\"/v2/image/upscale/topaz-wonder-3-5\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostUpscaleImageTopazWonder35", - methodName: "PostUpscaleImageTopazWonder35Async", - pathTemplate: "\"/v2/image/upscale/topaz-wonder-3-5\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostUpscaleImageTopazWonder35Response( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostUpscaleImageTopazWonder35", - methodName: "PostUpscaleImageTopazWonder35Async", - pathTemplate: "\"/v2/image/upscale/topaz-wonder-3-5\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostUpscaleImageTopazWonder35", - methodName: "PostUpscaleImageTopazWonder35Async", - pathTemplate: "\"/v2/image/upscale/topaz-wonder-3-5\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 500) - { - string? __content_500 = null; - global::System.Exception? __exception_500 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_500 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_500, - responseBody: __content_500, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostUpscaleImageTopazWonder35ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.UpscaleImageTopazWonder35Response.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.UpscaleImageTopazWonder35Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Upscale with Topaz Wonder 3.5
- /// Upscale an image to 2x, 4x, or 8x its original resolution, with
- /// `enhancement_strength` controlling how strongly detail is reconstructed.
- /// Upload the source `image` using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - /// - /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - /// - /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
- /// Default Value: x2 - /// - /// - /// How strongly the generative model reconstructs detail while upscaling. Lower values stay closer to the source image; higher values produce a more enhanced result.
- /// Default Value: high - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostUpscaleImageTopazWonder35Async( - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - global::Ideogram.UpscaleImageTopazWonder35RequestUpscaleFactor? upscaleFactor = default, - global::Ideogram.UpscaleImageTopazWonder35RequestEnhancementStrength? enhancementStrength = default, - int? seed = default, - bool? async = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.UpscaleImageTopazWonder35Request - { - ImageAssetIdentifier = imageAssetIdentifier, - Image = image, - Imagename = imagename, - UpscaleFactor = upscaleFactor, - EnhancementStrength = enhancementStrength, - Seed = seed, - Async = async, - WebhookUrl = webhookUrl, - Private = @private, - TargetCollectionId = targetCollectionId, - }; - - return await PostUpscaleImageTopazWonder35Async( - dryRun: dryRun, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Integrations.JsonSerializerContext.g.cs b/src/libs/Ideogram/Generated/Ideogram.Integrations.JsonSerializerContext.g.cs deleted file mode 100644 index 31f65626..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Integrations.JsonSerializerContext.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull - )] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(byte[]))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GetIntegrationsResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IntegrationType), TypeInfoPropertyName = "IntegrationType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IntegrationErrorResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IntegrationErrorResponseError), TypeInfoPropertyName = "IntegrationErrorResponseError2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IntegrationAssetSearchResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IntegrationAsset))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IntegrationAssetDelivery))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IntegrationAssetSearchRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IntegrationType?), TypeInfoPropertyName = "NullableIntegrationType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IntegrationErrorResponseError?), TypeInfoPropertyName = "NullableIntegrationErrorResponseError2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - internal sealed partial class IntegrationsSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext - { - } - /// - /// - /// - public sealed partial class IntegrationsSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext - { - private static readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver Resolver = new LazyChunkResolver(); - - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - internal static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver TypeInfoResolver => Resolver; - - - private static readonly global::System.Text.Json.JsonSerializerOptions DefaultOptions = CreateDefaultOptions(); - - /// - /// - /// - public static IntegrationsSourceGenerationContext Default { get; } = new(DefaultOptions); - - private IntegrationsSourceGenerationContext(global::System.Text.Json.JsonSerializerOptions options) - : base(options) - { - } - - /// - protected override global::System.Text.Json.JsonSerializerOptions? GeneratedSerializerOptions => DefaultOptions; - - /// - public override global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo(global::System.Type type) - { - return Resolver.GetTypeInfo(type, Options); - } - - /// - /// Adds this package's converters to . - /// - /// - /// A converter has to be on the options a chained resolver builds its JsonTypeInfo against, - /// and a context resolves types from every package below it. Each package contributes only - /// what it owns and calls down the chain for the rest, so the family's converter table is - /// written once rather than copied into all of them. - /// - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) - { - options.Converters.Add(new global::Ideogram.JsonConverters.UnixTimestampJsonConverter()); - options.Converters.Add(new LazyEnumJsonConverterFactory()); - } - - private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() - { - var options = new global::System.Text.Json.JsonSerializerOptions - { - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, - TypeInfoResolver = Resolver, - }; - AddConverters(options); - - return options; - } - - - private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory - { - public override bool CanConvert(global::System.Type typeToConvert) - { - return - typeToConvert == typeof(global::Ideogram.IntegrationType) - - || typeToConvert == typeof(global::Ideogram.IntegrationType?) - - || typeToConvert == typeof(global::Ideogram.IntegrationErrorResponseError) - - || typeToConvert == typeof(global::Ideogram.IntegrationErrorResponseError?); - } - - public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - if (typeToConvert == typeof(global::Ideogram.IntegrationType)) - { - return new global::Ideogram.JsonConverters.IntegrationTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.IntegrationType?)) - { - return new global::Ideogram.JsonConverters.IntegrationTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.IntegrationErrorResponseError)) - { - return new global::Ideogram.JsonConverters.IntegrationErrorResponseErrorJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.IntegrationErrorResponseError?)) - { - return new global::Ideogram.JsonConverters.IntegrationErrorResponseErrorNullableJsonConverter(); - } - throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); - } - } - - private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver - { - private readonly object _gate = new(); - private readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[] _resolvers = new global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[1]; - - public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo( - global::System.Type type, - global::System.Text.Json.JsonSerializerOptions options) - { - for (var index = 0; index < _resolvers.Length; index++) - { - var typeInfo = GetResolver(index).GetTypeInfo(type, options); - if (typeInfo is not null) - { - return typeInfo; - } - } - - return null; - } - - private global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver GetResolver(int index) - { - var resolver = global::System.Threading.Volatile.Read(ref _resolvers[index]); - if (resolver is not null) - { - return resolver; - } - - lock (_gate) - { - return _resolvers[index] ??= CreateResolver(index); - } - } - - private static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver CreateResolver(int index) - { - return index switch - { - 0 => new IntegrationsSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), - _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), - }; - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IntegrationsClient.Authorizations.Bearer.g.cs b/src/libs/Ideogram/Generated/Ideogram.IntegrationsClient.Authorizations.Bearer.g.cs deleted file mode 100644 index ce3a673f..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IntegrationsClient.Authorizations.Bearer.g.cs +++ /dev/null @@ -1,35 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public sealed partial class IntegrationsClient - { - - /// - public void AuthorizeUsingBearer( - string apiKey) - { - apiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey)); - - for (var i = Authorizations.Count - 1; i >= 0; i--) - { - var __authorization = Authorizations[i]; - if (__authorization.Type == "Http" && - __authorization.Name == "Bearer") - { - Authorizations.RemoveAt(i); - } - } - - Authorizations.Add(new global::Ideogram.EndPointAuthorization - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - Value = apiKey, - }); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IntegrationsClient.Constructors.Bearer.g.cs b/src/libs/Ideogram/Generated/Ideogram.IntegrationsClient.Constructors.Bearer.g.cs deleted file mode 100644 index 3b342cfa..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IntegrationsClient.Constructors.Bearer.g.cs +++ /dev/null @@ -1,31 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public sealed partial class IntegrationsClient - { - /// - - public IntegrationsClient( - string apiKey, - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - bool disposeHttpClient = true) : this(httpClient, baseUri, authorizations, disposeHttpClient) - { - Authorizing(HttpClient, ref apiKey); - - AuthorizeUsingBearer(apiKey); - - Authorized(HttpClient); - } - - partial void Authorizing( - global::System.Net.Http.HttpClient client, - ref string apiKey); - partial void Authorized( - global::System.Net.Http.HttpClient client); - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IntegrationsClient.GetIntegrationAssetDelivery.g.cs b/src/libs/Ideogram/Generated/Ideogram.IntegrationsClient.GetIntegrationAssetDelivery.g.cs deleted file mode 100644 index 0fb6d1e7..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IntegrationsClient.GetIntegrationAssetDelivery.g.cs +++ /dev/null @@ -1,955 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class IntegrationsClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_GetIntegrationAssetDeliverySecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_GetIntegrationAssetDeliverySecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_GetIntegrationAssetDeliverySecurityRequirement0, - }; - partial void PrepareGetIntegrationAssetDeliveryArguments( - global::System.Net.Http.HttpClient httpClient, - ref string externalRef); - partial void PrepareGetIntegrationAssetDeliveryRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string externalRef); - partial void ProcessGetIntegrationAssetDeliveryResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessGetIntegrationAssetDeliveryResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref byte[] content); - - /// - /// Fetch the media bytes for an integration asset
- /// Redeems the short-lived signed delivery reference returned by an integration asset search and streams the asset's media bytes. The signed reference is the sole authorization for this endpoint; it is rejected once it expires or when the integration it names has changed. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task GetIntegrationAssetDeliveryAsync( - string externalRef, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await GetIntegrationAssetDeliveryAsResponseAsync( - externalRef: externalRef, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Fetch the media bytes for an integration asset
- /// Redeems the short-lived signed delivery reference returned by an integration asset search and streams the asset's media bytes. The signed reference is the sole authorization for this endpoint; it is rejected once it expires or when the integration it names has changed. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task GetIntegrationAssetDeliveryAsStreamAsync( - string externalRef, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareGetIntegrationAssetDeliveryArguments( - httpClient: HttpClient, - externalRef: ref externalRef); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_GetIntegrationAssetDeliverySecurityRequirements, - operationName: "GetIntegrationAssetDeliveryAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: $"/integration-assets/{externalRef}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetIntegrationAssetDeliveryRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - externalRef: externalRef); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetIntegrationAssetDelivery", - methodName: "GetIntegrationAssetDeliveryAsync", - pathTemplate: "$\"/integration-assets/{externalRef}\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseHeadersRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetIntegrationAssetDelivery", - methodName: "GetIntegrationAssetDeliveryAsync", - pathTemplate: "$\"/integration-assets/{externalRef}\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetIntegrationAssetDelivery", - methodName: "GetIntegrationAssetDeliveryAsync", - pathTemplate: "$\"/integration-assets/{externalRef}\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - try - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetIntegrationAssetDeliveryResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetIntegrationAssetDelivery", - methodName: "GetIntegrationAssetDeliveryAsync", - pathTemplate: "$\"/integration-assets/{externalRef}\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetIntegrationAssetDelivery", - methodName: "GetIntegrationAssetDeliveryAsync", - pathTemplate: "$\"/integration-assets/{externalRef}\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // The delivery reference is invalid or has expired. - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::Ideogram.IntegrationErrorResponse? __value_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::Ideogram.IntegrationErrorResponse.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_404 = global::Ideogram.IntegrationErrorResponse.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseObject: __value_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // The referenced integration changed after the search. - if ((int)__response.StatusCode == 409) - { - string? __content_409 = null; - global::System.Exception? __exception_409 = null; - global::Ideogram.IntegrationErrorResponse? __value_409 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_409 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_409 = global::Ideogram.IntegrationErrorResponse.FromJson(__content_409, JsonSerializerContext); - } - else - { - __content_409 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_409 = global::Ideogram.IntegrationErrorResponse.FromJson(__content_409, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_409 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_409 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_409, - responseBody: __content_409, - responseObject: __value_409, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Integration delivery is not available. - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - global::Ideogram.IntegrationErrorResponse? __value_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::Ideogram.IntegrationErrorResponse.FromJson(__content_503, JsonSerializerContext); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_503 = global::Ideogram.IntegrationErrorResponse.FromJson(__content_503, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseObject: __value_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - return new global::Ideogram.ResponseStream(__response, __content); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - } - catch - { - __response.Dispose(); - throw; - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Fetch the media bytes for an integration asset
- /// Redeems the short-lived signed delivery reference returned by an integration asset search and streams the asset's media bytes. The signed reference is the sole authorization for this endpoint; it is rejected once it expires or when the integration it names has changed. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> GetIntegrationAssetDeliveryAsResponseAsync( - string externalRef, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareGetIntegrationAssetDeliveryArguments( - httpClient: HttpClient, - externalRef: ref externalRef); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_GetIntegrationAssetDeliverySecurityRequirements, - operationName: "GetIntegrationAssetDeliveryAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: $"/integration-assets/{externalRef}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetIntegrationAssetDeliveryRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - externalRef: externalRef); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetIntegrationAssetDelivery", - methodName: "GetIntegrationAssetDeliveryAsync", - pathTemplate: "$\"/integration-assets/{externalRef}\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetIntegrationAssetDelivery", - methodName: "GetIntegrationAssetDeliveryAsync", - pathTemplate: "$\"/integration-assets/{externalRef}\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetIntegrationAssetDelivery", - methodName: "GetIntegrationAssetDeliveryAsync", - pathTemplate: "$\"/integration-assets/{externalRef}\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetIntegrationAssetDeliveryResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetIntegrationAssetDelivery", - methodName: "GetIntegrationAssetDeliveryAsync", - pathTemplate: "$\"/integration-assets/{externalRef}\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetIntegrationAssetDelivery", - methodName: "GetIntegrationAssetDeliveryAsync", - pathTemplate: "$\"/integration-assets/{externalRef}\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // The delivery reference is invalid or has expired. - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::Ideogram.IntegrationErrorResponse? __value_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::Ideogram.IntegrationErrorResponse.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_404 = global::Ideogram.IntegrationErrorResponse.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseObject: __value_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // The referenced integration changed after the search. - if ((int)__response.StatusCode == 409) - { - string? __content_409 = null; - global::System.Exception? __exception_409 = null; - global::Ideogram.IntegrationErrorResponse? __value_409 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_409 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_409 = global::Ideogram.IntegrationErrorResponse.FromJson(__content_409, JsonSerializerContext); - } - else - { - __content_409 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_409 = global::Ideogram.IntegrationErrorResponse.FromJson(__content_409, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_409 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_409 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_409, - responseBody: __content_409, - responseObject: __value_409, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Integration delivery is not available. - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - global::Ideogram.IntegrationErrorResponse? __value_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::Ideogram.IntegrationErrorResponse.FromJson(__content_503, JsonSerializerContext); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_503 = global::Ideogram.IntegrationErrorResponse.FromJson(__content_503, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseObject: __value_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsByteArrayAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessGetIntegrationAssetDeliveryResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __content); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: null, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsByteArrayAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __content); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IntegrationsClient.GetIntegrations.g.cs b/src/libs/Ideogram/Generated/Ideogram.IntegrationsClient.GetIntegrations.g.cs deleted file mode 100644 index 07eb486e..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IntegrationsClient.GetIntegrations.g.cs +++ /dev/null @@ -1,486 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class IntegrationsClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_GetIntegrationsSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_GetIntegrationsSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_GetIntegrationsSecurityRequirement0, - }; - partial void PrepareGetIntegrationsArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareGetIntegrationsRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessGetIntegrationsResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessGetIntegrationsResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// List enabled integration types
- /// Lists the distinct integration types enabled for the authenticated organization. The response does not expose configured integration rows, provider details, configuration, or credentials. - ///
- /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task GetIntegrationsAsync( - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await GetIntegrationsAsResponseAsync( - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// List enabled integration types
- /// Lists the distinct integration types enabled for the authenticated organization. The response does not expose configured integration rows, provider details, configuration, or credentials. - ///
- /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> GetIntegrationsAsResponseAsync( - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareGetIntegrationsArguments( - httpClient: HttpClient); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_GetIntegrationsSecurityRequirements, - operationName: "GetIntegrationsAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/integrations", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetIntegrationsRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetIntegrations", - methodName: "GetIntegrationsAsync", - pathTemplate: "\"/v2/integrations\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetIntegrations", - methodName: "GetIntegrationsAsync", - pathTemplate: "\"/v2/integrations\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetIntegrations", - methodName: "GetIntegrationsAsync", - pathTemplate: "\"/v2/integrations\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetIntegrationsResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetIntegrations", - methodName: "GetIntegrationsAsync", - pathTemplate: "\"/v2/integrations\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetIntegrations", - methodName: "GetIntegrationsAsync", - pathTemplate: "\"/v2/integrations\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // The caller is not allowed to discover integrations or the mini-app token lacks the required existing asset-browsing scope. - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - global::Ideogram.IntegrationErrorResponse? __value_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::Ideogram.IntegrationErrorResponse.FromJson(__content_403, JsonSerializerContext); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_403 = global::Ideogram.IntegrationErrorResponse.FromJson(__content_403, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseObject: __value_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetIntegrationsResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.GetIntegrationsResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.GetIntegrationsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IntegrationsClient.PostIntegrationAssetsSearch.g.cs b/src/libs/Ideogram/Generated/Ideogram.IntegrationsClient.PostIntegrationAssetsSearch.g.cs deleted file mode 100644 index c6b91c83..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IntegrationsClient.PostIntegrationAssetsSearch.g.cs +++ /dev/null @@ -1,662 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class IntegrationsClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostIntegrationAssetsSearchSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostIntegrationAssetsSearchSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostIntegrationAssetsSearchSecurityRequirement0, - }; - partial void PreparePostIntegrationAssetsSearchArguments( - global::System.Net.Http.HttpClient httpClient, - ref global::Ideogram.IntegrationType integrationType, - global::Ideogram.IntegrationAssetSearchRequest request); - partial void PreparePostIntegrationAssetsSearchRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.IntegrationType integrationType, - global::Ideogram.IntegrationAssetSearchRequest request); - partial void ProcessPostIntegrationAssetsSearchResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostIntegrationAssetsSearchResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Search assets from an enabled integration type - /// - /// - /// A provider-neutral integration operation family. - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostIntegrationAssetsSearchAsync( - global::Ideogram.IntegrationType integrationType, - - global::Ideogram.IntegrationAssetSearchRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostIntegrationAssetsSearchAsResponseAsync( - integrationType: integrationType, - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Search assets from an enabled integration type - /// - /// - /// A provider-neutral integration operation family. - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostIntegrationAssetsSearchAsResponseAsync( - global::Ideogram.IntegrationType integrationType, - - global::Ideogram.IntegrationAssetSearchRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostIntegrationAssetsSearchArguments( - httpClient: HttpClient, - integrationType: ref integrationType, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostIntegrationAssetsSearchSecurityRequirements, - operationName: "PostIntegrationAssetsSearchAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: $"/v2/integrations/{(global::System.Uri.EscapeDataString(integrationType.ToValueString()))}/assets/search", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostIntegrationAssetsSearchRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - integrationType: integrationType, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostIntegrationAssetsSearch", - methodName: "PostIntegrationAssetsSearchAsync", - pathTemplate: "$\"/v2/integrations/{(global::System.Uri.EscapeDataString(integrationType.ToValueString()))}/assets/search\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostIntegrationAssetsSearch", - methodName: "PostIntegrationAssetsSearchAsync", - pathTemplate: "$\"/v2/integrations/{(global::System.Uri.EscapeDataString(integrationType.ToValueString()))}/assets/search\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostIntegrationAssetsSearch", - methodName: "PostIntegrationAssetsSearchAsync", - pathTemplate: "$\"/v2/integrations/{(global::System.Uri.EscapeDataString(integrationType.ToValueString()))}/assets/search\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostIntegrationAssetsSearchResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostIntegrationAssetsSearch", - methodName: "PostIntegrationAssetsSearchAsync", - pathTemplate: "$\"/v2/integrations/{(global::System.Uri.EscapeDataString(integrationType.ToValueString()))}/assets/search\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostIntegrationAssetsSearch", - methodName: "PostIntegrationAssetsSearchAsync", - pathTemplate: "$\"/v2/integrations/{(global::System.Uri.EscapeDataString(integrationType.ToValueString()))}/assets/search\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // The integration type or search request is invalid. - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - global::Ideogram.IntegrationErrorResponse? __value_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::Ideogram.IntegrationErrorResponse.FromJson(__content_400, JsonSerializerContext); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_400 = global::Ideogram.IntegrationErrorResponse.FromJson(__content_400, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseObject: __value_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // The caller is not allowed to search integrations or the mini-app token lacks the required existing asset-browsing scope. - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - global::Ideogram.IntegrationErrorResponse? __value_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::Ideogram.IntegrationErrorResponse.FromJson(__content_403, JsonSerializerContext); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_403 = global::Ideogram.IntegrationErrorResponse.FromJson(__content_403, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseObject: __value_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // The requested integration type is not configured. - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::Ideogram.IntegrationErrorResponse? __value_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::Ideogram.IntegrationErrorResponse.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_404 = global::Ideogram.IntegrationErrorResponse.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseObject: __value_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Integration search is not available. - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - global::Ideogram.IntegrationErrorResponse? __value_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::Ideogram.IntegrationErrorResponse.FromJson(__content_503, JsonSerializerContext); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_503 = global::Ideogram.IntegrationErrorResponse.FromJson(__content_503, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseObject: __value_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostIntegrationAssetsSearchResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.IntegrationAssetSearchResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.IntegrationAssetSearchResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Search assets from an enabled integration type - /// - /// - /// A provider-neutral integration operation family. - /// - /// - /// Maximum number of assets to return, bounded by the configured runtime policy. The operation returns a single bounded result; pagination is a future extension that adds optional fields additively. - /// - /// - /// Optional keyed lookup. For integrations whose upstream is a keyed catalog, this is the item key (for example a product style code); integrations without keyed lookup ignore it. Omitted means browse. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostIntegrationAssetsSearchAsync( - global::Ideogram.IntegrationType integrationType, - int limit, - string? query = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.IntegrationAssetSearchRequest - { - Limit = limit, - Query = query, - }; - - return await PostIntegrationAssetsSearchAsync( - integrationType: integrationType, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IntegrationsClient.g.cs b/src/libs/Ideogram/Generated/Ideogram.IntegrationsClient.g.cs deleted file mode 100644 index ea7df4e4..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.IntegrationsClient.g.cs +++ /dev/null @@ -1,144 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Organization-scoped external asset integrations.
- /// If no httpClient is provided, a new one will be created.
- /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. - ///
- public sealed partial class IntegrationsClient : global::Ideogram.IIntegrationsClient, global::System.IDisposable - { - /// - /// - /// - public const string DefaultBaseUrl = "https://api.ideogram.ai/"; - - private bool _disposeHttpClient = true; - - /// - public global::System.Net.Http.HttpClient HttpClient { get; } - - /// - public System.Uri? BaseUri => HttpClient.BaseAddress; - - /// - public global::System.Collections.Generic.List Authorizations { get; } - - /// - public bool ReadResponseAsString { get; set; } -#if DEBUG - = true; -#endif - - /// - public global::Ideogram.AutoSDKClientOptions Options { get; } - - internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::Ideogram.IntegrationsSourceGenerationContext.Default); - - /// - /// - /// - public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext - { - get => JsonSerializerContextProvider.Value; - set => JsonSerializerContextProvider = new(() => value); - } - - - /// - /// Creates a new instance of the IntegrationsClient. - /// If no httpClient is provided, a new one will be created. - /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. - /// - /// The HttpClient instance. If not provided, a new one will be created. - /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. - /// The authorizations to use for the requests. - /// Dispose the HttpClient when the instance is disposed. True by default. - public IntegrationsClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - bool disposeHttpClient = true) : this( - httpClient, - baseUri, - authorizations, - options: null, - disposeHttpClient: disposeHttpClient) - { - } - - /// - /// Creates a new instance of the IntegrationsClient with explicit options but no base URL override. - /// Skips passing baseUri so the default base URL from the OpenAPI spec applies. - /// - /// The HttpClient instance. If not provided, a new one will be created. - /// The authorizations to use for the requests. - /// Client-wide request defaults such as headers, query parameters, retries, and timeout. - /// Dispose the HttpClient when the instance is disposed. True by default. - public IntegrationsClient( - global::System.Net.Http.HttpClient? httpClient, - global::System.Collections.Generic.List? authorizations, - global::Ideogram.AutoSDKClientOptions? options, - bool disposeHttpClient = true) : this( - httpClient, - baseUri: null, - authorizations, - options, - disposeHttpClient: disposeHttpClient) - { - } - - /// - /// Creates a new instance of the IntegrationsClient. - /// If no httpClient is provided, a new one will be created. - /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. - /// - /// The HttpClient instance. If not provided, a new one will be created. - /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. - /// The authorizations to use for the requests. - /// Client-wide request defaults such as headers, query parameters, retries, and timeout. - /// Dispose the HttpClient when the instance is disposed. True by default. - public IntegrationsClient( - global::System.Net.Http.HttpClient? httpClient, - global::System.Uri? baseUri, - global::System.Collections.Generic.List? authorizations, - global::Ideogram.AutoSDKClientOptions? options, - bool disposeHttpClient = true) - { - - HttpClient = httpClient ?? new global::System.Net.Http.HttpClient(); - HttpClient.BaseAddress ??= baseUri ?? new global::System.Uri(DefaultBaseUrl); - Authorizations = authorizations ?? new global::System.Collections.Generic.List(); - Options = options ?? new global::Ideogram.AutoSDKClientOptions(); - _disposeHttpClient = disposeHttpClient; - - Initialized(HttpClient); - } - - /// - public void Dispose() - { - if (_disposeHttpClient) - { - HttpClient.Dispose(); - } - } - - partial void Initialized( - global::System.Net.Http.HttpClient client); - partial void PrepareArguments( - global::System.Net.Http.HttpClient client); - partial void PrepareRequest( - global::System.Net.Http.HttpClient client, - global::System.Net.Http.HttpRequestMessage request); - partial void ProcessResponse( - global::System.Net.Http.HttpClient client, - global::System.Net.Http.HttpResponseMessage response); - partial void ProcessResponseContent( - global::System.Net.Http.HttpClient client, - global::System.Net.Http.HttpResponseMessage response, - ref string content); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.InternalTesting.JsonSerializerContext.g.cs b/src/libs/Ideogram/Generated/Ideogram.InternalTesting.JsonSerializerContext.g.cs deleted file mode 100644 index 7c4cf0e0..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.InternalTesting.JsonSerializerContext.g.cs +++ /dev/null @@ -1,168 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull - )] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(byte[]))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.InternalTestingRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.InternalTestingNestedObject))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.InternalTestingNestedObjectRequiredFields))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.InternalTestingEnumField), TypeInfoPropertyName = "InternalTestingEnumField2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PostInternalTesting200Response))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.InternalTestingEnumField?), TypeInfoPropertyName = "NullableInternalTestingEnumField2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - internal sealed partial class InternalTestingSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext - { - } - /// - /// - /// - public sealed partial class InternalTestingSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext - { - private static readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver Resolver = new LazyChunkResolver(); - - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - internal static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver TypeInfoResolver => Resolver; - - - private static readonly global::System.Text.Json.JsonSerializerOptions DefaultOptions = CreateDefaultOptions(); - - /// - /// - /// - public static InternalTestingSourceGenerationContext Default { get; } = new(DefaultOptions); - - private InternalTestingSourceGenerationContext(global::System.Text.Json.JsonSerializerOptions options) - : base(options) - { - } - - /// - protected override global::System.Text.Json.JsonSerializerOptions? GeneratedSerializerOptions => DefaultOptions; - - /// - public override global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo(global::System.Type type) - { - return Resolver.GetTypeInfo(type, Options); - } - - /// - /// Adds this package's converters to . - /// - /// - /// A converter has to be on the options a chained resolver builds its JsonTypeInfo against, - /// and a context resolves types from every package below it. Each package contributes only - /// what it owns and calls down the chain for the rest, so the family's converter table is - /// written once rather than copied into all of them. - /// - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) - { - options.Converters.Add(new global::Ideogram.JsonConverters.UnixTimestampJsonConverter()); - options.Converters.Add(new LazyEnumJsonConverterFactory()); - } - - private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() - { - var options = new global::System.Text.Json.JsonSerializerOptions - { - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, - TypeInfoResolver = Resolver, - }; - AddConverters(options); - - return options; - } - - - private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory - { - public override bool CanConvert(global::System.Type typeToConvert) - { - return - typeToConvert == typeof(global::Ideogram.InternalTestingEnumField) - - || typeToConvert == typeof(global::Ideogram.InternalTestingEnumField?); - } - - public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - if (typeToConvert == typeof(global::Ideogram.InternalTestingEnumField)) - { - return new global::Ideogram.JsonConverters.InternalTestingEnumFieldJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.InternalTestingEnumField?)) - { - return new global::Ideogram.JsonConverters.InternalTestingEnumFieldNullableJsonConverter(); - } - throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); - } - } - - private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver - { - private readonly object _gate = new(); - private readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[] _resolvers = new global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[1]; - - public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo( - global::System.Type type, - global::System.Text.Json.JsonSerializerOptions options) - { - for (var index = 0; index < _resolvers.Length; index++) - { - var typeInfo = GetResolver(index).GetTypeInfo(type, options); - if (typeInfo is not null) - { - return typeInfo; - } - } - - return null; - } - - private global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver GetResolver(int index) - { - var resolver = global::System.Threading.Volatile.Read(ref _resolvers[index]); - if (resolver is not null) - { - return resolver; - } - - lock (_gate) - { - return _resolvers[index] ??= CreateResolver(index); - } - } - - private static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver CreateResolver(int index) - { - return index switch - { - 0 => new InternalTestingSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), - _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), - }; - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.InternalTestingClient.Authorizations.Bearer.g.cs b/src/libs/Ideogram/Generated/Ideogram.InternalTestingClient.Authorizations.Bearer.g.cs deleted file mode 100644 index 76f56d66..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.InternalTestingClient.Authorizations.Bearer.g.cs +++ /dev/null @@ -1,35 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public sealed partial class InternalTestingClient - { - - /// - public void AuthorizeUsingBearer( - string apiKey) - { - apiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey)); - - for (var i = Authorizations.Count - 1; i >= 0; i--) - { - var __authorization = Authorizations[i]; - if (__authorization.Type == "Http" && - __authorization.Name == "Bearer") - { - Authorizations.RemoveAt(i); - } - } - - Authorizations.Add(new global::Ideogram.EndPointAuthorization - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - Value = apiKey, - }); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.InternalTestingClient.Constructors.Bearer.g.cs b/src/libs/Ideogram/Generated/Ideogram.InternalTestingClient.Constructors.Bearer.g.cs deleted file mode 100644 index ba28648e..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.InternalTestingClient.Constructors.Bearer.g.cs +++ /dev/null @@ -1,31 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public sealed partial class InternalTestingClient - { - /// - - public InternalTestingClient( - string apiKey, - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - bool disposeHttpClient = true) : this(httpClient, baseUri, authorizations, disposeHttpClient) - { - Authorizing(HttpClient, ref apiKey); - - AuthorizeUsingBearer(apiKey); - - Authorized(HttpClient); - } - - partial void Authorizing( - global::System.Net.Http.HttpClient client, - ref string apiKey); - partial void Authorized( - global::System.Net.Http.HttpClient client); - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.InternalTestingClient.PostInternalTesting.g.cs b/src/libs/Ideogram/Generated/Ideogram.InternalTestingClient.PostInternalTesting.g.cs deleted file mode 100644 index 04924958..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.InternalTestingClient.PostInternalTesting.g.cs +++ /dev/null @@ -1,700 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class InternalTestingClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostInternalTestingSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostInternalTestingSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostInternalTestingSecurityRequirement0, - }; - partial void PreparePostInternalTestingArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xTestHeader, - ref string? xTestHeader2, - global::Ideogram.InternalTestingRequest request); - partial void PreparePostInternalTestingRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xTestHeader, - string? xTestHeader2, - global::Ideogram.InternalTestingRequest request); - partial void ProcessPostInternalTestingResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostInternalTestingResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Testing
- /// Just a testing endpoint - ///
- /// - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostInternalTestingAsync( - - global::Ideogram.InternalTestingRequest request, - string? xTestHeader = default, - string? xTestHeader2 = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostInternalTestingAsResponseAsync( - - request: request, - xTestHeader: xTestHeader, - xTestHeader2: xTestHeader2, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Testing
- /// Just a testing endpoint - ///
- /// - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostInternalTestingAsResponseAsync( - - global::Ideogram.InternalTestingRequest request, - string? xTestHeader = default, - string? xTestHeader2 = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostInternalTestingArguments( - httpClient: HttpClient, - xTestHeader: ref xTestHeader, - xTestHeader2: ref xTestHeader2, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostInternalTestingSecurityRequirements, - operationName: "PostInternalTestingAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/internal-testing", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xTestHeader != default) - { - __httpRequest.Headers.TryAddWithoutValidation("X-Test-Header", xTestHeader.ToString()); - } - if (xTestHeader2 != default) - { - __httpRequest.Headers.TryAddWithoutValidation("X-Test-Header-2", xTestHeader2.ToString()); - } - - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (request.XPosition != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.XPosition, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"x_position\""); - - } - if (request.ImageFile != default) - { - - var __contentImageFile = new global::System.Net.Http.ByteArrayContent(request.ImageFile ?? global::System.Array.Empty()); - __contentImageFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.ImageFilename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.ImageFilename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImageFile, - name: "\"image_file\"", - fileName: request.ImageFilename != null ? $"\"{request.ImageFilename}\"" : string.Empty); - if (__contentImageFile.Headers.ContentDisposition != null) - { - __contentImageFile.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.AnotherImageFile != default) - { - - var __contentAnotherImageFile = new global::System.Net.Http.ByteArrayContent(request.AnotherImageFile ?? global::System.Array.Empty()); - __contentAnotherImageFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.AnotherImageFilename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.AnotherImageFilename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentAnotherImageFile, - name: "\"another_image_file\"", - fileName: request.AnotherImageFilename != null ? $"\"{request.AnotherImageFilename}\"" : string.Empty); - if (__contentAnotherImageFile.Headers.ContentDisposition != null) - { - __contentAnotherImageFile.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.SomeText != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.SomeText ?? string.Empty), - name: "\"some_text\""); - - } - if (request.NestedObject != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.NestedObject.ToJson(JsonSerializerContext)), - name: "\"nested_object\""); - - } - if (request.NestedObjectRequiredFields != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.NestedObjectRequiredFields.ToJson(JsonSerializerContext)), - name: "\"nested_object_required_fields\""); - - } - if (request.DateTypeField != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.DateTypeField).HasValue ? (request.DateTypeField).GetValueOrDefault().ToString("yyyy-MM-dd") : string.Empty), - name: "\"date_type_field\""); - - } - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.RequiredDateTypeField.ToString("yyyy-MM-dd")), - name: "\"required_date_type_field\""); - - if (request.DateTimeTypeField != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.DateTimeTypeField).HasValue ? (request.DateTimeTypeField).GetValueOrDefault().ToString("yyyy-MM-ddTHH:mm:ssZ") : string.Empty), - name: "\"date_time_type_field\""); - - } - if (request.RepeatedPrimitiveField != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.RepeatedPrimitiveField!, x => x))}]"), - name: "\"repeated_primitive_field\""); - - } - if (request.RepeatedComplexField != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.RepeatedComplexField!, x => x.ToJson(JsonSerializerContext)))}]"), - name: "\"repeated_complex_field\""); - - } - if (request.EnumTypeField != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.EnumTypeField).HasValue ? (request.EnumTypeField).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"enum_type_field\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostInternalTestingRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xTestHeader: xTestHeader, - xTestHeader2: xTestHeader2, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostInternalTesting", - methodName: "PostInternalTestingAsync", - pathTemplate: "\"/internal-testing\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostInternalTesting", - methodName: "PostInternalTestingAsync", - pathTemplate: "\"/internal-testing\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostInternalTesting", - methodName: "PostInternalTestingAsync", - pathTemplate: "\"/internal-testing\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostInternalTestingResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostInternalTesting", - methodName: "PostInternalTestingAsync", - pathTemplate: "\"/internal-testing\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostInternalTesting", - methodName: "PostInternalTestingAsync", - pathTemplate: "\"/internal-testing\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostInternalTestingResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.PostInternalTesting200Response.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.PostInternalTesting200Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Testing
- /// Just a testing endpoint - ///
- /// - /// - /// - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostInternalTestingAsync( - global::System.DateTime requiredDateTypeField, - string? xTestHeader = default, - string? xTestHeader2 = default, - int? xPosition = default, - byte[]? imageFile = default, - string? imageFilename = default, - byte[]? anotherImageFile = default, - string? anotherImageFilename = default, - string? someText = default, - global::Ideogram.InternalTestingNestedObject? nestedObject = default, - global::Ideogram.InternalTestingNestedObjectRequiredFields? nestedObjectRequiredFields = default, - global::System.DateTime? dateTypeField = default, - global::System.DateTime? dateTimeTypeField = default, - global::System.Collections.Generic.IList? repeatedPrimitiveField = default, - global::System.Collections.Generic.IList? repeatedComplexField = default, - global::Ideogram.InternalTestingEnumField? enumTypeField = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.InternalTestingRequest - { - XPosition = xPosition, - ImageFile = imageFile, - ImageFilename = imageFilename, - AnotherImageFile = anotherImageFile, - AnotherImageFilename = anotherImageFilename, - SomeText = someText, - NestedObject = nestedObject, - NestedObjectRequiredFields = nestedObjectRequiredFields, - DateTypeField = dateTypeField, - RequiredDateTypeField = requiredDateTypeField, - DateTimeTypeField = dateTimeTypeField, - RepeatedPrimitiveField = repeatedPrimitiveField, - RepeatedComplexField = repeatedComplexField, - EnumTypeField = enumTypeField, - }; - - return await PostInternalTestingAsync( - xTestHeader: xTestHeader, - xTestHeader2: xTestHeader2, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.InternalTestingClient.g.cs b/src/libs/Ideogram/Generated/Ideogram.InternalTestingClient.g.cs deleted file mode 100644 index dae50c8c..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.InternalTestingClient.g.cs +++ /dev/null @@ -1,144 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Operations and endpoints designed for doing internal testing. Not intended to be called outside a test environment.
- /// If no httpClient is provided, a new one will be created.
- /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. - ///
- public sealed partial class InternalTestingClient : global::Ideogram.IInternalTestingClient, global::System.IDisposable - { - /// - /// - /// - public const string DefaultBaseUrl = "https://api.ideogram.ai/"; - - private bool _disposeHttpClient = true; - - /// - public global::System.Net.Http.HttpClient HttpClient { get; } - - /// - public System.Uri? BaseUri => HttpClient.BaseAddress; - - /// - public global::System.Collections.Generic.List Authorizations { get; } - - /// - public bool ReadResponseAsString { get; set; } -#if DEBUG - = true; -#endif - - /// - public global::Ideogram.AutoSDKClientOptions Options { get; } - - internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::Ideogram.InternalTestingSourceGenerationContext.Default); - - /// - /// - /// - public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext - { - get => JsonSerializerContextProvider.Value; - set => JsonSerializerContextProvider = new(() => value); - } - - - /// - /// Creates a new instance of the InternalTestingClient. - /// If no httpClient is provided, a new one will be created. - /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. - /// - /// The HttpClient instance. If not provided, a new one will be created. - /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. - /// The authorizations to use for the requests. - /// Dispose the HttpClient when the instance is disposed. True by default. - public InternalTestingClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - bool disposeHttpClient = true) : this( - httpClient, - baseUri, - authorizations, - options: null, - disposeHttpClient: disposeHttpClient) - { - } - - /// - /// Creates a new instance of the InternalTestingClient with explicit options but no base URL override. - /// Skips passing baseUri so the default base URL from the OpenAPI spec applies. - /// - /// The HttpClient instance. If not provided, a new one will be created. - /// The authorizations to use for the requests. - /// Client-wide request defaults such as headers, query parameters, retries, and timeout. - /// Dispose the HttpClient when the instance is disposed. True by default. - public InternalTestingClient( - global::System.Net.Http.HttpClient? httpClient, - global::System.Collections.Generic.List? authorizations, - global::Ideogram.AutoSDKClientOptions? options, - bool disposeHttpClient = true) : this( - httpClient, - baseUri: null, - authorizations, - options, - disposeHttpClient: disposeHttpClient) - { - } - - /// - /// Creates a new instance of the InternalTestingClient. - /// If no httpClient is provided, a new one will be created. - /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. - /// - /// The HttpClient instance. If not provided, a new one will be created. - /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. - /// The authorizations to use for the requests. - /// Client-wide request defaults such as headers, query parameters, retries, and timeout. - /// Dispose the HttpClient when the instance is disposed. True by default. - public InternalTestingClient( - global::System.Net.Http.HttpClient? httpClient, - global::System.Uri? baseUri, - global::System.Collections.Generic.List? authorizations, - global::Ideogram.AutoSDKClientOptions? options, - bool disposeHttpClient = true) - { - - HttpClient = httpClient ?? new global::System.Net.Http.HttpClient(); - HttpClient.BaseAddress ??= baseUri ?? new global::System.Uri(DefaultBaseUrl); - Authorizations = authorizations ?? new global::System.Collections.Generic.List(); - Options = options ?? new global::Ideogram.AutoSDKClientOptions(); - _disposeHttpClient = disposeHttpClient; - - Initialized(HttpClient); - } - - /// - public void Dispose() - { - if (_disposeHttpClient) - { - HttpClient.Dispose(); - } - } - - partial void Initialized( - global::System.Net.Http.HttpClient client); - partial void PrepareArguments( - global::System.Net.Http.HttpClient client); - partial void PrepareRequest( - global::System.Net.Http.HttpClient client, - global::System.Net.Http.HttpRequestMessage request); - partial void ProcessResponse( - global::System.Net.Http.HttpClient client, - global::System.Net.Http.HttpResponseMessage response); - partial void ProcessResponseContent( - global::System.Net.Http.HttpClient client, - global::System.Net.Http.HttpResponseMessage response, - ref string content); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.AdLocalizerRequestLanguage.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.AdLocalizerRequestLanguage.g.cs deleted file mode 100644 index be4e2f53..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.AdLocalizerRequestLanguage.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class AdLocalizerRequestLanguageJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.AdLocalizerRequestLanguage Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.AdLocalizerRequestLanguageExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.AdLocalizerRequestLanguage)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.AdLocalizerRequestLanguage); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.AdLocalizerRequestLanguage value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.AdLocalizerRequestLanguageExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.AdLocalizerRequestLanguageNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.AdLocalizerRequestLanguageNullable.g.cs deleted file mode 100644 index 5594ee5e..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.AdLocalizerRequestLanguageNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class AdLocalizerRequestLanguageNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.AdLocalizerRequestLanguage? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.AdLocalizerRequestLanguageExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.AdLocalizerRequestLanguage)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.AdLocalizerRequestLanguage?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.AdLocalizerRequestLanguage? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.AdLocalizerRequestLanguageExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.AdResizerRequestPlatform.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.AdResizerRequestPlatform.g.cs deleted file mode 100644 index 6d2a76c3..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.AdResizerRequestPlatform.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class AdResizerRequestPlatformJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.AdResizerRequestPlatform Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.AdResizerRequestPlatformExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.AdResizerRequestPlatform)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.AdResizerRequestPlatform); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.AdResizerRequestPlatform value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.AdResizerRequestPlatformExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.AdResizerRequestPlatformNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.AdResizerRequestPlatformNullable.g.cs deleted file mode 100644 index 15dd913c..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.AdResizerRequestPlatformNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class AdResizerRequestPlatformNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.AdResizerRequestPlatform? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.AdResizerRequestPlatformExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.AdResizerRequestPlatform)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.AdResizerRequestPlatform?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.AdResizerRequestPlatform? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.AdResizerRequestPlatformExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.AdResizerRequestResolution.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.AdResizerRequestResolution.g.cs deleted file mode 100644 index 8105a4d7..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.AdResizerRequestResolution.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class AdResizerRequestResolutionJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.AdResizerRequestResolution Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.AdResizerRequestResolutionExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.AdResizerRequestResolution)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.AdResizerRequestResolution); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.AdResizerRequestResolution value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.AdResizerRequestResolutionExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.AdResizerRequestResolutionNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.AdResizerRequestResolutionNullable.g.cs deleted file mode 100644 index 0253b6bf..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.AdResizerRequestResolutionNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class AdResizerRequestResolutionNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.AdResizerRequestResolution? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.AdResizerRequestResolutionExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.AdResizerRequestResolution)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.AdResizerRequestResolution?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.AdResizerRequestResolution? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.AdResizerRequestResolutionExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.AdVariationsRequestVariationType.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.AdVariationsRequestVariationType.g.cs deleted file mode 100644 index 9178a0a9..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.AdVariationsRequestVariationType.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class AdVariationsRequestVariationTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.AdVariationsRequestVariationType Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.AdVariationsRequestVariationTypeExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.AdVariationsRequestVariationType)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.AdVariationsRequestVariationType); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.AdVariationsRequestVariationType value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.AdVariationsRequestVariationTypeExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.AdVariationsRequestVariationTypeNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.AdVariationsRequestVariationTypeNullable.g.cs deleted file mode 100644 index 09712d03..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.AdVariationsRequestVariationTypeNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class AdVariationsRequestVariationTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.AdVariationsRequestVariationType? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.AdVariationsRequestVariationTypeExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.AdVariationsRequestVariationType)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.AdVariationsRequestVariationType?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.AdVariationsRequestVariationType? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.AdVariationsRequestVariationTypeExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ApiKeyStatus.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ApiKeyStatus.g.cs deleted file mode 100644 index 0ca308d3..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ApiKeyStatus.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class ApiKeyStatusJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.ApiKeyStatus Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.ApiKeyStatusExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.ApiKeyStatus)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.ApiKeyStatus); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.ApiKeyStatus value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.ApiKeyStatusExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ApiKeyStatusNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ApiKeyStatusNullable.g.cs deleted file mode 100644 index 342cd2c0..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ApiKeyStatusNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class ApiKeyStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.ApiKeyStatus? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.ApiKeyStatusExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.ApiKeyStatus)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.ApiKeyStatus?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.ApiKeyStatus? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.ApiKeyStatusExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ApiProfileRole.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ApiProfileRole.g.cs deleted file mode 100644 index 94df5018..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ApiProfileRole.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class ApiProfileRoleJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.ApiProfileRole Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.ApiProfileRoleExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.ApiProfileRole)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.ApiProfileRole); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.ApiProfileRole value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.ApiProfileRoleExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ApiProfileRoleNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ApiProfileRoleNullable.g.cs deleted file mode 100644 index 368933f9..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ApiProfileRoleNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class ApiProfileRoleNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.ApiProfileRole? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.ApiProfileRoleExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.ApiProfileRole)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.ApiProfileRole?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.ApiProfileRole? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.ApiProfileRoleExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ApiProfileType.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ApiProfileType.g.cs deleted file mode 100644 index d1c3a0f5..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ApiProfileType.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class ApiProfileTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.ApiProfileType Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.ApiProfileTypeExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.ApiProfileType)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.ApiProfileType); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.ApiProfileType value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.ApiProfileTypeExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ApiProfileTypeNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ApiProfileTypeNullable.g.cs deleted file mode 100644 index 15da6fee..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ApiProfileTypeNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class ApiProfileTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.ApiProfileType? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.ApiProfileTypeExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.ApiProfileType)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.ApiProfileType?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.ApiProfileType? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.ApiProfileTypeExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.AspectRatio.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.AspectRatio.g.cs deleted file mode 100644 index 363036c3..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.AspectRatio.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class AspectRatioJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.AspectRatio Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.AspectRatioExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.AspectRatio)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.AspectRatio); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.AspectRatio value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.AspectRatioExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.AspectRatioEditLite.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.AspectRatioEditLite.g.cs deleted file mode 100644 index ee3a0e21..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.AspectRatioEditLite.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class AspectRatioEditLiteJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.AspectRatioEditLite Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.AspectRatioEditLiteExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.AspectRatioEditLite)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.AspectRatioEditLite); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.AspectRatioEditLite value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.AspectRatioEditLiteExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.AspectRatioEditLiteNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.AspectRatioEditLiteNullable.g.cs deleted file mode 100644 index b0805e51..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.AspectRatioEditLiteNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class AspectRatioEditLiteNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.AspectRatioEditLite? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.AspectRatioEditLiteExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.AspectRatioEditLite)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.AspectRatioEditLite?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.AspectRatioEditLite? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.AspectRatioEditLiteExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.AspectRatioNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.AspectRatioNullable.g.cs deleted file mode 100644 index 714fa09f..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.AspectRatioNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class AspectRatioNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.AspectRatio? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.AspectRatioExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.AspectRatio)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.AspectRatio?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.AspectRatio? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.AspectRatioExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.AspectRatioV4.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.AspectRatioV4.g.cs deleted file mode 100644 index 9c7c42c1..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.AspectRatioV4.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class AspectRatioV4JsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.AspectRatioV4 Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.AspectRatioV4Extensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.AspectRatioV4)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.AspectRatioV4); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.AspectRatioV4 value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.AspectRatioV4Extensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.AspectRatioV4Nullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.AspectRatioV4Nullable.g.cs deleted file mode 100644 index 3b58c6a2..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.AspectRatioV4Nullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class AspectRatioV4NullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.AspectRatioV4? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.AspectRatioV4Extensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.AspectRatioV4)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.AspectRatioV4?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.AspectRatioV4? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.AspectRatioV4Extensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.AttributeValueType.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.AttributeValueType.g.cs deleted file mode 100644 index e5ea7ae7..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.AttributeValueType.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class AttributeValueTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.AttributeValueType Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.AttributeValueTypeExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.AttributeValueType)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.AttributeValueType); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.AttributeValueType value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.AttributeValueTypeExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.AttributeValueTypeNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.AttributeValueTypeNullable.g.cs deleted file mode 100644 index a9959200..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.AttributeValueTypeNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class AttributeValueTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.AttributeValueType? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.AttributeValueTypeExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.AttributeValueType)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.AttributeValueType?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.AttributeValueType? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.AttributeValueTypeExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ColorPalettePresetName.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ColorPalettePresetName.g.cs deleted file mode 100644 index 68aeed38..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ColorPalettePresetName.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class ColorPalettePresetNameJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.ColorPalettePresetName Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.ColorPalettePresetNameExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.ColorPalettePresetName)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.ColorPalettePresetName); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.ColorPalettePresetName value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.ColorPalettePresetNameExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ColorPalettePresetNameNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ColorPalettePresetNameNullable.g.cs deleted file mode 100644 index 6e106257..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ColorPalettePresetNameNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class ColorPalettePresetNameNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.ColorPalettePresetName? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.ColorPalettePresetNameExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.ColorPalettePresetName)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.ColorPalettePresetName?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.ColorPalettePresetName? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.ColorPalettePresetNameExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ColorPaletteWithPresetNameOrMembers.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ColorPaletteWithPresetNameOrMembers.g.cs deleted file mode 100644 index 609e7652..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ColorPaletteWithPresetNameOrMembers.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 // Type or member is obsolete - -namespace Ideogram.JsonConverters -{ - /// - public class ColorPaletteWithPresetNameOrMembersJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.ColorPaletteWithPresetNameOrMembers Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - options = options ?? throw new global::System.ArgumentNullException(nameof(options)); - var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); - - using var __jsonDocument = global::System.Text.Json.JsonDocument.ParseValue(ref reader); - var __rawJson = __jsonDocument.RootElement.GetRawText(); - var __jsonProps = new global::System.Collections.Generic.HashSet(); - if (__jsonDocument.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Object) - { - foreach (var __jsonProp in __jsonDocument.RootElement.EnumerateObject()) - { - __jsonProps.Add(__jsonProp.Name); - - } - } - - var __score0 = 0; - if (__jsonProps.Contains("name")) __score0++; - var __score1 = 0; - if (__jsonProps.Contains("members")) __score1++; - var __bestScore = 0; - var __bestIndex = -1; - if (__score0 > __bestScore) { __bestScore = __score0; __bestIndex = 0; } - if (__score1 > __bestScore) { __bestScore = __score1; __bestIndex = 1; } - - global::Ideogram.ColorPaletteWithPresetName? colorPaletteWithPresetName = default; - global::Ideogram.ColorPaletteWithMembers? colorPaletteWithMembers = default; - if (__bestIndex >= 0) - { - if (__bestIndex == 0) - { - try - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Ideogram.ColorPaletteWithPresetName), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Ideogram.ColorPaletteWithPresetName).Name}"); - colorPaletteWithPresetName = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); - } - catch (global::System.Text.Json.JsonException) - { - } - catch (global::System.InvalidOperationException) - { - } - } - else if (__bestIndex == 1) - { - try - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Ideogram.ColorPaletteWithMembers), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Ideogram.ColorPaletteWithMembers).Name}"); - colorPaletteWithMembers = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); - } - catch (global::System.Text.Json.JsonException) - { - } - catch (global::System.InvalidOperationException) - { - } - } - } - - if (colorPaletteWithPresetName == null && colorPaletteWithMembers == null) - { - try - { - - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Ideogram.ColorPaletteWithPresetName), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Ideogram.ColorPaletteWithPresetName).Name}"); - colorPaletteWithPresetName = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); - } - catch (global::System.Text.Json.JsonException) - { - } - catch (global::System.InvalidOperationException) - { - } - } - - if (colorPaletteWithPresetName == null && colorPaletteWithMembers == null) - { - try - { - - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Ideogram.ColorPaletteWithMembers), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Ideogram.ColorPaletteWithMembers).Name}"); - colorPaletteWithMembers = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); - } - catch (global::System.Text.Json.JsonException) - { - } - catch (global::System.InvalidOperationException) - { - } - } - - var __value = new global::Ideogram.ColorPaletteWithPresetNameOrMembers( - colorPaletteWithPresetName, - - colorPaletteWithMembers - ); - - return __value; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.ColorPaletteWithPresetNameOrMembers value, - global::System.Text.Json.JsonSerializerOptions options) - { - options = options ?? throw new global::System.ArgumentNullException(nameof(options)); - var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); - - if (value.IsColorPaletteWithPresetName) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Ideogram.ColorPaletteWithPresetName), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Ideogram.ColorPaletteWithPresetName).Name}"); - global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickColorPaletteWithPresetName(), typeInfo); - } - else if (value.IsColorPaletteWithMembers) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Ideogram.ColorPaletteWithMembers), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Ideogram.ColorPaletteWithMembers).Name}"); - global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickColorPaletteWithMembers(), typeInfo); - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.DatasetAssetFailureReason.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.DatasetAssetFailureReason.g.cs deleted file mode 100644 index 29354770..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.DatasetAssetFailureReason.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class DatasetAssetFailureReasonJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.DatasetAssetFailureReason Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.DatasetAssetFailureReasonExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.DatasetAssetFailureReason)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.DatasetAssetFailureReason); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.DatasetAssetFailureReason value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.DatasetAssetFailureReasonExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.DatasetAssetFailureReasonNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.DatasetAssetFailureReasonNullable.g.cs deleted file mode 100644 index 10882fd9..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.DatasetAssetFailureReasonNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class DatasetAssetFailureReasonNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.DatasetAssetFailureReason? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.DatasetAssetFailureReasonExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.DatasetAssetFailureReason)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.DatasetAssetFailureReason?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.DatasetAssetFailureReason? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.DatasetAssetFailureReasonExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.DatasetCoverAssetIdentifier.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.DatasetCoverAssetIdentifier.g.cs deleted file mode 100644 index b0372023..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.DatasetCoverAssetIdentifier.g.cs +++ /dev/null @@ -1,74 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 // Type or member is obsolete - -namespace Ideogram.JsonConverters -{ - /// - public class DatasetCoverAssetIdentifierJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.DatasetCoverAssetIdentifier Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - options = options ?? throw new global::System.ArgumentNullException(nameof(options)); - var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); - - using var __jsonDocument = global::System.Text.Json.JsonDocument.ParseValue(ref reader); - var __rawJson = __jsonDocument.RootElement.GetRawText(); - - global::Ideogram.AssetIdentifier? assetIdentifier = default; - try - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Ideogram.AssetIdentifier), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Ideogram.AssetIdentifier).Name}"); - assetIdentifier = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); - } - catch (global::System.Text.Json.JsonException) - { - } - catch (global::System.InvalidOperationException) - { - } - var __value = new global::Ideogram.DatasetCoverAssetIdentifier( - assetIdentifier - ); - - return __value; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.DatasetCoverAssetIdentifier value, - global::System.Text.Json.JsonSerializerOptions options) - { - options = options ?? throw new global::System.ArgumentNullException(nameof(options)); - var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); - - - writer.WriteStartObject(); - var __writtenPropertyNames = new global::System.Collections.Generic.HashSet(global::System.StringComparer.Ordinal); - if (value.IsAssetIdentifier) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Ideogram.AssetIdentifier), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Ideogram.AssetIdentifier).Name}"); - var __element0 = global::System.Text.Json.JsonSerializer.SerializeToElement(value.PickAssetIdentifier(), typeInfo); - if (__element0.ValueKind != global::System.Text.Json.JsonValueKind.Object) - { - throw new global::System.Text.Json.JsonException("AllOf values must serialize as JSON objects."); - } - - foreach (var __property in __element0.EnumerateObject()) - { - if (__writtenPropertyNames.Add(__property.Name)) - { - __property.WriteTo(writer); - } - } - } - writer.WriteEndObject(); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.DescribeModelVersion.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.DescribeModelVersion.g.cs deleted file mode 100644 index a10b5bb1..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.DescribeModelVersion.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class DescribeModelVersionJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.DescribeModelVersion Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.DescribeModelVersionExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.DescribeModelVersion)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.DescribeModelVersion); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.DescribeModelVersion value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.DescribeModelVersionExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.DescribeModelVersionNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.DescribeModelVersionNullable.g.cs deleted file mode 100644 index 6bbdf761..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.DescribeModelVersionNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class DescribeModelVersionNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.DescribeModelVersion? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.DescribeModelVersionExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.DescribeModelVersion)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.DescribeModelVersion?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.DescribeModelVersion? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.DescribeModelVersionExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.DetectedTextBlockFormattingItem.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.DetectedTextBlockFormattingItem.g.cs deleted file mode 100644 index f143d558..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.DetectedTextBlockFormattingItem.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class DetectedTextBlockFormattingItemJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.DetectedTextBlockFormattingItem Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.DetectedTextBlockFormattingItemExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.DetectedTextBlockFormattingItem)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.DetectedTextBlockFormattingItem); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.DetectedTextBlockFormattingItem value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.DetectedTextBlockFormattingItemExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.DetectedTextBlockFormattingItemNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.DetectedTextBlockFormattingItemNullable.g.cs deleted file mode 100644 index 9d08778f..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.DetectedTextBlockFormattingItemNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class DetectedTextBlockFormattingItemNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.DetectedTextBlockFormattingItem? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.DetectedTextBlockFormattingItemExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.DetectedTextBlockFormattingItem)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.DetectedTextBlockFormattingItem?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.DetectedTextBlockFormattingItem? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.DetectedTextBlockFormattingItemExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.DetectedTextBlockFormattingItems.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.DetectedTextBlockFormattingItems.g.cs new file mode 100644 index 00000000..478772b9 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.DetectedTextBlockFormattingItems.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class DetectedTextBlockFormattingItemsJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.DetectedTextBlockFormattingItems Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.DetectedTextBlockFormattingItemsExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.DetectedTextBlockFormattingItems)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.DetectedTextBlockFormattingItems); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.DetectedTextBlockFormattingItems value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Ideogram.DetectedTextBlockFormattingItemsExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.DetectedTextBlockFormattingItemsNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.DetectedTextBlockFormattingItemsNullable.g.cs new file mode 100644 index 00000000..7c54606a --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.DetectedTextBlockFormattingItemsNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class DetectedTextBlockFormattingItemsNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.DetectedTextBlockFormattingItems? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.DetectedTextBlockFormattingItemsExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.DetectedTextBlockFormattingItems)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.DetectedTextBlockFormattingItems?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.DetectedTextBlockFormattingItems? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Ideogram.DetectedTextBlockFormattingItemsExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateDesignRequestV4ArtifactGenerationModel.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateDesignRequestV4ArtifactGenerationModel.g.cs deleted file mode 100644 index 8cdfbbf5..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateDesignRequestV4ArtifactGenerationModel.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class GenerateDesignRequestV4ArtifactGenerationModelJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.GenerateDesignRequestV4ArtifactGenerationModel Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.GenerateDesignRequestV4ArtifactGenerationModelExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.GenerateDesignRequestV4ArtifactGenerationModel)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.GenerateDesignRequestV4ArtifactGenerationModel); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.GenerateDesignRequestV4ArtifactGenerationModel value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.GenerateDesignRequestV4ArtifactGenerationModelExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateDesignRequestV4ArtifactGenerationModelNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateDesignRequestV4ArtifactGenerationModelNullable.g.cs deleted file mode 100644 index 25a424ee..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateDesignRequestV4ArtifactGenerationModelNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class GenerateDesignRequestV4ArtifactGenerationModelNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.GenerateDesignRequestV4ArtifactGenerationModel? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.GenerateDesignRequestV4ArtifactGenerationModelExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.GenerateDesignRequestV4ArtifactGenerationModel)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.GenerateDesignRequestV4ArtifactGenerationModel?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.GenerateDesignRequestV4ArtifactGenerationModel? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.GenerateDesignRequestV4ArtifactGenerationModelExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateDesignRequestV4InspirationReferenceModel.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateDesignRequestV4InspirationReferenceModel.g.cs deleted file mode 100644 index 207a2704..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateDesignRequestV4InspirationReferenceModel.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class GenerateDesignRequestV4InspirationReferenceModelJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.GenerateDesignRequestV4InspirationReferenceModel Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.GenerateDesignRequestV4InspirationReferenceModelExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.GenerateDesignRequestV4InspirationReferenceModel)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.GenerateDesignRequestV4InspirationReferenceModel); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.GenerateDesignRequestV4InspirationReferenceModel value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.GenerateDesignRequestV4InspirationReferenceModelExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateDesignRequestV4InspirationReferenceModelNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateDesignRequestV4InspirationReferenceModelNullable.g.cs deleted file mode 100644 index 7f28c279..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateDesignRequestV4InspirationReferenceModelNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class GenerateDesignRequestV4InspirationReferenceModelNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.GenerateDesignRequestV4InspirationReferenceModel? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.GenerateDesignRequestV4InspirationReferenceModelExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.GenerateDesignRequestV4InspirationReferenceModel)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.GenerateDesignRequestV4InspirationReferenceModel?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.GenerateDesignRequestV4InspirationReferenceModel? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.GenerateDesignRequestV4InspirationReferenceModelExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateDesignRequestV4Layout2imageVariant.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateDesignRequestV4Layout2imageVariant.g.cs deleted file mode 100644 index 7971c449..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateDesignRequestV4Layout2imageVariant.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class GenerateDesignRequestV4Layout2imageVariantJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.GenerateDesignRequestV4Layout2imageVariant Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.GenerateDesignRequestV4Layout2imageVariantExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.GenerateDesignRequestV4Layout2imageVariant)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.GenerateDesignRequestV4Layout2imageVariant); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.GenerateDesignRequestV4Layout2imageVariant value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.GenerateDesignRequestV4Layout2imageVariantExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateDesignRequestV4Layout2imageVariantNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateDesignRequestV4Layout2imageVariantNullable.g.cs deleted file mode 100644 index 476fa3b0..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateDesignRequestV4Layout2imageVariantNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class GenerateDesignRequestV4Layout2imageVariantNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.GenerateDesignRequestV4Layout2imageVariant? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.GenerateDesignRequestV4Layout2imageVariantExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.GenerateDesignRequestV4Layout2imageVariant)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.GenerateDesignRequestV4Layout2imageVariant?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.GenerateDesignRequestV4Layout2imageVariant? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.GenerateDesignRequestV4Layout2imageVariantExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateDesignRequestV4ResponseType.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateDesignRequestV4ResponseType.g.cs deleted file mode 100644 index 4af60d8a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateDesignRequestV4ResponseType.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class GenerateDesignRequestV4ResponseTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.GenerateDesignRequestV4ResponseType Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.GenerateDesignRequestV4ResponseTypeExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.GenerateDesignRequestV4ResponseType)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.GenerateDesignRequestV4ResponseType); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.GenerateDesignRequestV4ResponseType value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.GenerateDesignRequestV4ResponseTypeExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateDesignRequestV4ResponseTypeNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateDesignRequestV4ResponseTypeNullable.g.cs deleted file mode 100644 index 5d8cd66d..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateDesignRequestV4ResponseTypeNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class GenerateDesignRequestV4ResponseTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.GenerateDesignRequestV4ResponseType? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.GenerateDesignRequestV4ResponseTypeExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.GenerateDesignRequestV4ResponseType)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.GenerateDesignRequestV4ResponseType?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.GenerateDesignRequestV4ResponseType? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.GenerateDesignRequestV4ResponseTypeExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageGptImage25FlareRequestBackground.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageGptImage25FlareRequestBackground.g.cs deleted file mode 100644 index 79344db3..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageGptImage25FlareRequestBackground.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class GenerateImageGptImage25FlareRequestBackgroundJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.GenerateImageGptImage25FlareRequestBackground Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.GenerateImageGptImage25FlareRequestBackgroundExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.GenerateImageGptImage25FlareRequestBackground)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.GenerateImageGptImage25FlareRequestBackground); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.GenerateImageGptImage25FlareRequestBackground value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.GenerateImageGptImage25FlareRequestBackgroundExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageGptImage25FlareRequestBackgroundNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageGptImage25FlareRequestBackgroundNullable.g.cs deleted file mode 100644 index c08ba019..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageGptImage25FlareRequestBackgroundNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class GenerateImageGptImage25FlareRequestBackgroundNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.GenerateImageGptImage25FlareRequestBackground? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.GenerateImageGptImage25FlareRequestBackgroundExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.GenerateImageGptImage25FlareRequestBackground)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.GenerateImageGptImage25FlareRequestBackground?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.GenerateImageGptImage25FlareRequestBackground? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.GenerateImageGptImage25FlareRequestBackgroundExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageGptImage25FlareRequestQuality.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageGptImage25FlareRequestQuality.g.cs deleted file mode 100644 index 2163ff05..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageGptImage25FlareRequestQuality.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class GenerateImageGptImage25FlareRequestQualityJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.GenerateImageGptImage25FlareRequestQuality Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.GenerateImageGptImage25FlareRequestQualityExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.GenerateImageGptImage25FlareRequestQuality)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.GenerateImageGptImage25FlareRequestQuality); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.GenerateImageGptImage25FlareRequestQuality value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.GenerateImageGptImage25FlareRequestQualityExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageGptImage25FlareRequestQualityNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageGptImage25FlareRequestQualityNullable.g.cs deleted file mode 100644 index eba6e2ce..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageGptImage25FlareRequestQualityNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class GenerateImageGptImage25FlareRequestQualityNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.GenerateImageGptImage25FlareRequestQuality? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.GenerateImageGptImage25FlareRequestQualityExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.GenerateImageGptImage25FlareRequestQuality)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.GenerateImageGptImage25FlareRequestQuality?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.GenerateImageGptImage25FlareRequestQuality? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.GenerateImageGptImage25FlareRequestQualityExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageGptImage25SunburstRequestBackground.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageGptImage25SunburstRequestBackground.g.cs deleted file mode 100644 index bf2da55a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageGptImage25SunburstRequestBackground.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class GenerateImageGptImage25SunburstRequestBackgroundJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.GenerateImageGptImage25SunburstRequestBackground Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.GenerateImageGptImage25SunburstRequestBackgroundExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.GenerateImageGptImage25SunburstRequestBackground)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.GenerateImageGptImage25SunburstRequestBackground); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.GenerateImageGptImage25SunburstRequestBackground value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.GenerateImageGptImage25SunburstRequestBackgroundExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageGptImage25SunburstRequestBackgroundNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageGptImage25SunburstRequestBackgroundNullable.g.cs deleted file mode 100644 index 0ea075e9..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageGptImage25SunburstRequestBackgroundNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class GenerateImageGptImage25SunburstRequestBackgroundNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.GenerateImageGptImage25SunburstRequestBackground? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.GenerateImageGptImage25SunburstRequestBackgroundExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.GenerateImageGptImage25SunburstRequestBackground)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.GenerateImageGptImage25SunburstRequestBackground?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.GenerateImageGptImage25SunburstRequestBackground? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.GenerateImageGptImage25SunburstRequestBackgroundExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageGptImage25SunburstRequestQuality.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageGptImage25SunburstRequestQuality.g.cs deleted file mode 100644 index 848daade..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageGptImage25SunburstRequestQuality.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class GenerateImageGptImage25SunburstRequestQualityJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.GenerateImageGptImage25SunburstRequestQuality Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.GenerateImageGptImage25SunburstRequestQualityExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.GenerateImageGptImage25SunburstRequestQuality)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.GenerateImageGptImage25SunburstRequestQuality); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.GenerateImageGptImage25SunburstRequestQuality value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.GenerateImageGptImage25SunburstRequestQualityExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageGptImage25SunburstRequestQualityNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageGptImage25SunburstRequestQualityNullable.g.cs deleted file mode 100644 index dea6ea67..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageGptImage25SunburstRequestQualityNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class GenerateImageGptImage25SunburstRequestQualityNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.GenerateImageGptImage25SunburstRequestQuality? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.GenerateImageGptImage25SunburstRequestQualityExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.GenerateImageGptImage25SunburstRequestQuality)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.GenerateImageGptImage25SunburstRequestQuality?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.GenerateImageGptImage25SunburstRequestQuality? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.GenerateImageGptImage25SunburstRequestQualityExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageIdeogram45RequestBackground.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageIdeogram45RequestBackground.g.cs deleted file mode 100644 index 92ebc62b..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageIdeogram45RequestBackground.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class GenerateImageIdeogram45RequestBackgroundJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.GenerateImageIdeogram45RequestBackground Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.GenerateImageIdeogram45RequestBackgroundExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.GenerateImageIdeogram45RequestBackground)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.GenerateImageIdeogram45RequestBackground); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.GenerateImageIdeogram45RequestBackground value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.GenerateImageIdeogram45RequestBackgroundExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageIdeogram45RequestBackgroundNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageIdeogram45RequestBackgroundNullable.g.cs deleted file mode 100644 index 8dcc26a1..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageIdeogram45RequestBackgroundNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class GenerateImageIdeogram45RequestBackgroundNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.GenerateImageIdeogram45RequestBackground? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.GenerateImageIdeogram45RequestBackgroundExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.GenerateImageIdeogram45RequestBackground)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.GenerateImageIdeogram45RequestBackground?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.GenerateImageIdeogram45RequestBackground? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.GenerateImageIdeogram45RequestBackgroundExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageIdeogram45RequestQuality.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageIdeogram45RequestQuality.g.cs deleted file mode 100644 index c9b97040..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageIdeogram45RequestQuality.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class GenerateImageIdeogram45RequestQualityJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.GenerateImageIdeogram45RequestQuality Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.GenerateImageIdeogram45RequestQualityExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.GenerateImageIdeogram45RequestQuality)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.GenerateImageIdeogram45RequestQuality); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.GenerateImageIdeogram45RequestQuality value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.GenerateImageIdeogram45RequestQualityExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageIdeogram45RequestQualityNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageIdeogram45RequestQualityNullable.g.cs deleted file mode 100644 index 92bdc0fe..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageIdeogram45RequestQualityNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class GenerateImageIdeogram45RequestQualityNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.GenerateImageIdeogram45RequestQuality? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.GenerateImageIdeogram45RequestQualityExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.GenerateImageIdeogram45RequestQuality)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.GenerateImageIdeogram45RequestQuality?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.GenerateImageIdeogram45RequestQuality? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.GenerateImageIdeogram45RequestQualityExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageIdeogramV3CharacterRequestRenderingSpeed.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageIdeogramV3CharacterRequestRenderingSpeed.g.cs deleted file mode 100644 index 394c299e..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageIdeogramV3CharacterRequestRenderingSpeed.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class GenerateImageIdeogramV3CharacterRequestRenderingSpeedJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.GenerateImageIdeogramV3CharacterRequestRenderingSpeed Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.GenerateImageIdeogramV3CharacterRequestRenderingSpeedExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.GenerateImageIdeogramV3CharacterRequestRenderingSpeed)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.GenerateImageIdeogramV3CharacterRequestRenderingSpeed); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.GenerateImageIdeogramV3CharacterRequestRenderingSpeed value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.GenerateImageIdeogramV3CharacterRequestRenderingSpeedExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageIdeogramV3CharacterRequestRenderingSpeedNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageIdeogramV3CharacterRequestRenderingSpeedNullable.g.cs deleted file mode 100644 index eacba7c9..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageIdeogramV3CharacterRequestRenderingSpeedNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class GenerateImageIdeogramV3CharacterRequestRenderingSpeedNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.GenerateImageIdeogramV3CharacterRequestRenderingSpeed? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.GenerateImageIdeogramV3CharacterRequestRenderingSpeedExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.GenerateImageIdeogramV3CharacterRequestRenderingSpeed)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.GenerateImageIdeogramV3CharacterRequestRenderingSpeed?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.GenerateImageIdeogramV3CharacterRequestRenderingSpeed? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.GenerateImageIdeogramV3CharacterRequestRenderingSpeedExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageIdeogramV3CharacterRequestStyleType.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageIdeogramV3CharacterRequestStyleType.g.cs deleted file mode 100644 index 10f20d5a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageIdeogramV3CharacterRequestStyleType.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class GenerateImageIdeogramV3CharacterRequestStyleTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.GenerateImageIdeogramV3CharacterRequestStyleType Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.GenerateImageIdeogramV3CharacterRequestStyleTypeExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.GenerateImageIdeogramV3CharacterRequestStyleType)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.GenerateImageIdeogramV3CharacterRequestStyleType); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.GenerateImageIdeogramV3CharacterRequestStyleType value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.GenerateImageIdeogramV3CharacterRequestStyleTypeExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageIdeogramV3CharacterRequestStyleTypeNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageIdeogramV3CharacterRequestStyleTypeNullable.g.cs deleted file mode 100644 index 0a3ba344..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageIdeogramV3CharacterRequestStyleTypeNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class GenerateImageIdeogramV3CharacterRequestStyleTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.GenerateImageIdeogramV3CharacterRequestStyleType? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.GenerateImageIdeogramV3CharacterRequestStyleTypeExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.GenerateImageIdeogramV3CharacterRequestStyleType)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.GenerateImageIdeogramV3CharacterRequestStyleType?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.GenerateImageIdeogramV3CharacterRequestStyleType? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.GenerateImageIdeogramV3CharacterRequestStyleTypeExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageIdeogramV3CustomModelRequestRenderingSpeed.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageIdeogramV3CustomModelRequestRenderingSpeed.g.cs deleted file mode 100644 index 98ed6138..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageIdeogramV3CustomModelRequestRenderingSpeed.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class GenerateImageIdeogramV3CustomModelRequestRenderingSpeedJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.GenerateImageIdeogramV3CustomModelRequestRenderingSpeed Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.GenerateImageIdeogramV3CustomModelRequestRenderingSpeedExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.GenerateImageIdeogramV3CustomModelRequestRenderingSpeed)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.GenerateImageIdeogramV3CustomModelRequestRenderingSpeed); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.GenerateImageIdeogramV3CustomModelRequestRenderingSpeed value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.GenerateImageIdeogramV3CustomModelRequestRenderingSpeedExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageIdeogramV3CustomModelRequestRenderingSpeedNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageIdeogramV3CustomModelRequestRenderingSpeedNullable.g.cs deleted file mode 100644 index db0238e1..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageIdeogramV3CustomModelRequestRenderingSpeedNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class GenerateImageIdeogramV3CustomModelRequestRenderingSpeedNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.GenerateImageIdeogramV3CustomModelRequestRenderingSpeed? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.GenerateImageIdeogramV3CustomModelRequestRenderingSpeedExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.GenerateImageIdeogramV3CustomModelRequestRenderingSpeed)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.GenerateImageIdeogramV3CustomModelRequestRenderingSpeed?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.GenerateImageIdeogramV3CustomModelRequestRenderingSpeed? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.GenerateImageIdeogramV3CustomModelRequestRenderingSpeedExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageIdeogramV3RequestRenderingSpeed.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageIdeogramV3RequestRenderingSpeed.g.cs deleted file mode 100644 index d1b50ae8..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageIdeogramV3RequestRenderingSpeed.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class GenerateImageIdeogramV3RequestRenderingSpeedJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.GenerateImageIdeogramV3RequestRenderingSpeed Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.GenerateImageIdeogramV3RequestRenderingSpeedExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.GenerateImageIdeogramV3RequestRenderingSpeed)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.GenerateImageIdeogramV3RequestRenderingSpeed); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.GenerateImageIdeogramV3RequestRenderingSpeed value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.GenerateImageIdeogramV3RequestRenderingSpeedExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageIdeogramV3RequestRenderingSpeedNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageIdeogramV3RequestRenderingSpeedNullable.g.cs deleted file mode 100644 index 37a0697a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageIdeogramV3RequestRenderingSpeedNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class GenerateImageIdeogramV3RequestRenderingSpeedNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.GenerateImageIdeogramV3RequestRenderingSpeed? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.GenerateImageIdeogramV3RequestRenderingSpeedExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.GenerateImageIdeogramV3RequestRenderingSpeed)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.GenerateImageIdeogramV3RequestRenderingSpeed?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.GenerateImageIdeogramV3RequestRenderingSpeed? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.GenerateImageIdeogramV3RequestRenderingSpeedExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageNanoBanana21RequestResolutionTier.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageNanoBanana21RequestResolutionTier.g.cs deleted file mode 100644 index 0a1bdce0..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageNanoBanana21RequestResolutionTier.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class GenerateImageNanoBanana21RequestResolutionTierJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.GenerateImageNanoBanana21RequestResolutionTier Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.GenerateImageNanoBanana21RequestResolutionTierExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.GenerateImageNanoBanana21RequestResolutionTier)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.GenerateImageNanoBanana21RequestResolutionTier); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.GenerateImageNanoBanana21RequestResolutionTier value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.GenerateImageNanoBanana21RequestResolutionTierExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageNanoBanana21RequestResolutionTierNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageNanoBanana21RequestResolutionTierNullable.g.cs deleted file mode 100644 index 8d8bb38f..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageNanoBanana21RequestResolutionTierNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class GenerateImageNanoBanana21RequestResolutionTierNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.GenerateImageNanoBanana21RequestResolutionTier? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.GenerateImageNanoBanana21RequestResolutionTierExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.GenerateImageNanoBanana21RequestResolutionTier)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.GenerateImageNanoBanana21RequestResolutionTier?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.GenerateImageNanoBanana21RequestResolutionTier? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.GenerateImageNanoBanana21RequestResolutionTierExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageNanoBanana2RequestResolutionTier.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageNanoBanana2RequestResolutionTier.g.cs deleted file mode 100644 index 2eb7e0b4..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageNanoBanana2RequestResolutionTier.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class GenerateImageNanoBanana2RequestResolutionTierJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.GenerateImageNanoBanana2RequestResolutionTier Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.GenerateImageNanoBanana2RequestResolutionTierExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.GenerateImageNanoBanana2RequestResolutionTier)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.GenerateImageNanoBanana2RequestResolutionTier); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.GenerateImageNanoBanana2RequestResolutionTier value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.GenerateImageNanoBanana2RequestResolutionTierExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageNanoBanana2RequestResolutionTierNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageNanoBanana2RequestResolutionTierNullable.g.cs deleted file mode 100644 index aea964b9..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageNanoBanana2RequestResolutionTierNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class GenerateImageNanoBanana2RequestResolutionTierNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.GenerateImageNanoBanana2RequestResolutionTier? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.GenerateImageNanoBanana2RequestResolutionTierExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.GenerateImageNanoBanana2RequestResolutionTier)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.GenerateImageNanoBanana2RequestResolutionTier?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.GenerateImageNanoBanana2RequestResolutionTier? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.GenerateImageNanoBanana2RequestResolutionTierExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageNanoBananaProRequestResolutionTier.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageNanoBananaProRequestResolutionTier.g.cs deleted file mode 100644 index a5e0a9a5..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageNanoBananaProRequestResolutionTier.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class GenerateImageNanoBananaProRequestResolutionTierJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.GenerateImageNanoBananaProRequestResolutionTier Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.GenerateImageNanoBananaProRequestResolutionTierExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.GenerateImageNanoBananaProRequestResolutionTier)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.GenerateImageNanoBananaProRequestResolutionTier); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.GenerateImageNanoBananaProRequestResolutionTier value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.GenerateImageNanoBananaProRequestResolutionTierExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageNanoBananaProRequestResolutionTierNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageNanoBananaProRequestResolutionTierNullable.g.cs deleted file mode 100644 index b2f45de7..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageNanoBananaProRequestResolutionTierNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class GenerateImageNanoBananaProRequestResolutionTierNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.GenerateImageNanoBananaProRequestResolutionTier? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.GenerateImageNanoBananaProRequestResolutionTierExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.GenerateImageNanoBananaProRequestResolutionTier)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.GenerateImageNanoBananaProRequestResolutionTier?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.GenerateImageNanoBananaProRequestResolutionTier? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.GenerateImageNanoBananaProRequestResolutionTierExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageRequestV4StableVersion.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageRequestV4StableVersion.g.cs deleted file mode 100644 index 4567a2e7..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageRequestV4StableVersion.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class GenerateImageRequestV4StableVersionJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.GenerateImageRequestV4StableVersion Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.GenerateImageRequestV4StableVersionExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.GenerateImageRequestV4StableVersion)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.GenerateImageRequestV4StableVersion); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.GenerateImageRequestV4StableVersion value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.GenerateImageRequestV4StableVersionExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageRequestV4StableVersionNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageRequestV4StableVersionNullable.g.cs deleted file mode 100644 index eedcc2d0..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageRequestV4StableVersionNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class GenerateImageRequestV4StableVersionNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.GenerateImageRequestV4StableVersion? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.GenerateImageRequestV4StableVersionExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.GenerateImageRequestV4StableVersion)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.GenerateImageRequestV4StableVersion?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.GenerateImageRequestV4StableVersion? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.GenerateImageRequestV4StableVersionExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageV2AutoRequestResolutionTier.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageV2AutoRequestResolutionTier.g.cs deleted file mode 100644 index e4557838..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageV2AutoRequestResolutionTier.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class GenerateImageV2AutoRequestResolutionTierJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.GenerateImageV2AutoRequestResolutionTier Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.GenerateImageV2AutoRequestResolutionTierExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.GenerateImageV2AutoRequestResolutionTier)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.GenerateImageV2AutoRequestResolutionTier); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.GenerateImageV2AutoRequestResolutionTier value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.GenerateImageV2AutoRequestResolutionTierExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageV2AutoRequestResolutionTierNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageV2AutoRequestResolutionTierNullable.g.cs deleted file mode 100644 index 99bbb7ad..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerateImageV2AutoRequestResolutionTierNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class GenerateImageV2AutoRequestResolutionTierNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.GenerateImageV2AutoRequestResolutionTier? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.GenerateImageV2AutoRequestResolutionTierExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.GenerateImageV2AutoRequestResolutionTier)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.GenerateImageV2AutoRequestResolutionTier?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.GenerateImageV2AutoRequestResolutionTier? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.GenerateImageV2AutoRequestResolutionTierExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerationResponseDataInner.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerationResponseDataInner.g.cs index bd808d6f..52a40cb9 100644 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerationResponseDataInner.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerationResponseDataInner.g.cs @@ -21,46 +21,46 @@ public class GenerationResponseDataInnerJsonConverter : global::System.Text.Json throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Ideogram.GenerationResponseDataInnerDiscriminator)}"); var discriminator = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, discriminatorTypeInfo); - global::Ideogram.ImageObjectWithoutPromptOrSeed? imageWithoutPromptOrSeed = default; + global::Ideogram.GenerationResponseDataInnerVariant1? imageWithoutPromptOrSeed = default; if (discriminator?.ObjectType == global::Ideogram.GenerationResponseDataInnerDiscriminatorObjectType.ImageWithoutPromptOrSeed) { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Ideogram.ImageObjectWithoutPromptOrSeed), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Ideogram.ImageObjectWithoutPromptOrSeed)}"); + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Ideogram.GenerationResponseDataInnerVariant1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Ideogram.GenerationResponseDataInnerVariant1)}"); imageWithoutPromptOrSeed = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); } - global::Ideogram.SvgGenerationObject? svgGeneration = default; + global::Ideogram.GenerationResponseDataInnerVariant2? svgGeneration = default; if (discriminator?.ObjectType == global::Ideogram.GenerationResponseDataInnerDiscriminatorObjectType.SvgGeneration) { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Ideogram.SvgGenerationObject), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Ideogram.SvgGenerationObject)}"); + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Ideogram.GenerationResponseDataInnerVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Ideogram.GenerationResponseDataInnerVariant2)}"); svgGeneration = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); } - global::Ideogram.ImageGenerationObject? imageGeneration = default; + global::Ideogram.GenerationResponseDataInnerVariant3? imageGeneration = default; if (discriminator?.ObjectType == global::Ideogram.GenerationResponseDataInnerDiscriminatorObjectType.ImageGeneration) { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Ideogram.ImageGenerationObject), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Ideogram.ImageGenerationObject)}"); + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Ideogram.GenerationResponseDataInnerVariant3), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Ideogram.GenerationResponseDataInnerVariant3)}"); imageGeneration = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); } - global::Ideogram.VideoObject? videoGeneration = default; + global::Ideogram.GenerationResponseDataInnerVariant4? videoGeneration = default; if (discriminator?.ObjectType == global::Ideogram.GenerationResponseDataInnerDiscriminatorObjectType.VideoGeneration) { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Ideogram.VideoObject), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Ideogram.VideoObject)}"); + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Ideogram.GenerationResponseDataInnerVariant4), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Ideogram.GenerationResponseDataInnerVariant4)}"); videoGeneration = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); } - global::Ideogram.LayerizedImageObject? layerizedImage = default; + global::Ideogram.GenerationResponseDataInnerVariant5? layerizedImage = default; if (discriminator?.ObjectType == global::Ideogram.GenerationResponseDataInnerDiscriminatorObjectType.LayerizedImage) { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Ideogram.LayerizedImageObject), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Ideogram.LayerizedImageObject)}"); + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Ideogram.GenerationResponseDataInnerVariant5), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Ideogram.GenerationResponseDataInnerVariant5)}"); layerizedImage = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); } - global::Ideogram.TextLayerizerResultObject? layerizedDesignGeneration = default; + global::Ideogram.GenerationResponseDataInnerVariant6? layerizedDesignGeneration = default; if (discriminator?.ObjectType == global::Ideogram.GenerationResponseDataInnerDiscriminatorObjectType.LayerizedDesignGeneration) { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Ideogram.TextLayerizerResultObject), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Ideogram.TextLayerizerResultObject)}"); + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Ideogram.GenerationResponseDataInnerVariant6), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Ideogram.GenerationResponseDataInnerVariant6)}"); layerizedDesignGeneration = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); } @@ -93,38 +93,38 @@ public override void Write( if (value.IsImageWithoutPromptOrSeed) { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Ideogram.ImageObjectWithoutPromptOrSeed), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Ideogram.ImageObjectWithoutPromptOrSeed).Name}"); + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Ideogram.GenerationResponseDataInnerVariant1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Ideogram.GenerationResponseDataInnerVariant1).Name}"); global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickImageWithoutPromptOrSeed(), typeInfo); } else if (value.IsSvgGeneration) { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Ideogram.SvgGenerationObject), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Ideogram.SvgGenerationObject).Name}"); + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Ideogram.GenerationResponseDataInnerVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Ideogram.GenerationResponseDataInnerVariant2).Name}"); global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickSvgGeneration(), typeInfo); } else if (value.IsImageGeneration) { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Ideogram.ImageGenerationObject), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Ideogram.ImageGenerationObject).Name}"); + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Ideogram.GenerationResponseDataInnerVariant3), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Ideogram.GenerationResponseDataInnerVariant3).Name}"); global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickImageGeneration(), typeInfo); } else if (value.IsVideoGeneration) { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Ideogram.VideoObject), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Ideogram.VideoObject).Name}"); + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Ideogram.GenerationResponseDataInnerVariant4), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Ideogram.GenerationResponseDataInnerVariant4).Name}"); global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickVideoGeneration(), typeInfo); } else if (value.IsLayerizedImage) { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Ideogram.LayerizedImageObject), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Ideogram.LayerizedImageObject).Name}"); + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Ideogram.GenerationResponseDataInnerVariant5), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Ideogram.GenerationResponseDataInnerVariant5).Name}"); global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickLayerizedImage(), typeInfo); } else if (value.IsLayerizedDesignGeneration) { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Ideogram.TextLayerizerResultObject), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Ideogram.TextLayerizerResultObject).Name}"); + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Ideogram.GenerationResponseDataInnerVariant6), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Ideogram.GenerationResponseDataInnerVariant6).Name}"); global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickLayerizedDesignGeneration(), typeInfo); } } diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerationResponseDataInnerDiscriminatorMappingSvgGenerationMimeType.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerationResponseDataInnerDiscriminatorMappingSvgGenerationMimeType.g.cs new file mode 100644 index 00000000..45562f44 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerationResponseDataInnerDiscriminatorMappingSvgGenerationMimeType.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class GenerationResponseDataInnerDiscriminatorMappingSvgGenerationMimeTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.GenerationResponseDataInnerDiscriminatorMappingSvgGenerationMimeType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.GenerationResponseDataInnerDiscriminatorMappingSvgGenerationMimeTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.GenerationResponseDataInnerDiscriminatorMappingSvgGenerationMimeType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.GenerationResponseDataInnerDiscriminatorMappingSvgGenerationMimeType); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.GenerationResponseDataInnerDiscriminatorMappingSvgGenerationMimeType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Ideogram.GenerationResponseDataInnerDiscriminatorMappingSvgGenerationMimeTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerationResponseDataInnerDiscriminatorMappingSvgGenerationMimeTypeNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerationResponseDataInnerDiscriminatorMappingSvgGenerationMimeTypeNullable.g.cs new file mode 100644 index 00000000..ae96d300 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerationResponseDataInnerDiscriminatorMappingSvgGenerationMimeTypeNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class GenerationResponseDataInnerDiscriminatorMappingSvgGenerationMimeTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.GenerationResponseDataInnerDiscriminatorMappingSvgGenerationMimeType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.GenerationResponseDataInnerDiscriminatorMappingSvgGenerationMimeTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.GenerationResponseDataInnerDiscriminatorMappingSvgGenerationMimeType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.GenerationResponseDataInnerDiscriminatorMappingSvgGenerationMimeType?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.GenerationResponseDataInnerDiscriminatorMappingSvgGenerationMimeType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Ideogram.GenerationResponseDataInnerDiscriminatorMappingSvgGenerationMimeTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerationResponseDataInnerVariant1ObjectType.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerationResponseDataInnerVariant1ObjectType.g.cs new file mode 100644 index 00000000..a975fb0c --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerationResponseDataInnerVariant1ObjectType.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class GenerationResponseDataInnerVariant1ObjectTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.GenerationResponseDataInnerVariant1ObjectType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.GenerationResponseDataInnerVariant1ObjectTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.GenerationResponseDataInnerVariant1ObjectType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.GenerationResponseDataInnerVariant1ObjectType); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.GenerationResponseDataInnerVariant1ObjectType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Ideogram.GenerationResponseDataInnerVariant1ObjectTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerationResponseDataInnerVariant1ObjectTypeNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerationResponseDataInnerVariant1ObjectTypeNullable.g.cs new file mode 100644 index 00000000..0a11cace --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerationResponseDataInnerVariant1ObjectTypeNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class GenerationResponseDataInnerVariant1ObjectTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.GenerationResponseDataInnerVariant1ObjectType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.GenerationResponseDataInnerVariant1ObjectTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.GenerationResponseDataInnerVariant1ObjectType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.GenerationResponseDataInnerVariant1ObjectType?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.GenerationResponseDataInnerVariant1ObjectType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Ideogram.GenerationResponseDataInnerVariant1ObjectTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerationResponseDataInnerVariant2ObjectType.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerationResponseDataInnerVariant2ObjectType.g.cs new file mode 100644 index 00000000..4fe76d21 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerationResponseDataInnerVariant2ObjectType.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class GenerationResponseDataInnerVariant2ObjectTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.GenerationResponseDataInnerVariant2ObjectType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.GenerationResponseDataInnerVariant2ObjectTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.GenerationResponseDataInnerVariant2ObjectType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.GenerationResponseDataInnerVariant2ObjectType); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.GenerationResponseDataInnerVariant2ObjectType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Ideogram.GenerationResponseDataInnerVariant2ObjectTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerationResponseDataInnerVariant2ObjectTypeNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerationResponseDataInnerVariant2ObjectTypeNullable.g.cs new file mode 100644 index 00000000..9d5cb359 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerationResponseDataInnerVariant2ObjectTypeNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class GenerationResponseDataInnerVariant2ObjectTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.GenerationResponseDataInnerVariant2ObjectType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.GenerationResponseDataInnerVariant2ObjectTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.GenerationResponseDataInnerVariant2ObjectType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.GenerationResponseDataInnerVariant2ObjectType?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.GenerationResponseDataInnerVariant2ObjectType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Ideogram.GenerationResponseDataInnerVariant2ObjectTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerationResponseDataInnerVariant3ObjectType.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerationResponseDataInnerVariant3ObjectType.g.cs new file mode 100644 index 00000000..3f312392 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerationResponseDataInnerVariant3ObjectType.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class GenerationResponseDataInnerVariant3ObjectTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.GenerationResponseDataInnerVariant3ObjectType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.GenerationResponseDataInnerVariant3ObjectTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.GenerationResponseDataInnerVariant3ObjectType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.GenerationResponseDataInnerVariant3ObjectType); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.GenerationResponseDataInnerVariant3ObjectType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Ideogram.GenerationResponseDataInnerVariant3ObjectTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerationResponseDataInnerVariant3ObjectTypeNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerationResponseDataInnerVariant3ObjectTypeNullable.g.cs new file mode 100644 index 00000000..f2f6f15f --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerationResponseDataInnerVariant3ObjectTypeNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class GenerationResponseDataInnerVariant3ObjectTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.GenerationResponseDataInnerVariant3ObjectType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.GenerationResponseDataInnerVariant3ObjectTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.GenerationResponseDataInnerVariant3ObjectType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.GenerationResponseDataInnerVariant3ObjectType?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.GenerationResponseDataInnerVariant3ObjectType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Ideogram.GenerationResponseDataInnerVariant3ObjectTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerationResponseDataInnerVariant4ObjectType.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerationResponseDataInnerVariant4ObjectType.g.cs new file mode 100644 index 00000000..272fdda0 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerationResponseDataInnerVariant4ObjectType.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class GenerationResponseDataInnerVariant4ObjectTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.GenerationResponseDataInnerVariant4ObjectType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.GenerationResponseDataInnerVariant4ObjectTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.GenerationResponseDataInnerVariant4ObjectType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.GenerationResponseDataInnerVariant4ObjectType); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.GenerationResponseDataInnerVariant4ObjectType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Ideogram.GenerationResponseDataInnerVariant4ObjectTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerationResponseDataInnerVariant4ObjectTypeNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerationResponseDataInnerVariant4ObjectTypeNullable.g.cs new file mode 100644 index 00000000..49088480 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerationResponseDataInnerVariant4ObjectTypeNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class GenerationResponseDataInnerVariant4ObjectTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.GenerationResponseDataInnerVariant4ObjectType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.GenerationResponseDataInnerVariant4ObjectTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.GenerationResponseDataInnerVariant4ObjectType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.GenerationResponseDataInnerVariant4ObjectType?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.GenerationResponseDataInnerVariant4ObjectType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Ideogram.GenerationResponseDataInnerVariant4ObjectTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerationResponseDataInnerVariant5ObjectType.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerationResponseDataInnerVariant5ObjectType.g.cs new file mode 100644 index 00000000..377e257b --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerationResponseDataInnerVariant5ObjectType.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class GenerationResponseDataInnerVariant5ObjectTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.GenerationResponseDataInnerVariant5ObjectType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.GenerationResponseDataInnerVariant5ObjectTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.GenerationResponseDataInnerVariant5ObjectType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.GenerationResponseDataInnerVariant5ObjectType); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.GenerationResponseDataInnerVariant5ObjectType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Ideogram.GenerationResponseDataInnerVariant5ObjectTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerationResponseDataInnerVariant5ObjectTypeNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerationResponseDataInnerVariant5ObjectTypeNullable.g.cs new file mode 100644 index 00000000..88b252a5 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerationResponseDataInnerVariant5ObjectTypeNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class GenerationResponseDataInnerVariant5ObjectTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.GenerationResponseDataInnerVariant5ObjectType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.GenerationResponseDataInnerVariant5ObjectTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.GenerationResponseDataInnerVariant5ObjectType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.GenerationResponseDataInnerVariant5ObjectType?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.GenerationResponseDataInnerVariant5ObjectType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Ideogram.GenerationResponseDataInnerVariant5ObjectTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerationResponseDataInnerVariant6ObjectType.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerationResponseDataInnerVariant6ObjectType.g.cs new file mode 100644 index 00000000..084d1721 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerationResponseDataInnerVariant6ObjectType.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class GenerationResponseDataInnerVariant6ObjectTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.GenerationResponseDataInnerVariant6ObjectType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.GenerationResponseDataInnerVariant6ObjectTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.GenerationResponseDataInnerVariant6ObjectType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.GenerationResponseDataInnerVariant6ObjectType); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.GenerationResponseDataInnerVariant6ObjectType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Ideogram.GenerationResponseDataInnerVariant6ObjectTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerationResponseDataInnerVariant6ObjectTypeNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerationResponseDataInnerVariant6ObjectTypeNullable.g.cs new file mode 100644 index 00000000..81e79b1f --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GenerationResponseDataInnerVariant6ObjectTypeNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class GenerationResponseDataInnerVariant6ObjectTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.GenerationResponseDataInnerVariant6ObjectType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.GenerationResponseDataInnerVariant6ObjectTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.GenerationResponseDataInnerVariant6ObjectType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.GenerationResponseDataInnerVariant6ObjectType?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.GenerationResponseDataInnerVariant6ObjectType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Ideogram.GenerationResponseDataInnerVariant6ObjectTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GetAccountUsageBucketWidth.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GetAccountUsageBucketWidth.g.cs deleted file mode 100644 index 92d0f51a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GetAccountUsageBucketWidth.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class GetAccountUsageBucketWidthJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.GetAccountUsageBucketWidth Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.GetAccountUsageBucketWidthExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.GetAccountUsageBucketWidth)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.GetAccountUsageBucketWidth); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.GetAccountUsageBucketWidth value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.GetAccountUsageBucketWidthExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GetAccountUsageBucketWidthNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GetAccountUsageBucketWidthNullable.g.cs deleted file mode 100644 index c1113a5f..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GetAccountUsageBucketWidthNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class GetAccountUsageBucketWidthNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.GetAccountUsageBucketWidth? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.GetAccountUsageBucketWidthExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.GetAccountUsageBucketWidth)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.GetAccountUsageBucketWidth?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.GetAccountUsageBucketWidth? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.GetAccountUsageBucketWidthExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GetAccountUsageSource.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GetAccountUsageSource.g.cs deleted file mode 100644 index ad4b5367..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GetAccountUsageSource.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class GetAccountUsageSourceJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.GetAccountUsageSource Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.GetAccountUsageSourceExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.GetAccountUsageSource)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.GetAccountUsageSource); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.GetAccountUsageSource value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.GetAccountUsageSourceExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GetAccountUsageSourceNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GetAccountUsageSourceNullable.g.cs deleted file mode 100644 index 51e67586..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GetAccountUsageSourceNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class GetAccountUsageSourceNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.GetAccountUsageSource? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.GetAccountUsageSourceExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.GetAccountUsageSource)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.GetAccountUsageSource?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.GetAccountUsageSource? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.GetAccountUsageSourceExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GhostMannequinRequestView.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GhostMannequinRequestView.g.cs deleted file mode 100644 index 16dc8295..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GhostMannequinRequestView.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class GhostMannequinRequestViewJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.GhostMannequinRequestView Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.GhostMannequinRequestViewExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.GhostMannequinRequestView)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.GhostMannequinRequestView); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.GhostMannequinRequestView value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.GhostMannequinRequestViewExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GhostMannequinRequestViewNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GhostMannequinRequestViewNullable.g.cs deleted file mode 100644 index 816ce8ad..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.GhostMannequinRequestViewNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class GhostMannequinRequestViewNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.GhostMannequinRequestView? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.GhostMannequinRequestViewExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.GhostMannequinRequestView)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.GhostMannequinRequestView?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.GhostMannequinRequestView? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.GhostMannequinRequestViewExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ImageGenerationObjectObjectType.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ImageGenerationObjectObjectType.g.cs deleted file mode 100644 index 1d5796b1..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ImageGenerationObjectObjectType.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class ImageGenerationObjectObjectTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.ImageGenerationObjectObjectType Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.ImageGenerationObjectObjectTypeExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.ImageGenerationObjectObjectType)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.ImageGenerationObjectObjectType); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.ImageGenerationObjectObjectType value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.ImageGenerationObjectObjectTypeExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ImageGenerationObjectObjectTypeNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ImageGenerationObjectObjectTypeNullable.g.cs deleted file mode 100644 index c7db34fa..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ImageGenerationObjectObjectTypeNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class ImageGenerationObjectObjectTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.ImageGenerationObjectObjectType? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.ImageGenerationObjectObjectTypeExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.ImageGenerationObjectObjectType)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.ImageGenerationObjectObjectType?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.ImageGenerationObjectObjectType? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.ImageGenerationObjectObjectTypeExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ImageGenerationResponseV4ImageToImageResponseType.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ImageGenerationResponseV4ImageToImageResponseType.g.cs deleted file mode 100644 index 16286acc..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ImageGenerationResponseV4ImageToImageResponseType.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class ImageGenerationResponseV4ImageToImageResponseTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.ImageGenerationResponseV4ImageToImageResponseType Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.ImageGenerationResponseV4ImageToImageResponseTypeExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.ImageGenerationResponseV4ImageToImageResponseType)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.ImageGenerationResponseV4ImageToImageResponseType); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.ImageGenerationResponseV4ImageToImageResponseType value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.ImageGenerationResponseV4ImageToImageResponseTypeExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ImageGenerationResponseV4ImageToImageResponseTypeNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ImageGenerationResponseV4ImageToImageResponseTypeNullable.g.cs deleted file mode 100644 index 28a9f88c..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ImageGenerationResponseV4ImageToImageResponseTypeNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class ImageGenerationResponseV4ImageToImageResponseTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.ImageGenerationResponseV4ImageToImageResponseType? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.ImageGenerationResponseV4ImageToImageResponseTypeExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.ImageGenerationResponseV4ImageToImageResponseType)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.ImageGenerationResponseV4ImageToImageResponseType?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.ImageGenerationResponseV4ImageToImageResponseType? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.ImageGenerationResponseV4ImageToImageResponseTypeExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ImageGenerationResponseV4LayoutResponseType.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ImageGenerationResponseV4LayoutResponseType.g.cs deleted file mode 100644 index f59fc14b..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ImageGenerationResponseV4LayoutResponseType.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class ImageGenerationResponseV4LayoutResponseTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.ImageGenerationResponseV4LayoutResponseType Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.ImageGenerationResponseV4LayoutResponseTypeExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.ImageGenerationResponseV4LayoutResponseType)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.ImageGenerationResponseV4LayoutResponseType); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.ImageGenerationResponseV4LayoutResponseType value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.ImageGenerationResponseV4LayoutResponseTypeExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ImageGenerationResponseV4LayoutResponseTypeNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ImageGenerationResponseV4LayoutResponseTypeNullable.g.cs deleted file mode 100644 index 555e1d7e..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ImageGenerationResponseV4LayoutResponseTypeNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class ImageGenerationResponseV4LayoutResponseTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.ImageGenerationResponseV4LayoutResponseType? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.ImageGenerationResponseV4LayoutResponseTypeExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.ImageGenerationResponseV4LayoutResponseType)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.ImageGenerationResponseV4LayoutResponseType?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.ImageGenerationResponseV4LayoutResponseType? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.ImageGenerationResponseV4LayoutResponseTypeExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ImageGenerationResponseV4ResponseType.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ImageGenerationResponseV4ResponseType.g.cs deleted file mode 100644 index 3446da2d..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ImageGenerationResponseV4ResponseType.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class ImageGenerationResponseV4ResponseTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.ImageGenerationResponseV4ResponseType Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.ImageGenerationResponseV4ResponseTypeExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.ImageGenerationResponseV4ResponseType)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.ImageGenerationResponseV4ResponseType); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.ImageGenerationResponseV4ResponseType value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.ImageGenerationResponseV4ResponseTypeExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ImageGenerationResponseV4ResponseTypeNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ImageGenerationResponseV4ResponseTypeNullable.g.cs deleted file mode 100644 index 85f50ecf..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ImageGenerationResponseV4ResponseTypeNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class ImageGenerationResponseV4ResponseTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.ImageGenerationResponseV4ResponseType? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.ImageGenerationResponseV4ResponseTypeExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.ImageGenerationResponseV4ResponseType)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.ImageGenerationResponseV4ResponseType?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.ImageGenerationResponseV4ResponseType? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.ImageGenerationResponseV4ResponseTypeExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ImageObjectWithoutPromptOrSeedObjectType.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ImageObjectWithoutPromptOrSeedObjectType.g.cs deleted file mode 100644 index de2a20b2..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ImageObjectWithoutPromptOrSeedObjectType.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class ImageObjectWithoutPromptOrSeedObjectTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.ImageObjectWithoutPromptOrSeedObjectType Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.ImageObjectWithoutPromptOrSeedObjectTypeExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.ImageObjectWithoutPromptOrSeedObjectType)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.ImageObjectWithoutPromptOrSeedObjectType); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.ImageObjectWithoutPromptOrSeedObjectType value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.ImageObjectWithoutPromptOrSeedObjectTypeExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ImageObjectWithoutPromptOrSeedObjectTypeNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ImageObjectWithoutPromptOrSeedObjectTypeNullable.g.cs deleted file mode 100644 index aefec2cd..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ImageObjectWithoutPromptOrSeedObjectTypeNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class ImageObjectWithoutPromptOrSeedObjectTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.ImageObjectWithoutPromptOrSeedObjectType? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.ImageObjectWithoutPromptOrSeedObjectTypeExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.ImageObjectWithoutPromptOrSeedObjectType)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.ImageObjectWithoutPromptOrSeedObjectType?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.ImageObjectWithoutPromptOrSeedObjectType? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.ImageObjectWithoutPromptOrSeedObjectTypeExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.InpaintImageIdeogramV3CharacterRequestRenderingSpeed.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.InpaintImageIdeogramV3CharacterRequestRenderingSpeed.g.cs deleted file mode 100644 index b98e5cba..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.InpaintImageIdeogramV3CharacterRequestRenderingSpeed.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class InpaintImageIdeogramV3CharacterRequestRenderingSpeedJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.InpaintImageIdeogramV3CharacterRequestRenderingSpeed Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.InpaintImageIdeogramV3CharacterRequestRenderingSpeedExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.InpaintImageIdeogramV3CharacterRequestRenderingSpeed)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.InpaintImageIdeogramV3CharacterRequestRenderingSpeed); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.InpaintImageIdeogramV3CharacterRequestRenderingSpeed value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.InpaintImageIdeogramV3CharacterRequestRenderingSpeedExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.InpaintImageIdeogramV3CharacterRequestRenderingSpeedNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.InpaintImageIdeogramV3CharacterRequestRenderingSpeedNullable.g.cs deleted file mode 100644 index b9a6fd68..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.InpaintImageIdeogramV3CharacterRequestRenderingSpeedNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class InpaintImageIdeogramV3CharacterRequestRenderingSpeedNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.InpaintImageIdeogramV3CharacterRequestRenderingSpeed? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.InpaintImageIdeogramV3CharacterRequestRenderingSpeedExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.InpaintImageIdeogramV3CharacterRequestRenderingSpeed)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.InpaintImageIdeogramV3CharacterRequestRenderingSpeed?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.InpaintImageIdeogramV3CharacterRequestRenderingSpeed? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.InpaintImageIdeogramV3CharacterRequestRenderingSpeedExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.InpaintImageIdeogramV3CharacterRequestStyleType.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.InpaintImageIdeogramV3CharacterRequestStyleType.g.cs deleted file mode 100644 index 08bc1e9f..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.InpaintImageIdeogramV3CharacterRequestStyleType.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class InpaintImageIdeogramV3CharacterRequestStyleTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.InpaintImageIdeogramV3CharacterRequestStyleType Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.InpaintImageIdeogramV3CharacterRequestStyleTypeExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.InpaintImageIdeogramV3CharacterRequestStyleType)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.InpaintImageIdeogramV3CharacterRequestStyleType); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.InpaintImageIdeogramV3CharacterRequestStyleType value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.InpaintImageIdeogramV3CharacterRequestStyleTypeExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.InpaintImageIdeogramV3CharacterRequestStyleTypeNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.InpaintImageIdeogramV3CharacterRequestStyleTypeNullable.g.cs deleted file mode 100644 index dd625bc9..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.InpaintImageIdeogramV3CharacterRequestStyleTypeNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class InpaintImageIdeogramV3CharacterRequestStyleTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.InpaintImageIdeogramV3CharacterRequestStyleType? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.InpaintImageIdeogramV3CharacterRequestStyleTypeExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.InpaintImageIdeogramV3CharacterRequestStyleType)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.InpaintImageIdeogramV3CharacterRequestStyleType?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.InpaintImageIdeogramV3CharacterRequestStyleType? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.InpaintImageIdeogramV3CharacterRequestStyleTypeExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.InpaintImageIdeogramV3CustomModelRequestRenderingSpeed.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.InpaintImageIdeogramV3CustomModelRequestRenderingSpeed.g.cs deleted file mode 100644 index 7e30309c..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.InpaintImageIdeogramV3CustomModelRequestRenderingSpeed.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class InpaintImageIdeogramV3CustomModelRequestRenderingSpeedJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.InpaintImageIdeogramV3CustomModelRequestRenderingSpeed Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.InpaintImageIdeogramV3CustomModelRequestRenderingSpeedExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.InpaintImageIdeogramV3CustomModelRequestRenderingSpeed)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.InpaintImageIdeogramV3CustomModelRequestRenderingSpeed); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.InpaintImageIdeogramV3CustomModelRequestRenderingSpeed value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.InpaintImageIdeogramV3CustomModelRequestRenderingSpeedExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.InpaintImageIdeogramV3CustomModelRequestRenderingSpeedNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.InpaintImageIdeogramV3CustomModelRequestRenderingSpeedNullable.g.cs deleted file mode 100644 index efb2e63a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.InpaintImageIdeogramV3CustomModelRequestRenderingSpeedNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class InpaintImageIdeogramV3CustomModelRequestRenderingSpeedNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.InpaintImageIdeogramV3CustomModelRequestRenderingSpeed? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.InpaintImageIdeogramV3CustomModelRequestRenderingSpeedExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.InpaintImageIdeogramV3CustomModelRequestRenderingSpeed)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.InpaintImageIdeogramV3CustomModelRequestRenderingSpeed?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.InpaintImageIdeogramV3CustomModelRequestRenderingSpeed? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.InpaintImageIdeogramV3CustomModelRequestRenderingSpeedExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.InpaintImageIdeogramV3RequestRenderingSpeed.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.InpaintImageIdeogramV3RequestRenderingSpeed.g.cs deleted file mode 100644 index 760c13a7..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.InpaintImageIdeogramV3RequestRenderingSpeed.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class InpaintImageIdeogramV3RequestRenderingSpeedJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.InpaintImageIdeogramV3RequestRenderingSpeed Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.InpaintImageIdeogramV3RequestRenderingSpeedExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.InpaintImageIdeogramV3RequestRenderingSpeed)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.InpaintImageIdeogramV3RequestRenderingSpeed); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.InpaintImageIdeogramV3RequestRenderingSpeed value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.InpaintImageIdeogramV3RequestRenderingSpeedExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.InpaintImageIdeogramV3RequestRenderingSpeedNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.InpaintImageIdeogramV3RequestRenderingSpeedNullable.g.cs deleted file mode 100644 index f6a1f18e..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.InpaintImageIdeogramV3RequestRenderingSpeedNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class InpaintImageIdeogramV3RequestRenderingSpeedNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.InpaintImageIdeogramV3RequestRenderingSpeed? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.InpaintImageIdeogramV3RequestRenderingSpeedExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.InpaintImageIdeogramV3RequestRenderingSpeed)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.InpaintImageIdeogramV3RequestRenderingSpeed?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.InpaintImageIdeogramV3RequestRenderingSpeed? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.InpaintImageIdeogramV3RequestRenderingSpeedExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.IntegrationErrorResponseError.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.IntegrationErrorResponseError.g.cs deleted file mode 100644 index ee993f55..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.IntegrationErrorResponseError.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class IntegrationErrorResponseErrorJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.IntegrationErrorResponseError Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.IntegrationErrorResponseErrorExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.IntegrationErrorResponseError)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.IntegrationErrorResponseError); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.IntegrationErrorResponseError value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.IntegrationErrorResponseErrorExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.IntegrationErrorResponseErrorNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.IntegrationErrorResponseErrorNullable.g.cs deleted file mode 100644 index 874075b7..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.IntegrationErrorResponseErrorNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class IntegrationErrorResponseErrorNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.IntegrationErrorResponseError? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.IntegrationErrorResponseErrorExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.IntegrationErrorResponseError)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.IntegrationErrorResponseError?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.IntegrationErrorResponseError? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.IntegrationErrorResponseErrorExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.IntegrationType.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.IntegrationType.g.cs deleted file mode 100644 index 295cc06d..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.IntegrationType.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class IntegrationTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.IntegrationType Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.IntegrationTypeExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.IntegrationType)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.IntegrationType); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.IntegrationType value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.IntegrationTypeExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.IntegrationTypeNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.IntegrationTypeNullable.g.cs deleted file mode 100644 index db4c759b..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.IntegrationTypeNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class IntegrationTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.IntegrationType? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.IntegrationTypeExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.IntegrationType)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.IntegrationType?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.IntegrationType? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.IntegrationTypeExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.InternalTestingEnumField.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.InternalTestingEnumField.g.cs deleted file mode 100644 index 2681f1ee..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.InternalTestingEnumField.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class InternalTestingEnumFieldJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.InternalTestingEnumField Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.InternalTestingEnumFieldExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.InternalTestingEnumField)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.InternalTestingEnumField); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.InternalTestingEnumField value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.InternalTestingEnumFieldExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.InternalTestingEnumFieldNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.InternalTestingEnumFieldNullable.g.cs deleted file mode 100644 index 0341612c..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.InternalTestingEnumFieldNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class InternalTestingEnumFieldNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.InternalTestingEnumField? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.InternalTestingEnumFieldExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.InternalTestingEnumField)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.InternalTestingEnumField?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.InternalTestingEnumField? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.InternalTestingEnumFieldExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.InvoiceStatus.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.InvoiceStatus.g.cs deleted file mode 100644 index f5c20d45..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.InvoiceStatus.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class InvoiceStatusJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.InvoiceStatus Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.InvoiceStatusExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.InvoiceStatus)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.InvoiceStatus); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.InvoiceStatus value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.InvoiceStatusExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.InvoiceStatusNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.InvoiceStatusNullable.g.cs deleted file mode 100644 index 7a817165..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.InvoiceStatusNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class InvoiceStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.InvoiceStatus? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.InvoiceStatusExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.InvoiceStatus)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.InvoiceStatus?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.InvoiceStatus? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.InvoiceStatusExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.LayeredImageGenerationResponseV3ResponseType.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.LayeredImageGenerationResponseV3ResponseType.g.cs deleted file mode 100644 index 222a4868..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.LayeredImageGenerationResponseV3ResponseType.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class LayeredImageGenerationResponseV3ResponseTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.LayeredImageGenerationResponseV3ResponseType Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.LayeredImageGenerationResponseV3ResponseTypeExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.LayeredImageGenerationResponseV3ResponseType)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.LayeredImageGenerationResponseV3ResponseType); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.LayeredImageGenerationResponseV3ResponseType value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.LayeredImageGenerationResponseV3ResponseTypeExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.LayeredImageGenerationResponseV3ResponseTypeNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.LayeredImageGenerationResponseV3ResponseTypeNullable.g.cs deleted file mode 100644 index 255e7007..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.LayeredImageGenerationResponseV3ResponseTypeNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class LayeredImageGenerationResponseV3ResponseTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.LayeredImageGenerationResponseV3ResponseType? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.LayeredImageGenerationResponseV3ResponseTypeExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.LayeredImageGenerationResponseV3ResponseType)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.LayeredImageGenerationResponseV3ResponseType?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.LayeredImageGenerationResponseV3ResponseType? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.LayeredImageGenerationResponseV3ResponseTypeExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.LayerizedImageObjectObjectType.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.LayerizedImageObjectObjectType.g.cs deleted file mode 100644 index 1e127513..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.LayerizedImageObjectObjectType.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class LayerizedImageObjectObjectTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.LayerizedImageObjectObjectType Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.LayerizedImageObjectObjectTypeExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.LayerizedImageObjectObjectType)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.LayerizedImageObjectObjectType); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.LayerizedImageObjectObjectType value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.LayerizedImageObjectObjectTypeExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.LayerizedImageObjectObjectTypeNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.LayerizedImageObjectObjectTypeNullable.g.cs deleted file mode 100644 index 8bca3940..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.LayerizedImageObjectObjectTypeNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class LayerizedImageObjectObjectTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.LayerizedImageObjectObjectType? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.LayerizedImageObjectObjectTypeExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.LayerizedImageObjectObjectType)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.LayerizedImageObjectObjectType?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.LayerizedImageObjectObjectType? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.LayerizedImageObjectObjectTypeExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.LayerizedTextBlock.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.LayerizedTextBlock.g.cs deleted file mode 100644 index 659beb44..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.LayerizedTextBlock.g.cs +++ /dev/null @@ -1,108 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 // Type or member is obsolete - -namespace Ideogram.JsonConverters -{ - /// - public class LayerizedTextBlockJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.LayerizedTextBlock Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - options = options ?? throw new global::System.ArgumentNullException(nameof(options)); - var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); - - using var __jsonDocument = global::System.Text.Json.JsonDocument.ParseValue(ref reader); - var __rawJson = __jsonDocument.RootElement.GetRawText(); - - global::Ideogram.DetectedTextBlock? detectedTextBlock = default; - try - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Ideogram.DetectedTextBlock), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Ideogram.DetectedTextBlock).Name}"); - detectedTextBlock = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); - } - catch (global::System.Text.Json.JsonException) - { - } - catch (global::System.InvalidOperationException) - { - } - - global::Ideogram.LayerizedTextBlockVariant2? layerizedTextBlockVariant2 = default; - try - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Ideogram.LayerizedTextBlockVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Ideogram.LayerizedTextBlockVariant2).Name}"); - layerizedTextBlockVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); - } - catch (global::System.Text.Json.JsonException) - { - } - catch (global::System.InvalidOperationException) - { - } - var __value = new global::Ideogram.LayerizedTextBlock( - detectedTextBlock, - - layerizedTextBlockVariant2 - ); - - return __value; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.LayerizedTextBlock value, - global::System.Text.Json.JsonSerializerOptions options) - { - options = options ?? throw new global::System.ArgumentNullException(nameof(options)); - var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); - - - writer.WriteStartObject(); - var __writtenPropertyNames = new global::System.Collections.Generic.HashSet(global::System.StringComparer.Ordinal); - if (value.IsDetectedTextBlock) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Ideogram.DetectedTextBlock), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Ideogram.DetectedTextBlock).Name}"); - var __element0 = global::System.Text.Json.JsonSerializer.SerializeToElement(value.PickDetectedTextBlock(), typeInfo); - if (__element0.ValueKind != global::System.Text.Json.JsonValueKind.Object) - { - throw new global::System.Text.Json.JsonException("AllOf values must serialize as JSON objects."); - } - - foreach (var __property in __element0.EnumerateObject()) - { - if (__writtenPropertyNames.Add(__property.Name)) - { - __property.WriteTo(writer); - } - } - } - if (value.IsLayerizedTextBlockVariant2) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Ideogram.LayerizedTextBlockVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Ideogram.LayerizedTextBlockVariant2).Name}"); - var __element1 = global::System.Text.Json.JsonSerializer.SerializeToElement(value.PickLayerizedTextBlockVariant2(), typeInfo); - if (__element1.ValueKind != global::System.Text.Json.JsonValueKind.Object) - { - throw new global::System.Text.Json.JsonException("AllOf values must serialize as JSON objects."); - } - - foreach (var __property in __element1.EnumerateObject()) - { - if (__writtenPropertyNames.Add(__property.Name)) - { - __property.WriteTo(writer); - } - } - } - writer.WriteEndObject(); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.LayerizedTextBlockAlignment.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.LayerizedTextBlockAlignment.g.cs new file mode 100644 index 00000000..48b624dd --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.LayerizedTextBlockAlignment.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class LayerizedTextBlockAlignmentJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.LayerizedTextBlockAlignment Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.LayerizedTextBlockAlignmentExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.LayerizedTextBlockAlignment)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.LayerizedTextBlockAlignment); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.LayerizedTextBlockAlignment value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Ideogram.LayerizedTextBlockAlignmentExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.LayerizedTextBlockAlignmentNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.LayerizedTextBlockAlignmentNullable.g.cs new file mode 100644 index 00000000..9d01a178 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.LayerizedTextBlockAlignmentNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class LayerizedTextBlockAlignmentNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.LayerizedTextBlockAlignment? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.LayerizedTextBlockAlignmentExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.LayerizedTextBlockAlignment)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.LayerizedTextBlockAlignment?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.LayerizedTextBlockAlignment? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Ideogram.LayerizedTextBlockAlignmentExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.LayerizedTextBlockFormattingItems.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.LayerizedTextBlockFormattingItems.g.cs new file mode 100644 index 00000000..a5c5ac28 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.LayerizedTextBlockFormattingItems.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class LayerizedTextBlockFormattingItemsJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.LayerizedTextBlockFormattingItems Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.LayerizedTextBlockFormattingItemsExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.LayerizedTextBlockFormattingItems)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.LayerizedTextBlockFormattingItems); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.LayerizedTextBlockFormattingItems value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Ideogram.LayerizedTextBlockFormattingItemsExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.LayerizedTextBlockFormattingItemsNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.LayerizedTextBlockFormattingItemsNullable.g.cs new file mode 100644 index 00000000..0f7827ac --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.LayerizedTextBlockFormattingItemsNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class LayerizedTextBlockFormattingItemsNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.LayerizedTextBlockFormattingItems? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.LayerizedTextBlockFormattingItemsExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.LayerizedTextBlockFormattingItems)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.LayerizedTextBlockFormattingItems?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.LayerizedTextBlockFormattingItems? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Ideogram.LayerizedTextBlockFormattingItemsExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.LayerizedTextBlockRole.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.LayerizedTextBlockRole.g.cs new file mode 100644 index 00000000..d2dee57d --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.LayerizedTextBlockRole.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class LayerizedTextBlockRoleJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.LayerizedTextBlockRole Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.LayerizedTextBlockRoleExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.LayerizedTextBlockRole)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.LayerizedTextBlockRole); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.LayerizedTextBlockRole value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Ideogram.LayerizedTextBlockRoleExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.LayerizedTextBlockRoleNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.LayerizedTextBlockRoleNullable.g.cs new file mode 100644 index 00000000..8029c8bc --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.LayerizedTextBlockRoleNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class LayerizedTextBlockRoleNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.LayerizedTextBlockRole? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.LayerizedTextBlockRoleExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.LayerizedTextBlockRole)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.LayerizedTextBlockRole?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.LayerizedTextBlockRole? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Ideogram.LayerizedTextBlockRoleExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ListCustomModelsScope.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ListCustomModelsScope.g.cs deleted file mode 100644 index 15170d47..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ListCustomModelsScope.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class ListCustomModelsScopeJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.ListCustomModelsScope Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.ListCustomModelsScopeExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.ListCustomModelsScope)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.ListCustomModelsScope); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.ListCustomModelsScope value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.ListCustomModelsScopeExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ListCustomModelsScopeNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ListCustomModelsScopeNullable.g.cs deleted file mode 100644 index 16a3ee83..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ListCustomModelsScopeNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class ListCustomModelsScopeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.ListCustomModelsScope? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.ListCustomModelsScopeExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.ListCustomModelsScope)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.ListCustomModelsScope?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.ListCustomModelsScope? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.ListCustomModelsScopeExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.LivingImageQuality.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.LivingImageQuality.g.cs deleted file mode 100644 index 7062499d..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.LivingImageQuality.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class LivingImageQualityJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.LivingImageQuality Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.LivingImageQualityExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.LivingImageQuality)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.LivingImageQuality); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.LivingImageQuality value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.LivingImageQualityExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.LivingImageQualityNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.LivingImageQualityNullable.g.cs deleted file mode 100644 index ac04defd..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.LivingImageQualityNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class LivingImageQualityNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.LivingImageQuality? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.LivingImageQualityExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.LivingImageQuality)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.LivingImageQuality?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.LivingImageQuality? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.LivingImageQualityExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.LookbookRequestCategory.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.LookbookRequestCategory.g.cs deleted file mode 100644 index 483d581e..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.LookbookRequestCategory.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class LookbookRequestCategoryJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.LookbookRequestCategory Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.LookbookRequestCategoryExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.LookbookRequestCategory)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.LookbookRequestCategory); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.LookbookRequestCategory value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.LookbookRequestCategoryExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.LookbookRequestCategoryNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.LookbookRequestCategoryNullable.g.cs deleted file mode 100644 index d14dfedb..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.LookbookRequestCategoryNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class LookbookRequestCategoryNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.LookbookRequestCategory? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.LookbookRequestCategoryExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.LookbookRequestCategory)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.LookbookRequestCategory?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.LookbookRequestCategory? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.LookbookRequestCategoryExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.MagicPromptOption.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.MagicPromptOption.g.cs deleted file mode 100644 index af92332e..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.MagicPromptOption.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class MagicPromptOptionJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.MagicPromptOption Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.MagicPromptOptionExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.MagicPromptOption)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.MagicPromptOption); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.MagicPromptOption value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.MagicPromptOptionExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.MagicPromptOptionNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.MagicPromptOptionNullable.g.cs deleted file mode 100644 index 8410e811..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.MagicPromptOptionNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class MagicPromptOptionNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.MagicPromptOption? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.MagicPromptOptionExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.MagicPromptOption)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.MagicPromptOption?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.MagicPromptOption? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.MagicPromptOptionExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.MagicPromptRequestMessagesInnerRole.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.MagicPromptRequestMessagesInnerRole.g.cs deleted file mode 100644 index fe0a49b1..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.MagicPromptRequestMessagesInnerRole.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class MagicPromptRequestMessagesInnerRoleJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.MagicPromptRequestMessagesInnerRole Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.MagicPromptRequestMessagesInnerRoleExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.MagicPromptRequestMessagesInnerRole)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.MagicPromptRequestMessagesInnerRole); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.MagicPromptRequestMessagesInnerRole value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.MagicPromptRequestMessagesInnerRoleExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.MagicPromptRequestMessagesInnerRoleNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.MagicPromptRequestMessagesInnerRoleNullable.g.cs deleted file mode 100644 index 3ac3f175..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.MagicPromptRequestMessagesInnerRoleNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class MagicPromptRequestMessagesInnerRoleNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.MagicPromptRequestMessagesInnerRole? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.MagicPromptRequestMessagesInnerRoleExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.MagicPromptRequestMessagesInnerRole)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.MagicPromptRequestMessagesInnerRole?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.MagicPromptRequestMessagesInnerRole? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.MagicPromptRequestMessagesInnerRoleExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.MagicPromptVersionEnum.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.MagicPromptVersionEnum.g.cs deleted file mode 100644 index d6da3478..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.MagicPromptVersionEnum.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class MagicPromptVersionEnumJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.MagicPromptVersionEnum Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.MagicPromptVersionEnumExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.MagicPromptVersionEnum)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.MagicPromptVersionEnum); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.MagicPromptVersionEnum value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.MagicPromptVersionEnumExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.MagicPromptVersionEnumNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.MagicPromptVersionEnumNullable.g.cs deleted file mode 100644 index d3998fca..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.MagicPromptVersionEnumNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class MagicPromptVersionEnumNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.MagicPromptVersionEnum? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.MagicPromptVersionEnumExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.MagicPromptVersionEnum)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.MagicPromptVersionEnum?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.MagicPromptVersionEnum? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.MagicPromptVersionEnumExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.MiniAppMarketingProjectionEntryEmbed.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.MiniAppMarketingProjectionEntryEmbed.g.cs deleted file mode 100644 index 6f7e1a7b..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.MiniAppMarketingProjectionEntryEmbed.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class MiniAppMarketingProjectionEntryEmbedJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.MiniAppMarketingProjectionEntryEmbed Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.MiniAppMarketingProjectionEntryEmbedExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.MiniAppMarketingProjectionEntryEmbed)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.MiniAppMarketingProjectionEntryEmbed); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.MiniAppMarketingProjectionEntryEmbed value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.MiniAppMarketingProjectionEntryEmbedExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.MiniAppMarketingProjectionEntryEmbedNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.MiniAppMarketingProjectionEntryEmbedNullable.g.cs deleted file mode 100644 index 34efe435..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.MiniAppMarketingProjectionEntryEmbedNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class MiniAppMarketingProjectionEntryEmbedNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.MiniAppMarketingProjectionEntryEmbed? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.MiniAppMarketingProjectionEntryEmbedExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.MiniAppMarketingProjectionEntryEmbed)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.MiniAppMarketingProjectionEntryEmbed?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.MiniAppMarketingProjectionEntryEmbed? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.MiniAppMarketingProjectionEntryEmbedExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ModelEnum.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ModelEnum.g.cs deleted file mode 100644 index fbaaa719..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ModelEnum.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class ModelEnumJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.ModelEnum Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.ModelEnumExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.ModelEnum)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.ModelEnum); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.ModelEnum value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.ModelEnumExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ModelEnumNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ModelEnumNullable.g.cs deleted file mode 100644 index aa9740a5..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ModelEnumNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class ModelEnumNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.ModelEnum? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.ModelEnumExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.ModelEnum)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.ModelEnum?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.ModelEnum? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.ModelEnumExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ModelStatus.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ModelStatus.g.cs deleted file mode 100644 index 733ea2af..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ModelStatus.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class ModelStatusJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.ModelStatus Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.ModelStatusExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.ModelStatus)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.ModelStatus); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.ModelStatus value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.ModelStatusExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ModelStatusNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ModelStatusNullable.g.cs deleted file mode 100644 index eeecb795..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ModelStatusNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class ModelStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.ModelStatus? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.ModelStatusExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.ModelStatus)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.ModelStatus?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.ModelStatus? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.ModelStatusExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ModelSwapQuality.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ModelSwapQuality.g.cs deleted file mode 100644 index b7b347af..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ModelSwapQuality.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class ModelSwapQualityJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.ModelSwapQuality Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.ModelSwapQualityExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.ModelSwapQuality)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.ModelSwapQuality); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.ModelSwapQuality value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.ModelSwapQualityExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ModelSwapQualityNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ModelSwapQualityNullable.g.cs deleted file mode 100644 index 2fe6c40d..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ModelSwapQualityNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class ModelSwapQualityNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.ModelSwapQuality? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.ModelSwapQualityExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.ModelSwapQuality)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.ModelSwapQuality?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.ModelSwapQuality? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.ModelSwapQualityExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ModelVersion.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ModelVersion.g.cs deleted file mode 100644 index c0e5b9b1..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ModelVersion.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class ModelVersionJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.ModelVersion Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.ModelVersionExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.ModelVersion)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.ModelVersion); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.ModelVersion value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.ModelVersionExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ModelVersionNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ModelVersionNullable.g.cs deleted file mode 100644 index 62652a46..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ModelVersionNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class ModelVersionNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.ModelVersion? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.ModelVersionExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.ModelVersion)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.ModelVersion?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.ModelVersion? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.ModelVersionExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.NanoBananaProReframeAspectRatio.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.NanoBananaProReframeAspectRatio.g.cs deleted file mode 100644 index 31b9646d..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.NanoBananaProReframeAspectRatio.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class NanoBananaProReframeAspectRatioJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.NanoBananaProReframeAspectRatio Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.NanoBananaProReframeAspectRatioExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.NanoBananaProReframeAspectRatio)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.NanoBananaProReframeAspectRatio); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.NanoBananaProReframeAspectRatio value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.NanoBananaProReframeAspectRatioExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.NanoBananaProReframeAspectRatioNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.NanoBananaProReframeAspectRatioNullable.g.cs deleted file mode 100644 index 75ff7b80..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.NanoBananaProReframeAspectRatioNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class NanoBananaProReframeAspectRatioNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.NanoBananaProReframeAspectRatio? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.NanoBananaProReframeAspectRatioExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.NanoBananaProReframeAspectRatio)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.NanoBananaProReframeAspectRatio?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.NanoBananaProReframeAspectRatio? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.NanoBananaProReframeAspectRatioExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.OutputResolution.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.OutputResolution.g.cs deleted file mode 100644 index 78bf7279..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.OutputResolution.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class OutputResolutionJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.OutputResolution Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.OutputResolutionExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.OutputResolution)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.OutputResolution); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.OutputResolution value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.OutputResolutionExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.OutputResolutionNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.OutputResolutionNullable.g.cs deleted file mode 100644 index 125592cd..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.OutputResolutionNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class OutputResolutionNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.OutputResolution? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.OutputResolutionExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.OutputResolution)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.OutputResolution?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.OutputResolution? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.OutputResolutionExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.PImageResolution.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.PImageResolution.g.cs deleted file mode 100644 index 072c00d5..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.PImageResolution.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class PImageResolutionJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.PImageResolution Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.PImageResolutionExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.PImageResolution)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.PImageResolution); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.PImageResolution value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.PImageResolutionExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.PImageResolutionNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.PImageResolutionNullable.g.cs deleted file mode 100644 index 4c2fda37..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.PImageResolutionNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class PImageResolutionNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.PImageResolution? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.PImageResolutionExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.PImageResolution)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.PImageResolution?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.PImageResolution? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.PImageResolutionExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.PackshotView.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.PackshotView.g.cs deleted file mode 100644 index 6491d587..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.PackshotView.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class PackshotViewJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.PackshotView Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.PackshotViewExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.PackshotView)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.PackshotView); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.PackshotView value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.PackshotViewExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.PackshotViewNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.PackshotViewNullable.g.cs deleted file mode 100644 index da935675..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.PackshotViewNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class PackshotViewNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.PackshotView? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.PackshotViewExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.PackshotView)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.PackshotView?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.PackshotView? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.PackshotViewExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.PackshotsQuality.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.PackshotsQuality.g.cs deleted file mode 100644 index cff29d62..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.PackshotsQuality.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class PackshotsQualityJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.PackshotsQuality Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.PackshotsQualityExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.PackshotsQuality)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.PackshotsQuality); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.PackshotsQuality value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.PackshotsQualityExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.PackshotsQualityNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.PackshotsQualityNullable.g.cs deleted file mode 100644 index c71f078a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.PackshotsQualityNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class PackshotsQualityNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.PackshotsQuality? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.PackshotsQualityExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.PackshotsQuality)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.PackshotsQuality?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.PackshotsQuality? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.PackshotsQualityExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.PostGenerateDesignV4200Response.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.PostGenerateDesignV4200Response.g.cs deleted file mode 100644 index a90486bd..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.PostGenerateDesignV4200Response.g.cs +++ /dev/null @@ -1,72 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 // Type or member is obsolete - -namespace Ideogram.JsonConverters -{ - /// - public class PostGenerateDesignV4200ResponseJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.PostGenerateDesignV4200Response Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - options = options ?? throw new global::System.ArgumentNullException(nameof(options)); - var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); - - - var readerCopy = reader; - var discriminatorTypeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Ideogram.PostGenerateDesignV4200ResponseDiscriminator), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Ideogram.PostGenerateDesignV4200ResponseDiscriminator)}"); - var discriminator = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, discriminatorTypeInfo); - - global::Ideogram.LayeredImageGenerationResponseV3? layered = default; - if (discriminator?.ResponseType == global::Ideogram.PostGenerateDesignV4200ResponseDiscriminatorResponseType.Layered) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Ideogram.LayeredImageGenerationResponseV3), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Ideogram.LayeredImageGenerationResponseV3)}"); - layered = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); - } - global::Ideogram.ImageGenerationResponseV4Layout? url = default; - if (discriminator?.ResponseType == global::Ideogram.PostGenerateDesignV4200ResponseDiscriminatorResponseType.Url) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Ideogram.ImageGenerationResponseV4Layout), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Ideogram.ImageGenerationResponseV4Layout)}"); - url = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); - } - - var __value = new global::Ideogram.PostGenerateDesignV4200Response( - discriminator?.ResponseType, - layered, - - url - ); - - return __value; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.PostGenerateDesignV4200Response value, - global::System.Text.Json.JsonSerializerOptions options) - { - options = options ?? throw new global::System.ArgumentNullException(nameof(options)); - var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); - - if (value.IsLayered) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Ideogram.LayeredImageGenerationResponseV3), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Ideogram.LayeredImageGenerationResponseV3).Name}"); - global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickLayered(), typeInfo); - } - else if (value.IsUrl) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Ideogram.ImageGenerationResponseV4Layout), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Ideogram.ImageGenerationResponseV4Layout).Name}"); - global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickUrl(), typeInfo); - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.PostGenerateDesignV4200ResponseDiscriminatorResponseType.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.PostGenerateDesignV4200ResponseDiscriminatorResponseType.g.cs deleted file mode 100644 index 3bdf0a01..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.PostGenerateDesignV4200ResponseDiscriminatorResponseType.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class PostGenerateDesignV4200ResponseDiscriminatorResponseTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.PostGenerateDesignV4200ResponseDiscriminatorResponseType Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.PostGenerateDesignV4200ResponseDiscriminatorResponseTypeExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.PostGenerateDesignV4200ResponseDiscriminatorResponseType)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.PostGenerateDesignV4200ResponseDiscriminatorResponseType); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.PostGenerateDesignV4200ResponseDiscriminatorResponseType value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.PostGenerateDesignV4200ResponseDiscriminatorResponseTypeExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.PostGenerateDesignV4200ResponseDiscriminatorResponseTypeNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.PostGenerateDesignV4200ResponseDiscriminatorResponseTypeNullable.g.cs deleted file mode 100644 index 513e90dc..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.PostGenerateDesignV4200ResponseDiscriminatorResponseTypeNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class PostGenerateDesignV4200ResponseDiscriminatorResponseTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.PostGenerateDesignV4200ResponseDiscriminatorResponseType? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.PostGenerateDesignV4200ResponseDiscriminatorResponseTypeExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.PostGenerateDesignV4200ResponseDiscriminatorResponseType)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.PostGenerateDesignV4200ResponseDiscriminatorResponseType?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.PostGenerateDesignV4200ResponseDiscriminatorResponseType? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.PostGenerateDesignV4200ResponseDiscriminatorResponseTypeExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.PreciseEditImageIdeogram45RequestQuality.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.PreciseEditImageIdeogram45RequestQuality.g.cs deleted file mode 100644 index 1114dd69..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.PreciseEditImageIdeogram45RequestQuality.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class PreciseEditImageIdeogram45RequestQualityJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.PreciseEditImageIdeogram45RequestQuality Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.PreciseEditImageIdeogram45RequestQualityExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.PreciseEditImageIdeogram45RequestQuality)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.PreciseEditImageIdeogram45RequestQuality); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.PreciseEditImageIdeogram45RequestQuality value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.PreciseEditImageIdeogram45RequestQualityExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.PreciseEditImageIdeogram45RequestQualityNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.PreciseEditImageIdeogram45RequestQualityNullable.g.cs deleted file mode 100644 index 58dbf7a7..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.PreciseEditImageIdeogram45RequestQualityNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class PreciseEditImageIdeogram45RequestQualityNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.PreciseEditImageIdeogram45RequestQuality? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.PreciseEditImageIdeogram45RequestQualityExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.PreciseEditImageIdeogram45RequestQuality)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.PreciseEditImageIdeogram45RequestQuality?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.PreciseEditImageIdeogram45RequestQuality? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.PreciseEditImageIdeogram45RequestQualityExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.PreciseMaskedEditModel.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.PreciseMaskedEditModel.g.cs deleted file mode 100644 index 0c3677af..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.PreciseMaskedEditModel.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class PreciseMaskedEditModelJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.PreciseMaskedEditModel Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.PreciseMaskedEditModelExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.PreciseMaskedEditModel)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.PreciseMaskedEditModel); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.PreciseMaskedEditModel value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.PreciseMaskedEditModelExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.PreciseMaskedEditModelNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.PreciseMaskedEditModelNullable.g.cs deleted file mode 100644 index 45bf20c6..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.PreciseMaskedEditModelNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class PreciseMaskedEditModelNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.PreciseMaskedEditModel? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.PreciseMaskedEditModelExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.PreciseMaskedEditModel)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.PreciseMaskedEditModel?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.PreciseMaskedEditModel? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.PreciseMaskedEditModelExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.PreciseMaskedEditQuality.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.PreciseMaskedEditQuality.g.cs deleted file mode 100644 index 3c32cec7..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.PreciseMaskedEditQuality.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class PreciseMaskedEditQualityJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.PreciseMaskedEditQuality Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.PreciseMaskedEditQualityExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.PreciseMaskedEditQuality)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.PreciseMaskedEditQuality); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.PreciseMaskedEditQuality value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.PreciseMaskedEditQualityExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.PreciseMaskedEditQualityNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.PreciseMaskedEditQualityNullable.g.cs deleted file mode 100644 index 93560887..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.PreciseMaskedEditQualityNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class PreciseMaskedEditQualityNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.PreciseMaskedEditQuality? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.PreciseMaskedEditQualityExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.PreciseMaskedEditQuality)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.PreciseMaskedEditQuality?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.PreciseMaskedEditQuality? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.PreciseMaskedEditQualityExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.PriceQualifier.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.PriceQualifier.g.cs deleted file mode 100644 index 1791f58d..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.PriceQualifier.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class PriceQualifierJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.PriceQualifier Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.PriceQualifierExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.PriceQualifier)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.PriceQualifier); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.PriceQualifier value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.PriceQualifierExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.PriceQualifierNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.PriceQualifierNullable.g.cs deleted file mode 100644 index 016c26c6..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.PriceQualifierNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class PriceQualifierNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.PriceQualifier? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.PriceQualifierExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.PriceQualifier)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.PriceQualifier?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.PriceQualifier? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.PriceQualifierExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.PriceQuoteObject.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.PriceQuoteObject.g.cs deleted file mode 100644 index bd2fc63d..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.PriceQuoteObject.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class PriceQuoteObjectJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.PriceQuoteObject Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.PriceQuoteObjectExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.PriceQuoteObject)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.PriceQuoteObject); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.PriceQuoteObject value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.PriceQuoteObjectExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.PriceQuoteObjectNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.PriceQuoteObjectNullable.g.cs deleted file mode 100644 index b1e2f961..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.PriceQuoteObjectNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class PriceQuoteObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.PriceQuoteObject? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.PriceQuoteObjectExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.PriceQuoteObject)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.PriceQuoteObject?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.PriceQuoteObject? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.PriceQuoteObjectExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.Product360VideoDirection.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.Product360VideoDirection.g.cs deleted file mode 100644 index 45e3bc84..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.Product360VideoDirection.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class Product360VideoDirectionJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.Product360VideoDirection Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.Product360VideoDirectionExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.Product360VideoDirection)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.Product360VideoDirection); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.Product360VideoDirection value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.Product360VideoDirectionExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.Product360VideoDirectionNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.Product360VideoDirectionNullable.g.cs deleted file mode 100644 index bfa28fec..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.Product360VideoDirectionNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class Product360VideoDirectionNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.Product360VideoDirection? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.Product360VideoDirectionExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.Product360VideoDirection)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.Product360VideoDirection?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.Product360VideoDirection? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.Product360VideoDirectionExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ProvenanceVerifyResponseValidationState.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ProvenanceVerifyResponseValidationState.g.cs deleted file mode 100644 index 1cc22ec9..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ProvenanceVerifyResponseValidationState.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class ProvenanceVerifyResponseValidationStateJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.ProvenanceVerifyResponseValidationState Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.ProvenanceVerifyResponseValidationStateExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.ProvenanceVerifyResponseValidationState)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.ProvenanceVerifyResponseValidationState); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.ProvenanceVerifyResponseValidationState value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.ProvenanceVerifyResponseValidationStateExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ProvenanceVerifyResponseValidationStateNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ProvenanceVerifyResponseValidationStateNullable.g.cs deleted file mode 100644 index 6afb7a8f..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ProvenanceVerifyResponseValidationStateNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class ProvenanceVerifyResponseValidationStateNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.ProvenanceVerifyResponseValidationState? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.ProvenanceVerifyResponseValidationStateExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.ProvenanceVerifyResponseValidationState)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.ProvenanceVerifyResponseValidationState?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.ProvenanceVerifyResponseValidationState? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.ProvenanceVerifyResponseValidationStateExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.PublishMiniAppPreviewRequestEmbed.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.PublishMiniAppPreviewRequestEmbed.g.cs deleted file mode 100644 index fe0e5705..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.PublishMiniAppPreviewRequestEmbed.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class PublishMiniAppPreviewRequestEmbedJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.PublishMiniAppPreviewRequestEmbed Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.PublishMiniAppPreviewRequestEmbedExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.PublishMiniAppPreviewRequestEmbed)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.PublishMiniAppPreviewRequestEmbed); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.PublishMiniAppPreviewRequestEmbed value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.PublishMiniAppPreviewRequestEmbedExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.PublishMiniAppPreviewRequestEmbedNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.PublishMiniAppPreviewRequestEmbedNullable.g.cs deleted file mode 100644 index 5be4672a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.PublishMiniAppPreviewRequestEmbedNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class PublishMiniAppPreviewRequestEmbedNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.PublishMiniAppPreviewRequestEmbed? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.PublishMiniAppPreviewRequestEmbedExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.PublishMiniAppPreviewRequestEmbed)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.PublishMiniAppPreviewRequestEmbed?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.PublishMiniAppPreviewRequestEmbed? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.PublishMiniAppPreviewRequestEmbedExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.PublishMiniAppRequestEmbed.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.PublishMiniAppRequestEmbed.g.cs deleted file mode 100644 index e8ab6a99..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.PublishMiniAppRequestEmbed.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class PublishMiniAppRequestEmbedJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.PublishMiniAppRequestEmbed Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.PublishMiniAppRequestEmbedExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.PublishMiniAppRequestEmbed)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.PublishMiniAppRequestEmbed); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.PublishMiniAppRequestEmbed value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.PublishMiniAppRequestEmbedExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.PublishMiniAppRequestEmbedNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.PublishMiniAppRequestEmbedNullable.g.cs deleted file mode 100644 index 5dcaad40..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.PublishMiniAppRequestEmbedNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class PublishMiniAppRequestEmbedNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.PublishMiniAppRequestEmbed? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.PublishMiniAppRequestEmbedExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.PublishMiniAppRequestEmbed)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.PublishMiniAppRequestEmbed?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.PublishMiniAppRequestEmbed? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.PublishMiniAppRequestEmbedExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.Quality.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.Quality.g.cs deleted file mode 100644 index d42c3287..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.Quality.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class QualityJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.Quality Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.QualityExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.Quality)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.Quality); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.Quality value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.QualityExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.QualityNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.QualityNullable.g.cs deleted file mode 100644 index 3ebeaf8b..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.QualityNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class QualityNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.Quality? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.QualityExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.Quality)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.Quality?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.Quality? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.QualityExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ReframeImageGptImage25FlareRequestQuality.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ReframeImageGptImage25FlareRequestQuality.g.cs deleted file mode 100644 index c4ac0046..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ReframeImageGptImage25FlareRequestQuality.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class ReframeImageGptImage25FlareRequestQualityJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.ReframeImageGptImage25FlareRequestQuality Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.ReframeImageGptImage25FlareRequestQualityExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.ReframeImageGptImage25FlareRequestQuality)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.ReframeImageGptImage25FlareRequestQuality); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.ReframeImageGptImage25FlareRequestQuality value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.ReframeImageGptImage25FlareRequestQualityExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ReframeImageGptImage25FlareRequestQualityNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ReframeImageGptImage25FlareRequestQualityNullable.g.cs deleted file mode 100644 index 09748ea9..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ReframeImageGptImage25FlareRequestQualityNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class ReframeImageGptImage25FlareRequestQualityNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.ReframeImageGptImage25FlareRequestQuality? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.ReframeImageGptImage25FlareRequestQualityExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.ReframeImageGptImage25FlareRequestQuality)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.ReframeImageGptImage25FlareRequestQuality?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.ReframeImageGptImage25FlareRequestQuality? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.ReframeImageGptImage25FlareRequestQualityExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ReframeImageIdeogramV3RequestRenderingSpeed.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ReframeImageIdeogramV3RequestRenderingSpeed.g.cs deleted file mode 100644 index 9725d3b6..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ReframeImageIdeogramV3RequestRenderingSpeed.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class ReframeImageIdeogramV3RequestRenderingSpeedJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.ReframeImageIdeogramV3RequestRenderingSpeed Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.ReframeImageIdeogramV3RequestRenderingSpeedExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.ReframeImageIdeogramV3RequestRenderingSpeed)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.ReframeImageIdeogramV3RequestRenderingSpeed); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.ReframeImageIdeogramV3RequestRenderingSpeed value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.ReframeImageIdeogramV3RequestRenderingSpeedExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ReframeImageIdeogramV3RequestRenderingSpeedNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ReframeImageIdeogramV3RequestRenderingSpeedNullable.g.cs deleted file mode 100644 index 57cb59f4..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ReframeImageIdeogramV3RequestRenderingSpeedNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class ReframeImageIdeogramV3RequestRenderingSpeedNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.ReframeImageIdeogramV3RequestRenderingSpeed? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.ReframeImageIdeogramV3RequestRenderingSpeedExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.ReframeImageIdeogramV3RequestRenderingSpeed)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.ReframeImageIdeogramV3RequestRenderingSpeed?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.ReframeImageIdeogramV3RequestRenderingSpeed? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.ReframeImageIdeogramV3RequestRenderingSpeedExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ReframeImageNanoBananaProRequestResolutionTier.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ReframeImageNanoBananaProRequestResolutionTier.g.cs deleted file mode 100644 index 242037fd..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ReframeImageNanoBananaProRequestResolutionTier.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class ReframeImageNanoBananaProRequestResolutionTierJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.ReframeImageNanoBananaProRequestResolutionTier Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.ReframeImageNanoBananaProRequestResolutionTierExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.ReframeImageNanoBananaProRequestResolutionTier)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.ReframeImageNanoBananaProRequestResolutionTier); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.ReframeImageNanoBananaProRequestResolutionTier value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.ReframeImageNanoBananaProRequestResolutionTierExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ReframeImageNanoBananaProRequestResolutionTierNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ReframeImageNanoBananaProRequestResolutionTierNullable.g.cs deleted file mode 100644 index 0e3b1333..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ReframeImageNanoBananaProRequestResolutionTierNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class ReframeImageNanoBananaProRequestResolutionTierNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.ReframeImageNanoBananaProRequestResolutionTier? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.ReframeImageNanoBananaProRequestResolutionTierExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.ReframeImageNanoBananaProRequestResolutionTier)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.ReframeImageNanoBananaProRequestResolutionTier?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.ReframeImageNanoBananaProRequestResolutionTier? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.ReframeImageNanoBananaProRequestResolutionTierExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.RemixImageIdeogramV3CharacterRequestRenderingSpeed.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.RemixImageIdeogramV3CharacterRequestRenderingSpeed.g.cs deleted file mode 100644 index b37e0993..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.RemixImageIdeogramV3CharacterRequestRenderingSpeed.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class RemixImageIdeogramV3CharacterRequestRenderingSpeedJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.RemixImageIdeogramV3CharacterRequestRenderingSpeed Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.RemixImageIdeogramV3CharacterRequestRenderingSpeedExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.RemixImageIdeogramV3CharacterRequestRenderingSpeed)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.RemixImageIdeogramV3CharacterRequestRenderingSpeed); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.RemixImageIdeogramV3CharacterRequestRenderingSpeed value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.RemixImageIdeogramV3CharacterRequestRenderingSpeedExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.RemixImageIdeogramV3CharacterRequestRenderingSpeedNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.RemixImageIdeogramV3CharacterRequestRenderingSpeedNullable.g.cs deleted file mode 100644 index c8ca3c0f..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.RemixImageIdeogramV3CharacterRequestRenderingSpeedNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class RemixImageIdeogramV3CharacterRequestRenderingSpeedNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.RemixImageIdeogramV3CharacterRequestRenderingSpeed? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.RemixImageIdeogramV3CharacterRequestRenderingSpeedExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.RemixImageIdeogramV3CharacterRequestRenderingSpeed)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.RemixImageIdeogramV3CharacterRequestRenderingSpeed?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.RemixImageIdeogramV3CharacterRequestRenderingSpeed? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.RemixImageIdeogramV3CharacterRequestRenderingSpeedExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.RemixImageIdeogramV3CharacterRequestStyleType.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.RemixImageIdeogramV3CharacterRequestStyleType.g.cs deleted file mode 100644 index 457d4cd5..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.RemixImageIdeogramV3CharacterRequestStyleType.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class RemixImageIdeogramV3CharacterRequestStyleTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.RemixImageIdeogramV3CharacterRequestStyleType Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.RemixImageIdeogramV3CharacterRequestStyleTypeExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.RemixImageIdeogramV3CharacterRequestStyleType)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.RemixImageIdeogramV3CharacterRequestStyleType); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.RemixImageIdeogramV3CharacterRequestStyleType value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.RemixImageIdeogramV3CharacterRequestStyleTypeExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.RemixImageIdeogramV3CharacterRequestStyleTypeNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.RemixImageIdeogramV3CharacterRequestStyleTypeNullable.g.cs deleted file mode 100644 index a7866284..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.RemixImageIdeogramV3CharacterRequestStyleTypeNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class RemixImageIdeogramV3CharacterRequestStyleTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.RemixImageIdeogramV3CharacterRequestStyleType? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.RemixImageIdeogramV3CharacterRequestStyleTypeExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.RemixImageIdeogramV3CharacterRequestStyleType)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.RemixImageIdeogramV3CharacterRequestStyleType?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.RemixImageIdeogramV3CharacterRequestStyleType? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.RemixImageIdeogramV3CharacterRequestStyleTypeExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.RemixImageIdeogramV3CustomModelRequestRenderingSpeed.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.RemixImageIdeogramV3CustomModelRequestRenderingSpeed.g.cs deleted file mode 100644 index 4009c36b..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.RemixImageIdeogramV3CustomModelRequestRenderingSpeed.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class RemixImageIdeogramV3CustomModelRequestRenderingSpeedJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.RemixImageIdeogramV3CustomModelRequestRenderingSpeed Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.RemixImageIdeogramV3CustomModelRequestRenderingSpeedExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.RemixImageIdeogramV3CustomModelRequestRenderingSpeed)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.RemixImageIdeogramV3CustomModelRequestRenderingSpeed); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.RemixImageIdeogramV3CustomModelRequestRenderingSpeed value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.RemixImageIdeogramV3CustomModelRequestRenderingSpeedExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.RemixImageIdeogramV3CustomModelRequestRenderingSpeedNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.RemixImageIdeogramV3CustomModelRequestRenderingSpeedNullable.g.cs deleted file mode 100644 index e886e247..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.RemixImageIdeogramV3CustomModelRequestRenderingSpeedNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class RemixImageIdeogramV3CustomModelRequestRenderingSpeedNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.RemixImageIdeogramV3CustomModelRequestRenderingSpeed? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.RemixImageIdeogramV3CustomModelRequestRenderingSpeedExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.RemixImageIdeogramV3CustomModelRequestRenderingSpeed)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.RemixImageIdeogramV3CustomModelRequestRenderingSpeed?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.RemixImageIdeogramV3CustomModelRequestRenderingSpeed? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.RemixImageIdeogramV3CustomModelRequestRenderingSpeedExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.RemixImageIdeogramV3RequestRenderingSpeed.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.RemixImageIdeogramV3RequestRenderingSpeed.g.cs deleted file mode 100644 index 9e14cfea..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.RemixImageIdeogramV3RequestRenderingSpeed.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class RemixImageIdeogramV3RequestRenderingSpeedJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.RemixImageIdeogramV3RequestRenderingSpeed Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.RemixImageIdeogramV3RequestRenderingSpeedExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.RemixImageIdeogramV3RequestRenderingSpeed)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.RemixImageIdeogramV3RequestRenderingSpeed); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.RemixImageIdeogramV3RequestRenderingSpeed value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.RemixImageIdeogramV3RequestRenderingSpeedExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.RemixImageIdeogramV3RequestRenderingSpeedNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.RemixImageIdeogramV3RequestRenderingSpeedNullable.g.cs deleted file mode 100644 index f7a59217..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.RemixImageIdeogramV3RequestRenderingSpeedNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class RemixImageIdeogramV3RequestRenderingSpeedNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.RemixImageIdeogramV3RequestRenderingSpeed? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.RemixImageIdeogramV3RequestRenderingSpeedExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.RemixImageIdeogramV3RequestRenderingSpeed)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.RemixImageIdeogramV3RequestRenderingSpeed?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.RemixImageIdeogramV3RequestRenderingSpeed? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.RemixImageIdeogramV3RequestRenderingSpeedExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.RemixImageIdeogramV4RequestRenderingSpeed.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.RemixImageIdeogramV4RequestRenderingSpeed.g.cs deleted file mode 100644 index e192f798..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.RemixImageIdeogramV4RequestRenderingSpeed.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class RemixImageIdeogramV4RequestRenderingSpeedJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.RemixImageIdeogramV4RequestRenderingSpeed Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.RemixImageIdeogramV4RequestRenderingSpeedExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.RemixImageIdeogramV4RequestRenderingSpeed)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.RemixImageIdeogramV4RequestRenderingSpeed); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.RemixImageIdeogramV4RequestRenderingSpeed value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.RemixImageIdeogramV4RequestRenderingSpeedExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.RemixImageIdeogramV4RequestRenderingSpeedNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.RemixImageIdeogramV4RequestRenderingSpeedNullable.g.cs deleted file mode 100644 index 49a578ed..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.RemixImageIdeogramV4RequestRenderingSpeedNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class RemixImageIdeogramV4RequestRenderingSpeedNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.RemixImageIdeogramV4RequestRenderingSpeed? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.RemixImageIdeogramV4RequestRenderingSpeedExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.RemixImageIdeogramV4RequestRenderingSpeed)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.RemixImageIdeogramV4RequestRenderingSpeed?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.RemixImageIdeogramV4RequestRenderingSpeed? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.RemixImageIdeogramV4RequestRenderingSpeedExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.RenderingSpeed.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.RenderingSpeed.g.cs deleted file mode 100644 index 7282b45b..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.RenderingSpeed.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class RenderingSpeedJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.RenderingSpeed Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.RenderingSpeedExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.RenderingSpeed)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.RenderingSpeed); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.RenderingSpeed value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.RenderingSpeedExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.RenderingSpeedNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.RenderingSpeedNullable.g.cs deleted file mode 100644 index 97ef78da..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.RenderingSpeedNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class RenderingSpeedNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.RenderingSpeed? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.RenderingSpeedExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.RenderingSpeed)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.RenderingSpeed?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.RenderingSpeed? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.RenderingSpeedExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.RenderingSpeedV4.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.RenderingSpeedV4.g.cs deleted file mode 100644 index 52ba8d47..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.RenderingSpeedV4.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class RenderingSpeedV4JsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.RenderingSpeedV4 Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.RenderingSpeedV4Extensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.RenderingSpeedV4)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.RenderingSpeedV4); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.RenderingSpeedV4 value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.RenderingSpeedV4Extensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.RenderingSpeedV4Nullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.RenderingSpeedV4Nullable.g.cs deleted file mode 100644 index a984e93f..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.RenderingSpeedV4Nullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class RenderingSpeedV4NullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.RenderingSpeedV4? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.RenderingSpeedV4Extensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.RenderingSpeedV4)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.RenderingSpeedV4?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.RenderingSpeedV4? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.RenderingSpeedV4Extensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ReplaceBackgroundIdeogramV3RequestRenderingSpeed.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ReplaceBackgroundIdeogramV3RequestRenderingSpeed.g.cs deleted file mode 100644 index 3cd444bc..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ReplaceBackgroundIdeogramV3RequestRenderingSpeed.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class ReplaceBackgroundIdeogramV3RequestRenderingSpeedJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.ReplaceBackgroundIdeogramV3RequestRenderingSpeed Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.ReplaceBackgroundIdeogramV3RequestRenderingSpeedExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.ReplaceBackgroundIdeogramV3RequestRenderingSpeed)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.ReplaceBackgroundIdeogramV3RequestRenderingSpeed); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.ReplaceBackgroundIdeogramV3RequestRenderingSpeed value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.ReplaceBackgroundIdeogramV3RequestRenderingSpeedExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ReplaceBackgroundIdeogramV3RequestRenderingSpeedNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ReplaceBackgroundIdeogramV3RequestRenderingSpeedNullable.g.cs deleted file mode 100644 index 309d12df..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ReplaceBackgroundIdeogramV3RequestRenderingSpeedNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class ReplaceBackgroundIdeogramV3RequestRenderingSpeedNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.ReplaceBackgroundIdeogramV3RequestRenderingSpeed? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.ReplaceBackgroundIdeogramV3RequestRenderingSpeedExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.ReplaceBackgroundIdeogramV3RequestRenderingSpeed)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.ReplaceBackgroundIdeogramV3RequestRenderingSpeed?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.ReplaceBackgroundIdeogramV3RequestRenderingSpeed? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.ReplaceBackgroundIdeogramV3RequestRenderingSpeedExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ResizeAdImageQuality.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ResizeAdImageQuality.g.cs deleted file mode 100644 index 1b0ded4b..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ResizeAdImageQuality.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class ResizeAdImageQualityJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.ResizeAdImageQuality Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.ResizeAdImageQualityExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.ResizeAdImageQuality)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.ResizeAdImageQuality); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.ResizeAdImageQuality value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.ResizeAdImageQualityExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ResizeAdImageQualityNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ResizeAdImageQualityNullable.g.cs deleted file mode 100644 index dd632cf5..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ResizeAdImageQualityNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class ResizeAdImageQualityNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.ResizeAdImageQuality? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.ResizeAdImageQualityExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.ResizeAdImageQuality)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.ResizeAdImageQuality?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.ResizeAdImageQuality? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.ResizeAdImageQualityExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ResizeAdImageRequestResolution.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ResizeAdImageRequestResolution.g.cs deleted file mode 100644 index b66a4f89..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ResizeAdImageRequestResolution.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class ResizeAdImageRequestResolutionJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.ResizeAdImageRequestResolution Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.ResizeAdImageRequestResolutionExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.ResizeAdImageRequestResolution)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.ResizeAdImageRequestResolution); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.ResizeAdImageRequestResolution value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.ResizeAdImageRequestResolutionExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ResizeAdImageRequestResolutionNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ResizeAdImageRequestResolutionNullable.g.cs deleted file mode 100644 index 7cb54a0e..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ResizeAdImageRequestResolutionNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class ResizeAdImageRequestResolutionNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.ResizeAdImageRequestResolution? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.ResizeAdImageRequestResolutionExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.ResizeAdImageRequestResolution)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.ResizeAdImageRequestResolution?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.ResizeAdImageRequestResolution? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.ResizeAdImageRequestResolutionExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.Resolution.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.Resolution.g.cs deleted file mode 100644 index 1f98aa7e..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.Resolution.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class ResolutionJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.Resolution Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.ResolutionExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.Resolution)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.Resolution); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.Resolution value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.ResolutionExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ResolutionNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ResolutionNullable.g.cs deleted file mode 100644 index 215070d5..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ResolutionNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class ResolutionNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.Resolution? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.ResolutionExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.Resolution)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.Resolution?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.Resolution? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.ResolutionExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ResolutionV4ImageToImage.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ResolutionV4ImageToImage.g.cs deleted file mode 100644 index 908a829b..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ResolutionV4ImageToImage.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class ResolutionV4ImageToImageJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.ResolutionV4ImageToImage Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.ResolutionV4ImageToImageExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.ResolutionV4ImageToImage)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.ResolutionV4ImageToImage); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.ResolutionV4ImageToImage value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.ResolutionV4ImageToImageExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ResolutionV4ImageToImageNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ResolutionV4ImageToImageNullable.g.cs deleted file mode 100644 index 31167fa2..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ResolutionV4ImageToImageNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class ResolutionV4ImageToImageNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.ResolutionV4ImageToImage? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.ResolutionV4ImageToImageExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.ResolutionV4ImageToImage)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.ResolutionV4ImageToImage?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.ResolutionV4ImageToImage? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.ResolutionV4ImageToImageExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ResolutionV4Layout.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ResolutionV4Layout.g.cs deleted file mode 100644 index 90edd4d7..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ResolutionV4Layout.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class ResolutionV4LayoutJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.ResolutionV4Layout Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.ResolutionV4LayoutExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.ResolutionV4Layout)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.ResolutionV4Layout); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.ResolutionV4Layout value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.ResolutionV4LayoutExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ResolutionV4LayoutNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ResolutionV4LayoutNullable.g.cs deleted file mode 100644 index b944284e..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ResolutionV4LayoutNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class ResolutionV4LayoutNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.ResolutionV4Layout? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.ResolutionV4LayoutExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.ResolutionV4Layout)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.ResolutionV4Layout?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.ResolutionV4Layout? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.ResolutionV4LayoutExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SegmentBy.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SegmentBy.g.cs deleted file mode 100644 index 27fb2a07..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SegmentBy.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class SegmentByJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.SegmentBy Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.SegmentByExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.SegmentBy)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.SegmentBy); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.SegmentBy value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.SegmentByExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SegmentByNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SegmentByNullable.g.cs deleted file mode 100644 index 1052b7eb..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SegmentByNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class SegmentByNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.SegmentBy? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.SegmentByExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.SegmentBy)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.SegmentBy?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.SegmentBy? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.SegmentByExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SkechersStyleEditQuality.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SkechersStyleEditQuality.g.cs deleted file mode 100644 index fe6213e1..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SkechersStyleEditQuality.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class SkechersStyleEditQualityJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.SkechersStyleEditQuality Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.SkechersStyleEditQualityExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.SkechersStyleEditQuality)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.SkechersStyleEditQuality); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.SkechersStyleEditQuality value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.SkechersStyleEditQualityExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SkechersStyleEditQualityNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SkechersStyleEditQualityNullable.g.cs deleted file mode 100644 index 3a7629d5..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SkechersStyleEditQualityNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class SkechersStyleEditQualityNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.SkechersStyleEditQuality? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.SkechersStyleEditQualityExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.SkechersStyleEditQuality)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.SkechersStyleEditQuality?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.SkechersStyleEditQuality? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.SkechersStyleEditQualityExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SkechersStyleEditRequestAspectRatio.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SkechersStyleEditRequestAspectRatio.g.cs deleted file mode 100644 index cdd78a4c..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SkechersStyleEditRequestAspectRatio.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class SkechersStyleEditRequestAspectRatioJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.SkechersStyleEditRequestAspectRatio Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.SkechersStyleEditRequestAspectRatioExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.SkechersStyleEditRequestAspectRatio)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.SkechersStyleEditRequestAspectRatio); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.SkechersStyleEditRequestAspectRatio value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.SkechersStyleEditRequestAspectRatioExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SkechersStyleEditRequestAspectRatioNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SkechersStyleEditRequestAspectRatioNullable.g.cs deleted file mode 100644 index a94aa8f6..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SkechersStyleEditRequestAspectRatioNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class SkechersStyleEditRequestAspectRatioNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.SkechersStyleEditRequestAspectRatio? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.SkechersStyleEditRequestAspectRatioExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.SkechersStyleEditRequestAspectRatio)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.SkechersStyleEditRequestAspectRatio?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.SkechersStyleEditRequestAspectRatio? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.SkechersStyleEditRequestAspectRatioExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SkechersStyleEditRequestBaseGenerationSize.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SkechersStyleEditRequestBaseGenerationSize.g.cs deleted file mode 100644 index 59a08821..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SkechersStyleEditRequestBaseGenerationSize.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class SkechersStyleEditRequestBaseGenerationSizeJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.SkechersStyleEditRequestBaseGenerationSize Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.SkechersStyleEditRequestBaseGenerationSizeExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.SkechersStyleEditRequestBaseGenerationSize)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.SkechersStyleEditRequestBaseGenerationSize); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.SkechersStyleEditRequestBaseGenerationSize value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.SkechersStyleEditRequestBaseGenerationSizeExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SkechersStyleEditRequestBaseGenerationSizeNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SkechersStyleEditRequestBaseGenerationSizeNullable.g.cs deleted file mode 100644 index f248a60d..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SkechersStyleEditRequestBaseGenerationSizeNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class SkechersStyleEditRequestBaseGenerationSizeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.SkechersStyleEditRequestBaseGenerationSize? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.SkechersStyleEditRequestBaseGenerationSizeExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.SkechersStyleEditRequestBaseGenerationSize)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.SkechersStyleEditRequestBaseGenerationSize?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.SkechersStyleEditRequestBaseGenerationSize? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.SkechersStyleEditRequestBaseGenerationSizeExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SoleSwapQuality.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SoleSwapQuality.g.cs deleted file mode 100644 index 8433bc65..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SoleSwapQuality.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class SoleSwapQualityJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.SoleSwapQuality Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.SoleSwapQualityExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.SoleSwapQuality)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.SoleSwapQuality); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.SoleSwapQuality value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.SoleSwapQualityExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SoleSwapQualityNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SoleSwapQualityNullable.g.cs deleted file mode 100644 index d6b6a3e4..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SoleSwapQualityNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class SoleSwapQualityNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.SoleSwapQuality? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.SoleSwapQualityExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.SoleSwapQuality)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.SoleSwapQuality?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.SoleSwapQuality? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.SoleSwapQualityExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SoleSwapRequestBaseGenerationSize.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SoleSwapRequestBaseGenerationSize.g.cs deleted file mode 100644 index d3644823..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SoleSwapRequestBaseGenerationSize.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class SoleSwapRequestBaseGenerationSizeJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.SoleSwapRequestBaseGenerationSize Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.SoleSwapRequestBaseGenerationSizeExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.SoleSwapRequestBaseGenerationSize)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.SoleSwapRequestBaseGenerationSize); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.SoleSwapRequestBaseGenerationSize value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.SoleSwapRequestBaseGenerationSizeExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SoleSwapRequestBaseGenerationSizeNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SoleSwapRequestBaseGenerationSizeNullable.g.cs deleted file mode 100644 index bc62a2ea..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SoleSwapRequestBaseGenerationSizeNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class SoleSwapRequestBaseGenerationSizeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.SoleSwapRequestBaseGenerationSize? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.SoleSwapRequestBaseGenerationSizeExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.SoleSwapRequestBaseGenerationSize)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.SoleSwapRequestBaseGenerationSize?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.SoleSwapRequestBaseGenerationSize? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.SoleSwapRequestBaseGenerationSizeExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.StylePresetV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.StylePresetV3.g.cs deleted file mode 100644 index dec3d48f..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.StylePresetV3.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class StylePresetV3JsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.StylePresetV3 Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.StylePresetV3Extensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.StylePresetV3)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.StylePresetV3); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.StylePresetV3 value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.StylePresetV3Extensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.StylePresetV3Nullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.StylePresetV3Nullable.g.cs deleted file mode 100644 index 0e4558c4..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.StylePresetV3Nullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class StylePresetV3NullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.StylePresetV3? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.StylePresetV3Extensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.StylePresetV3)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.StylePresetV3?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.StylePresetV3? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.StylePresetV3Extensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.StyleType.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.StyleType.g.cs deleted file mode 100644 index f70afab7..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.StyleType.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class StyleTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.StyleType Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.StyleTypeExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.StyleType)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.StyleType); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.StyleType value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.StyleTypeExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.StyleTypeNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.StyleTypeNullable.g.cs deleted file mode 100644 index 3303799e..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.StyleTypeNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class StyleTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.StyleType? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.StyleTypeExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.StyleType)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.StyleType?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.StyleType? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.StyleTypeExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.StyleTypeV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.StyleTypeV3.g.cs deleted file mode 100644 index 1c58010a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.StyleTypeV3.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class StyleTypeV3JsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.StyleTypeV3 Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.StyleTypeV3Extensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.StyleTypeV3)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.StyleTypeV3); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.StyleTypeV3 value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.StyleTypeV3Extensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.StyleTypeV3Nullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.StyleTypeV3Nullable.g.cs deleted file mode 100644 index cc2eaf09..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.StyleTypeV3Nullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class StyleTypeV3NullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.StyleTypeV3? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.StyleTypeV3Extensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.StyleTypeV3)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.StyleTypeV3?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.StyleTypeV3? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.StyleTypeV3Extensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SvgGenerationObjectMimeType.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SvgGenerationObjectMimeType.g.cs deleted file mode 100644 index fb312e8c..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SvgGenerationObjectMimeType.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class SvgGenerationObjectMimeTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.SvgGenerationObjectMimeType Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.SvgGenerationObjectMimeTypeExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.SvgGenerationObjectMimeType)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.SvgGenerationObjectMimeType); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.SvgGenerationObjectMimeType value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.SvgGenerationObjectMimeTypeExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SvgGenerationObjectMimeTypeNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SvgGenerationObjectMimeTypeNullable.g.cs deleted file mode 100644 index 350d2a62..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SvgGenerationObjectMimeTypeNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class SvgGenerationObjectMimeTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.SvgGenerationObjectMimeType? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.SvgGenerationObjectMimeTypeExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.SvgGenerationObjectMimeType)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.SvgGenerationObjectMimeType?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.SvgGenerationObjectMimeType? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.SvgGenerationObjectMimeTypeExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SvgGenerationObjectObjectType.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SvgGenerationObjectObjectType.g.cs deleted file mode 100644 index 16f02a42..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SvgGenerationObjectObjectType.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class SvgGenerationObjectObjectTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.SvgGenerationObjectObjectType Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.SvgGenerationObjectObjectTypeExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.SvgGenerationObjectObjectType)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.SvgGenerationObjectObjectType); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.SvgGenerationObjectObjectType value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.SvgGenerationObjectObjectTypeExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SvgGenerationObjectObjectTypeNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SvgGenerationObjectObjectTypeNullable.g.cs deleted file mode 100644 index a201f4a5..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SvgGenerationObjectObjectTypeNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class SvgGenerationObjectObjectTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.SvgGenerationObjectObjectType? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.SvgGenerationObjectObjectTypeExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.SvgGenerationObjectObjectType)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.SvgGenerationObjectObjectType?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.SvgGenerationObjectObjectType? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.SvgGenerationObjectObjectTypeExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SwanSLogoDesignRequestDesignVariant.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SwanSLogoDesignRequestDesignVariant.g.cs deleted file mode 100644 index 76ac5488..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SwanSLogoDesignRequestDesignVariant.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class SwanSLogoDesignRequestDesignVariantJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.SwanSLogoDesignRequestDesignVariant Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.SwanSLogoDesignRequestDesignVariantExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.SwanSLogoDesignRequestDesignVariant)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.SwanSLogoDesignRequestDesignVariant); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.SwanSLogoDesignRequestDesignVariant value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.SwanSLogoDesignRequestDesignVariantExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SwanSLogoDesignRequestDesignVariantNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SwanSLogoDesignRequestDesignVariantNullable.g.cs deleted file mode 100644 index dc194506..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SwanSLogoDesignRequestDesignVariantNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class SwanSLogoDesignRequestDesignVariantNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.SwanSLogoDesignRequestDesignVariant? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.SwanSLogoDesignRequestDesignVariantExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.SwanSLogoDesignRequestDesignVariant)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.SwanSLogoDesignRequestDesignVariant?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.SwanSLogoDesignRequestDesignVariant? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.SwanSLogoDesignRequestDesignVariantExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SwanSLogoDesignRequestLogoStyle.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SwanSLogoDesignRequestLogoStyle.g.cs deleted file mode 100644 index 9812e600..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SwanSLogoDesignRequestLogoStyle.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class SwanSLogoDesignRequestLogoStyleJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.SwanSLogoDesignRequestLogoStyle Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.SwanSLogoDesignRequestLogoStyleExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.SwanSLogoDesignRequestLogoStyle)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.SwanSLogoDesignRequestLogoStyle); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.SwanSLogoDesignRequestLogoStyle value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.SwanSLogoDesignRequestLogoStyleExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SwanSLogoDesignRequestLogoStyleNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SwanSLogoDesignRequestLogoStyleNullable.g.cs deleted file mode 100644 index 7c36f566..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SwanSLogoDesignRequestLogoStyleNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class SwanSLogoDesignRequestLogoStyleNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.SwanSLogoDesignRequestLogoStyle? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.SwanSLogoDesignRequestLogoStyleExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.SwanSLogoDesignRequestLogoStyle)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.SwanSLogoDesignRequestLogoStyle?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.SwanSLogoDesignRequestLogoStyle? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.SwanSLogoDesignRequestLogoStyleExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SwanSLogoDesignRequestSourceMode.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SwanSLogoDesignRequestSourceMode.g.cs deleted file mode 100644 index 7226d58e..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SwanSLogoDesignRequestSourceMode.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class SwanSLogoDesignRequestSourceModeJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.SwanSLogoDesignRequestSourceMode Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.SwanSLogoDesignRequestSourceModeExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.SwanSLogoDesignRequestSourceMode)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.SwanSLogoDesignRequestSourceMode); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.SwanSLogoDesignRequestSourceMode value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.SwanSLogoDesignRequestSourceModeExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SwanSLogoDesignRequestSourceModeNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SwanSLogoDesignRequestSourceModeNullable.g.cs deleted file mode 100644 index ab67b041..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SwanSLogoDesignRequestSourceModeNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class SwanSLogoDesignRequestSourceModeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.SwanSLogoDesignRequestSourceMode? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.SwanSLogoDesignRequestSourceModeExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.SwanSLogoDesignRequestSourceMode)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.SwanSLogoDesignRequestSourceMode?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.SwanSLogoDesignRequestSourceMode? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.SwanSLogoDesignRequestSourceModeExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SwanSLogoInstallRequestLogoStyle.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SwanSLogoInstallRequestLogoStyle.g.cs deleted file mode 100644 index 73c8a80e..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SwanSLogoInstallRequestLogoStyle.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class SwanSLogoInstallRequestLogoStyleJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.SwanSLogoInstallRequestLogoStyle Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.SwanSLogoInstallRequestLogoStyleExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.SwanSLogoInstallRequestLogoStyle)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.SwanSLogoInstallRequestLogoStyle); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.SwanSLogoInstallRequestLogoStyle value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.SwanSLogoInstallRequestLogoStyleExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SwanSLogoInstallRequestLogoStyleNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SwanSLogoInstallRequestLogoStyleNullable.g.cs deleted file mode 100644 index 31892a1c..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SwanSLogoInstallRequestLogoStyleNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class SwanSLogoInstallRequestLogoStyleNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.SwanSLogoInstallRequestLogoStyle? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.SwanSLogoInstallRequestLogoStyleExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.SwanSLogoInstallRequestLogoStyle)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.SwanSLogoInstallRequestLogoStyle?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.SwanSLogoInstallRequestLogoStyle? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.SwanSLogoInstallRequestLogoStyleExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SwanSLogoQuality.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SwanSLogoQuality.g.cs deleted file mode 100644 index adfe63c0..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SwanSLogoQuality.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class SwanSLogoQualityJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.SwanSLogoQuality Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.SwanSLogoQualityExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.SwanSLogoQuality)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.SwanSLogoQuality); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.SwanSLogoQuality value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.SwanSLogoQualityExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SwanSLogoQualityNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SwanSLogoQualityNullable.g.cs deleted file mode 100644 index d1b75d8f..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SwanSLogoQualityNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class SwanSLogoQualityNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.SwanSLogoQuality? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.SwanSLogoQualityExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.SwanSLogoQuality)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.SwanSLogoQuality?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.SwanSLogoQuality? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.SwanSLogoQualityExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SwapProductMode.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SwapProductMode.g.cs deleted file mode 100644 index d39a6fbf..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SwapProductMode.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class SwapProductModeJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.SwapProductMode Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.SwapProductModeExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.SwapProductMode)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.SwapProductMode); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.SwapProductMode value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.SwapProductModeExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SwapProductModeNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SwapProductModeNullable.g.cs deleted file mode 100644 index 0a1ea51b..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SwapProductModeNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class SwapProductModeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.SwapProductMode? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.SwapProductModeExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.SwapProductMode)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.SwapProductMode?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.SwapProductMode? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.SwapProductModeExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SwapProductQuality.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SwapProductQuality.g.cs deleted file mode 100644 index 92677d3c..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SwapProductQuality.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class SwapProductQualityJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.SwapProductQuality Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.SwapProductQualityExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.SwapProductQuality)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.SwapProductQuality); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.SwapProductQuality value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.SwapProductQualityExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SwapProductQualityNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SwapProductQualityNullable.g.cs deleted file mode 100644 index e097421c..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.SwapProductQualityNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class SwapProductQualityNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.SwapProductQuality? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.SwapProductQualityExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.SwapProductQuality)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.SwapProductQuality?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.SwapProductQuality? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.SwapProductQualityExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.TextItemV3Alignment.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.TextItemV3Alignment.g.cs deleted file mode 100644 index 2660b302..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.TextItemV3Alignment.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class TextItemV3AlignmentJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.TextItemV3Alignment Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.TextItemV3AlignmentExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.TextItemV3Alignment)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.TextItemV3Alignment); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.TextItemV3Alignment value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.TextItemV3AlignmentExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.TextItemV3AlignmentNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.TextItemV3AlignmentNullable.g.cs deleted file mode 100644 index 10527b2e..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.TextItemV3AlignmentNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class TextItemV3AlignmentNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.TextItemV3Alignment? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.TextItemV3AlignmentExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.TextItemV3Alignment)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.TextItemV3Alignment?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.TextItemV3Alignment? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.TextItemV3AlignmentExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.TextItemV3GlyphType.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.TextItemV3GlyphType.g.cs deleted file mode 100644 index 8401d974..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.TextItemV3GlyphType.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class TextItemV3GlyphTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.TextItemV3GlyphType Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.TextItemV3GlyphTypeExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.TextItemV3GlyphType)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.TextItemV3GlyphType); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.TextItemV3GlyphType value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.TextItemV3GlyphTypeExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.TextItemV3GlyphTypeNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.TextItemV3GlyphTypeNullable.g.cs deleted file mode 100644 index 2fac21f6..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.TextItemV3GlyphTypeNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class TextItemV3GlyphTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.TextItemV3GlyphType? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.TextItemV3GlyphTypeExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.TextItemV3GlyphType)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.TextItemV3GlyphType?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.TextItemV3GlyphType? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.TextItemV3GlyphTypeExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.TextItemV3StyleClass.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.TextItemV3StyleClass.g.cs deleted file mode 100644 index 7c6a49f3..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.TextItemV3StyleClass.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class TextItemV3StyleClassJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.TextItemV3StyleClass Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.TextItemV3StyleClassExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.TextItemV3StyleClass)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.TextItemV3StyleClass); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.TextItemV3StyleClass value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.TextItemV3StyleClassExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.TextItemV3StyleClassNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.TextItemV3StyleClassNullable.g.cs deleted file mode 100644 index 1d251061..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.TextItemV3StyleClassNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class TextItemV3StyleClassNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.TextItemV3StyleClass? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.TextItemV3StyleClassExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.TextItemV3StyleClass)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.TextItemV3StyleClass?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.TextItemV3StyleClass? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.TextItemV3StyleClassExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.TextItemV3TextTransform.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.TextItemV3TextTransform.g.cs deleted file mode 100644 index c146f372..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.TextItemV3TextTransform.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class TextItemV3TextTransformJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.TextItemV3TextTransform Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.TextItemV3TextTransformExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.TextItemV3TextTransform)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.TextItemV3TextTransform); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.TextItemV3TextTransform value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.TextItemV3TextTransformExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.TextItemV3TextTransformNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.TextItemV3TextTransformNullable.g.cs deleted file mode 100644 index 6e8fd5b0..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.TextItemV3TextTransformNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class TextItemV3TextTransformNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.TextItemV3TextTransform? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.TextItemV3TextTransformExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.TextItemV3TextTransform)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.TextItemV3TextTransform?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.TextItemV3TextTransform? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.TextItemV3TextTransformExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.TextItemV3VerticalAlignment.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.TextItemV3VerticalAlignment.g.cs deleted file mode 100644 index efafbbbb..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.TextItemV3VerticalAlignment.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class TextItemV3VerticalAlignmentJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.TextItemV3VerticalAlignment Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.TextItemV3VerticalAlignmentExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.TextItemV3VerticalAlignment)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.TextItemV3VerticalAlignment); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.TextItemV3VerticalAlignment value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.TextItemV3VerticalAlignmentExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.TextItemV3VerticalAlignmentNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.TextItemV3VerticalAlignmentNullable.g.cs deleted file mode 100644 index 347b01b6..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.TextItemV3VerticalAlignmentNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class TextItemV3VerticalAlignmentNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.TextItemV3VerticalAlignment? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.TextItemV3VerticalAlignmentExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.TextItemV3VerticalAlignment)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.TextItemV3VerticalAlignment?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.TextItemV3VerticalAlignment? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.TextItemV3VerticalAlignmentExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.TextLayerizerResultObjectObjectType.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.TextLayerizerResultObjectObjectType.g.cs deleted file mode 100644 index b1b2ee02..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.TextLayerizerResultObjectObjectType.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class TextLayerizerResultObjectObjectTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.TextLayerizerResultObjectObjectType Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.TextLayerizerResultObjectObjectTypeExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.TextLayerizerResultObjectObjectType)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.TextLayerizerResultObjectObjectType); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.TextLayerizerResultObjectObjectType value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.TextLayerizerResultObjectObjectTypeExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.TextLayerizerResultObjectObjectTypeNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.TextLayerizerResultObjectObjectTypeNullable.g.cs deleted file mode 100644 index e85b3090..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.TextLayerizerResultObjectObjectTypeNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class TextLayerizerResultObjectObjectTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.TextLayerizerResultObjectObjectType? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.TextLayerizerResultObjectObjectTypeExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.TextLayerizerResultObjectObjectType)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.TextLayerizerResultObjectObjectType?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.TextLayerizerResultObjectObjectType? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.TextLayerizerResultObjectObjectTypeExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.TextSpanV3FontFxItem.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.TextSpanV3FontFxItem.g.cs deleted file mode 100644 index 7d687f1c..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.TextSpanV3FontFxItem.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class TextSpanV3FontFxItemJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.TextSpanV3FontFxItem Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.TextSpanV3FontFxItemExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.TextSpanV3FontFxItem)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.TextSpanV3FontFxItem); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.TextSpanV3FontFxItem value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.TextSpanV3FontFxItemExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.TextSpanV3FontFxItemNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.TextSpanV3FontFxItemNullable.g.cs deleted file mode 100644 index e217ad7b..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.TextSpanV3FontFxItemNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class TextSpanV3FontFxItemNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.TextSpanV3FontFxItem? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.TextSpanV3FontFxItemExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.TextSpanV3FontFxItem)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.TextSpanV3FontFxItem?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.TextSpanV3FontFxItem? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.TextSpanV3FontFxItemExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ToolRemixRequestResolutionTier.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ToolRemixRequestResolutionTier.g.cs deleted file mode 100644 index bec9133a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ToolRemixRequestResolutionTier.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class ToolRemixRequestResolutionTierJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.ToolRemixRequestResolutionTier Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.ToolRemixRequestResolutionTierExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.ToolRemixRequestResolutionTier)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.ToolRemixRequestResolutionTier); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.ToolRemixRequestResolutionTier value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.ToolRemixRequestResolutionTierExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ToolRemixRequestResolutionTierNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ToolRemixRequestResolutionTierNullable.g.cs deleted file mode 100644 index 5b70df0a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ToolRemixRequestResolutionTierNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class ToolRemixRequestResolutionTierNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.ToolRemixRequestResolutionTier? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.ToolRemixRequestResolutionTierExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.ToolRemixRequestResolutionTier)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.ToolRemixRequestResolutionTier?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.ToolRemixRequestResolutionTier? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.ToolRemixRequestResolutionTierExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ToolType.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ToolType.g.cs deleted file mode 100644 index b4198b80..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ToolType.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class ToolTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.ToolType Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.ToolTypeExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.ToolType)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.ToolType); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.ToolType value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.ToolTypeExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ToolTypeNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ToolTypeNullable.g.cs deleted file mode 100644 index 0ab9c167..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.ToolTypeNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class ToolTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.ToolType? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.ToolTypeExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.ToolType)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.ToolType?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.ToolType? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.ToolTypeExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.TrainingRunStatus.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.TrainingRunStatus.g.cs deleted file mode 100644 index 1671db85..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.TrainingRunStatus.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class TrainingRunStatusJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.TrainingRunStatus Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.TrainingRunStatusExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.TrainingRunStatus)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.TrainingRunStatus); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.TrainingRunStatus value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.TrainingRunStatusExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.TrainingRunStatusNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.TrainingRunStatusNullable.g.cs deleted file mode 100644 index 584d89c6..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.TrainingRunStatusNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class TrainingRunStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.TrainingRunStatus? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.TrainingRunStatusExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.TrainingRunStatus)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.TrainingRunStatus?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.TrainingRunStatus? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.TrainingRunStatusExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.TransparencyOption.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.TransparencyOption.g.cs deleted file mode 100644 index be859fbd..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.TransparencyOption.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class TransparencyOptionJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.TransparencyOption Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.TransparencyOptionExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.TransparencyOption)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.TransparencyOption); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.TransparencyOption value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.TransparencyOptionExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.TransparencyOptionNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.TransparencyOptionNullable.g.cs deleted file mode 100644 index 5bfe42f4..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.TransparencyOptionNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class TransparencyOptionNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.TransparencyOption? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.TransparencyOptionExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.TransparencyOption)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.TransparencyOption?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.TransparencyOption? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.TransparencyOptionExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleFactor.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleFactor.g.cs deleted file mode 100644 index 32ae0570..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleFactor.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class UpscaleFactorJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.UpscaleFactor Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.UpscaleFactorExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.UpscaleFactor)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.UpscaleFactor); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.UpscaleFactor value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.UpscaleFactorExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleFactorNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleFactorNullable.g.cs deleted file mode 100644 index 1756208c..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleFactorNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class UpscaleFactorNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.UpscaleFactor? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.UpscaleFactorExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.UpscaleFactor)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.UpscaleFactor?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.UpscaleFactor? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.UpscaleFactorExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageNanoBananaProRequestResolutionTier.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageNanoBananaProRequestResolutionTier.g.cs deleted file mode 100644 index 75b7077d..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageNanoBananaProRequestResolutionTier.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class UpscaleImageNanoBananaProRequestResolutionTierJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.UpscaleImageNanoBananaProRequestResolutionTier Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.UpscaleImageNanoBananaProRequestResolutionTierExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.UpscaleImageNanoBananaProRequestResolutionTier)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.UpscaleImageNanoBananaProRequestResolutionTier); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.UpscaleImageNanoBananaProRequestResolutionTier value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.UpscaleImageNanoBananaProRequestResolutionTierExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageNanoBananaProRequestResolutionTierNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageNanoBananaProRequestResolutionTierNullable.g.cs deleted file mode 100644 index e0c878d4..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageNanoBananaProRequestResolutionTierNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class UpscaleImageNanoBananaProRequestResolutionTierNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.UpscaleImageNanoBananaProRequestResolutionTier? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.UpscaleImageNanoBananaProRequestResolutionTierExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.UpscaleImageNanoBananaProRequestResolutionTier)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.UpscaleImageNanoBananaProRequestResolutionTier?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.UpscaleImageNanoBananaProRequestResolutionTier? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.UpscaleImageNanoBananaProRequestResolutionTierExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazBloom2RequestUpscaleFactor.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazBloom2RequestUpscaleFactor.g.cs deleted file mode 100644 index 0ecfca06..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazBloom2RequestUpscaleFactor.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class UpscaleImageTopazBloom2RequestUpscaleFactorJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.UpscaleImageTopazBloom2RequestUpscaleFactor Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.UpscaleImageTopazBloom2RequestUpscaleFactorExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.UpscaleImageTopazBloom2RequestUpscaleFactor)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.UpscaleImageTopazBloom2RequestUpscaleFactor); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.UpscaleImageTopazBloom2RequestUpscaleFactor value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.UpscaleImageTopazBloom2RequestUpscaleFactorExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazBloom2RequestUpscaleFactorNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazBloom2RequestUpscaleFactorNullable.g.cs deleted file mode 100644 index f48495e6..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazBloom2RequestUpscaleFactorNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class UpscaleImageTopazBloom2RequestUpscaleFactorNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.UpscaleImageTopazBloom2RequestUpscaleFactor? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.UpscaleImageTopazBloom2RequestUpscaleFactorExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.UpscaleImageTopazBloom2RequestUpscaleFactor)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.UpscaleImageTopazBloom2RequestUpscaleFactor?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.UpscaleImageTopazBloom2RequestUpscaleFactor? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.UpscaleImageTopazBloom2RequestUpscaleFactorExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazRedefineRequestSubjectDetection.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazRedefineRequestSubjectDetection.g.cs deleted file mode 100644 index bf7ff97b..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazRedefineRequestSubjectDetection.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class UpscaleImageTopazRedefineRequestSubjectDetectionJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.UpscaleImageTopazRedefineRequestSubjectDetection Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.UpscaleImageTopazRedefineRequestSubjectDetectionExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.UpscaleImageTopazRedefineRequestSubjectDetection)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.UpscaleImageTopazRedefineRequestSubjectDetection); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.UpscaleImageTopazRedefineRequestSubjectDetection value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.UpscaleImageTopazRedefineRequestSubjectDetectionExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazRedefineRequestSubjectDetectionNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazRedefineRequestSubjectDetectionNullable.g.cs deleted file mode 100644 index 6cfc2389..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazRedefineRequestSubjectDetectionNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class UpscaleImageTopazRedefineRequestSubjectDetectionNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.UpscaleImageTopazRedefineRequestSubjectDetection? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.UpscaleImageTopazRedefineRequestSubjectDetectionExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.UpscaleImageTopazRedefineRequestSubjectDetection)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.UpscaleImageTopazRedefineRequestSubjectDetection?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.UpscaleImageTopazRedefineRequestSubjectDetection? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.UpscaleImageTopazRedefineRequestSubjectDetectionExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazRedefineRequestUpscaleFactor.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazRedefineRequestUpscaleFactor.g.cs deleted file mode 100644 index 08c00d34..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazRedefineRequestUpscaleFactor.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class UpscaleImageTopazRedefineRequestUpscaleFactorJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.UpscaleImageTopazRedefineRequestUpscaleFactor Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.UpscaleImageTopazRedefineRequestUpscaleFactorExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.UpscaleImageTopazRedefineRequestUpscaleFactor)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.UpscaleImageTopazRedefineRequestUpscaleFactor); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.UpscaleImageTopazRedefineRequestUpscaleFactor value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.UpscaleImageTopazRedefineRequestUpscaleFactorExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazRedefineRequestUpscaleFactorNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazRedefineRequestUpscaleFactorNullable.g.cs deleted file mode 100644 index fd9b255f..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazRedefineRequestUpscaleFactorNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class UpscaleImageTopazRedefineRequestUpscaleFactorNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.UpscaleImageTopazRedefineRequestUpscaleFactor? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.UpscaleImageTopazRedefineRequestUpscaleFactorExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.UpscaleImageTopazRedefineRequestUpscaleFactor)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.UpscaleImageTopazRedefineRequestUpscaleFactor?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.UpscaleImageTopazRedefineRequestUpscaleFactor? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.UpscaleImageTopazRedefineRequestUpscaleFactorExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazStandardV2RequestSubjectDetection.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazStandardV2RequestSubjectDetection.g.cs deleted file mode 100644 index 0ac9e432..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazStandardV2RequestSubjectDetection.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class UpscaleImageTopazStandardV2RequestSubjectDetectionJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.UpscaleImageTopazStandardV2RequestSubjectDetection Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.UpscaleImageTopazStandardV2RequestSubjectDetectionExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.UpscaleImageTopazStandardV2RequestSubjectDetection)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.UpscaleImageTopazStandardV2RequestSubjectDetection); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.UpscaleImageTopazStandardV2RequestSubjectDetection value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.UpscaleImageTopazStandardV2RequestSubjectDetectionExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazStandardV2RequestSubjectDetectionNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazStandardV2RequestSubjectDetectionNullable.g.cs deleted file mode 100644 index 02479e78..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazStandardV2RequestSubjectDetectionNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class UpscaleImageTopazStandardV2RequestSubjectDetectionNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.UpscaleImageTopazStandardV2RequestSubjectDetection? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.UpscaleImageTopazStandardV2RequestSubjectDetectionExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.UpscaleImageTopazStandardV2RequestSubjectDetection)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.UpscaleImageTopazStandardV2RequestSubjectDetection?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.UpscaleImageTopazStandardV2RequestSubjectDetection? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.UpscaleImageTopazStandardV2RequestSubjectDetectionExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazStandardV2RequestUpscaleFactor.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazStandardV2RequestUpscaleFactor.g.cs deleted file mode 100644 index 2678ad28..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazStandardV2RequestUpscaleFactor.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class UpscaleImageTopazStandardV2RequestUpscaleFactorJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.UpscaleImageTopazStandardV2RequestUpscaleFactor Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.UpscaleImageTopazStandardV2RequestUpscaleFactorExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.UpscaleImageTopazStandardV2RequestUpscaleFactor)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.UpscaleImageTopazStandardV2RequestUpscaleFactor); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.UpscaleImageTopazStandardV2RequestUpscaleFactor value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.UpscaleImageTopazStandardV2RequestUpscaleFactorExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazStandardV2RequestUpscaleFactorNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazStandardV2RequestUpscaleFactorNullable.g.cs deleted file mode 100644 index d2334892..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazStandardV2RequestUpscaleFactorNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class UpscaleImageTopazStandardV2RequestUpscaleFactorNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.UpscaleImageTopazStandardV2RequestUpscaleFactor? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.UpscaleImageTopazStandardV2RequestUpscaleFactorExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.UpscaleImageTopazStandardV2RequestUpscaleFactor)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.UpscaleImageTopazStandardV2RequestUpscaleFactor?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.UpscaleImageTopazStandardV2RequestUpscaleFactor? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.UpscaleImageTopazStandardV2RequestUpscaleFactorExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazTextRefineRequestSubjectDetection.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazTextRefineRequestSubjectDetection.g.cs deleted file mode 100644 index b694aa6e..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazTextRefineRequestSubjectDetection.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class UpscaleImageTopazTextRefineRequestSubjectDetectionJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.UpscaleImageTopazTextRefineRequestSubjectDetection Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.UpscaleImageTopazTextRefineRequestSubjectDetectionExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.UpscaleImageTopazTextRefineRequestSubjectDetection)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.UpscaleImageTopazTextRefineRequestSubjectDetection); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.UpscaleImageTopazTextRefineRequestSubjectDetection value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.UpscaleImageTopazTextRefineRequestSubjectDetectionExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazTextRefineRequestSubjectDetectionNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazTextRefineRequestSubjectDetectionNullable.g.cs deleted file mode 100644 index 9e41899d..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazTextRefineRequestSubjectDetectionNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class UpscaleImageTopazTextRefineRequestSubjectDetectionNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.UpscaleImageTopazTextRefineRequestSubjectDetection? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.UpscaleImageTopazTextRefineRequestSubjectDetectionExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.UpscaleImageTopazTextRefineRequestSubjectDetection)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.UpscaleImageTopazTextRefineRequestSubjectDetection?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.UpscaleImageTopazTextRefineRequestSubjectDetection? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.UpscaleImageTopazTextRefineRequestSubjectDetectionExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazTextRefineRequestUpscaleFactor.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazTextRefineRequestUpscaleFactor.g.cs deleted file mode 100644 index f75928d6..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazTextRefineRequestUpscaleFactor.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class UpscaleImageTopazTextRefineRequestUpscaleFactorJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.UpscaleImageTopazTextRefineRequestUpscaleFactor Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.UpscaleImageTopazTextRefineRequestUpscaleFactorExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.UpscaleImageTopazTextRefineRequestUpscaleFactor)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.UpscaleImageTopazTextRefineRequestUpscaleFactor); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.UpscaleImageTopazTextRefineRequestUpscaleFactor value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.UpscaleImageTopazTextRefineRequestUpscaleFactorExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazTextRefineRequestUpscaleFactorNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazTextRefineRequestUpscaleFactorNullable.g.cs deleted file mode 100644 index ef3bfc2c..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazTextRefineRequestUpscaleFactorNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class UpscaleImageTopazTextRefineRequestUpscaleFactorNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.UpscaleImageTopazTextRefineRequestUpscaleFactor? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.UpscaleImageTopazTextRefineRequestUpscaleFactorExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.UpscaleImageTopazTextRefineRequestUpscaleFactor)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.UpscaleImageTopazTextRefineRequestUpscaleFactor?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.UpscaleImageTopazTextRefineRequestUpscaleFactor? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.UpscaleImageTopazTextRefineRequestUpscaleFactorExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazWonder35RequestEnhancementStrength.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazWonder35RequestEnhancementStrength.g.cs deleted file mode 100644 index c9b8a2b5..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazWonder35RequestEnhancementStrength.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class UpscaleImageTopazWonder35RequestEnhancementStrengthJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.UpscaleImageTopazWonder35RequestEnhancementStrength Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.UpscaleImageTopazWonder35RequestEnhancementStrengthExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.UpscaleImageTopazWonder35RequestEnhancementStrength)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.UpscaleImageTopazWonder35RequestEnhancementStrength); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.UpscaleImageTopazWonder35RequestEnhancementStrength value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.UpscaleImageTopazWonder35RequestEnhancementStrengthExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazWonder35RequestEnhancementStrengthNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazWonder35RequestEnhancementStrengthNullable.g.cs deleted file mode 100644 index 34b4b004..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazWonder35RequestEnhancementStrengthNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class UpscaleImageTopazWonder35RequestEnhancementStrengthNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.UpscaleImageTopazWonder35RequestEnhancementStrength? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.UpscaleImageTopazWonder35RequestEnhancementStrengthExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.UpscaleImageTopazWonder35RequestEnhancementStrength)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.UpscaleImageTopazWonder35RequestEnhancementStrength?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.UpscaleImageTopazWonder35RequestEnhancementStrength? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.UpscaleImageTopazWonder35RequestEnhancementStrengthExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazWonder35RequestUpscaleFactor.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazWonder35RequestUpscaleFactor.g.cs deleted file mode 100644 index 046e3365..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazWonder35RequestUpscaleFactor.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class UpscaleImageTopazWonder35RequestUpscaleFactorJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.UpscaleImageTopazWonder35RequestUpscaleFactor Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.UpscaleImageTopazWonder35RequestUpscaleFactorExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.UpscaleImageTopazWonder35RequestUpscaleFactor)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.UpscaleImageTopazWonder35RequestUpscaleFactor); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.UpscaleImageTopazWonder35RequestUpscaleFactor value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.UpscaleImageTopazWonder35RequestUpscaleFactorExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazWonder35RequestUpscaleFactorNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazWonder35RequestUpscaleFactorNullable.g.cs deleted file mode 100644 index 9b653b95..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleImageTopazWonder35RequestUpscaleFactorNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class UpscaleImageTopazWonder35RequestUpscaleFactorNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.UpscaleImageTopazWonder35RequestUpscaleFactor? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.UpscaleImageTopazWonder35RequestUpscaleFactorExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.UpscaleImageTopazWonder35RequestUpscaleFactor)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.UpscaleImageTopazWonder35RequestUpscaleFactor?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.UpscaleImageTopazWonder35RequestUpscaleFactor? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.UpscaleImageTopazWonder35RequestUpscaleFactorExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleToolRequestUpscaleFactor.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleToolRequestUpscaleFactor.g.cs deleted file mode 100644 index 62fcf683..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleToolRequestUpscaleFactor.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class UpscaleToolRequestUpscaleFactorJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.UpscaleToolRequestUpscaleFactor Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.UpscaleToolRequestUpscaleFactorExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.UpscaleToolRequestUpscaleFactor)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.UpscaleToolRequestUpscaleFactor); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.UpscaleToolRequestUpscaleFactor value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.UpscaleToolRequestUpscaleFactorExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleToolRequestUpscaleFactorNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleToolRequestUpscaleFactorNullable.g.cs deleted file mode 100644 index 1f7768b1..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UpscaleToolRequestUpscaleFactorNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class UpscaleToolRequestUpscaleFactorNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.UpscaleToolRequestUpscaleFactor? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.UpscaleToolRequestUpscaleFactorExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.UpscaleToolRequestUpscaleFactor)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.UpscaleToolRequestUpscaleFactor?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.UpscaleToolRequestUpscaleFactor? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.UpscaleToolRequestUpscaleFactorExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UsageSource.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UsageSource.g.cs deleted file mode 100644 index debea699..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UsageSource.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class UsageSourceJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.UsageSource Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.UsageSourceExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.UsageSource)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.UsageSource); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.UsageSource value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.UsageSourceExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UsageSourceNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UsageSourceNullable.g.cs deleted file mode 100644 index 4bf00743..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.UsageSourceNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class UsageSourceNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.UsageSource? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.UsageSourceExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.UsageSource)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.UsageSource?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.UsageSource? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.UsageSourceExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2AccountUsageGetParametersBucketWidth.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2AccountUsageGetParametersBucketWidth.g.cs new file mode 100644 index 00000000..ecec5c76 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2AccountUsageGetParametersBucketWidth.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2AccountUsageGetParametersBucketWidthJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2AccountUsageGetParametersBucketWidth Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2AccountUsageGetParametersBucketWidthExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2AccountUsageGetParametersBucketWidth)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2AccountUsageGetParametersBucketWidth); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2AccountUsageGetParametersBucketWidth value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Ideogram.V2AccountUsageGetParametersBucketWidthExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2AccountUsageGetParametersBucketWidthNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2AccountUsageGetParametersBucketWidthNullable.g.cs new file mode 100644 index 00000000..1ec66dab --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2AccountUsageGetParametersBucketWidthNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2AccountUsageGetParametersBucketWidthNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2AccountUsageGetParametersBucketWidth? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2AccountUsageGetParametersBucketWidthExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2AccountUsageGetParametersBucketWidth)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2AccountUsageGetParametersBucketWidth?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2AccountUsageGetParametersBucketWidth? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Ideogram.V2AccountUsageGetParametersBucketWidthExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2AccountUsageGetParametersSourcesSchemaItems.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2AccountUsageGetParametersSourcesSchemaItems.g.cs new file mode 100644 index 00000000..eceb3604 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2AccountUsageGetParametersSourcesSchemaItems.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2AccountUsageGetParametersSourcesSchemaItemsJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2AccountUsageGetParametersSourcesSchemaItems Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2AccountUsageGetParametersSourcesSchemaItemsExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2AccountUsageGetParametersSourcesSchemaItems)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2AccountUsageGetParametersSourcesSchemaItems); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2AccountUsageGetParametersSourcesSchemaItems value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Ideogram.V2AccountUsageGetParametersSourcesSchemaItemsExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2AccountUsageGetParametersSourcesSchemaItemsNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2AccountUsageGetParametersSourcesSchemaItemsNullable.g.cs new file mode 100644 index 00000000..d4ba26e4 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2AccountUsageGetParametersSourcesSchemaItemsNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2AccountUsageGetParametersSourcesSchemaItemsNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2AccountUsageGetParametersSourcesSchemaItems? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2AccountUsageGetParametersSourcesSchemaItemsExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2AccountUsageGetParametersSourcesSchemaItems)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2AccountUsageGetParametersSourcesSchemaItems?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2AccountUsageGetParametersSourcesSchemaItems? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Ideogram.V2AccountUsageGetParametersSourcesSchemaItemsExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier.g.cs new file mode 100644 index 00000000..4c583ec8 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageGenerateAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTierJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageGenerateAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageGenerateAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTierExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageGenerateAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageGenerateAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageGenerateAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Ideogram.V2ImageGenerateAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTierExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTierNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTierNullable.g.cs new file mode 100644 index 00000000..ca7331a6 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTierNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageGenerateAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTierNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageGenerateAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageGenerateAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTierExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageGenerateAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageGenerateAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageGenerateAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Ideogram.V2ImageGenerateAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTierExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaBackground.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaBackground.g.cs new file mode 100644 index 00000000..c80821c2 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaBackground.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaBackgroundJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaBackground Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaBackgroundExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaBackground)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaBackground); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaBackground value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Ideogram.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaBackgroundExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaBackgroundNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaBackgroundNullable.g.cs new file mode 100644 index 00000000..98cdbe8f --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaBackgroundNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaBackgroundNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaBackground? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaBackgroundExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaBackground)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaBackground?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaBackground? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Ideogram.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaBackgroundExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaQuality.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaQuality.g.cs new file mode 100644 index 00000000..0eefdf16 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaQuality.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaQualityJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaQuality Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaQualityExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaQuality)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaQuality); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaQuality value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Ideogram.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaQualityExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaQualityNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaQualityNullable.g.cs new file mode 100644 index 00000000..5d4a7514 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaQualityNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaQualityNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaQuality? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaQualityExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaQuality)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaQuality?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaQuality? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Ideogram.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaQualityExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaBackground.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaBackground.g.cs new file mode 100644 index 00000000..72dc1195 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaBackground.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaBackgroundJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaBackground Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaBackgroundExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaBackground)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaBackground); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaBackground value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Ideogram.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaBackgroundExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaBackgroundNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaBackgroundNullable.g.cs new file mode 100644 index 00000000..8a4f80e7 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaBackgroundNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaBackgroundNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaBackground? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaBackgroundExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaBackground)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaBackground?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaBackground? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Ideogram.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaBackgroundExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaQuality.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaQuality.g.cs new file mode 100644 index 00000000..149fa11b --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaQuality.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaQualityJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaQuality Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaQualityExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaQuality)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaQuality); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaQuality value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Ideogram.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaQualityExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaQualityNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaQualityNullable.g.cs new file mode 100644 index 00000000..babb8c7c --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaQualityNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaQualityNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaQuality? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaQualityExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaQuality)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaQuality?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaQuality? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Ideogram.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaQualityExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs new file mode 100644 index 00000000..3c5162b2 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Ideogram.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullable.g.cs new file mode 100644 index 00000000..6f41a4cf --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Ideogram.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType.g.cs new file mode 100644 index 00000000..0e6f6927 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Ideogram.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleTypeNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleTypeNullable.g.cs new file mode 100644 index 00000000..9b6f4827 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleTypeNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Ideogram.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs new file mode 100644 index 00000000..13de0ffc --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageGenerateIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageGenerateIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageGenerateIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageGenerateIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageGenerateIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageGenerateIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Ideogram.V2ImageGenerateIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullable.g.cs new file mode 100644 index 00000000..3485d74d --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageGenerateIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageGenerateIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageGenerateIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageGenerateIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageGenerateIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageGenerateIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Ideogram.V2ImageGenerateIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs new file mode 100644 index 00000000..8ef1e27e --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageGenerateIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageGenerateIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageGenerateIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageGenerateIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageGenerateIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageGenerateIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Ideogram.V2ImageGenerateIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullable.g.cs new file mode 100644 index 00000000..47c5bfc9 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageGenerateIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageGenerateIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageGenerateIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageGenerateIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageGenerateIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageGenerateIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Ideogram.V2ImageGenerateIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaBackground.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaBackground.g.cs new file mode 100644 index 00000000..e79caeb1 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaBackground.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaBackgroundJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaBackground Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaBackgroundExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaBackground)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaBackground); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaBackground value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Ideogram.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaBackgroundExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaBackgroundNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaBackgroundNullable.g.cs new file mode 100644 index 00000000..8d5d90fb --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaBackgroundNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaBackgroundNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaBackground? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaBackgroundExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaBackground)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaBackground?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaBackground? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Ideogram.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaBackgroundExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality.g.cs new file mode 100644 index 00000000..3bf09f8b --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaQualityJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaQualityExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Ideogram.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaQualityExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaQualityNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaQualityNullable.g.cs new file mode 100644 index 00000000..3ab7f8e8 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaQualityNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaQualityNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaQualityExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Ideogram.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaQualityExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateNanoBanana21PostRequestBodyContentMultipartFormDataSchemaResolutionTier.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateNanoBanana21PostRequestBodyContentMultipartFormDataSchemaResolutionTier.g.cs new file mode 100644 index 00000000..e41b46fa --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateNanoBanana21PostRequestBodyContentMultipartFormDataSchemaResolutionTier.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageGenerateNanoBanana21PostRequestBodyContentMultipartFormDataSchemaResolutionTierJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageGenerateNanoBanana21PostRequestBodyContentMultipartFormDataSchemaResolutionTier Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageGenerateNanoBanana21PostRequestBodyContentMultipartFormDataSchemaResolutionTierExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageGenerateNanoBanana21PostRequestBodyContentMultipartFormDataSchemaResolutionTier)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageGenerateNanoBanana21PostRequestBodyContentMultipartFormDataSchemaResolutionTier); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageGenerateNanoBanana21PostRequestBodyContentMultipartFormDataSchemaResolutionTier value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Ideogram.V2ImageGenerateNanoBanana21PostRequestBodyContentMultipartFormDataSchemaResolutionTierExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateNanoBanana21PostRequestBodyContentMultipartFormDataSchemaResolutionTierNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateNanoBanana21PostRequestBodyContentMultipartFormDataSchemaResolutionTierNullable.g.cs new file mode 100644 index 00000000..9d4e8fd9 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateNanoBanana21PostRequestBodyContentMultipartFormDataSchemaResolutionTierNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageGenerateNanoBanana21PostRequestBodyContentMultipartFormDataSchemaResolutionTierNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageGenerateNanoBanana21PostRequestBodyContentMultipartFormDataSchemaResolutionTier? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageGenerateNanoBanana21PostRequestBodyContentMultipartFormDataSchemaResolutionTierExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageGenerateNanoBanana21PostRequestBodyContentMultipartFormDataSchemaResolutionTier)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageGenerateNanoBanana21PostRequestBodyContentMultipartFormDataSchemaResolutionTier?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageGenerateNanoBanana21PostRequestBodyContentMultipartFormDataSchemaResolutionTier? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Ideogram.V2ImageGenerateNanoBanana21PostRequestBodyContentMultipartFormDataSchemaResolutionTierExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateNanoBanana2PostRequestBodyContentMultipartFormDataSchemaResolutionTier.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateNanoBanana2PostRequestBodyContentMultipartFormDataSchemaResolutionTier.g.cs new file mode 100644 index 00000000..69176606 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateNanoBanana2PostRequestBodyContentMultipartFormDataSchemaResolutionTier.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageGenerateNanoBanana2PostRequestBodyContentMultipartFormDataSchemaResolutionTierJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageGenerateNanoBanana2PostRequestBodyContentMultipartFormDataSchemaResolutionTier Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageGenerateNanoBanana2PostRequestBodyContentMultipartFormDataSchemaResolutionTierExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageGenerateNanoBanana2PostRequestBodyContentMultipartFormDataSchemaResolutionTier)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageGenerateNanoBanana2PostRequestBodyContentMultipartFormDataSchemaResolutionTier); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageGenerateNanoBanana2PostRequestBodyContentMultipartFormDataSchemaResolutionTier value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Ideogram.V2ImageGenerateNanoBanana2PostRequestBodyContentMultipartFormDataSchemaResolutionTierExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateNanoBanana2PostRequestBodyContentMultipartFormDataSchemaResolutionTierNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateNanoBanana2PostRequestBodyContentMultipartFormDataSchemaResolutionTierNullable.g.cs new file mode 100644 index 00000000..6fbafac9 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateNanoBanana2PostRequestBodyContentMultipartFormDataSchemaResolutionTierNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageGenerateNanoBanana2PostRequestBodyContentMultipartFormDataSchemaResolutionTierNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageGenerateNanoBanana2PostRequestBodyContentMultipartFormDataSchemaResolutionTier? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageGenerateNanoBanana2PostRequestBodyContentMultipartFormDataSchemaResolutionTierExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageGenerateNanoBanana2PostRequestBodyContentMultipartFormDataSchemaResolutionTier)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageGenerateNanoBanana2PostRequestBodyContentMultipartFormDataSchemaResolutionTier?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageGenerateNanoBanana2PostRequestBodyContentMultipartFormDataSchemaResolutionTier? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Ideogram.V2ImageGenerateNanoBanana2PostRequestBodyContentMultipartFormDataSchemaResolutionTierExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier.g.cs new file mode 100644 index 00000000..668487da --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageGenerateNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTierJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageGenerateNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageGenerateNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTierExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageGenerateNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageGenerateNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageGenerateNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Ideogram.V2ImageGenerateNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTierExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTierNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTierNullable.g.cs new file mode 100644 index 00000000..e9191a33 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageGenerateNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTierNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageGenerateNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTierNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageGenerateNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageGenerateNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTierExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageGenerateNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageGenerateNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageGenerateNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Ideogram.V2ImageGenerateNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTierExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs new file mode 100644 index 00000000..45aa97bd --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Ideogram.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullable.g.cs new file mode 100644 index 00000000..cc098fc7 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Ideogram.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType.g.cs new file mode 100644 index 00000000..e7903861 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Ideogram.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleTypeNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleTypeNullable.g.cs new file mode 100644 index 00000000..861ef083 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleTypeNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Ideogram.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageInpaintIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageInpaintIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs new file mode 100644 index 00000000..d4505b1a --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageInpaintIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageInpaintIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageInpaintIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageInpaintIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageInpaintIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageInpaintIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageInpaintIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Ideogram.V2ImageInpaintIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageInpaintIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageInpaintIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullable.g.cs new file mode 100644 index 00000000..77188243 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageInpaintIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageInpaintIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageInpaintIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageInpaintIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageInpaintIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageInpaintIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageInpaintIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Ideogram.V2ImageInpaintIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageInpaintIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageInpaintIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs new file mode 100644 index 00000000..7097a175 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageInpaintIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageInpaintIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageInpaintIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageInpaintIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageInpaintIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageInpaintIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageInpaintIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Ideogram.V2ImageInpaintIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageInpaintIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageInpaintIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullable.g.cs new file mode 100644 index 00000000..483449fb --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageInpaintIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageInpaintIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageInpaintIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageInpaintIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageInpaintIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageInpaintIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageInpaintIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Ideogram.V2ImageInpaintIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImagePreciseEditIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImagePreciseEditIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality.g.cs new file mode 100644 index 00000000..0169617a --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImagePreciseEditIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImagePreciseEditIdeogram45PostRequestBodyContentMultipartFormDataSchemaQualityJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImagePreciseEditIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImagePreciseEditIdeogram45PostRequestBodyContentMultipartFormDataSchemaQualityExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImagePreciseEditIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImagePreciseEditIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImagePreciseEditIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Ideogram.V2ImagePreciseEditIdeogram45PostRequestBodyContentMultipartFormDataSchemaQualityExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImagePreciseEditIdeogram45PostRequestBodyContentMultipartFormDataSchemaQualityNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImagePreciseEditIdeogram45PostRequestBodyContentMultipartFormDataSchemaQualityNullable.g.cs new file mode 100644 index 00000000..94b0f0f3 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImagePreciseEditIdeogram45PostRequestBodyContentMultipartFormDataSchemaQualityNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImagePreciseEditIdeogram45PostRequestBodyContentMultipartFormDataSchemaQualityNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImagePreciseEditIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImagePreciseEditIdeogram45PostRequestBodyContentMultipartFormDataSchemaQualityExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImagePreciseEditIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImagePreciseEditIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImagePreciseEditIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Ideogram.V2ImagePreciseEditIdeogram45PostRequestBodyContentMultipartFormDataSchemaQualityExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageReframeIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageReframeIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs new file mode 100644 index 00000000..e909b96e --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageReframeIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageReframeIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageReframeIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageReframeIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageReframeIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageReframeIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageReframeIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Ideogram.V2ImageReframeIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageReframeIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageReframeIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullable.g.cs new file mode 100644 index 00000000..0779f1cb --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageReframeIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageReframeIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageReframeIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageReframeIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageReframeIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageReframeIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageReframeIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Ideogram.V2ImageReframeIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageRemixAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageRemixAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier.g.cs new file mode 100644 index 00000000..fd7d195c --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageRemixAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageRemixAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTierJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageRemixAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageRemixAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTierExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageRemixAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageRemixAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageRemixAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Ideogram.V2ImageRemixAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTierExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageRemixAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTierNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageRemixAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTierNullable.g.cs new file mode 100644 index 00000000..849d7b5e --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageRemixAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTierNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageRemixAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTierNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageRemixAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageRemixAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTierExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageRemixAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageRemixAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageRemixAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Ideogram.V2ImageRemixAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTierExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs new file mode 100644 index 00000000..a01b7cf7 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Ideogram.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullable.g.cs new file mode 100644 index 00000000..d2ee2f56 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Ideogram.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType.g.cs new file mode 100644 index 00000000..d1d9a0f8 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Ideogram.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleTypeNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleTypeNullable.g.cs new file mode 100644 index 00000000..b04b993e --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleTypeNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Ideogram.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageRemixIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageRemixIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs new file mode 100644 index 00000000..2b97f36c --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageRemixIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageRemixIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageRemixIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageRemixIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageRemixIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageRemixIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageRemixIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Ideogram.V2ImageRemixIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageRemixIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageRemixIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullable.g.cs new file mode 100644 index 00000000..2551c61c --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageRemixIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageRemixIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageRemixIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageRemixIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageRemixIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageRemixIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageRemixIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Ideogram.V2ImageRemixIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageRemixIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageRemixIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs new file mode 100644 index 00000000..8d0f4f19 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageRemixIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageRemixIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageRemixIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageRemixIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageRemixIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageRemixIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageRemixIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Ideogram.V2ImageRemixIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageRemixIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageRemixIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullable.g.cs new file mode 100644 index 00000000..6c6a9c7d --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageRemixIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageRemixIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageRemixIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageRemixIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageRemixIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageRemixIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageRemixIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Ideogram.V2ImageRemixIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageRemixIdeogram4PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageRemixIdeogram4PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs new file mode 100644 index 00000000..0e1b09b3 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageRemixIdeogram4PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageRemixIdeogram4PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageRemixIdeogram4PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageRemixIdeogram4PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageRemixIdeogram4PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageRemixIdeogram4PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageRemixIdeogram4PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Ideogram.V2ImageRemixIdeogram4PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageRemixIdeogram4PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageRemixIdeogram4PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullable.g.cs new file mode 100644 index 00000000..3c365521 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageRemixIdeogram4PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageRemixIdeogram4PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageRemixIdeogram4PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageRemixIdeogram4PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageRemixIdeogram4PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageRemixIdeogram4PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageRemixIdeogram4PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Ideogram.V2ImageRemixIdeogram4PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageReplaceBackgroundIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageReplaceBackgroundIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs new file mode 100644 index 00000000..c4745ca2 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageReplaceBackgroundIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageReplaceBackgroundIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageReplaceBackgroundIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageReplaceBackgroundIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageReplaceBackgroundIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageReplaceBackgroundIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageReplaceBackgroundIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Ideogram.V2ImageReplaceBackgroundIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageReplaceBackgroundIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageReplaceBackgroundIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullable.g.cs new file mode 100644 index 00000000..4c97d263 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageReplaceBackgroundIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageReplaceBackgroundIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageReplaceBackgroundIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageReplaceBackgroundIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageReplaceBackgroundIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageReplaceBackgroundIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageReplaceBackgroundIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Ideogram.V2ImageReplaceBackgroundIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleAutoPostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleAutoPostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.g.cs new file mode 100644 index 00000000..3ec1a2b3 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleAutoPostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageUpscaleAutoPostRequestBodyContentMultipartFormDataSchemaUpscaleFactorJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageUpscaleAutoPostRequestBodyContentMultipartFormDataSchemaUpscaleFactor Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageUpscaleAutoPostRequestBodyContentMultipartFormDataSchemaUpscaleFactorExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageUpscaleAutoPostRequestBodyContentMultipartFormDataSchemaUpscaleFactor)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageUpscaleAutoPostRequestBodyContentMultipartFormDataSchemaUpscaleFactor); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageUpscaleAutoPostRequestBodyContentMultipartFormDataSchemaUpscaleFactor value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Ideogram.V2ImageUpscaleAutoPostRequestBodyContentMultipartFormDataSchemaUpscaleFactorExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleAutoPostRequestBodyContentMultipartFormDataSchemaUpscaleFactorNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleAutoPostRequestBodyContentMultipartFormDataSchemaUpscaleFactorNullable.g.cs new file mode 100644 index 00000000..bc3b9a61 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleAutoPostRequestBodyContentMultipartFormDataSchemaUpscaleFactorNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageUpscaleAutoPostRequestBodyContentMultipartFormDataSchemaUpscaleFactorNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageUpscaleAutoPostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageUpscaleAutoPostRequestBodyContentMultipartFormDataSchemaUpscaleFactorExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageUpscaleAutoPostRequestBodyContentMultipartFormDataSchemaUpscaleFactor)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageUpscaleAutoPostRequestBodyContentMultipartFormDataSchemaUpscaleFactor?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageUpscaleAutoPostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Ideogram.V2ImageUpscaleAutoPostRequestBodyContentMultipartFormDataSchemaUpscaleFactorExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier.g.cs new file mode 100644 index 00000000..3af335a8 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageUpscaleNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTierJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageUpscaleNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageUpscaleNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTierExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageUpscaleNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageUpscaleNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageUpscaleNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Ideogram.V2ImageUpscaleNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTierExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTierNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTierNullable.g.cs new file mode 100644 index 00000000..72d3aae7 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTierNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageUpscaleNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTierNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageUpscaleNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageUpscaleNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTierExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageUpscaleNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageUpscaleNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageUpscaleNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Ideogram.V2ImageUpscaleNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTierExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazBloom2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazBloom2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.g.cs new file mode 100644 index 00000000..0f390222 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazBloom2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageUpscaleTopazBloom2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactorJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageUpscaleTopazBloom2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageUpscaleTopazBloom2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactorExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageUpscaleTopazBloom2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageUpscaleTopazBloom2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageUpscaleTopazBloom2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Ideogram.V2ImageUpscaleTopazBloom2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactorExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazBloom2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactorNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazBloom2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactorNullable.g.cs new file mode 100644 index 00000000..048552be --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazBloom2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactorNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageUpscaleTopazBloom2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactorNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageUpscaleTopazBloom2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageUpscaleTopazBloom2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactorExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageUpscaleTopazBloom2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageUpscaleTopazBloom2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageUpscaleTopazBloom2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Ideogram.V2ImageUpscaleTopazBloom2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactorExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection.g.cs new file mode 100644 index 00000000..62572ca9 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetectionJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetectionExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Ideogram.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetectionExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetectionNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetectionNullable.g.cs new file mode 100644 index 00000000..74d1e362 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetectionNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetectionNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetectionExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Ideogram.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetectionExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.g.cs new file mode 100644 index 00000000..d0884bdf --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactorJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactorExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Ideogram.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactorExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactorNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactorNullable.g.cs new file mode 100644 index 00000000..c4ac14e2 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactorNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactorNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactorExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Ideogram.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactorExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaSubjectDetection.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaSubjectDetection.g.cs new file mode 100644 index 00000000..001181a0 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaSubjectDetection.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaSubjectDetectionJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaSubjectDetection Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaSubjectDetectionExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaSubjectDetection)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaSubjectDetection); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaSubjectDetection value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Ideogram.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaSubjectDetectionExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaSubjectDetectionNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaSubjectDetectionNullable.g.cs new file mode 100644 index 00000000..5ea13278 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaSubjectDetectionNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaSubjectDetectionNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaSubjectDetection? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaSubjectDetectionExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaSubjectDetection)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaSubjectDetection?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaSubjectDetection? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Ideogram.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaSubjectDetectionExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.g.cs new file mode 100644 index 00000000..38662d44 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactorJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactorExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Ideogram.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactorExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactorNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactorNullable.g.cs new file mode 100644 index 00000000..2eaf4275 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactorNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactorNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactorExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Ideogram.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactorExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection.g.cs new file mode 100644 index 00000000..2d00d86f --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetectionJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetectionExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Ideogram.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetectionExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetectionNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetectionNullable.g.cs new file mode 100644 index 00000000..b3445cb2 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetectionNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetectionNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetectionExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Ideogram.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetectionExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.g.cs new file mode 100644 index 00000000..8213fbe8 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactorJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactorExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Ideogram.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactorExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactorNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactorNullable.g.cs new file mode 100644 index 00000000..0b2e7b37 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactorNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactorNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactorExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Ideogram.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactorExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaEnhancementStrength.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaEnhancementStrength.g.cs new file mode 100644 index 00000000..0e3a74ee --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaEnhancementStrength.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaEnhancementStrengthJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaEnhancementStrength Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaEnhancementStrengthExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaEnhancementStrength)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaEnhancementStrength); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaEnhancementStrength value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Ideogram.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaEnhancementStrengthExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaEnhancementStrengthNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaEnhancementStrengthNullable.g.cs new file mode 100644 index 00000000..ee7ba4bb --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaEnhancementStrengthNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaEnhancementStrengthNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaEnhancementStrength? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaEnhancementStrengthExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaEnhancementStrength)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaEnhancementStrength?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaEnhancementStrength? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Ideogram.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaEnhancementStrengthExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.g.cs new file mode 100644 index 00000000..f0a55e38 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaUpscaleFactorJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaUpscaleFactorExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Ideogram.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaUpscaleFactorExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaUpscaleFactorNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaUpscaleFactorNullable.g.cs new file mode 100644 index 00000000..07e039a0 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaUpscaleFactorNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaUpscaleFactorNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaUpscaleFactorExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Ideogram.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaUpscaleFactorExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage.g.cs new file mode 100644 index 00000000..232015a9 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguageJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguageExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Ideogram.V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguageExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguageNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguageNullable.g.cs new file mode 100644 index 00000000..ed3b4255 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguageNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguageNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguageExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Ideogram.V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguageExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaPlatform.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaPlatform.g.cs new file mode 100644 index 00000000..9f2954c2 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaPlatform.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaPlatformJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaPlatform Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaPlatformExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaPlatform)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaPlatform); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaPlatform value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Ideogram.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaPlatformExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaPlatformNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaPlatformNullable.g.cs new file mode 100644 index 00000000..67690bb1 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaPlatformNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaPlatformNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaPlatform? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaPlatformExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaPlatform)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaPlatform?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaPlatform? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Ideogram.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaPlatformExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.g.cs new file mode 100644 index 00000000..f83661b7 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolutionJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolutionExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Ideogram.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolutionExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolutionNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolutionNullable.g.cs new file mode 100644 index 00000000..b4c0ab30 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolutionNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolutionNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolutionExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Ideogram.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolutionExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ToolAdVariationsPostRequestBodyContentMultipartFormDataSchemaVariationType.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ToolAdVariationsPostRequestBodyContentMultipartFormDataSchemaVariationType.g.cs new file mode 100644 index 00000000..09a01eeb --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ToolAdVariationsPostRequestBodyContentMultipartFormDataSchemaVariationType.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ToolAdVariationsPostRequestBodyContentMultipartFormDataSchemaVariationTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ToolAdVariationsPostRequestBodyContentMultipartFormDataSchemaVariationType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ToolAdVariationsPostRequestBodyContentMultipartFormDataSchemaVariationTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ToolAdVariationsPostRequestBodyContentMultipartFormDataSchemaVariationType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ToolAdVariationsPostRequestBodyContentMultipartFormDataSchemaVariationType); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ToolAdVariationsPostRequestBodyContentMultipartFormDataSchemaVariationType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Ideogram.V2ToolAdVariationsPostRequestBodyContentMultipartFormDataSchemaVariationTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ToolAdVariationsPostRequestBodyContentMultipartFormDataSchemaVariationTypeNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ToolAdVariationsPostRequestBodyContentMultipartFormDataSchemaVariationTypeNullable.g.cs new file mode 100644 index 00000000..be1e439c --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ToolAdVariationsPostRequestBodyContentMultipartFormDataSchemaVariationTypeNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ToolAdVariationsPostRequestBodyContentMultipartFormDataSchemaVariationTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ToolAdVariationsPostRequestBodyContentMultipartFormDataSchemaVariationType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ToolAdVariationsPostRequestBodyContentMultipartFormDataSchemaVariationTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ToolAdVariationsPostRequestBodyContentMultipartFormDataSchemaVariationType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ToolAdVariationsPostRequestBodyContentMultipartFormDataSchemaVariationType?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ToolAdVariationsPostRequestBodyContentMultipartFormDataSchemaVariationType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Ideogram.V2ToolAdVariationsPostRequestBodyContentMultipartFormDataSchemaVariationTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ToolGhostMannequinPostRequestBodyContentMultipartFormDataSchemaView.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ToolGhostMannequinPostRequestBodyContentMultipartFormDataSchemaView.g.cs new file mode 100644 index 00000000..2adabc51 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ToolGhostMannequinPostRequestBodyContentMultipartFormDataSchemaView.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ToolGhostMannequinPostRequestBodyContentMultipartFormDataSchemaViewJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ToolGhostMannequinPostRequestBodyContentMultipartFormDataSchemaView Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ToolGhostMannequinPostRequestBodyContentMultipartFormDataSchemaViewExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ToolGhostMannequinPostRequestBodyContentMultipartFormDataSchemaView)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ToolGhostMannequinPostRequestBodyContentMultipartFormDataSchemaView); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ToolGhostMannequinPostRequestBodyContentMultipartFormDataSchemaView value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Ideogram.V2ToolGhostMannequinPostRequestBodyContentMultipartFormDataSchemaViewExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ToolGhostMannequinPostRequestBodyContentMultipartFormDataSchemaViewNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ToolGhostMannequinPostRequestBodyContentMultipartFormDataSchemaViewNullable.g.cs new file mode 100644 index 00000000..799f5269 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V2ToolGhostMannequinPostRequestBodyContentMultipartFormDataSchemaViewNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class V2ToolGhostMannequinPostRequestBodyContentMultipartFormDataSchemaViewNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.V2ToolGhostMannequinPostRequestBodyContentMultipartFormDataSchemaView? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.V2ToolGhostMannequinPostRequestBodyContentMultipartFormDataSchemaViewExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.V2ToolGhostMannequinPostRequestBodyContentMultipartFormDataSchemaView)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.V2ToolGhostMannequinPostRequestBodyContentMultipartFormDataSchemaView?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.V2ToolGhostMannequinPostRequestBodyContentMultipartFormDataSchemaView? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Ideogram.V2ToolGhostMannequinPostRequestBodyContentMultipartFormDataSchemaViewExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V4PromptElement.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V4PromptElement.g.cs index d2f78496..3f5f87e9 100644 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V4PromptElement.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.V4PromptElement.g.cs @@ -21,18 +21,18 @@ public class V4PromptElementJsonConverter : global::System.Text.Json.Serializati throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Ideogram.V4PromptElementDiscriminator)}"); var discriminator = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, discriminatorTypeInfo); - global::Ideogram.V4ObjPromptElement? obj = default; + global::Ideogram.V4PromptElementVariant1? obj = default; if (discriminator?.Type == global::Ideogram.V4PromptElementDiscriminatorType.Obj) { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Ideogram.V4ObjPromptElement), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Ideogram.V4ObjPromptElement)}"); + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Ideogram.V4PromptElementVariant1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Ideogram.V4PromptElementVariant1)}"); obj = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); } - global::Ideogram.V4TextPromptElement? text = default; + global::Ideogram.V4PromptElementVariant2? text = default; if (discriminator?.Type == global::Ideogram.V4PromptElementDiscriminatorType.Text) { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Ideogram.V4TextPromptElement), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Ideogram.V4TextPromptElement)}"); + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Ideogram.V4PromptElementVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Ideogram.V4PromptElementVariant2)}"); text = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); } @@ -57,14 +57,14 @@ public override void Write( if (value.IsObj) { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Ideogram.V4ObjPromptElement), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Ideogram.V4ObjPromptElement).Name}"); + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Ideogram.V4PromptElementVariant1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Ideogram.V4PromptElementVariant1).Name}"); global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickObj(), typeInfo); } else if (value.IsText) { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Ideogram.V4TextPromptElement), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Ideogram.V4TextPromptElement).Name}"); + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Ideogram.V4PromptElementVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Ideogram.V4PromptElementVariant2).Name}"); global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickText(), typeInfo); } } diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.VectorizerRequestMode.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.VectorizerRequestMode.g.cs deleted file mode 100644 index b32e9cee..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.VectorizerRequestMode.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class VectorizerRequestModeJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.VectorizerRequestMode Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.VectorizerRequestModeExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.VectorizerRequestMode)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.VectorizerRequestMode); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.VectorizerRequestMode value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.VectorizerRequestModeExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.VectorizerRequestModeNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.VectorizerRequestModeNullable.g.cs deleted file mode 100644 index b5b9f5bc..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.VectorizerRequestModeNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class VectorizerRequestModeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.VectorizerRequestMode? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.VectorizerRequestModeExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.VectorizerRequestMode)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.VectorizerRequestMode?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.VectorizerRequestMode? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.VectorizerRequestModeExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.VideoObjectObjectType.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.VideoObjectObjectType.g.cs deleted file mode 100644 index a806e40f..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.VideoObjectObjectType.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class VideoObjectObjectTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.VideoObjectObjectType Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.VideoObjectObjectTypeExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.VideoObjectObjectType)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.VideoObjectObjectType); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.VideoObjectObjectType value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::Ideogram.VideoObjectObjectTypeExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.VideoObjectObjectTypeNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.VideoObjectObjectTypeNullable.g.cs deleted file mode 100644 index affd829c..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.VideoObjectObjectTypeNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace Ideogram.JsonConverters -{ - /// - public sealed class VideoObjectObjectTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Ideogram.VideoObjectObjectType? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::Ideogram.VideoObjectObjectTypeExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::Ideogram.VideoObjectObjectType)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::Ideogram.VideoObjectObjectType?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Ideogram.VideoObjectObjectType? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::Ideogram.VideoObjectObjectTypeExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonSerializerContext.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonSerializerContext.g.cs index 6572e4fa..51272205 100644 --- a/src/libs/Ideogram/Generated/Ideogram.JsonSerializerContext.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.JsonSerializerContext.g.cs @@ -6,3816 +6,802 @@ namespace Ideogram /// /// /// + #pragma warning disable CS3016 // Converter type array in this attribute is not CLS-compliant. [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull - )] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PriceQuote))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PriceQuoteObject), TypeInfoPropertyName = "PriceQuoteObject2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(long))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PriceQualifier), TypeInfoPropertyName = "PriceQualifier2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LayerizedTextBlock), TypeInfoPropertyName = "LayerizedTextBlock2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DetectedTextBlock))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LayerizedTextBlockVariant2))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TextColorSpan))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageRequestV4))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4JsonPrompt))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ResolutionV4), TypeInfoPropertyName = "ResolutionV42")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RenderingSpeed), TypeInfoPropertyName = "RenderingSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.OutputResolution), TypeInfoPropertyName = "OutputResolution2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RenderingSpeedV4), TypeInfoPropertyName = "RenderingSpeedV42")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateTransparentImageRequestV4))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AspectRatioV4), TypeInfoPropertyName = "AspectRatioV42")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageRequestV4Fp8))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageRequestV4CfgDistilled))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageRequestPImage))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MagicPromptOption), TypeInfoPropertyName = "MagicPromptOption2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PImageResolution), TypeInfoPropertyName = "PImageResolution2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageRequestPImageIdeogram))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.Quality), TypeInfoPropertyName = "Quality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AspectRatioV3), TypeInfoPropertyName = "AspectRatioV32")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageRequestV4Stable))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageRequestV4StableVersion), TypeInfoPropertyName = "GenerateImageRequestV4StableVersion2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageRequestZImage))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageRequestFlux2Klein))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageRequestFlux2KleinBase))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageRequestErnie))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageRequestV4Im2Im))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(byte[]))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ResolutionV4ImageToImage), TypeInfoPropertyName = "ResolutionV4ImageToImage2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemixImageRequestV4))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateDesignRequestV4))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ResolutionV4Layout), TypeInfoPropertyName = "ResolutionV4Layout2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateDesignRequestV4InspirationReferenceModel), TypeInfoPropertyName = "GenerateDesignRequestV4InspirationReferenceModel2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateDesignRequestV4ArtifactGenerationModel), TypeInfoPropertyName = "GenerateDesignRequestV4ArtifactGenerationModel2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateDesignRequestV4Layout2imageVariant), TypeInfoPropertyName = "GenerateDesignRequestV4Layout2imageVariant2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateDesignRequestV4ResponseType), TypeInfoPropertyName = "GenerateDesignRequestV4ResponseType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DescribeResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.Description))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DescribeRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DescribeModelVersion), TypeInfoPropertyName = "DescribeModelVersion2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DescribeRequestV4))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DescribeResponseV4))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.EditImageRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ModelEnum), TypeInfoPropertyName = "ModelEnum2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.StyleType), TypeInfoPropertyName = "StyleType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImageRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageRequestV3))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ResolutionV3), TypeInfoPropertyName = "ResolutionV32")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ColorPaletteWithPresetNameOrMembers), TypeInfoPropertyName = "ColorPaletteWithPresetNameOrMembers2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.StyleTypeV3), TypeInfoPropertyName = "StyleTypeV32")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.StylePresetV3), TypeInfoPropertyName = "StylePresetV32")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateGraphicRequestV3))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateDesignRequestV3))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LayerizeDesignRequestV3))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateTransparentImageRequestV3))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleFactor), TypeInfoPropertyName = "UpscaleFactor2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemixImageRequestV3))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.EditImageRequestV3))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V1EditImagesRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TransparencyOption), TypeInfoPropertyName = "TransparencyOption2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AspectRatioEditLite), TypeInfoPropertyName = "AspectRatioEditLite2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V1EditLiteImagesRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TryOnRequestV3))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReframeImageRequestV3))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReplaceBackgroundRequestV3))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemoveBackgroundRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemoveBackgroundResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemoveBackgroundImageObject))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemoveObjectRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(float))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SnapMaskRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemoveObjectResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemoveObjectImageObject))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.InternalTestingRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.InternalTestingNestedObject))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.InternalTestingNestedObjectRequiredFields))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.InternalTestingEnumField), TypeInfoPropertyName = "InternalTestingEnumField2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemixImageRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.InitialImageRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReframeImageRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.Resolution), TypeInfoPropertyName = "Resolution2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleInitialImageRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AspectRatio), TypeInfoPropertyName = "AspectRatio2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MagicPromptVersionEnum), TypeInfoPropertyName = "MagicPromptVersionEnum2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImageObject))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImageGenerationResponseV3))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImageGenerationObjectV3))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V1EditImagesResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V1EditImageObject))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImageGenerationResponseV4))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImageGenerationResponseV4ResponseType), TypeInfoPropertyName = "ImageGenerationResponseV4ResponseType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImageGenerationObjectV4))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AsyncImageGenerationResponseV4))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponseStatus), TypeInfoPropertyName = "GenerationResponseStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponseResponseType), TypeInfoPropertyName = "GenerationResponseResponseType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponseDataInner), TypeInfoPropertyName = "GenerationResponseDataInner2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImageObjectWithoutPromptOrSeed))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImageObjectWithoutPromptOrSeedObjectType), TypeInfoPropertyName = "ImageObjectWithoutPromptOrSeedObjectType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImageGenerationObject))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImageGenerationObjectObjectType), TypeInfoPropertyName = "ImageGenerationObjectObjectType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImageGenerationResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImageGenerationResponseV4ImageToImage))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImageGenerationResponseV4ImageToImageResponseType), TypeInfoPropertyName = "ImageGenerationResponseV4ImageToImageResponseType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImageGenerationObjectV4ImageToImage))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImageGenerationResponseV4Layout))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImageGenerationResponseV4LayoutResponseType), TypeInfoPropertyName = "ImageGenerationResponseV4LayoutResponseType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImageGenerationObjectV4Layout))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LayeredImageGenerationObjectV3))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TextContainerV3))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImageLayerV3))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LayeredImageGenerationResponseV3))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LayeredImageGenerationResponseV3ResponseType), TypeInfoPropertyName = "LayeredImageGenerationResponseV3ResponseType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageSafetyError))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MagicPromptRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MagicPromptRequestMessagesInner))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MagicPromptResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MagicPromptV4Request))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MagicPromptV4Response))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.InternalBatchRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SamplingRequestParams))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.InternalBatchResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TextSpanV3))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TextSpanV3FontFxItem), TypeInfoPropertyName = "TextSpanV3FontFxItem2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TextItemV3))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TextItemV3Alignment), TypeInfoPropertyName = "TextItemV3Alignment2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TextItemV3StyleClass), TypeInfoPropertyName = "TextItemV3StyleClass2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TextItemV3GlyphType), TypeInfoPropertyName = "TextItemV3GlyphType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TextItemV3TextTransform), TypeInfoPropertyName = "TextItemV3TextTransform2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TextItemV3VerticalAlignment), TypeInfoPropertyName = "TextItemV3VerticalAlignment2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LayeredAssetTextShadow))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LayerizeLogosRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LayerizeLogosResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LayerizeTextRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LayerizeTextResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.InternalBatchResultsResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.InternalBatchResultsResponseResultsInner))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AssetReferenceUsageResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AssetReferenceUsageItem))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AssetIdentifier))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AttributeInfo))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateVideoSeedDance2Response))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateVideoSeedDance2TextToVideoRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SeedDance2AspectRatio), TypeInfoPropertyName = "SeedDance2AspectRatio2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SeedDance2Resolution), TypeInfoPropertyName = "SeedDance2Resolution2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationErrorResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationRejectReason), TypeInfoPropertyName = "GenerationRejectReason2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed), TypeInfoPropertyName = "GenerationErrorResponseTaskCompletionSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateVideoSeedDance2ImageToVideoRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateVideoSeedDance25Response))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateVideoSeedDance25TextToVideoRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SeedDance25Resolution), TypeInfoPropertyName = "SeedDance25Resolution2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateVideoSeedDance25ImageToVideoRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateVideoMinimaxH3TextToVideoRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MinimaxH3AspectRatio), TypeInfoPropertyName = "MinimaxH3AspectRatio2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MinimaxH3Resolution), TypeInfoPropertyName = "MinimaxH3Resolution2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateVideoMinimaxH3Response))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateVideoMinimaxH3ImageToVideoRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateVideoKlingV3Response))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateVideoKlingV3StandardTextToVideoRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.KlingV3AspectRatio), TypeInfoPropertyName = "KlingV3AspectRatio2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.KlingV3ShotType), TypeInfoPropertyName = "KlingV3ShotType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateVideoKlingV3StandardImageToVideoRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateVideoSeedDance2ReferenceToVideoRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateVideoSeedDance25ReferenceToVideoRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.EditVideoMinimaxH3ReferenceToVideoRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MinimaxH3PromptExpansionMode), TypeInfoPropertyName = "MinimaxH3PromptExpansionMode2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.EditVideoSeedDance2Request))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemoveObjectFromV2AssetsResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemoveObjectFromV2AssetsRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemoveBackgroundV2Response))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.BackgroundRemovedImageObject))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemoveBackgroundV2Request))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemoveBackgroundV2AssetRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReplaceBackgroundResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReplaceBackgroundRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReplaceBackgroundQuality), TypeInfoPropertyName = "ReplaceBackgroundQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReplaceBackgroundIdeogramV3Request))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReplaceBackgroundIdeogramV3RequestRenderingSpeed), TypeInfoPropertyName = "ReplaceBackgroundIdeogramV3RequestRenderingSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReplaceBackgroundIdeogram45Request))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ListAccountApiKeysResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AccountApiKey))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AccountApiKeyStatus), TypeInfoPropertyName = "AccountApiKeyStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GetAccountUsageResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AccountUsageBucket))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AccountUsageLineItem))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AccountUsageLineItemSource), TypeInfoPropertyName = "AccountUsageLineItemSource2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AccountUsageApiKey))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AccountUsageBilledUnits))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ListAccountInvoicesResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AccountInvoice))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AccountInvoiceStatus), TypeInfoPropertyName = "AccountInvoiceStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AccountInvoiceLineItem))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageTopazTextRefineResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageObject))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageTopazTextRefineRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageTopazTextRefineRequestUpscaleFactor), TypeInfoPropertyName = "UpscaleImageTopazTextRefineRequestUpscaleFactor2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageTopazTextRefineRequestSubjectDetection), TypeInfoPropertyName = "UpscaleImageTopazTextRefineRequestSubjectDetection2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageTopazWonder35Response))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageTopazWonder35Request))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageTopazWonder35RequestUpscaleFactor), TypeInfoPropertyName = "UpscaleImageTopazWonder35RequestUpscaleFactor2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageTopazWonder35RequestEnhancementStrength), TypeInfoPropertyName = "UpscaleImageTopazWonder35RequestEnhancementStrength2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageTopazStandardV2Response))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageTopazStandardV2Request))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageTopazStandardV2RequestUpscaleFactor), TypeInfoPropertyName = "UpscaleImageTopazStandardV2RequestUpscaleFactor2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageTopazStandardV2RequestSubjectDetection), TypeInfoPropertyName = "UpscaleImageTopazStandardV2RequestSubjectDetection2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageTopazBloom2Response))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageTopazBloom2Request))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageTopazBloom2RequestUpscaleFactor), TypeInfoPropertyName = "UpscaleImageTopazBloom2RequestUpscaleFactor2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageTopazRedefineResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageTopazRedefineRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageTopazRedefineRequestUpscaleFactor), TypeInfoPropertyName = "UpscaleImageTopazRedefineRequestUpscaleFactor2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageTopazRedefineRequestSubjectDetection), TypeInfoPropertyName = "UpscaleImageTopazRedefineRequestSubjectDetection2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageNanoBananaProResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageNanoBananaProRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageNanoBananaProRequestResolutionTier), TypeInfoPropertyName = "UpscaleImageNanoBananaProRequestResolutionTier2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LookbookResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LookbookRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LookbookRequestCategory), TypeInfoPropertyName = "LookbookRequestCategory2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ModelPoseVariantsResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ModelPoseVariantsRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ModelPoseVariantsQuality), TypeInfoPropertyName = "ModelPoseVariantsQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PackshotsResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PackshotsRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PackshotView), TypeInfoPropertyName = "PackshotView2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PackshotsQuality), TypeInfoPropertyName = "PackshotsQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GhostMannequinResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GhostMannequinRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GhostMannequinRequestView), TypeInfoPropertyName = "GhostMannequinRequestView2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GhostMannequinQuality), TypeInfoPropertyName = "GhostMannequinQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.Product360VideoRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.Product360VideoDirection), TypeInfoPropertyName = "Product360VideoDirection2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LivingImageResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LivingImageRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LivingImageQuality), TypeInfoPropertyName = "LivingImageQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PreciseMaskedEditResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PreciseMaskedEditRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PreciseMaskedEditModel), TypeInfoPropertyName = "PreciseMaskedEditModel2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PreciseMaskedEditQuality), TypeInfoPropertyName = "PreciseMaskedEditQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.VirtualTryOnResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.VirtualTryOnRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ColorwaysResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ColorwaysRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ColorwaysQuality), TypeInfoPropertyName = "ColorwaysQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AdLocalizerResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AdLocalizerRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AdLocalizerRequestLanguage), TypeInfoPropertyName = "AdLocalizerRequestLanguage2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AdLocalizerQuality), TypeInfoPropertyName = "AdLocalizerQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.VectorizerResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.VectorizerRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.VectorizerRequestMode), TypeInfoPropertyName = "VectorizerRequestMode2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TextLayerizerResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TextLayerizerRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AdResizerResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AdResizerRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AdResizerRequestResolution), TypeInfoPropertyName = "AdResizerRequestResolution2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AdResizerRequestPlatform), TypeInfoPropertyName = "AdResizerRequestPlatform2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AdResizerQuality), TypeInfoPropertyName = "AdResizerQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AdVariationsResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AdVariationsRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AdVariationsRequestVariationType), TypeInfoPropertyName = "AdVariationsRequestVariationType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AdVariationsQuality), TypeInfoPropertyName = "AdVariationsQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SketchToRenderResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SketchToRenderRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SketchToRenderQuality), TypeInfoPropertyName = "SketchToRenderQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SoleSwapResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SoleSwapRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SoleSwapRequestBaseGenerationSize), TypeInfoPropertyName = "SoleSwapRequestBaseGenerationSize2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SoleSwapQuality), TypeInfoPropertyName = "SoleSwapQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SwapProductResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SwapProductRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SwapProductMode), TypeInfoPropertyName = "SwapProductMode2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SwapProductQuality), TypeInfoPropertyName = "SwapProductQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SkechersStyleEditResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SkechersStyleEditRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SkechersStyleEditRequestAspectRatio), TypeInfoPropertyName = "SkechersStyleEditRequestAspectRatio2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SkechersStyleEditRequestBaseGenerationSize), TypeInfoPropertyName = "SkechersStyleEditRequestBaseGenerationSize2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SkechersStyleEditQuality), TypeInfoPropertyName = "SkechersStyleEditQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SwanSLogoDesignResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SwanSLogoDesignRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SwanSLogoDesignRequestLogoStyle), TypeInfoPropertyName = "SwanSLogoDesignRequestLogoStyle2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SwanSLogoDesignRequestSourceMode), TypeInfoPropertyName = "SwanSLogoDesignRequestSourceMode2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SwanSLogoDesignRequestDesignVariant), TypeInfoPropertyName = "SwanSLogoDesignRequestDesignVariant2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SwanSLogoQuality), TypeInfoPropertyName = "SwanSLogoQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SwanSLogoInstallResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SwanSLogoInstallRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SwanSLogoInstallRequestLogoStyle), TypeInfoPropertyName = "SwanSLogoInstallRequestLogoStyle2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ModelSwapResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ModelSwapRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ModelSwapQuality), TypeInfoPropertyName = "ModelSwapQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MaterialSwapResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MaterialSwapRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MaterialSwapQuality), TypeInfoPropertyName = "MaterialSwapQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleToolResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleToolRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleToolRequestUpscaleFactor), TypeInfoPropertyName = "UpscaleToolRequestUpscaleFactor2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LayerizeDesignIdeogramV3Response))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LayerizedImageObject))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LayerizedImageObjectObjectType), TypeInfoPropertyName = "LayerizedImageObjectObjectType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LayerizeDesignIdeogramV3Request))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DescribeImageIdeogramV3Response))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GeneratedDescription))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DescribeImageIdeogramV3Request))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImageSafetyError))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DescribeImageIdeogramV4Response))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DescribeImageIdeogramV4Request))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV3Response))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GeneratedImageObject))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV3Request))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramV3AspectRatio), TypeInfoPropertyName = "IdeogramV3AspectRatio2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV3RequestRenderingSpeed), TypeInfoPropertyName = "GenerateImageIdeogramV3RequestRenderingSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MagicPromptMode), TypeInfoPropertyName = "MagicPromptMode2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramColorPalette), TypeInfoPropertyName = "IdeogramColorPalette2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramV3StyleType), TypeInfoPropertyName = "IdeogramV3StyleType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramV3StylePreset), TypeInfoPropertyName = "IdeogramV3StylePreset2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV3CustomModelResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV3CustomModelRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV3CustomModelRequestRenderingSpeed), TypeInfoPropertyName = "GenerateImageIdeogramV3CustomModelRequestRenderingSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV4Response))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV4Request))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV4RequestRenderingSpeed), TypeInfoPropertyName = "GenerateImageIdeogramV4RequestRenderingSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV4CustomModelResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV4CustomModelRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.StackedCustomModel))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV4CustomModelRequestRenderingSpeed), TypeInfoPropertyName = "GenerateImageIdeogramV4CustomModelRequestRenderingSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemixImageIdeogramV3Response))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemixedImageObject))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemixImageIdeogramV3Request))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemixImageIdeogramV3RequestRenderingSpeed), TypeInfoPropertyName = "RemixImageIdeogramV3RequestRenderingSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemixImageIdeogramV3CustomModelResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemixImageIdeogramV3CustomModelRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemixImageIdeogramV3CustomModelRequestRenderingSpeed), TypeInfoPropertyName = "RemixImageIdeogramV3CustomModelRequestRenderingSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemixImageIdeogramV4Response))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemixImageIdeogramV4Request))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemixImageIdeogramV4RequestRenderingSpeed), TypeInfoPropertyName = "RemixImageIdeogramV4RequestRenderingSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemixImageIdeogramV3CharacterResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemixImageIdeogramV3CharacterRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemixImageIdeogramV3CharacterRequestRenderingSpeed), TypeInfoPropertyName = "RemixImageIdeogramV3CharacterRequestRenderingSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemixImageIdeogramV3CharacterRequestStyleType), TypeInfoPropertyName = "RemixImageIdeogramV3CharacterRequestStyleType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV3TransparentResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV3TransparentRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV3TransparentRequestUpscaleFactor), TypeInfoPropertyName = "GenerateImageIdeogramV3TransparentRequestUpscaleFactor2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV3TransparentRequestRenderingSpeed), TypeInfoPropertyName = "GenerateImageIdeogramV3TransparentRequestRenderingSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV4TransparentResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV4TransparentRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramV4AspectRatio), TypeInfoPropertyName = "IdeogramV4AspectRatio2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV4TransparentRequestOutputResolution), TypeInfoPropertyName = "GenerateImageIdeogramV4TransparentRequestOutputResolution2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV4TransparentRequestRenderingSpeed), TypeInfoPropertyName = "GenerateImageIdeogramV4TransparentRequestRenderingSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImagePImageIdeogramResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImagePImageIdeogramRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationQuality), TypeInfoPropertyName = "GenerationQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImagePImageIdeogramRequestResolution), TypeInfoPropertyName = "GenerateImagePImageIdeogramRequestResolution2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageZImageResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageZImageRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogram45Response))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationKind), TypeInfoPropertyName = "GenerationKind2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogram45Request))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogram45RequestBackground), TypeInfoPropertyName = "GenerateImageIdeogram45RequestBackground2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogram45RequestQuality), TypeInfoPropertyName = "GenerateImageIdeogram45RequestQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PreciseEditImageIdeogram45Response))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PreciseEditImageIdeogram45Request))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PreciseEditImageIdeogram45RequestQuality), TypeInfoPropertyName = "PreciseEditImageIdeogram45RequestQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageNanoBanana2Response))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageNanoBanana2Request))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.NanoBanana2AspectRatio), TypeInfoPropertyName = "NanoBanana2AspectRatio2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageNanoBanana2RequestResolutionTier), TypeInfoPropertyName = "GenerateImageNanoBanana2RequestResolutionTier2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageNanoBanana21Response))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageNanoBanana21Request))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.NanoBanana21AspectRatio), TypeInfoPropertyName = "NanoBanana21AspectRatio2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageNanoBanana21RequestResolutionTier), TypeInfoPropertyName = "GenerateImageNanoBanana21RequestResolutionTier2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageNanoBananaProResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageNanoBananaProRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.NanoBananaProAspectRatio), TypeInfoPropertyName = "NanoBananaProAspectRatio2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageNanoBananaProRequestResolutionTier), TypeInfoPropertyName = "GenerateImageNanoBananaProRequestResolutionTier2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageGptImage2Response))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageGptImage2Request))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageGptImage25FlareResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageGptImage25FlareRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageGptImage25FlareRequestBackground), TypeInfoPropertyName = "GenerateImageGptImage25FlareRequestBackground2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageGptImage25FlareRequestQuality), TypeInfoPropertyName = "GenerateImageGptImage25FlareRequestQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageGptImage25SunburstResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageGptImage25SunburstRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageGptImage25SunburstRequestBackground), TypeInfoPropertyName = "GenerateImageGptImage25SunburstRequestBackground2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageGptImage25SunburstRequestQuality), TypeInfoPropertyName = "GenerateImageGptImage25SunburstRequestQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV2Response))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV2Request))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV2RequestRenderingSpeed), TypeInfoPropertyName = "GenerateImageIdeogramV2RequestRenderingSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramV2StyleType), TypeInfoPropertyName = "IdeogramV2StyleType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV2AResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV2ARequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV2ARequestRenderingSpeed), TypeInfoPropertyName = "GenerateImageIdeogramV2ARequestRenderingSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.InpaintImageIdeogramV3Response))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.InpaintedImageObject))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.InpaintImageIdeogramV3Request))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.InpaintImageIdeogramV3RequestRenderingSpeed), TypeInfoPropertyName = "InpaintImageIdeogramV3RequestRenderingSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.InpaintImageIdeogramV3CustomModelResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.InpaintImageIdeogramV3CustomModelRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.InpaintImageIdeogramV3CustomModelRequestRenderingSpeed), TypeInfoPropertyName = "InpaintImageIdeogramV3CustomModelRequestRenderingSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReframeImageIdeogramV3Response))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReframeImageIdeogramV3Request))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReframeImageIdeogramV3RequestRenderingSpeed), TypeInfoPropertyName = "ReframeImageIdeogramV3RequestRenderingSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReframeImageNanoBanana2Response))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReframeImageNanoBanana2Request))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.NanoBanana2ReframeAspectRatio), TypeInfoPropertyName = "NanoBanana2ReframeAspectRatio2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReframeImageNanoBananaProResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReframeImageNanoBananaProRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.NanoBananaProReframeAspectRatio), TypeInfoPropertyName = "NanoBananaProReframeAspectRatio2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReframeImageNanoBananaProRequestResolutionTier), TypeInfoPropertyName = "ReframeImageNanoBananaProRequestResolutionTier2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReframeImageGptImage25FlareResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReframeImageGptImage25FlareRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReframeImageGptImage25FlareRequestQuality), TypeInfoPropertyName = "ReframeImageGptImage25FlareRequestQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReframeImageBriaExpandResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReframeImageBriaExpandRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReframeImageAutoResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReframeImageAutoRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV3CharacterResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV3CharacterRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV3CharacterRequestRenderingSpeed), TypeInfoPropertyName = "GenerateImageIdeogramV3CharacterRequestRenderingSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV3CharacterRequestStyleType), TypeInfoPropertyName = "GenerateImageIdeogramV3CharacterRequestStyleType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.InpaintImageIdeogramV3CharacterResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.InpaintImageIdeogramV3CharacterRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.InpaintImageIdeogramV3CharacterRequestRenderingSpeed), TypeInfoPropertyName = "InpaintImageIdeogramV3CharacterRequestRenderingSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.InpaintImageIdeogramV3CharacterRequestStyleType), TypeInfoPropertyName = "InpaintImageIdeogramV3CharacterRequestStyleType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageV2AutoResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageV2AutoRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageV2AutoRequestResolutionTier), TypeInfoPropertyName = "GenerateImageV2AutoRequestResolutionTier2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ToolRemixResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ToolRemixRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ToolRemixRequestResolutionTier), TypeInfoPropertyName = "ToolRemixRequestResolutionTier2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ResizeAdImageRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ResizeAdImageRequestResolution), TypeInfoPropertyName = "ResizeAdImageRequestResolution2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ResizeAdImageQuality), TypeInfoPropertyName = "ResizeAdImageQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.WebhookSigningJwks))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.WebhookSigningJwk))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ProvenanceVerifyResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ProvenanceVerifyResponseValidationState), TypeInfoPropertyName = "ProvenanceVerifyResponseValidationState2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ProvenanceVerifyRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ManageApiSubscriptionResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MetronomeLinks))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RechargeSettingsResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.Price))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RechargeSettings))] - internal sealed partial class SourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext - { - } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull - )] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PostApiSubscriptionResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PostApiSubscriptionError))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PostApiSubscriptionRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ManageApiCreditSummaryResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.CreditGrant))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GetApiKeysResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RedactedApiKey))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PostApiKeyResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.CreateApiKeyRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ApiProfileApiKey))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ApiKeyStatus), TypeInfoPropertyName = "ApiKeyStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PatchApiKeyRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ManageApiStripeSubscriptionResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ManageApiPaymentResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GetApiTermsResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ApiTerms))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PostApiTermsRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PostAddCreditsResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PostAddCreditsError))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PostAddCreditsRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GetUserCreditsResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SpendCommitInfoResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SpendCommitInfo))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GetUsageInfoResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UsageSegment))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ToolUsage))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ToolType), TypeInfoPropertyName = "ToolType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ModelVersion), TypeInfoPropertyName = "ModelVersion2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SegmentBy), TypeInfoPropertyName = "SegmentBy2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UsageSource), TypeInfoPropertyName = "UsageSource2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GetApiProfilesResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ApiProfile))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ApiProfileType), TypeInfoPropertyName = "ApiProfileType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ApiProfileRole), TypeInfoPropertyName = "ApiProfileRole2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpdateOrganizationApiPropertiesResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpdateOrganizationApiPropertiesRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GetApiOrganizationUserSuggestionsResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ApiOrganizationUserSuggestion))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GetOrganizationMembersResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.OrganizationMember))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.CreateApiKeyResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GetApiKeysV2Response))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.OrganizationMemberOperationResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.OrganizationMemberOperationResult))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AddOrganizationMembersRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LiteOrganizationMember))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemoveOrganizationMembersRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PromoteOrganizationAdminsRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DemoteOrganizationAdminsRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.CancelOrganizationInviteRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ResendOrganizationInviteRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ListOrganizationInvoicesResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.Invoice))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.InvoiceStatus), TypeInfoPropertyName = "InvoiceStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.InvoiceLineItem))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GetOrganizationBillingPortalResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ListDatasetsResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.Dataset))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.CreateDatasetRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GetDatasetResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DatasetFile))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UploadDatasetAssetsResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DatasetUploadSucceededAsset))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DatasetUploadFailedAsset))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DatasetAssetFailureReason), TypeInfoPropertyName = "DatasetAssetFailureReason2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UploadDatasetAssetsRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TrainDatasetModelResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TrainDatasetModelRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ListModelsResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.CustomModel))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ModelStatus), TypeInfoPropertyName = "ModelStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TrainingRun))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TrainingRunStatus), TypeInfoPropertyName = "TrainingRunStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GetModelResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TrainModelV3Request))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TrainModelV3AdvancedRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TrainModelV4Request))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TrainModelV4AdvancedRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PublishMiniAppResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PublishMiniAppRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PublishMiniAppRequestEmbed), TypeInfoPropertyName = "PublishMiniAppRequestEmbed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MiniAppArtwork))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PublishMiniAppPreviewResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PublishMiniAppPreviewRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PublishMiniAppPreviewRequestEmbed), TypeInfoPropertyName = "PublishMiniAppPreviewRequestEmbed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UnpublishMiniAppPreviewResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GetStaleMiniAppPreviewsResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MiniAppMarketingProjectionEntry))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MiniAppMarketingProjectionEntryEmbed), TypeInfoPropertyName = "MiniAppMarketingProjectionEntryEmbed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GetIntegrationsResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IntegrationType), TypeInfoPropertyName = "IntegrationType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IntegrationErrorResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IntegrationErrorResponseError), TypeInfoPropertyName = "IntegrationErrorResponseError2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IntegrationAssetSearchResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IntegrationAsset))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IntegrationAssetDelivery))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IntegrationAssetSearchRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4StyleDescription))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4CompositionalDeconstruction))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4PromptElement), TypeInfoPropertyName = "V4PromptElement2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4ObjPromptElement))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4TextPromptElement))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4PromptElementDiscriminator))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4PromptElementDiscriminatorType), TypeInfoPropertyName = "V4PromptElementDiscriminatorType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4ObjPromptElementType), TypeInfoPropertyName = "V4ObjPromptElementType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4TextPromptElementType), TypeInfoPropertyName = "V4TextPromptElementType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ColorPaletteWithPresetName))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ColorPaletteWithMembers))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ColorPalettePresetName), TypeInfoPropertyName = "ColorPalettePresetName2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ColorPaletteMember))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SvgGenerationObject))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SvgGenerationObjectObjectType), TypeInfoPropertyName = "SvgGenerationObjectObjectType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SvgGenerationObjectMimeType), TypeInfoPropertyName = "SvgGenerationObjectMimeType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.VideoObject))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.VideoObjectObjectType), TypeInfoPropertyName = "VideoObjectObjectType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TextLayerizerResultObject))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TextLayerizerResultObjectObjectType), TypeInfoPropertyName = "TextLayerizerResultObjectObjectType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DetectedTextBlockAlignment), TypeInfoPropertyName = "DetectedTextBlockAlignment2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DetectedTextBlockFormattingItem), TypeInfoPropertyName = "DetectedTextBlockFormattingItem2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DetectedTextBlockRole), TypeInfoPropertyName = "DetectedTextBlockRole2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AssetType), TypeInfoPropertyName = "AssetType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AttributeValueType), TypeInfoPropertyName = "AttributeValueType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramColorPaletteWithPresetName))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramColorPalettePresetName), TypeInfoPropertyName = "IdeogramColorPalettePresetName2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PostGenerateDesignV4200Response), TypeInfoPropertyName = "PostGenerateDesignV4200Response2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PostGenerateDesignV4200ResponseDiscriminator))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PostGenerateDesignV4200ResponseDiscriminatorResponseType), TypeInfoPropertyName = "PostGenerateDesignV4200ResponseDiscriminatorResponseType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PostInternalTesting200Response))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponseDataInnerDiscriminator))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponseDataInnerDiscriminatorObjectType), TypeInfoPropertyName = "GenerationResponseDataInnerDiscriminatorObjectType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MagicPromptRequestMessagesInnerRole), TypeInfoPropertyName = "MagicPromptRequestMessagesInnerRole2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DatasetCoverAssetIdentifier), TypeInfoPropertyName = "DatasetCoverAssetIdentifier2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ListCustomModelsScope), TypeInfoPropertyName = "ListCustomModelsScope2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GetAccountUsageBucketWidth), TypeInfoPropertyName = "GetAccountUsageBucketWidth2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GetAccountUsageSource), TypeInfoPropertyName = "GetAccountUsageSource2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PriceQuoteObject?), TypeInfoPropertyName = "NullablePriceQuoteObject2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(long?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PriceQualifier?), TypeInfoPropertyName = "NullablePriceQualifier2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LayerizedTextBlock?), TypeInfoPropertyName = "NullableLayerizedTextBlock2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ResolutionV4?), TypeInfoPropertyName = "NullableResolutionV42")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RenderingSpeed?), TypeInfoPropertyName = "NullableRenderingSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.OutputResolution?), TypeInfoPropertyName = "NullableOutputResolution2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RenderingSpeedV4?), TypeInfoPropertyName = "NullableRenderingSpeedV42")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AspectRatioV4?), TypeInfoPropertyName = "NullableAspectRatioV42")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MagicPromptOption?), TypeInfoPropertyName = "NullableMagicPromptOption2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PImageResolution?), TypeInfoPropertyName = "NullablePImageResolution2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.Quality?), TypeInfoPropertyName = "NullableQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AspectRatioV3?), TypeInfoPropertyName = "NullableAspectRatioV32")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageRequestV4StableVersion?), TypeInfoPropertyName = "NullableGenerateImageRequestV4StableVersion2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ResolutionV4ImageToImage?), TypeInfoPropertyName = "NullableResolutionV4ImageToImage2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ResolutionV4Layout?), TypeInfoPropertyName = "NullableResolutionV4Layout2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateDesignRequestV4InspirationReferenceModel?), TypeInfoPropertyName = "NullableGenerateDesignRequestV4InspirationReferenceModel2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateDesignRequestV4ArtifactGenerationModel?), TypeInfoPropertyName = "NullableGenerateDesignRequestV4ArtifactGenerationModel2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateDesignRequestV4Layout2imageVariant?), TypeInfoPropertyName = "NullableGenerateDesignRequestV4Layout2imageVariant2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateDesignRequestV4ResponseType?), TypeInfoPropertyName = "NullableGenerateDesignRequestV4ResponseType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DescribeModelVersion?), TypeInfoPropertyName = "NullableDescribeModelVersion2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ModelEnum?), TypeInfoPropertyName = "NullableModelEnum2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.StyleType?), TypeInfoPropertyName = "NullableStyleType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ResolutionV3?), TypeInfoPropertyName = "NullableResolutionV32")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ColorPaletteWithPresetNameOrMembers?), TypeInfoPropertyName = "NullableColorPaletteWithPresetNameOrMembers2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.StyleTypeV3?), TypeInfoPropertyName = "NullableStyleTypeV32")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.StylePresetV3?), TypeInfoPropertyName = "NullableStylePresetV32")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleFactor?), TypeInfoPropertyName = "NullableUpscaleFactor2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TransparencyOption?), TypeInfoPropertyName = "NullableTransparencyOption2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AspectRatioEditLite?), TypeInfoPropertyName = "NullableAspectRatioEditLite2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(float?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.InternalTestingEnumField?), TypeInfoPropertyName = "NullableInternalTestingEnumField2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.Resolution?), TypeInfoPropertyName = "NullableResolution2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AspectRatio?), TypeInfoPropertyName = "NullableAspectRatio2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MagicPromptVersionEnum?), TypeInfoPropertyName = "NullableMagicPromptVersionEnum2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImageGenerationResponseV4ResponseType?), TypeInfoPropertyName = "NullableImageGenerationResponseV4ResponseType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponseStatus?), TypeInfoPropertyName = "NullableGenerationResponseStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponseResponseType?), TypeInfoPropertyName = "NullableGenerationResponseResponseType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponseDataInner?), TypeInfoPropertyName = "NullableGenerationResponseDataInner2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImageObjectWithoutPromptOrSeedObjectType?), TypeInfoPropertyName = "NullableImageObjectWithoutPromptOrSeedObjectType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImageGenerationObjectObjectType?), TypeInfoPropertyName = "NullableImageGenerationObjectObjectType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImageGenerationResponseV4ImageToImageResponseType?), TypeInfoPropertyName = "NullableImageGenerationResponseV4ImageToImageResponseType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImageGenerationResponseV4LayoutResponseType?), TypeInfoPropertyName = "NullableImageGenerationResponseV4LayoutResponseType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LayeredImageGenerationResponseV3ResponseType?), TypeInfoPropertyName = "NullableLayeredImageGenerationResponseV3ResponseType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TextSpanV3FontFxItem?), TypeInfoPropertyName = "NullableTextSpanV3FontFxItem2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TextItemV3Alignment?), TypeInfoPropertyName = "NullableTextItemV3Alignment2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TextItemV3StyleClass?), TypeInfoPropertyName = "NullableTextItemV3StyleClass2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TextItemV3GlyphType?), TypeInfoPropertyName = "NullableTextItemV3GlyphType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TextItemV3TextTransform?), TypeInfoPropertyName = "NullableTextItemV3TextTransform2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TextItemV3VerticalAlignment?), TypeInfoPropertyName = "NullableTextItemV3VerticalAlignment2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SeedDance2AspectRatio?), TypeInfoPropertyName = "NullableSeedDance2AspectRatio2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SeedDance2Resolution?), TypeInfoPropertyName = "NullableSeedDance2Resolution2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationRejectReason?), TypeInfoPropertyName = "NullableGenerationRejectReason2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?), TypeInfoPropertyName = "NullableGenerationErrorResponseTaskCompletionSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SeedDance25Resolution?), TypeInfoPropertyName = "NullableSeedDance25Resolution2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MinimaxH3AspectRatio?), TypeInfoPropertyName = "NullableMinimaxH3AspectRatio2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MinimaxH3Resolution?), TypeInfoPropertyName = "NullableMinimaxH3Resolution2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.KlingV3AspectRatio?), TypeInfoPropertyName = "NullableKlingV3AspectRatio2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.KlingV3ShotType?), TypeInfoPropertyName = "NullableKlingV3ShotType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MinimaxH3PromptExpansionMode?), TypeInfoPropertyName = "NullableMinimaxH3PromptExpansionMode2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReplaceBackgroundQuality?), TypeInfoPropertyName = "NullableReplaceBackgroundQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReplaceBackgroundIdeogramV3RequestRenderingSpeed?), TypeInfoPropertyName = "NullableReplaceBackgroundIdeogramV3RequestRenderingSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AccountApiKeyStatus?), TypeInfoPropertyName = "NullableAccountApiKeyStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AccountUsageLineItemSource?), TypeInfoPropertyName = "NullableAccountUsageLineItemSource2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AccountInvoiceStatus?), TypeInfoPropertyName = "NullableAccountInvoiceStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageTopazTextRefineRequestUpscaleFactor?), TypeInfoPropertyName = "NullableUpscaleImageTopazTextRefineRequestUpscaleFactor2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageTopazTextRefineRequestSubjectDetection?), TypeInfoPropertyName = "NullableUpscaleImageTopazTextRefineRequestSubjectDetection2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageTopazWonder35RequestUpscaleFactor?), TypeInfoPropertyName = "NullableUpscaleImageTopazWonder35RequestUpscaleFactor2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageTopazWonder35RequestEnhancementStrength?), TypeInfoPropertyName = "NullableUpscaleImageTopazWonder35RequestEnhancementStrength2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageTopazStandardV2RequestUpscaleFactor?), TypeInfoPropertyName = "NullableUpscaleImageTopazStandardV2RequestUpscaleFactor2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageTopazStandardV2RequestSubjectDetection?), TypeInfoPropertyName = "NullableUpscaleImageTopazStandardV2RequestSubjectDetection2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageTopazBloom2RequestUpscaleFactor?), TypeInfoPropertyName = "NullableUpscaleImageTopazBloom2RequestUpscaleFactor2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageTopazRedefineRequestUpscaleFactor?), TypeInfoPropertyName = "NullableUpscaleImageTopazRedefineRequestUpscaleFactor2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageTopazRedefineRequestSubjectDetection?), TypeInfoPropertyName = "NullableUpscaleImageTopazRedefineRequestSubjectDetection2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageNanoBananaProRequestResolutionTier?), TypeInfoPropertyName = "NullableUpscaleImageNanoBananaProRequestResolutionTier2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LookbookRequestCategory?), TypeInfoPropertyName = "NullableLookbookRequestCategory2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ModelPoseVariantsQuality?), TypeInfoPropertyName = "NullableModelPoseVariantsQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PackshotView?), TypeInfoPropertyName = "NullablePackshotView2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PackshotsQuality?), TypeInfoPropertyName = "NullablePackshotsQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GhostMannequinRequestView?), TypeInfoPropertyName = "NullableGhostMannequinRequestView2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GhostMannequinQuality?), TypeInfoPropertyName = "NullableGhostMannequinQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.Product360VideoDirection?), TypeInfoPropertyName = "NullableProduct360VideoDirection2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LivingImageQuality?), TypeInfoPropertyName = "NullableLivingImageQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PreciseMaskedEditModel?), TypeInfoPropertyName = "NullablePreciseMaskedEditModel2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PreciseMaskedEditQuality?), TypeInfoPropertyName = "NullablePreciseMaskedEditQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ColorwaysQuality?), TypeInfoPropertyName = "NullableColorwaysQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AdLocalizerRequestLanguage?), TypeInfoPropertyName = "NullableAdLocalizerRequestLanguage2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AdLocalizerQuality?), TypeInfoPropertyName = "NullableAdLocalizerQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.VectorizerRequestMode?), TypeInfoPropertyName = "NullableVectorizerRequestMode2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AdResizerRequestResolution?), TypeInfoPropertyName = "NullableAdResizerRequestResolution2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AdResizerRequestPlatform?), TypeInfoPropertyName = "NullableAdResizerRequestPlatform2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AdResizerQuality?), TypeInfoPropertyName = "NullableAdResizerQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AdVariationsRequestVariationType?), TypeInfoPropertyName = "NullableAdVariationsRequestVariationType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AdVariationsQuality?), TypeInfoPropertyName = "NullableAdVariationsQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SketchToRenderQuality?), TypeInfoPropertyName = "NullableSketchToRenderQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SoleSwapRequestBaseGenerationSize?), TypeInfoPropertyName = "NullableSoleSwapRequestBaseGenerationSize2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SoleSwapQuality?), TypeInfoPropertyName = "NullableSoleSwapQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SwapProductMode?), TypeInfoPropertyName = "NullableSwapProductMode2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SwapProductQuality?), TypeInfoPropertyName = "NullableSwapProductQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SkechersStyleEditRequestAspectRatio?), TypeInfoPropertyName = "NullableSkechersStyleEditRequestAspectRatio2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SkechersStyleEditRequestBaseGenerationSize?), TypeInfoPropertyName = "NullableSkechersStyleEditRequestBaseGenerationSize2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SkechersStyleEditQuality?), TypeInfoPropertyName = "NullableSkechersStyleEditQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SwanSLogoDesignRequestLogoStyle?), TypeInfoPropertyName = "NullableSwanSLogoDesignRequestLogoStyle2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SwanSLogoDesignRequestSourceMode?), TypeInfoPropertyName = "NullableSwanSLogoDesignRequestSourceMode2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SwanSLogoDesignRequestDesignVariant?), TypeInfoPropertyName = "NullableSwanSLogoDesignRequestDesignVariant2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SwanSLogoQuality?), TypeInfoPropertyName = "NullableSwanSLogoQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SwanSLogoInstallRequestLogoStyle?), TypeInfoPropertyName = "NullableSwanSLogoInstallRequestLogoStyle2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ModelSwapQuality?), TypeInfoPropertyName = "NullableModelSwapQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MaterialSwapQuality?), TypeInfoPropertyName = "NullableMaterialSwapQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleToolRequestUpscaleFactor?), TypeInfoPropertyName = "NullableUpscaleToolRequestUpscaleFactor2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LayerizedImageObjectObjectType?), TypeInfoPropertyName = "NullableLayerizedImageObjectObjectType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramV3AspectRatio?), TypeInfoPropertyName = "NullableIdeogramV3AspectRatio2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV3RequestRenderingSpeed?), TypeInfoPropertyName = "NullableGenerateImageIdeogramV3RequestRenderingSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MagicPromptMode?), TypeInfoPropertyName = "NullableMagicPromptMode2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramColorPalette?), TypeInfoPropertyName = "NullableIdeogramColorPalette2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramV3StyleType?), TypeInfoPropertyName = "NullableIdeogramV3StyleType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramV3StylePreset?), TypeInfoPropertyName = "NullableIdeogramV3StylePreset2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV3CustomModelRequestRenderingSpeed?), TypeInfoPropertyName = "NullableGenerateImageIdeogramV3CustomModelRequestRenderingSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV4RequestRenderingSpeed?), TypeInfoPropertyName = "NullableGenerateImageIdeogramV4RequestRenderingSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV4CustomModelRequestRenderingSpeed?), TypeInfoPropertyName = "NullableGenerateImageIdeogramV4CustomModelRequestRenderingSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(double?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemixImageIdeogramV3RequestRenderingSpeed?), TypeInfoPropertyName = "NullableRemixImageIdeogramV3RequestRenderingSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemixImageIdeogramV3CustomModelRequestRenderingSpeed?), TypeInfoPropertyName = "NullableRemixImageIdeogramV3CustomModelRequestRenderingSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemixImageIdeogramV4RequestRenderingSpeed?), TypeInfoPropertyName = "NullableRemixImageIdeogramV4RequestRenderingSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemixImageIdeogramV3CharacterRequestRenderingSpeed?), TypeInfoPropertyName = "NullableRemixImageIdeogramV3CharacterRequestRenderingSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemixImageIdeogramV3CharacterRequestStyleType?), TypeInfoPropertyName = "NullableRemixImageIdeogramV3CharacterRequestStyleType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV3TransparentRequestUpscaleFactor?), TypeInfoPropertyName = "NullableGenerateImageIdeogramV3TransparentRequestUpscaleFactor2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV3TransparentRequestRenderingSpeed?), TypeInfoPropertyName = "NullableGenerateImageIdeogramV3TransparentRequestRenderingSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramV4AspectRatio?), TypeInfoPropertyName = "NullableIdeogramV4AspectRatio2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV4TransparentRequestOutputResolution?), TypeInfoPropertyName = "NullableGenerateImageIdeogramV4TransparentRequestOutputResolution2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV4TransparentRequestRenderingSpeed?), TypeInfoPropertyName = "NullableGenerateImageIdeogramV4TransparentRequestRenderingSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationQuality?), TypeInfoPropertyName = "NullableGenerationQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImagePImageIdeogramRequestResolution?), TypeInfoPropertyName = "NullableGenerateImagePImageIdeogramRequestResolution2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationKind?), TypeInfoPropertyName = "NullableGenerationKind2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogram45RequestBackground?), TypeInfoPropertyName = "NullableGenerateImageIdeogram45RequestBackground2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogram45RequestQuality?), TypeInfoPropertyName = "NullableGenerateImageIdeogram45RequestQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PreciseEditImageIdeogram45RequestQuality?), TypeInfoPropertyName = "NullablePreciseEditImageIdeogram45RequestQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.NanoBanana2AspectRatio?), TypeInfoPropertyName = "NullableNanoBanana2AspectRatio2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageNanoBanana2RequestResolutionTier?), TypeInfoPropertyName = "NullableGenerateImageNanoBanana2RequestResolutionTier2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.NanoBanana21AspectRatio?), TypeInfoPropertyName = "NullableNanoBanana21AspectRatio2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageNanoBanana21RequestResolutionTier?), TypeInfoPropertyName = "NullableGenerateImageNanoBanana21RequestResolutionTier2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.NanoBananaProAspectRatio?), TypeInfoPropertyName = "NullableNanoBananaProAspectRatio2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageNanoBananaProRequestResolutionTier?), TypeInfoPropertyName = "NullableGenerateImageNanoBananaProRequestResolutionTier2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageGptImage25FlareRequestBackground?), TypeInfoPropertyName = "NullableGenerateImageGptImage25FlareRequestBackground2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageGptImage25FlareRequestQuality?), TypeInfoPropertyName = "NullableGenerateImageGptImage25FlareRequestQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageGptImage25SunburstRequestBackground?), TypeInfoPropertyName = "NullableGenerateImageGptImage25SunburstRequestBackground2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageGptImage25SunburstRequestQuality?), TypeInfoPropertyName = "NullableGenerateImageGptImage25SunburstRequestQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV2RequestRenderingSpeed?), TypeInfoPropertyName = "NullableGenerateImageIdeogramV2RequestRenderingSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramV2StyleType?), TypeInfoPropertyName = "NullableIdeogramV2StyleType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV2ARequestRenderingSpeed?), TypeInfoPropertyName = "NullableGenerateImageIdeogramV2ARequestRenderingSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.InpaintImageIdeogramV3RequestRenderingSpeed?), TypeInfoPropertyName = "NullableInpaintImageIdeogramV3RequestRenderingSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.InpaintImageIdeogramV3CustomModelRequestRenderingSpeed?), TypeInfoPropertyName = "NullableInpaintImageIdeogramV3CustomModelRequestRenderingSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReframeImageIdeogramV3RequestRenderingSpeed?), TypeInfoPropertyName = "NullableReframeImageIdeogramV3RequestRenderingSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.NanoBanana2ReframeAspectRatio?), TypeInfoPropertyName = "NullableNanoBanana2ReframeAspectRatio2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.NanoBananaProReframeAspectRatio?), TypeInfoPropertyName = "NullableNanoBananaProReframeAspectRatio2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReframeImageNanoBananaProRequestResolutionTier?), TypeInfoPropertyName = "NullableReframeImageNanoBananaProRequestResolutionTier2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReframeImageGptImage25FlareRequestQuality?), TypeInfoPropertyName = "NullableReframeImageGptImage25FlareRequestQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV3CharacterRequestRenderingSpeed?), TypeInfoPropertyName = "NullableGenerateImageIdeogramV3CharacterRequestRenderingSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV3CharacterRequestStyleType?), TypeInfoPropertyName = "NullableGenerateImageIdeogramV3CharacterRequestStyleType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.InpaintImageIdeogramV3CharacterRequestRenderingSpeed?), TypeInfoPropertyName = "NullableInpaintImageIdeogramV3CharacterRequestRenderingSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.InpaintImageIdeogramV3CharacterRequestStyleType?), TypeInfoPropertyName = "NullableInpaintImageIdeogramV3CharacterRequestStyleType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageV2AutoRequestResolutionTier?), TypeInfoPropertyName = "NullableGenerateImageV2AutoRequestResolutionTier2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ToolRemixRequestResolutionTier?), TypeInfoPropertyName = "NullableToolRemixRequestResolutionTier2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ResizeAdImageRequestResolution?), TypeInfoPropertyName = "NullableResizeAdImageRequestResolution2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ResizeAdImageQuality?), TypeInfoPropertyName = "NullableResizeAdImageQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ProvenanceVerifyResponseValidationState?), TypeInfoPropertyName = "NullableProvenanceVerifyResponseValidationState2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ApiKeyStatus?), TypeInfoPropertyName = "NullableApiKeyStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ToolType?), TypeInfoPropertyName = "NullableToolType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ModelVersion?), TypeInfoPropertyName = "NullableModelVersion2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SegmentBy?), TypeInfoPropertyName = "NullableSegmentBy2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UsageSource?), TypeInfoPropertyName = "NullableUsageSource2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ApiProfileType?), TypeInfoPropertyName = "NullableApiProfileType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ApiProfileRole?), TypeInfoPropertyName = "NullableApiProfileRole2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.InvoiceStatus?), TypeInfoPropertyName = "NullableInvoiceStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DatasetAssetFailureReason?), TypeInfoPropertyName = "NullableDatasetAssetFailureReason2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ModelStatus?), TypeInfoPropertyName = "NullableModelStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TrainingRunStatus?), TypeInfoPropertyName = "NullableTrainingRunStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PublishMiniAppRequestEmbed?), TypeInfoPropertyName = "NullablePublishMiniAppRequestEmbed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PublishMiniAppPreviewRequestEmbed?), TypeInfoPropertyName = "NullablePublishMiniAppPreviewRequestEmbed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MiniAppMarketingProjectionEntryEmbed?), TypeInfoPropertyName = "NullableMiniAppMarketingProjectionEntryEmbed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IntegrationType?), TypeInfoPropertyName = "NullableIntegrationType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IntegrationErrorResponseError?), TypeInfoPropertyName = "NullableIntegrationErrorResponseError2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4PromptElement?), TypeInfoPropertyName = "NullableV4PromptElement2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4PromptElementDiscriminatorType?), TypeInfoPropertyName = "NullableV4PromptElementDiscriminatorType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4ObjPromptElementType?), TypeInfoPropertyName = "NullableV4ObjPromptElementType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4TextPromptElementType?), TypeInfoPropertyName = "NullableV4TextPromptElementType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ColorPalettePresetName?), TypeInfoPropertyName = "NullableColorPalettePresetName2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SvgGenerationObjectObjectType?), TypeInfoPropertyName = "NullableSvgGenerationObjectObjectType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SvgGenerationObjectMimeType?), TypeInfoPropertyName = "NullableSvgGenerationObjectMimeType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.VideoObjectObjectType?), TypeInfoPropertyName = "NullableVideoObjectObjectType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TextLayerizerResultObjectObjectType?), TypeInfoPropertyName = "NullableTextLayerizerResultObjectObjectType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DetectedTextBlockAlignment?), TypeInfoPropertyName = "NullableDetectedTextBlockAlignment2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DetectedTextBlockFormattingItem?), TypeInfoPropertyName = "NullableDetectedTextBlockFormattingItem2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DetectedTextBlockRole?), TypeInfoPropertyName = "NullableDetectedTextBlockRole2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AssetType?), TypeInfoPropertyName = "NullableAssetType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AttributeValueType?), TypeInfoPropertyName = "NullableAttributeValueType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramColorPalettePresetName?), TypeInfoPropertyName = "NullableIdeogramColorPalettePresetName2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PostGenerateDesignV4200Response?), TypeInfoPropertyName = "NullablePostGenerateDesignV4200Response2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PostGenerateDesignV4200ResponseDiscriminatorResponseType?), TypeInfoPropertyName = "NullablePostGenerateDesignV4200ResponseDiscriminatorResponseType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponseDataInnerDiscriminatorObjectType?), TypeInfoPropertyName = "NullableGenerationResponseDataInnerDiscriminatorObjectType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MagicPromptRequestMessagesInnerRole?), TypeInfoPropertyName = "NullableMagicPromptRequestMessagesInnerRole2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DatasetCoverAssetIdentifier?), TypeInfoPropertyName = "NullableDatasetCoverAssetIdentifier2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ListCustomModelsScope?), TypeInfoPropertyName = "NullableListCustomModelsScope2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GetAccountUsageBucketWidth?), TypeInfoPropertyName = "NullableGetAccountUsageBucketWidth2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GetAccountUsageSource?), TypeInfoPropertyName = "NullableGetAccountUsageSource2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - internal sealed partial class SourceGenerationContextChunk1 : global::System.Text.Json.Serialization.JsonSerializerContext - { - } - /// - /// - /// - public sealed partial class SourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext - { - private static readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver Resolver = new LazyChunkResolver(); - - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - internal static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver TypeInfoResolver => Resolver; - - - private static readonly global::System.Text.Json.JsonSerializerOptions DefaultOptions = CreateDefaultOptions(); - - /// - /// - /// - public static SourceGenerationContext Default { get; } = new(DefaultOptions); - - private SourceGenerationContext(global::System.Text.Json.JsonSerializerOptions options) - : base(options) - { - } - - /// - protected override global::System.Text.Json.JsonSerializerOptions? GeneratedSerializerOptions => DefaultOptions; - - /// - public override global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo(global::System.Type type) - { - return Resolver.GetTypeInfo(type, Options); - } - - internal static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) - { - options.Converters.Add(new global::Ideogram.JsonConverters.LayerizedTextBlockJsonConverter()); - options.Converters.Add(new global::Ideogram.JsonConverters.V4PromptElementJsonConverter()); - options.Converters.Add(new global::Ideogram.JsonConverters.ColorPaletteWithPresetNameOrMembersJsonConverter()); - options.Converters.Add(new global::Ideogram.JsonConverters.IdeogramColorPaletteJsonConverter()); - options.Converters.Add(new global::Ideogram.JsonConverters.PostGenerateDesignV4200ResponseJsonConverter()); - options.Converters.Add(new global::Ideogram.JsonConverters.GenerationResponseDataInnerJsonConverter()); - options.Converters.Add(new global::Ideogram.JsonConverters.DatasetCoverAssetIdentifierJsonConverter()); - options.Converters.Add(new global::Ideogram.JsonConverters.UnixTimestampJsonConverter()); - options.Converters.Add(new LazyEnumJsonConverterFactory()); - } - - private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() - { - var options = new global::System.Text.Json.JsonSerializerOptions - { - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, - TypeInfoResolver = Resolver, - }; - AddConverters(options); - - return options; - } - - - private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + Converters = new global::System.Type[] { - public override bool CanConvert(global::System.Type typeToConvert) - { - return - typeToConvert == typeof(global::Ideogram.PriceQuoteObject) - - || typeToConvert == typeof(global::Ideogram.PriceQuoteObject?) - - || typeToConvert == typeof(global::Ideogram.PriceQualifier) - - || typeToConvert == typeof(global::Ideogram.PriceQualifier?) - - || typeToConvert == typeof(global::Ideogram.OutputResolution) - - || typeToConvert == typeof(global::Ideogram.OutputResolution?) - - || typeToConvert == typeof(global::Ideogram.RenderingSpeedV4) - - || typeToConvert == typeof(global::Ideogram.RenderingSpeedV4?) - - || typeToConvert == typeof(global::Ideogram.PImageResolution) - - || typeToConvert == typeof(global::Ideogram.PImageResolution?) - - || typeToConvert == typeof(global::Ideogram.GenerateImageRequestV4StableVersion) - - || typeToConvert == typeof(global::Ideogram.GenerateImageRequestV4StableVersion?) - - || typeToConvert == typeof(global::Ideogram.GenerateDesignRequestV4InspirationReferenceModel) - - || typeToConvert == typeof(global::Ideogram.GenerateDesignRequestV4InspirationReferenceModel?) - - || typeToConvert == typeof(global::Ideogram.GenerateDesignRequestV4ArtifactGenerationModel) - - || typeToConvert == typeof(global::Ideogram.GenerateDesignRequestV4ArtifactGenerationModel?) - - || typeToConvert == typeof(global::Ideogram.GenerateDesignRequestV4Layout2imageVariant) - - || typeToConvert == typeof(global::Ideogram.GenerateDesignRequestV4Layout2imageVariant?) - - || typeToConvert == typeof(global::Ideogram.GenerateDesignRequestV4ResponseType) + typeof(global::Ideogram.JsonConverters.V2ImagePreciseEditIdeogram45PostRequestBodyContentMultipartFormDataSchemaQualityJsonConverter), - || typeToConvert == typeof(global::Ideogram.GenerateDesignRequestV4ResponseType?) + typeof(global::Ideogram.JsonConverters.V2ImagePreciseEditIdeogram45PostRequestBodyContentMultipartFormDataSchemaQualityNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.TransparencyOption) + typeof(global::Ideogram.JsonConverters.GenerationKindJsonConverter), - || typeToConvert == typeof(global::Ideogram.TransparencyOption?) + typeof(global::Ideogram.JsonConverters.GenerationKindNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.AspectRatioEditLite) + typeof(global::Ideogram.JsonConverters.GenerationRejectReasonJsonConverter), - || typeToConvert == typeof(global::Ideogram.AspectRatioEditLite?) + typeof(global::Ideogram.JsonConverters.GenerationRejectReasonNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.InternalTestingEnumField) + typeof(global::Ideogram.JsonConverters.GenerationErrorResponseTaskCompletionSpeedJsonConverter), - || typeToConvert == typeof(global::Ideogram.InternalTestingEnumField?) + typeof(global::Ideogram.JsonConverters.GenerationErrorResponseTaskCompletionSpeedNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.ImageGenerationResponseV4ResponseType) + typeof(global::Ideogram.JsonConverters.V2ImageGenerateAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTierJsonConverter), - || typeToConvert == typeof(global::Ideogram.ImageGenerationResponseV4ResponseType?) + typeof(global::Ideogram.JsonConverters.V2ImageGenerateAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTierNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.GenerationResponseStatus) + typeof(global::Ideogram.JsonConverters.MagicPromptModeJsonConverter), - || typeToConvert == typeof(global::Ideogram.GenerationResponseStatus?) + typeof(global::Ideogram.JsonConverters.MagicPromptModeNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.GenerationResponseResponseType) + typeof(global::Ideogram.JsonConverters.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaBackgroundJsonConverter), - || typeToConvert == typeof(global::Ideogram.GenerationResponseResponseType?) + typeof(global::Ideogram.JsonConverters.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaBackgroundNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.ImageObjectWithoutPromptOrSeedObjectType) + typeof(global::Ideogram.JsonConverters.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaQualityJsonConverter), - || typeToConvert == typeof(global::Ideogram.ImageObjectWithoutPromptOrSeedObjectType?) + typeof(global::Ideogram.JsonConverters.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaQualityNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.ImageGenerationObjectObjectType) + typeof(global::Ideogram.JsonConverters.ResolutionV4JsonConverter), - || typeToConvert == typeof(global::Ideogram.ImageGenerationObjectObjectType?) + typeof(global::Ideogram.JsonConverters.ResolutionV4NullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.ImageGenerationResponseV4ImageToImageResponseType) + typeof(global::Ideogram.JsonConverters.GenerateImageIdeogramV4RequestRenderingSpeedJsonConverter), - || typeToConvert == typeof(global::Ideogram.ImageGenerationResponseV4ImageToImageResponseType?) + typeof(global::Ideogram.JsonConverters.GenerateImageIdeogramV4RequestRenderingSpeedNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.ImageGenerationResponseV4LayoutResponseType) + typeof(global::Ideogram.JsonConverters.GenerateImageIdeogramV4CustomModelRequestRenderingSpeedJsonConverter), - || typeToConvert == typeof(global::Ideogram.ImageGenerationResponseV4LayoutResponseType?) + typeof(global::Ideogram.JsonConverters.GenerateImageIdeogramV4CustomModelRequestRenderingSpeedNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.LayeredImageGenerationResponseV3ResponseType) + typeof(global::Ideogram.JsonConverters.IdeogramV4AspectRatioJsonConverter), - || typeToConvert == typeof(global::Ideogram.LayeredImageGenerationResponseV3ResponseType?) + typeof(global::Ideogram.JsonConverters.IdeogramV4AspectRatioNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.ModelEnum) + typeof(global::Ideogram.JsonConverters.GenerateImageIdeogramV4TransparentRequestOutputResolutionJsonConverter), - || typeToConvert == typeof(global::Ideogram.ModelEnum?) + typeof(global::Ideogram.JsonConverters.GenerateImageIdeogramV4TransparentRequestOutputResolutionNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.TextSpanV3FontFxItem) + typeof(global::Ideogram.JsonConverters.GenerateImageIdeogramV4TransparentRequestRenderingSpeedJsonConverter), - || typeToConvert == typeof(global::Ideogram.TextSpanV3FontFxItem?) + typeof(global::Ideogram.JsonConverters.GenerateImageIdeogramV4TransparentRequestRenderingSpeedNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.TextItemV3Alignment) + typeof(global::Ideogram.JsonConverters.ResolutionV3JsonConverter), - || typeToConvert == typeof(global::Ideogram.TextItemV3Alignment?) + typeof(global::Ideogram.JsonConverters.ResolutionV3NullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.TextItemV3StyleClass) + typeof(global::Ideogram.JsonConverters.IdeogramV3AspectRatioJsonConverter), - || typeToConvert == typeof(global::Ideogram.TextItemV3StyleClass?) + typeof(global::Ideogram.JsonConverters.IdeogramV3AspectRatioNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.TextItemV3GlyphType) + typeof(global::Ideogram.JsonConverters.V2ImageGenerateIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedJsonConverter), - || typeToConvert == typeof(global::Ideogram.TextItemV3GlyphType?) + typeof(global::Ideogram.JsonConverters.V2ImageGenerateIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.TextItemV3TextTransform) + typeof(global::Ideogram.JsonConverters.IdeogramColorPalettePresetNameJsonConverter), - || typeToConvert == typeof(global::Ideogram.TextItemV3TextTransform?) + typeof(global::Ideogram.JsonConverters.IdeogramColorPalettePresetNameNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.TextItemV3VerticalAlignment) + typeof(global::Ideogram.JsonConverters.IdeogramV3StyleTypeJsonConverter), - || typeToConvert == typeof(global::Ideogram.TextItemV3VerticalAlignment?) + typeof(global::Ideogram.JsonConverters.IdeogramV3StyleTypeNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed) + typeof(global::Ideogram.JsonConverters.IdeogramV3StylePresetJsonConverter), - || typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?) + typeof(global::Ideogram.JsonConverters.IdeogramV3StylePresetNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.GenerationRejectReason) + typeof(global::Ideogram.JsonConverters.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedJsonConverter), - || typeToConvert == typeof(global::Ideogram.GenerationRejectReason?) + typeof(global::Ideogram.JsonConverters.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.SeedDance25Resolution) + typeof(global::Ideogram.JsonConverters.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleTypeJsonConverter), - || typeToConvert == typeof(global::Ideogram.SeedDance25Resolution?) + typeof(global::Ideogram.JsonConverters.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleTypeNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.ReplaceBackgroundQuality) + typeof(global::Ideogram.JsonConverters.V2ImageGenerateIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedJsonConverter), - || typeToConvert == typeof(global::Ideogram.ReplaceBackgroundQuality?) + typeof(global::Ideogram.JsonConverters.V2ImageGenerateIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.ReplaceBackgroundIdeogramV3RequestRenderingSpeed) + typeof(global::Ideogram.JsonConverters.GenerateImageIdeogramV3TransparentRequestUpscaleFactorJsonConverter), - || typeToConvert == typeof(global::Ideogram.ReplaceBackgroundIdeogramV3RequestRenderingSpeed?) + typeof(global::Ideogram.JsonConverters.GenerateImageIdeogramV3TransparentRequestUpscaleFactorNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.AccountApiKeyStatus) + typeof(global::Ideogram.JsonConverters.GenerateImageIdeogramV3TransparentRequestRenderingSpeedJsonConverter), - || typeToConvert == typeof(global::Ideogram.AccountApiKeyStatus?) + typeof(global::Ideogram.JsonConverters.GenerateImageIdeogramV3TransparentRequestRenderingSpeedNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.AccountUsageLineItemSource) + typeof(global::Ideogram.JsonConverters.GenerateImageIdeogramV2ARequestRenderingSpeedJsonConverter), - || typeToConvert == typeof(global::Ideogram.AccountUsageLineItemSource?) + typeof(global::Ideogram.JsonConverters.GenerateImageIdeogramV2ARequestRenderingSpeedNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.AccountInvoiceStatus) + typeof(global::Ideogram.JsonConverters.IdeogramV2StyleTypeJsonConverter), - || typeToConvert == typeof(global::Ideogram.AccountInvoiceStatus?) + typeof(global::Ideogram.JsonConverters.IdeogramV2StyleTypeNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.UpscaleImageTopazTextRefineRequestUpscaleFactor) + typeof(global::Ideogram.JsonConverters.GenerateImageIdeogramV2RequestRenderingSpeedJsonConverter), - || typeToConvert == typeof(global::Ideogram.UpscaleImageTopazTextRefineRequestUpscaleFactor?) + typeof(global::Ideogram.JsonConverters.GenerateImageIdeogramV2RequestRenderingSpeedNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.UpscaleImageTopazTextRefineRequestSubjectDetection) + typeof(global::Ideogram.JsonConverters.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaBackgroundJsonConverter), - || typeToConvert == typeof(global::Ideogram.UpscaleImageTopazTextRefineRequestSubjectDetection?) + typeof(global::Ideogram.JsonConverters.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaBackgroundNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.UpscaleImageTopazWonder35RequestUpscaleFactor) + typeof(global::Ideogram.JsonConverters.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaQualityJsonConverter), - || typeToConvert == typeof(global::Ideogram.UpscaleImageTopazWonder35RequestUpscaleFactor?) + typeof(global::Ideogram.JsonConverters.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaQualityNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.UpscaleImageTopazWonder35RequestEnhancementStrength) + typeof(global::Ideogram.JsonConverters.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaBackgroundJsonConverter), - || typeToConvert == typeof(global::Ideogram.UpscaleImageTopazWonder35RequestEnhancementStrength?) + typeof(global::Ideogram.JsonConverters.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaBackgroundNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.UpscaleImageTopazStandardV2RequestUpscaleFactor) + typeof(global::Ideogram.JsonConverters.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaQualityJsonConverter), - || typeToConvert == typeof(global::Ideogram.UpscaleImageTopazStandardV2RequestUpscaleFactor?) + typeof(global::Ideogram.JsonConverters.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaQualityNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.UpscaleImageTopazStandardV2RequestSubjectDetection) + typeof(global::Ideogram.JsonConverters.NanoBanana2AspectRatioJsonConverter), - || typeToConvert == typeof(global::Ideogram.UpscaleImageTopazStandardV2RequestSubjectDetection?) + typeof(global::Ideogram.JsonConverters.NanoBanana2AspectRatioNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.UpscaleImageTopazBloom2RequestUpscaleFactor) + typeof(global::Ideogram.JsonConverters.V2ImageGenerateNanoBanana2PostRequestBodyContentMultipartFormDataSchemaResolutionTierJsonConverter), - || typeToConvert == typeof(global::Ideogram.UpscaleImageTopazBloom2RequestUpscaleFactor?) + typeof(global::Ideogram.JsonConverters.V2ImageGenerateNanoBanana2PostRequestBodyContentMultipartFormDataSchemaResolutionTierNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.UpscaleImageTopazRedefineRequestUpscaleFactor) + typeof(global::Ideogram.JsonConverters.NanoBanana21AspectRatioJsonConverter), - || typeToConvert == typeof(global::Ideogram.UpscaleImageTopazRedefineRequestUpscaleFactor?) + typeof(global::Ideogram.JsonConverters.NanoBanana21AspectRatioNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.UpscaleImageTopazRedefineRequestSubjectDetection) + typeof(global::Ideogram.JsonConverters.V2ImageGenerateNanoBanana21PostRequestBodyContentMultipartFormDataSchemaResolutionTierJsonConverter), - || typeToConvert == typeof(global::Ideogram.UpscaleImageTopazRedefineRequestSubjectDetection?) + typeof(global::Ideogram.JsonConverters.V2ImageGenerateNanoBanana21PostRequestBodyContentMultipartFormDataSchemaResolutionTierNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.UpscaleImageNanoBananaProRequestResolutionTier) + typeof(global::Ideogram.JsonConverters.NanoBananaProAspectRatioJsonConverter), - || typeToConvert == typeof(global::Ideogram.UpscaleImageNanoBananaProRequestResolutionTier?) + typeof(global::Ideogram.JsonConverters.NanoBananaProAspectRatioNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.LookbookRequestCategory) + typeof(global::Ideogram.JsonConverters.V2ImageGenerateNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTierJsonConverter), - || typeToConvert == typeof(global::Ideogram.LookbookRequestCategory?) + typeof(global::Ideogram.JsonConverters.V2ImageGenerateNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTierNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.ModelPoseVariantsQuality) + typeof(global::Ideogram.JsonConverters.GenerationQualityJsonConverter), - || typeToConvert == typeof(global::Ideogram.ModelPoseVariantsQuality?) + typeof(global::Ideogram.JsonConverters.GenerationQualityNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.PackshotView) + typeof(global::Ideogram.JsonConverters.GenerateImagePImageIdeogramRequestResolutionJsonConverter), - || typeToConvert == typeof(global::Ideogram.PackshotView?) + typeof(global::Ideogram.JsonConverters.GenerateImagePImageIdeogramRequestResolutionNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.PackshotsQuality) + typeof(global::Ideogram.JsonConverters.AspectRatioV3JsonConverter), - || typeToConvert == typeof(global::Ideogram.PackshotsQuality?) + typeof(global::Ideogram.JsonConverters.AspectRatioV3NullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.GhostMannequinRequestView) + typeof(global::Ideogram.JsonConverters.V2ImageRemixAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTierJsonConverter), - || typeToConvert == typeof(global::Ideogram.GhostMannequinRequestView?) + typeof(global::Ideogram.JsonConverters.V2ImageRemixAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTierNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.GhostMannequinQuality) + typeof(global::Ideogram.JsonConverters.V2ImageRemixIdeogram4PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedJsonConverter), - || typeToConvert == typeof(global::Ideogram.GhostMannequinQuality?) + typeof(global::Ideogram.JsonConverters.V2ImageRemixIdeogram4PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.Product360VideoDirection) + typeof(global::Ideogram.JsonConverters.V2ImageRemixIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedJsonConverter), - || typeToConvert == typeof(global::Ideogram.Product360VideoDirection?) + typeof(global::Ideogram.JsonConverters.V2ImageRemixIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.LivingImageQuality) + typeof(global::Ideogram.JsonConverters.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedJsonConverter), - || typeToConvert == typeof(global::Ideogram.LivingImageQuality?) + typeof(global::Ideogram.JsonConverters.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.PreciseMaskedEditModel) + typeof(global::Ideogram.JsonConverters.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleTypeJsonConverter), - || typeToConvert == typeof(global::Ideogram.PreciseMaskedEditModel?) + typeof(global::Ideogram.JsonConverters.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleTypeNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.PreciseMaskedEditQuality) + typeof(global::Ideogram.JsonConverters.V2ImageRemixIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedJsonConverter), - || typeToConvert == typeof(global::Ideogram.PreciseMaskedEditQuality?) + typeof(global::Ideogram.JsonConverters.V2ImageRemixIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.ColorwaysQuality) + typeof(global::Ideogram.JsonConverters.V2ImageInpaintIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedJsonConverter), - || typeToConvert == typeof(global::Ideogram.ColorwaysQuality?) + typeof(global::Ideogram.JsonConverters.V2ImageInpaintIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.AdLocalizerRequestLanguage) + typeof(global::Ideogram.JsonConverters.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedJsonConverter), - || typeToConvert == typeof(global::Ideogram.AdLocalizerRequestLanguage?) + typeof(global::Ideogram.JsonConverters.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.AdLocalizerQuality) + typeof(global::Ideogram.JsonConverters.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleTypeJsonConverter), - || typeToConvert == typeof(global::Ideogram.AdLocalizerQuality?) + typeof(global::Ideogram.JsonConverters.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleTypeNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.VectorizerRequestMode) + typeof(global::Ideogram.JsonConverters.V2ImageInpaintIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedJsonConverter), - || typeToConvert == typeof(global::Ideogram.VectorizerRequestMode?) + typeof(global::Ideogram.JsonConverters.V2ImageInpaintIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.AdResizerRequestResolution) + typeof(global::Ideogram.JsonConverters.V2ImageReframeIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedJsonConverter), - || typeToConvert == typeof(global::Ideogram.AdResizerRequestResolution?) + typeof(global::Ideogram.JsonConverters.V2ImageReframeIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.AdResizerRequestPlatform) + typeof(global::Ideogram.JsonConverters.NanoBanana2ReframeAspectRatioJsonConverter), - || typeToConvert == typeof(global::Ideogram.AdResizerRequestPlatform?) + typeof(global::Ideogram.JsonConverters.NanoBanana2ReframeAspectRatioNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.AdResizerQuality) + typeof(global::Ideogram.JsonConverters.V2ImageUpscaleAutoPostRequestBodyContentMultipartFormDataSchemaUpscaleFactorJsonConverter), - || typeToConvert == typeof(global::Ideogram.AdResizerQuality?) + typeof(global::Ideogram.JsonConverters.V2ImageUpscaleAutoPostRequestBodyContentMultipartFormDataSchemaUpscaleFactorNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.AdVariationsRequestVariationType) + typeof(global::Ideogram.JsonConverters.V2ImageUpscaleNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTierJsonConverter), - || typeToConvert == typeof(global::Ideogram.AdVariationsRequestVariationType?) + typeof(global::Ideogram.JsonConverters.V2ImageUpscaleNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTierNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.AdVariationsQuality) + typeof(global::Ideogram.JsonConverters.V2ImageUpscaleTopazBloom2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactorJsonConverter), - || typeToConvert == typeof(global::Ideogram.AdVariationsQuality?) + typeof(global::Ideogram.JsonConverters.V2ImageUpscaleTopazBloom2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactorNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.SketchToRenderQuality) + typeof(global::Ideogram.JsonConverters.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactorJsonConverter), - || typeToConvert == typeof(global::Ideogram.SketchToRenderQuality?) + typeof(global::Ideogram.JsonConverters.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactorNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.SoleSwapRequestBaseGenerationSize) + typeof(global::Ideogram.JsonConverters.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetectionJsonConverter), - || typeToConvert == typeof(global::Ideogram.SoleSwapRequestBaseGenerationSize?) + typeof(global::Ideogram.JsonConverters.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetectionNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.SoleSwapQuality) + typeof(global::Ideogram.JsonConverters.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactorJsonConverter), - || typeToConvert == typeof(global::Ideogram.SoleSwapQuality?) + typeof(global::Ideogram.JsonConverters.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactorNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.SwapProductMode) + typeof(global::Ideogram.JsonConverters.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaSubjectDetectionJsonConverter), - || typeToConvert == typeof(global::Ideogram.SwapProductMode?) + typeof(global::Ideogram.JsonConverters.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaSubjectDetectionNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.SwapProductQuality) + typeof(global::Ideogram.JsonConverters.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactorJsonConverter), - || typeToConvert == typeof(global::Ideogram.SwapProductQuality?) + typeof(global::Ideogram.JsonConverters.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactorNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.SkechersStyleEditRequestAspectRatio) + typeof(global::Ideogram.JsonConverters.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetectionJsonConverter), - || typeToConvert == typeof(global::Ideogram.SkechersStyleEditRequestAspectRatio?) + typeof(global::Ideogram.JsonConverters.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetectionNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.SkechersStyleEditRequestBaseGenerationSize) + typeof(global::Ideogram.JsonConverters.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaUpscaleFactorJsonConverter), - || typeToConvert == typeof(global::Ideogram.SkechersStyleEditRequestBaseGenerationSize?) + typeof(global::Ideogram.JsonConverters.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaUpscaleFactorNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.SkechersStyleEditQuality) + typeof(global::Ideogram.JsonConverters.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaEnhancementStrengthJsonConverter), - || typeToConvert == typeof(global::Ideogram.SkechersStyleEditQuality?) + typeof(global::Ideogram.JsonConverters.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaEnhancementStrengthNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.SwanSLogoDesignRequestLogoStyle) + typeof(global::Ideogram.JsonConverters.V2ImageReplaceBackgroundIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedJsonConverter), - || typeToConvert == typeof(global::Ideogram.SwanSLogoDesignRequestLogoStyle?) + typeof(global::Ideogram.JsonConverters.V2ImageReplaceBackgroundIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.SwanSLogoDesignRequestSourceMode) + typeof(global::Ideogram.JsonConverters.ReplaceBackgroundQualityJsonConverter), - || typeToConvert == typeof(global::Ideogram.SwanSLogoDesignRequestSourceMode?) + typeof(global::Ideogram.JsonConverters.ReplaceBackgroundQualityNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.SwanSLogoDesignRequestDesignVariant) + typeof(global::Ideogram.JsonConverters.V4ObjPromptElementTypeJsonConverter), - || typeToConvert == typeof(global::Ideogram.SwanSLogoDesignRequestDesignVariant?) + typeof(global::Ideogram.JsonConverters.V4ObjPromptElementTypeNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.SwanSLogoQuality) + typeof(global::Ideogram.JsonConverters.V4TextPromptElementTypeJsonConverter), - || typeToConvert == typeof(global::Ideogram.SwanSLogoQuality?) + typeof(global::Ideogram.JsonConverters.V4TextPromptElementTypeNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.SwanSLogoInstallRequestLogoStyle) + typeof(global::Ideogram.JsonConverters.V4PromptElementDiscriminatorTypeJsonConverter), - || typeToConvert == typeof(global::Ideogram.SwanSLogoInstallRequestLogoStyle?) + typeof(global::Ideogram.JsonConverters.V4PromptElementDiscriminatorTypeNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.ModelSwapQuality) + typeof(global::Ideogram.JsonConverters.DetectedTextBlockAlignmentJsonConverter), - || typeToConvert == typeof(global::Ideogram.ModelSwapQuality?) + typeof(global::Ideogram.JsonConverters.DetectedTextBlockAlignmentNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.MaterialSwapQuality) + typeof(global::Ideogram.JsonConverters.DetectedTextBlockFormattingItemsJsonConverter), - || typeToConvert == typeof(global::Ideogram.MaterialSwapQuality?) + typeof(global::Ideogram.JsonConverters.DetectedTextBlockFormattingItemsNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.UpscaleToolRequestUpscaleFactor) + typeof(global::Ideogram.JsonConverters.DetectedTextBlockRoleJsonConverter), - || typeToConvert == typeof(global::Ideogram.UpscaleToolRequestUpscaleFactor?) + typeof(global::Ideogram.JsonConverters.DetectedTextBlockRoleNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.LayerizedImageObjectObjectType) + typeof(global::Ideogram.JsonConverters.KlingV3ShotTypeJsonConverter), - || typeToConvert == typeof(global::Ideogram.LayerizedImageObjectObjectType?) + typeof(global::Ideogram.JsonConverters.KlingV3ShotTypeNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV3RequestRenderingSpeed) + typeof(global::Ideogram.JsonConverters.KlingV3AspectRatioJsonConverter), - || typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV3RequestRenderingSpeed?) + typeof(global::Ideogram.JsonConverters.KlingV3AspectRatioNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV3CustomModelRequestRenderingSpeed) + typeof(global::Ideogram.JsonConverters.MinimaxH3ResolutionJsonConverter), - || typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV3CustomModelRequestRenderingSpeed?) + typeof(global::Ideogram.JsonConverters.MinimaxH3ResolutionNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV4RequestRenderingSpeed) + typeof(global::Ideogram.JsonConverters.MinimaxH3AspectRatioJsonConverter), - || typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV4RequestRenderingSpeed?) + typeof(global::Ideogram.JsonConverters.MinimaxH3AspectRatioNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV4CustomModelRequestRenderingSpeed) + typeof(global::Ideogram.JsonConverters.MinimaxH3PromptExpansionModeJsonConverter), - || typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV4CustomModelRequestRenderingSpeed?) + typeof(global::Ideogram.JsonConverters.MinimaxH3PromptExpansionModeNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.RemixImageIdeogramV3RequestRenderingSpeed) + typeof(global::Ideogram.JsonConverters.SeedDance25ResolutionJsonConverter), - || typeToConvert == typeof(global::Ideogram.RemixImageIdeogramV3RequestRenderingSpeed?) + typeof(global::Ideogram.JsonConverters.SeedDance25ResolutionNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.RemixImageIdeogramV3CustomModelRequestRenderingSpeed) + typeof(global::Ideogram.JsonConverters.SeedDance2AspectRatioJsonConverter), - || typeToConvert == typeof(global::Ideogram.RemixImageIdeogramV3CustomModelRequestRenderingSpeed?) + typeof(global::Ideogram.JsonConverters.SeedDance2AspectRatioNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.RemixImageIdeogramV4RequestRenderingSpeed) + typeof(global::Ideogram.JsonConverters.SeedDance2ResolutionJsonConverter), - || typeToConvert == typeof(global::Ideogram.RemixImageIdeogramV4RequestRenderingSpeed?) + typeof(global::Ideogram.JsonConverters.SeedDance2ResolutionNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.RemixImageIdeogramV3CharacterRequestRenderingSpeed) + typeof(global::Ideogram.JsonConverters.V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguageJsonConverter), - || typeToConvert == typeof(global::Ideogram.RemixImageIdeogramV3CharacterRequestRenderingSpeed?) + typeof(global::Ideogram.JsonConverters.V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguageNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.RemixImageIdeogramV3CharacterRequestStyleType) + typeof(global::Ideogram.JsonConverters.AdLocalizerQualityJsonConverter), - || typeToConvert == typeof(global::Ideogram.RemixImageIdeogramV3CharacterRequestStyleType?) + typeof(global::Ideogram.JsonConverters.AdLocalizerQualityNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV3TransparentRequestUpscaleFactor) + typeof(global::Ideogram.JsonConverters.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolutionJsonConverter), - || typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV3TransparentRequestUpscaleFactor?) + typeof(global::Ideogram.JsonConverters.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolutionNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV3TransparentRequestRenderingSpeed) + typeof(global::Ideogram.JsonConverters.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaPlatformJsonConverter), - || typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV3TransparentRequestRenderingSpeed?) + typeof(global::Ideogram.JsonConverters.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaPlatformNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV4TransparentRequestOutputResolution) + typeof(global::Ideogram.JsonConverters.AdResizerQualityJsonConverter), - || typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV4TransparentRequestOutputResolution?) + typeof(global::Ideogram.JsonConverters.AdResizerQualityNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV4TransparentRequestRenderingSpeed) + typeof(global::Ideogram.JsonConverters.V2ToolAdVariationsPostRequestBodyContentMultipartFormDataSchemaVariationTypeJsonConverter), - || typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV4TransparentRequestRenderingSpeed?) + typeof(global::Ideogram.JsonConverters.V2ToolAdVariationsPostRequestBodyContentMultipartFormDataSchemaVariationTypeNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.GenerateImagePImageIdeogramRequestResolution) + typeof(global::Ideogram.JsonConverters.AdVariationsQualityJsonConverter), - || typeToConvert == typeof(global::Ideogram.GenerateImagePImageIdeogramRequestResolution?) + typeof(global::Ideogram.JsonConverters.AdVariationsQualityNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.GenerateImageIdeogram45RequestBackground) + typeof(global::Ideogram.JsonConverters.ColorwaysQualityJsonConverter), - || typeToConvert == typeof(global::Ideogram.GenerateImageIdeogram45RequestBackground?) + typeof(global::Ideogram.JsonConverters.ColorwaysQualityNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.GenerateImageIdeogram45RequestQuality) + typeof(global::Ideogram.JsonConverters.AssetTypeJsonConverter), - || typeToConvert == typeof(global::Ideogram.GenerateImageIdeogram45RequestQuality?) + typeof(global::Ideogram.JsonConverters.AssetTypeNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.PreciseEditImageIdeogram45RequestQuality) + typeof(global::Ideogram.JsonConverters.V2ToolGhostMannequinPostRequestBodyContentMultipartFormDataSchemaViewJsonConverter), - || typeToConvert == typeof(global::Ideogram.PreciseEditImageIdeogram45RequestQuality?) + typeof(global::Ideogram.JsonConverters.V2ToolGhostMannequinPostRequestBodyContentMultipartFormDataSchemaViewNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.GenerateImageNanoBanana2RequestResolutionTier) + typeof(global::Ideogram.JsonConverters.GhostMannequinQualityJsonConverter), - || typeToConvert == typeof(global::Ideogram.GenerateImageNanoBanana2RequestResolutionTier?) + typeof(global::Ideogram.JsonConverters.GhostMannequinQualityNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.GenerateImageNanoBanana21RequestResolutionTier) + typeof(global::Ideogram.JsonConverters.MaterialSwapQualityJsonConverter), - || typeToConvert == typeof(global::Ideogram.GenerateImageNanoBanana21RequestResolutionTier?) + typeof(global::Ideogram.JsonConverters.MaterialSwapQualityNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.GenerateImageNanoBananaProRequestResolutionTier) + typeof(global::Ideogram.JsonConverters.ModelPoseVariantsQualityJsonConverter), - || typeToConvert == typeof(global::Ideogram.GenerateImageNanoBananaProRequestResolutionTier?) + typeof(global::Ideogram.JsonConverters.ModelPoseVariantsQualityNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.GenerateImageGptImage25FlareRequestBackground) + typeof(global::Ideogram.JsonConverters.SketchToRenderQualityJsonConverter), - || typeToConvert == typeof(global::Ideogram.GenerateImageGptImage25FlareRequestBackground?) + typeof(global::Ideogram.JsonConverters.SketchToRenderQualityNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.GenerateImageGptImage25FlareRequestQuality) + typeof(global::Ideogram.JsonConverters.GenerationResponseStatusJsonConverter), - || typeToConvert == typeof(global::Ideogram.GenerateImageGptImage25FlareRequestQuality?) + typeof(global::Ideogram.JsonConverters.GenerationResponseStatusNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.GenerateImageGptImage25SunburstRequestBackground) + typeof(global::Ideogram.JsonConverters.GenerationResponseResponseTypeJsonConverter), - || typeToConvert == typeof(global::Ideogram.GenerateImageGptImage25SunburstRequestBackground?) + typeof(global::Ideogram.JsonConverters.GenerationResponseResponseTypeNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.GenerateImageGptImage25SunburstRequestQuality) + typeof(global::Ideogram.JsonConverters.GenerationResponseDataInnerDiscriminatorMappingSvgGenerationMimeTypeJsonConverter), - || typeToConvert == typeof(global::Ideogram.GenerateImageGptImage25SunburstRequestQuality?) + typeof(global::Ideogram.JsonConverters.GenerationResponseDataInnerDiscriminatorMappingSvgGenerationMimeTypeNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV2RequestRenderingSpeed) + typeof(global::Ideogram.JsonConverters.LayerizedTextBlockAlignmentJsonConverter), - || typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV2RequestRenderingSpeed?) + typeof(global::Ideogram.JsonConverters.LayerizedTextBlockAlignmentNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV2ARequestRenderingSpeed) + typeof(global::Ideogram.JsonConverters.LayerizedTextBlockFormattingItemsJsonConverter), - || typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV2ARequestRenderingSpeed?) + typeof(global::Ideogram.JsonConverters.LayerizedTextBlockFormattingItemsNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.InpaintImageIdeogramV3RequestRenderingSpeed) + typeof(global::Ideogram.JsonConverters.LayerizedTextBlockRoleJsonConverter), - || typeToConvert == typeof(global::Ideogram.InpaintImageIdeogramV3RequestRenderingSpeed?) + typeof(global::Ideogram.JsonConverters.LayerizedTextBlockRoleNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.InpaintImageIdeogramV3CustomModelRequestRenderingSpeed) + typeof(global::Ideogram.JsonConverters.GenerationResponseDataInnerVariant1ObjectTypeJsonConverter), - || typeToConvert == typeof(global::Ideogram.InpaintImageIdeogramV3CustomModelRequestRenderingSpeed?) + typeof(global::Ideogram.JsonConverters.GenerationResponseDataInnerVariant1ObjectTypeNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.ReframeImageIdeogramV3RequestRenderingSpeed) + typeof(global::Ideogram.JsonConverters.GenerationResponseDataInnerVariant2ObjectTypeJsonConverter), - || typeToConvert == typeof(global::Ideogram.ReframeImageIdeogramV3RequestRenderingSpeed?) + typeof(global::Ideogram.JsonConverters.GenerationResponseDataInnerVariant2ObjectTypeNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.ReframeImageNanoBananaProRequestResolutionTier) + typeof(global::Ideogram.JsonConverters.GenerationResponseDataInnerVariant3ObjectTypeJsonConverter), - || typeToConvert == typeof(global::Ideogram.ReframeImageNanoBananaProRequestResolutionTier?) + typeof(global::Ideogram.JsonConverters.GenerationResponseDataInnerVariant3ObjectTypeNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.ReframeImageGptImage25FlareRequestQuality) + typeof(global::Ideogram.JsonConverters.GenerationResponseDataInnerVariant4ObjectTypeJsonConverter), - || typeToConvert == typeof(global::Ideogram.ReframeImageGptImage25FlareRequestQuality?) + typeof(global::Ideogram.JsonConverters.GenerationResponseDataInnerVariant4ObjectTypeNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV3CharacterRequestRenderingSpeed) + typeof(global::Ideogram.JsonConverters.GenerationResponseDataInnerVariant5ObjectTypeJsonConverter), - || typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV3CharacterRequestRenderingSpeed?) + typeof(global::Ideogram.JsonConverters.GenerationResponseDataInnerVariant5ObjectTypeNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV3CharacterRequestStyleType) + typeof(global::Ideogram.JsonConverters.GenerationResponseDataInnerVariant6ObjectTypeJsonConverter), - || typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV3CharacterRequestStyleType?) + typeof(global::Ideogram.JsonConverters.GenerationResponseDataInnerVariant6ObjectTypeNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.InpaintImageIdeogramV3CharacterRequestRenderingSpeed) + typeof(global::Ideogram.JsonConverters.GenerationResponseDataInnerDiscriminatorObjectTypeJsonConverter), - || typeToConvert == typeof(global::Ideogram.InpaintImageIdeogramV3CharacterRequestRenderingSpeed?) + typeof(global::Ideogram.JsonConverters.GenerationResponseDataInnerDiscriminatorObjectTypeNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.InpaintImageIdeogramV3CharacterRequestStyleType) + typeof(global::Ideogram.JsonConverters.AccountApiKeyStatusJsonConverter), - || typeToConvert == typeof(global::Ideogram.InpaintImageIdeogramV3CharacterRequestStyleType?) + typeof(global::Ideogram.JsonConverters.AccountApiKeyStatusNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.GenerateImageV2AutoRequestResolutionTier) + typeof(global::Ideogram.JsonConverters.AccountInvoiceStatusJsonConverter), - || typeToConvert == typeof(global::Ideogram.GenerateImageV2AutoRequestResolutionTier?) + typeof(global::Ideogram.JsonConverters.AccountInvoiceStatusNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.ToolRemixRequestResolutionTier) + typeof(global::Ideogram.JsonConverters.V2AccountUsageGetParametersBucketWidthJsonConverter), - || typeToConvert == typeof(global::Ideogram.ToolRemixRequestResolutionTier?) + typeof(global::Ideogram.JsonConverters.V2AccountUsageGetParametersBucketWidthNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.ResizeAdImageRequestResolution) + typeof(global::Ideogram.JsonConverters.V2AccountUsageGetParametersSourcesSchemaItemsJsonConverter), - || typeToConvert == typeof(global::Ideogram.ResizeAdImageRequestResolution?) + typeof(global::Ideogram.JsonConverters.V2AccountUsageGetParametersSourcesSchemaItemsNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.ResizeAdImageQuality) + typeof(global::Ideogram.JsonConverters.AccountUsageLineItemSourceJsonConverter), - || typeToConvert == typeof(global::Ideogram.ResizeAdImageQuality?) + typeof(global::Ideogram.JsonConverters.AccountUsageLineItemSourceNullableJsonConverter), - || typeToConvert == typeof(global::Ideogram.ProvenanceVerifyResponseValidationState) + typeof(global::Ideogram.JsonConverters.IdeogramColorPaletteJsonConverter), - || typeToConvert == typeof(global::Ideogram.ProvenanceVerifyResponseValidationState?) + typeof(global::Ideogram.JsonConverters.V4PromptElementJsonConverter), - || typeToConvert == typeof(global::Ideogram.ApiKeyStatus) + typeof(global::Ideogram.JsonConverters.GenerationResponseDataInnerJsonConverter), - || typeToConvert == typeof(global::Ideogram.ApiKeyStatus?) - - || typeToConvert == typeof(global::Ideogram.ToolType) - - || typeToConvert == typeof(global::Ideogram.ToolType?) - - || typeToConvert == typeof(global::Ideogram.SegmentBy) - - || typeToConvert == typeof(global::Ideogram.SegmentBy?) - - || typeToConvert == typeof(global::Ideogram.UsageSource) - - || typeToConvert == typeof(global::Ideogram.UsageSource?) - - || typeToConvert == typeof(global::Ideogram.ModelVersion) - - || typeToConvert == typeof(global::Ideogram.ModelVersion?) - - || typeToConvert == typeof(global::Ideogram.ApiProfileType) - - || typeToConvert == typeof(global::Ideogram.ApiProfileType?) - - || typeToConvert == typeof(global::Ideogram.ApiProfileRole) - - || typeToConvert == typeof(global::Ideogram.ApiProfileRole?) - - || typeToConvert == typeof(global::Ideogram.InvoiceStatus) - - || typeToConvert == typeof(global::Ideogram.InvoiceStatus?) - - || typeToConvert == typeof(global::Ideogram.DatasetAssetFailureReason) - - || typeToConvert == typeof(global::Ideogram.DatasetAssetFailureReason?) - - || typeToConvert == typeof(global::Ideogram.ModelStatus) - - || typeToConvert == typeof(global::Ideogram.ModelStatus?) - - || typeToConvert == typeof(global::Ideogram.TrainingRunStatus) - - || typeToConvert == typeof(global::Ideogram.TrainingRunStatus?) - - || typeToConvert == typeof(global::Ideogram.PublishMiniAppRequestEmbed) - - || typeToConvert == typeof(global::Ideogram.PublishMiniAppRequestEmbed?) - - || typeToConvert == typeof(global::Ideogram.PublishMiniAppPreviewRequestEmbed) - - || typeToConvert == typeof(global::Ideogram.PublishMiniAppPreviewRequestEmbed?) - - || typeToConvert == typeof(global::Ideogram.MiniAppMarketingProjectionEntryEmbed) - - || typeToConvert == typeof(global::Ideogram.MiniAppMarketingProjectionEntryEmbed?) - - || typeToConvert == typeof(global::Ideogram.IntegrationType) - - || typeToConvert == typeof(global::Ideogram.IntegrationType?) - - || typeToConvert == typeof(global::Ideogram.IntegrationErrorResponseError) - - || typeToConvert == typeof(global::Ideogram.IntegrationErrorResponseError?) - - || typeToConvert == typeof(global::Ideogram.V4PromptElementDiscriminatorType) - - || typeToConvert == typeof(global::Ideogram.V4PromptElementDiscriminatorType?) - - || typeToConvert == typeof(global::Ideogram.V4ObjPromptElementType) - - || typeToConvert == typeof(global::Ideogram.V4ObjPromptElementType?) - - || typeToConvert == typeof(global::Ideogram.V4TextPromptElementType) - - || typeToConvert == typeof(global::Ideogram.V4TextPromptElementType?) - - || typeToConvert == typeof(global::Ideogram.ResolutionV4) - - || typeToConvert == typeof(global::Ideogram.ResolutionV4?) - - || typeToConvert == typeof(global::Ideogram.RenderingSpeed) - - || typeToConvert == typeof(global::Ideogram.RenderingSpeed?) - - || typeToConvert == typeof(global::Ideogram.AspectRatioV4) - - || typeToConvert == typeof(global::Ideogram.AspectRatioV4?) - - || typeToConvert == typeof(global::Ideogram.MagicPromptOption) - - || typeToConvert == typeof(global::Ideogram.MagicPromptOption?) - - || typeToConvert == typeof(global::Ideogram.Quality) - - || typeToConvert == typeof(global::Ideogram.Quality?) - - || typeToConvert == typeof(global::Ideogram.AspectRatioV3) - - || typeToConvert == typeof(global::Ideogram.AspectRatioV3?) - - || typeToConvert == typeof(global::Ideogram.ResolutionV4ImageToImage) - - || typeToConvert == typeof(global::Ideogram.ResolutionV4ImageToImage?) - - || typeToConvert == typeof(global::Ideogram.ResolutionV4Layout) - - || typeToConvert == typeof(global::Ideogram.ResolutionV4Layout?) - - || typeToConvert == typeof(global::Ideogram.DescribeModelVersion) - - || typeToConvert == typeof(global::Ideogram.DescribeModelVersion?) - - || typeToConvert == typeof(global::Ideogram.StyleType) - - || typeToConvert == typeof(global::Ideogram.StyleType?) - - || typeToConvert == typeof(global::Ideogram.ResolutionV3) - - || typeToConvert == typeof(global::Ideogram.ResolutionV3?) - - || typeToConvert == typeof(global::Ideogram.ColorPalettePresetName) - - || typeToConvert == typeof(global::Ideogram.ColorPalettePresetName?) - - || typeToConvert == typeof(global::Ideogram.StyleTypeV3) - - || typeToConvert == typeof(global::Ideogram.StyleTypeV3?) - - || typeToConvert == typeof(global::Ideogram.StylePresetV3) - - || typeToConvert == typeof(global::Ideogram.StylePresetV3?) - - || typeToConvert == typeof(global::Ideogram.UpscaleFactor) - - || typeToConvert == typeof(global::Ideogram.UpscaleFactor?) - - || typeToConvert == typeof(global::Ideogram.Resolution) - - || typeToConvert == typeof(global::Ideogram.Resolution?) - - || typeToConvert == typeof(global::Ideogram.AspectRatio) - - || typeToConvert == typeof(global::Ideogram.AspectRatio?) - - || typeToConvert == typeof(global::Ideogram.MagicPromptVersionEnum) - - || typeToConvert == typeof(global::Ideogram.MagicPromptVersionEnum?) - - || typeToConvert == typeof(global::Ideogram.SvgGenerationObjectObjectType) - - || typeToConvert == typeof(global::Ideogram.SvgGenerationObjectObjectType?) - - || typeToConvert == typeof(global::Ideogram.SvgGenerationObjectMimeType) - - || typeToConvert == typeof(global::Ideogram.SvgGenerationObjectMimeType?) - - || typeToConvert == typeof(global::Ideogram.VideoObjectObjectType) - - || typeToConvert == typeof(global::Ideogram.VideoObjectObjectType?) - - || typeToConvert == typeof(global::Ideogram.TextLayerizerResultObjectObjectType) - - || typeToConvert == typeof(global::Ideogram.TextLayerizerResultObjectObjectType?) - - || typeToConvert == typeof(global::Ideogram.DetectedTextBlockAlignment) - - || typeToConvert == typeof(global::Ideogram.DetectedTextBlockAlignment?) - - || typeToConvert == typeof(global::Ideogram.DetectedTextBlockFormattingItem) - - || typeToConvert == typeof(global::Ideogram.DetectedTextBlockFormattingItem?) - - || typeToConvert == typeof(global::Ideogram.DetectedTextBlockRole) - - || typeToConvert == typeof(global::Ideogram.DetectedTextBlockRole?) - - || typeToConvert == typeof(global::Ideogram.AssetType) - - || typeToConvert == typeof(global::Ideogram.AssetType?) - - || typeToConvert == typeof(global::Ideogram.SeedDance2AspectRatio) - - || typeToConvert == typeof(global::Ideogram.SeedDance2AspectRatio?) - - || typeToConvert == typeof(global::Ideogram.SeedDance2Resolution) - - || typeToConvert == typeof(global::Ideogram.SeedDance2Resolution?) - - || typeToConvert == typeof(global::Ideogram.MinimaxH3AspectRatio) - - || typeToConvert == typeof(global::Ideogram.MinimaxH3AspectRatio?) - - || typeToConvert == typeof(global::Ideogram.MinimaxH3Resolution) - - || typeToConvert == typeof(global::Ideogram.MinimaxH3Resolution?) - - || typeToConvert == typeof(global::Ideogram.KlingV3AspectRatio) - - || typeToConvert == typeof(global::Ideogram.KlingV3AspectRatio?) - - || typeToConvert == typeof(global::Ideogram.KlingV3ShotType) - - || typeToConvert == typeof(global::Ideogram.KlingV3ShotType?) - - || typeToConvert == typeof(global::Ideogram.MinimaxH3PromptExpansionMode) - - || typeToConvert == typeof(global::Ideogram.MinimaxH3PromptExpansionMode?) - - || typeToConvert == typeof(global::Ideogram.IdeogramV3AspectRatio) - - || typeToConvert == typeof(global::Ideogram.IdeogramV3AspectRatio?) - - || typeToConvert == typeof(global::Ideogram.MagicPromptMode) - - || typeToConvert == typeof(global::Ideogram.MagicPromptMode?) - - || typeToConvert == typeof(global::Ideogram.IdeogramColorPalettePresetName) - - || typeToConvert == typeof(global::Ideogram.IdeogramColorPalettePresetName?) - - || typeToConvert == typeof(global::Ideogram.IdeogramV3StyleType) - - || typeToConvert == typeof(global::Ideogram.IdeogramV3StyleType?) - - || typeToConvert == typeof(global::Ideogram.IdeogramV3StylePreset) - - || typeToConvert == typeof(global::Ideogram.IdeogramV3StylePreset?) - - || typeToConvert == typeof(global::Ideogram.IdeogramV4AspectRatio) - - || typeToConvert == typeof(global::Ideogram.IdeogramV4AspectRatio?) - - || typeToConvert == typeof(global::Ideogram.GenerationQuality) - - || typeToConvert == typeof(global::Ideogram.GenerationQuality?) - - || typeToConvert == typeof(global::Ideogram.GenerationKind) - - || typeToConvert == typeof(global::Ideogram.GenerationKind?) - - || typeToConvert == typeof(global::Ideogram.NanoBanana2AspectRatio) - - || typeToConvert == typeof(global::Ideogram.NanoBanana2AspectRatio?) - - || typeToConvert == typeof(global::Ideogram.NanoBanana21AspectRatio) - - || typeToConvert == typeof(global::Ideogram.NanoBanana21AspectRatio?) - - || typeToConvert == typeof(global::Ideogram.NanoBananaProAspectRatio) - - || typeToConvert == typeof(global::Ideogram.NanoBananaProAspectRatio?) - - || typeToConvert == typeof(global::Ideogram.IdeogramV2StyleType) - - || typeToConvert == typeof(global::Ideogram.IdeogramV2StyleType?) - - || typeToConvert == typeof(global::Ideogram.NanoBanana2ReframeAspectRatio) - - || typeToConvert == typeof(global::Ideogram.NanoBanana2ReframeAspectRatio?) - - || typeToConvert == typeof(global::Ideogram.NanoBananaProReframeAspectRatio) - - || typeToConvert == typeof(global::Ideogram.NanoBananaProReframeAspectRatio?) - - || typeToConvert == typeof(global::Ideogram.AttributeValueType) - - || typeToConvert == typeof(global::Ideogram.AttributeValueType?) - - || typeToConvert == typeof(global::Ideogram.PostGenerateDesignV4200ResponseDiscriminatorResponseType) - - || typeToConvert == typeof(global::Ideogram.PostGenerateDesignV4200ResponseDiscriminatorResponseType?) - - || typeToConvert == typeof(global::Ideogram.GenerationResponseDataInnerDiscriminatorObjectType) - - || typeToConvert == typeof(global::Ideogram.GenerationResponseDataInnerDiscriminatorObjectType?) - - || typeToConvert == typeof(global::Ideogram.MagicPromptRequestMessagesInnerRole) - - || typeToConvert == typeof(global::Ideogram.MagicPromptRequestMessagesInnerRole?) - - || typeToConvert == typeof(global::Ideogram.ListCustomModelsScope) - - || typeToConvert == typeof(global::Ideogram.ListCustomModelsScope?) - - || typeToConvert == typeof(global::Ideogram.GetAccountUsageBucketWidth) - - || typeToConvert == typeof(global::Ideogram.GetAccountUsageBucketWidth?) - - || typeToConvert == typeof(global::Ideogram.GetAccountUsageSource) - - || typeToConvert == typeof(global::Ideogram.GetAccountUsageSource?); - } - - public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - if (typeToConvert == typeof(global::Ideogram.PriceQuoteObject)) - { - return new global::Ideogram.JsonConverters.PriceQuoteObjectJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.PriceQuoteObject?)) - { - return new global::Ideogram.JsonConverters.PriceQuoteObjectNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.PriceQualifier)) - { - return new global::Ideogram.JsonConverters.PriceQualifierJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.PriceQualifier?)) - { - return new global::Ideogram.JsonConverters.PriceQualifierNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.OutputResolution)) - { - return new global::Ideogram.JsonConverters.OutputResolutionJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.OutputResolution?)) - { - return new global::Ideogram.JsonConverters.OutputResolutionNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.RenderingSpeedV4)) - { - return new global::Ideogram.JsonConverters.RenderingSpeedV4JsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.RenderingSpeedV4?)) - { - return new global::Ideogram.JsonConverters.RenderingSpeedV4NullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.PImageResolution)) - { - return new global::Ideogram.JsonConverters.PImageResolutionJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.PImageResolution?)) - { - return new global::Ideogram.JsonConverters.PImageResolutionNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerateImageRequestV4StableVersion)) - { - return new global::Ideogram.JsonConverters.GenerateImageRequestV4StableVersionJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerateImageRequestV4StableVersion?)) - { - return new global::Ideogram.JsonConverters.GenerateImageRequestV4StableVersionNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerateDesignRequestV4InspirationReferenceModel)) - { - return new global::Ideogram.JsonConverters.GenerateDesignRequestV4InspirationReferenceModelJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerateDesignRequestV4InspirationReferenceModel?)) - { - return new global::Ideogram.JsonConverters.GenerateDesignRequestV4InspirationReferenceModelNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerateDesignRequestV4ArtifactGenerationModel)) - { - return new global::Ideogram.JsonConverters.GenerateDesignRequestV4ArtifactGenerationModelJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerateDesignRequestV4ArtifactGenerationModel?)) - { - return new global::Ideogram.JsonConverters.GenerateDesignRequestV4ArtifactGenerationModelNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerateDesignRequestV4Layout2imageVariant)) - { - return new global::Ideogram.JsonConverters.GenerateDesignRequestV4Layout2imageVariantJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerateDesignRequestV4Layout2imageVariant?)) - { - return new global::Ideogram.JsonConverters.GenerateDesignRequestV4Layout2imageVariantNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerateDesignRequestV4ResponseType)) - { - return new global::Ideogram.JsonConverters.GenerateDesignRequestV4ResponseTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerateDesignRequestV4ResponseType?)) - { - return new global::Ideogram.JsonConverters.GenerateDesignRequestV4ResponseTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.TransparencyOption)) - { - return new global::Ideogram.JsonConverters.TransparencyOptionJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.TransparencyOption?)) - { - return new global::Ideogram.JsonConverters.TransparencyOptionNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.AspectRatioEditLite)) - { - return new global::Ideogram.JsonConverters.AspectRatioEditLiteJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.AspectRatioEditLite?)) - { - return new global::Ideogram.JsonConverters.AspectRatioEditLiteNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.InternalTestingEnumField)) - { - return new global::Ideogram.JsonConverters.InternalTestingEnumFieldJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.InternalTestingEnumField?)) - { - return new global::Ideogram.JsonConverters.InternalTestingEnumFieldNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ImageGenerationResponseV4ResponseType)) - { - return new global::Ideogram.JsonConverters.ImageGenerationResponseV4ResponseTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ImageGenerationResponseV4ResponseType?)) - { - return new global::Ideogram.JsonConverters.ImageGenerationResponseV4ResponseTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerationResponseStatus)) - { - return new global::Ideogram.JsonConverters.GenerationResponseStatusJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerationResponseStatus?)) - { - return new global::Ideogram.JsonConverters.GenerationResponseStatusNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerationResponseResponseType)) - { - return new global::Ideogram.JsonConverters.GenerationResponseResponseTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerationResponseResponseType?)) - { - return new global::Ideogram.JsonConverters.GenerationResponseResponseTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ImageObjectWithoutPromptOrSeedObjectType)) - { - return new global::Ideogram.JsonConverters.ImageObjectWithoutPromptOrSeedObjectTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ImageObjectWithoutPromptOrSeedObjectType?)) - { - return new global::Ideogram.JsonConverters.ImageObjectWithoutPromptOrSeedObjectTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ImageGenerationObjectObjectType)) - { - return new global::Ideogram.JsonConverters.ImageGenerationObjectObjectTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ImageGenerationObjectObjectType?)) - { - return new global::Ideogram.JsonConverters.ImageGenerationObjectObjectTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ImageGenerationResponseV4ImageToImageResponseType)) - { - return new global::Ideogram.JsonConverters.ImageGenerationResponseV4ImageToImageResponseTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ImageGenerationResponseV4ImageToImageResponseType?)) - { - return new global::Ideogram.JsonConverters.ImageGenerationResponseV4ImageToImageResponseTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ImageGenerationResponseV4LayoutResponseType)) - { - return new global::Ideogram.JsonConverters.ImageGenerationResponseV4LayoutResponseTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ImageGenerationResponseV4LayoutResponseType?)) - { - return new global::Ideogram.JsonConverters.ImageGenerationResponseV4LayoutResponseTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.LayeredImageGenerationResponseV3ResponseType)) - { - return new global::Ideogram.JsonConverters.LayeredImageGenerationResponseV3ResponseTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.LayeredImageGenerationResponseV3ResponseType?)) - { - return new global::Ideogram.JsonConverters.LayeredImageGenerationResponseV3ResponseTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ModelEnum)) - { - return new global::Ideogram.JsonConverters.ModelEnumJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ModelEnum?)) - { - return new global::Ideogram.JsonConverters.ModelEnumNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.TextSpanV3FontFxItem)) - { - return new global::Ideogram.JsonConverters.TextSpanV3FontFxItemJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.TextSpanV3FontFxItem?)) - { - return new global::Ideogram.JsonConverters.TextSpanV3FontFxItemNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.TextItemV3Alignment)) - { - return new global::Ideogram.JsonConverters.TextItemV3AlignmentJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.TextItemV3Alignment?)) - { - return new global::Ideogram.JsonConverters.TextItemV3AlignmentNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.TextItemV3StyleClass)) - { - return new global::Ideogram.JsonConverters.TextItemV3StyleClassJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.TextItemV3StyleClass?)) - { - return new global::Ideogram.JsonConverters.TextItemV3StyleClassNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.TextItemV3GlyphType)) - { - return new global::Ideogram.JsonConverters.TextItemV3GlyphTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.TextItemV3GlyphType?)) - { - return new global::Ideogram.JsonConverters.TextItemV3GlyphTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.TextItemV3TextTransform)) - { - return new global::Ideogram.JsonConverters.TextItemV3TextTransformJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.TextItemV3TextTransform?)) - { - return new global::Ideogram.JsonConverters.TextItemV3TextTransformNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.TextItemV3VerticalAlignment)) - { - return new global::Ideogram.JsonConverters.TextItemV3VerticalAlignmentJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.TextItemV3VerticalAlignment?)) - { - return new global::Ideogram.JsonConverters.TextItemV3VerticalAlignmentNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed)) - { - return new global::Ideogram.JsonConverters.GenerationErrorResponseTaskCompletionSpeedJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?)) - { - return new global::Ideogram.JsonConverters.GenerationErrorResponseTaskCompletionSpeedNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerationRejectReason)) - { - return new global::Ideogram.JsonConverters.GenerationRejectReasonJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerationRejectReason?)) - { - return new global::Ideogram.JsonConverters.GenerationRejectReasonNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.SeedDance25Resolution)) - { - return new global::Ideogram.JsonConverters.SeedDance25ResolutionJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.SeedDance25Resolution?)) - { - return new global::Ideogram.JsonConverters.SeedDance25ResolutionNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ReplaceBackgroundQuality)) - { - return new global::Ideogram.JsonConverters.ReplaceBackgroundQualityJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ReplaceBackgroundQuality?)) - { - return new global::Ideogram.JsonConverters.ReplaceBackgroundQualityNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ReplaceBackgroundIdeogramV3RequestRenderingSpeed)) - { - return new global::Ideogram.JsonConverters.ReplaceBackgroundIdeogramV3RequestRenderingSpeedJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ReplaceBackgroundIdeogramV3RequestRenderingSpeed?)) - { - return new global::Ideogram.JsonConverters.ReplaceBackgroundIdeogramV3RequestRenderingSpeedNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.AccountApiKeyStatus)) - { - return new global::Ideogram.JsonConverters.AccountApiKeyStatusJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.AccountApiKeyStatus?)) - { - return new global::Ideogram.JsonConverters.AccountApiKeyStatusNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.AccountUsageLineItemSource)) - { - return new global::Ideogram.JsonConverters.AccountUsageLineItemSourceJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.AccountUsageLineItemSource?)) - { - return new global::Ideogram.JsonConverters.AccountUsageLineItemSourceNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.AccountInvoiceStatus)) - { - return new global::Ideogram.JsonConverters.AccountInvoiceStatusJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.AccountInvoiceStatus?)) - { - return new global::Ideogram.JsonConverters.AccountInvoiceStatusNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.UpscaleImageTopazTextRefineRequestUpscaleFactor)) - { - return new global::Ideogram.JsonConverters.UpscaleImageTopazTextRefineRequestUpscaleFactorJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.UpscaleImageTopazTextRefineRequestUpscaleFactor?)) - { - return new global::Ideogram.JsonConverters.UpscaleImageTopazTextRefineRequestUpscaleFactorNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.UpscaleImageTopazTextRefineRequestSubjectDetection)) - { - return new global::Ideogram.JsonConverters.UpscaleImageTopazTextRefineRequestSubjectDetectionJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.UpscaleImageTopazTextRefineRequestSubjectDetection?)) - { - return new global::Ideogram.JsonConverters.UpscaleImageTopazTextRefineRequestSubjectDetectionNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.UpscaleImageTopazWonder35RequestUpscaleFactor)) - { - return new global::Ideogram.JsonConverters.UpscaleImageTopazWonder35RequestUpscaleFactorJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.UpscaleImageTopazWonder35RequestUpscaleFactor?)) - { - return new global::Ideogram.JsonConverters.UpscaleImageTopazWonder35RequestUpscaleFactorNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.UpscaleImageTopazWonder35RequestEnhancementStrength)) - { - return new global::Ideogram.JsonConverters.UpscaleImageTopazWonder35RequestEnhancementStrengthJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.UpscaleImageTopazWonder35RequestEnhancementStrength?)) - { - return new global::Ideogram.JsonConverters.UpscaleImageTopazWonder35RequestEnhancementStrengthNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.UpscaleImageTopazStandardV2RequestUpscaleFactor)) - { - return new global::Ideogram.JsonConverters.UpscaleImageTopazStandardV2RequestUpscaleFactorJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.UpscaleImageTopazStandardV2RequestUpscaleFactor?)) - { - return new global::Ideogram.JsonConverters.UpscaleImageTopazStandardV2RequestUpscaleFactorNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.UpscaleImageTopazStandardV2RequestSubjectDetection)) - { - return new global::Ideogram.JsonConverters.UpscaleImageTopazStandardV2RequestSubjectDetectionJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.UpscaleImageTopazStandardV2RequestSubjectDetection?)) - { - return new global::Ideogram.JsonConverters.UpscaleImageTopazStandardV2RequestSubjectDetectionNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.UpscaleImageTopazBloom2RequestUpscaleFactor)) - { - return new global::Ideogram.JsonConverters.UpscaleImageTopazBloom2RequestUpscaleFactorJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.UpscaleImageTopazBloom2RequestUpscaleFactor?)) - { - return new global::Ideogram.JsonConverters.UpscaleImageTopazBloom2RequestUpscaleFactorNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.UpscaleImageTopazRedefineRequestUpscaleFactor)) - { - return new global::Ideogram.JsonConverters.UpscaleImageTopazRedefineRequestUpscaleFactorJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.UpscaleImageTopazRedefineRequestUpscaleFactor?)) - { - return new global::Ideogram.JsonConverters.UpscaleImageTopazRedefineRequestUpscaleFactorNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.UpscaleImageTopazRedefineRequestSubjectDetection)) - { - return new global::Ideogram.JsonConverters.UpscaleImageTopazRedefineRequestSubjectDetectionJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.UpscaleImageTopazRedefineRequestSubjectDetection?)) - { - return new global::Ideogram.JsonConverters.UpscaleImageTopazRedefineRequestSubjectDetectionNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.UpscaleImageNanoBananaProRequestResolutionTier)) - { - return new global::Ideogram.JsonConverters.UpscaleImageNanoBananaProRequestResolutionTierJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.UpscaleImageNanoBananaProRequestResolutionTier?)) - { - return new global::Ideogram.JsonConverters.UpscaleImageNanoBananaProRequestResolutionTierNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.LookbookRequestCategory)) - { - return new global::Ideogram.JsonConverters.LookbookRequestCategoryJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.LookbookRequestCategory?)) - { - return new global::Ideogram.JsonConverters.LookbookRequestCategoryNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ModelPoseVariantsQuality)) - { - return new global::Ideogram.JsonConverters.ModelPoseVariantsQualityJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ModelPoseVariantsQuality?)) - { - return new global::Ideogram.JsonConverters.ModelPoseVariantsQualityNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.PackshotView)) - { - return new global::Ideogram.JsonConverters.PackshotViewJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.PackshotView?)) - { - return new global::Ideogram.JsonConverters.PackshotViewNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.PackshotsQuality)) - { - return new global::Ideogram.JsonConverters.PackshotsQualityJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.PackshotsQuality?)) - { - return new global::Ideogram.JsonConverters.PackshotsQualityNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GhostMannequinRequestView)) - { - return new global::Ideogram.JsonConverters.GhostMannequinRequestViewJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GhostMannequinRequestView?)) - { - return new global::Ideogram.JsonConverters.GhostMannequinRequestViewNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GhostMannequinQuality)) - { - return new global::Ideogram.JsonConverters.GhostMannequinQualityJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GhostMannequinQuality?)) - { - return new global::Ideogram.JsonConverters.GhostMannequinQualityNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.Product360VideoDirection)) - { - return new global::Ideogram.JsonConverters.Product360VideoDirectionJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.Product360VideoDirection?)) - { - return new global::Ideogram.JsonConverters.Product360VideoDirectionNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.LivingImageQuality)) - { - return new global::Ideogram.JsonConverters.LivingImageQualityJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.LivingImageQuality?)) - { - return new global::Ideogram.JsonConverters.LivingImageQualityNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.PreciseMaskedEditModel)) - { - return new global::Ideogram.JsonConverters.PreciseMaskedEditModelJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.PreciseMaskedEditModel?)) - { - return new global::Ideogram.JsonConverters.PreciseMaskedEditModelNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.PreciseMaskedEditQuality)) - { - return new global::Ideogram.JsonConverters.PreciseMaskedEditQualityJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.PreciseMaskedEditQuality?)) - { - return new global::Ideogram.JsonConverters.PreciseMaskedEditQualityNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ColorwaysQuality)) - { - return new global::Ideogram.JsonConverters.ColorwaysQualityJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ColorwaysQuality?)) - { - return new global::Ideogram.JsonConverters.ColorwaysQualityNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.AdLocalizerRequestLanguage)) - { - return new global::Ideogram.JsonConverters.AdLocalizerRequestLanguageJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.AdLocalizerRequestLanguage?)) - { - return new global::Ideogram.JsonConverters.AdLocalizerRequestLanguageNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.AdLocalizerQuality)) - { - return new global::Ideogram.JsonConverters.AdLocalizerQualityJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.AdLocalizerQuality?)) - { - return new global::Ideogram.JsonConverters.AdLocalizerQualityNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.VectorizerRequestMode)) - { - return new global::Ideogram.JsonConverters.VectorizerRequestModeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.VectorizerRequestMode?)) - { - return new global::Ideogram.JsonConverters.VectorizerRequestModeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.AdResizerRequestResolution)) - { - return new global::Ideogram.JsonConverters.AdResizerRequestResolutionJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.AdResizerRequestResolution?)) - { - return new global::Ideogram.JsonConverters.AdResizerRequestResolutionNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.AdResizerRequestPlatform)) - { - return new global::Ideogram.JsonConverters.AdResizerRequestPlatformJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.AdResizerRequestPlatform?)) - { - return new global::Ideogram.JsonConverters.AdResizerRequestPlatformNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.AdResizerQuality)) - { - return new global::Ideogram.JsonConverters.AdResizerQualityJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.AdResizerQuality?)) - { - return new global::Ideogram.JsonConverters.AdResizerQualityNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.AdVariationsRequestVariationType)) - { - return new global::Ideogram.JsonConverters.AdVariationsRequestVariationTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.AdVariationsRequestVariationType?)) - { - return new global::Ideogram.JsonConverters.AdVariationsRequestVariationTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.AdVariationsQuality)) - { - return new global::Ideogram.JsonConverters.AdVariationsQualityJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.AdVariationsQuality?)) - { - return new global::Ideogram.JsonConverters.AdVariationsQualityNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.SketchToRenderQuality)) - { - return new global::Ideogram.JsonConverters.SketchToRenderQualityJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.SketchToRenderQuality?)) - { - return new global::Ideogram.JsonConverters.SketchToRenderQualityNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.SoleSwapRequestBaseGenerationSize)) - { - return new global::Ideogram.JsonConverters.SoleSwapRequestBaseGenerationSizeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.SoleSwapRequestBaseGenerationSize?)) - { - return new global::Ideogram.JsonConverters.SoleSwapRequestBaseGenerationSizeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.SoleSwapQuality)) - { - return new global::Ideogram.JsonConverters.SoleSwapQualityJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.SoleSwapQuality?)) - { - return new global::Ideogram.JsonConverters.SoleSwapQualityNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.SwapProductMode)) - { - return new global::Ideogram.JsonConverters.SwapProductModeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.SwapProductMode?)) - { - return new global::Ideogram.JsonConverters.SwapProductModeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.SwapProductQuality)) - { - return new global::Ideogram.JsonConverters.SwapProductQualityJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.SwapProductQuality?)) - { - return new global::Ideogram.JsonConverters.SwapProductQualityNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.SkechersStyleEditRequestAspectRatio)) - { - return new global::Ideogram.JsonConverters.SkechersStyleEditRequestAspectRatioJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.SkechersStyleEditRequestAspectRatio?)) - { - return new global::Ideogram.JsonConverters.SkechersStyleEditRequestAspectRatioNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.SkechersStyleEditRequestBaseGenerationSize)) - { - return new global::Ideogram.JsonConverters.SkechersStyleEditRequestBaseGenerationSizeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.SkechersStyleEditRequestBaseGenerationSize?)) - { - return new global::Ideogram.JsonConverters.SkechersStyleEditRequestBaseGenerationSizeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.SkechersStyleEditQuality)) - { - return new global::Ideogram.JsonConverters.SkechersStyleEditQualityJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.SkechersStyleEditQuality?)) - { - return new global::Ideogram.JsonConverters.SkechersStyleEditQualityNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.SwanSLogoDesignRequestLogoStyle)) - { - return new global::Ideogram.JsonConverters.SwanSLogoDesignRequestLogoStyleJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.SwanSLogoDesignRequestLogoStyle?)) - { - return new global::Ideogram.JsonConverters.SwanSLogoDesignRequestLogoStyleNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.SwanSLogoDesignRequestSourceMode)) - { - return new global::Ideogram.JsonConverters.SwanSLogoDesignRequestSourceModeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.SwanSLogoDesignRequestSourceMode?)) - { - return new global::Ideogram.JsonConverters.SwanSLogoDesignRequestSourceModeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.SwanSLogoDesignRequestDesignVariant)) - { - return new global::Ideogram.JsonConverters.SwanSLogoDesignRequestDesignVariantJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.SwanSLogoDesignRequestDesignVariant?)) - { - return new global::Ideogram.JsonConverters.SwanSLogoDesignRequestDesignVariantNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.SwanSLogoQuality)) - { - return new global::Ideogram.JsonConverters.SwanSLogoQualityJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.SwanSLogoQuality?)) - { - return new global::Ideogram.JsonConverters.SwanSLogoQualityNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.SwanSLogoInstallRequestLogoStyle)) - { - return new global::Ideogram.JsonConverters.SwanSLogoInstallRequestLogoStyleJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.SwanSLogoInstallRequestLogoStyle?)) - { - return new global::Ideogram.JsonConverters.SwanSLogoInstallRequestLogoStyleNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ModelSwapQuality)) - { - return new global::Ideogram.JsonConverters.ModelSwapQualityJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ModelSwapQuality?)) - { - return new global::Ideogram.JsonConverters.ModelSwapQualityNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.MaterialSwapQuality)) - { - return new global::Ideogram.JsonConverters.MaterialSwapQualityJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.MaterialSwapQuality?)) - { - return new global::Ideogram.JsonConverters.MaterialSwapQualityNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.UpscaleToolRequestUpscaleFactor)) - { - return new global::Ideogram.JsonConverters.UpscaleToolRequestUpscaleFactorJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.UpscaleToolRequestUpscaleFactor?)) - { - return new global::Ideogram.JsonConverters.UpscaleToolRequestUpscaleFactorNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.LayerizedImageObjectObjectType)) - { - return new global::Ideogram.JsonConverters.LayerizedImageObjectObjectTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.LayerizedImageObjectObjectType?)) - { - return new global::Ideogram.JsonConverters.LayerizedImageObjectObjectTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV3RequestRenderingSpeed)) - { - return new global::Ideogram.JsonConverters.GenerateImageIdeogramV3RequestRenderingSpeedJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV3RequestRenderingSpeed?)) - { - return new global::Ideogram.JsonConverters.GenerateImageIdeogramV3RequestRenderingSpeedNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV3CustomModelRequestRenderingSpeed)) - { - return new global::Ideogram.JsonConverters.GenerateImageIdeogramV3CustomModelRequestRenderingSpeedJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV3CustomModelRequestRenderingSpeed?)) - { - return new global::Ideogram.JsonConverters.GenerateImageIdeogramV3CustomModelRequestRenderingSpeedNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV4RequestRenderingSpeed)) - { - return new global::Ideogram.JsonConverters.GenerateImageIdeogramV4RequestRenderingSpeedJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV4RequestRenderingSpeed?)) - { - return new global::Ideogram.JsonConverters.GenerateImageIdeogramV4RequestRenderingSpeedNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV4CustomModelRequestRenderingSpeed)) - { - return new global::Ideogram.JsonConverters.GenerateImageIdeogramV4CustomModelRequestRenderingSpeedJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV4CustomModelRequestRenderingSpeed?)) - { - return new global::Ideogram.JsonConverters.GenerateImageIdeogramV4CustomModelRequestRenderingSpeedNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.RemixImageIdeogramV3RequestRenderingSpeed)) - { - return new global::Ideogram.JsonConverters.RemixImageIdeogramV3RequestRenderingSpeedJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.RemixImageIdeogramV3RequestRenderingSpeed?)) - { - return new global::Ideogram.JsonConverters.RemixImageIdeogramV3RequestRenderingSpeedNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.RemixImageIdeogramV3CustomModelRequestRenderingSpeed)) - { - return new global::Ideogram.JsonConverters.RemixImageIdeogramV3CustomModelRequestRenderingSpeedJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.RemixImageIdeogramV3CustomModelRequestRenderingSpeed?)) - { - return new global::Ideogram.JsonConverters.RemixImageIdeogramV3CustomModelRequestRenderingSpeedNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.RemixImageIdeogramV4RequestRenderingSpeed)) - { - return new global::Ideogram.JsonConverters.RemixImageIdeogramV4RequestRenderingSpeedJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.RemixImageIdeogramV4RequestRenderingSpeed?)) - { - return new global::Ideogram.JsonConverters.RemixImageIdeogramV4RequestRenderingSpeedNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.RemixImageIdeogramV3CharacterRequestRenderingSpeed)) - { - return new global::Ideogram.JsonConverters.RemixImageIdeogramV3CharacterRequestRenderingSpeedJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.RemixImageIdeogramV3CharacterRequestRenderingSpeed?)) - { - return new global::Ideogram.JsonConverters.RemixImageIdeogramV3CharacterRequestRenderingSpeedNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.RemixImageIdeogramV3CharacterRequestStyleType)) - { - return new global::Ideogram.JsonConverters.RemixImageIdeogramV3CharacterRequestStyleTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.RemixImageIdeogramV3CharacterRequestStyleType?)) - { - return new global::Ideogram.JsonConverters.RemixImageIdeogramV3CharacterRequestStyleTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV3TransparentRequestUpscaleFactor)) - { - return new global::Ideogram.JsonConverters.GenerateImageIdeogramV3TransparentRequestUpscaleFactorJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV3TransparentRequestUpscaleFactor?)) - { - return new global::Ideogram.JsonConverters.GenerateImageIdeogramV3TransparentRequestUpscaleFactorNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV3TransparentRequestRenderingSpeed)) - { - return new global::Ideogram.JsonConverters.GenerateImageIdeogramV3TransparentRequestRenderingSpeedJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV3TransparentRequestRenderingSpeed?)) - { - return new global::Ideogram.JsonConverters.GenerateImageIdeogramV3TransparentRequestRenderingSpeedNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV4TransparentRequestOutputResolution)) - { - return new global::Ideogram.JsonConverters.GenerateImageIdeogramV4TransparentRequestOutputResolutionJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV4TransparentRequestOutputResolution?)) - { - return new global::Ideogram.JsonConverters.GenerateImageIdeogramV4TransparentRequestOutputResolutionNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV4TransparentRequestRenderingSpeed)) - { - return new global::Ideogram.JsonConverters.GenerateImageIdeogramV4TransparentRequestRenderingSpeedJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV4TransparentRequestRenderingSpeed?)) - { - return new global::Ideogram.JsonConverters.GenerateImageIdeogramV4TransparentRequestRenderingSpeedNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerateImagePImageIdeogramRequestResolution)) - { - return new global::Ideogram.JsonConverters.GenerateImagePImageIdeogramRequestResolutionJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerateImagePImageIdeogramRequestResolution?)) - { - return new global::Ideogram.JsonConverters.GenerateImagePImageIdeogramRequestResolutionNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerateImageIdeogram45RequestBackground)) - { - return new global::Ideogram.JsonConverters.GenerateImageIdeogram45RequestBackgroundJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerateImageIdeogram45RequestBackground?)) - { - return new global::Ideogram.JsonConverters.GenerateImageIdeogram45RequestBackgroundNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerateImageIdeogram45RequestQuality)) - { - return new global::Ideogram.JsonConverters.GenerateImageIdeogram45RequestQualityJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerateImageIdeogram45RequestQuality?)) - { - return new global::Ideogram.JsonConverters.GenerateImageIdeogram45RequestQualityNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.PreciseEditImageIdeogram45RequestQuality)) - { - return new global::Ideogram.JsonConverters.PreciseEditImageIdeogram45RequestQualityJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.PreciseEditImageIdeogram45RequestQuality?)) - { - return new global::Ideogram.JsonConverters.PreciseEditImageIdeogram45RequestQualityNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerateImageNanoBanana2RequestResolutionTier)) - { - return new global::Ideogram.JsonConverters.GenerateImageNanoBanana2RequestResolutionTierJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerateImageNanoBanana2RequestResolutionTier?)) - { - return new global::Ideogram.JsonConverters.GenerateImageNanoBanana2RequestResolutionTierNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerateImageNanoBanana21RequestResolutionTier)) - { - return new global::Ideogram.JsonConverters.GenerateImageNanoBanana21RequestResolutionTierJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerateImageNanoBanana21RequestResolutionTier?)) - { - return new global::Ideogram.JsonConverters.GenerateImageNanoBanana21RequestResolutionTierNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerateImageNanoBananaProRequestResolutionTier)) - { - return new global::Ideogram.JsonConverters.GenerateImageNanoBananaProRequestResolutionTierJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerateImageNanoBananaProRequestResolutionTier?)) - { - return new global::Ideogram.JsonConverters.GenerateImageNanoBananaProRequestResolutionTierNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerateImageGptImage25FlareRequestBackground)) - { - return new global::Ideogram.JsonConverters.GenerateImageGptImage25FlareRequestBackgroundJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerateImageGptImage25FlareRequestBackground?)) - { - return new global::Ideogram.JsonConverters.GenerateImageGptImage25FlareRequestBackgroundNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerateImageGptImage25FlareRequestQuality)) - { - return new global::Ideogram.JsonConverters.GenerateImageGptImage25FlareRequestQualityJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerateImageGptImage25FlareRequestQuality?)) - { - return new global::Ideogram.JsonConverters.GenerateImageGptImage25FlareRequestQualityNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerateImageGptImage25SunburstRequestBackground)) - { - return new global::Ideogram.JsonConverters.GenerateImageGptImage25SunburstRequestBackgroundJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerateImageGptImage25SunburstRequestBackground?)) - { - return new global::Ideogram.JsonConverters.GenerateImageGptImage25SunburstRequestBackgroundNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerateImageGptImage25SunburstRequestQuality)) - { - return new global::Ideogram.JsonConverters.GenerateImageGptImage25SunburstRequestQualityJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerateImageGptImage25SunburstRequestQuality?)) - { - return new global::Ideogram.JsonConverters.GenerateImageGptImage25SunburstRequestQualityNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV2RequestRenderingSpeed)) - { - return new global::Ideogram.JsonConverters.GenerateImageIdeogramV2RequestRenderingSpeedJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV2RequestRenderingSpeed?)) - { - return new global::Ideogram.JsonConverters.GenerateImageIdeogramV2RequestRenderingSpeedNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV2ARequestRenderingSpeed)) - { - return new global::Ideogram.JsonConverters.GenerateImageIdeogramV2ARequestRenderingSpeedJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV2ARequestRenderingSpeed?)) - { - return new global::Ideogram.JsonConverters.GenerateImageIdeogramV2ARequestRenderingSpeedNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.InpaintImageIdeogramV3RequestRenderingSpeed)) - { - return new global::Ideogram.JsonConverters.InpaintImageIdeogramV3RequestRenderingSpeedJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.InpaintImageIdeogramV3RequestRenderingSpeed?)) - { - return new global::Ideogram.JsonConverters.InpaintImageIdeogramV3RequestRenderingSpeedNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.InpaintImageIdeogramV3CustomModelRequestRenderingSpeed)) - { - return new global::Ideogram.JsonConverters.InpaintImageIdeogramV3CustomModelRequestRenderingSpeedJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.InpaintImageIdeogramV3CustomModelRequestRenderingSpeed?)) - { - return new global::Ideogram.JsonConverters.InpaintImageIdeogramV3CustomModelRequestRenderingSpeedNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ReframeImageIdeogramV3RequestRenderingSpeed)) - { - return new global::Ideogram.JsonConverters.ReframeImageIdeogramV3RequestRenderingSpeedJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ReframeImageIdeogramV3RequestRenderingSpeed?)) - { - return new global::Ideogram.JsonConverters.ReframeImageIdeogramV3RequestRenderingSpeedNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ReframeImageNanoBananaProRequestResolutionTier)) - { - return new global::Ideogram.JsonConverters.ReframeImageNanoBananaProRequestResolutionTierJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ReframeImageNanoBananaProRequestResolutionTier?)) - { - return new global::Ideogram.JsonConverters.ReframeImageNanoBananaProRequestResolutionTierNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ReframeImageGptImage25FlareRequestQuality)) - { - return new global::Ideogram.JsonConverters.ReframeImageGptImage25FlareRequestQualityJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ReframeImageGptImage25FlareRequestQuality?)) - { - return new global::Ideogram.JsonConverters.ReframeImageGptImage25FlareRequestQualityNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV3CharacterRequestRenderingSpeed)) - { - return new global::Ideogram.JsonConverters.GenerateImageIdeogramV3CharacterRequestRenderingSpeedJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV3CharacterRequestRenderingSpeed?)) - { - return new global::Ideogram.JsonConverters.GenerateImageIdeogramV3CharacterRequestRenderingSpeedNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV3CharacterRequestStyleType)) - { - return new global::Ideogram.JsonConverters.GenerateImageIdeogramV3CharacterRequestStyleTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerateImageIdeogramV3CharacterRequestStyleType?)) - { - return new global::Ideogram.JsonConverters.GenerateImageIdeogramV3CharacterRequestStyleTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.InpaintImageIdeogramV3CharacterRequestRenderingSpeed)) - { - return new global::Ideogram.JsonConverters.InpaintImageIdeogramV3CharacterRequestRenderingSpeedJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.InpaintImageIdeogramV3CharacterRequestRenderingSpeed?)) - { - return new global::Ideogram.JsonConverters.InpaintImageIdeogramV3CharacterRequestRenderingSpeedNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.InpaintImageIdeogramV3CharacterRequestStyleType)) - { - return new global::Ideogram.JsonConverters.InpaintImageIdeogramV3CharacterRequestStyleTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.InpaintImageIdeogramV3CharacterRequestStyleType?)) - { - return new global::Ideogram.JsonConverters.InpaintImageIdeogramV3CharacterRequestStyleTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerateImageV2AutoRequestResolutionTier)) - { - return new global::Ideogram.JsonConverters.GenerateImageV2AutoRequestResolutionTierJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerateImageV2AutoRequestResolutionTier?)) - { - return new global::Ideogram.JsonConverters.GenerateImageV2AutoRequestResolutionTierNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ToolRemixRequestResolutionTier)) - { - return new global::Ideogram.JsonConverters.ToolRemixRequestResolutionTierJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ToolRemixRequestResolutionTier?)) - { - return new global::Ideogram.JsonConverters.ToolRemixRequestResolutionTierNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ResizeAdImageRequestResolution)) - { - return new global::Ideogram.JsonConverters.ResizeAdImageRequestResolutionJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ResizeAdImageRequestResolution?)) - { - return new global::Ideogram.JsonConverters.ResizeAdImageRequestResolutionNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ResizeAdImageQuality)) - { - return new global::Ideogram.JsonConverters.ResizeAdImageQualityJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ResizeAdImageQuality?)) - { - return new global::Ideogram.JsonConverters.ResizeAdImageQualityNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ProvenanceVerifyResponseValidationState)) - { - return new global::Ideogram.JsonConverters.ProvenanceVerifyResponseValidationStateJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ProvenanceVerifyResponseValidationState?)) - { - return new global::Ideogram.JsonConverters.ProvenanceVerifyResponseValidationStateNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ApiKeyStatus)) - { - return new global::Ideogram.JsonConverters.ApiKeyStatusJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ApiKeyStatus?)) - { - return new global::Ideogram.JsonConverters.ApiKeyStatusNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ToolType)) - { - return new global::Ideogram.JsonConverters.ToolTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ToolType?)) - { - return new global::Ideogram.JsonConverters.ToolTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.SegmentBy)) - { - return new global::Ideogram.JsonConverters.SegmentByJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.SegmentBy?)) - { - return new global::Ideogram.JsonConverters.SegmentByNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.UsageSource)) - { - return new global::Ideogram.JsonConverters.UsageSourceJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.UsageSource?)) - { - return new global::Ideogram.JsonConverters.UsageSourceNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ModelVersion)) - { - return new global::Ideogram.JsonConverters.ModelVersionJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ModelVersion?)) - { - return new global::Ideogram.JsonConverters.ModelVersionNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ApiProfileType)) - { - return new global::Ideogram.JsonConverters.ApiProfileTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ApiProfileType?)) - { - return new global::Ideogram.JsonConverters.ApiProfileTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ApiProfileRole)) - { - return new global::Ideogram.JsonConverters.ApiProfileRoleJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ApiProfileRole?)) - { - return new global::Ideogram.JsonConverters.ApiProfileRoleNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.InvoiceStatus)) - { - return new global::Ideogram.JsonConverters.InvoiceStatusJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.InvoiceStatus?)) - { - return new global::Ideogram.JsonConverters.InvoiceStatusNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.DatasetAssetFailureReason)) - { - return new global::Ideogram.JsonConverters.DatasetAssetFailureReasonJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.DatasetAssetFailureReason?)) - { - return new global::Ideogram.JsonConverters.DatasetAssetFailureReasonNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ModelStatus)) - { - return new global::Ideogram.JsonConverters.ModelStatusJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ModelStatus?)) - { - return new global::Ideogram.JsonConverters.ModelStatusNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.TrainingRunStatus)) - { - return new global::Ideogram.JsonConverters.TrainingRunStatusJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.TrainingRunStatus?)) - { - return new global::Ideogram.JsonConverters.TrainingRunStatusNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.PublishMiniAppRequestEmbed)) - { - return new global::Ideogram.JsonConverters.PublishMiniAppRequestEmbedJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.PublishMiniAppRequestEmbed?)) - { - return new global::Ideogram.JsonConverters.PublishMiniAppRequestEmbedNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.PublishMiniAppPreviewRequestEmbed)) - { - return new global::Ideogram.JsonConverters.PublishMiniAppPreviewRequestEmbedJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.PublishMiniAppPreviewRequestEmbed?)) - { - return new global::Ideogram.JsonConverters.PublishMiniAppPreviewRequestEmbedNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.MiniAppMarketingProjectionEntryEmbed)) - { - return new global::Ideogram.JsonConverters.MiniAppMarketingProjectionEntryEmbedJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.MiniAppMarketingProjectionEntryEmbed?)) - { - return new global::Ideogram.JsonConverters.MiniAppMarketingProjectionEntryEmbedNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.IntegrationType)) - { - return new global::Ideogram.JsonConverters.IntegrationTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.IntegrationType?)) - { - return new global::Ideogram.JsonConverters.IntegrationTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.IntegrationErrorResponseError)) - { - return new global::Ideogram.JsonConverters.IntegrationErrorResponseErrorJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.IntegrationErrorResponseError?)) - { - return new global::Ideogram.JsonConverters.IntegrationErrorResponseErrorNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.V4PromptElementDiscriminatorType)) - { - return new global::Ideogram.JsonConverters.V4PromptElementDiscriminatorTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.V4PromptElementDiscriminatorType?)) - { - return new global::Ideogram.JsonConverters.V4PromptElementDiscriminatorTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.V4ObjPromptElementType)) - { - return new global::Ideogram.JsonConverters.V4ObjPromptElementTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.V4ObjPromptElementType?)) - { - return new global::Ideogram.JsonConverters.V4ObjPromptElementTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.V4TextPromptElementType)) - { - return new global::Ideogram.JsonConverters.V4TextPromptElementTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.V4TextPromptElementType?)) - { - return new global::Ideogram.JsonConverters.V4TextPromptElementTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ResolutionV4)) - { - return new global::Ideogram.JsonConverters.ResolutionV4JsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ResolutionV4?)) - { - return new global::Ideogram.JsonConverters.ResolutionV4NullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.RenderingSpeed)) - { - return new global::Ideogram.JsonConverters.RenderingSpeedJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.RenderingSpeed?)) - { - return new global::Ideogram.JsonConverters.RenderingSpeedNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.AspectRatioV4)) - { - return new global::Ideogram.JsonConverters.AspectRatioV4JsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.AspectRatioV4?)) - { - return new global::Ideogram.JsonConverters.AspectRatioV4NullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.MagicPromptOption)) - { - return new global::Ideogram.JsonConverters.MagicPromptOptionJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.MagicPromptOption?)) - { - return new global::Ideogram.JsonConverters.MagicPromptOptionNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.Quality)) - { - return new global::Ideogram.JsonConverters.QualityJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.Quality?)) - { - return new global::Ideogram.JsonConverters.QualityNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.AspectRatioV3)) - { - return new global::Ideogram.JsonConverters.AspectRatioV3JsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.AspectRatioV3?)) - { - return new global::Ideogram.JsonConverters.AspectRatioV3NullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ResolutionV4ImageToImage)) - { - return new global::Ideogram.JsonConverters.ResolutionV4ImageToImageJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ResolutionV4ImageToImage?)) - { - return new global::Ideogram.JsonConverters.ResolutionV4ImageToImageNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ResolutionV4Layout)) - { - return new global::Ideogram.JsonConverters.ResolutionV4LayoutJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ResolutionV4Layout?)) - { - return new global::Ideogram.JsonConverters.ResolutionV4LayoutNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.DescribeModelVersion)) - { - return new global::Ideogram.JsonConverters.DescribeModelVersionJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.DescribeModelVersion?)) - { - return new global::Ideogram.JsonConverters.DescribeModelVersionNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.StyleType)) - { - return new global::Ideogram.JsonConverters.StyleTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.StyleType?)) - { - return new global::Ideogram.JsonConverters.StyleTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ResolutionV3)) - { - return new global::Ideogram.JsonConverters.ResolutionV3JsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ResolutionV3?)) - { - return new global::Ideogram.JsonConverters.ResolutionV3NullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ColorPalettePresetName)) - { - return new global::Ideogram.JsonConverters.ColorPalettePresetNameJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ColorPalettePresetName?)) - { - return new global::Ideogram.JsonConverters.ColorPalettePresetNameNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.StyleTypeV3)) - { - return new global::Ideogram.JsonConverters.StyleTypeV3JsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.StyleTypeV3?)) - { - return new global::Ideogram.JsonConverters.StyleTypeV3NullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.StylePresetV3)) - { - return new global::Ideogram.JsonConverters.StylePresetV3JsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.StylePresetV3?)) - { - return new global::Ideogram.JsonConverters.StylePresetV3NullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.UpscaleFactor)) - { - return new global::Ideogram.JsonConverters.UpscaleFactorJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.UpscaleFactor?)) - { - return new global::Ideogram.JsonConverters.UpscaleFactorNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.Resolution)) - { - return new global::Ideogram.JsonConverters.ResolutionJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.Resolution?)) - { - return new global::Ideogram.JsonConverters.ResolutionNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.AspectRatio)) - { - return new global::Ideogram.JsonConverters.AspectRatioJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.AspectRatio?)) - { - return new global::Ideogram.JsonConverters.AspectRatioNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.MagicPromptVersionEnum)) - { - return new global::Ideogram.JsonConverters.MagicPromptVersionEnumJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.MagicPromptVersionEnum?)) - { - return new global::Ideogram.JsonConverters.MagicPromptVersionEnumNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.SvgGenerationObjectObjectType)) - { - return new global::Ideogram.JsonConverters.SvgGenerationObjectObjectTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.SvgGenerationObjectObjectType?)) - { - return new global::Ideogram.JsonConverters.SvgGenerationObjectObjectTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.SvgGenerationObjectMimeType)) - { - return new global::Ideogram.JsonConverters.SvgGenerationObjectMimeTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.SvgGenerationObjectMimeType?)) - { - return new global::Ideogram.JsonConverters.SvgGenerationObjectMimeTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.VideoObjectObjectType)) - { - return new global::Ideogram.JsonConverters.VideoObjectObjectTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.VideoObjectObjectType?)) - { - return new global::Ideogram.JsonConverters.VideoObjectObjectTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.TextLayerizerResultObjectObjectType)) - { - return new global::Ideogram.JsonConverters.TextLayerizerResultObjectObjectTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.TextLayerizerResultObjectObjectType?)) - { - return new global::Ideogram.JsonConverters.TextLayerizerResultObjectObjectTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.DetectedTextBlockAlignment)) - { - return new global::Ideogram.JsonConverters.DetectedTextBlockAlignmentJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.DetectedTextBlockAlignment?)) - { - return new global::Ideogram.JsonConverters.DetectedTextBlockAlignmentNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.DetectedTextBlockFormattingItem)) - { - return new global::Ideogram.JsonConverters.DetectedTextBlockFormattingItemJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.DetectedTextBlockFormattingItem?)) - { - return new global::Ideogram.JsonConverters.DetectedTextBlockFormattingItemNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.DetectedTextBlockRole)) - { - return new global::Ideogram.JsonConverters.DetectedTextBlockRoleJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.DetectedTextBlockRole?)) - { - return new global::Ideogram.JsonConverters.DetectedTextBlockRoleNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.AssetType)) - { - return new global::Ideogram.JsonConverters.AssetTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.AssetType?)) - { - return new global::Ideogram.JsonConverters.AssetTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.SeedDance2AspectRatio)) - { - return new global::Ideogram.JsonConverters.SeedDance2AspectRatioJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.SeedDance2AspectRatio?)) - { - return new global::Ideogram.JsonConverters.SeedDance2AspectRatioNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.SeedDance2Resolution)) - { - return new global::Ideogram.JsonConverters.SeedDance2ResolutionJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.SeedDance2Resolution?)) - { - return new global::Ideogram.JsonConverters.SeedDance2ResolutionNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.MinimaxH3AspectRatio)) - { - return new global::Ideogram.JsonConverters.MinimaxH3AspectRatioJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.MinimaxH3AspectRatio?)) - { - return new global::Ideogram.JsonConverters.MinimaxH3AspectRatioNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.MinimaxH3Resolution)) - { - return new global::Ideogram.JsonConverters.MinimaxH3ResolutionJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.MinimaxH3Resolution?)) - { - return new global::Ideogram.JsonConverters.MinimaxH3ResolutionNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.KlingV3AspectRatio)) - { - return new global::Ideogram.JsonConverters.KlingV3AspectRatioJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.KlingV3AspectRatio?)) - { - return new global::Ideogram.JsonConverters.KlingV3AspectRatioNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.KlingV3ShotType)) - { - return new global::Ideogram.JsonConverters.KlingV3ShotTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.KlingV3ShotType?)) - { - return new global::Ideogram.JsonConverters.KlingV3ShotTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.MinimaxH3PromptExpansionMode)) - { - return new global::Ideogram.JsonConverters.MinimaxH3PromptExpansionModeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.MinimaxH3PromptExpansionMode?)) - { - return new global::Ideogram.JsonConverters.MinimaxH3PromptExpansionModeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.IdeogramV3AspectRatio)) - { - return new global::Ideogram.JsonConverters.IdeogramV3AspectRatioJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.IdeogramV3AspectRatio?)) - { - return new global::Ideogram.JsonConverters.IdeogramV3AspectRatioNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.MagicPromptMode)) - { - return new global::Ideogram.JsonConverters.MagicPromptModeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.MagicPromptMode?)) - { - return new global::Ideogram.JsonConverters.MagicPromptModeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.IdeogramColorPalettePresetName)) - { - return new global::Ideogram.JsonConverters.IdeogramColorPalettePresetNameJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.IdeogramColorPalettePresetName?)) - { - return new global::Ideogram.JsonConverters.IdeogramColorPalettePresetNameNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.IdeogramV3StyleType)) - { - return new global::Ideogram.JsonConverters.IdeogramV3StyleTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.IdeogramV3StyleType?)) - { - return new global::Ideogram.JsonConverters.IdeogramV3StyleTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.IdeogramV3StylePreset)) - { - return new global::Ideogram.JsonConverters.IdeogramV3StylePresetJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.IdeogramV3StylePreset?)) - { - return new global::Ideogram.JsonConverters.IdeogramV3StylePresetNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.IdeogramV4AspectRatio)) - { - return new global::Ideogram.JsonConverters.IdeogramV4AspectRatioJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.IdeogramV4AspectRatio?)) - { - return new global::Ideogram.JsonConverters.IdeogramV4AspectRatioNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerationQuality)) - { - return new global::Ideogram.JsonConverters.GenerationQualityJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerationQuality?)) - { - return new global::Ideogram.JsonConverters.GenerationQualityNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerationKind)) - { - return new global::Ideogram.JsonConverters.GenerationKindJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerationKind?)) - { - return new global::Ideogram.JsonConverters.GenerationKindNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.NanoBanana2AspectRatio)) - { - return new global::Ideogram.JsonConverters.NanoBanana2AspectRatioJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.NanoBanana2AspectRatio?)) - { - return new global::Ideogram.JsonConverters.NanoBanana2AspectRatioNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.NanoBanana21AspectRatio)) - { - return new global::Ideogram.JsonConverters.NanoBanana21AspectRatioJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.NanoBanana21AspectRatio?)) - { - return new global::Ideogram.JsonConverters.NanoBanana21AspectRatioNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.NanoBananaProAspectRatio)) - { - return new global::Ideogram.JsonConverters.NanoBananaProAspectRatioJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.NanoBananaProAspectRatio?)) - { - return new global::Ideogram.JsonConverters.NanoBananaProAspectRatioNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.IdeogramV2StyleType)) - { - return new global::Ideogram.JsonConverters.IdeogramV2StyleTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.IdeogramV2StyleType?)) - { - return new global::Ideogram.JsonConverters.IdeogramV2StyleTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.NanoBanana2ReframeAspectRatio)) - { - return new global::Ideogram.JsonConverters.NanoBanana2ReframeAspectRatioJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.NanoBanana2ReframeAspectRatio?)) - { - return new global::Ideogram.JsonConverters.NanoBanana2ReframeAspectRatioNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.NanoBananaProReframeAspectRatio)) - { - return new global::Ideogram.JsonConverters.NanoBananaProReframeAspectRatioJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.NanoBananaProReframeAspectRatio?)) - { - return new global::Ideogram.JsonConverters.NanoBananaProReframeAspectRatioNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.AttributeValueType)) - { - return new global::Ideogram.JsonConverters.AttributeValueTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.AttributeValueType?)) - { - return new global::Ideogram.JsonConverters.AttributeValueTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.PostGenerateDesignV4200ResponseDiscriminatorResponseType)) - { - return new global::Ideogram.JsonConverters.PostGenerateDesignV4200ResponseDiscriminatorResponseTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.PostGenerateDesignV4200ResponseDiscriminatorResponseType?)) - { - return new global::Ideogram.JsonConverters.PostGenerateDesignV4200ResponseDiscriminatorResponseTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerationResponseDataInnerDiscriminatorObjectType)) - { - return new global::Ideogram.JsonConverters.GenerationResponseDataInnerDiscriminatorObjectTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerationResponseDataInnerDiscriminatorObjectType?)) - { - return new global::Ideogram.JsonConverters.GenerationResponseDataInnerDiscriminatorObjectTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.MagicPromptRequestMessagesInnerRole)) - { - return new global::Ideogram.JsonConverters.MagicPromptRequestMessagesInnerRoleJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.MagicPromptRequestMessagesInnerRole?)) - { - return new global::Ideogram.JsonConverters.MagicPromptRequestMessagesInnerRoleNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ListCustomModelsScope)) - { - return new global::Ideogram.JsonConverters.ListCustomModelsScopeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ListCustomModelsScope?)) - { - return new global::Ideogram.JsonConverters.ListCustomModelsScopeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GetAccountUsageBucketWidth)) - { - return new global::Ideogram.JsonConverters.GetAccountUsageBucketWidthJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GetAccountUsageBucketWidth?)) - { - return new global::Ideogram.JsonConverters.GetAccountUsageBucketWidthNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GetAccountUsageSource)) - { - return new global::Ideogram.JsonConverters.GetAccountUsageSourceJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GetAccountUsageSource?)) - { - return new global::Ideogram.JsonConverters.GetAccountUsageSourceNullableJsonConverter(); - } - throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); - } - } - - private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver - { - private readonly object _gate = new(); - private readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[] _resolvers = new global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[2]; - - public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo( - global::System.Type type, - global::System.Text.Json.JsonSerializerOptions options) - { - for (var index = 0; index < _resolvers.Length; index++) - { - var typeInfo = GetResolver(index).GetTypeInfo(type, options); - if (typeInfo is not null) - { - return typeInfo; - } - } - - return null; - } - - private global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver GetResolver(int index) - { - var resolver = global::System.Threading.Volatile.Read(ref _resolvers[index]); - if (resolver is not null) - { - return resolver; - } - - lock (_gate) - { - return _resolvers[index] ??= CreateResolver(index); - } - } - - private static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver CreateResolver(int index) - { - return index switch - { - 0 => new SourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), - - 1 => new SourceGenerationContextChunk1(new global::System.Text.Json.JsonSerializerOptions()), - _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), - }; - } - } + typeof(global::Ideogram.JsonConverters.UnixTimestampJsonConverter), + })] + #pragma warning restore CS3016 + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.JsonSerializerContextTypes))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImagePreciseEditIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality), TypeInfoPropertyName = "V2ImagePreciseEditIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationKind), TypeInfoPropertyName = "GenerationKind2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GeneratedImageObject))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PreciseEditImageIdeogram45Response))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationRejectReason), TypeInfoPropertyName = "GenerationRejectReason2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed), TypeInfoPropertyName = "GenerationErrorResponseTaskCompletionSpeed2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationErrorResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageGenerateAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier), TypeInfoPropertyName = "V2ImageGenerateAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MagicPromptMode), TypeInfoPropertyName = "MagicPromptMode2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageV2AutoResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaBackground), TypeInfoPropertyName = "V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaBackground2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality), TypeInfoPropertyName = "V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogram45Response))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ResolutionV4), TypeInfoPropertyName = "ResolutionV42")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV4RequestRenderingSpeed), TypeInfoPropertyName = "GenerateImageIdeogramV4RequestRenderingSpeed2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV4Request))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV4Response))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV4CustomModelRequestRenderingSpeed), TypeInfoPropertyName = "GenerateImageIdeogramV4CustomModelRequestRenderingSpeed2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV4CustomModelRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV4CustomModelResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramV4AspectRatio), TypeInfoPropertyName = "IdeogramV4AspectRatio2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV4TransparentRequestOutputResolution), TypeInfoPropertyName = "GenerateImageIdeogramV4TransparentRequestOutputResolution2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV4TransparentRequestRenderingSpeed), TypeInfoPropertyName = "GenerateImageIdeogramV4TransparentRequestRenderingSpeed2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV4TransparentRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV4TransparentResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ResolutionV3), TypeInfoPropertyName = "ResolutionV32")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramV3AspectRatio), TypeInfoPropertyName = "IdeogramV3AspectRatio2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageGenerateIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed), TypeInfoPropertyName = "V2ImageGenerateIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramColorPalettePresetName), TypeInfoPropertyName = "IdeogramColorPalettePresetName2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramColorPaletteWithPresetName))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ColorPaletteMember))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ColorPaletteWithMembers))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramColorPalette), TypeInfoPropertyName = "IdeogramColorPalette2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramV3StyleType), TypeInfoPropertyName = "IdeogramV3StyleType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramV3StylePreset), TypeInfoPropertyName = "IdeogramV3StylePreset2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV3Response))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed), TypeInfoPropertyName = "V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType), TypeInfoPropertyName = "V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV3CharacterResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageGenerateIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed), TypeInfoPropertyName = "V2ImageGenerateIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV3CustomModelResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV3TransparentRequestUpscaleFactor), TypeInfoPropertyName = "GenerateImageIdeogramV3TransparentRequestUpscaleFactor2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV3TransparentRequestRenderingSpeed), TypeInfoPropertyName = "GenerateImageIdeogramV3TransparentRequestRenderingSpeed2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV3TransparentRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV3TransparentResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV2ARequestRenderingSpeed), TypeInfoPropertyName = "GenerateImageIdeogramV2ARequestRenderingSpeed2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramV2StyleType), TypeInfoPropertyName = "IdeogramV2StyleType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV2ARequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV2AResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV2RequestRenderingSpeed), TypeInfoPropertyName = "GenerateImageIdeogramV2RequestRenderingSpeed2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV2Request))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageIdeogramV2Response))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaBackground), TypeInfoPropertyName = "V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaBackground2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaQuality), TypeInfoPropertyName = "V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaQuality2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageGptImage25FlareResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaBackground), TypeInfoPropertyName = "V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaBackground2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaQuality), TypeInfoPropertyName = "V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaQuality2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageGptImage25SunburstResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageGptImage2Response))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.NanoBanana2AspectRatio), TypeInfoPropertyName = "NanoBanana2AspectRatio2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageGenerateNanoBanana2PostRequestBodyContentMultipartFormDataSchemaResolutionTier), TypeInfoPropertyName = "V2ImageGenerateNanoBanana2PostRequestBodyContentMultipartFormDataSchemaResolutionTier2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageNanoBanana2Response))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.NanoBanana21AspectRatio), TypeInfoPropertyName = "NanoBanana21AspectRatio2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageGenerateNanoBanana21PostRequestBodyContentMultipartFormDataSchemaResolutionTier), TypeInfoPropertyName = "V2ImageGenerateNanoBanana21PostRequestBodyContentMultipartFormDataSchemaResolutionTier2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageNanoBanana21Response))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.NanoBananaProAspectRatio), TypeInfoPropertyName = "NanoBananaProAspectRatio2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageGenerateNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier), TypeInfoPropertyName = "V2ImageGenerateNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageNanoBananaProResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationQuality), TypeInfoPropertyName = "GenerationQuality2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImagePImageIdeogramRequestResolution), TypeInfoPropertyName = "GenerateImagePImageIdeogramRequestResolution2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AspectRatioV3), TypeInfoPropertyName = "AspectRatioV32")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImagePImageIdeogramRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImagePImageIdeogramResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageZImageRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateImageZImageResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageRemixAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier), TypeInfoPropertyName = "V2ImageRemixAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ToolRemixResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageRemixIdeogram4PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed), TypeInfoPropertyName = "V2ImageRemixIdeogram4PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemixedImageObject))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemixImageIdeogramV4Response))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageRemixIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed), TypeInfoPropertyName = "V2ImageRemixIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemixImageIdeogramV3Response))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed), TypeInfoPropertyName = "V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType), TypeInfoPropertyName = "V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemixImageIdeogramV3CharacterResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageRemixIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed), TypeInfoPropertyName = "V2ImageRemixIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemixImageIdeogramV3CustomModelResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageInpaintIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed), TypeInfoPropertyName = "V2ImageInpaintIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.InpaintedImageObject))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.InpaintImageIdeogramV3Response))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed), TypeInfoPropertyName = "V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType), TypeInfoPropertyName = "V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.InpaintImageIdeogramV3CharacterResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageInpaintIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed), TypeInfoPropertyName = "V2ImageInpaintIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.InpaintImageIdeogramV3CustomModelResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageReframeIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed), TypeInfoPropertyName = "V2ImageReframeIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReframeImageIdeogramV3Response))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.NanoBanana2ReframeAspectRatio), TypeInfoPropertyName = "NanoBanana2ReframeAspectRatio2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReframeImageNanoBanana2Response))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageUpscaleAutoPostRequestBodyContentMultipartFormDataSchemaUpscaleFactor), TypeInfoPropertyName = "V2ImageUpscaleAutoPostRequestBodyContentMultipartFormDataSchemaUpscaleFactor2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageObject))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleToolResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageUpscaleNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier), TypeInfoPropertyName = "V2ImageUpscaleNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageNanoBananaProResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageUpscaleTopazBloom2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor), TypeInfoPropertyName = "V2ImageUpscaleTopazBloom2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageTopazBloom2Response))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor), TypeInfoPropertyName = "V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection), TypeInfoPropertyName = "V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageTopazRedefineResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor), TypeInfoPropertyName = "V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaSubjectDetection), TypeInfoPropertyName = "V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaSubjectDetection2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageTopazStandardV2Response))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor), TypeInfoPropertyName = "V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection), TypeInfoPropertyName = "V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageTopazTextRefineResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor), TypeInfoPropertyName = "V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaEnhancementStrength), TypeInfoPropertyName = "V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaEnhancementStrength2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageTopazWonder35Response))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageReplaceBackgroundIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed), TypeInfoPropertyName = "V2ImageReplaceBackgroundIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReplaceBackgroundResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReplaceBackgroundQuality), TypeInfoPropertyName = "ReplaceBackgroundQuality2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.BackgroundRemovedImageObject))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemoveBackgroundV2Response))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemoveObjectFromV2AssetsResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4StyleDescription))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4ObjPromptElementType), TypeInfoPropertyName = "V4ObjPromptElementType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4TextPromptElementType), TypeInfoPropertyName = "V4TextPromptElementType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4PromptElement), TypeInfoPropertyName = "V4PromptElement2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4PromptElementVariant1))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4PromptElementVariant2))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4PromptElementDiscriminator))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4PromptElementDiscriminatorType), TypeInfoPropertyName = "V4PromptElementDiscriminatorType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4CompositionalDeconstruction))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4JsonPrompt))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DescribeImageIdeogramV4Response))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImageSafetyError))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GeneratedDescription))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DescribeImageIdeogramV3Response))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DetectedTextBlockAlignment), TypeInfoPropertyName = "DetectedTextBlockAlignment2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DetectedTextBlockFormattingItems), TypeInfoPropertyName = "DetectedTextBlockFormattingItems2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DetectedTextBlockRole), TypeInfoPropertyName = "DetectedTextBlockRole2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DetectedTextBlock))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LayerizedImageObject))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LayerizeDesignIdeogramV3Response))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.KlingV3ShotType), TypeInfoPropertyName = "KlingV3ShotType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateVideoKlingV3Response))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.KlingV3AspectRatio), TypeInfoPropertyName = "KlingV3AspectRatio2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateVideoKlingV3StandardTextToVideoRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MinimaxH3Resolution), TypeInfoPropertyName = "MinimaxH3Resolution2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateVideoMinimaxH3Response))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MinimaxH3AspectRatio), TypeInfoPropertyName = "MinimaxH3AspectRatio2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MinimaxH3PromptExpansionMode), TypeInfoPropertyName = "MinimaxH3PromptExpansionMode2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateVideoMinimaxH3TextToVideoRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SeedDance25Resolution), TypeInfoPropertyName = "SeedDance25Resolution2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateVideoSeedDance25Response))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SeedDance2AspectRatio), TypeInfoPropertyName = "SeedDance2AspectRatio2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateVideoSeedDance25TextToVideoRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SeedDance2Resolution), TypeInfoPropertyName = "SeedDance2Resolution2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateVideoSeedDance2Response))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateVideoSeedDance2TextToVideoRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage), TypeInfoPropertyName = "V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AdLocalizerQuality), TypeInfoPropertyName = "AdLocalizerQuality2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AdLocalizerResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution), TypeInfoPropertyName = "V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaPlatform), TypeInfoPropertyName = "V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaPlatform2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AdResizerQuality), TypeInfoPropertyName = "AdResizerQuality2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AdResizerResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ToolAdVariationsPostRequestBodyContentMultipartFormDataSchemaVariationType), TypeInfoPropertyName = "V2ToolAdVariationsPostRequestBodyContentMultipartFormDataSchemaVariationType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AdVariationsQuality), TypeInfoPropertyName = "AdVariationsQuality2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AdVariationsResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ColorwaysQuality), TypeInfoPropertyName = "ColorwaysQuality2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ColorwaysResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AssetType), TypeInfoPropertyName = "AssetType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AssetIdentifier))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ToolGhostMannequinPostRequestBodyContentMultipartFormDataSchemaView), TypeInfoPropertyName = "V2ToolGhostMannequinPostRequestBodyContentMultipartFormDataSchemaView2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GhostMannequinQuality), TypeInfoPropertyName = "GhostMannequinQuality2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GhostMannequinResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MaterialSwapQuality), TypeInfoPropertyName = "MaterialSwapQuality2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MaterialSwapResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ModelPoseVariantsQuality), TypeInfoPropertyName = "ModelPoseVariantsQuality2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ModelPoseVariantsResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SketchToRenderQuality), TypeInfoPropertyName = "SketchToRenderQuality2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SketchToRenderResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponseStatus), TypeInfoPropertyName = "GenerationResponseStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponseResponseType), TypeInfoPropertyName = "GenerationResponseResponseType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponseDataInnerDiscriminatorMappingSvgGenerationMimeType), TypeInfoPropertyName = "GenerationResponseDataInnerDiscriminatorMappingSvgGenerationMimeType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LayerizedTextBlockAlignment), TypeInfoPropertyName = "LayerizedTextBlockAlignment2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LayerizedTextBlockFormattingItems), TypeInfoPropertyName = "LayerizedTextBlockFormattingItems2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LayerizedTextBlockRole), TypeInfoPropertyName = "LayerizedTextBlockRole2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TextColorSpan))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LayerizedTextBlock))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponseDataInner), TypeInfoPropertyName = "GenerationResponseDataInner2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponseDataInnerVariant1))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponseDataInnerVariant1ObjectType), TypeInfoPropertyName = "GenerationResponseDataInnerVariant1ObjectType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponseDataInnerVariant2))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponseDataInnerVariant2ObjectType), TypeInfoPropertyName = "GenerationResponseDataInnerVariant2ObjectType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponseDataInnerVariant3))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponseDataInnerVariant3ObjectType), TypeInfoPropertyName = "GenerationResponseDataInnerVariant3ObjectType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponseDataInnerVariant4))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponseDataInnerVariant4ObjectType), TypeInfoPropertyName = "GenerationResponseDataInnerVariant4ObjectType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponseDataInnerVariant5))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponseDataInnerVariant5ObjectType), TypeInfoPropertyName = "GenerationResponseDataInnerVariant5ObjectType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponseDataInnerVariant6))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponseDataInnerVariant6ObjectType), TypeInfoPropertyName = "GenerationResponseDataInnerVariant6ObjectType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponseDataInnerDiscriminator))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponseDataInnerDiscriminatorObjectType), TypeInfoPropertyName = "GenerationResponseDataInnerDiscriminatorObjectType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(long))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AccountApiKeyStatus), TypeInfoPropertyName = "AccountApiKeyStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AccountApiKey))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ListAccountApiKeysResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AccountInvoiceStatus), TypeInfoPropertyName = "AccountInvoiceStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AccountUsageApiKey))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AccountInvoiceLineItem))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AccountInvoice))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ListAccountInvoicesResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2AccountUsageGetParametersBucketWidth), TypeInfoPropertyName = "V2AccountUsageGetParametersBucketWidth2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2AccountUsageGetParametersSourcesSchemaItems), TypeInfoPropertyName = "V2AccountUsageGetParametersSourcesSchemaItems2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AccountUsageLineItemSource), TypeInfoPropertyName = "AccountUsageLineItemSource2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AccountUsageBilledUnits))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AccountUsageLineItem))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AccountUsageBucket))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GetAccountUsageResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Request))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(byte[]))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AutoModelPostGenerateImageV2AutoRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2Ideogram45Request))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3Request))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25FlareRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25SunburstRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage2Request))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana2Request))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana21Request))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBananaProRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AutoModelPostToolRemixRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV4Request))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3Request))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CharacterRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CustomModelRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3Request))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReframeIdeogramV3Request))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReframeNanoBanana2Request))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ToolsPostUpscaleRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImagesUpscalePostUpscaleImageNanoBananaProRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazBloom2Request))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazRedefineRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazStandardV2Request))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazTextRefineRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazWonder35Request))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ToolReplaceBackgroundIdeogramV3Request))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ToolReplaceBackgroundRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ToolRemoveBackgroundRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ObjectRemovalPostRemoveObjectFromV2AssetsRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImageDescribePostDescribeImageIdeogramV4Request))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImageDescribePostDescribeImageIdeogramV3Request))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DesignPostLayerizeDesignIdeogramV3Request))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.VideoEditPostEditVideoMinimaxH3ReferenceToVideoRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.EditWorkflowPostAdLocalizerRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.EditWorkflowPostAdResizerRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.EditWorkflowPostAdVariationsRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.EditWorkflowPostColorwaysRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.EditWorkflowPostGhostMannequinRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.EditWorkflowPostMaterialSwapRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.EditWorkflowPostModelPoseVariantsRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.EditWorkflowPostSketchToRenderRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ToolReplaceBackgroundIdeogram45Request))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + public sealed partial class SourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext + { } } \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonSerializerContextTypes.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonSerializerContextTypes.g.cs index 351c4e20..101b3451 100644 --- a/src/libs/Ideogram/Generated/Ideogram.JsonSerializerContextTypes.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.JsonSerializerContextTypes.g.cs @@ -33,2951 +33,1327 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::Ideogram.PriceQuote? Type0 { get; set; } + public global::Ideogram.V2ImagePreciseEditIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality? Type0 { get; set; } /// /// /// - public global::Ideogram.PriceQuoteObject? Type1 { get; set; } + public global::Ideogram.GenerationKind? Type1 { get; set; } /// /// /// - public string? Type2 { get; set; } + public global::Ideogram.GeneratedImageObject? Type2 { get; set; } /// /// /// - public int? Type3 { get; set; } + public string? Type3 { get; set; } /// /// /// - public long? Type4 { get; set; } + public bool? Type4 { get; set; } /// /// /// - public global::Ideogram.PriceQualifier? Type5 { get; set; } + public int? Type5 { get; set; } /// /// /// - public global::Ideogram.LayerizedTextBlock? Type6 { get; set; } + public global::Ideogram.PreciseEditImageIdeogram45Response? Type6 { get; set; } /// /// /// - public global::Ideogram.DetectedTextBlock? Type7 { get; set; } + public global::System.Collections.Generic.IList? Type7 { get; set; } /// /// /// - public global::Ideogram.LayerizedTextBlockVariant2? Type8 { get; set; } + public global::Ideogram.GenerationRejectReason? Type8 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type9 { get; set; } + public global::Ideogram.GenerationErrorResponseTaskCompletionSpeed? Type9 { get; set; } /// /// /// - public global::Ideogram.TextColorSpan? Type10 { get; set; } + public global::Ideogram.GenerationErrorResponse? Type10 { get; set; } /// /// /// - public global::Ideogram.GenerateImageRequestV4? Type11 { get; set; } + public global::Ideogram.V2ImageGenerateAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier? Type11 { get; set; } /// /// /// - public global::Ideogram.V4JsonPrompt? Type12 { get; set; } + public global::Ideogram.MagicPromptMode? Type12 { get; set; } /// /// /// - public global::Ideogram.ResolutionV4? Type13 { get; set; } + public global::Ideogram.GenerateImageV2AutoResponse? Type13 { get; set; } /// /// /// - public global::Ideogram.RenderingSpeed? Type14 { get; set; } + public global::Ideogram.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaBackground? Type14 { get; set; } /// /// /// - public bool? Type15 { get; set; } + public global::Ideogram.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality? Type15 { get; set; } /// /// /// - public global::Ideogram.OutputResolution? Type16 { get; set; } + public global::Ideogram.GenerateImageIdeogram45Response? Type16 { get; set; } /// /// /// - public global::Ideogram.RenderingSpeedV4? Type17 { get; set; } + public global::Ideogram.ResolutionV4? Type17 { get; set; } /// /// /// - public global::Ideogram.GenerateTransparentImageRequestV4? Type18 { get; set; } + public global::Ideogram.GenerateImageIdeogramV4RequestRenderingSpeed? Type18 { get; set; } /// /// /// - public global::Ideogram.AspectRatioV4? Type19 { get; set; } + public global::Ideogram.GenerateImageIdeogramV4Request? Type19 { get; set; } /// /// /// - public global::Ideogram.GenerateImageRequestV4Fp8? Type20 { get; set; } + public global::Ideogram.GenerateImageIdeogramV4Response? Type20 { get; set; } /// /// /// - public global::Ideogram.GenerateImageRequestV4CfgDistilled? Type21 { get; set; } + public global::Ideogram.GenerateImageIdeogramV4CustomModelRequestRenderingSpeed? Type21 { get; set; } /// /// /// - public global::Ideogram.GenerateImageRequestPImage? Type22 { get; set; } + public global::Ideogram.GenerateImageIdeogramV4CustomModelRequest? Type22 { get; set; } /// /// /// - public global::Ideogram.MagicPromptOption? Type23 { get; set; } + public global::Ideogram.GenerateImageIdeogramV4CustomModelResponse? Type23 { get; set; } /// /// /// - public global::Ideogram.PImageResolution? Type24 { get; set; } + public global::Ideogram.IdeogramV4AspectRatio? Type24 { get; set; } /// /// /// - public global::Ideogram.GenerateImageRequestPImageIdeogram? Type25 { get; set; } + public global::Ideogram.GenerateImageIdeogramV4TransparentRequestOutputResolution? Type25 { get; set; } /// /// /// - public global::Ideogram.Quality? Type26 { get; set; } + public global::Ideogram.GenerateImageIdeogramV4TransparentRequestRenderingSpeed? Type26 { get; set; } /// /// /// - public global::Ideogram.AspectRatioV3? Type27 { get; set; } + public global::Ideogram.GenerateImageIdeogramV4TransparentRequest? Type27 { get; set; } /// /// /// - public global::Ideogram.GenerateImageRequestV4Stable? Type28 { get; set; } + public global::Ideogram.GenerateImageIdeogramV4TransparentResponse? Type28 { get; set; } /// /// /// - public global::Ideogram.GenerateImageRequestV4StableVersion? Type29 { get; set; } + public global::Ideogram.ResolutionV3? Type29 { get; set; } /// /// /// - public global::Ideogram.GenerateImageRequestZImage? Type30 { get; set; } + public global::Ideogram.IdeogramV3AspectRatio? Type30 { get; set; } /// /// /// - public global::Ideogram.GenerateImageRequestFlux2Klein? Type31 { get; set; } + public global::Ideogram.V2ImageGenerateIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? Type31 { get; set; } /// /// /// - public global::Ideogram.GenerateImageRequestFlux2KleinBase? Type32 { get; set; } + public global::Ideogram.IdeogramColorPalettePresetName? Type32 { get; set; } /// /// /// - public global::Ideogram.GenerateImageRequestErnie? Type33 { get; set; } + public global::Ideogram.IdeogramColorPaletteWithPresetName? Type33 { get; set; } /// /// /// - public global::Ideogram.GenerateImageRequestV4Im2Im? Type34 { get; set; } + public global::Ideogram.ColorPaletteMember? Type34 { get; set; } /// /// /// - public byte[]? Type35 { get; set; } + public double? Type35 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type36 { get; set; } + public global::Ideogram.ColorPaletteWithMembers? Type36 { get; set; } /// /// /// - public global::Ideogram.ResolutionV4ImageToImage? Type37 { get; set; } + public global::System.Collections.Generic.IList? Type37 { get; set; } /// /// /// - public global::Ideogram.RemixImageRequestV4? Type38 { get; set; } + public global::Ideogram.IdeogramColorPalette? Type38 { get; set; } /// /// /// - public global::Ideogram.GenerateDesignRequestV4? Type39 { get; set; } + public global::Ideogram.IdeogramV3StyleType? Type39 { get; set; } /// /// /// - public global::Ideogram.ResolutionV4Layout? Type40 { get; set; } + public global::Ideogram.IdeogramV3StylePreset? Type40 { get; set; } /// /// /// - public global::Ideogram.GenerateDesignRequestV4InspirationReferenceModel? Type41 { get; set; } + public global::Ideogram.GenerateImageIdeogramV3Response? Type41 { get; set; } /// /// /// - public global::Ideogram.GenerateDesignRequestV4ArtifactGenerationModel? Type42 { get; set; } + public global::Ideogram.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? Type42 { get; set; } /// /// /// - public global::Ideogram.GenerateDesignRequestV4Layout2imageVariant? Type43 { get; set; } + public global::Ideogram.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType? Type43 { get; set; } /// /// /// - public global::Ideogram.GenerateDesignRequestV4ResponseType? Type44 { get; set; } + public global::Ideogram.GenerateImageIdeogramV3CharacterResponse? Type44 { get; set; } /// /// /// - public global::Ideogram.DescribeResponse? Type45 { get; set; } + public global::Ideogram.V2ImageGenerateIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? Type45 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type46 { get; set; } + public global::Ideogram.GenerateImageIdeogramV3CustomModelResponse? Type46 { get; set; } /// /// /// - public global::Ideogram.Description? Type47 { get; set; } + public global::Ideogram.GenerateImageIdeogramV3TransparentRequestUpscaleFactor? Type47 { get; set; } /// /// /// - public global::Ideogram.DescribeRequest? Type48 { get; set; } + public global::Ideogram.GenerateImageIdeogramV3TransparentRequestRenderingSpeed? Type48 { get; set; } /// /// /// - public global::Ideogram.DescribeModelVersion? Type49 { get; set; } + public global::Ideogram.GenerateImageIdeogramV3TransparentRequest? Type49 { get; set; } /// /// /// - public global::Ideogram.DescribeRequestV4? Type50 { get; set; } + public global::Ideogram.GenerateImageIdeogramV3TransparentResponse? Type50 { get; set; } /// /// /// - public global::Ideogram.DescribeResponseV4? Type51 { get; set; } + public global::Ideogram.GenerateImageIdeogramV2ARequestRenderingSpeed? Type51 { get; set; } /// /// /// - public global::Ideogram.EditImageRequest? Type52 { get; set; } + public global::Ideogram.IdeogramV2StyleType? Type52 { get; set; } /// /// /// - public global::Ideogram.ModelEnum? Type53 { get; set; } + public global::Ideogram.GenerateImageIdeogramV2ARequest? Type53 { get; set; } /// /// /// - public global::Ideogram.StyleType? Type54 { get; set; } + public global::Ideogram.GenerateImageIdeogramV2AResponse? Type54 { get; set; } /// /// /// - public global::Ideogram.GenerateImageRequest? Type55 { get; set; } + public global::Ideogram.GenerateImageIdeogramV2RequestRenderingSpeed? Type55 { get; set; } /// /// /// - public global::Ideogram.ImageRequest? Type56 { get; set; } + public global::Ideogram.GenerateImageIdeogramV2Request? Type56 { get; set; } /// /// /// - public global::Ideogram.GenerateImageRequestV3? Type57 { get; set; } + public global::Ideogram.GenerateImageIdeogramV2Response? Type57 { get; set; } /// /// /// - public global::Ideogram.ResolutionV3? Type58 { get; set; } + public global::Ideogram.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaBackground? Type58 { get; set; } /// /// /// - public global::Ideogram.ColorPaletteWithPresetNameOrMembers? Type59 { get; set; } + public global::Ideogram.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaQuality? Type59 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type60 { get; set; } + public global::Ideogram.GenerateImageGptImage25FlareResponse? Type60 { get; set; } /// /// /// - public global::Ideogram.StyleTypeV3? Type61 { get; set; } + public global::Ideogram.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaBackground? Type61 { get; set; } /// /// /// - public global::Ideogram.StylePresetV3? Type62 { get; set; } + public global::Ideogram.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaQuality? Type62 { get; set; } /// /// /// - public global::Ideogram.GenerateGraphicRequestV3? Type63 { get; set; } + public global::Ideogram.GenerateImageGptImage25SunburstResponse? Type63 { get; set; } /// /// /// - public global::Ideogram.GenerateDesignRequestV3? Type64 { get; set; } + public global::Ideogram.GenerateImageGptImage2Response? Type64 { get; set; } /// /// /// - public global::Ideogram.LayerizeDesignRequestV3? Type65 { get; set; } + public global::Ideogram.NanoBanana2AspectRatio? Type65 { get; set; } /// /// /// - public global::Ideogram.GenerateTransparentImageRequestV3? Type66 { get; set; } + public global::Ideogram.V2ImageGenerateNanoBanana2PostRequestBodyContentMultipartFormDataSchemaResolutionTier? Type66 { get; set; } /// /// /// - public global::Ideogram.UpscaleFactor? Type67 { get; set; } + public global::Ideogram.GenerateImageNanoBanana2Response? Type67 { get; set; } /// /// /// - public global::Ideogram.RemixImageRequestV3? Type68 { get; set; } + public global::Ideogram.NanoBanana21AspectRatio? Type68 { get; set; } /// /// /// - public global::Ideogram.EditImageRequestV3? Type69 { get; set; } + public global::Ideogram.V2ImageGenerateNanoBanana21PostRequestBodyContentMultipartFormDataSchemaResolutionTier? Type69 { get; set; } /// /// /// - public global::Ideogram.V1EditImagesRequest? Type70 { get; set; } + public global::Ideogram.GenerateImageNanoBanana21Response? Type70 { get; set; } /// /// /// - public global::Ideogram.TransparencyOption? Type71 { get; set; } + public global::Ideogram.NanoBananaProAspectRatio? Type71 { get; set; } /// /// /// - public global::Ideogram.AspectRatioEditLite? Type72 { get; set; } + public global::Ideogram.V2ImageGenerateNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier? Type72 { get; set; } /// /// /// - public global::Ideogram.V1EditLiteImagesRequest? Type73 { get; set; } + public global::Ideogram.GenerateImageNanoBananaProResponse? Type73 { get; set; } /// /// /// - public global::Ideogram.TryOnRequestV3? Type74 { get; set; } + public global::Ideogram.GenerationQuality? Type74 { get; set; } /// /// /// - public global::Ideogram.ReframeImageRequestV3? Type75 { get; set; } + public global::Ideogram.GenerateImagePImageIdeogramRequestResolution? Type75 { get; set; } /// /// /// - public global::Ideogram.ReplaceBackgroundRequestV3? Type76 { get; set; } + public global::Ideogram.AspectRatioV3? Type76 { get; set; } /// /// /// - public global::Ideogram.RemoveBackgroundRequest? Type77 { get; set; } + public global::Ideogram.GenerateImagePImageIdeogramRequest? Type77 { get; set; } /// /// /// - public global::Ideogram.RemoveBackgroundResponse? Type78 { get; set; } + public object? Type78 { get; set; } /// /// /// - public global::System.DateTime? Type79 { get; set; } + public global::Ideogram.GenerateImagePImageIdeogramResponse? Type79 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type80 { get; set; } + public global::Ideogram.GenerateImageZImageRequest? Type80 { get; set; } /// /// /// - public global::Ideogram.RemoveBackgroundImageObject? Type81 { get; set; } + public global::Ideogram.GenerateImageZImageResponse? Type81 { get; set; } /// /// /// - public global::Ideogram.RemoveObjectRequest? Type82 { get; set; } + public global::Ideogram.V2ImageRemixAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier? Type82 { get; set; } /// /// /// - public float? Type83 { get; set; } + public global::Ideogram.ToolRemixResponse? Type83 { get; set; } /// /// /// - public global::Ideogram.SnapMaskRequest? Type84 { get; set; } + public global::Ideogram.V2ImageRemixIdeogram4PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? Type84 { get; set; } /// /// /// - public global::Ideogram.RemoveObjectResponse? Type85 { get; set; } + public global::Ideogram.RemixedImageObject? Type85 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type86 { get; set; } + public global::Ideogram.RemixImageIdeogramV4Response? Type86 { get; set; } /// /// /// - public global::Ideogram.RemoveObjectImageObject? Type87 { get; set; } + public global::System.Collections.Generic.IList? Type87 { get; set; } /// /// /// - public global::Ideogram.InternalTestingRequest? Type88 { get; set; } + public global::Ideogram.V2ImageRemixIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? Type88 { get; set; } /// /// /// - public global::Ideogram.InternalTestingNestedObject? Type89 { get; set; } + public global::Ideogram.RemixImageIdeogramV3Response? Type89 { get; set; } /// /// /// - public global::Ideogram.InternalTestingNestedObjectRequiredFields? Type90 { get; set; } + public global::Ideogram.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? Type90 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type91 { get; set; } + public global::Ideogram.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType? Type91 { get; set; } /// /// /// - public global::Ideogram.InternalTestingEnumField? Type92 { get; set; } + public global::Ideogram.RemixImageIdeogramV3CharacterResponse? Type92 { get; set; } /// /// /// - public global::Ideogram.RemixImageRequest? Type93 { get; set; } + public global::Ideogram.V2ImageRemixIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? Type93 { get; set; } /// /// /// - public global::Ideogram.InitialImageRequest? Type94 { get; set; } + public global::Ideogram.RemixImageIdeogramV3CustomModelResponse? Type94 { get; set; } /// /// /// - public global::Ideogram.ReframeImageRequest? Type95 { get; set; } + public global::Ideogram.V2ImageInpaintIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? Type95 { get; set; } /// /// /// - public global::Ideogram.Resolution? Type96 { get; set; } + public global::Ideogram.InpaintedImageObject? Type96 { get; set; } /// /// /// - public global::Ideogram.UpscaleImageRequest? Type97 { get; set; } + public global::Ideogram.InpaintImageIdeogramV3Response? Type97 { get; set; } /// /// /// - public global::Ideogram.UpscaleInitialImageRequest? Type98 { get; set; } + public global::System.Collections.Generic.IList? Type98 { get; set; } /// /// /// - public global::Ideogram.AspectRatio? Type99 { get; set; } + public global::Ideogram.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? Type99 { get; set; } /// /// /// - public global::Ideogram.MagicPromptVersionEnum? Type100 { get; set; } + public global::Ideogram.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType? Type100 { get; set; } /// /// /// - public global::Ideogram.GenerateImageResponse? Type101 { get; set; } + public global::Ideogram.InpaintImageIdeogramV3CharacterResponse? Type101 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type102 { get; set; } + public global::Ideogram.V2ImageInpaintIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? Type102 { get; set; } /// /// /// - public global::Ideogram.ImageObject? Type103 { get; set; } + public global::Ideogram.InpaintImageIdeogramV3CustomModelResponse? Type103 { get; set; } /// /// /// - public global::Ideogram.ImageGenerationResponseV3? Type104 { get; set; } + public global::Ideogram.V2ImageReframeIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? Type104 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type105 { get; set; } + public global::Ideogram.ReframeImageIdeogramV3Response? Type105 { get; set; } /// /// /// - public global::Ideogram.ImageGenerationObjectV3? Type106 { get; set; } + public global::Ideogram.NanoBanana2ReframeAspectRatio? Type106 { get; set; } /// /// /// - public global::Ideogram.V1EditImagesResponse? Type107 { get; set; } + public global::Ideogram.ReframeImageNanoBanana2Response? Type107 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type108 { get; set; } + public global::Ideogram.V2ImageUpscaleAutoPostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? Type108 { get; set; } /// /// /// - public global::Ideogram.V1EditImageObject? Type109 { get; set; } + public global::Ideogram.UpscaleImageObject? Type109 { get; set; } /// /// /// - public global::Ideogram.ImageGenerationResponseV4? Type110 { get; set; } + public global::Ideogram.UpscaleToolResponse? Type110 { get; set; } /// /// /// - public global::Ideogram.ImageGenerationResponseV4ResponseType? Type111 { get; set; } + public global::System.Collections.Generic.IList? Type111 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type112 { get; set; } + public global::Ideogram.V2ImageUpscaleNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier? Type112 { get; set; } /// /// /// - public global::Ideogram.ImageGenerationObjectV4? Type113 { get; set; } + public global::Ideogram.UpscaleImageNanoBananaProResponse? Type113 { get; set; } /// /// /// - public global::Ideogram.AsyncImageGenerationResponseV4? Type114 { get; set; } + public global::Ideogram.V2ImageUpscaleTopazBloom2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? Type114 { get; set; } /// /// /// - public global::Ideogram.GenerationResponse? Type115 { get; set; } + public global::Ideogram.UpscaleImageTopazBloom2Response? Type115 { get; set; } /// /// /// - public global::Ideogram.GenerationResponseStatus? Type116 { get; set; } + public global::Ideogram.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? Type116 { get; set; } /// /// /// - public global::Ideogram.GenerationResponseResponseType? Type117 { get; set; } + public global::Ideogram.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection? Type117 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type118 { get; set; } + public global::Ideogram.UpscaleImageTopazRedefineResponse? Type118 { get; set; } /// /// /// - public global::Ideogram.GenerationResponseDataInner? Type119 { get; set; } + public global::Ideogram.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? Type119 { get; set; } /// /// /// - public global::Ideogram.ImageObjectWithoutPromptOrSeed? Type120 { get; set; } + public global::Ideogram.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaSubjectDetection? Type120 { get; set; } /// /// /// - public global::Ideogram.ImageObjectWithoutPromptOrSeedObjectType? Type121 { get; set; } + public global::Ideogram.UpscaleImageTopazStandardV2Response? Type121 { get; set; } /// /// /// - public global::Ideogram.ImageGenerationObject? Type122 { get; set; } + public global::Ideogram.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? Type122 { get; set; } /// /// /// - public global::Ideogram.ImageGenerationObjectObjectType? Type123 { get; set; } + public global::Ideogram.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection? Type123 { get; set; } /// /// /// - public global::Ideogram.ImageGenerationResponse? Type124 { get; set; } + public global::Ideogram.UpscaleImageTopazTextRefineResponse? Type124 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type125 { get; set; } + public global::Ideogram.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? Type125 { get; set; } /// /// /// - public global::Ideogram.ImageGenerationResponseV4ImageToImage? Type126 { get; set; } + public global::Ideogram.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaEnhancementStrength? Type126 { get; set; } /// /// /// - public global::Ideogram.ImageGenerationResponseV4ImageToImageResponseType? Type127 { get; set; } + public global::Ideogram.UpscaleImageTopazWonder35Response? Type127 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type128 { get; set; } + public global::Ideogram.V2ImageReplaceBackgroundIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? Type128 { get; set; } /// /// /// - public global::Ideogram.ImageGenerationObjectV4ImageToImage? Type129 { get; set; } + public global::Ideogram.ReplaceBackgroundResponse? Type129 { get; set; } /// /// /// - public global::Ideogram.ImageGenerationResponseV4Layout? Type130 { get; set; } + public global::Ideogram.ReplaceBackgroundQuality? Type130 { get; set; } /// /// /// - public global::Ideogram.ImageGenerationResponseV4LayoutResponseType? Type131 { get; set; } + public global::Ideogram.BackgroundRemovedImageObject? Type131 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type132 { get; set; } + public global::Ideogram.RemoveBackgroundV2Response? Type132 { get; set; } /// /// /// - public global::Ideogram.ImageGenerationObjectV4Layout? Type133 { get; set; } + public global::System.Collections.Generic.IList? Type133 { get; set; } /// /// /// - public global::Ideogram.LayeredImageGenerationObjectV3? Type134 { get; set; } + public global::Ideogram.RemoveObjectFromV2AssetsResponse? Type134 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type135 { get; set; } + public global::Ideogram.V4StyleDescription? Type135 { get; set; } /// /// /// - public global::Ideogram.TextContainerV3? Type136 { get; set; } + public global::System.Collections.Generic.IList? Type136 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type137 { get; set; } + public global::Ideogram.V4ObjPromptElementType? Type137 { get; set; } /// /// /// - public global::Ideogram.ImageLayerV3? Type138 { get; set; } + public global::Ideogram.V4TextPromptElementType? Type138 { get; set; } /// /// /// - public global::Ideogram.LayeredImageGenerationResponseV3? Type139 { get; set; } + public global::Ideogram.V4PromptElement? Type139 { get; set; } /// /// /// - public global::Ideogram.LayeredImageGenerationResponseV3ResponseType? Type140 { get; set; } + public global::Ideogram.V4PromptElementVariant1? Type140 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type141 { get; set; } + public global::System.Collections.Generic.IList? Type141 { get; set; } /// /// /// - public global::Ideogram.GenerateImageSafetyError? Type142 { get; set; } + public global::Ideogram.V4PromptElementVariant2? Type142 { get; set; } /// /// /// - public global::Ideogram.MagicPromptRequest? Type143 { get; set; } + public global::Ideogram.V4PromptElementDiscriminator? Type143 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type144 { get; set; } + public global::Ideogram.V4PromptElementDiscriminatorType? Type144 { get; set; } /// /// /// - public global::Ideogram.MagicPromptRequestMessagesInner? Type145 { get; set; } + public global::Ideogram.V4CompositionalDeconstruction? Type145 { get; set; } /// /// /// - public global::Ideogram.MagicPromptResponse? Type146 { get; set; } + public global::System.Collections.Generic.IList? Type146 { get; set; } /// /// /// - public global::Ideogram.MagicPromptV4Request? Type147 { get; set; } + public global::Ideogram.V4JsonPrompt? Type147 { get; set; } /// /// /// - public global::Ideogram.MagicPromptV4Response? Type148 { get; set; } + public global::Ideogram.DescribeImageIdeogramV4Response? Type148 { get; set; } /// /// /// - public global::Ideogram.InternalBatchRequest? Type149 { get; set; } + public global::System.DateTime? Type149 { get; set; } /// /// /// - public global::Ideogram.SamplingRequestParams? Type150 { get; set; } + public global::Ideogram.ImageSafetyError? Type150 { get; set; } /// /// /// - public global::Ideogram.InternalBatchResponse? Type151 { get; set; } + public global::Ideogram.GeneratedDescription? Type151 { get; set; } /// /// /// - public global::Ideogram.TextSpanV3? Type152 { get; set; } + public global::Ideogram.DescribeImageIdeogramV3Response? Type152 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type153 { get; set; } + public global::System.Collections.Generic.IList? Type153 { get; set; } /// /// /// - public global::Ideogram.TextSpanV3FontFxItem? Type154 { get; set; } + public global::Ideogram.DetectedTextBlockAlignment? Type154 { get; set; } /// /// /// - public global::Ideogram.TextItemV3? Type155 { get; set; } + public global::Ideogram.DetectedTextBlockFormattingItems? Type155 { get; set; } /// /// /// - public global::Ideogram.TextItemV3Alignment? Type156 { get; set; } + public global::Ideogram.DetectedTextBlockRole? Type156 { get; set; } /// /// /// - public global::Ideogram.TextItemV3StyleClass? Type157 { get; set; } + public global::Ideogram.DetectedTextBlock? Type157 { get; set; } /// /// /// - public global::Ideogram.TextItemV3GlyphType? Type158 { get; set; } + public global::System.Collections.Generic.IList? Type158 { get; set; } /// /// /// - public global::Ideogram.TextItemV3TextTransform? Type159 { get; set; } + public global::Ideogram.LayerizedImageObject? Type159 { get; set; } /// /// /// - public global::Ideogram.TextItemV3VerticalAlignment? Type160 { get; set; } + public global::System.Collections.Generic.IList? Type160 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type161 { get; set; } + public global::Ideogram.LayerizeDesignIdeogramV3Response? Type161 { get; set; } /// /// /// - public global::Ideogram.LayeredAssetTextShadow? Type162 { get; set; } + public global::System.Collections.Generic.IList? Type162 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type163 { get; set; } + public global::Ideogram.KlingV3ShotType? Type163 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type164 { get; set; } + public global::Ideogram.GenerateVideoKlingV3Response? Type164 { get; set; } /// /// /// - public global::Ideogram.LayerizeLogosRequest? Type165 { get; set; } + public global::Ideogram.KlingV3AspectRatio? Type165 { get; set; } /// /// /// - public global::Ideogram.LayerizeLogosResponse? Type166 { get; set; } + public global::Ideogram.GenerateVideoKlingV3StandardTextToVideoRequest? Type166 { get; set; } /// /// /// - public global::Ideogram.LayerizeTextRequest? Type167 { get; set; } + public global::Ideogram.MinimaxH3Resolution? Type167 { get; set; } /// /// /// - public global::Ideogram.LayerizeTextResponse? Type168 { get; set; } + public global::Ideogram.GenerateVideoMinimaxH3Response? Type168 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type169 { get; set; } + public global::Ideogram.MinimaxH3AspectRatio? Type169 { get; set; } /// /// /// - public global::Ideogram.InternalBatchResultsResponse? Type170 { get; set; } + public global::Ideogram.MinimaxH3PromptExpansionMode? Type170 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type171 { get; set; } + public global::Ideogram.GenerateVideoMinimaxH3TextToVideoRequest? Type171 { get; set; } /// /// /// - public global::Ideogram.InternalBatchResultsResponseResultsInner? Type172 { get; set; } + public global::Ideogram.SeedDance25Resolution? Type172 { get; set; } /// /// /// - public global::Ideogram.AssetReferenceUsageResponse? Type173 { get; set; } + public global::Ideogram.GenerateVideoSeedDance25Response? Type173 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type174 { get; set; } + public global::Ideogram.SeedDance2AspectRatio? Type174 { get; set; } /// /// /// - public global::Ideogram.AssetReferenceUsageItem? Type175 { get; set; } + public global::Ideogram.GenerateVideoSeedDance25TextToVideoRequest? Type175 { get; set; } /// /// /// - public global::Ideogram.AssetIdentifier? Type176 { get; set; } + public global::Ideogram.SeedDance2Resolution? Type176 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type177 { get; set; } + public global::Ideogram.GenerateVideoSeedDance2Response? Type177 { get; set; } /// /// /// - public global::Ideogram.AttributeInfo? Type178 { get; set; } + public global::Ideogram.GenerateVideoSeedDance2TextToVideoRequest? Type178 { get; set; } /// /// /// - public global::Ideogram.GenerateVideoSeedDance2Response? Type179 { get; set; } + public global::Ideogram.V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage? Type179 { get; set; } /// /// /// - public global::Ideogram.GenerateVideoSeedDance2TextToVideoRequest? Type180 { get; set; } + public global::Ideogram.AdLocalizerQuality? Type180 { get; set; } /// /// /// - public global::Ideogram.SeedDance2AspectRatio? Type181 { get; set; } + public global::Ideogram.AdLocalizerResponse? Type181 { get; set; } /// /// /// - public global::Ideogram.SeedDance2Resolution? Type182 { get; set; } + public global::Ideogram.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution? Type182 { get; set; } /// /// /// - public global::Ideogram.GenerationErrorResponse? Type183 { get; set; } + public global::Ideogram.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaPlatform? Type183 { get; set; } /// /// /// - public global::Ideogram.GenerationRejectReason? Type184 { get; set; } + public global::Ideogram.AdResizerQuality? Type184 { get; set; } /// /// /// - public global::Ideogram.GenerationErrorResponseTaskCompletionSpeed? Type185 { get; set; } + public global::Ideogram.AdResizerResponse? Type185 { get; set; } /// /// /// - public global::Ideogram.GenerateVideoSeedDance2ImageToVideoRequest? Type186 { get; set; } + public global::Ideogram.V2ToolAdVariationsPostRequestBodyContentMultipartFormDataSchemaVariationType? Type186 { get; set; } /// /// /// - public global::Ideogram.GenerateVideoSeedDance25Response? Type187 { get; set; } + public global::Ideogram.AdVariationsQuality? Type187 { get; set; } /// /// /// - public global::Ideogram.GenerateVideoSeedDance25TextToVideoRequest? Type188 { get; set; } + public global::Ideogram.AdVariationsResponse? Type188 { get; set; } /// /// /// - public global::Ideogram.SeedDance25Resolution? Type189 { get; set; } + public global::Ideogram.ColorwaysQuality? Type189 { get; set; } /// /// /// - public global::Ideogram.GenerateVideoSeedDance25ImageToVideoRequest? Type190 { get; set; } + public global::Ideogram.ColorwaysResponse? Type190 { get; set; } /// /// /// - public global::Ideogram.GenerateVideoMinimaxH3TextToVideoRequest? Type191 { get; set; } + public global::Ideogram.AssetType? Type191 { get; set; } /// /// /// - public global::Ideogram.MinimaxH3AspectRatio? Type192 { get; set; } + public global::Ideogram.AssetIdentifier? Type192 { get; set; } /// /// /// - public global::Ideogram.MinimaxH3Resolution? Type193 { get; set; } + public global::Ideogram.V2ToolGhostMannequinPostRequestBodyContentMultipartFormDataSchemaView? Type193 { get; set; } /// /// /// - public global::Ideogram.GenerateVideoMinimaxH3Response? Type194 { get; set; } + public global::Ideogram.GhostMannequinQuality? Type194 { get; set; } /// /// /// - public global::Ideogram.GenerateVideoMinimaxH3ImageToVideoRequest? Type195 { get; set; } + public global::Ideogram.GhostMannequinResponse? Type195 { get; set; } /// /// /// - public global::Ideogram.GenerateVideoKlingV3Response? Type196 { get; set; } + public global::Ideogram.MaterialSwapQuality? Type196 { get; set; } /// /// /// - public global::Ideogram.GenerateVideoKlingV3StandardTextToVideoRequest? Type197 { get; set; } + public global::Ideogram.MaterialSwapResponse? Type197 { get; set; } /// /// /// - public global::Ideogram.KlingV3AspectRatio? Type198 { get; set; } + public global::Ideogram.ModelPoseVariantsQuality? Type198 { get; set; } /// /// /// - public global::Ideogram.KlingV3ShotType? Type199 { get; set; } + public global::Ideogram.ModelPoseVariantsResponse? Type199 { get; set; } /// /// /// - public global::Ideogram.GenerateVideoKlingV3StandardImageToVideoRequest? Type200 { get; set; } + public global::Ideogram.SketchToRenderQuality? Type200 { get; set; } /// /// /// - public global::Ideogram.GenerateVideoSeedDance2ReferenceToVideoRequest? Type201 { get; set; } + public global::Ideogram.SketchToRenderResponse? Type201 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type202 { get; set; } + public global::Ideogram.GenerationResponseStatus? Type202 { get; set; } /// /// /// - public global::Ideogram.GenerateVideoSeedDance25ReferenceToVideoRequest? Type203 { get; set; } + public global::Ideogram.GenerationResponseResponseType? Type203 { get; set; } /// /// /// - public global::Ideogram.EditVideoMinimaxH3ReferenceToVideoRequest? Type204 { get; set; } + public global::Ideogram.GenerationResponseDataInnerDiscriminatorMappingSvgGenerationMimeType? Type204 { get; set; } /// /// /// - public global::Ideogram.MinimaxH3PromptExpansionMode? Type205 { get; set; } + public global::Ideogram.LayerizedTextBlockAlignment? Type205 { get; set; } /// /// /// - public global::Ideogram.EditVideoSeedDance2Request? Type206 { get; set; } + public global::Ideogram.LayerizedTextBlockFormattingItems? Type206 { get; set; } /// /// /// - public global::Ideogram.RemoveObjectFromV2AssetsResponse? Type207 { get; set; } + public global::Ideogram.LayerizedTextBlockRole? Type207 { get; set; } /// /// /// - public global::Ideogram.RemoveObjectFromV2AssetsRequest? Type208 { get; set; } + public global::Ideogram.TextColorSpan? Type208 { get; set; } /// /// /// - public global::Ideogram.RemoveBackgroundV2Response? Type209 { get; set; } + public global::Ideogram.LayerizedTextBlock? Type209 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type210 { get; set; } + public global::System.Collections.Generic.IList? Type210 { get; set; } /// /// /// - public global::Ideogram.BackgroundRemovedImageObject? Type211 { get; set; } + public global::System.Collections.Generic.IList? Type211 { get; set; } /// /// /// - public global::Ideogram.RemoveBackgroundV2Request? Type212 { get; set; } + public global::Ideogram.GenerationResponseDataInner? Type212 { get; set; } /// /// /// - public global::Ideogram.RemoveBackgroundV2AssetRequest? Type213 { get; set; } + public global::Ideogram.GenerationResponseDataInnerVariant1? Type213 { get; set; } /// /// /// - public global::Ideogram.ReplaceBackgroundResponse? Type214 { get; set; } + public global::Ideogram.GenerationResponseDataInnerVariant1ObjectType? Type214 { get; set; } /// /// /// - public global::Ideogram.ReplaceBackgroundRequest? Type215 { get; set; } + public global::Ideogram.GenerationResponseDataInnerVariant2? Type215 { get; set; } /// /// /// - public global::Ideogram.ReplaceBackgroundQuality? Type216 { get; set; } + public global::Ideogram.GenerationResponseDataInnerVariant2ObjectType? Type216 { get; set; } /// /// /// - public global::Ideogram.ReplaceBackgroundIdeogramV3Request? Type217 { get; set; } + public global::Ideogram.GenerationResponseDataInnerVariant3? Type217 { get; set; } /// /// /// - public global::Ideogram.ReplaceBackgroundIdeogramV3RequestRenderingSpeed? Type218 { get; set; } + public global::Ideogram.GenerationResponseDataInnerVariant3ObjectType? Type218 { get; set; } /// /// /// - public global::Ideogram.ReplaceBackgroundIdeogram45Request? Type219 { get; set; } + public global::Ideogram.GenerationResponseDataInnerVariant4? Type219 { get; set; } /// /// /// - public global::Ideogram.ListAccountApiKeysResponse? Type220 { get; set; } + public global::Ideogram.GenerationResponseDataInnerVariant4ObjectType? Type220 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type221 { get; set; } + public global::Ideogram.GenerationResponseDataInnerVariant5? Type221 { get; set; } /// /// /// - public global::Ideogram.AccountApiKey? Type222 { get; set; } + public global::Ideogram.GenerationResponseDataInnerVariant5ObjectType? Type222 { get; set; } /// /// /// - public global::Ideogram.AccountApiKeyStatus? Type223 { get; set; } + public global::Ideogram.GenerationResponseDataInnerVariant6? Type223 { get; set; } /// /// /// - public global::Ideogram.GetAccountUsageResponse? Type224 { get; set; } + public global::Ideogram.GenerationResponseDataInnerVariant6ObjectType? Type224 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type225 { get; set; } + public global::System.Collections.Generic.IList? Type225 { get; set; } /// /// /// - public global::Ideogram.AccountUsageBucket? Type226 { get; set; } + public global::Ideogram.GenerationResponseDataInnerDiscriminator? Type226 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type227 { get; set; } + public global::Ideogram.GenerationResponseDataInnerDiscriminatorObjectType? Type227 { get; set; } /// /// /// - public global::Ideogram.AccountUsageLineItem? Type228 { get; set; } + public global::Ideogram.GenerationResponse? Type228 { get; set; } /// /// /// - public global::System.Collections.Generic.Dictionary? Type229 { get; set; } + public long? Type229 { get; set; } /// /// /// - public global::Ideogram.AccountUsageLineItemSource? Type230 { get; set; } + public global::System.Collections.Generic.IList? Type230 { get; set; } /// /// /// - public global::Ideogram.AccountUsageApiKey? Type231 { get; set; } + public global::Ideogram.AccountApiKeyStatus? Type231 { get; set; } /// /// /// - public global::Ideogram.AccountUsageBilledUnits? Type232 { get; set; } + public global::Ideogram.AccountApiKey? Type232 { get; set; } /// /// /// - public global::Ideogram.ListAccountInvoicesResponse? Type233 { get; set; } + public global::Ideogram.ListAccountApiKeysResponse? Type233 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type234 { get; set; } + public global::System.Collections.Generic.IList? Type234 { get; set; } /// /// /// - public global::Ideogram.AccountInvoice? Type235 { get; set; } + public global::Ideogram.AccountInvoiceStatus? Type235 { get; set; } /// /// /// - public global::Ideogram.AccountInvoiceStatus? Type236 { get; set; } + public global::Ideogram.AccountUsageApiKey? Type236 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type237 { get; set; } + public global::Ideogram.AccountInvoiceLineItem? Type237 { get; set; } /// /// /// - public global::Ideogram.AccountInvoiceLineItem? Type238 { get; set; } + public global::Ideogram.AccountInvoice? Type238 { get; set; } /// /// /// - public global::Ideogram.UpscaleImageTopazTextRefineResponse? Type239 { get; set; } + public global::System.Collections.Generic.IList? Type239 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type240 { get; set; } + public global::Ideogram.ListAccountInvoicesResponse? Type240 { get; set; } /// /// /// - public global::Ideogram.UpscaleImageObject? Type241 { get; set; } + public global::System.Collections.Generic.IList? Type241 { get; set; } /// /// /// - public global::Ideogram.UpscaleImageTopazTextRefineRequest? Type242 { get; set; } + public global::Ideogram.V2AccountUsageGetParametersBucketWidth? Type242 { get; set; } /// /// /// - public global::Ideogram.UpscaleImageTopazTextRefineRequestUpscaleFactor? Type243 { get; set; } + public global::Ideogram.V2AccountUsageGetParametersSourcesSchemaItems? Type243 { get; set; } /// /// /// - public global::Ideogram.UpscaleImageTopazTextRefineRequestSubjectDetection? Type244 { get; set; } + public global::Ideogram.AccountUsageLineItemSource? Type244 { get; set; } /// /// /// - public global::Ideogram.UpscaleImageTopazWonder35Response? Type245 { get; set; } + public global::Ideogram.AccountUsageBilledUnits? Type245 { get; set; } /// /// /// - public global::Ideogram.UpscaleImageTopazWonder35Request? Type246 { get; set; } + public global::Ideogram.AccountUsageLineItem? Type246 { get; set; } /// /// /// - public global::Ideogram.UpscaleImageTopazWonder35RequestUpscaleFactor? Type247 { get; set; } + public global::System.Collections.Generic.Dictionary? Type247 { get; set; } /// /// /// - public global::Ideogram.UpscaleImageTopazWonder35RequestEnhancementStrength? Type248 { get; set; } + public global::Ideogram.AccountUsageBucket? Type248 { get; set; } /// /// /// - public global::Ideogram.UpscaleImageTopazStandardV2Response? Type249 { get; set; } + public global::System.Collections.Generic.IList? Type249 { get; set; } /// /// /// - public global::Ideogram.UpscaleImageTopazStandardV2Request? Type250 { get; set; } + public global::Ideogram.GetAccountUsageResponse? Type250 { get; set; } /// /// /// - public global::Ideogram.UpscaleImageTopazStandardV2RequestUpscaleFactor? Type251 { get; set; } + public global::System.Collections.Generic.IList? Type251 { get; set; } /// /// /// - public global::Ideogram.UpscaleImageTopazStandardV2RequestSubjectDetection? Type252 { get; set; } + public global::Ideogram.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Request? Type252 { get; set; } /// /// /// - public global::Ideogram.UpscaleImageTopazBloom2Response? Type253 { get; set; } + public byte[]? Type253 { get; set; } /// /// /// - public global::Ideogram.UpscaleImageTopazBloom2Request? Type254 { get; set; } + public global::System.Collections.Generic.IList? Type254 { get; set; } /// /// /// - public global::Ideogram.UpscaleImageTopazBloom2RequestUpscaleFactor? Type255 { get; set; } + public global::Ideogram.AutoModelPostGenerateImageV2AutoRequest? Type255 { get; set; } /// /// /// - public global::Ideogram.UpscaleImageTopazRedefineResponse? Type256 { get; set; } + public global::Ideogram.ImagesGeneratePostGenerateImageV2Ideogram45Request? Type256 { get; set; } /// /// /// - public global::Ideogram.UpscaleImageTopazRedefineRequest? Type257 { get; set; } + public global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3Request? Type257 { get; set; } /// /// /// - public global::Ideogram.UpscaleImageTopazRedefineRequestUpscaleFactor? Type258 { get; set; } + public global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterRequest? Type258 { get; set; } /// /// /// - public global::Ideogram.UpscaleImageTopazRedefineRequestSubjectDetection? Type259 { get; set; } + public global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelRequest? Type259 { get; set; } /// /// /// - public global::Ideogram.UpscaleImageNanoBananaProResponse? Type260 { get; set; } + public global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25FlareRequest? Type260 { get; set; } /// /// /// - public global::Ideogram.UpscaleImageNanoBananaProRequest? Type261 { get; set; } + public global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25SunburstRequest? Type261 { get; set; } /// /// /// - public global::Ideogram.UpscaleImageNanoBananaProRequestResolutionTier? Type262 { get; set; } + public global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage2Request? Type262 { get; set; } /// /// /// - public global::Ideogram.LookbookResponse? Type263 { get; set; } + public global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana2Request? Type263 { get; set; } /// /// /// - public global::Ideogram.LookbookRequest? Type264 { get; set; } + public global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana21Request? Type264 { get; set; } /// /// /// - public global::Ideogram.LookbookRequestCategory? Type265 { get; set; } + public global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBananaProRequest? Type265 { get; set; } /// /// /// - public global::Ideogram.ModelPoseVariantsResponse? Type266 { get; set; } + public global::Ideogram.AutoModelPostToolRemixRequest? Type266 { get; set; } /// /// /// - public global::Ideogram.ModelPoseVariantsRequest? Type267 { get; set; } + public global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV4Request? Type267 { get; set; } /// /// /// - public global::Ideogram.ModelPoseVariantsQuality? Type268 { get; set; } + public global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3Request? Type268 { get; set; } /// /// /// - public global::Ideogram.PackshotsResponse? Type269 { get; set; } + public global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CharacterRequest? Type269 { get; set; } /// /// /// - public global::Ideogram.PackshotsRequest? Type270 { get; set; } + public global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CustomModelRequest? Type270 { get; set; } /// /// /// - public global::Ideogram.PackshotView? Type271 { get; set; } + public global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3Request? Type271 { get; set; } /// /// /// - public global::Ideogram.PackshotsQuality? Type272 { get; set; } + public global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterRequest? Type272 { get; set; } /// /// /// - public global::Ideogram.GhostMannequinResponse? Type273 { get; set; } + public global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelRequest? Type273 { get; set; } /// /// /// - public global::Ideogram.GhostMannequinRequest? Type274 { get; set; } + public global::Ideogram.ReframeIdeogramV3Request? Type274 { get; set; } /// /// /// - public global::Ideogram.GhostMannequinRequestView? Type275 { get; set; } + public global::Ideogram.ReframeNanoBanana2Request? Type275 { get; set; } /// /// /// - public global::Ideogram.GhostMannequinQuality? Type276 { get; set; } + public global::Ideogram.ToolsPostUpscaleRequest? Type276 { get; set; } /// /// /// - public global::Ideogram.Product360VideoRequest? Type277 { get; set; } + public global::Ideogram.ImagesUpscalePostUpscaleImageNanoBananaProRequest? Type277 { get; set; } /// /// /// - public global::Ideogram.Product360VideoDirection? Type278 { get; set; } + public global::Ideogram.ImagesUpscalePostUpscaleImageTopazBloom2Request? Type278 { get; set; } /// /// /// - public global::Ideogram.LivingImageResponse? Type279 { get; set; } + public global::Ideogram.ImagesUpscalePostUpscaleImageTopazRedefineRequest? Type279 { get; set; } /// /// /// - public global::Ideogram.LivingImageRequest? Type280 { get; set; } + public global::Ideogram.ImagesUpscalePostUpscaleImageTopazStandardV2Request? Type280 { get; set; } /// /// /// - public global::Ideogram.LivingImageQuality? Type281 { get; set; } + public global::Ideogram.ImagesUpscalePostUpscaleImageTopazTextRefineRequest? Type281 { get; set; } /// /// /// - public global::Ideogram.PreciseMaskedEditResponse? Type282 { get; set; } + public global::Ideogram.ImagesUpscalePostUpscaleImageTopazWonder35Request? Type282 { get; set; } /// /// /// - public global::Ideogram.PreciseMaskedEditRequest? Type283 { get; set; } + public global::Ideogram.ToolReplaceBackgroundIdeogramV3Request? Type283 { get; set; } /// /// /// - public global::Ideogram.PreciseMaskedEditModel? Type284 { get; set; } + public global::Ideogram.ToolReplaceBackgroundRequest? Type284 { get; set; } /// /// /// - public global::Ideogram.PreciseMaskedEditQuality? Type285 { get; set; } + public global::Ideogram.ToolRemoveBackgroundRequest? Type285 { get; set; } /// /// /// - public global::Ideogram.VirtualTryOnResponse? Type286 { get; set; } + public global::Ideogram.ObjectRemovalPostRemoveObjectFromV2AssetsRequest? Type286 { get; set; } /// /// /// - public global::Ideogram.VirtualTryOnRequest? Type287 { get; set; } + public global::Ideogram.ImageDescribePostDescribeImageIdeogramV4Request? Type287 { get; set; } /// /// /// - public global::Ideogram.ColorwaysResponse? Type288 { get; set; } + public global::Ideogram.ImageDescribePostDescribeImageIdeogramV3Request? Type288 { get; set; } /// /// /// - public global::Ideogram.ColorwaysRequest? Type289 { get; set; } + public global::Ideogram.DesignPostLayerizeDesignIdeogramV3Request? Type289 { get; set; } /// /// /// - public global::Ideogram.ColorwaysQuality? Type290 { get; set; } + public global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoRequest? Type290 { get; set; } /// /// /// - public global::Ideogram.AdLocalizerResponse? Type291 { get; set; } + public global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoRequest? Type291 { get; set; } /// /// /// - public global::Ideogram.AdLocalizerRequest? Type292 { get; set; } + public global::Ideogram.VideoEditPostEditVideoMinimaxH3ReferenceToVideoRequest? Type292 { get; set; } /// /// /// - public global::Ideogram.AdLocalizerRequestLanguage? Type293 { get; set; } + public global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoRequest? Type293 { get; set; } /// /// /// - public global::Ideogram.AdLocalizerQuality? Type294 { get; set; } + public global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoRequest? Type294 { get; set; } /// /// /// - public global::Ideogram.VectorizerResponse? Type295 { get; set; } + public global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoRequest? Type295 { get; set; } /// /// /// - public global::Ideogram.VectorizerRequest? Type296 { get; set; } + public global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoRequest? Type296 { get; set; } /// /// /// - public global::Ideogram.VectorizerRequestMode? Type297 { get; set; } + public global::Ideogram.EditWorkflowPostAdLocalizerRequest? Type297 { get; set; } /// /// /// - public global::Ideogram.TextLayerizerResponse? Type298 { get; set; } + public global::Ideogram.EditWorkflowPostAdResizerRequest? Type298 { get; set; } /// /// /// - public global::Ideogram.TextLayerizerRequest? Type299 { get; set; } + public global::Ideogram.EditWorkflowPostAdVariationsRequest? Type299 { get; set; } /// /// /// - public global::Ideogram.AdResizerResponse? Type300 { get; set; } + public global::Ideogram.EditWorkflowPostColorwaysRequest? Type300 { get; set; } /// /// /// - public global::Ideogram.AdResizerRequest? Type301 { get; set; } + public global::Ideogram.EditWorkflowPostGhostMannequinRequest? Type301 { get; set; } /// /// /// - public global::Ideogram.AdResizerRequestResolution? Type302 { get; set; } + public global::Ideogram.EditWorkflowPostMaterialSwapRequest? Type302 { get; set; } /// /// /// - public global::Ideogram.AdResizerRequestPlatform? Type303 { get; set; } + public global::Ideogram.EditWorkflowPostModelPoseVariantsRequest? Type303 { get; set; } /// /// /// - public global::Ideogram.AdResizerQuality? Type304 { get; set; } + public global::Ideogram.EditWorkflowPostSketchToRenderRequest? Type304 { get; set; } /// /// /// - public global::Ideogram.AdVariationsResponse? Type305 { get; set; } + public global::Ideogram.ToolReplaceBackgroundIdeogram45Request? Type305 { get; set; } /// /// /// - public global::Ideogram.AdVariationsRequest? Type306 { get; set; } - /// - /// - /// - public global::Ideogram.AdVariationsRequestVariationType? Type307 { get; set; } - /// - /// - /// - public global::Ideogram.AdVariationsQuality? Type308 { get; set; } - /// - /// - /// - public global::Ideogram.SketchToRenderResponse? Type309 { get; set; } - /// - /// - /// - public global::Ideogram.SketchToRenderRequest? Type310 { get; set; } - /// - /// - /// - public global::Ideogram.SketchToRenderQuality? Type311 { get; set; } - /// - /// - /// - public global::Ideogram.SoleSwapResponse? Type312 { get; set; } - /// - /// - /// - public global::Ideogram.SoleSwapRequest? Type313 { get; set; } - /// - /// - /// - public global::Ideogram.SoleSwapRequestBaseGenerationSize? Type314 { get; set; } - /// - /// - /// - public global::Ideogram.SoleSwapQuality? Type315 { get; set; } - /// - /// - /// - public global::Ideogram.SwapProductResponse? Type316 { get; set; } - /// - /// - /// - public global::Ideogram.SwapProductRequest? Type317 { get; set; } - /// - /// - /// - public global::Ideogram.SwapProductMode? Type318 { get; set; } - /// - /// - /// - public global::Ideogram.SwapProductQuality? Type319 { get; set; } - /// - /// - /// - public global::Ideogram.SkechersStyleEditResponse? Type320 { get; set; } - /// - /// - /// - public global::Ideogram.SkechersStyleEditRequest? Type321 { get; set; } - /// - /// - /// - public global::Ideogram.SkechersStyleEditRequestAspectRatio? Type322 { get; set; } - /// - /// - /// - public global::Ideogram.SkechersStyleEditRequestBaseGenerationSize? Type323 { get; set; } - /// - /// - /// - public global::Ideogram.SkechersStyleEditQuality? Type324 { get; set; } - /// - /// - /// - public global::Ideogram.SwanSLogoDesignResponse? Type325 { get; set; } - /// - /// - /// - public global::Ideogram.SwanSLogoDesignRequest? Type326 { get; set; } - /// - /// - /// - public global::Ideogram.SwanSLogoDesignRequestLogoStyle? Type327 { get; set; } - /// - /// - /// - public global::Ideogram.SwanSLogoDesignRequestSourceMode? Type328 { get; set; } - /// - /// - /// - public global::Ideogram.SwanSLogoDesignRequestDesignVariant? Type329 { get; set; } - /// - /// - /// - public global::Ideogram.SwanSLogoQuality? Type330 { get; set; } - /// - /// - /// - public global::Ideogram.SwanSLogoInstallResponse? Type331 { get; set; } - /// - /// - /// - public global::Ideogram.SwanSLogoInstallRequest? Type332 { get; set; } - /// - /// - /// - public global::Ideogram.SwanSLogoInstallRequestLogoStyle? Type333 { get; set; } - /// - /// - /// - public global::Ideogram.ModelSwapResponse? Type334 { get; set; } - /// - /// - /// - public global::Ideogram.ModelSwapRequest? Type335 { get; set; } - /// - /// - /// - public global::Ideogram.ModelSwapQuality? Type336 { get; set; } - /// - /// - /// - public global::Ideogram.MaterialSwapResponse? Type337 { get; set; } - /// - /// - /// - public global::Ideogram.MaterialSwapRequest? Type338 { get; set; } - /// - /// - /// - public global::Ideogram.MaterialSwapQuality? Type339 { get; set; } - /// - /// - /// - public global::Ideogram.UpscaleToolResponse? Type340 { get; set; } - /// - /// - /// - public global::Ideogram.UpscaleToolRequest? Type341 { get; set; } - /// - /// - /// - public global::Ideogram.UpscaleToolRequestUpscaleFactor? Type342 { get; set; } - /// - /// - /// - public global::Ideogram.LayerizeDesignIdeogramV3Response? Type343 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.IList? Type344 { get; set; } - /// - /// - /// - public global::Ideogram.LayerizedImageObject? Type345 { get; set; } - /// - /// - /// - public global::Ideogram.LayerizedImageObjectObjectType? Type346 { get; set; } - /// - /// - /// - public global::Ideogram.LayerizeDesignIdeogramV3Request? Type347 { get; set; } - /// - /// - /// - public global::Ideogram.DescribeImageIdeogramV3Response? Type348 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.IList? Type349 { get; set; } - /// - /// - /// - public global::Ideogram.GeneratedDescription? Type350 { get; set; } - /// - /// - /// - public global::Ideogram.DescribeImageIdeogramV3Request? Type351 { get; set; } - /// - /// - /// - public global::Ideogram.ImageSafetyError? Type352 { get; set; } - /// - /// - /// - public global::Ideogram.DescribeImageIdeogramV4Response? Type353 { get; set; } - /// - /// - /// - public global::Ideogram.DescribeImageIdeogramV4Request? Type354 { get; set; } - /// - /// - /// - public global::Ideogram.GenerateImageIdeogramV3Response? Type355 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.IList? Type356 { get; set; } - /// - /// - /// - public global::Ideogram.GeneratedImageObject? Type357 { get; set; } - /// - /// - /// - public global::Ideogram.GenerateImageIdeogramV3Request? Type358 { get; set; } - /// - /// - /// - public global::Ideogram.IdeogramV3AspectRatio? Type359 { get; set; } - /// - /// - /// - public global::Ideogram.GenerateImageIdeogramV3RequestRenderingSpeed? Type360 { get; set; } - /// - /// - /// - public global::Ideogram.MagicPromptMode? Type361 { get; set; } - /// - /// - /// - public global::Ideogram.IdeogramColorPalette? Type362 { get; set; } - /// - /// - /// - public global::Ideogram.IdeogramV3StyleType? Type363 { get; set; } - /// - /// - /// - public global::Ideogram.IdeogramV3StylePreset? Type364 { get; set; } - /// - /// - /// - public global::Ideogram.GenerateImageIdeogramV3CustomModelResponse? Type365 { get; set; } - /// - /// - /// - public global::Ideogram.GenerateImageIdeogramV3CustomModelRequest? Type366 { get; set; } - /// - /// - /// - public global::Ideogram.GenerateImageIdeogramV3CustomModelRequestRenderingSpeed? Type367 { get; set; } - /// - /// - /// - public global::Ideogram.GenerateImageIdeogramV4Response? Type368 { get; set; } - /// - /// - /// - public global::Ideogram.GenerateImageIdeogramV4Request? Type369 { get; set; } - /// - /// - /// - public global::Ideogram.GenerateImageIdeogramV4RequestRenderingSpeed? Type370 { get; set; } - /// - /// - /// - public global::Ideogram.GenerateImageIdeogramV4CustomModelResponse? Type371 { get; set; } - /// - /// - /// - public global::Ideogram.GenerateImageIdeogramV4CustomModelRequest? Type372 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.IList? Type373 { get; set; } - /// - /// - /// - public global::Ideogram.StackedCustomModel? Type374 { get; set; } - /// - /// - /// - public global::Ideogram.GenerateImageIdeogramV4CustomModelRequestRenderingSpeed? Type375 { get; set; } - /// - /// - /// - public double? Type376 { get; set; } - /// - /// - /// - public global::Ideogram.RemixImageIdeogramV3Response? Type377 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.IList? Type378 { get; set; } - /// - /// - /// - public global::Ideogram.RemixedImageObject? Type379 { get; set; } - /// - /// - /// - public global::Ideogram.RemixImageIdeogramV3Request? Type380 { get; set; } - /// - /// - /// - public global::Ideogram.RemixImageIdeogramV3RequestRenderingSpeed? Type381 { get; set; } - /// - /// - /// - public global::Ideogram.RemixImageIdeogramV3CustomModelResponse? Type382 { get; set; } - /// - /// - /// - public global::Ideogram.RemixImageIdeogramV3CustomModelRequest? Type383 { get; set; } - /// - /// - /// - public global::Ideogram.RemixImageIdeogramV3CustomModelRequestRenderingSpeed? Type384 { get; set; } - /// - /// - /// - public global::Ideogram.RemixImageIdeogramV4Response? Type385 { get; set; } - /// - /// - /// - public global::Ideogram.RemixImageIdeogramV4Request? Type386 { get; set; } - /// - /// - /// - public global::Ideogram.RemixImageIdeogramV4RequestRenderingSpeed? Type387 { get; set; } - /// - /// - /// - public global::Ideogram.RemixImageIdeogramV3CharacterResponse? Type388 { get; set; } - /// - /// - /// - public global::Ideogram.RemixImageIdeogramV3CharacterRequest? Type389 { get; set; } - /// - /// - /// - public global::Ideogram.RemixImageIdeogramV3CharacterRequestRenderingSpeed? Type390 { get; set; } - /// - /// - /// - public global::Ideogram.RemixImageIdeogramV3CharacterRequestStyleType? Type391 { get; set; } - /// - /// - /// - public global::Ideogram.GenerateImageIdeogramV3TransparentResponse? Type392 { get; set; } - /// - /// - /// - public global::Ideogram.GenerateImageIdeogramV3TransparentRequest? Type393 { get; set; } - /// - /// - /// - public global::Ideogram.GenerateImageIdeogramV3TransparentRequestUpscaleFactor? Type394 { get; set; } - /// - /// - /// - public global::Ideogram.GenerateImageIdeogramV3TransparentRequestRenderingSpeed? Type395 { get; set; } - /// - /// - /// - public global::Ideogram.GenerateImageIdeogramV4TransparentResponse? Type396 { get; set; } - /// - /// - /// - public global::Ideogram.GenerateImageIdeogramV4TransparentRequest? Type397 { get; set; } - /// - /// - /// - public global::Ideogram.IdeogramV4AspectRatio? Type398 { get; set; } - /// - /// - /// - public global::Ideogram.GenerateImageIdeogramV4TransparentRequestOutputResolution? Type399 { get; set; } - /// - /// - /// - public global::Ideogram.GenerateImageIdeogramV4TransparentRequestRenderingSpeed? Type400 { get; set; } - /// - /// - /// - public global::Ideogram.GenerateImagePImageIdeogramResponse? Type401 { get; set; } - /// - /// - /// - public global::Ideogram.GenerateImagePImageIdeogramRequest? Type402 { get; set; } - /// - /// - /// - public global::Ideogram.GenerationQuality? Type403 { get; set; } - /// - /// - /// - public global::Ideogram.GenerateImagePImageIdeogramRequestResolution? Type404 { get; set; } - /// - /// - /// - public global::Ideogram.GenerateImageZImageResponse? Type405 { get; set; } - /// - /// - /// - public global::Ideogram.GenerateImageZImageRequest? Type406 { get; set; } - /// - /// - /// - public global::Ideogram.GenerateImageIdeogram45Response? Type407 { get; set; } - /// - /// - /// - public global::Ideogram.GenerationKind? Type408 { get; set; } - /// - /// - /// - public global::Ideogram.GenerateImageIdeogram45Request? Type409 { get; set; } - /// - /// - /// - public global::Ideogram.GenerateImageIdeogram45RequestBackground? Type410 { get; set; } - /// - /// - /// - public global::Ideogram.GenerateImageIdeogram45RequestQuality? Type411 { get; set; } - /// - /// - /// - public global::Ideogram.PreciseEditImageIdeogram45Response? Type412 { get; set; } - /// - /// - /// - public global::Ideogram.PreciseEditImageIdeogram45Request? Type413 { get; set; } - /// - /// - /// - public global::Ideogram.PreciseEditImageIdeogram45RequestQuality? Type414 { get; set; } - /// - /// - /// - public global::Ideogram.GenerateImageNanoBanana2Response? Type415 { get; set; } - /// - /// - /// - public global::Ideogram.GenerateImageNanoBanana2Request? Type416 { get; set; } - /// - /// - /// - public global::Ideogram.NanoBanana2AspectRatio? Type417 { get; set; } - /// - /// - /// - public global::Ideogram.GenerateImageNanoBanana2RequestResolutionTier? Type418 { get; set; } - /// - /// - /// - public global::Ideogram.GenerateImageNanoBanana21Response? Type419 { get; set; } - /// - /// - /// - public global::Ideogram.GenerateImageNanoBanana21Request? Type420 { get; set; } - /// - /// - /// - public global::Ideogram.NanoBanana21AspectRatio? Type421 { get; set; } - /// - /// - /// - public global::Ideogram.GenerateImageNanoBanana21RequestResolutionTier? Type422 { get; set; } - /// - /// - /// - public global::Ideogram.GenerateImageNanoBananaProResponse? Type423 { get; set; } - /// - /// - /// - public global::Ideogram.GenerateImageNanoBananaProRequest? Type424 { get; set; } - /// - /// - /// - public global::Ideogram.NanoBananaProAspectRatio? Type425 { get; set; } - /// - /// - /// - public global::Ideogram.GenerateImageNanoBananaProRequestResolutionTier? Type426 { get; set; } - /// - /// - /// - public global::Ideogram.GenerateImageGptImage2Response? Type427 { get; set; } - /// - /// - /// - public global::Ideogram.GenerateImageGptImage2Request? Type428 { get; set; } - /// - /// - /// - public global::Ideogram.GenerateImageGptImage25FlareResponse? Type429 { get; set; } - /// - /// - /// - public global::Ideogram.GenerateImageGptImage25FlareRequest? Type430 { get; set; } - /// - /// - /// - public global::Ideogram.GenerateImageGptImage25FlareRequestBackground? Type431 { get; set; } - /// - /// - /// - public global::Ideogram.GenerateImageGptImage25FlareRequestQuality? Type432 { get; set; } - /// - /// - /// - public global::Ideogram.GenerateImageGptImage25SunburstResponse? Type433 { get; set; } - /// - /// - /// - public global::Ideogram.GenerateImageGptImage25SunburstRequest? Type434 { get; set; } - /// - /// - /// - public global::Ideogram.GenerateImageGptImage25SunburstRequestBackground? Type435 { get; set; } - /// - /// - /// - public global::Ideogram.GenerateImageGptImage25SunburstRequestQuality? Type436 { get; set; } - /// - /// - /// - public global::Ideogram.GenerateImageIdeogramV2Response? Type437 { get; set; } - /// - /// - /// - public global::Ideogram.GenerateImageIdeogramV2Request? Type438 { get; set; } - /// - /// - /// - public global::Ideogram.GenerateImageIdeogramV2RequestRenderingSpeed? Type439 { get; set; } - /// - /// - /// - public global::Ideogram.IdeogramV2StyleType? Type440 { get; set; } - /// - /// - /// - public global::Ideogram.GenerateImageIdeogramV2AResponse? Type441 { get; set; } - /// - /// - /// - public global::Ideogram.GenerateImageIdeogramV2ARequest? Type442 { get; set; } - /// - /// - /// - public global::Ideogram.GenerateImageIdeogramV2ARequestRenderingSpeed? Type443 { get; set; } - /// - /// - /// - public global::Ideogram.InpaintImageIdeogramV3Response? Type444 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.IList? Type445 { get; set; } - /// - /// - /// - public global::Ideogram.InpaintedImageObject? Type446 { get; set; } - /// - /// - /// - public global::Ideogram.InpaintImageIdeogramV3Request? Type447 { get; set; } - /// - /// - /// - public global::Ideogram.InpaintImageIdeogramV3RequestRenderingSpeed? Type448 { get; set; } - /// - /// - /// - public global::Ideogram.InpaintImageIdeogramV3CustomModelResponse? Type449 { get; set; } - /// - /// - /// - public global::Ideogram.InpaintImageIdeogramV3CustomModelRequest? Type450 { get; set; } - /// - /// - /// - public global::Ideogram.InpaintImageIdeogramV3CustomModelRequestRenderingSpeed? Type451 { get; set; } - /// - /// - /// - public global::Ideogram.ReframeImageIdeogramV3Response? Type452 { get; set; } - /// - /// - /// - public global::Ideogram.ReframeImageIdeogramV3Request? Type453 { get; set; } - /// - /// - /// - public global::Ideogram.ReframeImageIdeogramV3RequestRenderingSpeed? Type454 { get; set; } - /// - /// - /// - public global::Ideogram.ReframeImageNanoBanana2Response? Type455 { get; set; } - /// - /// - /// - public global::Ideogram.ReframeImageNanoBanana2Request? Type456 { get; set; } - /// - /// - /// - public global::Ideogram.NanoBanana2ReframeAspectRatio? Type457 { get; set; } - /// - /// - /// - public global::Ideogram.ReframeImageNanoBananaProResponse? Type458 { get; set; } - /// - /// - /// - public global::Ideogram.ReframeImageNanoBananaProRequest? Type459 { get; set; } - /// - /// - /// - public global::Ideogram.NanoBananaProReframeAspectRatio? Type460 { get; set; } - /// - /// - /// - public global::Ideogram.ReframeImageNanoBananaProRequestResolutionTier? Type461 { get; set; } - /// - /// - /// - public global::Ideogram.ReframeImageGptImage25FlareResponse? Type462 { get; set; } - /// - /// - /// - public global::Ideogram.ReframeImageGptImage25FlareRequest? Type463 { get; set; } - /// - /// - /// - public global::Ideogram.ReframeImageGptImage25FlareRequestQuality? Type464 { get; set; } - /// - /// - /// - public global::Ideogram.ReframeImageBriaExpandResponse? Type465 { get; set; } - /// - /// - /// - public global::Ideogram.ReframeImageBriaExpandRequest? Type466 { get; set; } - /// - /// - /// - public global::Ideogram.ReframeImageAutoResponse? Type467 { get; set; } - /// - /// - /// - public global::Ideogram.ReframeImageAutoRequest? Type468 { get; set; } - /// - /// - /// - public global::Ideogram.GenerateImageIdeogramV3CharacterResponse? Type469 { get; set; } - /// - /// - /// - public global::Ideogram.GenerateImageIdeogramV3CharacterRequest? Type470 { get; set; } - /// - /// - /// - public global::Ideogram.GenerateImageIdeogramV3CharacterRequestRenderingSpeed? Type471 { get; set; } - /// - /// - /// - public global::Ideogram.GenerateImageIdeogramV3CharacterRequestStyleType? Type472 { get; set; } - /// - /// - /// - public global::Ideogram.InpaintImageIdeogramV3CharacterResponse? Type473 { get; set; } - /// - /// - /// - public global::Ideogram.InpaintImageIdeogramV3CharacterRequest? Type474 { get; set; } - /// - /// - /// - public global::Ideogram.InpaintImageIdeogramV3CharacterRequestRenderingSpeed? Type475 { get; set; } - /// - /// - /// - public global::Ideogram.InpaintImageIdeogramV3CharacterRequestStyleType? Type476 { get; set; } - /// - /// - /// - public global::Ideogram.GenerateImageV2AutoResponse? Type477 { get; set; } - /// - /// - /// - public global::Ideogram.GenerateImageV2AutoRequest? Type478 { get; set; } - /// - /// - /// - public global::Ideogram.GenerateImageV2AutoRequestResolutionTier? Type479 { get; set; } - /// - /// - /// - public global::Ideogram.ToolRemixResponse? Type480 { get; set; } - /// - /// - /// - public global::Ideogram.ToolRemixRequest? Type481 { get; set; } - /// - /// - /// - public global::Ideogram.ToolRemixRequestResolutionTier? Type482 { get; set; } - /// - /// - /// - public global::Ideogram.ResizeAdImageRequest? Type483 { get; set; } - /// - /// - /// - public global::Ideogram.ResizeAdImageRequestResolution? Type484 { get; set; } - /// - /// - /// - public global::Ideogram.ResizeAdImageQuality? Type485 { get; set; } - /// - /// - /// - public global::Ideogram.WebhookSigningJwks? Type486 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.IList? Type487 { get; set; } - /// - /// - /// - public global::Ideogram.WebhookSigningJwk? Type488 { get; set; } - /// - /// - /// - public global::Ideogram.ProvenanceVerifyResponse? Type489 { get; set; } - /// - /// - /// - public global::Ideogram.ProvenanceVerifyResponseValidationState? Type490 { get; set; } - /// - /// - /// - public global::Ideogram.ProvenanceVerifyRequest? Type491 { get; set; } - /// - /// - /// - public global::Ideogram.ManageApiSubscriptionResponse? Type492 { get; set; } - /// - /// - /// - public global::Ideogram.MetronomeLinks? Type493 { get; set; } - /// - /// - /// - public global::Ideogram.RechargeSettingsResponse? Type494 { get; set; } - /// - /// - /// - public global::Ideogram.Price? Type495 { get; set; } - /// - /// - /// - public global::Ideogram.RechargeSettings? Type496 { get; set; } - /// - /// - /// - public global::Ideogram.PostApiSubscriptionResponse? Type497 { get; set; } - /// - /// - /// - public global::Ideogram.PostApiSubscriptionError? Type498 { get; set; } - /// - /// - /// - public global::Ideogram.PostApiSubscriptionRequest? Type499 { get; set; } - /// - /// - /// - public global::Ideogram.ManageApiCreditSummaryResponse? Type500 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.IList? Type501 { get; set; } - /// - /// - /// - public global::Ideogram.CreditGrant? Type502 { get; set; } - /// - /// - /// - public global::Ideogram.GetApiKeysResponse? Type503 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.IList? Type504 { get; set; } - /// - /// - /// - public global::Ideogram.RedactedApiKey? Type505 { get; set; } - /// - /// - /// - public global::Ideogram.PostApiKeyResponse? Type506 { get; set; } - /// - /// - /// - public global::Ideogram.CreateApiKeyRequest? Type507 { get; set; } - /// - /// - /// - public global::Ideogram.ApiProfileApiKey? Type508 { get; set; } - /// - /// - /// - public global::Ideogram.ApiKeyStatus? Type509 { get; set; } - /// - /// - /// - public global::Ideogram.PatchApiKeyRequest? Type510 { get; set; } - /// - /// - /// - public global::Ideogram.ManageApiStripeSubscriptionResponse? Type511 { get; set; } - /// - /// - /// - public global::Ideogram.ManageApiPaymentResponse? Type512 { get; set; } - /// - /// - /// - public global::Ideogram.GetApiTermsResponse? Type513 { get; set; } - /// - /// - /// - public global::Ideogram.ApiTerms? Type514 { get; set; } - /// - /// - /// - public global::Ideogram.PostApiTermsRequest? Type515 { get; set; } - /// - /// - /// - public global::Ideogram.PostAddCreditsResponse? Type516 { get; set; } - /// - /// - /// - public global::Ideogram.PostAddCreditsError? Type517 { get; set; } - /// - /// - /// - public global::Ideogram.PostAddCreditsRequest? Type518 { get; set; } - /// - /// - /// - public global::Ideogram.GetUserCreditsResponse? Type519 { get; set; } - /// - /// - /// - public global::Ideogram.SpendCommitInfoResponse? Type520 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.IList? Type521 { get; set; } - /// - /// - /// - public global::Ideogram.SpendCommitInfo? Type522 { get; set; } - /// - /// - /// - public global::Ideogram.GetUsageInfoResponse? Type523 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.IList? Type524 { get; set; } - /// - /// - /// - public global::Ideogram.UsageSegment? Type525 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.IList? Type526 { get; set; } - /// - /// - /// - public global::Ideogram.ToolUsage? Type527 { get; set; } - /// - /// - /// - public global::Ideogram.ToolType? Type528 { get; set; } - /// - /// - /// - public global::Ideogram.ModelVersion? Type529 { get; set; } - /// - /// - /// - public global::Ideogram.SegmentBy? Type530 { get; set; } - /// - /// - /// - public global::Ideogram.UsageSource? Type531 { get; set; } - /// - /// - /// - public global::Ideogram.GetApiProfilesResponse? Type532 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.IList? Type533 { get; set; } - /// - /// - /// - public global::Ideogram.ApiProfile? Type534 { get; set; } - /// - /// - /// - public global::Ideogram.ApiProfileType? Type535 { get; set; } - /// - /// - /// - public global::Ideogram.ApiProfileRole? Type536 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.IList? Type537 { get; set; } - /// - /// - /// - public global::Ideogram.UpdateOrganizationApiPropertiesResponse? Type538 { get; set; } - /// - /// - /// - public global::Ideogram.UpdateOrganizationApiPropertiesRequest? Type539 { get; set; } - /// - /// - /// - public global::Ideogram.GetApiOrganizationUserSuggestionsResponse? Type540 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.IList? Type541 { get; set; } - /// - /// - /// - public global::Ideogram.ApiOrganizationUserSuggestion? Type542 { get; set; } - /// - /// - /// - public global::Ideogram.GetOrganizationMembersResponse? Type543 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.IList? Type544 { get; set; } - /// - /// - /// - public global::Ideogram.OrganizationMember? Type545 { get; set; } - /// - /// - /// - public global::Ideogram.CreateApiKeyResponse? Type546 { get; set; } - /// - /// - /// - public global::Ideogram.GetApiKeysV2Response? Type547 { get; set; } - /// - /// - /// - public global::Ideogram.OrganizationMemberOperationResponse? Type548 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.IList? Type549 { get; set; } - /// - /// - /// - public global::Ideogram.OrganizationMemberOperationResult? Type550 { get; set; } - /// - /// - /// - public global::Ideogram.AddOrganizationMembersRequest? Type551 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.IList? Type552 { get; set; } - /// - /// - /// - public global::Ideogram.LiteOrganizationMember? Type553 { get; set; } - /// - /// - /// - public global::Ideogram.RemoveOrganizationMembersRequest? Type554 { get; set; } - /// - /// - /// - public global::Ideogram.PromoteOrganizationAdminsRequest? Type555 { get; set; } - /// - /// - /// - public global::Ideogram.DemoteOrganizationAdminsRequest? Type556 { get; set; } - /// - /// - /// - public global::Ideogram.CancelOrganizationInviteRequest? Type557 { get; set; } - /// - /// - /// - public global::Ideogram.ResendOrganizationInviteRequest? Type558 { get; set; } - /// - /// - /// - public global::Ideogram.ListOrganizationInvoicesResponse? Type559 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.IList? Type560 { get; set; } - /// - /// - /// - public global::Ideogram.Invoice? Type561 { get; set; } - /// - /// - /// - public global::Ideogram.InvoiceStatus? Type562 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.IList? Type563 { get; set; } - /// - /// - /// - public global::Ideogram.InvoiceLineItem? Type564 { get; set; } - /// - /// - /// - public global::Ideogram.GetOrganizationBillingPortalResponse? Type565 { get; set; } - /// - /// - /// - public global::Ideogram.ListDatasetsResponse? Type566 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.IList? Type567 { get; set; } - /// - /// - /// - public global::Ideogram.Dataset? Type568 { get; set; } - /// - /// - /// - public global::Ideogram.CreateDatasetRequest? Type569 { get; set; } - /// - /// - /// - public global::Ideogram.GetDatasetResponse? Type570 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.IList? Type571 { get; set; } - /// - /// - /// - public global::Ideogram.DatasetFile? Type572 { get; set; } - /// - /// - /// - public global::Ideogram.UploadDatasetAssetsResponse? Type573 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.IList? Type574 { get; set; } - /// - /// - /// - public global::Ideogram.DatasetUploadSucceededAsset? Type575 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.IList? Type576 { get; set; } - /// - /// - /// - public global::Ideogram.DatasetUploadFailedAsset? Type577 { get; set; } - /// - /// - /// - public global::Ideogram.DatasetAssetFailureReason? Type578 { get; set; } - /// - /// - /// - public global::Ideogram.UploadDatasetAssetsRequest? Type579 { get; set; } - /// - /// - /// - public global::Ideogram.TrainDatasetModelResponse? Type580 { get; set; } - /// - /// - /// - public global::Ideogram.TrainDatasetModelRequest? Type581 { get; set; } - /// - /// - /// - public global::Ideogram.ListModelsResponse? Type582 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.IList? Type583 { get; set; } - /// - /// - /// - public global::Ideogram.CustomModel? Type584 { get; set; } - /// - /// - /// - public global::Ideogram.ModelStatus? Type585 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.IList? Type586 { get; set; } - /// - /// - /// - public global::Ideogram.TrainingRun? Type587 { get; set; } - /// - /// - /// - public global::Ideogram.TrainingRunStatus? Type588 { get; set; } - /// - /// - /// - public global::Ideogram.GetModelResponse? Type589 { get; set; } - /// - /// - /// - public global::Ideogram.TrainModelV3Request? Type590 { get; set; } - /// - /// - /// - public global::Ideogram.TrainModelV3AdvancedRequest? Type591 { get; set; } - /// - /// - /// - public global::Ideogram.TrainModelV4Request? Type592 { get; set; } - /// - /// - /// - public global::Ideogram.TrainModelV4AdvancedRequest? Type593 { get; set; } - /// - /// - /// - public global::Ideogram.PublishMiniAppResponse? Type594 { get; set; } - /// - /// - /// - public global::Ideogram.PublishMiniAppRequest? Type595 { get; set; } - /// - /// - /// - public global::Ideogram.PublishMiniAppRequestEmbed? Type596 { get; set; } - /// - /// - /// - public object? Type597 { get; set; } - /// - /// - /// - public global::Ideogram.MiniAppArtwork? Type598 { get; set; } - /// - /// - /// - public global::Ideogram.PublishMiniAppPreviewResponse? Type599 { get; set; } - /// - /// - /// - public global::Ideogram.PublishMiniAppPreviewRequest? Type600 { get; set; } - /// - /// - /// - public global::Ideogram.PublishMiniAppPreviewRequestEmbed? Type601 { get; set; } - /// - /// - /// - public global::Ideogram.UnpublishMiniAppPreviewResponse? Type602 { get; set; } - /// - /// - /// - public global::Ideogram.GetStaleMiniAppPreviewsResponse? Type603 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.IList? Type604 { get; set; } - /// - /// - /// - public global::Ideogram.MiniAppMarketingProjectionEntry? Type605 { get; set; } - /// - /// - /// - public global::Ideogram.MiniAppMarketingProjectionEntryEmbed? Type606 { get; set; } - /// - /// - /// - public global::Ideogram.GetIntegrationsResponse? Type607 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.IList? Type608 { get; set; } - /// - /// - /// - public global::Ideogram.IntegrationType? Type609 { get; set; } - /// - /// - /// - public global::Ideogram.IntegrationErrorResponse? Type610 { get; set; } - /// - /// - /// - public global::Ideogram.IntegrationErrorResponseError? Type611 { get; set; } - /// - /// - /// - public global::Ideogram.IntegrationAssetSearchResponse? Type612 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.IList? Type613 { get; set; } - /// - /// - /// - public global::Ideogram.IntegrationAsset? Type614 { get; set; } - /// - /// - /// - public global::Ideogram.IntegrationAssetDelivery? Type615 { get; set; } - /// - /// - /// - public global::Ideogram.IntegrationAssetSearchRequest? Type616 { get; set; } - /// - /// - /// - public global::Ideogram.V4StyleDescription? Type617 { get; set; } - /// - /// - /// - public global::Ideogram.V4CompositionalDeconstruction? Type618 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.IList? Type619 { get; set; } - /// - /// - /// - public global::Ideogram.V4PromptElement? Type620 { get; set; } - /// - /// - /// - public global::Ideogram.V4ObjPromptElement? Type621 { get; set; } - /// - /// - /// - public global::Ideogram.V4TextPromptElement? Type622 { get; set; } - /// - /// - /// - public global::Ideogram.V4PromptElementDiscriminator? Type623 { get; set; } - /// - /// - /// - public global::Ideogram.V4PromptElementDiscriminatorType? Type624 { get; set; } - /// - /// - /// - public global::Ideogram.V4ObjPromptElementType? Type625 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.IList? Type626 { get; set; } - /// - /// - /// - public global::Ideogram.V4TextPromptElementType? Type627 { get; set; } - /// - /// - /// - public global::Ideogram.ColorPaletteWithPresetName? Type628 { get; set; } - /// - /// - /// - public global::Ideogram.ColorPaletteWithMembers? Type629 { get; set; } - /// - /// - /// - public global::Ideogram.ColorPalettePresetName? Type630 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.IList? Type631 { get; set; } - /// - /// - /// - public global::Ideogram.ColorPaletteMember? Type632 { get; set; } - /// - /// - /// - public global::Ideogram.SvgGenerationObject? Type633 { get; set; } - /// - /// - /// - public global::Ideogram.SvgGenerationObjectObjectType? Type634 { get; set; } - /// - /// - /// - public global::Ideogram.SvgGenerationObjectMimeType? Type635 { get; set; } - /// - /// - /// - public global::Ideogram.VideoObject? Type636 { get; set; } - /// - /// - /// - public global::Ideogram.VideoObjectObjectType? Type637 { get; set; } - /// - /// - /// - public global::Ideogram.TextLayerizerResultObject? Type638 { get; set; } - /// - /// - /// - public global::Ideogram.TextLayerizerResultObjectObjectType? Type639 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.IList? Type640 { get; set; } - /// - /// - /// - public global::Ideogram.DetectedTextBlockAlignment? Type641 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.IList? Type642 { get; set; } - /// - /// - /// - public global::Ideogram.DetectedTextBlockFormattingItem? Type643 { get; set; } - /// - /// - /// - public global::Ideogram.DetectedTextBlockRole? Type644 { get; set; } - /// - /// - /// - public global::Ideogram.AssetType? Type645 { get; set; } - /// - /// - /// - public global::Ideogram.AttributeValueType? Type646 { get; set; } - /// - /// - /// - public global::Ideogram.IdeogramColorPaletteWithPresetName? Type647 { get; set; } - /// - /// - /// - public global::Ideogram.IdeogramColorPalettePresetName? Type648 { get; set; } - /// - /// - /// - public global::Ideogram.PostGenerateDesignV4200Response? Type649 { get; set; } - /// - /// - /// - public global::Ideogram.PostGenerateDesignV4200ResponseDiscriminator? Type650 { get; set; } - /// - /// - /// - public global::Ideogram.PostGenerateDesignV4200ResponseDiscriminatorResponseType? Type651 { get; set; } - /// - /// - /// - public global::Ideogram.PostInternalTesting200Response? Type652 { get; set; } - /// - /// - /// - public global::Ideogram.GenerationResponseDataInnerDiscriminator? Type653 { get; set; } - /// - /// - /// - public global::Ideogram.GenerationResponseDataInnerDiscriminatorObjectType? Type654 { get; set; } - /// - /// - /// - public global::Ideogram.MagicPromptRequestMessagesInnerRole? Type655 { get; set; } - /// - /// - /// - public global::Ideogram.DatasetCoverAssetIdentifier? Type656 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.IList? Type657 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.IList? Type658 { get; set; } - /// - /// - /// - public global::Ideogram.ListCustomModelsScope? Type659 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.IList? Type660 { get; set; } - /// - /// - /// - public global::Ideogram.GetAccountUsageBucketWidth? Type661 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.IList? Type662 { get; set; } - /// - /// - /// - public global::Ideogram.GetAccountUsageSource? Type663 { get; set; } + public global::System.Collections.Generic.IList? Type306 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType0 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.List? ListType1 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.List? ListType2 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.List? ListType3 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.List? ListType4 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.List? ListType5 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.List? ListType6 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.List? ListType7 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.List? ListType8 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.List? ListType9 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.List? ListType10 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.List? ListType11 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.List? ListType12 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.List? ListType13 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.List? ListType14 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.List? ListType15 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.List? ListType16 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.List? ListType17 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.List? ListType18 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.List? ListType19 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.List? ListType20 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.List? ListType21 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.List? ListType22 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.List? ListType23 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.List? ListType24 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.List? ListType25 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.List? ListType26 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.List? ListType27 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.List? ListType28 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.List? ListType29 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.List? ListType30 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.List? ListType31 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.List? ListType32 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.List? ListType33 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.List? ListType34 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.List? ListType35 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.List? ListType36 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.List? ListType37 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.List? ListType38 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.List? ListType39 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.List? ListType40 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.List? ListType41 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.List? ListType42 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.List? ListType43 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.List? ListType44 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.List? ListType45 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.List? ListType46 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.List? ListType47 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.List? ListType48 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.List? ListType49 { get; set; } + public global::System.Collections.Generic.List? ListType0 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType50 { get; set; } + public global::System.Collections.Generic.List? ListType1 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType51 { get; set; } + public global::System.Collections.Generic.List? ListType2 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType52 { get; set; } + public global::System.Collections.Generic.List? ListType3 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType53 { get; set; } + public global::System.Collections.Generic.List? ListType4 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType54 { get; set; } + public global::System.Collections.Generic.List? ListType5 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType55 { get; set; } + public global::System.Collections.Generic.List? ListType6 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType56 { get; set; } + public global::System.Collections.Generic.List? ListType7 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType57 { get; set; } + public global::System.Collections.Generic.List? ListType8 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType58 { get; set; } + public global::System.Collections.Generic.List? ListType9 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType59 { get; set; } + public global::System.Collections.Generic.List? ListType10 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType60 { get; set; } + public global::System.Collections.Generic.List? ListType11 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType61 { get; set; } + public global::System.Collections.Generic.List? ListType12 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType62 { get; set; } + public global::System.Collections.Generic.List? ListType13 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType63 { get; set; } + public global::System.Collections.Generic.List? ListType14 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType64 { get; set; } + public global::System.Collections.Generic.List? ListType15 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType65 { get; set; } + public global::System.Collections.Generic.List? ListType16 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType66 { get; set; } + public global::System.Collections.Generic.List? ListType17 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType67 { get; set; } + public global::System.Collections.Generic.List? ListType18 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType68 { get; set; } + public global::System.Collections.Generic.List? ListType19 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType69 { get; set; } + public global::System.Collections.Generic.List? ListType20 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType70 { get; set; } + public global::System.Collections.Generic.List? ListType21 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType71 { get; set; } + public global::System.Collections.Generic.List? ListType22 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType72 { get; set; } + public global::System.Collections.Generic.List? ListType23 { get; set; } } } \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Manage.JsonSerializerContext.g.cs b/src/libs/Ideogram/Generated/Ideogram.Manage.JsonSerializerContext.g.cs deleted file mode 100644 index 240797b0..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Manage.JsonSerializerContext.g.cs +++ /dev/null @@ -1,360 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull - )] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ManageApiSubscriptionResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MetronomeLinks))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RechargeSettingsResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.Price))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RechargeSettings))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PostApiSubscriptionResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PostApiSubscriptionError))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PostApiSubscriptionRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ManageApiCreditSummaryResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.CreditGrant))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GetApiKeysResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RedactedApiKey))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PostApiKeyResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.CreateApiKeyRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ApiProfileApiKey))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ApiKeyStatus), TypeInfoPropertyName = "ApiKeyStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PatchApiKeyRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ManageApiStripeSubscriptionResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ManageApiPaymentResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GetApiTermsResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ApiTerms))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PostApiTermsRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PostAddCreditsResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PostAddCreditsError))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PostAddCreditsRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GetUserCreditsResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SpendCommitInfoResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SpendCommitInfo))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GetUsageInfoResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UsageSegment))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ToolUsage))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ToolType), TypeInfoPropertyName = "ToolType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ModelVersion), TypeInfoPropertyName = "ModelVersion2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SegmentBy), TypeInfoPropertyName = "SegmentBy2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UsageSource), TypeInfoPropertyName = "UsageSource2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GetApiProfilesResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ApiProfile))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ApiProfileType), TypeInfoPropertyName = "ApiProfileType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ApiProfileRole), TypeInfoPropertyName = "ApiProfileRole2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpdateOrganizationApiPropertiesResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpdateOrganizationApiPropertiesRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GetApiOrganizationUserSuggestionsResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ApiOrganizationUserSuggestion))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GetOrganizationMembersResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.OrganizationMember))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.CreateApiKeyResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GetApiKeysV2Response))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.OrganizationMemberOperationResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.OrganizationMemberOperationResult))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AddOrganizationMembersRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LiteOrganizationMember))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemoveOrganizationMembersRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PromoteOrganizationAdminsRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DemoteOrganizationAdminsRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.CancelOrganizationInviteRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ResendOrganizationInviteRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ListOrganizationInvoicesResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.Invoice))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.InvoiceStatus), TypeInfoPropertyName = "InvoiceStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.InvoiceLineItem))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GetOrganizationBillingPortalResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(double?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ApiKeyStatus?), TypeInfoPropertyName = "NullableApiKeyStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ToolType?), TypeInfoPropertyName = "NullableToolType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ModelVersion?), TypeInfoPropertyName = "NullableModelVersion2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SegmentBy?), TypeInfoPropertyName = "NullableSegmentBy2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UsageSource?), TypeInfoPropertyName = "NullableUsageSource2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ApiProfileType?), TypeInfoPropertyName = "NullableApiProfileType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ApiProfileRole?), TypeInfoPropertyName = "NullableApiProfileRole2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.InvoiceStatus?), TypeInfoPropertyName = "NullableInvoiceStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - internal sealed partial class ManageSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext - { - } - /// - /// - /// - public sealed partial class ManageSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext - { - private static readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver Resolver = new LazyChunkResolver(); - - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - internal static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver TypeInfoResolver => Resolver; - - - private static readonly global::System.Text.Json.JsonSerializerOptions DefaultOptions = CreateDefaultOptions(); - - /// - /// - /// - public static ManageSourceGenerationContext Default { get; } = new(DefaultOptions); - - private ManageSourceGenerationContext(global::System.Text.Json.JsonSerializerOptions options) - : base(options) - { - } - - /// - protected override global::System.Text.Json.JsonSerializerOptions? GeneratedSerializerOptions => DefaultOptions; - - /// - public override global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo(global::System.Type type) - { - return Resolver.GetTypeInfo(type, Options); - } - - /// - /// Adds this package's converters to . - /// - /// - /// A converter has to be on the options a chained resolver builds its JsonTypeInfo against, - /// and a context resolves types from every package below it. Each package contributes only - /// what it owns and calls down the chain for the rest, so the family's converter table is - /// written once rather than copied into all of them. - /// - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) - { - options.Converters.Add(new global::Ideogram.JsonConverters.UnixTimestampJsonConverter()); - options.Converters.Add(new LazyEnumJsonConverterFactory()); - } - - private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() - { - var options = new global::System.Text.Json.JsonSerializerOptions - { - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, - TypeInfoResolver = Resolver, - }; - AddConverters(options); - - return options; - } - - - private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory - { - public override bool CanConvert(global::System.Type typeToConvert) - { - return - typeToConvert == typeof(global::Ideogram.ApiKeyStatus) - - || typeToConvert == typeof(global::Ideogram.ApiKeyStatus?) - - || typeToConvert == typeof(global::Ideogram.ToolType) - - || typeToConvert == typeof(global::Ideogram.ToolType?) - - || typeToConvert == typeof(global::Ideogram.SegmentBy) - - || typeToConvert == typeof(global::Ideogram.SegmentBy?) - - || typeToConvert == typeof(global::Ideogram.UsageSource) - - || typeToConvert == typeof(global::Ideogram.UsageSource?) - - || typeToConvert == typeof(global::Ideogram.ModelVersion) - - || typeToConvert == typeof(global::Ideogram.ModelVersion?) - - || typeToConvert == typeof(global::Ideogram.ApiProfileType) - - || typeToConvert == typeof(global::Ideogram.ApiProfileType?) - - || typeToConvert == typeof(global::Ideogram.ApiProfileRole) - - || typeToConvert == typeof(global::Ideogram.ApiProfileRole?) - - || typeToConvert == typeof(global::Ideogram.InvoiceStatus) - - || typeToConvert == typeof(global::Ideogram.InvoiceStatus?); - } - - public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - if (typeToConvert == typeof(global::Ideogram.ApiKeyStatus)) - { - return new global::Ideogram.JsonConverters.ApiKeyStatusJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ApiKeyStatus?)) - { - return new global::Ideogram.JsonConverters.ApiKeyStatusNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ToolType)) - { - return new global::Ideogram.JsonConverters.ToolTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ToolType?)) - { - return new global::Ideogram.JsonConverters.ToolTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.SegmentBy)) - { - return new global::Ideogram.JsonConverters.SegmentByJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.SegmentBy?)) - { - return new global::Ideogram.JsonConverters.SegmentByNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.UsageSource)) - { - return new global::Ideogram.JsonConverters.UsageSourceJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.UsageSource?)) - { - return new global::Ideogram.JsonConverters.UsageSourceNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ModelVersion)) - { - return new global::Ideogram.JsonConverters.ModelVersionJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ModelVersion?)) - { - return new global::Ideogram.JsonConverters.ModelVersionNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ApiProfileType)) - { - return new global::Ideogram.JsonConverters.ApiProfileTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ApiProfileType?)) - { - return new global::Ideogram.JsonConverters.ApiProfileTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ApiProfileRole)) - { - return new global::Ideogram.JsonConverters.ApiProfileRoleJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ApiProfileRole?)) - { - return new global::Ideogram.JsonConverters.ApiProfileRoleNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.InvoiceStatus)) - { - return new global::Ideogram.JsonConverters.InvoiceStatusJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.InvoiceStatus?)) - { - return new global::Ideogram.JsonConverters.InvoiceStatusNullableJsonConverter(); - } - throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); - } - } - - private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver - { - private readonly object _gate = new(); - private readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[] _resolvers = new global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[1]; - - public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo( - global::System.Type type, - global::System.Text.Json.JsonSerializerOptions options) - { - for (var index = 0; index < _resolvers.Length; index++) - { - var typeInfo = GetResolver(index).GetTypeInfo(type, options); - if (typeInfo is not null) - { - return typeInfo; - } - } - - return null; - } - - private global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver GetResolver(int index) - { - var resolver = global::System.Threading.Volatile.Read(ref _resolvers[index]); - if (resolver is not null) - { - return resolver; - } - - lock (_gate) - { - return _resolvers[index] ??= CreateResolver(index); - } - } - - private static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver CreateResolver(int index) - { - return index switch - { - 0 => new ManageSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), - _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), - }; - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ManageClient.AddOrganizationMembers.g.cs b/src/libs/Ideogram/Generated/Ideogram.ManageClient.AddOrganizationMembers.g.cs deleted file mode 100644 index 7d2c45a4..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ManageClient.AddOrganizationMembers.g.cs +++ /dev/null @@ -1,603 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ManageClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_AddOrganizationMembersSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_AddOrganizationMembersSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_AddOrganizationMembersSecurityRequirement0, - }; - partial void PrepareAddOrganizationMembersArguments( - global::System.Net.Http.HttpClient httpClient, - ref string organizationId, - global::Ideogram.AddOrganizationMembersRequest request); - partial void PrepareAddOrganizationMembersRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string organizationId, - global::Ideogram.AddOrganizationMembersRequest request); - partial void ProcessAddOrganizationMembersResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessAddOrganizationMembersResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Add members to a specific organization - /// - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task AddOrganizationMembersAsync( - string organizationId, - - global::Ideogram.AddOrganizationMembersRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await AddOrganizationMembersAsResponseAsync( - organizationId: organizationId, - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Add members to a specific organization - /// - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> AddOrganizationMembersAsResponseAsync( - string organizationId, - - global::Ideogram.AddOrganizationMembersRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareAddOrganizationMembersArguments( - httpClient: HttpClient, - organizationId: ref organizationId, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_AddOrganizationMembersSecurityRequirements, - operationName: "AddOrganizationMembersAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/manage/api/organization/add_members", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("organization_id", organizationId) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareAddOrganizationMembersRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - organizationId: organizationId, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "AddOrganizationMembers", - methodName: "AddOrganizationMembersAsync", - pathTemplate: "\"/manage/api/organization/add_members\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "AddOrganizationMembers", - methodName: "AddOrganizationMembersAsync", - pathTemplate: "\"/manage/api/organization/add_members\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "AddOrganizationMembers", - methodName: "AddOrganizationMembersAsync", - pathTemplate: "\"/manage/api/organization/add_members\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessAddOrganizationMembersResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "AddOrganizationMembers", - methodName: "AddOrganizationMembersAsync", - pathTemplate: "\"/manage/api/organization/add_members\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "AddOrganizationMembers", - methodName: "AddOrganizationMembersAsync", - pathTemplate: "\"/manage/api/organization/add_members\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessAddOrganizationMembersResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.OrganizationMemberOperationResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.OrganizationMemberOperationResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Add members to a specific organization - /// - /// - /// - /// List of organization members to add
- /// Default Value: [] - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task AddOrganizationMembersAsync( - string organizationId, - global::System.Collections.Generic.IList members, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.AddOrganizationMembersRequest - { - Members = members, - }; - - return await AddOrganizationMembersAsync( - organizationId: organizationId, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ManageClient.Authorizations.Bearer.g.cs b/src/libs/Ideogram/Generated/Ideogram.ManageClient.Authorizations.Bearer.g.cs deleted file mode 100644 index 9ae61543..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ManageClient.Authorizations.Bearer.g.cs +++ /dev/null @@ -1,35 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public sealed partial class ManageClient - { - - /// - public void AuthorizeUsingBearer( - string apiKey) - { - apiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey)); - - for (var i = Authorizations.Count - 1; i >= 0; i--) - { - var __authorization = Authorizations[i]; - if (__authorization.Type == "Http" && - __authorization.Name == "Bearer") - { - Authorizations.RemoveAt(i); - } - } - - Authorizations.Add(new global::Ideogram.EndPointAuthorization - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - Value = apiKey, - }); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ManageClient.CancelOrganizationInvite.g.cs b/src/libs/Ideogram/Generated/Ideogram.ManageClient.CancelOrganizationInvite.g.cs deleted file mode 100644 index 23d47679..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ManageClient.CancelOrganizationInvite.g.cs +++ /dev/null @@ -1,602 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ManageClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_CancelOrganizationInviteSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_CancelOrganizationInviteSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_CancelOrganizationInviteSecurityRequirement0, - }; - partial void PrepareCancelOrganizationInviteArguments( - global::System.Net.Http.HttpClient httpClient, - ref string organizationId, - global::Ideogram.CancelOrganizationInviteRequest request); - partial void PrepareCancelOrganizationInviteRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string organizationId, - global::Ideogram.CancelOrganizationInviteRequest request); - partial void ProcessCancelOrganizationInviteResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessCancelOrganizationInviteResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Cancel a pending invite for an organization - /// - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task CancelOrganizationInviteAsync( - string organizationId, - - global::Ideogram.CancelOrganizationInviteRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await CancelOrganizationInviteAsResponseAsync( - organizationId: organizationId, - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Cancel a pending invite for an organization - /// - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> CancelOrganizationInviteAsResponseAsync( - string organizationId, - - global::Ideogram.CancelOrganizationInviteRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareCancelOrganizationInviteArguments( - httpClient: HttpClient, - organizationId: ref organizationId, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_CancelOrganizationInviteSecurityRequirements, - operationName: "CancelOrganizationInviteAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/manage/api/organization/cancel_invite", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("organization_id", organizationId) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareCancelOrganizationInviteRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - organizationId: organizationId, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "CancelOrganizationInvite", - methodName: "CancelOrganizationInviteAsync", - pathTemplate: "\"/manage/api/organization/cancel_invite\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "CancelOrganizationInvite", - methodName: "CancelOrganizationInviteAsync", - pathTemplate: "\"/manage/api/organization/cancel_invite\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "CancelOrganizationInvite", - methodName: "CancelOrganizationInviteAsync", - pathTemplate: "\"/manage/api/organization/cancel_invite\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessCancelOrganizationInviteResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "CancelOrganizationInvite", - methodName: "CancelOrganizationInviteAsync", - pathTemplate: "\"/manage/api/organization/cancel_invite\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "CancelOrganizationInvite", - methodName: "CancelOrganizationInviteAsync", - pathTemplate: "\"/manage/api/organization/cancel_invite\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessCancelOrganizationInviteResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.OrganizationMemberOperationResult.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.OrganizationMemberOperationResult.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Cancel a pending invite for an organization - /// - /// - /// - /// Base64 URL-safe encoded ID of the invite to cancel - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task CancelOrganizationInviteAsync( - string organizationId, - string inviteId, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.CancelOrganizationInviteRequest - { - InviteId = inviteId, - }; - - return await CancelOrganizationInviteAsync( - organizationId: organizationId, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ManageClient.Constructors.Bearer.g.cs b/src/libs/Ideogram/Generated/Ideogram.ManageClient.Constructors.Bearer.g.cs deleted file mode 100644 index 5970757e..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ManageClient.Constructors.Bearer.g.cs +++ /dev/null @@ -1,31 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public sealed partial class ManageClient - { - /// - - public ManageClient( - string apiKey, - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - bool disposeHttpClient = true) : this(httpClient, baseUri, authorizations, disposeHttpClient) - { - Authorizing(HttpClient, ref apiKey); - - AuthorizeUsingBearer(apiKey); - - Authorized(HttpClient); - } - - partial void Authorizing( - global::System.Net.Http.HttpClient client, - ref string apiKey); - partial void Authorized( - global::System.Net.Http.HttpClient client); - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ManageClient.CreateApiKey.g.cs b/src/libs/Ideogram/Generated/Ideogram.ManageClient.CreateApiKey.g.cs deleted file mode 100644 index 2e2e19e8..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ManageClient.CreateApiKey.g.cs +++ /dev/null @@ -1,523 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ManageClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_CreateApiKeySecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_CreateApiKeySecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_CreateApiKeySecurityRequirement0, - }; - partial void PrepareCreateApiKeyArguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.CreateApiKeyRequest request); - partial void PrepareCreateApiKeyRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.CreateApiKeyRequest request); - partial void ProcessCreateApiKeyResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessCreateApiKeyResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Creates an API key. - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task CreateApiKeyAsync( - - global::Ideogram.CreateApiKeyRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await CreateApiKeyAsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Creates an API key. - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> CreateApiKeyAsResponseAsync( - - global::Ideogram.CreateApiKeyRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareCreateApiKeyArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_CreateApiKeySecurityRequirements, - operationName: "CreateApiKeyAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/manage/api/api_keys", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareCreateApiKeyRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "CreateApiKey", - methodName: "CreateApiKeyAsync", - pathTemplate: "\"/manage/api/api_keys\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "CreateApiKey", - methodName: "CreateApiKeyAsync", - pathTemplate: "\"/manage/api/api_keys\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "CreateApiKey", - methodName: "CreateApiKeyAsync", - pathTemplate: "\"/manage/api/api_keys\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessCreateApiKeyResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "CreateApiKey", - methodName: "CreateApiKeyAsync", - pathTemplate: "\"/manage/api/api_keys\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "CreateApiKey", - methodName: "CreateApiKeyAsync", - pathTemplate: "\"/manage/api/api_keys\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessCreateApiKeyResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.PostApiKeyResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.PostApiKeyResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Creates an API key. - /// - /// - /// User-supplied label shown alongside the key in the management UI. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task CreateApiKeyAsync( - string? label = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.CreateApiKeyRequest - { - Label = label, - }; - - return await CreateApiKeyAsync( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ManageClient.CreateApiKeyV2.g.cs b/src/libs/Ideogram/Generated/Ideogram.ManageClient.CreateApiKeyV2.g.cs deleted file mode 100644 index ff41aef5..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ManageClient.CreateApiKeyV2.g.cs +++ /dev/null @@ -1,570 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ManageClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_CreateApiKeyV2SecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_CreateApiKeyV2SecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_CreateApiKeyV2SecurityRequirement0, - }; - partial void PrepareCreateApiKeyV2Arguments( - global::System.Net.Http.HttpClient httpClient, - ref string organizationId, - global::Ideogram.CreateApiKeyRequest request); - partial void PrepareCreateApiKeyV2Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string organizationId, - global::Ideogram.CreateApiKeyRequest request); - partial void ProcessCreateApiKeyV2Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessCreateApiKeyV2ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Create an API key for a specific organization - /// - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task CreateApiKeyV2Async( - string organizationId, - - global::Ideogram.CreateApiKeyRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await CreateApiKeyV2AsResponseAsync( - organizationId: organizationId, - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Create an API key for a specific organization - /// - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> CreateApiKeyV2AsResponseAsync( - string organizationId, - - global::Ideogram.CreateApiKeyRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareCreateApiKeyV2Arguments( - httpClient: HttpClient, - organizationId: ref organizationId, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_CreateApiKeyV2SecurityRequirements, - operationName: "CreateApiKeyV2Async"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/manage/api/api_keys_v2", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("organization_id", organizationId) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareCreateApiKeyV2Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - organizationId: organizationId, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "CreateApiKeyV2", - methodName: "CreateApiKeyV2Async", - pathTemplate: "\"/manage/api/api_keys_v2\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "CreateApiKeyV2", - methodName: "CreateApiKeyV2Async", - pathTemplate: "\"/manage/api/api_keys_v2\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "CreateApiKeyV2", - methodName: "CreateApiKeyV2Async", - pathTemplate: "\"/manage/api/api_keys_v2\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessCreateApiKeyV2Response( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "CreateApiKeyV2", - methodName: "CreateApiKeyV2Async", - pathTemplate: "\"/manage/api/api_keys_v2\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "CreateApiKeyV2", - methodName: "CreateApiKeyV2Async", - pathTemplate: "\"/manage/api/api_keys_v2\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessCreateApiKeyV2ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.CreateApiKeyResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.CreateApiKeyResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Create an API key for a specific organization - /// - /// - /// - /// User-supplied label shown alongside the key in the management UI. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task CreateApiKeyV2Async( - string organizationId, - string? label = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.CreateApiKeyRequest - { - Label = label, - }; - - return await CreateApiKeyV2Async( - organizationId: organizationId, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ManageClient.CreateApiPayment.g.cs b/src/libs/Ideogram/Generated/Ideogram.ManageClient.CreateApiPayment.g.cs deleted file mode 100644 index d7350532..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ManageClient.CreateApiPayment.g.cs +++ /dev/null @@ -1,505 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ManageClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_CreateApiPaymentSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_CreateApiPaymentSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_CreateApiPaymentSecurityRequirement0, - }; - partial void PrepareCreateApiPaymentArguments( - global::System.Net.Http.HttpClient httpClient, - ref string organizationId); - partial void PrepareCreateApiPaymentRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string organizationId); - partial void ProcessCreateApiPaymentResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessCreateApiPaymentResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Create a payment setup session for inline card collection.
- /// Returns a client_secret for the org's payment customer so the inline payment
- /// modal can save a card without leaving the app.
- /// Soft-deprecated: the inline Elements flow was removed in the Stripe.js
- /// eager-bundle incident (2026-05-20). New clients should use the
- /// stripe_payment_setup_url field on ManageApiStripeSubscriptionResponse, which
- /// returns a hosted Stripe Checkout URL instead. This endpoint will be formally
- /// deprecated and then removed once no callers reference it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task CreateApiPaymentAsync( - string organizationId, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await CreateApiPaymentAsResponseAsync( - organizationId: organizationId, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Create a payment setup session for inline card collection.
- /// Returns a client_secret for the org's payment customer so the inline payment
- /// modal can save a card without leaving the app.
- /// Soft-deprecated: the inline Elements flow was removed in the Stripe.js
- /// eager-bundle incident (2026-05-20). New clients should use the
- /// stripe_payment_setup_url field on ManageApiStripeSubscriptionResponse, which
- /// returns a hosted Stripe Checkout URL instead. This endpoint will be formally
- /// deprecated and then removed once no callers reference it. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> CreateApiPaymentAsResponseAsync( - string organizationId, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareCreateApiPaymentArguments( - httpClient: HttpClient, - organizationId: ref organizationId); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_CreateApiPaymentSecurityRequirements, - operationName: "CreateApiPaymentAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/manage/api/payment", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("organization_id", organizationId) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareCreateApiPaymentRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - organizationId: organizationId); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "CreateApiPayment", - methodName: "CreateApiPaymentAsync", - pathTemplate: "\"/manage/api/payment\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "CreateApiPayment", - methodName: "CreateApiPaymentAsync", - pathTemplate: "\"/manage/api/payment\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "CreateApiPayment", - methodName: "CreateApiPaymentAsync", - pathTemplate: "\"/manage/api/payment\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessCreateApiPaymentResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "CreateApiPayment", - methodName: "CreateApiPaymentAsync", - pathTemplate: "\"/manage/api/payment\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "CreateApiPayment", - methodName: "CreateApiPaymentAsync", - pathTemplate: "\"/manage/api/payment\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessCreateApiPaymentResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.ManageApiPaymentResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.ManageApiPaymentResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ManageClient.DeactivateOrganizationApiKey.g.cs b/src/libs/Ideogram/Generated/Ideogram.ManageClient.DeactivateOrganizationApiKey.g.cs deleted file mode 100644 index 5c63be9b..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ManageClient.DeactivateOrganizationApiKey.g.cs +++ /dev/null @@ -1,532 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ManageClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_DeactivateOrganizationApiKeySecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_DeactivateOrganizationApiKeySecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_DeactivateOrganizationApiKeySecurityRequirement0, - }; - partial void PrepareDeactivateOrganizationApiKeyArguments( - global::System.Net.Http.HttpClient httpClient, - ref string apiKeyId); - partial void PrepareDeactivateOrganizationApiKeyRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string apiKeyId); - partial void ProcessDeactivateOrganizationApiKeyResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - /// - /// Deactivate an API key for a specific organization - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task DeactivateOrganizationApiKeyAsync( - string apiKeyId, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - await DeactivateOrganizationApiKeyAsResponseAsync( - apiKeyId: apiKeyId, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - } - /// - /// Deactivate an API key for a specific organization - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task DeactivateOrganizationApiKeyAsResponseAsync( - string apiKeyId, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareDeactivateOrganizationApiKeyArguments( - httpClient: HttpClient, - apiKeyId: ref apiKeyId); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_DeactivateOrganizationApiKeySecurityRequirements, - operationName: "DeactivateOrganizationApiKeyAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/manage/api/organization/deactivate_api_key", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("api_key_id", apiKeyId) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareDeactivateOrganizationApiKeyRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - apiKeyId: apiKeyId); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "DeactivateOrganizationApiKey", - methodName: "DeactivateOrganizationApiKeyAsync", - pathTemplate: "\"/manage/api/organization/deactivate_api_key\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "DeactivateOrganizationApiKey", - methodName: "DeactivateOrganizationApiKeyAsync", - pathTemplate: "\"/manage/api/organization/deactivate_api_key\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "DeactivateOrganizationApiKey", - methodName: "DeactivateOrganizationApiKeyAsync", - pathTemplate: "\"/manage/api/organization/deactivate_api_key\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessDeactivateOrganizationApiKeyResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "DeactivateOrganizationApiKey", - methodName: "DeactivateOrganizationApiKeyAsync", - pathTemplate: "\"/manage/api/organization/deactivate_api_key\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "DeactivateOrganizationApiKey", - methodName: "DeactivateOrganizationApiKeyAsync", - pathTemplate: "\"/manage/api/organization/deactivate_api_key\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ManageClient.DeleteSingleApiKey.g.cs b/src/libs/Ideogram/Generated/Ideogram.ManageClient.DeleteSingleApiKey.g.cs deleted file mode 100644 index 8c753721..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ManageClient.DeleteSingleApiKey.g.cs +++ /dev/null @@ -1,465 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ManageClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_DeleteSingleApiKeySecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_DeleteSingleApiKeySecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_DeleteSingleApiKeySecurityRequirement0, - }; - partial void PrepareDeleteSingleApiKeyArguments( - global::System.Net.Http.HttpClient httpClient, - ref string apiKeyId); - partial void PrepareDeleteSingleApiKeyRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string apiKeyId); - partial void ProcessDeleteSingleApiKeyResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - /// - /// Delete an API key. - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task DeleteSingleApiKeyAsync( - string apiKeyId, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - await DeleteSingleApiKeyAsResponseAsync( - apiKeyId: apiKeyId, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - } - /// - /// Delete an API key. - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task DeleteSingleApiKeyAsResponseAsync( - string apiKeyId, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareDeleteSingleApiKeyArguments( - httpClient: HttpClient, - apiKeyId: ref apiKeyId); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_DeleteSingleApiKeySecurityRequirements, - operationName: "DeleteSingleApiKeyAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: $"/manage/api/api_keys/{apiKeyId}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Delete, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareDeleteSingleApiKeyRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - apiKeyId: apiKeyId); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "DeleteSingleApiKey", - methodName: "DeleteSingleApiKeyAsync", - pathTemplate: "$\"/manage/api/api_keys/{apiKeyId}\"", - httpMethod: "DELETE", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "DeleteSingleApiKey", - methodName: "DeleteSingleApiKeyAsync", - pathTemplate: "$\"/manage/api/api_keys/{apiKeyId}\"", - httpMethod: "DELETE", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "DeleteSingleApiKey", - methodName: "DeleteSingleApiKeyAsync", - pathTemplate: "$\"/manage/api/api_keys/{apiKeyId}\"", - httpMethod: "DELETE", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessDeleteSingleApiKeyResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "DeleteSingleApiKey", - methodName: "DeleteSingleApiKeyAsync", - pathTemplate: "$\"/manage/api/api_keys/{apiKeyId}\"", - httpMethod: "DELETE", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "DeleteSingleApiKey", - methodName: "DeleteSingleApiKeyAsync", - pathTemplate: "$\"/manage/api/api_keys/{apiKeyId}\"", - httpMethod: "DELETE", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ManageClient.DemoteOrganizationAdmins.g.cs b/src/libs/Ideogram/Generated/Ideogram.ManageClient.DemoteOrganizationAdmins.g.cs deleted file mode 100644 index f574b5a1..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ManageClient.DemoteOrganizationAdmins.g.cs +++ /dev/null @@ -1,603 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ManageClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_DemoteOrganizationAdminsSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_DemoteOrganizationAdminsSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_DemoteOrganizationAdminsSecurityRequirement0, - }; - partial void PrepareDemoteOrganizationAdminsArguments( - global::System.Net.Http.HttpClient httpClient, - ref string organizationId, - global::Ideogram.DemoteOrganizationAdminsRequest request); - partial void PrepareDemoteOrganizationAdminsRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string organizationId, - global::Ideogram.DemoteOrganizationAdminsRequest request); - partial void ProcessDemoteOrganizationAdminsResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessDemoteOrganizationAdminsResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Demote admins back to member role in an ENTERPRISE_PREPAID or ENTERPRISE_API organization - /// - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task DemoteOrganizationAdminsAsync( - string organizationId, - - global::Ideogram.DemoteOrganizationAdminsRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await DemoteOrganizationAdminsAsResponseAsync( - organizationId: organizationId, - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Demote admins back to member role in an ENTERPRISE_PREPAID or ENTERPRISE_API organization - /// - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> DemoteOrganizationAdminsAsResponseAsync( - string organizationId, - - global::Ideogram.DemoteOrganizationAdminsRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareDemoteOrganizationAdminsArguments( - httpClient: HttpClient, - organizationId: ref organizationId, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_DemoteOrganizationAdminsSecurityRequirements, - operationName: "DemoteOrganizationAdminsAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/manage/api/organization/demote_admins", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("organization_id", organizationId) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareDemoteOrganizationAdminsRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - organizationId: organizationId, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "DemoteOrganizationAdmins", - methodName: "DemoteOrganizationAdminsAsync", - pathTemplate: "\"/manage/api/organization/demote_admins\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "DemoteOrganizationAdmins", - methodName: "DemoteOrganizationAdminsAsync", - pathTemplate: "\"/manage/api/organization/demote_admins\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "DemoteOrganizationAdmins", - methodName: "DemoteOrganizationAdminsAsync", - pathTemplate: "\"/manage/api/organization/demote_admins\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessDemoteOrganizationAdminsResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "DemoteOrganizationAdmins", - methodName: "DemoteOrganizationAdminsAsync", - pathTemplate: "\"/manage/api/organization/demote_admins\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "DemoteOrganizationAdmins", - methodName: "DemoteOrganizationAdminsAsync", - pathTemplate: "\"/manage/api/organization/demote_admins\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessDemoteOrganizationAdminsResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.OrganizationMemberOperationResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.OrganizationMemberOperationResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Demote admins back to member role in an ENTERPRISE_PREPAID or ENTERPRISE_API organization - /// - /// - /// - /// List of admins to demote back to MEMBER role
- /// Default Value: [] - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task DemoteOrganizationAdminsAsync( - string organizationId, - global::System.Collections.Generic.IList members, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.DemoteOrganizationAdminsRequest - { - Members = members, - }; - - return await DemoteOrganizationAdminsAsync( - organizationId: organizationId, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ManageClient.GetApiCreditSummary.g.cs b/src/libs/Ideogram/Generated/Ideogram.ManageClient.GetApiCreditSummary.g.cs deleted file mode 100644 index f46fa891..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ManageClient.GetApiCreditSummary.g.cs +++ /dev/null @@ -1,497 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ManageClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_GetApiCreditSummarySecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_GetApiCreditSummarySecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_GetApiCreditSummarySecurityRequirement0, - }; - partial void PrepareGetApiCreditSummaryArguments( - global::System.Net.Http.HttpClient httpClient, - ref string organizationId); - partial void PrepareGetApiCreditSummaryRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string organizationId); - partial void ProcessGetApiCreditSummaryResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessGetApiCreditSummaryResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Lifetime credit totals for the API user's account.
- /// Returns the lifetime credit KPIs (consumed, expired, issued) used to
- /// render the API credit dashboard strip. All values default to $0 when
- /// Metronome is unavailable so the FE can always render. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task GetApiCreditSummaryAsync( - string organizationId, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await GetApiCreditSummaryAsResponseAsync( - organizationId: organizationId, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Lifetime credit totals for the API user's account.
- /// Returns the lifetime credit KPIs (consumed, expired, issued) used to
- /// render the API credit dashboard strip. All values default to $0 when
- /// Metronome is unavailable so the FE can always render. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> GetApiCreditSummaryAsResponseAsync( - string organizationId, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareGetApiCreditSummaryArguments( - httpClient: HttpClient, - organizationId: ref organizationId); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_GetApiCreditSummarySecurityRequirements, - operationName: "GetApiCreditSummaryAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/manage/api/credit_summary", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("organization_id", organizationId) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetApiCreditSummaryRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - organizationId: organizationId); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetApiCreditSummary", - methodName: "GetApiCreditSummaryAsync", - pathTemplate: "\"/manage/api/credit_summary\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetApiCreditSummary", - methodName: "GetApiCreditSummaryAsync", - pathTemplate: "\"/manage/api/credit_summary\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetApiCreditSummary", - methodName: "GetApiCreditSummaryAsync", - pathTemplate: "\"/manage/api/credit_summary\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetApiCreditSummaryResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetApiCreditSummary", - methodName: "GetApiCreditSummaryAsync", - pathTemplate: "\"/manage/api/credit_summary\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetApiCreditSummary", - methodName: "GetApiCreditSummaryAsync", - pathTemplate: "\"/manage/api/credit_summary\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetApiCreditSummaryResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.ManageApiCreditSummaryResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.ManageApiCreditSummaryResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ManageClient.GetApiKeys.g.cs b/src/libs/Ideogram/Generated/Ideogram.ManageClient.GetApiKeys.g.cs deleted file mode 100644 index 86107f5d..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ManageClient.GetApiKeys.g.cs +++ /dev/null @@ -1,479 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ManageClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_GetApiKeysSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_GetApiKeysSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_GetApiKeysSecurityRequirement0, - }; - partial void PrepareGetApiKeysArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareGetApiKeysRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessGetApiKeysResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessGetApiKeysResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Retrieve current API keys and their respective data. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task GetApiKeysAsync( - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await GetApiKeysAsResponseAsync( - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Retrieve current API keys and their respective data. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> GetApiKeysAsResponseAsync( - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareGetApiKeysArguments( - httpClient: HttpClient); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_GetApiKeysSecurityRequirements, - operationName: "GetApiKeysAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/manage/api/api_keys", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetApiKeysRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetApiKeys", - methodName: "GetApiKeysAsync", - pathTemplate: "\"/manage/api/api_keys\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetApiKeys", - methodName: "GetApiKeysAsync", - pathTemplate: "\"/manage/api/api_keys\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetApiKeys", - methodName: "GetApiKeysAsync", - pathTemplate: "\"/manage/api/api_keys\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetApiKeysResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetApiKeys", - methodName: "GetApiKeysAsync", - pathTemplate: "\"/manage/api/api_keys\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetApiKeys", - methodName: "GetApiKeysAsync", - pathTemplate: "\"/manage/api/api_keys\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetApiKeysResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.GetApiKeysResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.GetApiKeysResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ManageClient.GetApiKeysV2.g.cs b/src/libs/Ideogram/Generated/Ideogram.ManageClient.GetApiKeysV2.g.cs deleted file mode 100644 index 6a7bdd54..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ManageClient.GetApiKeysV2.g.cs +++ /dev/null @@ -1,523 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ManageClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_GetApiKeysV2SecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_GetApiKeysV2SecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_GetApiKeysV2SecurityRequirement0, - }; - partial void PrepareGetApiKeysV2Arguments( - global::System.Net.Http.HttpClient httpClient, - ref string organizationId); - partial void PrepareGetApiKeysV2Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string organizationId); - partial void ProcessGetApiKeysV2Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessGetApiKeysV2ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Retrieve API keys for a specific organization - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task GetApiKeysV2Async( - string organizationId, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await GetApiKeysV2AsResponseAsync( - organizationId: organizationId, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Retrieve API keys for a specific organization - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> GetApiKeysV2AsResponseAsync( - string organizationId, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareGetApiKeysV2Arguments( - httpClient: HttpClient, - organizationId: ref organizationId); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_GetApiKeysV2SecurityRequirements, - operationName: "GetApiKeysV2Async"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/manage/api/organization/api_keys", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("organization_id", organizationId) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetApiKeysV2Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - organizationId: organizationId); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetApiKeysV2", - methodName: "GetApiKeysV2Async", - pathTemplate: "\"/manage/api/organization/api_keys\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetApiKeysV2", - methodName: "GetApiKeysV2Async", - pathTemplate: "\"/manage/api/organization/api_keys\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetApiKeysV2", - methodName: "GetApiKeysV2Async", - pathTemplate: "\"/manage/api/organization/api_keys\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetApiKeysV2Response( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetApiKeysV2", - methodName: "GetApiKeysV2Async", - pathTemplate: "\"/manage/api/organization/api_keys\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetApiKeysV2", - methodName: "GetApiKeysV2Async", - pathTemplate: "\"/manage/api/organization/api_keys\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetApiKeysV2ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.GetApiKeysV2Response.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.GetApiKeysV2Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ManageClient.GetApiOrganizationUserSuggestions.g.cs b/src/libs/Ideogram/Generated/Ideogram.ManageClient.GetApiOrganizationUserSuggestions.g.cs deleted file mode 100644 index 244c75b3..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ManageClient.GetApiOrganizationUserSuggestions.g.cs +++ /dev/null @@ -1,547 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ManageClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_GetApiOrganizationUserSuggestionsSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_GetApiOrganizationUserSuggestionsSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_GetApiOrganizationUserSuggestionsSecurityRequirement0, - }; - partial void PrepareGetApiOrganizationUserSuggestionsArguments( - global::System.Net.Http.HttpClient httpClient, - ref string organizationId, - ref string? userHandlePrefix, - ref int? maxItems); - partial void PrepareGetApiOrganizationUserSuggestionsRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string organizationId, - string? userHandlePrefix, - int? maxItems); - partial void ProcessGetApiOrganizationUserSuggestionsResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessGetApiOrganizationUserSuggestionsResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Get search results for user handles with suggestions for a particular organization. - /// - /// - /// - /// - /// Default Value: 3 - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task GetApiOrganizationUserSuggestionsAsync( - string organizationId, - string? userHandlePrefix = default, - int? maxItems = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await GetApiOrganizationUserSuggestionsAsResponseAsync( - organizationId: organizationId, - userHandlePrefix: userHandlePrefix, - maxItems: maxItems, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Get search results for user handles with suggestions for a particular organization. - /// - /// - /// - /// - /// Default Value: 3 - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> GetApiOrganizationUserSuggestionsAsResponseAsync( - string organizationId, - string? userHandlePrefix = default, - int? maxItems = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareGetApiOrganizationUserSuggestionsArguments( - httpClient: HttpClient, - organizationId: ref organizationId, - userHandlePrefix: ref userHandlePrefix, - maxItems: ref maxItems); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_GetApiOrganizationUserSuggestionsSecurityRequirements, - operationName: "GetApiOrganizationUserSuggestionsAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/manage/api/organization/user_suggestions", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("organization_id", organizationId) - .AddOptionalParameter("user_handle_prefix", userHandlePrefix) - .AddOptionalParameter("maxItems", maxItems?.ToString()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetApiOrganizationUserSuggestionsRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - organizationId: organizationId, - userHandlePrefix: userHandlePrefix, - maxItems: maxItems); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetApiOrganizationUserSuggestions", - methodName: "GetApiOrganizationUserSuggestionsAsync", - pathTemplate: "\"/manage/api/organization/user_suggestions\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetApiOrganizationUserSuggestions", - methodName: "GetApiOrganizationUserSuggestionsAsync", - pathTemplate: "\"/manage/api/organization/user_suggestions\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetApiOrganizationUserSuggestions", - methodName: "GetApiOrganizationUserSuggestionsAsync", - pathTemplate: "\"/manage/api/organization/user_suggestions\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetApiOrganizationUserSuggestionsResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetApiOrganizationUserSuggestions", - methodName: "GetApiOrganizationUserSuggestionsAsync", - pathTemplate: "\"/manage/api/organization/user_suggestions\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetApiOrganizationUserSuggestions", - methodName: "GetApiOrganizationUserSuggestionsAsync", - pathTemplate: "\"/manage/api/organization/user_suggestions\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetApiOrganizationUserSuggestionsResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.GetApiOrganizationUserSuggestionsResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.GetApiOrganizationUserSuggestionsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ManageClient.GetApiProfiles.g.cs b/src/libs/Ideogram/Generated/Ideogram.ManageClient.GetApiProfiles.g.cs deleted file mode 100644 index 89cc5ceb..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ManageClient.GetApiProfiles.g.cs +++ /dev/null @@ -1,479 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ManageClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_GetApiProfilesSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_GetApiProfilesSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_GetApiProfilesSecurityRequirement0, - }; - partial void PrepareGetApiProfilesArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareGetApiProfilesRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessGetApiProfilesResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessGetApiProfilesResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Retrieve the user's current API profiles - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task GetApiProfilesAsync( - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await GetApiProfilesAsResponseAsync( - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Retrieve the user's current API profiles - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> GetApiProfilesAsResponseAsync( - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareGetApiProfilesArguments( - httpClient: HttpClient); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_GetApiProfilesSecurityRequirements, - operationName: "GetApiProfilesAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/manage/api/profiles", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetApiProfilesRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetApiProfiles", - methodName: "GetApiProfilesAsync", - pathTemplate: "\"/manage/api/profiles\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetApiProfiles", - methodName: "GetApiProfilesAsync", - pathTemplate: "\"/manage/api/profiles\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetApiProfiles", - methodName: "GetApiProfilesAsync", - pathTemplate: "\"/manage/api/profiles\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetApiProfilesResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetApiProfiles", - methodName: "GetApiProfilesAsync", - pathTemplate: "\"/manage/api/profiles\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetApiProfiles", - methodName: "GetApiProfilesAsync", - pathTemplate: "\"/manage/api/profiles\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetApiProfilesResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.GetApiProfilesResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.GetApiProfilesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ManageClient.GetApiStripeSubscription.g.cs b/src/libs/Ideogram/Generated/Ideogram.ManageClient.GetApiStripeSubscription.g.cs deleted file mode 100644 index fd64941f..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ManageClient.GetApiStripeSubscription.g.cs +++ /dev/null @@ -1,501 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ManageClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_GetApiStripeSubscriptionSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_GetApiStripeSubscriptionSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_GetApiStripeSubscriptionSecurityRequirement0, - }; - partial void PrepareGetApiStripeSubscriptionArguments( - global::System.Net.Http.HttpClient httpClient, - ref string organizationId, - ref bool? isBusiness); - partial void PrepareGetApiStripeSubscriptionRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string organizationId, - bool? isBusiness); - partial void ProcessGetApiStripeSubscriptionResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessGetApiStripeSubscriptionResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Retrieve data relevant to connecting to Stripe. - /// - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task GetApiStripeSubscriptionAsync( - string organizationId, - bool? isBusiness = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await GetApiStripeSubscriptionAsResponseAsync( - organizationId: organizationId, - isBusiness: isBusiness, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Retrieve data relevant to connecting to Stripe. - /// - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> GetApiStripeSubscriptionAsResponseAsync( - string organizationId, - bool? isBusiness = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareGetApiStripeSubscriptionArguments( - httpClient: HttpClient, - organizationId: ref organizationId, - isBusiness: ref isBusiness); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_GetApiStripeSubscriptionSecurityRequirements, - operationName: "GetApiStripeSubscriptionAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/manage/api/stripe_subscription", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("organization_id", organizationId) - .AddOptionalParameter("isBusiness", isBusiness?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetApiStripeSubscriptionRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - organizationId: organizationId, - isBusiness: isBusiness); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetApiStripeSubscription", - methodName: "GetApiStripeSubscriptionAsync", - pathTemplate: "\"/manage/api/stripe_subscription\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetApiStripeSubscription", - methodName: "GetApiStripeSubscriptionAsync", - pathTemplate: "\"/manage/api/stripe_subscription\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetApiStripeSubscription", - methodName: "GetApiStripeSubscriptionAsync", - pathTemplate: "\"/manage/api/stripe_subscription\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetApiStripeSubscriptionResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetApiStripeSubscription", - methodName: "GetApiStripeSubscriptionAsync", - pathTemplate: "\"/manage/api/stripe_subscription\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetApiStripeSubscription", - methodName: "GetApiStripeSubscriptionAsync", - pathTemplate: "\"/manage/api/stripe_subscription\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetApiStripeSubscriptionResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.ManageApiStripeSubscriptionResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.ManageApiStripeSubscriptionResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ManageClient.GetApiSubscription.g.cs b/src/libs/Ideogram/Generated/Ideogram.ManageClient.GetApiSubscription.g.cs deleted file mode 100644 index 94b99365..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ManageClient.GetApiSubscription.g.cs +++ /dev/null @@ -1,491 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ManageClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_GetApiSubscriptionSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_GetApiSubscriptionSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_GetApiSubscriptionSecurityRequirement0, - }; - partial void PrepareGetApiSubscriptionArguments( - global::System.Net.Http.HttpClient httpClient, - ref string organizationId); - partial void PrepareGetApiSubscriptionRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string organizationId); - partial void ProcessGetApiSubscriptionResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessGetApiSubscriptionResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Retrieve data relevant to creating an API subscription. - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task GetApiSubscriptionAsync( - string organizationId, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await GetApiSubscriptionAsResponseAsync( - organizationId: organizationId, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Retrieve data relevant to creating an API subscription. - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> GetApiSubscriptionAsResponseAsync( - string organizationId, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareGetApiSubscriptionArguments( - httpClient: HttpClient, - organizationId: ref organizationId); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_GetApiSubscriptionSecurityRequirements, - operationName: "GetApiSubscriptionAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/manage/api/subscription", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("organization_id", organizationId) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetApiSubscriptionRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - organizationId: organizationId); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetApiSubscription", - methodName: "GetApiSubscriptionAsync", - pathTemplate: "\"/manage/api/subscription\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetApiSubscription", - methodName: "GetApiSubscriptionAsync", - pathTemplate: "\"/manage/api/subscription\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetApiSubscription", - methodName: "GetApiSubscriptionAsync", - pathTemplate: "\"/manage/api/subscription\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetApiSubscriptionResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetApiSubscription", - methodName: "GetApiSubscriptionAsync", - pathTemplate: "\"/manage/api/subscription\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetApiSubscription", - methodName: "GetApiSubscriptionAsync", - pathTemplate: "\"/manage/api/subscription\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetApiSubscriptionResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.ManageApiSubscriptionResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.ManageApiSubscriptionResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ManageClient.GetApiTerms.g.cs b/src/libs/Ideogram/Generated/Ideogram.ManageClient.GetApiTerms.g.cs deleted file mode 100644 index fecfd110..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ManageClient.GetApiTerms.g.cs +++ /dev/null @@ -1,479 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ManageClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_GetApiTermsSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_GetApiTermsSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_GetApiTermsSecurityRequirement0, - }; - partial void PrepareGetApiTermsArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareGetApiTermsRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessGetApiTermsResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessGetApiTermsResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Retrieve the latest terms of service for API usage. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task GetApiTermsAsync( - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await GetApiTermsAsResponseAsync( - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Retrieve the latest terms of service for API usage. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> GetApiTermsAsResponseAsync( - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareGetApiTermsArguments( - httpClient: HttpClient); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_GetApiTermsSecurityRequirements, - operationName: "GetApiTermsAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/manage/api/terms", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetApiTermsRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetApiTerms", - methodName: "GetApiTermsAsync", - pathTemplate: "\"/manage/api/terms\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetApiTerms", - methodName: "GetApiTermsAsync", - pathTemplate: "\"/manage/api/terms\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetApiTerms", - methodName: "GetApiTermsAsync", - pathTemplate: "\"/manage/api/terms\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetApiTermsResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetApiTerms", - methodName: "GetApiTermsAsync", - pathTemplate: "\"/manage/api/terms\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetApiTerms", - methodName: "GetApiTermsAsync", - pathTemplate: "\"/manage/api/terms\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetApiTermsResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.GetApiTermsResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.GetApiTermsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ManageClient.GetOrganizationBillingPortal.g.cs b/src/libs/Ideogram/Generated/Ideogram.ManageClient.GetOrganizationBillingPortal.g.cs deleted file mode 100644 index 161ffc3b..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ManageClient.GetOrganizationBillingPortal.g.cs +++ /dev/null @@ -1,523 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ManageClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_GetOrganizationBillingPortalSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_GetOrganizationBillingPortalSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_GetOrganizationBillingPortalSecurityRequirement0, - }; - partial void PrepareGetOrganizationBillingPortalArguments( - global::System.Net.Http.HttpClient httpClient, - ref string organizationId); - partial void PrepareGetOrganizationBillingPortalRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string organizationId); - partial void ProcessGetOrganizationBillingPortalResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessGetOrganizationBillingPortalResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Retrieve the Stripe billing portal URL for a specific organization - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task GetOrganizationBillingPortalAsync( - string organizationId, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await GetOrganizationBillingPortalAsResponseAsync( - organizationId: organizationId, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Retrieve the Stripe billing portal URL for a specific organization - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> GetOrganizationBillingPortalAsResponseAsync( - string organizationId, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareGetOrganizationBillingPortalArguments( - httpClient: HttpClient, - organizationId: ref organizationId); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_GetOrganizationBillingPortalSecurityRequirements, - operationName: "GetOrganizationBillingPortalAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/manage/api/organization/billing_portal", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("organization_id", organizationId) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetOrganizationBillingPortalRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - organizationId: organizationId); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetOrganizationBillingPortal", - methodName: "GetOrganizationBillingPortalAsync", - pathTemplate: "\"/manage/api/organization/billing_portal\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetOrganizationBillingPortal", - methodName: "GetOrganizationBillingPortalAsync", - pathTemplate: "\"/manage/api/organization/billing_portal\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetOrganizationBillingPortal", - methodName: "GetOrganizationBillingPortalAsync", - pathTemplate: "\"/manage/api/organization/billing_portal\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetOrganizationBillingPortalResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetOrganizationBillingPortal", - methodName: "GetOrganizationBillingPortalAsync", - pathTemplate: "\"/manage/api/organization/billing_portal\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetOrganizationBillingPortal", - methodName: "GetOrganizationBillingPortalAsync", - pathTemplate: "\"/manage/api/organization/billing_portal\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetOrganizationBillingPortalResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.GetOrganizationBillingPortalResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.GetOrganizationBillingPortalResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ManageClient.GetOrganizationMembers.g.cs b/src/libs/Ideogram/Generated/Ideogram.ManageClient.GetOrganizationMembers.g.cs deleted file mode 100644 index 2a6efea3..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ManageClient.GetOrganizationMembers.g.cs +++ /dev/null @@ -1,525 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ManageClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_GetOrganizationMembersSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_GetOrganizationMembersSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_GetOrganizationMembersSecurityRequirement0, - }; - partial void PrepareGetOrganizationMembersArguments( - global::System.Net.Http.HttpClient httpClient, - ref string organizationId); - partial void PrepareGetOrganizationMembersRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string organizationId); - partial void ProcessGetOrganizationMembersResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessGetOrganizationMembersResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Retrieve members of a specific organization
- /// Returns both active members and pending invites for the organization. A pending invite is identified by a non-null invite_status (e.g. PENDING); active members have a null invite_status. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task GetOrganizationMembersAsync( - string organizationId, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await GetOrganizationMembersAsResponseAsync( - organizationId: organizationId, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Retrieve members of a specific organization
- /// Returns both active members and pending invites for the organization. A pending invite is identified by a non-null invite_status (e.g. PENDING); active members have a null invite_status. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> GetOrganizationMembersAsResponseAsync( - string organizationId, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareGetOrganizationMembersArguments( - httpClient: HttpClient, - organizationId: ref organizationId); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_GetOrganizationMembersSecurityRequirements, - operationName: "GetOrganizationMembersAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/manage/api/organization/members", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("organization_id", organizationId) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetOrganizationMembersRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - organizationId: organizationId); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetOrganizationMembers", - methodName: "GetOrganizationMembersAsync", - pathTemplate: "\"/manage/api/organization/members\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetOrganizationMembers", - methodName: "GetOrganizationMembersAsync", - pathTemplate: "\"/manage/api/organization/members\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetOrganizationMembers", - methodName: "GetOrganizationMembersAsync", - pathTemplate: "\"/manage/api/organization/members\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetOrganizationMembersResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetOrganizationMembers", - methodName: "GetOrganizationMembersAsync", - pathTemplate: "\"/manage/api/organization/members\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetOrganizationMembers", - methodName: "GetOrganizationMembersAsync", - pathTemplate: "\"/manage/api/organization/members\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetOrganizationMembersResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.GetOrganizationMembersResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.GetOrganizationMembersResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ManageClient.GetUsageInfo.g.cs b/src/libs/Ideogram/Generated/Ideogram.ManageClient.GetUsageInfo.g.cs deleted file mode 100644 index d36216ca..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ManageClient.GetUsageInfo.g.cs +++ /dev/null @@ -1,599 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ManageClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_GetUsageInfoSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_GetUsageInfoSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_GetUsageInfoSecurityRequirement0, - }; - partial void PrepareGetUsageInfoArguments( - global::System.Net.Http.HttpClient httpClient, - ref string organizationId, - ref global::Ideogram.SegmentBy segmentBy, - ref global::System.DateTime startTime, - ref global::System.DateTime? endTime, - global::System.Collections.Generic.IList? modelVersions, - global::System.Collections.Generic.IList? tools, - global::System.Collections.Generic.IList? apiKeyIds, - global::System.Collections.Generic.IList? userEmails, - ref global::Ideogram.UsageSource? source); - partial void PrepareGetUsageInfoRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string organizationId, - global::Ideogram.SegmentBy segmentBy, - global::System.DateTime startTime, - global::System.DateTime? endTime, - global::System.Collections.Generic.IList? modelVersions, - global::System.Collections.Generic.IList? tools, - global::System.Collections.Generic.IList? apiKeyIds, - global::System.Collections.Generic.IList? userEmails, - global::Ideogram.UsageSource? source); - partial void ProcessGetUsageInfoResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessGetUsageInfoResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Retrieve usage information segmented by time period with tool-specific breakdowns - /// - /// - /// - /// Time segment granularity for usage breakdown
- /// Example: DAY - /// - /// - /// - /// - /// Default Value: [] - /// - /// - /// Default Value: [] - /// - /// - /// Default Value: [] - /// - /// - /// Default Value: [] - /// - /// - /// Filter usage by source - API for programmatic API usage, APP for web application usage
- /// Default Value: API - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task GetUsageInfoAsync( - string organizationId, - global::Ideogram.SegmentBy segmentBy, - global::System.DateTime startTime, - global::System.DateTime? endTime = default, - global::System.Collections.Generic.IList? modelVersions = default, - global::System.Collections.Generic.IList? tools = default, - global::System.Collections.Generic.IList? apiKeyIds = default, - global::System.Collections.Generic.IList? userEmails = default, - global::Ideogram.UsageSource? source = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await GetUsageInfoAsResponseAsync( - organizationId: organizationId, - segmentBy: segmentBy, - startTime: startTime, - endTime: endTime, - modelVersions: modelVersions, - tools: tools, - apiKeyIds: apiKeyIds, - userEmails: userEmails, - source: source, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Retrieve usage information segmented by time period with tool-specific breakdowns - /// - /// - /// - /// Time segment granularity for usage breakdown
- /// Example: DAY - /// - /// - /// - /// - /// Default Value: [] - /// - /// - /// Default Value: [] - /// - /// - /// Default Value: [] - /// - /// - /// Default Value: [] - /// - /// - /// Filter usage by source - API for programmatic API usage, APP for web application usage
- /// Default Value: API - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> GetUsageInfoAsResponseAsync( - string organizationId, - global::Ideogram.SegmentBy segmentBy, - global::System.DateTime startTime, - global::System.DateTime? endTime = default, - global::System.Collections.Generic.IList? modelVersions = default, - global::System.Collections.Generic.IList? tools = default, - global::System.Collections.Generic.IList? apiKeyIds = default, - global::System.Collections.Generic.IList? userEmails = default, - global::Ideogram.UsageSource? source = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareGetUsageInfoArguments( - httpClient: HttpClient, - organizationId: ref organizationId, - segmentBy: ref segmentBy, - startTime: ref startTime, - endTime: ref endTime, - modelVersions: modelVersions, - tools: tools, - apiKeyIds: apiKeyIds, - userEmails: userEmails, - source: ref source); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_GetUsageInfoSecurityRequirements, - operationName: "GetUsageInfoAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/manage/api/usage", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("organization_id", organizationId) - .AddRequiredParameter("segment_by", segmentBy.ToValueString()) - .AddRequiredParameter("start_time", startTime.ToString("yyyy-MM-ddTHH:mm:ssZ")) - .AddOptionalParameter("end_time", endTime?.ToString("yyyy-MM-ddTHH:mm:ssZ")) - .AddOptionalParameter("model_versions", modelVersions, selector: static x => x.ToValueString(), delimiter: ",", explode: true) - .AddOptionalParameter("tools", tools, selector: static x => x.ToValueString(), delimiter: ",", explode: true) - .AddOptionalParameter("api_key_ids", apiKeyIds, delimiter: ",", explode: true) - .AddOptionalParameter("user_emails", userEmails, delimiter: ",", explode: true) - .AddOptionalParameter("source", source?.ToValueString()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetUsageInfoRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - organizationId: organizationId, - segmentBy: segmentBy, - startTime: startTime, - endTime: endTime, - modelVersions: modelVersions, - tools: tools, - apiKeyIds: apiKeyIds, - userEmails: userEmails, - source: source); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetUsageInfo", - methodName: "GetUsageInfoAsync", - pathTemplate: "\"/manage/api/usage\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetUsageInfo", - methodName: "GetUsageInfoAsync", - pathTemplate: "\"/manage/api/usage\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetUsageInfo", - methodName: "GetUsageInfoAsync", - pathTemplate: "\"/manage/api/usage\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetUsageInfoResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetUsageInfo", - methodName: "GetUsageInfoAsync", - pathTemplate: "\"/manage/api/usage\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetUsageInfo", - methodName: "GetUsageInfoAsync", - pathTemplate: "\"/manage/api/usage\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetUsageInfoResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.GetUsageInfoResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.GetUsageInfoResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ManageClient.GetUserCredits.g.cs b/src/libs/Ideogram/Generated/Ideogram.ManageClient.GetUserCredits.g.cs deleted file mode 100644 index bb66bb25..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ManageClient.GetUserCredits.g.cs +++ /dev/null @@ -1,511 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ManageClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_GetUserCreditsSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_GetUserCreditsSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_GetUserCreditsSecurityRequirement0, - }; - partial void PrepareGetUserCreditsArguments( - global::System.Net.Http.HttpClient httpClient, - ref string organizationId, - ref global::System.DateTime startTime, - ref global::System.DateTime? endTime); - partial void PrepareGetUserCreditsRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string organizationId, - global::System.DateTime startTime, - global::System.DateTime? endTime); - partial void ProcessGetUserCreditsResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessGetUserCreditsResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Retrieve user credit information and spending metrics - /// - /// - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task GetUserCreditsAsync( - string organizationId, - global::System.DateTime startTime, - global::System.DateTime? endTime = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await GetUserCreditsAsResponseAsync( - organizationId: organizationId, - startTime: startTime, - endTime: endTime, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Retrieve user credit information and spending metrics - /// - /// - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> GetUserCreditsAsResponseAsync( - string organizationId, - global::System.DateTime startTime, - global::System.DateTime? endTime = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareGetUserCreditsArguments( - httpClient: HttpClient, - organizationId: ref organizationId, - startTime: ref startTime, - endTime: ref endTime); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_GetUserCreditsSecurityRequirements, - operationName: "GetUserCreditsAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/manage/api/credits", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("organization_id", organizationId) - .AddRequiredParameter("start_time", startTime.ToString("yyyy-MM-ddTHH:mm:ssZ")) - .AddOptionalParameter("end_time", endTime?.ToString("yyyy-MM-ddTHH:mm:ssZ")) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetUserCreditsRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - organizationId: organizationId, - startTime: startTime, - endTime: endTime); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetUserCredits", - methodName: "GetUserCreditsAsync", - pathTemplate: "\"/manage/api/credits\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetUserCredits", - methodName: "GetUserCreditsAsync", - pathTemplate: "\"/manage/api/credits\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetUserCredits", - methodName: "GetUserCreditsAsync", - pathTemplate: "\"/manage/api/credits\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetUserCreditsResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetUserCredits", - methodName: "GetUserCreditsAsync", - pathTemplate: "\"/manage/api/credits\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetUserCredits", - methodName: "GetUserCreditsAsync", - pathTemplate: "\"/manage/api/credits\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetUserCreditsResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.GetUserCreditsResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.GetUserCreditsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ManageClient.GetUserSpendCommitInfo.g.cs b/src/libs/Ideogram/Generated/Ideogram.ManageClient.GetUserSpendCommitInfo.g.cs deleted file mode 100644 index 46959a02..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ManageClient.GetUserSpendCommitInfo.g.cs +++ /dev/null @@ -1,501 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ManageClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_GetUserSpendCommitInfoSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_GetUserSpendCommitInfoSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_GetUserSpendCommitInfoSecurityRequirement0, - }; - partial void PrepareGetUserSpendCommitInfoArguments( - global::System.Net.Http.HttpClient httpClient, - ref string organizationId, - ref bool? postpaidOnly); - partial void PrepareGetUserSpendCommitInfoRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string organizationId, - bool? postpaidOnly); - partial void ProcessGetUserSpendCommitInfoResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessGetUserSpendCommitInfoResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Retrieve user spend commit information - /// - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task GetUserSpendCommitInfoAsync( - string organizationId, - bool? postpaidOnly = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await GetUserSpendCommitInfoAsResponseAsync( - organizationId: organizationId, - postpaidOnly: postpaidOnly, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Retrieve user spend commit information - /// - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> GetUserSpendCommitInfoAsResponseAsync( - string organizationId, - bool? postpaidOnly = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareGetUserSpendCommitInfoArguments( - httpClient: HttpClient, - organizationId: ref organizationId, - postpaidOnly: ref postpaidOnly); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_GetUserSpendCommitInfoSecurityRequirements, - operationName: "GetUserSpendCommitInfoAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/manage/api/spend_commit", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("organization_id", organizationId) - .AddOptionalParameter("postpaid_only", postpaidOnly?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetUserSpendCommitInfoRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - organizationId: organizationId, - postpaidOnly: postpaidOnly); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetUserSpendCommitInfo", - methodName: "GetUserSpendCommitInfoAsync", - pathTemplate: "\"/manage/api/spend_commit\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetUserSpendCommitInfo", - methodName: "GetUserSpendCommitInfoAsync", - pathTemplate: "\"/manage/api/spend_commit\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetUserSpendCommitInfo", - methodName: "GetUserSpendCommitInfoAsync", - pathTemplate: "\"/manage/api/spend_commit\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetUserSpendCommitInfoResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetUserSpendCommitInfo", - methodName: "GetUserSpendCommitInfoAsync", - pathTemplate: "\"/manage/api/spend_commit\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetUserSpendCommitInfo", - methodName: "GetUserSpendCommitInfoAsync", - pathTemplate: "\"/manage/api/spend_commit\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetUserSpendCommitInfoResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.SpendCommitInfoResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.SpendCommitInfoResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ManageClient.ListOrganizationInvoices.g.cs b/src/libs/Ideogram/Generated/Ideogram.ManageClient.ListOrganizationInvoices.g.cs deleted file mode 100644 index e53a152a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ManageClient.ListOrganizationInvoices.g.cs +++ /dev/null @@ -1,523 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ManageClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_ListOrganizationInvoicesSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_ListOrganizationInvoicesSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_ListOrganizationInvoicesSecurityRequirement0, - }; - partial void PrepareListOrganizationInvoicesArguments( - global::System.Net.Http.HttpClient httpClient, - ref string organizationId); - partial void PrepareListOrganizationInvoicesRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string organizationId); - partial void ProcessListOrganizationInvoicesResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessListOrganizationInvoicesResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Retrieve invoices for a specific organization - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task ListOrganizationInvoicesAsync( - string organizationId, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await ListOrganizationInvoicesAsResponseAsync( - organizationId: organizationId, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Retrieve invoices for a specific organization - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> ListOrganizationInvoicesAsResponseAsync( - string organizationId, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareListOrganizationInvoicesArguments( - httpClient: HttpClient, - organizationId: ref organizationId); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_ListOrganizationInvoicesSecurityRequirements, - operationName: "ListOrganizationInvoicesAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/manage/api/organization/list_invoices", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("organization_id", organizationId) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareListOrganizationInvoicesRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - organizationId: organizationId); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "ListOrganizationInvoices", - methodName: "ListOrganizationInvoicesAsync", - pathTemplate: "\"/manage/api/organization/list_invoices\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "ListOrganizationInvoices", - methodName: "ListOrganizationInvoicesAsync", - pathTemplate: "\"/manage/api/organization/list_invoices\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "ListOrganizationInvoices", - methodName: "ListOrganizationInvoicesAsync", - pathTemplate: "\"/manage/api/organization/list_invoices\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessListOrganizationInvoicesResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "ListOrganizationInvoices", - methodName: "ListOrganizationInvoicesAsync", - pathTemplate: "\"/manage/api/organization/list_invoices\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "ListOrganizationInvoices", - methodName: "ListOrganizationInvoicesAsync", - pathTemplate: "\"/manage/api/organization/list_invoices\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessListOrganizationInvoicesResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.ListOrganizationInvoicesResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.ListOrganizationInvoicesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ManageClient.PostAddCreditsForApi.g.cs b/src/libs/Ideogram/Generated/Ideogram.ManageClient.PostAddCreditsForApi.g.cs deleted file mode 100644 index 36d8b3ed..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ManageClient.PostAddCreditsForApi.g.cs +++ /dev/null @@ -1,576 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ManageClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostAddCreditsForApiSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostAddCreditsForApiSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostAddCreditsForApiSecurityRequirement0, - }; - partial void PreparePostAddCreditsForApiArguments( - global::System.Net.Http.HttpClient httpClient, - ref string organizationId, - global::Ideogram.PostAddCreditsRequest request); - partial void PreparePostAddCreditsForApiRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string organizationId, - global::Ideogram.PostAddCreditsRequest request); - partial void ProcessPostAddCreditsForApiResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostAddCreditsForApiResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Add credits to an API user's account. - /// - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostAddCreditsForApiAsync( - string organizationId, - - global::Ideogram.PostAddCreditsRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostAddCreditsForApiAsResponseAsync( - organizationId: organizationId, - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Add credits to an API user's account. - /// - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostAddCreditsForApiAsResponseAsync( - string organizationId, - - global::Ideogram.PostAddCreditsRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostAddCreditsForApiArguments( - httpClient: HttpClient, - organizationId: ref organizationId, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostAddCreditsForApiSecurityRequirements, - operationName: "PostAddCreditsForApiAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/manage/api/add_credits", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("organization_id", organizationId) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostAddCreditsForApiRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - organizationId: organizationId, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostAddCreditsForApi", - methodName: "PostAddCreditsForApiAsync", - pathTemplate: "\"/manage/api/add_credits\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostAddCreditsForApi", - methodName: "PostAddCreditsForApiAsync", - pathTemplate: "\"/manage/api/add_credits\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostAddCreditsForApi", - methodName: "PostAddCreditsForApiAsync", - pathTemplate: "\"/manage/api/add_credits\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostAddCreditsForApiResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostAddCreditsForApi", - methodName: "PostAddCreditsForApiAsync", - pathTemplate: "\"/manage/api/add_credits\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostAddCreditsForApi", - methodName: "PostAddCreditsForApiAsync", - pathTemplate: "\"/manage/api/add_credits\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // Bad request - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - global::Ideogram.PostAddCreditsError? __value_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::Ideogram.PostAddCreditsError.FromJson(__content_400, JsonSerializerContext); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_400 = global::Ideogram.PostAddCreditsError.FromJson(__content_400, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseObject: __value_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostAddCreditsForApiResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.PostAddCreditsResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.PostAddCreditsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Add credits to an API user's account. - /// - /// - /// - /// Represents a price.
- /// Example: {"amount":1050,"currency_code":"USD"} - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostAddCreditsForApiAsync( - string organizationId, - global::Ideogram.Price amount, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.PostAddCreditsRequest - { - Amount = amount, - }; - - return await PostAddCreditsForApiAsync( - organizationId: organizationId, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ManageClient.PostApiSubscription.g.cs b/src/libs/Ideogram/Generated/Ideogram.ManageClient.PostApiSubscription.g.cs deleted file mode 100644 index 8eeab70a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ManageClient.PostApiSubscription.g.cs +++ /dev/null @@ -1,581 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ManageClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostApiSubscriptionSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostApiSubscriptionSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostApiSubscriptionSecurityRequirement0, - }; - partial void PreparePostApiSubscriptionArguments( - global::System.Net.Http.HttpClient httpClient, - ref string organizationId, - global::Ideogram.PostApiSubscriptionRequest request); - partial void PreparePostApiSubscriptionRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string organizationId, - global::Ideogram.PostApiSubscriptionRequest request); - partial void ProcessPostApiSubscriptionResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostApiSubscriptionResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Update API subscription settings - /// - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostApiSubscriptionAsync( - string organizationId, - - global::Ideogram.PostApiSubscriptionRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostApiSubscriptionAsResponseAsync( - organizationId: organizationId, - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Update API subscription settings - /// - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostApiSubscriptionAsResponseAsync( - string organizationId, - - global::Ideogram.PostApiSubscriptionRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostApiSubscriptionArguments( - httpClient: HttpClient, - organizationId: ref organizationId, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostApiSubscriptionSecurityRequirements, - operationName: "PostApiSubscriptionAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/manage/api/subscription", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("organization_id", organizationId) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostApiSubscriptionRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - organizationId: organizationId, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostApiSubscription", - methodName: "PostApiSubscriptionAsync", - pathTemplate: "\"/manage/api/subscription\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostApiSubscription", - methodName: "PostApiSubscriptionAsync", - pathTemplate: "\"/manage/api/subscription\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostApiSubscription", - methodName: "PostApiSubscriptionAsync", - pathTemplate: "\"/manage/api/subscription\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostApiSubscriptionResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostApiSubscription", - methodName: "PostApiSubscriptionAsync", - pathTemplate: "\"/manage/api/subscription\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostApiSubscription", - methodName: "PostApiSubscriptionAsync", - pathTemplate: "\"/manage/api/subscription\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // Bad request - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - global::Ideogram.PostApiSubscriptionError? __value_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::Ideogram.PostApiSubscriptionError.FromJson(__content_400, JsonSerializerContext); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_400 = global::Ideogram.PostApiSubscriptionError.FromJson(__content_400, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseObject: __value_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostApiSubscriptionResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.PostApiSubscriptionResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.PostApiSubscriptionResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Update API subscription settings - /// - /// - /// - /// The current recharge settings for the API subscription.
- /// Example: {"minimum_balance_threshold":{"amount":1050,"currency_code":"USD"},"top_up_balance":{"amount":1050,"currency_code":"USD"}} - /// - /// - /// Whether to enable or disable auto recharge. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostApiSubscriptionAsync( - string organizationId, - global::Ideogram.RechargeSettings? rechargeSettings = default, - bool? isActive = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.PostApiSubscriptionRequest - { - RechargeSettings = rechargeSettings, - IsActive = isActive, - }; - - return await PostApiSubscriptionAsync( - organizationId: organizationId, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ManageClient.PostApiTerms.g.cs b/src/libs/Ideogram/Generated/Ideogram.ManageClient.PostApiTerms.g.cs deleted file mode 100644 index ba322147..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ManageClient.PostApiTerms.g.cs +++ /dev/null @@ -1,533 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ManageClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostApiTermsSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostApiTermsSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostApiTermsSecurityRequirement0, - }; - partial void PreparePostApiTermsArguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.PostApiTermsRequest request); - partial void PreparePostApiTermsRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.PostApiTermsRequest request); - partial void ProcessPostApiTermsResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - /// - /// Accept terms - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostApiTermsAsync( - - global::Ideogram.PostApiTermsRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - await PostApiTermsAsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - } - /// - /// Accept terms - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostApiTermsAsResponseAsync( - - global::Ideogram.PostApiTermsRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostApiTermsArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostApiTermsSecurityRequirements, - operationName: "PostApiTermsAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/manage/api/terms", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostApiTermsRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostApiTerms", - methodName: "PostApiTermsAsync", - pathTemplate: "\"/manage/api/terms\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostApiTerms", - methodName: "PostApiTermsAsync", - pathTemplate: "\"/manage/api/terms\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostApiTerms", - methodName: "PostApiTermsAsync", - pathTemplate: "\"/manage/api/terms\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostApiTermsResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostApiTerms", - methodName: "PostApiTermsAsync", - pathTemplate: "\"/manage/api/terms\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostApiTerms", - methodName: "PostApiTermsAsync", - pathTemplate: "\"/manage/api/terms\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Accept terms - /// - /// - /// The ID of the terms which are being accepted.
- /// Example: TOS_2024_04_20 - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostApiTermsAsync( - string termsId, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.PostApiTermsRequest - { - TermsId = termsId, - }; - - await PostApiTermsAsync( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ManageClient.PromoteOrganizationAdmins.g.cs b/src/libs/Ideogram/Generated/Ideogram.ManageClient.PromoteOrganizationAdmins.g.cs deleted file mode 100644 index 25a161b2..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ManageClient.PromoteOrganizationAdmins.g.cs +++ /dev/null @@ -1,603 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ManageClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PromoteOrganizationAdminsSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PromoteOrganizationAdminsSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PromoteOrganizationAdminsSecurityRequirement0, - }; - partial void PreparePromoteOrganizationAdminsArguments( - global::System.Net.Http.HttpClient httpClient, - ref string organizationId, - global::Ideogram.PromoteOrganizationAdminsRequest request); - partial void PreparePromoteOrganizationAdminsRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string organizationId, - global::Ideogram.PromoteOrganizationAdminsRequest request); - partial void ProcessPromoteOrganizationAdminsResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPromoteOrganizationAdminsResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Promote members to ADMIN role in an ENTERPRISE_PREPAID or ENTERPRISE_API organization - /// - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PromoteOrganizationAdminsAsync( - string organizationId, - - global::Ideogram.PromoteOrganizationAdminsRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PromoteOrganizationAdminsAsResponseAsync( - organizationId: organizationId, - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Promote members to ADMIN role in an ENTERPRISE_PREPAID or ENTERPRISE_API organization - /// - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PromoteOrganizationAdminsAsResponseAsync( - string organizationId, - - global::Ideogram.PromoteOrganizationAdminsRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePromoteOrganizationAdminsArguments( - httpClient: HttpClient, - organizationId: ref organizationId, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PromoteOrganizationAdminsSecurityRequirements, - operationName: "PromoteOrganizationAdminsAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/manage/api/organization/promote_admins", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("organization_id", organizationId) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePromoteOrganizationAdminsRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - organizationId: organizationId, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PromoteOrganizationAdmins", - methodName: "PromoteOrganizationAdminsAsync", - pathTemplate: "\"/manage/api/organization/promote_admins\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PromoteOrganizationAdmins", - methodName: "PromoteOrganizationAdminsAsync", - pathTemplate: "\"/manage/api/organization/promote_admins\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PromoteOrganizationAdmins", - methodName: "PromoteOrganizationAdminsAsync", - pathTemplate: "\"/manage/api/organization/promote_admins\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPromoteOrganizationAdminsResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PromoteOrganizationAdmins", - methodName: "PromoteOrganizationAdminsAsync", - pathTemplate: "\"/manage/api/organization/promote_admins\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PromoteOrganizationAdmins", - methodName: "PromoteOrganizationAdminsAsync", - pathTemplate: "\"/manage/api/organization/promote_admins\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPromoteOrganizationAdminsResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.OrganizationMemberOperationResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.OrganizationMemberOperationResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Promote members to ADMIN role in an ENTERPRISE_PREPAID or ENTERPRISE_API organization - /// - /// - /// - /// List of organization members to promote to ADMIN role
- /// Default Value: [] - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PromoteOrganizationAdminsAsync( - string organizationId, - global::System.Collections.Generic.IList members, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.PromoteOrganizationAdminsRequest - { - Members = members, - }; - - return await PromoteOrganizationAdminsAsync( - organizationId: organizationId, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ManageClient.RemoveOrganizationMembers.g.cs b/src/libs/Ideogram/Generated/Ideogram.ManageClient.RemoveOrganizationMembers.g.cs deleted file mode 100644 index 8a2b8d99..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ManageClient.RemoveOrganizationMembers.g.cs +++ /dev/null @@ -1,603 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ManageClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_RemoveOrganizationMembersSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_RemoveOrganizationMembersSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_RemoveOrganizationMembersSecurityRequirement0, - }; - partial void PrepareRemoveOrganizationMembersArguments( - global::System.Net.Http.HttpClient httpClient, - ref string organizationId, - global::Ideogram.RemoveOrganizationMembersRequest request); - partial void PrepareRemoveOrganizationMembersRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string organizationId, - global::Ideogram.RemoveOrganizationMembersRequest request); - partial void ProcessRemoveOrganizationMembersResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessRemoveOrganizationMembersResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Remove members from a specific organization - /// - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task RemoveOrganizationMembersAsync( - string organizationId, - - global::Ideogram.RemoveOrganizationMembersRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await RemoveOrganizationMembersAsResponseAsync( - organizationId: organizationId, - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Remove members from a specific organization - /// - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> RemoveOrganizationMembersAsResponseAsync( - string organizationId, - - global::Ideogram.RemoveOrganizationMembersRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareRemoveOrganizationMembersArguments( - httpClient: HttpClient, - organizationId: ref organizationId, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_RemoveOrganizationMembersSecurityRequirements, - operationName: "RemoveOrganizationMembersAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/manage/api/organization/remove_members", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("organization_id", organizationId) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareRemoveOrganizationMembersRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - organizationId: organizationId, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "RemoveOrganizationMembers", - methodName: "RemoveOrganizationMembersAsync", - pathTemplate: "\"/manage/api/organization/remove_members\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "RemoveOrganizationMembers", - methodName: "RemoveOrganizationMembersAsync", - pathTemplate: "\"/manage/api/organization/remove_members\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "RemoveOrganizationMembers", - methodName: "RemoveOrganizationMembersAsync", - pathTemplate: "\"/manage/api/organization/remove_members\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessRemoveOrganizationMembersResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "RemoveOrganizationMembers", - methodName: "RemoveOrganizationMembersAsync", - pathTemplate: "\"/manage/api/organization/remove_members\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "RemoveOrganizationMembers", - methodName: "RemoveOrganizationMembersAsync", - pathTemplate: "\"/manage/api/organization/remove_members\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessRemoveOrganizationMembersResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.OrganizationMemberOperationResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.OrganizationMemberOperationResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Remove members from a specific organization - /// - /// - /// - /// List of organization members to remove
- /// Default Value: [] - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task RemoveOrganizationMembersAsync( - string organizationId, - global::System.Collections.Generic.IList members, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.RemoveOrganizationMembersRequest - { - Members = members, - }; - - return await RemoveOrganizationMembersAsync( - organizationId: organizationId, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ManageClient.ResendOrganizationInvite.g.cs b/src/libs/Ideogram/Generated/Ideogram.ManageClient.ResendOrganizationInvite.g.cs deleted file mode 100644 index 8d21e233..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ManageClient.ResendOrganizationInvite.g.cs +++ /dev/null @@ -1,602 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ManageClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_ResendOrganizationInviteSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_ResendOrganizationInviteSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_ResendOrganizationInviteSecurityRequirement0, - }; - partial void PrepareResendOrganizationInviteArguments( - global::System.Net.Http.HttpClient httpClient, - ref string organizationId, - global::Ideogram.ResendOrganizationInviteRequest request); - partial void PrepareResendOrganizationInviteRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string organizationId, - global::Ideogram.ResendOrganizationInviteRequest request); - partial void ProcessResendOrganizationInviteResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessResendOrganizationInviteResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Resend a pending invite for an organization - /// - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task ResendOrganizationInviteAsync( - string organizationId, - - global::Ideogram.ResendOrganizationInviteRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await ResendOrganizationInviteAsResponseAsync( - organizationId: organizationId, - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Resend a pending invite for an organization - /// - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> ResendOrganizationInviteAsResponseAsync( - string organizationId, - - global::Ideogram.ResendOrganizationInviteRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareResendOrganizationInviteArguments( - httpClient: HttpClient, - organizationId: ref organizationId, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_ResendOrganizationInviteSecurityRequirements, - operationName: "ResendOrganizationInviteAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/manage/api/organization/resend_invite", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("organization_id", organizationId) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareResendOrganizationInviteRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - organizationId: organizationId, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "ResendOrganizationInvite", - methodName: "ResendOrganizationInviteAsync", - pathTemplate: "\"/manage/api/organization/resend_invite\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "ResendOrganizationInvite", - methodName: "ResendOrganizationInviteAsync", - pathTemplate: "\"/manage/api/organization/resend_invite\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "ResendOrganizationInvite", - methodName: "ResendOrganizationInviteAsync", - pathTemplate: "\"/manage/api/organization/resend_invite\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessResendOrganizationInviteResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "ResendOrganizationInvite", - methodName: "ResendOrganizationInviteAsync", - pathTemplate: "\"/manage/api/organization/resend_invite\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "ResendOrganizationInvite", - methodName: "ResendOrganizationInviteAsync", - pathTemplate: "\"/manage/api/organization/resend_invite\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessResendOrganizationInviteResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.OrganizationMemberOperationResult.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.OrganizationMemberOperationResult.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Resend a pending invite for an organization - /// - /// - /// - /// Base64 URL-safe encoded ID of the invite to resend - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task ResendOrganizationInviteAsync( - string organizationId, - string inviteId, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.ResendOrganizationInviteRequest - { - InviteId = inviteId, - }; - - return await ResendOrganizationInviteAsync( - organizationId: organizationId, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ManageClient.UpdateOrganizationApiProperties.g.cs b/src/libs/Ideogram/Generated/Ideogram.ManageClient.UpdateOrganizationApiProperties.g.cs deleted file mode 100644 index 97ffb22b..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ManageClient.UpdateOrganizationApiProperties.g.cs +++ /dev/null @@ -1,576 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ManageClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_UpdateOrganizationApiPropertiesSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_UpdateOrganizationApiPropertiesSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_UpdateOrganizationApiPropertiesSecurityRequirement0, - }; - partial void PrepareUpdateOrganizationApiPropertiesArguments( - global::System.Net.Http.HttpClient httpClient, - ref string organizationId, - global::Ideogram.UpdateOrganizationApiPropertiesRequest request); - partial void PrepareUpdateOrganizationApiPropertiesRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string organizationId, - global::Ideogram.UpdateOrganizationApiPropertiesRequest request); - partial void ProcessUpdateOrganizationApiPropertiesResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessUpdateOrganizationApiPropertiesResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Update a single field on an organization's API properties.
- /// Lets an organization owner toggle API-only settings such as
- /// copyright_detection_enabled. Updates only the fields explicitly present
- /// in the request body; absent fields are left unchanged. - ///
- /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task UpdateOrganizationApiPropertiesAsync( - string organizationId, - - global::Ideogram.UpdateOrganizationApiPropertiesRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await UpdateOrganizationApiPropertiesAsResponseAsync( - organizationId: organizationId, - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Update a single field on an organization's API properties.
- /// Lets an organization owner toggle API-only settings such as
- /// copyright_detection_enabled. Updates only the fields explicitly present
- /// in the request body; absent fields are left unchanged. - ///
- /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> UpdateOrganizationApiPropertiesAsResponseAsync( - string organizationId, - - global::Ideogram.UpdateOrganizationApiPropertiesRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareUpdateOrganizationApiPropertiesArguments( - httpClient: HttpClient, - organizationId: ref organizationId, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_UpdateOrganizationApiPropertiesSecurityRequirements, - operationName: "UpdateOrganizationApiPropertiesAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: $"/manage/api/organization/{organizationId}/api_properties", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: new global::System.Net.Http.HttpMethod("PATCH"), - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareUpdateOrganizationApiPropertiesRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - organizationId: organizationId, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "UpdateOrganizationApiProperties", - methodName: "UpdateOrganizationApiPropertiesAsync", - pathTemplate: "$\"/manage/api/organization/{organizationId}/api_properties\"", - httpMethod: "PATCH", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "UpdateOrganizationApiProperties", - methodName: "UpdateOrganizationApiPropertiesAsync", - pathTemplate: "$\"/manage/api/organization/{organizationId}/api_properties\"", - httpMethod: "PATCH", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "UpdateOrganizationApiProperties", - methodName: "UpdateOrganizationApiPropertiesAsync", - pathTemplate: "$\"/manage/api/organization/{organizationId}/api_properties\"", - httpMethod: "PATCH", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessUpdateOrganizationApiPropertiesResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "UpdateOrganizationApiProperties", - methodName: "UpdateOrganizationApiPropertiesAsync", - pathTemplate: "$\"/manage/api/organization/{organizationId}/api_properties\"", - httpMethod: "PATCH", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "UpdateOrganizationApiProperties", - methodName: "UpdateOrganizationApiPropertiesAsync", - pathTemplate: "$\"/manage/api/organization/{organizationId}/api_properties\"", - httpMethod: "PATCH", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessUpdateOrganizationApiPropertiesResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.UpdateOrganizationApiPropertiesResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.UpdateOrganizationApiPropertiesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Update a single field on an organization's API properties.
- /// Lets an organization owner toggle API-only settings such as
- /// copyright_detection_enabled. Updates only the fields explicitly present
- /// in the request body; absent fields are left unchanged. - ///
- /// - /// - /// Toggle post-generation Hive likeness + logo detection for this organization. See ApiProfile.copyright_detection_enabled for behavior. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task UpdateOrganizationApiPropertiesAsync( - string organizationId, - bool? copyrightDetectionEnabled = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.UpdateOrganizationApiPropertiesRequest - { - CopyrightDetectionEnabled = copyrightDetectionEnabled, - }; - - return await UpdateOrganizationApiPropertiesAsync( - organizationId: organizationId, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ManageClient.UpdateSingleApiKey.g.cs b/src/libs/Ideogram/Generated/Ideogram.ManageClient.UpdateSingleApiKey.g.cs deleted file mode 100644 index 6856b196..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ManageClient.UpdateSingleApiKey.g.cs +++ /dev/null @@ -1,568 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ManageClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_UpdateSingleApiKeySecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_UpdateSingleApiKeySecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_UpdateSingleApiKeySecurityRequirement0, - }; - partial void PrepareUpdateSingleApiKeyArguments( - global::System.Net.Http.HttpClient httpClient, - ref string apiKeyId, - global::Ideogram.PatchApiKeyRequest request); - partial void PrepareUpdateSingleApiKeyRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string apiKeyId, - global::Ideogram.PatchApiKeyRequest request); - partial void ProcessUpdateSingleApiKeyResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessUpdateSingleApiKeyResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Update an API key's user-supplied label. - /// - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task UpdateSingleApiKeyAsync( - string apiKeyId, - - global::Ideogram.PatchApiKeyRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await UpdateSingleApiKeyAsResponseAsync( - apiKeyId: apiKeyId, - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Update an API key's user-supplied label. - /// - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> UpdateSingleApiKeyAsResponseAsync( - string apiKeyId, - - global::Ideogram.PatchApiKeyRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareUpdateSingleApiKeyArguments( - httpClient: HttpClient, - apiKeyId: ref apiKeyId, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_UpdateSingleApiKeySecurityRequirements, - operationName: "UpdateSingleApiKeyAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: $"/manage/api/api_keys/{apiKeyId}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: new global::System.Net.Http.HttpMethod("PATCH"), - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareUpdateSingleApiKeyRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - apiKeyId: apiKeyId, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "UpdateSingleApiKey", - methodName: "UpdateSingleApiKeyAsync", - pathTemplate: "$\"/manage/api/api_keys/{apiKeyId}\"", - httpMethod: "PATCH", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "UpdateSingleApiKey", - methodName: "UpdateSingleApiKeyAsync", - pathTemplate: "$\"/manage/api/api_keys/{apiKeyId}\"", - httpMethod: "PATCH", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "UpdateSingleApiKey", - methodName: "UpdateSingleApiKeyAsync", - pathTemplate: "$\"/manage/api/api_keys/{apiKeyId}\"", - httpMethod: "PATCH", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessUpdateSingleApiKeyResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "UpdateSingleApiKey", - methodName: "UpdateSingleApiKeyAsync", - pathTemplate: "$\"/manage/api/api_keys/{apiKeyId}\"", - httpMethod: "PATCH", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "UpdateSingleApiKey", - methodName: "UpdateSingleApiKeyAsync", - pathTemplate: "$\"/manage/api/api_keys/{apiKeyId}\"", - httpMethod: "PATCH", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessUpdateSingleApiKeyResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.ApiProfileApiKey.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.ApiProfileApiKey.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Update an API key's user-supplied label. - /// - /// - /// - /// New label for the API key. Pass null (or omit) to clear the existing label.
- /// Example: Live production environment - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task UpdateSingleApiKeyAsync( - string apiKeyId, - string? label = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.PatchApiKeyRequest - { - Label = label, - }; - - return await UpdateSingleApiKeyAsync( - apiKeyId: apiKeyId, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ManageClient.g.cs b/src/libs/Ideogram/Generated/Ideogram.ManageClient.g.cs deleted file mode 100644 index f62aa66f..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ManageClient.g.cs +++ /dev/null @@ -1,144 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Content related to managing API account and API access
- /// If no httpClient is provided, a new one will be created.
- /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. - ///
- public sealed partial class ManageClient : global::Ideogram.IManageClient, global::System.IDisposable - { - /// - /// - /// - public const string DefaultBaseUrl = "https://api.ideogram.ai/"; - - private bool _disposeHttpClient = true; - - /// - public global::System.Net.Http.HttpClient HttpClient { get; } - - /// - public System.Uri? BaseUri => HttpClient.BaseAddress; - - /// - public global::System.Collections.Generic.List Authorizations { get; } - - /// - public bool ReadResponseAsString { get; set; } -#if DEBUG - = true; -#endif - - /// - public global::Ideogram.AutoSDKClientOptions Options { get; } - - internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::Ideogram.ManageSourceGenerationContext.Default); - - /// - /// - /// - public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext - { - get => JsonSerializerContextProvider.Value; - set => JsonSerializerContextProvider = new(() => value); - } - - - /// - /// Creates a new instance of the ManageClient. - /// If no httpClient is provided, a new one will be created. - /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. - /// - /// The HttpClient instance. If not provided, a new one will be created. - /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. - /// The authorizations to use for the requests. - /// Dispose the HttpClient when the instance is disposed. True by default. - public ManageClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - bool disposeHttpClient = true) : this( - httpClient, - baseUri, - authorizations, - options: null, - disposeHttpClient: disposeHttpClient) - { - } - - /// - /// Creates a new instance of the ManageClient with explicit options but no base URL override. - /// Skips passing baseUri so the default base URL from the OpenAPI spec applies. - /// - /// The HttpClient instance. If not provided, a new one will be created. - /// The authorizations to use for the requests. - /// Client-wide request defaults such as headers, query parameters, retries, and timeout. - /// Dispose the HttpClient when the instance is disposed. True by default. - public ManageClient( - global::System.Net.Http.HttpClient? httpClient, - global::System.Collections.Generic.List? authorizations, - global::Ideogram.AutoSDKClientOptions? options, - bool disposeHttpClient = true) : this( - httpClient, - baseUri: null, - authorizations, - options, - disposeHttpClient: disposeHttpClient) - { - } - - /// - /// Creates a new instance of the ManageClient. - /// If no httpClient is provided, a new one will be created. - /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. - /// - /// The HttpClient instance. If not provided, a new one will be created. - /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. - /// The authorizations to use for the requests. - /// Client-wide request defaults such as headers, query parameters, retries, and timeout. - /// Dispose the HttpClient when the instance is disposed. True by default. - public ManageClient( - global::System.Net.Http.HttpClient? httpClient, - global::System.Uri? baseUri, - global::System.Collections.Generic.List? authorizations, - global::Ideogram.AutoSDKClientOptions? options, - bool disposeHttpClient = true) - { - - HttpClient = httpClient ?? new global::System.Net.Http.HttpClient(); - HttpClient.BaseAddress ??= baseUri ?? new global::System.Uri(DefaultBaseUrl); - Authorizations = authorizations ?? new global::System.Collections.Generic.List(); - Options = options ?? new global::Ideogram.AutoSDKClientOptions(); - _disposeHttpClient = disposeHttpClient; - - Initialized(HttpClient); - } - - /// - public void Dispose() - { - if (_disposeHttpClient) - { - HttpClient.Dispose(); - } - } - - partial void Initialized( - global::System.Net.Http.HttpClient client); - partial void PrepareArguments( - global::System.Net.Http.HttpClient client); - partial void PrepareRequest( - global::System.Net.Http.HttpClient client, - global::System.Net.Http.HttpRequestMessage request); - partial void ProcessResponse( - global::System.Net.Http.HttpClient client, - global::System.Net.Http.HttpResponseMessage response); - partial void ProcessResponseContent( - global::System.Net.Http.HttpClient client, - global::System.Net.Http.HttpResponseMessage response, - ref string content); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.MiniApps.JsonSerializerContext.g.cs b/src/libs/Ideogram/Generated/Ideogram.MiniApps.JsonSerializerContext.g.cs deleted file mode 100644 index 8d936d16..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.MiniApps.JsonSerializerContext.g.cs +++ /dev/null @@ -1,204 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull - )] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PublishMiniAppResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PublishMiniAppRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PublishMiniAppRequestEmbed), TypeInfoPropertyName = "PublishMiniAppRequestEmbed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MiniAppArtwork))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PublishMiniAppPreviewResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PublishMiniAppPreviewRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PublishMiniAppPreviewRequestEmbed), TypeInfoPropertyName = "PublishMiniAppPreviewRequestEmbed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UnpublishMiniAppPreviewResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GetStaleMiniAppPreviewsResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MiniAppMarketingProjectionEntry))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MiniAppMarketingProjectionEntryEmbed), TypeInfoPropertyName = "MiniAppMarketingProjectionEntryEmbed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PublishMiniAppRequestEmbed?), TypeInfoPropertyName = "NullablePublishMiniAppRequestEmbed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.PublishMiniAppPreviewRequestEmbed?), TypeInfoPropertyName = "NullablePublishMiniAppPreviewRequestEmbed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MiniAppMarketingProjectionEntryEmbed?), TypeInfoPropertyName = "NullableMiniAppMarketingProjectionEntryEmbed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - internal sealed partial class MiniAppsSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext - { - } - /// - /// - /// - public sealed partial class MiniAppsSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext - { - private static readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver Resolver = new LazyChunkResolver(); - - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - internal static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver TypeInfoResolver => Resolver; - - - private static readonly global::System.Text.Json.JsonSerializerOptions DefaultOptions = CreateDefaultOptions(); - - /// - /// - /// - public static MiniAppsSourceGenerationContext Default { get; } = new(DefaultOptions); - - private MiniAppsSourceGenerationContext(global::System.Text.Json.JsonSerializerOptions options) - : base(options) - { - } - - /// - protected override global::System.Text.Json.JsonSerializerOptions? GeneratedSerializerOptions => DefaultOptions; - - /// - public override global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo(global::System.Type type) - { - return Resolver.GetTypeInfo(type, Options); - } - - /// - /// Adds this package's converters to . - /// - /// - /// A converter has to be on the options a chained resolver builds its JsonTypeInfo against, - /// and a context resolves types from every package below it. Each package contributes only - /// what it owns and calls down the chain for the rest, so the family's converter table is - /// written once rather than copied into all of them. - /// - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) - { - options.Converters.Add(new global::Ideogram.JsonConverters.UnixTimestampJsonConverter()); - options.Converters.Add(new LazyEnumJsonConverterFactory()); - } - - private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() - { - var options = new global::System.Text.Json.JsonSerializerOptions - { - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, - TypeInfoResolver = Resolver, - }; - AddConverters(options); - - return options; - } - - - private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory - { - public override bool CanConvert(global::System.Type typeToConvert) - { - return - typeToConvert == typeof(global::Ideogram.PublishMiniAppRequestEmbed) - - || typeToConvert == typeof(global::Ideogram.PublishMiniAppRequestEmbed?) - - || typeToConvert == typeof(global::Ideogram.PublishMiniAppPreviewRequestEmbed) - - || typeToConvert == typeof(global::Ideogram.PublishMiniAppPreviewRequestEmbed?) - - || typeToConvert == typeof(global::Ideogram.MiniAppMarketingProjectionEntryEmbed) - - || typeToConvert == typeof(global::Ideogram.MiniAppMarketingProjectionEntryEmbed?); - } - - public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - if (typeToConvert == typeof(global::Ideogram.PublishMiniAppRequestEmbed)) - { - return new global::Ideogram.JsonConverters.PublishMiniAppRequestEmbedJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.PublishMiniAppRequestEmbed?)) - { - return new global::Ideogram.JsonConverters.PublishMiniAppRequestEmbedNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.PublishMiniAppPreviewRequestEmbed)) - { - return new global::Ideogram.JsonConverters.PublishMiniAppPreviewRequestEmbedJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.PublishMiniAppPreviewRequestEmbed?)) - { - return new global::Ideogram.JsonConverters.PublishMiniAppPreviewRequestEmbedNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.MiniAppMarketingProjectionEntryEmbed)) - { - return new global::Ideogram.JsonConverters.MiniAppMarketingProjectionEntryEmbedJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.MiniAppMarketingProjectionEntryEmbed?)) - { - return new global::Ideogram.JsonConverters.MiniAppMarketingProjectionEntryEmbedNullableJsonConverter(); - } - throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); - } - } - - private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver - { - private readonly object _gate = new(); - private readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[] _resolvers = new global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[1]; - - public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo( - global::System.Type type, - global::System.Text.Json.JsonSerializerOptions options) - { - for (var index = 0; index < _resolvers.Length; index++) - { - var typeInfo = GetResolver(index).GetTypeInfo(type, options); - if (typeInfo is not null) - { - return typeInfo; - } - } - - return null; - } - - private global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver GetResolver(int index) - { - var resolver = global::System.Threading.Volatile.Read(ref _resolvers[index]); - if (resolver is not null) - { - return resolver; - } - - lock (_gate) - { - return _resolvers[index] ??= CreateResolver(index); - } - } - - private static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver CreateResolver(int index) - { - return index switch - { - 0 => new MiniAppsSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), - _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), - }; - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.MiniAppsClient.Authorizations.Bearer.g.cs b/src/libs/Ideogram/Generated/Ideogram.MiniAppsClient.Authorizations.Bearer.g.cs deleted file mode 100644 index ad5a28d4..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.MiniAppsClient.Authorizations.Bearer.g.cs +++ /dev/null @@ -1,35 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public sealed partial class MiniAppsClient - { - - /// - public void AuthorizeUsingBearer( - string apiKey) - { - apiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey)); - - for (var i = Authorizations.Count - 1; i >= 0; i--) - { - var __authorization = Authorizations[i]; - if (__authorization.Type == "Http" && - __authorization.Name == "Bearer") - { - Authorizations.RemoveAt(i); - } - } - - Authorizations.Add(new global::Ideogram.EndPointAuthorization - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - Value = apiKey, - }); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.MiniAppsClient.Constructors.Bearer.g.cs b/src/libs/Ideogram/Generated/Ideogram.MiniAppsClient.Constructors.Bearer.g.cs deleted file mode 100644 index 90cfad3c..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.MiniAppsClient.Constructors.Bearer.g.cs +++ /dev/null @@ -1,31 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public sealed partial class MiniAppsClient - { - /// - - public MiniAppsClient( - string apiKey, - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - bool disposeHttpClient = true) : this(httpClient, baseUri, authorizations, disposeHttpClient) - { - Authorizing(HttpClient, ref apiKey); - - AuthorizeUsingBearer(apiKey); - - Authorized(HttpClient); - } - - partial void Authorizing( - global::System.Net.Http.HttpClient client, - ref string apiKey); - partial void Authorized( - global::System.Net.Http.HttpClient client); - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.MiniAppsClient.GetMiniAppMarketingProjection.g.cs b/src/libs/Ideogram/Generated/Ideogram.MiniAppsClient.GetMiniAppMarketingProjection.g.cs deleted file mode 100644 index 5287b2e1..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.MiniAppsClient.GetMiniAppMarketingProjection.g.cs +++ /dev/null @@ -1,513 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class MiniAppsClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_GetMiniAppMarketingProjectionSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_GetMiniAppMarketingProjectionSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_GetMiniAppMarketingProjectionSecurityRequirement0, - }; - partial void PrepareGetMiniAppMarketingProjectionArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareGetMiniAppMarketingProjectionRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessGetMiniAppMarketingProjectionResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessGetMiniAppMarketingProjectionResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Get the public mini-app marketing projection
- /// Returns the public-safe mini-app metadata used to build marketing pages. The response includes only active marketing entries that have website metadata and can be published unchanged as the marketing registry. - ///
- /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> GetMiniAppMarketingProjectionAsync( - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await GetMiniAppMarketingProjectionAsResponseAsync( - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Get the public mini-app marketing projection
- /// Returns the public-safe mini-app metadata used to build marketing pages. The response includes only active marketing entries that have website metadata and can be published unchanged as the marketing registry. - ///
- /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task>> GetMiniAppMarketingProjectionAsResponseAsync( - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareGetMiniAppMarketingProjectionArguments( - httpClient: HttpClient); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_GetMiniAppMarketingProjectionSecurityRequirements, - operationName: "GetMiniAppMarketingProjectionAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/mini-apps/marketing-projection", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetMiniAppMarketingProjectionRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetMiniAppMarketingProjection", - methodName: "GetMiniAppMarketingProjectionAsync", - pathTemplate: "\"/mini-apps/marketing-projection\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetMiniAppMarketingProjection", - methodName: "GetMiniAppMarketingProjectionAsync", - pathTemplate: "\"/mini-apps/marketing-projection\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetMiniAppMarketingProjection", - methodName: "GetMiniAppMarketingProjectionAsync", - pathTemplate: "\"/mini-apps/marketing-projection\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetMiniAppMarketingProjectionResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetMiniAppMarketingProjection", - methodName: "GetMiniAppMarketingProjectionAsync", - pathTemplate: "\"/mini-apps/marketing-projection\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetMiniAppMarketingProjection", - methodName: "GetMiniAppMarketingProjectionAsync", - pathTemplate: "\"/mini-apps/marketing-projection\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetMiniAppMarketingProjectionResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse>( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse>( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.MiniAppsClient.GetStalePreviewMiniApps.g.cs b/src/libs/Ideogram/Generated/Ideogram.MiniAppsClient.GetStalePreviewMiniApps.g.cs deleted file mode 100644 index fce32e2e..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.MiniAppsClient.GetStalePreviewMiniApps.g.cs +++ /dev/null @@ -1,557 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class MiniAppsClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_GetStalePreviewMiniAppsSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_GetStalePreviewMiniAppsSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_GetStalePreviewMiniAppsSecurityRequirement0, - }; - partial void PrepareGetStalePreviewMiniAppsArguments( - global::System.Net.Http.HttpClient httpClient, - ref global::System.DateTime cutoff); - partial void PrepareGetStalePreviewMiniAppsRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::System.DateTime cutoff); - partial void ProcessGetStalePreviewMiniAppsResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessGetStalePreviewMiniAppsResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Get stale mini-app preview entries
- /// Returns preview ids whose most recent successful publish is older than the cutoff. This read-only endpoint does not delete preview entries. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task GetStalePreviewMiniAppsAsync( - global::System.DateTime cutoff, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await GetStalePreviewMiniAppsAsResponseAsync( - cutoff: cutoff, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Get stale mini-app preview entries
- /// Returns preview ids whose most recent successful publish is older than the cutoff. This read-only endpoint does not delete preview entries. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> GetStalePreviewMiniAppsAsResponseAsync( - global::System.DateTime cutoff, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareGetStalePreviewMiniAppsArguments( - httpClient: HttpClient, - cutoff: ref cutoff); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_GetStalePreviewMiniAppsSecurityRequirements, - operationName: "GetStalePreviewMiniAppsAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/mini-apps/stale-previews", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("cutoff", cutoff.ToString("yyyy-MM-ddTHH:mm:ssZ")) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetStalePreviewMiniAppsRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - cutoff: cutoff); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetStalePreviewMiniApps", - methodName: "GetStalePreviewMiniAppsAsync", - pathTemplate: "\"/mini-apps/stale-previews\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetStalePreviewMiniApps", - methodName: "GetStalePreviewMiniAppsAsync", - pathTemplate: "\"/mini-apps/stale-previews\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetStalePreviewMiniApps", - methodName: "GetStalePreviewMiniAppsAsync", - pathTemplate: "\"/mini-apps/stale-previews\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetStalePreviewMiniAppsResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetStalePreviewMiniApps", - methodName: "GetStalePreviewMiniAppsAsync", - pathTemplate: "\"/mini-apps/stale-previews\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetStalePreviewMiniApps", - methodName: "GetStalePreviewMiniAppsAsync", - pathTemplate: "\"/mini-apps/stale-previews\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetStalePreviewMiniAppsResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.GetStaleMiniAppPreviewsResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.GetStaleMiniAppPreviewsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.MiniAppsClient.PublishMiniApp.g.cs b/src/libs/Ideogram/Generated/Ideogram.MiniAppsClient.PublishMiniApp.g.cs deleted file mode 100644 index 1e28d8e8..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.MiniAppsClient.PublishMiniApp.g.cs +++ /dev/null @@ -1,635 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class MiniAppsClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PublishMiniAppSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PublishMiniAppSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PublishMiniAppSecurityRequirement0, - }; - partial void PreparePublishMiniAppArguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.PublishMiniAppRequest request); - partial void PreparePublishMiniAppRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.PublishMiniAppRequest request); - partial void ProcessPublishMiniAppResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPublishMiniAppResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Publish a mini-app catalog entry
- /// Publishes a mini-app's catalog entry. Called by the mini-apps deploy pipeline after a deploy to register or refresh a single app, keyed by its unique slug. Re-publishing an existing app refreshes the deploy-managed fields (label, description, embed mode, scopes, image-input support, deployment details, and website) while leaving administrator-managed settings and artwork untouched. Artwork from the request is used only when creating a new app. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PublishMiniAppAsync( - - global::Ideogram.PublishMiniAppRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PublishMiniAppAsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Publish a mini-app catalog entry
- /// Publishes a mini-app's catalog entry. Called by the mini-apps deploy pipeline after a deploy to register or refresh a single app, keyed by its unique slug. Re-publishing an existing app refreshes the deploy-managed fields (label, description, embed mode, scopes, image-input support, deployment details, and website) while leaving administrator-managed settings and artwork untouched. Artwork from the request is used only when creating a new app. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PublishMiniAppAsResponseAsync( - - global::Ideogram.PublishMiniAppRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePublishMiniAppArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PublishMiniAppSecurityRequirements, - operationName: "PublishMiniAppAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/mini-apps/publish", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePublishMiniAppRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PublishMiniApp", - methodName: "PublishMiniAppAsync", - pathTemplate: "\"/mini-apps/publish\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PublishMiniApp", - methodName: "PublishMiniAppAsync", - pathTemplate: "\"/mini-apps/publish\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PublishMiniApp", - methodName: "PublishMiniAppAsync", - pathTemplate: "\"/mini-apps/publish\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPublishMiniAppResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PublishMiniApp", - methodName: "PublishMiniAppAsync", - pathTemplate: "\"/mini-apps/publish\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PublishMiniApp", - methodName: "PublishMiniAppAsync", - pathTemplate: "\"/mini-apps/publish\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPublishMiniAppResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.PublishMiniAppResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.PublishMiniAppResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Publish a mini-app catalog entry
- /// Publishes a mini-app's catalog entry. Called by the mini-apps deploy pipeline after a deploy to register or refresh a single app, keyed by its unique slug. Re-publishing an existing app refreshes the deploy-managed fields (label, description, embed mode, scopes, image-input support, deployment details, and website) while leaving administrator-managed settings and artwork untouched. Artwork from the request is used only when creating a new app. - ///
- /// - /// Unique, stable, URL-safe mini-app identifier. - /// - /// - /// Human-readable display name shown in the catalog. - /// - /// - /// Short description of what the mini-app does. - /// - /// - /// How the mini-app is embedded. `iframe` loads the app in a sandboxed frame. - /// - /// - /// Permission scopes the mini-app requests. - /// - /// - /// Optional on publish. Whether the app can receive an existing image as its initial input. Omit this field to preserve the current value when re-publishing an existing app; new apps default to false. Catalog responses always include the resolved boolean. - /// - /// - /// Absolute HTTPS URL where the deployed mini-app is served from. - /// - /// - /// Source commit hash of the deployed build. - /// - /// - /// When the deployment that produced this build completed. - /// - /// - /// Structured website metadata for the mini-app. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PublishMiniAppAsync( - string slug, - string label, - global::System.Collections.Generic.IList scopes, - string? description = default, - global::Ideogram.PublishMiniAppRequestEmbed embed = default, - bool? acceptsImageInput = default, - string? deploymentUrl = default, - string? deploymentCommit = default, - global::System.DateTime? deploymentTime = default, - object? website = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.PublishMiniAppRequest - { - Slug = slug, - Label = label, - Description = description, - Embed = embed, - Scopes = scopes, - AcceptsImageInput = acceptsImageInput, - DeploymentUrl = deploymentUrl, - DeploymentCommit = deploymentCommit, - DeploymentTime = deploymentTime, - Website = website, - }; - - return await PublishMiniAppAsync( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.MiniAppsClient.PublishPreviewMiniApp.g.cs b/src/libs/Ideogram/Generated/Ideogram.MiniAppsClient.PublishPreviewMiniApp.g.cs deleted file mode 100644 index 89289c30..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.MiniAppsClient.PublishPreviewMiniApp.g.cs +++ /dev/null @@ -1,640 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class MiniAppsClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PublishPreviewMiniAppSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PublishPreviewMiniAppSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PublishPreviewMiniAppSecurityRequirement0, - }; - partial void PreparePublishPreviewMiniAppArguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.PublishMiniAppPreviewRequest request); - partial void PreparePublishPreviewMiniAppRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.PublishMiniAppPreviewRequest request); - partial void ProcessPublishPreviewMiniAppResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPublishPreviewMiniAppResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Publish a mini-app preview entry
- /// Publishes a mini-app preview entry. Called by the mini-apps preview deploy pipeline to register a throwaway preview deploy, keyed by its unique preview id. Re-publishing an existing preview id refreshes every deploy-managed field. Preview entries are independent from the main catalog: they carry no slug, owner, or membership gating, and anyone with the preview link can access the app. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PublishPreviewMiniAppAsync( - - global::Ideogram.PublishMiniAppPreviewRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PublishPreviewMiniAppAsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Publish a mini-app preview entry
- /// Publishes a mini-app preview entry. Called by the mini-apps preview deploy pipeline to register a throwaway preview deploy, keyed by its unique preview id. Re-publishing an existing preview id refreshes every deploy-managed field. Preview entries are independent from the main catalog: they carry no slug, owner, or membership gating, and anyone with the preview link can access the app. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PublishPreviewMiniAppAsResponseAsync( - - global::Ideogram.PublishMiniAppPreviewRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePublishPreviewMiniAppArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PublishPreviewMiniAppSecurityRequirements, - operationName: "PublishPreviewMiniAppAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/mini-apps/publish-preview", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePublishPreviewMiniAppRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PublishPreviewMiniApp", - methodName: "PublishPreviewMiniAppAsync", - pathTemplate: "\"/mini-apps/publish-preview\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PublishPreviewMiniApp", - methodName: "PublishPreviewMiniAppAsync", - pathTemplate: "\"/mini-apps/publish-preview\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PublishPreviewMiniApp", - methodName: "PublishPreviewMiniAppAsync", - pathTemplate: "\"/mini-apps/publish-preview\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPublishPreviewMiniAppResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PublishPreviewMiniApp", - methodName: "PublishPreviewMiniAppAsync", - pathTemplate: "\"/mini-apps/publish-preview\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PublishPreviewMiniApp", - methodName: "PublishPreviewMiniAppAsync", - pathTemplate: "\"/mini-apps/publish-preview\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPublishPreviewMiniAppResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.PublishMiniAppPreviewResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.PublishMiniAppPreviewResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Publish a mini-app preview entry
- /// Publishes a mini-app preview entry. Called by the mini-apps preview deploy pipeline to register a throwaway preview deploy, keyed by its unique preview id. Re-publishing an existing preview id refreshes every deploy-managed field. Preview entries are independent from the main catalog: they carry no slug, owner, or membership gating, and anyone with the preview link can access the app. - ///
- /// - /// Unique, URL-safe preview identifier composed by the deploy pipeline. - /// - /// - /// Unique, stable, URL-safe mini-app identifier. - /// - /// - /// Human-readable display name shown for the preview. - /// - /// - /// Short description of what the mini-app does. - /// - /// - /// How the mini-app is embedded. `iframe` loads the app in a sandboxed frame. - /// - /// - /// Permission scopes the mini-app preview requests. - /// - /// - /// Optional on publish. Whether the app can receive an existing image as its initial input. Omit this field to preserve the current value when re-publishing an existing preview; new previews default to false. - /// - /// - /// URL where the preview mini-app is served. Must be an `https://*.run.app` Cloud Run URL. - /// - /// - /// Source commit hash of the deployed build. - /// - /// - /// When the deployment that produced this build completed. - /// - /// - /// Structured website metadata for the mini-app. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PublishPreviewMiniAppAsync( - string previewId, - string label, - global::System.Collections.Generic.IList scopes, - string deploymentUrl, - string? slug = default, - string? description = default, - global::Ideogram.PublishMiniAppPreviewRequestEmbed embed = default, - bool? acceptsImageInput = default, - string? deploymentCommit = default, - global::System.DateTime? deploymentTime = default, - object? website = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.PublishMiniAppPreviewRequest - { - PreviewId = previewId, - Slug = slug, - Label = label, - Description = description, - Embed = embed, - Scopes = scopes, - AcceptsImageInput = acceptsImageInput, - DeploymentUrl = deploymentUrl, - DeploymentCommit = deploymentCommit, - DeploymentTime = deploymentTime, - Website = website, - }; - - return await PublishPreviewMiniAppAsync( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.MiniAppsClient.UnpublishMiniApp.g.cs b/src/libs/Ideogram/Generated/Ideogram.MiniAppsClient.UnpublishMiniApp.g.cs deleted file mode 100644 index 51844850..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.MiniAppsClient.UnpublishMiniApp.g.cs +++ /dev/null @@ -1,535 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class MiniAppsClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_UnpublishMiniAppSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_UnpublishMiniAppSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_UnpublishMiniAppSecurityRequirement0, - }; - partial void PrepareUnpublishMiniAppArguments( - global::System.Net.Http.HttpClient httpClient, - ref string slug); - partial void PrepareUnpublishMiniAppRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string slug); - partial void ProcessUnpublishMiniAppResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - /// - /// Unpublish a mini-app catalog entry
- /// Archives a mini-app by slug while preserving its deployment details and administrator-managed settings. Publishing the same slug again does not reactivate it; only an administrator can restore an archived app. - ///
- /// - /// Unique, stable, URL-safe mini-app identifier. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task UnpublishMiniAppAsync( - string slug, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - await UnpublishMiniAppAsResponseAsync( - slug: slug, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - } - /// - /// Unpublish a mini-app catalog entry
- /// Archives a mini-app by slug while preserving its deployment details and administrator-managed settings. Publishing the same slug again does not reactivate it; only an administrator can restore an archived app. - ///
- /// - /// Unique, stable, URL-safe mini-app identifier. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task UnpublishMiniAppAsResponseAsync( - string slug, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareUnpublishMiniAppArguments( - httpClient: HttpClient, - slug: ref slug); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_UnpublishMiniAppSecurityRequirements, - operationName: "UnpublishMiniAppAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: $"/mini-apps/unpublish/{slug}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareUnpublishMiniAppRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - slug: slug); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "UnpublishMiniApp", - methodName: "UnpublishMiniAppAsync", - pathTemplate: "$\"/mini-apps/unpublish/{slug}\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "UnpublishMiniApp", - methodName: "UnpublishMiniAppAsync", - pathTemplate: "$\"/mini-apps/unpublish/{slug}\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "UnpublishMiniApp", - methodName: "UnpublishMiniAppAsync", - pathTemplate: "$\"/mini-apps/unpublish/{slug}\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessUnpublishMiniAppResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "UnpublishMiniApp", - methodName: "UnpublishMiniAppAsync", - pathTemplate: "$\"/mini-apps/unpublish/{slug}\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "UnpublishMiniApp", - methodName: "UnpublishMiniAppAsync", - pathTemplate: "$\"/mini-apps/unpublish/{slug}\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.MiniAppsClient.UnpublishPreviewMiniApp.g.cs b/src/libs/Ideogram/Generated/Ideogram.MiniAppsClient.UnpublishPreviewMiniApp.g.cs deleted file mode 100644 index 75e93d43..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.MiniAppsClient.UnpublishPreviewMiniApp.g.cs +++ /dev/null @@ -1,526 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class MiniAppsClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_UnpublishPreviewMiniAppSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_UnpublishPreviewMiniAppSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_UnpublishPreviewMiniAppSecurityRequirement0, - }; - partial void PrepareUnpublishPreviewMiniAppArguments( - global::System.Net.Http.HttpClient httpClient, - ref string previewId); - partial void PrepareUnpublishPreviewMiniAppRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string previewId); - partial void ProcessUnpublishPreviewMiniAppResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessUnpublishPreviewMiniAppResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Unpublish a mini-app preview entry
- /// Deletes a mini-app preview entry by its preview id. Repeated requests succeed when the entry is already absent, so preview teardown can retry safely. - ///
- /// - /// Unique, URL-safe preview identifier composed by the deploy pipeline. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task UnpublishPreviewMiniAppAsync( - string previewId, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await UnpublishPreviewMiniAppAsResponseAsync( - previewId: previewId, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Unpublish a mini-app preview entry
- /// Deletes a mini-app preview entry by its preview id. Repeated requests succeed when the entry is already absent, so preview teardown can retry safely. - ///
- /// - /// Unique, URL-safe preview identifier composed by the deploy pipeline. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> UnpublishPreviewMiniAppAsResponseAsync( - string previewId, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareUnpublishPreviewMiniAppArguments( - httpClient: HttpClient, - previewId: ref previewId); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_UnpublishPreviewMiniAppSecurityRequirements, - operationName: "UnpublishPreviewMiniAppAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: $"/mini-apps/unpublish-preview/{previewId}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareUnpublishPreviewMiniAppRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - previewId: previewId); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "UnpublishPreviewMiniApp", - methodName: "UnpublishPreviewMiniAppAsync", - pathTemplate: "$\"/mini-apps/unpublish-preview/{previewId}\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "UnpublishPreviewMiniApp", - methodName: "UnpublishPreviewMiniAppAsync", - pathTemplate: "$\"/mini-apps/unpublish-preview/{previewId}\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "UnpublishPreviewMiniApp", - methodName: "UnpublishPreviewMiniAppAsync", - pathTemplate: "$\"/mini-apps/unpublish-preview/{previewId}\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessUnpublishPreviewMiniAppResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "UnpublishPreviewMiniApp", - methodName: "UnpublishPreviewMiniAppAsync", - pathTemplate: "$\"/mini-apps/unpublish-preview/{previewId}\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "UnpublishPreviewMiniApp", - methodName: "UnpublishPreviewMiniAppAsync", - pathTemplate: "$\"/mini-apps/unpublish-preview/{previewId}\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessUnpublishPreviewMiniAppResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.UnpublishMiniAppPreviewResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.UnpublishMiniAppPreviewResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.MiniAppsClient.g.cs b/src/libs/Ideogram/Generated/Ideogram.MiniAppsClient.g.cs deleted file mode 100644 index 30c8c0a3..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.MiniAppsClient.g.cs +++ /dev/null @@ -1,144 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Operations related to publishing mini-apps into the catalog.
- /// If no httpClient is provided, a new one will be created.
- /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. - ///
- public sealed partial class MiniAppsClient : global::Ideogram.IMiniAppsClient, global::System.IDisposable - { - /// - /// - /// - public const string DefaultBaseUrl = "https://api.ideogram.ai/"; - - private bool _disposeHttpClient = true; - - /// - public global::System.Net.Http.HttpClient HttpClient { get; } - - /// - public System.Uri? BaseUri => HttpClient.BaseAddress; - - /// - public global::System.Collections.Generic.List Authorizations { get; } - - /// - public bool ReadResponseAsString { get; set; } -#if DEBUG - = true; -#endif - - /// - public global::Ideogram.AutoSDKClientOptions Options { get; } - - internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::Ideogram.MiniAppsSourceGenerationContext.Default); - - /// - /// - /// - public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext - { - get => JsonSerializerContextProvider.Value; - set => JsonSerializerContextProvider = new(() => value); - } - - - /// - /// Creates a new instance of the MiniAppsClient. - /// If no httpClient is provided, a new one will be created. - /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. - /// - /// The HttpClient instance. If not provided, a new one will be created. - /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. - /// The authorizations to use for the requests. - /// Dispose the HttpClient when the instance is disposed. True by default. - public MiniAppsClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - bool disposeHttpClient = true) : this( - httpClient, - baseUri, - authorizations, - options: null, - disposeHttpClient: disposeHttpClient) - { - } - - /// - /// Creates a new instance of the MiniAppsClient with explicit options but no base URL override. - /// Skips passing baseUri so the default base URL from the OpenAPI spec applies. - /// - /// The HttpClient instance. If not provided, a new one will be created. - /// The authorizations to use for the requests. - /// Client-wide request defaults such as headers, query parameters, retries, and timeout. - /// Dispose the HttpClient when the instance is disposed. True by default. - public MiniAppsClient( - global::System.Net.Http.HttpClient? httpClient, - global::System.Collections.Generic.List? authorizations, - global::Ideogram.AutoSDKClientOptions? options, - bool disposeHttpClient = true) : this( - httpClient, - baseUri: null, - authorizations, - options, - disposeHttpClient: disposeHttpClient) - { - } - - /// - /// Creates a new instance of the MiniAppsClient. - /// If no httpClient is provided, a new one will be created. - /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. - /// - /// The HttpClient instance. If not provided, a new one will be created. - /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. - /// The authorizations to use for the requests. - /// Client-wide request defaults such as headers, query parameters, retries, and timeout. - /// Dispose the HttpClient when the instance is disposed. True by default. - public MiniAppsClient( - global::System.Net.Http.HttpClient? httpClient, - global::System.Uri? baseUri, - global::System.Collections.Generic.List? authorizations, - global::Ideogram.AutoSDKClientOptions? options, - bool disposeHttpClient = true) - { - - HttpClient = httpClient ?? new global::System.Net.Http.HttpClient(); - HttpClient.BaseAddress ??= baseUri ?? new global::System.Uri(DefaultBaseUrl); - Authorizations = authorizations ?? new global::System.Collections.Generic.List(); - Options = options ?? new global::Ideogram.AutoSDKClientOptions(); - _disposeHttpClient = disposeHttpClient; - - Initialized(HttpClient); - } - - /// - public void Dispose() - { - if (_disposeHttpClient) - { - HttpClient.Dispose(); - } - } - - partial void Initialized( - global::System.Net.Http.HttpClient client); - partial void PrepareArguments( - global::System.Net.Http.HttpClient client); - partial void PrepareRequest( - global::System.Net.Http.HttpClient client, - global::System.Net.Http.HttpRequestMessage request); - partial void ProcessResponse( - global::System.Net.Http.HttpClient client, - global::System.Net.Http.HttpResponseMessage response); - partial void ProcessResponseContent( - global::System.Net.Http.HttpClient client, - global::System.Net.Http.HttpResponseMessage response, - ref string content); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AccountApiKey.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AccountApiKey.g.cs index 2929a634..8c7ecef1 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.AccountApiKey.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.AccountApiKey.g.cs @@ -4,24 +4,20 @@ namespace Ideogram { /// - /// Example: {"creation_time":"2000-01-23T04:56:07\u002B00:00","label":"Live production environment","redacted_api_key":"ATG56\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022","api_key_id":"JRPVD7jWR1aTBYiJ0UFVOg","creator_display_label":"John Doe","status":null} + /// /// public sealed partial class AccountApiKey { /// - /// Base64 encoded API key ID
- /// Example: JRPVD7jWR1aTBYiJ0UFVOg + /// Base64 encoded API key ID ///
- /// JRPVD7jWR1aTBYiJ0UFVOg [global::System.Text.Json.Serialization.JsonPropertyName("api_key_id")] [global::System.Text.Json.Serialization.JsonRequired] public required string ApiKeyId { get; set; } /// - /// A redacted text snippet of the API key. Contains the first 4 characters of the API key
- /// Example: ATG56••••••••••••• + /// A redacted text snippet of the API key. Contains the first 4 characters of the API key ///
- /// ATG56••••••••••••• [global::System.Text.Json.Serialization.JsonPropertyName("redacted_api_key")] [global::System.Text.Json.Serialization.JsonRequired] public required string RedactedApiKey { get; set; } @@ -42,18 +38,14 @@ public sealed partial class AccountApiKey public required global::Ideogram.AccountApiKeyStatus Status { get; set; } /// - /// An optional user-supplied label for managing the API key
- /// Example: Live production environment + /// An optional user-supplied label for managing the API key ///
- /// Live production environment [global::System.Text.Json.Serialization.JsonPropertyName("label")] public string? Label { get; set; } /// - /// Name of the member who created the key, falling back to their display handle when no name is set. Null on keys created before creators were recorded, and on workspace types whose keys are shared rather than owned by one member.
- /// Example: John Doe + /// Name of the member who created the key, falling back to their display handle when no name is set. Null on keys created before creators were recorded, and on workspace types whose keys are shared rather than owned by one member. ///
- /// John Doe [global::System.Text.Json.Serialization.JsonPropertyName("creator_display_label")] public string? CreatorDisplayLabel { get; set; } @@ -67,24 +59,20 @@ public sealed partial class AccountApiKey /// Initializes a new instance of the class. /// /// - /// Base64 encoded API key ID
- /// Example: JRPVD7jWR1aTBYiJ0UFVOg + /// Base64 encoded API key ID /// /// - /// A redacted text snippet of the API key. Contains the first 4 characters of the API key
- /// Example: ATG56••••••••••••• + /// A redacted text snippet of the API key. Contains the first 4 characters of the API key /// /// /// The date at which the API key was created /// /// /// - /// An optional user-supplied label for managing the API key
- /// Example: Live production environment + /// An optional user-supplied label for managing the API key /// /// - /// Name of the member who created the key, falling back to their display handle when no name is set. Null on keys created before creators were recorded, and on workspace types whose keys are shared rather than owned by one member.
- /// Example: John Doe + /// Name of the member who created the key, falling back to their display handle when no name is set. Null on keys created before creators were recorded, and on workspace types whose keys are shared rather than owned by one member. /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AccountGetAccountApiKeysResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AccountGetAccountApiKeysResponse.Json.g.cs new file mode 100644 index 00000000..1b52a7e4 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.AccountGetAccountApiKeysResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class AccountGetAccountApiKeysResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.AccountGetAccountApiKeysResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.AccountGetAccountApiKeysResponse), + jsonSerializerContext) as global::Ideogram.AccountGetAccountApiKeysResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.AccountGetAccountApiKeysResponse? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.AccountGetAccountApiKeysResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.AccountGetAccountApiKeysResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.AccountGetAccountApiKeysResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AccountGetAccountApiKeysResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AccountGetAccountApiKeysResponse.g.cs new file mode 100644 index 00000000..106595d7 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.AccountGetAccountApiKeysResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class AccountGetAccountApiKeysResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AccountGetAccountApiKeysResponse2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AccountGetAccountApiKeysResponse2.Json.g.cs new file mode 100644 index 00000000..e8b1f373 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.AccountGetAccountApiKeysResponse2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class AccountGetAccountApiKeysResponse2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.AccountGetAccountApiKeysResponse2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.AccountGetAccountApiKeysResponse2), + jsonSerializerContext) as global::Ideogram.AccountGetAccountApiKeysResponse2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.AccountGetAccountApiKeysResponse2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.AccountGetAccountApiKeysResponse2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.AccountGetAccountApiKeysResponse2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.AccountGetAccountApiKeysResponse2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AccountGetAccountApiKeysResponse2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AccountGetAccountApiKeysResponse2.g.cs new file mode 100644 index 00000000..eb045829 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.AccountGetAccountApiKeysResponse2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class AccountGetAccountApiKeysResponse2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AccountGetAccountInvoicesResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AccountGetAccountInvoicesResponse.Json.g.cs new file mode 100644 index 00000000..1806ebfd --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.AccountGetAccountInvoicesResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class AccountGetAccountInvoicesResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.AccountGetAccountInvoicesResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.AccountGetAccountInvoicesResponse), + jsonSerializerContext) as global::Ideogram.AccountGetAccountInvoicesResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.AccountGetAccountInvoicesResponse? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.AccountGetAccountInvoicesResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.AccountGetAccountInvoicesResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.AccountGetAccountInvoicesResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AccountGetAccountInvoicesResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AccountGetAccountInvoicesResponse.g.cs new file mode 100644 index 00000000..a55957e8 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.AccountGetAccountInvoicesResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class AccountGetAccountInvoicesResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AccountGetAccountInvoicesResponse2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AccountGetAccountInvoicesResponse2.Json.g.cs new file mode 100644 index 00000000..c11124b8 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.AccountGetAccountInvoicesResponse2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class AccountGetAccountInvoicesResponse2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.AccountGetAccountInvoicesResponse2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.AccountGetAccountInvoicesResponse2), + jsonSerializerContext) as global::Ideogram.AccountGetAccountInvoicesResponse2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.AccountGetAccountInvoicesResponse2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.AccountGetAccountInvoicesResponse2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.AccountGetAccountInvoicesResponse2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.AccountGetAccountInvoicesResponse2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AccountGetAccountInvoicesResponse2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AccountGetAccountInvoicesResponse2.g.cs new file mode 100644 index 00000000..23773d89 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.AccountGetAccountInvoicesResponse2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class AccountGetAccountInvoicesResponse2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AccountGetAccountUsageResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AccountGetAccountUsageResponse.Json.g.cs new file mode 100644 index 00000000..dbdbaaeb --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.AccountGetAccountUsageResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class AccountGetAccountUsageResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.AccountGetAccountUsageResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.AccountGetAccountUsageResponse), + jsonSerializerContext) as global::Ideogram.AccountGetAccountUsageResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.AccountGetAccountUsageResponse? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.AccountGetAccountUsageResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.AccountGetAccountUsageResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.AccountGetAccountUsageResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AccountGetAccountUsageResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AccountGetAccountUsageResponse.g.cs new file mode 100644 index 00000000..9c65aa5d --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.AccountGetAccountUsageResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class AccountGetAccountUsageResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AccountGetAccountUsageResponse2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AccountGetAccountUsageResponse2.Json.g.cs new file mode 100644 index 00000000..c3ec0986 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.AccountGetAccountUsageResponse2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class AccountGetAccountUsageResponse2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.AccountGetAccountUsageResponse2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.AccountGetAccountUsageResponse2), + jsonSerializerContext) as global::Ideogram.AccountGetAccountUsageResponse2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.AccountGetAccountUsageResponse2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.AccountGetAccountUsageResponse2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.AccountGetAccountUsageResponse2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.AccountGetAccountUsageResponse2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AccountGetAccountUsageResponse2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AccountGetAccountUsageResponse2.g.cs new file mode 100644 index 00000000..7a5e775b --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.AccountGetAccountUsageResponse2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class AccountGetAccountUsageResponse2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AccountGetAccountUsageResponse3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AccountGetAccountUsageResponse3.Json.g.cs new file mode 100644 index 00000000..67092049 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.AccountGetAccountUsageResponse3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class AccountGetAccountUsageResponse3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.AccountGetAccountUsageResponse3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.AccountGetAccountUsageResponse3), + jsonSerializerContext) as global::Ideogram.AccountGetAccountUsageResponse3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.AccountGetAccountUsageResponse3? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.AccountGetAccountUsageResponse3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.AccountGetAccountUsageResponse3), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.AccountGetAccountUsageResponse3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AccountGetAccountUsageResponse3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AccountGetAccountUsageResponse3.g.cs new file mode 100644 index 00000000..e9ce1c7d --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.AccountGetAccountUsageResponse3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class AccountGetAccountUsageResponse3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AccountGetAccountUsageResponse4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AccountGetAccountUsageResponse4.Json.g.cs new file mode 100644 index 00000000..05bb0bca --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.AccountGetAccountUsageResponse4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class AccountGetAccountUsageResponse4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.AccountGetAccountUsageResponse4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.AccountGetAccountUsageResponse4), + jsonSerializerContext) as global::Ideogram.AccountGetAccountUsageResponse4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.AccountGetAccountUsageResponse4? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.AccountGetAccountUsageResponse4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.AccountGetAccountUsageResponse4), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.AccountGetAccountUsageResponse4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AccountGetAccountUsageResponse4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AccountGetAccountUsageResponse4.g.cs new file mode 100644 index 00000000..88a9e8b7 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.AccountGetAccountUsageResponse4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class AccountGetAccountUsageResponse4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AccountInvoice.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AccountInvoice.g.cs index e33a01bb..0bf1639a 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.AccountInvoice.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.AccountInvoice.g.cs @@ -4,7 +4,7 @@ namespace Ideogram { /// - /// Example: {"start_time":"2000-01-23T04:56:07\u002B00:00","total":"150.00","paid_time":"2000-01-23T04:56:07\u002B00:00","end_time":"2000-01-23T04:56:07\u002B00:00","line_items":[{"cost_total":"84.00","quantity":"2100","api_key":{"redacted_key":"ATG5\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022","id":"JRPVD7jWR1aTBYiJ0UFVOg","label":"Live production environment"},"description":"Ideogram v4 Generation","unit_price":"0.04","currency_code":"USD"},{"cost_total":"84.00","quantity":"2100","api_key":{"redacted_key":"ATG5\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022","id":"JRPVD7jWR1aTBYiJ0UFVOg","label":"Live production environment"},"description":"Ideogram v4 Generation","unit_price":"0.04","currency_code":"USD"}],"issued_time":"2000-01-23T04:56:07\u002B00:00","currency_code":"USD","status":"paid"} + /// /// public sealed partial class AccountInvoice { @@ -35,29 +35,23 @@ public sealed partial class AccountInvoice public global::System.DateTime? PaidTime { get; set; } /// - /// Status of the invoice
- /// Example: paid + /// Status of the invoice ///
- /// paid [global::System.Text.Json.Serialization.JsonPropertyName("status")] [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.AccountInvoiceStatusJsonConverter))] [global::System.Text.Json.Serialization.JsonRequired] public required global::Ideogram.AccountInvoiceStatus Status { get; set; } /// - /// Invoice total in `currency_code`, as a decimal string.
- /// Example: 150.00 + /// Invoice total in `currency_code`, as a decimal string. ///
- /// 150.00 [global::System.Text.Json.Serialization.JsonPropertyName("total")] [global::System.Text.Json.Serialization.JsonRequired] public required string Total { get; set; } /// - /// ISO 4217 currency code of the amounts on this invoice.
- /// Example: USD + /// ISO 4217 currency code of the amounts on this invoice. ///
- /// USD [global::System.Text.Json.Serialization.JsonPropertyName("currency_code")] [global::System.Text.Json.Serialization.JsonRequired] public required string CurrencyCode { get; set; } @@ -85,16 +79,13 @@ public sealed partial class AccountInvoice /// End of the invoice period. /// /// - /// Status of the invoice
- /// Example: paid + /// Status of the invoice /// /// - /// Invoice total in `currency_code`, as a decimal string.
- /// Example: 150.00 + /// Invoice total in `currency_code`, as a decimal string. /// /// - /// ISO 4217 currency code of the amounts on this invoice.
- /// Example: USD + /// ISO 4217 currency code of the amounts on this invoice. /// /// /// The invoice's charges. diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AccountInvoiceLineItem.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AccountInvoiceLineItem.g.cs index 6296c1d3..46774558 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.AccountInvoiceLineItem.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.AccountInvoiceLineItem.g.cs @@ -4,61 +4,48 @@ namespace Ideogram { /// - /// One charged product on an invoice.
- /// Example: {"cost_total":"84.00","quantity":"2100","api_key":{"redacted_key":"ATG5\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022","id":"JRPVD7jWR1aTBYiJ0UFVOg","label":"Live production environment"},"description":"Ideogram v4 Generation","unit_price":"0.04","currency_code":"USD"} + /// One charged product on an invoice. ///
public sealed partial class AccountInvoiceLineItem { /// - /// Display name of the charged product. Not an identifier.
- /// Example: Ideogram v4 Generation + /// Display name of the charged product. Not an identifier. ///
- /// Ideogram v4 Generation [global::System.Text.Json.Serialization.JsonPropertyName("description")] [global::System.Text.Json.Serialization.JsonRequired] public required string Description { get; set; } /// - /// Number of billed units, as a decimal string.
- /// Example: 2100 + /// Number of billed units, as a decimal string. ///
- /// 2100 [global::System.Text.Json.Serialization.JsonPropertyName("quantity")] [global::System.Text.Json.Serialization.JsonRequired] public required string Quantity { get; set; } /// - /// Price per unit in `currency_code`, as a decimal string.
- /// Example: 0.04 + /// Price per unit in `currency_code`, as a decimal string. ///
- /// 0.04 [global::System.Text.Json.Serialization.JsonPropertyName("unit_price")] [global::System.Text.Json.Serialization.JsonRequired] public required string UnitPrice { get; set; } /// - /// Total charged amount in `currency_code`, as a decimal string.
- /// Example: 84.00 + /// Total charged amount in `currency_code`, as a decimal string. ///
- /// 84.00 [global::System.Text.Json.Serialization.JsonPropertyName("cost_total")] [global::System.Text.Json.Serialization.JsonRequired] public required string CostTotal { get; set; } /// - /// ISO 4217 currency code of the amounts on this line item.
- /// Example: USD + /// ISO 4217 currency code of the amounts on this line item. ///
- /// USD [global::System.Text.Json.Serialization.JsonPropertyName("currency_code")] [global::System.Text.Json.Serialization.JsonRequired] public required string CurrencyCode { get; set; } /// - /// The API key the usage was billed to, in redacted form.
- /// Example: {"redacted_key":"ATG5\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022","id":"JRPVD7jWR1aTBYiJ0UFVOg","label":"Live production environment"} + /// The API key the usage was billed to, in redacted form. ///
- /// {"redacted_key":"ATG5\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022","id":"JRPVD7jWR1aTBYiJ0UFVOg","label":"Live production environment"} [global::System.Text.Json.Serialization.JsonPropertyName("api_key")] public global::Ideogram.AccountUsageApiKey? ApiKey { get; set; } @@ -72,28 +59,22 @@ public sealed partial class AccountInvoiceLineItem /// Initializes a new instance of the class. /// /// - /// Display name of the charged product. Not an identifier.
- /// Example: Ideogram v4 Generation + /// Display name of the charged product. Not an identifier. /// /// - /// Number of billed units, as a decimal string.
- /// Example: 2100 + /// Number of billed units, as a decimal string. /// /// - /// Price per unit in `currency_code`, as a decimal string.
- /// Example: 0.04 + /// Price per unit in `currency_code`, as a decimal string. /// /// - /// Total charged amount in `currency_code`, as a decimal string.
- /// Example: 84.00 + /// Total charged amount in `currency_code`, as a decimal string. /// /// - /// ISO 4217 currency code of the amounts on this line item.
- /// Example: USD + /// ISO 4217 currency code of the amounts on this line item. /// /// - /// The API key the usage was billed to, in redacted form.
- /// Example: {"redacted_key":"ATG5\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022","id":"JRPVD7jWR1aTBYiJ0UFVOg","label":"Live production environment"} + /// The API key the usage was billed to, in redacted form. /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AccountInvoiceStatus.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AccountInvoiceStatus.g.cs index c2071d8f..6a296646 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.AccountInvoiceStatus.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.AccountInvoiceStatus.g.cs @@ -4,8 +4,7 @@ namespace Ideogram { /// - /// Status of the invoice
- /// Example: paid + /// Status of the invoice ///
public enum AccountInvoiceStatus { diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AccountUsageApiKey.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AccountUsageApiKey.g.cs index 122cf3eb..b1bd5a05 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.AccountUsageApiKey.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.AccountUsageApiKey.g.cs @@ -4,33 +4,26 @@ namespace Ideogram { /// - /// The API key the usage was billed to, in redacted form.
- /// Example: {"redacted_key":"ATG5\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022","id":"JRPVD7jWR1aTBYiJ0UFVOg","label":"Live production environment"} + /// The API key the usage was billed to, in redacted form. ///
public sealed partial class AccountUsageApiKey { /// - /// The API key's id, as listed by `GET /v2/account/api-keys`.
- /// Example: JRPVD7jWR1aTBYiJ0UFVOg + /// The API key's id, as listed by `GET /v2/account/api-keys`. ///
- /// JRPVD7jWR1aTBYiJ0UFVOg [global::System.Text.Json.Serialization.JsonPropertyName("id")] [global::System.Text.Json.Serialization.JsonRequired] public required string Id { get; set; } /// - /// The first characters of the key followed by bullets.
- /// Example: ATG5••••••••••••• + /// The first characters of the key followed by bullets. ///
- /// ATG5••••••••••••• [global::System.Text.Json.Serialization.JsonPropertyName("redacted_key")] public string? RedactedKey { get; set; } /// - /// The key's user-supplied label, when one is set.
- /// Example: Live production environment + /// The key's user-supplied label, when one is set. ///
- /// Live production environment [global::System.Text.Json.Serialization.JsonPropertyName("label")] public string? Label { get; set; } @@ -44,16 +37,13 @@ public sealed partial class AccountUsageApiKey /// Initializes a new instance of the class. /// /// - /// The API key's id, as listed by `GET /v2/account/api-keys`.
- /// Example: JRPVD7jWR1aTBYiJ0UFVOg + /// The API key's id, as listed by `GET /v2/account/api-keys`. /// /// - /// The first characters of the key followed by bullets.
- /// Example: ATG5••••••••••••• + /// The first characters of the key followed by bullets. /// /// - /// The key's user-supplied label, when one is set.
- /// Example: Live production environment + /// The key's user-supplied label, when one is set. /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AccountUsageBilledUnits.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AccountUsageBilledUnits.g.cs index bcf096ab..06485c5d 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.AccountUsageBilledUnits.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.AccountUsageBilledUnits.g.cs @@ -4,34 +4,27 @@ namespace Ideogram { /// - /// Per-unit detail for products billed per item. `quantity × unit_price` always equals the line item's `cost_total`.
- /// Example: {"unit":"image","quantity":"2100","unit_price":"0.04"} + /// Per-unit detail for products billed per item. `quantity × unit_price` always equals the line item's `cost_total`. ///
public sealed partial class AccountUsageBilledUnits { /// - /// What one billed unit is (for example `image`).
- /// Example: image + /// What one billed unit is (for example `image`). ///
- /// image [global::System.Text.Json.Serialization.JsonPropertyName("unit")] [global::System.Text.Json.Serialization.JsonRequired] public required string Unit { get; set; } /// - /// Number of units billed, as a decimal string.
- /// Example: 2100 + /// Number of units billed, as a decimal string. ///
- /// 2100 [global::System.Text.Json.Serialization.JsonPropertyName("quantity")] [global::System.Text.Json.Serialization.JsonRequired] public required string Quantity { get; set; } /// - /// Price per unit in `currency_code`, as a decimal string.
- /// Example: 0.04 + /// Price per unit in `currency_code`, as a decimal string. ///
- /// 0.04 [global::System.Text.Json.Serialization.JsonPropertyName("unit_price")] [global::System.Text.Json.Serialization.JsonRequired] public required string UnitPrice { get; set; } @@ -46,16 +39,13 @@ public sealed partial class AccountUsageBilledUnits /// Initializes a new instance of the class. /// /// - /// What one billed unit is (for example `image`).
- /// Example: image + /// What one billed unit is (for example `image`). /// /// - /// Number of units billed, as a decimal string.
- /// Example: 2100 + /// Number of units billed, as a decimal string. /// /// - /// Price per unit in `currency_code`, as a decimal string.
- /// Example: 0.04 + /// Price per unit in `currency_code`, as a decimal string. /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AccountUsageBucket.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AccountUsageBucket.g.cs index 252141bc..838a22c5 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.AccountUsageBucket.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.AccountUsageBucket.g.cs @@ -4,7 +4,7 @@ namespace Ideogram { /// - /// Example: {"start_time":"2000-01-23T04:56:07\u002B00:00","end_time":"2000-01-23T04:56:07\u002B00:00","line_items":[{"product":"ideogram_v4_generation","endpoint":"/v2/image/generate/ideogram-4","cost_total":"84.00","user_email":"user_email","api_key":{"redacted_key":"ATG5\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022","id":"JRPVD7jWR1aTBYiJ0UFVOg","label":"Live production environment"},"description":"Ideogram v4 Generation","billed_units":{"unit":"image","quantity":"2100","unit_price":"0.04"},"source":"api","currency_code":"USD","dimensions":{"key":"dimensions"}},{"product":"ideogram_v4_generation","endpoint":"/v2/image/generate/ideogram-4","cost_total":"84.00","user_email":"user_email","api_key":{"redacted_key":"ATG5\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022","id":"JRPVD7jWR1aTBYiJ0UFVOg","label":"Live production environment"},"description":"Ideogram v4 Generation","billed_units":{"unit":"image","quantity":"2100","unit_price":"0.04"},"source":"api","currency_code":"USD","dimensions":{"key":"dimensions"}}]} + /// /// public sealed partial class AccountUsageBucket { diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AccountUsageLineItem.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AccountUsageLineItem.g.cs index c59798b2..0ce34902 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.AccountUsageLineItem.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.AccountUsageLineItem.g.cs @@ -4,34 +4,27 @@ namespace Ideogram { /// - /// One billed rate for one billing actor within one time bucket.
- /// Example: {"product":"ideogram_v4_generation","endpoint":"/v2/image/generate/ideogram-4","cost_total":"84.00","user_email":"user_email","api_key":{"redacted_key":"ATG5\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022","id":"JRPVD7jWR1aTBYiJ0UFVOg","label":"Live production environment"},"description":"Ideogram v4 Generation","billed_units":{"unit":"image","quantity":"2100","unit_price":"0.04"},"source":"api","currency_code":"USD","dimensions":{"key":"dimensions"}} + /// One billed rate for one billing actor within one time bucket. ///
public sealed partial class AccountUsageLineItem { /// - /// Stable identifier of the public pricing catalog entry this charge was billed under, at the granularity the pricing page prices it (for example one entry per quality and resolution). `unknown` when a historical charge can no longer be attributed; its cost is still included.
- /// Example: ideogram_v4_generation + /// Stable identifier of the public pricing catalog entry this charge was billed under, at the granularity the pricing page prices it (for example one entry per quality and resolution). `unknown` when a historical charge can no longer be attributed; its cost is still included. ///
- /// ideogram_v4_generation [global::System.Text.Json.Serialization.JsonPropertyName("product")] [global::System.Text.Json.Serialization.JsonRequired] public required string Product { get; set; } /// - /// The API endpoint path this product belongs to.
- /// Example: /v2/image/generate/ideogram-4 + /// The API endpoint path this product belongs to. ///
- /// /v2/image/generate/ideogram-4 [global::System.Text.Json.Serialization.JsonPropertyName("endpoint")] [global::System.Text.Json.Serialization.JsonRequired] public required string Endpoint { get; set; } /// - /// Name of the public pricing catalog entry, as shown on the pricing page. Not an identifier.
- /// Example: Ideogram v4 Generation + /// Name of the public pricing catalog entry, as shown on the pricing page. Not an identifier. ///
- /// Ideogram v4 Generation [global::System.Text.Json.Serialization.JsonPropertyName("description")] [global::System.Text.Json.Serialization.JsonRequired] public required string Description { get; set; } @@ -43,19 +36,15 @@ public sealed partial class AccountUsageLineItem public global::System.Collections.Generic.Dictionary? Dimensions { get; set; } /// - /// Total billed amount in `currency_code`, as a decimal string.
- /// Example: 84.00 + /// Total billed amount in `currency_code`, as a decimal string. ///
- /// 84.00 [global::System.Text.Json.Serialization.JsonPropertyName("cost_total")] [global::System.Text.Json.Serialization.JsonRequired] public required string CostTotal { get; set; } /// - /// ISO 4217 currency code of the amounts on this line item.
- /// Example: USD + /// ISO 4217 currency code of the amounts on this line item. ///
- /// USD [global::System.Text.Json.Serialization.JsonPropertyName("currency_code")] [global::System.Text.Json.Serialization.JsonRequired] public required string CurrencyCode { get; set; } @@ -69,10 +58,8 @@ public sealed partial class AccountUsageLineItem public required global::Ideogram.AccountUsageLineItemSource Source { get; set; } /// - /// The API key the usage was billed to, in redacted form.
- /// Example: {"redacted_key":"ATG5\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022","id":"JRPVD7jWR1aTBYiJ0UFVOg","label":"Live production environment"} + /// The API key the usage was billed to, in redacted form. ///
- /// {"redacted_key":"ATG5\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022","id":"JRPVD7jWR1aTBYiJ0UFVOg","label":"Live production environment"} [global::System.Text.Json.Serialization.JsonPropertyName("api_key")] public global::Ideogram.AccountUsageApiKey? ApiKey { get; set; } @@ -83,10 +70,8 @@ public sealed partial class AccountUsageLineItem public string? UserEmail { get; set; } /// - /// Per-unit detail for products billed per item. `quantity × unit_price` always equals the line item's `cost_total`.
- /// Example: {"unit":"image","quantity":"2100","unit_price":"0.04"} + /// Per-unit detail for products billed per item. `quantity × unit_price` always equals the line item's `cost_total`. ///
- /// {"unit":"image","quantity":"2100","unit_price":"0.04"} [global::System.Text.Json.Serialization.JsonPropertyName("billed_units")] public global::Ideogram.AccountUsageBilledUnits? BilledUnits { get; set; } @@ -100,24 +85,19 @@ public sealed partial class AccountUsageLineItem /// Initializes a new instance of the class. /// /// - /// Stable identifier of the public pricing catalog entry this charge was billed under, at the granularity the pricing page prices it (for example one entry per quality and resolution). `unknown` when a historical charge can no longer be attributed; its cost is still included.
- /// Example: ideogram_v4_generation + /// Stable identifier of the public pricing catalog entry this charge was billed under, at the granularity the pricing page prices it (for example one entry per quality and resolution). `unknown` when a historical charge can no longer be attributed; its cost is still included. /// /// - /// The API endpoint path this product belongs to.
- /// Example: /v2/image/generate/ideogram-4 + /// The API endpoint path this product belongs to. /// /// - /// Name of the public pricing catalog entry, as shown on the pricing page. Not an identifier.
- /// Example: Ideogram v4 Generation + /// Name of the public pricing catalog entry, as shown on the pricing page. Not an identifier. /// /// - /// Total billed amount in `currency_code`, as a decimal string.
- /// Example: 84.00 + /// Total billed amount in `currency_code`, as a decimal string. /// /// - /// ISO 4217 currency code of the amounts on this line item.
- /// Example: USD + /// ISO 4217 currency code of the amounts on this line item. /// /// /// Which billing surface the usage came through. `api` usage is attributed to an API key when one was used; `app` usage is attributed to the member who generated it. @@ -126,15 +106,13 @@ public sealed partial class AccountUsageLineItem /// Pricing dimensions this line item was billed under, for products priced per dimension (for example rendering speed). /// /// - /// The API key the usage was billed to, in redacted form.
- /// Example: {"redacted_key":"ATG5\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022","id":"JRPVD7jWR1aTBYiJ0UFVOg","label":"Live production environment"} + /// The API key the usage was billed to, in redacted form. /// /// /// Email address of the member who generated the usage. Only present on `app` usage. /// /// - /// Per-unit detail for products billed per item. `quantity × unit_price` always equals the line item's `cost_total`.
- /// Example: {"unit":"image","quantity":"2100","unit_price":"0.04"} + /// Per-unit detail for products billed per item. `quantity × unit_price` always equals the line item's `cost_total`. /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AdLocalizerRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AdLocalizerRequest.Json.g.cs deleted file mode 100644 index 16aef13f..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.AdLocalizerRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class AdLocalizerRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.AdLocalizerRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.AdLocalizerRequest), - jsonSerializerContext) as global::Ideogram.AdLocalizerRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.AdLocalizerRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.AdLocalizerRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.AdLocalizerRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.AdLocalizerRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AdLocalizerRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AdLocalizerRequest.g.cs deleted file mode 100644 index 7abbbfbc..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.AdLocalizerRequest.g.cs +++ /dev/null @@ -1,209 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Upload the source ad as `image` and choose a target `language`. - /// - public sealed partial class AdLocalizerRequest - { - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - ///
- /// {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - [global::System.Text.Json.Serialization.JsonPropertyName("image_asset_identifier")] - public global::Ideogram.AssetIdentifier? ImageAssetIdentifier { get; set; } - - /// - /// The source ad to localize (max size 25MB). Its layout, logos, brand
- /// type, and product are preserved, and the output keeps its shape, so
- /// no size or aspect ratio is needed. JPEG, PNG, and WEBP formats are
- /// supported. Multipart requests only. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("image")] - public byte[]? Image { get; set; } - - /// - /// The source ad to localize (max size 25MB). Its layout, logos, brand
- /// type, and product are preserved, and the output keeps its shape, so
- /// no size or aspect ratio is needed. JPEG, PNG, and WEBP formats are
- /// supported. Multipart requests only. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] - public string? Imagename { get; set; } - - /// - /// The target language for the copy. Arabic is rendered right-to-left. Each request covers one language; send one request per language. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("language")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.AdLocalizerRequestLanguageJsonConverter))] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.AdLocalizerRequestLanguage Language { get; set; } - - /// - /// Pre-approved wording, one `original => replacement` mapping per line. Each mapping names the text element showing `original` and sets it to `replacement`, placed character for character rather than translated. Any text element not listed is left as it is in the source. When omitted, all visible marketing copy is translated. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("exact_copy")] - public string? ExactCopy { get; set; } - - /// - /// Optional additional direction for the localization, for example "keep the badge in English". Anything it explicitly asks to change takes priority over the preservation rules. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - public string? Prompt { get; set; } - - /// - /// The quality tier for the edit. Higher tiers may improve detail and
- /// take longer to complete. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("quality")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.AdLocalizerQualityJsonConverter))] - public global::Ideogram.AdLocalizerQuality? Quality { get; set; } - - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - ///
- /// 12345 - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// Number of localized variations to create for this language.
- /// Default Value: 1 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] - public int? NumImages { get; set; } - - /// - /// A collection you can write to, by its URL-safe base64 collection id. Completed outputs are added to it automatically. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("target_collection_id")] - public string? TargetCollectionId { get; set; } - - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - ///
- /// https://api.example.com/webhooks/ideogram - [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] - public string? WebhookUrl { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The target language for the copy. Arabic is rendered right-to-left. Each request covers one language; send one request per language. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The source ad to localize (max size 25MB). Its layout, logos, brand
- /// type, and product are preserved, and the output keeps its shape, so
- /// no size or aspect ratio is needed. JPEG, PNG, and WEBP formats are
- /// supported. Multipart requests only. - /// - /// - /// The source ad to localize (max size 25MB). Its layout, logos, brand
- /// type, and product are preserved, and the output keeps its shape, so
- /// no size or aspect ratio is needed. JPEG, PNG, and WEBP formats are
- /// supported. Multipart requests only. - /// - /// - /// Pre-approved wording, one `original => replacement` mapping per line. Each mapping names the text element showing `original` and sets it to `replacement`, placed character for character rather than translated. Any text element not listed is left as it is in the source. When omitted, all visible marketing copy is translated. - /// - /// - /// Optional additional direction for the localization, for example "keep the badge in English". Anything it explicitly asks to change takes priority over the preservation rules. - /// - /// - /// The quality tier for the edit. Higher tiers may improve detail and
- /// take longer to complete. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// Number of localized variations to create for this language.
- /// Default Value: 1 - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. Completed outputs are added to it automatically. - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public AdLocalizerRequest( - global::Ideogram.AdLocalizerRequestLanguage language, - global::Ideogram.AssetIdentifier? imageAssetIdentifier, - byte[]? image, - string? imagename, - string? exactCopy, - string? prompt, - global::Ideogram.AdLocalizerQuality? quality, - int? seed, - int? numImages, - string? targetCollectionId, - bool? @private, - string? webhookUrl) - { - this.ImageAssetIdentifier = imageAssetIdentifier; - this.Image = image; - this.Imagename = imagename; - this.Language = language; - this.ExactCopy = exactCopy; - this.Prompt = prompt; - this.Quality = quality; - this.Seed = seed; - this.NumImages = numImages; - this.TargetCollectionId = targetCollectionId; - this.Private = @private; - this.WebhookUrl = webhookUrl; - } - - /// - /// Initializes a new instance of the class. - /// - public AdLocalizerRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AdLocalizerRequestLanguage.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AdLocalizerRequestLanguage.g.cs deleted file mode 100644 index b7b8250b..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.AdLocalizerRequestLanguage.g.cs +++ /dev/null @@ -1,141 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The target language for the copy. Arabic is rendered right-to-left. Each request covers one language; send one request per language. - /// - public enum AdLocalizerRequestLanguage - { - /// - /// - /// - Ar, - /// - /// - /// - Cs, - /// - /// - /// - Da, - /// - /// - /// - De, - /// - /// - /// - En, - /// - /// - /// - Es, - /// - /// - /// - Fi, - /// - /// - /// - Fr, - /// - /// - /// - FrCa, - /// - /// - /// - Hu, - /// - /// - /// - It, - /// - /// - /// - Ja, - /// - /// - /// - Nl, - /// - /// - /// - No, - /// - /// - /// - Pl, - /// - /// - /// - Pt, - /// - /// - /// - Sv, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class AdLocalizerRequestLanguageExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this AdLocalizerRequestLanguage value) - { - return value switch - { - AdLocalizerRequestLanguage.Ar => "ar", - AdLocalizerRequestLanguage.Cs => "cs", - AdLocalizerRequestLanguage.Da => "da", - AdLocalizerRequestLanguage.De => "de", - AdLocalizerRequestLanguage.En => "en", - AdLocalizerRequestLanguage.Es => "es", - AdLocalizerRequestLanguage.Fi => "fi", - AdLocalizerRequestLanguage.Fr => "fr", - AdLocalizerRequestLanguage.FrCa => "fr-ca", - AdLocalizerRequestLanguage.Hu => "hu", - AdLocalizerRequestLanguage.It => "it", - AdLocalizerRequestLanguage.Ja => "ja", - AdLocalizerRequestLanguage.Nl => "nl", - AdLocalizerRequestLanguage.No => "no", - AdLocalizerRequestLanguage.Pl => "pl", - AdLocalizerRequestLanguage.Pt => "pt", - AdLocalizerRequestLanguage.Sv => "sv", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static AdLocalizerRequestLanguage? ToEnum(string value) - { - return value switch - { - "ar" => AdLocalizerRequestLanguage.Ar, - "cs" => AdLocalizerRequestLanguage.Cs, - "da" => AdLocalizerRequestLanguage.Da, - "de" => AdLocalizerRequestLanguage.De, - "en" => AdLocalizerRequestLanguage.En, - "es" => AdLocalizerRequestLanguage.Es, - "fi" => AdLocalizerRequestLanguage.Fi, - "fr" => AdLocalizerRequestLanguage.Fr, - "fr-ca" => AdLocalizerRequestLanguage.FrCa, - "hu" => AdLocalizerRequestLanguage.Hu, - "it" => AdLocalizerRequestLanguage.It, - "ja" => AdLocalizerRequestLanguage.Ja, - "nl" => AdLocalizerRequestLanguage.Nl, - "no" => AdLocalizerRequestLanguage.No, - "pl" => AdLocalizerRequestLanguage.Pl, - "pt" => AdLocalizerRequestLanguage.Pt, - "sv" => AdLocalizerRequestLanguage.Sv, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AdLocalizerResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AdLocalizerResponse.g.cs index df14f609..c243931a 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.AdLocalizerResponse.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.AdLocalizerResponse.g.cs @@ -5,8 +5,7 @@ namespace Ideogram { /// /// Acknowledgement that the ad localization was accepted. Poll
- /// `GET /v2/generations/{generation_id}` for status and results.
- /// Example: {"generation_id":"generation_id"} + /// `GET /v2/generations/{generation_id}` for status and results. ///
public sealed partial class AdLocalizerResponse { diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AdResizerRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AdResizerRequest.Json.g.cs deleted file mode 100644 index 5b03eab5..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.AdResizerRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class AdResizerRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.AdResizerRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.AdResizerRequest), - jsonSerializerContext) as global::Ideogram.AdResizerRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.AdResizerRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.AdResizerRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.AdResizerRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.AdResizerRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AdResizerRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AdResizerRequest.g.cs deleted file mode 100644 index 2c8f5fd7..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.AdResizerRequest.g.cs +++ /dev/null @@ -1,232 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Upload the source creative as `image` and choose a target `resolution`. - /// - public sealed partial class AdResizerRequest - { - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - ///
- /// {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - [global::System.Text.Json.Serialization.JsonPropertyName("image_asset_identifier")] - public global::Ideogram.AssetIdentifier? ImageAssetIdentifier { get; set; } - - /// - /// The source creative to reframe (max size 25MB). JPEG, PNG, and
- /// WEBP formats are supported. Multipart requests only. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("image")] - public byte[]? Image { get; set; } - - /// - /// The source creative to reframe (max size 25MB). JPEG, PNG, and
- /// WEBP formats are supported. Multipart requests only. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] - public string? Imagename { get; set; } - - /// - /// Target ad resolution, formatted as `WIDTHxHEIGHT`. Any value not in
- /// the list is rejected with a 400. Each output image has exactly these
- /// pixel dimensions, with or without a `platform`. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.AdResizerRequestResolutionJsonConverter))] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.AdResizerRequestResolution Resolution { get; set; } - - /// - /// The ad platform whose published safe zone the ad must stay inside.
- /// The ad is generated inside the largest rectangle that fits the
- /// platform's safe zone for the requested aspect ratio, and the space
- /// around it is filled in so the output is still exactly the requested
- /// `resolution`. `google` covers YouTube and Google Ads placements.
- /// Use `meta_stories` or `meta_reels` for Meta placements; Reels uses
- /// the largest rectangle inside its notched safe zone. The legacy
- /// `meta` value is still supported and uses a more conservative safe
- /// zone. When omitted, the ad fills the whole frame and every
- /// supported `resolution` is accepted. Any other value is rejected
- /// with a 400.
- /// Each platform accepts only the resolutions for which it publishes a
- /// safe zone; any other `resolution` is rejected with a 400:
- /// | Platform | Accepted resolutions |
- /// | --- | --- |
- /// | `google` | `1920x1080`, `3840x2160`, `1080x1080`, `2400x2400`, `2880x2880`, `1080x1920`, `2160x3840` |
- /// | `tiktok` | `1920x1080`, `3840x2160`, `1080x1080`, `2400x2400`, `2880x2880`, `1080x1920`, `2160x3840` |
- /// | `meta_stories` | `1080x1920`, `2160x3840` |
- /// | `meta_reels` | `1080x1920`, `2160x3840` |
- /// | `meta` (legacy) | `1080x1920`, `2160x3840` |
- /// | `snapchat` | `1080x1920`, `2160x3840` | - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("platform")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.AdResizerRequestPlatformJsonConverter))] - public global::Ideogram.AdResizerRequestPlatform? Platform { get; set; } - - /// - /// Optional edit instruction to apply while reframing, for example "remove the logo" or "put the price bottom-right". - /// - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - public string? Prompt { get; set; } - - /// - /// The quality tier for the reframe. Higher tiers may improve detail and
- /// take longer to complete. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("quality")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.AdResizerQualityJsonConverter))] - public global::Ideogram.AdResizerQuality? Quality { get; set; } - - /// - /// The number of reframed variations to generate.
- /// Default Value: 1 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] - public int? NumImages { get; set; } - - /// - /// A collection you can write to, by its URL-safe base64 collection id. Completed outputs are added to it automatically. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("target_collection_id")] - public string? TargetCollectionId { get; set; } - - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - ///
- /// https://api.example.com/webhooks/ideogram - [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] - public string? WebhookUrl { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Target ad resolution, formatted as `WIDTHxHEIGHT`. Any value not in
- /// the list is rejected with a 400. Each output image has exactly these
- /// pixel dimensions, with or without a `platform`. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The source creative to reframe (max size 25MB). JPEG, PNG, and
- /// WEBP formats are supported. Multipart requests only. - /// - /// - /// The source creative to reframe (max size 25MB). JPEG, PNG, and
- /// WEBP formats are supported. Multipart requests only. - /// - /// - /// The ad platform whose published safe zone the ad must stay inside.
- /// The ad is generated inside the largest rectangle that fits the
- /// platform's safe zone for the requested aspect ratio, and the space
- /// around it is filled in so the output is still exactly the requested
- /// `resolution`. `google` covers YouTube and Google Ads placements.
- /// Use `meta_stories` or `meta_reels` for Meta placements; Reels uses
- /// the largest rectangle inside its notched safe zone. The legacy
- /// `meta` value is still supported and uses a more conservative safe
- /// zone. When omitted, the ad fills the whole frame and every
- /// supported `resolution` is accepted. Any other value is rejected
- /// with a 400.
- /// Each platform accepts only the resolutions for which it publishes a
- /// safe zone; any other `resolution` is rejected with a 400:
- /// | Platform | Accepted resolutions |
- /// | --- | --- |
- /// | `google` | `1920x1080`, `3840x2160`, `1080x1080`, `2400x2400`, `2880x2880`, `1080x1920`, `2160x3840` |
- /// | `tiktok` | `1920x1080`, `3840x2160`, `1080x1080`, `2400x2400`, `2880x2880`, `1080x1920`, `2160x3840` |
- /// | `meta_stories` | `1080x1920`, `2160x3840` |
- /// | `meta_reels` | `1080x1920`, `2160x3840` |
- /// | `meta` (legacy) | `1080x1920`, `2160x3840` |
- /// | `snapchat` | `1080x1920`, `2160x3840` | - /// - /// - /// Optional edit instruction to apply while reframing, for example "remove the logo" or "put the price bottom-right". - /// - /// - /// The quality tier for the reframe. Higher tiers may improve detail and
- /// take longer to complete. - /// - /// - /// The number of reframed variations to generate.
- /// Default Value: 1 - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. Completed outputs are added to it automatically. - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public AdResizerRequest( - global::Ideogram.AdResizerRequestResolution resolution, - global::Ideogram.AssetIdentifier? imageAssetIdentifier, - byte[]? image, - string? imagename, - global::Ideogram.AdResizerRequestPlatform? platform, - string? prompt, - global::Ideogram.AdResizerQuality? quality, - int? numImages, - string? targetCollectionId, - bool? @private, - string? webhookUrl) - { - this.ImageAssetIdentifier = imageAssetIdentifier; - this.Image = image; - this.Imagename = imagename; - this.Resolution = resolution; - this.Platform = platform; - this.Prompt = prompt; - this.Quality = quality; - this.NumImages = numImages; - this.TargetCollectionId = targetCollectionId; - this.Private = @private; - this.WebhookUrl = webhookUrl; - } - - /// - /// Initializes a new instance of the class. - /// - public AdResizerRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AdResizerRequestPlatform.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AdResizerRequestPlatform.g.cs deleted file mode 100644 index 45e5c2ca..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.AdResizerRequestPlatform.g.cs +++ /dev/null @@ -1,95 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The ad platform whose published safe zone the ad must stay inside.
- /// The ad is generated inside the largest rectangle that fits the
- /// platform's safe zone for the requested aspect ratio, and the space
- /// around it is filled in so the output is still exactly the requested
- /// `resolution`. `google` covers YouTube and Google Ads placements.
- /// Use `meta_stories` or `meta_reels` for Meta placements; Reels uses
- /// the largest rectangle inside its notched safe zone. The legacy
- /// `meta` value is still supported and uses a more conservative safe
- /// zone. When omitted, the ad fills the whole frame and every
- /// supported `resolution` is accepted. Any other value is rejected
- /// with a 400.
- /// Each platform accepts only the resolutions for which it publishes a
- /// safe zone; any other `resolution` is rejected with a 400:
- /// | Platform | Accepted resolutions |
- /// | --- | --- |
- /// | `google` | `1920x1080`, `3840x2160`, `1080x1080`, `2400x2400`, `2880x2880`, `1080x1920`, `2160x3840` |
- /// | `tiktok` | `1920x1080`, `3840x2160`, `1080x1080`, `2400x2400`, `2880x2880`, `1080x1920`, `2160x3840` |
- /// | `meta_stories` | `1080x1920`, `2160x3840` |
- /// | `meta_reels` | `1080x1920`, `2160x3840` |
- /// | `meta` (legacy) | `1080x1920`, `2160x3840` |
- /// | `snapchat` | `1080x1920`, `2160x3840` | - ///
- public enum AdResizerRequestPlatform - { - /// - /// - /// - Google, - /// - /// - /// - Meta, - /// - /// - /// - MetaReels, - /// - /// - /// - MetaStories, - /// - /// - /// - Snapchat, - /// - /// - /// - Tiktok, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class AdResizerRequestPlatformExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this AdResizerRequestPlatform value) - { - return value switch - { - AdResizerRequestPlatform.Google => "google", - AdResizerRequestPlatform.Meta => "meta", - AdResizerRequestPlatform.MetaReels => "meta_reels", - AdResizerRequestPlatform.MetaStories => "meta_stories", - AdResizerRequestPlatform.Snapchat => "snapchat", - AdResizerRequestPlatform.Tiktok => "tiktok", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static AdResizerRequestPlatform? ToEnum(string value) - { - return value switch - { - "google" => AdResizerRequestPlatform.Google, - "meta" => AdResizerRequestPlatform.Meta, - "meta_reels" => AdResizerRequestPlatform.MetaReels, - "meta_stories" => AdResizerRequestPlatform.MetaStories, - "snapchat" => AdResizerRequestPlatform.Snapchat, - "tiktok" => AdResizerRequestPlatform.Tiktok, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AdResizerRequestResolution.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AdResizerRequestResolution.g.cs deleted file mode 100644 index 78819a48..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.AdResizerRequestResolution.g.cs +++ /dev/null @@ -1,227 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Target ad resolution, formatted as `WIDTHxHEIGHT`. Any value not in
- /// the list is rejected with a 400. Each output image has exactly these
- /// pixel dimensions, with or without a `platform`. - ///
- public enum AdResizerRequestResolution - { - /// - /// - /// - x1080x1080, - /// - /// - /// - x1080x1350, - /// - /// - /// - x1080x1920, - /// - /// - /// - x1200x3500, - /// - /// - /// - x1280x3840, - /// - /// - /// - x160x600, - /// - /// - /// - x1800x900, - /// - /// - /// - x1920x1080, - /// - /// - /// - x1920x3840, - /// - /// - /// - x2160x3840, - /// - /// - /// - x2240x3584, - /// - /// - /// - x2336x3504, - /// - /// - /// - x2400x2400, - /// - /// - /// - x2448x3264, - /// - /// - /// - x2560x3200, - /// - /// - /// - x2880x2880, - /// - /// - /// - x300x250, - /// - /// - /// - x300x50, - /// - /// - /// - x300x600, - /// - /// - /// - x3200x2560, - /// - /// - /// - x320x100, - /// - /// - /// - x320x50, - /// - /// - /// - x3264x2448, - /// - /// - /// - x336x280, - /// - /// - /// - x3504x2336, - /// - /// - /// - x3584x2240, - /// - /// - /// - x3840x1280, - /// - /// - /// - x3840x1920, - /// - /// - /// - x3840x2160, - /// - /// - /// - x728x90, - /// - /// - /// - x970x250, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class AdResizerRequestResolutionExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this AdResizerRequestResolution value) - { - return value switch - { - AdResizerRequestResolution.x1080x1080 => "1080x1080", - AdResizerRequestResolution.x1080x1350 => "1080x1350", - AdResizerRequestResolution.x1080x1920 => "1080x1920", - AdResizerRequestResolution.x1200x3500 => "1200x3500", - AdResizerRequestResolution.x1280x3840 => "1280x3840", - AdResizerRequestResolution.x160x600 => "160x600", - AdResizerRequestResolution.x1800x900 => "1800x900", - AdResizerRequestResolution.x1920x1080 => "1920x1080", - AdResizerRequestResolution.x1920x3840 => "1920x3840", - AdResizerRequestResolution.x2160x3840 => "2160x3840", - AdResizerRequestResolution.x2240x3584 => "2240x3584", - AdResizerRequestResolution.x2336x3504 => "2336x3504", - AdResizerRequestResolution.x2400x2400 => "2400x2400", - AdResizerRequestResolution.x2448x3264 => "2448x3264", - AdResizerRequestResolution.x2560x3200 => "2560x3200", - AdResizerRequestResolution.x2880x2880 => "2880x2880", - AdResizerRequestResolution.x300x250 => "300x250", - AdResizerRequestResolution.x300x50 => "300x50", - AdResizerRequestResolution.x300x600 => "300x600", - AdResizerRequestResolution.x3200x2560 => "3200x2560", - AdResizerRequestResolution.x320x100 => "320x100", - AdResizerRequestResolution.x320x50 => "320x50", - AdResizerRequestResolution.x3264x2448 => "3264x2448", - AdResizerRequestResolution.x336x280 => "336x280", - AdResizerRequestResolution.x3504x2336 => "3504x2336", - AdResizerRequestResolution.x3584x2240 => "3584x2240", - AdResizerRequestResolution.x3840x1280 => "3840x1280", - AdResizerRequestResolution.x3840x1920 => "3840x1920", - AdResizerRequestResolution.x3840x2160 => "3840x2160", - AdResizerRequestResolution.x728x90 => "728x90", - AdResizerRequestResolution.x970x250 => "970x250", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static AdResizerRequestResolution? ToEnum(string value) - { - return value switch - { - "1080x1080" => AdResizerRequestResolution.x1080x1080, - "1080x1350" => AdResizerRequestResolution.x1080x1350, - "1080x1920" => AdResizerRequestResolution.x1080x1920, - "1200x3500" => AdResizerRequestResolution.x1200x3500, - "1280x3840" => AdResizerRequestResolution.x1280x3840, - "160x600" => AdResizerRequestResolution.x160x600, - "1800x900" => AdResizerRequestResolution.x1800x900, - "1920x1080" => AdResizerRequestResolution.x1920x1080, - "1920x3840" => AdResizerRequestResolution.x1920x3840, - "2160x3840" => AdResizerRequestResolution.x2160x3840, - "2240x3584" => AdResizerRequestResolution.x2240x3584, - "2336x3504" => AdResizerRequestResolution.x2336x3504, - "2400x2400" => AdResizerRequestResolution.x2400x2400, - "2448x3264" => AdResizerRequestResolution.x2448x3264, - "2560x3200" => AdResizerRequestResolution.x2560x3200, - "2880x2880" => AdResizerRequestResolution.x2880x2880, - "300x250" => AdResizerRequestResolution.x300x250, - "300x50" => AdResizerRequestResolution.x300x50, - "300x600" => AdResizerRequestResolution.x300x600, - "3200x2560" => AdResizerRequestResolution.x3200x2560, - "320x100" => AdResizerRequestResolution.x320x100, - "320x50" => AdResizerRequestResolution.x320x50, - "3264x2448" => AdResizerRequestResolution.x3264x2448, - "336x280" => AdResizerRequestResolution.x336x280, - "3504x2336" => AdResizerRequestResolution.x3504x2336, - "3584x2240" => AdResizerRequestResolution.x3584x2240, - "3840x1280" => AdResizerRequestResolution.x3840x1280, - "3840x1920" => AdResizerRequestResolution.x3840x1920, - "3840x2160" => AdResizerRequestResolution.x3840x2160, - "728x90" => AdResizerRequestResolution.x728x90, - "970x250" => AdResizerRequestResolution.x970x250, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AdResizerResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AdResizerResponse.g.cs index 11d08ffd..8e6c99f8 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.AdResizerResponse.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.AdResizerResponse.g.cs @@ -5,8 +5,7 @@ namespace Ideogram { /// /// Acknowledgement that the ad resize was accepted. Poll
- /// `GET /v2/generations/{generation_id}` for status and results.
- /// Example: {"generation_id":"generation_id"} + /// `GET /v2/generations/{generation_id}` for status and results. ///
public sealed partial class AdResizerResponse { diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AdVariationsRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AdVariationsRequest.Json.g.cs deleted file mode 100644 index cffe44df..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.AdVariationsRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class AdVariationsRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.AdVariationsRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.AdVariationsRequest), - jsonSerializerContext) as global::Ideogram.AdVariationsRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.AdVariationsRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.AdVariationsRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.AdVariationsRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.AdVariationsRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AdVariationsRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AdVariationsRequest.g.cs deleted file mode 100644 index bd3db3b0..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.AdVariationsRequest.g.cs +++ /dev/null @@ -1,181 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Upload the source creative as `image` and choose a `variation_type`. - /// - public sealed partial class AdVariationsRequest - { - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - ///
- /// {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - [global::System.Text.Json.Serialization.JsonPropertyName("image_asset_identifier")] - public global::Ideogram.AssetIdentifier? ImageAssetIdentifier { get; set; } - - /// - /// The source creative to vary (max size 25MB). JPEG, PNG, and WEBP
- /// formats are supported. Multipart requests only. Each output keeps
- /// the source's aspect ratio, capped at 3:1 between the long and short
- /// sides. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("image")] - public byte[]? Image { get; set; } - - /// - /// The source creative to vary (max size 25MB). JPEG, PNG, and WEBP
- /// formats are supported. Multipart requests only. Each output keeps
- /// the source's aspect ratio, capped at 3:1 between the long and short
- /// sides. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] - public string? Imagename { get; set; } - - /// - /// The axis to vary. `people`
- /// replaces the people in the ad with different talent. `setting`
- /// moves the same subject and product to a different environment.
- /// `group_size` changes how many people appear. `scene` shifts the
- /// moment or occasion (time of day, season, or activity). - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("variation_type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.AdVariationsRequestVariationTypeJsonConverter))] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.AdVariationsRequestVariationType VariationType { get; set; } - - /// - /// Optional direction to steer the variation, for example "set it on a beach" or "make the models older". Anything it explicitly asks to change takes priority over the default preservation rules. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - public string? Prompt { get; set; } - - /// - /// The quality tier for the edit. Higher tiers may improve detail and
- /// take longer to complete. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("quality")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.AdVariationsQualityJsonConverter))] - public global::Ideogram.AdVariationsQuality? Quality { get; set; } - - /// - /// The number of variations to generate along the requested axis.
- /// Default Value: 1 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] - public int? NumImages { get; set; } - - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - ///
- /// https://api.example.com/webhooks/ideogram - [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] - public string? WebhookUrl { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The axis to vary. `people`
- /// replaces the people in the ad with different talent. `setting`
- /// moves the same subject and product to a different environment.
- /// `group_size` changes how many people appear. `scene` shifts the
- /// moment or occasion (time of day, season, or activity). - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The source creative to vary (max size 25MB). JPEG, PNG, and WEBP
- /// formats are supported. Multipart requests only. Each output keeps
- /// the source's aspect ratio, capped at 3:1 between the long and short
- /// sides. - /// - /// - /// The source creative to vary (max size 25MB). JPEG, PNG, and WEBP
- /// formats are supported. Multipart requests only. Each output keeps
- /// the source's aspect ratio, capped at 3:1 between the long and short
- /// sides. - /// - /// - /// Optional direction to steer the variation, for example "set it on a beach" or "make the models older". Anything it explicitly asks to change takes priority over the default preservation rules. - /// - /// - /// The quality tier for the edit. Higher tiers may improve detail and
- /// take longer to complete. - /// - /// - /// The number of variations to generate along the requested axis.
- /// Default Value: 1 - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public AdVariationsRequest( - global::Ideogram.AdVariationsRequestVariationType variationType, - global::Ideogram.AssetIdentifier? imageAssetIdentifier, - byte[]? image, - string? imagename, - string? prompt, - global::Ideogram.AdVariationsQuality? quality, - int? numImages, - bool? @private, - string? webhookUrl) - { - this.ImageAssetIdentifier = imageAssetIdentifier; - this.Image = image; - this.Imagename = imagename; - this.VariationType = variationType; - this.Prompt = prompt; - this.Quality = quality; - this.NumImages = numImages; - this.Private = @private; - this.WebhookUrl = webhookUrl; - } - - /// - /// Initializes a new instance of the class. - /// - public AdVariationsRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AdVariationsRequestVariationType.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AdVariationsRequestVariationType.g.cs deleted file mode 100644 index 6e12d5c6..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.AdVariationsRequestVariationType.g.cs +++ /dev/null @@ -1,67 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The axis to vary. `people`
- /// replaces the people in the ad with different talent. `setting`
- /// moves the same subject and product to a different environment.
- /// `group_size` changes how many people appear. `scene` shifts the
- /// moment or occasion (time of day, season, or activity). - ///
- public enum AdVariationsRequestVariationType - { - /// - /// - /// - GroupSize, - /// - /// - /// - People, - /// - /// - /// - Scene, - /// - /// - /// - Setting, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class AdVariationsRequestVariationTypeExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this AdVariationsRequestVariationType value) - { - return value switch - { - AdVariationsRequestVariationType.GroupSize => "group_size", - AdVariationsRequestVariationType.People => "people", - AdVariationsRequestVariationType.Scene => "scene", - AdVariationsRequestVariationType.Setting => "setting", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static AdVariationsRequestVariationType? ToEnum(string value) - { - return value switch - { - "group_size" => AdVariationsRequestVariationType.GroupSize, - "people" => AdVariationsRequestVariationType.People, - "scene" => AdVariationsRequestVariationType.Scene, - "setting" => AdVariationsRequestVariationType.Setting, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AdVariationsResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AdVariationsResponse.g.cs index 94164564..2f55bbbe 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.AdVariationsResponse.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.AdVariationsResponse.g.cs @@ -5,8 +5,7 @@ namespace Ideogram { /// /// Acknowledgement that the ad variation was accepted. Poll
- /// `GET /v2/generations/{generation_id}` for status and results.
- /// Example: {"generation_id":"generation_id"} + /// `GET /v2/generations/{generation_id}` for status and results. ///
public sealed partial class AdVariationsResponse { diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AddOrganizationMembersRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AddOrganizationMembersRequest.Json.g.cs deleted file mode 100644 index 9f33e5b0..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.AddOrganizationMembersRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class AddOrganizationMembersRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.AddOrganizationMembersRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.AddOrganizationMembersRequest), - jsonSerializerContext) as global::Ideogram.AddOrganizationMembersRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.AddOrganizationMembersRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.AddOrganizationMembersRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.AddOrganizationMembersRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.AddOrganizationMembersRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AddOrganizationMembersRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AddOrganizationMembersRequest.g.cs deleted file mode 100644 index d15a181e..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.AddOrganizationMembersRequest.g.cs +++ /dev/null @@ -1,49 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"members":[{"display_handle":"john_doe","email_address":"john.doe@example.com","user_id":"dXNlcl8xMjM"},{"display_handle":"john_doe","email_address":"john.doe@example.com","user_id":"dXNlcl8xMjM"}]} - /// - public sealed partial class AddOrganizationMembersRequest - { - /// - /// List of organization members to add
- /// Default Value: [] - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("members")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList Members { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// List of organization members to add
- /// Default Value: [] - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public AddOrganizationMembersRequest( - global::System.Collections.Generic.IList members) - { - this.Members = members ?? throw new global::System.ArgumentNullException(nameof(members)); - } - - /// - /// Initializes a new instance of the class. - /// - public AddOrganizationMembersRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ApiKeyStatus.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ApiKeyStatus.g.cs deleted file mode 100644 index 5091c981..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ApiKeyStatus.g.cs +++ /dev/null @@ -1,57 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Status of the API key - /// - public enum ApiKeyStatus - { - /// - /// - /// - Active, - /// - /// - /// - Archived, - /// - /// - /// - Disabled, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class ApiKeyStatusExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this ApiKeyStatus value) - { - return value switch - { - ApiKeyStatus.Active => "ACTIVE", - ApiKeyStatus.Archived => "ARCHIVED", - ApiKeyStatus.Disabled => "DISABLED", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static ApiKeyStatus? ToEnum(string value) - { - return value switch - { - "ACTIVE" => ApiKeyStatus.Active, - "ARCHIVED" => ApiKeyStatus.Archived, - "DISABLED" => ApiKeyStatus.Disabled, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ApiOrganizationUserSuggestion.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ApiOrganizationUserSuggestion.Json.g.cs deleted file mode 100644 index b5193bb6..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ApiOrganizationUserSuggestion.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class ApiOrganizationUserSuggestion - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.ApiOrganizationUserSuggestion? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.ApiOrganizationUserSuggestion), - jsonSerializerContext) as global::Ideogram.ApiOrganizationUserSuggestion; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.ApiOrganizationUserSuggestion? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.ApiOrganizationUserSuggestion? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.ApiOrganizationUserSuggestion), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ApiOrganizationUserSuggestion; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ApiOrganizationUserSuggestion.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ApiOrganizationUserSuggestion.g.cs deleted file mode 100644 index 4a6ed429..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ApiOrganizationUserSuggestion.g.cs +++ /dev/null @@ -1,93 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"display_handle":"john_doe","joined":false,"profile_pic":"https://example.com/avatars/user123.jpg","name":"John Doe"} - /// - public sealed partial class ApiOrganizationUserSuggestion - { - /// - /// The display handle of the user
- /// Example: john_doe - ///
- /// john_doe - [global::System.Text.Json.Serialization.JsonPropertyName("display_handle")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string DisplayHandle { get; set; } - - /// - /// Whether the user has already joined the organization
- /// Example: false - ///
- /// false - [global::System.Text.Json.Serialization.JsonPropertyName("joined")] - [global::System.Text.Json.Serialization.JsonRequired] - public required bool Joined { get; set; } - - /// - /// URL to the user's profile picture
- /// Example: https://example.com/avatars/user123.jpg - ///
- /// https://example.com/avatars/user123.jpg - [global::System.Text.Json.Serialization.JsonPropertyName("profile_pic")] - public string? ProfilePic { get; set; } - - /// - /// The full name of the user
- /// Example: John Doe - ///
- /// John Doe - [global::System.Text.Json.Serialization.JsonPropertyName("name")] - public string? Name { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The display handle of the user
- /// Example: john_doe - /// - /// - /// Whether the user has already joined the organization
- /// Example: false - /// - /// - /// URL to the user's profile picture
- /// Example: https://example.com/avatars/user123.jpg - /// - /// - /// The full name of the user
- /// Example: John Doe - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ApiOrganizationUserSuggestion( - string displayHandle, - bool joined, - string? profilePic, - string? name) - { - this.DisplayHandle = displayHandle ?? throw new global::System.ArgumentNullException(nameof(displayHandle)); - this.Joined = joined; - this.ProfilePic = profilePic; - this.Name = name; - } - - /// - /// Initializes a new instance of the class. - /// - public ApiOrganizationUserSuggestion() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ApiProfile.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ApiProfile.Json.g.cs deleted file mode 100644 index 89969131..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ApiProfile.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class ApiProfile - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.ApiProfile? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.ApiProfile), - jsonSerializerContext) as global::Ideogram.ApiProfile; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.ApiProfile? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.ApiProfile? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.ApiProfile), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ApiProfile; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ApiProfile.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ApiProfile.g.cs deleted file mode 100644 index c0cd2612..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ApiProfile.g.cs +++ /dev/null @@ -1,163 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"is_metronome_2_user":true,"copyright_detection_enabled":true,"role":"OWNER","avatar_url":"https://example.com/avatar.jpg","organization_id":"b3JnYW5pemF0aW9uXzEyMw","name":"Gamma","type":"INDIVIDUAL","api_keys":[{"creation_time":"2000-01-23T04:56:07\u002B00:00","label":"Live production environment","redacted_api_key":"ATG56\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022","api_key_id":"JRPVD7jWR1aTBYiJ0UFVOg","creator_display_label":"John Doe","status":null},{"creation_time":"2000-01-23T04:56:07\u002B00:00","label":"Live production environment","redacted_api_key":"ATG56\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022","api_key_id":"JRPVD7jWR1aTBYiJ0UFVOg","creator_display_label":"John Doe","status":null}],"max_num_inflight_requests_permitted":10} - /// - public sealed partial class ApiProfile - { - /// - /// Type of API profile. TEAM is a seat-based team workspace, where each key belongs to the member who created it and spends that member's seat credits; the other types share their keys across the whole workspace.
- /// Example: INDIVIDUAL - ///
- /// INDIVIDUAL - [global::System.Text.Json.Serialization.JsonPropertyName("type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ApiProfileTypeJsonConverter))] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.ApiProfileType Type { get; set; } - - /// - /// The display name of the profile
- /// Example: Gamma - ///
- /// Gamma - [global::System.Text.Json.Serialization.JsonPropertyName("name")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Name { get; set; } - - /// - /// URL to the profile avatar
- /// Example: https://example.com/avatar.jpg - ///
- /// https://example.com/avatar.jpg - [global::System.Text.Json.Serialization.JsonPropertyName("avatar_url")] - public string? AvatarUrl { get; set; } - - /// - /// Base64 encoded organization ID (only for ENTERPRISE profiles)
- /// Example: b3JnYW5pemF0aW9uXzEyMw - ///
- /// b3JnYW5pemF0aW9uXzEyMw - [global::System.Text.Json.Serialization.JsonPropertyName("organization_id")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string OrganizationId { get; set; } - - /// - /// Role within an organization profile. ADMIN only exists for ENTERPRISE_PREPAID organizations.
- /// Example: OWNER - ///
- /// OWNER - [global::System.Text.Json.Serialization.JsonPropertyName("role")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ApiProfileRoleJsonConverter))] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.ApiProfileRole Role { get; set; } - - /// - /// List of API keys associated with this profile
- /// Default Value: [] - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("api_keys")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList ApiKeys { get; set; } - - /// - /// Whether the user is on Metronome 2.0 - /// - [global::System.Text.Json.Serialization.JsonPropertyName("is_metronome_2_user")] - [global::System.Text.Json.Serialization.JsonRequired] - public required bool IsMetronome2User { get; set; } - - /// - /// The maximum number of inflight requests permitted for the profile
- /// Example: 10 - ///
- /// 10 - [global::System.Text.Json.Serialization.JsonPropertyName("max_num_inflight_requests_permitted")] - [global::System.Text.Json.Serialization.JsonRequired] - public required int MaxNumInflightRequestsPermitted { get; set; } - - /// - /// Whether post-generation copyright detection (Hive likeness + logo) is enabled for this organization's API generations. When true, every successful generation is run through Hive IP scoring after the asset is saved; images that cross the likeness or logo thresholds come back with `is_image_safe = false`. Only populated for ENTERPRISE profiles. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("copyright_detection_enabled")] - public bool? CopyrightDetectionEnabled { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Type of API profile. TEAM is a seat-based team workspace, where each key belongs to the member who created it and spends that member's seat credits; the other types share their keys across the whole workspace.
- /// Example: INDIVIDUAL - /// - /// - /// The display name of the profile
- /// Example: Gamma - /// - /// - /// Base64 encoded organization ID (only for ENTERPRISE profiles)
- /// Example: b3JnYW5pemF0aW9uXzEyMw - /// - /// - /// Role within an organization profile. ADMIN only exists for ENTERPRISE_PREPAID organizations.
- /// Example: OWNER - /// - /// - /// List of API keys associated with this profile
- /// Default Value: [] - /// - /// - /// Whether the user is on Metronome 2.0 - /// - /// - /// The maximum number of inflight requests permitted for the profile
- /// Example: 10 - /// - /// - /// URL to the profile avatar
- /// Example: https://example.com/avatar.jpg - /// - /// - /// Whether post-generation copyright detection (Hive likeness + logo) is enabled for this organization's API generations. When true, every successful generation is run through Hive IP scoring after the asset is saved; images that cross the likeness or logo thresholds come back with `is_image_safe = false`. Only populated for ENTERPRISE profiles. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ApiProfile( - global::Ideogram.ApiProfileType type, - string name, - string organizationId, - global::Ideogram.ApiProfileRole role, - global::System.Collections.Generic.IList apiKeys, - bool isMetronome2User, - int maxNumInflightRequestsPermitted, - string? avatarUrl, - bool? copyrightDetectionEnabled) - { - this.Type = type; - this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); - this.AvatarUrl = avatarUrl; - this.OrganizationId = organizationId ?? throw new global::System.ArgumentNullException(nameof(organizationId)); - this.Role = role; - this.ApiKeys = apiKeys ?? throw new global::System.ArgumentNullException(nameof(apiKeys)); - this.IsMetronome2User = isMetronome2User; - this.MaxNumInflightRequestsPermitted = maxNumInflightRequestsPermitted; - this.CopyrightDetectionEnabled = copyrightDetectionEnabled; - } - - /// - /// Initializes a new instance of the class. - /// - public ApiProfile() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ApiProfileApiKey.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ApiProfileApiKey.Json.g.cs deleted file mode 100644 index 655fba46..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ApiProfileApiKey.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class ApiProfileApiKey - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.ApiProfileApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.ApiProfileApiKey), - jsonSerializerContext) as global::Ideogram.ApiProfileApiKey; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.ApiProfileApiKey? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.ApiProfileApiKey? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.ApiProfileApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ApiProfileApiKey; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ApiProfileApiKey.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ApiProfileApiKey.g.cs deleted file mode 100644 index 8b8b628e..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ApiProfileApiKey.g.cs +++ /dev/null @@ -1,118 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"creation_time":"2000-01-23T04:56:07\u002B00:00","label":"Live production environment","redacted_api_key":"ATG56\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022","api_key_id":"JRPVD7jWR1aTBYiJ0UFVOg","creator_display_label":"John Doe","status":null} - /// - public sealed partial class ApiProfileApiKey - { - /// - /// Base64 encoded API key ID
- /// Example: JRPVD7jWR1aTBYiJ0UFVOg - ///
- /// JRPVD7jWR1aTBYiJ0UFVOg - [global::System.Text.Json.Serialization.JsonPropertyName("api_key_id")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string ApiKeyId { get; set; } - - /// - /// A redacted text snippet of the API key. Contains the first 4 characters of the API key
- /// Example: ATG56••••••••••••• - ///
- /// ATG56••••••••••••• - [global::System.Text.Json.Serialization.JsonPropertyName("redacted_api_key")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string RedactedApiKey { get; set; } - - /// - /// The date at which the API key was created - /// - [global::System.Text.Json.Serialization.JsonPropertyName("creation_time")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.DateTime CreationTime { get; set; } - - /// - /// Status of the API key - /// - [global::System.Text.Json.Serialization.JsonPropertyName("status")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ApiKeyStatusJsonConverter))] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.ApiKeyStatus Status { get; set; } - - /// - /// An optional user-supplied label for managing the API key
- /// Example: Live production environment - ///
- /// Live production environment - [global::System.Text.Json.Serialization.JsonPropertyName("label")] - public string? Label { get; set; } - - /// - /// Name of the member who created the key, falling back to their display handle when no name is set. Null on keys created before creators were recorded, and on workspace types whose keys are shared rather than owned by one member.
- /// Example: John Doe - ///
- /// John Doe - [global::System.Text.Json.Serialization.JsonPropertyName("creator_display_label")] - public string? CreatorDisplayLabel { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Base64 encoded API key ID
- /// Example: JRPVD7jWR1aTBYiJ0UFVOg - /// - /// - /// A redacted text snippet of the API key. Contains the first 4 characters of the API key
- /// Example: ATG56••••••••••••• - /// - /// - /// The date at which the API key was created - /// - /// - /// Status of the API key - /// - /// - /// An optional user-supplied label for managing the API key
- /// Example: Live production environment - /// - /// - /// Name of the member who created the key, falling back to their display handle when no name is set. Null on keys created before creators were recorded, and on workspace types whose keys are shared rather than owned by one member.
- /// Example: John Doe - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ApiProfileApiKey( - string apiKeyId, - string redactedApiKey, - global::System.DateTime creationTime, - global::Ideogram.ApiKeyStatus status, - string? label, - string? creatorDisplayLabel) - { - this.ApiKeyId = apiKeyId ?? throw new global::System.ArgumentNullException(nameof(apiKeyId)); - this.RedactedApiKey = redactedApiKey ?? throw new global::System.ArgumentNullException(nameof(redactedApiKey)); - this.CreationTime = creationTime; - this.Status = status; - this.Label = label; - this.CreatorDisplayLabel = creatorDisplayLabel; - } - - /// - /// Initializes a new instance of the class. - /// - public ApiProfileApiKey() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ApiProfileRole.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ApiProfileRole.g.cs deleted file mode 100644 index 9679b230..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ApiProfileRole.g.cs +++ /dev/null @@ -1,58 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Role within an organization profile. ADMIN only exists for ENTERPRISE_PREPAID organizations.
- /// Example: OWNER - ///
- public enum ApiProfileRole - { - /// - /// - /// - Admin, - /// - /// - /// - Member, - /// - /// - /// - Owner, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class ApiProfileRoleExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this ApiProfileRole value) - { - return value switch - { - ApiProfileRole.Admin => "ADMIN", - ApiProfileRole.Member => "MEMBER", - ApiProfileRole.Owner => "OWNER", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static ApiProfileRole? ToEnum(string value) - { - return value switch - { - "ADMIN" => ApiProfileRole.Admin, - "MEMBER" => ApiProfileRole.Member, - "OWNER" => ApiProfileRole.Owner, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ApiProfileType.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ApiProfileType.g.cs deleted file mode 100644 index 8c4e21df..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ApiProfileType.g.cs +++ /dev/null @@ -1,64 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Type of API profile. TEAM is a seat-based team workspace, where each key belongs to the member who created it and spends that member's seat credits; the other types share their keys across the whole workspace.
- /// Example: INDIVIDUAL - ///
- public enum ApiProfileType - { - /// - /// - /// - Enterprise, - /// - /// - /// - EnterprisePrepaid, - /// - /// - /// - Individual, - /// - /// - /// - Team, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class ApiProfileTypeExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this ApiProfileType value) - { - return value switch - { - ApiProfileType.Enterprise => "ENTERPRISE", - ApiProfileType.EnterprisePrepaid => "ENTERPRISE_PREPAID", - ApiProfileType.Individual => "INDIVIDUAL", - ApiProfileType.Team => "TEAM", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static ApiProfileType? ToEnum(string value) - { - return value switch - { - "ENTERPRISE" => ApiProfileType.Enterprise, - "ENTERPRISE_PREPAID" => ApiProfileType.EnterprisePrepaid, - "INDIVIDUAL" => ApiProfileType.Individual, - "TEAM" => ApiProfileType.Team, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ApiTerms.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ApiTerms.Json.g.cs deleted file mode 100644 index 97fe1d3e..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ApiTerms.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class ApiTerms - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.ApiTerms? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.ApiTerms), - jsonSerializerContext) as global::Ideogram.ApiTerms; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.ApiTerms? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.ApiTerms? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.ApiTerms), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ApiTerms; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ApiTerms.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ApiTerms.g.cs deleted file mode 100644 index 6deb5497..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ApiTerms.g.cs +++ /dev/null @@ -1,59 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"terms_url":"terms_url","terms_id":"terms_id"} - /// - public sealed partial class ApiTerms - { - /// - /// The ID of the terms. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("terms_id")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string TermsId { get; set; } - - /// - /// The URL where the terms are hosted. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("terms_url")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string TermsUrl { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The ID of the terms. - /// - /// - /// The URL where the terms are hosted. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ApiTerms( - string termsId, - string termsUrl) - { - this.TermsId = termsId ?? throw new global::System.ArgumentNullException(nameof(termsId)); - this.TermsUrl = termsUrl ?? throw new global::System.ArgumentNullException(nameof(termsUrl)); - } - - /// - /// Initializes a new instance of the class. - /// - public ApiTerms() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AspectRatio.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AspectRatio.g.cs deleted file mode 100644 index b3848f12..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.AspectRatio.g.cs +++ /dev/null @@ -1,106 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// (Cannot be used in conjunction with resolution) The aspect ratio to use for image generation, which determines the image's resolution. Defaults to ASPECT_1_1.
- /// Example: ASPECT_10_16 - ///
- public enum AspectRatio - { - /// - /// - /// - Aspect1016, - /// - /// - /// - Aspect1610, - /// - /// - /// - Aspect169, - /// - /// - /// - Aspect11, - /// - /// - /// - Aspect13, - /// - /// - /// - Aspect23, - /// - /// - /// - Aspect31, - /// - /// - /// - Aspect32, - /// - /// - /// - Aspect34, - /// - /// - /// - Aspect43, - /// - /// - /// - Aspect916, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class AspectRatioExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this AspectRatio value) - { - return value switch - { - AspectRatio.Aspect1016 => "ASPECT_10_16", - AspectRatio.Aspect1610 => "ASPECT_16_10", - AspectRatio.Aspect169 => "ASPECT_16_9", - AspectRatio.Aspect11 => "ASPECT_1_1", - AspectRatio.Aspect13 => "ASPECT_1_3", - AspectRatio.Aspect23 => "ASPECT_2_3", - AspectRatio.Aspect31 => "ASPECT_3_1", - AspectRatio.Aspect32 => "ASPECT_3_2", - AspectRatio.Aspect34 => "ASPECT_3_4", - AspectRatio.Aspect43 => "ASPECT_4_3", - AspectRatio.Aspect916 => "ASPECT_9_16", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static AspectRatio? ToEnum(string value) - { - return value switch - { - "ASPECT_10_16" => AspectRatio.Aspect1016, - "ASPECT_16_10" => AspectRatio.Aspect1610, - "ASPECT_16_9" => AspectRatio.Aspect169, - "ASPECT_1_1" => AspectRatio.Aspect11, - "ASPECT_1_3" => AspectRatio.Aspect13, - "ASPECT_2_3" => AspectRatio.Aspect23, - "ASPECT_3_1" => AspectRatio.Aspect31, - "ASPECT_3_2" => AspectRatio.Aspect32, - "ASPECT_3_4" => AspectRatio.Aspect34, - "ASPECT_4_3" => AspectRatio.Aspect43, - "ASPECT_9_16" => AspectRatio.Aspect916, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AspectRatioEditLite.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AspectRatioEditLite.g.cs deleted file mode 100644 index 7c1d9b58..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.AspectRatioEditLite.g.cs +++ /dev/null @@ -1,101 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The aspect ratio of the edited output. When omitted, the output
- /// follows the aspect ratio of the image being edited.
- /// Example: 16x9 - ///
- public enum AspectRatioEditLite - { - /// - /// - /// - x16x9, - /// - /// - /// - x1x1, - /// - /// - /// - x21x9, - /// - /// - /// - x2x3, - /// - /// - /// - x3x2, - /// - /// - /// - x3x4, - /// - /// - /// - x4x3, - /// - /// - /// - x4x5, - /// - /// - /// - x5x4, - /// - /// - /// - x9x16, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class AspectRatioEditLiteExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this AspectRatioEditLite value) - { - return value switch - { - AspectRatioEditLite.x16x9 => "16x9", - AspectRatioEditLite.x1x1 => "1x1", - AspectRatioEditLite.x21x9 => "21x9", - AspectRatioEditLite.x2x3 => "2x3", - AspectRatioEditLite.x3x2 => "3x2", - AspectRatioEditLite.x3x4 => "3x4", - AspectRatioEditLite.x4x3 => "4x3", - AspectRatioEditLite.x4x5 => "4x5", - AspectRatioEditLite.x5x4 => "5x4", - AspectRatioEditLite.x9x16 => "9x16", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static AspectRatioEditLite? ToEnum(string value) - { - return value switch - { - "16x9" => AspectRatioEditLite.x16x9, - "1x1" => AspectRatioEditLite.x1x1, - "21x9" => AspectRatioEditLite.x21x9, - "2x3" => AspectRatioEditLite.x2x3, - "3x2" => AspectRatioEditLite.x3x2, - "3x4" => AspectRatioEditLite.x3x4, - "4x3" => AspectRatioEditLite.x4x3, - "4x5" => AspectRatioEditLite.x4x5, - "5x4" => AspectRatioEditLite.x5x4, - "9x16" => AspectRatioEditLite.x9x16, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AspectRatioV4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AspectRatioV4.g.cs deleted file mode 100644 index 11e549c5..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.AspectRatioV4.g.cs +++ /dev/null @@ -1,151 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The aspect ratio for an Ideogram 4.0 magic prompt. `AUTO` lets the
- /// model select the most suitable ratio from the prompt; any other value
- /// pins the ratio. The non-AUTO values are the buckets the 4.0 model
- /// supports.
- /// Default Value: AUTO - ///
- public enum AspectRatioV4 - { - /// - /// - /// - x10x16, - /// - /// - /// - x16x10, - /// - /// - /// - x16x9, - /// - /// - /// - x1x1, - /// - /// - /// - x1x2, - /// - /// - /// - x1x3, - /// - /// - /// - x1x4, - /// - /// - /// - x2x1, - /// - /// - /// - x2x3, - /// - /// - /// - x3x1, - /// - /// - /// - x3x2, - /// - /// - /// - x3x4, - /// - /// - /// - x4x1, - /// - /// - /// - x4x3, - /// - /// - /// - x4x5, - /// - /// - /// - x5x4, - /// - /// - /// - x9x16, - /// - /// - /// - Auto, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class AspectRatioV4Extensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this AspectRatioV4 value) - { - return value switch - { - AspectRatioV4.x10x16 => "10x16", - AspectRatioV4.x16x10 => "16x10", - AspectRatioV4.x16x9 => "16x9", - AspectRatioV4.x1x1 => "1x1", - AspectRatioV4.x1x2 => "1x2", - AspectRatioV4.x1x3 => "1x3", - AspectRatioV4.x1x4 => "1x4", - AspectRatioV4.x2x1 => "2x1", - AspectRatioV4.x2x3 => "2x3", - AspectRatioV4.x3x1 => "3x1", - AspectRatioV4.x3x2 => "3x2", - AspectRatioV4.x3x4 => "3x4", - AspectRatioV4.x4x1 => "4x1", - AspectRatioV4.x4x3 => "4x3", - AspectRatioV4.x4x5 => "4x5", - AspectRatioV4.x5x4 => "5x4", - AspectRatioV4.x9x16 => "9x16", - AspectRatioV4.Auto => "AUTO", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static AspectRatioV4? ToEnum(string value) - { - return value switch - { - "10x16" => AspectRatioV4.x10x16, - "16x10" => AspectRatioV4.x16x10, - "16x9" => AspectRatioV4.x16x9, - "1x1" => AspectRatioV4.x1x1, - "1x2" => AspectRatioV4.x1x2, - "1x3" => AspectRatioV4.x1x3, - "1x4" => AspectRatioV4.x1x4, - "2x1" => AspectRatioV4.x2x1, - "2x3" => AspectRatioV4.x2x3, - "3x1" => AspectRatioV4.x3x1, - "3x2" => AspectRatioV4.x3x2, - "3x4" => AspectRatioV4.x3x4, - "4x1" => AspectRatioV4.x4x1, - "4x3" => AspectRatioV4.x4x3, - "4x5" => AspectRatioV4.x4x5, - "5x4" => AspectRatioV4.x5x4, - "9x16" => AspectRatioV4.x9x16, - "AUTO" => AspectRatioV4.Auto, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AssetIdentifier.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AssetIdentifier.g.cs index 0ac0112b..a28ba6ce 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.AssetIdentifier.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.AssetIdentifier.g.cs @@ -4,8 +4,7 @@ namespace Ideogram { /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} + /// An identifier for an ideogram asset. ///
public sealed partial class AssetIdentifier { diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AssetReferenceUsageItem.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AssetReferenceUsageItem.Json.g.cs deleted file mode 100644 index fc53b021..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.AssetReferenceUsageItem.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class AssetReferenceUsageItem - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.AssetReferenceUsageItem? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.AssetReferenceUsageItem), - jsonSerializerContext) as global::Ideogram.AssetReferenceUsageItem; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.AssetReferenceUsageItem? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.AssetReferenceUsageItem? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.AssetReferenceUsageItem), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.AssetReferenceUsageItem; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AssetReferenceUsageItem.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AssetReferenceUsageItem.g.cs deleted file mode 100644 index 8b8c985a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.AssetReferenceUsageItem.g.cs +++ /dev/null @@ -1,124 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"collection_id":"collection_id","collection_path":"collection_path","asset_identifier":{"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"},"file_name":"file_name","download_url":"download_url","attributes":[{"creation_time":"2000-01-23T04:56:07\u002B00:00","value_type":null,"attribute_key":"attribute_key","value":"value"},{"creation_time":"2000-01-23T04:56:07\u002B00:00","value_type":null,"attribute_key":"attribute_key","value":"value"}],"collection_name":"collection_name","request_count":1} - /// - public sealed partial class AssetReferenceUsageItem - { - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - ///
- /// {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - [global::System.Text.Json.Serialization.JsonPropertyName("asset_identifier")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.AssetIdentifier AssetIdentifier { get; set; } - - /// - /// Present when include_collections is true. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("collection_id")] - public string? CollectionId { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("collection_name")] - public string? CollectionName { get; set; } - - /// - /// Readable collection names from accessible ancestors through this collection, separated by " / ". - /// - [global::System.Text.Json.Serialization.JsonPropertyName("collection_path")] - public string? CollectionPath { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("file_name")] - public string? FileName { get; set; } - - /// - /// Current attributes of this collection asset, present when include_collections is true. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("attributes")] - public global::System.Collections.Generic.IList? Attributes { get; set; } - - /// - /// Signed image URL valid for 24 hours, issued only when the caller can read the asset. Refresh the listing to obtain a fresh URL. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("download_url")] - public string? DownloadUrl { get; set; } - - /// - /// Completed organization requests using the asset as an edit input within the requested range. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("request_count")] - [global::System.Text.Json.Serialization.JsonRequired] - public required long RequestCount { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// Completed organization requests using the asset as an edit input within the requested range. - /// - /// - /// Present when include_collections is true. - /// - /// - /// - /// Readable collection names from accessible ancestors through this collection, separated by " / ". - /// - /// - /// - /// Current attributes of this collection asset, present when include_collections is true. - /// - /// - /// Signed image URL valid for 24 hours, issued only when the caller can read the asset. Refresh the listing to obtain a fresh URL. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public AssetReferenceUsageItem( - global::Ideogram.AssetIdentifier assetIdentifier, - long requestCount, - string? collectionId, - string? collectionName, - string? collectionPath, - string? fileName, - global::System.Collections.Generic.IList? attributes, - string? downloadUrl) - { - this.AssetIdentifier = assetIdentifier ?? throw new global::System.ArgumentNullException(nameof(assetIdentifier)); - this.CollectionId = collectionId; - this.CollectionName = collectionName; - this.CollectionPath = collectionPath; - this.FileName = fileName; - this.Attributes = attributes; - this.DownloadUrl = downloadUrl; - this.RequestCount = requestCount; - } - - /// - /// Initializes a new instance of the class. - /// - public AssetReferenceUsageItem() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AssetReferenceUsageResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AssetReferenceUsageResponse.Json.g.cs deleted file mode 100644 index af5f303d..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.AssetReferenceUsageResponse.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class AssetReferenceUsageResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.AssetReferenceUsageResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.AssetReferenceUsageResponse), - jsonSerializerContext) as global::Ideogram.AssetReferenceUsageResponse; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.AssetReferenceUsageResponse? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.AssetReferenceUsageResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.AssetReferenceUsageResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.AssetReferenceUsageResponse; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AssetReferenceUsageResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AssetReferenceUsageResponse.g.cs deleted file mode 100644 index 3bed8b41..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.AssetReferenceUsageResponse.g.cs +++ /dev/null @@ -1,54 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"next_cursor":"next_cursor","assets":[{"collection_id":"collection_id","collection_path":"collection_path","asset_identifier":{"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"},"file_name":"file_name","download_url":"download_url","attributes":[{"creation_time":"2000-01-23T04:56:07\u002B00:00","value_type":null,"attribute_key":"attribute_key","value":"value"},{"creation_time":"2000-01-23T04:56:07\u002B00:00","value_type":null,"attribute_key":"attribute_key","value":"value"}],"collection_name":"collection_name","request_count":1},{"collection_id":"collection_id","collection_path":"collection_path","asset_identifier":{"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"},"file_name":"file_name","download_url":"download_url","attributes":[{"creation_time":"2000-01-23T04:56:07\u002B00:00","value_type":null,"attribute_key":"attribute_key","value":"value"},{"creation_time":"2000-01-23T04:56:07\u002B00:00","value_type":null,"attribute_key":"attribute_key","value":"value"}],"collection_name":"collection_name","request_count":1}]} - /// - public sealed partial class AssetReferenceUsageResponse - { - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("assets")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList Assets { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("next_cursor")] - public string? NextCursor { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public AssetReferenceUsageResponse( - global::System.Collections.Generic.IList assets, - string? nextCursor) - { - this.Assets = assets ?? throw new global::System.ArgumentNullException(nameof(assets)); - this.NextCursor = nextCursor; - } - - /// - /// Initializes a new instance of the class. - /// - public AssetReferenceUsageResponse() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AsyncImageGenerationResponseV4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AsyncImageGenerationResponseV4.Json.g.cs deleted file mode 100644 index 9d78ac68..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.AsyncImageGenerationResponseV4.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class AsyncImageGenerationResponseV4 - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.AsyncImageGenerationResponseV4? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.AsyncImageGenerationResponseV4), - jsonSerializerContext) as global::Ideogram.AsyncImageGenerationResponseV4; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.AsyncImageGenerationResponseV4? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.AsyncImageGenerationResponseV4? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.AsyncImageGenerationResponseV4), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.AsyncImageGenerationResponseV4; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AsyncImageGenerationResponseV4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AsyncImageGenerationResponseV4.g.cs deleted file mode 100644 index 55c3833d..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.AsyncImageGenerationResponseV4.g.cs +++ /dev/null @@ -1,55 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Acknowledgement returned by the async (webhook) generation endpoints. The
- /// request is accepted for asynchronous processing and the generated images
- /// are POSTed to the supplied `webhook_url` once ready; this body carries only
- /// the generation_id so the caller can correlate the eventual webhook delivery.
- /// Example: {"generation_id":"generation_id"} - ///
- public sealed partial class AsyncImageGenerationResponseV4 - { - /// - /// URL-safe base64 ID of the accepted generation. Matches the
- /// `generation_id` field delivered in the webhook payload, and the
- /// `generation_id` accepted by the generation polling endpoint. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("generation_id")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string GenerationId { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// URL-safe base64 ID of the accepted generation. Matches the
- /// `generation_id` field delivered in the webhook payload, and the
- /// `generation_id` accepted by the generation polling endpoint. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public AsyncImageGenerationResponseV4( - string generationId) - { - this.GenerationId = generationId ?? throw new global::System.ArgumentNullException(nameof(generationId)); - } - - /// - /// Initializes a new instance of the class. - /// - public AsyncImageGenerationResponseV4() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AttributeInfo.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AttributeInfo.Json.g.cs deleted file mode 100644 index c4b735d2..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.AttributeInfo.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class AttributeInfo - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.AttributeInfo? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.AttributeInfo), - jsonSerializerContext) as global::Ideogram.AttributeInfo; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.AttributeInfo? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.AttributeInfo? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.AttributeInfo), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.AttributeInfo; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AttributeInfo.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AttributeInfo.g.cs deleted file mode 100644 index 37797245..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.AttributeInfo.g.cs +++ /dev/null @@ -1,79 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"creation_time":"2000-01-23T04:56:07\u002B00:00","value_type":null,"attribute_key":"attribute_key","value":"value"} - /// - public sealed partial class AttributeInfo - { - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("attribute_key")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string AttributeKey { get; set; } - - /// - /// The stored value. NUMBER values are returned in canonical form. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("value")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Value { get; set; } - - /// - /// How the values of an attribute key are stored and filtered. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("value_type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.AttributeValueTypeJsonConverter))] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.AttributeValueType ValueType { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("creation_time")] - public global::System.DateTime? CreationTime { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// - /// The stored value. NUMBER values are returned in canonical form. - /// - /// - /// How the values of an attribute key are stored and filtered. - /// - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public AttributeInfo( - string attributeKey, - string value, - global::Ideogram.AttributeValueType valueType, - global::System.DateTime? creationTime) - { - this.AttributeKey = attributeKey ?? throw new global::System.ArgumentNullException(nameof(attributeKey)); - this.Value = value ?? throw new global::System.ArgumentNullException(nameof(value)); - this.ValueType = valueType; - this.CreationTime = creationTime; - } - - /// - /// Initializes a new instance of the class. - /// - public AttributeInfo() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AttributeValueType.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AttributeValueType.g.cs deleted file mode 100644 index 1972dcba..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.AttributeValueType.g.cs +++ /dev/null @@ -1,51 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// How the values of an attribute key are stored and filtered. - /// - public enum AttributeValueType - { - /// - /// - /// - Number, - /// - /// - /// - Text, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class AttributeValueTypeExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this AttributeValueType value) - { - return value switch - { - AttributeValueType.Number => "NUMBER", - AttributeValueType.Text => "TEXT", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static AttributeValueType? ToEnum(string value) - { - return value switch - { - "NUMBER" => AttributeValueType.Number, - "TEXT" => AttributeValueType.Text, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostGenerateImageV2AutoRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostGenerateImageV2AutoRequest.Json.g.cs new file mode 100644 index 00000000..beefd4fa --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostGenerateImageV2AutoRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class AutoModelPostGenerateImageV2AutoRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.AutoModelPostGenerateImageV2AutoRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.AutoModelPostGenerateImageV2AutoRequest), + jsonSerializerContext) as global::Ideogram.AutoModelPostGenerateImageV2AutoRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.AutoModelPostGenerateImageV2AutoRequest? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.AutoModelPostGenerateImageV2AutoRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.AutoModelPostGenerateImageV2AutoRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.AutoModelPostGenerateImageV2AutoRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostGenerateImageV2AutoRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostGenerateImageV2AutoRequest.g.cs new file mode 100644 index 00000000..a4071f05 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostGenerateImageV2AutoRequest.g.cs @@ -0,0 +1,167 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// + /// + public sealed partial class AutoModelPostGenerateImageV2AutoRequest + { + /// + /// The prompt to generate images from or, when source images are supplied, the change to make to them. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Prompt { get; set; } + + /// + /// Optional source images to edit (max 10, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("images")] + public global::System.Collections.Generic.IList? Images { get; set; } + + /// + /// Description of what to exclude from the images. The prompt takes precedence over the negative prompt. Not every model uses it. Cannot be combined with source images. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("negative_prompt")] + public string? NegativePrompt { get; set; } + + /// + /// The output aspect ratio. `auto` (the default) picks the most suitable ratio for the request. Without source images the value must be a supported ratio (for example "16x9" or "1x1"); with source images any "WIDTHxHEIGHT" value is accepted and the output uses the closest supported shape. Omit `resolution` when supplying a non-`auto` value.
+ /// Default Value: auto + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] + public string? AspectRatio { get; set; } + + /// + /// The requested output resolution, formatted as "WIDTHxHEIGHT" (for example "1280x800"). The output is served at the closest resolution the selected model supports. Omit `aspect_ratio` (or leave it `auto`) when supplying a resolution. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] + public string? Resolution { get; set; } + + /// + /// The output resolution tier. Affects which model serves the request, since not every model offers every tier. When omitted, the selected model's default tier is used. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("resolution_tier")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.V2ImageGenerateAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTierJsonConverter))] + public global::Ideogram.V2ImageGenerateAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier? ResolutionTier { get; set; } + + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.MagicPromptModeJsonConverter))] + public global::Ideogram.MagicPromptMode? MagicPrompt { get; set; } + + /// + /// The number of images to generate.
+ /// Default Value: 1 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] + public int? NumImages { get; set; } + + /// + /// Random seed. Set for reproducible generation. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("seed")] + public int? Seed { get; set; } + + /// + /// Whether the generated images should be kept private. When omitted, the default follows the caller's plan; some plans always generate privately. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("private")] + public bool? Private { get; set; } + + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The prompt to generate images from or, when source images are supplied, the change to make to them. + /// + /// + /// Optional source images to edit (max 10, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only. + /// + /// + /// Description of what to exclude from the images. The prompt takes precedence over the negative prompt. Not every model uses it. Cannot be combined with source images. + /// + /// + /// The output aspect ratio. `auto` (the default) picks the most suitable ratio for the request. Without source images the value must be a supported ratio (for example "16x9" or "1x1"); with source images any "WIDTHxHEIGHT" value is accepted and the output uses the closest supported shape. Omit `resolution` when supplying a non-`auto` value.
+ /// Default Value: auto + /// + /// + /// The requested output resolution, formatted as "WIDTHxHEIGHT" (for example "1280x800"). The output is served at the closest resolution the selected model supports. Omit `aspect_ratio` (or leave it `auto`) when supplying a resolution. + /// + /// + /// The output resolution tier. Affects which model serves the request, since not every model offers every tier. When omitted, the selected model's default tier is used. + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// Whether the generated images should be kept private. When omitted, the default follows the caller's plan; some plans always generate privately. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public AutoModelPostGenerateImageV2AutoRequest( + string prompt, + global::System.Collections.Generic.IList? images, + string? negativePrompt, + string? aspectRatio, + string? resolution, + global::Ideogram.V2ImageGenerateAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier? resolutionTier, + global::Ideogram.MagicPromptMode? magicPrompt, + int? numImages, + int? seed, + bool? @private, + bool? async) + { + this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); + this.Images = images; + this.NegativePrompt = negativePrompt; + this.AspectRatio = aspectRatio; + this.Resolution = resolution; + this.ResolutionTier = resolutionTier; + this.MagicPrompt = magicPrompt; + this.NumImages = numImages; + this.Seed = seed; + this.Private = @private; + this.Async = async; + } + + /// + /// Initializes a new instance of the class. + /// + public AutoModelPostGenerateImageV2AutoRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostGenerateImageV2AutoResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostGenerateImageV2AutoResponse.Json.g.cs new file mode 100644 index 00000000..3aa131c6 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostGenerateImageV2AutoResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class AutoModelPostGenerateImageV2AutoResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.AutoModelPostGenerateImageV2AutoResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.AutoModelPostGenerateImageV2AutoResponse), + jsonSerializerContext) as global::Ideogram.AutoModelPostGenerateImageV2AutoResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.AutoModelPostGenerateImageV2AutoResponse? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.AutoModelPostGenerateImageV2AutoResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.AutoModelPostGenerateImageV2AutoResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.AutoModelPostGenerateImageV2AutoResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostGenerateImageV2AutoResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostGenerateImageV2AutoResponse.g.cs new file mode 100644 index 00000000..8b75ddad --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostGenerateImageV2AutoResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class AutoModelPostGenerateImageV2AutoResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostGenerateImageV2AutoResponse2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostGenerateImageV2AutoResponse2.Json.g.cs new file mode 100644 index 00000000..a94a2774 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostGenerateImageV2AutoResponse2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class AutoModelPostGenerateImageV2AutoResponse2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.AutoModelPostGenerateImageV2AutoResponse2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.AutoModelPostGenerateImageV2AutoResponse2), + jsonSerializerContext) as global::Ideogram.AutoModelPostGenerateImageV2AutoResponse2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.AutoModelPostGenerateImageV2AutoResponse2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.AutoModelPostGenerateImageV2AutoResponse2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.AutoModelPostGenerateImageV2AutoResponse2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.AutoModelPostGenerateImageV2AutoResponse2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostGenerateImageV2AutoResponse2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostGenerateImageV2AutoResponse2.g.cs new file mode 100644 index 00000000..cdd4e167 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostGenerateImageV2AutoResponse2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class AutoModelPostGenerateImageV2AutoResponse2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostGenerateImageV2AutoResponse3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostGenerateImageV2AutoResponse3.Json.g.cs new file mode 100644 index 00000000..79a5cd5f --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostGenerateImageV2AutoResponse3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class AutoModelPostGenerateImageV2AutoResponse3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.AutoModelPostGenerateImageV2AutoResponse3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.AutoModelPostGenerateImageV2AutoResponse3), + jsonSerializerContext) as global::Ideogram.AutoModelPostGenerateImageV2AutoResponse3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.AutoModelPostGenerateImageV2AutoResponse3? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.AutoModelPostGenerateImageV2AutoResponse3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.AutoModelPostGenerateImageV2AutoResponse3), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.AutoModelPostGenerateImageV2AutoResponse3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostGenerateImageV2AutoResponse3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostGenerateImageV2AutoResponse3.g.cs new file mode 100644 index 00000000..e0fdd4b2 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostGenerateImageV2AutoResponse3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class AutoModelPostGenerateImageV2AutoResponse3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostGenerateImageV2AutoResponse4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostGenerateImageV2AutoResponse4.Json.g.cs new file mode 100644 index 00000000..df79571b --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostGenerateImageV2AutoResponse4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class AutoModelPostGenerateImageV2AutoResponse4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.AutoModelPostGenerateImageV2AutoResponse4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.AutoModelPostGenerateImageV2AutoResponse4), + jsonSerializerContext) as global::Ideogram.AutoModelPostGenerateImageV2AutoResponse4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.AutoModelPostGenerateImageV2AutoResponse4? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.AutoModelPostGenerateImageV2AutoResponse4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.AutoModelPostGenerateImageV2AutoResponse4), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.AutoModelPostGenerateImageV2AutoResponse4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostGenerateImageV2AutoResponse4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostGenerateImageV2AutoResponse4.g.cs new file mode 100644 index 00000000..03e4ef65 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostGenerateImageV2AutoResponse4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class AutoModelPostGenerateImageV2AutoResponse4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostGenerateImageV2AutoResponse5.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostGenerateImageV2AutoResponse5.Json.g.cs new file mode 100644 index 00000000..a36e6412 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostGenerateImageV2AutoResponse5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class AutoModelPostGenerateImageV2AutoResponse5 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.AutoModelPostGenerateImageV2AutoResponse5? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.AutoModelPostGenerateImageV2AutoResponse5), + jsonSerializerContext) as global::Ideogram.AutoModelPostGenerateImageV2AutoResponse5; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.AutoModelPostGenerateImageV2AutoResponse5? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.AutoModelPostGenerateImageV2AutoResponse5? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.AutoModelPostGenerateImageV2AutoResponse5), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.AutoModelPostGenerateImageV2AutoResponse5; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostGenerateImageV2AutoResponse5.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostGenerateImageV2AutoResponse5.g.cs new file mode 100644 index 00000000..86f0af5d --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostGenerateImageV2AutoResponse5.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class AutoModelPostGenerateImageV2AutoResponse5 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostGenerateImageV2AutoResponse6.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostGenerateImageV2AutoResponse6.Json.g.cs new file mode 100644 index 00000000..ea7ce807 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostGenerateImageV2AutoResponse6.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class AutoModelPostGenerateImageV2AutoResponse6 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.AutoModelPostGenerateImageV2AutoResponse6? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.AutoModelPostGenerateImageV2AutoResponse6), + jsonSerializerContext) as global::Ideogram.AutoModelPostGenerateImageV2AutoResponse6; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.AutoModelPostGenerateImageV2AutoResponse6? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.AutoModelPostGenerateImageV2AutoResponse6? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.AutoModelPostGenerateImageV2AutoResponse6), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.AutoModelPostGenerateImageV2AutoResponse6; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostGenerateImageV2AutoResponse6.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostGenerateImageV2AutoResponse6.g.cs new file mode 100644 index 00000000..39b27475 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostGenerateImageV2AutoResponse6.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class AutoModelPostGenerateImageV2AutoResponse6 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostToolRemixRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostToolRemixRequest.Json.g.cs new file mode 100644 index 00000000..800f9780 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostToolRemixRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class AutoModelPostToolRemixRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.AutoModelPostToolRemixRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.AutoModelPostToolRemixRequest), + jsonSerializerContext) as global::Ideogram.AutoModelPostToolRemixRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.AutoModelPostToolRemixRequest? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.AutoModelPostToolRemixRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.AutoModelPostToolRemixRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.AutoModelPostToolRemixRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostToolRemixRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostToolRemixRequest.g.cs new file mode 100644 index 00000000..f2d9fda2 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostToolRemixRequest.g.cs @@ -0,0 +1,266 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// + /// + public sealed partial class AutoModelPostToolRemixRequest + { + /// + /// The prompt that guides the remix. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Prompt { get; set; } + + /// + /// The image to remix (max 50MB; JPEG, PNG, or WEBP). Multipart requests only. The image is used only for this request and is not saved to your account. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("image")] + [global::System.Text.Json.Serialization.JsonRequired] + public required byte[] Image { get; set; } + + /// + /// The image to remix (max 50MB; JPEG, PNG, or WEBP). Multipart requests only. The image is used only for this request and is not saved to your account. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Imagename { get; set; } + + /// + /// Optional. How closely the result should follow the source image, from 1 to 100. When omitted the selected model chooses its usual strength. Combining a weight with a `resolution` or `aspect_ratio` that changes the source's aspect ratio crops the source to the new shape; this is only available at the 1K tier and is rejected at 2K. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("image_weight")] + public int? ImageWeight { get; set; } + + /// + /// Description of what to exclude from the images. The prompt takes precedence over the negative prompt. Not every model uses it. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("negative_prompt")] + public string? NegativePrompt { get; set; } + + /// + /// The requested output resolution, formatted as "WIDTHxHEIGHT" (for example "1280x800"). The output uses the closest supported resolution in the matching 1K or 2K tier. Omit `aspect_ratio` when supplying a resolution. If `resolution_tier` is also supplied, it must match the tier these dimensions fall in. Combining a shape-changing value with `image_weight` requires the 1K tier. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] + public string? Resolution { get; set; } + + /// + /// The requested output aspect ratio. Omit it to keep the source image's shape. `auto` also keeps the source shape. Omit `resolution` when supplying a concrete value. Combining a shape-changing value with `image_weight` requires the 1K tier.
+ /// Default Value: auto + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.IdeogramV4AspectRatioJsonConverter))] + public global::Ideogram.IdeogramV4AspectRatio? AspectRatio { get; set; } + + /// + /// The output resolution tier. When omitted, the tier is inferred from `resolution`, or defaults to 1k. A color palette, style codes, style preset, or non-`auto` style type are only supported at 1k. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("resolution_tier")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.V2ImageRemixAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTierJsonConverter))] + public global::Ideogram.V2ImageRemixAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier? ResolutionTier { get; set; } + + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`. The selected model decides how to interpret it.
+ /// Default Value: auto + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.MagicPromptModeJsonConverter))] + public global::Ideogram.MagicPromptMode? MagicPrompt { get; set; } + + /// + /// Optional. Only honored when the request uses a model that supports reproducible remixes; results from the default model are not reproducible. The response reports the seed used. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("seed")] + public int? Seed { get; set; } + + /// + /// A predefined style preset to apply. Limits the request to a model that supports it and requires the 1K resolution tier. Cannot be combined with style codes. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("style_preset")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.IdeogramV3StylePresetJsonConverter))] + public global::Ideogram.IdeogramV3StylePreset? StylePreset { get; set; } + + /// + /// A color palette to apply. Limits the request to a model that supports palettes and requires the 1K resolution tier. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("color_palette")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.IdeogramColorPaletteJsonConverter))] + public global::Ideogram.IdeogramColorPalette? ColorPalette { get; set; } + + /// + /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("style_codes")] + public global::System.Collections.Generic.IList? StyleCodes { get; set; } + + /// + /// The style type to generate with. A value other than `auto` limits the request to a model that supports it and requires the 1K resolution tier.
+ /// Default Value: general + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("style_type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.IdeogramV3StyleTypeJsonConverter))] + public global::Ideogram.IdeogramV3StyleType? StyleType { get; set; } + + /// + /// The number of images to generate.
+ /// Default Value: 1 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] + public int? NumImages { get; set; } + + /// + /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("enable_copyright_detection")] + public bool? EnableCopyrightDetection { get; set; } + + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] + public string? WebhookUrl { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The prompt that guides the remix. + /// + /// + /// The image to remix (max 50MB; JPEG, PNG, or WEBP). Multipart requests only. The image is used only for this request and is not saved to your account. + /// + /// + /// The image to remix (max 50MB; JPEG, PNG, or WEBP). Multipart requests only. The image is used only for this request and is not saved to your account. + /// + /// + /// Optional. How closely the result should follow the source image, from 1 to 100. When omitted the selected model chooses its usual strength. Combining a weight with a `resolution` or `aspect_ratio` that changes the source's aspect ratio crops the source to the new shape; this is only available at the 1K tier and is rejected at 2K. + /// + /// + /// Description of what to exclude from the images. The prompt takes precedence over the negative prompt. Not every model uses it. + /// + /// + /// The requested output resolution, formatted as "WIDTHxHEIGHT" (for example "1280x800"). The output uses the closest supported resolution in the matching 1K or 2K tier. Omit `aspect_ratio` when supplying a resolution. If `resolution_tier` is also supplied, it must match the tier these dimensions fall in. Combining a shape-changing value with `image_weight` requires the 1K tier. + /// + /// + /// The requested output aspect ratio. Omit it to keep the source image's shape. `auto` also keeps the source shape. Omit `resolution` when supplying a concrete value. Combining a shape-changing value with `image_weight` requires the 1K tier.
+ /// Default Value: auto + /// + /// + /// The output resolution tier. When omitted, the tier is inferred from `resolution`, or defaults to 1k. A color palette, style codes, style preset, or non-`auto` style type are only supported at 1k. + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`. The selected model decides how to interpret it.
+ /// Default Value: auto + /// + /// + /// Optional. Only honored when the request uses a model that supports reproducible remixes; results from the default model are not reproducible. The response reports the seed used. + /// + /// + /// A predefined style preset to apply. Limits the request to a model that supports it and requires the 1K resolution tier. Cannot be combined with style codes. + /// + /// + /// A color palette to apply. Limits the request to a model that supports palettes and requires the 1K resolution tier. + /// + /// + /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images. + /// + /// + /// The style type to generate with. A value other than `auto` limits the request to a model that supports it and requires the 1K resolution tier.
+ /// Default Value: general + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public AutoModelPostToolRemixRequest( + string prompt, + byte[] image, + string imagename, + int? imageWeight, + string? negativePrompt, + string? resolution, + global::Ideogram.IdeogramV4AspectRatio? aspectRatio, + global::Ideogram.V2ImageRemixAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier? resolutionTier, + global::Ideogram.MagicPromptMode? magicPrompt, + int? seed, + global::Ideogram.IdeogramV3StylePreset? stylePreset, + global::Ideogram.IdeogramColorPalette? colorPalette, + global::System.Collections.Generic.IList? styleCodes, + global::Ideogram.IdeogramV3StyleType? styleType, + int? numImages, + bool? enableCopyrightDetection, + bool? async, + string? webhookUrl) + { + this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); + this.Image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + this.Imagename = imagename ?? throw new global::System.ArgumentNullException(nameof(imagename)); + this.ImageWeight = imageWeight; + this.NegativePrompt = negativePrompt; + this.Resolution = resolution; + this.AspectRatio = aspectRatio; + this.ResolutionTier = resolutionTier; + this.MagicPrompt = magicPrompt; + this.Seed = seed; + this.StylePreset = stylePreset; + this.ColorPalette = colorPalette; + this.StyleCodes = styleCodes; + this.StyleType = styleType; + this.NumImages = numImages; + this.EnableCopyrightDetection = enableCopyrightDetection; + this.Async = async; + this.WebhookUrl = webhookUrl; + } + + /// + /// Initializes a new instance of the class. + /// + public AutoModelPostToolRemixRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostToolRemixResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostToolRemixResponse.Json.g.cs new file mode 100644 index 00000000..380ac539 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostToolRemixResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class AutoModelPostToolRemixResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.AutoModelPostToolRemixResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.AutoModelPostToolRemixResponse), + jsonSerializerContext) as global::Ideogram.AutoModelPostToolRemixResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.AutoModelPostToolRemixResponse? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.AutoModelPostToolRemixResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.AutoModelPostToolRemixResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.AutoModelPostToolRemixResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostToolRemixResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostToolRemixResponse.g.cs new file mode 100644 index 00000000..63acb1db --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostToolRemixResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class AutoModelPostToolRemixResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostToolRemixResponse2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostToolRemixResponse2.Json.g.cs new file mode 100644 index 00000000..cd509da2 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostToolRemixResponse2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class AutoModelPostToolRemixResponse2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.AutoModelPostToolRemixResponse2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.AutoModelPostToolRemixResponse2), + jsonSerializerContext) as global::Ideogram.AutoModelPostToolRemixResponse2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.AutoModelPostToolRemixResponse2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.AutoModelPostToolRemixResponse2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.AutoModelPostToolRemixResponse2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.AutoModelPostToolRemixResponse2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostToolRemixResponse2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostToolRemixResponse2.g.cs new file mode 100644 index 00000000..f5c1c019 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostToolRemixResponse2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class AutoModelPostToolRemixResponse2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostToolRemixResponse3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostToolRemixResponse3.Json.g.cs new file mode 100644 index 00000000..8c80ddaf --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostToolRemixResponse3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class AutoModelPostToolRemixResponse3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.AutoModelPostToolRemixResponse3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.AutoModelPostToolRemixResponse3), + jsonSerializerContext) as global::Ideogram.AutoModelPostToolRemixResponse3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.AutoModelPostToolRemixResponse3? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.AutoModelPostToolRemixResponse3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.AutoModelPostToolRemixResponse3), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.AutoModelPostToolRemixResponse3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostToolRemixResponse3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostToolRemixResponse3.g.cs new file mode 100644 index 00000000..7158f054 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostToolRemixResponse3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class AutoModelPostToolRemixResponse3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostToolRemixResponse4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostToolRemixResponse4.Json.g.cs new file mode 100644 index 00000000..83006174 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostToolRemixResponse4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class AutoModelPostToolRemixResponse4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.AutoModelPostToolRemixResponse4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.AutoModelPostToolRemixResponse4), + jsonSerializerContext) as global::Ideogram.AutoModelPostToolRemixResponse4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.AutoModelPostToolRemixResponse4? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.AutoModelPostToolRemixResponse4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.AutoModelPostToolRemixResponse4), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.AutoModelPostToolRemixResponse4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostToolRemixResponse4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostToolRemixResponse4.g.cs new file mode 100644 index 00000000..64c3651c --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostToolRemixResponse4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class AutoModelPostToolRemixResponse4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostToolRemixResponse5.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostToolRemixResponse5.Json.g.cs new file mode 100644 index 00000000..14735c78 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostToolRemixResponse5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class AutoModelPostToolRemixResponse5 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.AutoModelPostToolRemixResponse5? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.AutoModelPostToolRemixResponse5), + jsonSerializerContext) as global::Ideogram.AutoModelPostToolRemixResponse5; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.AutoModelPostToolRemixResponse5? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.AutoModelPostToolRemixResponse5? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.AutoModelPostToolRemixResponse5), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.AutoModelPostToolRemixResponse5; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostToolRemixResponse5.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostToolRemixResponse5.g.cs new file mode 100644 index 00000000..6c769454 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostToolRemixResponse5.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class AutoModelPostToolRemixResponse5 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostToolRemixResponse6.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostToolRemixResponse6.Json.g.cs new file mode 100644 index 00000000..160cf442 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostToolRemixResponse6.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class AutoModelPostToolRemixResponse6 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.AutoModelPostToolRemixResponse6? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.AutoModelPostToolRemixResponse6), + jsonSerializerContext) as global::Ideogram.AutoModelPostToolRemixResponse6; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.AutoModelPostToolRemixResponse6? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.AutoModelPostToolRemixResponse6? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.AutoModelPostToolRemixResponse6), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.AutoModelPostToolRemixResponse6; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostToolRemixResponse6.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostToolRemixResponse6.g.cs new file mode 100644 index 00000000..4521cf28 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.AutoModelPostToolRemixResponse6.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class AutoModelPostToolRemixResponse6 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.CancelOrganizationInviteRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.CancelOrganizationInviteRequest.Json.g.cs deleted file mode 100644 index 13b4f37c..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.CancelOrganizationInviteRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class CancelOrganizationInviteRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.CancelOrganizationInviteRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.CancelOrganizationInviteRequest), - jsonSerializerContext) as global::Ideogram.CancelOrganizationInviteRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.CancelOrganizationInviteRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.CancelOrganizationInviteRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.CancelOrganizationInviteRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.CancelOrganizationInviteRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.CancelOrganizationInviteRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.CancelOrganizationInviteRequest.g.cs deleted file mode 100644 index 836d6012..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.CancelOrganizationInviteRequest.g.cs +++ /dev/null @@ -1,47 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"invite_id":"invite_id"} - /// - public sealed partial class CancelOrganizationInviteRequest - { - /// - /// Base64 URL-safe encoded ID of the invite to cancel - /// - [global::System.Text.Json.Serialization.JsonPropertyName("invite_id")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string InviteId { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Base64 URL-safe encoded ID of the invite to cancel - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public CancelOrganizationInviteRequest( - string inviteId) - { - this.InviteId = inviteId ?? throw new global::System.ArgumentNullException(nameof(inviteId)); - } - - /// - /// Initializes a new instance of the class. - /// - public CancelOrganizationInviteRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ColorPaletteMember.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ColorPaletteMember.g.cs index e5b6ae14..ed8a4c96 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ColorPaletteMember.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ColorPaletteMember.g.cs @@ -9,19 +9,15 @@ namespace Ideogram public sealed partial class ColorPaletteMember { /// - /// The hexadecimal representation of the color with an optional chosen weight.
- /// Example: #FFFFFF + /// The hexadecimal representation of the color with an optional chosen weight. ///
- /// #FFFFFF [global::System.Text.Json.Serialization.JsonPropertyName("color_hex")] [global::System.Text.Json.Serialization.JsonRequired] public required string ColorHex { get; set; } /// - /// The weight of the color in the color palette.
- /// Example: 0.25F + /// The weight of the color in the color palette. ///
- /// 0.25F [global::System.Text.Json.Serialization.JsonPropertyName("color_weight")] public double? ColorWeight { get; set; } @@ -35,12 +31,10 @@ public sealed partial class ColorPaletteMember /// Initializes a new instance of the class. /// /// - /// The hexadecimal representation of the color with an optional chosen weight.
- /// Example: #FFFFFF + /// The hexadecimal representation of the color with an optional chosen weight. /// /// - /// The weight of the color in the color palette.
- /// Example: 0.25F + /// The weight of the color in the color palette. /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ColorPalettePresetName.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ColorPalettePresetName.g.cs deleted file mode 100644 index a614cf17..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ColorPalettePresetName.g.cs +++ /dev/null @@ -1,88 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// A color palette preset value.
- /// Example: PASTEL - ///
- public enum ColorPalettePresetName - { - /// - /// - /// - Ember, - /// - /// - /// - Fresh, - /// - /// - /// - Jungle, - /// - /// - /// - Magic, - /// - /// - /// - Melon, - /// - /// - /// - Mosaic, - /// - /// - /// - Pastel, - /// - /// - /// - Ultramarine, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class ColorPalettePresetNameExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this ColorPalettePresetName value) - { - return value switch - { - ColorPalettePresetName.Ember => "EMBER", - ColorPalettePresetName.Fresh => "FRESH", - ColorPalettePresetName.Jungle => "JUNGLE", - ColorPalettePresetName.Magic => "MAGIC", - ColorPalettePresetName.Melon => "MELON", - ColorPalettePresetName.Mosaic => "MOSAIC", - ColorPalettePresetName.Pastel => "PASTEL", - ColorPalettePresetName.Ultramarine => "ULTRAMARINE", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static ColorPalettePresetName? ToEnum(string value) - { - return value switch - { - "EMBER" => ColorPalettePresetName.Ember, - "FRESH" => ColorPalettePresetName.Fresh, - "JUNGLE" => ColorPalettePresetName.Jungle, - "MAGIC" => ColorPalettePresetName.Magic, - "MELON" => ColorPalettePresetName.Melon, - "MOSAIC" => ColorPalettePresetName.Mosaic, - "PASTEL" => ColorPalettePresetName.Pastel, - "ULTRAMARINE" => ColorPalettePresetName.Ultramarine, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ColorPaletteWithMembers.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ColorPaletteWithMembers.g.cs index 6f11d1f5..5c8a4771 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ColorPaletteWithMembers.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ColorPaletteWithMembers.g.cs @@ -11,10 +11,8 @@ public sealed partial class ColorPaletteWithMembers /// /// A list of ColorPaletteMembers that define the color palette. Each color palette member
/// consists of a required color hex and an optional weight between 0.05 and 1.0 (inclusive).
- /// It is recommended that these weights descend from highest to lowest for the color hexes provided.
- /// Example: [{"ColorPaletteMember":{"color_hex":"#b470b3","color_weight":0.49}}, {"ColorPaletteMember":{"color_hex":"#7a79e3","color_weight":0.16}}, {"ColorPaletteMember":{"color_hex":"#a26563","color_weight":0.1}}, {"ColorPaletteMember":{"color_hex":"#5c7d76","color_weight":0.07}}, {"ColorPaletteMember":{"color_hex":"#642a9c","color_weight":0.05}}] + /// It is recommended that these weights descend from highest to lowest for the color hexes provided. ///
- /// [{"ColorPaletteMember":{"color_hex":"#b470b3","color_weight":0.49}}, {"ColorPaletteMember":{"color_hex":"#7a79e3","color_weight":0.16}}, {"ColorPaletteMember":{"color_hex":"#a26563","color_weight":0.1}}, {"ColorPaletteMember":{"color_hex":"#5c7d76","color_weight":0.07}}, {"ColorPaletteMember":{"color_hex":"#642a9c","color_weight":0.05}}] [global::System.Text.Json.Serialization.JsonPropertyName("members")] [global::System.Text.Json.Serialization.JsonRequired] public required global::System.Collections.Generic.IList Members { get; set; } @@ -31,8 +29,7 @@ public sealed partial class ColorPaletteWithMembers /// /// A list of ColorPaletteMembers that define the color palette. Each color palette member
/// consists of a required color hex and an optional weight between 0.05 and 1.0 (inclusive).
- /// It is recommended that these weights descend from highest to lowest for the color hexes provided.
- /// Example: [{"ColorPaletteMember":{"color_hex":"#b470b3","color_weight":0.49}}, {"ColorPaletteMember":{"color_hex":"#7a79e3","color_weight":0.16}}, {"ColorPaletteMember":{"color_hex":"#a26563","color_weight":0.1}}, {"ColorPaletteMember":{"color_hex":"#5c7d76","color_weight":0.07}}, {"ColorPaletteMember":{"color_hex":"#642a9c","color_weight":0.05}}] + /// It is recommended that these weights descend from highest to lowest for the color hexes provided. /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ColorPaletteWithPresetName.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ColorPaletteWithPresetName.Json.g.cs deleted file mode 100644 index 00ceef9a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ColorPaletteWithPresetName.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class ColorPaletteWithPresetName - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.ColorPaletteWithPresetName? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.ColorPaletteWithPresetName), - jsonSerializerContext) as global::Ideogram.ColorPaletteWithPresetName; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.ColorPaletteWithPresetName? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.ColorPaletteWithPresetName? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.ColorPaletteWithPresetName), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ColorPaletteWithPresetName; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ColorPaletteWithPresetName.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ColorPaletteWithPresetName.g.cs deleted file mode 100644 index 4e18d21b..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ColorPaletteWithPresetName.g.cs +++ /dev/null @@ -1,51 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"name":"PASTEL"} - /// - public sealed partial class ColorPaletteWithPresetName - { - /// - /// A color palette preset value.
- /// Example: PASTEL - ///
- /// PASTEL - [global::System.Text.Json.Serialization.JsonPropertyName("name")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ColorPalettePresetNameJsonConverter))] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.ColorPalettePresetName Name { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// A color palette preset value.
- /// Example: PASTEL - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ColorPaletteWithPresetName( - global::Ideogram.ColorPalettePresetName name) - { - this.Name = name; - } - - /// - /// Initializes a new instance of the class. - /// - public ColorPaletteWithPresetName() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ColorPaletteWithPresetNameOrMembers.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ColorPaletteWithPresetNameOrMembers.Json.g.cs deleted file mode 100644 index ec6610ef..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ColorPaletteWithPresetNameOrMembers.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public readonly partial struct ColorPaletteWithPresetNameOrMembers - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.ColorPaletteWithPresetNameOrMembers? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.ColorPaletteWithPresetNameOrMembers), - jsonSerializerContext) as global::Ideogram.ColorPaletteWithPresetNameOrMembers?; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.ColorPaletteWithPresetNameOrMembers? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.ColorPaletteWithPresetNameOrMembers? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.ColorPaletteWithPresetNameOrMembers), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ColorPaletteWithPresetNameOrMembers?; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ColorPaletteWithPresetNameOrMembers.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ColorPaletteWithPresetNameOrMembers.g.cs deleted file mode 100644 index 87fdfda3..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ColorPaletteWithPresetNameOrMembers.g.cs +++ /dev/null @@ -1,295 +0,0 @@ -#pragma warning disable CS0618 // Type or member is obsolete - -#nullable enable - -namespace Ideogram -{ - /// - /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). Not supported by V_1, V_1_TURBO, V_2A and V_2A_TURBO models. - /// - public readonly partial struct ColorPaletteWithPresetNameOrMembers : global::System.IEquatable - { - /// - /// Example: {"name":"PASTEL"} - /// -#if NET6_0_OR_GREATER - public global::Ideogram.ColorPaletteWithPresetName? ColorPaletteWithPresetName { get; init; } -#else - public global::Ideogram.ColorPaletteWithPresetName? ColorPaletteWithPresetName { get; } -#endif - - /// - /// - /// -#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(ColorPaletteWithPresetName))] -#endif - public bool IsColorPaletteWithPresetName => ColorPaletteWithPresetName != null; - - /// - /// - /// - public bool TryPickColorPaletteWithPresetName( -#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] -#endif - out global::Ideogram.ColorPaletteWithPresetName? value) - { - value = ColorPaletteWithPresetName; - return IsColorPaletteWithPresetName; - } - - /// - /// - /// - public global::Ideogram.ColorPaletteWithPresetName PickColorPaletteWithPresetName() => ColorPaletteWithPresetName is { } value - ? value - : throw new global::System.InvalidOperationException($"Expected union variant 'ColorPaletteWithPresetName' but the value was {ToString()}."); - - /// - /// A color palette represented only via its members. Cannot be used in conjunction with preset name. - /// -#if NET6_0_OR_GREATER - public global::Ideogram.ColorPaletteWithMembers? ColorPaletteWithMembers { get; init; } -#else - public global::Ideogram.ColorPaletteWithMembers? ColorPaletteWithMembers { get; } -#endif - - /// - /// - /// -#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(ColorPaletteWithMembers))] -#endif - public bool IsColorPaletteWithMembers => ColorPaletteWithMembers != null; - - /// - /// - /// - public bool TryPickColorPaletteWithMembers( -#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] -#endif - out global::Ideogram.ColorPaletteWithMembers? value) - { - value = ColorPaletteWithMembers; - return IsColorPaletteWithMembers; - } - - /// - /// - /// - public global::Ideogram.ColorPaletteWithMembers PickColorPaletteWithMembers() => ColorPaletteWithMembers is { } value - ? value - : throw new global::System.InvalidOperationException($"Expected union variant 'ColorPaletteWithMembers' but the value was {ToString()}."); - /// - /// - /// - public static implicit operator ColorPaletteWithPresetNameOrMembers(global::Ideogram.ColorPaletteWithPresetName value) => new ColorPaletteWithPresetNameOrMembers((global::Ideogram.ColorPaletteWithPresetName?)value); - - /// - /// - /// - public static implicit operator global::Ideogram.ColorPaletteWithPresetName?(ColorPaletteWithPresetNameOrMembers @this) => @this.ColorPaletteWithPresetName; - - /// - /// - /// - public ColorPaletteWithPresetNameOrMembers(global::Ideogram.ColorPaletteWithPresetName? value) - { - ColorPaletteWithPresetName = value; - } - - /// - /// - /// - public static ColorPaletteWithPresetNameOrMembers FromColorPaletteWithPresetName(global::Ideogram.ColorPaletteWithPresetName? value) => new ColorPaletteWithPresetNameOrMembers(value); - - /// - /// - /// - public static implicit operator ColorPaletteWithPresetNameOrMembers(global::Ideogram.ColorPaletteWithMembers value) => new ColorPaletteWithPresetNameOrMembers((global::Ideogram.ColorPaletteWithMembers?)value); - - /// - /// - /// - public static implicit operator global::Ideogram.ColorPaletteWithMembers?(ColorPaletteWithPresetNameOrMembers @this) => @this.ColorPaletteWithMembers; - - /// - /// - /// - public ColorPaletteWithPresetNameOrMembers(global::Ideogram.ColorPaletteWithMembers? value) - { - ColorPaletteWithMembers = value; - } - - /// - /// - /// - public static ColorPaletteWithPresetNameOrMembers FromColorPaletteWithMembers(global::Ideogram.ColorPaletteWithMembers? value) => new ColorPaletteWithPresetNameOrMembers(value); - - /// - /// - /// - public ColorPaletteWithPresetNameOrMembers( - global::Ideogram.ColorPaletteWithPresetName? colorPaletteWithPresetName, - global::Ideogram.ColorPaletteWithMembers? colorPaletteWithMembers - ) - { - ColorPaletteWithPresetName = colorPaletteWithPresetName; - ColorPaletteWithMembers = colorPaletteWithMembers; - } - - /// - /// - /// - public object? Object => - ColorPaletteWithMembers as object ?? - ColorPaletteWithPresetName as object - ; - - /// - /// - /// - public override string? ToString() => - ColorPaletteWithPresetName?.ToString() ?? - ColorPaletteWithMembers?.ToString() - ; - - /// - /// - /// - public bool Validate() - { - return IsColorPaletteWithPresetName && !IsColorPaletteWithMembers || !IsColorPaletteWithPresetName && IsColorPaletteWithMembers; - } - - /// - /// - /// - public TResult? Match( - global::System.Func? colorPaletteWithPresetName = null, - global::System.Func? colorPaletteWithMembers = null, - bool validate = true) - { - if (validate) - { - Validate(); - } - - if (ColorPaletteWithPresetName is { } __value0 && colorPaletteWithPresetName != null) - { - return colorPaletteWithPresetName(__value0); - } - else if (ColorPaletteWithMembers is { } __value1 && colorPaletteWithMembers != null) - { - return colorPaletteWithMembers(__value1); - } - - return default(TResult); - } - - /// - /// - /// - public void Match( - global::System.Action? colorPaletteWithPresetName = null, - - global::System.Action? colorPaletteWithMembers = null, - bool validate = true) - { - if (validate) - { - Validate(); - } - - if (ColorPaletteWithPresetName is { } __value0) - { - colorPaletteWithPresetName?.Invoke(__value0); - } - else if (ColorPaletteWithMembers is { } __value1) - { - colorPaletteWithMembers?.Invoke(__value1); - } - } - - /// - /// - /// - public void Switch( - global::System.Action? colorPaletteWithPresetName = null, - global::System.Action? colorPaletteWithMembers = null, - bool validate = true) - { - if (validate) - { - Validate(); - } - - if (ColorPaletteWithPresetName is { } __value0) - { - colorPaletteWithPresetName?.Invoke(__value0); - } - else if (ColorPaletteWithMembers is { } __value1) - { - colorPaletteWithMembers?.Invoke(__value1); - } - } - - /// - /// - /// - public override int GetHashCode() - { - var fields = new object?[] - { - ColorPaletteWithPresetName, - typeof(global::Ideogram.ColorPaletteWithPresetName), - ColorPaletteWithMembers, - typeof(global::Ideogram.ColorPaletteWithMembers), - }; - const int offset = unchecked((int)2166136261); - const int prime = 16777619; - static int HashCodeAggregator(int hashCode, object? value) => value == null - ? (hashCode ^ 0) * prime - : (hashCode ^ value.GetHashCode()) * prime; - - return global::System.Linq.Enumerable.Aggregate(fields, offset, HashCodeAggregator); - } - - /// - /// - /// - public bool Equals(ColorPaletteWithPresetNameOrMembers other) - { - return - global::System.Collections.Generic.EqualityComparer.Default.Equals(ColorPaletteWithPresetName, other.ColorPaletteWithPresetName) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(ColorPaletteWithMembers, other.ColorPaletteWithMembers) - ; - } - - /// - /// - /// - public static bool operator ==(ColorPaletteWithPresetNameOrMembers obj1, ColorPaletteWithPresetNameOrMembers obj2) - { - return global::System.Collections.Generic.EqualityComparer.Default.Equals(obj1, obj2); - } - - /// - /// - /// - public static bool operator !=(ColorPaletteWithPresetNameOrMembers obj1, ColorPaletteWithPresetNameOrMembers obj2) - { - return !(obj1 == obj2); - } - - /// - /// - /// - public override bool Equals(object? obj) - { - return obj is ColorPaletteWithPresetNameOrMembers o && Equals(o); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ColorwaysRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ColorwaysRequest.Json.g.cs deleted file mode 100644 index 187da49a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ColorwaysRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class ColorwaysRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.ColorwaysRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.ColorwaysRequest), - jsonSerializerContext) as global::Ideogram.ColorwaysRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.ColorwaysRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.ColorwaysRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.ColorwaysRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ColorwaysRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ColorwaysRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ColorwaysRequest.g.cs deleted file mode 100644 index a3f024d2..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ColorwaysRequest.g.cs +++ /dev/null @@ -1,221 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Upload the product photo as `image` and up to 4 `masks`, with one
- /// entry in `colors` per mask. For a single region, send one mask and one
- /// color. - ///
- public sealed partial class ColorwaysRequest - { - /// - /// The product photo to recolor, by reference. Everything outside
- /// the masked region is preserved. Provide exactly one of
- /// `image_asset_identifier` or `image`. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("image_asset_identifier")] - public global::Ideogram.AssetIdentifier? ImageAssetIdentifier { get; set; } - - /// - /// The product photo to recolor (max size 25MB). JPEG, PNG, and WEBP
- /// formats are supported. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("image")] - public byte[]? Image { get; set; } - - /// - /// The product photo to recolor (max size 25MB). JPEG, PNG, and WEBP
- /// formats are supported. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] - public string? Imagename { get; set; } - - /// - /// The masks marking the regions of the product photo to recolor, by
- /// reference, paired by position with `colors` (max 4). Every mask
- /// must have the same pixel dimensions as the product photo. White
- /// pixels mark the region to recolor; black pixels are preserved.
- /// Alpha-only masks are also supported: opaque pixels mark the
- /// region to recolor and transparent pixels are preserved. Provide
- /// exactly one of `mask_asset_identifiers` or `masks`. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("mask_asset_identifiers")] - public global::System.Collections.Generic.IList? MaskAssetIdentifiers { get; set; } - - /// - /// Masks marking the regions to recolor (max 4, max size 25MB each),
- /// paired by position with `colors`. JPEG, PNG, and WEBP formats are
- /// supported. Every mask must have the same pixel dimensions as the
- /// product photo. White pixels mark the region to recolor and black
- /// pixels are preserved; alpha-only masks also work (opaque =
- /// recolor, transparent = preserve). - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("masks")] - public global::System.Collections.Generic.IList? Masks { get; set; } - - /// - /// One target color per mask in `masks`, as six-digit hex codes like
- /// `#B3202C`, paired by position. The product's shape, construction,
- /// materials, prints, and logos are always preserved. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("colors")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList Colors { get; set; } - - /// - /// Output aspect ratio. Defaults to the product photo's aspect ratio,
- /// which keeps the original framing. A different ratio extends the
- /// scene to fill the new shape rather than cropping, so part of the
- /// frame is newly generated. Supported values are `1:1`, `3:4`,
- /// `4:3`, `16:9`, and `9:16`. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] - public string? AspectRatio { get; set; } - - /// - /// The quality tier for the edit. Higher tiers may improve detail and
- /// take longer to complete. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("quality")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ColorwaysQualityJsonConverter))] - public global::Ideogram.ColorwaysQuality? Quality { get; set; } - - /// - /// A collection you can write to, by its URL-safe base64 collection id. Completed outputs are added to it automatically. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("target_collection_id")] - public string? TargetCollectionId { get; set; } - - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - ///
- /// https://api.example.com/webhooks/ideogram - [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] - public string? WebhookUrl { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// One target color per mask in `masks`, as six-digit hex codes like
- /// `#B3202C`, paired by position. The product's shape, construction,
- /// materials, prints, and logos are always preserved. - /// - /// - /// The product photo to recolor, by reference. Everything outside
- /// the masked region is preserved. Provide exactly one of
- /// `image_asset_identifier` or `image`. - /// - /// - /// The product photo to recolor (max size 25MB). JPEG, PNG, and WEBP
- /// formats are supported. - /// - /// - /// The product photo to recolor (max size 25MB). JPEG, PNG, and WEBP
- /// formats are supported. - /// - /// - /// The masks marking the regions of the product photo to recolor, by
- /// reference, paired by position with `colors` (max 4). Every mask
- /// must have the same pixel dimensions as the product photo. White
- /// pixels mark the region to recolor; black pixels are preserved.
- /// Alpha-only masks are also supported: opaque pixels mark the
- /// region to recolor and transparent pixels are preserved. Provide
- /// exactly one of `mask_asset_identifiers` or `masks`. - /// - /// - /// Masks marking the regions to recolor (max 4, max size 25MB each),
- /// paired by position with `colors`. JPEG, PNG, and WEBP formats are
- /// supported. Every mask must have the same pixel dimensions as the
- /// product photo. White pixels mark the region to recolor and black
- /// pixels are preserved; alpha-only masks also work (opaque =
- /// recolor, transparent = preserve). - /// - /// - /// Output aspect ratio. Defaults to the product photo's aspect ratio,
- /// which keeps the original framing. A different ratio extends the
- /// scene to fill the new shape rather than cropping, so part of the
- /// frame is newly generated. Supported values are `1:1`, `3:4`,
- /// `4:3`, `16:9`, and `9:16`. - /// - /// - /// The quality tier for the edit. Higher tiers may improve detail and
- /// take longer to complete. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. Completed outputs are added to it automatically. - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ColorwaysRequest( - global::System.Collections.Generic.IList colors, - global::Ideogram.AssetIdentifier? imageAssetIdentifier, - byte[]? image, - string? imagename, - global::System.Collections.Generic.IList? maskAssetIdentifiers, - global::System.Collections.Generic.IList? masks, - string? aspectRatio, - global::Ideogram.ColorwaysQuality? quality, - string? targetCollectionId, - bool? @private, - string? webhookUrl) - { - this.ImageAssetIdentifier = imageAssetIdentifier; - this.Image = image; - this.Imagename = imagename; - this.MaskAssetIdentifiers = maskAssetIdentifiers; - this.Masks = masks; - this.Colors = colors ?? throw new global::System.ArgumentNullException(nameof(colors)); - this.AspectRatio = aspectRatio; - this.Quality = quality; - this.TargetCollectionId = targetCollectionId; - this.Private = @private; - this.WebhookUrl = webhookUrl; - } - - /// - /// Initializes a new instance of the class. - /// - public ColorwaysRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ColorwaysResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ColorwaysResponse.g.cs index 823c7203..0db19000 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ColorwaysResponse.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ColorwaysResponse.g.cs @@ -5,8 +5,7 @@ namespace Ideogram { /// /// Acknowledgement that the colorway was accepted. Poll
- /// `GET /v2/generations/{generation_id}` for status and results.
- /// Example: {"generation_id":"generation_id"} + /// `GET /v2/generations/{generation_id}` for status and results. ///
public sealed partial class ColorwaysResponse { diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.CreateApiKeyRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.CreateApiKeyRequest.Json.g.cs deleted file mode 100644 index 47132d19..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.CreateApiKeyRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class CreateApiKeyRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.CreateApiKeyRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.CreateApiKeyRequest), - jsonSerializerContext) as global::Ideogram.CreateApiKeyRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.CreateApiKeyRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.CreateApiKeyRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.CreateApiKeyRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.CreateApiKeyRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.CreateApiKeyRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.CreateApiKeyRequest.g.cs deleted file mode 100644 index ce6a3c9f..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.CreateApiKeyRequest.g.cs +++ /dev/null @@ -1,46 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"label":"label"} - /// - public sealed partial class CreateApiKeyRequest - { - /// - /// User-supplied label shown alongside the key in the management UI. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("label")] - public string? Label { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// User-supplied label shown alongside the key in the management UI. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public CreateApiKeyRequest( - string? label) - { - this.Label = label; - } - - /// - /// Initializes a new instance of the class. - /// - public CreateApiKeyRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.CreateApiKeyResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.CreateApiKeyResponse.Json.g.cs deleted file mode 100644 index 4222e53c..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.CreateApiKeyResponse.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class CreateApiKeyResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.CreateApiKeyResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.CreateApiKeyResponse), - jsonSerializerContext) as global::Ideogram.CreateApiKeyResponse; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.CreateApiKeyResponse? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.CreateApiKeyResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.CreateApiKeyResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.CreateApiKeyResponse; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.CreateApiKeyResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.CreateApiKeyResponse.g.cs deleted file mode 100644 index 0aefecf7..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.CreateApiKeyResponse.g.cs +++ /dev/null @@ -1,80 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"creation_time":"2024-05-25T02:00:30\u002B00:00","api_key":"example_api_key_replace_with_your_actual_key","api_key_id":"JRPVD7jWR1aTBYiJ0UFVOg=="} - /// - public sealed partial class CreateApiKeyResponse - { - /// - /// The API key to use when making authenticated requests with the API. This key will only be shown once.
- /// Example: example_api_key_replace_with_your_actual_key - ///
- /// example_api_key_replace_with_your_actual_key - [global::System.Text.Json.Serialization.JsonPropertyName("api_key")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string ApiKey { get; set; } - - /// - /// The ID of the API key. A URL safe base64 encoded UUID
- /// Example: JRPVD7jWR1aTBYiJ0UFVOg== - ///
- /// JRPVD7jWR1aTBYiJ0UFVOg== - [global::System.Text.Json.Serialization.JsonPropertyName("api_key_id")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string ApiKeyId { get; set; } - - /// - /// The time at which the API key was created
- /// Example: 2024-05-25T02:00:30+00:00 - ///
- /// 2024-05-25T02:00:30+00:00 - [global::System.Text.Json.Serialization.JsonPropertyName("creation_time")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.DateTime CreationTime { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The API key to use when making authenticated requests with the API. This key will only be shown once.
- /// Example: example_api_key_replace_with_your_actual_key - /// - /// - /// The ID of the API key. A URL safe base64 encoded UUID
- /// Example: JRPVD7jWR1aTBYiJ0UFVOg== - /// - /// - /// The time at which the API key was created
- /// Example: 2024-05-25T02:00:30+00:00 - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public CreateApiKeyResponse( - string apiKey, - string apiKeyId, - global::System.DateTime creationTime) - { - this.ApiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey)); - this.ApiKeyId = apiKeyId ?? throw new global::System.ArgumentNullException(nameof(apiKeyId)); - this.CreationTime = creationTime; - } - - /// - /// Initializes a new instance of the class. - /// - public CreateApiKeyResponse() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.CreateDatasetRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.CreateDatasetRequest.Json.g.cs deleted file mode 100644 index 33f31fef..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.CreateDatasetRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class CreateDatasetRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.CreateDatasetRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.CreateDatasetRequest), - jsonSerializerContext) as global::Ideogram.CreateDatasetRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.CreateDatasetRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.CreateDatasetRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.CreateDatasetRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.CreateDatasetRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.CreateDatasetRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.CreateDatasetRequest.g.cs deleted file mode 100644 index c53335ae..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.CreateDatasetRequest.g.cs +++ /dev/null @@ -1,47 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"name":"name"} - /// - public sealed partial class CreateDatasetRequest - { - /// - /// Name of the dataset. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("name")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Name { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Name of the dataset. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public CreateDatasetRequest( - string name) - { - this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); - } - - /// - /// Initializes a new instance of the class. - /// - public CreateDatasetRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.CreditGrant.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.CreditGrant.Json.g.cs deleted file mode 100644 index f9b31262..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.CreditGrant.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class CreditGrant - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.CreditGrant? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.CreditGrant), - jsonSerializerContext) as global::Ideogram.CreditGrant; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.CreditGrant? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.CreditGrant? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.CreditGrant), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.CreditGrant; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.CreditGrant.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.CreditGrant.g.cs deleted file mode 100644 index 5f4f02ed..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.CreditGrant.g.cs +++ /dev/null @@ -1,127 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"effective_at":"effective_at","amount_consumed":{"amount":1050,"currency_code":"USD"},"expires_at":"expires_at","amount_available":{"amount":1050,"currency_code":"USD"},"grant_id":"grant_id","name":"name","amount_issued":{"amount":1050,"currency_code":"USD"}} - /// - public sealed partial class CreditGrant - { - /// - /// The Metronome grant identifier. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("grant_id")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string GrantId { get; set; } - - /// - /// The grant name as shown in Metronome (e.g. "Ideogram API Usage"). - /// - [global::System.Text.Json.Serialization.JsonPropertyName("name")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Name { get; set; } - - /// - /// Represents a price.
- /// Example: {"amount":1050,"currency_code":"USD"} - ///
- /// {"amount":1050,"currency_code":"USD"} - [global::System.Text.Json.Serialization.JsonPropertyName("amount_issued")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.Price AmountIssued { get; set; } - - /// - /// Represents a price.
- /// Example: {"amount":1050,"currency_code":"USD"} - ///
- /// {"amount":1050,"currency_code":"USD"} - [global::System.Text.Json.Serialization.JsonPropertyName("amount_consumed")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.Price AmountConsumed { get; set; } - - /// - /// Represents a price.
- /// Example: {"amount":1050,"currency_code":"USD"} - ///
- /// {"amount":1050,"currency_code":"USD"} - [global::System.Text.Json.Serialization.JsonPropertyName("amount_available")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.Price AmountAvailable { get; set; } - - /// - /// ISO-8601 timestamp when the grant becomes effective. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("effective_at")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string EffectiveAt { get; set; } - - /// - /// ISO-8601 timestamp when the grant expires. Omitted if the grant has no expiration. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("expires_at")] - public string? ExpiresAt { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The Metronome grant identifier. - /// - /// - /// The grant name as shown in Metronome (e.g. "Ideogram API Usage"). - /// - /// - /// Represents a price.
- /// Example: {"amount":1050,"currency_code":"USD"} - /// - /// - /// Represents a price.
- /// Example: {"amount":1050,"currency_code":"USD"} - /// - /// - /// Represents a price.
- /// Example: {"amount":1050,"currency_code":"USD"} - /// - /// - /// ISO-8601 timestamp when the grant becomes effective. - /// - /// - /// ISO-8601 timestamp when the grant expires. Omitted if the grant has no expiration. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public CreditGrant( - string grantId, - string name, - global::Ideogram.Price amountIssued, - global::Ideogram.Price amountConsumed, - global::Ideogram.Price amountAvailable, - string effectiveAt, - string? expiresAt) - { - this.GrantId = grantId ?? throw new global::System.ArgumentNullException(nameof(grantId)); - this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); - this.AmountIssued = amountIssued ?? throw new global::System.ArgumentNullException(nameof(amountIssued)); - this.AmountConsumed = amountConsumed ?? throw new global::System.ArgumentNullException(nameof(amountConsumed)); - this.AmountAvailable = amountAvailable ?? throw new global::System.ArgumentNullException(nameof(amountAvailable)); - this.EffectiveAt = effectiveAt ?? throw new global::System.ArgumentNullException(nameof(effectiveAt)); - this.ExpiresAt = expiresAt; - } - - /// - /// Initializes a new instance of the class. - /// - public CreditGrant() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.CustomModel.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.CustomModel.Json.g.cs deleted file mode 100644 index 569b5e92..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.CustomModel.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class CustomModel - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.CustomModel? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.CustomModel), - jsonSerializerContext) as global::Ideogram.CustomModel; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.CustomModel? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.CustomModel? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.CustomModel), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.CustomModel; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.CustomModel.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.CustomModel.g.cs deleted file mode 100644 index ebe638a8..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.CustomModel.g.cs +++ /dev/null @@ -1,162 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// A custom model.
- /// Example: {"creation_time":"2000-01-23T04:56:07\u002B00:00","last_update_time":"2000-01-23T04:56:07\u002B00:00","is_available_for_generation":true,"dataset_id":"dataset_id","name":"name","is_owned":true,"training_runs":[{"creation_time":"2000-01-23T04:56:07\u002B00:00","last_update_time":"2000-01-23T04:56:07\u002B00:00","lora_rank":6,"num_chips":1,"training_run_id":"training_run_id","ema":5.962133916683182,"training_steps":0,"learning_rate":5.637376656633329,"status":null},{"creation_time":"2000-01-23T04:56:07\u002B00:00","last_update_time":"2000-01-23T04:56:07\u002B00:00","lora_rank":6,"num_chips":1,"training_run_id":"training_run_id","ema":5.962133916683182,"training_steps":0,"learning_rate":5.637376656633329,"status":null}],"model_id":"model_id","custom_model_uri":"model/my-custom-model/version/1","status":null} - ///
- public sealed partial class CustomModel - { - /// - /// Unique identifier for the model (base64 URL-safe encoded UUID). - /// - [global::System.Text.Json.Serialization.JsonPropertyName("model_id")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string ModelId { get; set; } - - /// - /// A custom model URI in the format model/<model_name>/version/<version_name>.
- /// Use this URI when generating images with this model. Only present for models
- /// that have been registered in the model registry.
- /// Example: model/my-custom-model/version/1 - ///
- /// model/my-custom-model/version/1 - [global::System.Text.Json.Serialization.JsonPropertyName("custom_model_uri")] - public string? CustomModelUri { get; set; } - - /// - /// Display name of the model. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("name")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Name { get; set; } - - /// - /// The status of a custom model. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("status")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ModelStatusJsonConverter))] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.ModelStatus Status { get; set; } - - /// - /// ID of the dataset (collection) the model was trained from. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("dataset_id")] - public string? DatasetId { get; set; } - - /// - /// When the model was created. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("creation_time")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.DateTime CreationTime { get; set; } - - /// - /// When the model was last updated. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("last_update_time")] - public global::System.DateTime? LastUpdateTime { get; set; } - - /// - /// Whether the model is available for image generation. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("is_available_for_generation")] - [global::System.Text.Json.Serialization.JsonRequired] - public required bool IsAvailableForGeneration { get; set; } - - /// - /// Whether the authenticated user owns this model. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("is_owned")] - [global::System.Text.Json.Serialization.JsonRequired] - public required bool IsOwned { get; set; } - - /// - /// Training run history. Only populated on the get-by-ID endpoint and only for owned models.
- /// Default Value: [] - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("training_runs")] - public global::System.Collections.Generic.IList? TrainingRuns { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Unique identifier for the model (base64 URL-safe encoded UUID). - /// - /// - /// Display name of the model. - /// - /// - /// The status of a custom model. - /// - /// - /// When the model was created. - /// - /// - /// Whether the model is available for image generation. - /// - /// - /// Whether the authenticated user owns this model. - /// - /// - /// A custom model URI in the format model/<model_name>/version/<version_name>.
- /// Use this URI when generating images with this model. Only present for models
- /// that have been registered in the model registry.
- /// Example: model/my-custom-model/version/1 - /// - /// - /// ID of the dataset (collection) the model was trained from. - /// - /// - /// When the model was last updated. - /// - /// - /// Training run history. Only populated on the get-by-ID endpoint and only for owned models.
- /// Default Value: [] - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public CustomModel( - string modelId, - string name, - global::Ideogram.ModelStatus status, - global::System.DateTime creationTime, - bool isAvailableForGeneration, - bool isOwned, - string? customModelUri, - string? datasetId, - global::System.DateTime? lastUpdateTime, - global::System.Collections.Generic.IList? trainingRuns) - { - this.ModelId = modelId ?? throw new global::System.ArgumentNullException(nameof(modelId)); - this.CustomModelUri = customModelUri; - this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); - this.Status = status; - this.DatasetId = datasetId; - this.CreationTime = creationTime; - this.LastUpdateTime = lastUpdateTime; - this.IsAvailableForGeneration = isAvailableForGeneration; - this.IsOwned = isOwned; - this.TrainingRuns = trainingRuns; - } - - /// - /// Initializes a new instance of the class. - /// - public CustomModel() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.Dataset.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.Dataset.Json.g.cs deleted file mode 100644 index 31f8b79f..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.Dataset.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class Dataset - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.Dataset? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.Dataset), - jsonSerializerContext) as global::Ideogram.Dataset; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.Dataset? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.Dataset? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.Dataset), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.Dataset; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.Dataset.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.Dataset.g.cs deleted file mode 100644 index dcbe06ce..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.Dataset.g.cs +++ /dev/null @@ -1,98 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// A dataset for organizing training images.
- /// Example: {"creation_time":"2000-01-23T04:56:07\u002B00:00","user_id":"user_id","dataset_id":"dataset_id","name":"name","cover_asset_identifier":{"collection_id":"collection_id","asset_type":null,"asset_id":"asset_id"}} - ///
- public sealed partial class Dataset - { - /// - /// Unique identifier for the dataset. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("dataset_id")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string DatasetId { get; set; } - - /// - /// Display name of the dataset. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("name")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Name { get; set; } - - /// - /// ID of the user who owns this dataset. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("user_id")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string UserId { get; set; } - - /// - /// When the dataset was created. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("creation_time")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.DateTime CreationTime { get; set; } - - /// - /// Cover asset of the dataset, null if not set.
- /// Example: {"collection_id":"collection_id","asset_type":null,"asset_id":"asset_id"} - ///
- /// {"collection_id":"collection_id","asset_type":null,"asset_id":"asset_id"} - [global::System.Text.Json.Serialization.JsonPropertyName("cover_asset_identifier")] - public global::Ideogram.AssetIdentifier? CoverAssetIdentifier { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Unique identifier for the dataset. - /// - /// - /// Display name of the dataset. - /// - /// - /// ID of the user who owns this dataset. - /// - /// - /// When the dataset was created. - /// - /// - /// Cover asset of the dataset, null if not set.
- /// Example: {"collection_id":"collection_id","asset_type":null,"asset_id":"asset_id"} - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public Dataset( - string datasetId, - string name, - string userId, - global::System.DateTime creationTime, - global::Ideogram.AssetIdentifier? coverAssetIdentifier) - { - this.DatasetId = datasetId ?? throw new global::System.ArgumentNullException(nameof(datasetId)); - this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); - this.UserId = userId ?? throw new global::System.ArgumentNullException(nameof(userId)); - this.CreationTime = creationTime; - this.CoverAssetIdentifier = coverAssetIdentifier; - } - - /// - /// Initializes a new instance of the class. - /// - public Dataset() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.DatasetAssetFailureReason.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.DatasetAssetFailureReason.g.cs deleted file mode 100644 index e54f2b2a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.DatasetAssetFailureReason.g.cs +++ /dev/null @@ -1,87 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Reason why an asset failed to upload. - /// - public enum DatasetAssetFailureReason - { - /// - /// - /// - FailedSafetyCheck, - /// - /// - /// - FileTooLarge, - /// - /// - /// - InternalError, - /// - /// - /// - InvalidCaption, - /// - /// - /// - InvalidCaptionJson, - /// - /// - /// - InvalidImage, - /// - /// - /// - InvalidZip, - /// - /// - /// - TooManyImages, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class DatasetAssetFailureReasonExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this DatasetAssetFailureReason value) - { - return value switch - { - DatasetAssetFailureReason.FailedSafetyCheck => "FAILED_SAFETY_CHECK", - DatasetAssetFailureReason.FileTooLarge => "FILE_TOO_LARGE", - DatasetAssetFailureReason.InternalError => "INTERNAL_ERROR", - DatasetAssetFailureReason.InvalidCaption => "INVALID_CAPTION", - DatasetAssetFailureReason.InvalidCaptionJson => "INVALID_CAPTION_JSON", - DatasetAssetFailureReason.InvalidImage => "INVALID_IMAGE", - DatasetAssetFailureReason.InvalidZip => "INVALID_ZIP", - DatasetAssetFailureReason.TooManyImages => "TOO_MANY_IMAGES", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static DatasetAssetFailureReason? ToEnum(string value) - { - return value switch - { - "FAILED_SAFETY_CHECK" => DatasetAssetFailureReason.FailedSafetyCheck, - "FILE_TOO_LARGE" => DatasetAssetFailureReason.FileTooLarge, - "INTERNAL_ERROR" => DatasetAssetFailureReason.InternalError, - "INVALID_CAPTION" => DatasetAssetFailureReason.InvalidCaption, - "INVALID_CAPTION_JSON" => DatasetAssetFailureReason.InvalidCaptionJson, - "INVALID_IMAGE" => DatasetAssetFailureReason.InvalidImage, - "INVALID_ZIP" => DatasetAssetFailureReason.InvalidZip, - "TOO_MANY_IMAGES" => DatasetAssetFailureReason.TooManyImages, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.DatasetCoverAssetIdentifier.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.DatasetCoverAssetIdentifier.Json.g.cs deleted file mode 100644 index 723dc189..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.DatasetCoverAssetIdentifier.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public readonly partial struct DatasetCoverAssetIdentifier - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.DatasetCoverAssetIdentifier? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.DatasetCoverAssetIdentifier), - jsonSerializerContext) as global::Ideogram.DatasetCoverAssetIdentifier?; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.DatasetCoverAssetIdentifier? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.DatasetCoverAssetIdentifier? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.DatasetCoverAssetIdentifier), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.DatasetCoverAssetIdentifier?; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.DatasetCoverAssetIdentifier.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.DatasetCoverAssetIdentifier.g.cs deleted file mode 100644 index 8807d72a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.DatasetCoverAssetIdentifier.g.cs +++ /dev/null @@ -1,204 +0,0 @@ -#pragma warning disable CS0618 // Type or member is obsolete - -#nullable enable - -namespace Ideogram -{ - /// - /// Cover asset of the dataset, null if not set.
- /// Example: {"collection_id":"collection_id","asset_type":null,"asset_id":"asset_id"} - ///
- public readonly partial struct DatasetCoverAssetIdentifier : global::System.IEquatable - { - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - ///
-#if NET6_0_OR_GREATER - public global::Ideogram.AssetIdentifier? AssetIdentifier { get; init; } -#else - public global::Ideogram.AssetIdentifier? AssetIdentifier { get; } -#endif - - /// - /// - /// -#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(AssetIdentifier))] -#endif - public bool IsAssetIdentifier => AssetIdentifier != null; - - /// - /// - /// - public bool TryPickAssetIdentifier( -#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] -#endif - out global::Ideogram.AssetIdentifier? value) - { - value = AssetIdentifier; - return IsAssetIdentifier; - } - - /// - /// - /// - public global::Ideogram.AssetIdentifier PickAssetIdentifier() => AssetIdentifier is { } value - ? value - : throw new global::System.InvalidOperationException($"Expected union variant 'AssetIdentifier' but the value was {ToString()}."); - /// - /// - /// - public static implicit operator DatasetCoverAssetIdentifier(global::Ideogram.AssetIdentifier value) => new DatasetCoverAssetIdentifier((global::Ideogram.AssetIdentifier?)value); - - /// - /// - /// - public static implicit operator global::Ideogram.AssetIdentifier?(DatasetCoverAssetIdentifier @this) => @this.AssetIdentifier; - - /// - /// - /// - public DatasetCoverAssetIdentifier(global::Ideogram.AssetIdentifier? value) - { - AssetIdentifier = value; - } - - /// - /// - /// - public static DatasetCoverAssetIdentifier FromAssetIdentifier(global::Ideogram.AssetIdentifier? value) => new DatasetCoverAssetIdentifier(value); - - /// - /// - /// - public object? Object => - AssetIdentifier as object - ; - - /// - /// - /// - public override string? ToString() => - AssetIdentifier?.ToString() - ; - - /// - /// - /// - public bool Validate() - { - return IsAssetIdentifier; - } - - /// - /// - /// - public TResult? Match( - global::System.Func? assetIdentifier = null, - bool validate = true) - { - if (validate) - { - Validate(); - } - - if (AssetIdentifier is { } __value0 && assetIdentifier != null) - { - return assetIdentifier(__value0); - } - - return default(TResult); - } - - /// - /// - /// - public void Match( - global::System.Action? assetIdentifier = null, - bool validate = true) - { - if (validate) - { - Validate(); - } - - if (AssetIdentifier is { } __value0) - { - assetIdentifier?.Invoke(__value0); - } - } - - /// - /// - /// - public void Switch( - global::System.Action? assetIdentifier = null, - bool validate = true) - { - if (validate) - { - Validate(); - } - - if (AssetIdentifier is { } __value0) - { - assetIdentifier?.Invoke(__value0); - } - } - - /// - /// - /// - public override int GetHashCode() - { - var fields = new object?[] - { - AssetIdentifier, - typeof(global::Ideogram.AssetIdentifier), - }; - const int offset = unchecked((int)2166136261); - const int prime = 16777619; - static int HashCodeAggregator(int hashCode, object? value) => value == null - ? (hashCode ^ 0) * prime - : (hashCode ^ value.GetHashCode()) * prime; - - return global::System.Linq.Enumerable.Aggregate(fields, offset, HashCodeAggregator); - } - - /// - /// - /// - public bool Equals(DatasetCoverAssetIdentifier other) - { - return - global::System.Collections.Generic.EqualityComparer.Default.Equals(AssetIdentifier, other.AssetIdentifier) - ; - } - - /// - /// - /// - public static bool operator ==(DatasetCoverAssetIdentifier obj1, DatasetCoverAssetIdentifier obj2) - { - return global::System.Collections.Generic.EqualityComparer.Default.Equals(obj1, obj2); - } - - /// - /// - /// - public static bool operator !=(DatasetCoverAssetIdentifier obj1, DatasetCoverAssetIdentifier obj2) - { - return !(obj1 == obj2); - } - - /// - /// - /// - public override bool Equals(object? obj) - { - return obj is DatasetCoverAssetIdentifier o && Equals(o); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.DatasetFile.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.DatasetFile.Json.g.cs deleted file mode 100644 index 7a9d8b47..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.DatasetFile.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class DatasetFile - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.DatasetFile? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.DatasetFile), - jsonSerializerContext) as global::Ideogram.DatasetFile; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.DatasetFile? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.DatasetFile? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.DatasetFile), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.DatasetFile; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.DatasetFile.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.DatasetFile.g.cs deleted file mode 100644 index 1e6c8478..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.DatasetFile.g.cs +++ /dev/null @@ -1,69 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// A file in a dataset.
- /// Example: {"file_name":"file_name","caption":"caption","file_size_bytes":6} - ///
- public sealed partial class DatasetFile - { - /// - /// Filename of the file in the dataset. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("file_name")] - public string? FileName { get; set; } - - /// - /// Size of the file in bytes, if available. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("file_size_bytes")] - public long? FileSizeBytes { get; set; } - - /// - /// Caption applied to the file, if any. A v4 structured caption is returned as a JSON-encoded string; a plain-text caption (from a .txt sidecar) is returned unchanged. Only present when the file has a caption. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("caption")] - public string? Caption { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Filename of the file in the dataset. - /// - /// - /// Size of the file in bytes, if available. - /// - /// - /// Caption applied to the file, if any. A v4 structured caption is returned as a JSON-encoded string; a plain-text caption (from a .txt sidecar) is returned unchanged. Only present when the file has a caption. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public DatasetFile( - string? fileName, - long? fileSizeBytes, - string? caption) - { - this.FileName = fileName; - this.FileSizeBytes = fileSizeBytes; - this.Caption = caption; - } - - /// - /// Initializes a new instance of the class. - /// - public DatasetFile() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.DatasetUploadFailedAsset.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.DatasetUploadFailedAsset.Json.g.cs deleted file mode 100644 index 12ae6bc1..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.DatasetUploadFailedAsset.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class DatasetUploadFailedAsset - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.DatasetUploadFailedAsset? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.DatasetUploadFailedAsset), - jsonSerializerContext) as global::Ideogram.DatasetUploadFailedAsset; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.DatasetUploadFailedAsset? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.DatasetUploadFailedAsset? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.DatasetUploadFailedAsset), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.DatasetUploadFailedAsset; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.DatasetUploadFailedAsset.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.DatasetUploadFailedAsset.g.cs deleted file mode 100644 index 25ef364b..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.DatasetUploadFailedAsset.g.cs +++ /dev/null @@ -1,59 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"file_name":"file_name","failure_reason":null} - /// - public sealed partial class DatasetUploadFailedAsset - { - /// - /// Original filename of the failed image. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("file_name")] - public string? FileName { get; set; } - - /// - /// Reason why an asset failed to upload. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("failure_reason")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.DatasetAssetFailureReasonJsonConverter))] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.DatasetAssetFailureReason FailureReason { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Reason why an asset failed to upload. - /// - /// - /// Original filename of the failed image. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public DatasetUploadFailedAsset( - global::Ideogram.DatasetAssetFailureReason failureReason, - string? fileName) - { - this.FileName = fileName; - this.FailureReason = failureReason; - } - - /// - /// Initializes a new instance of the class. - /// - public DatasetUploadFailedAsset() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.DatasetUploadSucceededAsset.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.DatasetUploadSucceededAsset.Json.g.cs deleted file mode 100644 index 073c08b7..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.DatasetUploadSucceededAsset.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class DatasetUploadSucceededAsset - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.DatasetUploadSucceededAsset? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.DatasetUploadSucceededAsset), - jsonSerializerContext) as global::Ideogram.DatasetUploadSucceededAsset; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.DatasetUploadSucceededAsset? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.DatasetUploadSucceededAsset? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.DatasetUploadSucceededAsset), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.DatasetUploadSucceededAsset; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.DatasetUploadSucceededAsset.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.DatasetUploadSucceededAsset.g.cs deleted file mode 100644 index c948ad2f..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.DatasetUploadSucceededAsset.g.cs +++ /dev/null @@ -1,58 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"asset_identifier":"","file_name":"file_name"} - /// - public sealed partial class DatasetUploadSucceededAsset - { - /// - /// The uploaded image's asset identifier. For a caption sidecar entry, points to the image the caption was applied to. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("asset_identifier")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.AssetIdentifier AssetIdentifier { get; set; } - - /// - /// Original filename of the uploaded file. For a caption sidecar (.txt or .json) this is the sidecar's filename. A single image therefore yields one entry for the image plus one per caption file. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("file_name")] - public string? FileName { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The uploaded image's asset identifier. For a caption sidecar entry, points to the image the caption was applied to. - /// - /// - /// Original filename of the uploaded file. For a caption sidecar (.txt or .json) this is the sidecar's filename. A single image therefore yields one entry for the image plus one per caption file. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public DatasetUploadSucceededAsset( - global::Ideogram.AssetIdentifier assetIdentifier, - string? fileName) - { - this.AssetIdentifier = assetIdentifier ?? throw new global::System.ArgumentNullException(nameof(assetIdentifier)); - this.FileName = fileName; - } - - /// - /// Initializes a new instance of the class. - /// - public DatasetUploadSucceededAsset() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.DemoteOrganizationAdminsRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.DemoteOrganizationAdminsRequest.Json.g.cs deleted file mode 100644 index 9c3437c4..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.DemoteOrganizationAdminsRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class DemoteOrganizationAdminsRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.DemoteOrganizationAdminsRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.DemoteOrganizationAdminsRequest), - jsonSerializerContext) as global::Ideogram.DemoteOrganizationAdminsRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.DemoteOrganizationAdminsRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.DemoteOrganizationAdminsRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.DemoteOrganizationAdminsRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.DemoteOrganizationAdminsRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.DemoteOrganizationAdminsRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.DemoteOrganizationAdminsRequest.g.cs deleted file mode 100644 index aab054fb..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.DemoteOrganizationAdminsRequest.g.cs +++ /dev/null @@ -1,49 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"members":[{"display_handle":"john_doe","email_address":"john.doe@example.com","user_id":"dXNlcl8xMjM"},{"display_handle":"john_doe","email_address":"john.doe@example.com","user_id":"dXNlcl8xMjM"}]} - /// - public sealed partial class DemoteOrganizationAdminsRequest - { - /// - /// List of admins to demote back to MEMBER role
- /// Default Value: [] - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("members")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList Members { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// List of admins to demote back to MEMBER role
- /// Default Value: [] - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public DemoteOrganizationAdminsRequest( - global::System.Collections.Generic.IList members) - { - this.Members = members ?? throw new global::System.ArgumentNullException(nameof(members)); - } - - /// - /// Initializes a new instance of the class. - /// - public DemoteOrganizationAdminsRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.DescribeImageIdeogramV3Request.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.DescribeImageIdeogramV3Request.Json.g.cs deleted file mode 100644 index 97289ff8..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.DescribeImageIdeogramV3Request.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class DescribeImageIdeogramV3Request - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.DescribeImageIdeogramV3Request? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.DescribeImageIdeogramV3Request), - jsonSerializerContext) as global::Ideogram.DescribeImageIdeogramV3Request; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.DescribeImageIdeogramV3Request? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.DescribeImageIdeogramV3Request? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.DescribeImageIdeogramV3Request), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.DescribeImageIdeogramV3Request; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.DescribeImageIdeogramV3Request.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.DescribeImageIdeogramV3Request.g.cs deleted file mode 100644 index b56024b1..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.DescribeImageIdeogramV3Request.g.cs +++ /dev/null @@ -1,72 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// A request to describe one image. Upload the image as `image` using
- /// `multipart/form-data`. - ///
- public sealed partial class DescribeImageIdeogramV3Request - { - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - ///
- /// {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - [global::System.Text.Json.Serialization.JsonPropertyName("image_asset_identifier")] - public global::Ideogram.AssetIdentifier? ImageAssetIdentifier { get; set; } - - /// - /// The image to describe (max 10MB). JPEG, PNG, and WebP are supported. Multipart requests only. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image")] - public byte[]? Image { get; set; } - - /// - /// The image to describe (max 10MB). JPEG, PNG, and WebP are supported. Multipart requests only. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] - public string? Imagename { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The image to describe (max 10MB). JPEG, PNG, and WebP are supported. Multipart requests only. - /// - /// - /// The image to describe (max 10MB). JPEG, PNG, and WebP are supported. Multipart requests only. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public DescribeImageIdeogramV3Request( - global::Ideogram.AssetIdentifier? imageAssetIdentifier, - byte[]? image, - string? imagename) - { - this.ImageAssetIdentifier = imageAssetIdentifier; - this.Image = image; - this.Imagename = imagename; - } - - /// - /// Initializes a new instance of the class. - /// - public DescribeImageIdeogramV3Request() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.DescribeImageIdeogramV3Response.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.DescribeImageIdeogramV3Response.g.cs index 6a7cff93..455e32fb 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.DescribeImageIdeogramV3Response.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.DescribeImageIdeogramV3Response.g.cs @@ -4,8 +4,7 @@ namespace Ideogram { /// - /// Response returned by `POST /v2/image/describe/ideogram-3`.
- /// Example: {"description_id":"description_id","created":"2000-01-23T04:56:07\u002B00:00","descriptions":[{"text":"text"},{"text":"text"}]} + /// Response returned by `POST /v2/image/describe/ideogram-3`. ///
public sealed partial class DescribeImageIdeogramV3Response { diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.DescribeImageIdeogramV4Request.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.DescribeImageIdeogramV4Request.Json.g.cs deleted file mode 100644 index 5db040b3..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.DescribeImageIdeogramV4Request.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class DescribeImageIdeogramV4Request - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.DescribeImageIdeogramV4Request? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.DescribeImageIdeogramV4Request), - jsonSerializerContext) as global::Ideogram.DescribeImageIdeogramV4Request; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.DescribeImageIdeogramV4Request? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.DescribeImageIdeogramV4Request? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.DescribeImageIdeogramV4Request), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.DescribeImageIdeogramV4Request; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.DescribeImageIdeogramV4Request.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.DescribeImageIdeogramV4Request.g.cs deleted file mode 100644 index 60a159aa..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.DescribeImageIdeogramV4Request.g.cs +++ /dev/null @@ -1,111 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// A request to describe one image. Upload the image as `image` using
- /// `multipart/form-data`. - ///
- public sealed partial class DescribeImageIdeogramV4Request - { - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - ///
- /// {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - [global::System.Text.Json.Serialization.JsonPropertyName("image_asset_identifier")] - public global::Ideogram.AssetIdentifier? ImageAssetIdentifier { get; set; } - - /// - /// The image to describe (max 10MB). JPEG, PNG, and WebP are supported. Multipart requests only. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image")] - public byte[]? Image { get; set; } - - /// - /// The image to describe (max 10MB). JPEG, PNG, and WebP are supported. Multipart requests only. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] - public string? Imagename { get; set; } - - /// - /// Whether to include bounding boxes for the subjects and text in the returned `json_prompt`. Defaults to true, so the prompt preserves the layout of the described image.
- /// Default Value: true - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("include_bbox")] - public bool? IncludeBbox { get; set; } - - /// - /// Whether to include a free-form style description in the returned `json_prompt`. Defaults to false.
- /// Default Value: false - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("include_style_descriptions")] - public bool? IncludeStyleDescriptions { get; set; } - - /// - /// Whether to include free-form tags in the returned `json_prompt`. Defaults to false.
- /// Default Value: false - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("include_tags")] - public bool? IncludeTags { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The image to describe (max 10MB). JPEG, PNG, and WebP are supported. Multipart requests only. - /// - /// - /// The image to describe (max 10MB). JPEG, PNG, and WebP are supported. Multipart requests only. - /// - /// - /// Whether to include bounding boxes for the subjects and text in the returned `json_prompt`. Defaults to true, so the prompt preserves the layout of the described image.
- /// Default Value: true - /// - /// - /// Whether to include a free-form style description in the returned `json_prompt`. Defaults to false.
- /// Default Value: false - /// - /// - /// Whether to include free-form tags in the returned `json_prompt`. Defaults to false.
- /// Default Value: false - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public DescribeImageIdeogramV4Request( - global::Ideogram.AssetIdentifier? imageAssetIdentifier, - byte[]? image, - string? imagename, - bool? includeBbox, - bool? includeStyleDescriptions, - bool? includeTags) - { - this.ImageAssetIdentifier = imageAssetIdentifier; - this.Image = image; - this.Imagename = imagename; - this.IncludeBbox = includeBbox; - this.IncludeStyleDescriptions = includeStyleDescriptions; - this.IncludeTags = includeTags; - } - - /// - /// Initializes a new instance of the class. - /// - public DescribeImageIdeogramV4Request() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.DescribeImageIdeogramV4Response.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.DescribeImageIdeogramV4Response.g.cs index 9f484c20..a7585cba 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.DescribeImageIdeogramV4Response.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.DescribeImageIdeogramV4Response.g.cs @@ -7,8 +7,7 @@ namespace Ideogram /// Response returned by `POST /v2/image/describe/ideogram-4`.
/// The `json_prompt` field is a structured `V4JsonPrompt` that can be
/// passed back as `json_prompt` to the `/v1/ideogram-v4/generate` family
- /// of endpoints.
- /// Example: {"description_id":"description_id","created":"2000-01-23T04:56:07\u002B00:00","json_prompt":{"high_level_description":"high_level_description","style_description":{"photo":"photo","art_style":"art_style","medium":"medium","aesthetics":"aesthetics","lighting":"lighting","color_palette":["#FFD700","#FFD700"]},"compositional_deconstruction":{"background":"background","elements":[{"bbox":[0,0,1000,1000],"type":"obj","desc":"desc","color_palette":["#FFD700","#FFD700"]},{"bbox":[0,0,1000,1000],"type":"obj","desc":"desc","color_palette":["#FFD700","#FFD700"]}]},"tags":["tags","tags"]}} + /// of endpoints. /// public sealed partial class DescribeImageIdeogramV4Response { @@ -30,10 +29,8 @@ public sealed partial class DescribeImageIdeogramV4Response /// Structured prompt for Ideogram 4.0 generation. When `json_prompt` is
/// supplied, magic-prompt is disabled and the diffusion model consumes
/// the JSON contract directly. Mutually exclusive with `text_prompt`
- /// and the legacy `prompt` field.
- /// Example: {"high_level_description":"high_level_description","style_description":{"photo":"photo","art_style":"art_style","medium":"medium","aesthetics":"aesthetics","lighting":"lighting","color_palette":["#FFD700","#FFD700"]},"compositional_deconstruction":{"background":"background","elements":[{"bbox":[0,0,1000,1000],"type":"obj","desc":"desc","color_palette":["#FFD700","#FFD700"]},{"bbox":[0,0,1000,1000],"type":"obj","desc":"desc","color_palette":["#FFD700","#FFD700"]}]},"tags":["tags","tags"]} + /// and the legacy `prompt` field. /// - /// {"high_level_description":"high_level_description","style_description":{"photo":"photo","art_style":"art_style","medium":"medium","aesthetics":"aesthetics","lighting":"lighting","color_palette":["#FFD700","#FFD700"]},"compositional_deconstruction":{"background":"background","elements":[{"bbox":[0,0,1000,1000],"type":"obj","desc":"desc","color_palette":["#FFD700","#FFD700"]},{"bbox":[0,0,1000,1000],"type":"obj","desc":"desc","color_palette":["#FFD700","#FFD700"]}]},"tags":["tags","tags"]} [global::System.Text.Json.Serialization.JsonPropertyName("json_prompt")] [global::System.Text.Json.Serialization.JsonRequired] public required global::Ideogram.V4JsonPrompt JsonPrompt { get; set; } @@ -57,8 +54,7 @@ public sealed partial class DescribeImageIdeogramV4Response /// Structured prompt for Ideogram 4.0 generation. When `json_prompt` is
/// supplied, magic-prompt is disabled and the diffusion model consumes
/// the JSON contract directly. Mutually exclusive with `text_prompt`
- /// and the legacy `prompt` field.
- /// Example: {"high_level_description":"high_level_description","style_description":{"photo":"photo","art_style":"art_style","medium":"medium","aesthetics":"aesthetics","lighting":"lighting","color_palette":["#FFD700","#FFD700"]},"compositional_deconstruction":{"background":"background","elements":[{"bbox":[0,0,1000,1000],"type":"obj","desc":"desc","color_palette":["#FFD700","#FFD700"]},{"bbox":[0,0,1000,1000],"type":"obj","desc":"desc","color_palette":["#FFD700","#FFD700"]}]},"tags":["tags","tags"]} + /// and the legacy `prompt` field. /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.DescribeModelVersion.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.DescribeModelVersion.g.cs deleted file mode 100644 index e78b73c4..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.DescribeModelVersion.g.cs +++ /dev/null @@ -1,64 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The model version to use for describing images. Defaults to V_3.
- /// Default Value: V_3 - ///
- public enum DescribeModelVersion - { - /// - /// - /// - Custom, - /// - /// - /// - V2, - /// - /// - /// - V3, - /// - /// - /// - V4, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class DescribeModelVersionExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this DescribeModelVersion value) - { - return value switch - { - DescribeModelVersion.Custom => "CUSTOM", - DescribeModelVersion.V2 => "V_2", - DescribeModelVersion.V3 => "V_3", - DescribeModelVersion.V4 => "V_4", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static DescribeModelVersion? ToEnum(string value) - { - return value switch - { - "CUSTOM" => DescribeModelVersion.Custom, - "V_2" => DescribeModelVersion.V2, - "V_3" => DescribeModelVersion.V3, - "V_4" => DescribeModelVersion.V4, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.DescribeRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.DescribeRequest.Json.g.cs deleted file mode 100644 index cc742828..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.DescribeRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class DescribeRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.DescribeRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.DescribeRequest), - jsonSerializerContext) as global::Ideogram.DescribeRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.DescribeRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.DescribeRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.DescribeRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.DescribeRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.DescribeRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.DescribeRequest.g.cs deleted file mode 100644 index cc697a46..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.DescribeRequest.g.cs +++ /dev/null @@ -1,73 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - public sealed partial class DescribeRequest - { - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image_file")] - [global::System.Text.Json.Serialization.JsonRequired] - public required byte[] ImageFile { get; set; } - - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image_filename")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string ImageFilename { get; set; } - - /// - /// The model version to use for describing images. Defaults to V_3.
- /// Default Value: V_3 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("describe_model_version")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.DescribeModelVersionJsonConverter))] - public global::Ideogram.DescribeModelVersion? DescribeModelVersion { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The model version to use for describing images. Defaults to V_3.
- /// Default Value: V_3 - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public DescribeRequest( - byte[] imageFile, - string imageFilename, - global::Ideogram.DescribeModelVersion? describeModelVersion) - { - this.ImageFile = imageFile ?? throw new global::System.ArgumentNullException(nameof(imageFile)); - this.ImageFilename = imageFilename ?? throw new global::System.ArgumentNullException(nameof(imageFilename)); - this.DescribeModelVersion = describeModelVersion; - } - - /// - /// Initializes a new instance of the class. - /// - public DescribeRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.DescribeRequestV4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.DescribeRequestV4.Json.g.cs deleted file mode 100644 index 7b1c8b5f..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.DescribeRequestV4.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class DescribeRequestV4 - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.DescribeRequestV4? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.DescribeRequestV4), - jsonSerializerContext) as global::Ideogram.DescribeRequestV4; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.DescribeRequestV4? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.DescribeRequestV4? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.DescribeRequestV4), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.DescribeRequestV4; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.DescribeRequestV4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.DescribeRequestV4.g.cs deleted file mode 100644 index eaa7486b..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.DescribeRequestV4.g.cs +++ /dev/null @@ -1,116 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - public sealed partial class DescribeRequestV4 - { - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image_file")] - [global::System.Text.Json.Serialization.JsonRequired] - public required byte[] ImageFile { get; set; } - - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image_filename")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string ImageFilename { get; set; } - - /// - /// When true (default), the response preserves bounding boxes on each
- /// element so the prompt can be pasted into `/v1/ideogram-v4/generate`
- /// as `json_prompt` and reproduce the source layout. Set to false to
- /// drop bounding boxes and let the sampler place elements freely.
- /// Default Value: true - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("include_bbox")] - public bool? IncludeBbox { get; set; } - - /// - /// When false (default), the response omits `json_prompt.style_description`
- /// to match the contract used by `/v1/ideogram-v4/generate`'s `json_prompt`
- /// input. Set to true to surface the captioner's source-image style
- /// description in the response.
- /// Default Value: false - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("include_style_descriptions")] - public bool? IncludeStyleDescriptions { get; set; } - - /// - /// When false (default), the response omits `json_prompt.tags` to match
- /// the contract used by `/v1/ideogram-v4/generate`'s `json_prompt`
- /// input. Set to true to surface the captioner's free-form tags on the
- /// response.
- /// Default Value: false - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("include_tags")] - public bool? IncludeTags { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// When true (default), the response preserves bounding boxes on each
- /// element so the prompt can be pasted into `/v1/ideogram-v4/generate`
- /// as `json_prompt` and reproduce the source layout. Set to false to
- /// drop bounding boxes and let the sampler place elements freely.
- /// Default Value: true - /// - /// - /// When false (default), the response omits `json_prompt.style_description`
- /// to match the contract used by `/v1/ideogram-v4/generate`'s `json_prompt`
- /// input. Set to true to surface the captioner's source-image style
- /// description in the response.
- /// Default Value: false - /// - /// - /// When false (default), the response omits `json_prompt.tags` to match
- /// the contract used by `/v1/ideogram-v4/generate`'s `json_prompt`
- /// input. Set to true to surface the captioner's free-form tags on the
- /// response.
- /// Default Value: false - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public DescribeRequestV4( - byte[] imageFile, - string imageFilename, - bool? includeBbox, - bool? includeStyleDescriptions, - bool? includeTags) - { - this.ImageFile = imageFile ?? throw new global::System.ArgumentNullException(nameof(imageFile)); - this.ImageFilename = imageFilename ?? throw new global::System.ArgumentNullException(nameof(imageFilename)); - this.IncludeBbox = includeBbox; - this.IncludeStyleDescriptions = includeStyleDescriptions; - this.IncludeTags = includeTags; - } - - /// - /// Initializes a new instance of the class. - /// - public DescribeRequestV4() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.DescribeResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.DescribeResponse.Json.g.cs deleted file mode 100644 index 5e66e7e7..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.DescribeResponse.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class DescribeResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.DescribeResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.DescribeResponse), - jsonSerializerContext) as global::Ideogram.DescribeResponse; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.DescribeResponse? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.DescribeResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.DescribeResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.DescribeResponse; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.DescribeResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.DescribeResponse.g.cs deleted file mode 100644 index f4da7569..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.DescribeResponse.g.cs +++ /dev/null @@ -1,47 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The response for a describe request encapsulates a list of descriptions.
- /// Example: {"descriptions":[{"text":"A meticulously illustrated cat with striped patterns, sitting upright. The cat\u0027s eyes are a captivating shade of yellow, and it appears to be gazing intently at something. The background consists of abstract, swirling patterns in shades of black, white, and beige, creating an almost fluid or wavy appearance. The cat is positioned in the foreground, with the background elements fading into the distance, giving a sense of depth to the image."}]} - ///
- public sealed partial class DescribeResponse - { - /// - /// A collection of descriptions for given content. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("descriptions")] - public global::System.Collections.Generic.IList? Descriptions { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// A collection of descriptions for given content. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public DescribeResponse( - global::System.Collections.Generic.IList? descriptions) - { - this.Descriptions = descriptions; - } - - /// - /// Initializes a new instance of the class. - /// - public DescribeResponse() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.DescribeResponseV4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.DescribeResponseV4.Json.g.cs deleted file mode 100644 index 05666c75..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.DescribeResponseV4.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class DescribeResponseV4 - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.DescribeResponseV4? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.DescribeResponseV4), - jsonSerializerContext) as global::Ideogram.DescribeResponseV4; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.DescribeResponseV4? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.DescribeResponseV4? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.DescribeResponseV4), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.DescribeResponseV4; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.DescribeResponseV4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.DescribeResponseV4.g.cs deleted file mode 100644 index 954188a6..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.DescribeResponseV4.g.cs +++ /dev/null @@ -1,59 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The response for an Ideogram 4.0 describe request. The `json_prompt`
- /// field is a structured `V4JsonPrompt` that can be passed back as
- /// `json_prompt` to the `/v1/ideogram-v4/generate` family of endpoints.
- /// Example: {"json_prompt":{"high_level_description":"high_level_description","style_description":{"photo":"photo","art_style":"art_style","medium":"medium","aesthetics":"aesthetics","lighting":"lighting","color_palette":["#FFD700","#FFD700"]},"compositional_deconstruction":{"background":"background","elements":[{"bbox":[0,0,1000,1000],"type":"obj","desc":"desc","color_palette":["#FFD700","#FFD700"]},{"bbox":[0,0,1000,1000],"type":"obj","desc":"desc","color_palette":["#FFD700","#FFD700"]}]},"tags":["tags","tags"]}} - ///
- public sealed partial class DescribeResponseV4 - { - /// - /// Structured prompt for Ideogram 4.0 generation. When `json_prompt` is
- /// supplied, magic-prompt is disabled and the diffusion model consumes
- /// the JSON contract directly. Mutually exclusive with `text_prompt`
- /// and the legacy `prompt` field.
- /// Example: {"high_level_description":"high_level_description","style_description":{"photo":"photo","art_style":"art_style","medium":"medium","aesthetics":"aesthetics","lighting":"lighting","color_palette":["#FFD700","#FFD700"]},"compositional_deconstruction":{"background":"background","elements":[{"bbox":[0,0,1000,1000],"type":"obj","desc":"desc","color_palette":["#FFD700","#FFD700"]},{"bbox":[0,0,1000,1000],"type":"obj","desc":"desc","color_palette":["#FFD700","#FFD700"]}]},"tags":["tags","tags"]} - ///
- /// {"high_level_description":"high_level_description","style_description":{"photo":"photo","art_style":"art_style","medium":"medium","aesthetics":"aesthetics","lighting":"lighting","color_palette":["#FFD700","#FFD700"]},"compositional_deconstruction":{"background":"background","elements":[{"bbox":[0,0,1000,1000],"type":"obj","desc":"desc","color_palette":["#FFD700","#FFD700"]},{"bbox":[0,0,1000,1000],"type":"obj","desc":"desc","color_palette":["#FFD700","#FFD700"]}]},"tags":["tags","tags"]} - [global::System.Text.Json.Serialization.JsonPropertyName("json_prompt")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.V4JsonPrompt JsonPrompt { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Structured prompt for Ideogram 4.0 generation. When `json_prompt` is
- /// supplied, magic-prompt is disabled and the diffusion model consumes
- /// the JSON contract directly. Mutually exclusive with `text_prompt`
- /// and the legacy `prompt` field.
- /// Example: {"high_level_description":"high_level_description","style_description":{"photo":"photo","art_style":"art_style","medium":"medium","aesthetics":"aesthetics","lighting":"lighting","color_palette":["#FFD700","#FFD700"]},"compositional_deconstruction":{"background":"background","elements":[{"bbox":[0,0,1000,1000],"type":"obj","desc":"desc","color_palette":["#FFD700","#FFD700"]},{"bbox":[0,0,1000,1000],"type":"obj","desc":"desc","color_palette":["#FFD700","#FFD700"]}]},"tags":["tags","tags"]} - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public DescribeResponseV4( - global::Ideogram.V4JsonPrompt jsonPrompt) - { - this.JsonPrompt = jsonPrompt ?? throw new global::System.ArgumentNullException(nameof(jsonPrompt)); - } - - /// - /// Initializes a new instance of the class. - /// - public DescribeResponseV4() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.Description.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.Description.Json.g.cs deleted file mode 100644 index b96b8cdd..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.Description.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class Description - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.Description? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.Description), - jsonSerializerContext) as global::Ideogram.Description; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.Description? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.Description? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.Description), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.Description; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.Description.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.Description.g.cs deleted file mode 100644 index fd023b45..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.Description.g.cs +++ /dev/null @@ -1,49 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - public sealed partial class Description - { - /// - /// The generated description for the provided image.
- /// Example: A meticulously illustrated cat with striped patterns, sitting upright. The cat's eyes are a captivating shade of yellow, and it appears to be gazing intently at something. The background consists of abstract, swirling patterns in shades of black, white, and beige, creating an almost fluid or wavy appearance. The cat is positioned in the foreground, with the background elements fading into the distance, giving a sense of depth to the image. - ///
- /// A meticulously illustrated cat with striped patterns, sitting upright. The cat's eyes are a captivating shade of yellow, and it appears to be gazing intently at something. The background consists of abstract, swirling patterns in shades of black, white, and beige, creating an almost fluid or wavy appearance. The cat is positioned in the foreground, with the background elements fading into the distance, giving a sense of depth to the image. - [global::System.Text.Json.Serialization.JsonPropertyName("text")] - public string? Text { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The generated description for the provided image.
- /// Example: A meticulously illustrated cat with striped patterns, sitting upright. The cat's eyes are a captivating shade of yellow, and it appears to be gazing intently at something. The background consists of abstract, swirling patterns in shades of black, white, and beige, creating an almost fluid or wavy appearance. The cat is positioned in the foreground, with the background elements fading into the distance, giving a sense of depth to the image. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public Description( - string? text) - { - this.Text = text; - } - - /// - /// Initializes a new instance of the class. - /// - public Description() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.DesignPostLayerizeDesignIdeogramV3Request.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.DesignPostLayerizeDesignIdeogramV3Request.Json.g.cs new file mode 100644 index 00000000..cb9cea7d --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.DesignPostLayerizeDesignIdeogramV3Request.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class DesignPostLayerizeDesignIdeogramV3Request + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.DesignPostLayerizeDesignIdeogramV3Request? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.DesignPostLayerizeDesignIdeogramV3Request), + jsonSerializerContext) as global::Ideogram.DesignPostLayerizeDesignIdeogramV3Request; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.DesignPostLayerizeDesignIdeogramV3Request? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.DesignPostLayerizeDesignIdeogramV3Request? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.DesignPostLayerizeDesignIdeogramV3Request), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.DesignPostLayerizeDesignIdeogramV3Request; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.DesignPostLayerizeDesignIdeogramV3Request.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.DesignPostLayerizeDesignIdeogramV3Request.g.cs new file mode 100644 index 00000000..6d0e16a8 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.DesignPostLayerizeDesignIdeogramV3Request.g.cs @@ -0,0 +1,130 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// + /// + public sealed partial class DesignPostLayerizeDesignIdeogramV3Request + { + /// + /// The source image to layerize (max 50MB). Common image formats such as JPEG, PNG, and WEBP are supported. Multipart requests only. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("image")] + [global::System.Text.Json.Serialization.JsonRequired] + public required byte[] Image { get; set; } + + /// + /// The source image to layerize (max 50MB). Common image formats such as JPEG, PNG, and WEBP are supported. Multipart requests only. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Imagename { get; set; } + + /// + /// A description of the image, used to guide text detection. When omitted, detection runs on the image alone. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] + public string? Prompt { get; set; } + + /// + /// Random seed. Set for reproducible generation. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("seed")] + public int? Seed { get; set; } + + /// + /// Candidate font files to make available for text style matching. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB each, maximum 5 files). Multipart requests only. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("font_candidate_files")] + public global::System.Collections.Generic.IList? FontCandidateFiles { get; set; } + + /// + /// When false (the default), the request waits until layerization is complete and returns the result in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] + public string? WebhookUrl { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The source image to layerize (max 50MB). Common image formats such as JPEG, PNG, and WEBP are supported. Multipart requests only. + /// + /// + /// The source image to layerize (max 50MB). Common image formats such as JPEG, PNG, and WEBP are supported. Multipart requests only. + /// + /// + /// A description of the image, used to guide text detection. When omitted, detection runs on the image alone. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// Candidate font files to make available for text style matching. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB each, maximum 5 files). Multipart requests only. + /// + /// + /// When false (the default), the request waits until layerization is complete and returns the result in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DesignPostLayerizeDesignIdeogramV3Request( + byte[] image, + string imagename, + string? prompt, + int? seed, + global::System.Collections.Generic.IList? fontCandidateFiles, + bool? async, + string? webhookUrl) + { + this.Image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + this.Imagename = imagename ?? throw new global::System.ArgumentNullException(nameof(imagename)); + this.Prompt = prompt; + this.Seed = seed; + this.FontCandidateFiles = fontCandidateFiles; + this.Async = async; + this.WebhookUrl = webhookUrl; + } + + /// + /// Initializes a new instance of the class. + /// + public DesignPostLayerizeDesignIdeogramV3Request() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.DesignPostLayerizeDesignIdeogramV3Response.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.DesignPostLayerizeDesignIdeogramV3Response.Json.g.cs new file mode 100644 index 00000000..5524492d --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.DesignPostLayerizeDesignIdeogramV3Response.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class DesignPostLayerizeDesignIdeogramV3Response + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.DesignPostLayerizeDesignIdeogramV3Response? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.DesignPostLayerizeDesignIdeogramV3Response), + jsonSerializerContext) as global::Ideogram.DesignPostLayerizeDesignIdeogramV3Response; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.DesignPostLayerizeDesignIdeogramV3Response? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.DesignPostLayerizeDesignIdeogramV3Response? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.DesignPostLayerizeDesignIdeogramV3Response), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.DesignPostLayerizeDesignIdeogramV3Response; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.DesignPostLayerizeDesignIdeogramV3Response.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.DesignPostLayerizeDesignIdeogramV3Response.g.cs new file mode 100644 index 00000000..68bc65e8 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.DesignPostLayerizeDesignIdeogramV3Response.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class DesignPostLayerizeDesignIdeogramV3Response + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.DesignPostLayerizeDesignIdeogramV3Response2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.DesignPostLayerizeDesignIdeogramV3Response2.Json.g.cs new file mode 100644 index 00000000..15dc0d37 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.DesignPostLayerizeDesignIdeogramV3Response2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class DesignPostLayerizeDesignIdeogramV3Response2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.DesignPostLayerizeDesignIdeogramV3Response2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.DesignPostLayerizeDesignIdeogramV3Response2), + jsonSerializerContext) as global::Ideogram.DesignPostLayerizeDesignIdeogramV3Response2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.DesignPostLayerizeDesignIdeogramV3Response2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.DesignPostLayerizeDesignIdeogramV3Response2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.DesignPostLayerizeDesignIdeogramV3Response2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.DesignPostLayerizeDesignIdeogramV3Response2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.DesignPostLayerizeDesignIdeogramV3Response2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.DesignPostLayerizeDesignIdeogramV3Response2.g.cs new file mode 100644 index 00000000..e616104c --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.DesignPostLayerizeDesignIdeogramV3Response2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class DesignPostLayerizeDesignIdeogramV3Response2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.DesignPostLayerizeDesignIdeogramV3Response3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.DesignPostLayerizeDesignIdeogramV3Response3.Json.g.cs new file mode 100644 index 00000000..c8b53e9f --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.DesignPostLayerizeDesignIdeogramV3Response3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class DesignPostLayerizeDesignIdeogramV3Response3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.DesignPostLayerizeDesignIdeogramV3Response3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.DesignPostLayerizeDesignIdeogramV3Response3), + jsonSerializerContext) as global::Ideogram.DesignPostLayerizeDesignIdeogramV3Response3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.DesignPostLayerizeDesignIdeogramV3Response3? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.DesignPostLayerizeDesignIdeogramV3Response3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.DesignPostLayerizeDesignIdeogramV3Response3), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.DesignPostLayerizeDesignIdeogramV3Response3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.DesignPostLayerizeDesignIdeogramV3Response3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.DesignPostLayerizeDesignIdeogramV3Response3.g.cs new file mode 100644 index 00000000..254a0b5c --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.DesignPostLayerizeDesignIdeogramV3Response3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class DesignPostLayerizeDesignIdeogramV3Response3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.DesignPostLayerizeDesignIdeogramV3Response4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.DesignPostLayerizeDesignIdeogramV3Response4.Json.g.cs new file mode 100644 index 00000000..c90ea5a7 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.DesignPostLayerizeDesignIdeogramV3Response4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class DesignPostLayerizeDesignIdeogramV3Response4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.DesignPostLayerizeDesignIdeogramV3Response4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.DesignPostLayerizeDesignIdeogramV3Response4), + jsonSerializerContext) as global::Ideogram.DesignPostLayerizeDesignIdeogramV3Response4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.DesignPostLayerizeDesignIdeogramV3Response4? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.DesignPostLayerizeDesignIdeogramV3Response4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.DesignPostLayerizeDesignIdeogramV3Response4), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.DesignPostLayerizeDesignIdeogramV3Response4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.DesignPostLayerizeDesignIdeogramV3Response4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.DesignPostLayerizeDesignIdeogramV3Response4.g.cs new file mode 100644 index 00000000..7297d6cd --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.DesignPostLayerizeDesignIdeogramV3Response4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class DesignPostLayerizeDesignIdeogramV3Response4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.DesignPostLayerizeDesignIdeogramV3Response5.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.DesignPostLayerizeDesignIdeogramV3Response5.Json.g.cs new file mode 100644 index 00000000..a176d869 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.DesignPostLayerizeDesignIdeogramV3Response5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class DesignPostLayerizeDesignIdeogramV3Response5 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.DesignPostLayerizeDesignIdeogramV3Response5? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.DesignPostLayerizeDesignIdeogramV3Response5), + jsonSerializerContext) as global::Ideogram.DesignPostLayerizeDesignIdeogramV3Response5; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.DesignPostLayerizeDesignIdeogramV3Response5? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.DesignPostLayerizeDesignIdeogramV3Response5? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.DesignPostLayerizeDesignIdeogramV3Response5), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.DesignPostLayerizeDesignIdeogramV3Response5; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.DesignPostLayerizeDesignIdeogramV3Response5.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.DesignPostLayerizeDesignIdeogramV3Response5.g.cs new file mode 100644 index 00000000..fa94d635 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.DesignPostLayerizeDesignIdeogramV3Response5.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class DesignPostLayerizeDesignIdeogramV3Response5 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.DesignPostLayerizeDesignIdeogramV3Response6.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.DesignPostLayerizeDesignIdeogramV3Response6.Json.g.cs new file mode 100644 index 00000000..1f928075 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.DesignPostLayerizeDesignIdeogramV3Response6.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class DesignPostLayerizeDesignIdeogramV3Response6 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.DesignPostLayerizeDesignIdeogramV3Response6? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.DesignPostLayerizeDesignIdeogramV3Response6), + jsonSerializerContext) as global::Ideogram.DesignPostLayerizeDesignIdeogramV3Response6; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.DesignPostLayerizeDesignIdeogramV3Response6? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.DesignPostLayerizeDesignIdeogramV3Response6? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.DesignPostLayerizeDesignIdeogramV3Response6), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.DesignPostLayerizeDesignIdeogramV3Response6; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.DesignPostLayerizeDesignIdeogramV3Response6.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.DesignPostLayerizeDesignIdeogramV3Response6.g.cs new file mode 100644 index 00000000..cc354a13 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.DesignPostLayerizeDesignIdeogramV3Response6.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class DesignPostLayerizeDesignIdeogramV3Response6 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.DetectedTextBlock.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.DetectedTextBlock.g.cs index 3069955d..eda3ee76 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.DetectedTextBlock.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.DetectedTextBlock.g.cs @@ -4,8 +4,7 @@ namespace Ideogram { /// - /// A single detected text region with its position, content, font information, and styling.
- /// Example: {"role":"heading","color":"#212121","font_alternatives":["font_alternatives","font_alternatives"],"font_size":2,"font_name":"font_name","line_height":7.0614014,"x":0,"width":1,"y":6,"angle":5.637377,"text":"Hello World","alignment":"left","formatting":["bold","bold"],"height":5} + /// A single detected text region with its position, content, font information, and styling. ///
public sealed partial class DetectedTextBlock { @@ -38,10 +37,8 @@ public sealed partial class DetectedTextBlock public required int Height { get; set; } /// - /// The detected text content. Line breaks are represented as \n.
- /// Example: Hello World + /// The detected text content. Line breaks are represented as \n. ///
- /// Hello World [global::System.Text.Json.Serialization.JsonPropertyName("text")] [global::System.Text.Json.Serialization.JsonRequired] public required string Text { get; set; } @@ -59,7 +56,7 @@ public sealed partial class DetectedTextBlock /// Default Value: 0 /// [global::System.Text.Json.Serialization.JsonPropertyName("angle")] - public float? Angle { get; set; } + public string? Angle { get; set; } /// /// Best-matching font name from the font library. @@ -83,13 +80,11 @@ public sealed partial class DetectedTextBlock /// Line height multiplier (e.g., 1.2). /// [global::System.Text.Json.Serialization.JsonPropertyName("line_height")] - public float? LineHeight { get; set; } + public string? LineHeight { get; set; } /// - /// Detected text color in hex format.
- /// Example: #212121 + /// Detected text color in hex format. ///
- /// #212121 [global::System.Text.Json.Serialization.JsonPropertyName("color")] public string? Color { get; set; } @@ -98,13 +93,12 @@ public sealed partial class DetectedTextBlock /// [global::System.Text.Json.Serialization.JsonPropertyName("formatting")] [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList Formatting { get; set; } + public required global::System.Collections.Generic.IList Formatting { get; set; } /// /// Inferred typographic role of this text block. /// [global::System.Text.Json.Serialization.JsonPropertyName("role")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.DetectedTextBlockRoleJsonConverter))] public global::Ideogram.DetectedTextBlockRole? Role { get; set; } /// @@ -129,8 +123,7 @@ public sealed partial class DetectedTextBlock /// Height of the text region in pixels. /// /// - /// The detected text content. Line breaks are represented as \n.
- /// Example: Hello World + /// The detected text content. Line breaks are represented as \n. /// /// /// Detected text alignment. @@ -155,8 +148,7 @@ public sealed partial class DetectedTextBlock /// Line height multiplier (e.g., 1.2). /// /// - /// Detected text color in hex format.
- /// Example: #212121 + /// Detected text color in hex format. /// /// /// Inferred typographic role of this text block. @@ -171,12 +163,12 @@ public DetectedTextBlock( int height, string text, global::Ideogram.DetectedTextBlockAlignment alignment, - global::System.Collections.Generic.IList formatting, - float? angle, + global::System.Collections.Generic.IList formatting, + string? angle, string? fontName, global::System.Collections.Generic.IList? fontAlternatives, int? fontSize, - float? lineHeight, + string? lineHeight, string? color, global::Ideogram.DetectedTextBlockRole? role) { diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.DetectedTextBlockFormattingItem.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.DetectedTextBlockFormattingItem.g.cs deleted file mode 100644 index 11050283..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.DetectedTextBlockFormattingItem.g.cs +++ /dev/null @@ -1,87 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - public enum DetectedTextBlockFormattingItem - { - /// - /// - /// - AllCaps, - /// - /// - /// - Bold, - /// - /// - /// - Italic, - /// - /// - /// - SmallCaps, - /// - /// - /// - Strikethrough, - /// - /// - /// - Subscript, - /// - /// - /// - Superscript, - /// - /// - /// - Underline, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class DetectedTextBlockFormattingItemExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this DetectedTextBlockFormattingItem value) - { - return value switch - { - DetectedTextBlockFormattingItem.AllCaps => "all_caps", - DetectedTextBlockFormattingItem.Bold => "bold", - DetectedTextBlockFormattingItem.Italic => "italic", - DetectedTextBlockFormattingItem.SmallCaps => "small_caps", - DetectedTextBlockFormattingItem.Strikethrough => "strikethrough", - DetectedTextBlockFormattingItem.Subscript => "subscript", - DetectedTextBlockFormattingItem.Superscript => "superscript", - DetectedTextBlockFormattingItem.Underline => "underline", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static DetectedTextBlockFormattingItem? ToEnum(string value) - { - return value switch - { - "all_caps" => DetectedTextBlockFormattingItem.AllCaps, - "bold" => DetectedTextBlockFormattingItem.Bold, - "italic" => DetectedTextBlockFormattingItem.Italic, - "small_caps" => DetectedTextBlockFormattingItem.SmallCaps, - "strikethrough" => DetectedTextBlockFormattingItem.Strikethrough, - "subscript" => DetectedTextBlockFormattingItem.Subscript, - "superscript" => DetectedTextBlockFormattingItem.Superscript, - "underline" => DetectedTextBlockFormattingItem.Underline, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.DetectedTextBlockFormattingItems.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.DetectedTextBlockFormattingItems.g.cs new file mode 100644 index 00000000..ab68e04b --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.DetectedTextBlockFormattingItems.g.cs @@ -0,0 +1,87 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// + /// + public enum DetectedTextBlockFormattingItems + { + /// + /// + /// + AllCaps, + /// + /// + /// + Bold, + /// + /// + /// + Italic, + /// + /// + /// + SmallCaps, + /// + /// + /// + Strikethrough, + /// + /// + /// + Subscript, + /// + /// + /// + Superscript, + /// + /// + /// + Underline, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class DetectedTextBlockFormattingItemsExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this DetectedTextBlockFormattingItems value) + { + return value switch + { + DetectedTextBlockFormattingItems.AllCaps => "all_caps", + DetectedTextBlockFormattingItems.Bold => "bold", + DetectedTextBlockFormattingItems.Italic => "italic", + DetectedTextBlockFormattingItems.SmallCaps => "small_caps", + DetectedTextBlockFormattingItems.Strikethrough => "strikethrough", + DetectedTextBlockFormattingItems.Subscript => "subscript", + DetectedTextBlockFormattingItems.Superscript => "superscript", + DetectedTextBlockFormattingItems.Underline => "underline", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static DetectedTextBlockFormattingItems? ToEnum(string value) + { + return value switch + { + "all_caps" => DetectedTextBlockFormattingItems.AllCaps, + "bold" => DetectedTextBlockFormattingItems.Bold, + "italic" => DetectedTextBlockFormattingItems.Italic, + "small_caps" => DetectedTextBlockFormattingItems.SmallCaps, + "strikethrough" => DetectedTextBlockFormattingItems.Strikethrough, + "subscript" => DetectedTextBlockFormattingItems.Subscript, + "superscript" => DetectedTextBlockFormattingItems.Superscript, + "underline" => DetectedTextBlockFormattingItems.Underline, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditImageRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditImageRequest.Json.g.cs deleted file mode 100644 index f05eb73b..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.EditImageRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class EditImageRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.EditImageRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.EditImageRequest), - jsonSerializerContext) as global::Ideogram.EditImageRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.EditImageRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.EditImageRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.EditImageRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.EditImageRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditImageRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditImageRequest.g.cs deleted file mode 100644 index ccc5ea8e..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.EditImageRequest.g.cs +++ /dev/null @@ -1,185 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - public sealed partial class EditImageRequest - { - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image_file")] - [global::System.Text.Json.Serialization.JsonRequired] - public required byte[] ImageFile { get; set; } - - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image_filename")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string ImageFilename { get; set; } - - /// - /// A black and white image of the same size as the image being edited (max size 25MB). Black regions in the mask should match up with the regions of the image that you would like to edit; only JPEG, WebP and PNG formats are supported at this time. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("mask")] - [global::System.Text.Json.Serialization.JsonRequired] - public required byte[] Mask { get; set; } - - /// - /// A black and white image of the same size as the image being edited (max size 25MB). Black regions in the mask should match up with the regions of the image that you would like to edit; only JPEG, WebP and PNG formats are supported at this time. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("maskname")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Maskname { get; set; } - - /// - /// The prompt used to describe the edited result.
- /// Example: A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there is an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset. - ///
- /// A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there is an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset. - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Prompt { get; set; } - - /// - /// The model used to generate an image or edit one. /generate and /remix supports all model types, however, /edit is only supported for V_2 and V_2_TURBO.
- /// Default Value: V_2
- /// Example: V_2_TURBO - ///
- /// global::Ideogram.ModelEnum.V2 - /// V_2_TURBO - [global::System.Text.Json.Serialization.JsonPropertyName("model")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ModelEnumJsonConverter))] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.ModelEnum Model { get; set; } = global::Ideogram.ModelEnum.V2; - - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - ///
- /// ON - [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt_option")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.MagicPromptOptionJsonConverter))] - public global::Ideogram.MagicPromptOption? MagicPromptOption { get; set; } - - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt_system_prompt_config_id")] - public string? MagicPromptSystemPromptConfigId { get; set; } - - /// - /// The number of images to generate.
- /// Default Value: 1 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] - public int? NumImages { get; set; } - - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - ///
- /// 12345 - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// The style type to generate with; this is only applicable for models V_2 and above and should not be specified for model versions V_1.
- /// Example: REALISTIC - ///
- /// REALISTIC - [global::System.Text.Json.Serialization.JsonPropertyName("style_type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.StyleTypeJsonConverter))] - public global::Ideogram.StyleType? StyleType { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// A black and white image of the same size as the image being edited (max size 25MB). Black regions in the mask should match up with the regions of the image that you would like to edit; only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// A black and white image of the same size as the image being edited (max size 25MB). Black regions in the mask should match up with the regions of the image that you would like to edit; only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The prompt used to describe the edited result.
- /// Example: A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there is an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset. - /// - /// - /// The model used to generate an image or edit one. /generate and /remix supports all model types, however, /edit is only supported for V_2 and V_2_TURBO.
- /// Default Value: V_2
- /// Example: V_2_TURBO - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The style type to generate with; this is only applicable for models V_2 and above and should not be specified for model versions V_1.
- /// Example: REALISTIC - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public EditImageRequest( - byte[] imageFile, - string imageFilename, - byte[] mask, - string maskname, - string prompt, - global::Ideogram.ModelEnum model, - global::Ideogram.MagicPromptOption? magicPromptOption, - string? magicPromptSystemPromptConfigId, - int? numImages, - int? seed, - global::Ideogram.StyleType? styleType) - { - this.ImageFile = imageFile ?? throw new global::System.ArgumentNullException(nameof(imageFile)); - this.ImageFilename = imageFilename ?? throw new global::System.ArgumentNullException(nameof(imageFilename)); - this.Mask = mask ?? throw new global::System.ArgumentNullException(nameof(mask)); - this.Maskname = maskname ?? throw new global::System.ArgumentNullException(nameof(maskname)); - this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); - this.Model = model; - this.MagicPromptOption = magicPromptOption; - this.MagicPromptSystemPromptConfigId = magicPromptSystemPromptConfigId; - this.NumImages = numImages; - this.Seed = seed; - this.StyleType = styleType; - } - - /// - /// Initializes a new instance of the class. - /// - public EditImageRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditImageRequestV3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditImageRequestV3.Json.g.cs deleted file mode 100644 index ae85d983..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.EditImageRequestV3.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class EditImageRequestV3 - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.EditImageRequestV3? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.EditImageRequestV3), - jsonSerializerContext) as global::Ideogram.EditImageRequestV3; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.EditImageRequestV3? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.EditImageRequestV3? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.EditImageRequestV3), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.EditImageRequestV3; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditImageRequestV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditImageRequestV3.g.cs deleted file mode 100644 index 5f19fc53..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.EditImageRequestV3.g.cs +++ /dev/null @@ -1,272 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - public sealed partial class EditImageRequestV3 - { - /// - /// The image being edited (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image")] - [global::System.Text.Json.Serialization.JsonRequired] - public required byte[] Image { get; set; } - - /// - /// The image being edited (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Imagename { get; set; } - - /// - /// A black and white image of the same size as the image being edited (max size 25MB). Black regions in the mask should match up with the regions of the image that you would like to edit; only JPEG, WebP and PNG formats are supported at this time. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("mask")] - [global::System.Text.Json.Serialization.JsonRequired] - public required byte[] Mask { get; set; } - - /// - /// A black and white image of the same size as the image being edited (max size 25MB). Black regions in the mask should match up with the regions of the image that you would like to edit; only JPEG, WebP and PNG formats are supported at this time. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("maskname")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Maskname { get; set; } - - /// - /// The prompt used to describe the edited result.
- /// Example: A photo of a cat. - ///
- /// A photo of a cat. - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Prompt { get; set; } - - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - ///
- /// ON - [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.MagicPromptOptionJsonConverter))] - public global::Ideogram.MagicPromptOption? MagicPrompt { get; set; } - - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt_system_prompt_config_id")] - public string? MagicPromptSystemPromptConfigId { get; set; } - - /// - /// The number of images to generate.
- /// Default Value: 1 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] - public int? NumImages { get; set; } - - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - ///
- /// 12345 - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("rendering_speed")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.RenderingSpeedJsonConverter))] - public global::Ideogram.RenderingSpeed? RenderingSpeed { get; set; } - - /// - /// The style type to generate with.
- /// Default Value: GENERAL
- /// Example: GENERAL - ///
- /// GENERAL - [global::System.Text.Json.Serialization.JsonPropertyName("style_type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.StyleTypeV3JsonConverter))] - public global::Ideogram.StyleTypeV3? StyleType { get; set; } - - /// - /// A predefined style preset that applies a specific artistic style to the generated image.
- /// Example: BRIGHT_ART - ///
- /// BRIGHT_ART - [global::System.Text.Json.Serialization.JsonPropertyName("style_preset")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.StylePresetV3JsonConverter))] - public global::Ideogram.StylePresetV3? StylePreset { get; set; } - - /// - /// A custom model URI in the format model/<model_name>/version/<version_name>.
- /// When provided, the model version and style will be resolved from this URI, and style_type is not required.
- /// Example: model/my-custom-model/version/1 - ///
- /// model/my-custom-model/version/1 - [global::System.Text.Json.Serialization.JsonPropertyName("custom_model_uri")] - public string? CustomModelUri { get; set; } - - /// - /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). Not supported by V_1, V_1_TURBO, V_2A and V_2A_TURBO models. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("color_palette")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ColorPaletteWithPresetNameOrMembersJsonConverter))] - public global::Ideogram.ColorPaletteWithPresetNameOrMembers? ColorPalette { get; set; } - - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - ///
- /// [AAFF5733, 0133FF57, DE3357FF] - [global::System.Text.Json.Serialization.JsonPropertyName("style_codes")] - public global::System.Collections.Generic.IList? StyleCodes { get; set; } - - /// - /// A set of images to use as style references (max size 25MB per image; the whole request must stay under 50MB). The images should be in JPEG, PNG or WebP format. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("style_reference_images")] - public global::System.Collections.Generic.IList? StyleReferenceImages { get; set; } - - /// - /// Generations with character reference are subject to the character reference pricing. A set of images to use as character references (max size 25MB per image; the whole request must stay under 50MB), currently only supports 1 character reference image. The images should be in JPEG, PNG or WebP format. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("character_reference_images")] - public global::System.Collections.Generic.IList? CharacterReferenceImages { get; set; } - - /// - /// Optional masks for character reference images. When provided, must match the number of character_reference_images. Each mask should be a grayscale image of the same dimensions as the corresponding character reference image. The images should be in JPEG, PNG or WebP format. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("character_reference_images_mask")] - public global::System.Collections.Generic.IList? CharacterReferenceImagesMask { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The image being edited (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The image being edited (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// A black and white image of the same size as the image being edited (max size 25MB). Black regions in the mask should match up with the regions of the image that you would like to edit; only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// A black and white image of the same size as the image being edited (max size 25MB). Black regions in the mask should match up with the regions of the image that you would like to edit; only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The prompt used to describe the edited result.
- /// Example: A photo of a cat. - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - /// - /// - /// The style type to generate with.
- /// Default Value: GENERAL
- /// Example: GENERAL - /// - /// - /// A predefined style preset that applies a specific artistic style to the generated image.
- /// Example: BRIGHT_ART - /// - /// - /// A custom model URI in the format model/<model_name>/version/<version_name>.
- /// When provided, the model version and style will be resolved from this URI, and style_type is not required.
- /// Example: model/my-custom-model/version/1 - /// - /// - /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). Not supported by V_1, V_1_TURBO, V_2A and V_2A_TURBO models. - /// - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - /// - /// - /// A set of images to use as style references (max size 25MB per image; the whole request must stay under 50MB). The images should be in JPEG, PNG or WebP format. - /// - /// - /// Generations with character reference are subject to the character reference pricing. A set of images to use as character references (max size 25MB per image; the whole request must stay under 50MB), currently only supports 1 character reference image. The images should be in JPEG, PNG or WebP format. - /// - /// - /// Optional masks for character reference images. When provided, must match the number of character_reference_images. Each mask should be a grayscale image of the same dimensions as the corresponding character reference image. The images should be in JPEG, PNG or WebP format. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public EditImageRequestV3( - byte[] image, - string imagename, - byte[] mask, - string maskname, - string prompt, - global::Ideogram.MagicPromptOption? magicPrompt, - string? magicPromptSystemPromptConfigId, - int? numImages, - int? seed, - global::Ideogram.RenderingSpeed? renderingSpeed, - global::Ideogram.StyleTypeV3? styleType, - global::Ideogram.StylePresetV3? stylePreset, - string? customModelUri, - global::Ideogram.ColorPaletteWithPresetNameOrMembers? colorPalette, - global::System.Collections.Generic.IList? styleCodes, - global::System.Collections.Generic.IList? styleReferenceImages, - global::System.Collections.Generic.IList? characterReferenceImages, - global::System.Collections.Generic.IList? characterReferenceImagesMask) - { - this.Image = image ?? throw new global::System.ArgumentNullException(nameof(image)); - this.Imagename = imagename ?? throw new global::System.ArgumentNullException(nameof(imagename)); - this.Mask = mask ?? throw new global::System.ArgumentNullException(nameof(mask)); - this.Maskname = maskname ?? throw new global::System.ArgumentNullException(nameof(maskname)); - this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); - this.MagicPrompt = magicPrompt; - this.MagicPromptSystemPromptConfigId = magicPromptSystemPromptConfigId; - this.NumImages = numImages; - this.Seed = seed; - this.RenderingSpeed = renderingSpeed; - this.StyleType = styleType; - this.StylePreset = stylePreset; - this.CustomModelUri = customModelUri; - this.ColorPalette = colorPalette; - this.StyleCodes = styleCodes; - this.StyleReferenceImages = styleReferenceImages; - this.CharacterReferenceImages = characterReferenceImages; - this.CharacterReferenceImagesMask = characterReferenceImagesMask; - } - - /// - /// Initializes a new instance of the class. - /// - public EditImageRequestV3() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditVideoMinimaxH3ReferenceToVideoRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditVideoMinimaxH3ReferenceToVideoRequest.Json.g.cs deleted file mode 100644 index e0fb2576..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.EditVideoMinimaxH3ReferenceToVideoRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class EditVideoMinimaxH3ReferenceToVideoRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.EditVideoMinimaxH3ReferenceToVideoRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.EditVideoMinimaxH3ReferenceToVideoRequest), - jsonSerializerContext) as global::Ideogram.EditVideoMinimaxH3ReferenceToVideoRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.EditVideoMinimaxH3ReferenceToVideoRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.EditVideoMinimaxH3ReferenceToVideoRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.EditVideoMinimaxH3ReferenceToVideoRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.EditVideoMinimaxH3ReferenceToVideoRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditVideoMinimaxH3ReferenceToVideoRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditVideoMinimaxH3ReferenceToVideoRequest.g.cs deleted file mode 100644 index 8d998ec1..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.EditVideoMinimaxH3ReferenceToVideoRequest.g.cs +++ /dev/null @@ -1,216 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Request body for MiniMax H3 reference-to-video. The prompt addresses
- /// references by position: `Image 1`, `Audio 1`, and so on. References
- /// are optional; with none, the video is produced from the prompt alone.
- /// Audio requires an image alongside it, and audio references must total
- /// at most 15 seconds. - ///
- public sealed partial class EditVideoMinimaxH3ReferenceToVideoRequest - { - /// - /// A natural-language prompt describing the video to produce. Reference media is addressed by position, as in "Image 1 walks toward the camera with the motion of Video 1".
- /// Example: Image 1 walks through the snowy forest at dawn. - ///
- /// Image 1 walks through the snowy forest at dawn. - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Prompt { get; set; } - - /// - /// Images already stored with Ideogram to use as references, by reference, in prompt order. Cannot be combined with `reference_images`. Only image assets are accepted. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("reference_image_asset_identifiers")] - public global::System.Collections.Generic.IList? ReferenceImageAssetIdentifiers { get; set; } - - /// - /// Images to use as references (max size 50MB each), as raw bytes, in prompt order; only common image formats such as JPEG, PNG, and WEBP are supported. Uploaded images are used for this request only and are not stored. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("reference_images")] - public global::System.Collections.Generic.IList? ReferenceImages { get; set; } - - /// - /// Videos generated or uploaded with Ideogram to use as motion references, by reference, in prompt order. Each clip must be between 2 and 15 seconds long, and the clips must total no more than 15 seconds. Raw video uploads are not accepted. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("reference_video_asset_identifiers")] - public global::System.Collections.Generic.IList? ReferenceVideoAssetIdentifiers { get; set; } - - /// - /// MP3 or WAV audio references, in prompt order as Audio 1, Audio 2, and Audio 3. Multipart uploads only; up to 15 MB per file and 2–15 seconds each. Audio and video references must total no more than 15 seconds. Requires a reference image or video. At most 12 references across images, videos, and audio. Used only for this request and not saved as assets. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("reference_audios")] - public global::System.Collections.Generic.IList? ReferenceAudios { get; set; } - - /// - /// The aspect ratio of the generated video.
- /// Default Value: 16x9 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.MinimaxH3AspectRatioJsonConverter))] - public global::Ideogram.MinimaxH3AspectRatio? AspectRatio { get; set; } - - /// - /// The resolution tier of the generated video, spelled the way MiniMax
- /// spells it. `480P` and `768P` are generated natively; `2K` and `4K` are
- /// upscaled from a `768P` result.
- /// Higher tiers cost more.
- /// Default Value: 2K - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.MinimaxH3ResolutionJsonConverter))] - public global::Ideogram.MinimaxH3Resolution? Resolution { get; set; } - - /// - /// The length of the generated video in seconds.
- /// Default Value: 5
- /// Example: 5 - ///
- /// 5 - [global::System.Text.Json.Serialization.JsonPropertyName("duration")] - public int? Duration { get; set; } - - /// - /// How much the model may rewrite the prompt before generating. `disabled`
- /// uses the prompt as written; the other modes trade latency for a richer
- /// rewrite.
- /// Default Value: balanced - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("prompt_expansion_mode")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.MinimaxH3PromptExpansionModeJsonConverter))] - public global::Ideogram.MinimaxH3PromptExpansionMode? PromptExpansionMode { get; set; } - - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - ///
- /// https://api.example.com/webhooks/ideogram - [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] - public string? WebhookUrl { get; set; } - - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output videos are added to it when the request completes. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("target_collection_id")] - public string? TargetCollectionId { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// A natural-language prompt describing the video to produce. Reference media is addressed by position, as in "Image 1 walks toward the camera with the motion of Video 1".
- /// Example: Image 1 walks through the snowy forest at dawn. - /// - /// - /// Images already stored with Ideogram to use as references, by reference, in prompt order. Cannot be combined with `reference_images`. Only image assets are accepted. - /// - /// - /// Images to use as references (max size 50MB each), as raw bytes, in prompt order; only common image formats such as JPEG, PNG, and WEBP are supported. Uploaded images are used for this request only and are not stored. - /// - /// - /// Videos generated or uploaded with Ideogram to use as motion references, by reference, in prompt order. Each clip must be between 2 and 15 seconds long, and the clips must total no more than 15 seconds. Raw video uploads are not accepted. - /// - /// - /// MP3 or WAV audio references, in prompt order as Audio 1, Audio 2, and Audio 3. Multipart uploads only; up to 15 MB per file and 2–15 seconds each. Audio and video references must total no more than 15 seconds. Requires a reference image or video. At most 12 references across images, videos, and audio. Used only for this request and not saved as assets. - /// - /// - /// The aspect ratio of the generated video.
- /// Default Value: 16x9 - /// - /// - /// The resolution tier of the generated video, spelled the way MiniMax
- /// spells it. `480P` and `768P` are generated natively; `2K` and `4K` are
- /// upscaled from a `768P` result.
- /// Higher tiers cost more.
- /// Default Value: 2K - /// - /// - /// The length of the generated video in seconds.
- /// Default Value: 5
- /// Example: 5 - /// - /// - /// How much the model may rewrite the prompt before generating. `disabled`
- /// uses the prompt as written; the other modes trade latency for a richer
- /// rewrite.
- /// Default Value: balanced - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output videos are added to it when the request completes. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public EditVideoMinimaxH3ReferenceToVideoRequest( - string prompt, - global::System.Collections.Generic.IList? referenceImageAssetIdentifiers, - global::System.Collections.Generic.IList? referenceImages, - global::System.Collections.Generic.IList? referenceVideoAssetIdentifiers, - global::System.Collections.Generic.IList? referenceAudios, - global::Ideogram.MinimaxH3AspectRatio? aspectRatio, - global::Ideogram.MinimaxH3Resolution? resolution, - int? duration, - global::Ideogram.MinimaxH3PromptExpansionMode? promptExpansionMode, - string? webhookUrl, - bool? @private, - string? targetCollectionId) - { - this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); - this.ReferenceImageAssetIdentifiers = referenceImageAssetIdentifiers; - this.ReferenceImages = referenceImages; - this.ReferenceVideoAssetIdentifiers = referenceVideoAssetIdentifiers; - this.ReferenceAudios = referenceAudios; - this.AspectRatio = aspectRatio; - this.Resolution = resolution; - this.Duration = duration; - this.PromptExpansionMode = promptExpansionMode; - this.WebhookUrl = webhookUrl; - this.Private = @private; - this.TargetCollectionId = targetCollectionId; - } - - /// - /// Initializes a new instance of the class. - /// - public EditVideoMinimaxH3ReferenceToVideoRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditVideoSeedDance2Request.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditVideoSeedDance2Request.Json.g.cs deleted file mode 100644 index c4fa503d..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.EditVideoSeedDance2Request.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class EditVideoSeedDance2Request - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.EditVideoSeedDance2Request? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.EditVideoSeedDance2Request), - jsonSerializerContext) as global::Ideogram.EditVideoSeedDance2Request; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.EditVideoSeedDance2Request? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.EditVideoSeedDance2Request? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.EditVideoSeedDance2Request), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.EditVideoSeedDance2Request; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditVideoSeedDance2Request.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditVideoSeedDance2Request.g.cs deleted file mode 100644 index 86f53c5b..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.EditVideoSeedDance2Request.g.cs +++ /dev/null @@ -1,210 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Request body for a Seedance 2.0 video edit. `video_asset_identifier`
- /// names the video being edited and `start_frame_time`/`end_frame_time` mark
- /// the span of it the generated clip replaces. The two `is_*_included` flags
- /// anchor the generated clip on the span's own end frames; at least one must
- /// be anchored.
- /// Example: {"duration":5,"private":true,"end_frame_time":"","is_end_frame_included":false,"webhook_url":"https://api.example.com/webhooks/ideogram","video_asset_identifier":"","target_collection_id":"target_collection_id","generate_audio":false,"is_start_frame_included":true,"prompt":"The camera pushes in as the dancer turns towards the light.","resolution":"","start_frame_time":""} - ///
- public sealed partial class EditVideoSeedDance2Request - { - /// - /// A reference to a video already stored with Ideogram to take the frames from. Only video assets are accepted. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("video_asset_identifier")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.AssetIdentifier VideoAssetIdentifier { get; set; } - - /// - /// Where the replaced span of the source video begins. Everything before it is kept as-is. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("start_frame_time")] - [global::System.Text.Json.Serialization.JsonRequired] - public required float StartFrameTime { get; set; } - - /// - /// Whether the generated clip is anchored on the frame already at `start_frame_time`, so it opens on the footage it replaces. Set it to false to anchor on the end frame alone, in which case `is_end_frame_included` must be true.
- /// Default Value: true - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("is_start_frame_included")] - public bool? IsStartFrameIncluded { get; set; } - - /// - /// Where the replaced span of the source video ends; must come after `start_frame_time`. Everything from here on is kept as-is. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("end_frame_time")] - [global::System.Text.Json.Serialization.JsonRequired] - public required float EndFrameTime { get; set; } - - /// - /// Whether the generated clip is anchored on the frame at `end_frame_time`, so it lands on the footage that follows the span.
- /// Default Value: false - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("is_end_frame_included")] - public bool? IsEndFrameIncluded { get; set; } - - /// - /// A natural-language prompt describing what the replaced span should show.
- /// Example: The camera pushes in as the dancer turns towards the light. - ///
- /// The camera pushes in as the dancer turns towards the light. - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Prompt { get; set; } - - /// - /// The resolution tier the replaced span is generated at. The clip is then scaled to the source video's own frame, so this affects the detail generated rather than the edited video's dimensions. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.SeedDance2ResolutionJsonConverter))] - public global::Ideogram.SeedDance2Resolution? Resolution { get; set; } - - /// - /// The length of the generated video in seconds. When omitted, the model
- /// picks the best duration for the prompt ("auto").
- /// Example: 5 - ///
- /// 5 - [global::System.Text.Json.Serialization.JsonPropertyName("duration")] - public int? Duration { get; set; } - - /// - /// Whether to generate an audio track for the video. Audio roughly
- /// doubles the provider cost and is subject to stricter output moderation.
- /// Default Value: false - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("generate_audio")] - public bool? GenerateAudio { get; set; } - - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - ///
- /// https://api.example.com/webhooks/ideogram - [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] - public string? WebhookUrl { get; set; } - - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output videos are added to it when the request completes. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("target_collection_id")] - public string? TargetCollectionId { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// A reference to a video already stored with Ideogram to take the frames from. Only video assets are accepted. - /// - /// - /// Where the replaced span of the source video begins. Everything before it is kept as-is. - /// - /// - /// Where the replaced span of the source video ends; must come after `start_frame_time`. Everything from here on is kept as-is. - /// - /// - /// A natural-language prompt describing what the replaced span should show.
- /// Example: The camera pushes in as the dancer turns towards the light. - /// - /// - /// Whether the generated clip is anchored on the frame already at `start_frame_time`, so it opens on the footage it replaces. Set it to false to anchor on the end frame alone, in which case `is_end_frame_included` must be true.
- /// Default Value: true - /// - /// - /// Whether the generated clip is anchored on the frame at `end_frame_time`, so it lands on the footage that follows the span.
- /// Default Value: false - /// - /// - /// The resolution tier the replaced span is generated at. The clip is then scaled to the source video's own frame, so this affects the detail generated rather than the edited video's dimensions. - /// - /// - /// The length of the generated video in seconds. When omitted, the model
- /// picks the best duration for the prompt ("auto").
- /// Example: 5 - /// - /// - /// Whether to generate an audio track for the video. Audio roughly
- /// doubles the provider cost and is subject to stricter output moderation.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output videos are added to it when the request completes. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public EditVideoSeedDance2Request( - global::Ideogram.AssetIdentifier videoAssetIdentifier, - float startFrameTime, - float endFrameTime, - string prompt, - bool? isStartFrameIncluded, - bool? isEndFrameIncluded, - global::Ideogram.SeedDance2Resolution? resolution, - int? duration, - bool? generateAudio, - string? webhookUrl, - bool? @private, - string? targetCollectionId) - { - this.VideoAssetIdentifier = videoAssetIdentifier ?? throw new global::System.ArgumentNullException(nameof(videoAssetIdentifier)); - this.StartFrameTime = startFrameTime; - this.IsStartFrameIncluded = isStartFrameIncluded; - this.EndFrameTime = endFrameTime; - this.IsEndFrameIncluded = isEndFrameIncluded; - this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); - this.Resolution = resolution; - this.Duration = duration; - this.GenerateAudio = generateAudio; - this.WebhookUrl = webhookUrl; - this.Private = @private; - this.TargetCollectionId = targetCollectionId; - } - - /// - /// Initializes a new instance of the class. - /// - public EditVideoSeedDance2Request() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdLocalizerRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdLocalizerRequest.Json.g.cs new file mode 100644 index 00000000..f94cda92 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdLocalizerRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class EditWorkflowPostAdLocalizerRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostAdLocalizerRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.EditWorkflowPostAdLocalizerRequest), + jsonSerializerContext) as global::Ideogram.EditWorkflowPostAdLocalizerRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostAdLocalizerRequest? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.EditWorkflowPostAdLocalizerRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.EditWorkflowPostAdLocalizerRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.EditWorkflowPostAdLocalizerRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdLocalizerRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdLocalizerRequest.g.cs new file mode 100644 index 00000000..2c0f5f77 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdLocalizerRequest.g.cs @@ -0,0 +1,169 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// + /// + public sealed partial class EditWorkflowPostAdLocalizerRequest + { + /// + /// The source ad to localize (max size 25MB). Its layout, logos, brand
+ /// type, and product are preserved, and the output keeps its shape, so
+ /// no size or aspect ratio is needed. JPEG, PNG, and WEBP formats are
+ /// supported. Multipart requests only. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("image")] + [global::System.Text.Json.Serialization.JsonRequired] + public required byte[] Image { get; set; } + + /// + /// The source ad to localize (max size 25MB). Its layout, logos, brand
+ /// type, and product are preserved, and the output keeps its shape, so
+ /// no size or aspect ratio is needed. JPEG, PNG, and WEBP formats are
+ /// supported. Multipart requests only. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Imagename { get; set; } + + /// + /// The target language for the copy. Arabic is rendered right-to-left. Each request covers one language; send one request per language. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("language")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguageJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Ideogram.V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage Language { get; set; } + + /// + /// Pre-approved wording, one `original => replacement` mapping per line. Each mapping names the text element showing `original` and sets it to `replacement`, placed character for character rather than translated. Any text element not listed is left as it is in the source. When omitted, all visible marketing copy is translated. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("exact_copy")] + public string? ExactCopy { get; set; } + + /// + /// Optional additional direction for the localization, for example "keep the badge in English". Anything it explicitly asks to change takes priority over the preservation rules. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] + public string? Prompt { get; set; } + + /// + /// The quality tier for the edit. Higher tiers may improve detail and
+ /// take longer to complete. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("quality")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.AdLocalizerQualityJsonConverter))] + public global::Ideogram.AdLocalizerQuality? Quality { get; set; } + + /// + /// Random seed. Set for reproducible generation. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("seed")] + public int? Seed { get; set; } + + /// + /// Number of localized variations to create for this language.
+ /// Default Value: 1 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] + public int? NumImages { get; set; } + + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] + public string? WebhookUrl { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The source ad to localize (max size 25MB). Its layout, logos, brand
+ /// type, and product are preserved, and the output keeps its shape, so
+ /// no size or aspect ratio is needed. JPEG, PNG, and WEBP formats are
+ /// supported. Multipart requests only. + /// + /// + /// The source ad to localize (max size 25MB). Its layout, logos, brand
+ /// type, and product are preserved, and the output keeps its shape, so
+ /// no size or aspect ratio is needed. JPEG, PNG, and WEBP formats are
+ /// supported. Multipart requests only. + /// + /// + /// The target language for the copy. Arabic is rendered right-to-left. Each request covers one language; send one request per language. + /// + /// + /// Pre-approved wording, one `original => replacement` mapping per line. Each mapping names the text element showing `original` and sets it to `replacement`, placed character for character rather than translated. Any text element not listed is left as it is in the source. When omitted, all visible marketing copy is translated. + /// + /// + /// Optional additional direction for the localization, for example "keep the badge in English". Anything it explicitly asks to change takes priority over the preservation rules. + /// + /// + /// The quality tier for the edit. Higher tiers may improve detail and
+ /// take longer to complete. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// Number of localized variations to create for this language.
+ /// Default Value: 1 + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public EditWorkflowPostAdLocalizerRequest( + byte[] image, + string imagename, + global::Ideogram.V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage language, + string? exactCopy, + string? prompt, + global::Ideogram.AdLocalizerQuality? quality, + int? seed, + int? numImages, + string? webhookUrl) + { + this.Image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + this.Imagename = imagename ?? throw new global::System.ArgumentNullException(nameof(imagename)); + this.Language = language; + this.ExactCopy = exactCopy; + this.Prompt = prompt; + this.Quality = quality; + this.Seed = seed; + this.NumImages = numImages; + this.WebhookUrl = webhookUrl; + } + + /// + /// Initializes a new instance of the class. + /// + public EditWorkflowPostAdLocalizerRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdLocalizerResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdLocalizerResponse.Json.g.cs new file mode 100644 index 00000000..e874ffec --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdLocalizerResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class EditWorkflowPostAdLocalizerResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostAdLocalizerResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.EditWorkflowPostAdLocalizerResponse), + jsonSerializerContext) as global::Ideogram.EditWorkflowPostAdLocalizerResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostAdLocalizerResponse? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.EditWorkflowPostAdLocalizerResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.EditWorkflowPostAdLocalizerResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.EditWorkflowPostAdLocalizerResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdLocalizerResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdLocalizerResponse.g.cs new file mode 100644 index 00000000..479db188 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdLocalizerResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class EditWorkflowPostAdLocalizerResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdLocalizerResponse2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdLocalizerResponse2.Json.g.cs new file mode 100644 index 00000000..21e0c05e --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdLocalizerResponse2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class EditWorkflowPostAdLocalizerResponse2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostAdLocalizerResponse2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.EditWorkflowPostAdLocalizerResponse2), + jsonSerializerContext) as global::Ideogram.EditWorkflowPostAdLocalizerResponse2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostAdLocalizerResponse2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.EditWorkflowPostAdLocalizerResponse2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.EditWorkflowPostAdLocalizerResponse2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.EditWorkflowPostAdLocalizerResponse2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdLocalizerResponse2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdLocalizerResponse2.g.cs new file mode 100644 index 00000000..ec4ae2ef --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdLocalizerResponse2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class EditWorkflowPostAdLocalizerResponse2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdLocalizerResponse3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdLocalizerResponse3.Json.g.cs new file mode 100644 index 00000000..b05ec932 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdLocalizerResponse3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class EditWorkflowPostAdLocalizerResponse3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostAdLocalizerResponse3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.EditWorkflowPostAdLocalizerResponse3), + jsonSerializerContext) as global::Ideogram.EditWorkflowPostAdLocalizerResponse3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostAdLocalizerResponse3? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.EditWorkflowPostAdLocalizerResponse3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.EditWorkflowPostAdLocalizerResponse3), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.EditWorkflowPostAdLocalizerResponse3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdLocalizerResponse3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdLocalizerResponse3.g.cs new file mode 100644 index 00000000..dfcddb5f --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdLocalizerResponse3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class EditWorkflowPostAdLocalizerResponse3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdLocalizerResponse4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdLocalizerResponse4.Json.g.cs new file mode 100644 index 00000000..298598b7 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdLocalizerResponse4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class EditWorkflowPostAdLocalizerResponse4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostAdLocalizerResponse4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.EditWorkflowPostAdLocalizerResponse4), + jsonSerializerContext) as global::Ideogram.EditWorkflowPostAdLocalizerResponse4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostAdLocalizerResponse4? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.EditWorkflowPostAdLocalizerResponse4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.EditWorkflowPostAdLocalizerResponse4), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.EditWorkflowPostAdLocalizerResponse4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdLocalizerResponse4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdLocalizerResponse4.g.cs new file mode 100644 index 00000000..bdc91086 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdLocalizerResponse4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class EditWorkflowPostAdLocalizerResponse4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdLocalizerResponse5.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdLocalizerResponse5.Json.g.cs new file mode 100644 index 00000000..9f2a7ac0 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdLocalizerResponse5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class EditWorkflowPostAdLocalizerResponse5 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostAdLocalizerResponse5? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.EditWorkflowPostAdLocalizerResponse5), + jsonSerializerContext) as global::Ideogram.EditWorkflowPostAdLocalizerResponse5; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostAdLocalizerResponse5? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.EditWorkflowPostAdLocalizerResponse5? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.EditWorkflowPostAdLocalizerResponse5), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.EditWorkflowPostAdLocalizerResponse5; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdLocalizerResponse5.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdLocalizerResponse5.g.cs new file mode 100644 index 00000000..871963d6 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdLocalizerResponse5.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class EditWorkflowPostAdLocalizerResponse5 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdResizerRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdResizerRequest.Json.g.cs new file mode 100644 index 00000000..659282ce --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdResizerRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class EditWorkflowPostAdResizerRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostAdResizerRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.EditWorkflowPostAdResizerRequest), + jsonSerializerContext) as global::Ideogram.EditWorkflowPostAdResizerRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostAdResizerRequest? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.EditWorkflowPostAdResizerRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.EditWorkflowPostAdResizerRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.EditWorkflowPostAdResizerRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdResizerRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdResizerRequest.g.cs new file mode 100644 index 00000000..1024fe17 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdResizerRequest.g.cs @@ -0,0 +1,195 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// + /// + public sealed partial class EditWorkflowPostAdResizerRequest + { + /// + /// The source creative to reframe (max size 25MB). JPEG, PNG, and
+ /// WEBP formats are supported. Multipart requests only. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("image")] + [global::System.Text.Json.Serialization.JsonRequired] + public required byte[] Image { get; set; } + + /// + /// The source creative to reframe (max size 25MB). JPEG, PNG, and
+ /// WEBP formats are supported. Multipart requests only. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Imagename { get; set; } + + /// + /// Target ad resolution, formatted as `WIDTHxHEIGHT`. Any value not in
+ /// the list is rejected with a 400. Each output image has exactly these
+ /// pixel dimensions, with or without a `platform`. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolutionJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Ideogram.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution Resolution { get; set; } + + /// + /// The ad platform whose published safe zone the ad must stay inside.
+ /// The ad is generated inside the largest rectangle that fits the
+ /// platform's safe zone for the requested aspect ratio, and the space
+ /// around it is filled in so the output is still exactly the requested
+ /// `resolution`. `google` covers YouTube and Google Ads placements.
+ /// Use `meta_stories` or `meta_reels` for Meta placements; Reels uses
+ /// the largest rectangle inside its notched safe zone. The legacy
+ /// `meta` value is still supported and uses a more conservative safe
+ /// zone. When omitted, the ad fills the whole frame and every
+ /// supported `resolution` is accepted. Any other value is rejected
+ /// with a 400.
+ /// Each platform accepts only the resolutions for which it publishes a
+ /// safe zone; any other `resolution` is rejected with a 400:
+ /// | Platform | Accepted resolutions |
+ /// | --- | --- |
+ /// | `google` | `1920x1080`, `3840x2160`, `1080x1080`, `2400x2400`, `2880x2880`, `1080x1920`, `2160x3840` |
+ /// | `tiktok` | `1920x1080`, `3840x2160`, `1080x1080`, `2400x2400`, `2880x2880`, `1080x1920`, `2160x3840` |
+ /// | `meta_stories` | `1080x1920`, `2160x3840` |
+ /// | `meta_reels` | `1080x1920`, `2160x3840` |
+ /// | `meta` (legacy) | `1080x1920`, `2160x3840` |
+ /// | `snapchat` | `1080x1920`, `2160x3840` | + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("platform")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaPlatformJsonConverter))] + public global::Ideogram.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaPlatform? Platform { get; set; } + + /// + /// Optional edit instruction to apply while reframing, for example "remove the logo" or "put the price bottom-right". + /// + [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] + public string? Prompt { get; set; } + + /// + /// The quality tier for the reframe. Higher tiers may improve detail and
+ /// take longer to complete. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("quality")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.AdResizerQualityJsonConverter))] + public global::Ideogram.AdResizerQuality? Quality { get; set; } + + /// + /// The number of reframed variations to generate.
+ /// Default Value: 1 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] + public int? NumImages { get; set; } + + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] + public string? WebhookUrl { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The source creative to reframe (max size 25MB). JPEG, PNG, and
+ /// WEBP formats are supported. Multipart requests only. + /// + /// + /// The source creative to reframe (max size 25MB). JPEG, PNG, and
+ /// WEBP formats are supported. Multipart requests only. + /// + /// + /// Target ad resolution, formatted as `WIDTHxHEIGHT`. Any value not in
+ /// the list is rejected with a 400. Each output image has exactly these
+ /// pixel dimensions, with or without a `platform`. + /// + /// + /// The ad platform whose published safe zone the ad must stay inside.
+ /// The ad is generated inside the largest rectangle that fits the
+ /// platform's safe zone for the requested aspect ratio, and the space
+ /// around it is filled in so the output is still exactly the requested
+ /// `resolution`. `google` covers YouTube and Google Ads placements.
+ /// Use `meta_stories` or `meta_reels` for Meta placements; Reels uses
+ /// the largest rectangle inside its notched safe zone. The legacy
+ /// `meta` value is still supported and uses a more conservative safe
+ /// zone. When omitted, the ad fills the whole frame and every
+ /// supported `resolution` is accepted. Any other value is rejected
+ /// with a 400.
+ /// Each platform accepts only the resolutions for which it publishes a
+ /// safe zone; any other `resolution` is rejected with a 400:
+ /// | Platform | Accepted resolutions |
+ /// | --- | --- |
+ /// | `google` | `1920x1080`, `3840x2160`, `1080x1080`, `2400x2400`, `2880x2880`, `1080x1920`, `2160x3840` |
+ /// | `tiktok` | `1920x1080`, `3840x2160`, `1080x1080`, `2400x2400`, `2880x2880`, `1080x1920`, `2160x3840` |
+ /// | `meta_stories` | `1080x1920`, `2160x3840` |
+ /// | `meta_reels` | `1080x1920`, `2160x3840` |
+ /// | `meta` (legacy) | `1080x1920`, `2160x3840` |
+ /// | `snapchat` | `1080x1920`, `2160x3840` | + /// + /// + /// Optional edit instruction to apply while reframing, for example "remove the logo" or "put the price bottom-right". + /// + /// + /// The quality tier for the reframe. Higher tiers may improve detail and
+ /// take longer to complete. + /// + /// + /// The number of reframed variations to generate.
+ /// Default Value: 1 + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public EditWorkflowPostAdResizerRequest( + byte[] image, + string imagename, + global::Ideogram.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution resolution, + global::Ideogram.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaPlatform? platform, + string? prompt, + global::Ideogram.AdResizerQuality? quality, + int? numImages, + string? webhookUrl) + { + this.Image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + this.Imagename = imagename ?? throw new global::System.ArgumentNullException(nameof(imagename)); + this.Resolution = resolution; + this.Platform = platform; + this.Prompt = prompt; + this.Quality = quality; + this.NumImages = numImages; + this.WebhookUrl = webhookUrl; + } + + /// + /// Initializes a new instance of the class. + /// + public EditWorkflowPostAdResizerRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdResizerResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdResizerResponse.Json.g.cs new file mode 100644 index 00000000..f62381f7 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdResizerResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class EditWorkflowPostAdResizerResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostAdResizerResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.EditWorkflowPostAdResizerResponse), + jsonSerializerContext) as global::Ideogram.EditWorkflowPostAdResizerResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostAdResizerResponse? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.EditWorkflowPostAdResizerResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.EditWorkflowPostAdResizerResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.EditWorkflowPostAdResizerResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdResizerResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdResizerResponse.g.cs new file mode 100644 index 00000000..2e2e679e --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdResizerResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class EditWorkflowPostAdResizerResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdResizerResponse2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdResizerResponse2.Json.g.cs new file mode 100644 index 00000000..e5b9e382 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdResizerResponse2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class EditWorkflowPostAdResizerResponse2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostAdResizerResponse2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.EditWorkflowPostAdResizerResponse2), + jsonSerializerContext) as global::Ideogram.EditWorkflowPostAdResizerResponse2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostAdResizerResponse2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.EditWorkflowPostAdResizerResponse2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.EditWorkflowPostAdResizerResponse2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.EditWorkflowPostAdResizerResponse2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdResizerResponse2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdResizerResponse2.g.cs new file mode 100644 index 00000000..b57d2f0c --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdResizerResponse2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class EditWorkflowPostAdResizerResponse2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdResizerResponse3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdResizerResponse3.Json.g.cs new file mode 100644 index 00000000..d7d5ac3a --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdResizerResponse3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class EditWorkflowPostAdResizerResponse3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostAdResizerResponse3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.EditWorkflowPostAdResizerResponse3), + jsonSerializerContext) as global::Ideogram.EditWorkflowPostAdResizerResponse3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostAdResizerResponse3? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.EditWorkflowPostAdResizerResponse3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.EditWorkflowPostAdResizerResponse3), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.EditWorkflowPostAdResizerResponse3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdResizerResponse3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdResizerResponse3.g.cs new file mode 100644 index 00000000..2095823c --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdResizerResponse3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class EditWorkflowPostAdResizerResponse3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdResizerResponse4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdResizerResponse4.Json.g.cs new file mode 100644 index 00000000..6c975266 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdResizerResponse4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class EditWorkflowPostAdResizerResponse4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostAdResizerResponse4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.EditWorkflowPostAdResizerResponse4), + jsonSerializerContext) as global::Ideogram.EditWorkflowPostAdResizerResponse4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostAdResizerResponse4? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.EditWorkflowPostAdResizerResponse4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.EditWorkflowPostAdResizerResponse4), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.EditWorkflowPostAdResizerResponse4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdResizerResponse4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdResizerResponse4.g.cs new file mode 100644 index 00000000..0fdb0496 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdResizerResponse4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class EditWorkflowPostAdResizerResponse4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdResizerResponse5.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdResizerResponse5.Json.g.cs new file mode 100644 index 00000000..c81076c2 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdResizerResponse5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class EditWorkflowPostAdResizerResponse5 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostAdResizerResponse5? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.EditWorkflowPostAdResizerResponse5), + jsonSerializerContext) as global::Ideogram.EditWorkflowPostAdResizerResponse5; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostAdResizerResponse5? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.EditWorkflowPostAdResizerResponse5? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.EditWorkflowPostAdResizerResponse5), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.EditWorkflowPostAdResizerResponse5; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdResizerResponse5.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdResizerResponse5.g.cs new file mode 100644 index 00000000..626bc82c --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdResizerResponse5.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class EditWorkflowPostAdResizerResponse5 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdVariationsRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdVariationsRequest.Json.g.cs new file mode 100644 index 00000000..97cc259f --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdVariationsRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class EditWorkflowPostAdVariationsRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostAdVariationsRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.EditWorkflowPostAdVariationsRequest), + jsonSerializerContext) as global::Ideogram.EditWorkflowPostAdVariationsRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostAdVariationsRequest? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.EditWorkflowPostAdVariationsRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.EditWorkflowPostAdVariationsRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.EditWorkflowPostAdVariationsRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdVariationsRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdVariationsRequest.g.cs new file mode 100644 index 00000000..49cd5da7 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdVariationsRequest.g.cs @@ -0,0 +1,155 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// + /// + public sealed partial class EditWorkflowPostAdVariationsRequest + { + /// + /// The source creative to vary (max size 25MB). JPEG, PNG, and WEBP
+ /// formats are supported. Multipart requests only. Each output keeps
+ /// the source's aspect ratio, capped at 3:1 between the long and short
+ /// sides. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("image")] + [global::System.Text.Json.Serialization.JsonRequired] + public required byte[] Image { get; set; } + + /// + /// The source creative to vary (max size 25MB). JPEG, PNG, and WEBP
+ /// formats are supported. Multipart requests only. Each output keeps
+ /// the source's aspect ratio, capped at 3:1 between the long and short
+ /// sides. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Imagename { get; set; } + + /// + /// The axis to vary. `people`
+ /// replaces the people in the ad with different talent. `setting`
+ /// moves the same subject and product to a different environment.
+ /// `group_size` changes how many people appear. `scene` shifts the
+ /// moment or occasion (time of day, season, or activity). + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("variation_type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.V2ToolAdVariationsPostRequestBodyContentMultipartFormDataSchemaVariationTypeJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Ideogram.V2ToolAdVariationsPostRequestBodyContentMultipartFormDataSchemaVariationType VariationType { get; set; } + + /// + /// Optional direction to steer the variation, for example "set it on a beach" or "make the models older". Anything it explicitly asks to change takes priority over the default preservation rules. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] + public string? Prompt { get; set; } + + /// + /// The quality tier for the edit. Higher tiers may improve detail and
+ /// take longer to complete. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("quality")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.AdVariationsQualityJsonConverter))] + public global::Ideogram.AdVariationsQuality? Quality { get; set; } + + /// + /// The number of variations to generate along the requested axis.
+ /// Default Value: 1 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] + public int? NumImages { get; set; } + + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] + public string? WebhookUrl { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The source creative to vary (max size 25MB). JPEG, PNG, and WEBP
+ /// formats are supported. Multipart requests only. Each output keeps
+ /// the source's aspect ratio, capped at 3:1 between the long and short
+ /// sides. + /// + /// + /// The source creative to vary (max size 25MB). JPEG, PNG, and WEBP
+ /// formats are supported. Multipart requests only. Each output keeps
+ /// the source's aspect ratio, capped at 3:1 between the long and short
+ /// sides. + /// + /// + /// The axis to vary. `people`
+ /// replaces the people in the ad with different talent. `setting`
+ /// moves the same subject and product to a different environment.
+ /// `group_size` changes how many people appear. `scene` shifts the
+ /// moment or occasion (time of day, season, or activity). + /// + /// + /// Optional direction to steer the variation, for example "set it on a beach" or "make the models older". Anything it explicitly asks to change takes priority over the default preservation rules. + /// + /// + /// The quality tier for the edit. Higher tiers may improve detail and
+ /// take longer to complete. + /// + /// + /// The number of variations to generate along the requested axis.
+ /// Default Value: 1 + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public EditWorkflowPostAdVariationsRequest( + byte[] image, + string imagename, + global::Ideogram.V2ToolAdVariationsPostRequestBodyContentMultipartFormDataSchemaVariationType variationType, + string? prompt, + global::Ideogram.AdVariationsQuality? quality, + int? numImages, + string? webhookUrl) + { + this.Image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + this.Imagename = imagename ?? throw new global::System.ArgumentNullException(nameof(imagename)); + this.VariationType = variationType; + this.Prompt = prompt; + this.Quality = quality; + this.NumImages = numImages; + this.WebhookUrl = webhookUrl; + } + + /// + /// Initializes a new instance of the class. + /// + public EditWorkflowPostAdVariationsRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdVariationsResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdVariationsResponse.Json.g.cs new file mode 100644 index 00000000..f37ac974 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdVariationsResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class EditWorkflowPostAdVariationsResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostAdVariationsResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.EditWorkflowPostAdVariationsResponse), + jsonSerializerContext) as global::Ideogram.EditWorkflowPostAdVariationsResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostAdVariationsResponse? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.EditWorkflowPostAdVariationsResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.EditWorkflowPostAdVariationsResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.EditWorkflowPostAdVariationsResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdVariationsResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdVariationsResponse.g.cs new file mode 100644 index 00000000..837f1cf6 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdVariationsResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class EditWorkflowPostAdVariationsResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdVariationsResponse2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdVariationsResponse2.Json.g.cs new file mode 100644 index 00000000..7c06c9cd --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdVariationsResponse2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class EditWorkflowPostAdVariationsResponse2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostAdVariationsResponse2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.EditWorkflowPostAdVariationsResponse2), + jsonSerializerContext) as global::Ideogram.EditWorkflowPostAdVariationsResponse2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostAdVariationsResponse2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.EditWorkflowPostAdVariationsResponse2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.EditWorkflowPostAdVariationsResponse2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.EditWorkflowPostAdVariationsResponse2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdVariationsResponse2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdVariationsResponse2.g.cs new file mode 100644 index 00000000..d205447d --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdVariationsResponse2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class EditWorkflowPostAdVariationsResponse2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdVariationsResponse3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdVariationsResponse3.Json.g.cs new file mode 100644 index 00000000..4084e37e --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdVariationsResponse3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class EditWorkflowPostAdVariationsResponse3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostAdVariationsResponse3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.EditWorkflowPostAdVariationsResponse3), + jsonSerializerContext) as global::Ideogram.EditWorkflowPostAdVariationsResponse3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostAdVariationsResponse3? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.EditWorkflowPostAdVariationsResponse3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.EditWorkflowPostAdVariationsResponse3), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.EditWorkflowPostAdVariationsResponse3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdVariationsResponse3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdVariationsResponse3.g.cs new file mode 100644 index 00000000..10e9aeb7 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdVariationsResponse3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class EditWorkflowPostAdVariationsResponse3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdVariationsResponse4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdVariationsResponse4.Json.g.cs new file mode 100644 index 00000000..83a83eff --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdVariationsResponse4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class EditWorkflowPostAdVariationsResponse4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostAdVariationsResponse4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.EditWorkflowPostAdVariationsResponse4), + jsonSerializerContext) as global::Ideogram.EditWorkflowPostAdVariationsResponse4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostAdVariationsResponse4? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.EditWorkflowPostAdVariationsResponse4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.EditWorkflowPostAdVariationsResponse4), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.EditWorkflowPostAdVariationsResponse4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdVariationsResponse4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdVariationsResponse4.g.cs new file mode 100644 index 00000000..88ae5160 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdVariationsResponse4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class EditWorkflowPostAdVariationsResponse4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdVariationsResponse5.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdVariationsResponse5.Json.g.cs new file mode 100644 index 00000000..867b8356 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdVariationsResponse5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class EditWorkflowPostAdVariationsResponse5 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostAdVariationsResponse5? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.EditWorkflowPostAdVariationsResponse5), + jsonSerializerContext) as global::Ideogram.EditWorkflowPostAdVariationsResponse5; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostAdVariationsResponse5? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.EditWorkflowPostAdVariationsResponse5? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.EditWorkflowPostAdVariationsResponse5), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.EditWorkflowPostAdVariationsResponse5; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdVariationsResponse5.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdVariationsResponse5.g.cs new file mode 100644 index 00000000..d5b7f94a --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostAdVariationsResponse5.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class EditWorkflowPostAdVariationsResponse5 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostColorwaysRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostColorwaysRequest.Json.g.cs new file mode 100644 index 00000000..63f512b5 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostColorwaysRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class EditWorkflowPostColorwaysRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostColorwaysRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.EditWorkflowPostColorwaysRequest), + jsonSerializerContext) as global::Ideogram.EditWorkflowPostColorwaysRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostColorwaysRequest? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.EditWorkflowPostColorwaysRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.EditWorkflowPostColorwaysRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.EditWorkflowPostColorwaysRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostColorwaysRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostColorwaysRequest.g.cs new file mode 100644 index 00000000..bd78bfa0 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostColorwaysRequest.g.cs @@ -0,0 +1,158 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// + /// + public sealed partial class EditWorkflowPostColorwaysRequest + { + /// + /// The product photo to recolor (max size 25MB). JPEG, PNG, and WEBP
+ /// formats are supported. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("image")] + [global::System.Text.Json.Serialization.JsonRequired] + public required byte[] Image { get; set; } + + /// + /// The product photo to recolor (max size 25MB). JPEG, PNG, and WEBP
+ /// formats are supported. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Imagename { get; set; } + + /// + /// Masks marking the regions to recolor (max 4, max size 25MB each),
+ /// paired by position with `colors`. JPEG, PNG, and WEBP formats are
+ /// supported. Every mask must have the same pixel dimensions as the
+ /// product photo. White pixels mark the region to recolor and black
+ /// pixels are preserved; alpha-only masks also work (opaque =
+ /// recolor, transparent = preserve). + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("masks")] + public global::System.Collections.Generic.IList? Masks { get; set; } + + /// + /// One target color per mask in `masks`, as six-digit hex codes like
+ /// `#B3202C`, paired by position. The product's shape, construction,
+ /// materials, prints, and logos are always preserved. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("colors")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Colors { get; set; } + + /// + /// Output aspect ratio. Defaults to the product photo's aspect ratio,
+ /// which keeps the original framing. A different ratio extends the
+ /// scene to fill the new shape rather than cropping, so part of the
+ /// frame is newly generated. Supported values are `1:1`, `3:4`,
+ /// `4:3`, `16:9`, and `9:16`. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] + public string? AspectRatio { get; set; } + + /// + /// The quality tier for the edit. Higher tiers may improve detail and
+ /// take longer to complete. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("quality")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ColorwaysQualityJsonConverter))] + public global::Ideogram.ColorwaysQuality? Quality { get; set; } + + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] + public string? WebhookUrl { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The product photo to recolor (max size 25MB). JPEG, PNG, and WEBP
+ /// formats are supported. + /// + /// + /// The product photo to recolor (max size 25MB). JPEG, PNG, and WEBP
+ /// formats are supported. + /// + /// + /// One target color per mask in `masks`, as six-digit hex codes like
+ /// `#B3202C`, paired by position. The product's shape, construction,
+ /// materials, prints, and logos are always preserved. + /// + /// + /// Masks marking the regions to recolor (max 4, max size 25MB each),
+ /// paired by position with `colors`. JPEG, PNG, and WEBP formats are
+ /// supported. Every mask must have the same pixel dimensions as the
+ /// product photo. White pixels mark the region to recolor and black
+ /// pixels are preserved; alpha-only masks also work (opaque =
+ /// recolor, transparent = preserve). + /// + /// + /// Output aspect ratio. Defaults to the product photo's aspect ratio,
+ /// which keeps the original framing. A different ratio extends the
+ /// scene to fill the new shape rather than cropping, so part of the
+ /// frame is newly generated. Supported values are `1:1`, `3:4`,
+ /// `4:3`, `16:9`, and `9:16`. + /// + /// + /// The quality tier for the edit. Higher tiers may improve detail and
+ /// take longer to complete. + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public EditWorkflowPostColorwaysRequest( + byte[] image, + string imagename, + global::System.Collections.Generic.IList colors, + global::System.Collections.Generic.IList? masks, + string? aspectRatio, + global::Ideogram.ColorwaysQuality? quality, + string? webhookUrl) + { + this.Image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + this.Imagename = imagename ?? throw new global::System.ArgumentNullException(nameof(imagename)); + this.Masks = masks; + this.Colors = colors ?? throw new global::System.ArgumentNullException(nameof(colors)); + this.AspectRatio = aspectRatio; + this.Quality = quality; + this.WebhookUrl = webhookUrl; + } + + /// + /// Initializes a new instance of the class. + /// + public EditWorkflowPostColorwaysRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostColorwaysResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostColorwaysResponse.Json.g.cs new file mode 100644 index 00000000..c0c1c04e --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostColorwaysResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class EditWorkflowPostColorwaysResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostColorwaysResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.EditWorkflowPostColorwaysResponse), + jsonSerializerContext) as global::Ideogram.EditWorkflowPostColorwaysResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostColorwaysResponse? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.EditWorkflowPostColorwaysResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.EditWorkflowPostColorwaysResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.EditWorkflowPostColorwaysResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostColorwaysResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostColorwaysResponse.g.cs new file mode 100644 index 00000000..7da08d4a --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostColorwaysResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class EditWorkflowPostColorwaysResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostColorwaysResponse2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostColorwaysResponse2.Json.g.cs new file mode 100644 index 00000000..f0997fde --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostColorwaysResponse2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class EditWorkflowPostColorwaysResponse2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostColorwaysResponse2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.EditWorkflowPostColorwaysResponse2), + jsonSerializerContext) as global::Ideogram.EditWorkflowPostColorwaysResponse2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostColorwaysResponse2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.EditWorkflowPostColorwaysResponse2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.EditWorkflowPostColorwaysResponse2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.EditWorkflowPostColorwaysResponse2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostColorwaysResponse2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostColorwaysResponse2.g.cs new file mode 100644 index 00000000..eaa1b897 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostColorwaysResponse2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class EditWorkflowPostColorwaysResponse2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostColorwaysResponse3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostColorwaysResponse3.Json.g.cs new file mode 100644 index 00000000..55f75370 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostColorwaysResponse3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class EditWorkflowPostColorwaysResponse3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostColorwaysResponse3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.EditWorkflowPostColorwaysResponse3), + jsonSerializerContext) as global::Ideogram.EditWorkflowPostColorwaysResponse3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostColorwaysResponse3? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.EditWorkflowPostColorwaysResponse3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.EditWorkflowPostColorwaysResponse3), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.EditWorkflowPostColorwaysResponse3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostColorwaysResponse3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostColorwaysResponse3.g.cs new file mode 100644 index 00000000..c1752445 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostColorwaysResponse3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class EditWorkflowPostColorwaysResponse3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostGhostMannequinRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostGhostMannequinRequest.Json.g.cs new file mode 100644 index 00000000..725d52f2 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostGhostMannequinRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class EditWorkflowPostGhostMannequinRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostGhostMannequinRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.EditWorkflowPostGhostMannequinRequest), + jsonSerializerContext) as global::Ideogram.EditWorkflowPostGhostMannequinRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostGhostMannequinRequest? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.EditWorkflowPostGhostMannequinRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.EditWorkflowPostGhostMannequinRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.EditWorkflowPostGhostMannequinRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostGhostMannequinRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostGhostMannequinRequest.g.cs new file mode 100644 index 00000000..b7be3de8 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostGhostMannequinRequest.g.cs @@ -0,0 +1,367 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// + /// + public sealed partial class EditWorkflowPostGhostMannequinRequest + { + /// + /// Additional photos of the same garment, up to 50 MB each. JPEG,
+ /// PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and MPO are supported.
+ /// Multipart requests only. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("garment_images")] + public global::System.Collections.Generic.IList? GarmentImages { get; set; } + + /// + /// Optional front-view garment photo, up to 50 MB. Multipart requests
+ /// only. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("front_image")] + public byte[]? FrontImage { get; set; } + + /// + /// Optional front-view garment photo, up to 50 MB. Multipart requests
+ /// only. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("front_imagename")] + public string? FrontImagename { get; set; } + + /// + /// Optional back-view garment photo, up to 50 MB. Multipart requests
+ /// only. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("back_image")] + public byte[]? BackImage { get; set; } + + /// + /// Optional back-view garment photo, up to 50 MB. Multipart requests
+ /// only. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("back_imagename")] + public string? BackImagename { get; set; } + + /// + /// Optional left-view garment photo, up to 50 MB. Multipart requests
+ /// only. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("left_image")] + public byte[]? LeftImage { get; set; } + + /// + /// Optional left-view garment photo, up to 50 MB. Multipart requests
+ /// only. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("left_imagename")] + public string? LeftImagename { get; set; } + + /// + /// Optional right-view garment photo, up to 50 MB. Multipart requests
+ /// only. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("right_image")] + public byte[]? RightImage { get; set; } + + /// + /// Optional right-view garment photo, up to 50 MB. Multipart requests
+ /// only. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("right_imagename")] + public string? RightImagename { get; set; } + + /// + /// Optional top-view garment photo, up to 50 MB. Multipart requests
+ /// only. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("top_image")] + public byte[]? TopImage { get; set; } + + /// + /// Optional top-view garment photo, up to 50 MB. Multipart requests
+ /// only. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("top_imagename")] + public string? TopImagename { get; set; } + + /// + /// Optional bottom-view garment photo, up to 50 MB. Multipart
+ /// requests only. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("bottom_image")] + public byte[]? BottomImage { get; set; } + + /// + /// Optional bottom-view garment photo, up to 50 MB. Multipart
+ /// requests only. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("bottom_imagename")] + public string? BottomImagename { get; set; } + + /// + /// An identifier for an ideogram asset. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("output_reference_asset_identifier")] + public global::Ideogram.AssetIdentifier? OutputReferenceAssetIdentifier { get; set; } + + /// + /// Optional presentation example, up to 50 MB. Multipart requests only.
+ /// Guides pose, framing, and lighting without copying its garment,
+ /// colors, text, or branding. Garment photos remain authoritative for
+ /// product identity; view and aspect_ratio take precedence, and the
+ /// background remains white. Does not replace a required garment photo.
+ /// Mutually exclusive with `output_reference_asset_identifier`. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("output_reference_image")] + public byte[]? OutputReferenceImage { get; set; } + + /// + /// Optional presentation example, up to 50 MB. Multipart requests only.
+ /// Guides pose, framing, and lighting without copying its garment,
+ /// colors, text, or branding. Garment photos remain authoritative for
+ /// product identity; view and aspect_ratio take precedence, and the
+ /// background remains white. Does not replace a required garment photo.
+ /// Mutually exclusive with `output_reference_asset_identifier`. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("output_reference_imagename")] + public string? OutputReferenceImagename { get; set; } + + /// + /// Camera view for the output garment. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("view")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.V2ToolGhostMannequinPostRequestBodyContentMultipartFormDataSchemaViewJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Ideogram.V2ToolGhostMannequinPostRequestBodyContentMultipartFormDataSchemaView View { get; set; } + + /// + /// Optional reconstruction guidance or identity-critical garment
+ /// details to check against the photos. The output always uses a clean
+ /// white studio background. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("instruction")] + public string? Instruction { get; set; } + + /// + /// Optional JSON object serialized as a string containing factual
+ /// product context, such as title, brand, category, color, material,
+ /// item code, and exact printed text. Metadata helps disambiguate the
+ /// garment photos but does not add features they do not show. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("metadata")] + public string? Metadata { get; set; } + + /// + /// Output aspect ratio. Defaults to `1:1` when omitted. Supported
+ /// values are `1:1`, `3:4`, `4:3`, `16:9`, and `9:16`. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] + public string? AspectRatio { get; set; } + + /// + /// The quality tier for the edit. Higher tiers may improve detail and
+ /// take longer to complete. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("quality")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.GhostMannequinQualityJsonConverter))] + public global::Ideogram.GhostMannequinQuality? Quality { get; set; } + + /// + /// Optional seed for repeatable results. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("seed")] + public int? Seed { get; set; } + + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] + public string? WebhookUrl { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Camera view for the output garment. + /// + /// + /// Additional photos of the same garment, up to 50 MB each. JPEG,
+ /// PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and MPO are supported.
+ /// Multipart requests only. + /// + /// + /// Optional front-view garment photo, up to 50 MB. Multipart requests
+ /// only. + /// + /// + /// Optional front-view garment photo, up to 50 MB. Multipart requests
+ /// only. + /// + /// + /// Optional back-view garment photo, up to 50 MB. Multipart requests
+ /// only. + /// + /// + /// Optional back-view garment photo, up to 50 MB. Multipart requests
+ /// only. + /// + /// + /// Optional left-view garment photo, up to 50 MB. Multipart requests
+ /// only. + /// + /// + /// Optional left-view garment photo, up to 50 MB. Multipart requests
+ /// only. + /// + /// + /// Optional right-view garment photo, up to 50 MB. Multipart requests
+ /// only. + /// + /// + /// Optional right-view garment photo, up to 50 MB. Multipart requests
+ /// only. + /// + /// + /// Optional top-view garment photo, up to 50 MB. Multipart requests
+ /// only. + /// + /// + /// Optional top-view garment photo, up to 50 MB. Multipart requests
+ /// only. + /// + /// + /// Optional bottom-view garment photo, up to 50 MB. Multipart
+ /// requests only. + /// + /// + /// Optional bottom-view garment photo, up to 50 MB. Multipart
+ /// requests only. + /// + /// + /// An identifier for an ideogram asset. + /// + /// + /// Optional presentation example, up to 50 MB. Multipart requests only.
+ /// Guides pose, framing, and lighting without copying its garment,
+ /// colors, text, or branding. Garment photos remain authoritative for
+ /// product identity; view and aspect_ratio take precedence, and the
+ /// background remains white. Does not replace a required garment photo.
+ /// Mutually exclusive with `output_reference_asset_identifier`. + /// + /// + /// Optional presentation example, up to 50 MB. Multipart requests only.
+ /// Guides pose, framing, and lighting without copying its garment,
+ /// colors, text, or branding. Garment photos remain authoritative for
+ /// product identity; view and aspect_ratio take precedence, and the
+ /// background remains white. Does not replace a required garment photo.
+ /// Mutually exclusive with `output_reference_asset_identifier`. + /// + /// + /// Optional reconstruction guidance or identity-critical garment
+ /// details to check against the photos. The output always uses a clean
+ /// white studio background. + /// + /// + /// Optional JSON object serialized as a string containing factual
+ /// product context, such as title, brand, category, color, material,
+ /// item code, and exact printed text. Metadata helps disambiguate the
+ /// garment photos but does not add features they do not show. + /// + /// + /// Output aspect ratio. Defaults to `1:1` when omitted. Supported
+ /// values are `1:1`, `3:4`, `4:3`, `16:9`, and `9:16`. + /// + /// + /// The quality tier for the edit. Higher tiers may improve detail and
+ /// take longer to complete. + /// + /// + /// Optional seed for repeatable results. + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public EditWorkflowPostGhostMannequinRequest( + global::Ideogram.V2ToolGhostMannequinPostRequestBodyContentMultipartFormDataSchemaView view, + global::System.Collections.Generic.IList? garmentImages, + byte[]? frontImage, + string? frontImagename, + byte[]? backImage, + string? backImagename, + byte[]? leftImage, + string? leftImagename, + byte[]? rightImage, + string? rightImagename, + byte[]? topImage, + string? topImagename, + byte[]? bottomImage, + string? bottomImagename, + global::Ideogram.AssetIdentifier? outputReferenceAssetIdentifier, + byte[]? outputReferenceImage, + string? outputReferenceImagename, + string? instruction, + string? metadata, + string? aspectRatio, + global::Ideogram.GhostMannequinQuality? quality, + int? seed, + string? webhookUrl) + { + this.GarmentImages = garmentImages; + this.FrontImage = frontImage; + this.FrontImagename = frontImagename; + this.BackImage = backImage; + this.BackImagename = backImagename; + this.LeftImage = leftImage; + this.LeftImagename = leftImagename; + this.RightImage = rightImage; + this.RightImagename = rightImagename; + this.TopImage = topImage; + this.TopImagename = topImagename; + this.BottomImage = bottomImage; + this.BottomImagename = bottomImagename; + this.OutputReferenceAssetIdentifier = outputReferenceAssetIdentifier; + this.OutputReferenceImage = outputReferenceImage; + this.OutputReferenceImagename = outputReferenceImagename; + this.View = view; + this.Instruction = instruction; + this.Metadata = metadata; + this.AspectRatio = aspectRatio; + this.Quality = quality; + this.Seed = seed; + this.WebhookUrl = webhookUrl; + } + + /// + /// Initializes a new instance of the class. + /// + public EditWorkflowPostGhostMannequinRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostGhostMannequinResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostGhostMannequinResponse.Json.g.cs new file mode 100644 index 00000000..acfda5c8 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostGhostMannequinResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class EditWorkflowPostGhostMannequinResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostGhostMannequinResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.EditWorkflowPostGhostMannequinResponse), + jsonSerializerContext) as global::Ideogram.EditWorkflowPostGhostMannequinResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostGhostMannequinResponse? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.EditWorkflowPostGhostMannequinResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.EditWorkflowPostGhostMannequinResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.EditWorkflowPostGhostMannequinResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostGhostMannequinResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostGhostMannequinResponse.g.cs new file mode 100644 index 00000000..1a3b23c9 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostGhostMannequinResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class EditWorkflowPostGhostMannequinResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostGhostMannequinResponse2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostGhostMannequinResponse2.Json.g.cs new file mode 100644 index 00000000..f575547e --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostGhostMannequinResponse2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class EditWorkflowPostGhostMannequinResponse2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostGhostMannequinResponse2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.EditWorkflowPostGhostMannequinResponse2), + jsonSerializerContext) as global::Ideogram.EditWorkflowPostGhostMannequinResponse2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostGhostMannequinResponse2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.EditWorkflowPostGhostMannequinResponse2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.EditWorkflowPostGhostMannequinResponse2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.EditWorkflowPostGhostMannequinResponse2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostGhostMannequinResponse2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostGhostMannequinResponse2.g.cs new file mode 100644 index 00000000..b1c51559 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostGhostMannequinResponse2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class EditWorkflowPostGhostMannequinResponse2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostGhostMannequinResponse3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostGhostMannequinResponse3.Json.g.cs new file mode 100644 index 00000000..ca730852 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostGhostMannequinResponse3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class EditWorkflowPostGhostMannequinResponse3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostGhostMannequinResponse3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.EditWorkflowPostGhostMannequinResponse3), + jsonSerializerContext) as global::Ideogram.EditWorkflowPostGhostMannequinResponse3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostGhostMannequinResponse3? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.EditWorkflowPostGhostMannequinResponse3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.EditWorkflowPostGhostMannequinResponse3), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.EditWorkflowPostGhostMannequinResponse3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostGhostMannequinResponse3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostGhostMannequinResponse3.g.cs new file mode 100644 index 00000000..93a3dc18 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostGhostMannequinResponse3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class EditWorkflowPostGhostMannequinResponse3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostGhostMannequinResponse4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostGhostMannequinResponse4.Json.g.cs new file mode 100644 index 00000000..e994d526 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostGhostMannequinResponse4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class EditWorkflowPostGhostMannequinResponse4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostGhostMannequinResponse4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.EditWorkflowPostGhostMannequinResponse4), + jsonSerializerContext) as global::Ideogram.EditWorkflowPostGhostMannequinResponse4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostGhostMannequinResponse4? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.EditWorkflowPostGhostMannequinResponse4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.EditWorkflowPostGhostMannequinResponse4), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.EditWorkflowPostGhostMannequinResponse4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostGhostMannequinResponse4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostGhostMannequinResponse4.g.cs new file mode 100644 index 00000000..8a3edf20 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostGhostMannequinResponse4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class EditWorkflowPostGhostMannequinResponse4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostGhostMannequinResponse5.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostGhostMannequinResponse5.Json.g.cs new file mode 100644 index 00000000..846f00ad --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostGhostMannequinResponse5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class EditWorkflowPostGhostMannequinResponse5 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostGhostMannequinResponse5? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.EditWorkflowPostGhostMannequinResponse5), + jsonSerializerContext) as global::Ideogram.EditWorkflowPostGhostMannequinResponse5; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostGhostMannequinResponse5? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.EditWorkflowPostGhostMannequinResponse5? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.EditWorkflowPostGhostMannequinResponse5), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.EditWorkflowPostGhostMannequinResponse5; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostGhostMannequinResponse5.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostGhostMannequinResponse5.g.cs new file mode 100644 index 00000000..34b43c4b --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostGhostMannequinResponse5.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class EditWorkflowPostGhostMannequinResponse5 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostGhostMannequinResponse6.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostGhostMannequinResponse6.Json.g.cs new file mode 100644 index 00000000..c6fe19ad --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostGhostMannequinResponse6.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class EditWorkflowPostGhostMannequinResponse6 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostGhostMannequinResponse6? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.EditWorkflowPostGhostMannequinResponse6), + jsonSerializerContext) as global::Ideogram.EditWorkflowPostGhostMannequinResponse6; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostGhostMannequinResponse6? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.EditWorkflowPostGhostMannequinResponse6? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.EditWorkflowPostGhostMannequinResponse6), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.EditWorkflowPostGhostMannequinResponse6; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostGhostMannequinResponse6.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostGhostMannequinResponse6.g.cs new file mode 100644 index 00000000..b0c9c39d --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostGhostMannequinResponse6.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class EditWorkflowPostGhostMannequinResponse6 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostMaterialSwapRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostMaterialSwapRequest.Json.g.cs new file mode 100644 index 00000000..3dd1301d --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostMaterialSwapRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class EditWorkflowPostMaterialSwapRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostMaterialSwapRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.EditWorkflowPostMaterialSwapRequest), + jsonSerializerContext) as global::Ideogram.EditWorkflowPostMaterialSwapRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostMaterialSwapRequest? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.EditWorkflowPostMaterialSwapRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.EditWorkflowPostMaterialSwapRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.EditWorkflowPostMaterialSwapRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostMaterialSwapRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostMaterialSwapRequest.g.cs new file mode 100644 index 00000000..3370ad43 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostMaterialSwapRequest.g.cs @@ -0,0 +1,159 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// + /// + public sealed partial class EditWorkflowPostMaterialSwapRequest + { + /// + /// The product photo to edit (max size 25MB). JPEG, PNG, and WEBP
+ /// formats are supported. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("image")] + [global::System.Text.Json.Serialization.JsonRequired] + public required byte[] Image { get; set; } + + /// + /// The product photo to edit (max size 25MB). JPEG, PNG, and WEBP
+ /// formats are supported. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Imagename { get; set; } + + /// + /// Masks marking the regions to change (max 4, max size 25MB each).
+ /// JPEG, PNG, and WEBP formats are supported. Every mask must have the
+ /// same pixel dimensions as the product photo. White pixels mark the
+ /// region to change and black pixels are preserved; alpha-only masks
+ /// also work (opaque = change, transparent = preserve). + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("masks")] + public global::System.Collections.Generic.IList? Masks { get; set; } + + /// + /// Material reference images (max size 25MB each). JPEG, PNG, and WEBP
+ /// formats are supported. Only their material (color, texture, pattern
+ /// scale, and orientation) is applied to the masked regions. Send one
+ /// material for every mask, or exactly one per mask, paired by
+ /// position. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("materials")] + public global::System.Collections.Generic.IList? Materials { get; set; } + + /// + /// Output aspect ratio. Defaults to the product photo's aspect ratio,
+ /// which keeps the original framing. A different ratio extends the
+ /// scene to fill the new shape rather than cropping, so part of the
+ /// frame is newly generated. Supported values are `1:1`, `3:4`,
+ /// `4:3`, `16:9`, and `9:16`. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] + public string? AspectRatio { get; set; } + + /// + /// The quality tier for the edit. Higher tiers may improve detail and
+ /// take longer to complete. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("quality")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.MaterialSwapQualityJsonConverter))] + public global::Ideogram.MaterialSwapQuality? Quality { get; set; } + + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] + public string? WebhookUrl { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The product photo to edit (max size 25MB). JPEG, PNG, and WEBP
+ /// formats are supported. + /// + /// + /// The product photo to edit (max size 25MB). JPEG, PNG, and WEBP
+ /// formats are supported. + /// + /// + /// Masks marking the regions to change (max 4, max size 25MB each).
+ /// JPEG, PNG, and WEBP formats are supported. Every mask must have the
+ /// same pixel dimensions as the product photo. White pixels mark the
+ /// region to change and black pixels are preserved; alpha-only masks
+ /// also work (opaque = change, transparent = preserve). + /// + /// + /// Material reference images (max size 25MB each). JPEG, PNG, and WEBP
+ /// formats are supported. Only their material (color, texture, pattern
+ /// scale, and orientation) is applied to the masked regions. Send one
+ /// material for every mask, or exactly one per mask, paired by
+ /// position. + /// + /// + /// Output aspect ratio. Defaults to the product photo's aspect ratio,
+ /// which keeps the original framing. A different ratio extends the
+ /// scene to fill the new shape rather than cropping, so part of the
+ /// frame is newly generated. Supported values are `1:1`, `3:4`,
+ /// `4:3`, `16:9`, and `9:16`. + /// + /// + /// The quality tier for the edit. Higher tiers may improve detail and
+ /// take longer to complete. + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public EditWorkflowPostMaterialSwapRequest( + byte[] image, + string imagename, + global::System.Collections.Generic.IList? masks, + global::System.Collections.Generic.IList? materials, + string? aspectRatio, + global::Ideogram.MaterialSwapQuality? quality, + string? webhookUrl) + { + this.Image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + this.Imagename = imagename ?? throw new global::System.ArgumentNullException(nameof(imagename)); + this.Masks = masks; + this.Materials = materials; + this.AspectRatio = aspectRatio; + this.Quality = quality; + this.WebhookUrl = webhookUrl; + } + + /// + /// Initializes a new instance of the class. + /// + public EditWorkflowPostMaterialSwapRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostMaterialSwapResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostMaterialSwapResponse.Json.g.cs new file mode 100644 index 00000000..289ef7c5 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostMaterialSwapResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class EditWorkflowPostMaterialSwapResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostMaterialSwapResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.EditWorkflowPostMaterialSwapResponse), + jsonSerializerContext) as global::Ideogram.EditWorkflowPostMaterialSwapResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostMaterialSwapResponse? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.EditWorkflowPostMaterialSwapResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.EditWorkflowPostMaterialSwapResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.EditWorkflowPostMaterialSwapResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostMaterialSwapResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostMaterialSwapResponse.g.cs new file mode 100644 index 00000000..5860089d --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostMaterialSwapResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class EditWorkflowPostMaterialSwapResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostMaterialSwapResponse2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostMaterialSwapResponse2.Json.g.cs new file mode 100644 index 00000000..99fd343c --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostMaterialSwapResponse2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class EditWorkflowPostMaterialSwapResponse2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostMaterialSwapResponse2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.EditWorkflowPostMaterialSwapResponse2), + jsonSerializerContext) as global::Ideogram.EditWorkflowPostMaterialSwapResponse2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostMaterialSwapResponse2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.EditWorkflowPostMaterialSwapResponse2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.EditWorkflowPostMaterialSwapResponse2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.EditWorkflowPostMaterialSwapResponse2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostMaterialSwapResponse2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostMaterialSwapResponse2.g.cs new file mode 100644 index 00000000..8dbc04d4 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostMaterialSwapResponse2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class EditWorkflowPostMaterialSwapResponse2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostMaterialSwapResponse3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostMaterialSwapResponse3.Json.g.cs new file mode 100644 index 00000000..99dd9ccf --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostMaterialSwapResponse3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class EditWorkflowPostMaterialSwapResponse3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostMaterialSwapResponse3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.EditWorkflowPostMaterialSwapResponse3), + jsonSerializerContext) as global::Ideogram.EditWorkflowPostMaterialSwapResponse3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostMaterialSwapResponse3? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.EditWorkflowPostMaterialSwapResponse3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.EditWorkflowPostMaterialSwapResponse3), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.EditWorkflowPostMaterialSwapResponse3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostMaterialSwapResponse3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostMaterialSwapResponse3.g.cs new file mode 100644 index 00000000..cfba7d23 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostMaterialSwapResponse3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class EditWorkflowPostMaterialSwapResponse3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostModelPoseVariantsRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostModelPoseVariantsRequest.Json.g.cs new file mode 100644 index 00000000..075b2dae --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostModelPoseVariantsRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class EditWorkflowPostModelPoseVariantsRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostModelPoseVariantsRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.EditWorkflowPostModelPoseVariantsRequest), + jsonSerializerContext) as global::Ideogram.EditWorkflowPostModelPoseVariantsRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostModelPoseVariantsRequest? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.EditWorkflowPostModelPoseVariantsRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.EditWorkflowPostModelPoseVariantsRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.EditWorkflowPostModelPoseVariantsRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostModelPoseVariantsRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostModelPoseVariantsRequest.g.cs new file mode 100644 index 00000000..5ed5e0b1 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostModelPoseVariantsRequest.g.cs @@ -0,0 +1,159 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// + /// + public sealed partial class EditWorkflowPostModelPoseVariantsRequest + { + /// + /// Fashion image to edit (max size 50MB). JPEG, PNG, WEBP, HEIF,
+ /// AVIF, GIF, BMP, TIFF, and MPO formats are supported. Multipart
+ /// requests only. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("source_image")] + [global::System.Text.Json.Serialization.JsonRequired] + public required byte[] SourceImage { get; set; } + + /// + /// Fashion image to edit (max size 50MB). JPEG, PNG, WEBP, HEIF,
+ /// AVIF, GIF, BMP, TIFF, and MPO formats are supported. Multipart
+ /// requests only. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("source_imagename")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string SourceImagename { get; set; } + + /// + /// Plain-language pose or camera direction, such as a front-facing
+ /// catalog stance or right-facing walking profile. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("instruction")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Instruction { get; set; } + + /// + /// Output aspect ratio. When omitted, the nearest supported ratio is
+ /// derived from the source image. Supported values are `1:1`, `3:4`,
+ /// `4:3`, `16:9`, and `9:16`. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] + public string? AspectRatio { get; set; } + + /// + /// The quality tier for the edit. Higher tiers may improve detail and
+ /// take longer to complete. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("quality")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ModelPoseVariantsQualityJsonConverter))] + public global::Ideogram.ModelPoseVariantsQuality? Quality { get; set; } + + /// + /// Optional seed for repeatable results. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("seed")] + public int? Seed { get; set; } + + /// + /// Number of pose variants to create.
+ /// Default Value: 1 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] + public int? NumImages { get; set; } + + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] + public string? WebhookUrl { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Fashion image to edit (max size 50MB). JPEG, PNG, WEBP, HEIF,
+ /// AVIF, GIF, BMP, TIFF, and MPO formats are supported. Multipart
+ /// requests only. + /// + /// + /// Fashion image to edit (max size 50MB). JPEG, PNG, WEBP, HEIF,
+ /// AVIF, GIF, BMP, TIFF, and MPO formats are supported. Multipart
+ /// requests only. + /// + /// + /// Plain-language pose or camera direction, such as a front-facing
+ /// catalog stance or right-facing walking profile. + /// + /// + /// Output aspect ratio. When omitted, the nearest supported ratio is
+ /// derived from the source image. Supported values are `1:1`, `3:4`,
+ /// `4:3`, `16:9`, and `9:16`. + /// + /// + /// The quality tier for the edit. Higher tiers may improve detail and
+ /// take longer to complete. + /// + /// + /// Optional seed for repeatable results. + /// + /// + /// Number of pose variants to create.
+ /// Default Value: 1 + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public EditWorkflowPostModelPoseVariantsRequest( + byte[] sourceImage, + string sourceImagename, + string instruction, + string? aspectRatio, + global::Ideogram.ModelPoseVariantsQuality? quality, + int? seed, + int? numImages, + string? webhookUrl) + { + this.SourceImage = sourceImage ?? throw new global::System.ArgumentNullException(nameof(sourceImage)); + this.SourceImagename = sourceImagename ?? throw new global::System.ArgumentNullException(nameof(sourceImagename)); + this.Instruction = instruction ?? throw new global::System.ArgumentNullException(nameof(instruction)); + this.AspectRatio = aspectRatio; + this.Quality = quality; + this.Seed = seed; + this.NumImages = numImages; + this.WebhookUrl = webhookUrl; + } + + /// + /// Initializes a new instance of the class. + /// + public EditWorkflowPostModelPoseVariantsRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostModelPoseVariantsResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostModelPoseVariantsResponse.Json.g.cs new file mode 100644 index 00000000..a366e258 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostModelPoseVariantsResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class EditWorkflowPostModelPoseVariantsResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostModelPoseVariantsResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.EditWorkflowPostModelPoseVariantsResponse), + jsonSerializerContext) as global::Ideogram.EditWorkflowPostModelPoseVariantsResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostModelPoseVariantsResponse? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.EditWorkflowPostModelPoseVariantsResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.EditWorkflowPostModelPoseVariantsResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.EditWorkflowPostModelPoseVariantsResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostModelPoseVariantsResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostModelPoseVariantsResponse.g.cs new file mode 100644 index 00000000..4720c7bb --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostModelPoseVariantsResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class EditWorkflowPostModelPoseVariantsResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostModelPoseVariantsResponse2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostModelPoseVariantsResponse2.Json.g.cs new file mode 100644 index 00000000..c8850f87 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostModelPoseVariantsResponse2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class EditWorkflowPostModelPoseVariantsResponse2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostModelPoseVariantsResponse2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.EditWorkflowPostModelPoseVariantsResponse2), + jsonSerializerContext) as global::Ideogram.EditWorkflowPostModelPoseVariantsResponse2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostModelPoseVariantsResponse2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.EditWorkflowPostModelPoseVariantsResponse2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.EditWorkflowPostModelPoseVariantsResponse2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.EditWorkflowPostModelPoseVariantsResponse2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostModelPoseVariantsResponse2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostModelPoseVariantsResponse2.g.cs new file mode 100644 index 00000000..39d1e168 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostModelPoseVariantsResponse2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class EditWorkflowPostModelPoseVariantsResponse2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostModelPoseVariantsResponse3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostModelPoseVariantsResponse3.Json.g.cs new file mode 100644 index 00000000..2d7e39e9 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostModelPoseVariantsResponse3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class EditWorkflowPostModelPoseVariantsResponse3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostModelPoseVariantsResponse3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.EditWorkflowPostModelPoseVariantsResponse3), + jsonSerializerContext) as global::Ideogram.EditWorkflowPostModelPoseVariantsResponse3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostModelPoseVariantsResponse3? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.EditWorkflowPostModelPoseVariantsResponse3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.EditWorkflowPostModelPoseVariantsResponse3), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.EditWorkflowPostModelPoseVariantsResponse3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostModelPoseVariantsResponse3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostModelPoseVariantsResponse3.g.cs new file mode 100644 index 00000000..1f9940d5 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostModelPoseVariantsResponse3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class EditWorkflowPostModelPoseVariantsResponse3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostModelPoseVariantsResponse4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostModelPoseVariantsResponse4.Json.g.cs new file mode 100644 index 00000000..4f25f635 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostModelPoseVariantsResponse4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class EditWorkflowPostModelPoseVariantsResponse4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostModelPoseVariantsResponse4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.EditWorkflowPostModelPoseVariantsResponse4), + jsonSerializerContext) as global::Ideogram.EditWorkflowPostModelPoseVariantsResponse4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostModelPoseVariantsResponse4? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.EditWorkflowPostModelPoseVariantsResponse4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.EditWorkflowPostModelPoseVariantsResponse4), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.EditWorkflowPostModelPoseVariantsResponse4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostModelPoseVariantsResponse4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostModelPoseVariantsResponse4.g.cs new file mode 100644 index 00000000..dc661f47 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostModelPoseVariantsResponse4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class EditWorkflowPostModelPoseVariantsResponse4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostModelPoseVariantsResponse5.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostModelPoseVariantsResponse5.Json.g.cs new file mode 100644 index 00000000..617c181a --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostModelPoseVariantsResponse5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class EditWorkflowPostModelPoseVariantsResponse5 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostModelPoseVariantsResponse5? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.EditWorkflowPostModelPoseVariantsResponse5), + jsonSerializerContext) as global::Ideogram.EditWorkflowPostModelPoseVariantsResponse5; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostModelPoseVariantsResponse5? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.EditWorkflowPostModelPoseVariantsResponse5? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.EditWorkflowPostModelPoseVariantsResponse5), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.EditWorkflowPostModelPoseVariantsResponse5; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostModelPoseVariantsResponse5.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostModelPoseVariantsResponse5.g.cs new file mode 100644 index 00000000..092d7131 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostModelPoseVariantsResponse5.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class EditWorkflowPostModelPoseVariantsResponse5 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostSketchToRenderRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostSketchToRenderRequest.Json.g.cs new file mode 100644 index 00000000..35555ba1 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostSketchToRenderRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class EditWorkflowPostSketchToRenderRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostSketchToRenderRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.EditWorkflowPostSketchToRenderRequest), + jsonSerializerContext) as global::Ideogram.EditWorkflowPostSketchToRenderRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostSketchToRenderRequest? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.EditWorkflowPostSketchToRenderRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.EditWorkflowPostSketchToRenderRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.EditWorkflowPostSketchToRenderRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostSketchToRenderRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostSketchToRenderRequest.g.cs new file mode 100644 index 00000000..ba142dc1 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostSketchToRenderRequest.g.cs @@ -0,0 +1,155 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// + /// + public sealed partial class EditWorkflowPostSketchToRenderRequest + { + /// + /// The fashion sketch to render, up to 50 MB. JPEG, PNG, WEBP, HEIF,
+ /// AVIF, GIF, BMP, TIFF, and MPO are supported. Multipart requests
+ /// only. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("sketch_image")] + [global::System.Text.Json.Serialization.JsonRequired] + public required byte[] SketchImage { get; set; } + + /// + /// The fashion sketch to render, up to 50 MB. JPEG, PNG, WEBP, HEIF,
+ /// AVIF, GIF, BMP, TIFF, and MPO are supported. Multipart requests
+ /// only. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("sketch_imagename")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string SketchImagename { get; set; } + + /// + /// Material and rendering direction, plus any construction or design
+ /// details that are not legible in the sketch. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("instruction")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Instruction { get; set; } + + /// + /// Aspect ratio of each output image. Defaults to `1:1` when omitted. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] + public string? AspectRatio { get; set; } + + /// + /// The quality tier for the edit. Higher tiers may improve detail and
+ /// take longer to complete. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("quality")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.SketchToRenderQualityJsonConverter))] + public global::Ideogram.SketchToRenderQuality? Quality { get; set; } + + /// + /// Optional seed for repeatable results. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("seed")] + public int? Seed { get; set; } + + /// + /// Number of product renders to create.
+ /// Default Value: 1 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] + public int? NumImages { get; set; } + + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] + public string? WebhookUrl { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The fashion sketch to render, up to 50 MB. JPEG, PNG, WEBP, HEIF,
+ /// AVIF, GIF, BMP, TIFF, and MPO are supported. Multipart requests
+ /// only. + /// + /// + /// The fashion sketch to render, up to 50 MB. JPEG, PNG, WEBP, HEIF,
+ /// AVIF, GIF, BMP, TIFF, and MPO are supported. Multipart requests
+ /// only. + /// + /// + /// Material and rendering direction, plus any construction or design
+ /// details that are not legible in the sketch. + /// + /// + /// Aspect ratio of each output image. Defaults to `1:1` when omitted. + /// + /// + /// The quality tier for the edit. Higher tiers may improve detail and
+ /// take longer to complete. + /// + /// + /// Optional seed for repeatable results. + /// + /// + /// Number of product renders to create.
+ /// Default Value: 1 + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public EditWorkflowPostSketchToRenderRequest( + byte[] sketchImage, + string sketchImagename, + string instruction, + string? aspectRatio, + global::Ideogram.SketchToRenderQuality? quality, + int? seed, + int? numImages, + string? webhookUrl) + { + this.SketchImage = sketchImage ?? throw new global::System.ArgumentNullException(nameof(sketchImage)); + this.SketchImagename = sketchImagename ?? throw new global::System.ArgumentNullException(nameof(sketchImagename)); + this.Instruction = instruction ?? throw new global::System.ArgumentNullException(nameof(instruction)); + this.AspectRatio = aspectRatio; + this.Quality = quality; + this.Seed = seed; + this.NumImages = numImages; + this.WebhookUrl = webhookUrl; + } + + /// + /// Initializes a new instance of the class. + /// + public EditWorkflowPostSketchToRenderRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostSketchToRenderResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostSketchToRenderResponse.Json.g.cs new file mode 100644 index 00000000..36bfb859 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostSketchToRenderResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class EditWorkflowPostSketchToRenderResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostSketchToRenderResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.EditWorkflowPostSketchToRenderResponse), + jsonSerializerContext) as global::Ideogram.EditWorkflowPostSketchToRenderResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostSketchToRenderResponse? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.EditWorkflowPostSketchToRenderResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.EditWorkflowPostSketchToRenderResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.EditWorkflowPostSketchToRenderResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostSketchToRenderResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostSketchToRenderResponse.g.cs new file mode 100644 index 00000000..2b8dfcde --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostSketchToRenderResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class EditWorkflowPostSketchToRenderResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostSketchToRenderResponse2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostSketchToRenderResponse2.Json.g.cs new file mode 100644 index 00000000..f26f11e5 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostSketchToRenderResponse2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class EditWorkflowPostSketchToRenderResponse2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostSketchToRenderResponse2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.EditWorkflowPostSketchToRenderResponse2), + jsonSerializerContext) as global::Ideogram.EditWorkflowPostSketchToRenderResponse2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostSketchToRenderResponse2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.EditWorkflowPostSketchToRenderResponse2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.EditWorkflowPostSketchToRenderResponse2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.EditWorkflowPostSketchToRenderResponse2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostSketchToRenderResponse2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostSketchToRenderResponse2.g.cs new file mode 100644 index 00000000..d52ecd15 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostSketchToRenderResponse2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class EditWorkflowPostSketchToRenderResponse2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostSketchToRenderResponse3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostSketchToRenderResponse3.Json.g.cs new file mode 100644 index 00000000..a9b104df --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostSketchToRenderResponse3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class EditWorkflowPostSketchToRenderResponse3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostSketchToRenderResponse3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.EditWorkflowPostSketchToRenderResponse3), + jsonSerializerContext) as global::Ideogram.EditWorkflowPostSketchToRenderResponse3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostSketchToRenderResponse3? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.EditWorkflowPostSketchToRenderResponse3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.EditWorkflowPostSketchToRenderResponse3), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.EditWorkflowPostSketchToRenderResponse3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostSketchToRenderResponse3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostSketchToRenderResponse3.g.cs new file mode 100644 index 00000000..1fcea089 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostSketchToRenderResponse3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class EditWorkflowPostSketchToRenderResponse3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostSketchToRenderResponse4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostSketchToRenderResponse4.Json.g.cs new file mode 100644 index 00000000..08bbf0f8 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostSketchToRenderResponse4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class EditWorkflowPostSketchToRenderResponse4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostSketchToRenderResponse4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.EditWorkflowPostSketchToRenderResponse4), + jsonSerializerContext) as global::Ideogram.EditWorkflowPostSketchToRenderResponse4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostSketchToRenderResponse4? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.EditWorkflowPostSketchToRenderResponse4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.EditWorkflowPostSketchToRenderResponse4), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.EditWorkflowPostSketchToRenderResponse4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostSketchToRenderResponse4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostSketchToRenderResponse4.g.cs new file mode 100644 index 00000000..bcfd6999 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostSketchToRenderResponse4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class EditWorkflowPostSketchToRenderResponse4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostSketchToRenderResponse5.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostSketchToRenderResponse5.Json.g.cs new file mode 100644 index 00000000..6f26d23b --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostSketchToRenderResponse5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class EditWorkflowPostSketchToRenderResponse5 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostSketchToRenderResponse5? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.EditWorkflowPostSketchToRenderResponse5), + jsonSerializerContext) as global::Ideogram.EditWorkflowPostSketchToRenderResponse5; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.EditWorkflowPostSketchToRenderResponse5? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.EditWorkflowPostSketchToRenderResponse5? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.EditWorkflowPostSketchToRenderResponse5), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.EditWorkflowPostSketchToRenderResponse5; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostSketchToRenderResponse5.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostSketchToRenderResponse5.g.cs new file mode 100644 index 00000000..9ac02215 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditWorkflowPostSketchToRenderResponse5.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class EditWorkflowPostSketchToRenderResponse5 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateDesignRequestV3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateDesignRequestV3.Json.g.cs deleted file mode 100644 index e911277f..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateDesignRequestV3.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class GenerateDesignRequestV3 - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.GenerateDesignRequestV3? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.GenerateDesignRequestV3), - jsonSerializerContext) as global::Ideogram.GenerateDesignRequestV3; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.GenerateDesignRequestV3? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.GenerateDesignRequestV3? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.GenerateDesignRequestV3), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GenerateDesignRequestV3; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateDesignRequestV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateDesignRequestV3.g.cs deleted file mode 100644 index 106852cc..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateDesignRequestV3.g.cs +++ /dev/null @@ -1,391 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - public sealed partial class GenerateDesignRequestV3 - { - /// - /// The prompt to use to generate the design.
- /// Example: A birthday card saying 'Happy Birthday' - ///
- /// A birthday card saying 'Happy Birthday' - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Prompt { get; set; } - - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - ///
- /// 12345 - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// The resolutions supported for Ideogram 3.0.
- /// Example: 1280x800 - ///
- /// 1280x800 - [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ResolutionV3JsonConverter))] - public global::Ideogram.ResolutionV3? Resolution { get; set; } - - /// - /// Output aspect ratio. Cannot be combined with resolution. Generation defaults to 1x1; remix keeps the source ratio when both fields are omitted. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.AspectRatioV3JsonConverter))] - public global::Ideogram.AspectRatioV3? AspectRatio { get; set; } - - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("rendering_speed")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.RenderingSpeedJsonConverter))] - public global::Ideogram.RenderingSpeed? RenderingSpeed { get; set; } - - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - ///
- /// ON - [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.MagicPromptOptionJsonConverter))] - public global::Ideogram.MagicPromptOption? MagicPrompt { get; set; } - - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt_system_prompt_config_id")] - public string? MagicPromptSystemPromptConfigId { get; set; } - - /// - /// Description of what to exclude from a design. Descriptions in the prompt take precedence
- /// to descriptions in the negative prompt.
- /// Example: brush strokes, painting - ///
- /// brush strokes, painting - [global::System.Text.Json.Serialization.JsonPropertyName("negative_prompt")] - public string? NegativePrompt { get; set; } - - /// - /// Number of designs to generate.
- /// Default Value: 1 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] - public int? NumImages { get; set; } - - /// - /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). Not supported by V_1, V_1_TURBO, V_2A and V_2A_TURBO models. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("color_palette")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ColorPaletteWithPresetNameOrMembersJsonConverter))] - public global::Ideogram.ColorPaletteWithPresetNameOrMembers? ColorPalette { get; set; } - - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - ///
- /// [AAFF5733, 0133FF57, DE3357FF] - [global::System.Text.Json.Serialization.JsonPropertyName("style_codes")] - public global::System.Collections.Generic.IList? StyleCodes { get; set; } - - /// - /// The style type to generate with.
- /// Default Value: GENERAL
- /// Example: GENERAL - ///
- /// GENERAL - [global::System.Text.Json.Serialization.JsonPropertyName("style_type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.StyleTypeV3JsonConverter))] - public global::Ideogram.StyleTypeV3? StyleType { get; set; } - - /// - /// A predefined style preset that applies a specific artistic style to the generated image.
- /// Example: BRIGHT_ART - ///
- /// BRIGHT_ART - [global::System.Text.Json.Serialization.JsonPropertyName("style_preset")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.StylePresetV3JsonConverter))] - public global::Ideogram.StylePresetV3? StylePreset { get; set; } - - /// - /// A custom model URI in the format model/<model_name>/version/<version_name>.
- /// When provided, the model version and style will be resolved from this URI, and style_type is not required.
- /// Example: model/my-custom-model/version/1 - ///
- /// model/my-custom-model/version/1 - [global::System.Text.Json.Serialization.JsonPropertyName("custom_model_uri")] - public string? CustomModelUri { get; set; } - - /// - /// Custom font file for H1 (heading) text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_h1. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("font_file_h1")] - public byte[]? FontFileH1 { get; set; } - - /// - /// Custom font file for H1 (heading) text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_h1. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("font_file_h1name")] - public string? FontFileH1name { get; set; } - - /// - /// Font name from the available font library for H1 text. Ignored if font_file_h1 is provided.
- /// Example: Ubuntu-Bold.ttf - ///
- /// Ubuntu-Bold.ttf - [global::System.Text.Json.Serialization.JsonPropertyName("font_name_h1")] - public string? FontNameH1 { get; set; } - - /// - /// Custom font file for H2 (subheading) text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_h2. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("font_file_h2")] - public byte[]? FontFileH2 { get; set; } - - /// - /// Custom font file for H2 (subheading) text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_h2. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("font_file_h2name")] - public string? FontFileH2name { get; set; } - - /// - /// Font name from the available font library for H2 text. Ignored if font_file_h2 is provided. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("font_name_h2")] - public string? FontNameH2 { get; set; } - - /// - /// Custom font file for body text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_body. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("font_file_body")] - public byte[]? FontFileBody { get; set; } - - /// - /// Custom font file for body text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_body. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("font_file_bodyname")] - public string? FontFileBodyname { get; set; } - - /// - /// Font name from the available font library for body text. Ignored if font_file_body is provided. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("font_name_body")] - public string? FontNameBody { get; set; } - - /// - /// Custom font file for small/caption text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_small. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("font_file_small")] - public byte[]? FontFileSmall { get; set; } - - /// - /// Custom font file for small/caption text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_small. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("font_file_smallname")] - public string? FontFileSmallname { get; set; } - - /// - /// Font name from the available font library for small text. Ignored if font_file_small is provided. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("font_name_small")] - public string? FontNameSmall { get; set; } - - /// - /// A set of images to use as style references (max size 25MB per image; the whole request must stay under 50MB). The images should be in JPEG, PNG or WebP format. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("style_reference_images")] - public global::System.Collections.Generic.IList? StyleReferenceImages { get; set; } - - /// - /// A set of asset images (e.g., logos, icons) to use as references for detection and replacement (maximum 10 images). The images should be in JPEG, PNG or WebP format. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("reference_asset_images")] - public global::System.Collections.Generic.IList? ReferenceAssetImages { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The prompt to use to generate the design.
- /// Example: A birthday card saying 'Happy Birthday' - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The resolutions supported for Ideogram 3.0.
- /// Example: 1280x800 - /// - /// - /// Output aspect ratio. Cannot be combined with resolution. Generation defaults to 1x1; remix keeps the source ratio when both fields are omitted. - /// - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// Description of what to exclude from a design. Descriptions in the prompt take precedence
- /// to descriptions in the negative prompt.
- /// Example: brush strokes, painting - /// - /// - /// Number of designs to generate.
- /// Default Value: 1 - /// - /// - /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). Not supported by V_1, V_1_TURBO, V_2A and V_2A_TURBO models. - /// - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - /// - /// - /// The style type to generate with.
- /// Default Value: GENERAL
- /// Example: GENERAL - /// - /// - /// A predefined style preset that applies a specific artistic style to the generated image.
- /// Example: BRIGHT_ART - /// - /// - /// A custom model URI in the format model/<model_name>/version/<version_name>.
- /// When provided, the model version and style will be resolved from this URI, and style_type is not required.
- /// Example: model/my-custom-model/version/1 - /// - /// - /// Custom font file for H1 (heading) text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_h1. - /// - /// - /// Custom font file for H1 (heading) text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_h1. - /// - /// - /// Font name from the available font library for H1 text. Ignored if font_file_h1 is provided.
- /// Example: Ubuntu-Bold.ttf - /// - /// - /// Custom font file for H2 (subheading) text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_h2. - /// - /// - /// Custom font file for H2 (subheading) text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_h2. - /// - /// - /// Font name from the available font library for H2 text. Ignored if font_file_h2 is provided. - /// - /// - /// Custom font file for body text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_body. - /// - /// - /// Custom font file for body text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_body. - /// - /// - /// Font name from the available font library for body text. Ignored if font_file_body is provided. - /// - /// - /// Custom font file for small/caption text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_small. - /// - /// - /// Custom font file for small/caption text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_small. - /// - /// - /// Font name from the available font library for small text. Ignored if font_file_small is provided. - /// - /// - /// A set of images to use as style references (max size 25MB per image; the whole request must stay under 50MB). The images should be in JPEG, PNG or WebP format. - /// - /// - /// A set of asset images (e.g., logos, icons) to use as references for detection and replacement (maximum 10 images). The images should be in JPEG, PNG or WebP format. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public GenerateDesignRequestV3( - string prompt, - int? seed, - global::Ideogram.ResolutionV3? resolution, - global::Ideogram.AspectRatioV3? aspectRatio, - global::Ideogram.RenderingSpeed? renderingSpeed, - global::Ideogram.MagicPromptOption? magicPrompt, - string? magicPromptSystemPromptConfigId, - string? negativePrompt, - int? numImages, - global::Ideogram.ColorPaletteWithPresetNameOrMembers? colorPalette, - global::System.Collections.Generic.IList? styleCodes, - global::Ideogram.StyleTypeV3? styleType, - global::Ideogram.StylePresetV3? stylePreset, - string? customModelUri, - byte[]? fontFileH1, - string? fontFileH1name, - string? fontNameH1, - byte[]? fontFileH2, - string? fontFileH2name, - string? fontNameH2, - byte[]? fontFileBody, - string? fontFileBodyname, - string? fontNameBody, - byte[]? fontFileSmall, - string? fontFileSmallname, - string? fontNameSmall, - global::System.Collections.Generic.IList? styleReferenceImages, - global::System.Collections.Generic.IList? referenceAssetImages) - { - this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); - this.Seed = seed; - this.Resolution = resolution; - this.AspectRatio = aspectRatio; - this.RenderingSpeed = renderingSpeed; - this.MagicPrompt = magicPrompt; - this.MagicPromptSystemPromptConfigId = magicPromptSystemPromptConfigId; - this.NegativePrompt = negativePrompt; - this.NumImages = numImages; - this.ColorPalette = colorPalette; - this.StyleCodes = styleCodes; - this.StyleType = styleType; - this.StylePreset = stylePreset; - this.CustomModelUri = customModelUri; - this.FontFileH1 = fontFileH1; - this.FontFileH1name = fontFileH1name; - this.FontNameH1 = fontNameH1; - this.FontFileH2 = fontFileH2; - this.FontFileH2name = fontFileH2name; - this.FontNameH2 = fontNameH2; - this.FontFileBody = fontFileBody; - this.FontFileBodyname = fontFileBodyname; - this.FontNameBody = fontNameBody; - this.FontFileSmall = fontFileSmall; - this.FontFileSmallname = fontFileSmallname; - this.FontNameSmall = fontNameSmall; - this.StyleReferenceImages = styleReferenceImages; - this.ReferenceAssetImages = referenceAssetImages; - } - - /// - /// Initializes a new instance of the class. - /// - public GenerateDesignRequestV3() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateDesignRequestV4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateDesignRequestV4.Json.g.cs deleted file mode 100644 index 1e45608c..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateDesignRequestV4.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class GenerateDesignRequestV4 - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.GenerateDesignRequestV4? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.GenerateDesignRequestV4), - jsonSerializerContext) as global::Ideogram.GenerateDesignRequestV4; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.GenerateDesignRequestV4? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.GenerateDesignRequestV4? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.GenerateDesignRequestV4), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GenerateDesignRequestV4; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateDesignRequestV4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateDesignRequestV4.g.cs deleted file mode 100644 index 7c3cc6af..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateDesignRequestV4.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - public sealed partial class GenerateDesignRequestV4 - { - /// - /// The text prompt for editable design generation. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Prompt { get; set; } - - /// - /// Random seed for reproducibility. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - ///
- /// ON - [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt_option")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.MagicPromptOptionJsonConverter))] - public global::Ideogram.MagicPromptOption? MagicPromptOption { get; set; } - - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt_system_prompt_config_id")] - public string? MagicPromptSystemPromptConfigId { get; set; } - - /// - /// The resolutions supported for Ideogram 4.0 layout-to-image and design generation.
- /// Example: 1024x1024 - ///
- /// 1024x1024 - [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ResolutionV4LayoutJsonConverter))] - public global::Ideogram.ResolutionV4Layout? Resolution { get; set; } - - /// - /// The rendering speed to use. For Ideogram V4, `rendering_speed=FLASH`
- /// is coming soon; requests with `rendering_speed=FLASH` currently
- /// return a 400. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("rendering_speed")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.RenderingSpeedJsonConverter))] - public global::Ideogram.RenderingSpeed? RenderingSpeed { get; set; } - - /// - /// Experimental. Up to 4 static inspiration images used as transferable visual style references for V4 layout-to-image design. Images are not edit targets and are not inserted into the generated HTML layout. Supported formats are JPEG, PNG, and WebP (max size 25MB each). Animated images are not supported. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("inspiration_reference_images")] - public global::System.Collections.Generic.IList? InspirationReferenceImages { get; set; } - - /// - /// Experimental. Model to use for the inspiration vision prepass.
- /// Default Value: claude-sonnet-4-6 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("inspiration_reference_model")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.GenerateDesignRequestV4InspirationReferenceModelJsonConverter))] - public global::Ideogram.GenerateDesignRequestV4InspirationReferenceModel? InspirationReferenceModel { get; set; } - - /// - /// Experimental. Model to use for the HTML/layout and base-plate handoff generation call.
- /// Default Value: claude-sonnet-4-6 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("artifact_generation_model")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.GenerateDesignRequestV4ArtifactGenerationModelJsonConverter))] - public global::Ideogram.GenerateDesignRequestV4ArtifactGenerationModel? ArtifactGenerationModel { get; set; } - - /// - /// Experimental. Staging only. Select a v4 layout-to-image pipeline variant.
- /// Omit for the default v4l2i path. Rejected on production. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("layout2image_variant")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.GenerateDesignRequestV4Layout2imageVariantJsonConverter))] - public global::Ideogram.GenerateDesignRequestV4Layout2imageVariant? Layout2imageVariant { get; set; } - - /// - /// layered (default): full editable design payload with text layers and HTML.
- /// url: JSON with an expiring link to the final composited cover image.
- /// binary: raw PNG bytes of the final composited cover image (Content-Type image/png).
- /// html: raw HTML document of the generated layout (Content-Type text/html).
- /// Default Value: layered - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("response_type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.GenerateDesignRequestV4ResponseTypeJsonConverter))] - public global::Ideogram.GenerateDesignRequestV4ResponseType? ResponseType { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The text prompt for editable design generation. - /// - /// - /// Random seed for reproducibility. - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// The resolutions supported for Ideogram 4.0 layout-to-image and design generation.
- /// Example: 1024x1024 - /// - /// - /// The rendering speed to use. For Ideogram V4, `rendering_speed=FLASH`
- /// is coming soon; requests with `rendering_speed=FLASH` currently
- /// return a 400. - /// - /// - /// Experimental. Up to 4 static inspiration images used as transferable visual style references for V4 layout-to-image design. Images are not edit targets and are not inserted into the generated HTML layout. Supported formats are JPEG, PNG, and WebP (max size 25MB each). Animated images are not supported. - /// - /// - /// Experimental. Model to use for the inspiration vision prepass.
- /// Default Value: claude-sonnet-4-6 - /// - /// - /// Experimental. Model to use for the HTML/layout and base-plate handoff generation call.
- /// Default Value: claude-sonnet-4-6 - /// - /// - /// Experimental. Staging only. Select a v4 layout-to-image pipeline variant.
- /// Omit for the default v4l2i path. Rejected on production. - /// - /// - /// layered (default): full editable design payload with text layers and HTML.
- /// url: JSON with an expiring link to the final composited cover image.
- /// binary: raw PNG bytes of the final composited cover image (Content-Type image/png).
- /// html: raw HTML document of the generated layout (Content-Type text/html).
- /// Default Value: layered - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public GenerateDesignRequestV4( - string prompt, - int? seed, - global::Ideogram.MagicPromptOption? magicPromptOption, - string? magicPromptSystemPromptConfigId, - global::Ideogram.ResolutionV4Layout? resolution, - global::Ideogram.RenderingSpeed? renderingSpeed, - global::System.Collections.Generic.IList? inspirationReferenceImages, - global::Ideogram.GenerateDesignRequestV4InspirationReferenceModel? inspirationReferenceModel, - global::Ideogram.GenerateDesignRequestV4ArtifactGenerationModel? artifactGenerationModel, - global::Ideogram.GenerateDesignRequestV4Layout2imageVariant? layout2imageVariant, - global::Ideogram.GenerateDesignRequestV4ResponseType? responseType) - { - this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); - this.Seed = seed; - this.MagicPromptOption = magicPromptOption; - this.MagicPromptSystemPromptConfigId = magicPromptSystemPromptConfigId; - this.Resolution = resolution; - this.RenderingSpeed = renderingSpeed; - this.InspirationReferenceImages = inspirationReferenceImages; - this.InspirationReferenceModel = inspirationReferenceModel; - this.ArtifactGenerationModel = artifactGenerationModel; - this.Layout2imageVariant = layout2imageVariant; - this.ResponseType = responseType; - } - - /// - /// Initializes a new instance of the class. - /// - public GenerateDesignRequestV4() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateDesignRequestV4ArtifactGenerationModel.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateDesignRequestV4ArtifactGenerationModel.g.cs deleted file mode 100644 index 77f5eb1d..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateDesignRequestV4ArtifactGenerationModel.g.cs +++ /dev/null @@ -1,58 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Experimental. Model to use for the HTML/layout and base-plate handoff generation call.
- /// Default Value: claude-sonnet-4-6 - ///
- public enum GenerateDesignRequestV4ArtifactGenerationModel - { - /// - /// - /// - ClaudeOpus46, - /// - /// - /// - ClaudeOpus47, - /// - /// - /// - ClaudeSonnet46, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class GenerateDesignRequestV4ArtifactGenerationModelExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this GenerateDesignRequestV4ArtifactGenerationModel value) - { - return value switch - { - GenerateDesignRequestV4ArtifactGenerationModel.ClaudeOpus46 => "claude-opus-4-6", - GenerateDesignRequestV4ArtifactGenerationModel.ClaudeOpus47 => "claude-opus-4-7", - GenerateDesignRequestV4ArtifactGenerationModel.ClaudeSonnet46 => "claude-sonnet-4-6", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static GenerateDesignRequestV4ArtifactGenerationModel? ToEnum(string value) - { - return value switch - { - "claude-opus-4-6" => GenerateDesignRequestV4ArtifactGenerationModel.ClaudeOpus46, - "claude-opus-4-7" => GenerateDesignRequestV4ArtifactGenerationModel.ClaudeOpus47, - "claude-sonnet-4-6" => GenerateDesignRequestV4ArtifactGenerationModel.ClaudeSonnet46, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateDesignRequestV4InspirationReferenceModel.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateDesignRequestV4InspirationReferenceModel.g.cs deleted file mode 100644 index 73ae0ad3..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateDesignRequestV4InspirationReferenceModel.g.cs +++ /dev/null @@ -1,58 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Experimental. Model to use for the inspiration vision prepass.
- /// Default Value: claude-sonnet-4-6 - ///
- public enum GenerateDesignRequestV4InspirationReferenceModel - { - /// - /// - /// - ClaudeOpus46, - /// - /// - /// - ClaudeOpus47, - /// - /// - /// - ClaudeSonnet46, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class GenerateDesignRequestV4InspirationReferenceModelExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this GenerateDesignRequestV4InspirationReferenceModel value) - { - return value switch - { - GenerateDesignRequestV4InspirationReferenceModel.ClaudeOpus46 => "claude-opus-4-6", - GenerateDesignRequestV4InspirationReferenceModel.ClaudeOpus47 => "claude-opus-4-7", - GenerateDesignRequestV4InspirationReferenceModel.ClaudeSonnet46 => "claude-sonnet-4-6", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static GenerateDesignRequestV4InspirationReferenceModel? ToEnum(string value) - { - return value switch - { - "claude-opus-4-6" => GenerateDesignRequestV4InspirationReferenceModel.ClaudeOpus46, - "claude-opus-4-7" => GenerateDesignRequestV4InspirationReferenceModel.ClaudeOpus47, - "claude-sonnet-4-6" => GenerateDesignRequestV4InspirationReferenceModel.ClaudeSonnet46, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateDesignRequestV4Layout2imageVariant.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateDesignRequestV4Layout2imageVariant.g.cs deleted file mode 100644 index b917e62b..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateDesignRequestV4Layout2imageVariant.g.cs +++ /dev/null @@ -1,58 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Experimental. Staging only. Select a v4 layout-to-image pipeline variant.
- /// Omit for the default v4l2i path. Rejected on production. - ///
- public enum GenerateDesignRequestV4Layout2imageVariant - { - /// - /// - /// - BboxAware, - /// - /// - /// - Opus47, - /// - /// - /// - SeparateImageLayer, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class GenerateDesignRequestV4Layout2imageVariantExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this GenerateDesignRequestV4Layout2imageVariant value) - { - return value switch - { - GenerateDesignRequestV4Layout2imageVariant.BboxAware => "bbox_aware", - GenerateDesignRequestV4Layout2imageVariant.Opus47 => "opus_4_7", - GenerateDesignRequestV4Layout2imageVariant.SeparateImageLayer => "separate_image_layer", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static GenerateDesignRequestV4Layout2imageVariant? ToEnum(string value) - { - return value switch - { - "bbox_aware" => GenerateDesignRequestV4Layout2imageVariant.BboxAware, - "opus_4_7" => GenerateDesignRequestV4Layout2imageVariant.Opus47, - "separate_image_layer" => GenerateDesignRequestV4Layout2imageVariant.SeparateImageLayer, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateDesignRequestV4ResponseType.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateDesignRequestV4ResponseType.g.cs deleted file mode 100644 index 3e447a5a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateDesignRequestV4ResponseType.g.cs +++ /dev/null @@ -1,67 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// layered (default): full editable design payload with text layers and HTML.
- /// url: JSON with an expiring link to the final composited cover image.
- /// binary: raw PNG bytes of the final composited cover image (Content-Type image/png).
- /// html: raw HTML document of the generated layout (Content-Type text/html).
- /// Default Value: layered - ///
- public enum GenerateDesignRequestV4ResponseType - { - /// - /// raw PNG bytes of the final composited cover image (Content-Type image/png). - /// - Binary, - /// - /// raw HTML document of the generated layout (Content-Type text/html). - /// - Html, - /// - /// full editable design payload with text layers and HTML. - /// - Layered, - /// - /// JSON with an expiring link to the final composited cover image. - /// - Url, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class GenerateDesignRequestV4ResponseTypeExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this GenerateDesignRequestV4ResponseType value) - { - return value switch - { - GenerateDesignRequestV4ResponseType.Binary => "binary", - GenerateDesignRequestV4ResponseType.Html => "html", - GenerateDesignRequestV4ResponseType.Layered => "layered", - GenerateDesignRequestV4ResponseType.Url => "url", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static GenerateDesignRequestV4ResponseType? ToEnum(string value) - { - return value switch - { - "binary" => GenerateDesignRequestV4ResponseType.Binary, - "html" => GenerateDesignRequestV4ResponseType.Html, - "layered" => GenerateDesignRequestV4ResponseType.Layered, - "url" => GenerateDesignRequestV4ResponseType.Url, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateGraphicRequestV3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateGraphicRequestV3.Json.g.cs deleted file mode 100644 index 9e55677c..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateGraphicRequestV3.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class GenerateGraphicRequestV3 - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.GenerateGraphicRequestV3? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.GenerateGraphicRequestV3), - jsonSerializerContext) as global::Ideogram.GenerateGraphicRequestV3; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.GenerateGraphicRequestV3? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.GenerateGraphicRequestV3? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.GenerateGraphicRequestV3), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GenerateGraphicRequestV3; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateGraphicRequestV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateGraphicRequestV3.g.cs deleted file mode 100644 index ada5d5b3..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateGraphicRequestV3.g.cs +++ /dev/null @@ -1,412 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - public sealed partial class GenerateGraphicRequestV3 - { - /// - /// The prompt to use to generate the graphic.
- /// Example: A birthday card saying 'Happy Birthday' - ///
- /// A birthday card saying 'Happy Birthday' - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - public string? Prompt { get; set; } - - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - ///
- /// 12345 - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// The resolutions supported for Ideogram 3.0.
- /// Example: 1280x800 - ///
- /// 1280x800 - [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ResolutionV3JsonConverter))] - public global::Ideogram.ResolutionV3? Resolution { get; set; } - - /// - /// Output aspect ratio. Cannot be combined with resolution. Generation defaults to 1x1; remix keeps the source ratio when both fields are omitted. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.AspectRatioV3JsonConverter))] - public global::Ideogram.AspectRatioV3? AspectRatio { get; set; } - - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("rendering_speed")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.RenderingSpeedJsonConverter))] - public global::Ideogram.RenderingSpeed? RenderingSpeed { get; set; } - - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - ///
- /// ON - [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.MagicPromptOptionJsonConverter))] - public global::Ideogram.MagicPromptOption? MagicPrompt { get; set; } - - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt_system_prompt_config_id")] - public string? MagicPromptSystemPromptConfigId { get; set; } - - /// - /// Description of what to exclude from a graphic. Descriptions in the prompt take precedence
- /// to descriptions in the negative prompt.
- /// Example: brush strokes, painting - ///
- /// brush strokes, painting - [global::System.Text.Json.Serialization.JsonPropertyName("negative_prompt")] - public string? NegativePrompt { get; set; } - - /// - /// Number of graphics to generate.
- /// Default Value: 1 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] - public int? NumImages { get; set; } - - /// - /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). Not supported by V_1, V_1_TURBO, V_2A and V_2A_TURBO models. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("color_palette")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ColorPaletteWithPresetNameOrMembersJsonConverter))] - public global::Ideogram.ColorPaletteWithPresetNameOrMembers? ColorPalette { get; set; } - - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - ///
- /// [AAFF5733, 0133FF57, DE3357FF] - [global::System.Text.Json.Serialization.JsonPropertyName("style_codes")] - public global::System.Collections.Generic.IList? StyleCodes { get; set; } - - /// - /// The style type to generate with.
- /// Default Value: GENERAL
- /// Example: GENERAL - ///
- /// GENERAL - [global::System.Text.Json.Serialization.JsonPropertyName("style_type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.StyleTypeV3JsonConverter))] - public global::Ideogram.StyleTypeV3? StyleType { get; set; } - - /// - /// A predefined style preset that applies a specific artistic style to the generated image.
- /// Example: BRIGHT_ART - ///
- /// BRIGHT_ART - [global::System.Text.Json.Serialization.JsonPropertyName("style_preset")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.StylePresetV3JsonConverter))] - public global::Ideogram.StylePresetV3? StylePreset { get; set; } - - /// - /// A custom model URI in the format model/<model_name>/version/<version_name>.
- /// When provided, the model version and style will be resolved from this URI, and style_type is not required.
- /// Example: model/my-custom-model/version/1 - ///
- /// model/my-custom-model/version/1 - [global::System.Text.Json.Serialization.JsonPropertyName("custom_model_uri")] - public string? CustomModelUri { get; set; } - - /// - /// An existing flat graphic image to process for text detection and correction without generating a new image. When provided, image generation is bypassed. The image should be in JPEG, PNG or WebP format (max size 25MB). - /// - [global::System.Text.Json.Serialization.JsonPropertyName("flat_graphic_image")] - public byte[]? FlatGraphicImage { get; set; } - - /// - /// An existing flat graphic image to process for text detection and correction without generating a new image. When provided, image generation is bypassed. The image should be in JPEG, PNG or WebP format (max size 25MB). - /// - [global::System.Text.Json.Serialization.JsonPropertyName("flat_graphic_imagename")] - public string? FlatGraphicImagename { get; set; } - - /// - /// Custom font file for H1 (heading) text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_h1. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("font_file_h1")] - public byte[]? FontFileH1 { get; set; } - - /// - /// Custom font file for H1 (heading) text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_h1. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("font_file_h1name")] - public string? FontFileH1name { get; set; } - - /// - /// Font name from the available font library for H1 text. Ignored if font_file_h1 is provided.
- /// Example: Ubuntu-Bold.ttf - ///
- /// Ubuntu-Bold.ttf - [global::System.Text.Json.Serialization.JsonPropertyName("font_name_h1")] - public string? FontNameH1 { get; set; } - - /// - /// Custom font file for H2 (subheading) text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_h2. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("font_file_h2")] - public byte[]? FontFileH2 { get; set; } - - /// - /// Custom font file for H2 (subheading) text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_h2. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("font_file_h2name")] - public string? FontFileH2name { get; set; } - - /// - /// Font name from the available font library for H2 text. Ignored if font_file_h2 is provided. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("font_name_h2")] - public string? FontNameH2 { get; set; } - - /// - /// Custom font file for body text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_body. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("font_file_body")] - public byte[]? FontFileBody { get; set; } - - /// - /// Custom font file for body text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_body. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("font_file_bodyname")] - public string? FontFileBodyname { get; set; } - - /// - /// Font name from the available font library for body text. Ignored if font_file_body is provided. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("font_name_body")] - public string? FontNameBody { get; set; } - - /// - /// Custom font file for small/caption text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_small. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("font_file_small")] - public byte[]? FontFileSmall { get; set; } - - /// - /// Custom font file for small/caption text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_small. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("font_file_smallname")] - public string? FontFileSmallname { get; set; } - - /// - /// Font name from the available font library for small text. Ignored if font_file_small is provided. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("font_name_small")] - public string? FontNameSmall { get; set; } - - /// - /// A set of images to use as style references (max size 25MB per image; the whole request must stay under 50MB). The images should be in JPEG, PNG or WebP format. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("style_reference_images")] - public global::System.Collections.Generic.IList? StyleReferenceImages { get; set; } - - /// - /// A set of asset images (e.g., logos, icons) to use as references for detection and replacement (maximum 10 images). The images should be in JPEG, PNG or WebP format. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("reference_asset_images")] - public global::System.Collections.Generic.IList? ReferenceAssetImages { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The prompt to use to generate the graphic.
- /// Example: A birthday card saying 'Happy Birthday' - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The resolutions supported for Ideogram 3.0.
- /// Example: 1280x800 - /// - /// - /// Output aspect ratio. Cannot be combined with resolution. Generation defaults to 1x1; remix keeps the source ratio when both fields are omitted. - /// - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// Description of what to exclude from a graphic. Descriptions in the prompt take precedence
- /// to descriptions in the negative prompt.
- /// Example: brush strokes, painting - /// - /// - /// Number of graphics to generate.
- /// Default Value: 1 - /// - /// - /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). Not supported by V_1, V_1_TURBO, V_2A and V_2A_TURBO models. - /// - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - /// - /// - /// The style type to generate with.
- /// Default Value: GENERAL
- /// Example: GENERAL - /// - /// - /// A predefined style preset that applies a specific artistic style to the generated image.
- /// Example: BRIGHT_ART - /// - /// - /// A custom model URI in the format model/<model_name>/version/<version_name>.
- /// When provided, the model version and style will be resolved from this URI, and style_type is not required.
- /// Example: model/my-custom-model/version/1 - /// - /// - /// An existing flat graphic image to process for text detection and correction without generating a new image. When provided, image generation is bypassed. The image should be in JPEG, PNG or WebP format (max size 25MB). - /// - /// - /// An existing flat graphic image to process for text detection and correction without generating a new image. When provided, image generation is bypassed. The image should be in JPEG, PNG or WebP format (max size 25MB). - /// - /// - /// Custom font file for H1 (heading) text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_h1. - /// - /// - /// Custom font file for H1 (heading) text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_h1. - /// - /// - /// Font name from the available font library for H1 text. Ignored if font_file_h1 is provided.
- /// Example: Ubuntu-Bold.ttf - /// - /// - /// Custom font file for H2 (subheading) text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_h2. - /// - /// - /// Custom font file for H2 (subheading) text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_h2. - /// - /// - /// Font name from the available font library for H2 text. Ignored if font_file_h2 is provided. - /// - /// - /// Custom font file for body text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_body. - /// - /// - /// Custom font file for body text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_body. - /// - /// - /// Font name from the available font library for body text. Ignored if font_file_body is provided. - /// - /// - /// Custom font file for small/caption text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_small. - /// - /// - /// Custom font file for small/caption text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_small. - /// - /// - /// Font name from the available font library for small text. Ignored if font_file_small is provided. - /// - /// - /// A set of images to use as style references (max size 25MB per image; the whole request must stay under 50MB). The images should be in JPEG, PNG or WebP format. - /// - /// - /// A set of asset images (e.g., logos, icons) to use as references for detection and replacement (maximum 10 images). The images should be in JPEG, PNG or WebP format. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public GenerateGraphicRequestV3( - string? prompt, - int? seed, - global::Ideogram.ResolutionV3? resolution, - global::Ideogram.AspectRatioV3? aspectRatio, - global::Ideogram.RenderingSpeed? renderingSpeed, - global::Ideogram.MagicPromptOption? magicPrompt, - string? magicPromptSystemPromptConfigId, - string? negativePrompt, - int? numImages, - global::Ideogram.ColorPaletteWithPresetNameOrMembers? colorPalette, - global::System.Collections.Generic.IList? styleCodes, - global::Ideogram.StyleTypeV3? styleType, - global::Ideogram.StylePresetV3? stylePreset, - string? customModelUri, - byte[]? flatGraphicImage, - string? flatGraphicImagename, - byte[]? fontFileH1, - string? fontFileH1name, - string? fontNameH1, - byte[]? fontFileH2, - string? fontFileH2name, - string? fontNameH2, - byte[]? fontFileBody, - string? fontFileBodyname, - string? fontNameBody, - byte[]? fontFileSmall, - string? fontFileSmallname, - string? fontNameSmall, - global::System.Collections.Generic.IList? styleReferenceImages, - global::System.Collections.Generic.IList? referenceAssetImages) - { - this.Prompt = prompt; - this.Seed = seed; - this.Resolution = resolution; - this.AspectRatio = aspectRatio; - this.RenderingSpeed = renderingSpeed; - this.MagicPrompt = magicPrompt; - this.MagicPromptSystemPromptConfigId = magicPromptSystemPromptConfigId; - this.NegativePrompt = negativePrompt; - this.NumImages = numImages; - this.ColorPalette = colorPalette; - this.StyleCodes = styleCodes; - this.StyleType = styleType; - this.StylePreset = stylePreset; - this.CustomModelUri = customModelUri; - this.FlatGraphicImage = flatGraphicImage; - this.FlatGraphicImagename = flatGraphicImagename; - this.FontFileH1 = fontFileH1; - this.FontFileH1name = fontFileH1name; - this.FontNameH1 = fontNameH1; - this.FontFileH2 = fontFileH2; - this.FontFileH2name = fontFileH2name; - this.FontNameH2 = fontNameH2; - this.FontFileBody = fontFileBody; - this.FontFileBodyname = fontFileBodyname; - this.FontNameBody = fontNameBody; - this.FontFileSmall = fontFileSmall; - this.FontFileSmallname = fontFileSmallname; - this.FontNameSmall = fontNameSmall; - this.StyleReferenceImages = styleReferenceImages; - this.ReferenceAssetImages = referenceAssetImages; - } - - /// - /// Initializes a new instance of the class. - /// - public GenerateGraphicRequestV3() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageGptImage25FlareRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageGptImage25FlareRequest.Json.g.cs deleted file mode 100644 index 94b79182..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageGptImage25FlareRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class GenerateImageGptImage25FlareRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.GenerateImageGptImage25FlareRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.GenerateImageGptImage25FlareRequest), - jsonSerializerContext) as global::Ideogram.GenerateImageGptImage25FlareRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.GenerateImageGptImage25FlareRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.GenerateImageGptImage25FlareRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.GenerateImageGptImage25FlareRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GenerateImageGptImage25FlareRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageGptImage25FlareRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageGptImage25FlareRequest.g.cs deleted file mode 100644 index d37ed19e..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageGptImage25FlareRequest.g.cs +++ /dev/null @@ -1,254 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Source `images` are optional. When supplied, the prompt is applied to
- /// them as an edit. Without source images, the output is generated from
- /// the prompt alone. - ///
- public sealed partial class GenerateImageGptImage25FlareRequest - { - /// - /// The prompt to generate images from, or the edit instruction to apply when source images are supplied. It is passed to the model as written. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Prompt { get; set; } - - /// - /// Existing upload or generated image assets to edit, by reference. Takes priority over `images` if both are supplied. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image_asset_identifiers")] - public global::System.Collections.Generic.IList? ImageAssetIdentifiers { get; set; } - - /// - /// Optional source images to edit (max 16, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("images")] - public global::System.Collections.Generic.IList? Images { get; set; } - - /// - /// An existing upload or generated image asset to use as the mask, by reference. The same rules as `mask` apply. Takes priority over `mask` if both are supplied. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("mask_asset_identifier")] - public global::Ideogram.AssetIdentifier? MaskAssetIdentifier { get; set; } - - /// - /// An optional mask for the first source image (max 25MB; JPEG, PNG, or WEBP). Multipart requests only. Fully transparent pixels mark the areas to edit. The mask must have the same dimensions as the first source image, and requires source images in the same request. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("mask")] - public byte[]? Mask { get; set; } - - /// - /// An optional mask for the first source image (max 25MB; JPEG, PNG, or WEBP). Multipart requests only. Fully transparent pixels mark the areas to edit. The mask must have the same dimensions as the first source image, and requires source images in the same request. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("maskname")] - public string? Maskname { get; set; } - - /// - /// The output background. `transparent` returns images with an alpha channel, `opaque` forces a solid background, and `auto` lets the model decide from the prompt.
- /// Default Value: auto - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("background")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.GenerateImageGptImage25FlareRequestBackgroundJsonConverter))] - public global::Ideogram.GenerateImageGptImage25FlareRequestBackground? Background { get; set; } - - /// - /// How much rendering effort the model spends. Lower tiers return sooner and cost less; `auto` lets the model choose, which it currently renders at `high`.
- /// Default Value: auto - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("quality")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.GenerateImageGptImage25FlareRequestQualityJsonConverter))] - public global::Ideogram.GenerateImageGptImage25FlareRequestQuality? Quality { get; set; } - - /// - /// The number of images to generate.
- /// Default Value: 1 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] - public int? NumImages { get; set; } - - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - ///
- /// 12345 - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// The requested output aspect ratio, for example "1:1", "16:9", or "9:16". Ignored when `resolution` is provided. Defaults to "1:1". - /// - [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] - public string? AspectRatio { get; set; } - - /// - /// Exact output resolution, formatted as "WIDTHxHEIGHT", for example
- /// "2048x2048" or "1920x1088". When provided, this takes precedence
- /// over `aspect_ratio`. The dimensions must satisfy GPT Image 2.5 Flare
- /// constraints: each side is a multiple of 16, the largest side is at
- /// most 3840px, the long:short ratio is at most 3:1, and total pixels
- /// are between 655360 and 8294400 inclusive. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] - public string? Resolution { get; set; } - - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("async")] - public bool? Async { get; set; } - - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - ///
- /// https://api.example.com/webhooks/ideogram - [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] - public string? WebhookUrl { get; set; } - - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("target_collection_id")] - public string? TargetCollectionId { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The prompt to generate images from, or the edit instruction to apply when source images are supplied. It is passed to the model as written. - /// - /// - /// Existing upload or generated image assets to edit, by reference. Takes priority over `images` if both are supplied. - /// - /// - /// Optional source images to edit (max 16, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only. - /// - /// - /// An existing upload or generated image asset to use as the mask, by reference. The same rules as `mask` apply. Takes priority over `mask` if both are supplied. - /// - /// - /// An optional mask for the first source image (max 25MB; JPEG, PNG, or WEBP). Multipart requests only. Fully transparent pixels mark the areas to edit. The mask must have the same dimensions as the first source image, and requires source images in the same request. - /// - /// - /// An optional mask for the first source image (max 25MB; JPEG, PNG, or WEBP). Multipart requests only. Fully transparent pixels mark the areas to edit. The mask must have the same dimensions as the first source image, and requires source images in the same request. - /// - /// - /// The output background. `transparent` returns images with an alpha channel, `opaque` forces a solid background, and `auto` lets the model decide from the prompt.
- /// Default Value: auto - /// - /// - /// How much rendering effort the model spends. Lower tiers return sooner and cost less; `auto` lets the model choose, which it currently renders at `high`.
- /// Default Value: auto - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The requested output aspect ratio, for example "1:1", "16:9", or "9:16". Ignored when `resolution` is provided. Defaults to "1:1". - /// - /// - /// Exact output resolution, formatted as "WIDTHxHEIGHT", for example
- /// "2048x2048" or "1920x1088". When provided, this takes precedence
- /// over `aspect_ratio`. The dimensions must satisfy GPT Image 2.5 Flare
- /// constraints: each side is a multiple of 16, the largest side is at
- /// most 3840px, the long:short ratio is at most 3:1, and total pixels
- /// are between 655360 and 8294400 inclusive. - /// - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public GenerateImageGptImage25FlareRequest( - string prompt, - global::System.Collections.Generic.IList? imageAssetIdentifiers, - global::System.Collections.Generic.IList? images, - global::Ideogram.AssetIdentifier? maskAssetIdentifier, - byte[]? mask, - string? maskname, - global::Ideogram.GenerateImageGptImage25FlareRequestBackground? background, - global::Ideogram.GenerateImageGptImage25FlareRequestQuality? quality, - int? numImages, - int? seed, - string? aspectRatio, - string? resolution, - bool? async, - string? webhookUrl, - bool? @private, - string? targetCollectionId) - { - this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); - this.ImageAssetIdentifiers = imageAssetIdentifiers; - this.Images = images; - this.MaskAssetIdentifier = maskAssetIdentifier; - this.Mask = mask; - this.Maskname = maskname; - this.Background = background; - this.Quality = quality; - this.NumImages = numImages; - this.Seed = seed; - this.AspectRatio = aspectRatio; - this.Resolution = resolution; - this.Async = async; - this.WebhookUrl = webhookUrl; - this.Private = @private; - this.TargetCollectionId = targetCollectionId; - } - - /// - /// Initializes a new instance of the class. - /// - public GenerateImageGptImage25FlareRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageGptImage25FlareRequestBackground.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageGptImage25FlareRequestBackground.g.cs deleted file mode 100644 index 2d43b62d..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageGptImage25FlareRequestBackground.g.cs +++ /dev/null @@ -1,58 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The output background. `transparent` returns images with an alpha channel, `opaque` forces a solid background, and `auto` lets the model decide from the prompt.
- /// Default Value: auto - ///
- public enum GenerateImageGptImage25FlareRequestBackground - { - /// - /// - /// - Auto, - /// - /// - /// - Opaque, - /// - /// - /// - Transparent, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class GenerateImageGptImage25FlareRequestBackgroundExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this GenerateImageGptImage25FlareRequestBackground value) - { - return value switch - { - GenerateImageGptImage25FlareRequestBackground.Auto => "auto", - GenerateImageGptImage25FlareRequestBackground.Opaque => "opaque", - GenerateImageGptImage25FlareRequestBackground.Transparent => "transparent", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static GenerateImageGptImage25FlareRequestBackground? ToEnum(string value) - { - return value switch - { - "auto" => GenerateImageGptImage25FlareRequestBackground.Auto, - "opaque" => GenerateImageGptImage25FlareRequestBackground.Opaque, - "transparent" => GenerateImageGptImage25FlareRequestBackground.Transparent, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageGptImage25FlareRequestQuality.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageGptImage25FlareRequestQuality.g.cs deleted file mode 100644 index 72cc5532..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageGptImage25FlareRequestQuality.g.cs +++ /dev/null @@ -1,64 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// How much rendering effort the model spends. Lower tiers return sooner and cost less; `auto` lets the model choose, which it currently renders at `high`.
- /// Default Value: auto - ///
- public enum GenerateImageGptImage25FlareRequestQuality - { - /// - /// - /// - Auto, - /// - /// - /// - High, - /// - /// - /// - Low, - /// - /// - /// - Medium, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class GenerateImageGptImage25FlareRequestQualityExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this GenerateImageGptImage25FlareRequestQuality value) - { - return value switch - { - GenerateImageGptImage25FlareRequestQuality.Auto => "auto", - GenerateImageGptImage25FlareRequestQuality.High => "high", - GenerateImageGptImage25FlareRequestQuality.Low => "low", - GenerateImageGptImage25FlareRequestQuality.Medium => "medium", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static GenerateImageGptImage25FlareRequestQuality? ToEnum(string value) - { - return value switch - { - "auto" => GenerateImageGptImage25FlareRequestQuality.Auto, - "high" => GenerateImageGptImage25FlareRequestQuality.High, - "low" => GenerateImageGptImage25FlareRequestQuality.Low, - "medium" => GenerateImageGptImage25FlareRequestQuality.Medium, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageGptImage25FlareResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageGptImage25FlareResponse.g.cs index 1d1fbd46..5eb5b437 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageGptImage25FlareResponse.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageGptImage25FlareResponse.g.cs @@ -9,8 +9,7 @@ namespace Ideogram /// `data`. Asynchronous requests omit `data`; poll
/// `GET /v2/generations/{generation_id}` with the returned
/// `generation_id`. `seed` is the seed that was used, including when you
- /// did not set one.
- /// Example: {"data":[{"seed":12345,"prompt":"prompt","resolution":"1024x1024","url":"https://openapi-generator.tech","is_image_safe":true},{"seed":12345,"prompt":"prompt","resolution":"1024x1024","url":"https://openapi-generator.tech","is_image_safe":true}],"seed":12345,"generation_id":"generation_id"} + /// did not set one. ///
public sealed partial class GenerateImageGptImage25FlareResponse { @@ -29,10 +28,8 @@ public sealed partial class GenerateImageGptImage25FlareResponse public global::System.Collections.Generic.IList? Data { get; set; } /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. ///
- /// 12345 [global::System.Text.Json.Serialization.JsonPropertyName("seed")] [global::System.Text.Json.Serialization.JsonRequired] public required int Seed { get; set; } @@ -51,8 +48,7 @@ public sealed partial class GenerateImageGptImage25FlareResponse /// `GET /v2/generations/{generation_id}`. /// /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. /// /// /// The generated images, in generation order. Present only for synchronous requests (`async` omitted or false). diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageGptImage25SunburstRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageGptImage25SunburstRequest.Json.g.cs deleted file mode 100644 index 0f6d304e..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageGptImage25SunburstRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class GenerateImageGptImage25SunburstRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.GenerateImageGptImage25SunburstRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.GenerateImageGptImage25SunburstRequest), - jsonSerializerContext) as global::Ideogram.GenerateImageGptImage25SunburstRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.GenerateImageGptImage25SunburstRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.GenerateImageGptImage25SunburstRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.GenerateImageGptImage25SunburstRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GenerateImageGptImage25SunburstRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageGptImage25SunburstRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageGptImage25SunburstRequest.g.cs deleted file mode 100644 index efdd679b..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageGptImage25SunburstRequest.g.cs +++ /dev/null @@ -1,254 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Source `images` are optional. When supplied, the prompt is applied to
- /// them as an edit. Without source images, the output is generated from
- /// the prompt alone. - ///
- public sealed partial class GenerateImageGptImage25SunburstRequest - { - /// - /// The prompt to generate images from, or the edit instruction to apply when source images are supplied. It is passed to the model as written. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Prompt { get; set; } - - /// - /// Existing upload or generated image assets to edit, by reference. Takes priority over `images` if both are supplied. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image_asset_identifiers")] - public global::System.Collections.Generic.IList? ImageAssetIdentifiers { get; set; } - - /// - /// Optional source images to edit (max 16, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("images")] - public global::System.Collections.Generic.IList? Images { get; set; } - - /// - /// An existing upload or generated image asset to use as the mask, by reference. The same rules as `mask` apply. Takes priority over `mask` if both are supplied. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("mask_asset_identifier")] - public global::Ideogram.AssetIdentifier? MaskAssetIdentifier { get; set; } - - /// - /// An optional mask for the first source image (max 25MB; JPEG, PNG, or WEBP). Multipart requests only. Fully transparent pixels mark the areas to edit. The mask must have the same dimensions as the first source image, and requires source images in the same request. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("mask")] - public byte[]? Mask { get; set; } - - /// - /// An optional mask for the first source image (max 25MB; JPEG, PNG, or WEBP). Multipart requests only. Fully transparent pixels mark the areas to edit. The mask must have the same dimensions as the first source image, and requires source images in the same request. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("maskname")] - public string? Maskname { get; set; } - - /// - /// The output background. `transparent` returns images with an alpha channel, `opaque` forces a solid background, and `auto` lets the model decide from the prompt.
- /// Default Value: auto - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("background")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.GenerateImageGptImage25SunburstRequestBackgroundJsonConverter))] - public global::Ideogram.GenerateImageGptImage25SunburstRequestBackground? Background { get; set; } - - /// - /// How much rendering effort the model spends. Lower tiers return sooner and cost less; `auto` lets the model choose, which it currently renders at `high`.
- /// Default Value: auto - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("quality")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.GenerateImageGptImage25SunburstRequestQualityJsonConverter))] - public global::Ideogram.GenerateImageGptImage25SunburstRequestQuality? Quality { get; set; } - - /// - /// The number of images to generate.
- /// Default Value: 1 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] - public int? NumImages { get; set; } - - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - ///
- /// 12345 - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// The requested output aspect ratio, for example "1:1", "16:9", or "9:16". Ignored when `resolution` is provided. Defaults to "1:1". - /// - [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] - public string? AspectRatio { get; set; } - - /// - /// Exact output resolution, formatted as "WIDTHxHEIGHT", for example
- /// "2048x2048" or "1920x1088". When provided, this takes precedence
- /// over `aspect_ratio`. The dimensions must satisfy GPT Image 2.5 Sunburst
- /// constraints: each side is a multiple of 16, the largest side is at
- /// most 3840px, the long:short ratio is at most 3:1, and total pixels
- /// are between 655360 and 8294400 inclusive. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] - public string? Resolution { get; set; } - - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("async")] - public bool? Async { get; set; } - - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - ///
- /// https://api.example.com/webhooks/ideogram - [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] - public string? WebhookUrl { get; set; } - - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("target_collection_id")] - public string? TargetCollectionId { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The prompt to generate images from, or the edit instruction to apply when source images are supplied. It is passed to the model as written. - /// - /// - /// Existing upload or generated image assets to edit, by reference. Takes priority over `images` if both are supplied. - /// - /// - /// Optional source images to edit (max 16, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only. - /// - /// - /// An existing upload or generated image asset to use as the mask, by reference. The same rules as `mask` apply. Takes priority over `mask` if both are supplied. - /// - /// - /// An optional mask for the first source image (max 25MB; JPEG, PNG, or WEBP). Multipart requests only. Fully transparent pixels mark the areas to edit. The mask must have the same dimensions as the first source image, and requires source images in the same request. - /// - /// - /// An optional mask for the first source image (max 25MB; JPEG, PNG, or WEBP). Multipart requests only. Fully transparent pixels mark the areas to edit. The mask must have the same dimensions as the first source image, and requires source images in the same request. - /// - /// - /// The output background. `transparent` returns images with an alpha channel, `opaque` forces a solid background, and `auto` lets the model decide from the prompt.
- /// Default Value: auto - /// - /// - /// How much rendering effort the model spends. Lower tiers return sooner and cost less; `auto` lets the model choose, which it currently renders at `high`.
- /// Default Value: auto - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The requested output aspect ratio, for example "1:1", "16:9", or "9:16". Ignored when `resolution` is provided. Defaults to "1:1". - /// - /// - /// Exact output resolution, formatted as "WIDTHxHEIGHT", for example
- /// "2048x2048" or "1920x1088". When provided, this takes precedence
- /// over `aspect_ratio`. The dimensions must satisfy GPT Image 2.5 Sunburst
- /// constraints: each side is a multiple of 16, the largest side is at
- /// most 3840px, the long:short ratio is at most 3:1, and total pixels
- /// are between 655360 and 8294400 inclusive. - /// - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public GenerateImageGptImage25SunburstRequest( - string prompt, - global::System.Collections.Generic.IList? imageAssetIdentifiers, - global::System.Collections.Generic.IList? images, - global::Ideogram.AssetIdentifier? maskAssetIdentifier, - byte[]? mask, - string? maskname, - global::Ideogram.GenerateImageGptImage25SunburstRequestBackground? background, - global::Ideogram.GenerateImageGptImage25SunburstRequestQuality? quality, - int? numImages, - int? seed, - string? aspectRatio, - string? resolution, - bool? async, - string? webhookUrl, - bool? @private, - string? targetCollectionId) - { - this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); - this.ImageAssetIdentifiers = imageAssetIdentifiers; - this.Images = images; - this.MaskAssetIdentifier = maskAssetIdentifier; - this.Mask = mask; - this.Maskname = maskname; - this.Background = background; - this.Quality = quality; - this.NumImages = numImages; - this.Seed = seed; - this.AspectRatio = aspectRatio; - this.Resolution = resolution; - this.Async = async; - this.WebhookUrl = webhookUrl; - this.Private = @private; - this.TargetCollectionId = targetCollectionId; - } - - /// - /// Initializes a new instance of the class. - /// - public GenerateImageGptImage25SunburstRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageGptImage25SunburstRequestBackground.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageGptImage25SunburstRequestBackground.g.cs deleted file mode 100644 index 81c6f656..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageGptImage25SunburstRequestBackground.g.cs +++ /dev/null @@ -1,58 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The output background. `transparent` returns images with an alpha channel, `opaque` forces a solid background, and `auto` lets the model decide from the prompt.
- /// Default Value: auto - ///
- public enum GenerateImageGptImage25SunburstRequestBackground - { - /// - /// - /// - Auto, - /// - /// - /// - Opaque, - /// - /// - /// - Transparent, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class GenerateImageGptImage25SunburstRequestBackgroundExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this GenerateImageGptImage25SunburstRequestBackground value) - { - return value switch - { - GenerateImageGptImage25SunburstRequestBackground.Auto => "auto", - GenerateImageGptImage25SunburstRequestBackground.Opaque => "opaque", - GenerateImageGptImage25SunburstRequestBackground.Transparent => "transparent", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static GenerateImageGptImage25SunburstRequestBackground? ToEnum(string value) - { - return value switch - { - "auto" => GenerateImageGptImage25SunburstRequestBackground.Auto, - "opaque" => GenerateImageGptImage25SunburstRequestBackground.Opaque, - "transparent" => GenerateImageGptImage25SunburstRequestBackground.Transparent, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageGptImage25SunburstRequestQuality.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageGptImage25SunburstRequestQuality.g.cs deleted file mode 100644 index c1925754..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageGptImage25SunburstRequestQuality.g.cs +++ /dev/null @@ -1,64 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// How much rendering effort the model spends. Lower tiers return sooner and cost less; `auto` lets the model choose, which it currently renders at `high`.
- /// Default Value: auto - ///
- public enum GenerateImageGptImage25SunburstRequestQuality - { - /// - /// - /// - Auto, - /// - /// - /// - High, - /// - /// - /// - Low, - /// - /// - /// - Medium, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class GenerateImageGptImage25SunburstRequestQualityExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this GenerateImageGptImage25SunburstRequestQuality value) - { - return value switch - { - GenerateImageGptImage25SunburstRequestQuality.Auto => "auto", - GenerateImageGptImage25SunburstRequestQuality.High => "high", - GenerateImageGptImage25SunburstRequestQuality.Low => "low", - GenerateImageGptImage25SunburstRequestQuality.Medium => "medium", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static GenerateImageGptImage25SunburstRequestQuality? ToEnum(string value) - { - return value switch - { - "auto" => GenerateImageGptImage25SunburstRequestQuality.Auto, - "high" => GenerateImageGptImage25SunburstRequestQuality.High, - "low" => GenerateImageGptImage25SunburstRequestQuality.Low, - "medium" => GenerateImageGptImage25SunburstRequestQuality.Medium, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageGptImage25SunburstResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageGptImage25SunburstResponse.g.cs index f7189f08..6f307a2f 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageGptImage25SunburstResponse.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageGptImage25SunburstResponse.g.cs @@ -9,8 +9,7 @@ namespace Ideogram /// `data`. Asynchronous requests omit `data`; poll
/// `GET /v2/generations/{generation_id}` with the returned
/// `generation_id`. `seed` is the seed that was used, including when you
- /// did not set one.
- /// Example: {"data":[{"seed":12345,"prompt":"prompt","resolution":"1024x1024","url":"https://openapi-generator.tech","is_image_safe":true},{"seed":12345,"prompt":"prompt","resolution":"1024x1024","url":"https://openapi-generator.tech","is_image_safe":true}],"seed":12345,"generation_id":"generation_id"} + /// did not set one. /// public sealed partial class GenerateImageGptImage25SunburstResponse { @@ -29,10 +28,8 @@ public sealed partial class GenerateImageGptImage25SunburstResponse public global::System.Collections.Generic.IList? Data { get; set; } /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. ///
- /// 12345 [global::System.Text.Json.Serialization.JsonPropertyName("seed")] [global::System.Text.Json.Serialization.JsonRequired] public required int Seed { get; set; } @@ -51,8 +48,7 @@ public sealed partial class GenerateImageGptImage25SunburstResponse /// `GET /v2/generations/{generation_id}`. /// /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. /// /// /// The generated images, in generation order. Present only for synchronous requests (`async` omitted or false). diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageGptImage2Request.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageGptImage2Request.Json.g.cs deleted file mode 100644 index 1ffaf153..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageGptImage2Request.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class GenerateImageGptImage2Request - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.GenerateImageGptImage2Request? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.GenerateImageGptImage2Request), - jsonSerializerContext) as global::Ideogram.GenerateImageGptImage2Request; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.GenerateImageGptImage2Request? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.GenerateImageGptImage2Request? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.GenerateImageGptImage2Request), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GenerateImageGptImage2Request; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageGptImage2Request.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageGptImage2Request.g.cs deleted file mode 100644 index 59006ea8..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageGptImage2Request.g.cs +++ /dev/null @@ -1,193 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Source `images` are optional. When supplied, the prompt is applied to
- /// them as an edit. Without source images, the output is generated from
- /// the prompt alone. - ///
- public sealed partial class GenerateImageGptImage2Request - { - /// - /// The prompt to generate images from, or the edit instruction to apply when source images are supplied. It is passed to the model as written. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Prompt { get; set; } - - /// - /// Existing upload or generated image assets to edit, by reference. Takes priority over `images` if both are supplied. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image_asset_identifiers")] - public global::System.Collections.Generic.IList? ImageAssetIdentifiers { get; set; } - - /// - /// Optional source images to edit (max 16, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("images")] - public global::System.Collections.Generic.IList? Images { get; set; } - - /// - /// The number of images to generate.
- /// Default Value: 1 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] - public int? NumImages { get; set; } - - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - ///
- /// 12345 - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// The requested output aspect ratio, for example "1:1", "16:9", or "9:16". Ignored when `resolution` is provided. Defaults to "1:1". - /// - [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] - public string? AspectRatio { get; set; } - - /// - /// Exact output resolution, formatted as "WIDTHxHEIGHT", for example
- /// "2048x2048" or "1920x1088". When provided, this takes precedence
- /// over `aspect_ratio`. The dimensions must satisfy GPT Image 2
- /// constraints: each side is a multiple of 16, the largest side is at
- /// most 3840px, the long:short ratio is at most 3:1, and total pixels
- /// are between 655360 and 8294400 inclusive. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] - public string? Resolution { get; set; } - - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("async")] - public bool? Async { get; set; } - - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - ///
- /// https://api.example.com/webhooks/ideogram - [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] - public string? WebhookUrl { get; set; } - - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("target_collection_id")] - public string? TargetCollectionId { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The prompt to generate images from, or the edit instruction to apply when source images are supplied. It is passed to the model as written. - /// - /// - /// Existing upload or generated image assets to edit, by reference. Takes priority over `images` if both are supplied. - /// - /// - /// Optional source images to edit (max 16, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only. - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The requested output aspect ratio, for example "1:1", "16:9", or "9:16". Ignored when `resolution` is provided. Defaults to "1:1". - /// - /// - /// Exact output resolution, formatted as "WIDTHxHEIGHT", for example
- /// "2048x2048" or "1920x1088". When provided, this takes precedence
- /// over `aspect_ratio`. The dimensions must satisfy GPT Image 2
- /// constraints: each side is a multiple of 16, the largest side is at
- /// most 3840px, the long:short ratio is at most 3:1, and total pixels
- /// are between 655360 and 8294400 inclusive. - /// - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public GenerateImageGptImage2Request( - string prompt, - global::System.Collections.Generic.IList? imageAssetIdentifiers, - global::System.Collections.Generic.IList? images, - int? numImages, - int? seed, - string? aspectRatio, - string? resolution, - bool? async, - string? webhookUrl, - bool? @private, - string? targetCollectionId) - { - this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); - this.ImageAssetIdentifiers = imageAssetIdentifiers; - this.Images = images; - this.NumImages = numImages; - this.Seed = seed; - this.AspectRatio = aspectRatio; - this.Resolution = resolution; - this.Async = async; - this.WebhookUrl = webhookUrl; - this.Private = @private; - this.TargetCollectionId = targetCollectionId; - } - - /// - /// Initializes a new instance of the class. - /// - public GenerateImageGptImage2Request() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageGptImage2Response.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageGptImage2Response.g.cs index df59dd86..f0d95b31 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageGptImage2Response.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageGptImage2Response.g.cs @@ -9,8 +9,7 @@ namespace Ideogram /// `data`. Asynchronous requests omit `data`; poll
/// `GET /v2/generations/{generation_id}` with the returned
/// `generation_id`. `seed` is the seed that was used, including when you
- /// did not set one.
- /// Example: {"data":[{"seed":12345,"prompt":"prompt","resolution":"1024x1024","url":"https://openapi-generator.tech","is_image_safe":true},{"seed":12345,"prompt":"prompt","resolution":"1024x1024","url":"https://openapi-generator.tech","is_image_safe":true}],"seed":12345,"generation_id":"generation_id"} + /// did not set one. /// public sealed partial class GenerateImageGptImage2Response { @@ -29,10 +28,8 @@ public sealed partial class GenerateImageGptImage2Response public global::System.Collections.Generic.IList? Data { get; set; } /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. ///
- /// 12345 [global::System.Text.Json.Serialization.JsonPropertyName("seed")] [global::System.Text.Json.Serialization.JsonRequired] public required int Seed { get; set; } @@ -51,8 +48,7 @@ public sealed partial class GenerateImageGptImage2Response /// `GET /v2/generations/{generation_id}`. /// /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. /// /// /// The generated images, in generation order. Present only for synchronous requests (`async` omitted or false). diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogram45Request.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogram45Request.Json.g.cs deleted file mode 100644 index bcedc478..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogram45Request.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class GenerateImageIdeogram45Request - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.GenerateImageIdeogram45Request? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.GenerateImageIdeogram45Request), - jsonSerializerContext) as global::Ideogram.GenerateImageIdeogram45Request; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.GenerateImageIdeogram45Request? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.GenerateImageIdeogram45Request? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.GenerateImageIdeogram45Request), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GenerateImageIdeogram45Request; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogram45Request.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogram45Request.g.cs deleted file mode 100644 index de20b920..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogram45Request.g.cs +++ /dev/null @@ -1,304 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Source `images` are optional. When supplied, the request edits them
- /// and `size` defaults to "auto". A prompt is required either way. - ///
- public sealed partial class GenerateImageIdeogram45Request - { - /// - /// The prompt to generate images from, or the edit instruction when
- /// source images are supplied. Natural language or a structured
- /// Ideogram 4.0 JSON prompt. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Prompt { get; set; } - - /// - /// Controls how a natural-language prompt is prepared. `auto` (the
- /// default) and `on` rewrite and expand the prompt before generation.
- /// `off` keeps your wording and only converts it into a structured
- /// prompt. A valid structured JSON prompt skips magic prompt unless
- /// `magic_prompt` is `on`. With source images, every mode converts
- /// the edit instruction into a structured edit prompt.
- /// Default Value: auto - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.MagicPromptModeJsonConverter))] - public global::Ideogram.MagicPromptMode? MagicPrompt { get; set; } - - /// - /// Existing upload or generated image assets to transform, by reference. Takes priority over `images` if both are supplied. The first source is the primary image; any further sources are additional references. Supplying sources turns the request into an image-to-image transform. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image_asset_identifiers")] - public global::System.Collections.Generic.IList? ImageAssetIdentifiers { get; set; } - - /// - /// Optional source images to edit (max 5, max 25MB each; JPEG, PNG, or WEBP). The first image is the one being edited; any others are extra references. Multipart requests only. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("images")] - public global::System.Collections.Generic.IList? Images { get; set; } - - /// - /// An existing upload or generated image asset to use as the mask, by reference. The same rules as `mask` apply. Takes priority over `mask` if both are supplied. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("mask_asset_identifier")] - public global::Ideogram.AssetIdentifier? MaskAssetIdentifier { get; set; } - - /// - /// An optional mask that limits the edit to part of the first source image (max 25MB; JPEG, PNG, or WEBP). Multipart requests only. Black marks the area to edit and white the area to keep; values in between are rounded to the nearer of the two. The mask must have the same width and height as the first source image and contain both black and white areas. A masked request can include at most three other source images. With a mask, the output is always the first source image's own size, so `size` cannot be set. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("mask")] - public byte[]? Mask { get; set; } - - /// - /// An optional mask that limits the edit to part of the first source image (max 25MB; JPEG, PNG, or WEBP). Multipart requests only. Black marks the area to edit and white the area to keep; values in between are rounded to the nearer of the two. The mask must have the same width and height as the first source image and contain both black and white areas. A masked request can include at most three other source images. With a mask, the output is always the first source image's own size, so `size` cannot be set. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("maskname")] - public string? Maskname { get; set; } - - /// - /// The output size: "auto", "source" or an exact "WIDTHxHEIGHT".
- /// Without source images, an exact size must be one of the supported
- /// 1K/2K presets (for example 1024x1024, 2048x2048 or 1440x2880);
- /// "auto" or omitted picks a supported size based on the prompt.
- /// "source" is rejected.
- /// With source images, "auto" (the default) picks a supported 2K size
- /// based on the source images and the prompt, and "source" returns the
- /// output at the first source image's own width and height (scaled
- /// down, keeping its proportions, if it is too large for the model).
- /// Every source image's aspect ratio must be between 1:6 and 6:1.
- /// An exact size must have both sides a multiple of 32 and at least
- /// 256px, a total of at most 2048x2048 pixels, and an aspect ratio of
- /// at most 6:1. With source images, an exact size reshapes the source
- /// to it.
- /// Pricing is tiered by the resolved output pixels: up to 1024x1024
- /// bills as 1K, above that as 2K. An "auto" size bills as 2K.
- /// Default Value: auto
- /// Example: 2048x2048 - ///
- /// 2048x2048 - [global::System.Text.Json.Serialization.JsonPropertyName("size")] - public string? Size { get; set; } - - /// - /// The output background. `transparent` returns images with an alpha channel, `opaque` returns a solid one, and `auto` decides for you.
- /// Default Value: auto - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("background")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.GenerateImageIdeogram45RequestBackgroundJsonConverter))] - public global::Ideogram.GenerateImageIdeogram45RequestBackground? Background { get; set; } - - /// - /// The rendering quality to use. Higher quality takes longer and costs more. Defaults to `medium` with source images and `high` without. `very_low`, the fastest and cheapest, requires source images. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("quality")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.GenerateImageIdeogram45RequestQualityJsonConverter))] - public global::Ideogram.GenerateImageIdeogram45RequestQuality? Quality { get; set; } - - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - ///
- /// 12345 - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// The number of images to generate.
- /// Default Value: 1 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] - public int? NumImages { get; set; } - - /// - /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("enable_copyright_detection")] - public bool? EnableCopyrightDetection { get; set; } - - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("async")] - public bool? Async { get; set; } - - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - ///
- /// https://api.example.com/webhooks/ideogram - [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] - public string? WebhookUrl { get; set; } - - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("target_collection_id")] - public string? TargetCollectionId { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The prompt to generate images from, or the edit instruction when
- /// source images are supplied. Natural language or a structured
- /// Ideogram 4.0 JSON prompt. - /// - /// - /// Controls how a natural-language prompt is prepared. `auto` (the
- /// default) and `on` rewrite and expand the prompt before generation.
- /// `off` keeps your wording and only converts it into a structured
- /// prompt. A valid structured JSON prompt skips magic prompt unless
- /// `magic_prompt` is `on`. With source images, every mode converts
- /// the edit instruction into a structured edit prompt.
- /// Default Value: auto - /// - /// - /// Existing upload or generated image assets to transform, by reference. Takes priority over `images` if both are supplied. The first source is the primary image; any further sources are additional references. Supplying sources turns the request into an image-to-image transform. - /// - /// - /// Optional source images to edit (max 5, max 25MB each; JPEG, PNG, or WEBP). The first image is the one being edited; any others are extra references. Multipart requests only. - /// - /// - /// An existing upload or generated image asset to use as the mask, by reference. The same rules as `mask` apply. Takes priority over `mask` if both are supplied. - /// - /// - /// An optional mask that limits the edit to part of the first source image (max 25MB; JPEG, PNG, or WEBP). Multipart requests only. Black marks the area to edit and white the area to keep; values in between are rounded to the nearer of the two. The mask must have the same width and height as the first source image and contain both black and white areas. A masked request can include at most three other source images. With a mask, the output is always the first source image's own size, so `size` cannot be set. - /// - /// - /// An optional mask that limits the edit to part of the first source image (max 25MB; JPEG, PNG, or WEBP). Multipart requests only. Black marks the area to edit and white the area to keep; values in between are rounded to the nearer of the two. The mask must have the same width and height as the first source image and contain both black and white areas. A masked request can include at most three other source images. With a mask, the output is always the first source image's own size, so `size` cannot be set. - /// - /// - /// The output size: "auto", "source" or an exact "WIDTHxHEIGHT".
- /// Without source images, an exact size must be one of the supported
- /// 1K/2K presets (for example 1024x1024, 2048x2048 or 1440x2880);
- /// "auto" or omitted picks a supported size based on the prompt.
- /// "source" is rejected.
- /// With source images, "auto" (the default) picks a supported 2K size
- /// based on the source images and the prompt, and "source" returns the
- /// output at the first source image's own width and height (scaled
- /// down, keeping its proportions, if it is too large for the model).
- /// Every source image's aspect ratio must be between 1:6 and 6:1.
- /// An exact size must have both sides a multiple of 32 and at least
- /// 256px, a total of at most 2048x2048 pixels, and an aspect ratio of
- /// at most 6:1. With source images, an exact size reshapes the source
- /// to it.
- /// Pricing is tiered by the resolved output pixels: up to 1024x1024
- /// bills as 1K, above that as 2K. An "auto" size bills as 2K.
- /// Default Value: auto
- /// Example: 2048x2048 - /// - /// - /// The output background. `transparent` returns images with an alpha channel, `opaque` returns a solid one, and `auto` decides for you.
- /// Default Value: auto - /// - /// - /// The rendering quality to use. Higher quality takes longer and costs more. Defaults to `medium` with source images and `high` without. `very_low`, the fastest and cheapest, requires source images. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. - /// - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public GenerateImageIdeogram45Request( - string prompt, - global::Ideogram.MagicPromptMode? magicPrompt, - global::System.Collections.Generic.IList? imageAssetIdentifiers, - global::System.Collections.Generic.IList? images, - global::Ideogram.AssetIdentifier? maskAssetIdentifier, - byte[]? mask, - string? maskname, - string? size, - global::Ideogram.GenerateImageIdeogram45RequestBackground? background, - global::Ideogram.GenerateImageIdeogram45RequestQuality? quality, - int? seed, - int? numImages, - bool? enableCopyrightDetection, - bool? async, - string? webhookUrl, - bool? @private, - string? targetCollectionId) - { - this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); - this.MagicPrompt = magicPrompt; - this.ImageAssetIdentifiers = imageAssetIdentifiers; - this.Images = images; - this.MaskAssetIdentifier = maskAssetIdentifier; - this.Mask = mask; - this.Maskname = maskname; - this.Size = size; - this.Background = background; - this.Quality = quality; - this.Seed = seed; - this.NumImages = numImages; - this.EnableCopyrightDetection = enableCopyrightDetection; - this.Async = async; - this.WebhookUrl = webhookUrl; - this.Private = @private; - this.TargetCollectionId = targetCollectionId; - } - - /// - /// Initializes a new instance of the class. - /// - public GenerateImageIdeogram45Request() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogram45RequestBackground.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogram45RequestBackground.g.cs deleted file mode 100644 index 30bd7fb3..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogram45RequestBackground.g.cs +++ /dev/null @@ -1,58 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The output background. `transparent` returns images with an alpha channel, `opaque` returns a solid one, and `auto` decides for you.
- /// Default Value: auto - ///
- public enum GenerateImageIdeogram45RequestBackground - { - /// - /// - /// - Auto, - /// - /// - /// - Opaque, - /// - /// - /// - Transparent, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class GenerateImageIdeogram45RequestBackgroundExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this GenerateImageIdeogram45RequestBackground value) - { - return value switch - { - GenerateImageIdeogram45RequestBackground.Auto => "auto", - GenerateImageIdeogram45RequestBackground.Opaque => "opaque", - GenerateImageIdeogram45RequestBackground.Transparent => "transparent", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static GenerateImageIdeogram45RequestBackground? ToEnum(string value) - { - return value switch - { - "auto" => GenerateImageIdeogram45RequestBackground.Auto, - "opaque" => GenerateImageIdeogram45RequestBackground.Opaque, - "transparent" => GenerateImageIdeogram45RequestBackground.Transparent, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogram45RequestQuality.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogram45RequestQuality.g.cs deleted file mode 100644 index e89cb06d..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogram45RequestQuality.g.cs +++ /dev/null @@ -1,63 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The rendering quality to use. Higher quality takes longer and costs more. Defaults to `medium` with source images and `high` without. `very_low`, the fastest and cheapest, requires source images. - /// - public enum GenerateImageIdeogram45RequestQuality - { - /// - /// - /// - High, - /// - /// - /// - Low, - /// - /// - /// - Medium, - /// - /// - /// - VeryLow, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class GenerateImageIdeogram45RequestQualityExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this GenerateImageIdeogram45RequestQuality value) - { - return value switch - { - GenerateImageIdeogram45RequestQuality.High => "high", - GenerateImageIdeogram45RequestQuality.Low => "low", - GenerateImageIdeogram45RequestQuality.Medium => "medium", - GenerateImageIdeogram45RequestQuality.VeryLow => "very_low", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static GenerateImageIdeogram45RequestQuality? ToEnum(string value) - { - return value switch - { - "high" => GenerateImageIdeogram45RequestQuality.High, - "low" => GenerateImageIdeogram45RequestQuality.Low, - "medium" => GenerateImageIdeogram45RequestQuality.Medium, - "very_low" => GenerateImageIdeogram45RequestQuality.VeryLow, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogram45Response.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogram45Response.g.cs index f2a4aceb..be74b80f 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogram45Response.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogram45Response.g.cs @@ -9,8 +9,7 @@ namespace Ideogram /// `data`. Asynchronous requests omit `data`; poll
/// `GET /v2/generations/{generation_id}` with the returned
/// `generation_id`. `seed` is the seed that was used, including when you
- /// did not set one.
- /// Example: {"generation_kind":null,"data":[{"seed":12345,"prompt":"prompt","resolution":"1024x1024","url":"https://openapi-generator.tech","is_image_safe":true},{"seed":12345,"prompt":"prompt","resolution":"1024x1024","url":"https://openapi-generator.tech","is_image_safe":true}],"seed":12345,"generation_id":"generation_id"} + /// did not set one. /// public sealed partial class GenerateImageIdeogram45Response { @@ -37,10 +36,8 @@ public sealed partial class GenerateImageIdeogram45Response public global::System.Collections.Generic.IList? Data { get; set; } /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. ///
- /// 12345 [global::System.Text.Json.Serialization.JsonPropertyName("seed")] [global::System.Text.Json.Serialization.JsonRequired] public required int Seed { get; set; } @@ -62,8 +59,7 @@ public sealed partial class GenerateImageIdeogram45Response /// `GET /v2/generations/{generation_id}`. /// /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. /// /// /// The generated images, in generation order. Present only for synchronous requests (`async` omitted or false). diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV2ARequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV2ARequest.g.cs index ac6393aa..f7bee739 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV2ARequest.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV2ARequest.g.cs @@ -4,7 +4,7 @@ namespace Ideogram { /// - /// Example: {"magic_prompt":"","aspect_ratio":null,"async":false,"style_type":"realistic","private":true,"seed":12345,"rendering_speed":"default","webhook_url":"https://api.example.com/webhooks/ideogram","enable_copyright_detection":true,"target_collection_id":"target_collection_id","prompt":"prompt","num_images":1} + /// /// public sealed partial class GenerateImageIdeogramV2ARequest { @@ -16,10 +16,8 @@ public sealed partial class GenerateImageIdeogramV2ARequest public required string Prompt { get; set; } /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. ///
- /// 12345 [global::System.Text.Json.Serialization.JsonPropertyName("seed")] public int? Seed { get; set; } @@ -57,10 +55,8 @@ public sealed partial class GenerateImageIdeogramV2ARequest public int? NumImages { get; set; } /// - /// The style type to generate with. When omitted, the model's default styling is used; pass `auto` to have a style selected automatically from the prompt.
- /// Example: realistic + /// The style type to generate with. When omitted, the model's default styling is used; pass `auto` to have a style selected automatically from the prompt. ///
- /// realistic [global::System.Text.Json.Serialization.JsonPropertyName("style_type")] [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.IdeogramV2StyleTypeJsonConverter))] public global::Ideogram.IdeogramV2StyleType? StyleType { get; set; } @@ -86,25 +82,11 @@ public sealed partial class GenerateImageIdeogramV2ARequest /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
/// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
/// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram + /// private and loopback hosts and the cloud metadata service are rejected. /// - /// https://api.example.com/webhooks/ideogram [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] public string? WebhookUrl { get; set; } - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("target_collection_id")] - public string? TargetCollectionId { get; set; } - /// /// Additional properties that are not explicitly defined in the schema /// @@ -118,8 +100,7 @@ public sealed partial class GenerateImageIdeogramV2ARequest /// The prompt to generate images from. /// /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. /// /// /// The aspect ratio for an Ideogram 3.x or 2.x generation. `auto` lets the
@@ -140,8 +121,7 @@ public sealed partial class GenerateImageIdeogramV2ARequest /// Default Value: 1 /// /// - /// The style type to generate with. When omitted, the model's default styling is used; pass `auto` to have a style selected automatically from the prompt.
- /// Example: realistic + /// The style type to generate with. When omitted, the model's default styling is used; pass `auto` to have a style selected automatically from the prompt. /// /// /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. @@ -158,14 +138,7 @@ public sealed partial class GenerateImageIdeogramV2ARequest /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
/// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
/// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. + /// private and loopback hosts and the cloud metadata service are rejected. /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -180,9 +153,7 @@ public GenerateImageIdeogramV2ARequest( global::Ideogram.IdeogramV2StyleType? styleType, bool? enableCopyrightDetection, bool? async, - string? webhookUrl, - bool? @private, - string? targetCollectionId) + string? webhookUrl) { this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); this.Seed = seed; @@ -194,8 +165,6 @@ public GenerateImageIdeogramV2ARequest( this.EnableCopyrightDetection = enableCopyrightDetection; this.Async = async; this.WebhookUrl = webhookUrl; - this.Private = @private; - this.TargetCollectionId = targetCollectionId; } /// diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV2AResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV2AResponse.g.cs index 52e2452e..ccdf721d 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV2AResponse.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV2AResponse.g.cs @@ -9,8 +9,7 @@ namespace Ideogram /// `data`. Asynchronous requests omit `data`; poll
/// `GET /v2/generations/{generation_id}` with the returned
/// `generation_id`. `seed` is the seed that was used, including when you
- /// did not set one.
- /// Example: {"data":[{"seed":12345,"prompt":"prompt","resolution":"1024x1024","url":"https://openapi-generator.tech","is_image_safe":true},{"seed":12345,"prompt":"prompt","resolution":"1024x1024","url":"https://openapi-generator.tech","is_image_safe":true}],"seed":12345,"generation_id":"generation_id"} + /// did not set one. ///
public sealed partial class GenerateImageIdeogramV2AResponse { @@ -29,10 +28,8 @@ public sealed partial class GenerateImageIdeogramV2AResponse public global::System.Collections.Generic.IList? Data { get; set; } /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. ///
- /// 12345 [global::System.Text.Json.Serialization.JsonPropertyName("seed")] [global::System.Text.Json.Serialization.JsonRequired] public required int Seed { get; set; } @@ -51,8 +48,7 @@ public sealed partial class GenerateImageIdeogramV2AResponse /// `GET /v2/generations/{generation_id}`. /// /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. /// /// /// The generated images, in generation order. Present only for synchronous requests (`async` omitted or false). diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV2Request.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV2Request.g.cs index ff47f820..c82af8e0 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV2Request.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV2Request.g.cs @@ -4,7 +4,7 @@ namespace Ideogram { /// - /// Example: {"aspect_ratio":null,"private":true,"seed":12345,"rendering_speed":"default","webhook_url":"https://api.example.com/webhooks/ideogram","target_collection_id":"target_collection_id","num_images":1,"magic_prompt":"","async":false,"style_type":"realistic","negative_prompt":"negative_prompt","enable_copyright_detection":true,"prompt":"prompt"} + /// /// public sealed partial class GenerateImageIdeogramV2Request { @@ -22,10 +22,8 @@ public sealed partial class GenerateImageIdeogramV2Request public string? NegativePrompt { get; set; } /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. ///
- /// 12345 [global::System.Text.Json.Serialization.JsonPropertyName("seed")] public int? Seed { get; set; } @@ -63,10 +61,8 @@ public sealed partial class GenerateImageIdeogramV2Request public int? NumImages { get; set; } /// - /// The style type to generate with. When omitted, the model's default styling is used; pass `auto` to have a style selected automatically from the prompt.
- /// Example: realistic + /// The style type to generate with. When omitted, the model's default styling is used; pass `auto` to have a style selected automatically from the prompt. ///
- /// realistic [global::System.Text.Json.Serialization.JsonPropertyName("style_type")] [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.IdeogramV2StyleTypeJsonConverter))] public global::Ideogram.IdeogramV2StyleType? StyleType { get; set; } @@ -92,25 +88,11 @@ public sealed partial class GenerateImageIdeogramV2Request /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
/// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
/// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram + /// private and loopback hosts and the cloud metadata service are rejected. /// - /// https://api.example.com/webhooks/ideogram [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] public string? WebhookUrl { get; set; } - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("target_collection_id")] - public string? TargetCollectionId { get; set; } - /// /// Additional properties that are not explicitly defined in the schema /// @@ -127,8 +109,7 @@ public sealed partial class GenerateImageIdeogramV2Request /// Description of what to exclude from the images. The prompt takes precedence over the negative prompt. /// /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. /// /// /// The aspect ratio for an Ideogram 3.x or 2.x generation. `auto` lets the
@@ -149,8 +130,7 @@ public sealed partial class GenerateImageIdeogramV2Request /// Default Value: 1 /// /// - /// The style type to generate with. When omitted, the model's default styling is used; pass `auto` to have a style selected automatically from the prompt.
- /// Example: realistic + /// The style type to generate with. When omitted, the model's default styling is used; pass `auto` to have a style selected automatically from the prompt. /// /// /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. @@ -167,14 +147,7 @@ public sealed partial class GenerateImageIdeogramV2Request /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
/// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
/// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. + /// private and loopback hosts and the cloud metadata service are rejected. /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -190,9 +163,7 @@ public GenerateImageIdeogramV2Request( global::Ideogram.IdeogramV2StyleType? styleType, bool? enableCopyrightDetection, bool? async, - string? webhookUrl, - bool? @private, - string? targetCollectionId) + string? webhookUrl) { this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); this.NegativePrompt = negativePrompt; @@ -205,8 +176,6 @@ public GenerateImageIdeogramV2Request( this.EnableCopyrightDetection = enableCopyrightDetection; this.Async = async; this.WebhookUrl = webhookUrl; - this.Private = @private; - this.TargetCollectionId = targetCollectionId; } /// diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV2Response.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV2Response.g.cs index ca50dd4a..9b8fd521 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV2Response.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV2Response.g.cs @@ -9,8 +9,7 @@ namespace Ideogram /// `data`. Asynchronous requests omit `data`; poll
/// `GET /v2/generations/{generation_id}` with the returned
/// `generation_id`. `seed` is the seed that was used, including when you
- /// did not set one.
- /// Example: {"data":[{"seed":12345,"prompt":"prompt","resolution":"1024x1024","url":"https://openapi-generator.tech","is_image_safe":true},{"seed":12345,"prompt":"prompt","resolution":"1024x1024","url":"https://openapi-generator.tech","is_image_safe":true}],"seed":12345,"generation_id":"generation_id"} + /// did not set one. ///
public sealed partial class GenerateImageIdeogramV2Response { @@ -29,10 +28,8 @@ public sealed partial class GenerateImageIdeogramV2Response public global::System.Collections.Generic.IList? Data { get; set; } /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. ///
- /// 12345 [global::System.Text.Json.Serialization.JsonPropertyName("seed")] [global::System.Text.Json.Serialization.JsonRequired] public required int Seed { get; set; } @@ -51,8 +48,7 @@ public sealed partial class GenerateImageIdeogramV2Response /// `GET /v2/generations/{generation_id}`. /// /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. /// /// /// The generated images, in generation order. Present only for synchronous requests (`async` omitted or false). diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV3CharacterRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV3CharacterRequest.Json.g.cs deleted file mode 100644 index 96558195..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV3CharacterRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class GenerateImageIdeogramV3CharacterRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.GenerateImageIdeogramV3CharacterRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.GenerateImageIdeogramV3CharacterRequest), - jsonSerializerContext) as global::Ideogram.GenerateImageIdeogramV3CharacterRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.GenerateImageIdeogramV3CharacterRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.GenerateImageIdeogramV3CharacterRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.GenerateImageIdeogramV3CharacterRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GenerateImageIdeogramV3CharacterRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV3CharacterRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV3CharacterRequest.g.cs deleted file mode 100644 index a530b527..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV3CharacterRequest.g.cs +++ /dev/null @@ -1,358 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Upload one character reference per request as
- /// `character_reference_images`. Style references can be
- /// added only on accounts with access; otherwise combining them with a
- /// character returns a 400. - ///
- public sealed partial class GenerateImageIdeogramV3CharacterRequest - { - /// - /// The prompt to generate images from. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Prompt { get; set; } - - /// - /// Description of what to exclude from the images. The prompt takes precedence over the negative prompt. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("negative_prompt")] - public string? NegativePrompt { get; set; } - - /// - /// A saved character to feature, by its URL-safe base64 collection id. Takes priority over `character_reference_images` if both are supplied. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("character_reference_collection_id")] - public string? CharacterReferenceCollectionId { get; set; } - - /// - /// Optional URL-safe base64 version id of the saved character in `character_reference_collection_id`. Ignored without it. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("character_reference_collection_version_id")] - public string? CharacterReferenceCollectionVersionId { get; set; } - - /// - /// An existing upload or generated image asset to use as the character reference, by reference. Takes priority over `character_reference_images` if both are supplied. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("character_reference_asset_identifiers")] - public global::System.Collections.Generic.IList? CharacterReferenceAssetIdentifiers { get; set; } - - /// - /// An image of the character to feature (max 25MB; JPEG, PNG, or WEBP). - /// - [global::System.Text.Json.Serialization.JsonPropertyName("character_reference_images")] - public global::System.Collections.Generic.IList? CharacterReferenceImages { get; set; } - - /// - /// An existing upload or generated image asset to use as the character reference mask, by reference. The same rules as `character_reference_mask` apply. Takes priority over `character_reference_mask` if both are supplied. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("character_reference_mask_asset_identifier")] - public global::Ideogram.AssetIdentifier? CharacterReferenceMaskAssetIdentifier { get; set; } - - /// - /// Optional grayscale mask marking where the character is in the character reference image, at the same size as that image (JPEG, PNG, or WEBP). Multipart requests only. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("character_reference_mask")] - public byte[]? CharacterReferenceMask { get; set; } - - /// - /// Optional grayscale mask marking where the character is in the character reference image, at the same size as that image (JPEG, PNG, or WEBP). Multipart requests only. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("character_reference_maskname")] - public string? CharacterReferenceMaskname { get; set; } - - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - ///
- /// 12345 - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// The resolutions supported for Ideogram 3.0.
- /// Example: 1280x800 - ///
- /// 1280x800 - [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ResolutionV3JsonConverter))] - public global::Ideogram.ResolutionV3? Resolution { get; set; } - - /// - /// The aspect ratio for an Ideogram 3.x or 2.x generation. `auto` lets the
- /// model select a ratio from the prompt; any other value pins the ratio.
- /// Cannot be combined with `resolution`. Omitting the field is not `auto`:
- /// it uses `1x1`. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.IdeogramV3AspectRatioJsonConverter))] - public global::Ideogram.IdeogramV3AspectRatio? AspectRatio { get; set; } - - /// - /// The rendering speed to use.
- /// Default Value: default - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("rendering_speed")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.GenerateImageIdeogramV3CharacterRequestRenderingSpeedJsonConverter))] - public global::Ideogram.GenerateImageIdeogramV3CharacterRequestRenderingSpeed? RenderingSpeed { get; set; } - - /// - /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
- /// Default Value: auto - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.MagicPromptModeJsonConverter))] - public global::Ideogram.MagicPromptMode? MagicPrompt { get; set; } - - /// - /// The number of images to generate.
- /// Default Value: 1 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] - public int? NumImages { get; set; } - - /// - /// The style type to generate the character with. Defaults to `auto`.
- /// Default Value: auto - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("style_type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.GenerateImageIdeogramV3CharacterRequestStyleTypeJsonConverter))] - public global::Ideogram.GenerateImageIdeogramV3CharacterRequestStyleType? StyleType { get; set; } - - /// - /// A saved style to apply, by its URL-safe base64 collection id. Takes priority over `style_reference_images` if both are supplied. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("style_reference_collection_id")] - public string? StyleReferenceCollectionId { get; set; } - - /// - /// Optional URL-safe base64 version id of the saved style in `style_reference_collection_id`. Ignored without it. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("style_reference_collection_version_id")] - public string? StyleReferenceCollectionVersionId { get; set; } - - /// - /// Existing upload or generated image assets to use as style references, by reference. Takes priority over `style_reference_images` if both are supplied. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("style_reference_asset_identifiers")] - public global::System.Collections.Generic.IList? StyleReferenceAssetIdentifiers { get; set; } - - /// - /// Images to use as style references (max 10, max 25MB each; JPEG, PNG, or WEBP). - /// - [global::System.Text.Json.Serialization.JsonPropertyName("style_reference_images")] - public global::System.Collections.Generic.IList? StyleReferenceImages { get; set; } - - /// - /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("enable_copyright_detection")] - public bool? EnableCopyrightDetection { get; set; } - - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("async")] - public bool? Async { get; set; } - - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - ///
- /// https://api.example.com/webhooks/ideogram - [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] - public string? WebhookUrl { get; set; } - - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("target_collection_id")] - public string? TargetCollectionId { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The prompt to generate images from. - /// - /// - /// Description of what to exclude from the images. The prompt takes precedence over the negative prompt. - /// - /// - /// A saved character to feature, by its URL-safe base64 collection id. Takes priority over `character_reference_images` if both are supplied. - /// - /// - /// Optional URL-safe base64 version id of the saved character in `character_reference_collection_id`. Ignored without it. - /// - /// - /// An existing upload or generated image asset to use as the character reference, by reference. Takes priority over `character_reference_images` if both are supplied. - /// - /// - /// An image of the character to feature (max 25MB; JPEG, PNG, or WEBP). - /// - /// - /// An existing upload or generated image asset to use as the character reference mask, by reference. The same rules as `character_reference_mask` apply. Takes priority over `character_reference_mask` if both are supplied. - /// - /// - /// Optional grayscale mask marking where the character is in the character reference image, at the same size as that image (JPEG, PNG, or WEBP). Multipart requests only. - /// - /// - /// Optional grayscale mask marking where the character is in the character reference image, at the same size as that image (JPEG, PNG, or WEBP). Multipart requests only. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The resolutions supported for Ideogram 3.0.
- /// Example: 1280x800 - /// - /// - /// The aspect ratio for an Ideogram 3.x or 2.x generation. `auto` lets the
- /// model select a ratio from the prompt; any other value pins the ratio.
- /// Cannot be combined with `resolution`. Omitting the field is not `auto`:
- /// it uses `1x1`. - /// - /// - /// The rendering speed to use.
- /// Default Value: default - /// - /// - /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
- /// Default Value: auto - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// The style type to generate the character with. Defaults to `auto`.
- /// Default Value: auto - /// - /// - /// A saved style to apply, by its URL-safe base64 collection id. Takes priority over `style_reference_images` if both are supplied. - /// - /// - /// Optional URL-safe base64 version id of the saved style in `style_reference_collection_id`. Ignored without it. - /// - /// - /// Existing upload or generated image assets to use as style references, by reference. Takes priority over `style_reference_images` if both are supplied. - /// - /// - /// Images to use as style references (max 10, max 25MB each; JPEG, PNG, or WEBP). - /// - /// - /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. - /// - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public GenerateImageIdeogramV3CharacterRequest( - string prompt, - string? negativePrompt, - string? characterReferenceCollectionId, - string? characterReferenceCollectionVersionId, - global::System.Collections.Generic.IList? characterReferenceAssetIdentifiers, - global::System.Collections.Generic.IList? characterReferenceImages, - global::Ideogram.AssetIdentifier? characterReferenceMaskAssetIdentifier, - byte[]? characterReferenceMask, - string? characterReferenceMaskname, - int? seed, - global::Ideogram.ResolutionV3? resolution, - global::Ideogram.IdeogramV3AspectRatio? aspectRatio, - global::Ideogram.GenerateImageIdeogramV3CharacterRequestRenderingSpeed? renderingSpeed, - global::Ideogram.MagicPromptMode? magicPrompt, - int? numImages, - global::Ideogram.GenerateImageIdeogramV3CharacterRequestStyleType? styleType, - string? styleReferenceCollectionId, - string? styleReferenceCollectionVersionId, - global::System.Collections.Generic.IList? styleReferenceAssetIdentifiers, - global::System.Collections.Generic.IList? styleReferenceImages, - bool? enableCopyrightDetection, - bool? async, - string? webhookUrl, - bool? @private, - string? targetCollectionId) - { - this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); - this.NegativePrompt = negativePrompt; - this.CharacterReferenceCollectionId = characterReferenceCollectionId; - this.CharacterReferenceCollectionVersionId = characterReferenceCollectionVersionId; - this.CharacterReferenceAssetIdentifiers = characterReferenceAssetIdentifiers; - this.CharacterReferenceImages = characterReferenceImages; - this.CharacterReferenceMaskAssetIdentifier = characterReferenceMaskAssetIdentifier; - this.CharacterReferenceMask = characterReferenceMask; - this.CharacterReferenceMaskname = characterReferenceMaskname; - this.Seed = seed; - this.Resolution = resolution; - this.AspectRatio = aspectRatio; - this.RenderingSpeed = renderingSpeed; - this.MagicPrompt = magicPrompt; - this.NumImages = numImages; - this.StyleType = styleType; - this.StyleReferenceCollectionId = styleReferenceCollectionId; - this.StyleReferenceCollectionVersionId = styleReferenceCollectionVersionId; - this.StyleReferenceAssetIdentifiers = styleReferenceAssetIdentifiers; - this.StyleReferenceImages = styleReferenceImages; - this.EnableCopyrightDetection = enableCopyrightDetection; - this.Async = async; - this.WebhookUrl = webhookUrl; - this.Private = @private; - this.TargetCollectionId = targetCollectionId; - } - - /// - /// Initializes a new instance of the class. - /// - public GenerateImageIdeogramV3CharacterRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV3CharacterRequestRenderingSpeed.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV3CharacterRequestRenderingSpeed.g.cs deleted file mode 100644 index 6282a608..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV3CharacterRequestRenderingSpeed.g.cs +++ /dev/null @@ -1,58 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The rendering speed to use.
- /// Default Value: default - ///
- public enum GenerateImageIdeogramV3CharacterRequestRenderingSpeed - { - /// - /// - /// - Default, - /// - /// - /// - Quality, - /// - /// - /// - Turbo, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class GenerateImageIdeogramV3CharacterRequestRenderingSpeedExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this GenerateImageIdeogramV3CharacterRequestRenderingSpeed value) - { - return value switch - { - GenerateImageIdeogramV3CharacterRequestRenderingSpeed.Default => "default", - GenerateImageIdeogramV3CharacterRequestRenderingSpeed.Quality => "quality", - GenerateImageIdeogramV3CharacterRequestRenderingSpeed.Turbo => "turbo", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static GenerateImageIdeogramV3CharacterRequestRenderingSpeed? ToEnum(string value) - { - return value switch - { - "default" => GenerateImageIdeogramV3CharacterRequestRenderingSpeed.Default, - "quality" => GenerateImageIdeogramV3CharacterRequestRenderingSpeed.Quality, - "turbo" => GenerateImageIdeogramV3CharacterRequestRenderingSpeed.Turbo, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV3CharacterRequestStyleType.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV3CharacterRequestStyleType.g.cs deleted file mode 100644 index 25ab44a8..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV3CharacterRequestStyleType.g.cs +++ /dev/null @@ -1,58 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The style type to generate the character with. Defaults to `auto`.
- /// Default Value: auto - ///
- public enum GenerateImageIdeogramV3CharacterRequestStyleType - { - /// - /// - /// - Auto, - /// - /// - /// - Fiction, - /// - /// - /// - Realistic, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class GenerateImageIdeogramV3CharacterRequestStyleTypeExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this GenerateImageIdeogramV3CharacterRequestStyleType value) - { - return value switch - { - GenerateImageIdeogramV3CharacterRequestStyleType.Auto => "auto", - GenerateImageIdeogramV3CharacterRequestStyleType.Fiction => "fiction", - GenerateImageIdeogramV3CharacterRequestStyleType.Realistic => "realistic", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static GenerateImageIdeogramV3CharacterRequestStyleType? ToEnum(string value) - { - return value switch - { - "auto" => GenerateImageIdeogramV3CharacterRequestStyleType.Auto, - "fiction" => GenerateImageIdeogramV3CharacterRequestStyleType.Fiction, - "realistic" => GenerateImageIdeogramV3CharacterRequestStyleType.Realistic, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV3CharacterResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV3CharacterResponse.g.cs index d81cecfc..79dc0732 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV3CharacterResponse.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV3CharacterResponse.g.cs @@ -9,8 +9,7 @@ namespace Ideogram /// `data`. Asynchronous requests omit `data`; poll
/// `GET /v2/generations/{generation_id}` with the returned
/// `generation_id`. `seed` is the seed that was used, including when you
- /// did not set one.
- /// Example: {"data":[{"seed":12345,"prompt":"prompt","resolution":"1024x1024","url":"https://openapi-generator.tech","is_image_safe":true},{"seed":12345,"prompt":"prompt","resolution":"1024x1024","url":"https://openapi-generator.tech","is_image_safe":true}],"seed":12345,"generation_id":"generation_id"} + /// did not set one. /// public sealed partial class GenerateImageIdeogramV3CharacterResponse { @@ -29,10 +28,8 @@ public sealed partial class GenerateImageIdeogramV3CharacterResponse public global::System.Collections.Generic.IList? Data { get; set; } /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. ///
- /// 12345 [global::System.Text.Json.Serialization.JsonPropertyName("seed")] [global::System.Text.Json.Serialization.JsonRequired] public required int Seed { get; set; } @@ -51,8 +48,7 @@ public sealed partial class GenerateImageIdeogramV3CharacterResponse /// `GET /v2/generations/{generation_id}`. /// /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. /// /// /// The generated images, in generation order. Present only for synchronous requests (`async` omitted or false). diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV3CustomModelRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV3CustomModelRequest.Json.g.cs deleted file mode 100644 index 22837cbc..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV3CustomModelRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class GenerateImageIdeogramV3CustomModelRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.GenerateImageIdeogramV3CustomModelRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.GenerateImageIdeogramV3CustomModelRequest), - jsonSerializerContext) as global::Ideogram.GenerateImageIdeogramV3CustomModelRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.GenerateImageIdeogramV3CustomModelRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.GenerateImageIdeogramV3CustomModelRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.GenerateImageIdeogramV3CustomModelRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GenerateImageIdeogramV3CustomModelRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV3CustomModelRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV3CustomModelRequest.g.cs deleted file mode 100644 index 6ad8ae13..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV3CustomModelRequest.g.cs +++ /dev/null @@ -1,306 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - public sealed partial class GenerateImageIdeogramV3CustomModelRequest - { - /// - /// The prompt to generate images from. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Prompt { get; set; } - - /// - /// The custom model URI, in the form `model/<model_name>/version/<version_name>`. You or your organization must have access to the model. The model determines which rendering speeds are supported and whether backgrounds are removed automatically.
- /// Example: model/my-custom-model/version/1 - ///
- /// model/my-custom-model/version/1 - [global::System.Text.Json.Serialization.JsonPropertyName("custom_model_uri")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string CustomModelUri { get; set; } - - /// - /// Remove the background after generation and return transparent PNG images. Included in the custom model generation price at no extra charge. When false, the model's automatic background removal behavior still applies.
- /// Default Value: false - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("transparent_background")] - public bool? TransparentBackground { get; set; } - - /// - /// Description of what to exclude from the images. The prompt takes precedence over the negative prompt. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("negative_prompt")] - public string? NegativePrompt { get; set; } - - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - ///
- /// 12345 - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// The resolutions supported for Ideogram 3.0.
- /// Example: 1280x800 - ///
- /// 1280x800 - [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ResolutionV3JsonConverter))] - public global::Ideogram.ResolutionV3? Resolution { get; set; } - - /// - /// The aspect ratio for an Ideogram 3.x or 2.x generation. `auto` lets the
- /// model select a ratio from the prompt; any other value pins the ratio.
- /// Cannot be combined with `resolution`. Omitting the field is not `auto`:
- /// it uses `1x1`. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.IdeogramV3AspectRatioJsonConverter))] - public global::Ideogram.IdeogramV3AspectRatio? AspectRatio { get; set; } - - /// - /// The rendering speed to use. When omitted, a speed supported by the custom model is used. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("rendering_speed")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.GenerateImageIdeogramV3CustomModelRequestRenderingSpeedJsonConverter))] - public global::Ideogram.GenerateImageIdeogramV3CustomModelRequestRenderingSpeed? RenderingSpeed { get; set; } - - /// - /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
- /// Default Value: auto - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.MagicPromptModeJsonConverter))] - public global::Ideogram.MagicPromptMode? MagicPrompt { get; set; } - - /// - /// The number of images to generate.
- /// Default Value: 1 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] - public int? NumImages { get; set; } - - /// - /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). - /// - [global::System.Text.Json.Serialization.JsonPropertyName("color_palette")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.IdeogramColorPaletteJsonConverter))] - public global::Ideogram.IdeogramColorPalette? ColorPalette { get; set; } - - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - ///
- /// [AAFF5733, 0133FF57, DE3357FF] - [global::System.Text.Json.Serialization.JsonPropertyName("style_codes")] - public global::System.Collections.Generic.IList? StyleCodes { get; set; } - - /// - /// A predefined style preset to apply to the generated images. Cannot be combined with style codes or style references. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("style_preset")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.IdeogramV3StylePresetJsonConverter))] - public global::Ideogram.IdeogramV3StylePreset? StylePreset { get; set; } - - /// - /// Existing upload or generated image assets to use as style references, by reference. Cannot be combined with `style_reference_images`. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("style_reference_asset_identifiers")] - public global::System.Collections.Generic.IList? StyleReferenceAssetIdentifiers { get; set; } - - /// - /// Images to use as style references (max 10, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("style_reference_images")] - public global::System.Collections.Generic.IList? StyleReferenceImages { get; set; } - - /// - /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("enable_copyright_detection")] - public bool? EnableCopyrightDetection { get; set; } - - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("async")] - public bool? Async { get; set; } - - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - ///
- /// https://api.example.com/webhooks/ideogram - [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] - public string? WebhookUrl { get; set; } - - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("target_collection_id")] - public string? TargetCollectionId { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The prompt to generate images from. - /// - /// - /// The custom model URI, in the form `model/<model_name>/version/<version_name>`. You or your organization must have access to the model. The model determines which rendering speeds are supported and whether backgrounds are removed automatically.
- /// Example: model/my-custom-model/version/1 - /// - /// - /// Remove the background after generation and return transparent PNG images. Included in the custom model generation price at no extra charge. When false, the model's automatic background removal behavior still applies.
- /// Default Value: false - /// - /// - /// Description of what to exclude from the images. The prompt takes precedence over the negative prompt. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The resolutions supported for Ideogram 3.0.
- /// Example: 1280x800 - /// - /// - /// The aspect ratio for an Ideogram 3.x or 2.x generation. `auto` lets the
- /// model select a ratio from the prompt; any other value pins the ratio.
- /// Cannot be combined with `resolution`. Omitting the field is not `auto`:
- /// it uses `1x1`. - /// - /// - /// The rendering speed to use. When omitted, a speed supported by the custom model is used. - /// - /// - /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
- /// Default Value: auto - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). - /// - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - /// - /// - /// A predefined style preset to apply to the generated images. Cannot be combined with style codes or style references. - /// - /// - /// Existing upload or generated image assets to use as style references, by reference. Cannot be combined with `style_reference_images`. - /// - /// - /// Images to use as style references (max 10, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only. - /// - /// - /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. - /// - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public GenerateImageIdeogramV3CustomModelRequest( - string prompt, - string customModelUri, - bool? transparentBackground, - string? negativePrompt, - int? seed, - global::Ideogram.ResolutionV3? resolution, - global::Ideogram.IdeogramV3AspectRatio? aspectRatio, - global::Ideogram.GenerateImageIdeogramV3CustomModelRequestRenderingSpeed? renderingSpeed, - global::Ideogram.MagicPromptMode? magicPrompt, - int? numImages, - global::Ideogram.IdeogramColorPalette? colorPalette, - global::System.Collections.Generic.IList? styleCodes, - global::Ideogram.IdeogramV3StylePreset? stylePreset, - global::System.Collections.Generic.IList? styleReferenceAssetIdentifiers, - global::System.Collections.Generic.IList? styleReferenceImages, - bool? enableCopyrightDetection, - bool? async, - string? webhookUrl, - bool? @private, - string? targetCollectionId) - { - this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); - this.CustomModelUri = customModelUri ?? throw new global::System.ArgumentNullException(nameof(customModelUri)); - this.TransparentBackground = transparentBackground; - this.NegativePrompt = negativePrompt; - this.Seed = seed; - this.Resolution = resolution; - this.AspectRatio = aspectRatio; - this.RenderingSpeed = renderingSpeed; - this.MagicPrompt = magicPrompt; - this.NumImages = numImages; - this.ColorPalette = colorPalette; - this.StyleCodes = styleCodes; - this.StylePreset = stylePreset; - this.StyleReferenceAssetIdentifiers = styleReferenceAssetIdentifiers; - this.StyleReferenceImages = styleReferenceImages; - this.EnableCopyrightDetection = enableCopyrightDetection; - this.Async = async; - this.WebhookUrl = webhookUrl; - this.Private = @private; - this.TargetCollectionId = targetCollectionId; - } - - /// - /// Initializes a new instance of the class. - /// - public GenerateImageIdeogramV3CustomModelRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV3CustomModelRequestRenderingSpeed.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV3CustomModelRequestRenderingSpeed.g.cs deleted file mode 100644 index 8c9c0b22..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV3CustomModelRequestRenderingSpeed.g.cs +++ /dev/null @@ -1,57 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The rendering speed to use. When omitted, a speed supported by the custom model is used. - /// - public enum GenerateImageIdeogramV3CustomModelRequestRenderingSpeed - { - /// - /// - /// - Default, - /// - /// - /// - Quality, - /// - /// - /// - Turbo, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class GenerateImageIdeogramV3CustomModelRequestRenderingSpeedExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this GenerateImageIdeogramV3CustomModelRequestRenderingSpeed value) - { - return value switch - { - GenerateImageIdeogramV3CustomModelRequestRenderingSpeed.Default => "default", - GenerateImageIdeogramV3CustomModelRequestRenderingSpeed.Quality => "quality", - GenerateImageIdeogramV3CustomModelRequestRenderingSpeed.Turbo => "turbo", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static GenerateImageIdeogramV3CustomModelRequestRenderingSpeed? ToEnum(string value) - { - return value switch - { - "default" => GenerateImageIdeogramV3CustomModelRequestRenderingSpeed.Default, - "quality" => GenerateImageIdeogramV3CustomModelRequestRenderingSpeed.Quality, - "turbo" => GenerateImageIdeogramV3CustomModelRequestRenderingSpeed.Turbo, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV3CustomModelResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV3CustomModelResponse.g.cs index 1fd8afde..3526ae30 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV3CustomModelResponse.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV3CustomModelResponse.g.cs @@ -9,8 +9,7 @@ namespace Ideogram /// `data`. Asynchronous requests omit `data`; poll
/// `GET /v2/generations/{generation_id}` with the returned
/// `generation_id`. `seed` is the seed that was used, including when you
- /// did not set one.
- /// Example: {"data":[{"seed":12345,"prompt":"prompt","resolution":"1024x1024","url":"https://openapi-generator.tech","is_image_safe":true},{"seed":12345,"prompt":"prompt","resolution":"1024x1024","url":"https://openapi-generator.tech","is_image_safe":true}],"seed":12345,"generation_id":"generation_id"} + /// did not set one. /// public sealed partial class GenerateImageIdeogramV3CustomModelResponse { @@ -29,10 +28,8 @@ public sealed partial class GenerateImageIdeogramV3CustomModelResponse public global::System.Collections.Generic.IList? Data { get; set; } /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. ///
- /// 12345 [global::System.Text.Json.Serialization.JsonPropertyName("seed")] [global::System.Text.Json.Serialization.JsonRequired] public required int Seed { get; set; } @@ -51,8 +48,7 @@ public sealed partial class GenerateImageIdeogramV3CustomModelResponse /// `GET /v2/generations/{generation_id}`. /// /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. /// /// /// The generated images, in generation order. Present only for synchronous requests (`async` omitted or false). diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV3Request.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV3Request.Json.g.cs deleted file mode 100644 index 9273277a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV3Request.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class GenerateImageIdeogramV3Request - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.GenerateImageIdeogramV3Request? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.GenerateImageIdeogramV3Request), - jsonSerializerContext) as global::Ideogram.GenerateImageIdeogramV3Request; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.GenerateImageIdeogramV3Request? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.GenerateImageIdeogramV3Request? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.GenerateImageIdeogramV3Request), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GenerateImageIdeogramV3Request; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV3Request.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV3Request.g.cs deleted file mode 100644 index e07833f2..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV3Request.g.cs +++ /dev/null @@ -1,319 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - public sealed partial class GenerateImageIdeogramV3Request - { - /// - /// The prompt to generate images from. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Prompt { get; set; } - - /// - /// Description of what to exclude from the images. The prompt takes precedence over the negative prompt. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("negative_prompt")] - public string? NegativePrompt { get; set; } - - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - ///
- /// 12345 - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// The resolutions supported for Ideogram 3.0.
- /// Example: 1280x800 - ///
- /// 1280x800 - [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ResolutionV3JsonConverter))] - public global::Ideogram.ResolutionV3? Resolution { get; set; } - - /// - /// The aspect ratio for an Ideogram 3.x or 2.x generation. `auto` lets the
- /// model select a ratio from the prompt; any other value pins the ratio.
- /// Cannot be combined with `resolution`. Omitting the field is not `auto`:
- /// it uses `1x1`. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.IdeogramV3AspectRatioJsonConverter))] - public global::Ideogram.IdeogramV3AspectRatio? AspectRatio { get; set; } - - /// - /// The rendering speed to use.
- /// Default Value: default - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("rendering_speed")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.GenerateImageIdeogramV3RequestRenderingSpeedJsonConverter))] - public global::Ideogram.GenerateImageIdeogramV3RequestRenderingSpeed? RenderingSpeed { get; set; } - - /// - /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
- /// Default Value: auto - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.MagicPromptModeJsonConverter))] - public global::Ideogram.MagicPromptMode? MagicPrompt { get; set; } - - /// - /// The number of images to generate.
- /// Default Value: 1 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] - public int? NumImages { get; set; } - - /// - /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). - /// - [global::System.Text.Json.Serialization.JsonPropertyName("color_palette")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.IdeogramColorPaletteJsonConverter))] - public global::Ideogram.IdeogramColorPalette? ColorPalette { get; set; } - - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - ///
- /// [AAFF5733, 0133FF57, DE3357FF] - [global::System.Text.Json.Serialization.JsonPropertyName("style_codes")] - public global::System.Collections.Generic.IList? StyleCodes { get; set; } - - /// - /// The style type to generate with.
- /// Default Value: general
- /// Example: general - ///
- /// general - [global::System.Text.Json.Serialization.JsonPropertyName("style_type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.IdeogramV3StyleTypeJsonConverter))] - public global::Ideogram.IdeogramV3StyleType? StyleType { get; set; } - - /// - /// A predefined style preset to apply to the generated images. Cannot be combined with style codes or style references. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("style_preset")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.IdeogramV3StylePresetJsonConverter))] - public global::Ideogram.IdeogramV3StylePreset? StylePreset { get; set; } - - /// - /// A saved style to apply, by its URL-safe base64 collection id. Cannot be combined with `style_reference_images`. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("style_reference_collection_id")] - public string? StyleReferenceCollectionId { get; set; } - - /// - /// Optional URL-safe base64 version id of the saved style in `style_reference_collection_id`. Ignored without it. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("style_reference_collection_version_id")] - public string? StyleReferenceCollectionVersionId { get; set; } - - /// - /// Existing upload or generated image assets to use as style references, by reference. Cannot be combined with `style_reference_collection_id` or `style_reference_images`. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("style_reference_asset_identifiers")] - public global::System.Collections.Generic.IList? StyleReferenceAssetIdentifiers { get; set; } - - /// - /// Images to use as style references (max 10, max 25MB each; JPEG, PNG, or WEBP). - /// - [global::System.Text.Json.Serialization.JsonPropertyName("style_reference_images")] - public global::System.Collections.Generic.IList? StyleReferenceImages { get; set; } - - /// - /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("enable_copyright_detection")] - public bool? EnableCopyrightDetection { get; set; } - - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("async")] - public bool? Async { get; set; } - - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - ///
- /// https://api.example.com/webhooks/ideogram - [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] - public string? WebhookUrl { get; set; } - - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("target_collection_id")] - public string? TargetCollectionId { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The prompt to generate images from. - /// - /// - /// Description of what to exclude from the images. The prompt takes precedence over the negative prompt. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The resolutions supported for Ideogram 3.0.
- /// Example: 1280x800 - /// - /// - /// The aspect ratio for an Ideogram 3.x or 2.x generation. `auto` lets the
- /// model select a ratio from the prompt; any other value pins the ratio.
- /// Cannot be combined with `resolution`. Omitting the field is not `auto`:
- /// it uses `1x1`. - /// - /// - /// The rendering speed to use.
- /// Default Value: default - /// - /// - /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
- /// Default Value: auto - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). - /// - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - /// - /// - /// The style type to generate with.
- /// Default Value: general
- /// Example: general - /// - /// - /// A predefined style preset to apply to the generated images. Cannot be combined with style codes or style references. - /// - /// - /// A saved style to apply, by its URL-safe base64 collection id. Cannot be combined with `style_reference_images`. - /// - /// - /// Optional URL-safe base64 version id of the saved style in `style_reference_collection_id`. Ignored without it. - /// - /// - /// Existing upload or generated image assets to use as style references, by reference. Cannot be combined with `style_reference_collection_id` or `style_reference_images`. - /// - /// - /// Images to use as style references (max 10, max 25MB each; JPEG, PNG, or WEBP). - /// - /// - /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. - /// - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public GenerateImageIdeogramV3Request( - string prompt, - string? negativePrompt, - int? seed, - global::Ideogram.ResolutionV3? resolution, - global::Ideogram.IdeogramV3AspectRatio? aspectRatio, - global::Ideogram.GenerateImageIdeogramV3RequestRenderingSpeed? renderingSpeed, - global::Ideogram.MagicPromptMode? magicPrompt, - int? numImages, - global::Ideogram.IdeogramColorPalette? colorPalette, - global::System.Collections.Generic.IList? styleCodes, - global::Ideogram.IdeogramV3StyleType? styleType, - global::Ideogram.IdeogramV3StylePreset? stylePreset, - string? styleReferenceCollectionId, - string? styleReferenceCollectionVersionId, - global::System.Collections.Generic.IList? styleReferenceAssetIdentifiers, - global::System.Collections.Generic.IList? styleReferenceImages, - bool? enableCopyrightDetection, - bool? async, - string? webhookUrl, - bool? @private, - string? targetCollectionId) - { - this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); - this.NegativePrompt = negativePrompt; - this.Seed = seed; - this.Resolution = resolution; - this.AspectRatio = aspectRatio; - this.RenderingSpeed = renderingSpeed; - this.MagicPrompt = magicPrompt; - this.NumImages = numImages; - this.ColorPalette = colorPalette; - this.StyleCodes = styleCodes; - this.StyleType = styleType; - this.StylePreset = stylePreset; - this.StyleReferenceCollectionId = styleReferenceCollectionId; - this.StyleReferenceCollectionVersionId = styleReferenceCollectionVersionId; - this.StyleReferenceAssetIdentifiers = styleReferenceAssetIdentifiers; - this.StyleReferenceImages = styleReferenceImages; - this.EnableCopyrightDetection = enableCopyrightDetection; - this.Async = async; - this.WebhookUrl = webhookUrl; - this.Private = @private; - this.TargetCollectionId = targetCollectionId; - } - - /// - /// Initializes a new instance of the class. - /// - public GenerateImageIdeogramV3Request() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV3RequestRenderingSpeed.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV3RequestRenderingSpeed.g.cs deleted file mode 100644 index a6b501bb..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV3RequestRenderingSpeed.g.cs +++ /dev/null @@ -1,58 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The rendering speed to use.
- /// Default Value: default - ///
- public enum GenerateImageIdeogramV3RequestRenderingSpeed - { - /// - /// - /// - Default, - /// - /// - /// - Quality, - /// - /// - /// - Turbo, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class GenerateImageIdeogramV3RequestRenderingSpeedExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this GenerateImageIdeogramV3RequestRenderingSpeed value) - { - return value switch - { - GenerateImageIdeogramV3RequestRenderingSpeed.Default => "default", - GenerateImageIdeogramV3RequestRenderingSpeed.Quality => "quality", - GenerateImageIdeogramV3RequestRenderingSpeed.Turbo => "turbo", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static GenerateImageIdeogramV3RequestRenderingSpeed? ToEnum(string value) - { - return value switch - { - "default" => GenerateImageIdeogramV3RequestRenderingSpeed.Default, - "quality" => GenerateImageIdeogramV3RequestRenderingSpeed.Quality, - "turbo" => GenerateImageIdeogramV3RequestRenderingSpeed.Turbo, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV3Response.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV3Response.g.cs index 547864f3..ddefeabc 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV3Response.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV3Response.g.cs @@ -9,8 +9,7 @@ namespace Ideogram /// `data`. Asynchronous requests omit `data`; poll
/// `GET /v2/generations/{generation_id}` with the returned
/// `generation_id`. `seed` is the seed that was used, including when you
- /// did not set one.
- /// Example: {"data":[{"seed":12345,"prompt":"prompt","resolution":"1024x1024","url":"https://openapi-generator.tech","is_image_safe":true},{"seed":12345,"prompt":"prompt","resolution":"1024x1024","url":"https://openapi-generator.tech","is_image_safe":true}],"seed":12345,"generation_id":"generation_id"} + /// did not set one. /// public sealed partial class GenerateImageIdeogramV3Response { @@ -29,10 +28,8 @@ public sealed partial class GenerateImageIdeogramV3Response public global::System.Collections.Generic.IList? Data { get; set; } /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. ///
- /// 12345 [global::System.Text.Json.Serialization.JsonPropertyName("seed")] [global::System.Text.Json.Serialization.JsonRequired] public required int Seed { get; set; } @@ -51,8 +48,7 @@ public sealed partial class GenerateImageIdeogramV3Response /// `GET /v2/generations/{generation_id}`. /// /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. /// /// /// The generated images, in generation order. Present only for synchronous requests (`async` omitted or false). diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV3TransparentRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV3TransparentRequest.g.cs index c2fde766..f1a3c590 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV3TransparentRequest.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV3TransparentRequest.g.cs @@ -4,7 +4,7 @@ namespace Ideogram { /// - /// Example: {"aspect_ratio":null,"private":true,"seed":12345,"upscale_factor":"x1","rendering_speed":"default","webhook_url":"https://api.example.com/webhooks/ideogram","target_collection_id":"target_collection_id","num_images":1,"magic_prompt":"","async":false,"negative_prompt":"negative_prompt","enable_copyright_detection":true,"prompt":"prompt"} + /// /// public sealed partial class GenerateImageIdeogramV3TransparentRequest { @@ -22,10 +22,8 @@ public sealed partial class GenerateImageIdeogramV3TransparentRequest public string? NegativePrompt { get; set; } /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. ///
- /// 12345 [global::System.Text.Json.Serialization.JsonPropertyName("seed")] public int? Seed { get; set; } @@ -91,25 +89,11 @@ public sealed partial class GenerateImageIdeogramV3TransparentRequest /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
/// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
/// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram + /// private and loopback hosts and the cloud metadata service are rejected. /// - /// https://api.example.com/webhooks/ideogram [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] public string? WebhookUrl { get; set; } - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("target_collection_id")] - public string? TargetCollectionId { get; set; } - /// /// Additional properties that are not explicitly defined in the schema /// @@ -126,8 +110,7 @@ public sealed partial class GenerateImageIdeogramV3TransparentRequest /// Description of what to exclude from the images. The prompt takes precedence over the negative prompt. /// /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. /// /// /// Optional enhancement factor applied after generation. `x1` (the default) delivers the base render.
@@ -166,14 +149,7 @@ public sealed partial class GenerateImageIdeogramV3TransparentRequest /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
/// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
/// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. + /// private and loopback hosts and the cloud metadata service are rejected. /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -189,9 +165,7 @@ public GenerateImageIdeogramV3TransparentRequest( int? numImages, bool? enableCopyrightDetection, bool? async, - string? webhookUrl, - bool? @private, - string? targetCollectionId) + string? webhookUrl) { this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); this.NegativePrompt = negativePrompt; @@ -204,8 +178,6 @@ public GenerateImageIdeogramV3TransparentRequest( this.EnableCopyrightDetection = enableCopyrightDetection; this.Async = async; this.WebhookUrl = webhookUrl; - this.Private = @private; - this.TargetCollectionId = targetCollectionId; } /// diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV3TransparentResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV3TransparentResponse.g.cs index 85336240..b969bf1a 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV3TransparentResponse.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV3TransparentResponse.g.cs @@ -10,8 +10,7 @@ namespace Ideogram /// Asynchronous requests omit `data`; poll
/// `GET /v2/generations/{generation_id}` with the returned
/// `generation_id`. `seed` is the seed that was used, including when you
- /// did not set one.
- /// Example: {"data":[{"seed":12345,"prompt":"prompt","resolution":"1024x1024","url":"https://openapi-generator.tech","is_image_safe":true},{"seed":12345,"prompt":"prompt","resolution":"1024x1024","url":"https://openapi-generator.tech","is_image_safe":true}],"seed":12345,"generation_id":"generation_id"} + /// did not set one. ///
public sealed partial class GenerateImageIdeogramV3TransparentResponse { @@ -30,10 +29,8 @@ public sealed partial class GenerateImageIdeogramV3TransparentResponse public global::System.Collections.Generic.IList? Data { get; set; } /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. ///
- /// 12345 [global::System.Text.Json.Serialization.JsonPropertyName("seed")] [global::System.Text.Json.Serialization.JsonRequired] public required int Seed { get; set; } @@ -52,8 +49,7 @@ public sealed partial class GenerateImageIdeogramV3TransparentResponse /// `GET /v2/generations/{generation_id}`. /// /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. /// /// /// The generated images, in generation order. Present only for synchronous requests (`async` omitted or false). diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV4CustomModelRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV4CustomModelRequest.g.cs index 7bdf7203..5d5bbea6 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV4CustomModelRequest.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV4CustomModelRequest.g.cs @@ -4,7 +4,7 @@ namespace Ideogram { /// - /// Example: {"private":true,"seed":12345,"rendering_speed":"turbo","webhook_url":"https://api.example.com/webhooks/ideogram","target_collection_id":"target_collection_id","custom_model_uri":"model/my-custom-v4-model/version/1","resolution":"","transparent_background":false,"num_images":1,"magic_prompt":"","async":false,"enable_copyright_detection":true,"stacked_custom_models":[{"custom_model_uri":"model/my-base-plora/version/1","weight":0.5}],"prompt":"prompt"} + /// /// public sealed partial class GenerateImageIdeogramV4CustomModelRequest { @@ -18,10 +18,8 @@ public sealed partial class GenerateImageIdeogramV4CustomModelRequest public required string Prompt { get; set; } /// - /// The custom model URI, in the form `model/<model_name>/version/<version_name>`. You or your organization must have access to the model. The model determines which rendering speeds are supported.
- /// Example: model/my-custom-v4-model/version/1 + /// The custom model URI, in the form `model/<model_name>/version/<version_name>`. You or your organization must have access to the model. The model determines which rendering speeds are supported. ///
- /// model/my-custom-v4-model/version/1 [global::System.Text.Json.Serialization.JsonPropertyName("custom_model_uri")] [global::System.Text.Json.Serialization.JsonRequired] public required string CustomModelUri { get; set; } @@ -33,14 +31,6 @@ public sealed partial class GenerateImageIdeogramV4CustomModelRequest [global::System.Text.Json.Serialization.JsonPropertyName("transparent_background")] public bool? TransparentBackground { get; set; } - /// - /// Custom models whose pLoRA checkpoints are fused beneath the `custom_model_uri` model, in list order: the first entry is applied first and `custom_model_uri` last. Every entry must be an accessible Ideogram 4.0 LoRA with a registered checkpoint and must not repeat `custom_model_uri`.
- /// Example: [{"custom_model_uri":"model/my-base-plora/version/1","weight":0.5}] - ///
- /// [{"custom_model_uri":"model/my-base-plora/version/1","weight":0.5}] - [global::System.Text.Json.Serialization.JsonPropertyName("stacked_custom_models")] - public global::System.Collections.Generic.IList? StackedCustomModels { get; set; } - /// /// Controls how a natural-language prompt is prepared. `auto` (the
/// default) and `on` rewrite and expand the prompt before generation.
@@ -54,10 +44,8 @@ public sealed partial class GenerateImageIdeogramV4CustomModelRequest public global::Ideogram.MagicPromptMode? MagicPrompt { get; set; } /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. ///
- /// 12345 [global::System.Text.Json.Serialization.JsonPropertyName("seed")] public int? Seed { get; set; } @@ -105,25 +93,11 @@ public sealed partial class GenerateImageIdeogramV4CustomModelRequest /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
/// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
/// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram + /// private and loopback hosts and the cloud metadata service are rejected. ///
- /// https://api.example.com/webhooks/ideogram [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] public string? WebhookUrl { get; set; } - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("target_collection_id")] - public string? TargetCollectionId { get; set; } - /// /// Additional properties that are not explicitly defined in the schema /// @@ -139,17 +113,12 @@ public sealed partial class GenerateImageIdeogramV4CustomModelRequest /// used as is and skips magic prompt unless `magic_prompt` is `on`. /// /// - /// The custom model URI, in the form `model/<model_name>/version/<version_name>`. You or your organization must have access to the model. The model determines which rendering speeds are supported.
- /// Example: model/my-custom-v4-model/version/1 + /// The custom model URI, in the form `model/<model_name>/version/<version_name>`. You or your organization must have access to the model. The model determines which rendering speeds are supported. /// /// /// Remove the background after generation and return transparent PNG images. Included in the custom model generation price at no extra charge. When false, the model's automatic background removal behavior still applies.
/// Default Value: false /// - /// - /// Custom models whose pLoRA checkpoints are fused beneath the `custom_model_uri` model, in list order: the first entry is applied first and `custom_model_uri` last. Every entry must be an accessible Ideogram 4.0 LoRA with a registered checkpoint and must not repeat `custom_model_uri`.
- /// Example: [{"custom_model_uri":"model/my-base-plora/version/1","weight":0.5}] - /// /// /// Controls how a natural-language prompt is prepared. `auto` (the
/// default) and `on` rewrite and expand the prompt before generation.
@@ -159,8 +128,7 @@ public sealed partial class GenerateImageIdeogramV4CustomModelRequest /// Default Value: auto /// /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. /// /// /// The number of images to generate.
@@ -189,14 +157,7 @@ public sealed partial class GenerateImageIdeogramV4CustomModelRequest /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
/// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
/// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. + /// private and loopback hosts and the cloud metadata service are rejected. /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -205,7 +166,6 @@ public GenerateImageIdeogramV4CustomModelRequest( string prompt, string customModelUri, bool? transparentBackground, - global::System.Collections.Generic.IList? stackedCustomModels, global::Ideogram.MagicPromptMode? magicPrompt, int? seed, int? numImages, @@ -213,14 +173,11 @@ public GenerateImageIdeogramV4CustomModelRequest( global::Ideogram.GenerateImageIdeogramV4CustomModelRequestRenderingSpeed? renderingSpeed, bool? enableCopyrightDetection, bool? async, - string? webhookUrl, - bool? @private, - string? targetCollectionId) + string? webhookUrl) { this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); this.CustomModelUri = customModelUri ?? throw new global::System.ArgumentNullException(nameof(customModelUri)); this.TransparentBackground = transparentBackground; - this.StackedCustomModels = stackedCustomModels; this.MagicPrompt = magicPrompt; this.Seed = seed; this.NumImages = numImages; @@ -229,8 +186,6 @@ public GenerateImageIdeogramV4CustomModelRequest( this.EnableCopyrightDetection = enableCopyrightDetection; this.Async = async; this.WebhookUrl = webhookUrl; - this.Private = @private; - this.TargetCollectionId = targetCollectionId; } /// diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV4CustomModelResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV4CustomModelResponse.g.cs index ec76f901..e45a2b14 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV4CustomModelResponse.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV4CustomModelResponse.g.cs @@ -9,8 +9,7 @@ namespace Ideogram /// `data`. Asynchronous requests omit `data`; poll
/// `GET /v2/generations/{generation_id}` with the returned
/// `generation_id`. `seed` is the seed that was used, including when you
- /// did not set one.
- /// Example: {"data":[{"seed":12345,"prompt":"prompt","resolution":"1024x1024","url":"https://openapi-generator.tech","is_image_safe":true},{"seed":12345,"prompt":"prompt","resolution":"1024x1024","url":"https://openapi-generator.tech","is_image_safe":true}],"seed":12345,"generation_id":"generation_id"} + /// did not set one. ///
public sealed partial class GenerateImageIdeogramV4CustomModelResponse { @@ -29,10 +28,8 @@ public sealed partial class GenerateImageIdeogramV4CustomModelResponse public global::System.Collections.Generic.IList? Data { get; set; } /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. ///
- /// 12345 [global::System.Text.Json.Serialization.JsonPropertyName("seed")] [global::System.Text.Json.Serialization.JsonRequired] public required int Seed { get; set; } @@ -51,8 +48,7 @@ public sealed partial class GenerateImageIdeogramV4CustomModelResponse /// `GET /v2/generations/{generation_id}`. /// /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. /// /// /// The generated images, in generation order. Present only for synchronous requests (`async` omitted or false). diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV4Request.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV4Request.g.cs index 948ae020..3e4141e7 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV4Request.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV4Request.g.cs @@ -4,7 +4,7 @@ namespace Ideogram { /// - /// Example: {"magic_prompt":"","async":false,"private":true,"seed":12345,"rendering_speed":"default","webhook_url":"https://api.example.com/webhooks/ideogram","enable_copyright_detection":true,"target_collection_id":"target_collection_id","prompt":"prompt","resolution":"","num_images":1} + /// /// public sealed partial class GenerateImageIdeogramV4Request { @@ -30,10 +30,8 @@ public sealed partial class GenerateImageIdeogramV4Request public global::Ideogram.MagicPromptMode? MagicPrompt { get; set; } /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. ///
- /// 12345 [global::System.Text.Json.Serialization.JsonPropertyName("seed")] public int? Seed { get; set; } @@ -82,25 +80,11 @@ public sealed partial class GenerateImageIdeogramV4Request /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
/// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
/// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram + /// private and loopback hosts and the cloud metadata service are rejected. /// - /// https://api.example.com/webhooks/ideogram [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] public string? WebhookUrl { get; set; } - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("target_collection_id")] - public string? TargetCollectionId { get; set; } - /// /// Additional properties that are not explicitly defined in the schema /// @@ -124,8 +108,7 @@ public sealed partial class GenerateImageIdeogramV4Request /// Default Value: auto /// /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. /// /// /// The number of images to generate.
@@ -155,14 +138,7 @@ public sealed partial class GenerateImageIdeogramV4Request /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
/// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
/// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. + /// private and loopback hosts and the cloud metadata service are rejected. /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -176,9 +152,7 @@ public GenerateImageIdeogramV4Request( global::Ideogram.GenerateImageIdeogramV4RequestRenderingSpeed? renderingSpeed, bool? enableCopyrightDetection, bool? async, - string? webhookUrl, - bool? @private, - string? targetCollectionId) + string? webhookUrl) { this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); this.MagicPrompt = magicPrompt; @@ -189,8 +163,6 @@ public GenerateImageIdeogramV4Request( this.EnableCopyrightDetection = enableCopyrightDetection; this.Async = async; this.WebhookUrl = webhookUrl; - this.Private = @private; - this.TargetCollectionId = targetCollectionId; } /// diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV4Response.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV4Response.g.cs index c5033b90..3692f592 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV4Response.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV4Response.g.cs @@ -9,8 +9,7 @@ namespace Ideogram /// `data`. Asynchronous requests omit `data`; poll
/// `GET /v2/generations/{generation_id}` with the returned
/// `generation_id`. `seed` is the seed that was used, including when you
- /// did not set one.
- /// Example: {"data":[{"seed":12345,"prompt":"prompt","resolution":"1024x1024","url":"https://openapi-generator.tech","is_image_safe":true},{"seed":12345,"prompt":"prompt","resolution":"1024x1024","url":"https://openapi-generator.tech","is_image_safe":true}],"seed":12345,"generation_id":"generation_id"} + /// did not set one. ///
public sealed partial class GenerateImageIdeogramV4Response { @@ -29,10 +28,8 @@ public sealed partial class GenerateImageIdeogramV4Response public global::System.Collections.Generic.IList? Data { get; set; } /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. ///
- /// 12345 [global::System.Text.Json.Serialization.JsonPropertyName("seed")] [global::System.Text.Json.Serialization.JsonRequired] public required int Seed { get; set; } @@ -51,8 +48,7 @@ public sealed partial class GenerateImageIdeogramV4Response /// `GET /v2/generations/{generation_id}`. /// /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. /// /// /// The generated images, in generation order. Present only for synchronous requests (`async` omitted or false). diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV4TransparentRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV4TransparentRequest.g.cs index bee47ff7..6698ae1c 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV4TransparentRequest.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV4TransparentRequest.g.cs @@ -4,7 +4,7 @@ namespace Ideogram { /// - /// Example: {"magic_prompt":"","aspect_ratio":null,"async":false,"private":true,"seed":12345,"rendering_speed":"default","webhook_url":"https://api.example.com/webhooks/ideogram","enable_copyright_detection":true,"target_collection_id":"target_collection_id","output_resolution":"1k","prompt":"prompt","num_images":1} + /// /// public sealed partial class GenerateImageIdeogramV4TransparentRequest { @@ -31,10 +31,8 @@ public sealed partial class GenerateImageIdeogramV4TransparentRequest public global::Ideogram.MagicPromptMode? MagicPrompt { get; set; } /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. ///
- /// 12345 [global::System.Text.Json.Serialization.JsonPropertyName("seed")] public int? Seed { get; set; } @@ -95,25 +93,11 @@ public sealed partial class GenerateImageIdeogramV4TransparentRequest /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
/// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
/// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram + /// private and loopback hosts and the cloud metadata service are rejected. /// - /// https://api.example.com/webhooks/ideogram [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] public string? WebhookUrl { get; set; } - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("target_collection_id")] - public string? TargetCollectionId { get; set; } - /// /// Additional properties that are not explicitly defined in the schema /// @@ -138,8 +122,7 @@ public sealed partial class GenerateImageIdeogramV4TransparentRequest /// Default Value: auto /// /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. /// /// /// The number of images to generate.
@@ -177,14 +160,7 @@ public sealed partial class GenerateImageIdeogramV4TransparentRequest /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
/// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
/// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. + /// private and loopback hosts and the cloud metadata service are rejected. /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -199,9 +175,7 @@ public GenerateImageIdeogramV4TransparentRequest( global::Ideogram.GenerateImageIdeogramV4TransparentRequestRenderingSpeed? renderingSpeed, bool? enableCopyrightDetection, bool? async, - string? webhookUrl, - bool? @private, - string? targetCollectionId) + string? webhookUrl) { this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); this.MagicPrompt = magicPrompt; @@ -213,8 +187,6 @@ public GenerateImageIdeogramV4TransparentRequest( this.EnableCopyrightDetection = enableCopyrightDetection; this.Async = async; this.WebhookUrl = webhookUrl; - this.Private = @private; - this.TargetCollectionId = targetCollectionId; } /// diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV4TransparentResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV4TransparentResponse.g.cs index 855e5389..d22037bc 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV4TransparentResponse.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageIdeogramV4TransparentResponse.g.cs @@ -10,8 +10,7 @@ namespace Ideogram /// Asynchronous requests omit `data`; poll
/// `GET /v2/generations/{generation_id}` with the returned
/// `generation_id`. `seed` is the seed that was used, including when you
- /// did not set one.
- /// Example: {"data":[{"seed":12345,"prompt":"prompt","resolution":"1024x1024","url":"https://openapi-generator.tech","is_image_safe":true},{"seed":12345,"prompt":"prompt","resolution":"1024x1024","url":"https://openapi-generator.tech","is_image_safe":true}],"seed":12345,"generation_id":"generation_id"} + /// did not set one. ///
public sealed partial class GenerateImageIdeogramV4TransparentResponse { @@ -30,10 +29,8 @@ public sealed partial class GenerateImageIdeogramV4TransparentResponse public global::System.Collections.Generic.IList? Data { get; set; } /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. ///
- /// 12345 [global::System.Text.Json.Serialization.JsonPropertyName("seed")] [global::System.Text.Json.Serialization.JsonRequired] public required int Seed { get; set; } @@ -52,8 +49,7 @@ public sealed partial class GenerateImageIdeogramV4TransparentResponse /// `GET /v2/generations/{generation_id}`. /// /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. /// /// /// The generated images, in generation order. Present only for synchronous requests (`async` omitted or false). diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageNanoBanana21Request.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageNanoBanana21Request.Json.g.cs deleted file mode 100644 index 340b7c8a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageNanoBanana21Request.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class GenerateImageNanoBanana21Request - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.GenerateImageNanoBanana21Request? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.GenerateImageNanoBanana21Request), - jsonSerializerContext) as global::Ideogram.GenerateImageNanoBanana21Request; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.GenerateImageNanoBanana21Request? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.GenerateImageNanoBanana21Request? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.GenerateImageNanoBanana21Request), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GenerateImageNanoBanana21Request; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageNanoBanana21Request.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageNanoBanana21Request.g.cs deleted file mode 100644 index f38106e5..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageNanoBanana21Request.g.cs +++ /dev/null @@ -1,189 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Source `images` are optional. When supplied, the prompt is applied to
- /// them as an edit. Without source images, the output is generated from
- /// the prompt alone. - ///
- public sealed partial class GenerateImageNanoBanana21Request - { - /// - /// The prompt to generate images from, or the edit instruction to apply when source images are supplied. It is passed to the model as written. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Prompt { get; set; } - - /// - /// Existing upload or generated image assets to edit, by reference. Takes priority over `images` if both are supplied. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image_asset_identifiers")] - public global::System.Collections.Generic.IList? ImageAssetIdentifiers { get; set; } - - /// - /// Optional source images to edit (max 10, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("images")] - public global::System.Collections.Generic.IList? Images { get; set; } - - /// - /// Output aspect ratios Nano Banana 2.1 serves. `auto` lets the model choose the shape; an edit keeps its source image's shape.
- /// Default Value: auto - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.NanoBanana21AspectRatioJsonConverter))] - public global::Ideogram.NanoBanana21AspectRatio? AspectRatio { get; set; } - - /// - /// The output resolution tier.
- /// Default Value: 1K - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("resolution_tier")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.GenerateImageNanoBanana21RequestResolutionTierJsonConverter))] - public global::Ideogram.GenerateImageNanoBanana21RequestResolutionTier? ResolutionTier { get; set; } - - /// - /// The number of images to generate.
- /// Default Value: 1 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] - public int? NumImages { get; set; } - - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - ///
- /// 12345 - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("async")] - public bool? Async { get; set; } - - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - ///
- /// https://api.example.com/webhooks/ideogram - [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] - public string? WebhookUrl { get; set; } - - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("target_collection_id")] - public string? TargetCollectionId { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The prompt to generate images from, or the edit instruction to apply when source images are supplied. It is passed to the model as written. - /// - /// - /// Existing upload or generated image assets to edit, by reference. Takes priority over `images` if both are supplied. - /// - /// - /// Optional source images to edit (max 10, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only. - /// - /// - /// Output aspect ratios Nano Banana 2.1 serves. `auto` lets the model choose the shape; an edit keeps its source image's shape.
- /// Default Value: auto - /// - /// - /// The output resolution tier.
- /// Default Value: 1K - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public GenerateImageNanoBanana21Request( - string prompt, - global::System.Collections.Generic.IList? imageAssetIdentifiers, - global::System.Collections.Generic.IList? images, - global::Ideogram.NanoBanana21AspectRatio? aspectRatio, - global::Ideogram.GenerateImageNanoBanana21RequestResolutionTier? resolutionTier, - int? numImages, - int? seed, - bool? async, - string? webhookUrl, - bool? @private, - string? targetCollectionId) - { - this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); - this.ImageAssetIdentifiers = imageAssetIdentifiers; - this.Images = images; - this.AspectRatio = aspectRatio; - this.ResolutionTier = resolutionTier; - this.NumImages = numImages; - this.Seed = seed; - this.Async = async; - this.WebhookUrl = webhookUrl; - this.Private = @private; - this.TargetCollectionId = targetCollectionId; - } - - /// - /// Initializes a new instance of the class. - /// - public GenerateImageNanoBanana21Request() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageNanoBanana21RequestResolutionTier.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageNanoBanana21RequestResolutionTier.g.cs deleted file mode 100644 index c3a4ca32..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageNanoBanana21RequestResolutionTier.g.cs +++ /dev/null @@ -1,58 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The output resolution tier.
- /// Default Value: 1K - ///
- public enum GenerateImageNanoBanana21RequestResolutionTier - { - /// - /// - /// - x1k, - /// - /// - /// - x2k, - /// - /// - /// - x4k, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class GenerateImageNanoBanana21RequestResolutionTierExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this GenerateImageNanoBanana21RequestResolutionTier value) - { - return value switch - { - GenerateImageNanoBanana21RequestResolutionTier.x1k => "1K", - GenerateImageNanoBanana21RequestResolutionTier.x2k => "2K", - GenerateImageNanoBanana21RequestResolutionTier.x4k => "4K", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static GenerateImageNanoBanana21RequestResolutionTier? ToEnum(string value) - { - return value switch - { - "1K" => GenerateImageNanoBanana21RequestResolutionTier.x1k, - "2K" => GenerateImageNanoBanana21RequestResolutionTier.x2k, - "4K" => GenerateImageNanoBanana21RequestResolutionTier.x4k, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageNanoBanana21Response.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageNanoBanana21Response.g.cs index 3bd60593..8a486eb8 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageNanoBanana21Response.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageNanoBanana21Response.g.cs @@ -9,8 +9,7 @@ namespace Ideogram /// `data`. Asynchronous requests omit `data`; poll
/// `GET /v2/generations/{generation_id}` with the returned
/// `generation_id`. `seed` is the seed that was used, including when you
- /// did not set one.
- /// Example: {"data":[{"seed":12345,"prompt":"prompt","resolution":"1024x1024","url":"https://openapi-generator.tech","is_image_safe":true},{"seed":12345,"prompt":"prompt","resolution":"1024x1024","url":"https://openapi-generator.tech","is_image_safe":true}],"seed":12345,"generation_id":"generation_id"} + /// did not set one. /// public sealed partial class GenerateImageNanoBanana21Response { @@ -29,10 +28,8 @@ public sealed partial class GenerateImageNanoBanana21Response public global::System.Collections.Generic.IList? Data { get; set; } /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. ///
- /// 12345 [global::System.Text.Json.Serialization.JsonPropertyName("seed")] [global::System.Text.Json.Serialization.JsonRequired] public required int Seed { get; set; } @@ -51,8 +48,7 @@ public sealed partial class GenerateImageNanoBanana21Response /// `GET /v2/generations/{generation_id}`. /// /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. /// /// /// The generated images, in generation order. Present only for synchronous requests (`async` omitted or false). diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageNanoBanana2Request.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageNanoBanana2Request.Json.g.cs deleted file mode 100644 index 321845b3..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageNanoBanana2Request.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class GenerateImageNanoBanana2Request - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.GenerateImageNanoBanana2Request? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.GenerateImageNanoBanana2Request), - jsonSerializerContext) as global::Ideogram.GenerateImageNanoBanana2Request; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.GenerateImageNanoBanana2Request? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.GenerateImageNanoBanana2Request? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.GenerateImageNanoBanana2Request), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GenerateImageNanoBanana2Request; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageNanoBanana2Request.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageNanoBanana2Request.g.cs deleted file mode 100644 index cdb7aeb4..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageNanoBanana2Request.g.cs +++ /dev/null @@ -1,189 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Source `images` are optional. When supplied, the prompt is applied to
- /// them as an edit. Without source images, the output is generated from
- /// the prompt alone. - ///
- public sealed partial class GenerateImageNanoBanana2Request - { - /// - /// The prompt to generate images from, or the edit instruction to apply when source images are supplied. It is passed to the model as written. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Prompt { get; set; } - - /// - /// Existing upload or generated image assets to edit, by reference. Takes priority over `images` if both are supplied. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image_asset_identifiers")] - public global::System.Collections.Generic.IList? ImageAssetIdentifiers { get; set; } - - /// - /// Optional source images to edit (max 10, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("images")] - public global::System.Collections.Generic.IList? Images { get; set; } - - /// - /// Output aspect ratios Nano Banana 2 serves. `auto` lets the model choose the shape; an edit keeps its source image's shape.
- /// Default Value: auto - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.NanoBanana2AspectRatioJsonConverter))] - public global::Ideogram.NanoBanana2AspectRatio? AspectRatio { get; set; } - - /// - /// The output resolution tier.
- /// Default Value: 1K - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("resolution_tier")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.GenerateImageNanoBanana2RequestResolutionTierJsonConverter))] - public global::Ideogram.GenerateImageNanoBanana2RequestResolutionTier? ResolutionTier { get; set; } - - /// - /// The number of images to generate.
- /// Default Value: 1 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] - public int? NumImages { get; set; } - - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - ///
- /// 12345 - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("async")] - public bool? Async { get; set; } - - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - ///
- /// https://api.example.com/webhooks/ideogram - [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] - public string? WebhookUrl { get; set; } - - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("target_collection_id")] - public string? TargetCollectionId { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The prompt to generate images from, or the edit instruction to apply when source images are supplied. It is passed to the model as written. - /// - /// - /// Existing upload or generated image assets to edit, by reference. Takes priority over `images` if both are supplied. - /// - /// - /// Optional source images to edit (max 10, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only. - /// - /// - /// Output aspect ratios Nano Banana 2 serves. `auto` lets the model choose the shape; an edit keeps its source image's shape.
- /// Default Value: auto - /// - /// - /// The output resolution tier.
- /// Default Value: 1K - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public GenerateImageNanoBanana2Request( - string prompt, - global::System.Collections.Generic.IList? imageAssetIdentifiers, - global::System.Collections.Generic.IList? images, - global::Ideogram.NanoBanana2AspectRatio? aspectRatio, - global::Ideogram.GenerateImageNanoBanana2RequestResolutionTier? resolutionTier, - int? numImages, - int? seed, - bool? async, - string? webhookUrl, - bool? @private, - string? targetCollectionId) - { - this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); - this.ImageAssetIdentifiers = imageAssetIdentifiers; - this.Images = images; - this.AspectRatio = aspectRatio; - this.ResolutionTier = resolutionTier; - this.NumImages = numImages; - this.Seed = seed; - this.Async = async; - this.WebhookUrl = webhookUrl; - this.Private = @private; - this.TargetCollectionId = targetCollectionId; - } - - /// - /// Initializes a new instance of the class. - /// - public GenerateImageNanoBanana2Request() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageNanoBanana2RequestResolutionTier.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageNanoBanana2RequestResolutionTier.g.cs deleted file mode 100644 index d53569eb..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageNanoBanana2RequestResolutionTier.g.cs +++ /dev/null @@ -1,58 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The output resolution tier.
- /// Default Value: 1K - ///
- public enum GenerateImageNanoBanana2RequestResolutionTier - { - /// - /// - /// - x1k, - /// - /// - /// - x2k, - /// - /// - /// - x4k, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class GenerateImageNanoBanana2RequestResolutionTierExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this GenerateImageNanoBanana2RequestResolutionTier value) - { - return value switch - { - GenerateImageNanoBanana2RequestResolutionTier.x1k => "1K", - GenerateImageNanoBanana2RequestResolutionTier.x2k => "2K", - GenerateImageNanoBanana2RequestResolutionTier.x4k => "4K", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static GenerateImageNanoBanana2RequestResolutionTier? ToEnum(string value) - { - return value switch - { - "1K" => GenerateImageNanoBanana2RequestResolutionTier.x1k, - "2K" => GenerateImageNanoBanana2RequestResolutionTier.x2k, - "4K" => GenerateImageNanoBanana2RequestResolutionTier.x4k, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageNanoBanana2Response.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageNanoBanana2Response.g.cs index 64306f35..bd8ae8a3 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageNanoBanana2Response.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageNanoBanana2Response.g.cs @@ -9,8 +9,7 @@ namespace Ideogram /// `data`. Asynchronous requests omit `data`; poll
/// `GET /v2/generations/{generation_id}` with the returned
/// `generation_id`. `seed` is the seed that was used, including when you
- /// did not set one.
- /// Example: {"data":[{"seed":12345,"prompt":"prompt","resolution":"1024x1024","url":"https://openapi-generator.tech","is_image_safe":true},{"seed":12345,"prompt":"prompt","resolution":"1024x1024","url":"https://openapi-generator.tech","is_image_safe":true}],"seed":12345,"generation_id":"generation_id"} + /// did not set one. /// public sealed partial class GenerateImageNanoBanana2Response { @@ -29,10 +28,8 @@ public sealed partial class GenerateImageNanoBanana2Response public global::System.Collections.Generic.IList? Data { get; set; } /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. ///
- /// 12345 [global::System.Text.Json.Serialization.JsonPropertyName("seed")] [global::System.Text.Json.Serialization.JsonRequired] public required int Seed { get; set; } @@ -51,8 +48,7 @@ public sealed partial class GenerateImageNanoBanana2Response /// `GET /v2/generations/{generation_id}`. /// /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. /// /// /// The generated images, in generation order. Present only for synchronous requests (`async` omitted or false). diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageNanoBananaProRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageNanoBananaProRequest.Json.g.cs deleted file mode 100644 index 8ef38bd7..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageNanoBananaProRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class GenerateImageNanoBananaProRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.GenerateImageNanoBananaProRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.GenerateImageNanoBananaProRequest), - jsonSerializerContext) as global::Ideogram.GenerateImageNanoBananaProRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.GenerateImageNanoBananaProRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.GenerateImageNanoBananaProRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.GenerateImageNanoBananaProRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GenerateImageNanoBananaProRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageNanoBananaProRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageNanoBananaProRequest.g.cs deleted file mode 100644 index 8ae63fe2..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageNanoBananaProRequest.g.cs +++ /dev/null @@ -1,189 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Source `images` are optional. When supplied, the prompt is applied to
- /// them as an edit. Without source images, the output is generated from
- /// the prompt alone. - ///
- public sealed partial class GenerateImageNanoBananaProRequest - { - /// - /// The prompt to generate images from, or the edit instruction to apply when source images are supplied. It is passed to the model as written. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Prompt { get; set; } - - /// - /// Existing upload or generated image assets to edit, by reference. Takes priority over `images` if both are supplied. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image_asset_identifiers")] - public global::System.Collections.Generic.IList? ImageAssetIdentifiers { get; set; } - - /// - /// Optional source images to edit (max 10, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("images")] - public global::System.Collections.Generic.IList? Images { get; set; } - - /// - /// Output aspect ratios Nano Banana Pro serves. `auto` lets the model choose the shape; an edit keeps its source image's shape.
- /// Default Value: auto - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.NanoBananaProAspectRatioJsonConverter))] - public global::Ideogram.NanoBananaProAspectRatio? AspectRatio { get; set; } - - /// - /// The output resolution tier.
- /// Default Value: 1K - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("resolution_tier")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.GenerateImageNanoBananaProRequestResolutionTierJsonConverter))] - public global::Ideogram.GenerateImageNanoBananaProRequestResolutionTier? ResolutionTier { get; set; } - - /// - /// The number of images to generate.
- /// Default Value: 1 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] - public int? NumImages { get; set; } - - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - ///
- /// 12345 - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("async")] - public bool? Async { get; set; } - - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - ///
- /// https://api.example.com/webhooks/ideogram - [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] - public string? WebhookUrl { get; set; } - - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("target_collection_id")] - public string? TargetCollectionId { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The prompt to generate images from, or the edit instruction to apply when source images are supplied. It is passed to the model as written. - /// - /// - /// Existing upload or generated image assets to edit, by reference. Takes priority over `images` if both are supplied. - /// - /// - /// Optional source images to edit (max 10, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only. - /// - /// - /// Output aspect ratios Nano Banana Pro serves. `auto` lets the model choose the shape; an edit keeps its source image's shape.
- /// Default Value: auto - /// - /// - /// The output resolution tier.
- /// Default Value: 1K - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public GenerateImageNanoBananaProRequest( - string prompt, - global::System.Collections.Generic.IList? imageAssetIdentifiers, - global::System.Collections.Generic.IList? images, - global::Ideogram.NanoBananaProAspectRatio? aspectRatio, - global::Ideogram.GenerateImageNanoBananaProRequestResolutionTier? resolutionTier, - int? numImages, - int? seed, - bool? async, - string? webhookUrl, - bool? @private, - string? targetCollectionId) - { - this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); - this.ImageAssetIdentifiers = imageAssetIdentifiers; - this.Images = images; - this.AspectRatio = aspectRatio; - this.ResolutionTier = resolutionTier; - this.NumImages = numImages; - this.Seed = seed; - this.Async = async; - this.WebhookUrl = webhookUrl; - this.Private = @private; - this.TargetCollectionId = targetCollectionId; - } - - /// - /// Initializes a new instance of the class. - /// - public GenerateImageNanoBananaProRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageNanoBananaProRequestResolutionTier.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageNanoBananaProRequestResolutionTier.g.cs deleted file mode 100644 index 5379e332..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageNanoBananaProRequestResolutionTier.g.cs +++ /dev/null @@ -1,58 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The output resolution tier.
- /// Default Value: 1K - ///
- public enum GenerateImageNanoBananaProRequestResolutionTier - { - /// - /// - /// - x1k, - /// - /// - /// - x2k, - /// - /// - /// - x4k, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class GenerateImageNanoBananaProRequestResolutionTierExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this GenerateImageNanoBananaProRequestResolutionTier value) - { - return value switch - { - GenerateImageNanoBananaProRequestResolutionTier.x1k => "1K", - GenerateImageNanoBananaProRequestResolutionTier.x2k => "2K", - GenerateImageNanoBananaProRequestResolutionTier.x4k => "4K", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static GenerateImageNanoBananaProRequestResolutionTier? ToEnum(string value) - { - return value switch - { - "1K" => GenerateImageNanoBananaProRequestResolutionTier.x1k, - "2K" => GenerateImageNanoBananaProRequestResolutionTier.x2k, - "4K" => GenerateImageNanoBananaProRequestResolutionTier.x4k, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageNanoBananaProResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageNanoBananaProResponse.g.cs index d72c068e..e4db478e 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageNanoBananaProResponse.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageNanoBananaProResponse.g.cs @@ -9,8 +9,7 @@ namespace Ideogram /// `data`. Asynchronous requests omit `data`; poll
/// `GET /v2/generations/{generation_id}` with the returned
/// `generation_id`. `seed` is the seed that was used, including when you
- /// did not set one.
- /// Example: {"data":[{"seed":12345,"prompt":"prompt","resolution":"1024x1024","url":"https://openapi-generator.tech","is_image_safe":true},{"seed":12345,"prompt":"prompt","resolution":"1024x1024","url":"https://openapi-generator.tech","is_image_safe":true}],"seed":12345,"generation_id":"generation_id"} + /// did not set one. /// public sealed partial class GenerateImageNanoBananaProResponse { @@ -29,10 +28,8 @@ public sealed partial class GenerateImageNanoBananaProResponse public global::System.Collections.Generic.IList? Data { get; set; } /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. ///
- /// 12345 [global::System.Text.Json.Serialization.JsonPropertyName("seed")] [global::System.Text.Json.Serialization.JsonRequired] public required int Seed { get; set; } @@ -51,8 +48,7 @@ public sealed partial class GenerateImageNanoBananaProResponse /// `GET /v2/generations/{generation_id}`. /// /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. /// /// /// The generated images, in generation order. Present only for synchronous requests (`async` omitted or false). diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImagePImageIdeogramRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImagePImageIdeogramRequest.g.cs index 569d98db..267378db 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImagePImageIdeogramRequest.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImagePImageIdeogramRequest.g.cs @@ -4,7 +4,7 @@ namespace Ideogram { /// - /// Example: {"aspect_ratio":"","custom_height":1,"private":true,"seed":12345,"webhook_url":"https://api.example.com/webhooks/ideogram","custom_width":6,"target_collection_id":"target_collection_id","resolution":"1k","num_images":1,"quality":"","magic_prompt":"","async":false,"enable_copyright_detection":true,"prompt":"prompt"} + /// /// public sealed partial class GenerateImagePImageIdeogramRequest { @@ -25,10 +25,8 @@ public sealed partial class GenerateImagePImageIdeogramRequest public global::Ideogram.MagicPromptMode? MagicPrompt { get; set; } /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. ///
- /// 12345 [global::System.Text.Json.Serialization.JsonPropertyName("seed")] public int? Seed { get; set; } @@ -51,7 +49,6 @@ public sealed partial class GenerateImagePImageIdeogramRequest /// The output size tier. Defaults to `1k`. Cannot be combined with `custom_width`/`custom_height`. /// [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.GenerateImagePImageIdeogramRequestResolutionJsonConverter))] public global::Ideogram.GenerateImagePImageIdeogramRequestResolution? Resolution { get; set; } /// @@ -103,25 +100,11 @@ public sealed partial class GenerateImagePImageIdeogramRequest /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
/// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
/// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram + /// private and loopback hosts and the cloud metadata service are rejected. ///
- /// https://api.example.com/webhooks/ideogram [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] public string? WebhookUrl { get; set; } - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("target_collection_id")] - public string? TargetCollectionId { get; set; } - /// /// Additional properties that are not explicitly defined in the schema /// @@ -140,8 +123,7 @@ public sealed partial class GenerateImagePImageIdeogramRequest /// Default Value: auto /// /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. /// /// /// The number of images to generate.
@@ -187,14 +169,7 @@ public sealed partial class GenerateImagePImageIdeogramRequest /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
/// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
/// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. + /// private and loopback hosts and the cloud metadata service are rejected. /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -211,9 +186,7 @@ public GenerateImagePImageIdeogramRequest( int? customHeight, bool? enableCopyrightDetection, bool? async, - string? webhookUrl, - bool? @private, - string? targetCollectionId) + string? webhookUrl) { this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); this.MagicPrompt = magicPrompt; @@ -227,8 +200,6 @@ public GenerateImagePImageIdeogramRequest( this.EnableCopyrightDetection = enableCopyrightDetection; this.Async = async; this.WebhookUrl = webhookUrl; - this.Private = @private; - this.TargetCollectionId = targetCollectionId; } /// diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImagePImageIdeogramResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImagePImageIdeogramResponse.g.cs index 0d47bc2b..9e8b2c21 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImagePImageIdeogramResponse.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImagePImageIdeogramResponse.g.cs @@ -9,8 +9,7 @@ namespace Ideogram /// `data`. Asynchronous requests omit `data`; poll
/// `GET /v2/generations/{generation_id}` with the returned
/// `generation_id`. `seed` is the seed that was used, including when you
- /// did not set one.
- /// Example: {"data":[{"seed":12345,"prompt":"prompt","resolution":"1024x1024","url":"https://openapi-generator.tech","is_image_safe":true},{"seed":12345,"prompt":"prompt","resolution":"1024x1024","url":"https://openapi-generator.tech","is_image_safe":true}],"seed":12345,"generation_id":"generation_id"} + /// did not set one. ///
public sealed partial class GenerateImagePImageIdeogramResponse { @@ -29,10 +28,8 @@ public sealed partial class GenerateImagePImageIdeogramResponse public global::System.Collections.Generic.IList? Data { get; set; } /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. ///
- /// 12345 [global::System.Text.Json.Serialization.JsonPropertyName("seed")] [global::System.Text.Json.Serialization.JsonRequired] public required int Seed { get; set; } @@ -51,8 +48,7 @@ public sealed partial class GenerateImagePImageIdeogramResponse /// `GET /v2/generations/{generation_id}`. /// /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. /// /// /// The generated images, in generation order. Present only for synchronous requests (`async` omitted or false). diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequest.Json.g.cs deleted file mode 100644 index 22d418db..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class GenerateImageRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.GenerateImageRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.GenerateImageRequest), - jsonSerializerContext) as global::Ideogram.GenerateImageRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.GenerateImageRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.GenerateImageRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.GenerateImageRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GenerateImageRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequest.g.cs deleted file mode 100644 index 1a4b76f2..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequest.g.cs +++ /dev/null @@ -1,48 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"image_request":{"aspect_ratio":"ASPECT_10_16","magic_prompt_option":"AUTO","model":"V_2","prompt":"A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there is an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset."}} - /// - public sealed partial class GenerateImageRequest - { - /// - /// Example: {"aspect_ratio":"ASPECT_10_16","magic_prompt_option":"AUTO","model":"V_2","prompt":"A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there is an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset."} - /// - /// {"aspect_ratio":"ASPECT_10_16","magic_prompt_option":"AUTO","model":"V_2","prompt":"A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there is an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset."} - [global::System.Text.Json.Serialization.JsonPropertyName("image_request")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.ImageRequest ImageRequest { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Example: {"aspect_ratio":"ASPECT_10_16","magic_prompt_option":"AUTO","model":"V_2","prompt":"A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there is an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset."} - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public GenerateImageRequest( - global::Ideogram.ImageRequest imageRequest) - { - this.ImageRequest = imageRequest ?? throw new global::System.ArgumentNullException(nameof(imageRequest)); - } - - /// - /// Initializes a new instance of the class. - /// - public GenerateImageRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestErnie.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestErnie.Json.g.cs deleted file mode 100644 index 27cd438a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestErnie.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class GenerateImageRequestErnie - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.GenerateImageRequestErnie? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.GenerateImageRequestErnie), - jsonSerializerContext) as global::Ideogram.GenerateImageRequestErnie; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.GenerateImageRequestErnie? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.GenerateImageRequestErnie? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.GenerateImageRequestErnie), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GenerateImageRequestErnie; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestErnie.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestErnie.g.cs deleted file mode 100644 index ea0d0233..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestErnie.g.cs +++ /dev/null @@ -1,163 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Request body for the ERNIE-Image-Turbo generate endpoint. The base
- /// model is pinned server-side; supply `custom_model_uri` to layer a
- /// registered ERNIE LoRA finetune on the base.
- /// Width and height must each be a positive multiple of 16; the total
- /// area must not exceed 1,075,200 pixels (896×1200). When `width` and
- /// `height` are omitted, the server uses the model's default 1024×1024. - ///
- public sealed partial class GenerateImageRequestErnie - { - /// - /// A natural-language prompt for image generation.
- /// Example: A poster with bold typography reading "GRAND OPENING", art deco style. - ///
- /// A poster with bold typography reading "GRAND OPENING", art deco style. - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Prompt { get; set; } - - /// - /// An optional system prompt applied alongside the prompt — use it for
- /// standing instructions such as style constraints or "do not render
- /// text". When omitted, no system prompt is applied. If you trained a
- /// LoRA with a system prompt, supply the same one here for best results.
- /// Example: Do not include any text in the image. - ///
- /// Do not include any text in the image. - [global::System.Text.Json.Serialization.JsonPropertyName("system_prompt")] - public string? SystemPrompt { get; set; } - - /// - /// Output width in pixels; must be a positive multiple of 16.
- /// Example: 1024 - ///
- /// 1024 - [global::System.Text.Json.Serialization.JsonPropertyName("width")] - public int? Width { get; set; } - - /// - /// Output height in pixels; must be a positive multiple of 16.
- /// Example: 1024 - ///
- /// 1024 - [global::System.Text.Json.Serialization.JsonPropertyName("height")] - public int? Height { get; set; } - - /// - /// Optional diffusion step count. When omitted, the server uses the
- /// model's default. Higher values trade latency for quality.
- /// Example: 8 - ///
- /// 8 - [global::System.Text.Json.Serialization.JsonPropertyName("num_inference_steps")] - public int? NumInferenceSteps { get; set; } - - /// - /// Random seed for reproducibility. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// Number of images to generate.
- /// Default Value: 1 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] - public int? NumImages { get; set; } - - /// - /// A custom model URI in the format model/<model_name>/version/<version_name>.
- /// When provided, the URI must resolve to a registered fine-tune of the
- /// ERNIE base model; the fine-tune's LoRA checkpoint is layered on the
- /// base. When omitted, the ERNIE base is used with no LoRA.
- /// Example: model/my-ernie-lora/version/0 - ///
- /// model/my-ernie-lora/version/0 - [global::System.Text.Json.Serialization.JsonPropertyName("custom_model_uri")] - public string? CustomModelUri { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// A natural-language prompt for image generation.
- /// Example: A poster with bold typography reading "GRAND OPENING", art deco style. - /// - /// - /// An optional system prompt applied alongside the prompt — use it for
- /// standing instructions such as style constraints or "do not render
- /// text". When omitted, no system prompt is applied. If you trained a
- /// LoRA with a system prompt, supply the same one here for best results.
- /// Example: Do not include any text in the image. - /// - /// - /// Output width in pixels; must be a positive multiple of 16.
- /// Example: 1024 - /// - /// - /// Output height in pixels; must be a positive multiple of 16.
- /// Example: 1024 - /// - /// - /// Optional diffusion step count. When omitted, the server uses the
- /// model's default. Higher values trade latency for quality.
- /// Example: 8 - /// - /// - /// Random seed for reproducibility. - /// - /// - /// Number of images to generate.
- /// Default Value: 1 - /// - /// - /// A custom model URI in the format model/<model_name>/version/<version_name>.
- /// When provided, the URI must resolve to a registered fine-tune of the
- /// ERNIE base model; the fine-tune's LoRA checkpoint is layered on the
- /// base. When omitted, the ERNIE base is used with no LoRA.
- /// Example: model/my-ernie-lora/version/0 - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public GenerateImageRequestErnie( - string prompt, - string? systemPrompt, - int? width, - int? height, - int? numInferenceSteps, - int? seed, - int? numImages, - string? customModelUri) - { - this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); - this.SystemPrompt = systemPrompt; - this.Width = width; - this.Height = height; - this.NumInferenceSteps = numInferenceSteps; - this.Seed = seed; - this.NumImages = numImages; - this.CustomModelUri = customModelUri; - } - - /// - /// Initializes a new instance of the class. - /// - public GenerateImageRequestErnie() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestFlux2Klein.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestFlux2Klein.Json.g.cs deleted file mode 100644 index 405b72ff..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestFlux2Klein.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class GenerateImageRequestFlux2Klein - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.GenerateImageRequestFlux2Klein? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.GenerateImageRequestFlux2Klein), - jsonSerializerContext) as global::Ideogram.GenerateImageRequestFlux2Klein; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.GenerateImageRequestFlux2Klein? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.GenerateImageRequestFlux2Klein? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.GenerateImageRequestFlux2Klein), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GenerateImageRequestFlux2Klein; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestFlux2Klein.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestFlux2Klein.g.cs deleted file mode 100644 index bbb90304..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestFlux2Klein.g.cs +++ /dev/null @@ -1,163 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Request body for the FLUX.2-Klein generate endpoint. The base model is
- /// pinned server-side; supply `custom_model_uri` to layer a registered
- /// FLUX.2-Klein LoRA finetune on the base.
- /// Width and height must each be a positive multiple of 16; the total
- /// area must not exceed 1,048,576 pixels (1024×1024). When `width` and
- /// `height` are omitted, the server uses the model's default 1024×1024. - ///
- public sealed partial class GenerateImageRequestFlux2Klein - { - /// - /// A natural-language prompt for image generation.
- /// Example: A photo of a tabby cat sleeping on a couch, soft daylight. - ///
- /// A photo of a tabby cat sleeping on a couch, soft daylight. - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Prompt { get; set; } - - /// - /// An optional system prompt applied alongside the prompt — use it for
- /// standing instructions such as style constraints or "do not render
- /// text". When omitted, no system prompt is applied. If you trained a
- /// LoRA with a system prompt, supply the same one here for best results.
- /// Example: Do not include any text in the image. - ///
- /// Do not include any text in the image. - [global::System.Text.Json.Serialization.JsonPropertyName("system_prompt")] - public string? SystemPrompt { get; set; } - - /// - /// Output width in pixels; must be a positive multiple of 16.
- /// Example: 1024 - ///
- /// 1024 - [global::System.Text.Json.Serialization.JsonPropertyName("width")] - public int? Width { get; set; } - - /// - /// Output height in pixels; must be a positive multiple of 16.
- /// Example: 1024 - ///
- /// 1024 - [global::System.Text.Json.Serialization.JsonPropertyName("height")] - public int? Height { get; set; } - - /// - /// Optional diffusion step count. When omitted, the server uses the
- /// model's default. Higher values trade latency for quality.
- /// Example: 4 - ///
- /// 4 - [global::System.Text.Json.Serialization.JsonPropertyName("num_inference_steps")] - public int? NumInferenceSteps { get; set; } - - /// - /// Random seed for reproducibility. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// Number of images to generate.
- /// Default Value: 1 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] - public int? NumImages { get; set; } - - /// - /// A custom model URI in the format model/<model_name>/version/<version_name>.
- /// When provided, the URI must resolve to a registered fine-tune of the
- /// FLUX.2-Klein base model; the fine-tune's LoRA checkpoint is layered
- /// on the base. When omitted, the FLUX.2-Klein base is used with no LoRA.
- /// Example: model/my-flux-klein-lora/version/0 - ///
- /// model/my-flux-klein-lora/version/0 - [global::System.Text.Json.Serialization.JsonPropertyName("custom_model_uri")] - public string? CustomModelUri { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// A natural-language prompt for image generation.
- /// Example: A photo of a tabby cat sleeping on a couch, soft daylight. - /// - /// - /// An optional system prompt applied alongside the prompt — use it for
- /// standing instructions such as style constraints or "do not render
- /// text". When omitted, no system prompt is applied. If you trained a
- /// LoRA with a system prompt, supply the same one here for best results.
- /// Example: Do not include any text in the image. - /// - /// - /// Output width in pixels; must be a positive multiple of 16.
- /// Example: 1024 - /// - /// - /// Output height in pixels; must be a positive multiple of 16.
- /// Example: 1024 - /// - /// - /// Optional diffusion step count. When omitted, the server uses the
- /// model's default. Higher values trade latency for quality.
- /// Example: 4 - /// - /// - /// Random seed for reproducibility. - /// - /// - /// Number of images to generate.
- /// Default Value: 1 - /// - /// - /// A custom model URI in the format model/<model_name>/version/<version_name>.
- /// When provided, the URI must resolve to a registered fine-tune of the
- /// FLUX.2-Klein base model; the fine-tune's LoRA checkpoint is layered
- /// on the base. When omitted, the FLUX.2-Klein base is used with no LoRA.
- /// Example: model/my-flux-klein-lora/version/0 - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public GenerateImageRequestFlux2Klein( - string prompt, - string? systemPrompt, - int? width, - int? height, - int? numInferenceSteps, - int? seed, - int? numImages, - string? customModelUri) - { - this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); - this.SystemPrompt = systemPrompt; - this.Width = width; - this.Height = height; - this.NumInferenceSteps = numInferenceSteps; - this.Seed = seed; - this.NumImages = numImages; - this.CustomModelUri = customModelUri; - } - - /// - /// Initializes a new instance of the class. - /// - public GenerateImageRequestFlux2Klein() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestFlux2KleinBase.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestFlux2KleinBase.Json.g.cs deleted file mode 100644 index dba53e04..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestFlux2KleinBase.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class GenerateImageRequestFlux2KleinBase - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.GenerateImageRequestFlux2KleinBase? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.GenerateImageRequestFlux2KleinBase), - jsonSerializerContext) as global::Ideogram.GenerateImageRequestFlux2KleinBase; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.GenerateImageRequestFlux2KleinBase? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.GenerateImageRequestFlux2KleinBase? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.GenerateImageRequestFlux2KleinBase), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GenerateImageRequestFlux2KleinBase; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestFlux2KleinBase.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestFlux2KleinBase.g.cs deleted file mode 100644 index 74d2e586..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestFlux2KleinBase.g.cs +++ /dev/null @@ -1,163 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Request body for the undistilled FLUX.2-Klein base generate endpoint (50-step quality tier). The base model is
- /// pinned server-side; supply `custom_model_uri` to layer a registered
- /// FLUX.2-Klein LoRA finetune on the base.
- /// Width and height must each be a positive multiple of 16; the total
- /// area must not exceed 1,048,576 pixels (1024×1024). When `width` and
- /// `height` are omitted, the server uses the model's default 1024×1024. - ///
- public sealed partial class GenerateImageRequestFlux2KleinBase - { - /// - /// A natural-language prompt for image generation.
- /// Example: A photo of a tabby cat sleeping on a couch, soft daylight. - ///
- /// A photo of a tabby cat sleeping on a couch, soft daylight. - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Prompt { get; set; } - - /// - /// An optional system prompt applied alongside the prompt — use it for
- /// standing instructions such as style constraints or "do not render
- /// text". When omitted, no system prompt is applied. If you trained a
- /// LoRA with a system prompt, supply the same one here for best results.
- /// Example: Do not include any text in the image. - ///
- /// Do not include any text in the image. - [global::System.Text.Json.Serialization.JsonPropertyName("system_prompt")] - public string? SystemPrompt { get; set; } - - /// - /// Output width in pixels; must be a positive multiple of 16.
- /// Example: 1024 - ///
- /// 1024 - [global::System.Text.Json.Serialization.JsonPropertyName("width")] - public int? Width { get; set; } - - /// - /// Output height in pixels; must be a positive multiple of 16.
- /// Example: 1024 - ///
- /// 1024 - [global::System.Text.Json.Serialization.JsonPropertyName("height")] - public int? Height { get; set; } - - /// - /// Optional diffusion step count. When omitted, the server uses the
- /// model's default. Higher values trade latency for quality.
- /// Example: 50 - ///
- /// 50 - [global::System.Text.Json.Serialization.JsonPropertyName("num_inference_steps")] - public int? NumInferenceSteps { get; set; } - - /// - /// Random seed for reproducibility. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// Number of images to generate.
- /// Default Value: 1 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] - public int? NumImages { get; set; } - - /// - /// A custom model URI in the format model/<model_name>/version/<version_name>.
- /// When provided, the URI must resolve to a registered fine-tune of the
- /// FLUX.2-Klein base model; the fine-tune's LoRA checkpoint is layered
- /// on the base. When omitted, the FLUX.2-Klein base is used with no LoRA.
- /// Example: model/my-flux-klein-base-lora/version/0 - ///
- /// model/my-flux-klein-base-lora/version/0 - [global::System.Text.Json.Serialization.JsonPropertyName("custom_model_uri")] - public string? CustomModelUri { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// A natural-language prompt for image generation.
- /// Example: A photo of a tabby cat sleeping on a couch, soft daylight. - /// - /// - /// An optional system prompt applied alongside the prompt — use it for
- /// standing instructions such as style constraints or "do not render
- /// text". When omitted, no system prompt is applied. If you trained a
- /// LoRA with a system prompt, supply the same one here for best results.
- /// Example: Do not include any text in the image. - /// - /// - /// Output width in pixels; must be a positive multiple of 16.
- /// Example: 1024 - /// - /// - /// Output height in pixels; must be a positive multiple of 16.
- /// Example: 1024 - /// - /// - /// Optional diffusion step count. When omitted, the server uses the
- /// model's default. Higher values trade latency for quality.
- /// Example: 50 - /// - /// - /// Random seed for reproducibility. - /// - /// - /// Number of images to generate.
- /// Default Value: 1 - /// - /// - /// A custom model URI in the format model/<model_name>/version/<version_name>.
- /// When provided, the URI must resolve to a registered fine-tune of the
- /// FLUX.2-Klein base model; the fine-tune's LoRA checkpoint is layered
- /// on the base. When omitted, the FLUX.2-Klein base is used with no LoRA.
- /// Example: model/my-flux-klein-base-lora/version/0 - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public GenerateImageRequestFlux2KleinBase( - string prompt, - string? systemPrompt, - int? width, - int? height, - int? numInferenceSteps, - int? seed, - int? numImages, - string? customModelUri) - { - this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); - this.SystemPrompt = systemPrompt; - this.Width = width; - this.Height = height; - this.NumInferenceSteps = numInferenceSteps; - this.Seed = seed; - this.NumImages = numImages; - this.CustomModelUri = customModelUri; - } - - /// - /// Initializes a new instance of the class. - /// - public GenerateImageRequestFlux2KleinBase() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestPImage.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestPImage.Json.g.cs deleted file mode 100644 index 951c194b..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestPImage.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class GenerateImageRequestPImage - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.GenerateImageRequestPImage? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.GenerateImageRequestPImage), - jsonSerializerContext) as global::Ideogram.GenerateImageRequestPImage; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.GenerateImageRequestPImage? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.GenerateImageRequestPImage? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.GenerateImageRequestPImage), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GenerateImageRequestPImage; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestPImage.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestPImage.g.cs deleted file mode 100644 index 8bdbaff0..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestPImage.g.cs +++ /dev/null @@ -1,134 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Request body for the distilled few-step Ideogram generate endpoints. The
- /// speed/quality tier is selected by the URL path, not this body. Supply a
- /// `prompt`: either natural language or a structured Ideogram 4.0 JSON prompt
- /// (the server detects which). The base model is always the distilled
- /// few-step Ideogram model; a custom registry model cannot be selected on
- /// these endpoints. - ///
- public sealed partial class GenerateImageRequestPImage - { - /// - /// The prompt for image generation. Accepts either natural language or
- /// a structured prompt that conforms to the Ideogram 4.0 JSON contract;
- /// the server detects which was supplied. See `prompt_upsampling` for
- /// how magic-prompt is applied. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Prompt { get; set; } - - /// - /// Controls magic-prompt (prompt upsampling). `AUTO` (default) applies
- /// magic-prompt to a natural-language `prompt` or a non-Ideogram 4.0 JSON
- /// `prompt`, and skips it when `prompt` is already a structured Ideogram
- /// 4.0 JSON prompt. `ON` always applies magic-prompt, even to an Ideogram
- /// 4.0 JSON prompt; `OFF` never applies it. Defaults to `AUTO`. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("prompt_upsampling")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.MagicPromptOptionJsonConverter))] - public global::Ideogram.MagicPromptOption? PromptUpsampling { get; set; } - - /// - /// Random seed for reproducibility. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// A base64url-encoded magic prompt system prompt config ID to use
- /// for this request. Honored only when magic-prompt runs (a
- /// natural-language `prompt` with `prompt_upsampling` AUTO or ON). - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt_system_prompt_config_id")] - public string? MagicPromptSystemPromptConfigId { get; set; } - - /// - /// The 1K and 2K resolutions supported for Ideogram 4.0 image generation.
- /// Example: 2048x2048 - ///
- /// 2048x2048 - [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ResolutionV4JsonConverter))] - public global::Ideogram.ResolutionV4? Resolution { get; set; } - - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). The effective gate is the OR of this field and the organization's
- /// `copyright_detection_enabled` setting on `/api`. See GenerateImageRequestV3 for details. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("enable_copyright_detection")] - public bool? EnableCopyrightDetection { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The prompt for image generation. Accepts either natural language or
- /// a structured prompt that conforms to the Ideogram 4.0 JSON contract;
- /// the server detects which was supplied. See `prompt_upsampling` for
- /// how magic-prompt is applied. - /// - /// - /// Controls magic-prompt (prompt upsampling). `AUTO` (default) applies
- /// magic-prompt to a natural-language `prompt` or a non-Ideogram 4.0 JSON
- /// `prompt`, and skips it when `prompt` is already a structured Ideogram
- /// 4.0 JSON prompt. `ON` always applies magic-prompt, even to an Ideogram
- /// 4.0 JSON prompt; `OFF` never applies it. Defaults to `AUTO`. - /// - /// - /// Random seed for reproducibility. - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use
- /// for this request. Honored only when magic-prompt runs (a
- /// natural-language `prompt` with `prompt_upsampling` AUTO or ON). - /// - /// - /// The 1K and 2K resolutions supported for Ideogram 4.0 image generation.
- /// Example: 2048x2048 - /// - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). The effective gate is the OR of this field and the organization's
- /// `copyright_detection_enabled` setting on `/api`. See GenerateImageRequestV3 for details. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public GenerateImageRequestPImage( - string prompt, - global::Ideogram.MagicPromptOption? promptUpsampling, - int? seed, - string? magicPromptSystemPromptConfigId, - global::Ideogram.ResolutionV4? resolution, - bool? enableCopyrightDetection) - { - this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); - this.PromptUpsampling = promptUpsampling; - this.Seed = seed; - this.MagicPromptSystemPromptConfigId = magicPromptSystemPromptConfigId; - this.Resolution = resolution; - this.EnableCopyrightDetection = enableCopyrightDetection; - } - - /// - /// Initializes a new instance of the class. - /// - public GenerateImageRequestPImage() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestPImageIdeogram.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestPImageIdeogram.Json.g.cs deleted file mode 100644 index dd162508..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestPImageIdeogram.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class GenerateImageRequestPImageIdeogram - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.GenerateImageRequestPImageIdeogram? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.GenerateImageRequestPImageIdeogram), - jsonSerializerContext) as global::Ideogram.GenerateImageRequestPImageIdeogram; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.GenerateImageRequestPImageIdeogram? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.GenerateImageRequestPImageIdeogram? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.GenerateImageRequestPImageIdeogram), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GenerateImageRequestPImageIdeogram; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestPImageIdeogram.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestPImageIdeogram.g.cs deleted file mode 100644 index 88c10415..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestPImageIdeogram.g.cs +++ /dev/null @@ -1,180 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Request body for P-Image Ideogram. The model's quality and resolution
- /// tier are supplied as request parameters. The server selects the matching
- /// P-Image model variant; custom registry models cannot be selected. - ///
- public sealed partial class GenerateImageRequestPImageIdeogram - { - /// - /// The prompt for image generation. Accepts either natural language or
- /// a structured Ideogram 4.0 JSON prompt; the server detects which was supplied. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Prompt { get; set; } - - /// - /// Controls magic-prompt (prompt upsampling). Defaults to `AUTO`.
- /// Default Value: AUTO - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("prompt_upsampling")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.MagicPromptOptionJsonConverter))] - public global::Ideogram.MagicPromptOption? PromptUpsampling { get; set; } - - /// - /// Random seed for reproducibility. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// A base64url-encoded magic prompt system prompt config ID to use
- /// for this request. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt_system_prompt_config_id")] - public string? MagicPromptSystemPromptConfigId { get; set; } - - /// - /// The generation quality level. Defaults to `MEDIUM`.
- /// Default Value: MEDIUM - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("quality")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.QualityJsonConverter))] - public global::Ideogram.Quality? Quality { get; set; } - - /// - /// The output-size tier. Defaults to `1K`.
- /// Default Value: 1K - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.PImageResolutionJsonConverter))] - public global::Ideogram.PImageResolution? Resolution { get; set; } - - /// - /// The output aspect ratio. Defaults to `1x1`.
- /// Default Value: 1x1 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.AspectRatioV3JsonConverter))] - public global::Ideogram.AspectRatioV3? AspectRatio { get; set; } - - /// - /// Optional. An exact output width in pixels, used together with
- /// `custom_height` for output sizes outside the preset tiers. Must be
- /// a positive multiple of 16 between 16 and 4096, and
- /// `custom_width` × `custom_height` must not exceed 4,194,304 pixels
- /// (2048×2048). Cannot be combined with `resolution` or
- /// `aspect_ratio`; the request is billed at the resolution tier
- /// matching its total pixel count. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("custom_width")] - public int? CustomWidth { get; set; } - - /// - /// Optional. An exact output height in pixels, used together with
- /// `custom_width`. See `custom_width` for the accepted range and
- /// billing behavior. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("custom_height")] - public int? CustomHeight { get; set; } - - /// - /// Optional. Opt this request into post-generation copyright detection. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("enable_copyright_detection")] - public bool? EnableCopyrightDetection { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The prompt for image generation. Accepts either natural language or
- /// a structured Ideogram 4.0 JSON prompt; the server detects which was supplied. - /// - /// - /// Controls magic-prompt (prompt upsampling). Defaults to `AUTO`.
- /// Default Value: AUTO - /// - /// - /// Random seed for reproducibility. - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use
- /// for this request. - /// - /// - /// The generation quality level. Defaults to `MEDIUM`.
- /// Default Value: MEDIUM - /// - /// - /// The output-size tier. Defaults to `1K`.
- /// Default Value: 1K - /// - /// - /// The output aspect ratio. Defaults to `1x1`.
- /// Default Value: 1x1 - /// - /// - /// Optional. An exact output width in pixels, used together with
- /// `custom_height` for output sizes outside the preset tiers. Must be
- /// a positive multiple of 16 between 16 and 4096, and
- /// `custom_width` × `custom_height` must not exceed 4,194,304 pixels
- /// (2048×2048). Cannot be combined with `resolution` or
- /// `aspect_ratio`; the request is billed at the resolution tier
- /// matching its total pixel count. - /// - /// - /// Optional. An exact output height in pixels, used together with
- /// `custom_width`. See `custom_width` for the accepted range and
- /// billing behavior. - /// - /// - /// Optional. Opt this request into post-generation copyright detection. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public GenerateImageRequestPImageIdeogram( - string prompt, - global::Ideogram.MagicPromptOption? promptUpsampling, - int? seed, - string? magicPromptSystemPromptConfigId, - global::Ideogram.Quality? quality, - global::Ideogram.PImageResolution? resolution, - global::Ideogram.AspectRatioV3? aspectRatio, - int? customWidth, - int? customHeight, - bool? enableCopyrightDetection) - { - this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); - this.PromptUpsampling = promptUpsampling; - this.Seed = seed; - this.MagicPromptSystemPromptConfigId = magicPromptSystemPromptConfigId; - this.Quality = quality; - this.Resolution = resolution; - this.AspectRatio = aspectRatio; - this.CustomWidth = customWidth; - this.CustomHeight = customHeight; - this.EnableCopyrightDetection = enableCopyrightDetection; - } - - /// - /// Initializes a new instance of the class. - /// - public GenerateImageRequestPImageIdeogram() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestV3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestV3.Json.g.cs deleted file mode 100644 index 02eca701..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestV3.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class GenerateImageRequestV3 - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.GenerateImageRequestV3? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.GenerateImageRequestV3), - jsonSerializerContext) as global::Ideogram.GenerateImageRequestV3; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.GenerateImageRequestV3? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.GenerateImageRequestV3? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.GenerateImageRequestV3), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GenerateImageRequestV3; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestV3.g.cs deleted file mode 100644 index 8c1da718..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestV3.g.cs +++ /dev/null @@ -1,286 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - public sealed partial class GenerateImageRequestV3 - { - /// - /// The prompt to use to generate the image.
- /// Example: A photo of a cat - ///
- /// A photo of a cat - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Prompt { get; set; } - - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - ///
- /// 12345 - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// The resolutions supported for Ideogram 3.0.
- /// Example: 1280x800 - ///
- /// 1280x800 - [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ResolutionV3JsonConverter))] - public global::Ideogram.ResolutionV3? Resolution { get; set; } - - /// - /// Output aspect ratio. Cannot be combined with resolution. Generation defaults to 1x1; remix keeps the source ratio when both fields are omitted. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.AspectRatioV3JsonConverter))] - public global::Ideogram.AspectRatioV3? AspectRatio { get; set; } - - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("rendering_speed")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.RenderingSpeedJsonConverter))] - public global::Ideogram.RenderingSpeed? RenderingSpeed { get; set; } - - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - ///
- /// ON - [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.MagicPromptOptionJsonConverter))] - public global::Ideogram.MagicPromptOption? MagicPrompt { get; set; } - - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt_system_prompt_config_id")] - public string? MagicPromptSystemPromptConfigId { get; set; } - - /// - /// Description of what to exclude from an image. Descriptions in the prompt take precedence
- /// to descriptions in the negative prompt.
- /// Example: brush strokes, painting - ///
- /// brush strokes, painting - [global::System.Text.Json.Serialization.JsonPropertyName("negative_prompt")] - public string? NegativePrompt { get; set; } - - /// - /// Number of images to generate.
- /// Default Value: 1 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] - public int? NumImages { get; set; } - - /// - /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). Not supported by V_1, V_1_TURBO, V_2A and V_2A_TURBO models. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("color_palette")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ColorPaletteWithPresetNameOrMembersJsonConverter))] - public global::Ideogram.ColorPaletteWithPresetNameOrMembers? ColorPalette { get; set; } - - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - ///
- /// [AAFF5733, 0133FF57, DE3357FF] - [global::System.Text.Json.Serialization.JsonPropertyName("style_codes")] - public global::System.Collections.Generic.IList? StyleCodes { get; set; } - - /// - /// The style type to generate with.
- /// Default Value: GENERAL
- /// Example: GENERAL - ///
- /// GENERAL - [global::System.Text.Json.Serialization.JsonPropertyName("style_type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.StyleTypeV3JsonConverter))] - public global::Ideogram.StyleTypeV3? StyleType { get; set; } - - /// - /// A predefined style preset that applies a specific artistic style to the generated image.
- /// Example: BRIGHT_ART - ///
- /// BRIGHT_ART - [global::System.Text.Json.Serialization.JsonPropertyName("style_preset")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.StylePresetV3JsonConverter))] - public global::Ideogram.StylePresetV3? StylePreset { get; set; } - - /// - /// A custom model URI in the format model/<model_name>/version/<version_name>.
- /// When provided, the model version and style will be resolved from this URI, and style_type is not required.
- /// Example: model/my-custom-model/version/1 - ///
- /// model/my-custom-model/version/1 - [global::System.Text.Json.Serialization.JsonPropertyName("custom_model_uri")] - public string? CustomModelUri { get; set; } - - /// - /// A set of images to use as style references (max size 25MB per image; the whole request must stay under 50MB). The images should be in JPEG, PNG or WebP format. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("style_reference_images")] - public global::System.Collections.Generic.IList? StyleReferenceImages { get; set; } - - /// - /// Generations with character reference are subject to the character reference pricing. A set of images to use as character references (max size 25MB per image; the whole request must stay under 50MB), currently only supports 1 character reference image. The images should be in JPEG, PNG or WebP format. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("character_reference_images")] - public global::System.Collections.Generic.IList? CharacterReferenceImages { get; set; } - - /// - /// Optional masks for character reference images. When provided, must match the number of character_reference_images. Each mask should be a grayscale image of the same dimensions as the corresponding character reference image. The images should be in JPEG, PNG or WebP format. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("character_reference_images_mask")] - public global::System.Collections.Generic.IList? CharacterReferenceImagesMask { get; set; } - - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). The effective gate is the OR of this field and the organization's
- /// `copyright_detection_enabled` setting on `/api`: if the org has it on, this is ignored;
- /// if the org has it off, setting this `true` enables detection for this request only.
- /// Adds detection latency. Flagged images come back with `is_image_safe: false`. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("enable_copyright_detection")] - public bool? EnableCopyrightDetection { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The prompt to use to generate the image.
- /// Example: A photo of a cat - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The resolutions supported for Ideogram 3.0.
- /// Example: 1280x800 - /// - /// - /// Output aspect ratio. Cannot be combined with resolution. Generation defaults to 1x1; remix keeps the source ratio when both fields are omitted. - /// - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// Description of what to exclude from an image. Descriptions in the prompt take precedence
- /// to descriptions in the negative prompt.
- /// Example: brush strokes, painting - /// - /// - /// Number of images to generate.
- /// Default Value: 1 - /// - /// - /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). Not supported by V_1, V_1_TURBO, V_2A and V_2A_TURBO models. - /// - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - /// - /// - /// The style type to generate with.
- /// Default Value: GENERAL
- /// Example: GENERAL - /// - /// - /// A predefined style preset that applies a specific artistic style to the generated image.
- /// Example: BRIGHT_ART - /// - /// - /// A custom model URI in the format model/<model_name>/version/<version_name>.
- /// When provided, the model version and style will be resolved from this URI, and style_type is not required.
- /// Example: model/my-custom-model/version/1 - /// - /// - /// A set of images to use as style references (max size 25MB per image; the whole request must stay under 50MB). The images should be in JPEG, PNG or WebP format. - /// - /// - /// Generations with character reference are subject to the character reference pricing. A set of images to use as character references (max size 25MB per image; the whole request must stay under 50MB), currently only supports 1 character reference image. The images should be in JPEG, PNG or WebP format. - /// - /// - /// Optional masks for character reference images. When provided, must match the number of character_reference_images. Each mask should be a grayscale image of the same dimensions as the corresponding character reference image. The images should be in JPEG, PNG or WebP format. - /// - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). The effective gate is the OR of this field and the organization's
- /// `copyright_detection_enabled` setting on `/api`: if the org has it on, this is ignored;
- /// if the org has it off, setting this `true` enables detection for this request only.
- /// Adds detection latency. Flagged images come back with `is_image_safe: false`. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public GenerateImageRequestV3( - string prompt, - int? seed, - global::Ideogram.ResolutionV3? resolution, - global::Ideogram.AspectRatioV3? aspectRatio, - global::Ideogram.RenderingSpeed? renderingSpeed, - global::Ideogram.MagicPromptOption? magicPrompt, - string? magicPromptSystemPromptConfigId, - string? negativePrompt, - int? numImages, - global::Ideogram.ColorPaletteWithPresetNameOrMembers? colorPalette, - global::System.Collections.Generic.IList? styleCodes, - global::Ideogram.StyleTypeV3? styleType, - global::Ideogram.StylePresetV3? stylePreset, - string? customModelUri, - global::System.Collections.Generic.IList? styleReferenceImages, - global::System.Collections.Generic.IList? characterReferenceImages, - global::System.Collections.Generic.IList? characterReferenceImagesMask, - bool? enableCopyrightDetection) - { - this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); - this.Seed = seed; - this.Resolution = resolution; - this.AspectRatio = aspectRatio; - this.RenderingSpeed = renderingSpeed; - this.MagicPrompt = magicPrompt; - this.MagicPromptSystemPromptConfigId = magicPromptSystemPromptConfigId; - this.NegativePrompt = negativePrompt; - this.NumImages = numImages; - this.ColorPalette = colorPalette; - this.StyleCodes = styleCodes; - this.StyleType = styleType; - this.StylePreset = stylePreset; - this.CustomModelUri = customModelUri; - this.StyleReferenceImages = styleReferenceImages; - this.CharacterReferenceImages = characterReferenceImages; - this.CharacterReferenceImagesMask = characterReferenceImagesMask; - this.EnableCopyrightDetection = enableCopyrightDetection; - } - - /// - /// Initializes a new instance of the class. - /// - public GenerateImageRequestV3() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestV4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestV4.Json.g.cs deleted file mode 100644 index c9f9d2fb..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestV4.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class GenerateImageRequestV4 - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.GenerateImageRequestV4? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.GenerateImageRequestV4), - jsonSerializerContext) as global::Ideogram.GenerateImageRequestV4; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.GenerateImageRequestV4? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.GenerateImageRequestV4? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.GenerateImageRequestV4), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GenerateImageRequestV4; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestV4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestV4.g.cs deleted file mode 100644 index c57b7729..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestV4.g.cs +++ /dev/null @@ -1,159 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Request body for Ideogram 4.0 image generation. Supply exactly one of
- /// `text_prompt` or `json_prompt`. When `text_prompt` is supplied,
- /// magic-prompt is applied automatically. When `json_prompt` is supplied,
- /// magic-prompt is skipped and the structured prompt is consumed
- /// directly. - ///
- public sealed partial class GenerateImageRequestV4 - { - /// - /// A natural-language prompt for image generation. When supplied,
- /// magic-prompt is enabled automatically. Mutually exclusive with
- /// `json_prompt`. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("text_prompt")] - public string? TextPrompt { get; set; } - - /// - /// A structured prompt that conforms to the Ideogram 4.0 JSON
- /// contract. When supplied, magic-prompt is disabled and the
- /// structured prompt is consumed by the diffusion model directly.
- /// Mutually exclusive with `text_prompt`. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("json_prompt")] - public global::Ideogram.V4JsonPrompt? JsonPrompt { get; set; } - - /// - /// Random seed for reproducibility. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// A base64url-encoded magic prompt system prompt config ID to use
- /// for this request. Honored when `text_prompt` is supplied. Ignored
- /// when `json_prompt` is supplied. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt_system_prompt_config_id")] - public string? MagicPromptSystemPromptConfigId { get; set; } - - /// - /// A custom model URI in the format model/<model_name>/version/<version_name>.
- /// When provided, the model version and style will be resolved from this URI.
- /// Example: model/my-custom-model/version/0 - ///
- /// model/my-custom-model/version/0 - [global::System.Text.Json.Serialization.JsonPropertyName("custom_model_uri")] - public string? CustomModelUri { get; set; } - - /// - /// The 1K and 2K resolutions supported for Ideogram 4.0 image generation.
- /// Example: 2048x2048 - ///
- /// 2048x2048 - [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ResolutionV4JsonConverter))] - public global::Ideogram.ResolutionV4? Resolution { get; set; } - - /// - /// The rendering speed to use. For Ideogram V4, `rendering_speed=FLASH`
- /// is coming soon; requests with `rendering_speed=FLASH` currently
- /// return a 400. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("rendering_speed")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.RenderingSpeedJsonConverter))] - public global::Ideogram.RenderingSpeed? RenderingSpeed { get; set; } - - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). The effective gate is the OR of this field and the organization's
- /// `copyright_detection_enabled` setting on `/api`. See GenerateImageRequestV3 for details. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("enable_copyright_detection")] - public bool? EnableCopyrightDetection { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// A natural-language prompt for image generation. When supplied,
- /// magic-prompt is enabled automatically. Mutually exclusive with
- /// `json_prompt`. - /// - /// - /// A structured prompt that conforms to the Ideogram 4.0 JSON
- /// contract. When supplied, magic-prompt is disabled and the
- /// structured prompt is consumed by the diffusion model directly.
- /// Mutually exclusive with `text_prompt`. - /// - /// - /// Random seed for reproducibility. - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use
- /// for this request. Honored when `text_prompt` is supplied. Ignored
- /// when `json_prompt` is supplied. - /// - /// - /// A custom model URI in the format model/<model_name>/version/<version_name>.
- /// When provided, the model version and style will be resolved from this URI.
- /// Example: model/my-custom-model/version/0 - /// - /// - /// The 1K and 2K resolutions supported for Ideogram 4.0 image generation.
- /// Example: 2048x2048 - /// - /// - /// The rendering speed to use. For Ideogram V4, `rendering_speed=FLASH`
- /// is coming soon; requests with `rendering_speed=FLASH` currently
- /// return a 400. - /// - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). The effective gate is the OR of this field and the organization's
- /// `copyright_detection_enabled` setting on `/api`. See GenerateImageRequestV3 for details. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public GenerateImageRequestV4( - string? textPrompt, - global::Ideogram.V4JsonPrompt? jsonPrompt, - int? seed, - string? magicPromptSystemPromptConfigId, - string? customModelUri, - global::Ideogram.ResolutionV4? resolution, - global::Ideogram.RenderingSpeed? renderingSpeed, - bool? enableCopyrightDetection) - { - this.TextPrompt = textPrompt; - this.JsonPrompt = jsonPrompt; - this.Seed = seed; - this.MagicPromptSystemPromptConfigId = magicPromptSystemPromptConfigId; - this.CustomModelUri = customModelUri; - this.Resolution = resolution; - this.RenderingSpeed = renderingSpeed; - this.EnableCopyrightDetection = enableCopyrightDetection; - } - - /// - /// Initializes a new instance of the class. - /// - public GenerateImageRequestV4() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestV4CfgDistilled.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestV4CfgDistilled.Json.g.cs deleted file mode 100644 index a062662b..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestV4CfgDistilled.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class GenerateImageRequestV4CfgDistilled - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.GenerateImageRequestV4CfgDistilled? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.GenerateImageRequestV4CfgDistilled), - jsonSerializerContext) as global::Ideogram.GenerateImageRequestV4CfgDistilled; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.GenerateImageRequestV4CfgDistilled? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.GenerateImageRequestV4CfgDistilled? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.GenerateImageRequestV4CfgDistilled), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GenerateImageRequestV4CfgDistilled; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestV4CfgDistilled.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestV4CfgDistilled.g.cs deleted file mode 100644 index f27b4453..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestV4CfgDistilled.g.cs +++ /dev/null @@ -1,142 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Request body for the CFG/guidance-distilled Ideogram 4.0 generate
- /// endpoint. Supply exactly one of `text_prompt` or `json_prompt`. The base
- /// model is always the CFG-distilled Ideogram 4.0; a custom registry model
- /// cannot be selected on this endpoint. - ///
- public sealed partial class GenerateImageRequestV4CfgDistilled - { - /// - /// A natural-language prompt for image generation. When supplied,
- /// magic-prompt is enabled automatically. Mutually exclusive with
- /// `json_prompt`. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("text_prompt")] - public string? TextPrompt { get; set; } - - /// - /// A structured prompt that conforms to the Ideogram 4.0 JSON
- /// contract. When supplied, magic-prompt is disabled and the
- /// structured prompt is consumed by the diffusion model directly.
- /// Mutually exclusive with `text_prompt`. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("json_prompt")] - public global::Ideogram.V4JsonPrompt? JsonPrompt { get; set; } - - /// - /// Random seed for reproducibility. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// A base64url-encoded magic prompt system prompt config ID to use
- /// for this request. Honored when `text_prompt` is supplied. Ignored
- /// when `json_prompt` is supplied. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt_system_prompt_config_id")] - public string? MagicPromptSystemPromptConfigId { get; set; } - - /// - /// The 1K and 2K resolutions supported for Ideogram 4.0 image generation.
- /// Example: 2048x2048 - ///
- /// 2048x2048 - [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ResolutionV4JsonConverter))] - public global::Ideogram.ResolutionV4? Resolution { get; set; } - - /// - /// The rendering speed to use. For Ideogram V4, `rendering_speed=FLASH`
- /// is coming soon; requests with `rendering_speed=FLASH` currently
- /// return a 400. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("rendering_speed")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.RenderingSpeedJsonConverter))] - public global::Ideogram.RenderingSpeed? RenderingSpeed { get; set; } - - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). The effective gate is the OR of this field and the organization's
- /// `copyright_detection_enabled` setting on `/api`. See GenerateImageRequestV3 for details. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("enable_copyright_detection")] - public bool? EnableCopyrightDetection { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// A natural-language prompt for image generation. When supplied,
- /// magic-prompt is enabled automatically. Mutually exclusive with
- /// `json_prompt`. - /// - /// - /// A structured prompt that conforms to the Ideogram 4.0 JSON
- /// contract. When supplied, magic-prompt is disabled and the
- /// structured prompt is consumed by the diffusion model directly.
- /// Mutually exclusive with `text_prompt`. - /// - /// - /// Random seed for reproducibility. - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use
- /// for this request. Honored when `text_prompt` is supplied. Ignored
- /// when `json_prompt` is supplied. - /// - /// - /// The 1K and 2K resolutions supported for Ideogram 4.0 image generation.
- /// Example: 2048x2048 - /// - /// - /// The rendering speed to use. For Ideogram V4, `rendering_speed=FLASH`
- /// is coming soon; requests with `rendering_speed=FLASH` currently
- /// return a 400. - /// - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). The effective gate is the OR of this field and the organization's
- /// `copyright_detection_enabled` setting on `/api`. See GenerateImageRequestV3 for details. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public GenerateImageRequestV4CfgDistilled( - string? textPrompt, - global::Ideogram.V4JsonPrompt? jsonPrompt, - int? seed, - string? magicPromptSystemPromptConfigId, - global::Ideogram.ResolutionV4? resolution, - global::Ideogram.RenderingSpeed? renderingSpeed, - bool? enableCopyrightDetection) - { - this.TextPrompt = textPrompt; - this.JsonPrompt = jsonPrompt; - this.Seed = seed; - this.MagicPromptSystemPromptConfigId = magicPromptSystemPromptConfigId; - this.Resolution = resolution; - this.RenderingSpeed = renderingSpeed; - this.EnableCopyrightDetection = enableCopyrightDetection; - } - - /// - /// Initializes a new instance of the class. - /// - public GenerateImageRequestV4CfgDistilled() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestV4Fp8.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestV4Fp8.Json.g.cs deleted file mode 100644 index 5219f7a1..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestV4Fp8.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class GenerateImageRequestV4Fp8 - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.GenerateImageRequestV4Fp8? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.GenerateImageRequestV4Fp8), - jsonSerializerContext) as global::Ideogram.GenerateImageRequestV4Fp8; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.GenerateImageRequestV4Fp8? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.GenerateImageRequestV4Fp8? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.GenerateImageRequestV4Fp8), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GenerateImageRequestV4Fp8; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestV4Fp8.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestV4Fp8.g.cs deleted file mode 100644 index 8ec82046..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestV4Fp8.g.cs +++ /dev/null @@ -1,142 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Request body for the fp8-quantized Ideogram 4.0 generate endpoint.
- /// Supply exactly one of `text_prompt` or `json_prompt`. The base model is
- /// always the fp8-quantized Ideogram 4.0; a custom registry model cannot be
- /// selected on this endpoint. - ///
- public sealed partial class GenerateImageRequestV4Fp8 - { - /// - /// A natural-language prompt for image generation. When supplied,
- /// magic-prompt is enabled automatically. Mutually exclusive with
- /// `json_prompt`. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("text_prompt")] - public string? TextPrompt { get; set; } - - /// - /// A structured prompt that conforms to the Ideogram 4.0 JSON
- /// contract. When supplied, magic-prompt is disabled and the
- /// structured prompt is consumed by the diffusion model directly.
- /// Mutually exclusive with `text_prompt`. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("json_prompt")] - public global::Ideogram.V4JsonPrompt? JsonPrompt { get; set; } - - /// - /// Random seed for reproducibility. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// A base64url-encoded magic prompt system prompt config ID to use
- /// for this request. Honored when `text_prompt` is supplied. Ignored
- /// when `json_prompt` is supplied. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt_system_prompt_config_id")] - public string? MagicPromptSystemPromptConfigId { get; set; } - - /// - /// The 1K and 2K resolutions supported for Ideogram 4.0 image generation.
- /// Example: 2048x2048 - ///
- /// 2048x2048 - [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ResolutionV4JsonConverter))] - public global::Ideogram.ResolutionV4? Resolution { get; set; } - - /// - /// The rendering speed to use. For Ideogram V4, `rendering_speed=FLASH`
- /// is coming soon; requests with `rendering_speed=FLASH` currently
- /// return a 400. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("rendering_speed")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.RenderingSpeedJsonConverter))] - public global::Ideogram.RenderingSpeed? RenderingSpeed { get; set; } - - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). The effective gate is the OR of this field and the organization's
- /// `copyright_detection_enabled` setting on `/api`. See GenerateImageRequestV3 for details. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("enable_copyright_detection")] - public bool? EnableCopyrightDetection { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// A natural-language prompt for image generation. When supplied,
- /// magic-prompt is enabled automatically. Mutually exclusive with
- /// `json_prompt`. - /// - /// - /// A structured prompt that conforms to the Ideogram 4.0 JSON
- /// contract. When supplied, magic-prompt is disabled and the
- /// structured prompt is consumed by the diffusion model directly.
- /// Mutually exclusive with `text_prompt`. - /// - /// - /// Random seed for reproducibility. - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use
- /// for this request. Honored when `text_prompt` is supplied. Ignored
- /// when `json_prompt` is supplied. - /// - /// - /// The 1K and 2K resolutions supported for Ideogram 4.0 image generation.
- /// Example: 2048x2048 - /// - /// - /// The rendering speed to use. For Ideogram V4, `rendering_speed=FLASH`
- /// is coming soon; requests with `rendering_speed=FLASH` currently
- /// return a 400. - /// - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). The effective gate is the OR of this field and the organization's
- /// `copyright_detection_enabled` setting on `/api`. See GenerateImageRequestV3 for details. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public GenerateImageRequestV4Fp8( - string? textPrompt, - global::Ideogram.V4JsonPrompt? jsonPrompt, - int? seed, - string? magicPromptSystemPromptConfigId, - global::Ideogram.ResolutionV4? resolution, - global::Ideogram.RenderingSpeed? renderingSpeed, - bool? enableCopyrightDetection) - { - this.TextPrompt = textPrompt; - this.JsonPrompt = jsonPrompt; - this.Seed = seed; - this.MagicPromptSystemPromptConfigId = magicPromptSystemPromptConfigId; - this.Resolution = resolution; - this.RenderingSpeed = renderingSpeed; - this.EnableCopyrightDetection = enableCopyrightDetection; - } - - /// - /// Initializes a new instance of the class. - /// - public GenerateImageRequestV4Fp8() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestV4Im2Im.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestV4Im2Im.Json.g.cs deleted file mode 100644 index 79da0d1c..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestV4Im2Im.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class GenerateImageRequestV4Im2Im - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.GenerateImageRequestV4Im2Im? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.GenerateImageRequestV4Im2Im), - jsonSerializerContext) as global::Ideogram.GenerateImageRequestV4Im2Im; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.GenerateImageRequestV4Im2Im? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.GenerateImageRequestV4Im2Im? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.GenerateImageRequestV4Im2Im), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GenerateImageRequestV4Im2Im; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestV4Im2Im.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestV4Im2Im.g.cs deleted file mode 100644 index 44ab817a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestV4Im2Im.g.cs +++ /dev/null @@ -1,169 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - public sealed partial class GenerateImageRequestV4Im2Im - { - /// - /// The initial image binary (max 25MB); only JPEG, WebP and PNG formats are supported. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image")] - [global::System.Text.Json.Serialization.JsonRequired] - public required byte[] Image { get; set; } - - /// - /// The initial image binary (max 25MB); only JPEG, WebP and PNG formats are supported. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Imagename { get; set; } - - /// - /// Optional. Up to 4 additional reference images used together with `image` to condition
- /// the generation, for a maximum of 5 reference images total. Each image may be up to 25MB;
- /// only JPEG, WebP and PNG formats are supported. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("additional_images")] - public global::System.Collections.Generic.IList? AdditionalImages { get; set; } - - /// - /// An optional text prompt to guide the generation. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - public string? Prompt { get; set; } - - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - ///
- /// 12345 - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - ///
- /// ON - [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt_option")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.MagicPromptOptionJsonConverter))] - public global::Ideogram.MagicPromptOption? MagicPromptOption { get; set; } - - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt_system_prompt_config_id")] - public string? MagicPromptSystemPromptConfigId { get; set; } - - /// - /// Output resolutions for Ideogram 4.0 image-to-image. Superset of ResolutionV4 (the 1K/2K t2im set) plus the small 512-tier (512x512, 768x384, 384x768).
- /// Example: 1024x1024 - ///
- /// 1024x1024 - [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ResolutionV4ImageToImageJsonConverter))] - public global::Ideogram.ResolutionV4ImageToImage? Resolution { get; set; } - - /// - /// The rendering speed to use. For Ideogram V4, `rendering_speed=FLASH`
- /// is coming soon; requests with `rendering_speed=FLASH` currently
- /// return a 400. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("rendering_speed")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.RenderingSpeedJsonConverter))] - public global::Ideogram.RenderingSpeed? RenderingSpeed { get; set; } - - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). See GenerateImageRequestV3 for details. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("enable_copyright_detection")] - public bool? EnableCopyrightDetection { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The initial image binary (max 25MB); only JPEG, WebP and PNG formats are supported. - /// - /// - /// The initial image binary (max 25MB); only JPEG, WebP and PNG formats are supported. - /// - /// - /// Optional. Up to 4 additional reference images used together with `image` to condition
- /// the generation, for a maximum of 5 reference images total. Each image may be up to 25MB;
- /// only JPEG, WebP and PNG formats are supported. - /// - /// - /// An optional text prompt to guide the generation. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// Output resolutions for Ideogram 4.0 image-to-image. Superset of ResolutionV4 (the 1K/2K t2im set) plus the small 512-tier (512x512, 768x384, 384x768).
- /// Example: 1024x1024 - /// - /// - /// The rendering speed to use. For Ideogram V4, `rendering_speed=FLASH`
- /// is coming soon; requests with `rendering_speed=FLASH` currently
- /// return a 400. - /// - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). See GenerateImageRequestV3 for details. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public GenerateImageRequestV4Im2Im( - byte[] image, - string imagename, - global::System.Collections.Generic.IList? additionalImages, - string? prompt, - int? seed, - global::Ideogram.MagicPromptOption? magicPromptOption, - string? magicPromptSystemPromptConfigId, - global::Ideogram.ResolutionV4ImageToImage? resolution, - global::Ideogram.RenderingSpeed? renderingSpeed, - bool? enableCopyrightDetection) - { - this.Image = image ?? throw new global::System.ArgumentNullException(nameof(image)); - this.Imagename = imagename ?? throw new global::System.ArgumentNullException(nameof(imagename)); - this.AdditionalImages = additionalImages; - this.Prompt = prompt; - this.Seed = seed; - this.MagicPromptOption = magicPromptOption; - this.MagicPromptSystemPromptConfigId = magicPromptSystemPromptConfigId; - this.Resolution = resolution; - this.RenderingSpeed = renderingSpeed; - this.EnableCopyrightDetection = enableCopyrightDetection; - } - - /// - /// Initializes a new instance of the class. - /// - public GenerateImageRequestV4Im2Im() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestV4Stable.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestV4Stable.Json.g.cs deleted file mode 100644 index 8fbccbcf..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestV4Stable.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class GenerateImageRequestV4Stable - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.GenerateImageRequestV4Stable? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.GenerateImageRequestV4Stable), - jsonSerializerContext) as global::Ideogram.GenerateImageRequestV4Stable; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.GenerateImageRequestV4Stable? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.GenerateImageRequestV4Stable? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.GenerateImageRequestV4Stable), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GenerateImageRequestV4Stable; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestV4Stable.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestV4Stable.g.cs deleted file mode 100644 index f189e5c5..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestV4Stable.g.cs +++ /dev/null @@ -1,113 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Request body for the stable Ideogram 4.0 endpoint. Supply exactly one
- /// of `text_prompt` or `json_prompt`. The model URI is pinned
- /// server-side. When `resolution` is omitted, the server chooses an
- /// aspect ratio automatically. - ///
- public sealed partial class GenerateImageRequestV4Stable - { - /// - /// A natural-language prompt for image generation. When supplied,
- /// magic-prompt is enabled automatically. Mutually exclusive with
- /// `json_prompt`. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("text_prompt")] - public string? TextPrompt { get; set; } - - /// - /// A structured prompt that conforms to the Ideogram 4.0 JSON
- /// contract. When supplied, magic-prompt is disabled and the
- /// structured prompt is consumed by the diffusion model directly.
- /// Mutually exclusive with `text_prompt`. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("json_prompt")] - public global::Ideogram.V4JsonPrompt? JsonPrompt { get; set; } - - /// - /// Random seed for reproducibility. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// Optional. When supplied, the image is generated at this
- /// resolution. When omitted, the server picks an aspect ratio
- /// automatically based on the prompt. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ResolutionV4JsonConverter))] - public global::Ideogram.ResolutionV4? Resolution { get; set; } - - /// - /// Optional. Selects a specific pinned stable build. When omitted,
- /// the default stable model URI is used. When set to `stable_may29`,
- /// the request is routed to the May 29th stable build. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("version")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.GenerateImageRequestV4StableVersionJsonConverter))] - public global::Ideogram.GenerateImageRequestV4StableVersion? Version { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// A natural-language prompt for image generation. When supplied,
- /// magic-prompt is enabled automatically. Mutually exclusive with
- /// `json_prompt`. - /// - /// - /// A structured prompt that conforms to the Ideogram 4.0 JSON
- /// contract. When supplied, magic-prompt is disabled and the
- /// structured prompt is consumed by the diffusion model directly.
- /// Mutually exclusive with `text_prompt`. - /// - /// - /// Random seed for reproducibility. - /// - /// - /// Optional. When supplied, the image is generated at this
- /// resolution. When omitted, the server picks an aspect ratio
- /// automatically based on the prompt. - /// - /// - /// Optional. Selects a specific pinned stable build. When omitted,
- /// the default stable model URI is used. When set to `stable_may29`,
- /// the request is routed to the May 29th stable build. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public GenerateImageRequestV4Stable( - string? textPrompt, - global::Ideogram.V4JsonPrompt? jsonPrompt, - int? seed, - global::Ideogram.ResolutionV4? resolution, - global::Ideogram.GenerateImageRequestV4StableVersion? version) - { - this.TextPrompt = textPrompt; - this.JsonPrompt = jsonPrompt; - this.Seed = seed; - this.Resolution = resolution; - this.Version = version; - } - - /// - /// Initializes a new instance of the class. - /// - public GenerateImageRequestV4Stable() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestV4StableVersion.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestV4StableVersion.g.cs deleted file mode 100644 index 8227b807..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestV4StableVersion.g.cs +++ /dev/null @@ -1,47 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Optional. Selects a specific pinned stable build. When omitted,
- /// the default stable model URI is used. When set to `stable_may29`,
- /// the request is routed to the May 29th stable build. - ///
- public enum GenerateImageRequestV4StableVersion - { - /// - /// - /// - StableMay29, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class GenerateImageRequestV4StableVersionExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this GenerateImageRequestV4StableVersion value) - { - return value switch - { - GenerateImageRequestV4StableVersion.StableMay29 => "stable_may29", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static GenerateImageRequestV4StableVersion? ToEnum(string value) - { - return value switch - { - "stable_may29" => GenerateImageRequestV4StableVersion.StableMay29, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestZImage.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestZImage.Json.g.cs deleted file mode 100644 index d4803354..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestZImage.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class GenerateImageRequestZImage - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.GenerateImageRequestZImage? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.GenerateImageRequestZImage), - jsonSerializerContext) as global::Ideogram.GenerateImageRequestZImage; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.GenerateImageRequestZImage? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.GenerateImageRequestZImage? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.GenerateImageRequestZImage), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GenerateImageRequestZImage; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestZImage.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestZImage.g.cs deleted file mode 100644 index b70c48b9..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestZImage.g.cs +++ /dev/null @@ -1,163 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Request body for the Z-Image generate endpoint. The base model is
- /// pinned server-side; supply `custom_model_uri` to layer a registered
- /// Z-Image LoRA finetune on the base.
- /// Width and height must each be a positive multiple of 16; the total
- /// area must not exceed 1,048,576 pixels (1024×1024). When `width` and
- /// `height` are omitted, the server uses the model's default 1024×1024. - ///
- public sealed partial class GenerateImageRequestZImage - { - /// - /// A natural-language prompt for image generation.
- /// Example: A futuristic cityscape at golden hour, highly detailed. - ///
- /// A futuristic cityscape at golden hour, highly detailed. - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Prompt { get; set; } - - /// - /// An optional system prompt applied alongside the prompt — use it for
- /// standing instructions such as style constraints or "do not render
- /// text". When omitted, no system prompt is applied. If you trained a
- /// LoRA with a system prompt, supply the same one here for best results.
- /// Example: Do not include any text in the image. - ///
- /// Do not include any text in the image. - [global::System.Text.Json.Serialization.JsonPropertyName("system_prompt")] - public string? SystemPrompt { get; set; } - - /// - /// Output width in pixels; must be a positive multiple of 16.
- /// Example: 1024 - ///
- /// 1024 - [global::System.Text.Json.Serialization.JsonPropertyName("width")] - public int? Width { get; set; } - - /// - /// Output height in pixels; must be a positive multiple of 16.
- /// Example: 1024 - ///
- /// 1024 - [global::System.Text.Json.Serialization.JsonPropertyName("height")] - public int? Height { get; set; } - - /// - /// Optional diffusion step count. When omitted, the server uses the
- /// model's default. Higher values trade latency for quality.
- /// Example: 8 - ///
- /// 8 - [global::System.Text.Json.Serialization.JsonPropertyName("num_inference_steps")] - public int? NumInferenceSteps { get; set; } - - /// - /// Random seed for reproducibility. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// Number of images to generate.
- /// Default Value: 1 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] - public int? NumImages { get; set; } - - /// - /// A custom model URI in the format model/<model_name>/version/<version_name>.
- /// When provided, the URI must resolve to a registered fine-tune of the
- /// Z-Image base model; the fine-tune's LoRA checkpoint is layered on
- /// the base. When omitted, the Z-Image base is used with no LoRA.
- /// Example: model/my-z-image-lora/version/0 - ///
- /// model/my-z-image-lora/version/0 - [global::System.Text.Json.Serialization.JsonPropertyName("custom_model_uri")] - public string? CustomModelUri { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// A natural-language prompt for image generation.
- /// Example: A futuristic cityscape at golden hour, highly detailed. - /// - /// - /// An optional system prompt applied alongside the prompt — use it for
- /// standing instructions such as style constraints or "do not render
- /// text". When omitted, no system prompt is applied. If you trained a
- /// LoRA with a system prompt, supply the same one here for best results.
- /// Example: Do not include any text in the image. - /// - /// - /// Output width in pixels; must be a positive multiple of 16.
- /// Example: 1024 - /// - /// - /// Output height in pixels; must be a positive multiple of 16.
- /// Example: 1024 - /// - /// - /// Optional diffusion step count. When omitted, the server uses the
- /// model's default. Higher values trade latency for quality.
- /// Example: 8 - /// - /// - /// Random seed for reproducibility. - /// - /// - /// Number of images to generate.
- /// Default Value: 1 - /// - /// - /// A custom model URI in the format model/<model_name>/version/<version_name>.
- /// When provided, the URI must resolve to a registered fine-tune of the
- /// Z-Image base model; the fine-tune's LoRA checkpoint is layered on
- /// the base. When omitted, the Z-Image base is used with no LoRA.
- /// Example: model/my-z-image-lora/version/0 - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public GenerateImageRequestZImage( - string prompt, - string? systemPrompt, - int? width, - int? height, - int? numInferenceSteps, - int? seed, - int? numImages, - string? customModelUri) - { - this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); - this.SystemPrompt = systemPrompt; - this.Width = width; - this.Height = height; - this.NumInferenceSteps = numInferenceSteps; - this.Seed = seed; - this.NumImages = numImages; - this.CustomModelUri = customModelUri; - } - - /// - /// Initializes a new instance of the class. - /// - public GenerateImageRequestZImage() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageResponse.Json.g.cs deleted file mode 100644 index 3ea36254..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageResponse.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class GenerateImageResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.GenerateImageResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.GenerateImageResponse), - jsonSerializerContext) as global::Ideogram.GenerateImageResponse; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.GenerateImageResponse? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.GenerateImageResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.GenerateImageResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GenerateImageResponse; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageResponse.g.cs deleted file mode 100644 index 70b12b4a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageResponse.g.cs +++ /dev/null @@ -1,77 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The response which contains information about the generated image, including the download link.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it.
- /// Example: {"data":[{"style_type":"REALISTIC","seed":12345,"upscaled_resolution":"4096x4096","prompt":"A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there\u0027s an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset.","resolution":"1024x1024","url":"https://ideogram.ai/api/images/direct/8YEpFzHuS-S6xXEGmCsf7g","is_image_safe":true},{"style_type":"REALISTIC","seed":12345,"upscaled_resolution":"4096x4096","prompt":"A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there\u0027s an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset.","resolution":"1024x1024","url":"https://ideogram.ai/api/images/direct/8YEpFzHuS-S6xXEGmCsf7g","is_image_safe":true}],"created":"2000-01-23T04:56:07\u002B00:00","request_id":"request_id"} - ///
- public sealed partial class GenerateImageResponse - { - /// - /// URL-safe base64 ID of the sampling request. Present when the caller
- /// supplied `webhook_url` and the request was accepted for async
- /// delivery; in that case `data` is omitted and the generated images
- /// will be POSTed to the customer's `webhook_url` when ready. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("request_id")] - public string? RequestId { get; set; } - - /// - /// The time the request was created. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("created")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.DateTime Created { get; set; } - - /// - /// A list of ImageObjects that contain the generated image(s). - /// - [global::System.Text.Json.Serialization.JsonPropertyName("data")] - public global::System.Collections.Generic.IList? Data { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The time the request was created. - /// - /// - /// URL-safe base64 ID of the sampling request. Present when the caller
- /// supplied `webhook_url` and the request was accepted for async
- /// delivery; in that case `data` is omitted and the generated images
- /// will be POSTed to the customer's `webhook_url` when ready. - /// - /// - /// A list of ImageObjects that contain the generated image(s). - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public GenerateImageResponse( - global::System.DateTime created, - string? requestId, - global::System.Collections.Generic.IList? data) - { - this.RequestId = requestId; - this.Created = created; - this.Data = data; - } - - /// - /// Initializes a new instance of the class. - /// - public GenerateImageResponse() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageSafetyError.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageSafetyError.Json.g.cs deleted file mode 100644 index be9ec203..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageSafetyError.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class GenerateImageSafetyError - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.GenerateImageSafetyError? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.GenerateImageSafetyError), - jsonSerializerContext) as global::Ideogram.GenerateImageSafetyError; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.GenerateImageSafetyError? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.GenerateImageSafetyError? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.GenerateImageSafetyError), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GenerateImageSafetyError; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageSafetyError.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageSafetyError.g.cs deleted file mode 100644 index 4de077bb..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageSafetyError.g.cs +++ /dev/null @@ -1,48 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"error":"Prompt provided failed safety check due to the inclusion of prohibited content."} - /// - public sealed partial class GenerateImageSafetyError - { - /// - /// Example: Prompt provided failed safety check due to the inclusion of prohibited content. - /// - /// Prompt provided failed safety check due to the inclusion of prohibited content. - [global::System.Text.Json.Serialization.JsonPropertyName("error")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Error { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Example: Prompt provided failed safety check due to the inclusion of prohibited content. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public GenerateImageSafetyError( - string error) - { - this.Error = error ?? throw new global::System.ArgumentNullException(nameof(error)); - } - - /// - /// Initializes a new instance of the class. - /// - public GenerateImageSafetyError() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageV2AutoRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageV2AutoRequest.Json.g.cs deleted file mode 100644 index 94d108c8..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageV2AutoRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class GenerateImageV2AutoRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.GenerateImageV2AutoRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.GenerateImageV2AutoRequest), - jsonSerializerContext) as global::Ideogram.GenerateImageV2AutoRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.GenerateImageV2AutoRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.GenerateImageV2AutoRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.GenerateImageV2AutoRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GenerateImageV2AutoRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageV2AutoRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageV2AutoRequest.g.cs deleted file mode 100644 index 62915009..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageV2AutoRequest.g.cs +++ /dev/null @@ -1,216 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Source `images` are optional. When supplied, Ideogram picks a model
- /// that can edit them and the prompt describes the change.
- /// `negative_prompt` cannot be combined with source images. - ///
- public sealed partial class GenerateImageV2AutoRequest - { - /// - /// The prompt to generate images from or, when source images are supplied, the change to make to them. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Prompt { get; set; } - - /// - /// Existing upload or generated image assets to transform, by reference. Takes priority over `images` if both are supplied. Supplying sources turns the request into a transform. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image_asset_identifiers")] - public global::System.Collections.Generic.IList? ImageAssetIdentifiers { get; set; } - - /// - /// Optional source images to edit (max 10, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("images")] - public global::System.Collections.Generic.IList? Images { get; set; } - - /// - /// Description of what to exclude from the images. The prompt takes precedence over the negative prompt. Not every model uses it. Cannot be combined with source images. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("negative_prompt")] - public string? NegativePrompt { get; set; } - - /// - /// Existing upload or generated image assets whose style should guide the generation, by reference. Cannot be combined with source images. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("style_reference_asset_identifiers")] - public global::System.Collections.Generic.IList? StyleReferenceAssetIdentifiers { get; set; } - - /// - /// The output aspect ratio. `auto` (the default) picks the most suitable ratio for the request. Without source images the value must be a supported ratio (for example "16x9" or "1x1"); with source images any "WIDTHxHEIGHT" value is accepted and the output uses the closest supported shape. Omit `resolution` when supplying a non-`auto` value.
- /// Default Value: auto - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] - public string? AspectRatio { get; set; } - - /// - /// The requested output resolution, formatted as "WIDTHxHEIGHT" (for example "1280x800"). The output is served at the closest resolution the selected model supports. Omit `aspect_ratio` (or leave it `auto`) when supplying a resolution. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] - public string? Resolution { get; set; } - - /// - /// The output resolution tier. Affects which model serves the request, since not every model offers every tier. When omitted, the selected model's default tier is used. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("resolution_tier")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.GenerateImageV2AutoRequestResolutionTierJsonConverter))] - public global::Ideogram.GenerateImageV2AutoRequestResolutionTier? ResolutionTier { get; set; } - - /// - /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
- /// Default Value: auto - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.MagicPromptModeJsonConverter))] - public global::Ideogram.MagicPromptMode? MagicPrompt { get; set; } - - /// - /// The number of images to generate.
- /// Default Value: 1 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] - public int? NumImages { get; set; } - - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - ///
- /// 12345 - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// Whether the generated images should be kept private. When omitted, the default follows the caller's plan; some plans always generate privately. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("target_collection_id")] - public string? TargetCollectionId { get; set; } - - /// - /// The internal generation category to attribute to the output, as a URL-safe base64 UUID without padding. Only applies when source images are supplied. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("category_id")] - public string? CategoryId { get; set; } - - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("async")] - public bool? Async { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The prompt to generate images from or, when source images are supplied, the change to make to them. - /// - /// - /// Existing upload or generated image assets to transform, by reference. Takes priority over `images` if both are supplied. Supplying sources turns the request into a transform. - /// - /// - /// Optional source images to edit (max 10, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only. - /// - /// - /// Description of what to exclude from the images. The prompt takes precedence over the negative prompt. Not every model uses it. Cannot be combined with source images. - /// - /// - /// Existing upload or generated image assets whose style should guide the generation, by reference. Cannot be combined with source images. - /// - /// - /// The output aspect ratio. `auto` (the default) picks the most suitable ratio for the request. Without source images the value must be a supported ratio (for example "16x9" or "1x1"); with source images any "WIDTHxHEIGHT" value is accepted and the output uses the closest supported shape. Omit `resolution` when supplying a non-`auto` value.
- /// Default Value: auto - /// - /// - /// The requested output resolution, formatted as "WIDTHxHEIGHT" (for example "1280x800"). The output is served at the closest resolution the selected model supports. Omit `aspect_ratio` (or leave it `auto`) when supplying a resolution. - /// - /// - /// The output resolution tier. Affects which model serves the request, since not every model offers every tier. When omitted, the selected model's default tier is used. - /// - /// - /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
- /// Default Value: auto - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// Whether the generated images should be kept private. When omitted, the default follows the caller's plan; some plans always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - /// - /// The internal generation category to attribute to the output, as a URL-safe base64 UUID without padding. Only applies when source images are supplied. - /// - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public GenerateImageV2AutoRequest( - string prompt, - global::System.Collections.Generic.IList? imageAssetIdentifiers, - global::System.Collections.Generic.IList? images, - string? negativePrompt, - global::System.Collections.Generic.IList? styleReferenceAssetIdentifiers, - string? aspectRatio, - string? resolution, - global::Ideogram.GenerateImageV2AutoRequestResolutionTier? resolutionTier, - global::Ideogram.MagicPromptMode? magicPrompt, - int? numImages, - int? seed, - bool? @private, - string? targetCollectionId, - string? categoryId, - bool? async) - { - this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); - this.ImageAssetIdentifiers = imageAssetIdentifiers; - this.Images = images; - this.NegativePrompt = negativePrompt; - this.StyleReferenceAssetIdentifiers = styleReferenceAssetIdentifiers; - this.AspectRatio = aspectRatio; - this.Resolution = resolution; - this.ResolutionTier = resolutionTier; - this.MagicPrompt = magicPrompt; - this.NumImages = numImages; - this.Seed = seed; - this.Private = @private; - this.TargetCollectionId = targetCollectionId; - this.CategoryId = categoryId; - this.Async = async; - } - - /// - /// Initializes a new instance of the class. - /// - public GenerateImageV2AutoRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageV2AutoRequestResolutionTier.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageV2AutoRequestResolutionTier.g.cs deleted file mode 100644 index 20033d7a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageV2AutoRequestResolutionTier.g.cs +++ /dev/null @@ -1,57 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The output resolution tier. Affects which model serves the request, since not every model offers every tier. When omitted, the selected model's default tier is used. - /// - public enum GenerateImageV2AutoRequestResolutionTier - { - /// - /// - /// - x1k, - /// - /// - /// - x2k, - /// - /// - /// - x4k, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class GenerateImageV2AutoRequestResolutionTierExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this GenerateImageV2AutoRequestResolutionTier value) - { - return value switch - { - GenerateImageV2AutoRequestResolutionTier.x1k => "1k", - GenerateImageV2AutoRequestResolutionTier.x2k => "2k", - GenerateImageV2AutoRequestResolutionTier.x4k => "4k", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static GenerateImageV2AutoRequestResolutionTier? ToEnum(string value) - { - return value switch - { - "1k" => GenerateImageV2AutoRequestResolutionTier.x1k, - "2k" => GenerateImageV2AutoRequestResolutionTier.x2k, - "4k" => GenerateImageV2AutoRequestResolutionTier.x4k, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageV2AutoResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageV2AutoResponse.g.cs index d968a619..6f1e40c8 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageV2AutoResponse.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageV2AutoResponse.g.cs @@ -9,8 +9,7 @@ namespace Ideogram /// Asynchronous requests omit `data`; poll
/// `GET /v2/generations/{generation_id}` with the returned
/// `generation_id`. `seed` is the seed that was used, including when you
- /// did not set one.
- /// Example: {"data":[{"seed":12345,"prompt":"prompt","resolution":"1024x1024","url":"https://openapi-generator.tech","is_image_safe":true},{"seed":12345,"prompt":"prompt","resolution":"1024x1024","url":"https://openapi-generator.tech","is_image_safe":true}],"seed":12345,"generation_id":"generation_id"} + /// did not set one. /// public sealed partial class GenerateImageV2AutoResponse { @@ -29,10 +28,8 @@ public sealed partial class GenerateImageV2AutoResponse public global::System.Collections.Generic.IList? Data { get; set; } /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. ///
- /// 12345 [global::System.Text.Json.Serialization.JsonPropertyName("seed")] [global::System.Text.Json.Serialization.JsonRequired] public required int Seed { get; set; } @@ -51,8 +48,7 @@ public sealed partial class GenerateImageV2AutoResponse /// `GET /v2/generations/{generation_id}`. /// /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. /// /// /// The generated images, in generation order. Present only for synchronous requests (`async` omitted or false). diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageZImageRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageZImageRequest.g.cs index 90a40894..cb42cacf 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageZImageRequest.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageZImageRequest.g.cs @@ -4,41 +4,33 @@ namespace Ideogram { /// - /// Example: {"async":false,"private":true,"seed":12345,"webhook_url":"https://api.example.com/webhooks/ideogram","target_collection_id":"target_collection_id","prompt":"A futuristic cityscape at golden hour, highly detailed.","resolution":"1024x1024","num_images":1,"num_inference_steps":8} + /// /// public sealed partial class GenerateImageZImageRequest { /// - /// The prompt to generate images from.
- /// Example: A futuristic cityscape at golden hour, highly detailed. + /// The prompt to generate images from. ///
- /// A futuristic cityscape at golden hour, highly detailed. [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] [global::System.Text.Json.Serialization.JsonRequired] public required string Prompt { get; set; } /// - /// Exact output resolution, formatted as "WIDTHxHEIGHT". Each side must be a positive multiple of 16 and the total area must not exceed 1,048,576 pixels (1024×1024). When omitted, the model's default 1024×1024 is used.
- /// Example: 1024x1024 + /// Exact output resolution, formatted as "WIDTHxHEIGHT". Each side must be a positive multiple of 16 and the total area must not exceed 1,048,576 pixels (1024×1024). When omitted, the model's default 1024×1024 is used. ///
- /// 1024x1024 [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] public string? Resolution { get; set; } /// /// Optional number of diffusion steps. When omitted, the model's
- /// default is used. Higher values improve quality but take longer.
- /// Example: 8 + /// default is used. Higher values improve quality but take longer. ///
- /// 8 [global::System.Text.Json.Serialization.JsonPropertyName("num_inference_steps")] public int? NumInferenceSteps { get; set; } /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. ///
- /// 12345 [global::System.Text.Json.Serialization.JsonPropertyName("seed")] public int? Seed { get; set; } @@ -64,25 +56,11 @@ public sealed partial class GenerateImageZImageRequest /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
/// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
/// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram + /// private and loopback hosts and the cloud metadata service are rejected. /// - /// https://api.example.com/webhooks/ideogram [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] public string? WebhookUrl { get; set; } - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("target_collection_id")] - public string? TargetCollectionId { get; set; } - /// /// Additional properties that are not explicitly defined in the schema /// @@ -93,21 +71,17 @@ public sealed partial class GenerateImageZImageRequest /// Initializes a new instance of the class. /// /// - /// The prompt to generate images from.
- /// Example: A futuristic cityscape at golden hour, highly detailed. + /// The prompt to generate images from. /// /// - /// Exact output resolution, formatted as "WIDTHxHEIGHT". Each side must be a positive multiple of 16 and the total area must not exceed 1,048,576 pixels (1024×1024). When omitted, the model's default 1024×1024 is used.
- /// Example: 1024x1024 + /// Exact output resolution, formatted as "WIDTHxHEIGHT". Each side must be a positive multiple of 16 and the total area must not exceed 1,048,576 pixels (1024×1024). When omitted, the model's default 1024×1024 is used. /// /// /// Optional number of diffusion steps. When omitted, the model's
- /// default is used. Higher values improve quality but take longer.
- /// Example: 8 + /// default is used. Higher values improve quality but take longer. /// /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. /// /// /// The number of images to generate.
@@ -125,14 +99,7 @@ public sealed partial class GenerateImageZImageRequest /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
/// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
/// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. + /// private and loopback hosts and the cloud metadata service are rejected. /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -144,9 +111,7 @@ public GenerateImageZImageRequest( int? seed, int? numImages, bool? async, - string? webhookUrl, - bool? @private, - string? targetCollectionId) + string? webhookUrl) { this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); this.Resolution = resolution; @@ -155,8 +120,6 @@ public GenerateImageZImageRequest( this.NumImages = numImages; this.Async = async; this.WebhookUrl = webhookUrl; - this.Private = @private; - this.TargetCollectionId = targetCollectionId; } /// diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageZImageResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageZImageResponse.g.cs index 320d2ffc..59585e91 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageZImageResponse.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageZImageResponse.g.cs @@ -9,8 +9,7 @@ namespace Ideogram /// Asynchronous requests omit `data`; poll
/// `GET /v2/generations/{generation_id}` with the returned
/// `generation_id`. `seed` is the seed that was used, including when you
- /// did not set one.
- /// Example: {"data":[{"seed":12345,"prompt":"prompt","resolution":"1024x1024","url":"https://openapi-generator.tech","is_image_safe":true},{"seed":12345,"prompt":"prompt","resolution":"1024x1024","url":"https://openapi-generator.tech","is_image_safe":true}],"seed":12345,"generation_id":"generation_id"} + /// did not set one. ///
public sealed partial class GenerateImageZImageResponse { @@ -29,10 +28,8 @@ public sealed partial class GenerateImageZImageResponse public global::System.Collections.Generic.IList? Data { get; set; } /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. ///
- /// 12345 [global::System.Text.Json.Serialization.JsonPropertyName("seed")] [global::System.Text.Json.Serialization.JsonRequired] public required int Seed { get; set; } @@ -51,8 +48,7 @@ public sealed partial class GenerateImageZImageResponse /// `GET /v2/generations/{generation_id}`. /// /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. /// /// /// The generated images, in generation order. Present only for synchronous requests (`async` omitted or false). diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateTransparentImageRequestV3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateTransparentImageRequestV3.Json.g.cs deleted file mode 100644 index b187e729..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateTransparentImageRequestV3.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class GenerateTransparentImageRequestV3 - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.GenerateTransparentImageRequestV3? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.GenerateTransparentImageRequestV3), - jsonSerializerContext) as global::Ideogram.GenerateTransparentImageRequestV3; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.GenerateTransparentImageRequestV3? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.GenerateTransparentImageRequestV3? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.GenerateTransparentImageRequestV3), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GenerateTransparentImageRequestV3; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateTransparentImageRequestV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateTransparentImageRequestV3.g.cs deleted file mode 100644 index 4b164974..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateTransparentImageRequestV3.g.cs +++ /dev/null @@ -1,199 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - public sealed partial class GenerateTransparentImageRequestV3 - { - /// - /// The prompt to use to generate the image.
- /// Example: A photo of a cat - ///
- /// A photo of a cat - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Prompt { get; set; } - - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - ///
- /// 12345 - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// Upscale the initially generated image by the given factor. Upscale factors other than X1 will incur additional cost.
- /// Default Value: X1
- /// Example: X2 - ///
- /// X2 - [global::System.Text.Json.Serialization.JsonPropertyName("upscale_factor")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.UpscaleFactorJsonConverter))] - public global::Ideogram.UpscaleFactor? UpscaleFactor { get; set; } - - /// - /// Output aspect ratio. Cannot be combined with resolution. Generation defaults to 1x1; remix keeps the source ratio when both fields are omitted. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.AspectRatioV3JsonConverter))] - public global::Ideogram.AspectRatioV3? AspectRatio { get; set; } - - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("rendering_speed")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.RenderingSpeedJsonConverter))] - public global::Ideogram.RenderingSpeed? RenderingSpeed { get; set; } - - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - ///
- /// ON - [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.MagicPromptOptionJsonConverter))] - public global::Ideogram.MagicPromptOption? MagicPrompt { get; set; } - - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt_system_prompt_config_id")] - public string? MagicPromptSystemPromptConfigId { get; set; } - - /// - /// Description of what to exclude from an image. Descriptions in the prompt take precedence
- /// to descriptions in the negative prompt.
- /// Example: brush strokes, painting - ///
- /// brush strokes, painting - [global::System.Text.Json.Serialization.JsonPropertyName("negative_prompt")] - public string? NegativePrompt { get; set; } - - /// - /// Number of images to generate.
- /// Default Value: 1 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] - public int? NumImages { get; set; } - - /// - /// A custom model URI in the format model/<model_name>/version/<version_name>.
- /// When provided, the model version and style will be resolved from this URI, and style_type is not required.
- /// A model must be able to generate transparent background to be used for this endpoint.
- /// Example: model/my-custom-model/version/1 - ///
- /// model/my-custom-model/version/1 - [global::System.Text.Json.Serialization.JsonPropertyName("custom_model_uri")] - public string? CustomModelUri { get; set; } - - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). The effective gate is the OR of this field and the organization's
- /// `copyright_detection_enabled` setting on `/api`: if the org has it on, this is ignored;
- /// if the org has it off, setting this `true` enables detection for this request only.
- /// Adds detection latency. Flagged images come back with `is_image_safe: false`. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("enable_copyright_detection")] - public bool? EnableCopyrightDetection { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The prompt to use to generate the image.
- /// Example: A photo of a cat - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// Upscale the initially generated image by the given factor. Upscale factors other than X1 will incur additional cost.
- /// Default Value: X1
- /// Example: X2 - /// - /// - /// Output aspect ratio. Cannot be combined with resolution. Generation defaults to 1x1; remix keeps the source ratio when both fields are omitted. - /// - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// Description of what to exclude from an image. Descriptions in the prompt take precedence
- /// to descriptions in the negative prompt.
- /// Example: brush strokes, painting - /// - /// - /// Number of images to generate.
- /// Default Value: 1 - /// - /// - /// A custom model URI in the format model/<model_name>/version/<version_name>.
- /// When provided, the model version and style will be resolved from this URI, and style_type is not required.
- /// A model must be able to generate transparent background to be used for this endpoint.
- /// Example: model/my-custom-model/version/1 - /// - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). The effective gate is the OR of this field and the organization's
- /// `copyright_detection_enabled` setting on `/api`: if the org has it on, this is ignored;
- /// if the org has it off, setting this `true` enables detection for this request only.
- /// Adds detection latency. Flagged images come back with `is_image_safe: false`. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public GenerateTransparentImageRequestV3( - string prompt, - int? seed, - global::Ideogram.UpscaleFactor? upscaleFactor, - global::Ideogram.AspectRatioV3? aspectRatio, - global::Ideogram.RenderingSpeed? renderingSpeed, - global::Ideogram.MagicPromptOption? magicPrompt, - string? magicPromptSystemPromptConfigId, - string? negativePrompt, - int? numImages, - string? customModelUri, - bool? enableCopyrightDetection) - { - this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); - this.Seed = seed; - this.UpscaleFactor = upscaleFactor; - this.AspectRatio = aspectRatio; - this.RenderingSpeed = renderingSpeed; - this.MagicPrompt = magicPrompt; - this.MagicPromptSystemPromptConfigId = magicPromptSystemPromptConfigId; - this.NegativePrompt = negativePrompt; - this.NumImages = numImages; - this.CustomModelUri = customModelUri; - this.EnableCopyrightDetection = enableCopyrightDetection; - } - - /// - /// Initializes a new instance of the class. - /// - public GenerateTransparentImageRequestV3() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateTransparentImageRequestV4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateTransparentImageRequestV4.Json.g.cs deleted file mode 100644 index a26a981e..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateTransparentImageRequestV4.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class GenerateTransparentImageRequestV4 - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.GenerateTransparentImageRequestV4? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.GenerateTransparentImageRequestV4), - jsonSerializerContext) as global::Ideogram.GenerateTransparentImageRequestV4; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.GenerateTransparentImageRequestV4? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.GenerateTransparentImageRequestV4? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.GenerateTransparentImageRequestV4), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GenerateTransparentImageRequestV4; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateTransparentImageRequestV4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateTransparentImageRequestV4.g.cs deleted file mode 100644 index d91745d7..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateTransparentImageRequestV4.g.cs +++ /dev/null @@ -1,173 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Request body for Ideogram 4.0 transparent-background image generation.
- /// Supply exactly one of `text_prompt` or `json_prompt`. When
- /// `text_prompt` is supplied, magic-prompt is applied automatically. When
- /// `json_prompt` is supplied, magic-prompt is skipped and the structured
- /// prompt is consumed directly; its `compositional_deconstruction.background`
- /// is replaced with a transparent-background directive. - ///
- public sealed partial class GenerateTransparentImageRequestV4 - { - /// - /// A natural-language prompt for image generation. When supplied,
- /// magic-prompt is enabled automatically. Mutually exclusive with
- /// `json_prompt`. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("text_prompt")] - public string? TextPrompt { get; set; } - - /// - /// A structured prompt that conforms to the Ideogram 4.0 JSON
- /// contract. When supplied, magic-prompt is disabled and the
- /// structured prompt is consumed by the diffusion model directly,
- /// except that `compositional_deconstruction.background` is replaced
- /// with a transparent-background directive. Mutually exclusive with
- /// `text_prompt`. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("json_prompt")] - public global::Ideogram.V4JsonPrompt? JsonPrompt { get; set; } - - /// - /// Random seed for reproducibility. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// A base64url-encoded magic prompt system prompt config ID to use
- /// for this request. Honored when `text_prompt` is supplied. Ignored
- /// when `json_prompt` is supplied. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt_system_prompt_config_id")] - public string? MagicPromptSystemPromptConfigId { get; set; } - - /// - /// The aspect ratio for an Ideogram 4.0 magic prompt. `AUTO` lets the
- /// model select the most suitable ratio from the prompt; any other value
- /// pins the ratio. The non-AUTO values are the buckets the 4.0 model
- /// supports.
- /// Default Value: AUTO - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.AspectRatioV4JsonConverter))] - public global::Ideogram.AspectRatioV4? AspectRatio { get; set; } - - /// - /// The output resolution tier for the generated image. Tiers are
- /// total-pixel budgets matching a square of the named size (for example,
- /// `8K` delivers at most 8192x8192 total pixels); wide and tall aspect
- /// ratios keep the same pixel budget, so a single dimension may exceed
- /// the named size. Defaults to 1K.
- /// Default Value: 1K - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("output_resolution")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.OutputResolutionJsonConverter))] - public global::Ideogram.OutputResolution? OutputResolution { get; set; } - - /// - /// The rendering speed to use. Defaults to DEFAULT.
- /// Default Value: DEFAULT - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("rendering_speed")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.RenderingSpeedV4JsonConverter))] - public global::Ideogram.RenderingSpeedV4? RenderingSpeed { get; set; } - - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). The effective gate is the OR of this field and the organization's
- /// `copyright_detection_enabled` setting on `/api`. See GenerateImageRequestV3 for details. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("enable_copyright_detection")] - public bool? EnableCopyrightDetection { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// A natural-language prompt for image generation. When supplied,
- /// magic-prompt is enabled automatically. Mutually exclusive with
- /// `json_prompt`. - /// - /// - /// A structured prompt that conforms to the Ideogram 4.0 JSON
- /// contract. When supplied, magic-prompt is disabled and the
- /// structured prompt is consumed by the diffusion model directly,
- /// except that `compositional_deconstruction.background` is replaced
- /// with a transparent-background directive. Mutually exclusive with
- /// `text_prompt`. - /// - /// - /// Random seed for reproducibility. - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use
- /// for this request. Honored when `text_prompt` is supplied. Ignored
- /// when `json_prompt` is supplied. - /// - /// - /// The aspect ratio for an Ideogram 4.0 magic prompt. `AUTO` lets the
- /// model select the most suitable ratio from the prompt; any other value
- /// pins the ratio. The non-AUTO values are the buckets the 4.0 model
- /// supports.
- /// Default Value: AUTO - /// - /// - /// The output resolution tier for the generated image. Tiers are
- /// total-pixel budgets matching a square of the named size (for example,
- /// `8K` delivers at most 8192x8192 total pixels); wide and tall aspect
- /// ratios keep the same pixel budget, so a single dimension may exceed
- /// the named size. Defaults to 1K.
- /// Default Value: 1K - /// - /// - /// The rendering speed to use. Defaults to DEFAULT.
- /// Default Value: DEFAULT - /// - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). The effective gate is the OR of this field and the organization's
- /// `copyright_detection_enabled` setting on `/api`. See GenerateImageRequestV3 for details. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public GenerateTransparentImageRequestV4( - string? textPrompt, - global::Ideogram.V4JsonPrompt? jsonPrompt, - int? seed, - string? magicPromptSystemPromptConfigId, - global::Ideogram.AspectRatioV4? aspectRatio, - global::Ideogram.OutputResolution? outputResolution, - global::Ideogram.RenderingSpeedV4? renderingSpeed, - bool? enableCopyrightDetection) - { - this.TextPrompt = textPrompt; - this.JsonPrompt = jsonPrompt; - this.Seed = seed; - this.MagicPromptSystemPromptConfigId = magicPromptSystemPromptConfigId; - this.AspectRatio = aspectRatio; - this.OutputResolution = outputResolution; - this.RenderingSpeed = renderingSpeed; - this.EnableCopyrightDetection = enableCopyrightDetection; - } - - /// - /// Initializes a new instance of the class. - /// - public GenerateTransparentImageRequestV4() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoKlingV3Response.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoKlingV3Response.g.cs index 58468ed4..535afaed 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoKlingV3Response.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoKlingV3Response.g.cs @@ -8,8 +8,7 @@ namespace Ideogram /// part of this response: poll `GET /v2/generations/{generation_id}` with
/// the returned `generation_id`, or receive it at your `webhook_url`.
/// Video links expire after a limited time, so download any video you
- /// want to keep.
- /// Example: {"generation_id":"generation_id","created":"2000-01-23T04:56:07\u002B00:00"} + /// want to keep. /// public sealed partial class GenerateVideoKlingV3Response { diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoKlingV3StandardImageToVideoRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoKlingV3StandardImageToVideoRequest.Json.g.cs deleted file mode 100644 index 03a06193..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoKlingV3StandardImageToVideoRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class GenerateVideoKlingV3StandardImageToVideoRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.GenerateVideoKlingV3StandardImageToVideoRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.GenerateVideoKlingV3StandardImageToVideoRequest), - jsonSerializerContext) as global::Ideogram.GenerateVideoKlingV3StandardImageToVideoRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.GenerateVideoKlingV3StandardImageToVideoRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.GenerateVideoKlingV3StandardImageToVideoRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.GenerateVideoKlingV3StandardImageToVideoRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GenerateVideoKlingV3StandardImageToVideoRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoKlingV3StandardImageToVideoRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoKlingV3StandardImageToVideoRequest.g.cs deleted file mode 100644 index 9fa65658..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoKlingV3StandardImageToVideoRequest.g.cs +++ /dev/null @@ -1,243 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Request body for Kling v3 Standard image-to-video generation.
- /// Upload the first frame as `image`, and optionally a final frame as
- /// `end_image`, using `multipart/form-data`. The video takes its aspect
- /// ratio from the first frame, so there is no `aspect_ratio` field. - ///
- public sealed partial class GenerateVideoKlingV3StandardImageToVideoRequest - { - /// - /// A reference to an image already stored with Ideogram to use as the first frame, in place of uploading `image`. Only image assets are accepted. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image_asset_identifier")] - public global::Ideogram.AssetIdentifier? ImageAssetIdentifier { get; set; } - - /// - /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image")] - public byte[]? Image { get; set; } - - /// - /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] - public string? Imagename { get; set; } - - /// - /// An optional final frame, as a reference to an image already stored with Ideogram. When supplied, the generated video transitions from the first frame to this one. Only image assets are accepted. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("end_image_asset_identifier")] - public global::Ideogram.AssetIdentifier? EndImageAssetIdentifier { get; set; } - - /// - /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("end_image")] - public byte[]? EndImage { get; set; } - - /// - /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("end_imagename")] - public string? EndImagename { get; set; } - - /// - /// A natural-language prompt describing how the first frame should animate.
- /// Example: The camera slowly pans right as the waves roll in. - ///
- /// The camera slowly pans right as the waves roll in. - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Prompt { get; set; } - - /// - /// Description of what to keep out of the video. Descriptions in the prompt take precedence over descriptions in the negative prompt. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("negative_prompt")] - public string? NegativePrompt { get; set; } - - /// - /// The length of the generated video in seconds. Defaults to 5 seconds
- /// when omitted.
- /// Example: 5 - ///
- /// 5 - [global::System.Text.Json.Serialization.JsonPropertyName("duration")] - public int? Duration { get; set; } - - /// - /// Whether to generate an audio track for the video. Audio roughly
- /// doubles the provider cost and is subject to stricter output moderation.
- /// Default Value: false - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("generate_audio")] - public bool? GenerateAudio { get; set; } - - /// - /// How the prompt is staged. `customize` follows the prompt as written;
- /// `intelligent` lets the model break the prompt into its own shots.
- /// Default Value: customize - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("shot_type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.KlingV3ShotTypeJsonConverter))] - public global::Ideogram.KlingV3ShotType? ShotType { get; set; } - - /// - /// How closely the video follows the prompt, from 0 to 1. Lower values
- /// leave the model more freedom. Defaults to 0.5 when omitted.
- /// Example: 0.5F - ///
- /// 0.5F - [global::System.Text.Json.Serialization.JsonPropertyName("cfg_scale")] - public float? CfgScale { get; set; } - - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - ///
- /// https://api.example.com/webhooks/ideogram - [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] - public string? WebhookUrl { get; set; } - - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output videos are added to it when the request completes. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("target_collection_id")] - public string? TargetCollectionId { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// A natural-language prompt describing how the first frame should animate.
- /// Example: The camera slowly pans right as the waves roll in. - /// - /// - /// A reference to an image already stored with Ideogram to use as the first frame, in place of uploading `image`. Only image assets are accepted. - /// - /// - /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - /// - /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - /// - /// An optional final frame, as a reference to an image already stored with Ideogram. When supplied, the generated video transitions from the first frame to this one. Only image assets are accepted. - /// - /// - /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. - /// - /// - /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. - /// - /// - /// Description of what to keep out of the video. Descriptions in the prompt take precedence over descriptions in the negative prompt. - /// - /// - /// The length of the generated video in seconds. Defaults to 5 seconds
- /// when omitted.
- /// Example: 5 - /// - /// - /// Whether to generate an audio track for the video. Audio roughly
- /// doubles the provider cost and is subject to stricter output moderation.
- /// Default Value: false - /// - /// - /// How the prompt is staged. `customize` follows the prompt as written;
- /// `intelligent` lets the model break the prompt into its own shots.
- /// Default Value: customize - /// - /// - /// How closely the video follows the prompt, from 0 to 1. Lower values
- /// leave the model more freedom. Defaults to 0.5 when omitted.
- /// Example: 0.5F - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output videos are added to it when the request completes. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public GenerateVideoKlingV3StandardImageToVideoRequest( - string prompt, - global::Ideogram.AssetIdentifier? imageAssetIdentifier, - byte[]? image, - string? imagename, - global::Ideogram.AssetIdentifier? endImageAssetIdentifier, - byte[]? endImage, - string? endImagename, - string? negativePrompt, - int? duration, - bool? generateAudio, - global::Ideogram.KlingV3ShotType? shotType, - float? cfgScale, - string? webhookUrl, - bool? @private, - string? targetCollectionId) - { - this.ImageAssetIdentifier = imageAssetIdentifier; - this.Image = image; - this.Imagename = imagename; - this.EndImageAssetIdentifier = endImageAssetIdentifier; - this.EndImage = endImage; - this.EndImagename = endImagename; - this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); - this.NegativePrompt = negativePrompt; - this.Duration = duration; - this.GenerateAudio = generateAudio; - this.ShotType = shotType; - this.CfgScale = cfgScale; - this.WebhookUrl = webhookUrl; - this.Private = @private; - this.TargetCollectionId = targetCollectionId; - } - - /// - /// Initializes a new instance of the class. - /// - public GenerateVideoKlingV3StandardImageToVideoRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoKlingV3StandardTextToVideoRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoKlingV3StandardTextToVideoRequest.g.cs index ac067a9e..1fe1924b 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoKlingV3StandardTextToVideoRequest.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoKlingV3StandardTextToVideoRequest.g.cs @@ -4,16 +4,13 @@ namespace Ideogram { /// - /// Request body for Kling v3 Standard text-to-video generation.
- /// Example: {"duration":5,"shot_type":null,"aspect_ratio":null,"private":true,"webhook_url":"https://api.example.com/webhooks/ideogram","negative_prompt":"negative_prompt","target_collection_id":"target_collection_id","generate_audio":false,"prompt":"A red fox running through a snowy forest at dawn.","cfg_scale":0.5} + /// Request body for Kling v3 Standard text-to-video generation. ///
public sealed partial class GenerateVideoKlingV3StandardTextToVideoRequest { /// - /// A natural-language prompt describing the video to generate.
- /// Example: A red fox running through a snowy forest at dawn. + /// A natural-language prompt describing the video to generate. ///
- /// A red fox running through a snowy forest at dawn. [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] [global::System.Text.Json.Serialization.JsonRequired] public required string Prompt { get; set; } @@ -34,10 +31,8 @@ public sealed partial class GenerateVideoKlingV3StandardTextToVideoRequest /// /// The length of the generated video in seconds. Defaults to 5 seconds
- /// when omitted.
- /// Example: 5 + /// when omitted. ///
- /// 5 [global::System.Text.Json.Serialization.JsonPropertyName("duration")] public int? Duration { get; set; } @@ -60,12 +55,10 @@ public sealed partial class GenerateVideoKlingV3StandardTextToVideoRequest /// /// How closely the video follows the prompt, from 0 to 1. Lower values
- /// leave the model more freedom. Defaults to 0.5 when omitted.
- /// Example: 0.5F + /// leave the model more freedom. Defaults to 0.5 when omitted. ///
- /// 0.5F [global::System.Text.Json.Serialization.JsonPropertyName("cfg_scale")] - public float? CfgScale { get; set; } + public string? CfgScale { get; set; } /// /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
@@ -75,25 +68,11 @@ public sealed partial class GenerateVideoKlingV3StandardTextToVideoRequest /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
/// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
/// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram + /// private and loopback hosts and the cloud metadata service are rejected. ///
- /// https://api.example.com/webhooks/ideogram [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] public string? WebhookUrl { get; set; } - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output videos are added to it when the request completes. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("target_collection_id")] - public string? TargetCollectionId { get; set; } - /// /// Additional properties that are not explicitly defined in the schema /// @@ -104,8 +83,7 @@ public sealed partial class GenerateVideoKlingV3StandardTextToVideoRequest /// Initializes a new instance of the class. /// /// - /// A natural-language prompt describing the video to generate.
- /// Example: A red fox running through a snowy forest at dawn. + /// A natural-language prompt describing the video to generate. /// /// /// Description of what to keep out of the video. Descriptions in the prompt take precedence over descriptions in the negative prompt. @@ -116,8 +94,7 @@ public sealed partial class GenerateVideoKlingV3StandardTextToVideoRequest /// /// /// The length of the generated video in seconds. Defaults to 5 seconds
- /// when omitted.
- /// Example: 5 + /// when omitted. /// /// /// Whether to generate an audio track for the video. Audio roughly
@@ -131,8 +108,7 @@ public sealed partial class GenerateVideoKlingV3StandardTextToVideoRequest /// /// /// How closely the video follows the prompt, from 0 to 1. Lower values
- /// leave the model more freedom. Defaults to 0.5 when omitted.
- /// Example: 0.5F + /// leave the model more freedom. Defaults to 0.5 when omitted. /// /// /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
@@ -142,14 +118,7 @@ public sealed partial class GenerateVideoKlingV3StandardTextToVideoRequest /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
/// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
/// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output videos are added to it when the request completes. + /// private and loopback hosts and the cloud metadata service are rejected. /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -161,10 +130,8 @@ public GenerateVideoKlingV3StandardTextToVideoRequest( int? duration, bool? generateAudio, global::Ideogram.KlingV3ShotType? shotType, - float? cfgScale, - string? webhookUrl, - bool? @private, - string? targetCollectionId) + string? cfgScale, + string? webhookUrl) { this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); this.NegativePrompt = negativePrompt; @@ -174,8 +141,6 @@ public GenerateVideoKlingV3StandardTextToVideoRequest( this.ShotType = shotType; this.CfgScale = cfgScale; this.WebhookUrl = webhookUrl; - this.Private = @private; - this.TargetCollectionId = targetCollectionId; } /// diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoMinimaxH3ImageToVideoRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoMinimaxH3ImageToVideoRequest.Json.g.cs deleted file mode 100644 index d2a99cd2..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoMinimaxH3ImageToVideoRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class GenerateVideoMinimaxH3ImageToVideoRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.GenerateVideoMinimaxH3ImageToVideoRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.GenerateVideoMinimaxH3ImageToVideoRequest), - jsonSerializerContext) as global::Ideogram.GenerateVideoMinimaxH3ImageToVideoRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.GenerateVideoMinimaxH3ImageToVideoRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.GenerateVideoMinimaxH3ImageToVideoRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.GenerateVideoMinimaxH3ImageToVideoRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GenerateVideoMinimaxH3ImageToVideoRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoMinimaxH3ImageToVideoRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoMinimaxH3ImageToVideoRequest.g.cs deleted file mode 100644 index e74afffa..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoMinimaxH3ImageToVideoRequest.g.cs +++ /dev/null @@ -1,205 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Request body for MiniMax H3 image-to-video generation.
- /// Upload the first frame as `image`, and optionally a final frame as
- /// `end_image`, using `multipart/form-data`. The video takes its aspect
- /// ratio from the first frame, so there is no `aspect_ratio` field. - ///
- public sealed partial class GenerateVideoMinimaxH3ImageToVideoRequest - { - /// - /// A reference to an image already stored with Ideogram to use as the first frame, in place of uploading `image`. Only image assets are accepted. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image_asset_identifier")] - public global::Ideogram.AssetIdentifier? ImageAssetIdentifier { get; set; } - - /// - /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image")] - public byte[]? Image { get; set; } - - /// - /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] - public string? Imagename { get; set; } - - /// - /// An optional final frame, as a reference to an image already stored with Ideogram. When supplied, the generated video transitions from the first frame to this one. Only image assets are accepted. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("end_image_asset_identifier")] - public global::Ideogram.AssetIdentifier? EndImageAssetIdentifier { get; set; } - - /// - /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("end_image")] - public byte[]? EndImage { get; set; } - - /// - /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("end_imagename")] - public string? EndImagename { get; set; } - - /// - /// A natural-language prompt describing how the first frame should animate.
- /// Example: The camera slowly pans right as the waves roll in. - ///
- /// The camera slowly pans right as the waves roll in. - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Prompt { get; set; } - - /// - /// The resolution tier of the generated video, spelled the way MiniMax
- /// spells it. `480P` and `768P` are generated natively; `2K` and `4K` are
- /// upscaled from a `768P` result.
- /// Higher tiers cost more.
- /// Default Value: 2K - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.MinimaxH3ResolutionJsonConverter))] - public global::Ideogram.MinimaxH3Resolution? Resolution { get; set; } - - /// - /// The length of the generated video in seconds.
- /// Default Value: 5
- /// Example: 5 - ///
- /// 5 - [global::System.Text.Json.Serialization.JsonPropertyName("duration")] - public int? Duration { get; set; } - - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - ///
- /// https://api.example.com/webhooks/ideogram - [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] - public string? WebhookUrl { get; set; } - - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output video is added to it when the request completes. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("target_collection_id")] - public string? TargetCollectionId { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// A natural-language prompt describing how the first frame should animate.
- /// Example: The camera slowly pans right as the waves roll in. - /// - /// - /// A reference to an image already stored with Ideogram to use as the first frame, in place of uploading `image`. Only image assets are accepted. - /// - /// - /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - /// - /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - /// - /// An optional final frame, as a reference to an image already stored with Ideogram. When supplied, the generated video transitions from the first frame to this one. Only image assets are accepted. - /// - /// - /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. - /// - /// - /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. - /// - /// - /// The resolution tier of the generated video, spelled the way MiniMax
- /// spells it. `480P` and `768P` are generated natively; `2K` and `4K` are
- /// upscaled from a `768P` result.
- /// Higher tiers cost more.
- /// Default Value: 2K - /// - /// - /// The length of the generated video in seconds.
- /// Default Value: 5
- /// Example: 5 - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output video is added to it when the request completes. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public GenerateVideoMinimaxH3ImageToVideoRequest( - string prompt, - global::Ideogram.AssetIdentifier? imageAssetIdentifier, - byte[]? image, - string? imagename, - global::Ideogram.AssetIdentifier? endImageAssetIdentifier, - byte[]? endImage, - string? endImagename, - global::Ideogram.MinimaxH3Resolution? resolution, - int? duration, - string? webhookUrl, - bool? @private, - string? targetCollectionId) - { - this.ImageAssetIdentifier = imageAssetIdentifier; - this.Image = image; - this.Imagename = imagename; - this.EndImageAssetIdentifier = endImageAssetIdentifier; - this.EndImage = endImage; - this.EndImagename = endImagename; - this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); - this.Resolution = resolution; - this.Duration = duration; - this.WebhookUrl = webhookUrl; - this.Private = @private; - this.TargetCollectionId = targetCollectionId; - } - - /// - /// Initializes a new instance of the class. - /// - public GenerateVideoMinimaxH3ImageToVideoRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoMinimaxH3Response.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoMinimaxH3Response.g.cs index 32146cd5..d0ea9d35 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoMinimaxH3Response.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoMinimaxH3Response.g.cs @@ -8,8 +8,7 @@ namespace Ideogram /// included in this response: poll `GET /v2/generations/{generation_id}`
/// with the returned `generation_id`, or receive it at the `webhook_url`
/// you supplied. Video links expire after a limited time, so download any
- /// video you want to keep.
- /// Example: {"generation_id":"generation_id","created":"2000-01-23T04:56:07\u002B00:00"} + /// video you want to keep. ///
public sealed partial class GenerateVideoMinimaxH3Response { diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoMinimaxH3TextToVideoRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoMinimaxH3TextToVideoRequest.g.cs index b088b498..2b8bb6e7 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoMinimaxH3TextToVideoRequest.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoMinimaxH3TextToVideoRequest.g.cs @@ -4,16 +4,13 @@ namespace Ideogram { /// - /// Request body for MiniMax H3 text-to-video generation.
- /// Example: {"duration":5,"aspect_ratio":null,"private":true,"webhook_url":"https://api.example.com/webhooks/ideogram","target_collection_id":"target_collection_id","prompt":"A red fox running through a snowy forest at dawn.","resolution":null} + /// Request body for MiniMax H3 text-to-video generation. ///
public sealed partial class GenerateVideoMinimaxH3TextToVideoRequest { /// - /// A natural-language prompt describing the video to generate.
- /// Example: A red fox running through a snowy forest at dawn. + /// A natural-language prompt describing the video to generate. ///
- /// A red fox running through a snowy forest at dawn. [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] [global::System.Text.Json.Serialization.JsonRequired] public required string Prompt { get; set; } @@ -39,10 +36,8 @@ public sealed partial class GenerateVideoMinimaxH3TextToVideoRequest /// /// The length of the generated video in seconds.
- /// Default Value: 5
- /// Example: 5 + /// Default Value: 5 ///
- /// 5 [global::System.Text.Json.Serialization.JsonPropertyName("duration")] public int? Duration { get; set; } @@ -54,25 +49,11 @@ public sealed partial class GenerateVideoMinimaxH3TextToVideoRequest /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
/// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
/// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram + /// private and loopback hosts and the cloud metadata service are rejected. /// - /// https://api.example.com/webhooks/ideogram [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] public string? WebhookUrl { get; set; } - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output video is added to it when the request completes. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("target_collection_id")] - public string? TargetCollectionId { get; set; } - /// /// Additional properties that are not explicitly defined in the schema /// @@ -83,8 +64,7 @@ public sealed partial class GenerateVideoMinimaxH3TextToVideoRequest /// Initializes a new instance of the class. /// /// - /// A natural-language prompt describing the video to generate.
- /// Example: A red fox running through a snowy forest at dawn. + /// A natural-language prompt describing the video to generate. /// /// /// The aspect ratio of the generated video.
@@ -99,8 +79,7 @@ public sealed partial class GenerateVideoMinimaxH3TextToVideoRequest /// /// /// The length of the generated video in seconds.
- /// Default Value: 5
- /// Example: 5 + /// Default Value: 5 /// /// /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
@@ -110,14 +89,7 @@ public sealed partial class GenerateVideoMinimaxH3TextToVideoRequest /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
/// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
/// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output video is added to it when the request completes. + /// private and loopback hosts and the cloud metadata service are rejected. /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -127,17 +99,13 @@ public GenerateVideoMinimaxH3TextToVideoRequest( global::Ideogram.MinimaxH3AspectRatio? aspectRatio, global::Ideogram.MinimaxH3Resolution? resolution, int? duration, - string? webhookUrl, - bool? @private, - string? targetCollectionId) + string? webhookUrl) { this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); this.AspectRatio = aspectRatio; this.Resolution = resolution; this.Duration = duration; this.WebhookUrl = webhookUrl; - this.Private = @private; - this.TargetCollectionId = targetCollectionId; } /// diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoSeedDance25ImageToVideoRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoSeedDance25ImageToVideoRequest.Json.g.cs deleted file mode 100644 index 6dfce3cf..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoSeedDance25ImageToVideoRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class GenerateVideoSeedDance25ImageToVideoRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.GenerateVideoSeedDance25ImageToVideoRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.GenerateVideoSeedDance25ImageToVideoRequest), - jsonSerializerContext) as global::Ideogram.GenerateVideoSeedDance25ImageToVideoRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.GenerateVideoSeedDance25ImageToVideoRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.GenerateVideoSeedDance25ImageToVideoRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.GenerateVideoSeedDance25ImageToVideoRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GenerateVideoSeedDance25ImageToVideoRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoSeedDance25ImageToVideoRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoSeedDance25ImageToVideoRequest.g.cs deleted file mode 100644 index d2080bdd..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoSeedDance25ImageToVideoRequest.g.cs +++ /dev/null @@ -1,214 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Request body for Seedance 2.5 image-to-video generation.
- /// Upload the first frame as `image`, and optionally a final frame as
- /// `end_image`, using `multipart/form-data`. The video takes its aspect
- /// ratio from the first frame, so there is no `aspect_ratio` field. - ///
- public sealed partial class GenerateVideoSeedDance25ImageToVideoRequest - { - /// - /// A reference to an image already stored with Ideogram to use as the first frame, in place of uploading `image`. Only image assets are accepted. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image_asset_identifier")] - public global::Ideogram.AssetIdentifier? ImageAssetIdentifier { get; set; } - - /// - /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image")] - public byte[]? Image { get; set; } - - /// - /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] - public string? Imagename { get; set; } - - /// - /// An optional final frame, as a reference to an image already stored with Ideogram. When supplied, the generated video transitions from the first frame to this one. Only image assets are accepted. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("end_image_asset_identifier")] - public global::Ideogram.AssetIdentifier? EndImageAssetIdentifier { get; set; } - - /// - /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("end_image")] - public byte[]? EndImage { get; set; } - - /// - /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("end_imagename")] - public string? EndImagename { get; set; } - - /// - /// A natural-language prompt describing how the first frame should animate.
- /// Example: The camera slowly pans right as the waves roll in. - ///
- /// The camera slowly pans right as the waves roll in. - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Prompt { get; set; } - - /// - /// The resolution tier of the generated video.
- /// Default Value: 720p - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.SeedDance25ResolutionJsonConverter))] - public global::Ideogram.SeedDance25Resolution? Resolution { get; set; } - - /// - /// The length of the generated video in seconds. When omitted, the model
- /// picks the best duration for the prompt ("auto").
- /// Example: 5 - ///
- /// 5 - [global::System.Text.Json.Serialization.JsonPropertyName("duration")] - public int? Duration { get; set; } - - /// - /// Whether to generate an audio track for the video. Audio roughly
- /// doubles the provider cost and is subject to stricter output moderation.
- /// Default Value: false - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("generate_audio")] - public bool? GenerateAudio { get; set; } - - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - ///
- /// https://api.example.com/webhooks/ideogram - [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] - public string? WebhookUrl { get; set; } - - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output video is added to it when the request completes. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("target_collection_id")] - public string? TargetCollectionId { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// A natural-language prompt describing how the first frame should animate.
- /// Example: The camera slowly pans right as the waves roll in. - /// - /// - /// A reference to an image already stored with Ideogram to use as the first frame, in place of uploading `image`. Only image assets are accepted. - /// - /// - /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - /// - /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - /// - /// An optional final frame, as a reference to an image already stored with Ideogram. When supplied, the generated video transitions from the first frame to this one. Only image assets are accepted. - /// - /// - /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. - /// - /// - /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. - /// - /// - /// The resolution tier of the generated video.
- /// Default Value: 720p - /// - /// - /// The length of the generated video in seconds. When omitted, the model
- /// picks the best duration for the prompt ("auto").
- /// Example: 5 - /// - /// - /// Whether to generate an audio track for the video. Audio roughly
- /// doubles the provider cost and is subject to stricter output moderation.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output video is added to it when the request completes. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public GenerateVideoSeedDance25ImageToVideoRequest( - string prompt, - global::Ideogram.AssetIdentifier? imageAssetIdentifier, - byte[]? image, - string? imagename, - global::Ideogram.AssetIdentifier? endImageAssetIdentifier, - byte[]? endImage, - string? endImagename, - global::Ideogram.SeedDance25Resolution? resolution, - int? duration, - bool? generateAudio, - string? webhookUrl, - bool? @private, - string? targetCollectionId) - { - this.ImageAssetIdentifier = imageAssetIdentifier; - this.Image = image; - this.Imagename = imagename; - this.EndImageAssetIdentifier = endImageAssetIdentifier; - this.EndImage = endImage; - this.EndImagename = endImagename; - this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); - this.Resolution = resolution; - this.Duration = duration; - this.GenerateAudio = generateAudio; - this.WebhookUrl = webhookUrl; - this.Private = @private; - this.TargetCollectionId = targetCollectionId; - } - - /// - /// Initializes a new instance of the class. - /// - public GenerateVideoSeedDance25ImageToVideoRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoSeedDance25ReferenceToVideoRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoSeedDance25ReferenceToVideoRequest.Json.g.cs deleted file mode 100644 index 3b98e86b..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoSeedDance25ReferenceToVideoRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class GenerateVideoSeedDance25ReferenceToVideoRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.GenerateVideoSeedDance25ReferenceToVideoRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.GenerateVideoSeedDance25ReferenceToVideoRequest), - jsonSerializerContext) as global::Ideogram.GenerateVideoSeedDance25ReferenceToVideoRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.GenerateVideoSeedDance25ReferenceToVideoRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.GenerateVideoSeedDance25ReferenceToVideoRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.GenerateVideoSeedDance25ReferenceToVideoRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GenerateVideoSeedDance25ReferenceToVideoRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoSeedDance25ReferenceToVideoRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoSeedDance25ReferenceToVideoRequest.g.cs deleted file mode 100644 index 7a179c47..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoSeedDance25ReferenceToVideoRequest.g.cs +++ /dev/null @@ -1,208 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Request body for Seedance 2.5 reference-to-video. Upload
- /// `reference_images` (at least one is required) and optional
- /// `reference_audios` using `multipart/form-data`. The prompt refers to
- /// them by position: `[Image1]`, `[Audio1]`, and so on. - ///
- public sealed partial class GenerateVideoSeedDance25ReferenceToVideoRequest - { - /// - /// A natural-language prompt describing the video to produce. Refer to references by position, as in "[Image1] walks toward the camera".
- /// Example: [Image1] walks through the snowy forest at dawn. - ///
- /// [Image1] walks through the snowy forest at dawn. - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Prompt { get; set; } - - /// - /// Images already stored with Ideogram to use as references, by reference, in prompt order. Cannot be combined with `reference_images`. Only image assets are accepted. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("reference_image_asset_identifiers")] - public global::System.Collections.Generic.IList? ReferenceImageAssetIdentifiers { get; set; } - - /// - /// Reference images, in prompt order. Common formats such as JPEG, PNG, and WEBP are supported, up to 50MB each. Multipart requests only. Uploaded images are used for this request only and are not stored. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("reference_images")] - public global::System.Collections.Generic.IList? ReferenceImages { get; set; } - - /// - /// Uploaded or generated videos to use as references, by reference, in prompt order. Each clip must be between 2 and 30 seconds long, and the clips must total no more than 30 seconds. Upload video files first and pass their asset identifiers. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("reference_video_asset_identifiers")] - public global::System.Collections.Generic.IList? ReferenceVideoAssetIdentifiers { get; set; } - - /// - /// MP3 or WAV audio references, in prompt order. Multipart requests only. Each file must be at most 15 MB and between 2 and 30 seconds long, with a combined duration of at most 30 seconds. Requires at least one reference image. Audio is used for this request only and is not saved to your library. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("reference_audios")] - public global::System.Collections.Generic.IList? ReferenceAudios { get; set; } - - /// - /// The aspect ratio of the generated video. `auto` lets the model choose the
- /// most suitable ratio from the prompt; any other value pins the ratio.
- /// Default Value: auto - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.SeedDance2AspectRatioJsonConverter))] - public global::Ideogram.SeedDance2AspectRatio? AspectRatio { get; set; } - - /// - /// The resolution tier of the generated video.
- /// Default Value: 720p - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.SeedDance25ResolutionJsonConverter))] - public global::Ideogram.SeedDance25Resolution? Resolution { get; set; } - - /// - /// The length of the generated video in seconds. When omitted, the model
- /// picks the best duration for the prompt ("auto").
- /// Example: 5 - ///
- /// 5 - [global::System.Text.Json.Serialization.JsonPropertyName("duration")] - public int? Duration { get; set; } - - /// - /// Whether to generate an audio track for the video. Audio roughly
- /// doubles the provider cost and is subject to stricter output moderation.
- /// Default Value: false - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("generate_audio")] - public bool? GenerateAudio { get; set; } - - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - ///
- /// https://api.example.com/webhooks/ideogram - [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] - public string? WebhookUrl { get; set; } - - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output videos are added to it when the request completes. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("target_collection_id")] - public string? TargetCollectionId { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// A natural-language prompt describing the video to produce. Refer to references by position, as in "[Image1] walks toward the camera".
- /// Example: [Image1] walks through the snowy forest at dawn. - /// - /// - /// Images already stored with Ideogram to use as references, by reference, in prompt order. Cannot be combined with `reference_images`. Only image assets are accepted. - /// - /// - /// Reference images, in prompt order. Common formats such as JPEG, PNG, and WEBP are supported, up to 50MB each. Multipart requests only. Uploaded images are used for this request only and are not stored. - /// - /// - /// Uploaded or generated videos to use as references, by reference, in prompt order. Each clip must be between 2 and 30 seconds long, and the clips must total no more than 30 seconds. Upload video files first and pass their asset identifiers. - /// - /// - /// MP3 or WAV audio references, in prompt order. Multipart requests only. Each file must be at most 15 MB and between 2 and 30 seconds long, with a combined duration of at most 30 seconds. Requires at least one reference image. Audio is used for this request only and is not saved to your library. - /// - /// - /// The aspect ratio of the generated video. `auto` lets the model choose the
- /// most suitable ratio from the prompt; any other value pins the ratio.
- /// Default Value: auto - /// - /// - /// The resolution tier of the generated video.
- /// Default Value: 720p - /// - /// - /// The length of the generated video in seconds. When omitted, the model
- /// picks the best duration for the prompt ("auto").
- /// Example: 5 - /// - /// - /// Whether to generate an audio track for the video. Audio roughly
- /// doubles the provider cost and is subject to stricter output moderation.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output videos are added to it when the request completes. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public GenerateVideoSeedDance25ReferenceToVideoRequest( - string prompt, - global::System.Collections.Generic.IList? referenceImageAssetIdentifiers, - global::System.Collections.Generic.IList? referenceImages, - global::System.Collections.Generic.IList? referenceVideoAssetIdentifiers, - global::System.Collections.Generic.IList? referenceAudios, - global::Ideogram.SeedDance2AspectRatio? aspectRatio, - global::Ideogram.SeedDance25Resolution? resolution, - int? duration, - bool? generateAudio, - string? webhookUrl, - bool? @private, - string? targetCollectionId) - { - this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); - this.ReferenceImageAssetIdentifiers = referenceImageAssetIdentifiers; - this.ReferenceImages = referenceImages; - this.ReferenceVideoAssetIdentifiers = referenceVideoAssetIdentifiers; - this.ReferenceAudios = referenceAudios; - this.AspectRatio = aspectRatio; - this.Resolution = resolution; - this.Duration = duration; - this.GenerateAudio = generateAudio; - this.WebhookUrl = webhookUrl; - this.Private = @private; - this.TargetCollectionId = targetCollectionId; - } - - /// - /// Initializes a new instance of the class. - /// - public GenerateVideoSeedDance25ReferenceToVideoRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoSeedDance25Response.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoSeedDance25Response.g.cs index dfccb754..eb246359 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoSeedDance25Response.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoSeedDance25Response.g.cs @@ -8,8 +8,7 @@ namespace Ideogram /// part of this response: poll `GET /v2/generations/{generation_id}` with
/// the returned `generation_id`, or receive it at your `webhook_url`.
/// Video links expire after a limited time, so download any video you
- /// want to keep.
- /// Example: {"generation_id":"generation_id","created":"2000-01-23T04:56:07\u002B00:00"} + /// want to keep. ///
public sealed partial class GenerateVideoSeedDance25Response { diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoSeedDance25TextToVideoRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoSeedDance25TextToVideoRequest.g.cs index 3341ec11..da4a12e8 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoSeedDance25TextToVideoRequest.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoSeedDance25TextToVideoRequest.g.cs @@ -4,16 +4,13 @@ namespace Ideogram { /// - /// Request body for Seedance 2.5 text-to-video generation.
- /// Example: {"duration":5,"aspect_ratio":null,"private":true,"webhook_url":"https://api.example.com/webhooks/ideogram","target_collection_id":"target_collection_id","generate_audio":false,"prompt":"A red fox running through a snowy forest at dawn.","resolution":null} + /// Request body for Seedance 2.5 text-to-video generation. ///
public sealed partial class GenerateVideoSeedDance25TextToVideoRequest { /// - /// A natural-language prompt describing the video to generate.
- /// Example: A red fox running through a snowy forest at dawn. + /// A natural-language prompt describing the video to generate. ///
- /// A red fox running through a snowy forest at dawn. [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] [global::System.Text.Json.Serialization.JsonRequired] public required string Prompt { get; set; } @@ -37,10 +34,8 @@ public sealed partial class GenerateVideoSeedDance25TextToVideoRequest /// /// The length of the generated video in seconds. When omitted, the model
- /// picks the best duration for the prompt ("auto").
- /// Example: 5 + /// picks the best duration for the prompt ("auto"). ///
- /// 5 [global::System.Text.Json.Serialization.JsonPropertyName("duration")] public int? Duration { get; set; } @@ -60,25 +55,11 @@ public sealed partial class GenerateVideoSeedDance25TextToVideoRequest /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
/// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
/// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram + /// private and loopback hosts and the cloud metadata service are rejected. /// - /// https://api.example.com/webhooks/ideogram [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] public string? WebhookUrl { get; set; } - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output video is added to it when the request completes. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("target_collection_id")] - public string? TargetCollectionId { get; set; } - /// /// Additional properties that are not explicitly defined in the schema /// @@ -89,8 +70,7 @@ public sealed partial class GenerateVideoSeedDance25TextToVideoRequest /// Initializes a new instance of the class. /// /// - /// A natural-language prompt describing the video to generate.
- /// Example: A red fox running through a snowy forest at dawn. + /// A natural-language prompt describing the video to generate. /// /// /// The aspect ratio of the generated video. `auto` lets the model choose the
@@ -103,8 +83,7 @@ public sealed partial class GenerateVideoSeedDance25TextToVideoRequest /// /// /// The length of the generated video in seconds. When omitted, the model
- /// picks the best duration for the prompt ("auto").
- /// Example: 5 + /// picks the best duration for the prompt ("auto"). /// /// /// Whether to generate an audio track for the video. Audio roughly
@@ -119,14 +98,7 @@ public sealed partial class GenerateVideoSeedDance25TextToVideoRequest /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
/// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
/// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output video is added to it when the request completes. + /// private and loopback hosts and the cloud metadata service are rejected. /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -137,9 +109,7 @@ public GenerateVideoSeedDance25TextToVideoRequest( global::Ideogram.SeedDance25Resolution? resolution, int? duration, bool? generateAudio, - string? webhookUrl, - bool? @private, - string? targetCollectionId) + string? webhookUrl) { this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); this.AspectRatio = aspectRatio; @@ -147,8 +117,6 @@ public GenerateVideoSeedDance25TextToVideoRequest( this.Duration = duration; this.GenerateAudio = generateAudio; this.WebhookUrl = webhookUrl; - this.Private = @private; - this.TargetCollectionId = targetCollectionId; } /// diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoSeedDance2ImageToVideoRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoSeedDance2ImageToVideoRequest.Json.g.cs deleted file mode 100644 index 27a734fc..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoSeedDance2ImageToVideoRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class GenerateVideoSeedDance2ImageToVideoRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.GenerateVideoSeedDance2ImageToVideoRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.GenerateVideoSeedDance2ImageToVideoRequest), - jsonSerializerContext) as global::Ideogram.GenerateVideoSeedDance2ImageToVideoRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.GenerateVideoSeedDance2ImageToVideoRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.GenerateVideoSeedDance2ImageToVideoRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.GenerateVideoSeedDance2ImageToVideoRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GenerateVideoSeedDance2ImageToVideoRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoSeedDance2ImageToVideoRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoSeedDance2ImageToVideoRequest.g.cs deleted file mode 100644 index 0bdae403..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoSeedDance2ImageToVideoRequest.g.cs +++ /dev/null @@ -1,229 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Request body for Seedance 2.0 image-to-video generation.
- /// Upload the first frame as `image`, and optionally a final frame as
- /// `end_image`, using `multipart/form-data`. - ///
- public sealed partial class GenerateVideoSeedDance2ImageToVideoRequest - { - /// - /// A reference to an image already stored with Ideogram to use as the first frame, in place of uploading `image`. Only image assets are accepted. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image_asset_identifier")] - public global::Ideogram.AssetIdentifier? ImageAssetIdentifier { get; set; } - - /// - /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image")] - public byte[]? Image { get; set; } - - /// - /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] - public string? Imagename { get; set; } - - /// - /// An optional final frame, as a reference to an image already stored with Ideogram. When supplied, the generated video transitions from the first frame to this one. Only image assets are accepted. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("end_image_asset_identifier")] - public global::Ideogram.AssetIdentifier? EndImageAssetIdentifier { get; set; } - - /// - /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("end_image")] - public byte[]? EndImage { get; set; } - - /// - /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("end_imagename")] - public string? EndImagename { get; set; } - - /// - /// A natural-language prompt describing how the first frame should animate.
- /// Example: The camera slowly pans right as the waves roll in. - ///
- /// The camera slowly pans right as the waves roll in. - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Prompt { get; set; } - - /// - /// The aspect ratio of the generated video. `auto` lets the model choose the
- /// most suitable ratio from the prompt; any other value pins the ratio.
- /// Default Value: auto - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.SeedDance2AspectRatioJsonConverter))] - public global::Ideogram.SeedDance2AspectRatio? AspectRatio { get; set; } - - /// - /// The resolution tier of the generated video.
- /// Default Value: 720p - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.SeedDance2ResolutionJsonConverter))] - public global::Ideogram.SeedDance2Resolution? Resolution { get; set; } - - /// - /// The length of the generated video in seconds. When omitted, the model
- /// picks the best duration for the prompt ("auto").
- /// Example: 5 - ///
- /// 5 - [global::System.Text.Json.Serialization.JsonPropertyName("duration")] - public int? Duration { get; set; } - - /// - /// Whether to generate an audio track for the video. Audio roughly
- /// doubles the provider cost and is subject to stricter output moderation.
- /// Default Value: false - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("generate_audio")] - public bool? GenerateAudio { get; set; } - - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - ///
- /// https://api.example.com/webhooks/ideogram - [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] - public string? WebhookUrl { get; set; } - - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output videos are added to it when the request completes. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("target_collection_id")] - public string? TargetCollectionId { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// A natural-language prompt describing how the first frame should animate.
- /// Example: The camera slowly pans right as the waves roll in. - /// - /// - /// A reference to an image already stored with Ideogram to use as the first frame, in place of uploading `image`. Only image assets are accepted. - /// - /// - /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - /// - /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - /// - /// An optional final frame, as a reference to an image already stored with Ideogram. When supplied, the generated video transitions from the first frame to this one. Only image assets are accepted. - /// - /// - /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. - /// - /// - /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. - /// - /// - /// The aspect ratio of the generated video. `auto` lets the model choose the
- /// most suitable ratio from the prompt; any other value pins the ratio.
- /// Default Value: auto - /// - /// - /// The resolution tier of the generated video.
- /// Default Value: 720p - /// - /// - /// The length of the generated video in seconds. When omitted, the model
- /// picks the best duration for the prompt ("auto").
- /// Example: 5 - /// - /// - /// Whether to generate an audio track for the video. Audio roughly
- /// doubles the provider cost and is subject to stricter output moderation.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output videos are added to it when the request completes. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public GenerateVideoSeedDance2ImageToVideoRequest( - string prompt, - global::Ideogram.AssetIdentifier? imageAssetIdentifier, - byte[]? image, - string? imagename, - global::Ideogram.AssetIdentifier? endImageAssetIdentifier, - byte[]? endImage, - string? endImagename, - global::Ideogram.SeedDance2AspectRatio? aspectRatio, - global::Ideogram.SeedDance2Resolution? resolution, - int? duration, - bool? generateAudio, - string? webhookUrl, - bool? @private, - string? targetCollectionId) - { - this.ImageAssetIdentifier = imageAssetIdentifier; - this.Image = image; - this.Imagename = imagename; - this.EndImageAssetIdentifier = endImageAssetIdentifier; - this.EndImage = endImage; - this.EndImagename = endImagename; - this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); - this.AspectRatio = aspectRatio; - this.Resolution = resolution; - this.Duration = duration; - this.GenerateAudio = generateAudio; - this.WebhookUrl = webhookUrl; - this.Private = @private; - this.TargetCollectionId = targetCollectionId; - } - - /// - /// Initializes a new instance of the class. - /// - public GenerateVideoSeedDance2ImageToVideoRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoSeedDance2ReferenceToVideoRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoSeedDance2ReferenceToVideoRequest.Json.g.cs deleted file mode 100644 index 64873979..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoSeedDance2ReferenceToVideoRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class GenerateVideoSeedDance2ReferenceToVideoRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.GenerateVideoSeedDance2ReferenceToVideoRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.GenerateVideoSeedDance2ReferenceToVideoRequest), - jsonSerializerContext) as global::Ideogram.GenerateVideoSeedDance2ReferenceToVideoRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.GenerateVideoSeedDance2ReferenceToVideoRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.GenerateVideoSeedDance2ReferenceToVideoRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.GenerateVideoSeedDance2ReferenceToVideoRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GenerateVideoSeedDance2ReferenceToVideoRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoSeedDance2ReferenceToVideoRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoSeedDance2ReferenceToVideoRequest.g.cs deleted file mode 100644 index 528d3419..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoSeedDance2ReferenceToVideoRequest.g.cs +++ /dev/null @@ -1,208 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Request body for Seedance 2.0 reference-to-video. Upload
- /// `reference_images` (at least one is required) and optional
- /// `reference_audios` using `multipart/form-data`. The prompt refers to
- /// them by position: `@Image1`, `@Audio1`, and so on. - ///
- public sealed partial class GenerateVideoSeedDance2ReferenceToVideoRequest - { - /// - /// A natural-language prompt describing the video to produce. Refer to references by position, as in "@Image1 walks toward the camera".
- /// Example: @Image1 walks through the snowy forest at dawn. - ///
- /// @Image1 walks through the snowy forest at dawn. - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Prompt { get; set; } - - /// - /// Images already stored with Ideogram to use as references, by reference, in prompt order. Cannot be combined with `reference_images`. Only image assets are accepted. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("reference_image_asset_identifiers")] - public global::System.Collections.Generic.IList? ReferenceImageAssetIdentifiers { get; set; } - - /// - /// Reference images, in prompt order. Common formats such as JPEG, PNG, and WEBP are supported, up to 50MB each. Multipart requests only. Uploaded images are used for this request only and are not stored. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("reference_images")] - public global::System.Collections.Generic.IList? ReferenceImages { get; set; } - - /// - /// Uploaded or generated videos to use as references, by reference, in prompt order. Each clip must be between 2 and 15 seconds long, and the clips must total no more than 15 seconds. Upload video files first and pass their asset identifiers. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("reference_video_asset_identifiers")] - public global::System.Collections.Generic.IList? ReferenceVideoAssetIdentifiers { get; set; } - - /// - /// MP3 or WAV audio references, in prompt order. Multipart requests only. Each file must be at most 15 MB and between 2 and 15 seconds long, with a combined duration of at most 15 seconds. Requires at least one reference image. Audio is used for this request only and is not saved to your library. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("reference_audios")] - public global::System.Collections.Generic.IList? ReferenceAudios { get; set; } - - /// - /// The aspect ratio of the generated video. `auto` lets the model choose the
- /// most suitable ratio from the prompt; any other value pins the ratio.
- /// Default Value: auto - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.SeedDance2AspectRatioJsonConverter))] - public global::Ideogram.SeedDance2AspectRatio? AspectRatio { get; set; } - - /// - /// The resolution tier of the generated video.
- /// Default Value: 720p - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.SeedDance2ResolutionJsonConverter))] - public global::Ideogram.SeedDance2Resolution? Resolution { get; set; } - - /// - /// The length of the generated video in seconds. When omitted, the model
- /// picks the best duration for the prompt ("auto").
- /// Example: 5 - ///
- /// 5 - [global::System.Text.Json.Serialization.JsonPropertyName("duration")] - public int? Duration { get; set; } - - /// - /// Whether to generate an audio track for the video. Audio roughly
- /// doubles the provider cost and is subject to stricter output moderation.
- /// Default Value: false - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("generate_audio")] - public bool? GenerateAudio { get; set; } - - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - ///
- /// https://api.example.com/webhooks/ideogram - [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] - public string? WebhookUrl { get; set; } - - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output videos are added to it when the request completes. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("target_collection_id")] - public string? TargetCollectionId { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// A natural-language prompt describing the video to produce. Refer to references by position, as in "@Image1 walks toward the camera".
- /// Example: @Image1 walks through the snowy forest at dawn. - /// - /// - /// Images already stored with Ideogram to use as references, by reference, in prompt order. Cannot be combined with `reference_images`. Only image assets are accepted. - /// - /// - /// Reference images, in prompt order. Common formats such as JPEG, PNG, and WEBP are supported, up to 50MB each. Multipart requests only. Uploaded images are used for this request only and are not stored. - /// - /// - /// Uploaded or generated videos to use as references, by reference, in prompt order. Each clip must be between 2 and 15 seconds long, and the clips must total no more than 15 seconds. Upload video files first and pass their asset identifiers. - /// - /// - /// MP3 or WAV audio references, in prompt order. Multipart requests only. Each file must be at most 15 MB and between 2 and 15 seconds long, with a combined duration of at most 15 seconds. Requires at least one reference image. Audio is used for this request only and is not saved to your library. - /// - /// - /// The aspect ratio of the generated video. `auto` lets the model choose the
- /// most suitable ratio from the prompt; any other value pins the ratio.
- /// Default Value: auto - /// - /// - /// The resolution tier of the generated video.
- /// Default Value: 720p - /// - /// - /// The length of the generated video in seconds. When omitted, the model
- /// picks the best duration for the prompt ("auto").
- /// Example: 5 - /// - /// - /// Whether to generate an audio track for the video. Audio roughly
- /// doubles the provider cost and is subject to stricter output moderation.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output videos are added to it when the request completes. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public GenerateVideoSeedDance2ReferenceToVideoRequest( - string prompt, - global::System.Collections.Generic.IList? referenceImageAssetIdentifiers, - global::System.Collections.Generic.IList? referenceImages, - global::System.Collections.Generic.IList? referenceVideoAssetIdentifiers, - global::System.Collections.Generic.IList? referenceAudios, - global::Ideogram.SeedDance2AspectRatio? aspectRatio, - global::Ideogram.SeedDance2Resolution? resolution, - int? duration, - bool? generateAudio, - string? webhookUrl, - bool? @private, - string? targetCollectionId) - { - this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); - this.ReferenceImageAssetIdentifiers = referenceImageAssetIdentifiers; - this.ReferenceImages = referenceImages; - this.ReferenceVideoAssetIdentifiers = referenceVideoAssetIdentifiers; - this.ReferenceAudios = referenceAudios; - this.AspectRatio = aspectRatio; - this.Resolution = resolution; - this.Duration = duration; - this.GenerateAudio = generateAudio; - this.WebhookUrl = webhookUrl; - this.Private = @private; - this.TargetCollectionId = targetCollectionId; - } - - /// - /// Initializes a new instance of the class. - /// - public GenerateVideoSeedDance2ReferenceToVideoRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoSeedDance2Response.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoSeedDance2Response.g.cs index c097ccac..4c23ff87 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoSeedDance2Response.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoSeedDance2Response.g.cs @@ -8,8 +8,7 @@ namespace Ideogram /// part of this response: poll `GET /v2/generations/{generation_id}` with
/// the returned `generation_id`, or receive it at your `webhook_url`.
/// Video links expire after a limited time, so download any video you
- /// want to keep.
- /// Example: {"generation_id":"generation_id","created":"2000-01-23T04:56:07\u002B00:00"} + /// want to keep. ///
public sealed partial class GenerateVideoSeedDance2Response { diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoSeedDance2TextToVideoRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoSeedDance2TextToVideoRequest.g.cs index 992ab8a5..0e5cf192 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoSeedDance2TextToVideoRequest.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateVideoSeedDance2TextToVideoRequest.g.cs @@ -4,16 +4,13 @@ namespace Ideogram { /// - /// Request body for Seedance 2.0 text-to-video generation.
- /// Example: {"duration":5,"aspect_ratio":null,"private":true,"webhook_url":"https://api.example.com/webhooks/ideogram","target_collection_id":"target_collection_id","generate_audio":false,"prompt":"A red fox running through a snowy forest at dawn.","resolution":null} + /// Request body for Seedance 2.0 text-to-video generation. ///
public sealed partial class GenerateVideoSeedDance2TextToVideoRequest { /// - /// A natural-language prompt describing the video to generate.
- /// Example: A red fox running through a snowy forest at dawn. + /// A natural-language prompt describing the video to generate. ///
- /// A red fox running through a snowy forest at dawn. [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] [global::System.Text.Json.Serialization.JsonRequired] public required string Prompt { get; set; } @@ -37,10 +34,8 @@ public sealed partial class GenerateVideoSeedDance2TextToVideoRequest /// /// The length of the generated video in seconds. When omitted, the model
- /// picks the best duration for the prompt ("auto").
- /// Example: 5 + /// picks the best duration for the prompt ("auto"). ///
- /// 5 [global::System.Text.Json.Serialization.JsonPropertyName("duration")] public int? Duration { get; set; } @@ -60,25 +55,11 @@ public sealed partial class GenerateVideoSeedDance2TextToVideoRequest /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
/// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
/// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram + /// private and loopback hosts and the cloud metadata service are rejected. /// - /// https://api.example.com/webhooks/ideogram [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] public string? WebhookUrl { get; set; } - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output videos are added to it when the request completes. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("target_collection_id")] - public string? TargetCollectionId { get; set; } - /// /// Additional properties that are not explicitly defined in the schema /// @@ -89,8 +70,7 @@ public sealed partial class GenerateVideoSeedDance2TextToVideoRequest /// Initializes a new instance of the class. /// /// - /// A natural-language prompt describing the video to generate.
- /// Example: A red fox running through a snowy forest at dawn. + /// A natural-language prompt describing the video to generate. /// /// /// The aspect ratio of the generated video. `auto` lets the model choose the
@@ -103,8 +83,7 @@ public sealed partial class GenerateVideoSeedDance2TextToVideoRequest /// /// /// The length of the generated video in seconds. When omitted, the model
- /// picks the best duration for the prompt ("auto").
- /// Example: 5 + /// picks the best duration for the prompt ("auto"). /// /// /// Whether to generate an audio track for the video. Audio roughly
@@ -119,14 +98,7 @@ public sealed partial class GenerateVideoSeedDance2TextToVideoRequest /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
/// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
/// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output videos are added to it when the request completes. + /// private and loopback hosts and the cloud metadata service are rejected. /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -137,9 +109,7 @@ public GenerateVideoSeedDance2TextToVideoRequest( global::Ideogram.SeedDance2Resolution? resolution, int? duration, bool? generateAudio, - string? webhookUrl, - bool? @private, - string? targetCollectionId) + string? webhookUrl) { this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); this.AspectRatio = aspectRatio; @@ -147,8 +117,6 @@ public GenerateVideoSeedDance2TextToVideoRequest( this.Duration = duration; this.GenerateAudio = generateAudio; this.WebhookUrl = webhookUrl; - this.Private = @private; - this.TargetCollectionId = targetCollectionId; } /// diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GeneratedDescription.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GeneratedDescription.g.cs index 9938a0fa..e2c81a6a 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GeneratedDescription.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GeneratedDescription.g.cs @@ -4,7 +4,7 @@ namespace Ideogram { /// - /// Example: {"text":"text"} + /// /// public sealed partial class GeneratedDescription { diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GeneratedImageObject.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GeneratedImageObject.g.cs index bcb22b83..055e9b5c 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GeneratedImageObject.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GeneratedImageObject.g.cs @@ -4,8 +4,7 @@ namespace Ideogram { /// - /// One generated output image.
- /// Example: {"seed":12345,"prompt":"prompt","resolution":"1024x1024","url":"https://openapi-generator.tech","is_image_safe":true} + /// One generated output image. ///
public sealed partial class GeneratedImageObject { @@ -23,10 +22,8 @@ public sealed partial class GeneratedImageObject public required string Prompt { get; set; } /// - /// The resolution of the generated image, formatted as "WIDTHxHEIGHT".
- /// Example: 1024x1024 + /// The resolution of the generated image, formatted as "WIDTHxHEIGHT". ///
- /// 1024x1024 [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] [global::System.Text.Json.Serialization.JsonRequired] public required string Resolution { get; set; } @@ -39,10 +36,8 @@ public sealed partial class GeneratedImageObject public required bool IsImageSafe { get; set; } /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. ///
- /// 12345 [global::System.Text.Json.Serialization.JsonPropertyName("seed")] [global::System.Text.Json.Serialization.JsonRequired] public required int Seed { get; set; } @@ -60,15 +55,13 @@ public sealed partial class GeneratedImageObject /// The final prompt the image was generated from. /// /// - /// The resolution of the generated image, formatted as "WIDTHxHEIGHT".
- /// Example: 1024x1024 + /// The resolution of the generated image, formatted as "WIDTHxHEIGHT". /// /// /// Whether the image passed safety checks. If false, `url` is empty. /// /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. /// /// /// The direct link to the generated image. Empty when the image did not pass safety checks. diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerationErrorResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerationErrorResponse.g.cs index bf513dda..ab7220d5 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerationErrorResponse.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerationErrorResponse.g.cs @@ -4,8 +4,7 @@ namespace Ideogram { /// - /// A generation request rejected by an account or usage limit.
- /// Example: {"max_inflight_requests":8,"task_completion_speed":"fast","reject_reason":null,"error":"error"} + /// A generation request rejected by an account or usage limit. ///
public sealed partial class GenerationErrorResponse { @@ -27,10 +26,8 @@ public sealed partial class GenerationErrorResponse /// /// How many generations the account may have in progress at once on
/// the queue this request resolved to. Present when `reject_reason`
- /// is `inflight_limit`.
- /// Example: 8 + /// is `inflight_limit`. ///
- /// 8 [global::System.Text.Json.Serialization.JsonPropertyName("max_inflight_requests")] public int? MaxInflightRequests { get; set; } @@ -60,8 +57,7 @@ public sealed partial class GenerationErrorResponse /// /// How many generations the account may have in progress at once on
/// the queue this request resolved to. Present when `reject_reason`
- /// is `inflight_limit`.
- /// Example: 8 + /// is `inflight_limit`. /// /// /// The queue this request resolved to. Present when `reject_reason`
diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponse.g.cs index f86f87b1..d51e6860 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponse.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponse.g.cs @@ -4,8 +4,7 @@ namespace Ideogram { /// - /// The current status and, when complete, result data for an asynchronous generation.
- /// Example: {"generation_id":"bzue-VZtSlSMAneIbfCo2A","status":"completed","created":"2000-01-23T04:56:07\u002B00:00","response_type":"url","data":[{"prompt":"prompt","resolution":"2048x2048","seed":12345,"is_image_safe":true,"url":"https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804\u0026sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89"}]} + /// The current status and, when complete, result data for an asynchronous generation. ///
public sealed partial class GenerationResponse { @@ -39,19 +38,15 @@ public sealed partial class GenerationResponse public global::Ideogram.GenerationResponseResponseType? ResponseType { get; set; } /// - /// The total variable usage-based cost charged for the completed request, in millionths of a US dollar. Present only when `status` is `completed` and the request uses variable usage-based pricing; omitted otherwise.
- /// Example: 130000 + /// The total variable usage-based cost charged for the completed request, in millionths of a US dollar. Present only when `status` is `completed` and the request uses variable usage-based pricing; omitted otherwise. ///
- /// 130000 [global::System.Text.Json.Serialization.JsonPropertyName("usage_cost_usd_micros")] public long? UsageCostUsdMicros { get; set; } /// /// A short machine-readable reason the generation failed, for example
- /// `content_policy_violation`. Present only when `status` is `failed`.
- /// Example: content_policy_violation + /// `content_policy_violation`. Present only when `status` is `failed`. ///
- /// content_policy_violation [global::System.Text.Json.Serialization.JsonPropertyName("failure_reason")] public string? FailureReason { get; set; } @@ -86,13 +81,11 @@ public sealed partial class GenerationResponse /// Present when `status` is `completed`; always "url" for this shape. /// /// - /// The total variable usage-based cost charged for the completed request, in millionths of a US dollar. Present only when `status` is `completed` and the request uses variable usage-based pricing; omitted otherwise.
- /// Example: 130000 + /// The total variable usage-based cost charged for the completed request, in millionths of a US dollar. Present only when `status` is `completed` and the request uses variable usage-based pricing; omitted otherwise. /// /// /// A short machine-readable reason the generation failed, for example
- /// `content_policy_violation`. Present only when `status` is `failed`.
- /// Example: content_policy_violation + /// `content_policy_violation`. Present only when `status` is `failed`. /// /// /// A list of generated images or videos. Present when `status` is
diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInner.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInner.g.cs index c69f87d6..ab71cf5d 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInner.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInner.g.cs @@ -18,9 +18,9 @@ namespace Ideogram /// An image result that does not expose its prompt or seed. ///
#if NET6_0_OR_GREATER - public global::Ideogram.ImageObjectWithoutPromptOrSeed? ImageWithoutPromptOrSeed { get; init; } + public global::Ideogram.GenerationResponseDataInnerVariant1? ImageWithoutPromptOrSeed { get; init; } #else - public global::Ideogram.ImageObjectWithoutPromptOrSeed? ImageWithoutPromptOrSeed { get; } + public global::Ideogram.GenerationResponseDataInnerVariant1? ImageWithoutPromptOrSeed { get; } #endif /// @@ -38,7 +38,7 @@ public bool TryPickImageWithoutPromptOrSeed( #if NET6_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] #endif - out global::Ideogram.ImageObjectWithoutPromptOrSeed? value) + out global::Ideogram.GenerationResponseDataInnerVariant1? value) { value = ImageWithoutPromptOrSeed; return IsImageWithoutPromptOrSeed; @@ -47,17 +47,17 @@ public bool TryPickImageWithoutPromptOrSeed( /// /// /// - public global::Ideogram.ImageObjectWithoutPromptOrSeed PickImageWithoutPromptOrSeed() => ImageWithoutPromptOrSeed is { } value + public global::Ideogram.GenerationResponseDataInnerVariant1 PickImageWithoutPromptOrSeed() => ImageWithoutPromptOrSeed is { } value ? value : throw new global::System.InvalidOperationException($"Expected union variant 'ImageWithoutPromptOrSeed' but the value was {ToString()}."); /// - /// + /// SvgGenerationObject variant /// #if NET6_0_OR_GREATER - public global::Ideogram.SvgGenerationObject? SvgGeneration { get; init; } + public global::Ideogram.GenerationResponseDataInnerVariant2? SvgGeneration { get; init; } #else - public global::Ideogram.SvgGenerationObject? SvgGeneration { get; } + public global::Ideogram.GenerationResponseDataInnerVariant2? SvgGeneration { get; } #endif /// @@ -75,7 +75,7 @@ public bool TryPickSvgGeneration( #if NET6_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] #endif - out global::Ideogram.SvgGenerationObject? value) + out global::Ideogram.GenerationResponseDataInnerVariant2? value) { value = SvgGeneration; return IsSvgGeneration; @@ -84,18 +84,17 @@ public bool TryPickSvgGeneration( /// /// /// - public global::Ideogram.SvgGenerationObject PickSvgGeneration() => SvgGeneration is { } value + public global::Ideogram.GenerationResponseDataInnerVariant2 PickSvgGeneration() => SvgGeneration is { } value ? value : throw new global::System.InvalidOperationException($"Expected union variant 'SvgGeneration' but the value was {ToString()}."); /// - /// A single generated image. Model-agnostic shape returned by the generation polling endpoint.
- /// Example: {"seed":12345,"object_type":"image.generation","asset_id":"asset_id","prompt":"prompt","resolution":"2048x2048","url":"https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804\u0026sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89","is_image_safe":true} + /// A single generated image. Model-agnostic shape returned by the generation polling endpoint. ///
#if NET6_0_OR_GREATER - public global::Ideogram.ImageGenerationObject? ImageGeneration { get; init; } + public global::Ideogram.GenerationResponseDataInnerVariant3? ImageGeneration { get; init; } #else - public global::Ideogram.ImageGenerationObject? ImageGeneration { get; } + public global::Ideogram.GenerationResponseDataInnerVariant3? ImageGeneration { get; } #endif /// @@ -113,7 +112,7 @@ public bool TryPickImageGeneration( #if NET6_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] #endif - out global::Ideogram.ImageGenerationObject? value) + out global::Ideogram.GenerationResponseDataInnerVariant3? value) { value = ImageGeneration; return IsImageGeneration; @@ -122,7 +121,7 @@ public bool TryPickImageGeneration( /// /// /// - public global::Ideogram.ImageGenerationObject PickImageGeneration() => ImageGeneration is { } value + public global::Ideogram.GenerationResponseDataInnerVariant3 PickImageGeneration() => ImageGeneration is { } value ? value : throw new global::System.InvalidOperationException($"Expected union variant 'ImageGeneration' but the value was {ToString()}."); @@ -130,9 +129,9 @@ public bool TryPickImageGeneration( /// A single generated video returned by the generation polling endpoint. /// #if NET6_0_OR_GREATER - public global::Ideogram.VideoObject? VideoGeneration { get; init; } + public global::Ideogram.GenerationResponseDataInnerVariant4? VideoGeneration { get; init; } #else - public global::Ideogram.VideoObject? VideoGeneration { get; } + public global::Ideogram.GenerationResponseDataInnerVariant4? VideoGeneration { get; } #endif /// @@ -150,7 +149,7 @@ public bool TryPickVideoGeneration( #if NET6_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] #endif - out global::Ideogram.VideoObject? value) + out global::Ideogram.GenerationResponseDataInnerVariant4? value) { value = VideoGeneration; return IsVideoGeneration; @@ -159,19 +158,18 @@ public bool TryPickVideoGeneration( /// /// /// - public global::Ideogram.VideoObject PickVideoGeneration() => VideoGeneration is { } value + public global::Ideogram.GenerationResponseDataInnerVariant4 PickVideoGeneration() => VideoGeneration is { } value ? value : throw new global::System.InvalidOperationException($"Expected union variant 'VideoGeneration' but the value was {ToString()}."); /// /// One layerized design. Image links are available for a limited period
- /// of time; if you would like to keep an image, you must download it.
- /// Example: {"seed":12345,"object_type":"layerized_image","resolution":"1024x1024","url":"https://openapi-generator.tech","base_image_url":"https://openapi-generator.tech","is_image_safe":true,"text_blocks":[{"role":"heading","color":"#212121","font_alternatives":["font_alternatives","font_alternatives"],"font_size":2,"font_name":"font_name","line_height":7.0614014,"x":0,"width":1,"y":6,"angle":5.637377,"text":"Hello World","alignment":"left","formatting":["bold","bold"],"height":5},{"role":"heading","color":"#212121","font_alternatives":["font_alternatives","font_alternatives"],"font_size":2,"font_name":"font_name","line_height":7.0614014,"x":0,"width":1,"y":6,"angle":5.637377,"text":"Hello World","alignment":"left","formatting":["bold","bold"],"height":5}]} + /// of time; if you would like to keep an image, you must download it. ///
#if NET6_0_OR_GREATER - public global::Ideogram.LayerizedImageObject? LayerizedImage { get; init; } + public global::Ideogram.GenerationResponseDataInnerVariant5? LayerizedImage { get; init; } #else - public global::Ideogram.LayerizedImageObject? LayerizedImage { get; } + public global::Ideogram.GenerationResponseDataInnerVariant5? LayerizedImage { get; } #endif /// @@ -189,7 +187,7 @@ public bool TryPickLayerizedImage( #if NET6_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] #endif - out global::Ideogram.LayerizedImageObject? value) + out global::Ideogram.GenerationResponseDataInnerVariant5? value) { value = LayerizedImage; return IsLayerizedImage; @@ -198,7 +196,7 @@ public bool TryPickLayerizedImage( /// /// /// - public global::Ideogram.LayerizedImageObject PickLayerizedImage() => LayerizedImage is { } value + public global::Ideogram.GenerationResponseDataInnerVariant5 PickLayerizedImage() => LayerizedImage is { } value ? value : throw new global::System.InvalidOperationException($"Expected union variant 'LayerizedImage' but the value was {ToString()}."); @@ -207,9 +205,9 @@ public bool TryPickLayerizedImage( /// if you would like to keep a file, you must download it. /// #if NET6_0_OR_GREATER - public global::Ideogram.TextLayerizerResultObject? LayerizedDesignGeneration { get; init; } + public global::Ideogram.GenerationResponseDataInnerVariant6? LayerizedDesignGeneration { get; init; } #else - public global::Ideogram.TextLayerizerResultObject? LayerizedDesignGeneration { get; } + public global::Ideogram.GenerationResponseDataInnerVariant6? LayerizedDesignGeneration { get; } #endif /// @@ -227,7 +225,7 @@ public bool TryPickLayerizedDesignGeneration( #if NET6_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] #endif - out global::Ideogram.TextLayerizerResultObject? value) + out global::Ideogram.GenerationResponseDataInnerVariant6? value) { value = LayerizedDesignGeneration; return IsLayerizedDesignGeneration; @@ -236,23 +234,23 @@ public bool TryPickLayerizedDesignGeneration( /// /// /// - public global::Ideogram.TextLayerizerResultObject PickLayerizedDesignGeneration() => LayerizedDesignGeneration is { } value + public global::Ideogram.GenerationResponseDataInnerVariant6 PickLayerizedDesignGeneration() => LayerizedDesignGeneration is { } value ? value : throw new global::System.InvalidOperationException($"Expected union variant 'LayerizedDesignGeneration' but the value was {ToString()}."); /// /// /// - public static implicit operator GenerationResponseDataInner(global::Ideogram.ImageObjectWithoutPromptOrSeed value) => new GenerationResponseDataInner((global::Ideogram.ImageObjectWithoutPromptOrSeed?)value); + public static implicit operator GenerationResponseDataInner(global::Ideogram.GenerationResponseDataInnerVariant1 value) => new GenerationResponseDataInner((global::Ideogram.GenerationResponseDataInnerVariant1?)value); /// /// /// - public static implicit operator global::Ideogram.ImageObjectWithoutPromptOrSeed?(GenerationResponseDataInner @this) => @this.ImageWithoutPromptOrSeed; + public static implicit operator global::Ideogram.GenerationResponseDataInnerVariant1?(GenerationResponseDataInner @this) => @this.ImageWithoutPromptOrSeed; /// /// /// - public GenerationResponseDataInner(global::Ideogram.ImageObjectWithoutPromptOrSeed? value) + public GenerationResponseDataInner(global::Ideogram.GenerationResponseDataInnerVariant1? value) { ImageWithoutPromptOrSeed = value; } @@ -260,22 +258,22 @@ public GenerationResponseDataInner(global::Ideogram.ImageObjectWithoutPromptOrSe /// /// /// - public static GenerationResponseDataInner FromImageWithoutPromptOrSeed(global::Ideogram.ImageObjectWithoutPromptOrSeed? value) => new GenerationResponseDataInner(value); + public static GenerationResponseDataInner FromImageWithoutPromptOrSeed(global::Ideogram.GenerationResponseDataInnerVariant1? value) => new GenerationResponseDataInner(value); /// /// /// - public static implicit operator GenerationResponseDataInner(global::Ideogram.SvgGenerationObject value) => new GenerationResponseDataInner((global::Ideogram.SvgGenerationObject?)value); + public static implicit operator GenerationResponseDataInner(global::Ideogram.GenerationResponseDataInnerVariant2 value) => new GenerationResponseDataInner((global::Ideogram.GenerationResponseDataInnerVariant2?)value); /// /// /// - public static implicit operator global::Ideogram.SvgGenerationObject?(GenerationResponseDataInner @this) => @this.SvgGeneration; + public static implicit operator global::Ideogram.GenerationResponseDataInnerVariant2?(GenerationResponseDataInner @this) => @this.SvgGeneration; /// /// /// - public GenerationResponseDataInner(global::Ideogram.SvgGenerationObject? value) + public GenerationResponseDataInner(global::Ideogram.GenerationResponseDataInnerVariant2? value) { SvgGeneration = value; } @@ -283,22 +281,22 @@ public GenerationResponseDataInner(global::Ideogram.SvgGenerationObject? value) /// /// /// - public static GenerationResponseDataInner FromSvgGeneration(global::Ideogram.SvgGenerationObject? value) => new GenerationResponseDataInner(value); + public static GenerationResponseDataInner FromSvgGeneration(global::Ideogram.GenerationResponseDataInnerVariant2? value) => new GenerationResponseDataInner(value); /// /// /// - public static implicit operator GenerationResponseDataInner(global::Ideogram.ImageGenerationObject value) => new GenerationResponseDataInner((global::Ideogram.ImageGenerationObject?)value); + public static implicit operator GenerationResponseDataInner(global::Ideogram.GenerationResponseDataInnerVariant3 value) => new GenerationResponseDataInner((global::Ideogram.GenerationResponseDataInnerVariant3?)value); /// /// /// - public static implicit operator global::Ideogram.ImageGenerationObject?(GenerationResponseDataInner @this) => @this.ImageGeneration; + public static implicit operator global::Ideogram.GenerationResponseDataInnerVariant3?(GenerationResponseDataInner @this) => @this.ImageGeneration; /// /// /// - public GenerationResponseDataInner(global::Ideogram.ImageGenerationObject? value) + public GenerationResponseDataInner(global::Ideogram.GenerationResponseDataInnerVariant3? value) { ImageGeneration = value; } @@ -306,22 +304,22 @@ public GenerationResponseDataInner(global::Ideogram.ImageGenerationObject? value /// /// /// - public static GenerationResponseDataInner FromImageGeneration(global::Ideogram.ImageGenerationObject? value) => new GenerationResponseDataInner(value); + public static GenerationResponseDataInner FromImageGeneration(global::Ideogram.GenerationResponseDataInnerVariant3? value) => new GenerationResponseDataInner(value); /// /// /// - public static implicit operator GenerationResponseDataInner(global::Ideogram.VideoObject value) => new GenerationResponseDataInner((global::Ideogram.VideoObject?)value); + public static implicit operator GenerationResponseDataInner(global::Ideogram.GenerationResponseDataInnerVariant4 value) => new GenerationResponseDataInner((global::Ideogram.GenerationResponseDataInnerVariant4?)value); /// /// /// - public static implicit operator global::Ideogram.VideoObject?(GenerationResponseDataInner @this) => @this.VideoGeneration; + public static implicit operator global::Ideogram.GenerationResponseDataInnerVariant4?(GenerationResponseDataInner @this) => @this.VideoGeneration; /// /// /// - public GenerationResponseDataInner(global::Ideogram.VideoObject? value) + public GenerationResponseDataInner(global::Ideogram.GenerationResponseDataInnerVariant4? value) { VideoGeneration = value; } @@ -329,22 +327,22 @@ public GenerationResponseDataInner(global::Ideogram.VideoObject? value) /// /// /// - public static GenerationResponseDataInner FromVideoGeneration(global::Ideogram.VideoObject? value) => new GenerationResponseDataInner(value); + public static GenerationResponseDataInner FromVideoGeneration(global::Ideogram.GenerationResponseDataInnerVariant4? value) => new GenerationResponseDataInner(value); /// /// /// - public static implicit operator GenerationResponseDataInner(global::Ideogram.LayerizedImageObject value) => new GenerationResponseDataInner((global::Ideogram.LayerizedImageObject?)value); + public static implicit operator GenerationResponseDataInner(global::Ideogram.GenerationResponseDataInnerVariant5 value) => new GenerationResponseDataInner((global::Ideogram.GenerationResponseDataInnerVariant5?)value); /// /// /// - public static implicit operator global::Ideogram.LayerizedImageObject?(GenerationResponseDataInner @this) => @this.LayerizedImage; + public static implicit operator global::Ideogram.GenerationResponseDataInnerVariant5?(GenerationResponseDataInner @this) => @this.LayerizedImage; /// /// /// - public GenerationResponseDataInner(global::Ideogram.LayerizedImageObject? value) + public GenerationResponseDataInner(global::Ideogram.GenerationResponseDataInnerVariant5? value) { LayerizedImage = value; } @@ -352,22 +350,22 @@ public GenerationResponseDataInner(global::Ideogram.LayerizedImageObject? value) /// /// /// - public static GenerationResponseDataInner FromLayerizedImage(global::Ideogram.LayerizedImageObject? value) => new GenerationResponseDataInner(value); + public static GenerationResponseDataInner FromLayerizedImage(global::Ideogram.GenerationResponseDataInnerVariant5? value) => new GenerationResponseDataInner(value); /// /// /// - public static implicit operator GenerationResponseDataInner(global::Ideogram.TextLayerizerResultObject value) => new GenerationResponseDataInner((global::Ideogram.TextLayerizerResultObject?)value); + public static implicit operator GenerationResponseDataInner(global::Ideogram.GenerationResponseDataInnerVariant6 value) => new GenerationResponseDataInner((global::Ideogram.GenerationResponseDataInnerVariant6?)value); /// /// /// - public static implicit operator global::Ideogram.TextLayerizerResultObject?(GenerationResponseDataInner @this) => @this.LayerizedDesignGeneration; + public static implicit operator global::Ideogram.GenerationResponseDataInnerVariant6?(GenerationResponseDataInner @this) => @this.LayerizedDesignGeneration; /// /// /// - public GenerationResponseDataInner(global::Ideogram.TextLayerizerResultObject? value) + public GenerationResponseDataInner(global::Ideogram.GenerationResponseDataInnerVariant6? value) { LayerizedDesignGeneration = value; } @@ -375,19 +373,19 @@ public GenerationResponseDataInner(global::Ideogram.TextLayerizerResultObject? v /// /// /// - public static GenerationResponseDataInner FromLayerizedDesignGeneration(global::Ideogram.TextLayerizerResultObject? value) => new GenerationResponseDataInner(value); + public static GenerationResponseDataInner FromLayerizedDesignGeneration(global::Ideogram.GenerationResponseDataInnerVariant6? value) => new GenerationResponseDataInner(value); /// /// /// public GenerationResponseDataInner( global::Ideogram.GenerationResponseDataInnerDiscriminatorObjectType? objectType, - global::Ideogram.ImageObjectWithoutPromptOrSeed? imageWithoutPromptOrSeed, - global::Ideogram.SvgGenerationObject? svgGeneration, - global::Ideogram.ImageGenerationObject? imageGeneration, - global::Ideogram.VideoObject? videoGeneration, - global::Ideogram.LayerizedImageObject? layerizedImage, - global::Ideogram.TextLayerizerResultObject? layerizedDesignGeneration + global::Ideogram.GenerationResponseDataInnerVariant1? imageWithoutPromptOrSeed, + global::Ideogram.GenerationResponseDataInnerVariant2? svgGeneration, + global::Ideogram.GenerationResponseDataInnerVariant3? imageGeneration, + global::Ideogram.GenerationResponseDataInnerVariant4? videoGeneration, + global::Ideogram.GenerationResponseDataInnerVariant5? layerizedImage, + global::Ideogram.GenerationResponseDataInnerVariant6? layerizedDesignGeneration ) { ObjectType = objectType; @@ -436,12 +434,12 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? imageWithoutPromptOrSeed = null, - global::System.Func? svgGeneration = null, - global::System.Func? imageGeneration = null, - global::System.Func? videoGeneration = null, - global::System.Func? layerizedImage = null, - global::System.Func? layerizedDesignGeneration = null, + global::System.Func? imageWithoutPromptOrSeed = null, + global::System.Func? svgGeneration = null, + global::System.Func? imageGeneration = null, + global::System.Func? videoGeneration = null, + global::System.Func? layerizedImage = null, + global::System.Func? layerizedDesignGeneration = null, bool validate = true) { if (validate) @@ -481,17 +479,17 @@ public bool Validate() /// ///
public void Match( - global::System.Action? imageWithoutPromptOrSeed = null, + global::System.Action? imageWithoutPromptOrSeed = null, - global::System.Action? svgGeneration = null, + global::System.Action? svgGeneration = null, - global::System.Action? imageGeneration = null, + global::System.Action? imageGeneration = null, - global::System.Action? videoGeneration = null, + global::System.Action? videoGeneration = null, - global::System.Action? layerizedImage = null, + global::System.Action? layerizedImage = null, - global::System.Action? layerizedDesignGeneration = null, + global::System.Action? layerizedDesignGeneration = null, bool validate = true) { if (validate) @@ -529,12 +527,12 @@ public void Match( /// ///
public void Switch( - global::System.Action? imageWithoutPromptOrSeed = null, - global::System.Action? svgGeneration = null, - global::System.Action? imageGeneration = null, - global::System.Action? videoGeneration = null, - global::System.Action? layerizedImage = null, - global::System.Action? layerizedDesignGeneration = null, + global::System.Action? imageWithoutPromptOrSeed = null, + global::System.Action? svgGeneration = null, + global::System.Action? imageGeneration = null, + global::System.Action? videoGeneration = null, + global::System.Action? layerizedImage = null, + global::System.Action? layerizedDesignGeneration = null, bool validate = true) { if (validate) @@ -576,17 +574,17 @@ public override int GetHashCode() var fields = new object?[] { ImageWithoutPromptOrSeed, - typeof(global::Ideogram.ImageObjectWithoutPromptOrSeed), + typeof(global::Ideogram.GenerationResponseDataInnerVariant1), SvgGeneration, - typeof(global::Ideogram.SvgGenerationObject), + typeof(global::Ideogram.GenerationResponseDataInnerVariant2), ImageGeneration, - typeof(global::Ideogram.ImageGenerationObject), + typeof(global::Ideogram.GenerationResponseDataInnerVariant3), VideoGeneration, - typeof(global::Ideogram.VideoObject), + typeof(global::Ideogram.GenerationResponseDataInnerVariant4), LayerizedImage, - typeof(global::Ideogram.LayerizedImageObject), + typeof(global::Ideogram.GenerationResponseDataInnerVariant5), LayerizedDesignGeneration, - typeof(global::Ideogram.TextLayerizerResultObject), + typeof(global::Ideogram.GenerationResponseDataInnerVariant6), }; const int offset = unchecked((int)2166136261); const int prime = 16777619; @@ -603,12 +601,12 @@ static int HashCodeAggregator(int hashCode, object? value) => value == null public bool Equals(GenerationResponseDataInner other) { return - global::System.Collections.Generic.EqualityComparer.Default.Equals(ImageWithoutPromptOrSeed, other.ImageWithoutPromptOrSeed) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(SvgGeneration, other.SvgGeneration) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(ImageGeneration, other.ImageGeneration) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(VideoGeneration, other.VideoGeneration) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(LayerizedImage, other.LayerizedImage) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(LayerizedDesignGeneration, other.LayerizedDesignGeneration) + global::System.Collections.Generic.EqualityComparer.Default.Equals(ImageWithoutPromptOrSeed, other.ImageWithoutPromptOrSeed) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(SvgGeneration, other.SvgGeneration) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(ImageGeneration, other.ImageGeneration) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(VideoGeneration, other.VideoGeneration) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(LayerizedImage, other.LayerizedImage) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(LayerizedDesignGeneration, other.LayerizedDesignGeneration) ; } diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerDiscriminatorMappingSvgGenerationMimeType.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerDiscriminatorMappingSvgGenerationMimeType.g.cs new file mode 100644 index 00000000..617663a5 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerDiscriminatorMappingSvgGenerationMimeType.g.cs @@ -0,0 +1,45 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// + /// + public enum GenerationResponseDataInnerDiscriminatorMappingSvgGenerationMimeType + { + /// + /// + /// + ImageSvgPlusxml, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class GenerationResponseDataInnerDiscriminatorMappingSvgGenerationMimeTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this GenerationResponseDataInnerDiscriminatorMappingSvgGenerationMimeType value) + { + return value switch + { + GenerationResponseDataInnerDiscriminatorMappingSvgGenerationMimeType.ImageSvgPlusxml => "image/svg+xml", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static GenerationResponseDataInnerDiscriminatorMappingSvgGenerationMimeType? ToEnum(string value) + { + return value switch + { + "image/svg+xml" => GenerationResponseDataInnerDiscriminatorMappingSvgGenerationMimeType.ImageSvgPlusxml, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant1.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant1.Json.g.cs new file mode 100644 index 00000000..a2b398d5 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant1.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class GenerationResponseDataInnerVariant1 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.GenerationResponseDataInnerVariant1? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.GenerationResponseDataInnerVariant1), + jsonSerializerContext) as global::Ideogram.GenerationResponseDataInnerVariant1; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.GenerationResponseDataInnerVariant1? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.GenerationResponseDataInnerVariant1? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.GenerationResponseDataInnerVariant1), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GenerationResponseDataInnerVariant1; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant1.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant1.g.cs new file mode 100644 index 00000000..9179b6b2 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant1.g.cs @@ -0,0 +1,82 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// An image result that does not expose its prompt or seed. + /// + public sealed partial class GenerationResponseDataInnerVariant1 + { + /// + /// Discriminator value: image.without-prompt-or-seed + /// + [global::System.Text.Json.Serialization.JsonPropertyName("object_type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.GenerationResponseDataInnerVariant1ObjectTypeJsonConverter))] + public global::Ideogram.GenerationResponseDataInnerVariant1ObjectType ObjectType { get; set; } + + /// + /// The direct link to the reframed image. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("url")] + public string? Url { get; set; } + + /// + /// The exact dimensions of the reframed image, formatted as "{width}x{height}". + /// + [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Resolution { get; set; } + + /// + /// Whether this image passes safety checks. If false, the url field is empty. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("is_image_safe")] + [global::System.Text.Json.Serialization.JsonRequired] + public required bool IsImageSafe { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The exact dimensions of the reframed image, formatted as "{width}x{height}". + /// + /// + /// Whether this image passes safety checks. If false, the url field is empty. + /// + /// + /// Discriminator value: image.without-prompt-or-seed + /// + /// + /// The direct link to the reframed image. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public GenerationResponseDataInnerVariant1( + string resolution, + bool isImageSafe, + global::Ideogram.GenerationResponseDataInnerVariant1ObjectType objectType, + string? url) + { + this.ObjectType = objectType; + this.Url = url; + this.Resolution = resolution ?? throw new global::System.ArgumentNullException(nameof(resolution)); + this.IsImageSafe = isImageSafe; + } + + /// + /// Initializes a new instance of the class. + /// + public GenerationResponseDataInnerVariant1() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant1ObjectType.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant1ObjectType.g.cs new file mode 100644 index 00000000..40610e7a --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant1ObjectType.g.cs @@ -0,0 +1,45 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Discriminator value: image.without-prompt-or-seed + /// + public enum GenerationResponseDataInnerVariant1ObjectType + { + /// + /// image.without-prompt-or-seed + /// + ImageWithoutPromptOrSeed, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class GenerationResponseDataInnerVariant1ObjectTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this GenerationResponseDataInnerVariant1ObjectType value) + { + return value switch + { + GenerationResponseDataInnerVariant1ObjectType.ImageWithoutPromptOrSeed => "image.without-prompt-or-seed", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static GenerationResponseDataInnerVariant1ObjectType? ToEnum(string value) + { + return value switch + { + "image.without-prompt-or-seed" => GenerationResponseDataInnerVariant1ObjectType.ImageWithoutPromptOrSeed, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant2.Json.g.cs new file mode 100644 index 00000000..30f5d725 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class GenerationResponseDataInnerVariant2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.GenerationResponseDataInnerVariant2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.GenerationResponseDataInnerVariant2), + jsonSerializerContext) as global::Ideogram.GenerationResponseDataInnerVariant2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.GenerationResponseDataInnerVariant2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.GenerationResponseDataInnerVariant2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.GenerationResponseDataInnerVariant2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GenerationResponseDataInnerVariant2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant2.g.cs new file mode 100644 index 00000000..209afc3c --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant2.g.cs @@ -0,0 +1,105 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// SvgGenerationObject variant + /// + public sealed partial class GenerationResponseDataInnerVariant2 + { + /// + /// Discriminator value: svg.generation + /// + [global::System.Text.Json.Serialization.JsonPropertyName("object_type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.GenerationResponseDataInnerVariant2ObjectTypeJsonConverter))] + public global::Ideogram.GenerationResponseDataInnerVariant2ObjectType ObjectType { get; set; } + + /// + /// URL-safe base64 SVG asset ID. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("asset_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string AssetId { get; set; } + + /// + /// Signed download URL for the original SVG. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("url")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Url { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("mime_type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.GenerationResponseDataInnerDiscriminatorMappingSvgGenerationMimeTypeJsonConverter))] + public global::Ideogram.GenerationResponseDataInnerDiscriminatorMappingSvgGenerationMimeType MimeType { get; set; } + + /// + /// Width of the output SVG canvas in pixels. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("width")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int Width { get; set; } + + /// + /// Height of the output SVG canvas in pixels. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("height")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int Height { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// URL-safe base64 SVG asset ID. + /// + /// + /// Signed download URL for the original SVG. + /// + /// + /// Width of the output SVG canvas in pixels. + /// + /// + /// Height of the output SVG canvas in pixels. + /// + /// + /// Discriminator value: svg.generation + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public GenerationResponseDataInnerVariant2( + string assetId, + string url, + int width, + int height, + global::Ideogram.GenerationResponseDataInnerVariant2ObjectType objectType, + global::Ideogram.GenerationResponseDataInnerDiscriminatorMappingSvgGenerationMimeType mimeType) + { + this.ObjectType = objectType; + this.AssetId = assetId ?? throw new global::System.ArgumentNullException(nameof(assetId)); + this.Url = url ?? throw new global::System.ArgumentNullException(nameof(url)); + this.MimeType = mimeType; + this.Width = width; + this.Height = height; + } + + /// + /// Initializes a new instance of the class. + /// + public GenerationResponseDataInnerVariant2() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant2ObjectType.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant2ObjectType.g.cs new file mode 100644 index 00000000..0e3e7462 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant2ObjectType.g.cs @@ -0,0 +1,45 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Discriminator value: svg.generation + /// + public enum GenerationResponseDataInnerVariant2ObjectType + { + /// + /// svg.generation + /// + SvgGeneration, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class GenerationResponseDataInnerVariant2ObjectTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this GenerationResponseDataInnerVariant2ObjectType value) + { + return value switch + { + GenerationResponseDataInnerVariant2ObjectType.SvgGeneration => "svg.generation", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static GenerationResponseDataInnerVariant2ObjectType? ToEnum(string value) + { + return value switch + { + "svg.generation" => GenerationResponseDataInnerVariant2ObjectType.SvgGeneration, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant3.Json.g.cs new file mode 100644 index 00000000..6c11889c --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class GenerationResponseDataInnerVariant3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.GenerationResponseDataInnerVariant3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.GenerationResponseDataInnerVariant3), + jsonSerializerContext) as global::Ideogram.GenerationResponseDataInnerVariant3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.GenerationResponseDataInnerVariant3? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.GenerationResponseDataInnerVariant3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.GenerationResponseDataInnerVariant3), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GenerationResponseDataInnerVariant3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant3.g.cs new file mode 100644 index 00000000..b129765d --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant3.g.cs @@ -0,0 +1,106 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// A single generated image. Model-agnostic shape returned by the generation polling endpoint. + /// + public sealed partial class GenerationResponseDataInnerVariant3 + { + /// + /// Discriminator value: image.generation + /// + [global::System.Text.Json.Serialization.JsonPropertyName("object_type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.GenerationResponseDataInnerVariant3ObjectTypeJsonConverter))] + public global::Ideogram.GenerationResponseDataInnerVariant3ObjectType ObjectType { get; set; } + + /// + /// The direct link to the image generated. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("url")] + public string? Url { get; set; } + + /// + /// The prompt used for the generation. This may be different from the original prompt. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Prompt { get; set; } + + /// + /// The resolution of the generated image, formatted as "{width}x{height}". + /// + [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Resolution { get; set; } + + /// + /// Whether this image passes safety checks. If false, the url field will be empty. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("is_image_safe")] + [global::System.Text.Json.Serialization.JsonRequired] + public required bool IsImageSafe { get; set; } + + /// + /// Random seed. Set for reproducible generation. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("seed")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int Seed { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The prompt used for the generation. This may be different from the original prompt. + /// + /// + /// The resolution of the generated image, formatted as "{width}x{height}". + /// + /// + /// Whether this image passes safety checks. If false, the url field will be empty. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// Discriminator value: image.generation + /// + /// + /// The direct link to the image generated. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public GenerationResponseDataInnerVariant3( + string prompt, + string resolution, + bool isImageSafe, + int seed, + global::Ideogram.GenerationResponseDataInnerVariant3ObjectType objectType, + string? url) + { + this.ObjectType = objectType; + this.Url = url; + this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); + this.Resolution = resolution ?? throw new global::System.ArgumentNullException(nameof(resolution)); + this.IsImageSafe = isImageSafe; + this.Seed = seed; + } + + /// + /// Initializes a new instance of the class. + /// + public GenerationResponseDataInnerVariant3() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant3ObjectType.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant3ObjectType.g.cs new file mode 100644 index 00000000..cedd104a --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant3ObjectType.g.cs @@ -0,0 +1,45 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Discriminator value: image.generation + /// + public enum GenerationResponseDataInnerVariant3ObjectType + { + /// + /// image.generation + /// + ImageGeneration, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class GenerationResponseDataInnerVariant3ObjectTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this GenerationResponseDataInnerVariant3ObjectType value) + { + return value switch + { + GenerationResponseDataInnerVariant3ObjectType.ImageGeneration => "image.generation", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static GenerationResponseDataInnerVariant3ObjectType? ToEnum(string value) + { + return value switch + { + "image.generation" => GenerationResponseDataInnerVariant3ObjectType.ImageGeneration, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant4.Json.g.cs new file mode 100644 index 00000000..09326506 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class GenerationResponseDataInnerVariant4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.GenerationResponseDataInnerVariant4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.GenerationResponseDataInnerVariant4), + jsonSerializerContext) as global::Ideogram.GenerationResponseDataInnerVariant4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.GenerationResponseDataInnerVariant4? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.GenerationResponseDataInnerVariant4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.GenerationResponseDataInnerVariant4), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GenerationResponseDataInnerVariant4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant4.g.cs new file mode 100644 index 00000000..e254c246 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant4.g.cs @@ -0,0 +1,117 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// A single generated video returned by the generation polling endpoint. + /// + public sealed partial class GenerationResponseDataInnerVariant4 + { + /// + /// Discriminator value: video.generation + /// + [global::System.Text.Json.Serialization.JsonPropertyName("object_type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.GenerationResponseDataInnerVariant4ObjectTypeJsonConverter))] + public global::Ideogram.GenerationResponseDataInnerVariant4ObjectType ObjectType { get; set; } + + /// + /// The generated video's asset ID. Use it with asset_type RESPONSE in video_asset_identifier for a follow-up video edit. This is distinct from the generation ID used for polling. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("asset_id")] + public string? AssetId { get; set; } + + /// + /// The direct link to the generated video. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("url")] + public string? Url { get; set; } + + /// + /// The prompt used for the generation. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Prompt { get; set; } + + /// + /// The resolution tier of the generated video. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Resolution { get; set; } + + /// + /// The actual aspect ratio of the produced video, formatted as "{width}:{height}". + /// + [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string AspectRatio { get; set; } + + /// + /// The actual measured length of the produced video in seconds. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("duration")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int Duration { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The prompt used for the generation. + /// + /// + /// The resolution tier of the generated video. + /// + /// + /// The actual aspect ratio of the produced video, formatted as "{width}:{height}". + /// + /// + /// The actual measured length of the produced video in seconds. + /// + /// + /// Discriminator value: video.generation + /// + /// + /// The generated video's asset ID. Use it with asset_type RESPONSE in video_asset_identifier for a follow-up video edit. This is distinct from the generation ID used for polling. + /// + /// + /// The direct link to the generated video. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public GenerationResponseDataInnerVariant4( + string prompt, + string resolution, + string aspectRatio, + int duration, + global::Ideogram.GenerationResponseDataInnerVariant4ObjectType objectType, + string? assetId, + string? url) + { + this.ObjectType = objectType; + this.AssetId = assetId; + this.Url = url; + this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); + this.Resolution = resolution ?? throw new global::System.ArgumentNullException(nameof(resolution)); + this.AspectRatio = aspectRatio ?? throw new global::System.ArgumentNullException(nameof(aspectRatio)); + this.Duration = duration; + } + + /// + /// Initializes a new instance of the class. + /// + public GenerationResponseDataInnerVariant4() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant4ObjectType.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant4ObjectType.g.cs new file mode 100644 index 00000000..8c33d285 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant4ObjectType.g.cs @@ -0,0 +1,45 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Discriminator value: video.generation + /// + public enum GenerationResponseDataInnerVariant4ObjectType + { + /// + /// video.generation + /// + VideoGeneration, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class GenerationResponseDataInnerVariant4ObjectTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this GenerationResponseDataInnerVariant4ObjectType value) + { + return value switch + { + GenerationResponseDataInnerVariant4ObjectType.VideoGeneration => "video.generation", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static GenerationResponseDataInnerVariant4ObjectType? ToEnum(string value) + { + return value switch + { + "video.generation" => GenerationResponseDataInnerVariant4ObjectType.VideoGeneration, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant5.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant5.Json.g.cs new file mode 100644 index 00000000..e40780e9 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class GenerationResponseDataInnerVariant5 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.GenerationResponseDataInnerVariant5? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.GenerationResponseDataInnerVariant5), + jsonSerializerContext) as global::Ideogram.GenerationResponseDataInnerVariant5; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.GenerationResponseDataInnerVariant5? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.GenerationResponseDataInnerVariant5? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.GenerationResponseDataInnerVariant5), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GenerationResponseDataInnerVariant5; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant5.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant5.g.cs new file mode 100644 index 00000000..311ea777 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant5.g.cs @@ -0,0 +1,118 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// One layerized design. Image links are available for a limited period
+ /// of time; if you would like to keep an image, you must download it. + ///
+ public sealed partial class GenerationResponseDataInnerVariant5 + { + /// + /// Discriminator value: layerized_image + /// + [global::System.Text.Json.Serialization.JsonPropertyName("object_type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.GenerationResponseDataInnerVariant5ObjectTypeJsonConverter))] + public global::Ideogram.GenerationResponseDataInnerVariant5ObjectType ObjectType { get; set; } + + /// + /// The direct link to the design image with its text intact. Empty when the image did not pass safety checks. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("url")] + public string? Url { get; set; } + + /// + /// The direct link to the base image with all detected text removed. Empty when the image did not pass safety checks. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("base_image_url")] + public string? BaseImageUrl { get; set; } + + /// + /// The resolution of the design, formatted as "WIDTHxHEIGHT". + /// + [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Resolution { get; set; } + + /// + /// Whether the image passed safety checks. If false, the image links are empty. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("is_image_safe")] + [global::System.Text.Json.Serialization.JsonRequired] + public required bool IsImageSafe { get; set; } + + /// + /// Random seed. Set for reproducible generation. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("seed")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int Seed { get; set; } + + /// + /// Flat list of detected text regions in the design. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("text_blocks")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList TextBlocks { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The resolution of the design, formatted as "WIDTHxHEIGHT". + /// + /// + /// Whether the image passed safety checks. If false, the image links are empty. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// Flat list of detected text regions in the design. + /// + /// + /// Discriminator value: layerized_image + /// + /// + /// The direct link to the design image with its text intact. Empty when the image did not pass safety checks. + /// + /// + /// The direct link to the base image with all detected text removed. Empty when the image did not pass safety checks. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public GenerationResponseDataInnerVariant5( + string resolution, + bool isImageSafe, + int seed, + global::System.Collections.Generic.IList textBlocks, + global::Ideogram.GenerationResponseDataInnerVariant5ObjectType objectType, + string? url, + string? baseImageUrl) + { + this.ObjectType = objectType; + this.Url = url; + this.BaseImageUrl = baseImageUrl; + this.Resolution = resolution ?? throw new global::System.ArgumentNullException(nameof(resolution)); + this.IsImageSafe = isImageSafe; + this.Seed = seed; + this.TextBlocks = textBlocks ?? throw new global::System.ArgumentNullException(nameof(textBlocks)); + } + + /// + /// Initializes a new instance of the class. + /// + public GenerationResponseDataInnerVariant5() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant5ObjectType.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant5ObjectType.g.cs new file mode 100644 index 00000000..1059ffc2 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant5ObjectType.g.cs @@ -0,0 +1,45 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Discriminator value: layerized_image + /// + public enum GenerationResponseDataInnerVariant5ObjectType + { + /// + /// layerized_image + /// + LayerizedImage, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class GenerationResponseDataInnerVariant5ObjectTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this GenerationResponseDataInnerVariant5ObjectType value) + { + return value switch + { + GenerationResponseDataInnerVariant5ObjectType.LayerizedImage => "layerized_image", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static GenerationResponseDataInnerVariant5ObjectType? ToEnum(string value) + { + return value switch + { + "layerized_image" => GenerationResponseDataInnerVariant5ObjectType.LayerizedImage, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant6.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant6.Json.g.cs new file mode 100644 index 00000000..7c6e9470 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant6.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class GenerationResponseDataInnerVariant6 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.GenerationResponseDataInnerVariant6? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.GenerationResponseDataInnerVariant6), + jsonSerializerContext) as global::Ideogram.GenerationResponseDataInnerVariant6; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.GenerationResponseDataInnerVariant6? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.GenerationResponseDataInnerVariant6? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.GenerationResponseDataInnerVariant6), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GenerationResponseDataInnerVariant6; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant6.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant6.g.cs new file mode 100644 index 00000000..a10422a2 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant6.g.cs @@ -0,0 +1,165 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// One layerized design. Links are available for a limited period of time;
+ /// if you would like to keep a file, you must download it. + ///
+ public sealed partial class GenerationResponseDataInnerVariant6 + { + /// + /// Discriminator value: layerized_design.generation + /// + [global::System.Text.Json.Serialization.JsonPropertyName("object_type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.GenerationResponseDataInnerVariant6ObjectTypeJsonConverter))] + public global::Ideogram.GenerationResponseDataInnerVariant6ObjectType ObjectType { get; set; } + + /// + /// Signed link to the design image with its text intact. Empty when the image did not pass safety checks. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("url")] + public string? Url { get; set; } + + /// + /// Signed link to the base image with all detected text removed. Empty when the image did not pass safety checks. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("base_image_url")] + public string? BaseImageUrl { get; set; } + + /// + /// The resolution of the design, formatted as "WIDTHxHEIGHT". + /// + [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Resolution { get; set; } + + /// + /// Whether the image passed safety checks. If false, the links are empty. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("is_image_safe")] + [global::System.Text.Json.Serialization.JsonRequired] + public required bool IsImageSafe { get; set; } + + /// + /// Random seed. Set for reproducible generation. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("seed")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int Seed { get; set; } + + /// + /// Flat list of detected text regions in the design. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("text_blocks")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList TextBlocks { get; set; } + + /// + /// Signed link to a self-contained HTML page displaying the editable
+ /// design, including curved text, gradients, outlines, and shadows. The
+ /// renderer, images, and fonts are embedded in the page, so it keeps
+ /// working offline once downloaded; the link itself expires after 24
+ /// hours. Uploaded `font_candidate_files` are embedded as supplied, so
+ /// redistributing the page is subject to those fonts' licenses. Empty
+ /// when the image did not pass safety checks or the page could not be
+ /// built.
+ /// The page exposes one editing API for every text layer, whether it
+ /// is drawn as HTML or on a canvas. Each layer is addressed by its
+ /// `text_blocks[].layer_id`. Scripts in the page can call
+ /// `window.layerize` (`ready`, `getTextLayers()`, `setText(id, text)`,
+ /// `update(id, patch)`, `toJSON()`, `toPNG()`); a parent page that
+ /// embeds it in an iframe sends `postMessage` requests such as
+ /// `{"type": "layerize:set-text", "id": "text-0", "text": "Hello"}`
+ /// and receives `layerize:ready`, `layerize:updated`, and
+ /// `layerize:error` replies. The page is served sandboxed with an
+ /// opaque origin, so it cannot read cookies or storage of the site
+ /// that embeds it. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("html_url")] + public string? HtmlUrl { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The resolution of the design, formatted as "WIDTHxHEIGHT". + /// + /// + /// Whether the image passed safety checks. If false, the links are empty. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// Flat list of detected text regions in the design. + /// + /// + /// Discriminator value: layerized_design.generation + /// + /// + /// Signed link to the design image with its text intact. Empty when the image did not pass safety checks. + /// + /// + /// Signed link to the base image with all detected text removed. Empty when the image did not pass safety checks. + /// + /// + /// Signed link to a self-contained HTML page displaying the editable
+ /// design, including curved text, gradients, outlines, and shadows. The
+ /// renderer, images, and fonts are embedded in the page, so it keeps
+ /// working offline once downloaded; the link itself expires after 24
+ /// hours. Uploaded `font_candidate_files` are embedded as supplied, so
+ /// redistributing the page is subject to those fonts' licenses. Empty
+ /// when the image did not pass safety checks or the page could not be
+ /// built.
+ /// The page exposes one editing API for every text layer, whether it
+ /// is drawn as HTML or on a canvas. Each layer is addressed by its
+ /// `text_blocks[].layer_id`. Scripts in the page can call
+ /// `window.layerize` (`ready`, `getTextLayers()`, `setText(id, text)`,
+ /// `update(id, patch)`, `toJSON()`, `toPNG()`); a parent page that
+ /// embeds it in an iframe sends `postMessage` requests such as
+ /// `{"type": "layerize:set-text", "id": "text-0", "text": "Hello"}`
+ /// and receives `layerize:ready`, `layerize:updated`, and
+ /// `layerize:error` replies. The page is served sandboxed with an
+ /// opaque origin, so it cannot read cookies or storage of the site
+ /// that embeds it. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public GenerationResponseDataInnerVariant6( + string resolution, + bool isImageSafe, + int seed, + global::System.Collections.Generic.IList textBlocks, + global::Ideogram.GenerationResponseDataInnerVariant6ObjectType objectType, + string? url, + string? baseImageUrl, + string? htmlUrl) + { + this.ObjectType = objectType; + this.Url = url; + this.BaseImageUrl = baseImageUrl; + this.Resolution = resolution ?? throw new global::System.ArgumentNullException(nameof(resolution)); + this.IsImageSafe = isImageSafe; + this.Seed = seed; + this.TextBlocks = textBlocks ?? throw new global::System.ArgumentNullException(nameof(textBlocks)); + this.HtmlUrl = htmlUrl; + } + + /// + /// Initializes a new instance of the class. + /// + public GenerationResponseDataInnerVariant6() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant6ObjectType.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant6ObjectType.g.cs new file mode 100644 index 00000000..24941421 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerationResponseDataInnerVariant6ObjectType.g.cs @@ -0,0 +1,45 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Discriminator value: layerized_design.generation + /// + public enum GenerationResponseDataInnerVariant6ObjectType + { + /// + /// layerized_design.generation + /// + LayerizedDesignGeneration, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class GenerationResponseDataInnerVariant6ObjectTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this GenerationResponseDataInnerVariant6ObjectType value) + { + return value switch + { + GenerationResponseDataInnerVariant6ObjectType.LayerizedDesignGeneration => "layerized_design.generation", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static GenerationResponseDataInnerVariant6ObjectType? ToEnum(string value) + { + return value switch + { + "layerized_design.generation" => GenerationResponseDataInnerVariant6ObjectType.LayerizedDesignGeneration, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerationsGetGenerationV2Response.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerationsGetGenerationV2Response.Json.g.cs new file mode 100644 index 00000000..06e817a5 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerationsGetGenerationV2Response.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class GenerationsGetGenerationV2Response + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.GenerationsGetGenerationV2Response? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.GenerationsGetGenerationV2Response), + jsonSerializerContext) as global::Ideogram.GenerationsGetGenerationV2Response; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.GenerationsGetGenerationV2Response? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.GenerationsGetGenerationV2Response? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.GenerationsGetGenerationV2Response), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GenerationsGetGenerationV2Response; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerationsGetGenerationV2Response.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerationsGetGenerationV2Response.g.cs new file mode 100644 index 00000000..8a28d16a --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerationsGetGenerationV2Response.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class GenerationsGetGenerationV2Response + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerationsGetGenerationV2Response2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerationsGetGenerationV2Response2.Json.g.cs new file mode 100644 index 00000000..da5b02aa --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerationsGetGenerationV2Response2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class GenerationsGetGenerationV2Response2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.GenerationsGetGenerationV2Response2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.GenerationsGetGenerationV2Response2), + jsonSerializerContext) as global::Ideogram.GenerationsGetGenerationV2Response2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.GenerationsGetGenerationV2Response2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.GenerationsGetGenerationV2Response2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.GenerationsGetGenerationV2Response2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GenerationsGetGenerationV2Response2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerationsGetGenerationV2Response2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerationsGetGenerationV2Response2.g.cs new file mode 100644 index 00000000..37107c7a --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerationsGetGenerationV2Response2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class GenerationsGetGenerationV2Response2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerationsGetGenerationV2Response3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerationsGetGenerationV2Response3.Json.g.cs new file mode 100644 index 00000000..7b1c66df --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerationsGetGenerationV2Response3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class GenerationsGetGenerationV2Response3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.GenerationsGetGenerationV2Response3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.GenerationsGetGenerationV2Response3), + jsonSerializerContext) as global::Ideogram.GenerationsGetGenerationV2Response3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.GenerationsGetGenerationV2Response3? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.GenerationsGetGenerationV2Response3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.GenerationsGetGenerationV2Response3), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GenerationsGetGenerationV2Response3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerationsGetGenerationV2Response3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerationsGetGenerationV2Response3.g.cs new file mode 100644 index 00000000..06cf07d6 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerationsGetGenerationV2Response3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class GenerationsGetGenerationV2Response3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerationsGetGenerationV2Response4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerationsGetGenerationV2Response4.Json.g.cs new file mode 100644 index 00000000..a27e069d --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerationsGetGenerationV2Response4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class GenerationsGetGenerationV2Response4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.GenerationsGetGenerationV2Response4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.GenerationsGetGenerationV2Response4), + jsonSerializerContext) as global::Ideogram.GenerationsGetGenerationV2Response4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.GenerationsGetGenerationV2Response4? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.GenerationsGetGenerationV2Response4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.GenerationsGetGenerationV2Response4), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GenerationsGetGenerationV2Response4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerationsGetGenerationV2Response4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerationsGetGenerationV2Response4.g.cs new file mode 100644 index 00000000..7fef9bad --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerationsGetGenerationV2Response4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class GenerationsGetGenerationV2Response4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GetAccountUsageBucketWidth.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GetAccountUsageBucketWidth.g.cs deleted file mode 100644 index 712501f1..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GetAccountUsageBucketWidth.g.cs +++ /dev/null @@ -1,51 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Default Value: 1d - /// - public enum GetAccountUsageBucketWidth - { - /// - /// - /// - x1d, - /// - /// - /// - x1h, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class GetAccountUsageBucketWidthExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this GetAccountUsageBucketWidth value) - { - return value switch - { - GetAccountUsageBucketWidth.x1d => "1d", - GetAccountUsageBucketWidth.x1h => "1h", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static GetAccountUsageBucketWidth? ToEnum(string value) - { - return value switch - { - "1d" => GetAccountUsageBucketWidth.x1d, - "1h" => GetAccountUsageBucketWidth.x1h, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GetAccountUsageResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GetAccountUsageResponse.g.cs index 172b540e..c635bfc9 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GetAccountUsageResponse.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GetAccountUsageResponse.g.cs @@ -4,7 +4,7 @@ namespace Ideogram { /// - /// Example: {"buckets":[{"start_time":"2000-01-23T04:56:07\u002B00:00","end_time":"2000-01-23T04:56:07\u002B00:00","line_items":[{"product":"ideogram_v4_generation","endpoint":"/v2/image/generate/ideogram-4","cost_total":"84.00","user_email":"user_email","api_key":{"redacted_key":"ATG5\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022","id":"JRPVD7jWR1aTBYiJ0UFVOg","label":"Live production environment"},"description":"Ideogram v4 Generation","billed_units":{"unit":"image","quantity":"2100","unit_price":"0.04"},"source":"api","currency_code":"USD","dimensions":{"key":"dimensions"}},{"product":"ideogram_v4_generation","endpoint":"/v2/image/generate/ideogram-4","cost_total":"84.00","user_email":"user_email","api_key":{"redacted_key":"ATG5\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022","id":"JRPVD7jWR1aTBYiJ0UFVOg","label":"Live production environment"},"description":"Ideogram v4 Generation","billed_units":{"unit":"image","quantity":"2100","unit_price":"0.04"},"source":"api","currency_code":"USD","dimensions":{"key":"dimensions"}}]},{"start_time":"2000-01-23T04:56:07\u002B00:00","end_time":"2000-01-23T04:56:07\u002B00:00","line_items":[{"product":"ideogram_v4_generation","endpoint":"/v2/image/generate/ideogram-4","cost_total":"84.00","user_email":"user_email","api_key":{"redacted_key":"ATG5\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022","id":"JRPVD7jWR1aTBYiJ0UFVOg","label":"Live production environment"},"description":"Ideogram v4 Generation","billed_units":{"unit":"image","quantity":"2100","unit_price":"0.04"},"source":"api","currency_code":"USD","dimensions":{"key":"dimensions"}},{"product":"ideogram_v4_generation","endpoint":"/v2/image/generate/ideogram-4","cost_total":"84.00","user_email":"user_email","api_key":{"redacted_key":"ATG5\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022","id":"JRPVD7jWR1aTBYiJ0UFVOg","label":"Live production environment"},"description":"Ideogram v4 Generation","billed_units":{"unit":"image","quantity":"2100","unit_price":"0.04"},"source":"api","currency_code":"USD","dimensions":{"key":"dimensions"}}]}]} + /// /// public sealed partial class GetAccountUsageResponse { diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GetAccountUsageSource.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GetAccountUsageSource.g.cs deleted file mode 100644 index 7dfd5e95..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GetAccountUsageSource.g.cs +++ /dev/null @@ -1,51 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - public enum GetAccountUsageSource - { - /// - /// - /// - Api, - /// - /// - /// - App, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class GetAccountUsageSourceExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this GetAccountUsageSource value) - { - return value switch - { - GetAccountUsageSource.Api => "api", - GetAccountUsageSource.App => "app", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static GetAccountUsageSource? ToEnum(string value) - { - return value switch - { - "api" => GetAccountUsageSource.Api, - "app" => GetAccountUsageSource.App, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GetApiKeysResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GetApiKeysResponse.Json.g.cs deleted file mode 100644 index 615e46ce..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GetApiKeysResponse.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class GetApiKeysResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.GetApiKeysResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.GetApiKeysResponse), - jsonSerializerContext) as global::Ideogram.GetApiKeysResponse; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.GetApiKeysResponse? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.GetApiKeysResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.GetApiKeysResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GetApiKeysResponse; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GetApiKeysResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GetApiKeysResponse.g.cs deleted file mode 100644 index 0301e540..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GetApiKeysResponse.g.cs +++ /dev/null @@ -1,48 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"current_api_keys":[{"creation_time":"2000-01-23T04:56:07\u002B00:00","redacted_api_key":"vkpDja","api_key_id":"JRPVD7jWR1aTBYiJ0UFVOg=="},{"creation_time":"2000-01-23T04:56:07\u002B00:00","redacted_api_key":"vkpDja","api_key_id":"JRPVD7jWR1aTBYiJ0UFVOg=="}]} - /// - public sealed partial class GetApiKeysResponse - { - /// - /// The current API keys that are active. Only returns redacted keys.
- /// Default Value: [] - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("current_api_keys")] - public global::System.Collections.Generic.IList? CurrentApiKeys { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The current API keys that are active. Only returns redacted keys.
- /// Default Value: [] - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public GetApiKeysResponse( - global::System.Collections.Generic.IList? currentApiKeys) - { - this.CurrentApiKeys = currentApiKeys; - } - - /// - /// Initializes a new instance of the class. - /// - public GetApiKeysResponse() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GetApiKeysV2Response.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GetApiKeysV2Response.Json.g.cs deleted file mode 100644 index 9b08dd7f..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GetApiKeysV2Response.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class GetApiKeysV2Response - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.GetApiKeysV2Response? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.GetApiKeysV2Response), - jsonSerializerContext) as global::Ideogram.GetApiKeysV2Response; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.GetApiKeysV2Response? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.GetApiKeysV2Response? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.GetApiKeysV2Response), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GetApiKeysV2Response; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GetApiKeysV2Response.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GetApiKeysV2Response.g.cs deleted file mode 100644 index d72b0e32..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GetApiKeysV2Response.g.cs +++ /dev/null @@ -1,49 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"api_keys":[{"creation_time":"2000-01-23T04:56:07\u002B00:00","label":"Live production environment","redacted_api_key":"ATG56\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022","api_key_id":"JRPVD7jWR1aTBYiJ0UFVOg","creator_display_label":"John Doe","status":null},{"creation_time":"2000-01-23T04:56:07\u002B00:00","label":"Live production environment","redacted_api_key":"ATG56\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022","api_key_id":"JRPVD7jWR1aTBYiJ0UFVOg","creator_display_label":"John Doe","status":null}]} - /// - public sealed partial class GetApiKeysV2Response - { - /// - /// List of API keys associated with the organization
- /// Default Value: [] - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("api_keys")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList ApiKeys { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// List of API keys associated with the organization
- /// Default Value: [] - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public GetApiKeysV2Response( - global::System.Collections.Generic.IList apiKeys) - { - this.ApiKeys = apiKeys ?? throw new global::System.ArgumentNullException(nameof(apiKeys)); - } - - /// - /// Initializes a new instance of the class. - /// - public GetApiKeysV2Response() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GetApiOrganizationUserSuggestionsResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GetApiOrganizationUserSuggestionsResponse.Json.g.cs deleted file mode 100644 index 4c0cf763..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GetApiOrganizationUserSuggestionsResponse.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class GetApiOrganizationUserSuggestionsResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.GetApiOrganizationUserSuggestionsResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.GetApiOrganizationUserSuggestionsResponse), - jsonSerializerContext) as global::Ideogram.GetApiOrganizationUserSuggestionsResponse; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.GetApiOrganizationUserSuggestionsResponse? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.GetApiOrganizationUserSuggestionsResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.GetApiOrganizationUserSuggestionsResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GetApiOrganizationUserSuggestionsResponse; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GetApiOrganizationUserSuggestionsResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GetApiOrganizationUserSuggestionsResponse.g.cs deleted file mode 100644 index d8e5f07d..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GetApiOrganizationUserSuggestionsResponse.g.cs +++ /dev/null @@ -1,49 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"user_suggestions":[{"display_handle":"john_doe","joined":false,"profile_pic":"https://example.com/avatars/user123.jpg","name":"John Doe"},{"display_handle":"john_doe","joined":false,"profile_pic":"https://example.com/avatars/user123.jpg","name":"John Doe"}]} - /// - public sealed partial class GetApiOrganizationUserSuggestionsResponse - { - /// - /// List of user suggestions for the organization
- /// Default Value: [] - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("user_suggestions")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList UserSuggestions { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// List of user suggestions for the organization
- /// Default Value: [] - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public GetApiOrganizationUserSuggestionsResponse( - global::System.Collections.Generic.IList userSuggestions) - { - this.UserSuggestions = userSuggestions ?? throw new global::System.ArgumentNullException(nameof(userSuggestions)); - } - - /// - /// Initializes a new instance of the class. - /// - public GetApiOrganizationUserSuggestionsResponse() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GetApiProfilesResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GetApiProfilesResponse.Json.g.cs deleted file mode 100644 index 18498dd6..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GetApiProfilesResponse.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class GetApiProfilesResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.GetApiProfilesResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.GetApiProfilesResponse), - jsonSerializerContext) as global::Ideogram.GetApiProfilesResponse; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.GetApiProfilesResponse? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.GetApiProfilesResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.GetApiProfilesResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GetApiProfilesResponse; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GetApiProfilesResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GetApiProfilesResponse.g.cs deleted file mode 100644 index 07483da4..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GetApiProfilesResponse.g.cs +++ /dev/null @@ -1,49 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"profiles":[{"is_metronome_2_user":true,"copyright_detection_enabled":true,"role":"OWNER","avatar_url":"https://example.com/avatar.jpg","organization_id":"b3JnYW5pemF0aW9uXzEyMw","name":"Gamma","type":"INDIVIDUAL","api_keys":[{"creation_time":"2000-01-23T04:56:07\u002B00:00","label":"Live production environment","redacted_api_key":"ATG56\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022","api_key_id":"JRPVD7jWR1aTBYiJ0UFVOg","creator_display_label":"John Doe","status":null},{"creation_time":"2000-01-23T04:56:07\u002B00:00","label":"Live production environment","redacted_api_key":"ATG56\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022","api_key_id":"JRPVD7jWR1aTBYiJ0UFVOg","creator_display_label":"John Doe","status":null}],"max_num_inflight_requests_permitted":10},{"is_metronome_2_user":true,"copyright_detection_enabled":true,"role":"OWNER","avatar_url":"https://example.com/avatar.jpg","organization_id":"b3JnYW5pemF0aW9uXzEyMw","name":"Gamma","type":"INDIVIDUAL","api_keys":[{"creation_time":"2000-01-23T04:56:07\u002B00:00","label":"Live production environment","redacted_api_key":"ATG56\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022","api_key_id":"JRPVD7jWR1aTBYiJ0UFVOg","creator_display_label":"John Doe","status":null},{"creation_time":"2000-01-23T04:56:07\u002B00:00","label":"Live production environment","redacted_api_key":"ATG56\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022","api_key_id":"JRPVD7jWR1aTBYiJ0UFVOg","creator_display_label":"John Doe","status":null}],"max_num_inflight_requests_permitted":10}]} - /// - public sealed partial class GetApiProfilesResponse - { - /// - /// List of user's API profiles
- /// Default Value: [] - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("profiles")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList Profiles { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// List of user's API profiles
- /// Default Value: [] - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public GetApiProfilesResponse( - global::System.Collections.Generic.IList profiles) - { - this.Profiles = profiles ?? throw new global::System.ArgumentNullException(nameof(profiles)); - } - - /// - /// Initializes a new instance of the class. - /// - public GetApiProfilesResponse() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GetApiTermsResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GetApiTermsResponse.Json.g.cs deleted file mode 100644 index c685b3a6..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GetApiTermsResponse.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class GetApiTermsResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.GetApiTermsResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.GetApiTermsResponse), - jsonSerializerContext) as global::Ideogram.GetApiTermsResponse; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.GetApiTermsResponse? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.GetApiTermsResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.GetApiTermsResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GetApiTermsResponse; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GetApiTermsResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GetApiTermsResponse.g.cs deleted file mode 100644 index ea112556..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GetApiTermsResponse.g.cs +++ /dev/null @@ -1,60 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"has_accepted_terms":true,"api_terms":{"terms_url":"terms_url","terms_id":"terms_id"}} - /// - public sealed partial class GetApiTermsResponse - { - /// - /// Example: {"terms_url":"terms_url","terms_id":"terms_id"} - /// - /// {"terms_url":"terms_url","terms_id":"terms_id"} - [global::System.Text.Json.Serialization.JsonPropertyName("api_terms")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.ApiTerms ApiTerms { get; set; } - - /// - /// Whether the requesting user has accepted the latest API terms. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("has_accepted_terms")] - [global::System.Text.Json.Serialization.JsonRequired] - public required bool HasAcceptedTerms { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Example: {"terms_url":"terms_url","terms_id":"terms_id"} - /// - /// - /// Whether the requesting user has accepted the latest API terms. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public GetApiTermsResponse( - global::Ideogram.ApiTerms apiTerms, - bool hasAcceptedTerms) - { - this.ApiTerms = apiTerms ?? throw new global::System.ArgumentNullException(nameof(apiTerms)); - this.HasAcceptedTerms = hasAcceptedTerms; - } - - /// - /// Initializes a new instance of the class. - /// - public GetApiTermsResponse() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GetDatasetResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GetDatasetResponse.Json.g.cs deleted file mode 100644 index a2eacd6e..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GetDatasetResponse.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class GetDatasetResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.GetDatasetResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.GetDatasetResponse), - jsonSerializerContext) as global::Ideogram.GetDatasetResponse; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.GetDatasetResponse? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.GetDatasetResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.GetDatasetResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GetDatasetResponse; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GetDatasetResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GetDatasetResponse.g.cs deleted file mode 100644 index 6992a823..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GetDatasetResponse.g.cs +++ /dev/null @@ -1,91 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Detailed view of a dataset, including its files.
- /// Example: {"file_count":0,"custom_model_ids":["custom_model_ids","custom_model_ids"],"files":[{"file_name":"file_name","caption":"caption","file_size_bytes":6},{"file_name":"file_name","caption":"caption","file_size_bytes":6}],"dataset":{"creation_time":"2000-01-23T04:56:07\u002B00:00","user_id":"user_id","dataset_id":"dataset_id","name":"name","cover_asset_identifier":{"collection_id":"collection_id","asset_type":null,"asset_id":"asset_id"}}} - ///
- public sealed partial class GetDatasetResponse - { - /// - /// A dataset for organizing training images.
- /// Example: {"creation_time":"2000-01-23T04:56:07\u002B00:00","user_id":"user_id","dataset_id":"dataset_id","name":"name","cover_asset_identifier":{"collection_id":"collection_id","asset_type":null,"asset_id":"asset_id"}} - ///
- /// {"creation_time":"2000-01-23T04:56:07\u002B00:00","user_id":"user_id","dataset_id":"dataset_id","name":"name","cover_asset_identifier":{"collection_id":"collection_id","asset_type":null,"asset_id":"asset_id"}} - [global::System.Text.Json.Serialization.JsonPropertyName("dataset")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.Dataset Dataset { get; set; } - - /// - /// Total number of files in the dataset. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("file_count")] - [global::System.Text.Json.Serialization.JsonRequired] - public required int FileCount { get; set; } - - /// - /// List of files in the dataset.
- /// Default Value: [] - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("files")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList Files { get; set; } - - /// - /// IDs of all custom models trained from this dataset. Empty array if no model has been trained yet.
- /// Default Value: [] - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("custom_model_ids")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList CustomModelIds { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// A dataset for organizing training images.
- /// Example: {"creation_time":"2000-01-23T04:56:07\u002B00:00","user_id":"user_id","dataset_id":"dataset_id","name":"name","cover_asset_identifier":{"collection_id":"collection_id","asset_type":null,"asset_id":"asset_id"}} - /// - /// - /// Total number of files in the dataset. - /// - /// - /// List of files in the dataset.
- /// Default Value: [] - /// - /// - /// IDs of all custom models trained from this dataset. Empty array if no model has been trained yet.
- /// Default Value: [] - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public GetDatasetResponse( - global::Ideogram.Dataset dataset, - int fileCount, - global::System.Collections.Generic.IList files, - global::System.Collections.Generic.IList customModelIds) - { - this.Dataset = dataset ?? throw new global::System.ArgumentNullException(nameof(dataset)); - this.FileCount = fileCount; - this.Files = files ?? throw new global::System.ArgumentNullException(nameof(files)); - this.CustomModelIds = customModelIds ?? throw new global::System.ArgumentNullException(nameof(customModelIds)); - } - - /// - /// Initializes a new instance of the class. - /// - public GetDatasetResponse() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GetIntegrationsResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GetIntegrationsResponse.Json.g.cs deleted file mode 100644 index 38cef326..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GetIntegrationsResponse.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class GetIntegrationsResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.GetIntegrationsResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.GetIntegrationsResponse), - jsonSerializerContext) as global::Ideogram.GetIntegrationsResponse; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.GetIntegrationsResponse? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.GetIntegrationsResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.GetIntegrationsResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GetIntegrationsResponse; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GetIntegrationsResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GetIntegrationsResponse.g.cs deleted file mode 100644 index 2e055e22..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GetIntegrationsResponse.g.cs +++ /dev/null @@ -1,47 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"integration_types":[null,null]} - /// - public sealed partial class GetIntegrationsResponse - { - /// - /// Distinct enabled integration types for the active organization. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("integration_types")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList IntegrationTypes { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Distinct enabled integration types for the active organization. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public GetIntegrationsResponse( - global::System.Collections.Generic.IList integrationTypes) - { - this.IntegrationTypes = integrationTypes ?? throw new global::System.ArgumentNullException(nameof(integrationTypes)); - } - - /// - /// Initializes a new instance of the class. - /// - public GetIntegrationsResponse() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GetModelResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GetModelResponse.Json.g.cs deleted file mode 100644 index 7dd230a5..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GetModelResponse.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class GetModelResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.GetModelResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.GetModelResponse), - jsonSerializerContext) as global::Ideogram.GetModelResponse; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.GetModelResponse? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.GetModelResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.GetModelResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GetModelResponse; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GetModelResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GetModelResponse.g.cs deleted file mode 100644 index d0c723e1..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GetModelResponse.g.cs +++ /dev/null @@ -1,50 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"model":{"creation_time":"2000-01-23T04:56:07\u002B00:00","last_update_time":"2000-01-23T04:56:07\u002B00:00","is_available_for_generation":true,"dataset_id":"dataset_id","name":"name","is_owned":true,"training_runs":[{"creation_time":"2000-01-23T04:56:07\u002B00:00","last_update_time":"2000-01-23T04:56:07\u002B00:00","lora_rank":6,"num_chips":1,"training_run_id":"training_run_id","ema":5.962133916683182,"training_steps":0,"learning_rate":5.637376656633329,"status":null},{"creation_time":"2000-01-23T04:56:07\u002B00:00","last_update_time":"2000-01-23T04:56:07\u002B00:00","lora_rank":6,"num_chips":1,"training_run_id":"training_run_id","ema":5.962133916683182,"training_steps":0,"learning_rate":5.637376656633329,"status":null}],"model_id":"model_id","custom_model_uri":"model/my-custom-model/version/1","status":null}} - /// - public sealed partial class GetModelResponse - { - /// - /// A custom model.
- /// Example: {"creation_time":"2000-01-23T04:56:07\u002B00:00","last_update_time":"2000-01-23T04:56:07\u002B00:00","is_available_for_generation":true,"dataset_id":"dataset_id","name":"name","is_owned":true,"training_runs":[{"creation_time":"2000-01-23T04:56:07\u002B00:00","last_update_time":"2000-01-23T04:56:07\u002B00:00","lora_rank":6,"num_chips":1,"training_run_id":"training_run_id","ema":5.962133916683182,"training_steps":0,"learning_rate":5.637376656633329,"status":null},{"creation_time":"2000-01-23T04:56:07\u002B00:00","last_update_time":"2000-01-23T04:56:07\u002B00:00","lora_rank":6,"num_chips":1,"training_run_id":"training_run_id","ema":5.962133916683182,"training_steps":0,"learning_rate":5.637376656633329,"status":null}],"model_id":"model_id","custom_model_uri":"model/my-custom-model/version/1","status":null} - ///
- /// {"creation_time":"2000-01-23T04:56:07\u002B00:00","last_update_time":"2000-01-23T04:56:07\u002B00:00","is_available_for_generation":true,"dataset_id":"dataset_id","name":"name","is_owned":true,"training_runs":[{"creation_time":"2000-01-23T04:56:07\u002B00:00","last_update_time":"2000-01-23T04:56:07\u002B00:00","lora_rank":6,"num_chips":1,"training_run_id":"training_run_id","ema":5.962133916683182,"training_steps":0,"learning_rate":5.637376656633329,"status":null},{"creation_time":"2000-01-23T04:56:07\u002B00:00","last_update_time":"2000-01-23T04:56:07\u002B00:00","lora_rank":6,"num_chips":1,"training_run_id":"training_run_id","ema":5.962133916683182,"training_steps":0,"learning_rate":5.637376656633329,"status":null}],"model_id":"model_id","custom_model_uri":"model/my-custom-model/version/1","status":null} - [global::System.Text.Json.Serialization.JsonPropertyName("model")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.CustomModel Model { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// A custom model.
- /// Example: {"creation_time":"2000-01-23T04:56:07\u002B00:00","last_update_time":"2000-01-23T04:56:07\u002B00:00","is_available_for_generation":true,"dataset_id":"dataset_id","name":"name","is_owned":true,"training_runs":[{"creation_time":"2000-01-23T04:56:07\u002B00:00","last_update_time":"2000-01-23T04:56:07\u002B00:00","lora_rank":6,"num_chips":1,"training_run_id":"training_run_id","ema":5.962133916683182,"training_steps":0,"learning_rate":5.637376656633329,"status":null},{"creation_time":"2000-01-23T04:56:07\u002B00:00","last_update_time":"2000-01-23T04:56:07\u002B00:00","lora_rank":6,"num_chips":1,"training_run_id":"training_run_id","ema":5.962133916683182,"training_steps":0,"learning_rate":5.637376656633329,"status":null}],"model_id":"model_id","custom_model_uri":"model/my-custom-model/version/1","status":null} - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public GetModelResponse( - global::Ideogram.CustomModel model) - { - this.Model = model ?? throw new global::System.ArgumentNullException(nameof(model)); - } - - /// - /// Initializes a new instance of the class. - /// - public GetModelResponse() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GetOrganizationBillingPortalResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GetOrganizationBillingPortalResponse.Json.g.cs deleted file mode 100644 index c3a78b57..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GetOrganizationBillingPortalResponse.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class GetOrganizationBillingPortalResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.GetOrganizationBillingPortalResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.GetOrganizationBillingPortalResponse), - jsonSerializerContext) as global::Ideogram.GetOrganizationBillingPortalResponse; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.GetOrganizationBillingPortalResponse? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.GetOrganizationBillingPortalResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.GetOrganizationBillingPortalResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GetOrganizationBillingPortalResponse; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GetOrganizationBillingPortalResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GetOrganizationBillingPortalResponse.g.cs deleted file mode 100644 index b1b145a3..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GetOrganizationBillingPortalResponse.g.cs +++ /dev/null @@ -1,58 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"has_stripe_setup":true,"stripe_billing_url":"stripe_billing_url"} - /// - public sealed partial class GetOrganizationBillingPortalResponse - { - /// - /// Whether or not Stripe billing is set up for the organization's API usage. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("has_stripe_setup")] - [global::System.Text.Json.Serialization.JsonRequired] - public required bool HasStripeSetup { get; set; } - - /// - /// The URL for an organization admin to manage the organization's Stripe billing, including adding or removing payment methods. Absent when no Stripe customer exists for the organization. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("stripe_billing_url")] - public string? StripeBillingUrl { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Whether or not Stripe billing is set up for the organization's API usage. - /// - /// - /// The URL for an organization admin to manage the organization's Stripe billing, including adding or removing payment methods. Absent when no Stripe customer exists for the organization. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public GetOrganizationBillingPortalResponse( - bool hasStripeSetup, - string? stripeBillingUrl) - { - this.HasStripeSetup = hasStripeSetup; - this.StripeBillingUrl = stripeBillingUrl; - } - - /// - /// Initializes a new instance of the class. - /// - public GetOrganizationBillingPortalResponse() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GetOrganizationMembersResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GetOrganizationMembersResponse.Json.g.cs deleted file mode 100644 index 8321a64e..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GetOrganizationMembersResponse.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class GetOrganizationMembersResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.GetOrganizationMembersResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.GetOrganizationMembersResponse), - jsonSerializerContext) as global::Ideogram.GetOrganizationMembersResponse; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.GetOrganizationMembersResponse? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.GetOrganizationMembersResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.GetOrganizationMembersResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GetOrganizationMembersResponse; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GetOrganizationMembersResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GetOrganizationMembersResponse.g.cs deleted file mode 100644 index c6edc211..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GetOrganizationMembersResponse.g.cs +++ /dev/null @@ -1,49 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"members":[{"invite_id":"invite_id","display_handle":"john_doe","email_address":"john.doe@example.com","role":"OWNER","full_name":"full_name","invite_expiry_time":"2000-01-23T04:56:07\u002B00:00","avatar_url":"https://example.com/avatars/user123.jpg","user_id":"dXNlcl8xMjM","invite_status":"PENDING"},{"invite_id":"invite_id","display_handle":"john_doe","email_address":"john.doe@example.com","role":"OWNER","full_name":"full_name","invite_expiry_time":"2000-01-23T04:56:07\u002B00:00","avatar_url":"https://example.com/avatars/user123.jpg","user_id":"dXNlcl8xMjM","invite_status":"PENDING"}]} - /// - public sealed partial class GetOrganizationMembersResponse - { - /// - /// List of organization members
- /// Default Value: [] - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("members")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList Members { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// List of organization members
- /// Default Value: [] - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public GetOrganizationMembersResponse( - global::System.Collections.Generic.IList members) - { - this.Members = members ?? throw new global::System.ArgumentNullException(nameof(members)); - } - - /// - /// Initializes a new instance of the class. - /// - public GetOrganizationMembersResponse() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GetStaleMiniAppPreviewsResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GetStaleMiniAppPreviewsResponse.Json.g.cs deleted file mode 100644 index 31143673..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GetStaleMiniAppPreviewsResponse.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class GetStaleMiniAppPreviewsResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.GetStaleMiniAppPreviewsResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.GetStaleMiniAppPreviewsResponse), - jsonSerializerContext) as global::Ideogram.GetStaleMiniAppPreviewsResponse; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.GetStaleMiniAppPreviewsResponse? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.GetStaleMiniAppPreviewsResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.GetStaleMiniAppPreviewsResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GetStaleMiniAppPreviewsResponse; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GetStaleMiniAppPreviewsResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GetStaleMiniAppPreviewsResponse.g.cs deleted file mode 100644 index b8d144a5..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GetStaleMiniAppPreviewsResponse.g.cs +++ /dev/null @@ -1,48 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Preview entries older than the requested cutoff.
- /// Example: {"preview_ids":[null,null]} - ///
- public sealed partial class GetStaleMiniAppPreviewsResponse - { - /// - /// Unique identifiers of the stale preview entries, sorted lexicographically. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("preview_ids")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList PreviewIds { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Unique identifiers of the stale preview entries, sorted lexicographically. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public GetStaleMiniAppPreviewsResponse( - global::System.Collections.Generic.IList previewIds) - { - this.PreviewIds = previewIds ?? throw new global::System.ArgumentNullException(nameof(previewIds)); - } - - /// - /// Initializes a new instance of the class. - /// - public GetStaleMiniAppPreviewsResponse() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GetUsageInfoResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GetUsageInfoResponse.Json.g.cs deleted file mode 100644 index 0f8ae4d2..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GetUsageInfoResponse.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class GetUsageInfoResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.GetUsageInfoResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.GetUsageInfoResponse), - jsonSerializerContext) as global::Ideogram.GetUsageInfoResponse; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.GetUsageInfoResponse? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.GetUsageInfoResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.GetUsageInfoResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GetUsageInfoResponse; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GetUsageInfoResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GetUsageInfoResponse.g.cs deleted file mode 100644 index 8ee2c38b..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GetUsageInfoResponse.g.cs +++ /dev/null @@ -1,47 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"usage_segments":[{"segment_start":"2023-08-09T00:00:00\u002B00:00","tool_usage":[{"user_email_address":"user@company.com","model_version":"V_0_3","full_tool_name":"Turbo Image Generation V3","amount":{"amount":1050,"currency_code":"USD"},"tool_type":"GENERATE","api_key_id":"JRPVD7jWR1aTBYiJ0UFVOg"},{"user_email_address":"user@company.com","model_version":"V_0_3","full_tool_name":"Turbo Image Generation V3","amount":{"amount":1050,"currency_code":"USD"},"tool_type":"GENERATE","api_key_id":"JRPVD7jWR1aTBYiJ0UFVOg"}],"segment_end":"2023-08-09T23:59:59\u002B00:00"},{"segment_start":"2023-08-09T00:00:00\u002B00:00","tool_usage":[{"user_email_address":"user@company.com","model_version":"V_0_3","full_tool_name":"Turbo Image Generation V3","amount":{"amount":1050,"currency_code":"USD"},"tool_type":"GENERATE","api_key_id":"JRPVD7jWR1aTBYiJ0UFVOg"},{"user_email_address":"user@company.com","model_version":"V_0_3","full_tool_name":"Turbo Image Generation V3","amount":{"amount":1050,"currency_code":"USD"},"tool_type":"GENERATE","api_key_id":"JRPVD7jWR1aTBYiJ0UFVOg"}],"segment_end":"2023-08-09T23:59:59\u002B00:00"}]} - /// - public sealed partial class GetUsageInfoResponse - { - /// - /// List of usage segments with tool-specific breakdowns - /// - [global::System.Text.Json.Serialization.JsonPropertyName("usage_segments")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList UsageSegments { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// List of usage segments with tool-specific breakdowns - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public GetUsageInfoResponse( - global::System.Collections.Generic.IList usageSegments) - { - this.UsageSegments = usageSegments ?? throw new global::System.ArgumentNullException(nameof(usageSegments)); - } - - /// - /// Initializes a new instance of the class. - /// - public GetUsageInfoResponse() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GetUserCreditsResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GetUserCreditsResponse.Json.g.cs deleted file mode 100644 index 9af4e174..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GetUserCreditsResponse.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class GetUserCreditsResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.GetUserCreditsResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.GetUserCreditsResponse), - jsonSerializerContext) as global::Ideogram.GetUserCreditsResponse; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.GetUserCreditsResponse? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.GetUserCreditsResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.GetUserCreditsResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GetUserCreditsResponse; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GetUserCreditsResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GetUserCreditsResponse.g.cs deleted file mode 100644 index ecfd346c..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GetUserCreditsResponse.g.cs +++ /dev/null @@ -1,79 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"total_spend":{"amount":1050,"currency_code":"USD"},"average_daily_spend":{"amount":1050,"currency_code":"USD"},"available_credits":{"amount":1050,"currency_code":"USD"}} - /// - public sealed partial class GetUserCreditsResponse - { - /// - /// Represents a price.
- /// Example: {"amount":1050,"currency_code":"USD"} - ///
- /// {"amount":1050,"currency_code":"USD"} - [global::System.Text.Json.Serialization.JsonPropertyName("available_credits")] - public global::Ideogram.Price? AvailableCredits { get; set; } - - /// - /// Represents a price.
- /// Example: {"amount":1050,"currency_code":"USD"} - ///
- /// {"amount":1050,"currency_code":"USD"} - [global::System.Text.Json.Serialization.JsonPropertyName("total_spend")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.Price TotalSpend { get; set; } - - /// - /// Represents a price.
- /// Example: {"amount":1050,"currency_code":"USD"} - ///
- /// {"amount":1050,"currency_code":"USD"} - [global::System.Text.Json.Serialization.JsonPropertyName("average_daily_spend")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.Price AverageDailySpend { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Represents a price.
- /// Example: {"amount":1050,"currency_code":"USD"} - /// - /// - /// Represents a price.
- /// Example: {"amount":1050,"currency_code":"USD"} - /// - /// - /// Represents a price.
- /// Example: {"amount":1050,"currency_code":"USD"} - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public GetUserCreditsResponse( - global::Ideogram.Price totalSpend, - global::Ideogram.Price averageDailySpend, - global::Ideogram.Price? availableCredits) - { - this.AvailableCredits = availableCredits; - this.TotalSpend = totalSpend ?? throw new global::System.ArgumentNullException(nameof(totalSpend)); - this.AverageDailySpend = averageDailySpend ?? throw new global::System.ArgumentNullException(nameof(averageDailySpend)); - } - - /// - /// Initializes a new instance of the class. - /// - public GetUserCreditsResponse() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GhostMannequinRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GhostMannequinRequest.Json.g.cs deleted file mode 100644 index 1409f696..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GhostMannequinRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class GhostMannequinRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.GhostMannequinRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.GhostMannequinRequest), - jsonSerializerContext) as global::Ideogram.GhostMannequinRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.GhostMannequinRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.GhostMannequinRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.GhostMannequinRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GhostMannequinRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GhostMannequinRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GhostMannequinRequest.g.cs deleted file mode 100644 index d7211417..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GhostMannequinRequest.g.cs +++ /dev/null @@ -1,499 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Supply at least one garment image. Every image must show the same
- /// primary garment. At most 15 garment images are accepted, plus one optional
- /// output reference for presentation only. All uploads combined must not
- /// exceed 100 MB. - ///
- public sealed partial class GhostMannequinRequest - { - /// - /// Ordered uploaded or generated images of the same garment. Use
- /// multiple angles when available so obscured construction can be
- /// reconstructed conservatively. Mutually exclusive with
- /// `garment_images`. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("garment_asset_identifiers")] - public global::System.Collections.Generic.IList? GarmentAssetIdentifiers { get; set; } - - /// - /// Additional photos of the same garment, up to 50 MB each. JPEG,
- /// PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and MPO are supported.
- /// Multipart requests only. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("garment_images")] - public global::System.Collections.Generic.IList? GarmentImages { get; set; } - - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - ///
- /// {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - [global::System.Text.Json.Serialization.JsonPropertyName("front_asset_identifier")] - public global::Ideogram.AssetIdentifier? FrontAssetIdentifier { get; set; } - - /// - /// Optional front-view garment photo, up to 50 MB. Multipart requests
- /// only. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("front_image")] - public byte[]? FrontImage { get; set; } - - /// - /// Optional front-view garment photo, up to 50 MB. Multipart requests
- /// only. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("front_imagename")] - public string? FrontImagename { get; set; } - - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - ///
- /// {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - [global::System.Text.Json.Serialization.JsonPropertyName("back_asset_identifier")] - public global::Ideogram.AssetIdentifier? BackAssetIdentifier { get; set; } - - /// - /// Optional back-view garment photo, up to 50 MB. Multipart requests
- /// only. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("back_image")] - public byte[]? BackImage { get; set; } - - /// - /// Optional back-view garment photo, up to 50 MB. Multipart requests
- /// only. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("back_imagename")] - public string? BackImagename { get; set; } - - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - ///
- /// {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - [global::System.Text.Json.Serialization.JsonPropertyName("left_asset_identifier")] - public global::Ideogram.AssetIdentifier? LeftAssetIdentifier { get; set; } - - /// - /// Optional left-view garment photo, up to 50 MB. Multipart requests
- /// only. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("left_image")] - public byte[]? LeftImage { get; set; } - - /// - /// Optional left-view garment photo, up to 50 MB. Multipart requests
- /// only. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("left_imagename")] - public string? LeftImagename { get; set; } - - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - ///
- /// {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - [global::System.Text.Json.Serialization.JsonPropertyName("right_asset_identifier")] - public global::Ideogram.AssetIdentifier? RightAssetIdentifier { get; set; } - - /// - /// Optional right-view garment photo, up to 50 MB. Multipart requests
- /// only. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("right_image")] - public byte[]? RightImage { get; set; } - - /// - /// Optional right-view garment photo, up to 50 MB. Multipart requests
- /// only. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("right_imagename")] - public string? RightImagename { get; set; } - - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - ///
- /// {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - [global::System.Text.Json.Serialization.JsonPropertyName("top_asset_identifier")] - public global::Ideogram.AssetIdentifier? TopAssetIdentifier { get; set; } - - /// - /// Optional top-view garment photo, up to 50 MB. Multipart requests
- /// only. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("top_image")] - public byte[]? TopImage { get; set; } - - /// - /// Optional top-view garment photo, up to 50 MB. Multipart requests
- /// only. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("top_imagename")] - public string? TopImagename { get; set; } - - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - ///
- /// {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - [global::System.Text.Json.Serialization.JsonPropertyName("bottom_asset_identifier")] - public global::Ideogram.AssetIdentifier? BottomAssetIdentifier { get; set; } - - /// - /// Optional bottom-view garment photo, up to 50 MB. Multipart
- /// requests only. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("bottom_image")] - public byte[]? BottomImage { get; set; } - - /// - /// Optional bottom-view garment photo, up to 50 MB. Multipart
- /// requests only. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("bottom_imagename")] - public string? BottomImagename { get; set; } - - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - ///
- /// {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - [global::System.Text.Json.Serialization.JsonPropertyName("output_reference_asset_identifier")] - public global::Ideogram.AssetIdentifier? OutputReferenceAssetIdentifier { get; set; } - - /// - /// Optional presentation example, up to 50 MB. Multipart requests only.
- /// Guides pose, framing, and lighting without copying its garment,
- /// colors, text, or branding. Garment photos remain authoritative for
- /// product identity; view and aspect_ratio take precedence, and the
- /// background remains white. Does not replace a required garment photo.
- /// Mutually exclusive with `output_reference_asset_identifier`. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("output_reference_image")] - public byte[]? OutputReferenceImage { get; set; } - - /// - /// Optional presentation example, up to 50 MB. Multipart requests only.
- /// Guides pose, framing, and lighting without copying its garment,
- /// colors, text, or branding. Garment photos remain authoritative for
- /// product identity; view and aspect_ratio take precedence, and the
- /// background remains white. Does not replace a required garment photo.
- /// Mutually exclusive with `output_reference_asset_identifier`. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("output_reference_imagename")] - public string? OutputReferenceImagename { get; set; } - - /// - /// Camera view for the output garment. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("view")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.GhostMannequinRequestViewJsonConverter))] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.GhostMannequinRequestView View { get; set; } - - /// - /// Optional reconstruction guidance or identity-critical garment
- /// details to check against the photos. The output always uses a clean
- /// white studio background. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("instruction")] - public string? Instruction { get; set; } - - /// - /// Optional JSON object serialized as a string containing factual
- /// product context, such as title, brand, category, color, material,
- /// item code, and exact printed text. Metadata helps disambiguate the
- /// garment photos but does not add features they do not show. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("metadata")] - public string? Metadata { get; set; } - - /// - /// Output aspect ratio. Defaults to `1:1` when omitted. Supported
- /// values are `1:1`, `3:4`, `4:3`, `16:9`, and `9:16`. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] - public string? AspectRatio { get; set; } - - /// - /// The quality tier for the edit. Higher tiers may improve detail and
- /// take longer to complete. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("quality")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.GhostMannequinQualityJsonConverter))] - public global::Ideogram.GhostMannequinQuality? Quality { get; set; } - - /// - /// Optional seed for repeatable results. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// A collection you can write to, by its URL-safe base64 collection id. Completed outputs are added to it automatically. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("target_collection_id")] - public string? TargetCollectionId { get; set; } - - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - ///
- /// https://api.example.com/webhooks/ideogram - [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] - public string? WebhookUrl { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Camera view for the output garment. - /// - /// - /// Ordered uploaded or generated images of the same garment. Use
- /// multiple angles when available so obscured construction can be
- /// reconstructed conservatively. Mutually exclusive with
- /// `garment_images`. - /// - /// - /// Additional photos of the same garment, up to 50 MB each. JPEG,
- /// PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and MPO are supported.
- /// Multipart requests only. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// Optional front-view garment photo, up to 50 MB. Multipart requests
- /// only. - /// - /// - /// Optional front-view garment photo, up to 50 MB. Multipart requests
- /// only. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// Optional back-view garment photo, up to 50 MB. Multipart requests
- /// only. - /// - /// - /// Optional back-view garment photo, up to 50 MB. Multipart requests
- /// only. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// Optional left-view garment photo, up to 50 MB. Multipart requests
- /// only. - /// - /// - /// Optional left-view garment photo, up to 50 MB. Multipart requests
- /// only. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// Optional right-view garment photo, up to 50 MB. Multipart requests
- /// only. - /// - /// - /// Optional right-view garment photo, up to 50 MB. Multipart requests
- /// only. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// Optional top-view garment photo, up to 50 MB. Multipart requests
- /// only. - /// - /// - /// Optional top-view garment photo, up to 50 MB. Multipart requests
- /// only. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// Optional bottom-view garment photo, up to 50 MB. Multipart
- /// requests only. - /// - /// - /// Optional bottom-view garment photo, up to 50 MB. Multipart
- /// requests only. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// Optional presentation example, up to 50 MB. Multipart requests only.
- /// Guides pose, framing, and lighting without copying its garment,
- /// colors, text, or branding. Garment photos remain authoritative for
- /// product identity; view and aspect_ratio take precedence, and the
- /// background remains white. Does not replace a required garment photo.
- /// Mutually exclusive with `output_reference_asset_identifier`. - /// - /// - /// Optional presentation example, up to 50 MB. Multipart requests only.
- /// Guides pose, framing, and lighting without copying its garment,
- /// colors, text, or branding. Garment photos remain authoritative for
- /// product identity; view and aspect_ratio take precedence, and the
- /// background remains white. Does not replace a required garment photo.
- /// Mutually exclusive with `output_reference_asset_identifier`. - /// - /// - /// Optional reconstruction guidance or identity-critical garment
- /// details to check against the photos. The output always uses a clean
- /// white studio background. - /// - /// - /// Optional JSON object serialized as a string containing factual
- /// product context, such as title, brand, category, color, material,
- /// item code, and exact printed text. Metadata helps disambiguate the
- /// garment photos but does not add features they do not show. - /// - /// - /// Output aspect ratio. Defaults to `1:1` when omitted. Supported
- /// values are `1:1`, `3:4`, `4:3`, `16:9`, and `9:16`. - /// - /// - /// The quality tier for the edit. Higher tiers may improve detail and
- /// take longer to complete. - /// - /// - /// Optional seed for repeatable results. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. Completed outputs are added to it automatically. - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public GhostMannequinRequest( - global::Ideogram.GhostMannequinRequestView view, - global::System.Collections.Generic.IList? garmentAssetIdentifiers, - global::System.Collections.Generic.IList? garmentImages, - global::Ideogram.AssetIdentifier? frontAssetIdentifier, - byte[]? frontImage, - string? frontImagename, - global::Ideogram.AssetIdentifier? backAssetIdentifier, - byte[]? backImage, - string? backImagename, - global::Ideogram.AssetIdentifier? leftAssetIdentifier, - byte[]? leftImage, - string? leftImagename, - global::Ideogram.AssetIdentifier? rightAssetIdentifier, - byte[]? rightImage, - string? rightImagename, - global::Ideogram.AssetIdentifier? topAssetIdentifier, - byte[]? topImage, - string? topImagename, - global::Ideogram.AssetIdentifier? bottomAssetIdentifier, - byte[]? bottomImage, - string? bottomImagename, - global::Ideogram.AssetIdentifier? outputReferenceAssetIdentifier, - byte[]? outputReferenceImage, - string? outputReferenceImagename, - string? instruction, - string? metadata, - string? aspectRatio, - global::Ideogram.GhostMannequinQuality? quality, - int? seed, - string? targetCollectionId, - bool? @private, - string? webhookUrl) - { - this.GarmentAssetIdentifiers = garmentAssetIdentifiers; - this.GarmentImages = garmentImages; - this.FrontAssetIdentifier = frontAssetIdentifier; - this.FrontImage = frontImage; - this.FrontImagename = frontImagename; - this.BackAssetIdentifier = backAssetIdentifier; - this.BackImage = backImage; - this.BackImagename = backImagename; - this.LeftAssetIdentifier = leftAssetIdentifier; - this.LeftImage = leftImage; - this.LeftImagename = leftImagename; - this.RightAssetIdentifier = rightAssetIdentifier; - this.RightImage = rightImage; - this.RightImagename = rightImagename; - this.TopAssetIdentifier = topAssetIdentifier; - this.TopImage = topImage; - this.TopImagename = topImagename; - this.BottomAssetIdentifier = bottomAssetIdentifier; - this.BottomImage = bottomImage; - this.BottomImagename = bottomImagename; - this.OutputReferenceAssetIdentifier = outputReferenceAssetIdentifier; - this.OutputReferenceImage = outputReferenceImage; - this.OutputReferenceImagename = outputReferenceImagename; - this.View = view; - this.Instruction = instruction; - this.Metadata = metadata; - this.AspectRatio = aspectRatio; - this.Quality = quality; - this.Seed = seed; - this.TargetCollectionId = targetCollectionId; - this.Private = @private; - this.WebhookUrl = webhookUrl; - } - - /// - /// Initializes a new instance of the class. - /// - public GhostMannequinRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GhostMannequinRequestView.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GhostMannequinRequestView.g.cs deleted file mode 100644 index 3353b9eb..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GhostMannequinRequestView.g.cs +++ /dev/null @@ -1,57 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Camera view for the output garment. - /// - public enum GhostMannequinRequestView - { - /// - /// - /// - Back, - /// - /// - /// - Front, - /// - /// - /// - ThreeQuarter, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class GhostMannequinRequestViewExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this GhostMannequinRequestView value) - { - return value switch - { - GhostMannequinRequestView.Back => "back", - GhostMannequinRequestView.Front => "front", - GhostMannequinRequestView.ThreeQuarter => "three_quarter", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static GhostMannequinRequestView? ToEnum(string value) - { - return value switch - { - "back" => GhostMannequinRequestView.Back, - "front" => GhostMannequinRequestView.Front, - "three_quarter" => GhostMannequinRequestView.ThreeQuarter, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GhostMannequinResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GhostMannequinResponse.g.cs index ec27c620..a25b71ad 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GhostMannequinResponse.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GhostMannequinResponse.g.cs @@ -5,8 +5,7 @@ namespace Ideogram { /// /// Acknowledgement that the ghost-mannequin request was accepted. Poll
- /// `GET /v2/generations/{generation_id}` for status and results.
- /// Example: {"generation_id":"generation_id"} + /// `GET /v2/generations/{generation_id}` for status and results. ///
public sealed partial class GhostMannequinResponse { diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.IdeogramColorPalettePresetName.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.IdeogramColorPalettePresetName.g.cs index f9d44933..f3bfd942 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.IdeogramColorPalettePresetName.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.IdeogramColorPalettePresetName.g.cs @@ -4,8 +4,7 @@ namespace Ideogram { /// - /// A color palette preset value.
- /// Example: pastel + /// A color palette preset value. ///
public enum IdeogramColorPalettePresetName { diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.IdeogramColorPaletteWithPresetName.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.IdeogramColorPaletteWithPresetName.g.cs index 68205268..114452a3 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.IdeogramColorPaletteWithPresetName.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.IdeogramColorPaletteWithPresetName.g.cs @@ -9,10 +9,8 @@ namespace Ideogram public sealed partial class IdeogramColorPaletteWithPresetName { /// - /// A color palette preset value.
- /// Example: pastel + /// A color palette preset value. ///
- /// pastel [global::System.Text.Json.Serialization.JsonPropertyName("name")] [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.IdeogramColorPalettePresetNameJsonConverter))] [global::System.Text.Json.Serialization.JsonRequired] @@ -28,8 +26,7 @@ public sealed partial class IdeogramColorPaletteWithPresetName /// Initializes a new instance of the class. ///
/// - /// A color palette preset value.
- /// Example: pastel + /// A color palette preset value. /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.IdeogramV2StyleType.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.IdeogramV2StyleType.g.cs index 6820df88..3208b8fb 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.IdeogramV2StyleType.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.IdeogramV2StyleType.g.cs @@ -4,8 +4,7 @@ namespace Ideogram { /// - /// The style type to generate with. When omitted, the model's default styling is used; pass `auto` to have a style selected automatically from the prompt.
- /// Example: realistic + /// The style type to generate with. When omitted, the model's default styling is used; pass `auto` to have a style selected automatically from the prompt. ///
public enum IdeogramV2StyleType { diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.IdeogramV3StylePreset.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.IdeogramV3StylePreset.g.cs index 5bcebcad..34762701 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.IdeogramV3StylePreset.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.IdeogramV3StylePreset.g.cs @@ -4,8 +4,7 @@ namespace Ideogram { /// - /// A predefined style preset that applies a specific artistic style to the generated image.
- /// Example: bright_art + /// A predefined style preset that applies a specific artistic style to the generated image. ///
public enum IdeogramV3StylePreset { diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.IdeogramV3StyleType.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.IdeogramV3StyleType.g.cs index 7b7a2051..046a8d8b 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.IdeogramV3StyleType.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.IdeogramV3StyleType.g.cs @@ -5,8 +5,7 @@ namespace Ideogram { /// /// The style type to generate with.
- /// Default Value: general
- /// Example: general + /// Default Value: general ///
public enum IdeogramV3StyleType { diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV3Request.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV3Request.Json.g.cs new file mode 100644 index 00000000..0f5dde9e --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV3Request.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImageDescribePostDescribeImageIdeogramV3Request + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImageDescribePostDescribeImageIdeogramV3Request? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImageDescribePostDescribeImageIdeogramV3Request), + jsonSerializerContext) as global::Ideogram.ImageDescribePostDescribeImageIdeogramV3Request; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImageDescribePostDescribeImageIdeogramV3Request? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImageDescribePostDescribeImageIdeogramV3Request? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImageDescribePostDescribeImageIdeogramV3Request), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImageDescribePostDescribeImageIdeogramV3Request; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV3Request.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV3Request.g.cs new file mode 100644 index 00000000..108d6696 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV3Request.g.cs @@ -0,0 +1,59 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// + /// + public sealed partial class ImageDescribePostDescribeImageIdeogramV3Request + { + /// + /// The image to describe (max 10MB). JPEG, PNG, and WebP are supported. Multipart requests only. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("image")] + [global::System.Text.Json.Serialization.JsonRequired] + public required byte[] Image { get; set; } + + /// + /// The image to describe (max 10MB). JPEG, PNG, and WebP are supported. Multipart requests only. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Imagename { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The image to describe (max 10MB). JPEG, PNG, and WebP are supported. Multipart requests only. + /// + /// + /// The image to describe (max 10MB). JPEG, PNG, and WebP are supported. Multipart requests only. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ImageDescribePostDescribeImageIdeogramV3Request( + byte[] image, + string imagename) + { + this.Image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + this.Imagename = imagename ?? throw new global::System.ArgumentNullException(nameof(imagename)); + } + + /// + /// Initializes a new instance of the class. + /// + public ImageDescribePostDescribeImageIdeogramV3Request() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV3Response.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV3Response.Json.g.cs new file mode 100644 index 00000000..43714c61 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV3Response.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImageDescribePostDescribeImageIdeogramV3Response + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImageDescribePostDescribeImageIdeogramV3Response? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImageDescribePostDescribeImageIdeogramV3Response), + jsonSerializerContext) as global::Ideogram.ImageDescribePostDescribeImageIdeogramV3Response; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImageDescribePostDescribeImageIdeogramV3Response? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImageDescribePostDescribeImageIdeogramV3Response? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImageDescribePostDescribeImageIdeogramV3Response), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImageDescribePostDescribeImageIdeogramV3Response; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV3Response.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV3Response.g.cs new file mode 100644 index 00000000..e2077aeb --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV3Response.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImageDescribePostDescribeImageIdeogramV3Response + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV3Response2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV3Response2.Json.g.cs new file mode 100644 index 00000000..29f46dea --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV3Response2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImageDescribePostDescribeImageIdeogramV3Response2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImageDescribePostDescribeImageIdeogramV3Response2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImageDescribePostDescribeImageIdeogramV3Response2), + jsonSerializerContext) as global::Ideogram.ImageDescribePostDescribeImageIdeogramV3Response2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImageDescribePostDescribeImageIdeogramV3Response2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImageDescribePostDescribeImageIdeogramV3Response2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImageDescribePostDescribeImageIdeogramV3Response2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImageDescribePostDescribeImageIdeogramV3Response2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV3Response2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV3Response2.g.cs new file mode 100644 index 00000000..89e7a2c2 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV3Response2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImageDescribePostDescribeImageIdeogramV3Response2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV3Response3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV3Response3.Json.g.cs new file mode 100644 index 00000000..51982ce6 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV3Response3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImageDescribePostDescribeImageIdeogramV3Response3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImageDescribePostDescribeImageIdeogramV3Response3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImageDescribePostDescribeImageIdeogramV3Response3), + jsonSerializerContext) as global::Ideogram.ImageDescribePostDescribeImageIdeogramV3Response3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImageDescribePostDescribeImageIdeogramV3Response3? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImageDescribePostDescribeImageIdeogramV3Response3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImageDescribePostDescribeImageIdeogramV3Response3), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImageDescribePostDescribeImageIdeogramV3Response3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV3Response3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV3Response3.g.cs new file mode 100644 index 00000000..7b041a4a --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV3Response3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImageDescribePostDescribeImageIdeogramV3Response3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV3Response4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV3Response4.Json.g.cs new file mode 100644 index 00000000..547af2bc --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV3Response4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImageDescribePostDescribeImageIdeogramV3Response4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImageDescribePostDescribeImageIdeogramV3Response4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImageDescribePostDescribeImageIdeogramV3Response4), + jsonSerializerContext) as global::Ideogram.ImageDescribePostDescribeImageIdeogramV3Response4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImageDescribePostDescribeImageIdeogramV3Response4? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImageDescribePostDescribeImageIdeogramV3Response4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImageDescribePostDescribeImageIdeogramV3Response4), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImageDescribePostDescribeImageIdeogramV3Response4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV3Response4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV3Response4.g.cs new file mode 100644 index 00000000..b8934735 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV3Response4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImageDescribePostDescribeImageIdeogramV3Response4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV3Response5.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV3Response5.Json.g.cs new file mode 100644 index 00000000..7ebfa699 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV3Response5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImageDescribePostDescribeImageIdeogramV3Response5 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImageDescribePostDescribeImageIdeogramV3Response5? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImageDescribePostDescribeImageIdeogramV3Response5), + jsonSerializerContext) as global::Ideogram.ImageDescribePostDescribeImageIdeogramV3Response5; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImageDescribePostDescribeImageIdeogramV3Response5? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImageDescribePostDescribeImageIdeogramV3Response5? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImageDescribePostDescribeImageIdeogramV3Response5), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImageDescribePostDescribeImageIdeogramV3Response5; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV3Response5.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV3Response5.g.cs new file mode 100644 index 00000000..4dda95a5 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV3Response5.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImageDescribePostDescribeImageIdeogramV3Response5 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV4Request.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV4Request.Json.g.cs new file mode 100644 index 00000000..ba234fbf --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV4Request.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImageDescribePostDescribeImageIdeogramV4Request + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImageDescribePostDescribeImageIdeogramV4Request? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImageDescribePostDescribeImageIdeogramV4Request), + jsonSerializerContext) as global::Ideogram.ImageDescribePostDescribeImageIdeogramV4Request; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImageDescribePostDescribeImageIdeogramV4Request? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImageDescribePostDescribeImageIdeogramV4Request? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImageDescribePostDescribeImageIdeogramV4Request), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImageDescribePostDescribeImageIdeogramV4Request; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV4Request.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV4Request.g.cs new file mode 100644 index 00000000..78d33bed --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV4Request.g.cs @@ -0,0 +1,98 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// + /// + public sealed partial class ImageDescribePostDescribeImageIdeogramV4Request + { + /// + /// The image to describe (max 10MB). JPEG, PNG, and WebP are supported. Multipart requests only. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("image")] + [global::System.Text.Json.Serialization.JsonRequired] + public required byte[] Image { get; set; } + + /// + /// The image to describe (max 10MB). JPEG, PNG, and WebP are supported. Multipart requests only. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Imagename { get; set; } + + /// + /// Whether to include bounding boxes for the subjects and text in the returned `json_prompt`. Defaults to true, so the prompt preserves the layout of the described image.
+ /// Default Value: true + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("include_bbox")] + public bool? IncludeBbox { get; set; } + + /// + /// Whether to include a free-form style description in the returned `json_prompt`. Defaults to false.
+ /// Default Value: false + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("include_style_descriptions")] + public bool? IncludeStyleDescriptions { get; set; } + + /// + /// Whether to include free-form tags in the returned `json_prompt`. Defaults to false.
+ /// Default Value: false + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("include_tags")] + public bool? IncludeTags { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The image to describe (max 10MB). JPEG, PNG, and WebP are supported. Multipart requests only. + /// + /// + /// The image to describe (max 10MB). JPEG, PNG, and WebP are supported. Multipart requests only. + /// + /// + /// Whether to include bounding boxes for the subjects and text in the returned `json_prompt`. Defaults to true, so the prompt preserves the layout of the described image.
+ /// Default Value: true + /// + /// + /// Whether to include a free-form style description in the returned `json_prompt`. Defaults to false.
+ /// Default Value: false + /// + /// + /// Whether to include free-form tags in the returned `json_prompt`. Defaults to false.
+ /// Default Value: false + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ImageDescribePostDescribeImageIdeogramV4Request( + byte[] image, + string imagename, + bool? includeBbox, + bool? includeStyleDescriptions, + bool? includeTags) + { + this.Image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + this.Imagename = imagename ?? throw new global::System.ArgumentNullException(nameof(imagename)); + this.IncludeBbox = includeBbox; + this.IncludeStyleDescriptions = includeStyleDescriptions; + this.IncludeTags = includeTags; + } + + /// + /// Initializes a new instance of the class. + /// + public ImageDescribePostDescribeImageIdeogramV4Request() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV4Response.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV4Response.Json.g.cs new file mode 100644 index 00000000..322190fa --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV4Response.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImageDescribePostDescribeImageIdeogramV4Response + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImageDescribePostDescribeImageIdeogramV4Response? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImageDescribePostDescribeImageIdeogramV4Response), + jsonSerializerContext) as global::Ideogram.ImageDescribePostDescribeImageIdeogramV4Response; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImageDescribePostDescribeImageIdeogramV4Response? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImageDescribePostDescribeImageIdeogramV4Response? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImageDescribePostDescribeImageIdeogramV4Response), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImageDescribePostDescribeImageIdeogramV4Response; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV4Response.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV4Response.g.cs new file mode 100644 index 00000000..1f9c7120 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV4Response.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImageDescribePostDescribeImageIdeogramV4Response + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV4Response2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV4Response2.Json.g.cs new file mode 100644 index 00000000..d79ed238 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV4Response2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImageDescribePostDescribeImageIdeogramV4Response2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImageDescribePostDescribeImageIdeogramV4Response2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImageDescribePostDescribeImageIdeogramV4Response2), + jsonSerializerContext) as global::Ideogram.ImageDescribePostDescribeImageIdeogramV4Response2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImageDescribePostDescribeImageIdeogramV4Response2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImageDescribePostDescribeImageIdeogramV4Response2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImageDescribePostDescribeImageIdeogramV4Response2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImageDescribePostDescribeImageIdeogramV4Response2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV4Response2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV4Response2.g.cs new file mode 100644 index 00000000..a77f1461 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV4Response2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImageDescribePostDescribeImageIdeogramV4Response2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV4Response3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV4Response3.Json.g.cs new file mode 100644 index 00000000..3cadf732 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV4Response3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImageDescribePostDescribeImageIdeogramV4Response3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImageDescribePostDescribeImageIdeogramV4Response3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImageDescribePostDescribeImageIdeogramV4Response3), + jsonSerializerContext) as global::Ideogram.ImageDescribePostDescribeImageIdeogramV4Response3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImageDescribePostDescribeImageIdeogramV4Response3? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImageDescribePostDescribeImageIdeogramV4Response3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImageDescribePostDescribeImageIdeogramV4Response3), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImageDescribePostDescribeImageIdeogramV4Response3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV4Response3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV4Response3.g.cs new file mode 100644 index 00000000..3a8694fe --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV4Response3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImageDescribePostDescribeImageIdeogramV4Response3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV4Response4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV4Response4.Json.g.cs new file mode 100644 index 00000000..50ee0727 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV4Response4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImageDescribePostDescribeImageIdeogramV4Response4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImageDescribePostDescribeImageIdeogramV4Response4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImageDescribePostDescribeImageIdeogramV4Response4), + jsonSerializerContext) as global::Ideogram.ImageDescribePostDescribeImageIdeogramV4Response4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImageDescribePostDescribeImageIdeogramV4Response4? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImageDescribePostDescribeImageIdeogramV4Response4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImageDescribePostDescribeImageIdeogramV4Response4), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImageDescribePostDescribeImageIdeogramV4Response4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV4Response4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV4Response4.g.cs new file mode 100644 index 00000000..8c128b77 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV4Response4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImageDescribePostDescribeImageIdeogramV4Response4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV4Response5.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV4Response5.Json.g.cs new file mode 100644 index 00000000..ea49f8ad --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV4Response5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImageDescribePostDescribeImageIdeogramV4Response5 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImageDescribePostDescribeImageIdeogramV4Response5? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImageDescribePostDescribeImageIdeogramV4Response5), + jsonSerializerContext) as global::Ideogram.ImageDescribePostDescribeImageIdeogramV4Response5; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImageDescribePostDescribeImageIdeogramV4Response5? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImageDescribePostDescribeImageIdeogramV4Response5? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImageDescribePostDescribeImageIdeogramV4Response5), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImageDescribePostDescribeImageIdeogramV4Response5; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV4Response5.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV4Response5.g.cs new file mode 100644 index 00000000..724c7539 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImageDescribePostDescribeImageIdeogramV4Response5.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImageDescribePostDescribeImageIdeogramV4Response5 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationObject.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationObject.Json.g.cs deleted file mode 100644 index 4e856875..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationObject.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class ImageGenerationObject - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.ImageGenerationObject? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.ImageGenerationObject), - jsonSerializerContext) as global::Ideogram.ImageGenerationObject; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.ImageGenerationObject? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.ImageGenerationObject? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.ImageGenerationObject), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImageGenerationObject; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationObject.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationObject.g.cs deleted file mode 100644 index c06447cd..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationObject.g.cs +++ /dev/null @@ -1,127 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// A single generated image. Model-agnostic shape returned by the generation polling endpoint.
- /// Example: {"seed":12345,"object_type":"image.generation","asset_id":"asset_id","prompt":"prompt","resolution":"2048x2048","url":"https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804\u0026sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89","is_image_safe":true} - ///
- public sealed partial class ImageGenerationObject - { - /// - /// Discriminator marking this entry as a generated image in the polling endpoint's mixed data array. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("object_type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ImageGenerationObjectObjectTypeJsonConverter))] - public global::Ideogram.ImageGenerationObjectObjectType? ObjectType { get; set; } - - /// - /// The direct link to the image generated.
- /// Example: https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89 - ///
- /// https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89 - [global::System.Text.Json.Serialization.JsonPropertyName("url")] - public string? Url { get; set; } - - /// - /// The base64url-encoded identifier of the generated image asset. Present for safe workflow-owned outputs. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("asset_id")] - public string? AssetId { get; set; } - - /// - /// The prompt used for the generation. This may be different from the original prompt. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Prompt { get; set; } - - /// - /// The resolution of the generated image, formatted as "{width}x{height}".
- /// Example: 2048x2048 - ///
- /// 2048x2048 - [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Resolution { get; set; } - - /// - /// Whether this image passes safety checks. If false, the url field will be empty. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("is_image_safe")] - [global::System.Text.Json.Serialization.JsonRequired] - public required bool IsImageSafe { get; set; } - - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - ///
- /// 12345 - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - [global::System.Text.Json.Serialization.JsonRequired] - public required int Seed { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The prompt used for the generation. This may be different from the original prompt. - /// - /// - /// The resolution of the generated image, formatted as "{width}x{height}".
- /// Example: 2048x2048 - /// - /// - /// Whether this image passes safety checks. If false, the url field will be empty. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// Discriminator marking this entry as a generated image in the polling endpoint's mixed data array. - /// - /// - /// The direct link to the image generated.
- /// Example: https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89 - /// - /// - /// The base64url-encoded identifier of the generated image asset. Present for safe workflow-owned outputs. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ImageGenerationObject( - string prompt, - string resolution, - bool isImageSafe, - int seed, - global::Ideogram.ImageGenerationObjectObjectType? objectType, - string? url, - string? assetId) - { - this.ObjectType = objectType; - this.Url = url; - this.AssetId = assetId; - this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); - this.Resolution = resolution ?? throw new global::System.ArgumentNullException(nameof(resolution)); - this.IsImageSafe = isImageSafe; - this.Seed = seed; - } - - /// - /// Initializes a new instance of the class. - /// - public ImageGenerationObject() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationObjectObjectType.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationObjectObjectType.g.cs deleted file mode 100644 index 949e4f2e..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationObjectObjectType.g.cs +++ /dev/null @@ -1,45 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Discriminator marking this entry as a generated image in the polling endpoint's mixed data array. - /// - public enum ImageGenerationObjectObjectType - { - /// - /// - /// - ImageGeneration, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class ImageGenerationObjectObjectTypeExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this ImageGenerationObjectObjectType value) - { - return value switch - { - ImageGenerationObjectObjectType.ImageGeneration => "image.generation", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static ImageGenerationObjectObjectType? ToEnum(string value) - { - return value switch - { - "image.generation" => ImageGenerationObjectObjectType.ImageGeneration, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationObjectV3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationObjectV3.Json.g.cs deleted file mode 100644 index f79797c0..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationObjectV3.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class ImageGenerationObjectV3 - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.ImageGenerationObjectV3? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.ImageGenerationObjectV3), - jsonSerializerContext) as global::Ideogram.ImageGenerationObjectV3; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.ImageGenerationObjectV3? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.ImageGenerationObjectV3? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.ImageGenerationObjectV3), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImageGenerationObjectV3; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationObjectV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationObjectV3.g.cs deleted file mode 100644 index a2fe6bd2..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationObjectV3.g.cs +++ /dev/null @@ -1,138 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"style_type":"GENERAL","seed":12345,"upscaled_resolution":"4096x4096","prompt":"A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there\u0027s an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset.","resolution":"1280x800","url":"https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804\u0026sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89","is_image_safe":true} - /// - public sealed partial class ImageGenerationObjectV3 - { - /// - /// The direct link to the image generated.
- /// Example: https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89 - ///
- /// https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89 - [global::System.Text.Json.Serialization.JsonPropertyName("url")] - public string? Url { get; set; } - - /// - /// The prompt used for the generation. This may be different from the original prompt.
- /// Example: A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there's an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset. - ///
- /// A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there's an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset. - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Prompt { get; set; } - - /// - /// The resolutions supported for Ideogram 3.0.
- /// Example: 1280x800 - ///
- /// 1280x800 - [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ResolutionV3JsonConverter))] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.ResolutionV3 Resolution { get; set; } - - /// - /// Output resolution, only used if operations alters image dimensions, such as upscale, crop etc.
- /// Example: 4096x4096 - ///
- /// 4096x4096 - [global::System.Text.Json.Serialization.JsonPropertyName("upscaled_resolution")] - public string? UpscaledResolution { get; set; } - - /// - /// Whether this request passes safety checks. If false, the url field will be empty. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("is_image_safe")] - [global::System.Text.Json.Serialization.JsonRequired] - public required bool IsImageSafe { get; set; } - - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - ///
- /// 12345 - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - [global::System.Text.Json.Serialization.JsonRequired] - public required int Seed { get; set; } - - /// - /// The style type to generate with.
- /// Default Value: GENERAL
- /// Example: GENERAL - ///
- /// GENERAL - [global::System.Text.Json.Serialization.JsonPropertyName("style_type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.StyleTypeV3JsonConverter))] - public global::Ideogram.StyleTypeV3? StyleType { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The prompt used for the generation. This may be different from the original prompt.
- /// Example: A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there's an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset. - /// - /// - /// The resolutions supported for Ideogram 3.0.
- /// Example: 1280x800 - /// - /// - /// Whether this request passes safety checks. If false, the url field will be empty. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The direct link to the image generated.
- /// Example: https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89 - /// - /// - /// Output resolution, only used if operations alters image dimensions, such as upscale, crop etc.
- /// Example: 4096x4096 - /// - /// - /// The style type to generate with.
- /// Default Value: GENERAL
- /// Example: GENERAL - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ImageGenerationObjectV3( - string prompt, - global::Ideogram.ResolutionV3 resolution, - bool isImageSafe, - int seed, - string? url, - string? upscaledResolution, - global::Ideogram.StyleTypeV3? styleType) - { - this.Url = url; - this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); - this.Resolution = resolution; - this.UpscaledResolution = upscaledResolution; - this.IsImageSafe = isImageSafe; - this.Seed = seed; - this.StyleType = styleType; - } - - /// - /// Initializes a new instance of the class. - /// - public ImageGenerationObjectV3() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationObjectV4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationObjectV4.Json.g.cs deleted file mode 100644 index a2b506dc..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationObjectV4.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class ImageGenerationObjectV4 - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.ImageGenerationObjectV4? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.ImageGenerationObjectV4), - jsonSerializerContext) as global::Ideogram.ImageGenerationObjectV4; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.ImageGenerationObjectV4? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.ImageGenerationObjectV4? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.ImageGenerationObjectV4), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImageGenerationObjectV4; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationObjectV4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationObjectV4.g.cs deleted file mode 100644 index 31135cf7..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationObjectV4.g.cs +++ /dev/null @@ -1,109 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"seed":12345,"prompt":"prompt","resolution":"1024x1024","url":"https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804\u0026sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89","is_image_safe":true} - /// - public sealed partial class ImageGenerationObjectV4 - { - /// - /// The direct link to the image generated.
- /// Example: https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89 - ///
- /// https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89 - [global::System.Text.Json.Serialization.JsonPropertyName("url")] - public string? Url { get; set; } - - /// - /// The prompt used for the generation. This may be different from the original prompt. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Prompt { get; set; } - - /// - /// The output resolution of the image, in the format
- /// WIDTHxHEIGHT (e.g. 1024x1024). Not limited to the request
- /// resolution presets, since some endpoints accept custom output
- /// sizes.
- /// Example: 1024x1024 - ///
- /// 1024x1024 - [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Resolution { get; set; } - - /// - /// Whether this request passes safety checks. If false, the url field will be empty. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("is_image_safe")] - [global::System.Text.Json.Serialization.JsonRequired] - public required bool IsImageSafe { get; set; } - - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - ///
- /// 12345 - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - [global::System.Text.Json.Serialization.JsonRequired] - public required int Seed { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The prompt used for the generation. This may be different from the original prompt. - /// - /// - /// The output resolution of the image, in the format
- /// WIDTHxHEIGHT (e.g. 1024x1024). Not limited to the request
- /// resolution presets, since some endpoints accept custom output
- /// sizes.
- /// Example: 1024x1024 - /// - /// - /// Whether this request passes safety checks. If false, the url field will be empty. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The direct link to the image generated.
- /// Example: https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89 - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ImageGenerationObjectV4( - string prompt, - string resolution, - bool isImageSafe, - int seed, - string? url) - { - this.Url = url; - this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); - this.Resolution = resolution ?? throw new global::System.ArgumentNullException(nameof(resolution)); - this.IsImageSafe = isImageSafe; - this.Seed = seed; - } - - /// - /// Initializes a new instance of the class. - /// - public ImageGenerationObjectV4() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationObjectV4ImageToImage.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationObjectV4ImageToImage.Json.g.cs deleted file mode 100644 index 76f0fafb..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationObjectV4ImageToImage.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class ImageGenerationObjectV4ImageToImage - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.ImageGenerationObjectV4ImageToImage? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.ImageGenerationObjectV4ImageToImage), - jsonSerializerContext) as global::Ideogram.ImageGenerationObjectV4ImageToImage; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.ImageGenerationObjectV4ImageToImage? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.ImageGenerationObjectV4ImageToImage? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.ImageGenerationObjectV4ImageToImage), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImageGenerationObjectV4ImageToImage; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationObjectV4ImageToImage.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationObjectV4ImageToImage.g.cs deleted file mode 100644 index bc15f8fd..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationObjectV4ImageToImage.g.cs +++ /dev/null @@ -1,104 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"seed":12345,"prompt":"prompt","resolution":"1024x1024","url":"https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804\u0026sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89","is_image_safe":true} - /// - public sealed partial class ImageGenerationObjectV4ImageToImage - { - /// - /// The direct link to the image generated.
- /// Example: https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89 - ///
- /// https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89 - [global::System.Text.Json.Serialization.JsonPropertyName("url")] - public string? Url { get; set; } - - /// - /// The prompt used for the generation. This may be different from the original prompt. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Prompt { get; set; } - - /// - /// Output resolutions for Ideogram 4.0 image-to-image. Superset of ResolutionV4 (the 1K/2K t2im set) plus the small 512-tier (512x512, 768x384, 384x768).
- /// Example: 1024x1024 - ///
- /// 1024x1024 - [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ResolutionV4ImageToImageJsonConverter))] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.ResolutionV4ImageToImage Resolution { get; set; } - - /// - /// Whether this request passes safety checks. If false, the url field will be empty. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("is_image_safe")] - [global::System.Text.Json.Serialization.JsonRequired] - public required bool IsImageSafe { get; set; } - - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - ///
- /// 12345 - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - [global::System.Text.Json.Serialization.JsonRequired] - public required int Seed { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The prompt used for the generation. This may be different from the original prompt. - /// - /// - /// Output resolutions for Ideogram 4.0 image-to-image. Superset of ResolutionV4 (the 1K/2K t2im set) plus the small 512-tier (512x512, 768x384, 384x768).
- /// Example: 1024x1024 - /// - /// - /// Whether this request passes safety checks. If false, the url field will be empty. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The direct link to the image generated.
- /// Example: https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89 - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ImageGenerationObjectV4ImageToImage( - string prompt, - global::Ideogram.ResolutionV4ImageToImage resolution, - bool isImageSafe, - int seed, - string? url) - { - this.Url = url; - this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); - this.Resolution = resolution; - this.IsImageSafe = isImageSafe; - this.Seed = seed; - } - - /// - /// Initializes a new instance of the class. - /// - public ImageGenerationObjectV4ImageToImage() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationObjectV4Layout.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationObjectV4Layout.Json.g.cs deleted file mode 100644 index 45b1de29..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationObjectV4Layout.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class ImageGenerationObjectV4Layout - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.ImageGenerationObjectV4Layout? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.ImageGenerationObjectV4Layout), - jsonSerializerContext) as global::Ideogram.ImageGenerationObjectV4Layout; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.ImageGenerationObjectV4Layout? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.ImageGenerationObjectV4Layout? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.ImageGenerationObjectV4Layout), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImageGenerationObjectV4Layout; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationObjectV4Layout.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationObjectV4Layout.g.cs deleted file mode 100644 index 323cd947..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationObjectV4Layout.g.cs +++ /dev/null @@ -1,104 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - public sealed partial class ImageGenerationObjectV4Layout - { - /// - /// The direct link to the image generated.
- /// Example: https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89 - ///
- /// https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89 - [global::System.Text.Json.Serialization.JsonPropertyName("url")] - public string? Url { get; set; } - - /// - /// The prompt used for the generation. This may be different from the original prompt. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Prompt { get; set; } - - /// - /// The resolutions supported for Ideogram 4.0 layout-to-image and design generation.
- /// Example: 1024x1024 - ///
- /// 1024x1024 - [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ResolutionV4LayoutJsonConverter))] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.ResolutionV4Layout Resolution { get; set; } - - /// - /// Whether this request passes safety checks. If false, the url field will be empty. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("is_image_safe")] - [global::System.Text.Json.Serialization.JsonRequired] - public required bool IsImageSafe { get; set; } - - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - ///
- /// 12345 - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - [global::System.Text.Json.Serialization.JsonRequired] - public required int Seed { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The prompt used for the generation. This may be different from the original prompt. - /// - /// - /// The resolutions supported for Ideogram 4.0 layout-to-image and design generation.
- /// Example: 1024x1024 - /// - /// - /// Whether this request passes safety checks. If false, the url field will be empty. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The direct link to the image generated.
- /// Example: https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89 - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ImageGenerationObjectV4Layout( - string prompt, - global::Ideogram.ResolutionV4Layout resolution, - bool isImageSafe, - int seed, - string? url) - { - this.Url = url; - this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); - this.Resolution = resolution; - this.IsImageSafe = isImageSafe; - this.Seed = seed; - } - - /// - /// Initializes a new instance of the class. - /// - public ImageGenerationObjectV4Layout() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationResponse.Json.g.cs deleted file mode 100644 index 1733cbe4..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationResponse.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class ImageGenerationResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.ImageGenerationResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.ImageGenerationResponse), - jsonSerializerContext) as global::Ideogram.ImageGenerationResponse; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.ImageGenerationResponse? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.ImageGenerationResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.ImageGenerationResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImageGenerationResponse; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationResponse.g.cs deleted file mode 100644 index 7558a3c0..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationResponse.g.cs +++ /dev/null @@ -1,60 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The response for self-hosted open-source model generation endpoints. Uses a free-form resolution string (not a grid enum) because these models accept arbitrary dimensions.
- /// Example: {"data":[{"seed":12345,"object_type":"image.generation","asset_id":"asset_id","prompt":"prompt","resolution":"2048x2048","url":"https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804\u0026sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89","is_image_safe":true},{"seed":12345,"object_type":"image.generation","asset_id":"asset_id","prompt":"prompt","resolution":"2048x2048","url":"https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804\u0026sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89","is_image_safe":true}],"created":"2000-01-23T04:56:07\u002B00:00"} - ///
- public sealed partial class ImageGenerationResponse - { - /// - /// The time the request was created. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("created")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.DateTime Created { get; set; } - - /// - /// A list of ImageObjects that contain the generated image(s). - /// - [global::System.Text.Json.Serialization.JsonPropertyName("data")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList Data { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The time the request was created. - /// - /// - /// A list of ImageObjects that contain the generated image(s). - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ImageGenerationResponse( - global::System.DateTime created, - global::System.Collections.Generic.IList data) - { - this.Created = created; - this.Data = data ?? throw new global::System.ArgumentNullException(nameof(data)); - } - - /// - /// Initializes a new instance of the class. - /// - public ImageGenerationResponse() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationResponseV3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationResponseV3.Json.g.cs deleted file mode 100644 index 4daa6e87..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationResponseV3.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class ImageGenerationResponseV3 - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.ImageGenerationResponseV3? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.ImageGenerationResponseV3), - jsonSerializerContext) as global::Ideogram.ImageGenerationResponseV3; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.ImageGenerationResponseV3? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.ImageGenerationResponseV3? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.ImageGenerationResponseV3), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImageGenerationResponseV3; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationResponseV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationResponseV3.g.cs deleted file mode 100644 index 1234e296..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationResponseV3.g.cs +++ /dev/null @@ -1,61 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The response which contains information about the generated image, including the download link.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it.
- /// Example: {"data":[{"style_type":"GENERAL","seed":12345,"upscaled_resolution":"4096x4096","prompt":"A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there\u0027s an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset.","resolution":"1280x800","url":"https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804\u0026sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89","is_image_safe":true},{"style_type":"GENERAL","seed":12345,"upscaled_resolution":"4096x4096","prompt":"A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there\u0027s an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset.","resolution":"1280x800","url":"https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804\u0026sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89","is_image_safe":true}],"created":"2000-01-23T04:56:07\u002B00:00"} - ///
- public sealed partial class ImageGenerationResponseV3 - { - /// - /// The time the request was created. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("created")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.DateTime Created { get; set; } - - /// - /// A list of ImageObjects that contain the generated image(s). - /// - [global::System.Text.Json.Serialization.JsonPropertyName("data")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList Data { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The time the request was created. - /// - /// - /// A list of ImageObjects that contain the generated image(s). - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ImageGenerationResponseV3( - global::System.DateTime created, - global::System.Collections.Generic.IList data) - { - this.Created = created; - this.Data = data ?? throw new global::System.ArgumentNullException(nameof(data)); - } - - /// - /// Initializes a new instance of the class. - /// - public ImageGenerationResponseV3() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationResponseV4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationResponseV4.Json.g.cs deleted file mode 100644 index 76140960..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationResponseV4.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class ImageGenerationResponseV4 - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.ImageGenerationResponseV4? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.ImageGenerationResponseV4), - jsonSerializerContext) as global::Ideogram.ImageGenerationResponseV4; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.ImageGenerationResponseV4? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.ImageGenerationResponseV4? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.ImageGenerationResponseV4), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImageGenerationResponseV4; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationResponseV4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationResponseV4.g.cs deleted file mode 100644 index 6dd9b86b..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationResponseV4.g.cs +++ /dev/null @@ -1,73 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The response which contains information about the generated image, including the download link.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it.
- /// Example: {"data":[{"seed":12345,"prompt":"prompt","resolution":"1024x1024","url":"https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804\u0026sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89","is_image_safe":true},{"seed":12345,"prompt":"prompt","resolution":"1024x1024","url":"https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804\u0026sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89","is_image_safe":true}],"created":"2000-01-23T04:56:07\u002B00:00","response_type":"url"} - ///
- public sealed partial class ImageGenerationResponseV4 - { - /// - /// Discriminator for the postGenerateDesignV4 oneOf response. Always "url" for this shape. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("response_type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ImageGenerationResponseV4ResponseTypeJsonConverter))] - public global::Ideogram.ImageGenerationResponseV4ResponseType? ResponseType { get; set; } - - /// - /// The time the request was created. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("created")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.DateTime Created { get; set; } - - /// - /// A list of ImageObjects that contain the generated image(s). - /// - [global::System.Text.Json.Serialization.JsonPropertyName("data")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList Data { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The time the request was created. - /// - /// - /// A list of ImageObjects that contain the generated image(s). - /// - /// - /// Discriminator for the postGenerateDesignV4 oneOf response. Always "url" for this shape. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ImageGenerationResponseV4( - global::System.DateTime created, - global::System.Collections.Generic.IList data, - global::Ideogram.ImageGenerationResponseV4ResponseType? responseType) - { - this.ResponseType = responseType; - this.Created = created; - this.Data = data ?? throw new global::System.ArgumentNullException(nameof(data)); - } - - /// - /// Initializes a new instance of the class. - /// - public ImageGenerationResponseV4() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationResponseV4ImageToImage.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationResponseV4ImageToImage.Json.g.cs deleted file mode 100644 index 70cc3883..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationResponseV4ImageToImage.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class ImageGenerationResponseV4ImageToImage - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.ImageGenerationResponseV4ImageToImage? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.ImageGenerationResponseV4ImageToImage), - jsonSerializerContext) as global::Ideogram.ImageGenerationResponseV4ImageToImage; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.ImageGenerationResponseV4ImageToImage? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.ImageGenerationResponseV4ImageToImage? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.ImageGenerationResponseV4ImageToImage), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImageGenerationResponseV4ImageToImage; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationResponseV4ImageToImage.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationResponseV4ImageToImage.g.cs deleted file mode 100644 index 17eaef40..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationResponseV4ImageToImage.g.cs +++ /dev/null @@ -1,73 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The response which contains information about the generated image-to-image output, including the download link.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it.
- /// Example: {"data":[{"seed":12345,"prompt":"prompt","resolution":"1024x1024","url":"https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804\u0026sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89","is_image_safe":true},{"seed":12345,"prompt":"prompt","resolution":"1024x1024","url":"https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804\u0026sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89","is_image_safe":true}],"created":"2000-01-23T04:56:07\u002B00:00","response_type":"url"} - ///
- public sealed partial class ImageGenerationResponseV4ImageToImage - { - /// - /// Always "url" for this shape. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("response_type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ImageGenerationResponseV4ImageToImageResponseTypeJsonConverter))] - public global::Ideogram.ImageGenerationResponseV4ImageToImageResponseType? ResponseType { get; set; } - - /// - /// The time the request was created. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("created")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.DateTime Created { get; set; } - - /// - /// A list of ImageObjects that contain the generated image(s). - /// - [global::System.Text.Json.Serialization.JsonPropertyName("data")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList Data { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The time the request was created. - /// - /// - /// A list of ImageObjects that contain the generated image(s). - /// - /// - /// Always "url" for this shape. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ImageGenerationResponseV4ImageToImage( - global::System.DateTime created, - global::System.Collections.Generic.IList data, - global::Ideogram.ImageGenerationResponseV4ImageToImageResponseType? responseType) - { - this.ResponseType = responseType; - this.Created = created; - this.Data = data ?? throw new global::System.ArgumentNullException(nameof(data)); - } - - /// - /// Initializes a new instance of the class. - /// - public ImageGenerationResponseV4ImageToImage() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationResponseV4ImageToImageResponseType.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationResponseV4ImageToImageResponseType.g.cs deleted file mode 100644 index 12010980..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationResponseV4ImageToImageResponseType.g.cs +++ /dev/null @@ -1,45 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Always "url" for this shape. - /// - public enum ImageGenerationResponseV4ImageToImageResponseType - { - /// - /// - /// - Url, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class ImageGenerationResponseV4ImageToImageResponseTypeExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this ImageGenerationResponseV4ImageToImageResponseType value) - { - return value switch - { - ImageGenerationResponseV4ImageToImageResponseType.Url => "url", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static ImageGenerationResponseV4ImageToImageResponseType? ToEnum(string value) - { - return value switch - { - "url" => ImageGenerationResponseV4ImageToImageResponseType.Url, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationResponseV4Layout.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationResponseV4Layout.Json.g.cs deleted file mode 100644 index 816d6bb5..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationResponseV4Layout.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class ImageGenerationResponseV4Layout - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.ImageGenerationResponseV4Layout? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.ImageGenerationResponseV4Layout), - jsonSerializerContext) as global::Ideogram.ImageGenerationResponseV4Layout; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.ImageGenerationResponseV4Layout? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.ImageGenerationResponseV4Layout? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.ImageGenerationResponseV4Layout), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImageGenerationResponseV4Layout; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationResponseV4Layout.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationResponseV4Layout.g.cs deleted file mode 100644 index 61cebead..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationResponseV4Layout.g.cs +++ /dev/null @@ -1,72 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The response which contains information about the generated layout-to-image output, including the download link.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
- public sealed partial class ImageGenerationResponseV4Layout - { - /// - /// Discriminator for the postGenerateDesignV4 oneOf response. Always "url" for this shape. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("response_type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ImageGenerationResponseV4LayoutResponseTypeJsonConverter))] - public global::Ideogram.ImageGenerationResponseV4LayoutResponseType? ResponseType { get; set; } - - /// - /// The time the request was created. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("created")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.DateTime Created { get; set; } - - /// - /// A list of ImageObjects that contain the generated image(s). - /// - [global::System.Text.Json.Serialization.JsonPropertyName("data")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList Data { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The time the request was created. - /// - /// - /// A list of ImageObjects that contain the generated image(s). - /// - /// - /// Discriminator for the postGenerateDesignV4 oneOf response. Always "url" for this shape. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ImageGenerationResponseV4Layout( - global::System.DateTime created, - global::System.Collections.Generic.IList data, - global::Ideogram.ImageGenerationResponseV4LayoutResponseType? responseType) - { - this.ResponseType = responseType; - this.Created = created; - this.Data = data ?? throw new global::System.ArgumentNullException(nameof(data)); - } - - /// - /// Initializes a new instance of the class. - /// - public ImageGenerationResponseV4Layout() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationResponseV4LayoutResponseType.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationResponseV4LayoutResponseType.g.cs deleted file mode 100644 index 423a5d2b..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationResponseV4LayoutResponseType.g.cs +++ /dev/null @@ -1,45 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Discriminator for the postGenerateDesignV4 oneOf response. Always "url" for this shape. - /// - public enum ImageGenerationResponseV4LayoutResponseType - { - /// - /// - /// - Url, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class ImageGenerationResponseV4LayoutResponseTypeExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this ImageGenerationResponseV4LayoutResponseType value) - { - return value switch - { - ImageGenerationResponseV4LayoutResponseType.Url => "url", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static ImageGenerationResponseV4LayoutResponseType? ToEnum(string value) - { - return value switch - { - "url" => ImageGenerationResponseV4LayoutResponseType.Url, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationResponseV4ResponseType.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationResponseV4ResponseType.g.cs deleted file mode 100644 index d06fbdd3..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationResponseV4ResponseType.g.cs +++ /dev/null @@ -1,45 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Discriminator for the postGenerateDesignV4 oneOf response. Always "url" for this shape. - /// - public enum ImageGenerationResponseV4ResponseType - { - /// - /// - /// - Url, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class ImageGenerationResponseV4ResponseTypeExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this ImageGenerationResponseV4ResponseType value) - { - return value switch - { - ImageGenerationResponseV4ResponseType.Url => "url", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static ImageGenerationResponseV4ResponseType? ToEnum(string value) - { - return value switch - { - "url" => ImageGenerationResponseV4ResponseType.Url, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImageLayerV3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImageLayerV3.Json.g.cs deleted file mode 100644 index 4faefbcf..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ImageLayerV3.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class ImageLayerV3 - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.ImageLayerV3? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.ImageLayerV3), - jsonSerializerContext) as global::Ideogram.ImageLayerV3; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.ImageLayerV3? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.ImageLayerV3? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.ImageLayerV3), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImageLayerV3; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImageLayerV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImageLayerV3.g.cs deleted file mode 100644 index 81545b78..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ImageLayerV3.g.cs +++ /dev/null @@ -1,98 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// An image layer (logo, brand asset, icon) for a layered image generation.
- /// Example: {"ref_id":"REF_0","x":4,"width":1,"y":7,"height":1} - ///
- public sealed partial class ImageLayerV3 - { - /// - /// The x coordinate of the layer. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("x")] - [global::System.Text.Json.Serialization.JsonRequired] - public required int X { get; set; } - - /// - /// The y coordinate of the layer. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("y")] - [global::System.Text.Json.Serialization.JsonRequired] - public required int Y { get; set; } - - /// - /// The width of the layer. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("width")] - [global::System.Text.Json.Serialization.JsonRequired] - public required int Width { get; set; } - - /// - /// The height of the layer. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("height")] - [global::System.Text.Json.Serialization.JsonRequired] - public required int Height { get; set; } - - /// - /// Reference ID matching a provided reference image (e.g., "REF_0"), or -1 if no match.
- /// Example: REF_0 - ///
- /// REF_0 - [global::System.Text.Json.Serialization.JsonPropertyName("ref_id")] - public string? RefId { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The x coordinate of the layer. - /// - /// - /// The y coordinate of the layer. - /// - /// - /// The width of the layer. - /// - /// - /// The height of the layer. - /// - /// - /// Reference ID matching a provided reference image (e.g., "REF_0"), or -1 if no match.
- /// Example: REF_0 - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ImageLayerV3( - int x, - int y, - int width, - int height, - string? refId) - { - this.X = x; - this.Y = y; - this.Width = width; - this.Height = height; - this.RefId = refId; - } - - /// - /// Initializes a new instance of the class. - /// - public ImageLayerV3() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImageObject.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImageObject.Json.g.cs deleted file mode 100644 index 78dacb54..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ImageObject.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class ImageObject - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.ImageObject? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.ImageObject), - jsonSerializerContext) as global::Ideogram.ImageObject; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.ImageObject? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.ImageObject? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.ImageObject), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImageObject; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImageObject.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImageObject.g.cs deleted file mode 100644 index 25dff734..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ImageObject.g.cs +++ /dev/null @@ -1,135 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"style_type":"REALISTIC","seed":12345,"upscaled_resolution":"4096x4096","prompt":"A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there\u0027s an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset.","resolution":"1024x1024","url":"https://ideogram.ai/api/images/direct/8YEpFzHuS-S6xXEGmCsf7g","is_image_safe":true} - /// - public sealed partial class ImageObject - { - /// - /// The direct link to the image generated.
- /// Example: https://ideogram.ai/api/images/direct/8YEpFzHuS-S6xXEGmCsf7g - ///
- /// https://ideogram.ai/api/images/direct/8YEpFzHuS-S6xXEGmCsf7g - [global::System.Text.Json.Serialization.JsonPropertyName("url")] - public string? Url { get; set; } - - /// - /// The prompt used for the generation. This may be different from the original prompt.
- /// Example: A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there's an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset. - ///
- /// A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there's an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset. - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Prompt { get; set; } - - /// - /// The resolution of the final image.
- /// Example: 1024x1024 - ///
- /// 1024x1024 - [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Resolution { get; set; } - - /// - /// Output resolution, only used if operations alters image dimensions, such as upscale, crop etc.
- /// Example: 4096x4096 - ///
- /// 4096x4096 - [global::System.Text.Json.Serialization.JsonPropertyName("upscaled_resolution")] - public string? UpscaledResolution { get; set; } - - /// - /// Whether this request passes safety checks. If false, the url field will be empty. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("is_image_safe")] - [global::System.Text.Json.Serialization.JsonRequired] - public required bool IsImageSafe { get; set; } - - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - ///
- /// 12345 - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - [global::System.Text.Json.Serialization.JsonRequired] - public required int Seed { get; set; } - - /// - /// The style type to generate with; this is only applicable for models V_2 and above and should not be specified for model versions V_1.
- /// Example: REALISTIC - ///
- /// REALISTIC - [global::System.Text.Json.Serialization.JsonPropertyName("style_type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.StyleTypeJsonConverter))] - public global::Ideogram.StyleType? StyleType { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The prompt used for the generation. This may be different from the original prompt.
- /// Example: A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there's an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset. - /// - /// - /// The resolution of the final image.
- /// Example: 1024x1024 - /// - /// - /// Whether this request passes safety checks. If false, the url field will be empty. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The direct link to the image generated.
- /// Example: https://ideogram.ai/api/images/direct/8YEpFzHuS-S6xXEGmCsf7g - /// - /// - /// Output resolution, only used if operations alters image dimensions, such as upscale, crop etc.
- /// Example: 4096x4096 - /// - /// - /// The style type to generate with; this is only applicable for models V_2 and above and should not be specified for model versions V_1.
- /// Example: REALISTIC - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ImageObject( - string prompt, - string resolution, - bool isImageSafe, - int seed, - string? url, - string? upscaledResolution, - global::Ideogram.StyleType? styleType) - { - this.Url = url; - this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); - this.Resolution = resolution ?? throw new global::System.ArgumentNullException(nameof(resolution)); - this.UpscaledResolution = upscaledResolution; - this.IsImageSafe = isImageSafe; - this.Seed = seed; - this.StyleType = styleType; - } - - /// - /// Initializes a new instance of the class. - /// - public ImageObject() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImageObjectWithoutPromptOrSeed.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImageObjectWithoutPromptOrSeed.Json.g.cs deleted file mode 100644 index d1076731..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ImageObjectWithoutPromptOrSeed.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class ImageObjectWithoutPromptOrSeed - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.ImageObjectWithoutPromptOrSeed? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.ImageObjectWithoutPromptOrSeed), - jsonSerializerContext) as global::Ideogram.ImageObjectWithoutPromptOrSeed; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.ImageObjectWithoutPromptOrSeed? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.ImageObjectWithoutPromptOrSeed? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.ImageObjectWithoutPromptOrSeed), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImageObjectWithoutPromptOrSeed; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImageObjectWithoutPromptOrSeed.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImageObjectWithoutPromptOrSeed.g.cs deleted file mode 100644 index 1198112c..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ImageObjectWithoutPromptOrSeed.g.cs +++ /dev/null @@ -1,96 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// An image result that does not expose its prompt or seed. - /// - public sealed partial class ImageObjectWithoutPromptOrSeed - { - /// - /// Discriminator marking this entry as an image result without prompt or seed. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("object_type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ImageObjectWithoutPromptOrSeedObjectTypeJsonConverter))] - public global::Ideogram.ImageObjectWithoutPromptOrSeedObjectType ObjectType { get; set; } - - /// - /// The direct link to the reframed image. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("url")] - public string? Url { get; set; } - - /// - /// The base64url-encoded identifier of the generated image asset. Present for safe workflow-owned outputs. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("asset_id")] - public string? AssetId { get; set; } - - /// - /// The exact dimensions of the reframed image, formatted as "{width}x{height}".
- /// Example: 1920x1080 - ///
- /// 1920x1080 - [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Resolution { get; set; } - - /// - /// Whether this image passes safety checks. If false, the url field is empty. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("is_image_safe")] - [global::System.Text.Json.Serialization.JsonRequired] - public required bool IsImageSafe { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The exact dimensions of the reframed image, formatted as "{width}x{height}".
- /// Example: 1920x1080 - /// - /// - /// Whether this image passes safety checks. If false, the url field is empty. - /// - /// - /// Discriminator marking this entry as an image result without prompt or seed. - /// - /// - /// The direct link to the reframed image. - /// - /// - /// The base64url-encoded identifier of the generated image asset. Present for safe workflow-owned outputs. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ImageObjectWithoutPromptOrSeed( - string resolution, - bool isImageSafe, - global::Ideogram.ImageObjectWithoutPromptOrSeedObjectType objectType, - string? url, - string? assetId) - { - this.ObjectType = objectType; - this.Url = url; - this.AssetId = assetId; - this.Resolution = resolution ?? throw new global::System.ArgumentNullException(nameof(resolution)); - this.IsImageSafe = isImageSafe; - } - - /// - /// Initializes a new instance of the class. - /// - public ImageObjectWithoutPromptOrSeed() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImageObjectWithoutPromptOrSeedObjectType.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImageObjectWithoutPromptOrSeedObjectType.g.cs deleted file mode 100644 index 53f8309e..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ImageObjectWithoutPromptOrSeedObjectType.g.cs +++ /dev/null @@ -1,45 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Discriminator marking this entry as an image result without prompt or seed. - /// - public enum ImageObjectWithoutPromptOrSeedObjectType - { - /// - /// - /// - ImageWithoutPromptOrSeed, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class ImageObjectWithoutPromptOrSeedObjectTypeExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this ImageObjectWithoutPromptOrSeedObjectType value) - { - return value switch - { - ImageObjectWithoutPromptOrSeedObjectType.ImageWithoutPromptOrSeed => "image.without-prompt-or-seed", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static ImageObjectWithoutPromptOrSeedObjectType? ToEnum(string value) - { - return value switch - { - "image.without-prompt-or-seed" => ImageObjectWithoutPromptOrSeedObjectType.ImageWithoutPromptOrSeed, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImageRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImageRequest.Json.g.cs deleted file mode 100644 index 7103f32a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ImageRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class ImageRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.ImageRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.ImageRequest), - jsonSerializerContext) as global::Ideogram.ImageRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.ImageRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.ImageRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.ImageRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImageRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImageRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImageRequest.g.cs deleted file mode 100644 index 50f7c54d..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ImageRequest.g.cs +++ /dev/null @@ -1,201 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"aspect_ratio":"ASPECT_10_16","magic_prompt_option":"AUTO","model":"V_2","prompt":"A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there is an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset."} - /// - public sealed partial class ImageRequest - { - /// - /// The prompt to use to generate the image.
- /// Example: A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there is an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset. - ///
- /// A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there is an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset. - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Prompt { get; set; } - - /// - /// (Cannot be used in conjunction with resolution) The aspect ratio to use for image generation, which determines the image's resolution. Defaults to ASPECT_1_1.
- /// Example: ASPECT_10_16 - ///
- /// ASPECT_10_16 - [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.AspectRatioJsonConverter))] - public global::Ideogram.AspectRatio? AspectRatio { get; set; } - - /// - /// The model used to generate an image or edit one. /generate and /remix supports all model types, however, /edit is only supported for V_2 and V_2_TURBO.
- /// Default Value: V_2
- /// Example: V_2_TURBO - ///
- /// V_2_TURBO - [global::System.Text.Json.Serialization.JsonPropertyName("model")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ModelEnumJsonConverter))] - public global::Ideogram.ModelEnum? Model { get; set; } - - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - ///
- /// ON - [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt_option")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.MagicPromptOptionJsonConverter))] - public global::Ideogram.MagicPromptOption? MagicPromptOption { get; set; } - - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt_system_prompt_config_id")] - public string? MagicPromptSystemPromptConfigId { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt_version")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.MagicPromptVersionEnumJsonConverter))] - public global::Ideogram.MagicPromptVersionEnum? MagicPromptVersion { get; set; } - - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - ///
- /// 12345 - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// The style type to generate with; this is only applicable for models V_2 and above and should not be specified for model versions V_1.
- /// Example: REALISTIC - ///
- /// REALISTIC - [global::System.Text.Json.Serialization.JsonPropertyName("style_type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.StyleTypeJsonConverter))] - public global::Ideogram.StyleType? StyleType { get; set; } - - /// - /// Only available for model versions V_1, V_1_TURBO, V_2 and V_2_TURBO. Description of what to exclude from an image. Descriptions in the prompt take precedence to descriptions in the negative prompt.
- /// Example: brush strokes, painting - ///
- /// brush strokes, painting - [global::System.Text.Json.Serialization.JsonPropertyName("negative_prompt")] - public string? NegativePrompt { get; set; } - - /// - /// The number of images to generate.
- /// Default Value: 1 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] - public int? NumImages { get; set; } - - /// - /// (For model_version for 2.0 only, cannot be used in conjunction with aspect_ratio) The resolution to use for image generation, represented in width x height. If not specified, defaults to using aspect_ratio.
- /// Example: RESOLUTION_1024_1024 - ///
- /// RESOLUTION_1024_1024 - [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ResolutionJsonConverter))] - public global::Ideogram.Resolution? Resolution { get; set; } - - /// - /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). Not supported by V_1, V_1_TURBO, V_2A and V_2A_TURBO models. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("color_palette")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ColorPaletteWithPresetNameOrMembersJsonConverter))] - public global::Ideogram.ColorPaletteWithPresetNameOrMembers? ColorPalette { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The prompt to use to generate the image.
- /// Example: A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there is an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset. - /// - /// - /// (Cannot be used in conjunction with resolution) The aspect ratio to use for image generation, which determines the image's resolution. Defaults to ASPECT_1_1.
- /// Example: ASPECT_10_16 - /// - /// - /// The model used to generate an image or edit one. /generate and /remix supports all model types, however, /edit is only supported for V_2 and V_2_TURBO.
- /// Default Value: V_2
- /// Example: V_2_TURBO - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The style type to generate with; this is only applicable for models V_2 and above and should not be specified for model versions V_1.
- /// Example: REALISTIC - /// - /// - /// Only available for model versions V_1, V_1_TURBO, V_2 and V_2_TURBO. Description of what to exclude from an image. Descriptions in the prompt take precedence to descriptions in the negative prompt.
- /// Example: brush strokes, painting - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// (For model_version for 2.0 only, cannot be used in conjunction with aspect_ratio) The resolution to use for image generation, represented in width x height. If not specified, defaults to using aspect_ratio.
- /// Example: RESOLUTION_1024_1024 - /// - /// - /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). Not supported by V_1, V_1_TURBO, V_2A and V_2A_TURBO models. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ImageRequest( - string prompt, - global::Ideogram.AspectRatio? aspectRatio, - global::Ideogram.ModelEnum? model, - global::Ideogram.MagicPromptOption? magicPromptOption, - string? magicPromptSystemPromptConfigId, - global::Ideogram.MagicPromptVersionEnum? magicPromptVersion, - int? seed, - global::Ideogram.StyleType? styleType, - string? negativePrompt, - int? numImages, - global::Ideogram.Resolution? resolution, - global::Ideogram.ColorPaletteWithPresetNameOrMembers? colorPalette) - { - this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); - this.AspectRatio = aspectRatio; - this.Model = model; - this.MagicPromptOption = magicPromptOption; - this.MagicPromptSystemPromptConfigId = magicPromptSystemPromptConfigId; - this.MagicPromptVersion = magicPromptVersion; - this.Seed = seed; - this.StyleType = styleType; - this.NegativePrompt = negativePrompt; - this.NumImages = numImages; - this.Resolution = resolution; - this.ColorPalette = colorPalette; - } - - /// - /// Initializes a new instance of the class. - /// - public ImageRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImageSafetyError.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImageSafetyError.g.cs index 29434540..08ba99c5 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ImageSafetyError.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImageSafetyError.g.cs @@ -4,14 +4,13 @@ namespace Ideogram { /// - /// Example: {"error":"Image provided failed safety check due to the inclusion of prohibited content."} + /// /// public sealed partial class ImageSafetyError { /// - /// Example: Image provided failed safety check due to the inclusion of prohibited content. + /// /// - /// Image provided failed safety check due to the inclusion of prohibited content. [global::System.Text.Json.Serialization.JsonPropertyName("error")] [global::System.Text.Json.Serialization.JsonRequired] public required string Error { get; set; } @@ -25,9 +24,7 @@ public sealed partial class ImageSafetyError /// /// Initializes a new instance of the class. /// - /// - /// Example: Image provided failed safety check due to the inclusion of prohibited content. - /// + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25FlareRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25FlareRequest.Json.g.cs new file mode 100644 index 00000000..23e7feb4 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25FlareRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2GptImage25FlareRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25FlareRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25FlareRequest), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25FlareRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25FlareRequest? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25FlareRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25FlareRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25FlareRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25FlareRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25FlareRequest.g.cs new file mode 100644 index 00000000..25e39ca6 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25FlareRequest.g.cs @@ -0,0 +1,202 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// + /// + public sealed partial class ImagesGeneratePostGenerateImageV2GptImage25FlareRequest + { + /// + /// The prompt to generate images from, or the edit instruction to apply when source images are supplied. It is passed to the model as written. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Prompt { get; set; } + + /// + /// Optional source images to edit (max 16, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("images")] + public global::System.Collections.Generic.IList? Images { get; set; } + + /// + /// An optional mask for the first source image (max 25MB; JPEG, PNG, or WEBP). Multipart requests only. Fully transparent pixels mark the areas to edit. The mask must have the same dimensions as the first source image, and requires source images in the same request. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("mask")] + public byte[]? Mask { get; set; } + + /// + /// An optional mask for the first source image (max 25MB; JPEG, PNG, or WEBP). Multipart requests only. Fully transparent pixels mark the areas to edit. The mask must have the same dimensions as the first source image, and requires source images in the same request. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("maskname")] + public string? Maskname { get; set; } + + /// + /// The output background. `transparent` returns images with an alpha channel, `opaque` forces a solid background, and `auto` lets the model decide from the prompt.
+ /// Default Value: auto + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("background")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaBackgroundJsonConverter))] + public global::Ideogram.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaBackground? Background { get; set; } + + /// + /// How much rendering effort the model spends. Lower tiers return sooner and cost less; `auto` lets the model choose, which it currently renders at `high`.
+ /// Default Value: auto + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("quality")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaQualityJsonConverter))] + public global::Ideogram.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaQuality? Quality { get; set; } + + /// + /// The number of images to generate.
+ /// Default Value: 1 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] + public int? NumImages { get; set; } + + /// + /// Random seed. Set for reproducible generation. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("seed")] + public int? Seed { get; set; } + + /// + /// The requested output aspect ratio, for example "1:1", "16:9", or "9:16". Ignored when `resolution` is provided. Defaults to "1:1". + /// + [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] + public string? AspectRatio { get; set; } + + /// + /// Exact output resolution, formatted as "WIDTHxHEIGHT", for example
+ /// "2048x2048" or "1920x1088". When provided, this takes precedence
+ /// over `aspect_ratio`. The dimensions must satisfy GPT Image 2.5 Flare
+ /// constraints: each side is a multiple of 16, the largest side is at
+ /// most 3840px, the long:short ratio is at most 3:1, and total pixels
+ /// are between 655360 and 8294400 inclusive. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] + public string? Resolution { get; set; } + + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] + public string? WebhookUrl { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The prompt to generate images from, or the edit instruction to apply when source images are supplied. It is passed to the model as written. + /// + /// + /// Optional source images to edit (max 16, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only. + /// + /// + /// An optional mask for the first source image (max 25MB; JPEG, PNG, or WEBP). Multipart requests only. Fully transparent pixels mark the areas to edit. The mask must have the same dimensions as the first source image, and requires source images in the same request. + /// + /// + /// An optional mask for the first source image (max 25MB; JPEG, PNG, or WEBP). Multipart requests only. Fully transparent pixels mark the areas to edit. The mask must have the same dimensions as the first source image, and requires source images in the same request. + /// + /// + /// The output background. `transparent` returns images with an alpha channel, `opaque` forces a solid background, and `auto` lets the model decide from the prompt.
+ /// Default Value: auto + /// + /// + /// How much rendering effort the model spends. Lower tiers return sooner and cost less; `auto` lets the model choose, which it currently renders at `high`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The requested output aspect ratio, for example "1:1", "16:9", or "9:16". Ignored when `resolution` is provided. Defaults to "1:1". + /// + /// + /// Exact output resolution, formatted as "WIDTHxHEIGHT", for example
+ /// "2048x2048" or "1920x1088". When provided, this takes precedence
+ /// over `aspect_ratio`. The dimensions must satisfy GPT Image 2.5 Flare
+ /// constraints: each side is a multiple of 16, the largest side is at
+ /// most 3840px, the long:short ratio is at most 3:1, and total pixels
+ /// are between 655360 and 8294400 inclusive. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ImagesGeneratePostGenerateImageV2GptImage25FlareRequest( + string prompt, + global::System.Collections.Generic.IList? images, + byte[]? mask, + string? maskname, + global::Ideogram.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaBackground? background, + global::Ideogram.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaQuality? quality, + int? numImages, + int? seed, + string? aspectRatio, + string? resolution, + bool? async, + string? webhookUrl) + { + this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); + this.Images = images; + this.Mask = mask; + this.Maskname = maskname; + this.Background = background; + this.Quality = quality; + this.NumImages = numImages; + this.Seed = seed; + this.AspectRatio = aspectRatio; + this.Resolution = resolution; + this.Async = async; + this.WebhookUrl = webhookUrl; + } + + /// + /// Initializes a new instance of the class. + /// + public ImagesGeneratePostGenerateImageV2GptImage25FlareRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse.Json.g.cs new file mode 100644 index 00000000..f3b48d73 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2GptImage25FlareResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse.g.cs new file mode 100644 index 00000000..aca8dbfd --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2GptImage25FlareResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse2.Json.g.cs new file mode 100644 index 00000000..871fa318 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2GptImage25FlareResponse2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse2), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse2.g.cs new file mode 100644 index 00000000..86284c0d --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2GptImage25FlareResponse2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse3.Json.g.cs new file mode 100644 index 00000000..fc2fe0db --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2GptImage25FlareResponse3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse3), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse3? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse3), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse3.g.cs new file mode 100644 index 00000000..78e0a97f --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2GptImage25FlareResponse3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse4.Json.g.cs new file mode 100644 index 00000000..393b05bd --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2GptImage25FlareResponse4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse4), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse4? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse4), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse4.g.cs new file mode 100644 index 00000000..4358fada --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2GptImage25FlareResponse4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse5.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse5.Json.g.cs new file mode 100644 index 00000000..6d4b6096 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2GptImage25FlareResponse5 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse5? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse5), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse5; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse5? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse5? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse5), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse5; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse5.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse5.g.cs new file mode 100644 index 00000000..e8f60c0b --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25FlareResponse5.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2GptImage25FlareResponse5 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25SunburstRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25SunburstRequest.Json.g.cs new file mode 100644 index 00000000..c344acd1 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25SunburstRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2GptImage25SunburstRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25SunburstRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25SunburstRequest), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25SunburstRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25SunburstRequest? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25SunburstRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25SunburstRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25SunburstRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25SunburstRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25SunburstRequest.g.cs new file mode 100644 index 00000000..dab2eb6c --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25SunburstRequest.g.cs @@ -0,0 +1,202 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// + /// + public sealed partial class ImagesGeneratePostGenerateImageV2GptImage25SunburstRequest + { + /// + /// The prompt to generate images from, or the edit instruction to apply when source images are supplied. It is passed to the model as written. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Prompt { get; set; } + + /// + /// Optional source images to edit (max 16, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("images")] + public global::System.Collections.Generic.IList? Images { get; set; } + + /// + /// An optional mask for the first source image (max 25MB; JPEG, PNG, or WEBP). Multipart requests only. Fully transparent pixels mark the areas to edit. The mask must have the same dimensions as the first source image, and requires source images in the same request. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("mask")] + public byte[]? Mask { get; set; } + + /// + /// An optional mask for the first source image (max 25MB; JPEG, PNG, or WEBP). Multipart requests only. Fully transparent pixels mark the areas to edit. The mask must have the same dimensions as the first source image, and requires source images in the same request. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("maskname")] + public string? Maskname { get; set; } + + /// + /// The output background. `transparent` returns images with an alpha channel, `opaque` forces a solid background, and `auto` lets the model decide from the prompt.
+ /// Default Value: auto + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("background")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaBackgroundJsonConverter))] + public global::Ideogram.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaBackground? Background { get; set; } + + /// + /// How much rendering effort the model spends. Lower tiers return sooner and cost less; `auto` lets the model choose, which it currently renders at `high`.
+ /// Default Value: auto + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("quality")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaQualityJsonConverter))] + public global::Ideogram.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaQuality? Quality { get; set; } + + /// + /// The number of images to generate.
+ /// Default Value: 1 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] + public int? NumImages { get; set; } + + /// + /// Random seed. Set for reproducible generation. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("seed")] + public int? Seed { get; set; } + + /// + /// The requested output aspect ratio, for example "1:1", "16:9", or "9:16". Ignored when `resolution` is provided. Defaults to "1:1". + /// + [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] + public string? AspectRatio { get; set; } + + /// + /// Exact output resolution, formatted as "WIDTHxHEIGHT", for example
+ /// "2048x2048" or "1920x1088". When provided, this takes precedence
+ /// over `aspect_ratio`. The dimensions must satisfy GPT Image 2.5 Sunburst
+ /// constraints: each side is a multiple of 16, the largest side is at
+ /// most 3840px, the long:short ratio is at most 3:1, and total pixels
+ /// are between 655360 and 8294400 inclusive. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] + public string? Resolution { get; set; } + + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] + public string? WebhookUrl { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The prompt to generate images from, or the edit instruction to apply when source images are supplied. It is passed to the model as written. + /// + /// + /// Optional source images to edit (max 16, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only. + /// + /// + /// An optional mask for the first source image (max 25MB; JPEG, PNG, or WEBP). Multipart requests only. Fully transparent pixels mark the areas to edit. The mask must have the same dimensions as the first source image, and requires source images in the same request. + /// + /// + /// An optional mask for the first source image (max 25MB; JPEG, PNG, or WEBP). Multipart requests only. Fully transparent pixels mark the areas to edit. The mask must have the same dimensions as the first source image, and requires source images in the same request. + /// + /// + /// The output background. `transparent` returns images with an alpha channel, `opaque` forces a solid background, and `auto` lets the model decide from the prompt.
+ /// Default Value: auto + /// + /// + /// How much rendering effort the model spends. Lower tiers return sooner and cost less; `auto` lets the model choose, which it currently renders at `high`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The requested output aspect ratio, for example "1:1", "16:9", or "9:16". Ignored when `resolution` is provided. Defaults to "1:1". + /// + /// + /// Exact output resolution, formatted as "WIDTHxHEIGHT", for example
+ /// "2048x2048" or "1920x1088". When provided, this takes precedence
+ /// over `aspect_ratio`. The dimensions must satisfy GPT Image 2.5 Sunburst
+ /// constraints: each side is a multiple of 16, the largest side is at
+ /// most 3840px, the long:short ratio is at most 3:1, and total pixels
+ /// are between 655360 and 8294400 inclusive. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ImagesGeneratePostGenerateImageV2GptImage25SunburstRequest( + string prompt, + global::System.Collections.Generic.IList? images, + byte[]? mask, + string? maskname, + global::Ideogram.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaBackground? background, + global::Ideogram.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaQuality? quality, + int? numImages, + int? seed, + string? aspectRatio, + string? resolution, + bool? async, + string? webhookUrl) + { + this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); + this.Images = images; + this.Mask = mask; + this.Maskname = maskname; + this.Background = background; + this.Quality = quality; + this.NumImages = numImages; + this.Seed = seed; + this.AspectRatio = aspectRatio; + this.Resolution = resolution; + this.Async = async; + this.WebhookUrl = webhookUrl; + } + + /// + /// Initializes a new instance of the class. + /// + public ImagesGeneratePostGenerateImageV2GptImage25SunburstRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse.Json.g.cs new file mode 100644 index 00000000..a5e90295 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse.g.cs new file mode 100644 index 00000000..1f8277cb --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse2.Json.g.cs new file mode 100644 index 00000000..0c426e0c --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse2), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse2.g.cs new file mode 100644 index 00000000..ff4bd55f --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse3.Json.g.cs new file mode 100644 index 00000000..a53259ab --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse3), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse3? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse3), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse3.g.cs new file mode 100644 index 00000000..99e18640 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse4.Json.g.cs new file mode 100644 index 00000000..6bba926b --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse4), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse4? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse4), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse4.g.cs new file mode 100644 index 00000000..c28e4cae --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse5.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse5.Json.g.cs new file mode 100644 index 00000000..7cd156de --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse5 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse5? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse5), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse5; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse5? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse5? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse5), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse5; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse5.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse5.g.cs new file mode 100644 index 00000000..354e353f --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse5.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2GptImage25SunburstResponse5 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage2Request.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage2Request.Json.g.cs new file mode 100644 index 00000000..2c022e80 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage2Request.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2GptImage2Request + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage2Request? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage2Request), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage2Request; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage2Request? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage2Request? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage2Request), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage2Request; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage2Request.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage2Request.g.cs new file mode 100644 index 00000000..e3435f40 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage2Request.g.cs @@ -0,0 +1,152 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// + /// + public sealed partial class ImagesGeneratePostGenerateImageV2GptImage2Request + { + /// + /// The prompt to generate images from, or the edit instruction to apply when source images are supplied. It is passed to the model as written. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Prompt { get; set; } + + /// + /// Optional source images to edit (max 16, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("images")] + public global::System.Collections.Generic.IList? Images { get; set; } + + /// + /// The number of images to generate.
+ /// Default Value: 1 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] + public int? NumImages { get; set; } + + /// + /// Random seed. Set for reproducible generation. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("seed")] + public int? Seed { get; set; } + + /// + /// The requested output aspect ratio, for example "1:1", "16:9", or "9:16". Ignored when `resolution` is provided. Defaults to "1:1". + /// + [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] + public string? AspectRatio { get; set; } + + /// + /// Exact output resolution, formatted as "WIDTHxHEIGHT", for example
+ /// "2048x2048" or "1920x1088". When provided, this takes precedence
+ /// over `aspect_ratio`. The dimensions must satisfy GPT Image 2
+ /// constraints: each side is a multiple of 16, the largest side is at
+ /// most 3840px, the long:short ratio is at most 3:1, and total pixels
+ /// are between 655360 and 8294400 inclusive. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] + public string? Resolution { get; set; } + + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] + public string? WebhookUrl { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The prompt to generate images from, or the edit instruction to apply when source images are supplied. It is passed to the model as written. + /// + /// + /// Optional source images to edit (max 16, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only. + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The requested output aspect ratio, for example "1:1", "16:9", or "9:16". Ignored when `resolution` is provided. Defaults to "1:1". + /// + /// + /// Exact output resolution, formatted as "WIDTHxHEIGHT", for example
+ /// "2048x2048" or "1920x1088". When provided, this takes precedence
+ /// over `aspect_ratio`. The dimensions must satisfy GPT Image 2
+ /// constraints: each side is a multiple of 16, the largest side is at
+ /// most 3840px, the long:short ratio is at most 3:1, and total pixels
+ /// are between 655360 and 8294400 inclusive. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ImagesGeneratePostGenerateImageV2GptImage2Request( + string prompt, + global::System.Collections.Generic.IList? images, + int? numImages, + int? seed, + string? aspectRatio, + string? resolution, + bool? async, + string? webhookUrl) + { + this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); + this.Images = images; + this.NumImages = numImages; + this.Seed = seed; + this.AspectRatio = aspectRatio; + this.Resolution = resolution; + this.Async = async; + this.WebhookUrl = webhookUrl; + } + + /// + /// Initializes a new instance of the class. + /// + public ImagesGeneratePostGenerateImageV2GptImage2Request() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage2Response.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage2Response.Json.g.cs new file mode 100644 index 00000000..39b3c3eb --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage2Response.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2GptImage2Response + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage2Response? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage2Response), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage2Response; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage2Response? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage2Response? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage2Response), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage2Response; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage2Response.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage2Response.g.cs new file mode 100644 index 00000000..6471b37c --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage2Response.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2GptImage2Response + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage2Response2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage2Response2.Json.g.cs new file mode 100644 index 00000000..bdd5fbe1 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage2Response2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2GptImage2Response2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage2Response2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage2Response2), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage2Response2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage2Response2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage2Response2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage2Response2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage2Response2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage2Response2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage2Response2.g.cs new file mode 100644 index 00000000..0c4899c2 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage2Response2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2GptImage2Response2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage2Response3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage2Response3.Json.g.cs new file mode 100644 index 00000000..465f53f4 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage2Response3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2GptImage2Response3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage2Response3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage2Response3), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage2Response3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage2Response3? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage2Response3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage2Response3), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage2Response3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage2Response3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage2Response3.g.cs new file mode 100644 index 00000000..c2eae860 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage2Response3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2GptImage2Response3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage2Response4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage2Response4.Json.g.cs new file mode 100644 index 00000000..d7323ec9 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage2Response4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2GptImage2Response4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage2Response4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage2Response4), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage2Response4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage2Response4? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage2Response4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage2Response4), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage2Response4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage2Response4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage2Response4.g.cs new file mode 100644 index 00000000..3fd4e770 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage2Response4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2GptImage2Response4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage2Response5.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage2Response5.Json.g.cs new file mode 100644 index 00000000..f881ae3f --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage2Response5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2GptImage2Response5 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage2Response5? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage2Response5), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage2Response5; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage2Response5? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage2Response5? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage2Response5), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2GptImage2Response5; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage2Response5.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage2Response5.g.cs new file mode 100644 index 00000000..0a2ef6c1 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2GptImage2Response5.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2GptImage2Response5 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2Ideogram45Request.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2Ideogram45Request.Json.g.cs new file mode 100644 index 00000000..0c68fe06 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2Ideogram45Request.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2Ideogram45Request + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2Ideogram45Request? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2Ideogram45Request), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2Ideogram45Request; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2Ideogram45Request? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2Ideogram45Request? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2Ideogram45Request), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2Ideogram45Request; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2Ideogram45Request.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2Ideogram45Request.g.cs new file mode 100644 index 00000000..580614d7 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2Ideogram45Request.g.cs @@ -0,0 +1,250 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// + /// + public sealed partial class ImagesGeneratePostGenerateImageV2Ideogram45Request + { + /// + /// The prompt to generate images from, or the edit instruction when
+ /// source images are supplied. Natural language or a structured
+ /// Ideogram 4.0 JSON prompt. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Prompt { get; set; } + + /// + /// Controls how a natural-language prompt is prepared. `auto` (the
+ /// default) and `on` rewrite and expand the prompt before generation.
+ /// `off` keeps your wording and only converts it into a structured
+ /// prompt. A valid structured JSON prompt skips magic prompt unless
+ /// `magic_prompt` is `on`. With source images, every mode converts
+ /// the edit instruction into a structured edit prompt.
+ /// Default Value: auto + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.MagicPromptModeJsonConverter))] + public global::Ideogram.MagicPromptMode? MagicPrompt { get; set; } + + /// + /// Optional source images to edit (max 5, max 25MB each; JPEG, PNG, or WEBP). The first image is the one being edited; any others are extra references. Multipart requests only. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("images")] + public global::System.Collections.Generic.IList? Images { get; set; } + + /// + /// An optional mask that limits the edit to part of the first source image (max 25MB; JPEG, PNG, or WEBP). Multipart requests only. Black marks the area to edit and white the area to keep; values in between are rounded to the nearer of the two. The mask must have the same width and height as the first source image and contain both black and white areas. A masked request can include at most three other source images. With a mask, the output is always the first source image's own size, so `size` cannot be set. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("mask")] + public byte[]? Mask { get; set; } + + /// + /// An optional mask that limits the edit to part of the first source image (max 25MB; JPEG, PNG, or WEBP). Multipart requests only. Black marks the area to edit and white the area to keep; values in between are rounded to the nearer of the two. The mask must have the same width and height as the first source image and contain both black and white areas. A masked request can include at most three other source images. With a mask, the output is always the first source image's own size, so `size` cannot be set. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("maskname")] + public string? Maskname { get; set; } + + /// + /// The output size: "auto", "source" or an exact "WIDTHxHEIGHT".
+ /// Without source images, an exact size must be one of the supported
+ /// 1K/2K presets (for example 1024x1024, 2048x2048 or 1440x2880);
+ /// "auto" or omitted picks a supported size based on the prompt.
+ /// "source" is rejected.
+ /// With source images, "auto" (the default) picks a supported 2K size
+ /// based on the source images and the prompt, and "source" returns the
+ /// output at the first source image's own width and height (scaled
+ /// down, keeping its proportions, if it is too large for the model).
+ /// Every source image's aspect ratio must be between 1:6 and 6:1.
+ /// An exact size must have both sides a multiple of 32 and at least
+ /// 256px, a total of at most 2048x2048 pixels, and an aspect ratio of
+ /// at most 6:1. With source images, an exact size reshapes the source
+ /// to it.
+ /// Pricing is tiered by the resolved output pixels: up to 1024x1024
+ /// bills as 1K, above that as 2K. An "auto" size bills as 2K.
+ /// Default Value: auto + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("size")] + public string? Size { get; set; } + + /// + /// The output background. `transparent` returns images with an alpha channel, `opaque` returns a solid one, and `auto` decides for you.
+ /// Default Value: auto + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("background")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaBackgroundJsonConverter))] + public global::Ideogram.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaBackground? Background { get; set; } + + /// + /// The rendering quality to use. Higher quality takes longer and costs more. Defaults to `medium` with source images and `high` without. `very_low`, the fastest and cheapest, requires source images. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("quality")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaQualityJsonConverter))] + public global::Ideogram.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality? Quality { get; set; } + + /// + /// Random seed. Set for reproducible generation. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("seed")] + public int? Seed { get; set; } + + /// + /// The number of images to generate.
+ /// Default Value: 1 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] + public int? NumImages { get; set; } + + /// + /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("enable_copyright_detection")] + public bool? EnableCopyrightDetection { get; set; } + + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] + public string? WebhookUrl { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The prompt to generate images from, or the edit instruction when
+ /// source images are supplied. Natural language or a structured
+ /// Ideogram 4.0 JSON prompt. + /// + /// + /// Controls how a natural-language prompt is prepared. `auto` (the
+ /// default) and `on` rewrite and expand the prompt before generation.
+ /// `off` keeps your wording and only converts it into a structured
+ /// prompt. A valid structured JSON prompt skips magic prompt unless
+ /// `magic_prompt` is `on`. With source images, every mode converts
+ /// the edit instruction into a structured edit prompt.
+ /// Default Value: auto + /// + /// + /// Optional source images to edit (max 5, max 25MB each; JPEG, PNG, or WEBP). The first image is the one being edited; any others are extra references. Multipart requests only. + /// + /// + /// An optional mask that limits the edit to part of the first source image (max 25MB; JPEG, PNG, or WEBP). Multipart requests only. Black marks the area to edit and white the area to keep; values in between are rounded to the nearer of the two. The mask must have the same width and height as the first source image and contain both black and white areas. A masked request can include at most three other source images. With a mask, the output is always the first source image's own size, so `size` cannot be set. + /// + /// + /// An optional mask that limits the edit to part of the first source image (max 25MB; JPEG, PNG, or WEBP). Multipart requests only. Black marks the area to edit and white the area to keep; values in between are rounded to the nearer of the two. The mask must have the same width and height as the first source image and contain both black and white areas. A masked request can include at most three other source images. With a mask, the output is always the first source image's own size, so `size` cannot be set. + /// + /// + /// The output size: "auto", "source" or an exact "WIDTHxHEIGHT".
+ /// Without source images, an exact size must be one of the supported
+ /// 1K/2K presets (for example 1024x1024, 2048x2048 or 1440x2880);
+ /// "auto" or omitted picks a supported size based on the prompt.
+ /// "source" is rejected.
+ /// With source images, "auto" (the default) picks a supported 2K size
+ /// based on the source images and the prompt, and "source" returns the
+ /// output at the first source image's own width and height (scaled
+ /// down, keeping its proportions, if it is too large for the model).
+ /// Every source image's aspect ratio must be between 1:6 and 6:1.
+ /// An exact size must have both sides a multiple of 32 and at least
+ /// 256px, a total of at most 2048x2048 pixels, and an aspect ratio of
+ /// at most 6:1. With source images, an exact size reshapes the source
+ /// to it.
+ /// Pricing is tiered by the resolved output pixels: up to 1024x1024
+ /// bills as 1K, above that as 2K. An "auto" size bills as 2K.
+ /// Default Value: auto + /// + /// + /// The output background. `transparent` returns images with an alpha channel, `opaque` returns a solid one, and `auto` decides for you.
+ /// Default Value: auto + /// + /// + /// The rendering quality to use. Higher quality takes longer and costs more. Defaults to `medium` with source images and `high` without. `very_low`, the fastest and cheapest, requires source images. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ImagesGeneratePostGenerateImageV2Ideogram45Request( + string prompt, + global::Ideogram.MagicPromptMode? magicPrompt, + global::System.Collections.Generic.IList? images, + byte[]? mask, + string? maskname, + string? size, + global::Ideogram.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaBackground? background, + global::Ideogram.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality? quality, + int? seed, + int? numImages, + bool? enableCopyrightDetection, + bool? async, + string? webhookUrl) + { + this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); + this.MagicPrompt = magicPrompt; + this.Images = images; + this.Mask = mask; + this.Maskname = maskname; + this.Size = size; + this.Background = background; + this.Quality = quality; + this.Seed = seed; + this.NumImages = numImages; + this.EnableCopyrightDetection = enableCopyrightDetection; + this.Async = async; + this.WebhookUrl = webhookUrl; + } + + /// + /// Initializes a new instance of the class. + /// + public ImagesGeneratePostGenerateImageV2Ideogram45Request() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2Ideogram45Response.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2Ideogram45Response.Json.g.cs new file mode 100644 index 00000000..b5a6cd75 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2Ideogram45Response.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2Ideogram45Response + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2Ideogram45Response? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2Ideogram45Response), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2Ideogram45Response; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2Ideogram45Response? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2Ideogram45Response? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2Ideogram45Response), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2Ideogram45Response; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2Ideogram45Response.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2Ideogram45Response.g.cs new file mode 100644 index 00000000..239c06be --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2Ideogram45Response.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2Ideogram45Response + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2Ideogram45Response2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2Ideogram45Response2.Json.g.cs new file mode 100644 index 00000000..302fbd59 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2Ideogram45Response2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2Ideogram45Response2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2Ideogram45Response2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2Ideogram45Response2), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2Ideogram45Response2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2Ideogram45Response2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2Ideogram45Response2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2Ideogram45Response2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2Ideogram45Response2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2Ideogram45Response2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2Ideogram45Response2.g.cs new file mode 100644 index 00000000..84868a23 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2Ideogram45Response2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2Ideogram45Response2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2Ideogram45Response3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2Ideogram45Response3.Json.g.cs new file mode 100644 index 00000000..8e08aef5 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2Ideogram45Response3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2Ideogram45Response3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2Ideogram45Response3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2Ideogram45Response3), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2Ideogram45Response3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2Ideogram45Response3? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2Ideogram45Response3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2Ideogram45Response3), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2Ideogram45Response3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2Ideogram45Response3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2Ideogram45Response3.g.cs new file mode 100644 index 00000000..24eee061 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2Ideogram45Response3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2Ideogram45Response3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2Ideogram45Response4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2Ideogram45Response4.Json.g.cs new file mode 100644 index 00000000..0a465003 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2Ideogram45Response4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2Ideogram45Response4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2Ideogram45Response4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2Ideogram45Response4), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2Ideogram45Response4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2Ideogram45Response4? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2Ideogram45Response4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2Ideogram45Response4), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2Ideogram45Response4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2Ideogram45Response4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2Ideogram45Response4.g.cs new file mode 100644 index 00000000..5d50c098 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2Ideogram45Response4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2Ideogram45Response4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2Ideogram45Response5.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2Ideogram45Response5.Json.g.cs new file mode 100644 index 00000000..1436f478 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2Ideogram45Response5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2Ideogram45Response5 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2Ideogram45Response5? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2Ideogram45Response5), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2Ideogram45Response5; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2Ideogram45Response5? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2Ideogram45Response5? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2Ideogram45Response5), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2Ideogram45Response5; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2Ideogram45Response5.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2Ideogram45Response5.g.cs new file mode 100644 index 00000000..8d0c5049 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2Ideogram45Response5.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2Ideogram45Response5 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse.Json.g.cs new file mode 100644 index 00000000..22567a44 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV2AResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse.g.cs new file mode 100644 index 00000000..f9654a73 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV2AResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse2.Json.g.cs new file mode 100644 index 00000000..d5eba1d4 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV2AResponse2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse2), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse2.g.cs new file mode 100644 index 00000000..e5c8f36e --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV2AResponse2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse3.Json.g.cs new file mode 100644 index 00000000..cd70c30d --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV2AResponse3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse3), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse3? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse3), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse3.g.cs new file mode 100644 index 00000000..9ef2c141 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV2AResponse3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse4.Json.g.cs new file mode 100644 index 00000000..c32d3b49 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV2AResponse4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse4), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse4? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse4), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse4.g.cs new file mode 100644 index 00000000..f4918953 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV2AResponse4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse5.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse5.Json.g.cs new file mode 100644 index 00000000..73349597 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV2AResponse5 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse5? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse5), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse5; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse5? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse5? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse5), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse5; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse5.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse5.g.cs new file mode 100644 index 00000000..c4016fef --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2AResponse5.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV2AResponse5 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2Response.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2Response.Json.g.cs new file mode 100644 index 00000000..9ef1ba14 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2Response.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV2Response + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2Response? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2Response), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2Response; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2Response? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2Response? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2Response), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2Response; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2Response.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2Response.g.cs new file mode 100644 index 00000000..ab226452 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2Response.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV2Response + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2Response2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2Response2.Json.g.cs new file mode 100644 index 00000000..7bb42984 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2Response2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV2Response2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2Response2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2Response2), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2Response2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2Response2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2Response2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2Response2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2Response2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2Response2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2Response2.g.cs new file mode 100644 index 00000000..c87e0ae1 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2Response2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV2Response2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2Response3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2Response3.Json.g.cs new file mode 100644 index 00000000..524b4bd3 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2Response3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV2Response3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2Response3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2Response3), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2Response3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2Response3? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2Response3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2Response3), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2Response3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2Response3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2Response3.g.cs new file mode 100644 index 00000000..e56a1db9 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2Response3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV2Response3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2Response4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2Response4.Json.g.cs new file mode 100644 index 00000000..69c7fe19 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2Response4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV2Response4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2Response4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2Response4), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2Response4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2Response4? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2Response4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2Response4), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2Response4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2Response4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2Response4.g.cs new file mode 100644 index 00000000..19b9b188 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2Response4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV2Response4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2Response5.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2Response5.Json.g.cs new file mode 100644 index 00000000..450c5ff2 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2Response5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV2Response5 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2Response5? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2Response5), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2Response5; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2Response5? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2Response5? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2Response5), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV2Response5; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2Response5.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2Response5.g.cs new file mode 100644 index 00000000..e9b32d9f --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV2Response5.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV2Response5 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterRequest.Json.g.cs new file mode 100644 index 00000000..88938de1 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV3CharacterRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterRequest), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterRequest? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterRequest.g.cs new file mode 100644 index 00000000..5da7a0f5 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterRequest.g.cs @@ -0,0 +1,248 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// + /// + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV3CharacterRequest + { + /// + /// The prompt to generate images from. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Prompt { get; set; } + + /// + /// Description of what to exclude from the images. The prompt takes precedence over the negative prompt. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("negative_prompt")] + public string? NegativePrompt { get; set; } + + /// + /// An image of the character to feature (max 25MB; JPEG, PNG, or WEBP). + /// + [global::System.Text.Json.Serialization.JsonPropertyName("character_reference_images")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList CharacterReferenceImages { get; set; } + + /// + /// Optional grayscale mask marking where the character is in the character reference image, at the same size as that image (JPEG, PNG, or WEBP). Multipart requests only. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("character_reference_mask")] + public byte[]? CharacterReferenceMask { get; set; } + + /// + /// Optional grayscale mask marking where the character is in the character reference image, at the same size as that image (JPEG, PNG, or WEBP). Multipart requests only. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("character_reference_maskname")] + public string? CharacterReferenceMaskname { get; set; } + + /// + /// Random seed. Set for reproducible generation. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("seed")] + public int? Seed { get; set; } + + /// + /// The resolutions supported for Ideogram 3.0. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ResolutionV3JsonConverter))] + public global::Ideogram.ResolutionV3? Resolution { get; set; } + + /// + /// The aspect ratio for an Ideogram 3.x or 2.x generation. `auto` lets the
+ /// model select a ratio from the prompt; any other value pins the ratio.
+ /// Cannot be combined with `resolution`. Omitting the field is not `auto`:
+ /// it uses `1x1`. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.IdeogramV3AspectRatioJsonConverter))] + public global::Ideogram.IdeogramV3AspectRatio? AspectRatio { get; set; } + + /// + /// The rendering speed to use.
+ /// Default Value: default + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("rendering_speed")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedJsonConverter))] + public global::Ideogram.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? RenderingSpeed { get; set; } + + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.MagicPromptModeJsonConverter))] + public global::Ideogram.MagicPromptMode? MagicPrompt { get; set; } + + /// + /// The number of images to generate.
+ /// Default Value: 1 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] + public int? NumImages { get; set; } + + /// + /// The style type to generate the character with. Defaults to `auto`.
+ /// Default Value: auto + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("style_type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleTypeJsonConverter))] + public global::Ideogram.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType? StyleType { get; set; } + + /// + /// Images to use as style references (max 10, max 25MB each; JPEG, PNG, or WEBP). + /// + [global::System.Text.Json.Serialization.JsonPropertyName("style_reference_images")] + public global::System.Collections.Generic.IList? StyleReferenceImages { get; set; } + + /// + /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("enable_copyright_detection")] + public bool? EnableCopyrightDetection { get; set; } + + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] + public string? WebhookUrl { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The prompt to generate images from. + /// + /// + /// An image of the character to feature (max 25MB; JPEG, PNG, or WEBP). + /// + /// + /// Description of what to exclude from the images. The prompt takes precedence over the negative prompt. + /// + /// + /// Optional grayscale mask marking where the character is in the character reference image, at the same size as that image (JPEG, PNG, or WEBP). Multipart requests only. + /// + /// + /// Optional grayscale mask marking where the character is in the character reference image, at the same size as that image (JPEG, PNG, or WEBP). Multipart requests only. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The resolutions supported for Ideogram 3.0. + /// + /// + /// The aspect ratio for an Ideogram 3.x or 2.x generation. `auto` lets the
+ /// model select a ratio from the prompt; any other value pins the ratio.
+ /// Cannot be combined with `resolution`. Omitting the field is not `auto`:
+ /// it uses `1x1`. + /// + /// + /// The rendering speed to use.
+ /// Default Value: default + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// The style type to generate the character with. Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// Images to use as style references (max 10, max 25MB each; JPEG, PNG, or WEBP). + /// + /// + /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ImagesGeneratePostGenerateImageV2IdeogramV3CharacterRequest( + string prompt, + global::System.Collections.Generic.IList characterReferenceImages, + string? negativePrompt, + byte[]? characterReferenceMask, + string? characterReferenceMaskname, + int? seed, + global::Ideogram.ResolutionV3? resolution, + global::Ideogram.IdeogramV3AspectRatio? aspectRatio, + global::Ideogram.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed, + global::Ideogram.MagicPromptMode? magicPrompt, + int? numImages, + global::Ideogram.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType? styleType, + global::System.Collections.Generic.IList? styleReferenceImages, + bool? enableCopyrightDetection, + bool? async, + string? webhookUrl) + { + this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); + this.NegativePrompt = negativePrompt; + this.CharacterReferenceImages = characterReferenceImages ?? throw new global::System.ArgumentNullException(nameof(characterReferenceImages)); + this.CharacterReferenceMask = characterReferenceMask; + this.CharacterReferenceMaskname = characterReferenceMaskname; + this.Seed = seed; + this.Resolution = resolution; + this.AspectRatio = aspectRatio; + this.RenderingSpeed = renderingSpeed; + this.MagicPrompt = magicPrompt; + this.NumImages = numImages; + this.StyleType = styleType; + this.StyleReferenceImages = styleReferenceImages; + this.EnableCopyrightDetection = enableCopyrightDetection; + this.Async = async; + this.WebhookUrl = webhookUrl; + } + + /// + /// Initializes a new instance of the class. + /// + public ImagesGeneratePostGenerateImageV2IdeogramV3CharacterRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse.Json.g.cs new file mode 100644 index 00000000..50074b6f --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse.g.cs new file mode 100644 index 00000000..01a58cd5 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse2.Json.g.cs new file mode 100644 index 00000000..a1cc5dde --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse2), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse2.g.cs new file mode 100644 index 00000000..32daa387 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse3.Json.g.cs new file mode 100644 index 00000000..81a2626d --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse3), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse3? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse3), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse3.g.cs new file mode 100644 index 00000000..61cb567a --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse4.Json.g.cs new file mode 100644 index 00000000..8ec04e35 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse4), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse4? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse4), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse4.g.cs new file mode 100644 index 00000000..2af3b503 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse5.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse5.Json.g.cs new file mode 100644 index 00000000..c1af2ecd --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse5 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse5? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse5), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse5; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse5? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse5? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse5), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse5; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse5.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse5.g.cs new file mode 100644 index 00000000..8f7ff27c --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse5.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse5 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse6.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse6.Json.g.cs new file mode 100644 index 00000000..eff92139 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse6.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse6 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse6? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse6), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse6; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse6? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse6? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse6), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse6; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse6.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse6.g.cs new file mode 100644 index 00000000..8a4988c2 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse6.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV3CharacterResponse6 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelRequest.Json.g.cs new file mode 100644 index 00000000..5b369ec3 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelRequest), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelRequest? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelRequest.g.cs new file mode 100644 index 00000000..8de2dd3c --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelRequest.g.cs @@ -0,0 +1,258 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// + /// + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelRequest + { + /// + /// The prompt to generate images from. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Prompt { get; set; } + + /// + /// The custom model URI, in the form `model/<model_name>/version/<version_name>`. You or your organization must have access to the model. The model determines which rendering speeds are supported and whether backgrounds are removed automatically. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("custom_model_uri")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string CustomModelUri { get; set; } + + /// + /// Remove the background after generation and return transparent PNG images. Included in the custom model generation price at no extra charge. When false, the model's automatic background removal behavior still applies.
+ /// Default Value: false + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("transparent_background")] + public bool? TransparentBackground { get; set; } + + /// + /// Description of what to exclude from the images. The prompt takes precedence over the negative prompt. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("negative_prompt")] + public string? NegativePrompt { get; set; } + + /// + /// Random seed. Set for reproducible generation. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("seed")] + public int? Seed { get; set; } + + /// + /// The resolutions supported for Ideogram 3.0. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ResolutionV3JsonConverter))] + public global::Ideogram.ResolutionV3? Resolution { get; set; } + + /// + /// The aspect ratio for an Ideogram 3.x or 2.x generation. `auto` lets the
+ /// model select a ratio from the prompt; any other value pins the ratio.
+ /// Cannot be combined with `resolution`. Omitting the field is not `auto`:
+ /// it uses `1x1`. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.IdeogramV3AspectRatioJsonConverter))] + public global::Ideogram.IdeogramV3AspectRatio? AspectRatio { get; set; } + + /// + /// The rendering speed to use. When omitted, a speed supported by the custom model is used. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("rendering_speed")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.V2ImageGenerateIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedJsonConverter))] + public global::Ideogram.V2ImageGenerateIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? RenderingSpeed { get; set; } + + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.MagicPromptModeJsonConverter))] + public global::Ideogram.MagicPromptMode? MagicPrompt { get; set; } + + /// + /// The number of images to generate.
+ /// Default Value: 1 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] + public int? NumImages { get; set; } + + /// + /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). + /// + [global::System.Text.Json.Serialization.JsonPropertyName("color_palette")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.IdeogramColorPaletteJsonConverter))] + public global::Ideogram.IdeogramColorPalette? ColorPalette { get; set; } + + /// + /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("style_codes")] + public global::System.Collections.Generic.IList? StyleCodes { get; set; } + + /// + /// A predefined style preset to apply to the generated images. Cannot be combined with style codes or style references. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("style_preset")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.IdeogramV3StylePresetJsonConverter))] + public global::Ideogram.IdeogramV3StylePreset? StylePreset { get; set; } + + /// + /// Images to use as style references (max 10, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("style_reference_images")] + public global::System.Collections.Generic.IList? StyleReferenceImages { get; set; } + + /// + /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("enable_copyright_detection")] + public bool? EnableCopyrightDetection { get; set; } + + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] + public string? WebhookUrl { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The prompt to generate images from. + /// + /// + /// The custom model URI, in the form `model/<model_name>/version/<version_name>`. You or your organization must have access to the model. The model determines which rendering speeds are supported and whether backgrounds are removed automatically. + /// + /// + /// Remove the background after generation and return transparent PNG images. Included in the custom model generation price at no extra charge. When false, the model's automatic background removal behavior still applies.
+ /// Default Value: false + /// + /// + /// Description of what to exclude from the images. The prompt takes precedence over the negative prompt. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The resolutions supported for Ideogram 3.0. + /// + /// + /// The aspect ratio for an Ideogram 3.x or 2.x generation. `auto` lets the
+ /// model select a ratio from the prompt; any other value pins the ratio.
+ /// Cannot be combined with `resolution`. Omitting the field is not `auto`:
+ /// it uses `1x1`. + /// + /// + /// The rendering speed to use. When omitted, a speed supported by the custom model is used. + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). + /// + /// + /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images. + /// + /// + /// A predefined style preset to apply to the generated images. Cannot be combined with style codes or style references. + /// + /// + /// Images to use as style references (max 10, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only. + /// + /// + /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelRequest( + string prompt, + string customModelUri, + bool? transparentBackground, + string? negativePrompt, + int? seed, + global::Ideogram.ResolutionV3? resolution, + global::Ideogram.IdeogramV3AspectRatio? aspectRatio, + global::Ideogram.V2ImageGenerateIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed, + global::Ideogram.MagicPromptMode? magicPrompt, + int? numImages, + global::Ideogram.IdeogramColorPalette? colorPalette, + global::System.Collections.Generic.IList? styleCodes, + global::Ideogram.IdeogramV3StylePreset? stylePreset, + global::System.Collections.Generic.IList? styleReferenceImages, + bool? enableCopyrightDetection, + bool? async, + string? webhookUrl) + { + this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); + this.CustomModelUri = customModelUri ?? throw new global::System.ArgumentNullException(nameof(customModelUri)); + this.TransparentBackground = transparentBackground; + this.NegativePrompt = negativePrompt; + this.Seed = seed; + this.Resolution = resolution; + this.AspectRatio = aspectRatio; + this.RenderingSpeed = renderingSpeed; + this.MagicPrompt = magicPrompt; + this.NumImages = numImages; + this.ColorPalette = colorPalette; + this.StyleCodes = styleCodes; + this.StylePreset = stylePreset; + this.StyleReferenceImages = styleReferenceImages; + this.EnableCopyrightDetection = enableCopyrightDetection; + this.Async = async; + this.WebhookUrl = webhookUrl; + } + + /// + /// Initializes a new instance of the class. + /// + public ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse.Json.g.cs new file mode 100644 index 00000000..c0683f76 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse.g.cs new file mode 100644 index 00000000..c4ae0c1e --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse2.Json.g.cs new file mode 100644 index 00000000..fa6083fa --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse2), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse2.g.cs new file mode 100644 index 00000000..d814e7b5 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse3.Json.g.cs new file mode 100644 index 00000000..d8508ccd --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse3), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse3? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse3), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse3.g.cs new file mode 100644 index 00000000..8299cea6 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse4.Json.g.cs new file mode 100644 index 00000000..58bd069b --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse4), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse4? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse4), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse4.g.cs new file mode 100644 index 00000000..5934bab0 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse5.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse5.Json.g.cs new file mode 100644 index 00000000..5fcf4084 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse5 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse5? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse5), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse5; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse5? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse5? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse5), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse5; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse5.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse5.g.cs new file mode 100644 index 00000000..8202bf83 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse5.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse5 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse6.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse6.Json.g.cs new file mode 100644 index 00000000..5ca5ebc8 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse6.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse6 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse6? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse6), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse6; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse6? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse6? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse6), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse6; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse6.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse6.g.cs new file mode 100644 index 00000000..a8a21d81 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse6.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse6 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse7.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse7.Json.g.cs new file mode 100644 index 00000000..f7c11abc --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse7.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse7 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse7? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse7), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse7; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse7? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse7? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse7), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse7; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse7.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse7.g.cs new file mode 100644 index 00000000..de5b3796 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse7.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV3CustomModelResponse7 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3Request.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3Request.Json.g.cs new file mode 100644 index 00000000..88d7b546 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3Request.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV3Request + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3Request? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3Request), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3Request; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3Request? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3Request? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3Request), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3Request; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3Request.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3Request.g.cs new file mode 100644 index 00000000..6d965729 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3Request.g.cs @@ -0,0 +1,249 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// + /// + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV3Request + { + /// + /// The prompt to generate images from. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Prompt { get; set; } + + /// + /// Description of what to exclude from the images. The prompt takes precedence over the negative prompt. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("negative_prompt")] + public string? NegativePrompt { get; set; } + + /// + /// Random seed. Set for reproducible generation. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("seed")] + public int? Seed { get; set; } + + /// + /// The resolutions supported for Ideogram 3.0. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ResolutionV3JsonConverter))] + public global::Ideogram.ResolutionV3? Resolution { get; set; } + + /// + /// The aspect ratio for an Ideogram 3.x or 2.x generation. `auto` lets the
+ /// model select a ratio from the prompt; any other value pins the ratio.
+ /// Cannot be combined with `resolution`. Omitting the field is not `auto`:
+ /// it uses `1x1`. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.IdeogramV3AspectRatioJsonConverter))] + public global::Ideogram.IdeogramV3AspectRatio? AspectRatio { get; set; } + + /// + /// The rendering speed to use.
+ /// Default Value: default + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("rendering_speed")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.V2ImageGenerateIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedJsonConverter))] + public global::Ideogram.V2ImageGenerateIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? RenderingSpeed { get; set; } + + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.MagicPromptModeJsonConverter))] + public global::Ideogram.MagicPromptMode? MagicPrompt { get; set; } + + /// + /// The number of images to generate.
+ /// Default Value: 1 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] + public int? NumImages { get; set; } + + /// + /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). + /// + [global::System.Text.Json.Serialization.JsonPropertyName("color_palette")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.IdeogramColorPaletteJsonConverter))] + public global::Ideogram.IdeogramColorPalette? ColorPalette { get; set; } + + /// + /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("style_codes")] + public global::System.Collections.Generic.IList? StyleCodes { get; set; } + + /// + /// The style type to generate with.
+ /// Default Value: general + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("style_type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.IdeogramV3StyleTypeJsonConverter))] + public global::Ideogram.IdeogramV3StyleType? StyleType { get; set; } + + /// + /// A predefined style preset to apply to the generated images. Cannot be combined with style codes or style references. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("style_preset")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.IdeogramV3StylePresetJsonConverter))] + public global::Ideogram.IdeogramV3StylePreset? StylePreset { get; set; } + + /// + /// Images to use as style references (max 10, max 25MB each; JPEG, PNG, or WEBP). + /// + [global::System.Text.Json.Serialization.JsonPropertyName("style_reference_images")] + public global::System.Collections.Generic.IList? StyleReferenceImages { get; set; } + + /// + /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("enable_copyright_detection")] + public bool? EnableCopyrightDetection { get; set; } + + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] + public string? WebhookUrl { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The prompt to generate images from. + /// + /// + /// Description of what to exclude from the images. The prompt takes precedence over the negative prompt. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The resolutions supported for Ideogram 3.0. + /// + /// + /// The aspect ratio for an Ideogram 3.x or 2.x generation. `auto` lets the
+ /// model select a ratio from the prompt; any other value pins the ratio.
+ /// Cannot be combined with `resolution`. Omitting the field is not `auto`:
+ /// it uses `1x1`. + /// + /// + /// The rendering speed to use.
+ /// Default Value: default + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). + /// + /// + /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images. + /// + /// + /// The style type to generate with.
+ /// Default Value: general + /// + /// + /// A predefined style preset to apply to the generated images. Cannot be combined with style codes or style references. + /// + /// + /// Images to use as style references (max 10, max 25MB each; JPEG, PNG, or WEBP). + /// + /// + /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ImagesGeneratePostGenerateImageV2IdeogramV3Request( + string prompt, + string? negativePrompt, + int? seed, + global::Ideogram.ResolutionV3? resolution, + global::Ideogram.IdeogramV3AspectRatio? aspectRatio, + global::Ideogram.V2ImageGenerateIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed, + global::Ideogram.MagicPromptMode? magicPrompt, + int? numImages, + global::Ideogram.IdeogramColorPalette? colorPalette, + global::System.Collections.Generic.IList? styleCodes, + global::Ideogram.IdeogramV3StyleType? styleType, + global::Ideogram.IdeogramV3StylePreset? stylePreset, + global::System.Collections.Generic.IList? styleReferenceImages, + bool? enableCopyrightDetection, + bool? async, + string? webhookUrl) + { + this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); + this.NegativePrompt = negativePrompt; + this.Seed = seed; + this.Resolution = resolution; + this.AspectRatio = aspectRatio; + this.RenderingSpeed = renderingSpeed; + this.MagicPrompt = magicPrompt; + this.NumImages = numImages; + this.ColorPalette = colorPalette; + this.StyleCodes = styleCodes; + this.StyleType = styleType; + this.StylePreset = stylePreset; + this.StyleReferenceImages = styleReferenceImages; + this.EnableCopyrightDetection = enableCopyrightDetection; + this.Async = async; + this.WebhookUrl = webhookUrl; + } + + /// + /// Initializes a new instance of the class. + /// + public ImagesGeneratePostGenerateImageV2IdeogramV3Request() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3Response.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3Response.Json.g.cs new file mode 100644 index 00000000..78f8be30 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3Response.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV3Response + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3Response? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3Response), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3Response; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3Response? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3Response? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3Response), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3Response; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3Response.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3Response.g.cs new file mode 100644 index 00000000..38a0affb --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3Response.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV3Response + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3Response2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3Response2.Json.g.cs new file mode 100644 index 00000000..0aa66bd6 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3Response2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV3Response2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3Response2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3Response2), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3Response2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3Response2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3Response2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3Response2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3Response2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3Response2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3Response2.g.cs new file mode 100644 index 00000000..d9ac540a --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3Response2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV3Response2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3Response3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3Response3.Json.g.cs new file mode 100644 index 00000000..275a0692 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3Response3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV3Response3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3Response3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3Response3), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3Response3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3Response3? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3Response3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3Response3), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3Response3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3Response3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3Response3.g.cs new file mode 100644 index 00000000..ab05520e --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3Response3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV3Response3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3Response4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3Response4.Json.g.cs new file mode 100644 index 00000000..1f794dab --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3Response4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV3Response4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3Response4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3Response4), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3Response4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3Response4? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3Response4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3Response4), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3Response4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3Response4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3Response4.g.cs new file mode 100644 index 00000000..a71888d0 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3Response4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV3Response4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3Response5.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3Response5.Json.g.cs new file mode 100644 index 00000000..381854c4 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3Response5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV3Response5 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3Response5? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3Response5), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3Response5; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3Response5? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3Response5? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3Response5), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3Response5; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3Response5.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3Response5.g.cs new file mode 100644 index 00000000..35381dbd --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3Response5.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV3Response5 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3Response6.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3Response6.Json.g.cs new file mode 100644 index 00000000..30d3743a --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3Response6.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV3Response6 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3Response6? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3Response6), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3Response6; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3Response6? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3Response6? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3Response6), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3Response6; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3Response6.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3Response6.g.cs new file mode 100644 index 00000000..06185f03 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3Response6.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV3Response6 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse.Json.g.cs new file mode 100644 index 00000000..62eb870a --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse.g.cs new file mode 100644 index 00000000..97ad9d77 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse2.Json.g.cs new file mode 100644 index 00000000..27706d26 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse2), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse2.g.cs new file mode 100644 index 00000000..54244edf --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse3.Json.g.cs new file mode 100644 index 00000000..be62f4ef --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse3), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse3? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse3), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse3.g.cs new file mode 100644 index 00000000..56f96ce7 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse4.Json.g.cs new file mode 100644 index 00000000..cef85524 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse4), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse4? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse4), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse4.g.cs new file mode 100644 index 00000000..3bf27359 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse5.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse5.Json.g.cs new file mode 100644 index 00000000..ea5c1616 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse5 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse5? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse5), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse5; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse5? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse5? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse5), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse5; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse5.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse5.g.cs new file mode 100644 index 00000000..aec0f162 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse5.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV3TransparentResponse5 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse.Json.g.cs new file mode 100644 index 00000000..625727b1 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse.g.cs new file mode 100644 index 00000000..b34c2f12 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse2.Json.g.cs new file mode 100644 index 00000000..d1f60605 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse2), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse2.g.cs new file mode 100644 index 00000000..7c75208d --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse3.Json.g.cs new file mode 100644 index 00000000..d8fd5840 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse3), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse3? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse3), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse3.g.cs new file mode 100644 index 00000000..38ea7e3f --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse4.Json.g.cs new file mode 100644 index 00000000..38cfbdd2 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse4), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse4? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse4), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse4.g.cs new file mode 100644 index 00000000..b036a44e --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse5.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse5.Json.g.cs new file mode 100644 index 00000000..a16d0dc7 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse5 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse5? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse5), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse5; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse5? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse5? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse5), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse5; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse5.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse5.g.cs new file mode 100644 index 00000000..c9b3f822 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse5.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse5 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse6.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse6.Json.g.cs new file mode 100644 index 00000000..0f8e6a39 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse6.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse6 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse6? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse6), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse6; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse6? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse6? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse6), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse6; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse6.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse6.g.cs new file mode 100644 index 00000000..d1347571 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse6.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV4CustomModelResponse6 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4Response.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4Response.Json.g.cs new file mode 100644 index 00000000..521f42e1 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4Response.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV4Response + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4Response? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4Response), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4Response; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4Response? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4Response? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4Response), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4Response; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4Response.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4Response.g.cs new file mode 100644 index 00000000..fcbc73a7 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4Response.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV4Response + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4Response2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4Response2.Json.g.cs new file mode 100644 index 00000000..a4eb41ae --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4Response2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV4Response2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4Response2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4Response2), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4Response2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4Response2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4Response2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4Response2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4Response2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4Response2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4Response2.g.cs new file mode 100644 index 00000000..561b189b --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4Response2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV4Response2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4Response3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4Response3.Json.g.cs new file mode 100644 index 00000000..f0a6afae --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4Response3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV4Response3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4Response3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4Response3), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4Response3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4Response3? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4Response3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4Response3), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4Response3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4Response3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4Response3.g.cs new file mode 100644 index 00000000..41e79304 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4Response3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV4Response3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4Response4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4Response4.Json.g.cs new file mode 100644 index 00000000..e2ceb996 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4Response4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV4Response4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4Response4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4Response4), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4Response4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4Response4? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4Response4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4Response4), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4Response4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4Response4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4Response4.g.cs new file mode 100644 index 00000000..34210ed9 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4Response4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV4Response4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4Response5.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4Response5.Json.g.cs new file mode 100644 index 00000000..1a9cdff4 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4Response5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV4Response5 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4Response5? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4Response5), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4Response5; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4Response5? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4Response5? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4Response5), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4Response5; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4Response5.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4Response5.g.cs new file mode 100644 index 00000000..ea2c80a5 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4Response5.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV4Response5 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse.Json.g.cs new file mode 100644 index 00000000..9fd79678 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse.g.cs new file mode 100644 index 00000000..b61bd4e3 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse2.Json.g.cs new file mode 100644 index 00000000..b3042bae --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse2), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse2.g.cs new file mode 100644 index 00000000..8d271f15 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse3.Json.g.cs new file mode 100644 index 00000000..47e93864 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse3), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse3? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse3), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse3.g.cs new file mode 100644 index 00000000..c7616f6c --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse4.Json.g.cs new file mode 100644 index 00000000..b506d20e --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse4), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse4? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse4), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse4.g.cs new file mode 100644 index 00000000..7f6b7122 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse5.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse5.Json.g.cs new file mode 100644 index 00000000..a200b3d1 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse5 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse5? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse5), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse5; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse5? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse5? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse5), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse5; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse5.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse5.g.cs new file mode 100644 index 00000000..6f9e4ad0 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse5.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2IdeogramV4TransparentResponse5 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana21Request.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana21Request.Json.g.cs new file mode 100644 index 00000000..5333ed23 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana21Request.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2NanoBanana21Request + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana21Request? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana21Request), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana21Request; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana21Request? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana21Request? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana21Request), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana21Request; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana21Request.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana21Request.g.cs new file mode 100644 index 00000000..67c7d59c --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana21Request.g.cs @@ -0,0 +1,148 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// + /// + public sealed partial class ImagesGeneratePostGenerateImageV2NanoBanana21Request + { + /// + /// The prompt to generate images from, or the edit instruction to apply when source images are supplied. It is passed to the model as written. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Prompt { get; set; } + + /// + /// Optional source images to edit (max 10, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("images")] + public global::System.Collections.Generic.IList? Images { get; set; } + + /// + /// Output aspect ratios Nano Banana 2.1 serves. `auto` lets the model choose the shape; an edit keeps its source image's shape.
+ /// Default Value: auto + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.NanoBanana21AspectRatioJsonConverter))] + public global::Ideogram.NanoBanana21AspectRatio? AspectRatio { get; set; } + + /// + /// The output resolution tier.
+ /// Default Value: 1K + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("resolution_tier")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.V2ImageGenerateNanoBanana21PostRequestBodyContentMultipartFormDataSchemaResolutionTierJsonConverter))] + public global::Ideogram.V2ImageGenerateNanoBanana21PostRequestBodyContentMultipartFormDataSchemaResolutionTier? ResolutionTier { get; set; } + + /// + /// The number of images to generate.
+ /// Default Value: 1 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] + public int? NumImages { get; set; } + + /// + /// Random seed. Set for reproducible generation. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("seed")] + public int? Seed { get; set; } + + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] + public string? WebhookUrl { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The prompt to generate images from, or the edit instruction to apply when source images are supplied. It is passed to the model as written. + /// + /// + /// Optional source images to edit (max 10, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only. + /// + /// + /// Output aspect ratios Nano Banana 2.1 serves. `auto` lets the model choose the shape; an edit keeps its source image's shape.
+ /// Default Value: auto + /// + /// + /// The output resolution tier.
+ /// Default Value: 1K + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ImagesGeneratePostGenerateImageV2NanoBanana21Request( + string prompt, + global::System.Collections.Generic.IList? images, + global::Ideogram.NanoBanana21AspectRatio? aspectRatio, + global::Ideogram.V2ImageGenerateNanoBanana21PostRequestBodyContentMultipartFormDataSchemaResolutionTier? resolutionTier, + int? numImages, + int? seed, + bool? async, + string? webhookUrl) + { + this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); + this.Images = images; + this.AspectRatio = aspectRatio; + this.ResolutionTier = resolutionTier; + this.NumImages = numImages; + this.Seed = seed; + this.Async = async; + this.WebhookUrl = webhookUrl; + } + + /// + /// Initializes a new instance of the class. + /// + public ImagesGeneratePostGenerateImageV2NanoBanana21Request() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana21Response.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana21Response.Json.g.cs new file mode 100644 index 00000000..7f73203d --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana21Response.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2NanoBanana21Response + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana21Response? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana21Response), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana21Response; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana21Response? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana21Response? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana21Response), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana21Response; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana21Response.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana21Response.g.cs new file mode 100644 index 00000000..a1a3df37 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana21Response.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2NanoBanana21Response + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana21Response2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana21Response2.Json.g.cs new file mode 100644 index 00000000..0e3db7cf --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana21Response2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2NanoBanana21Response2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana21Response2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana21Response2), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana21Response2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana21Response2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana21Response2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana21Response2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana21Response2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana21Response2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana21Response2.g.cs new file mode 100644 index 00000000..059e237a --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana21Response2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2NanoBanana21Response2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana21Response3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana21Response3.Json.g.cs new file mode 100644 index 00000000..7ce5041a --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana21Response3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2NanoBanana21Response3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana21Response3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana21Response3), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana21Response3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana21Response3? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana21Response3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana21Response3), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana21Response3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana21Response3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana21Response3.g.cs new file mode 100644 index 00000000..6a9c308a --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana21Response3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2NanoBanana21Response3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana21Response4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana21Response4.Json.g.cs new file mode 100644 index 00000000..5e824d70 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana21Response4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2NanoBanana21Response4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana21Response4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana21Response4), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana21Response4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana21Response4? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana21Response4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana21Response4), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana21Response4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana21Response4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana21Response4.g.cs new file mode 100644 index 00000000..c732f3f3 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana21Response4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2NanoBanana21Response4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana21Response5.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana21Response5.Json.g.cs new file mode 100644 index 00000000..5405e995 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana21Response5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2NanoBanana21Response5 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana21Response5? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana21Response5), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana21Response5; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana21Response5? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana21Response5? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana21Response5), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana21Response5; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana21Response5.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana21Response5.g.cs new file mode 100644 index 00000000..85d655af --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana21Response5.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2NanoBanana21Response5 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana2Request.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana2Request.Json.g.cs new file mode 100644 index 00000000..2c1dde00 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana2Request.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2NanoBanana2Request + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana2Request? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana2Request), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana2Request; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana2Request? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana2Request? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana2Request), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana2Request; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana2Request.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana2Request.g.cs new file mode 100644 index 00000000..dbfe2336 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana2Request.g.cs @@ -0,0 +1,148 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// + /// + public sealed partial class ImagesGeneratePostGenerateImageV2NanoBanana2Request + { + /// + /// The prompt to generate images from, or the edit instruction to apply when source images are supplied. It is passed to the model as written. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Prompt { get; set; } + + /// + /// Optional source images to edit (max 10, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("images")] + public global::System.Collections.Generic.IList? Images { get; set; } + + /// + /// Output aspect ratios Nano Banana 2 serves. `auto` lets the model choose the shape; an edit keeps its source image's shape.
+ /// Default Value: auto + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.NanoBanana2AspectRatioJsonConverter))] + public global::Ideogram.NanoBanana2AspectRatio? AspectRatio { get; set; } + + /// + /// The output resolution tier.
+ /// Default Value: 1K + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("resolution_tier")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.V2ImageGenerateNanoBanana2PostRequestBodyContentMultipartFormDataSchemaResolutionTierJsonConverter))] + public global::Ideogram.V2ImageGenerateNanoBanana2PostRequestBodyContentMultipartFormDataSchemaResolutionTier? ResolutionTier { get; set; } + + /// + /// The number of images to generate.
+ /// Default Value: 1 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] + public int? NumImages { get; set; } + + /// + /// Random seed. Set for reproducible generation. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("seed")] + public int? Seed { get; set; } + + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] + public string? WebhookUrl { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The prompt to generate images from, or the edit instruction to apply when source images are supplied. It is passed to the model as written. + /// + /// + /// Optional source images to edit (max 10, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only. + /// + /// + /// Output aspect ratios Nano Banana 2 serves. `auto` lets the model choose the shape; an edit keeps its source image's shape.
+ /// Default Value: auto + /// + /// + /// The output resolution tier.
+ /// Default Value: 1K + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ImagesGeneratePostGenerateImageV2NanoBanana2Request( + string prompt, + global::System.Collections.Generic.IList? images, + global::Ideogram.NanoBanana2AspectRatio? aspectRatio, + global::Ideogram.V2ImageGenerateNanoBanana2PostRequestBodyContentMultipartFormDataSchemaResolutionTier? resolutionTier, + int? numImages, + int? seed, + bool? async, + string? webhookUrl) + { + this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); + this.Images = images; + this.AspectRatio = aspectRatio; + this.ResolutionTier = resolutionTier; + this.NumImages = numImages; + this.Seed = seed; + this.Async = async; + this.WebhookUrl = webhookUrl; + } + + /// + /// Initializes a new instance of the class. + /// + public ImagesGeneratePostGenerateImageV2NanoBanana2Request() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana2Response.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana2Response.Json.g.cs new file mode 100644 index 00000000..f8920f44 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana2Response.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2NanoBanana2Response + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana2Response? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana2Response), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana2Response; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana2Response? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana2Response? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana2Response), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana2Response; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana2Response.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana2Response.g.cs new file mode 100644 index 00000000..bfa5212b --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana2Response.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2NanoBanana2Response + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana2Response2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana2Response2.Json.g.cs new file mode 100644 index 00000000..9f6b3d51 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana2Response2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2NanoBanana2Response2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana2Response2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana2Response2), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana2Response2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana2Response2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana2Response2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana2Response2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana2Response2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana2Response2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana2Response2.g.cs new file mode 100644 index 00000000..4441dc78 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana2Response2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2NanoBanana2Response2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana2Response3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana2Response3.Json.g.cs new file mode 100644 index 00000000..44436f38 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana2Response3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2NanoBanana2Response3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana2Response3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana2Response3), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana2Response3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana2Response3? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana2Response3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana2Response3), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana2Response3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana2Response3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana2Response3.g.cs new file mode 100644 index 00000000..0dc5e4ae --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana2Response3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2NanoBanana2Response3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana2Response4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana2Response4.Json.g.cs new file mode 100644 index 00000000..02de92e3 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana2Response4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2NanoBanana2Response4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana2Response4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana2Response4), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana2Response4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana2Response4? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana2Response4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana2Response4), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana2Response4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana2Response4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana2Response4.g.cs new file mode 100644 index 00000000..d29b0f6a --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana2Response4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2NanoBanana2Response4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana2Response5.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana2Response5.Json.g.cs new file mode 100644 index 00000000..6b9bf461 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana2Response5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2NanoBanana2Response5 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana2Response5? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana2Response5), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana2Response5; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana2Response5? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana2Response5? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana2Response5), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBanana2Response5; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana2Response5.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana2Response5.g.cs new file mode 100644 index 00000000..f82daaad --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBanana2Response5.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2NanoBanana2Response5 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBananaProRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBananaProRequest.Json.g.cs new file mode 100644 index 00000000..95fdd038 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBananaProRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2NanoBananaProRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBananaProRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBananaProRequest), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBananaProRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBananaProRequest? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBananaProRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBananaProRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBananaProRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBananaProRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBananaProRequest.g.cs new file mode 100644 index 00000000..91610cb0 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBananaProRequest.g.cs @@ -0,0 +1,148 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// + /// + public sealed partial class ImagesGeneratePostGenerateImageV2NanoBananaProRequest + { + /// + /// The prompt to generate images from, or the edit instruction to apply when source images are supplied. It is passed to the model as written. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Prompt { get; set; } + + /// + /// Optional source images to edit (max 10, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("images")] + public global::System.Collections.Generic.IList? Images { get; set; } + + /// + /// Output aspect ratios Nano Banana Pro serves. `auto` lets the model choose the shape; an edit keeps its source image's shape.
+ /// Default Value: auto + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.NanoBananaProAspectRatioJsonConverter))] + public global::Ideogram.NanoBananaProAspectRatio? AspectRatio { get; set; } + + /// + /// The output resolution tier.
+ /// Default Value: 1K + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("resolution_tier")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.V2ImageGenerateNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTierJsonConverter))] + public global::Ideogram.V2ImageGenerateNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier? ResolutionTier { get; set; } + + /// + /// The number of images to generate.
+ /// Default Value: 1 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] + public int? NumImages { get; set; } + + /// + /// Random seed. Set for reproducible generation. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("seed")] + public int? Seed { get; set; } + + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] + public string? WebhookUrl { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The prompt to generate images from, or the edit instruction to apply when source images are supplied. It is passed to the model as written. + /// + /// + /// Optional source images to edit (max 10, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only. + /// + /// + /// Output aspect ratios Nano Banana Pro serves. `auto` lets the model choose the shape; an edit keeps its source image's shape.
+ /// Default Value: auto + /// + /// + /// The output resolution tier.
+ /// Default Value: 1K + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ImagesGeneratePostGenerateImageV2NanoBananaProRequest( + string prompt, + global::System.Collections.Generic.IList? images, + global::Ideogram.NanoBananaProAspectRatio? aspectRatio, + global::Ideogram.V2ImageGenerateNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier? resolutionTier, + int? numImages, + int? seed, + bool? async, + string? webhookUrl) + { + this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); + this.Images = images; + this.AspectRatio = aspectRatio; + this.ResolutionTier = resolutionTier; + this.NumImages = numImages; + this.Seed = seed; + this.Async = async; + this.WebhookUrl = webhookUrl; + } + + /// + /// Initializes a new instance of the class. + /// + public ImagesGeneratePostGenerateImageV2NanoBananaProRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBananaProResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBananaProResponse.Json.g.cs new file mode 100644 index 00000000..3a249a79 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBananaProResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2NanoBananaProResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBananaProResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBananaProResponse), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBananaProResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBananaProResponse? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBananaProResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBananaProResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBananaProResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBananaProResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBananaProResponse.g.cs new file mode 100644 index 00000000..cdb302af --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBananaProResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2NanoBananaProResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBananaProResponse2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBananaProResponse2.Json.g.cs new file mode 100644 index 00000000..9a24a14d --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBananaProResponse2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2NanoBananaProResponse2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBananaProResponse2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBananaProResponse2), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBananaProResponse2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBananaProResponse2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBananaProResponse2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBananaProResponse2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBananaProResponse2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBananaProResponse2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBananaProResponse2.g.cs new file mode 100644 index 00000000..4fcc43e4 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBananaProResponse2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2NanoBananaProResponse2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBananaProResponse3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBananaProResponse3.Json.g.cs new file mode 100644 index 00000000..e967200b --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBananaProResponse3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2NanoBananaProResponse3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBananaProResponse3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBananaProResponse3), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBananaProResponse3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBananaProResponse3? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBananaProResponse3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBananaProResponse3), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBananaProResponse3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBananaProResponse3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBananaProResponse3.g.cs new file mode 100644 index 00000000..28035322 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBananaProResponse3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2NanoBananaProResponse3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBananaProResponse4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBananaProResponse4.Json.g.cs new file mode 100644 index 00000000..060df767 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBananaProResponse4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2NanoBananaProResponse4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBananaProResponse4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBananaProResponse4), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBananaProResponse4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBananaProResponse4? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBananaProResponse4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBananaProResponse4), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBananaProResponse4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBananaProResponse4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBananaProResponse4.g.cs new file mode 100644 index 00000000..1c3fac4c --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBananaProResponse4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2NanoBananaProResponse4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBananaProResponse5.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBananaProResponse5.Json.g.cs new file mode 100644 index 00000000..38d07b55 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBananaProResponse5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2NanoBananaProResponse5 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBananaProResponse5? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBananaProResponse5), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBananaProResponse5; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBananaProResponse5? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBananaProResponse5? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBananaProResponse5), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2NanoBananaProResponse5; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBananaProResponse5.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBananaProResponse5.g.cs new file mode 100644 index 00000000..db533dc6 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2NanoBananaProResponse5.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2NanoBananaProResponse5 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse.Json.g.cs new file mode 100644 index 00000000..3407388e --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2PImageIdeogramResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse.g.cs new file mode 100644 index 00000000..13c46d53 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2PImageIdeogramResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse2.Json.g.cs new file mode 100644 index 00000000..c3ae5232 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2PImageIdeogramResponse2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse2), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse2.g.cs new file mode 100644 index 00000000..09e82305 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2PImageIdeogramResponse2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse3.Json.g.cs new file mode 100644 index 00000000..3a57b0d9 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2PImageIdeogramResponse3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse3), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse3? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse3), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse3.g.cs new file mode 100644 index 00000000..fe9b2c83 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2PImageIdeogramResponse3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse4.Json.g.cs new file mode 100644 index 00000000..8f50a53f --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2PImageIdeogramResponse4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse4), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse4? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse4), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse4.g.cs new file mode 100644 index 00000000..ccbc69d4 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2PImageIdeogramResponse4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse5.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse5.Json.g.cs new file mode 100644 index 00000000..6b996471 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2PImageIdeogramResponse5 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse5? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse5), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse5; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse5? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse5? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse5), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse5; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse5.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse5.g.cs new file mode 100644 index 00000000..54a4c817 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2PImageIdeogramResponse5.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2PImageIdeogramResponse5 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2ZImageResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2ZImageResponse.Json.g.cs new file mode 100644 index 00000000..4d0fef80 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2ZImageResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2ZImageResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2ZImageResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2ZImageResponse), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2ZImageResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2ZImageResponse? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2ZImageResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2ZImageResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2ZImageResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2ZImageResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2ZImageResponse.g.cs new file mode 100644 index 00000000..c39c4fd7 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2ZImageResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2ZImageResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2ZImageResponse2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2ZImageResponse2.Json.g.cs new file mode 100644 index 00000000..3f25a27f --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2ZImageResponse2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2ZImageResponse2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2ZImageResponse2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2ZImageResponse2), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2ZImageResponse2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2ZImageResponse2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2ZImageResponse2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2ZImageResponse2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2ZImageResponse2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2ZImageResponse2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2ZImageResponse2.g.cs new file mode 100644 index 00000000..70162b9d --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2ZImageResponse2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2ZImageResponse2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2ZImageResponse3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2ZImageResponse3.Json.g.cs new file mode 100644 index 00000000..17bfdd36 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2ZImageResponse3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2ZImageResponse3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2ZImageResponse3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2ZImageResponse3), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2ZImageResponse3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2ZImageResponse3? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2ZImageResponse3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2ZImageResponse3), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2ZImageResponse3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2ZImageResponse3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2ZImageResponse3.g.cs new file mode 100644 index 00000000..80813d46 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2ZImageResponse3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2ZImageResponse3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2ZImageResponse4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2ZImageResponse4.Json.g.cs new file mode 100644 index 00000000..e9b29235 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2ZImageResponse4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2ZImageResponse4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2ZImageResponse4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2ZImageResponse4), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2ZImageResponse4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2ZImageResponse4? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2ZImageResponse4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2ZImageResponse4), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2ZImageResponse4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2ZImageResponse4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2ZImageResponse4.g.cs new file mode 100644 index 00000000..a2ae2889 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2ZImageResponse4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2ZImageResponse4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2ZImageResponse5.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2ZImageResponse5.Json.g.cs new file mode 100644 index 00000000..989e0032 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2ZImageResponse5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesGeneratePostGenerateImageV2ZImageResponse5 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2ZImageResponse5? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2ZImageResponse5), + jsonSerializerContext) as global::Ideogram.ImagesGeneratePostGenerateImageV2ZImageResponse5; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesGeneratePostGenerateImageV2ZImageResponse5? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesGeneratePostGenerateImageV2ZImageResponse5? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesGeneratePostGenerateImageV2ZImageResponse5), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesGeneratePostGenerateImageV2ZImageResponse5; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2ZImageResponse5.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2ZImageResponse5.g.cs new file mode 100644 index 00000000..403b1e1e --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesGeneratePostGenerateImageV2ZImageResponse5.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesGeneratePostGenerateImageV2ZImageResponse5 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterRequest.Json.g.cs new file mode 100644 index 00000000..0bc1e367 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesInpaintPostInpaintImageV2IdeogramV3CharacterRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterRequest), + jsonSerializerContext) as global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterRequest? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterRequest.g.cs new file mode 100644 index 00000000..6ebd38f3 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterRequest.g.cs @@ -0,0 +1,266 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// + /// + public sealed partial class ImagesInpaintPostInpaintImageV2IdeogramV3CharacterRequest + { + /// + /// The prompt describing the repainted result. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Prompt { get; set; } + + /// + /// The source image to repaint (max 25MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The output matches its size, snapped to the nearest supported resolution. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("image")] + [global::System.Text.Json.Serialization.JsonRequired] + public required byte[] Image { get; set; } + + /// + /// The source image to repaint (max 25MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The output matches its size, snapped to the nearest supported resolution. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Imagename { get; set; } + + /// + /// A black-and-white mask the same size as the source image. Black marks the region to repaint. JPEG, PNG, and WEBP are supported. Multipart requests only. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("mask")] + [global::System.Text.Json.Serialization.JsonRequired] + public required byte[] Mask { get; set; } + + /// + /// A black-and-white mask the same size as the source image. Black marks the region to repaint. JPEG, PNG, and WEBP are supported. Multipart requests only. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("maskname")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Maskname { get; set; } + + /// + /// An image to use as the character reference (max 25MB). JPEG, PNG, and WEBP are supported. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("character_reference_images")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList CharacterReferenceImages { get; set; } + + /// + /// Optional grayscale mask for the character reference image, the same size as that image, marking where the character is. Only JPEG, PNG, and WEBP formats are supported. Multipart requests only; cannot be combined with `character_reference_collection_id`. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("character_reference_mask")] + public byte[]? CharacterReferenceMask { get; set; } + + /// + /// Optional grayscale mask for the character reference image, the same size as that image, marking where the character is. Only JPEG, PNG, and WEBP formats are supported. Multipart requests only; cannot be combined with `character_reference_collection_id`. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("character_reference_maskname")] + public string? CharacterReferenceMaskname { get; set; } + + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.MagicPromptModeJsonConverter))] + public global::Ideogram.MagicPromptMode? MagicPrompt { get; set; } + + /// + /// The number of images to generate.
+ /// Default Value: 1 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] + public int? NumImages { get; set; } + + /// + /// Random seed. Set for reproducible generation. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("seed")] + public int? Seed { get; set; } + + /// + /// The rendering speed to use.
+ /// Default Value: default + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("rendering_speed")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedJsonConverter))] + public global::Ideogram.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? RenderingSpeed { get; set; } + + /// + /// The style type to repaint the character with. Defaults to `auto`. `realistic` and `fiction` are supported for character-only requests; style codes or style references (not both) require `auto`. For API-key callers, combining a style with a character requires that feature to be enabled for their account.
+ /// Default Value: auto + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("style_type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleTypeJsonConverter))] + public global::Ideogram.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType? StyleType { get; set; } + + /// + /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("style_codes")] + public global::System.Collections.Generic.IList? StyleCodes { get; set; } + + /// + /// Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported. Cannot be combined with `style_codes`. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("style_reference_images")] + public global::System.Collections.Generic.IList? StyleReferenceImages { get; set; } + + /// + /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("enable_copyright_detection")] + public bool? EnableCopyrightDetection { get; set; } + + /// + /// When false (the default), the request waits until the repainted images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
+ /// Default Value: false + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] + public string? WebhookUrl { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The prompt describing the repainted result. + /// + /// + /// The source image to repaint (max 25MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The output matches its size, snapped to the nearest supported resolution. + /// + /// + /// The source image to repaint (max 25MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The output matches its size, snapped to the nearest supported resolution. + /// + /// + /// A black-and-white mask the same size as the source image. Black marks the region to repaint. JPEG, PNG, and WEBP are supported. Multipart requests only. + /// + /// + /// A black-and-white mask the same size as the source image. Black marks the region to repaint. JPEG, PNG, and WEBP are supported. Multipart requests only. + /// + /// + /// An image to use as the character reference (max 25MB). JPEG, PNG, and WEBP are supported. + /// + /// + /// Optional grayscale mask for the character reference image, the same size as that image, marking where the character is. Only JPEG, PNG, and WEBP formats are supported. Multipart requests only; cannot be combined with `character_reference_collection_id`. + /// + /// + /// Optional grayscale mask for the character reference image, the same size as that image, marking where the character is. Only JPEG, PNG, and WEBP formats are supported. Multipart requests only; cannot be combined with `character_reference_collection_id`. + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The rendering speed to use.
+ /// Default Value: default + /// + /// + /// The style type to repaint the character with. Defaults to `auto`. `realistic` and `fiction` are supported for character-only requests; style codes or style references (not both) require `auto`. For API-key callers, combining a style with a character requires that feature to be enabled for their account.
+ /// Default Value: auto + /// + /// + /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images. + /// + /// + /// Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported. Cannot be combined with `style_codes`. + /// + /// + /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the repainted images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ImagesInpaintPostInpaintImageV2IdeogramV3CharacterRequest( + string prompt, + byte[] image, + string imagename, + byte[] mask, + string maskname, + global::System.Collections.Generic.IList characterReferenceImages, + byte[]? characterReferenceMask, + string? characterReferenceMaskname, + global::Ideogram.MagicPromptMode? magicPrompt, + int? numImages, + int? seed, + global::Ideogram.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed, + global::Ideogram.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType? styleType, + global::System.Collections.Generic.IList? styleCodes, + global::System.Collections.Generic.IList? styleReferenceImages, + bool? enableCopyrightDetection, + bool? async, + string? webhookUrl) + { + this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); + this.Image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + this.Imagename = imagename ?? throw new global::System.ArgumentNullException(nameof(imagename)); + this.Mask = mask ?? throw new global::System.ArgumentNullException(nameof(mask)); + this.Maskname = maskname ?? throw new global::System.ArgumentNullException(nameof(maskname)); + this.CharacterReferenceImages = characterReferenceImages ?? throw new global::System.ArgumentNullException(nameof(characterReferenceImages)); + this.CharacterReferenceMask = characterReferenceMask; + this.CharacterReferenceMaskname = characterReferenceMaskname; + this.MagicPrompt = magicPrompt; + this.NumImages = numImages; + this.Seed = seed; + this.RenderingSpeed = renderingSpeed; + this.StyleType = styleType; + this.StyleCodes = styleCodes; + this.StyleReferenceImages = styleReferenceImages; + this.EnableCopyrightDetection = enableCopyrightDetection; + this.Async = async; + this.WebhookUrl = webhookUrl; + } + + /// + /// Initializes a new instance of the class. + /// + public ImagesInpaintPostInpaintImageV2IdeogramV3CharacterRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse.Json.g.cs new file mode 100644 index 00000000..c7e651d4 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse), + jsonSerializerContext) as global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse.g.cs new file mode 100644 index 00000000..b12b48a6 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse2.Json.g.cs new file mode 100644 index 00000000..5fb7760f --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse2), + jsonSerializerContext) as global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse2.g.cs new file mode 100644 index 00000000..14925231 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse3.Json.g.cs new file mode 100644 index 00000000..25c29214 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse3), + jsonSerializerContext) as global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse3? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse3), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse3.g.cs new file mode 100644 index 00000000..68ab6b26 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse4.Json.g.cs new file mode 100644 index 00000000..eed84f54 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse4), + jsonSerializerContext) as global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse4? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse4), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse4.g.cs new file mode 100644 index 00000000..c0962541 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse5.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse5.Json.g.cs new file mode 100644 index 00000000..899313d6 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse5 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse5? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse5), + jsonSerializerContext) as global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse5; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse5? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse5? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse5), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse5; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse5.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse5.g.cs new file mode 100644 index 00000000..7a463313 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse5.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse5 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse6.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse6.Json.g.cs new file mode 100644 index 00000000..6d4b0671 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse6.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse6 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse6? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse6), + jsonSerializerContext) as global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse6; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse6? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse6? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse6), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse6; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse6.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse6.g.cs new file mode 100644 index 00000000..638d50b4 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse6.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesInpaintPostInpaintImageV2IdeogramV3CharacterResponse6 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelRequest.Json.g.cs new file mode 100644 index 00000000..7f6fcd08 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelRequest), + jsonSerializerContext) as global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelRequest? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelRequest.g.cs new file mode 100644 index 00000000..41374fe8 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelRequest.g.cs @@ -0,0 +1,215 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// + /// + public sealed partial class ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelRequest + { + /// + /// The prompt describing the repainted result. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Prompt { get; set; } + + /// + /// The custom model URI returned by the custom-model API, in the form `model/<model_name>/version/<version_name>`. The authenticated user or organization must have access to the model. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("custom_model_uri")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string CustomModelUri { get; set; } + + /// + /// The source image to repaint (max 25MB), as JPEG, PNG, or WEBP. Multipart requests only. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("image")] + [global::System.Text.Json.Serialization.JsonRequired] + public required byte[] Image { get; set; } + + /// + /// The source image to repaint (max 25MB), as JPEG, PNG, or WEBP. Multipart requests only. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Imagename { get; set; } + + /// + /// A black-and-white mask the same size as the source image, as JPEG, PNG, or WEBP. Black marks the region to repaint. Multipart requests only. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("mask")] + [global::System.Text.Json.Serialization.JsonRequired] + public required byte[] Mask { get; set; } + + /// + /// A black-and-white mask the same size as the source image, as JPEG, PNG, or WEBP. Black marks the region to repaint. Multipart requests only. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("maskname")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Maskname { get; set; } + + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.MagicPromptModeJsonConverter))] + public global::Ideogram.MagicPromptMode? MagicPrompt { get; set; } + + /// + /// The number of images to generate.
+ /// Default Value: 1 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] + public int? NumImages { get; set; } + + /// + /// Random seed. Set for reproducible generation. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("seed")] + public int? Seed { get; set; } + + /// + /// The rendering speed to use. When omitted, the server chooses a speed supported by the selected custom model. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("rendering_speed")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.V2ImageInpaintIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedJsonConverter))] + public global::Ideogram.V2ImageInpaintIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? RenderingSpeed { get; set; } + + /// + /// A predefined style preset. Cannot be combined with style codes or style references. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("style_preset")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.IdeogramV3StylePresetJsonConverter))] + public global::Ideogram.IdeogramV3StylePreset? StylePreset { get; set; } + + /// + /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("style_codes")] + public global::System.Collections.Generic.IList? StyleCodes { get; set; } + + /// + /// Images to use as style references (max 10, max 25MB each), as JPEG, PNG, or WEBP. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("style_reference_images")] + public global::System.Collections.Generic.IList? StyleReferenceImages { get; set; } + + /// + /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images return `is_image_safe: false`. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("enable_copyright_detection")] + public bool? EnableCopyrightDetection { get; set; } + + /// + /// When false, wait until the images are ready. When true, return as soon as the request is accepted and poll `GET /v2/generations/{generation_id}`.
+ /// Default Value: false + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The prompt describing the repainted result. + /// + /// + /// The custom model URI returned by the custom-model API, in the form `model/<model_name>/version/<version_name>`. The authenticated user or organization must have access to the model. + /// + /// + /// The source image to repaint (max 25MB), as JPEG, PNG, or WEBP. Multipart requests only. + /// + /// + /// The source image to repaint (max 25MB), as JPEG, PNG, or WEBP. Multipart requests only. + /// + /// + /// A black-and-white mask the same size as the source image, as JPEG, PNG, or WEBP. Black marks the region to repaint. Multipart requests only. + /// + /// + /// A black-and-white mask the same size as the source image, as JPEG, PNG, or WEBP. Black marks the region to repaint. Multipart requests only. + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The rendering speed to use. When omitted, the server chooses a speed supported by the selected custom model. + /// + /// + /// A predefined style preset. Cannot be combined with style codes or style references. + /// + /// + /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images. + /// + /// + /// Images to use as style references (max 10, max 25MB each), as JPEG, PNG, or WEBP. + /// + /// + /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images return `is_image_safe: false`. + /// + /// + /// When false, wait until the images are ready. When true, return as soon as the request is accepted and poll `GET /v2/generations/{generation_id}`.
+ /// Default Value: false + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelRequest( + string prompt, + string customModelUri, + byte[] image, + string imagename, + byte[] mask, + string maskname, + global::Ideogram.MagicPromptMode? magicPrompt, + int? numImages, + int? seed, + global::Ideogram.V2ImageInpaintIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed, + global::Ideogram.IdeogramV3StylePreset? stylePreset, + global::System.Collections.Generic.IList? styleCodes, + global::System.Collections.Generic.IList? styleReferenceImages, + bool? enableCopyrightDetection, + bool? async) + { + this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); + this.CustomModelUri = customModelUri ?? throw new global::System.ArgumentNullException(nameof(customModelUri)); + this.Image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + this.Imagename = imagename ?? throw new global::System.ArgumentNullException(nameof(imagename)); + this.Mask = mask ?? throw new global::System.ArgumentNullException(nameof(mask)); + this.Maskname = maskname ?? throw new global::System.ArgumentNullException(nameof(maskname)); + this.MagicPrompt = magicPrompt; + this.NumImages = numImages; + this.Seed = seed; + this.RenderingSpeed = renderingSpeed; + this.StylePreset = stylePreset; + this.StyleCodes = styleCodes; + this.StyleReferenceImages = styleReferenceImages; + this.EnableCopyrightDetection = enableCopyrightDetection; + this.Async = async; + } + + /// + /// Initializes a new instance of the class. + /// + public ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse.Json.g.cs new file mode 100644 index 00000000..eda6a29e --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse), + jsonSerializerContext) as global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse.g.cs new file mode 100644 index 00000000..1f11da93 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse2.Json.g.cs new file mode 100644 index 00000000..ab1e77fc --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse2), + jsonSerializerContext) as global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse2.g.cs new file mode 100644 index 00000000..38db35dd --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse3.Json.g.cs new file mode 100644 index 00000000..c43c6d91 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse3), + jsonSerializerContext) as global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse3? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse3), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse3.g.cs new file mode 100644 index 00000000..d2df364a --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse4.Json.g.cs new file mode 100644 index 00000000..a392e660 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse4), + jsonSerializerContext) as global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse4? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse4), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse4.g.cs new file mode 100644 index 00000000..367cf0e3 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse5.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse5.Json.g.cs new file mode 100644 index 00000000..d451f1dc --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse5 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse5? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse5), + jsonSerializerContext) as global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse5; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse5? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse5? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse5), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse5; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse5.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse5.g.cs new file mode 100644 index 00000000..8b7b0cc5 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse5.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse5 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse6.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse6.Json.g.cs new file mode 100644 index 00000000..81eb15ec --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse6.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse6 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse6? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse6), + jsonSerializerContext) as global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse6; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse6? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse6? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse6), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse6; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse6.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse6.g.cs new file mode 100644 index 00000000..36cba1fe --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse6.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse6 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse7.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse7.Json.g.cs new file mode 100644 index 00000000..c3a137db --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse7.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse7 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse7? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse7), + jsonSerializerContext) as global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse7; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse7? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse7? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse7), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse7; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse7.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse7.g.cs new file mode 100644 index 00000000..aae49b3f --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse7.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesInpaintPostInpaintImageV2IdeogramV3CustomModelResponse7 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3Request.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3Request.Json.g.cs new file mode 100644 index 00000000..20c01efc --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3Request.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesInpaintPostInpaintImageV2IdeogramV3Request + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3Request? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3Request), + jsonSerializerContext) as global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3Request; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3Request? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3Request? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3Request), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3Request; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3Request.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3Request.g.cs new file mode 100644 index 00000000..0334689b --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3Request.g.cs @@ -0,0 +1,244 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// + /// + public sealed partial class ImagesInpaintPostInpaintImageV2IdeogramV3Request + { + /// + /// The prompt describing the repainted result. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Prompt { get; set; } + + /// + /// The source image to repaint (max 25MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The output matches its size, snapped to the nearest supported resolution. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("image")] + [global::System.Text.Json.Serialization.JsonRequired] + public required byte[] Image { get; set; } + + /// + /// The source image to repaint (max 25MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The output matches its size, snapped to the nearest supported resolution. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Imagename { get; set; } + + /// + /// A black-and-white mask the same size as the source image. Black marks the region to repaint. JPEG, PNG, and WEBP are supported. Multipart requests only. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("mask")] + [global::System.Text.Json.Serialization.JsonRequired] + public required byte[] Mask { get; set; } + + /// + /// A black-and-white mask the same size as the source image. Black marks the region to repaint. JPEG, PNG, and WEBP are supported. Multipart requests only. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("maskname")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Maskname { get; set; } + + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.MagicPromptModeJsonConverter))] + public global::Ideogram.MagicPromptMode? MagicPrompt { get; set; } + + /// + /// The number of images to generate.
+ /// Default Value: 1 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] + public int? NumImages { get; set; } + + /// + /// Random seed. Set for reproducible generation. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("seed")] + public int? Seed { get; set; } + + /// + /// The rendering speed to use.
+ /// Default Value: default + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("rendering_speed")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.V2ImageInpaintIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedJsonConverter))] + public global::Ideogram.V2ImageInpaintIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? RenderingSpeed { get; set; } + + /// + /// The style type to generate with.
+ /// Default Value: general + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("style_type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.IdeogramV3StyleTypeJsonConverter))] + public global::Ideogram.IdeogramV3StyleType? StyleType { get; set; } + + /// + /// A predefined style preset to apply to the repainted images. Cannot be combined with style codes or style references. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("style_preset")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.IdeogramV3StylePresetJsonConverter))] + public global::Ideogram.IdeogramV3StylePreset? StylePreset { get; set; } + + /// + /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("style_codes")] + public global::System.Collections.Generic.IList? StyleCodes { get; set; } + + /// + /// Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("style_reference_images")] + public global::System.Collections.Generic.IList? StyleReferenceImages { get; set; } + + /// + /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("enable_copyright_detection")] + public bool? EnableCopyrightDetection { get; set; } + + /// + /// When false (the default), the request waits until the repainted images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
+ /// Default Value: false + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] + public string? WebhookUrl { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The prompt describing the repainted result. + /// + /// + /// The source image to repaint (max 25MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The output matches its size, snapped to the nearest supported resolution. + /// + /// + /// The source image to repaint (max 25MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The output matches its size, snapped to the nearest supported resolution. + /// + /// + /// A black-and-white mask the same size as the source image. Black marks the region to repaint. JPEG, PNG, and WEBP are supported. Multipart requests only. + /// + /// + /// A black-and-white mask the same size as the source image. Black marks the region to repaint. JPEG, PNG, and WEBP are supported. Multipart requests only. + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The rendering speed to use.
+ /// Default Value: default + /// + /// + /// The style type to generate with.
+ /// Default Value: general + /// + /// + /// A predefined style preset to apply to the repainted images. Cannot be combined with style codes or style references. + /// + /// + /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images. + /// + /// + /// Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported. + /// + /// + /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the repainted images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ImagesInpaintPostInpaintImageV2IdeogramV3Request( + string prompt, + byte[] image, + string imagename, + byte[] mask, + string maskname, + global::Ideogram.MagicPromptMode? magicPrompt, + int? numImages, + int? seed, + global::Ideogram.V2ImageInpaintIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed, + global::Ideogram.IdeogramV3StyleType? styleType, + global::Ideogram.IdeogramV3StylePreset? stylePreset, + global::System.Collections.Generic.IList? styleCodes, + global::System.Collections.Generic.IList? styleReferenceImages, + bool? enableCopyrightDetection, + bool? async, + string? webhookUrl) + { + this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); + this.Image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + this.Imagename = imagename ?? throw new global::System.ArgumentNullException(nameof(imagename)); + this.Mask = mask ?? throw new global::System.ArgumentNullException(nameof(mask)); + this.Maskname = maskname ?? throw new global::System.ArgumentNullException(nameof(maskname)); + this.MagicPrompt = magicPrompt; + this.NumImages = numImages; + this.Seed = seed; + this.RenderingSpeed = renderingSpeed; + this.StyleType = styleType; + this.StylePreset = stylePreset; + this.StyleCodes = styleCodes; + this.StyleReferenceImages = styleReferenceImages; + this.EnableCopyrightDetection = enableCopyrightDetection; + this.Async = async; + this.WebhookUrl = webhookUrl; + } + + /// + /// Initializes a new instance of the class. + /// + public ImagesInpaintPostInpaintImageV2IdeogramV3Request() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3Response.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3Response.Json.g.cs new file mode 100644 index 00000000..3f9d5efc --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3Response.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesInpaintPostInpaintImageV2IdeogramV3Response + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3Response? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3Response), + jsonSerializerContext) as global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3Response; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3Response? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3Response? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3Response), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3Response; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3Response.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3Response.g.cs new file mode 100644 index 00000000..8bf7c028 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3Response.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesInpaintPostInpaintImageV2IdeogramV3Response + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3Response2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3Response2.Json.g.cs new file mode 100644 index 00000000..15fcdaeb --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3Response2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesInpaintPostInpaintImageV2IdeogramV3Response2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3Response2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3Response2), + jsonSerializerContext) as global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3Response2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3Response2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3Response2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3Response2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3Response2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3Response2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3Response2.g.cs new file mode 100644 index 00000000..6cc66d66 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3Response2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesInpaintPostInpaintImageV2IdeogramV3Response2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3Response3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3Response3.Json.g.cs new file mode 100644 index 00000000..a8a40cea --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3Response3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesInpaintPostInpaintImageV2IdeogramV3Response3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3Response3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3Response3), + jsonSerializerContext) as global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3Response3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3Response3? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3Response3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3Response3), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3Response3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3Response3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3Response3.g.cs new file mode 100644 index 00000000..14cf803c --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3Response3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesInpaintPostInpaintImageV2IdeogramV3Response3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3Response4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3Response4.Json.g.cs new file mode 100644 index 00000000..060aa795 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3Response4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesInpaintPostInpaintImageV2IdeogramV3Response4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3Response4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3Response4), + jsonSerializerContext) as global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3Response4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3Response4? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3Response4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3Response4), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3Response4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3Response4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3Response4.g.cs new file mode 100644 index 00000000..5d35848c --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3Response4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesInpaintPostInpaintImageV2IdeogramV3Response4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3Response5.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3Response5.Json.g.cs new file mode 100644 index 00000000..a769a1e8 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3Response5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesInpaintPostInpaintImageV2IdeogramV3Response5 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3Response5? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3Response5), + jsonSerializerContext) as global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3Response5; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3Response5? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3Response5? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3Response5), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3Response5; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3Response5.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3Response5.g.cs new file mode 100644 index 00000000..679fdce3 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3Response5.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesInpaintPostInpaintImageV2IdeogramV3Response5 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3Response6.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3Response6.Json.g.cs new file mode 100644 index 00000000..67b10e88 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3Response6.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesInpaintPostInpaintImageV2IdeogramV3Response6 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3Response6? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3Response6), + jsonSerializerContext) as global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3Response6; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3Response6? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3Response6? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3Response6), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesInpaintPostInpaintImageV2IdeogramV3Response6; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3Response6.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3Response6.g.cs new file mode 100644 index 00000000..804b9ade --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesInpaintPostInpaintImageV2IdeogramV3Response6.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesInpaintPostInpaintImageV2IdeogramV3Response6 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Request.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Request.Json.g.cs new file mode 100644 index 00000000..61387ba7 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Request.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesPreciseEditPostPreciseEditImageV2Ideogram45Request + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Request? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Request), + jsonSerializerContext) as global::Ideogram.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Request; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Request? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Request? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Request), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Request; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Request.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Request.g.cs new file mode 100644 index 00000000..1bcc8406 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Request.g.cs @@ -0,0 +1,216 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// + /// + public sealed partial class ImagesPreciseEditPostPreciseEditImageV2Ideogram45Request + { + /// + /// The edit instruction, in natural language or as a structured JSON
+ /// prompt. Natural language is automatically converted into a
+ /// structured prompt; valid structured JSON is used as is. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Prompt { get; set; } + + /// + /// The image to edit, as raw bytes (max 50MB; JPEG, PNG, or WEBP). Multipart requests only; ignored if `image_asset_identifier` is also supplied. The output always matches this image's width and height, and pixels the edit did not meaningfully change are copied exactly from it. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("image")] + [global::System.Text.Json.Serialization.JsonRequired] + public required byte[] Image { get; set; } + + /// + /// The image to edit, as raw bytes (max 50MB; JPEG, PNG, or WEBP). Multipart requests only; ignored if `image_asset_identifier` is also supplied. The output always matches this image's width and height, and pixels the edit did not meaningfully change are copied exactly from it. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Imagename { get; set; } + + /// + /// Optional images to guide the edit (max 4, max 50MB each; JPEG, PNG, or WEBP). They are never edited themselves; only `image` is. Multipart requests only; ignored if `reference_image_asset_identifiers` is also supplied. A request with a `mask` can include at most three, because the mask takes up one reference slot. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("reference_images")] + public global::System.Collections.Generic.IList? ReferenceImages { get; set; } + + /// + /// An optional mask that limits the edit to part of `image` (max 50MB; JPEG, PNG, or WEBP). Multipart requests only. Black marks the area to edit and white the area to keep; values in between are rounded to the nearer of the two. The mask must have the same width and height as the image being edited and contain both black and white areas. A masked request can include at most three reference images. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("mask")] + public byte[]? Mask { get; set; } + + /// + /// An optional mask that limits the edit to part of `image` (max 50MB; JPEG, PNG, or WEBP). Multipart requests only. Black marks the area to edit and white the area to keep; values in between are rounded to the nearer of the two. The mask must have the same width and height as the image being edited and contain both black and white areas. A masked request can include at most three reference images. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("maskname")] + public string? Maskname { get; set; } + + /// + /// Which region of the image to edit.
+ /// `none`, the default, edits the whole image. A large image may come back smaller than it was sent.
+ /// `auto` requires a `mask` and automatically selects an appropriate context region around the masked area.
+ /// `y_min,x_min,y_max,x_max` names the region explicitly, by its corners. Rows come first, matching the `bbox` ordering used elsewhere in this API, and the values are the edited image's own pixels with the origin at its top-left corner. For example `512,1024,2048,3072` is the region 2048 pixels wide and 1536 tall whose top-left corner is 1024 across and 512 down. The maximum edges are exclusive, so the region measures `x_max - x_min` by `y_max - y_min`. It must lie inside the image, measure at least 256px on each side, have an aspect ratio between 1:6 and 6:1, and cover no more than 4194304 pixels. A `mask` may select only pixels inside it.
+ /// With `auto` or an explicit region, only that region changes and the output keeps the image's own width and height.
+ /// Default Value: none + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("context_window")] + public string? ContextWindow { get; set; } + + /// + /// The rendering quality to use. `very_low` is the fastest and cheapest, and `high` takes longer and is priced higher.
+ /// Default Value: medium + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("quality")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.V2ImagePreciseEditIdeogram45PostRequestBodyContentMultipartFormDataSchemaQualityJsonConverter))] + public global::Ideogram.V2ImagePreciseEditIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality? Quality { get; set; } + + /// + /// Random seed. Set for reproducible generation. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("seed")] + public int? Seed { get; set; } + + /// + /// The number of images to generate.
+ /// Default Value: 1 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] + public int? NumImages { get; set; } + + /// + /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("enable_copyright_detection")] + public bool? EnableCopyrightDetection { get; set; } + + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] + public string? WebhookUrl { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The edit instruction, in natural language or as a structured JSON
+ /// prompt. Natural language is automatically converted into a
+ /// structured prompt; valid structured JSON is used as is. + /// + /// + /// The image to edit, as raw bytes (max 50MB; JPEG, PNG, or WEBP). Multipart requests only; ignored if `image_asset_identifier` is also supplied. The output always matches this image's width and height, and pixels the edit did not meaningfully change are copied exactly from it. + /// + /// + /// The image to edit, as raw bytes (max 50MB; JPEG, PNG, or WEBP). Multipart requests only; ignored if `image_asset_identifier` is also supplied. The output always matches this image's width and height, and pixels the edit did not meaningfully change are copied exactly from it. + /// + /// + /// Optional images to guide the edit (max 4, max 50MB each; JPEG, PNG, or WEBP). They are never edited themselves; only `image` is. Multipart requests only; ignored if `reference_image_asset_identifiers` is also supplied. A request with a `mask` can include at most three, because the mask takes up one reference slot. + /// + /// + /// An optional mask that limits the edit to part of `image` (max 50MB; JPEG, PNG, or WEBP). Multipart requests only. Black marks the area to edit and white the area to keep; values in between are rounded to the nearer of the two. The mask must have the same width and height as the image being edited and contain both black and white areas. A masked request can include at most three reference images. + /// + /// + /// An optional mask that limits the edit to part of `image` (max 50MB; JPEG, PNG, or WEBP). Multipart requests only. Black marks the area to edit and white the area to keep; values in between are rounded to the nearer of the two. The mask must have the same width and height as the image being edited and contain both black and white areas. A masked request can include at most three reference images. + /// + /// + /// Which region of the image to edit.
+ /// `none`, the default, edits the whole image. A large image may come back smaller than it was sent.
+ /// `auto` requires a `mask` and automatically selects an appropriate context region around the masked area.
+ /// `y_min,x_min,y_max,x_max` names the region explicitly, by its corners. Rows come first, matching the `bbox` ordering used elsewhere in this API, and the values are the edited image's own pixels with the origin at its top-left corner. For example `512,1024,2048,3072` is the region 2048 pixels wide and 1536 tall whose top-left corner is 1024 across and 512 down. The maximum edges are exclusive, so the region measures `x_max - x_min` by `y_max - y_min`. It must lie inside the image, measure at least 256px on each side, have an aspect ratio between 1:6 and 6:1, and cover no more than 4194304 pixels. A `mask` may select only pixels inside it.
+ /// With `auto` or an explicit region, only that region changes and the output keeps the image's own width and height.
+ /// Default Value: none + /// + /// + /// The rendering quality to use. `very_low` is the fastest and cheapest, and `high` takes longer and is priced higher.
+ /// Default Value: medium + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ImagesPreciseEditPostPreciseEditImageV2Ideogram45Request( + string prompt, + byte[] image, + string imagename, + global::System.Collections.Generic.IList? referenceImages, + byte[]? mask, + string? maskname, + string? contextWindow, + global::Ideogram.V2ImagePreciseEditIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality? quality, + int? seed, + int? numImages, + bool? enableCopyrightDetection, + bool? async, + string? webhookUrl) + { + this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); + this.Image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + this.Imagename = imagename ?? throw new global::System.ArgumentNullException(nameof(imagename)); + this.ReferenceImages = referenceImages; + this.Mask = mask; + this.Maskname = maskname; + this.ContextWindow = contextWindow; + this.Quality = quality; + this.Seed = seed; + this.NumImages = numImages; + this.EnableCopyrightDetection = enableCopyrightDetection; + this.Async = async; + this.WebhookUrl = webhookUrl; + } + + /// + /// Initializes a new instance of the class. + /// + public ImagesPreciseEditPostPreciseEditImageV2Ideogram45Request() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response.Json.g.cs new file mode 100644 index 00000000..86ec5552 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response), + jsonSerializerContext) as global::Ideogram.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response.g.cs new file mode 100644 index 00000000..607d3461 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response2.Json.g.cs new file mode 100644 index 00000000..8d84a171 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response2), + jsonSerializerContext) as global::Ideogram.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response2.g.cs new file mode 100644 index 00000000..cf658db3 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response3.Json.g.cs new file mode 100644 index 00000000..888231cc --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response3), + jsonSerializerContext) as global::Ideogram.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response3? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response3), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response3.g.cs new file mode 100644 index 00000000..f6efd949 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response4.Json.g.cs new file mode 100644 index 00000000..127cd206 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response4), + jsonSerializerContext) as global::Ideogram.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response4? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response4), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response4.g.cs new file mode 100644 index 00000000..b70a39b9 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response5.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response5.Json.g.cs new file mode 100644 index 00000000..3aea0787 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response5 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response5? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response5), + jsonSerializerContext) as global::Ideogram.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response5; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response5? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response5? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response5), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response5; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response5.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response5.g.cs new file mode 100644 index 00000000..78ea0260 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response5.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesPreciseEditPostPreciseEditImageV2Ideogram45Response5 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CharacterRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CharacterRequest.Json.g.cs new file mode 100644 index 00000000..3d7932bc --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CharacterRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesRemixPostRemixImageV2IdeogramV3CharacterRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CharacterRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CharacterRequest), + jsonSerializerContext) as global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CharacterRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CharacterRequest? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CharacterRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CharacterRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CharacterRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CharacterRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CharacterRequest.g.cs new file mode 100644 index 00000000..29579e98 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CharacterRequest.g.cs @@ -0,0 +1,277 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// + /// + public sealed partial class ImagesRemixPostRemixImageV2IdeogramV3CharacterRequest + { + /// + /// The prompt that guides the remix. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Prompt { get; set; } + + /// + /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("image")] + [global::System.Text.Json.Serialization.JsonRequired] + public required byte[] Image { get; set; } + + /// + /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Imagename { get; set; } + + /// + /// Optional. How closely the result should follow the source image, from 1 to 100. When omitted the server chooses a value from your prompt, which is the usual case. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("image_weight")] + public int? ImageWeight { get; set; } + + /// + /// Description of what to exclude from the images. Descriptions in the prompt take precedence over descriptions in the negative prompt. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("negative_prompt")] + public string? NegativePrompt { get; set; } + + /// + /// An image to use as the character reference (max 25MB). JPEG, PNG, and WEBP are supported. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("character_reference_images")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList CharacterReferenceImages { get; set; } + + /// + /// Optional grayscale mask for the character reference image, the same size as that image, marking where the character is. Only JPEG, PNG, and WEBP formats are supported. Multipart requests only; cannot be combined with `character_reference_collection_id`. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("character_reference_mask")] + public byte[]? CharacterReferenceMask { get; set; } + + /// + /// Optional grayscale mask for the character reference image, the same size as that image, marking where the character is. Only JPEG, PNG, and WEBP formats are supported. Multipart requests only; cannot be combined with `character_reference_collection_id`. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("character_reference_maskname")] + public string? CharacterReferenceMaskname { get; set; } + + /// + /// Random seed. Set for reproducible generation. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("seed")] + public int? Seed { get; set; } + + /// + /// The resolutions supported for Ideogram 3.0. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ResolutionV3JsonConverter))] + public global::Ideogram.ResolutionV3? Resolution { get; set; } + + /// + /// Output aspect ratio. Cannot be combined with resolution. Generation defaults to 1x1; remix keeps the source ratio when both fields are omitted. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.AspectRatioV3JsonConverter))] + public global::Ideogram.AspectRatioV3? AspectRatio { get; set; } + + /// + /// The rendering speed to use.
+ /// Default Value: default + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("rendering_speed")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedJsonConverter))] + public global::Ideogram.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? RenderingSpeed { get; set; } + + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.MagicPromptModeJsonConverter))] + public global::Ideogram.MagicPromptMode? MagicPrompt { get; set; } + + /// + /// The number of images to generate.
+ /// Default Value: 1 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] + public int? NumImages { get; set; } + + /// + /// The style type to remix the character with. Defaults to `auto`.
+ /// Default Value: auto + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("style_type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleTypeJsonConverter))] + public global::Ideogram.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType? StyleType { get; set; } + + /// + /// Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("style_reference_images")] + public global::System.Collections.Generic.IList? StyleReferenceImages { get; set; } + + /// + /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("enable_copyright_detection")] + public bool? EnableCopyrightDetection { get; set; } + + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
+ /// Default Value: false + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] + public string? WebhookUrl { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The prompt that guides the remix. + /// + /// + /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. + /// + /// + /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. + /// + /// + /// An image to use as the character reference (max 25MB). JPEG, PNG, and WEBP are supported. + /// + /// + /// Optional. How closely the result should follow the source image, from 1 to 100. When omitted the server chooses a value from your prompt, which is the usual case. + /// + /// + /// Description of what to exclude from the images. Descriptions in the prompt take precedence over descriptions in the negative prompt. + /// + /// + /// Optional grayscale mask for the character reference image, the same size as that image, marking where the character is. Only JPEG, PNG, and WEBP formats are supported. Multipart requests only; cannot be combined with `character_reference_collection_id`. + /// + /// + /// Optional grayscale mask for the character reference image, the same size as that image, marking where the character is. Only JPEG, PNG, and WEBP formats are supported. Multipart requests only; cannot be combined with `character_reference_collection_id`. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The resolutions supported for Ideogram 3.0. + /// + /// + /// Output aspect ratio. Cannot be combined with resolution. Generation defaults to 1x1; remix keeps the source ratio when both fields are omitted. + /// + /// + /// The rendering speed to use.
+ /// Default Value: default + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// The style type to remix the character with. Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported. + /// + /// + /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ImagesRemixPostRemixImageV2IdeogramV3CharacterRequest( + string prompt, + byte[] image, + string imagename, + global::System.Collections.Generic.IList characterReferenceImages, + int? imageWeight, + string? negativePrompt, + byte[]? characterReferenceMask, + string? characterReferenceMaskname, + int? seed, + global::Ideogram.ResolutionV3? resolution, + global::Ideogram.AspectRatioV3? aspectRatio, + global::Ideogram.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed, + global::Ideogram.MagicPromptMode? magicPrompt, + int? numImages, + global::Ideogram.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType? styleType, + global::System.Collections.Generic.IList? styleReferenceImages, + bool? enableCopyrightDetection, + bool? async, + string? webhookUrl) + { + this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); + this.Image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + this.Imagename = imagename ?? throw new global::System.ArgumentNullException(nameof(imagename)); + this.ImageWeight = imageWeight; + this.NegativePrompt = negativePrompt; + this.CharacterReferenceImages = characterReferenceImages ?? throw new global::System.ArgumentNullException(nameof(characterReferenceImages)); + this.CharacterReferenceMask = characterReferenceMask; + this.CharacterReferenceMaskname = characterReferenceMaskname; + this.Seed = seed; + this.Resolution = resolution; + this.AspectRatio = aspectRatio; + this.RenderingSpeed = renderingSpeed; + this.MagicPrompt = magicPrompt; + this.NumImages = numImages; + this.StyleType = styleType; + this.StyleReferenceImages = styleReferenceImages; + this.EnableCopyrightDetection = enableCopyrightDetection; + this.Async = async; + this.WebhookUrl = webhookUrl; + } + + /// + /// Initializes a new instance of the class. + /// + public ImagesRemixPostRemixImageV2IdeogramV3CharacterRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse.Json.g.cs new file mode 100644 index 00000000..46e6eaef --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse), + jsonSerializerContext) as global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse.g.cs new file mode 100644 index 00000000..268404a9 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse2.Json.g.cs new file mode 100644 index 00000000..60a6012e --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse2), + jsonSerializerContext) as global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse2.g.cs new file mode 100644 index 00000000..a7ff36eb --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse3.Json.g.cs new file mode 100644 index 00000000..5d5ceb28 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse3), + jsonSerializerContext) as global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse3? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse3), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse3.g.cs new file mode 100644 index 00000000..27a1a8e2 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse4.Json.g.cs new file mode 100644 index 00000000..d7ca58f1 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse4), + jsonSerializerContext) as global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse4? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse4), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse4.g.cs new file mode 100644 index 00000000..64fdc1e5 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse5.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse5.Json.g.cs new file mode 100644 index 00000000..befbf7c8 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse5 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse5? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse5), + jsonSerializerContext) as global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse5; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse5? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse5? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse5), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse5; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse5.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse5.g.cs new file mode 100644 index 00000000..c0a6032d --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse5.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse5 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse6.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse6.Json.g.cs new file mode 100644 index 00000000..d6039086 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse6.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse6 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse6? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse6), + jsonSerializerContext) as global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse6; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse6? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse6? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse6), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse6; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse6.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse6.g.cs new file mode 100644 index 00000000..0aa21cd2 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse6.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesRemixPostRemixImageV2IdeogramV3CharacterResponse6 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CustomModelRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CustomModelRequest.Json.g.cs new file mode 100644 index 00000000..21aa1504 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CustomModelRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesRemixPostRemixImageV2IdeogramV3CustomModelRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CustomModelRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CustomModelRequest), + jsonSerializerContext) as global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CustomModelRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CustomModelRequest? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CustomModelRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CustomModelRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CustomModelRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CustomModelRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CustomModelRequest.g.cs new file mode 100644 index 00000000..d8ba4ade --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CustomModelRequest.g.cs @@ -0,0 +1,274 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// + /// + public sealed partial class ImagesRemixPostRemixImageV2IdeogramV3CustomModelRequest + { + /// + /// The prompt that guides the remix. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Prompt { get; set; } + + /// + /// The custom model URI returned by the custom-model API, in the form `model/<model_name>/version/<version_name>`. The authenticated user or organization must have access to the model. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("custom_model_uri")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string CustomModelUri { get; set; } + + /// + /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("image")] + [global::System.Text.Json.Serialization.JsonRequired] + public required byte[] Image { get; set; } + + /// + /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Imagename { get; set; } + + /// + /// Optional. How closely the result should follow the source image, from 1 to 100. When omitted the server chooses a value from your prompt, which is the usual case. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("image_weight")] + public int? ImageWeight { get; set; } + + /// + /// Description of what to exclude from the images. Descriptions in the prompt take precedence over descriptions in the negative prompt. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("negative_prompt")] + public string? NegativePrompt { get; set; } + + /// + /// Random seed. Set for reproducible generation. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("seed")] + public int? Seed { get; set; } + + /// + /// The resolutions supported for Ideogram 3.0. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ResolutionV3JsonConverter))] + public global::Ideogram.ResolutionV3? Resolution { get; set; } + + /// + /// Output aspect ratio. Cannot be combined with resolution. Generation defaults to 1x1; remix keeps the source ratio when both fields are omitted. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.AspectRatioV3JsonConverter))] + public global::Ideogram.AspectRatioV3? AspectRatio { get; set; } + + /// + /// The rendering speed to use. When omitted, the server chooses a speed supported by the selected custom model. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("rendering_speed")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.V2ImageRemixIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedJsonConverter))] + public global::Ideogram.V2ImageRemixIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? RenderingSpeed { get; set; } + + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.MagicPromptModeJsonConverter))] + public global::Ideogram.MagicPromptMode? MagicPrompt { get; set; } + + /// + /// The number of images to generate.
+ /// Default Value: 1 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] + public int? NumImages { get; set; } + + /// + /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). + /// + [global::System.Text.Json.Serialization.JsonPropertyName("color_palette")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.IdeogramColorPaletteJsonConverter))] + public global::Ideogram.IdeogramColorPalette? ColorPalette { get; set; } + + /// + /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("style_codes")] + public global::System.Collections.Generic.IList? StyleCodes { get; set; } + + /// + /// A predefined style preset to apply to the remixed images. Cannot be combined with style codes or style references. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("style_preset")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.IdeogramV3StylePresetJsonConverter))] + public global::Ideogram.IdeogramV3StylePreset? StylePreset { get; set; } + + /// + /// Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported. Multipart requests only. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("style_reference_images")] + public global::System.Collections.Generic.IList? StyleReferenceImages { get; set; } + + /// + /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("enable_copyright_detection")] + public bool? EnableCopyrightDetection { get; set; } + + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
+ /// Default Value: false + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] + public string? WebhookUrl { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The prompt that guides the remix. + /// + /// + /// The custom model URI returned by the custom-model API, in the form `model/<model_name>/version/<version_name>`. The authenticated user or organization must have access to the model. + /// + /// + /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. + /// + /// + /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. + /// + /// + /// Optional. How closely the result should follow the source image, from 1 to 100. When omitted the server chooses a value from your prompt, which is the usual case. + /// + /// + /// Description of what to exclude from the images. Descriptions in the prompt take precedence over descriptions in the negative prompt. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The resolutions supported for Ideogram 3.0. + /// + /// + /// Output aspect ratio. Cannot be combined with resolution. Generation defaults to 1x1; remix keeps the source ratio when both fields are omitted. + /// + /// + /// The rendering speed to use. When omitted, the server chooses a speed supported by the selected custom model. + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). + /// + /// + /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images. + /// + /// + /// A predefined style preset to apply to the remixed images. Cannot be combined with style codes or style references. + /// + /// + /// Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported. Multipart requests only. + /// + /// + /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ImagesRemixPostRemixImageV2IdeogramV3CustomModelRequest( + string prompt, + string customModelUri, + byte[] image, + string imagename, + int? imageWeight, + string? negativePrompt, + int? seed, + global::Ideogram.ResolutionV3? resolution, + global::Ideogram.AspectRatioV3? aspectRatio, + global::Ideogram.V2ImageRemixIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed, + global::Ideogram.MagicPromptMode? magicPrompt, + int? numImages, + global::Ideogram.IdeogramColorPalette? colorPalette, + global::System.Collections.Generic.IList? styleCodes, + global::Ideogram.IdeogramV3StylePreset? stylePreset, + global::System.Collections.Generic.IList? styleReferenceImages, + bool? enableCopyrightDetection, + bool? async, + string? webhookUrl) + { + this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); + this.CustomModelUri = customModelUri ?? throw new global::System.ArgumentNullException(nameof(customModelUri)); + this.Image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + this.Imagename = imagename ?? throw new global::System.ArgumentNullException(nameof(imagename)); + this.ImageWeight = imageWeight; + this.NegativePrompt = negativePrompt; + this.Seed = seed; + this.Resolution = resolution; + this.AspectRatio = aspectRatio; + this.RenderingSpeed = renderingSpeed; + this.MagicPrompt = magicPrompt; + this.NumImages = numImages; + this.ColorPalette = colorPalette; + this.StyleCodes = styleCodes; + this.StylePreset = stylePreset; + this.StyleReferenceImages = styleReferenceImages; + this.EnableCopyrightDetection = enableCopyrightDetection; + this.Async = async; + this.WebhookUrl = webhookUrl; + } + + /// + /// Initializes a new instance of the class. + /// + public ImagesRemixPostRemixImageV2IdeogramV3CustomModelRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse.Json.g.cs new file mode 100644 index 00000000..7864cbd3 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse), + jsonSerializerContext) as global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse.g.cs new file mode 100644 index 00000000..b560a38e --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse2.Json.g.cs new file mode 100644 index 00000000..e3c627b2 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse2), + jsonSerializerContext) as global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse2.g.cs new file mode 100644 index 00000000..cd5af6a2 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse3.Json.g.cs new file mode 100644 index 00000000..6e961ebb --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse3), + jsonSerializerContext) as global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse3? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse3), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse3.g.cs new file mode 100644 index 00000000..b05d1c23 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse4.Json.g.cs new file mode 100644 index 00000000..e5644246 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse4), + jsonSerializerContext) as global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse4? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse4), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse4.g.cs new file mode 100644 index 00000000..f4c2581e --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse5.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse5.Json.g.cs new file mode 100644 index 00000000..54acca8a --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse5 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse5? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse5), + jsonSerializerContext) as global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse5; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse5? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse5? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse5), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse5; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse5.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse5.g.cs new file mode 100644 index 00000000..88993985 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse5.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse5 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse6.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse6.Json.g.cs new file mode 100644 index 00000000..0362dd1a --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse6.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse6 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse6? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse6), + jsonSerializerContext) as global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse6; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse6? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse6? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse6), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse6; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse6.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse6.g.cs new file mode 100644 index 00000000..f24d0153 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse6.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse6 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse7.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse7.Json.g.cs new file mode 100644 index 00000000..ab28e256 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse7.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse7 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse7? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse7), + jsonSerializerContext) as global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse7; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse7? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse7? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse7), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse7; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse7.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse7.g.cs new file mode 100644 index 00000000..2abc4d4f --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse7.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesRemixPostRemixImageV2IdeogramV3CustomModelResponse7 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3Request.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3Request.Json.g.cs new file mode 100644 index 00000000..49125ea8 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3Request.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesRemixPostRemixImageV2IdeogramV3Request + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3Request? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3Request), + jsonSerializerContext) as global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3Request; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3Request? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3Request? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3Request), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3Request; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3Request.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3Request.g.cs new file mode 100644 index 00000000..c6f0c5e0 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3Request.g.cs @@ -0,0 +1,278 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// + /// + public sealed partial class ImagesRemixPostRemixImageV2IdeogramV3Request + { + /// + /// The prompt that guides the remix. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Prompt { get; set; } + + /// + /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("image")] + [global::System.Text.Json.Serialization.JsonRequired] + public required byte[] Image { get; set; } + + /// + /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Imagename { get; set; } + + /// + /// Optional. How closely the result should follow the source image, from 1 to 100. When omitted the server chooses a value from your prompt, which is the usual case. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("image_weight")] + public int? ImageWeight { get; set; } + + /// + /// Description of what to exclude from the images. Descriptions in the prompt take precedence over descriptions in the negative prompt. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("negative_prompt")] + public string? NegativePrompt { get; set; } + + /// + /// Random seed. Set for reproducible generation. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("seed")] + public int? Seed { get; set; } + + /// + /// The resolutions supported for Ideogram 3.0. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ResolutionV3JsonConverter))] + public global::Ideogram.ResolutionV3? Resolution { get; set; } + + /// + /// Output aspect ratio. Cannot be combined with resolution. Generation defaults to 1x1; remix keeps the source ratio when both fields are omitted. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.AspectRatioV3JsonConverter))] + public global::Ideogram.AspectRatioV3? AspectRatio { get; set; } + + /// + /// The rendering speed to use.
+ /// Default Value: default + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("rendering_speed")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.V2ImageRemixIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedJsonConverter))] + public global::Ideogram.V2ImageRemixIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? RenderingSpeed { get; set; } + + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.MagicPromptModeJsonConverter))] + public global::Ideogram.MagicPromptMode? MagicPrompt { get; set; } + + /// + /// The number of images to generate.
+ /// Default Value: 1 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] + public int? NumImages { get; set; } + + /// + /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). + /// + [global::System.Text.Json.Serialization.JsonPropertyName("color_palette")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.IdeogramColorPaletteJsonConverter))] + public global::Ideogram.IdeogramColorPalette? ColorPalette { get; set; } + + /// + /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("style_codes")] + public global::System.Collections.Generic.IList? StyleCodes { get; set; } + + /// + /// The style type to generate with.
+ /// Default Value: general + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("style_type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.IdeogramV3StyleTypeJsonConverter))] + public global::Ideogram.IdeogramV3StyleType? StyleType { get; set; } + + /// + /// A predefined style preset to apply to the remixed images. Cannot be combined with style codes or style references. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("style_preset")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.IdeogramV3StylePresetJsonConverter))] + public global::Ideogram.IdeogramV3StylePreset? StylePreset { get; set; } + + /// + /// Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("style_reference_images")] + public global::System.Collections.Generic.IList? StyleReferenceImages { get; set; } + + /// + /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("enable_copyright_detection")] + public bool? EnableCopyrightDetection { get; set; } + + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
+ /// Default Value: false + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] + public string? WebhookUrl { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The prompt that guides the remix. + /// + /// + /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. + /// + /// + /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. + /// + /// + /// Optional. How closely the result should follow the source image, from 1 to 100. When omitted the server chooses a value from your prompt, which is the usual case. + /// + /// + /// Description of what to exclude from the images. Descriptions in the prompt take precedence over descriptions in the negative prompt. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// The resolutions supported for Ideogram 3.0. + /// + /// + /// Output aspect ratio. Cannot be combined with resolution. Generation defaults to 1x1; remix keeps the source ratio when both fields are omitted. + /// + /// + /// The rendering speed to use.
+ /// Default Value: default + /// + /// + /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
+ /// Default Value: auto + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). + /// + /// + /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images. + /// + /// + /// The style type to generate with.
+ /// Default Value: general + /// + /// + /// A predefined style preset to apply to the remixed images. Cannot be combined with style codes or style references. + /// + /// + /// Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported. + /// + /// + /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ImagesRemixPostRemixImageV2IdeogramV3Request( + string prompt, + byte[] image, + string imagename, + int? imageWeight, + string? negativePrompt, + int? seed, + global::Ideogram.ResolutionV3? resolution, + global::Ideogram.AspectRatioV3? aspectRatio, + global::Ideogram.V2ImageRemixIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed, + global::Ideogram.MagicPromptMode? magicPrompt, + int? numImages, + global::Ideogram.IdeogramColorPalette? colorPalette, + global::System.Collections.Generic.IList? styleCodes, + global::Ideogram.IdeogramV3StyleType? styleType, + global::Ideogram.IdeogramV3StylePreset? stylePreset, + global::System.Collections.Generic.IList? styleReferenceImages, + bool? enableCopyrightDetection, + bool? async, + string? webhookUrl) + { + this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); + this.Image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + this.Imagename = imagename ?? throw new global::System.ArgumentNullException(nameof(imagename)); + this.ImageWeight = imageWeight; + this.NegativePrompt = negativePrompt; + this.Seed = seed; + this.Resolution = resolution; + this.AspectRatio = aspectRatio; + this.RenderingSpeed = renderingSpeed; + this.MagicPrompt = magicPrompt; + this.NumImages = numImages; + this.ColorPalette = colorPalette; + this.StyleCodes = styleCodes; + this.StyleType = styleType; + this.StylePreset = stylePreset; + this.StyleReferenceImages = styleReferenceImages; + this.EnableCopyrightDetection = enableCopyrightDetection; + this.Async = async; + this.WebhookUrl = webhookUrl; + } + + /// + /// Initializes a new instance of the class. + /// + public ImagesRemixPostRemixImageV2IdeogramV3Request() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3Response.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3Response.Json.g.cs new file mode 100644 index 00000000..85301785 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3Response.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesRemixPostRemixImageV2IdeogramV3Response + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3Response? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3Response), + jsonSerializerContext) as global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3Response; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3Response? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3Response? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3Response), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3Response; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3Response.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3Response.g.cs new file mode 100644 index 00000000..a62a7502 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3Response.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesRemixPostRemixImageV2IdeogramV3Response + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3Response2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3Response2.Json.g.cs new file mode 100644 index 00000000..678ec6a0 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3Response2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesRemixPostRemixImageV2IdeogramV3Response2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3Response2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3Response2), + jsonSerializerContext) as global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3Response2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3Response2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3Response2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3Response2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3Response2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3Response2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3Response2.g.cs new file mode 100644 index 00000000..f287c506 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3Response2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesRemixPostRemixImageV2IdeogramV3Response2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3Response3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3Response3.Json.g.cs new file mode 100644 index 00000000..3960e66f --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3Response3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesRemixPostRemixImageV2IdeogramV3Response3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3Response3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3Response3), + jsonSerializerContext) as global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3Response3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3Response3? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3Response3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3Response3), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3Response3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3Response3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3Response3.g.cs new file mode 100644 index 00000000..7d218148 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3Response3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesRemixPostRemixImageV2IdeogramV3Response3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3Response4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3Response4.Json.g.cs new file mode 100644 index 00000000..1840b275 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3Response4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesRemixPostRemixImageV2IdeogramV3Response4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3Response4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3Response4), + jsonSerializerContext) as global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3Response4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3Response4? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3Response4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3Response4), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3Response4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3Response4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3Response4.g.cs new file mode 100644 index 00000000..f3fe06f4 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3Response4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesRemixPostRemixImageV2IdeogramV3Response4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3Response5.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3Response5.Json.g.cs new file mode 100644 index 00000000..0d8cd29e --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3Response5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesRemixPostRemixImageV2IdeogramV3Response5 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3Response5? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3Response5), + jsonSerializerContext) as global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3Response5; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3Response5? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3Response5? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3Response5), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3Response5; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3Response5.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3Response5.g.cs new file mode 100644 index 00000000..f139311e --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3Response5.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesRemixPostRemixImageV2IdeogramV3Response5 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3Response6.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3Response6.Json.g.cs new file mode 100644 index 00000000..3d63c845 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3Response6.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesRemixPostRemixImageV2IdeogramV3Response6 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3Response6? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3Response6), + jsonSerializerContext) as global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3Response6; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3Response6? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3Response6? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3Response6), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV3Response6; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3Response6.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3Response6.g.cs new file mode 100644 index 00000000..484f7662 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV3Response6.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesRemixPostRemixImageV2IdeogramV3Response6 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV4Request.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV4Request.Json.g.cs new file mode 100644 index 00000000..3dcda428 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV4Request.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesRemixPostRemixImageV2IdeogramV4Request + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV4Request? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV4Request), + jsonSerializerContext) as global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV4Request; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV4Request? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV4Request? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV4Request), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV4Request; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV4Request.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV4Request.g.cs new file mode 100644 index 00000000..ce378fc0 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV4Request.g.cs @@ -0,0 +1,176 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// + /// + public sealed partial class ImagesRemixPostRemixImageV2IdeogramV4Request + { + /// + /// The prompt that guides the remix. It is always read as an editing instruction, so there is no `magic_prompt` option. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Prompt { get; set; } + + /// + /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` to keep its shape. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("image")] + [global::System.Text.Json.Serialization.JsonRequired] + public required byte[] Image { get; set; } + + /// + /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` to keep its shape. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Imagename { get; set; } + + /// + /// Optional. How closely the result should follow the source image, from 1 to 100. When omitted the server chooses a value from your prompt, which is the usual case. Only accepted when the output keeps the source image's shape: combining `image_weight` with a `resolution` whose aspect ratio differs from the source's is rejected with a 400. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("image_weight")] + public int? ImageWeight { get; set; } + + /// + /// The number of images to generate.
+ /// Default Value: 1 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] + public int? NumImages { get; set; } + + /// + /// Optional. When supplied, the images are generated at this
+ /// resolution. When omitted, the source image's shape is kept. A
+ /// resolution whose aspect ratio differs from the source's cannot
+ /// be combined with `image_weight`. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ResolutionV4JsonConverter))] + public global::Ideogram.ResolutionV4? Resolution { get; set; } + + /// + /// The rendering speed to use.
+ /// Default Value: default + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("rendering_speed")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.V2ImageRemixIdeogram4PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedJsonConverter))] + public global::Ideogram.V2ImageRemixIdeogram4PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? RenderingSpeed { get; set; } + + /// + /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("enable_copyright_detection")] + public bool? EnableCopyrightDetection { get; set; } + + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
+ /// Default Value: false + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] + public string? WebhookUrl { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The prompt that guides the remix. It is always read as an editing instruction, so there is no `magic_prompt` option. + /// + /// + /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` to keep its shape. + /// + /// + /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` to keep its shape. + /// + /// + /// Optional. How closely the result should follow the source image, from 1 to 100. When omitted the server chooses a value from your prompt, which is the usual case. Only accepted when the output keeps the source image's shape: combining `image_weight` with a `resolution` whose aspect ratio differs from the source's is rejected with a 400. + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Optional. When supplied, the images are generated at this
+ /// resolution. When omitted, the source image's shape is kept. A
+ /// resolution whose aspect ratio differs from the source's cannot
+ /// be combined with `image_weight`. + /// + /// + /// The rendering speed to use.
+ /// Default Value: default + /// + /// + /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. + /// + /// + /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ImagesRemixPostRemixImageV2IdeogramV4Request( + string prompt, + byte[] image, + string imagename, + int? imageWeight, + int? numImages, + global::Ideogram.ResolutionV4? resolution, + global::Ideogram.V2ImageRemixIdeogram4PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed, + bool? enableCopyrightDetection, + bool? async, + string? webhookUrl) + { + this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); + this.Image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + this.Imagename = imagename ?? throw new global::System.ArgumentNullException(nameof(imagename)); + this.ImageWeight = imageWeight; + this.NumImages = numImages; + this.Resolution = resolution; + this.RenderingSpeed = renderingSpeed; + this.EnableCopyrightDetection = enableCopyrightDetection; + this.Async = async; + this.WebhookUrl = webhookUrl; + } + + /// + /// Initializes a new instance of the class. + /// + public ImagesRemixPostRemixImageV2IdeogramV4Request() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV4Response.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV4Response.Json.g.cs new file mode 100644 index 00000000..b085d2c4 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV4Response.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesRemixPostRemixImageV2IdeogramV4Response + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV4Response? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV4Response), + jsonSerializerContext) as global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV4Response; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV4Response? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV4Response? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV4Response), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV4Response; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV4Response.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV4Response.g.cs new file mode 100644 index 00000000..edba9af4 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV4Response.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesRemixPostRemixImageV2IdeogramV4Response + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV4Response2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV4Response2.Json.g.cs new file mode 100644 index 00000000..b55c4481 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV4Response2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesRemixPostRemixImageV2IdeogramV4Response2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV4Response2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV4Response2), + jsonSerializerContext) as global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV4Response2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV4Response2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV4Response2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV4Response2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV4Response2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV4Response2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV4Response2.g.cs new file mode 100644 index 00000000..d328ba9f --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV4Response2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesRemixPostRemixImageV2IdeogramV4Response2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV4Response3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV4Response3.Json.g.cs new file mode 100644 index 00000000..0de6afa2 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV4Response3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesRemixPostRemixImageV2IdeogramV4Response3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV4Response3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV4Response3), + jsonSerializerContext) as global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV4Response3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV4Response3? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV4Response3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV4Response3), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV4Response3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV4Response3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV4Response3.g.cs new file mode 100644 index 00000000..87b7c732 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV4Response3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesRemixPostRemixImageV2IdeogramV4Response3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV4Response4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV4Response4.Json.g.cs new file mode 100644 index 00000000..5c95b4fb --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV4Response4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesRemixPostRemixImageV2IdeogramV4Response4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV4Response4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV4Response4), + jsonSerializerContext) as global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV4Response4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV4Response4? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV4Response4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV4Response4), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV4Response4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV4Response4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV4Response4.g.cs new file mode 100644 index 00000000..6b3d8724 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV4Response4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesRemixPostRemixImageV2IdeogramV4Response4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV4Response5.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV4Response5.Json.g.cs new file mode 100644 index 00000000..f0547487 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV4Response5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesRemixPostRemixImageV2IdeogramV4Response5 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV4Response5? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV4Response5), + jsonSerializerContext) as global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV4Response5; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV4Response5? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV4Response5? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV4Response5), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV4Response5; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV4Response5.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV4Response5.g.cs new file mode 100644 index 00000000..84e76242 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV4Response5.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesRemixPostRemixImageV2IdeogramV4Response5 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV4Response6.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV4Response6.Json.g.cs new file mode 100644 index 00000000..847e0211 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV4Response6.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesRemixPostRemixImageV2IdeogramV4Response6 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV4Response6? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV4Response6), + jsonSerializerContext) as global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV4Response6; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV4Response6? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV4Response6? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV4Response6), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesRemixPostRemixImageV2IdeogramV4Response6; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV4Response6.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV4Response6.g.cs new file mode 100644 index 00000000..e88aa2c0 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesRemixPostRemixImageV2IdeogramV4Response6.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesRemixPostRemixImageV2IdeogramV4Response6 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageNanoBananaProRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageNanoBananaProRequest.Json.g.cs new file mode 100644 index 00000000..009a3d67 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageNanoBananaProRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesUpscalePostUpscaleImageNanoBananaProRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageNanoBananaProRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageNanoBananaProRequest), + jsonSerializerContext) as global::Ideogram.ImagesUpscalePostUpscaleImageNanoBananaProRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageNanoBananaProRequest? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesUpscalePostUpscaleImageNanoBananaProRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageNanoBananaProRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesUpscalePostUpscaleImageNanoBananaProRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageNanoBananaProRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageNanoBananaProRequest.g.cs new file mode 100644 index 00000000..a7d142ea --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageNanoBananaProRequest.g.cs @@ -0,0 +1,133 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// + /// + public sealed partial class ImagesUpscalePostUpscaleImageNanoBananaProRequest + { + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("image")] + [global::System.Text.Json.Serialization.JsonRequired] + public required byte[] Image { get; set; } + + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Imagename { get; set; } + + /// + /// Optional short guidance for the enhancement, appended to the model's upscaling instruction. When omitted, the image is upscaled as-is. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] + public string? Prompt { get; set; } + + /// + /// The output resolution tier. The model sizes its output by tier at the source image's aspect ratio; exact pixel dimensions cannot be requested. Rejected when the source is already at or above the requested tier. Defaults to "2K".
+ /// Default Value: 2K + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("resolution_tier")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.V2ImageUpscaleNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTierJsonConverter))] + public global::Ideogram.V2ImageUpscaleNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier? ResolutionTier { get; set; } + + /// + /// Random seed. Set for reproducible generation. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("seed")] + public int? Seed { get; set; } + + /// + /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
+ /// Default Value: false + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] + public string? WebhookUrl { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// Optional short guidance for the enhancement, appended to the model's upscaling instruction. When omitted, the image is upscaled as-is. + /// + /// + /// The output resolution tier. The model sizes its output by tier at the source image's aspect ratio; exact pixel dimensions cannot be requested. Rejected when the source is already at or above the requested tier. Defaults to "2K".
+ /// Default Value: 2K + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ImagesUpscalePostUpscaleImageNanoBananaProRequest( + byte[] image, + string imagename, + string? prompt, + global::Ideogram.V2ImageUpscaleNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier? resolutionTier, + int? seed, + bool? async, + string? webhookUrl) + { + this.Image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + this.Imagename = imagename ?? throw new global::System.ArgumentNullException(nameof(imagename)); + this.Prompt = prompt; + this.ResolutionTier = resolutionTier; + this.Seed = seed; + this.Async = async; + this.WebhookUrl = webhookUrl; + } + + /// + /// Initializes a new instance of the class. + /// + public ImagesUpscalePostUpscaleImageNanoBananaProRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageNanoBananaProResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageNanoBananaProResponse.Json.g.cs new file mode 100644 index 00000000..cd817ca2 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageNanoBananaProResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesUpscalePostUpscaleImageNanoBananaProResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageNanoBananaProResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageNanoBananaProResponse), + jsonSerializerContext) as global::Ideogram.ImagesUpscalePostUpscaleImageNanoBananaProResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageNanoBananaProResponse? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesUpscalePostUpscaleImageNanoBananaProResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageNanoBananaProResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesUpscalePostUpscaleImageNanoBananaProResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageNanoBananaProResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageNanoBananaProResponse.g.cs new file mode 100644 index 00000000..dfb43935 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageNanoBananaProResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesUpscalePostUpscaleImageNanoBananaProResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageNanoBananaProResponse2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageNanoBananaProResponse2.Json.g.cs new file mode 100644 index 00000000..ea0e0cc0 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageNanoBananaProResponse2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesUpscalePostUpscaleImageNanoBananaProResponse2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageNanoBananaProResponse2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageNanoBananaProResponse2), + jsonSerializerContext) as global::Ideogram.ImagesUpscalePostUpscaleImageNanoBananaProResponse2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageNanoBananaProResponse2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesUpscalePostUpscaleImageNanoBananaProResponse2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageNanoBananaProResponse2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesUpscalePostUpscaleImageNanoBananaProResponse2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageNanoBananaProResponse2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageNanoBananaProResponse2.g.cs new file mode 100644 index 00000000..e46f8b7a --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageNanoBananaProResponse2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesUpscalePostUpscaleImageNanoBananaProResponse2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageNanoBananaProResponse3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageNanoBananaProResponse3.Json.g.cs new file mode 100644 index 00000000..9c8d4216 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageNanoBananaProResponse3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesUpscalePostUpscaleImageNanoBananaProResponse3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageNanoBananaProResponse3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageNanoBananaProResponse3), + jsonSerializerContext) as global::Ideogram.ImagesUpscalePostUpscaleImageNanoBananaProResponse3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageNanoBananaProResponse3? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesUpscalePostUpscaleImageNanoBananaProResponse3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageNanoBananaProResponse3), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesUpscalePostUpscaleImageNanoBananaProResponse3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageNanoBananaProResponse3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageNanoBananaProResponse3.g.cs new file mode 100644 index 00000000..94b42edd --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageNanoBananaProResponse3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesUpscalePostUpscaleImageNanoBananaProResponse3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageNanoBananaProResponse4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageNanoBananaProResponse4.Json.g.cs new file mode 100644 index 00000000..35064409 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageNanoBananaProResponse4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesUpscalePostUpscaleImageNanoBananaProResponse4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageNanoBananaProResponse4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageNanoBananaProResponse4), + jsonSerializerContext) as global::Ideogram.ImagesUpscalePostUpscaleImageNanoBananaProResponse4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageNanoBananaProResponse4? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesUpscalePostUpscaleImageNanoBananaProResponse4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageNanoBananaProResponse4), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesUpscalePostUpscaleImageNanoBananaProResponse4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageNanoBananaProResponse4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageNanoBananaProResponse4.g.cs new file mode 100644 index 00000000..dcf4eac2 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageNanoBananaProResponse4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesUpscalePostUpscaleImageNanoBananaProResponse4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageNanoBananaProResponse5.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageNanoBananaProResponse5.Json.g.cs new file mode 100644 index 00000000..6e0c723d --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageNanoBananaProResponse5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesUpscalePostUpscaleImageNanoBananaProResponse5 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageNanoBananaProResponse5? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageNanoBananaProResponse5), + jsonSerializerContext) as global::Ideogram.ImagesUpscalePostUpscaleImageNanoBananaProResponse5; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageNanoBananaProResponse5? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesUpscalePostUpscaleImageNanoBananaProResponse5? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageNanoBananaProResponse5), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesUpscalePostUpscaleImageNanoBananaProResponse5; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageNanoBananaProResponse5.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageNanoBananaProResponse5.g.cs new file mode 100644 index 00000000..cbf12d8e --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageNanoBananaProResponse5.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesUpscalePostUpscaleImageNanoBananaProResponse5 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageNanoBananaProResponse6.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageNanoBananaProResponse6.Json.g.cs new file mode 100644 index 00000000..89d93778 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageNanoBananaProResponse6.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesUpscalePostUpscaleImageNanoBananaProResponse6 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageNanoBananaProResponse6? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageNanoBananaProResponse6), + jsonSerializerContext) as global::Ideogram.ImagesUpscalePostUpscaleImageNanoBananaProResponse6; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageNanoBananaProResponse6? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesUpscalePostUpscaleImageNanoBananaProResponse6? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageNanoBananaProResponse6), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesUpscalePostUpscaleImageNanoBananaProResponse6; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageNanoBananaProResponse6.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageNanoBananaProResponse6.g.cs new file mode 100644 index 00000000..d4581676 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageNanoBananaProResponse6.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesUpscalePostUpscaleImageNanoBananaProResponse6 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazBloom2Request.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazBloom2Request.Json.g.cs new file mode 100644 index 00000000..02221222 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazBloom2Request.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesUpscalePostUpscaleImageTopazBloom2Request + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazBloom2Request? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazBloom2Request), + jsonSerializerContext) as global::Ideogram.ImagesUpscalePostUpscaleImageTopazBloom2Request; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazBloom2Request? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazBloom2Request? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazBloom2Request), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesUpscalePostUpscaleImageTopazBloom2Request; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazBloom2Request.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazBloom2Request.g.cs new file mode 100644 index 00000000..2cc8c50e --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazBloom2Request.g.cs @@ -0,0 +1,159 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// + /// + public sealed partial class ImagesUpscalePostUpscaleImageTopazBloom2Request + { + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("image")] + [global::System.Text.Json.Serialization.JsonRequired] + public required byte[] Image { get; set; } + + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Imagename { get; set; } + + /// + /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
+ /// Default Value: x2 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("upscale_factor")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.V2ImageUpscaleTopazBloom2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactorJsonConverter))] + public global::Ideogram.V2ImageUpscaleTopazBloom2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? UpscaleFactor { get; set; } + + /// + /// An optional prompt guiding the detail the model regenerates while enlarging the image. Leave empty to enhance the source image as-is. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] + public string? Prompt { get; set; } + + /// + /// How strongly the model reinterprets the source while enlarging it, from 1 (most faithful) to 9 (most creative).
+ /// Default Value: 3 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("creativity")] + public int? Creativity { get; set; } + + /// + /// When true (the default), the output keeps the source image's colors. Set to false to let the model adjust colors while enhancing.
+ /// Default Value: true + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("color_preservation")] + public bool? ColorPreservation { get; set; } + + /// + /// Random seed. Set for reproducible generation. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("seed")] + public int? Seed { get; set; } + + /// + /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
+ /// Default Value: false + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] + public string? WebhookUrl { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
+ /// Default Value: x2 + /// + /// + /// An optional prompt guiding the detail the model regenerates while enlarging the image. Leave empty to enhance the source image as-is. + /// + /// + /// How strongly the model reinterprets the source while enlarging it, from 1 (most faithful) to 9 (most creative).
+ /// Default Value: 3 + /// + /// + /// When true (the default), the output keeps the source image's colors. Set to false to let the model adjust colors while enhancing.
+ /// Default Value: true + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ImagesUpscalePostUpscaleImageTopazBloom2Request( + byte[] image, + string imagename, + global::Ideogram.V2ImageUpscaleTopazBloom2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? upscaleFactor, + string? prompt, + int? creativity, + bool? colorPreservation, + int? seed, + bool? async, + string? webhookUrl) + { + this.Image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + this.Imagename = imagename ?? throw new global::System.ArgumentNullException(nameof(imagename)); + this.UpscaleFactor = upscaleFactor; + this.Prompt = prompt; + this.Creativity = creativity; + this.ColorPreservation = colorPreservation; + this.Seed = seed; + this.Async = async; + this.WebhookUrl = webhookUrl; + } + + /// + /// Initializes a new instance of the class. + /// + public ImagesUpscalePostUpscaleImageTopazBloom2Request() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazBloom2Response.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazBloom2Response.Json.g.cs new file mode 100644 index 00000000..d2859be3 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazBloom2Response.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesUpscalePostUpscaleImageTopazBloom2Response + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazBloom2Response? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazBloom2Response), + jsonSerializerContext) as global::Ideogram.ImagesUpscalePostUpscaleImageTopazBloom2Response; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazBloom2Response? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazBloom2Response? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazBloom2Response), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesUpscalePostUpscaleImageTopazBloom2Response; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazBloom2Response.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazBloom2Response.g.cs new file mode 100644 index 00000000..87245c3c --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazBloom2Response.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesUpscalePostUpscaleImageTopazBloom2Response + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazBloom2Response2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazBloom2Response2.Json.g.cs new file mode 100644 index 00000000..f94ae58c --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazBloom2Response2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesUpscalePostUpscaleImageTopazBloom2Response2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazBloom2Response2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazBloom2Response2), + jsonSerializerContext) as global::Ideogram.ImagesUpscalePostUpscaleImageTopazBloom2Response2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazBloom2Response2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazBloom2Response2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazBloom2Response2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesUpscalePostUpscaleImageTopazBloom2Response2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazBloom2Response2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazBloom2Response2.g.cs new file mode 100644 index 00000000..bbfb3573 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazBloom2Response2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesUpscalePostUpscaleImageTopazBloom2Response2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazBloom2Response3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazBloom2Response3.Json.g.cs new file mode 100644 index 00000000..282ae54d --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazBloom2Response3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesUpscalePostUpscaleImageTopazBloom2Response3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazBloom2Response3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazBloom2Response3), + jsonSerializerContext) as global::Ideogram.ImagesUpscalePostUpscaleImageTopazBloom2Response3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazBloom2Response3? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazBloom2Response3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazBloom2Response3), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesUpscalePostUpscaleImageTopazBloom2Response3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazBloom2Response3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazBloom2Response3.g.cs new file mode 100644 index 00000000..3d2e9abb --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazBloom2Response3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesUpscalePostUpscaleImageTopazBloom2Response3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazBloom2Response4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazBloom2Response4.Json.g.cs new file mode 100644 index 00000000..d809556a --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazBloom2Response4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesUpscalePostUpscaleImageTopazBloom2Response4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazBloom2Response4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazBloom2Response4), + jsonSerializerContext) as global::Ideogram.ImagesUpscalePostUpscaleImageTopazBloom2Response4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazBloom2Response4? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazBloom2Response4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazBloom2Response4), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesUpscalePostUpscaleImageTopazBloom2Response4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazBloom2Response4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazBloom2Response4.g.cs new file mode 100644 index 00000000..d2033e60 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazBloom2Response4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesUpscalePostUpscaleImageTopazBloom2Response4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazBloom2Response5.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazBloom2Response5.Json.g.cs new file mode 100644 index 00000000..48d4f1de --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazBloom2Response5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesUpscalePostUpscaleImageTopazBloom2Response5 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazBloom2Response5? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazBloom2Response5), + jsonSerializerContext) as global::Ideogram.ImagesUpscalePostUpscaleImageTopazBloom2Response5; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazBloom2Response5? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazBloom2Response5? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazBloom2Response5), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesUpscalePostUpscaleImageTopazBloom2Response5; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazBloom2Response5.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazBloom2Response5.g.cs new file mode 100644 index 00000000..c80f3c79 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazBloom2Response5.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesUpscalePostUpscaleImageTopazBloom2Response5 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazBloom2Response6.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazBloom2Response6.Json.g.cs new file mode 100644 index 00000000..6b540aef --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazBloom2Response6.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesUpscalePostUpscaleImageTopazBloom2Response6 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazBloom2Response6? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazBloom2Response6), + jsonSerializerContext) as global::Ideogram.ImagesUpscalePostUpscaleImageTopazBloom2Response6; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazBloom2Response6? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazBloom2Response6? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazBloom2Response6), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesUpscalePostUpscaleImageTopazBloom2Response6; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazBloom2Response6.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazBloom2Response6.g.cs new file mode 100644 index 00000000..8c1e278f --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazBloom2Response6.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesUpscalePostUpscaleImageTopazBloom2Response6 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazRedefineRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazRedefineRequest.Json.g.cs new file mode 100644 index 00000000..a76c957a --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazRedefineRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesUpscalePostUpscaleImageTopazRedefineRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazRedefineRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazRedefineRequest), + jsonSerializerContext) as global::Ideogram.ImagesUpscalePostUpscaleImageTopazRedefineRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazRedefineRequest? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazRedefineRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazRedefineRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesUpscalePostUpscaleImageTopazRedefineRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazRedefineRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazRedefineRequest.g.cs new file mode 100644 index 00000000..4c928f62 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazRedefineRequest.g.cs @@ -0,0 +1,263 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// + /// + public sealed partial class ImagesUpscalePostUpscaleImageTopazRedefineRequest + { + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("image")] + [global::System.Text.Json.Serialization.JsonRequired] + public required byte[] Image { get; set; } + + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Imagename { get; set; } + + /// + /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
+ /// Default Value: x2 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("upscale_factor")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactorJsonConverter))] + public global::Ideogram.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? UpscaleFactor { get; set; } + + /// + /// An optional prompt guiding the detail the model regenerates while enlarging the image. Leave empty to enhance the source image as-is. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] + public string? Prompt { get; set; } + + /// + /// How strongly the model reinterprets the source while enlarging it, from 1 (most faithful) to 9 (most creative).
+ /// Default Value: 3 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("creativity")] + public int? Creativity { get; set; } + + /// + /// When true, the model describes the image itself and any `prompt` is ignored.
+ /// Default Value: false + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("autoprompt")] + public bool? Autoprompt { get; set; } + + /// + /// How much fine texture the model adds, from 1 to 5. Keep it low at low creativity.
+ /// Default Value: 1 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("texture")] + public int? Texture { get; set; } + + /// + /// Apply a detail adjustment after rendering. When true, `detail_strength` sets how much.
+ /// Default Value: false + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("detail")] + public bool? Detail { get; set; } + + /// + /// Detail adjustment intensity, from 0 to 10. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("detail_strength")] + public string? DetailStrength { get; set; } + + /// + /// Edge sharpening applied after enlarging, from 0 to 1. Omit to let the model choose per image. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("sharpen")] + public string? Sharpen { get; set; } + + /// + /// Noise and grain reduction, from 0 to 1. Omit to let the model choose per image. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("denoise")] + public string? Denoise { get; set; } + + /// + /// Recover detail in faces. When true, `face_enhancement_strength` and `face_enhancement_creativity` are required. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("face_enhancement")] + public bool? FaceEnhancement { get; set; } + + /// + /// How strongly faces are recovered, from 0 to 1. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("face_enhancement_strength")] + public string? FaceEnhancementStrength { get; set; } + + /// + /// How freely face recovery may reinterpret features, from 0 (faithful) to 1 (creative). + /// + [global::System.Text.Json.Serialization.JsonPropertyName("face_enhancement_creativity")] + public string? FaceEnhancementCreativity { get; set; } + + /// + /// Where enhancements apply. Omit to let the model choose per image. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("subject_detection")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetectionJsonConverter))] + public global::Ideogram.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection? SubjectDetection { get; set; } + + /// + /// Random seed. Set for reproducible generation. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("seed")] + public int? Seed { get; set; } + + /// + /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
+ /// Default Value: false + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] + public string? WebhookUrl { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
+ /// Default Value: x2 + /// + /// + /// An optional prompt guiding the detail the model regenerates while enlarging the image. Leave empty to enhance the source image as-is. + /// + /// + /// How strongly the model reinterprets the source while enlarging it, from 1 (most faithful) to 9 (most creative).
+ /// Default Value: 3 + /// + /// + /// When true, the model describes the image itself and any `prompt` is ignored.
+ /// Default Value: false + /// + /// + /// How much fine texture the model adds, from 1 to 5. Keep it low at low creativity.
+ /// Default Value: 1 + /// + /// + /// Apply a detail adjustment after rendering. When true, `detail_strength` sets how much.
+ /// Default Value: false + /// + /// + /// Detail adjustment intensity, from 0 to 10. + /// + /// + /// Edge sharpening applied after enlarging, from 0 to 1. Omit to let the model choose per image. + /// + /// + /// Noise and grain reduction, from 0 to 1. Omit to let the model choose per image. + /// + /// + /// Recover detail in faces. When true, `face_enhancement_strength` and `face_enhancement_creativity` are required. + /// + /// + /// How strongly faces are recovered, from 0 to 1. + /// + /// + /// How freely face recovery may reinterpret features, from 0 (faithful) to 1 (creative). + /// + /// + /// Where enhancements apply. Omit to let the model choose per image. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ImagesUpscalePostUpscaleImageTopazRedefineRequest( + byte[] image, + string imagename, + global::Ideogram.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? upscaleFactor, + string? prompt, + int? creativity, + bool? autoprompt, + int? texture, + bool? detail, + string? detailStrength, + string? sharpen, + string? denoise, + bool? faceEnhancement, + string? faceEnhancementStrength, + string? faceEnhancementCreativity, + global::Ideogram.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection? subjectDetection, + int? seed, + bool? async, + string? webhookUrl) + { + this.Image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + this.Imagename = imagename ?? throw new global::System.ArgumentNullException(nameof(imagename)); + this.UpscaleFactor = upscaleFactor; + this.Prompt = prompt; + this.Creativity = creativity; + this.Autoprompt = autoprompt; + this.Texture = texture; + this.Detail = detail; + this.DetailStrength = detailStrength; + this.Sharpen = sharpen; + this.Denoise = denoise; + this.FaceEnhancement = faceEnhancement; + this.FaceEnhancementStrength = faceEnhancementStrength; + this.FaceEnhancementCreativity = faceEnhancementCreativity; + this.SubjectDetection = subjectDetection; + this.Seed = seed; + this.Async = async; + this.WebhookUrl = webhookUrl; + } + + /// + /// Initializes a new instance of the class. + /// + public ImagesUpscalePostUpscaleImageTopazRedefineRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazRedefineResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazRedefineResponse.Json.g.cs new file mode 100644 index 00000000..4de9704a --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazRedefineResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesUpscalePostUpscaleImageTopazRedefineResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazRedefineResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazRedefineResponse), + jsonSerializerContext) as global::Ideogram.ImagesUpscalePostUpscaleImageTopazRedefineResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazRedefineResponse? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazRedefineResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazRedefineResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesUpscalePostUpscaleImageTopazRedefineResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazRedefineResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazRedefineResponse.g.cs new file mode 100644 index 00000000..9e1409dc --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazRedefineResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesUpscalePostUpscaleImageTopazRedefineResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazRedefineResponse2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazRedefineResponse2.Json.g.cs new file mode 100644 index 00000000..f2eafd99 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazRedefineResponse2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesUpscalePostUpscaleImageTopazRedefineResponse2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazRedefineResponse2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazRedefineResponse2), + jsonSerializerContext) as global::Ideogram.ImagesUpscalePostUpscaleImageTopazRedefineResponse2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazRedefineResponse2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazRedefineResponse2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazRedefineResponse2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesUpscalePostUpscaleImageTopazRedefineResponse2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazRedefineResponse2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazRedefineResponse2.g.cs new file mode 100644 index 00000000..8469efce --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazRedefineResponse2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesUpscalePostUpscaleImageTopazRedefineResponse2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazRedefineResponse3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazRedefineResponse3.Json.g.cs new file mode 100644 index 00000000..eca18d32 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazRedefineResponse3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesUpscalePostUpscaleImageTopazRedefineResponse3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazRedefineResponse3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazRedefineResponse3), + jsonSerializerContext) as global::Ideogram.ImagesUpscalePostUpscaleImageTopazRedefineResponse3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazRedefineResponse3? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazRedefineResponse3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazRedefineResponse3), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesUpscalePostUpscaleImageTopazRedefineResponse3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazRedefineResponse3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazRedefineResponse3.g.cs new file mode 100644 index 00000000..dd8c8ce9 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazRedefineResponse3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesUpscalePostUpscaleImageTopazRedefineResponse3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazRedefineResponse4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazRedefineResponse4.Json.g.cs new file mode 100644 index 00000000..377c064f --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazRedefineResponse4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesUpscalePostUpscaleImageTopazRedefineResponse4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazRedefineResponse4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazRedefineResponse4), + jsonSerializerContext) as global::Ideogram.ImagesUpscalePostUpscaleImageTopazRedefineResponse4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazRedefineResponse4? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazRedefineResponse4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazRedefineResponse4), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesUpscalePostUpscaleImageTopazRedefineResponse4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazRedefineResponse4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazRedefineResponse4.g.cs new file mode 100644 index 00000000..e3002b64 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazRedefineResponse4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesUpscalePostUpscaleImageTopazRedefineResponse4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazRedefineResponse5.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazRedefineResponse5.Json.g.cs new file mode 100644 index 00000000..e274ec3f --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazRedefineResponse5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesUpscalePostUpscaleImageTopazRedefineResponse5 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazRedefineResponse5? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazRedefineResponse5), + jsonSerializerContext) as global::Ideogram.ImagesUpscalePostUpscaleImageTopazRedefineResponse5; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazRedefineResponse5? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazRedefineResponse5? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazRedefineResponse5), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesUpscalePostUpscaleImageTopazRedefineResponse5; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazRedefineResponse5.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazRedefineResponse5.g.cs new file mode 100644 index 00000000..9e40eec7 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazRedefineResponse5.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesUpscalePostUpscaleImageTopazRedefineResponse5 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazRedefineResponse6.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazRedefineResponse6.Json.g.cs new file mode 100644 index 00000000..85b1c578 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazRedefineResponse6.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesUpscalePostUpscaleImageTopazRedefineResponse6 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazRedefineResponse6? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazRedefineResponse6), + jsonSerializerContext) as global::Ideogram.ImagesUpscalePostUpscaleImageTopazRedefineResponse6; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazRedefineResponse6? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazRedefineResponse6? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazRedefineResponse6), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesUpscalePostUpscaleImageTopazRedefineResponse6; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazRedefineResponse6.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazRedefineResponse6.g.cs new file mode 100644 index 00000000..3d655f5d --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazRedefineResponse6.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesUpscalePostUpscaleImageTopazRedefineResponse6 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazStandardV2Request.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazStandardV2Request.Json.g.cs new file mode 100644 index 00000000..a7860817 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazStandardV2Request.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesUpscalePostUpscaleImageTopazStandardV2Request + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazStandardV2Request? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazStandardV2Request), + jsonSerializerContext) as global::Ideogram.ImagesUpscalePostUpscaleImageTopazStandardV2Request; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazStandardV2Request? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazStandardV2Request? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazStandardV2Request), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesUpscalePostUpscaleImageTopazStandardV2Request; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazStandardV2Request.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazStandardV2Request.g.cs new file mode 100644 index 00000000..b42dd0be --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazStandardV2Request.g.cs @@ -0,0 +1,200 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// + /// + public sealed partial class ImagesUpscalePostUpscaleImageTopazStandardV2Request + { + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("image")] + [global::System.Text.Json.Serialization.JsonRequired] + public required byte[] Image { get; set; } + + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Imagename { get; set; } + + /// + /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
+ /// Default Value: x2 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("upscale_factor")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactorJsonConverter))] + public global::Ideogram.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? UpscaleFactor { get; set; } + + /// + /// Overall intensity of the enhancement model, from 0.01 to 1. Higher values look crisper but can turn unrealistic. Omit to let the model choose per image. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("strength")] + public string? Strength { get; set; } + + /// + /// Edge sharpening applied after enlarging, from 0 to 1. Omit to let the model choose per image. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("sharpen")] + public string? Sharpen { get; set; } + + /// + /// Noise and grain reduction, from 0 to 1. Omit to let the model choose per image. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("denoise")] + public string? Denoise { get; set; } + + /// + /// Compression artifact removal, from 0 to 1. Omit to let the model choose per image. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("fix_compression")] + public string? FixCompression { get; set; } + + /// + /// Recover detail in faces. When true, `face_enhancement_strength` and `face_enhancement_creativity` are required. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("face_enhancement")] + public bool? FaceEnhancement { get; set; } + + /// + /// How strongly faces are recovered, from 0 to 1. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("face_enhancement_strength")] + public string? FaceEnhancementStrength { get; set; } + + /// + /// How freely face recovery may reinterpret features, from 0 (faithful) to 1 (creative). + /// + [global::System.Text.Json.Serialization.JsonPropertyName("face_enhancement_creativity")] + public string? FaceEnhancementCreativity { get; set; } + + /// + /// Where enhancements apply. Omit to let the model choose per image. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("subject_detection")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaSubjectDetectionJsonConverter))] + public global::Ideogram.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaSubjectDetection? SubjectDetection { get; set; } + + /// + /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
+ /// Default Value: false + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] + public string? WebhookUrl { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
+ /// Default Value: x2 + /// + /// + /// Overall intensity of the enhancement model, from 0.01 to 1. Higher values look crisper but can turn unrealistic. Omit to let the model choose per image. + /// + /// + /// Edge sharpening applied after enlarging, from 0 to 1. Omit to let the model choose per image. + /// + /// + /// Noise and grain reduction, from 0 to 1. Omit to let the model choose per image. + /// + /// + /// Compression artifact removal, from 0 to 1. Omit to let the model choose per image. + /// + /// + /// Recover detail in faces. When true, `face_enhancement_strength` and `face_enhancement_creativity` are required. + /// + /// + /// How strongly faces are recovered, from 0 to 1. + /// + /// + /// How freely face recovery may reinterpret features, from 0 (faithful) to 1 (creative). + /// + /// + /// Where enhancements apply. Omit to let the model choose per image. + /// + /// + /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ImagesUpscalePostUpscaleImageTopazStandardV2Request( + byte[] image, + string imagename, + global::Ideogram.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? upscaleFactor, + string? strength, + string? sharpen, + string? denoise, + string? fixCompression, + bool? faceEnhancement, + string? faceEnhancementStrength, + string? faceEnhancementCreativity, + global::Ideogram.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaSubjectDetection? subjectDetection, + bool? async, + string? webhookUrl) + { + this.Image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + this.Imagename = imagename ?? throw new global::System.ArgumentNullException(nameof(imagename)); + this.UpscaleFactor = upscaleFactor; + this.Strength = strength; + this.Sharpen = sharpen; + this.Denoise = denoise; + this.FixCompression = fixCompression; + this.FaceEnhancement = faceEnhancement; + this.FaceEnhancementStrength = faceEnhancementStrength; + this.FaceEnhancementCreativity = faceEnhancementCreativity; + this.SubjectDetection = subjectDetection; + this.Async = async; + this.WebhookUrl = webhookUrl; + } + + /// + /// Initializes a new instance of the class. + /// + public ImagesUpscalePostUpscaleImageTopazStandardV2Request() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazStandardV2Response.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazStandardV2Response.Json.g.cs new file mode 100644 index 00000000..7da2b19b --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazStandardV2Response.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesUpscalePostUpscaleImageTopazStandardV2Response + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazStandardV2Response? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazStandardV2Response), + jsonSerializerContext) as global::Ideogram.ImagesUpscalePostUpscaleImageTopazStandardV2Response; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazStandardV2Response? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazStandardV2Response? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazStandardV2Response), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesUpscalePostUpscaleImageTopazStandardV2Response; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazStandardV2Response.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazStandardV2Response.g.cs new file mode 100644 index 00000000..5f51cf32 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazStandardV2Response.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesUpscalePostUpscaleImageTopazStandardV2Response + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazStandardV2Response2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazStandardV2Response2.Json.g.cs new file mode 100644 index 00000000..86bac945 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazStandardV2Response2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesUpscalePostUpscaleImageTopazStandardV2Response2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazStandardV2Response2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazStandardV2Response2), + jsonSerializerContext) as global::Ideogram.ImagesUpscalePostUpscaleImageTopazStandardV2Response2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazStandardV2Response2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazStandardV2Response2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazStandardV2Response2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesUpscalePostUpscaleImageTopazStandardV2Response2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazStandardV2Response2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazStandardV2Response2.g.cs new file mode 100644 index 00000000..40f209fb --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazStandardV2Response2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesUpscalePostUpscaleImageTopazStandardV2Response2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazStandardV2Response3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazStandardV2Response3.Json.g.cs new file mode 100644 index 00000000..1b3d25b1 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazStandardV2Response3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesUpscalePostUpscaleImageTopazStandardV2Response3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazStandardV2Response3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazStandardV2Response3), + jsonSerializerContext) as global::Ideogram.ImagesUpscalePostUpscaleImageTopazStandardV2Response3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazStandardV2Response3? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazStandardV2Response3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazStandardV2Response3), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesUpscalePostUpscaleImageTopazStandardV2Response3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazStandardV2Response3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazStandardV2Response3.g.cs new file mode 100644 index 00000000..6b69c447 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazStandardV2Response3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesUpscalePostUpscaleImageTopazStandardV2Response3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazStandardV2Response4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazStandardV2Response4.Json.g.cs new file mode 100644 index 00000000..38f8d056 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazStandardV2Response4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesUpscalePostUpscaleImageTopazStandardV2Response4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazStandardV2Response4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazStandardV2Response4), + jsonSerializerContext) as global::Ideogram.ImagesUpscalePostUpscaleImageTopazStandardV2Response4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazStandardV2Response4? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazStandardV2Response4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazStandardV2Response4), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesUpscalePostUpscaleImageTopazStandardV2Response4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazStandardV2Response4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazStandardV2Response4.g.cs new file mode 100644 index 00000000..b15fd0d5 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazStandardV2Response4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesUpscalePostUpscaleImageTopazStandardV2Response4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazStandardV2Response5.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazStandardV2Response5.Json.g.cs new file mode 100644 index 00000000..58f08e4b --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazStandardV2Response5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesUpscalePostUpscaleImageTopazStandardV2Response5 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazStandardV2Response5? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazStandardV2Response5), + jsonSerializerContext) as global::Ideogram.ImagesUpscalePostUpscaleImageTopazStandardV2Response5; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazStandardV2Response5? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazStandardV2Response5? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazStandardV2Response5), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesUpscalePostUpscaleImageTopazStandardV2Response5; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazStandardV2Response5.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazStandardV2Response5.g.cs new file mode 100644 index 00000000..19e02108 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazStandardV2Response5.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesUpscalePostUpscaleImageTopazStandardV2Response5 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazTextRefineRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazTextRefineRequest.Json.g.cs new file mode 100644 index 00000000..7c08c88e --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazTextRefineRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesUpscalePostUpscaleImageTopazTextRefineRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazTextRefineRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazTextRefineRequest), + jsonSerializerContext) as global::Ideogram.ImagesUpscalePostUpscaleImageTopazTextRefineRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazTextRefineRequest? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazTextRefineRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazTextRefineRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesUpscalePostUpscaleImageTopazTextRefineRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazTextRefineRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazTextRefineRequest.g.cs new file mode 100644 index 00000000..f0c83387 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazTextRefineRequest.g.cs @@ -0,0 +1,211 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// + /// + public sealed partial class ImagesUpscalePostUpscaleImageTopazTextRefineRequest + { + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("image")] + [global::System.Text.Json.Serialization.JsonRequired] + public required byte[] Image { get; set; } + + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Imagename { get; set; } + + /// + /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
+ /// Default Value: x2 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("upscale_factor")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactorJsonConverter))] + public global::Ideogram.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? UpscaleFactor { get; set; } + + /// + /// Overall intensity of the enhancement model, from 0.01 to 1. Higher values look crisper but can turn unrealistic. Omit to let the model choose per image. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("strength")] + public string? Strength { get; set; } + + /// + /// Edge sharpening applied after enlarging, from 0 to 1. Omit to let the model choose per image. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("sharpen")] + public string? Sharpen { get; set; } + + /// + /// Noise and grain reduction, from 0 to 1. Omit to let the model choose per image. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("denoise")] + public string? Denoise { get; set; } + + /// + /// Compression artifact removal, from 0 to 1. Omit to let the model choose per image. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("fix_compression")] + public string? FixCompression { get; set; } + + /// + /// Recover detail in faces. When true, `face_enhancement_strength` and `face_enhancement_creativity` are required. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("face_enhancement")] + public bool? FaceEnhancement { get; set; } + + /// + /// How strongly faces are recovered, from 0 to 1. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("face_enhancement_strength")] + public string? FaceEnhancementStrength { get; set; } + + /// + /// How freely face recovery may reinterpret features, from 0 (faithful) to 1 (creative). + /// + [global::System.Text.Json.Serialization.JsonPropertyName("face_enhancement_creativity")] + public string? FaceEnhancementCreativity { get; set; } + + /// + /// Where enhancements apply. Omit to let the model choose per image. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("subject_detection")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetectionJsonConverter))] + public global::Ideogram.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection? SubjectDetection { get; set; } + + /// + /// Random seed. Set for reproducible generation. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("seed")] + public int? Seed { get; set; } + + /// + /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
+ /// Default Value: false + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] + public string? WebhookUrl { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
+ /// Default Value: x2 + /// + /// + /// Overall intensity of the enhancement model, from 0.01 to 1. Higher values look crisper but can turn unrealistic. Omit to let the model choose per image. + /// + /// + /// Edge sharpening applied after enlarging, from 0 to 1. Omit to let the model choose per image. + /// + /// + /// Noise and grain reduction, from 0 to 1. Omit to let the model choose per image. + /// + /// + /// Compression artifact removal, from 0 to 1. Omit to let the model choose per image. + /// + /// + /// Recover detail in faces. When true, `face_enhancement_strength` and `face_enhancement_creativity` are required. + /// + /// + /// How strongly faces are recovered, from 0 to 1. + /// + /// + /// How freely face recovery may reinterpret features, from 0 (faithful) to 1 (creative). + /// + /// + /// Where enhancements apply. Omit to let the model choose per image. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ImagesUpscalePostUpscaleImageTopazTextRefineRequest( + byte[] image, + string imagename, + global::Ideogram.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? upscaleFactor, + string? strength, + string? sharpen, + string? denoise, + string? fixCompression, + bool? faceEnhancement, + string? faceEnhancementStrength, + string? faceEnhancementCreativity, + global::Ideogram.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection? subjectDetection, + int? seed, + bool? async, + string? webhookUrl) + { + this.Image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + this.Imagename = imagename ?? throw new global::System.ArgumentNullException(nameof(imagename)); + this.UpscaleFactor = upscaleFactor; + this.Strength = strength; + this.Sharpen = sharpen; + this.Denoise = denoise; + this.FixCompression = fixCompression; + this.FaceEnhancement = faceEnhancement; + this.FaceEnhancementStrength = faceEnhancementStrength; + this.FaceEnhancementCreativity = faceEnhancementCreativity; + this.SubjectDetection = subjectDetection; + this.Seed = seed; + this.Async = async; + this.WebhookUrl = webhookUrl; + } + + /// + /// Initializes a new instance of the class. + /// + public ImagesUpscalePostUpscaleImageTopazTextRefineRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazTextRefineResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazTextRefineResponse.Json.g.cs new file mode 100644 index 00000000..73b4db36 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazTextRefineResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesUpscalePostUpscaleImageTopazTextRefineResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazTextRefineResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazTextRefineResponse), + jsonSerializerContext) as global::Ideogram.ImagesUpscalePostUpscaleImageTopazTextRefineResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazTextRefineResponse? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazTextRefineResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazTextRefineResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesUpscalePostUpscaleImageTopazTextRefineResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazTextRefineResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazTextRefineResponse.g.cs new file mode 100644 index 00000000..228db036 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazTextRefineResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesUpscalePostUpscaleImageTopazTextRefineResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazTextRefineResponse2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazTextRefineResponse2.Json.g.cs new file mode 100644 index 00000000..6b31d49a --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazTextRefineResponse2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesUpscalePostUpscaleImageTopazTextRefineResponse2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazTextRefineResponse2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazTextRefineResponse2), + jsonSerializerContext) as global::Ideogram.ImagesUpscalePostUpscaleImageTopazTextRefineResponse2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazTextRefineResponse2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazTextRefineResponse2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazTextRefineResponse2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesUpscalePostUpscaleImageTopazTextRefineResponse2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazTextRefineResponse2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazTextRefineResponse2.g.cs new file mode 100644 index 00000000..0ab55f04 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazTextRefineResponse2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesUpscalePostUpscaleImageTopazTextRefineResponse2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazTextRefineResponse3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazTextRefineResponse3.Json.g.cs new file mode 100644 index 00000000..5925ac3d --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazTextRefineResponse3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesUpscalePostUpscaleImageTopazTextRefineResponse3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazTextRefineResponse3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazTextRefineResponse3), + jsonSerializerContext) as global::Ideogram.ImagesUpscalePostUpscaleImageTopazTextRefineResponse3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazTextRefineResponse3? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazTextRefineResponse3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazTextRefineResponse3), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesUpscalePostUpscaleImageTopazTextRefineResponse3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazTextRefineResponse3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazTextRefineResponse3.g.cs new file mode 100644 index 00000000..266600ab --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazTextRefineResponse3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesUpscalePostUpscaleImageTopazTextRefineResponse3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazTextRefineResponse4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazTextRefineResponse4.Json.g.cs new file mode 100644 index 00000000..81ebc7fe --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazTextRefineResponse4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesUpscalePostUpscaleImageTopazTextRefineResponse4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazTextRefineResponse4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazTextRefineResponse4), + jsonSerializerContext) as global::Ideogram.ImagesUpscalePostUpscaleImageTopazTextRefineResponse4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazTextRefineResponse4? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazTextRefineResponse4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazTextRefineResponse4), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesUpscalePostUpscaleImageTopazTextRefineResponse4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazTextRefineResponse4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazTextRefineResponse4.g.cs new file mode 100644 index 00000000..9964d781 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazTextRefineResponse4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesUpscalePostUpscaleImageTopazTextRefineResponse4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazTextRefineResponse5.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazTextRefineResponse5.Json.g.cs new file mode 100644 index 00000000..2bd24186 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazTextRefineResponse5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesUpscalePostUpscaleImageTopazTextRefineResponse5 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazTextRefineResponse5? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazTextRefineResponse5), + jsonSerializerContext) as global::Ideogram.ImagesUpscalePostUpscaleImageTopazTextRefineResponse5; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazTextRefineResponse5? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazTextRefineResponse5? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazTextRefineResponse5), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesUpscalePostUpscaleImageTopazTextRefineResponse5; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazTextRefineResponse5.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazTextRefineResponse5.g.cs new file mode 100644 index 00000000..2469bca1 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazTextRefineResponse5.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesUpscalePostUpscaleImageTopazTextRefineResponse5 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazWonder35Request.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazWonder35Request.Json.g.cs new file mode 100644 index 00000000..d8094c55 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazWonder35Request.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesUpscalePostUpscaleImageTopazWonder35Request + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazWonder35Request? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazWonder35Request), + jsonSerializerContext) as global::Ideogram.ImagesUpscalePostUpscaleImageTopazWonder35Request; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazWonder35Request? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazWonder35Request? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazWonder35Request), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesUpscalePostUpscaleImageTopazWonder35Request; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazWonder35Request.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazWonder35Request.g.cs new file mode 100644 index 00000000..8ad18a03 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazWonder35Request.g.cs @@ -0,0 +1,136 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// + /// + public sealed partial class ImagesUpscalePostUpscaleImageTopazWonder35Request + { + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("image")] + [global::System.Text.Json.Serialization.JsonRequired] + public required byte[] Image { get; set; } + + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Imagename { get; set; } + + /// + /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
+ /// Default Value: x2 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("upscale_factor")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaUpscaleFactorJsonConverter))] + public global::Ideogram.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? UpscaleFactor { get; set; } + + /// + /// How strongly the generative model reconstructs detail while upscaling. Lower values stay closer to the source image; higher values produce a more enhanced result.
+ /// Default Value: high + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("enhancement_strength")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaEnhancementStrengthJsonConverter))] + public global::Ideogram.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaEnhancementStrength? EnhancementStrength { get; set; } + + /// + /// Random seed. Set for reproducible generation. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("seed")] + public int? Seed { get; set; } + + /// + /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
+ /// Default Value: false + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] + public string? WebhookUrl { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
+ /// Default Value: x2 + /// + /// + /// How strongly the generative model reconstructs detail while upscaling. Lower values stay closer to the source image; higher values produce a more enhanced result.
+ /// Default Value: high + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ImagesUpscalePostUpscaleImageTopazWonder35Request( + byte[] image, + string imagename, + global::Ideogram.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? upscaleFactor, + global::Ideogram.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaEnhancementStrength? enhancementStrength, + int? seed, + bool? async, + string? webhookUrl) + { + this.Image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + this.Imagename = imagename ?? throw new global::System.ArgumentNullException(nameof(imagename)); + this.UpscaleFactor = upscaleFactor; + this.EnhancementStrength = enhancementStrength; + this.Seed = seed; + this.Async = async; + this.WebhookUrl = webhookUrl; + } + + /// + /// Initializes a new instance of the class. + /// + public ImagesUpscalePostUpscaleImageTopazWonder35Request() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazWonder35Response.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazWonder35Response.Json.g.cs new file mode 100644 index 00000000..f26a8a8a --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazWonder35Response.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesUpscalePostUpscaleImageTopazWonder35Response + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazWonder35Response? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazWonder35Response), + jsonSerializerContext) as global::Ideogram.ImagesUpscalePostUpscaleImageTopazWonder35Response; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazWonder35Response? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazWonder35Response? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazWonder35Response), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesUpscalePostUpscaleImageTopazWonder35Response; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazWonder35Response.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazWonder35Response.g.cs new file mode 100644 index 00000000..11aeff49 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazWonder35Response.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesUpscalePostUpscaleImageTopazWonder35Response + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazWonder35Response2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazWonder35Response2.Json.g.cs new file mode 100644 index 00000000..8e35f5ba --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazWonder35Response2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesUpscalePostUpscaleImageTopazWonder35Response2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazWonder35Response2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazWonder35Response2), + jsonSerializerContext) as global::Ideogram.ImagesUpscalePostUpscaleImageTopazWonder35Response2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazWonder35Response2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazWonder35Response2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazWonder35Response2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesUpscalePostUpscaleImageTopazWonder35Response2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazWonder35Response2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazWonder35Response2.g.cs new file mode 100644 index 00000000..a9baaddf --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazWonder35Response2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesUpscalePostUpscaleImageTopazWonder35Response2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazWonder35Response3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazWonder35Response3.Json.g.cs new file mode 100644 index 00000000..bbd0de13 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazWonder35Response3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesUpscalePostUpscaleImageTopazWonder35Response3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazWonder35Response3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazWonder35Response3), + jsonSerializerContext) as global::Ideogram.ImagesUpscalePostUpscaleImageTopazWonder35Response3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazWonder35Response3? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazWonder35Response3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazWonder35Response3), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesUpscalePostUpscaleImageTopazWonder35Response3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazWonder35Response3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazWonder35Response3.g.cs new file mode 100644 index 00000000..c2c47354 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazWonder35Response3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesUpscalePostUpscaleImageTopazWonder35Response3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazWonder35Response4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazWonder35Response4.Json.g.cs new file mode 100644 index 00000000..09fe9d8c --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazWonder35Response4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesUpscalePostUpscaleImageTopazWonder35Response4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazWonder35Response4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazWonder35Response4), + jsonSerializerContext) as global::Ideogram.ImagesUpscalePostUpscaleImageTopazWonder35Response4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazWonder35Response4? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazWonder35Response4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazWonder35Response4), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesUpscalePostUpscaleImageTopazWonder35Response4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazWonder35Response4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazWonder35Response4.g.cs new file mode 100644 index 00000000..320aab0c --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazWonder35Response4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesUpscalePostUpscaleImageTopazWonder35Response4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazWonder35Response5.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazWonder35Response5.Json.g.cs new file mode 100644 index 00000000..dda8e34e --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazWonder35Response5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImagesUpscalePostUpscaleImageTopazWonder35Response5 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazWonder35Response5? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazWonder35Response5), + jsonSerializerContext) as global::Ideogram.ImagesUpscalePostUpscaleImageTopazWonder35Response5; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazWonder35Response5? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImagesUpscalePostUpscaleImageTopazWonder35Response5? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImagesUpscalePostUpscaleImageTopazWonder35Response5), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImagesUpscalePostUpscaleImageTopazWonder35Response5; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazWonder35Response5.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazWonder35Response5.g.cs new file mode 100644 index 00000000..19338807 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImagesUpscalePostUpscaleImageTopazWonder35Response5.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ImagesUpscalePostUpscaleImageTopazWonder35Response5 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.InitialImageRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.InitialImageRequest.Json.g.cs deleted file mode 100644 index 5509ea79..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.InitialImageRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class InitialImageRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.InitialImageRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.InitialImageRequest), - jsonSerializerContext) as global::Ideogram.InitialImageRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.InitialImageRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.InitialImageRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.InitialImageRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.InitialImageRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.InitialImageRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.InitialImageRequest.g.cs deleted file mode 100644 index dbb6fb3b..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.InitialImageRequest.g.cs +++ /dev/null @@ -1,50 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// A request to generate a new image using a provided image and a prompt.
- /// Example: {"aspect_ratio":"ASPECT_10_16","magic_prompt_option":"ON","model":"V_2","prompt":"A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there is an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset.","image_weight":50} - ///
- public sealed partial class InitialImageRequest - { - /// - /// Default Value: 50
- /// Example: 50 - ///
- /// 50 - [global::System.Text.Json.Serialization.JsonPropertyName("image_weight")] - public int? ImageWeight { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Default Value: 50
- /// Example: 50 - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public InitialImageRequest( - int? imageWeight) - { - this.ImageWeight = imageWeight; - } - - /// - /// Initializes a new instance of the class. - /// - public InitialImageRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.InpaintImageIdeogramV3CharacterRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.InpaintImageIdeogramV3CharacterRequest.Json.g.cs deleted file mode 100644 index 711b0091..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.InpaintImageIdeogramV3CharacterRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class InpaintImageIdeogramV3CharacterRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.InpaintImageIdeogramV3CharacterRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.InpaintImageIdeogramV3CharacterRequest), - jsonSerializerContext) as global::Ideogram.InpaintImageIdeogramV3CharacterRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.InpaintImageIdeogramV3CharacterRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.InpaintImageIdeogramV3CharacterRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.InpaintImageIdeogramV3CharacterRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.InpaintImageIdeogramV3CharacterRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.InpaintImageIdeogramV3CharacterRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.InpaintImageIdeogramV3CharacterRequest.g.cs deleted file mode 100644 index ce62a408..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.InpaintImageIdeogramV3CharacterRequest.g.cs +++ /dev/null @@ -1,399 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The source `image` and its `mask` are both required and must be
- /// uploaded in a multipart request. Upload one character reference as
- /// `character_reference_images`. - ///
- public sealed partial class InpaintImageIdeogramV3CharacterRequest - { - /// - /// The prompt describing the repainted result. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Prompt { get; set; } - - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - ///
- /// {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - [global::System.Text.Json.Serialization.JsonPropertyName("image_asset_identifier")] - public global::Ideogram.AssetIdentifier? ImageAssetIdentifier { get; set; } - - /// - /// The source image to repaint (max 25MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The output matches its size, snapped to the nearest supported resolution. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image")] - public byte[]? Image { get; set; } - - /// - /// The source image to repaint (max 25MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The output matches its size, snapped to the nearest supported resolution. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] - public string? Imagename { get; set; } - - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - ///
- /// {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - [global::System.Text.Json.Serialization.JsonPropertyName("mask_asset_identifier")] - public global::Ideogram.AssetIdentifier? MaskAssetIdentifier { get; set; } - - /// - /// A black-and-white mask the same size as the source image. Black marks the region to repaint. JPEG, PNG, and WEBP are supported. Multipart requests only. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("mask")] - public byte[]? Mask { get; set; } - - /// - /// A black-and-white mask the same size as the source image. Black marks the region to repaint. JPEG, PNG, and WEBP are supported. Multipart requests only. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("maskname")] - public string? Maskname { get; set; } - - /// - /// A saved character to feature, by its URL-safe base64 collection id. Takes priority over `character_reference_images` if both are supplied. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("character_reference_collection_id")] - public string? CharacterReferenceCollectionId { get; set; } - - /// - /// Optional URL-safe base64 version id pinning a specific version of the `character_reference_collection_id` collection. Ignored without it. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("character_reference_collection_version_id")] - public string? CharacterReferenceCollectionVersionId { get; set; } - - /// - /// An existing upload or generated image asset to use as the character reference, by reference. Takes priority over `character_reference_images` if both are supplied. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("character_reference_asset_identifiers")] - public global::System.Collections.Generic.IList? CharacterReferenceAssetIdentifiers { get; set; } - - /// - /// An image to use as the character reference (max 25MB). JPEG, PNG, and WEBP are supported. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("character_reference_images")] - public global::System.Collections.Generic.IList? CharacterReferenceImages { get; set; } - - /// - /// An existing upload or generated image asset to use as the character reference mask, by reference. The same rules as `character_reference_mask` apply. Takes priority over `character_reference_mask` if both are supplied. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("character_reference_mask_asset_identifier")] - public global::Ideogram.AssetIdentifier? CharacterReferenceMaskAssetIdentifier { get; set; } - - /// - /// Optional grayscale mask for the character reference image, the same size as that image, marking where the character is. Only JPEG, PNG, and WEBP formats are supported. Multipart requests only; cannot be combined with `character_reference_collection_id`. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("character_reference_mask")] - public byte[]? CharacterReferenceMask { get; set; } - - /// - /// Optional grayscale mask for the character reference image, the same size as that image, marking where the character is. Only JPEG, PNG, and WEBP formats are supported. Multipart requests only; cannot be combined with `character_reference_collection_id`. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("character_reference_maskname")] - public string? CharacterReferenceMaskname { get; set; } - - /// - /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
- /// Default Value: auto - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.MagicPromptModeJsonConverter))] - public global::Ideogram.MagicPromptMode? MagicPrompt { get; set; } - - /// - /// The number of images to generate.
- /// Default Value: 1 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] - public int? NumImages { get; set; } - - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - ///
- /// 12345 - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// The rendering speed to use.
- /// Default Value: default - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("rendering_speed")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.InpaintImageIdeogramV3CharacterRequestRenderingSpeedJsonConverter))] - public global::Ideogram.InpaintImageIdeogramV3CharacterRequestRenderingSpeed? RenderingSpeed { get; set; } - - /// - /// The style type to repaint the character with. Defaults to `auto`. `realistic` and `fiction` are supported for character-only requests; style codes or style references (not both) require `auto`. For API-key callers, combining a style with a character requires that feature to be enabled for their account.
- /// Default Value: auto - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("style_type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.InpaintImageIdeogramV3CharacterRequestStyleTypeJsonConverter))] - public global::Ideogram.InpaintImageIdeogramV3CharacterRequestStyleType? StyleType { get; set; } - - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - ///
- /// [AAFF5733, 0133FF57, DE3357FF] - [global::System.Text.Json.Serialization.JsonPropertyName("style_codes")] - public global::System.Collections.Generic.IList? StyleCodes { get; set; } - - /// - /// A saved style to apply, by its URL-safe base64 collection id. Takes priority over `style_reference_images` if both are supplied. Cannot be combined with `style_codes`. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("style_reference_collection_id")] - public string? StyleReferenceCollectionId { get; set; } - - /// - /// Optional URL-safe base64 version id pinning a specific version of the `style_reference_collection_id` collection. Ignored without it. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("style_reference_collection_version_id")] - public string? StyleReferenceCollectionVersionId { get; set; } - - /// - /// Existing upload or generated image assets to use as style references, by reference. Takes priority over `style_reference_images` if both are supplied. Cannot be combined with `style_codes`. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("style_reference_asset_identifiers")] - public global::System.Collections.Generic.IList? StyleReferenceAssetIdentifiers { get; set; } - - /// - /// Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported. Cannot be combined with `style_codes`. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("style_reference_images")] - public global::System.Collections.Generic.IList? StyleReferenceImages { get; set; } - - /// - /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("enable_copyright_detection")] - public bool? EnableCopyrightDetection { get; set; } - - /// - /// When false (the default), the request waits until the repainted images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
- /// Default Value: false - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("async")] - public bool? Async { get; set; } - - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - ///
- /// https://api.example.com/webhooks/ideogram - [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] - public string? WebhookUrl { get; set; } - - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("target_collection_id")] - public string? TargetCollectionId { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The prompt describing the repainted result. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The source image to repaint (max 25MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The output matches its size, snapped to the nearest supported resolution. - /// - /// - /// The source image to repaint (max 25MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The output matches its size, snapped to the nearest supported resolution. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// A black-and-white mask the same size as the source image. Black marks the region to repaint. JPEG, PNG, and WEBP are supported. Multipart requests only. - /// - /// - /// A black-and-white mask the same size as the source image. Black marks the region to repaint. JPEG, PNG, and WEBP are supported. Multipart requests only. - /// - /// - /// A saved character to feature, by its URL-safe base64 collection id. Takes priority over `character_reference_images` if both are supplied. - /// - /// - /// Optional URL-safe base64 version id pinning a specific version of the `character_reference_collection_id` collection. Ignored without it. - /// - /// - /// An existing upload or generated image asset to use as the character reference, by reference. Takes priority over `character_reference_images` if both are supplied. - /// - /// - /// An image to use as the character reference (max 25MB). JPEG, PNG, and WEBP are supported. - /// - /// - /// An existing upload or generated image asset to use as the character reference mask, by reference. The same rules as `character_reference_mask` apply. Takes priority over `character_reference_mask` if both are supplied. - /// - /// - /// Optional grayscale mask for the character reference image, the same size as that image, marking where the character is. Only JPEG, PNG, and WEBP formats are supported. Multipart requests only; cannot be combined with `character_reference_collection_id`. - /// - /// - /// Optional grayscale mask for the character reference image, the same size as that image, marking where the character is. Only JPEG, PNG, and WEBP formats are supported. Multipart requests only; cannot be combined with `character_reference_collection_id`. - /// - /// - /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
- /// Default Value: auto - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The rendering speed to use.
- /// Default Value: default - /// - /// - /// The style type to repaint the character with. Defaults to `auto`. `realistic` and `fiction` are supported for character-only requests; style codes or style references (not both) require `auto`. For API-key callers, combining a style with a character requires that feature to be enabled for their account.
- /// Default Value: auto - /// - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - /// - /// - /// A saved style to apply, by its URL-safe base64 collection id. Takes priority over `style_reference_images` if both are supplied. Cannot be combined with `style_codes`. - /// - /// - /// Optional URL-safe base64 version id pinning a specific version of the `style_reference_collection_id` collection. Ignored without it. - /// - /// - /// Existing upload or generated image assets to use as style references, by reference. Takes priority over `style_reference_images` if both are supplied. Cannot be combined with `style_codes`. - /// - /// - /// Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported. Cannot be combined with `style_codes`. - /// - /// - /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. - /// - /// - /// When false (the default), the request waits until the repainted images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public InpaintImageIdeogramV3CharacterRequest( - string prompt, - global::Ideogram.AssetIdentifier? imageAssetIdentifier, - byte[]? image, - string? imagename, - global::Ideogram.AssetIdentifier? maskAssetIdentifier, - byte[]? mask, - string? maskname, - string? characterReferenceCollectionId, - string? characterReferenceCollectionVersionId, - global::System.Collections.Generic.IList? characterReferenceAssetIdentifiers, - global::System.Collections.Generic.IList? characterReferenceImages, - global::Ideogram.AssetIdentifier? characterReferenceMaskAssetIdentifier, - byte[]? characterReferenceMask, - string? characterReferenceMaskname, - global::Ideogram.MagicPromptMode? magicPrompt, - int? numImages, - int? seed, - global::Ideogram.InpaintImageIdeogramV3CharacterRequestRenderingSpeed? renderingSpeed, - global::Ideogram.InpaintImageIdeogramV3CharacterRequestStyleType? styleType, - global::System.Collections.Generic.IList? styleCodes, - string? styleReferenceCollectionId, - string? styleReferenceCollectionVersionId, - global::System.Collections.Generic.IList? styleReferenceAssetIdentifiers, - global::System.Collections.Generic.IList? styleReferenceImages, - bool? enableCopyrightDetection, - bool? async, - string? webhookUrl, - bool? @private, - string? targetCollectionId) - { - this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); - this.ImageAssetIdentifier = imageAssetIdentifier; - this.Image = image; - this.Imagename = imagename; - this.MaskAssetIdentifier = maskAssetIdentifier; - this.Mask = mask; - this.Maskname = maskname; - this.CharacterReferenceCollectionId = characterReferenceCollectionId; - this.CharacterReferenceCollectionVersionId = characterReferenceCollectionVersionId; - this.CharacterReferenceAssetIdentifiers = characterReferenceAssetIdentifiers; - this.CharacterReferenceImages = characterReferenceImages; - this.CharacterReferenceMaskAssetIdentifier = characterReferenceMaskAssetIdentifier; - this.CharacterReferenceMask = characterReferenceMask; - this.CharacterReferenceMaskname = characterReferenceMaskname; - this.MagicPrompt = magicPrompt; - this.NumImages = numImages; - this.Seed = seed; - this.RenderingSpeed = renderingSpeed; - this.StyleType = styleType; - this.StyleCodes = styleCodes; - this.StyleReferenceCollectionId = styleReferenceCollectionId; - this.StyleReferenceCollectionVersionId = styleReferenceCollectionVersionId; - this.StyleReferenceAssetIdentifiers = styleReferenceAssetIdentifiers; - this.StyleReferenceImages = styleReferenceImages; - this.EnableCopyrightDetection = enableCopyrightDetection; - this.Async = async; - this.WebhookUrl = webhookUrl; - this.Private = @private; - this.TargetCollectionId = targetCollectionId; - } - - /// - /// Initializes a new instance of the class. - /// - public InpaintImageIdeogramV3CharacterRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.InpaintImageIdeogramV3CharacterRequestRenderingSpeed.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.InpaintImageIdeogramV3CharacterRequestRenderingSpeed.g.cs deleted file mode 100644 index 6671828d..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.InpaintImageIdeogramV3CharacterRequestRenderingSpeed.g.cs +++ /dev/null @@ -1,58 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The rendering speed to use.
- /// Default Value: default - ///
- public enum InpaintImageIdeogramV3CharacterRequestRenderingSpeed - { - /// - /// - /// - Default, - /// - /// - /// - Quality, - /// - /// - /// - Turbo, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class InpaintImageIdeogramV3CharacterRequestRenderingSpeedExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this InpaintImageIdeogramV3CharacterRequestRenderingSpeed value) - { - return value switch - { - InpaintImageIdeogramV3CharacterRequestRenderingSpeed.Default => "default", - InpaintImageIdeogramV3CharacterRequestRenderingSpeed.Quality => "quality", - InpaintImageIdeogramV3CharacterRequestRenderingSpeed.Turbo => "turbo", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static InpaintImageIdeogramV3CharacterRequestRenderingSpeed? ToEnum(string value) - { - return value switch - { - "default" => InpaintImageIdeogramV3CharacterRequestRenderingSpeed.Default, - "quality" => InpaintImageIdeogramV3CharacterRequestRenderingSpeed.Quality, - "turbo" => InpaintImageIdeogramV3CharacterRequestRenderingSpeed.Turbo, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.InpaintImageIdeogramV3CharacterRequestStyleType.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.InpaintImageIdeogramV3CharacterRequestStyleType.g.cs deleted file mode 100644 index 3a79ae90..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.InpaintImageIdeogramV3CharacterRequestStyleType.g.cs +++ /dev/null @@ -1,58 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The style type to repaint the character with. Defaults to `auto`. `realistic` and `fiction` are supported for character-only requests; style codes or style references (not both) require `auto`. For API-key callers, combining a style with a character requires that feature to be enabled for their account.
- /// Default Value: auto - ///
- public enum InpaintImageIdeogramV3CharacterRequestStyleType - { - /// - /// - /// - Auto, - /// - /// - /// - Fiction, - /// - /// - /// - Realistic, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class InpaintImageIdeogramV3CharacterRequestStyleTypeExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this InpaintImageIdeogramV3CharacterRequestStyleType value) - { - return value switch - { - InpaintImageIdeogramV3CharacterRequestStyleType.Auto => "auto", - InpaintImageIdeogramV3CharacterRequestStyleType.Fiction => "fiction", - InpaintImageIdeogramV3CharacterRequestStyleType.Realistic => "realistic", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static InpaintImageIdeogramV3CharacterRequestStyleType? ToEnum(string value) - { - return value switch - { - "auto" => InpaintImageIdeogramV3CharacterRequestStyleType.Auto, - "fiction" => InpaintImageIdeogramV3CharacterRequestStyleType.Fiction, - "realistic" => InpaintImageIdeogramV3CharacterRequestStyleType.Realistic, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.InpaintImageIdeogramV3CharacterResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.InpaintImageIdeogramV3CharacterResponse.g.cs index b19e1130..9d6fad71 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.InpaintImageIdeogramV3CharacterResponse.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.InpaintImageIdeogramV3CharacterResponse.g.cs @@ -9,8 +9,7 @@ namespace Ideogram /// `data`. Requests with `async` set to true omit `data`; poll for
/// completion and results with `GET /v2/generations/{generation_id}`
/// using the returned `generation_id`. The seed, width, and height report
- /// the values the request resolved to when the caller left them unset.
- /// Example: {"data":[{"seed":12345,"prompt":"prompt","resolution":"1024x1024","url":"https://openapi-generator.tech","is_image_safe":true},{"seed":12345,"prompt":"prompt","resolution":"1024x1024","url":"https://openapi-generator.tech","is_image_safe":true}],"seed":12345,"generation_id":"generation_id","width":0,"height":6} + /// the values the request resolved to when the caller left them unset. /// public sealed partial class InpaintImageIdeogramV3CharacterResponse { @@ -29,10 +28,8 @@ public sealed partial class InpaintImageIdeogramV3CharacterResponse public global::System.Collections.Generic.IList? Data { get; set; } /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. ///
- /// 12345 [global::System.Text.Json.Serialization.JsonPropertyName("seed")] [global::System.Text.Json.Serialization.JsonRequired] public required int Seed { get; set; } @@ -65,8 +62,7 @@ public sealed partial class InpaintImageIdeogramV3CharacterResponse /// `GET /v2/generations/{generation_id}` polling endpoint. /// /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. /// /// /// The output width in pixels this request resolved to. diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.InpaintImageIdeogramV3CustomModelRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.InpaintImageIdeogramV3CustomModelRequest.Json.g.cs deleted file mode 100644 index e516cce3..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.InpaintImageIdeogramV3CustomModelRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class InpaintImageIdeogramV3CustomModelRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.InpaintImageIdeogramV3CustomModelRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.InpaintImageIdeogramV3CustomModelRequest), - jsonSerializerContext) as global::Ideogram.InpaintImageIdeogramV3CustomModelRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.InpaintImageIdeogramV3CustomModelRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.InpaintImageIdeogramV3CustomModelRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.InpaintImageIdeogramV3CustomModelRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.InpaintImageIdeogramV3CustomModelRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.InpaintImageIdeogramV3CustomModelRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.InpaintImageIdeogramV3CustomModelRequest.g.cs deleted file mode 100644 index 993b8d60..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.InpaintImageIdeogramV3CustomModelRequest.g.cs +++ /dev/null @@ -1,298 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The source `image` and its `mask` are both required and must be
- /// uploaded in a multipart request. - ///
- public sealed partial class InpaintImageIdeogramV3CustomModelRequest - { - /// - /// The prompt describing the repainted result. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Prompt { get; set; } - - /// - /// The custom model URI returned by the custom-model API, in the form `model/<model_name>/version/<version_name>`. The authenticated user or organization must have access to the model.
- /// Example: model/my-custom-model/version/1 - ///
- /// model/my-custom-model/version/1 - [global::System.Text.Json.Serialization.JsonPropertyName("custom_model_uri")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string CustomModelUri { get; set; } - - /// - /// The source image asset to repaint. Takes priority over `image`. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image_asset_identifier")] - public global::Ideogram.AssetIdentifier? ImageAssetIdentifier { get; set; } - - /// - /// The source image to repaint (max 25MB), as JPEG, PNG, or WEBP. Multipart requests only. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image")] - public byte[]? Image { get; set; } - - /// - /// The source image to repaint (max 25MB), as JPEG, PNG, or WEBP. Multipart requests only. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] - public string? Imagename { get; set; } - - /// - /// A black-and-white mask asset the same size as the source image. Black marks the region to repaint. Takes priority over `mask`. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("mask_asset_identifier")] - public global::Ideogram.AssetIdentifier? MaskAssetIdentifier { get; set; } - - /// - /// A black-and-white mask the same size as the source image, as JPEG, PNG, or WEBP. Black marks the region to repaint. Multipart requests only. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("mask")] - public byte[]? Mask { get; set; } - - /// - /// A black-and-white mask the same size as the source image, as JPEG, PNG, or WEBP. Black marks the region to repaint. Multipart requests only. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("maskname")] - public string? Maskname { get; set; } - - /// - /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
- /// Default Value: auto - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.MagicPromptModeJsonConverter))] - public global::Ideogram.MagicPromptMode? MagicPrompt { get; set; } - - /// - /// The number of images to generate.
- /// Default Value: 1 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] - public int? NumImages { get; set; } - - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - ///
- /// 12345 - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// The rendering speed to use. When omitted, the server chooses a speed supported by the selected custom model. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("rendering_speed")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.InpaintImageIdeogramV3CustomModelRequestRenderingSpeedJsonConverter))] - public global::Ideogram.InpaintImageIdeogramV3CustomModelRequestRenderingSpeed? RenderingSpeed { get; set; } - - /// - /// A predefined style preset. Cannot be combined with style codes or style references. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("style_preset")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.IdeogramV3StylePresetJsonConverter))] - public global::Ideogram.IdeogramV3StylePreset? StylePreset { get; set; } - - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - ///
- /// [AAFF5733, 0133FF57, DE3357FF] - [global::System.Text.Json.Serialization.JsonPropertyName("style_codes")] - public global::System.Collections.Generic.IList? StyleCodes { get; set; } - - /// - /// A saved style, by its URL-safe base64 collection id. Takes priority over `style_reference_images` if both are supplied. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("style_reference_collection_id")] - public string? StyleReferenceCollectionId { get; set; } - - /// - /// Optional URL-safe base64 version id for the saved style. Ignored without `style_reference_collection_id`. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("style_reference_collection_version_id")] - public string? StyleReferenceCollectionVersionId { get; set; } - - /// - /// Existing upload or generated image assets to use as style references. Takes priority over raw style reference images. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("style_reference_asset_identifiers")] - public global::System.Collections.Generic.IList? StyleReferenceAssetIdentifiers { get; set; } - - /// - /// Images to use as style references (max 10, max 25MB each), as JPEG, PNG, or WEBP. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("style_reference_images")] - public global::System.Collections.Generic.IList? StyleReferenceImages { get; set; } - - /// - /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images return `is_image_safe: false`. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("enable_copyright_detection")] - public bool? EnableCopyrightDetection { get; set; } - - /// - /// When false, wait until the images are ready. When true, return as soon as the request is accepted and poll `GET /v2/generations/{generation_id}`.
- /// Default Value: false - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("async")] - public bool? Async { get; set; } - - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish it. Enterprise accounts always generate privately. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// A collection you can write to, by its URL-safe base64 collection id. Completed images are added to it. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("target_collection_id")] - public string? TargetCollectionId { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The prompt describing the repainted result. - /// - /// - /// The custom model URI returned by the custom-model API, in the form `model/<model_name>/version/<version_name>`. The authenticated user or organization must have access to the model.
- /// Example: model/my-custom-model/version/1 - /// - /// - /// The source image asset to repaint. Takes priority over `image`. - /// - /// - /// The source image to repaint (max 25MB), as JPEG, PNG, or WEBP. Multipart requests only. - /// - /// - /// The source image to repaint (max 25MB), as JPEG, PNG, or WEBP. Multipart requests only. - /// - /// - /// A black-and-white mask asset the same size as the source image. Black marks the region to repaint. Takes priority over `mask`. - /// - /// - /// A black-and-white mask the same size as the source image, as JPEG, PNG, or WEBP. Black marks the region to repaint. Multipart requests only. - /// - /// - /// A black-and-white mask the same size as the source image, as JPEG, PNG, or WEBP. Black marks the region to repaint. Multipart requests only. - /// - /// - /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
- /// Default Value: auto - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The rendering speed to use. When omitted, the server chooses a speed supported by the selected custom model. - /// - /// - /// A predefined style preset. Cannot be combined with style codes or style references. - /// - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - /// - /// - /// A saved style, by its URL-safe base64 collection id. Takes priority over `style_reference_images` if both are supplied. - /// - /// - /// Optional URL-safe base64 version id for the saved style. Ignored without `style_reference_collection_id`. - /// - /// - /// Existing upload or generated image assets to use as style references. Takes priority over raw style reference images. - /// - /// - /// Images to use as style references (max 10, max 25MB each), as JPEG, PNG, or WEBP. - /// - /// - /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images return `is_image_safe: false`. - /// - /// - /// When false, wait until the images are ready. When true, return as soon as the request is accepted and poll `GET /v2/generations/{generation_id}`.
- /// Default Value: false - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish it. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. Completed images are added to it. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public InpaintImageIdeogramV3CustomModelRequest( - string prompt, - string customModelUri, - global::Ideogram.AssetIdentifier? imageAssetIdentifier, - byte[]? image, - string? imagename, - global::Ideogram.AssetIdentifier? maskAssetIdentifier, - byte[]? mask, - string? maskname, - global::Ideogram.MagicPromptMode? magicPrompt, - int? numImages, - int? seed, - global::Ideogram.InpaintImageIdeogramV3CustomModelRequestRenderingSpeed? renderingSpeed, - global::Ideogram.IdeogramV3StylePreset? stylePreset, - global::System.Collections.Generic.IList? styleCodes, - string? styleReferenceCollectionId, - string? styleReferenceCollectionVersionId, - global::System.Collections.Generic.IList? styleReferenceAssetIdentifiers, - global::System.Collections.Generic.IList? styleReferenceImages, - bool? enableCopyrightDetection, - bool? async, - bool? @private, - string? targetCollectionId) - { - this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); - this.CustomModelUri = customModelUri ?? throw new global::System.ArgumentNullException(nameof(customModelUri)); - this.ImageAssetIdentifier = imageAssetIdentifier; - this.Image = image; - this.Imagename = imagename; - this.MaskAssetIdentifier = maskAssetIdentifier; - this.Mask = mask; - this.Maskname = maskname; - this.MagicPrompt = magicPrompt; - this.NumImages = numImages; - this.Seed = seed; - this.RenderingSpeed = renderingSpeed; - this.StylePreset = stylePreset; - this.StyleCodes = styleCodes; - this.StyleReferenceCollectionId = styleReferenceCollectionId; - this.StyleReferenceCollectionVersionId = styleReferenceCollectionVersionId; - this.StyleReferenceAssetIdentifiers = styleReferenceAssetIdentifiers; - this.StyleReferenceImages = styleReferenceImages; - this.EnableCopyrightDetection = enableCopyrightDetection; - this.Async = async; - this.Private = @private; - this.TargetCollectionId = targetCollectionId; - } - - /// - /// Initializes a new instance of the class. - /// - public InpaintImageIdeogramV3CustomModelRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.InpaintImageIdeogramV3CustomModelRequestRenderingSpeed.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.InpaintImageIdeogramV3CustomModelRequestRenderingSpeed.g.cs deleted file mode 100644 index 354907ac..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.InpaintImageIdeogramV3CustomModelRequestRenderingSpeed.g.cs +++ /dev/null @@ -1,57 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The rendering speed to use. When omitted, the server chooses a speed supported by the selected custom model. - /// - public enum InpaintImageIdeogramV3CustomModelRequestRenderingSpeed - { - /// - /// - /// - Default, - /// - /// - /// - Quality, - /// - /// - /// - Turbo, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class InpaintImageIdeogramV3CustomModelRequestRenderingSpeedExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this InpaintImageIdeogramV3CustomModelRequestRenderingSpeed value) - { - return value switch - { - InpaintImageIdeogramV3CustomModelRequestRenderingSpeed.Default => "default", - InpaintImageIdeogramV3CustomModelRequestRenderingSpeed.Quality => "quality", - InpaintImageIdeogramV3CustomModelRequestRenderingSpeed.Turbo => "turbo", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static InpaintImageIdeogramV3CustomModelRequestRenderingSpeed? ToEnum(string value) - { - return value switch - { - "default" => InpaintImageIdeogramV3CustomModelRequestRenderingSpeed.Default, - "quality" => InpaintImageIdeogramV3CustomModelRequestRenderingSpeed.Quality, - "turbo" => InpaintImageIdeogramV3CustomModelRequestRenderingSpeed.Turbo, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.InpaintImageIdeogramV3CustomModelResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.InpaintImageIdeogramV3CustomModelResponse.g.cs index 4f9e7724..90c9c67d 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.InpaintImageIdeogramV3CustomModelResponse.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.InpaintImageIdeogramV3CustomModelResponse.g.cs @@ -8,8 +8,7 @@ namespace Ideogram /// `POST /v2/image/inpaint/ideogram-3-custom-model`. Synchronous
/// requests include the repainted images in `data`; asynchronous requests
/// omit `data` and can be polled with
- /// `GET /v2/generations/{generation_id}`.
- /// Example: {"data":[{"seed":12345,"prompt":"prompt","resolution":"1024x1024","url":"https://openapi-generator.tech","is_image_safe":true},{"seed":12345,"prompt":"prompt","resolution":"1024x1024","url":"https://openapi-generator.tech","is_image_safe":true}],"seed":12345,"generation_id":"generation_id","width":0,"height":6} + /// `GET /v2/generations/{generation_id}`. /// public sealed partial class InpaintImageIdeogramV3CustomModelResponse { @@ -27,10 +26,8 @@ public sealed partial class InpaintImageIdeogramV3CustomModelResponse public global::System.Collections.Generic.IList? Data { get; set; } /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. ///
- /// 12345 [global::System.Text.Json.Serialization.JsonPropertyName("seed")] [global::System.Text.Json.Serialization.JsonRequired] public required int Seed { get; set; } @@ -62,8 +59,7 @@ public sealed partial class InpaintImageIdeogramV3CustomModelResponse /// URL-safe base64 ID accepted by the generation polling endpoint. /// /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. /// /// /// The output width in pixels. diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.InpaintImageIdeogramV3Request.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.InpaintImageIdeogramV3Request.Json.g.cs deleted file mode 100644 index ab1a3c31..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.InpaintImageIdeogramV3Request.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class InpaintImageIdeogramV3Request - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.InpaintImageIdeogramV3Request? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.InpaintImageIdeogramV3Request), - jsonSerializerContext) as global::Ideogram.InpaintImageIdeogramV3Request; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.InpaintImageIdeogramV3Request? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.InpaintImageIdeogramV3Request? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.InpaintImageIdeogramV3Request), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.InpaintImageIdeogramV3Request; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.InpaintImageIdeogramV3Request.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.InpaintImageIdeogramV3Request.g.cs deleted file mode 100644 index 20a2daa1..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.InpaintImageIdeogramV3Request.g.cs +++ /dev/null @@ -1,336 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The source `image` and its `mask` are both required and must be
- /// uploaded in a multipart request. - ///
- public sealed partial class InpaintImageIdeogramV3Request - { - /// - /// The prompt describing the repainted result. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Prompt { get; set; } - - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - ///
- /// {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - [global::System.Text.Json.Serialization.JsonPropertyName("image_asset_identifier")] - public global::Ideogram.AssetIdentifier? ImageAssetIdentifier { get; set; } - - /// - /// The source image to repaint (max 25MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The output matches its size, snapped to the nearest supported resolution. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image")] - public byte[]? Image { get; set; } - - /// - /// The source image to repaint (max 25MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The output matches its size, snapped to the nearest supported resolution. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] - public string? Imagename { get; set; } - - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - ///
- /// {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - [global::System.Text.Json.Serialization.JsonPropertyName("mask_asset_identifier")] - public global::Ideogram.AssetIdentifier? MaskAssetIdentifier { get; set; } - - /// - /// A black-and-white mask the same size as the source image. Black marks the region to repaint. JPEG, PNG, and WEBP are supported. Multipart requests only. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("mask")] - public byte[]? Mask { get; set; } - - /// - /// A black-and-white mask the same size as the source image. Black marks the region to repaint. JPEG, PNG, and WEBP are supported. Multipart requests only. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("maskname")] - public string? Maskname { get; set; } - - /// - /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
- /// Default Value: auto - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.MagicPromptModeJsonConverter))] - public global::Ideogram.MagicPromptMode? MagicPrompt { get; set; } - - /// - /// The number of images to generate.
- /// Default Value: 1 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] - public int? NumImages { get; set; } - - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - ///
- /// 12345 - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// The rendering speed to use.
- /// Default Value: default - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("rendering_speed")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.InpaintImageIdeogramV3RequestRenderingSpeedJsonConverter))] - public global::Ideogram.InpaintImageIdeogramV3RequestRenderingSpeed? RenderingSpeed { get; set; } - - /// - /// The style type to generate with.
- /// Default Value: general
- /// Example: general - ///
- /// general - [global::System.Text.Json.Serialization.JsonPropertyName("style_type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.IdeogramV3StyleTypeJsonConverter))] - public global::Ideogram.IdeogramV3StyleType? StyleType { get; set; } - - /// - /// A predefined style preset to apply to the repainted images. Cannot be combined with style codes or style references. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("style_preset")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.IdeogramV3StylePresetJsonConverter))] - public global::Ideogram.IdeogramV3StylePreset? StylePreset { get; set; } - - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - ///
- /// [AAFF5733, 0133FF57, DE3357FF] - [global::System.Text.Json.Serialization.JsonPropertyName("style_codes")] - public global::System.Collections.Generic.IList? StyleCodes { get; set; } - - /// - /// A saved style to apply, by its URL-safe base64 collection id. Takes priority over `style_reference_images` if both are supplied. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("style_reference_collection_id")] - public string? StyleReferenceCollectionId { get; set; } - - /// - /// Optional URL-safe base64 version id pinning a specific version of the `style_reference_collection_id` collection. Ignored without it. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("style_reference_collection_version_id")] - public string? StyleReferenceCollectionVersionId { get; set; } - - /// - /// Existing upload or generated image assets to use as style references, by reference. Takes priority over `style_reference_images` if both are supplied. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("style_reference_asset_identifiers")] - public global::System.Collections.Generic.IList? StyleReferenceAssetIdentifiers { get; set; } - - /// - /// Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("style_reference_images")] - public global::System.Collections.Generic.IList? StyleReferenceImages { get; set; } - - /// - /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("enable_copyright_detection")] - public bool? EnableCopyrightDetection { get; set; } - - /// - /// When false (the default), the request waits until the repainted images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
- /// Default Value: false - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("async")] - public bool? Async { get; set; } - - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - ///
- /// https://api.example.com/webhooks/ideogram - [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] - public string? WebhookUrl { get; set; } - - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("target_collection_id")] - public string? TargetCollectionId { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The prompt describing the repainted result. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The source image to repaint (max 25MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The output matches its size, snapped to the nearest supported resolution. - /// - /// - /// The source image to repaint (max 25MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The output matches its size, snapped to the nearest supported resolution. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// A black-and-white mask the same size as the source image. Black marks the region to repaint. JPEG, PNG, and WEBP are supported. Multipart requests only. - /// - /// - /// A black-and-white mask the same size as the source image. Black marks the region to repaint. JPEG, PNG, and WEBP are supported. Multipart requests only. - /// - /// - /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
- /// Default Value: auto - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The rendering speed to use.
- /// Default Value: default - /// - /// - /// The style type to generate with.
- /// Default Value: general
- /// Example: general - /// - /// - /// A predefined style preset to apply to the repainted images. Cannot be combined with style codes or style references. - /// - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - /// - /// - /// A saved style to apply, by its URL-safe base64 collection id. Takes priority over `style_reference_images` if both are supplied. - /// - /// - /// Optional URL-safe base64 version id pinning a specific version of the `style_reference_collection_id` collection. Ignored without it. - /// - /// - /// Existing upload or generated image assets to use as style references, by reference. Takes priority over `style_reference_images` if both are supplied. - /// - /// - /// Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported. - /// - /// - /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. - /// - /// - /// When false (the default), the request waits until the repainted images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public InpaintImageIdeogramV3Request( - string prompt, - global::Ideogram.AssetIdentifier? imageAssetIdentifier, - byte[]? image, - string? imagename, - global::Ideogram.AssetIdentifier? maskAssetIdentifier, - byte[]? mask, - string? maskname, - global::Ideogram.MagicPromptMode? magicPrompt, - int? numImages, - int? seed, - global::Ideogram.InpaintImageIdeogramV3RequestRenderingSpeed? renderingSpeed, - global::Ideogram.IdeogramV3StyleType? styleType, - global::Ideogram.IdeogramV3StylePreset? stylePreset, - global::System.Collections.Generic.IList? styleCodes, - string? styleReferenceCollectionId, - string? styleReferenceCollectionVersionId, - global::System.Collections.Generic.IList? styleReferenceAssetIdentifiers, - global::System.Collections.Generic.IList? styleReferenceImages, - bool? enableCopyrightDetection, - bool? async, - string? webhookUrl, - bool? @private, - string? targetCollectionId) - { - this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); - this.ImageAssetIdentifier = imageAssetIdentifier; - this.Image = image; - this.Imagename = imagename; - this.MaskAssetIdentifier = maskAssetIdentifier; - this.Mask = mask; - this.Maskname = maskname; - this.MagicPrompt = magicPrompt; - this.NumImages = numImages; - this.Seed = seed; - this.RenderingSpeed = renderingSpeed; - this.StyleType = styleType; - this.StylePreset = stylePreset; - this.StyleCodes = styleCodes; - this.StyleReferenceCollectionId = styleReferenceCollectionId; - this.StyleReferenceCollectionVersionId = styleReferenceCollectionVersionId; - this.StyleReferenceAssetIdentifiers = styleReferenceAssetIdentifiers; - this.StyleReferenceImages = styleReferenceImages; - this.EnableCopyrightDetection = enableCopyrightDetection; - this.Async = async; - this.WebhookUrl = webhookUrl; - this.Private = @private; - this.TargetCollectionId = targetCollectionId; - } - - /// - /// Initializes a new instance of the class. - /// - public InpaintImageIdeogramV3Request() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.InpaintImageIdeogramV3RequestRenderingSpeed.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.InpaintImageIdeogramV3RequestRenderingSpeed.g.cs deleted file mode 100644 index 744cb639..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.InpaintImageIdeogramV3RequestRenderingSpeed.g.cs +++ /dev/null @@ -1,58 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The rendering speed to use.
- /// Default Value: default - ///
- public enum InpaintImageIdeogramV3RequestRenderingSpeed - { - /// - /// - /// - Default, - /// - /// - /// - Quality, - /// - /// - /// - Turbo, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class InpaintImageIdeogramV3RequestRenderingSpeedExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this InpaintImageIdeogramV3RequestRenderingSpeed value) - { - return value switch - { - InpaintImageIdeogramV3RequestRenderingSpeed.Default => "default", - InpaintImageIdeogramV3RequestRenderingSpeed.Quality => "quality", - InpaintImageIdeogramV3RequestRenderingSpeed.Turbo => "turbo", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static InpaintImageIdeogramV3RequestRenderingSpeed? ToEnum(string value) - { - return value switch - { - "default" => InpaintImageIdeogramV3RequestRenderingSpeed.Default, - "quality" => InpaintImageIdeogramV3RequestRenderingSpeed.Quality, - "turbo" => InpaintImageIdeogramV3RequestRenderingSpeed.Turbo, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.InpaintImageIdeogramV3Response.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.InpaintImageIdeogramV3Response.g.cs index ccdf87d0..506bd1e7 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.InpaintImageIdeogramV3Response.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.InpaintImageIdeogramV3Response.g.cs @@ -9,8 +9,7 @@ namespace Ideogram /// `data`. Requests with `async` set to true omit `data`; poll for
/// completion and results with `GET /v2/generations/{generation_id}`
/// using the returned `generation_id`. The seed, width, and height report
- /// the values the request resolved to when the caller left them unset.
- /// Example: {"data":[{"seed":12345,"prompt":"prompt","resolution":"1024x1024","url":"https://openapi-generator.tech","is_image_safe":true},{"seed":12345,"prompt":"prompt","resolution":"1024x1024","url":"https://openapi-generator.tech","is_image_safe":true}],"seed":12345,"generation_id":"generation_id","width":0,"height":6} + /// the values the request resolved to when the caller left them unset. /// public sealed partial class InpaintImageIdeogramV3Response { @@ -29,10 +28,8 @@ public sealed partial class InpaintImageIdeogramV3Response public global::System.Collections.Generic.IList? Data { get; set; } /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. ///
- /// 12345 [global::System.Text.Json.Serialization.JsonPropertyName("seed")] [global::System.Text.Json.Serialization.JsonRequired] public required int Seed { get; set; } @@ -65,8 +62,7 @@ public sealed partial class InpaintImageIdeogramV3Response /// `GET /v2/generations/{generation_id}` polling endpoint. /// /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. /// /// /// The output width in pixels this request resolved to. diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.InpaintedImageObject.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.InpaintedImageObject.g.cs index e639d2c3..ec8fd772 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.InpaintedImageObject.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.InpaintedImageObject.g.cs @@ -4,8 +4,7 @@ namespace Ideogram { /// - /// One repainted output image.
- /// Example: {"seed":12345,"prompt":"prompt","resolution":"1024x1024","url":"https://openapi-generator.tech","is_image_safe":true} + /// One repainted output image. ///
public sealed partial class InpaintedImageObject { @@ -23,10 +22,8 @@ public sealed partial class InpaintedImageObject public required string Prompt { get; set; } /// - /// The resolution of the repainted image, formatted as "WIDTHxHEIGHT".
- /// Example: 1024x1024 + /// The resolution of the repainted image, formatted as "WIDTHxHEIGHT". ///
- /// 1024x1024 [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] [global::System.Text.Json.Serialization.JsonRequired] public required string Resolution { get; set; } @@ -39,10 +36,8 @@ public sealed partial class InpaintedImageObject public required bool IsImageSafe { get; set; } /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. ///
- /// 12345 [global::System.Text.Json.Serialization.JsonPropertyName("seed")] [global::System.Text.Json.Serialization.JsonRequired] public required int Seed { get; set; } @@ -60,15 +55,13 @@ public sealed partial class InpaintedImageObject /// The final prompt the image was generated from. /// /// - /// The resolution of the repainted image, formatted as "WIDTHxHEIGHT".
- /// Example: 1024x1024 + /// The resolution of the repainted image, formatted as "WIDTHxHEIGHT". /// /// /// Whether the image passed safety checks. If false, `url` is empty. /// /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. /// /// /// The direct link to the repainted image. Empty when the image did not pass safety checks. diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.IntegrationAsset.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.IntegrationAsset.Json.g.cs deleted file mode 100644 index 51efcb9e..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.IntegrationAsset.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class IntegrationAsset - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.IntegrationAsset? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.IntegrationAsset), - jsonSerializerContext) as global::Ideogram.IntegrationAsset; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.IntegrationAsset? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.IntegrationAsset? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.IntegrationAsset), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.IntegrationAsset; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.IntegrationAsset.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.IntegrationAsset.g.cs deleted file mode 100644 index 868bfbf4..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.IntegrationAsset.g.cs +++ /dev/null @@ -1,116 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"delivery":"","metadata":{"key":"metadata"},"media_type":"media_type","external_ref":"external_ref","width":1,"label":"label","height":1} - /// - public sealed partial class IntegrationAsset - { - /// - /// Opaque signed reference to this external asset. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("external_ref")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string ExternalRef { get; set; } - - /// - /// Short-lived link for fetching this asset's media bytes. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("delivery")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.IntegrationAssetDelivery Delivery { get; set; } - - /// - /// Human-readable asset label supplied by the integration. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("label")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Label { get; set; } - - /// - /// Asset media type. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("media_type")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string MediaType { get; set; } - - /// - /// Pixel width when supplied by the integration. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("width")] - public int? Width { get; set; } - - /// - /// Pixel height when supplied by the integration. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("height")] - public int? Height { get; set; } - - /// - /// Adapter-specific identifiers needed to organize the asset. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("metadata")] - public global::System.Collections.Generic.Dictionary? Metadata { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Opaque signed reference to this external asset. - /// - /// - /// Short-lived link for fetching this asset's media bytes. - /// - /// - /// Human-readable asset label supplied by the integration. - /// - /// - /// Asset media type. - /// - /// - /// Pixel width when supplied by the integration. - /// - /// - /// Pixel height when supplied by the integration. - /// - /// - /// Adapter-specific identifiers needed to organize the asset. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public IntegrationAsset( - string externalRef, - global::Ideogram.IntegrationAssetDelivery delivery, - string label, - string mediaType, - int? width, - int? height, - global::System.Collections.Generic.Dictionary? metadata) - { - this.ExternalRef = externalRef ?? throw new global::System.ArgumentNullException(nameof(externalRef)); - this.Delivery = delivery ?? throw new global::System.ArgumentNullException(nameof(delivery)); - this.Label = label ?? throw new global::System.ArgumentNullException(nameof(label)); - this.MediaType = mediaType ?? throw new global::System.ArgumentNullException(nameof(mediaType)); - this.Width = width; - this.Height = height; - this.Metadata = metadata; - } - - /// - /// Initializes a new instance of the class. - /// - public IntegrationAsset() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.IntegrationAssetDelivery.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.IntegrationAssetDelivery.Json.g.cs deleted file mode 100644 index b3d5204f..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.IntegrationAssetDelivery.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class IntegrationAssetDelivery - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.IntegrationAssetDelivery? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.IntegrationAssetDelivery), - jsonSerializerContext) as global::Ideogram.IntegrationAssetDelivery; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.IntegrationAssetDelivery? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.IntegrationAssetDelivery? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.IntegrationAssetDelivery), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.IntegrationAssetDelivery; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.IntegrationAssetDelivery.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.IntegrationAssetDelivery.g.cs deleted file mode 100644 index 9207c976..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.IntegrationAssetDelivery.g.cs +++ /dev/null @@ -1,59 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - public sealed partial class IntegrationAssetDelivery - { - /// - /// Short-lived URL that streams this asset's media bytes. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("url")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Url { get; set; } - - /// - /// Instant after which the delivery URL stops working. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("expires_at")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.DateTime ExpiresAt { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Short-lived URL that streams this asset's media bytes. - /// - /// - /// Instant after which the delivery URL stops working. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public IntegrationAssetDelivery( - string url, - global::System.DateTime expiresAt) - { - this.Url = url ?? throw new global::System.ArgumentNullException(nameof(url)); - this.ExpiresAt = expiresAt; - } - - /// - /// Initializes a new instance of the class. - /// - public IntegrationAssetDelivery() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.IntegrationAssetMetadata.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.IntegrationAssetMetadata.Json.g.cs deleted file mode 100644 index 5f83e496..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.IntegrationAssetMetadata.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class IntegrationAssetMetadata - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.IntegrationAssetMetadata? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.IntegrationAssetMetadata), - jsonSerializerContext) as global::Ideogram.IntegrationAssetMetadata; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.IntegrationAssetMetadata? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.IntegrationAssetMetadata? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.IntegrationAssetMetadata), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.IntegrationAssetMetadata; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.IntegrationAssetMetadata.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.IntegrationAssetMetadata.g.cs deleted file mode 100644 index bf465b19..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.IntegrationAssetMetadata.g.cs +++ /dev/null @@ -1,19 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Adapter-specific identifiers needed to organize the asset. - /// - public sealed partial class IntegrationAssetMetadata - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.IntegrationAssetSearchRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.IntegrationAssetSearchRequest.Json.g.cs deleted file mode 100644 index 39f63554..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.IntegrationAssetSearchRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class IntegrationAssetSearchRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.IntegrationAssetSearchRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.IntegrationAssetSearchRequest), - jsonSerializerContext) as global::Ideogram.IntegrationAssetSearchRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.IntegrationAssetSearchRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.IntegrationAssetSearchRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.IntegrationAssetSearchRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.IntegrationAssetSearchRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.IntegrationAssetSearchRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.IntegrationAssetSearchRequest.g.cs deleted file mode 100644 index e153b1ff..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.IntegrationAssetSearchRequest.g.cs +++ /dev/null @@ -1,58 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"query":"query","limit":1} - /// - public sealed partial class IntegrationAssetSearchRequest - { - /// - /// Maximum number of assets to return, bounded by the configured runtime policy. The operation returns a single bounded result; pagination is a future extension that adds optional fields additively. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("limit")] - [global::System.Text.Json.Serialization.JsonRequired] - public required int Limit { get; set; } - - /// - /// Optional keyed lookup. For integrations whose upstream is a keyed catalog, this is the item key (for example a product style code); integrations without keyed lookup ignore it. Omitted means browse. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("query")] - public string? Query { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Maximum number of assets to return, bounded by the configured runtime policy. The operation returns a single bounded result; pagination is a future extension that adds optional fields additively. - /// - /// - /// Optional keyed lookup. For integrations whose upstream is a keyed catalog, this is the item key (for example a product style code); integrations without keyed lookup ignore it. Omitted means browse. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public IntegrationAssetSearchRequest( - int limit, - string? query) - { - this.Limit = limit; - this.Query = query; - } - - /// - /// Initializes a new instance of the class. - /// - public IntegrationAssetSearchRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.IntegrationAssetSearchResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.IntegrationAssetSearchResponse.Json.g.cs deleted file mode 100644 index 5cd0fae8..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.IntegrationAssetSearchResponse.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class IntegrationAssetSearchResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.IntegrationAssetSearchResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.IntegrationAssetSearchResponse), - jsonSerializerContext) as global::Ideogram.IntegrationAssetSearchResponse; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.IntegrationAssetSearchResponse? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.IntegrationAssetSearchResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.IntegrationAssetSearchResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.IntegrationAssetSearchResponse; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.IntegrationAssetSearchResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.IntegrationAssetSearchResponse.g.cs deleted file mode 100644 index 45d0d4a1..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.IntegrationAssetSearchResponse.g.cs +++ /dev/null @@ -1,45 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"assets":[{"delivery":"","metadata":{"key":"metadata"},"media_type":"media_type","external_ref":"external_ref","width":1,"label":"label","height":1},{"delivery":"","metadata":{"key":"metadata"},"media_type":"media_type","external_ref":"external_ref","width":1,"label":"label","height":1}]} - /// - public sealed partial class IntegrationAssetSearchResponse - { - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("assets")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList Assets { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public IntegrationAssetSearchResponse( - global::System.Collections.Generic.IList assets) - { - this.Assets = assets ?? throw new global::System.ArgumentNullException(nameof(assets)); - } - - /// - /// Initializes a new instance of the class. - /// - public IntegrationAssetSearchResponse() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.IntegrationErrorResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.IntegrationErrorResponse.Json.g.cs deleted file mode 100644 index 75f48abc..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.IntegrationErrorResponse.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class IntegrationErrorResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.IntegrationErrorResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.IntegrationErrorResponse), - jsonSerializerContext) as global::Ideogram.IntegrationErrorResponse; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.IntegrationErrorResponse? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.IntegrationErrorResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.IntegrationErrorResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.IntegrationErrorResponse; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.IntegrationErrorResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.IntegrationErrorResponse.g.cs deleted file mode 100644 index 8f6e835e..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.IntegrationErrorResponse.g.cs +++ /dev/null @@ -1,82 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"token_scopes":["token_scopes","token_scopes"],"required_scopes":["required_scopes","required_scopes"],"error":"INTEGRATION_ACCESS_DENIED","message":"message"} - /// - public sealed partial class IntegrationErrorResponse - { - /// - /// Stable machine-readable integration error code. `INTEGRATION_ACCESS_DENIED` (403): the caller or organization is not allowed to use integrations. `MINI_APP_TOKEN_MISSING_SCOPES` (403): emitted by the shared mini-app token middleware. `INTEGRATION_REQUEST_INVALID` (400): malformed search request or an integration type that does not implement the operation. `INTEGRATION_NOT_CONFIGURED` (404): the organization has no enabled integration of the requested type. `INTEGRATION_STATE_CHANGED` (409): the integration mutated after the signed reference was issued; run a new search. `INTEGRATION_REFERENCE_INVALID` (404): the signed delivery reference is forged, tampered, malformed, or expired; obtain a fresh reference from a new search. `INTEGRATION_SERVER_ERROR` (503): server-side failure (adapter or runtime unavailable, credential unusable, or a malformed upstream response); retry later. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("error")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.IntegrationErrorResponseErrorJsonConverter))] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.IntegrationErrorResponseError Error { get; set; } - - /// - /// Stable human-readable explanation of the error. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("message")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Message { get; set; } - - /// - /// Required mini-app scopes when scope authorization fails. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("required_scopes")] - public global::System.Collections.Generic.IList? RequiredScopes { get; set; } - - /// - /// Scopes present in the mini-app token when authorization fails. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("token_scopes")] - public global::System.Collections.Generic.IList? TokenScopes { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Stable machine-readable integration error code. `INTEGRATION_ACCESS_DENIED` (403): the caller or organization is not allowed to use integrations. `MINI_APP_TOKEN_MISSING_SCOPES` (403): emitted by the shared mini-app token middleware. `INTEGRATION_REQUEST_INVALID` (400): malformed search request or an integration type that does not implement the operation. `INTEGRATION_NOT_CONFIGURED` (404): the organization has no enabled integration of the requested type. `INTEGRATION_STATE_CHANGED` (409): the integration mutated after the signed reference was issued; run a new search. `INTEGRATION_REFERENCE_INVALID` (404): the signed delivery reference is forged, tampered, malformed, or expired; obtain a fresh reference from a new search. `INTEGRATION_SERVER_ERROR` (503): server-side failure (adapter or runtime unavailable, credential unusable, or a malformed upstream response); retry later. - /// - /// - /// Stable human-readable explanation of the error. - /// - /// - /// Required mini-app scopes when scope authorization fails. - /// - /// - /// Scopes present in the mini-app token when authorization fails. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public IntegrationErrorResponse( - global::Ideogram.IntegrationErrorResponseError error, - string message, - global::System.Collections.Generic.IList? requiredScopes, - global::System.Collections.Generic.IList? tokenScopes) - { - this.Error = error; - this.Message = message ?? throw new global::System.ArgumentNullException(nameof(message)); - this.RequiredScopes = requiredScopes; - this.TokenScopes = tokenScopes; - } - - /// - /// Initializes a new instance of the class. - /// - public IntegrationErrorResponse() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.IntegrationErrorResponseError.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.IntegrationErrorResponseError.g.cs deleted file mode 100644 index 55abc2c5..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.IntegrationErrorResponseError.g.cs +++ /dev/null @@ -1,81 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Stable machine-readable integration error code. `INTEGRATION_ACCESS_DENIED` (403): the caller or organization is not allowed to use integrations. `MINI_APP_TOKEN_MISSING_SCOPES` (403): emitted by the shared mini-app token middleware. `INTEGRATION_REQUEST_INVALID` (400): malformed search request or an integration type that does not implement the operation. `INTEGRATION_NOT_CONFIGURED` (404): the organization has no enabled integration of the requested type. `INTEGRATION_STATE_CHANGED` (409): the integration mutated after the signed reference was issued; run a new search. `INTEGRATION_REFERENCE_INVALID` (404): the signed delivery reference is forged, tampered, malformed, or expired; obtain a fresh reference from a new search. `INTEGRATION_SERVER_ERROR` (503): server-side failure (adapter or runtime unavailable, credential unusable, or a malformed upstream response); retry later. - /// - public enum IntegrationErrorResponseError - { - /// - /// the caller or organization is not allowed to use integrations. `MINI_APP_TOKEN_MISSING_SCOPES` (403): emitted by the shared mini-app token middleware. `INTEGRATION_REQUEST_INVALID` (400): malformed search request or an integration type that does not implement the operation. `INTEGRATION_NOT_CONFIGURED` (404): the organization has no enabled integration of the requested type. `INTEGRATION_STATE_CHANGED` (409): the integration mutated after the signed reference was issued; run a new search. `INTEGRATION_REFERENCE_INVALID` (404): the signed delivery reference is forged, tampered, malformed, or expired; obtain a fresh reference from a new search. `INTEGRATION_SERVER_ERROR` (503): server-side failure (adapter or runtime unavailable, credential unusable, or a malformed upstream response); retry later. - /// - IntegrationAccessDenied, - /// - /// the caller or organization is not allowed to use integrations. `MINI_APP_TOKEN_MISSING_SCOPES` (403): emitted by the shared mini-app token middleware. `INTEGRATION_REQUEST_INVALID` (400): malformed search request or an integration type that does not implement the operation. `INTEGRATION_NOT_CONFIGURED` (404): the organization has no enabled integration of the requested type. `INTEGRATION_STATE_CHANGED` (409): the integration mutated after the signed reference was issued; run a new search. `INTEGRATION_REFERENCE_INVALID` (404): the signed delivery reference is forged, tampered, malformed, or expired; obtain a fresh reference from a new search. `INTEGRATION_SERVER_ERROR` (503): server-side failure (adapter or runtime unavailable, credential unusable, or a malformed upstream response); retry later. - /// - IntegrationNotConfigured, - /// - /// the caller or organization is not allowed to use integrations. `MINI_APP_TOKEN_MISSING_SCOPES` (403): emitted by the shared mini-app token middleware. `INTEGRATION_REQUEST_INVALID` (400): malformed search request or an integration type that does not implement the operation. `INTEGRATION_NOT_CONFIGURED` (404): the organization has no enabled integration of the requested type. `INTEGRATION_STATE_CHANGED` (409): the integration mutated after the signed reference was issued; run a new search. `INTEGRATION_REFERENCE_INVALID` (404): the signed delivery reference is forged, tampered, malformed, or expired; obtain a fresh reference from a new search. `INTEGRATION_SERVER_ERROR` (503): server-side failure (adapter or runtime unavailable, credential unusable, or a malformed upstream response); retry later. - /// - IntegrationReferenceInvalid, - /// - /// the caller or organization is not allowed to use integrations. `MINI_APP_TOKEN_MISSING_SCOPES` (403): emitted by the shared mini-app token middleware. `INTEGRATION_REQUEST_INVALID` (400): malformed search request or an integration type that does not implement the operation. `INTEGRATION_NOT_CONFIGURED` (404): the organization has no enabled integration of the requested type. `INTEGRATION_STATE_CHANGED` (409): the integration mutated after the signed reference was issued; run a new search. `INTEGRATION_REFERENCE_INVALID` (404): the signed delivery reference is forged, tampered, malformed, or expired; obtain a fresh reference from a new search. `INTEGRATION_SERVER_ERROR` (503): server-side failure (adapter or runtime unavailable, credential unusable, or a malformed upstream response); retry later. - /// - IntegrationRequestInvalid, - /// - /// the caller or organization is not allowed to use integrations. `MINI_APP_TOKEN_MISSING_SCOPES` (403): emitted by the shared mini-app token middleware. `INTEGRATION_REQUEST_INVALID` (400): malformed search request or an integration type that does not implement the operation. `INTEGRATION_NOT_CONFIGURED` (404): the organization has no enabled integration of the requested type. `INTEGRATION_STATE_CHANGED` (409): the integration mutated after the signed reference was issued; run a new search. `INTEGRATION_REFERENCE_INVALID` (404): the signed delivery reference is forged, tampered, malformed, or expired; obtain a fresh reference from a new search. `INTEGRATION_SERVER_ERROR` (503): server-side failure (adapter or runtime unavailable, credential unusable, or a malformed upstream response); retry later. - /// - IntegrationServerError, - /// - /// the caller or organization is not allowed to use integrations. `MINI_APP_TOKEN_MISSING_SCOPES` (403): emitted by the shared mini-app token middleware. `INTEGRATION_REQUEST_INVALID` (400): malformed search request or an integration type that does not implement the operation. `INTEGRATION_NOT_CONFIGURED` (404): the organization has no enabled integration of the requested type. `INTEGRATION_STATE_CHANGED` (409): the integration mutated after the signed reference was issued; run a new search. `INTEGRATION_REFERENCE_INVALID` (404): the signed delivery reference is forged, tampered, malformed, or expired; obtain a fresh reference from a new search. `INTEGRATION_SERVER_ERROR` (503): server-side failure (adapter or runtime unavailable, credential unusable, or a malformed upstream response); retry later. - /// - IntegrationStateChanged, - /// - /// the caller or organization is not allowed to use integrations. `MINI_APP_TOKEN_MISSING_SCOPES` (403): emitted by the shared mini-app token middleware. `INTEGRATION_REQUEST_INVALID` (400): malformed search request or an integration type that does not implement the operation. `INTEGRATION_NOT_CONFIGURED` (404): the organization has no enabled integration of the requested type. `INTEGRATION_STATE_CHANGED` (409): the integration mutated after the signed reference was issued; run a new search. `INTEGRATION_REFERENCE_INVALID` (404): the signed delivery reference is forged, tampered, malformed, or expired; obtain a fresh reference from a new search. `INTEGRATION_SERVER_ERROR` (503): server-side failure (adapter or runtime unavailable, credential unusable, or a malformed upstream response); retry later. - /// - MiniAppTokenMissingScopes, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class IntegrationErrorResponseErrorExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this IntegrationErrorResponseError value) - { - return value switch - { - IntegrationErrorResponseError.IntegrationAccessDenied => "INTEGRATION_ACCESS_DENIED", - IntegrationErrorResponseError.IntegrationNotConfigured => "INTEGRATION_NOT_CONFIGURED", - IntegrationErrorResponseError.IntegrationReferenceInvalid => "INTEGRATION_REFERENCE_INVALID", - IntegrationErrorResponseError.IntegrationRequestInvalid => "INTEGRATION_REQUEST_INVALID", - IntegrationErrorResponseError.IntegrationServerError => "INTEGRATION_SERVER_ERROR", - IntegrationErrorResponseError.IntegrationStateChanged => "INTEGRATION_STATE_CHANGED", - IntegrationErrorResponseError.MiniAppTokenMissingScopes => "MINI_APP_TOKEN_MISSING_SCOPES", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static IntegrationErrorResponseError? ToEnum(string value) - { - return value switch - { - "INTEGRATION_ACCESS_DENIED" => IntegrationErrorResponseError.IntegrationAccessDenied, - "INTEGRATION_NOT_CONFIGURED" => IntegrationErrorResponseError.IntegrationNotConfigured, - "INTEGRATION_REFERENCE_INVALID" => IntegrationErrorResponseError.IntegrationReferenceInvalid, - "INTEGRATION_REQUEST_INVALID" => IntegrationErrorResponseError.IntegrationRequestInvalid, - "INTEGRATION_SERVER_ERROR" => IntegrationErrorResponseError.IntegrationServerError, - "INTEGRATION_STATE_CHANGED" => IntegrationErrorResponseError.IntegrationStateChanged, - "MINI_APP_TOKEN_MISSING_SCOPES" => IntegrationErrorResponseError.MiniAppTokenMissingScopes, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.IntegrationType.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.IntegrationType.g.cs deleted file mode 100644 index 900bdfd7..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.IntegrationType.g.cs +++ /dev/null @@ -1,45 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// A provider-neutral integration operation family. - /// - public enum IntegrationType - { - /// - /// - /// - DigitalAssetManagement, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class IntegrationTypeExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this IntegrationType value) - { - return value switch - { - IntegrationType.DigitalAssetManagement => "DIGITAL_ASSET_MANAGEMENT", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static IntegrationType? ToEnum(string value) - { - return value switch - { - "DIGITAL_ASSET_MANAGEMENT" => IntegrationType.DigitalAssetManagement, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.InternalBatchRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.InternalBatchRequest.Json.g.cs deleted file mode 100644 index 24be768c..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.InternalBatchRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class InternalBatchRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.InternalBatchRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.InternalBatchRequest), - jsonSerializerContext) as global::Ideogram.InternalBatchRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.InternalBatchRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.InternalBatchRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.InternalBatchRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.InternalBatchRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.InternalBatchRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.InternalBatchRequest.g.cs deleted file mode 100644 index 0c04e305..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.InternalBatchRequest.g.cs +++ /dev/null @@ -1,77 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// A request for batch magic prompt evalution.
- /// Example: {"user_prompts":["a cat","a dog"],"sampling_request_params":{"magic_prompt_system_prompt_config_id":"magic_prompt_system_prompt_config_id","aspect_ratio":"1x1","style_type":"GENERAL","magic_prompt_version":"V_0","seed":12345,"negative_prompt":"brush strokes, painting","magic_prompt_option":"ON","model":"V_2_TURBO","resolution":"1280x800","num_images":1,"color_palette":{"name":"PASTEL"}},"experiment_variant":"MAGIC_PROMPT_NO_TEXT"} - ///
- public sealed partial class InternalBatchRequest - { - /// - /// The prompts to enhance with a magic prompt.
- /// Example: [a cat, a dog] - ///
- /// [a cat, a dog] - [global::System.Text.Json.Serialization.JsonPropertyName("user_prompts")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList UserPrompts { get; set; } - - /// - /// The experiment variant used for template selection for the magic prompts.
- /// Example: MAGIC_PROMPT_NO_TEXT - ///
- /// MAGIC_PROMPT_NO_TEXT - [global::System.Text.Json.Serialization.JsonPropertyName("experiment_variant")] - public string? ExperimentVariant { get; set; } - - /// - /// Example: {"magic_prompt_system_prompt_config_id":"magic_prompt_system_prompt_config_id","aspect_ratio":"1x1","style_type":"GENERAL","magic_prompt_version":"V_0","seed":12345,"negative_prompt":"brush strokes, painting","magic_prompt_option":"ON","model":"V_2_TURBO","resolution":"1280x800","num_images":1,"color_palette":{"name":"PASTEL"}} - /// - /// {"magic_prompt_system_prompt_config_id":"magic_prompt_system_prompt_config_id","aspect_ratio":"1x1","style_type":"GENERAL","magic_prompt_version":"V_0","seed":12345,"negative_prompt":"brush strokes, painting","magic_prompt_option":"ON","model":"V_2_TURBO","resolution":"1280x800","num_images":1,"color_palette":{"name":"PASTEL"}} - [global::System.Text.Json.Serialization.JsonPropertyName("sampling_request_params")] - public global::Ideogram.SamplingRequestParams? SamplingRequestParams { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The prompts to enhance with a magic prompt.
- /// Example: [a cat, a dog] - /// - /// - /// The experiment variant used for template selection for the magic prompts.
- /// Example: MAGIC_PROMPT_NO_TEXT - /// - /// - /// Example: {"magic_prompt_system_prompt_config_id":"magic_prompt_system_prompt_config_id","aspect_ratio":"1x1","style_type":"GENERAL","magic_prompt_version":"V_0","seed":12345,"negative_prompt":"brush strokes, painting","magic_prompt_option":"ON","model":"V_2_TURBO","resolution":"1280x800","num_images":1,"color_palette":{"name":"PASTEL"}} - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public InternalBatchRequest( - global::System.Collections.Generic.IList userPrompts, - string? experimentVariant, - global::Ideogram.SamplingRequestParams? samplingRequestParams) - { - this.UserPrompts = userPrompts ?? throw new global::System.ArgumentNullException(nameof(userPrompts)); - this.ExperimentVariant = experimentVariant; - this.SamplingRequestParams = samplingRequestParams; - } - - /// - /// Initializes a new instance of the class. - /// - public InternalBatchRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.InternalBatchResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.InternalBatchResponse.Json.g.cs deleted file mode 100644 index 94fa6ecf..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.InternalBatchResponse.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class InternalBatchResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.InternalBatchResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.InternalBatchResponse), - jsonSerializerContext) as global::Ideogram.InternalBatchResponse; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.InternalBatchResponse? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.InternalBatchResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.InternalBatchResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.InternalBatchResponse; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.InternalBatchResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.InternalBatchResponse.g.cs deleted file mode 100644 index a9f051f6..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.InternalBatchResponse.g.cs +++ /dev/null @@ -1,48 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// A response for batch magic prompt evalution containing relavent information for /internal/batch/status GET request to find out if the batch generation has completed.
- /// Example: {"job_id":"job_id"} - ///
- public sealed partial class InternalBatchResponse - { - /// - /// The job id for the batch generation. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("job_id")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string JobId { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The job id for the batch generation. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public InternalBatchResponse( - string jobId) - { - this.JobId = jobId ?? throw new global::System.ArgumentNullException(nameof(jobId)); - } - - /// - /// Initializes a new instance of the class. - /// - public InternalBatchResponse() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.InternalBatchResultsResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.InternalBatchResultsResponse.Json.g.cs deleted file mode 100644 index 72fdab51..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.InternalBatchResultsResponse.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class InternalBatchResultsResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.InternalBatchResultsResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.InternalBatchResultsResponse), - jsonSerializerContext) as global::Ideogram.InternalBatchResultsResponse; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.InternalBatchResultsResponse? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.InternalBatchResultsResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.InternalBatchResultsResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.InternalBatchResultsResponse; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.InternalBatchResultsResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.InternalBatchResultsResponse.g.cs deleted file mode 100644 index 79f5f7b5..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.InternalBatchResultsResponse.g.cs +++ /dev/null @@ -1,62 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// A response for batch magic prompt job results.
- /// Example: {"job_status":"COMPLETE","results":[{"image_url":"image_url","prompt":"a cat"},{"image_url":"image_url","prompt":"a cat"}]} - ///
- public sealed partial class InternalBatchResultsResponse - { - /// - /// The status of the batch generation job.
- /// Example: COMPLETE - ///
- /// COMPLETE - [global::System.Text.Json.Serialization.JsonPropertyName("job_status")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string JobStatus { get; set; } - - /// - /// The batch generation results, with each entry containing a prompt and its corresponding image URL. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("results")] - public global::System.Collections.Generic.IList? Results { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The status of the batch generation job.
- /// Example: COMPLETE - /// - /// - /// The batch generation results, with each entry containing a prompt and its corresponding image URL. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public InternalBatchResultsResponse( - string jobStatus, - global::System.Collections.Generic.IList? results) - { - this.JobStatus = jobStatus ?? throw new global::System.ArgumentNullException(nameof(jobStatus)); - this.Results = results; - } - - /// - /// Initializes a new instance of the class. - /// - public InternalBatchResultsResponse() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.InternalBatchResultsResponseResultsInner.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.InternalBatchResultsResponseResultsInner.Json.g.cs deleted file mode 100644 index 448bfc17..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.InternalBatchResultsResponseResultsInner.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class InternalBatchResultsResponseResultsInner - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.InternalBatchResultsResponseResultsInner? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.InternalBatchResultsResponseResultsInner), - jsonSerializerContext) as global::Ideogram.InternalBatchResultsResponseResultsInner; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.InternalBatchResultsResponseResultsInner? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.InternalBatchResultsResponseResultsInner? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.InternalBatchResultsResponseResultsInner), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.InternalBatchResultsResponseResultsInner; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.InternalBatchResultsResponseResultsInner.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.InternalBatchResultsResponseResultsInner.g.cs deleted file mode 100644 index 8fff229d..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.InternalBatchResultsResponseResultsInner.g.cs +++ /dev/null @@ -1,62 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"image_url":"image_url","prompt":"a cat"} - /// - public sealed partial class InternalBatchResultsResponseResultsInner - { - /// - /// The prompt used for generation.
- /// Example: a cat - ///
- /// a cat - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Prompt { get; set; } - - /// - /// The URL of the generated image. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image_url")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string ImageUrl { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The prompt used for generation.
- /// Example: a cat - /// - /// - /// The URL of the generated image. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public InternalBatchResultsResponseResultsInner( - string prompt, - string imageUrl) - { - this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); - this.ImageUrl = imageUrl ?? throw new global::System.ArgumentNullException(nameof(imageUrl)); - } - - /// - /// Initializes a new instance of the class. - /// - public InternalBatchResultsResponseResultsInner() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.InternalTestingEnumField.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.InternalTestingEnumField.g.cs deleted file mode 100644 index c72c0582..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.InternalTestingEnumField.g.cs +++ /dev/null @@ -1,57 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - public enum InternalTestingEnumField - { - /// - /// - /// - Drei, - /// - /// - /// - Ein, - /// - /// - /// - Zwei, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class InternalTestingEnumFieldExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this InternalTestingEnumField value) - { - return value switch - { - InternalTestingEnumField.Drei => "DREI", - InternalTestingEnumField.Ein => "EIN", - InternalTestingEnumField.Zwei => "ZWEI", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static InternalTestingEnumField? ToEnum(string value) - { - return value switch - { - "DREI" => InternalTestingEnumField.Drei, - "EIN" => InternalTestingEnumField.Ein, - "ZWEI" => InternalTestingEnumField.Zwei, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.InternalTestingNestedObject.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.InternalTestingNestedObject.Json.g.cs deleted file mode 100644 index 8d0bb9f5..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.InternalTestingNestedObject.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class InternalTestingNestedObject - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.InternalTestingNestedObject? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.InternalTestingNestedObject), - jsonSerializerContext) as global::Ideogram.InternalTestingNestedObject; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.InternalTestingNestedObject? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.InternalTestingNestedObject? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.InternalTestingNestedObject), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.InternalTestingNestedObject; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.InternalTestingNestedObject.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.InternalTestingNestedObject.g.cs deleted file mode 100644 index 577fedae..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.InternalTestingNestedObject.g.cs +++ /dev/null @@ -1,53 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - public sealed partial class InternalTestingNestedObject - { - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("prop_one")] - public string? PropOne { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("prop_two")] - public string? PropTwo { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public InternalTestingNestedObject( - string? propOne, - string? propTwo) - { - this.PropOne = propOne; - this.PropTwo = propTwo; - } - - /// - /// Initializes a new instance of the class. - /// - public InternalTestingNestedObject() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.InternalTestingNestedObjectRequiredFields.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.InternalTestingNestedObjectRequiredFields.Json.g.cs deleted file mode 100644 index f784b6ee..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.InternalTestingNestedObjectRequiredFields.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class InternalTestingNestedObjectRequiredFields - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.InternalTestingNestedObjectRequiredFields? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.InternalTestingNestedObjectRequiredFields), - jsonSerializerContext) as global::Ideogram.InternalTestingNestedObjectRequiredFields; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.InternalTestingNestedObjectRequiredFields? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.InternalTestingNestedObjectRequiredFields? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.InternalTestingNestedObjectRequiredFields), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.InternalTestingNestedObjectRequiredFields; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.InternalTestingNestedObjectRequiredFields.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.InternalTestingNestedObjectRequiredFields.g.cs deleted file mode 100644 index 1c451f7d..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.InternalTestingNestedObjectRequiredFields.g.cs +++ /dev/null @@ -1,55 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - public sealed partial class InternalTestingNestedObjectRequiredFields - { - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("prop_one")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string PropOne { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("prop_two")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string PropTwo { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public InternalTestingNestedObjectRequiredFields( - string propOne, - string propTwo) - { - this.PropOne = propOne ?? throw new global::System.ArgumentNullException(nameof(propOne)); - this.PropTwo = propTwo ?? throw new global::System.ArgumentNullException(nameof(propTwo)); - } - - /// - /// Initializes a new instance of the class. - /// - public InternalTestingNestedObjectRequiredFields() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.InternalTestingRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.InternalTestingRequest.Json.g.cs deleted file mode 100644 index 5127d50e..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.InternalTestingRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class InternalTestingRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.InternalTestingRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.InternalTestingRequest), - jsonSerializerContext) as global::Ideogram.InternalTestingRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.InternalTestingRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.InternalTestingRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.InternalTestingRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.InternalTestingRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.InternalTestingRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.InternalTestingRequest.g.cs deleted file mode 100644 index 20929032..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.InternalTestingRequest.g.cs +++ /dev/null @@ -1,171 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - public sealed partial class InternalTestingRequest - { - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("x_position")] - public int? XPosition { get; set; } - - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image_file")] - public byte[]? ImageFile { get; set; } - - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image_filename")] - public string? ImageFilename { get; set; } - - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("another_image_file")] - public byte[]? AnotherImageFile { get; set; } - - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("another_image_filename")] - public string? AnotherImageFilename { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("some_text")] - public string? SomeText { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("nested_object")] - public global::Ideogram.InternalTestingNestedObject? NestedObject { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("nested_object_required_fields")] - public global::Ideogram.InternalTestingNestedObjectRequiredFields? NestedObjectRequiredFields { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("date_type_field")] - public global::System.DateTime? DateTypeField { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("required_date_type_field")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.DateTime RequiredDateTypeField { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("date_time_type_field")] - public global::System.DateTime? DateTimeTypeField { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("repeated_primitive_field")] - public global::System.Collections.Generic.IList? RepeatedPrimitiveField { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("repeated_complex_field")] - public global::System.Collections.Generic.IList? RepeatedComplexField { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("enum_type_field")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.InternalTestingEnumFieldJsonConverter))] - public global::Ideogram.InternalTestingEnumField? EnumTypeField { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// - /// - /// - /// - /// - /// - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public InternalTestingRequest( - global::System.DateTime requiredDateTypeField, - int? xPosition, - byte[]? imageFile, - string? imageFilename, - byte[]? anotherImageFile, - string? anotherImageFilename, - string? someText, - global::Ideogram.InternalTestingNestedObject? nestedObject, - global::Ideogram.InternalTestingNestedObjectRequiredFields? nestedObjectRequiredFields, - global::System.DateTime? dateTypeField, - global::System.DateTime? dateTimeTypeField, - global::System.Collections.Generic.IList? repeatedPrimitiveField, - global::System.Collections.Generic.IList? repeatedComplexField, - global::Ideogram.InternalTestingEnumField? enumTypeField) - { - this.XPosition = xPosition; - this.ImageFile = imageFile; - this.ImageFilename = imageFilename; - this.AnotherImageFile = anotherImageFile; - this.AnotherImageFilename = anotherImageFilename; - this.SomeText = someText; - this.NestedObject = nestedObject; - this.NestedObjectRequiredFields = nestedObjectRequiredFields; - this.DateTypeField = dateTypeField; - this.RequiredDateTypeField = requiredDateTypeField; - this.DateTimeTypeField = dateTimeTypeField; - this.RepeatedPrimitiveField = repeatedPrimitiveField; - this.RepeatedComplexField = repeatedComplexField; - this.EnumTypeField = enumTypeField; - } - - /// - /// Initializes a new instance of the class. - /// - public InternalTestingRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.Invoice.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.Invoice.Json.g.cs deleted file mode 100644 index 2677c470..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.Invoice.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class Invoice - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.Invoice? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.Invoice), - jsonSerializerContext) as global::Ideogram.Invoice; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.Invoice? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.Invoice? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.Invoice), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.Invoice; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.Invoice.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.Invoice.g.cs deleted file mode 100644 index 284d9773..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.Invoice.g.cs +++ /dev/null @@ -1,152 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"total_spend":{"amount":1050,"currency_code":"USD"},"start_time":"2024-01-01T00:00:00\u002B00:00","end_time":"2024-01-31T23:59:59\u002B00:00","invoice_id":"invoice_123","line_items":[{"charge_name":"Image Generation - V3","total":{"amount":1050,"currency_code":"USD"},"quantity":1000,"unit_price":{"amount":1050,"currency_code":"USD"},"api_key_id":"api_key_id"},{"charge_name":"Image Generation - V3","total":{"amount":1050,"currency_code":"USD"},"quantity":1000,"unit_price":{"amount":1050,"currency_code":"USD"},"api_key_id":"api_key_id"}],"issued_time":"2024-01-01T00:00:00\u002B00:00","paid_date":"2024-02-01T00:00:00\u002B00:00","invoice_status":"PAID"} - /// - public sealed partial class Invoice - { - /// - /// The invoice ID in Metronome
- /// Example: invoice_123 - ///
- /// invoice_123 - [global::System.Text.Json.Serialization.JsonPropertyName("invoice_id")] - public string? InvoiceId { get; set; } - - /// - /// The start time of the invoice period
- /// Example: 2024-01-01T00:00:00+00:00 - ///
- /// 2024-01-01T00:00:00+00:00 - [global::System.Text.Json.Serialization.JsonPropertyName("start_time")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.DateTime StartTime { get; set; } - - /// - /// The end time of the invoice period
- /// Example: 2024-01-31T23:59:59+00:00 - ///
- /// 2024-01-31T23:59:59+00:00 - [global::System.Text.Json.Serialization.JsonPropertyName("end_time")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.DateTime EndTime { get; set; } - - /// - /// The date when the invoice was issued
- /// Example: 2024-01-01T00:00:00+00:00 - ///
- /// 2024-01-01T00:00:00+00:00 - [global::System.Text.Json.Serialization.JsonPropertyName("issued_time")] - public global::System.DateTime? IssuedTime { get; set; } - - /// - /// The date when the invoice was marked paid in Metronome
- /// Example: 2024-02-01T00:00:00+00:00 - ///
- /// 2024-02-01T00:00:00+00:00 - [global::System.Text.Json.Serialization.JsonPropertyName("paid_date")] - public global::System.DateTime? PaidDate { get; set; } - - /// - /// Represents a price.
- /// Example: {"amount":1050,"currency_code":"USD"} - ///
- /// {"amount":1050,"currency_code":"USD"} - [global::System.Text.Json.Serialization.JsonPropertyName("total_spend")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.Price TotalSpend { get; set; } - - /// - /// Status of the invoice
- /// Example: PAID - ///
- /// PAID - [global::System.Text.Json.Serialization.JsonPropertyName("invoice_status")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.InvoiceStatusJsonConverter))] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.InvoiceStatus InvoiceStatus { get; set; } - - /// - /// A list of line items within the invoice
- /// Default Value: [] - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("line_items")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList LineItems { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The start time of the invoice period
- /// Example: 2024-01-01T00:00:00+00:00 - /// - /// - /// The end time of the invoice period
- /// Example: 2024-01-31T23:59:59+00:00 - /// - /// - /// Represents a price.
- /// Example: {"amount":1050,"currency_code":"USD"} - /// - /// - /// Status of the invoice
- /// Example: PAID - /// - /// - /// A list of line items within the invoice
- /// Default Value: [] - /// - /// - /// The invoice ID in Metronome
- /// Example: invoice_123 - /// - /// - /// The date when the invoice was issued
- /// Example: 2024-01-01T00:00:00+00:00 - /// - /// - /// The date when the invoice was marked paid in Metronome
- /// Example: 2024-02-01T00:00:00+00:00 - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public Invoice( - global::System.DateTime startTime, - global::System.DateTime endTime, - global::Ideogram.Price totalSpend, - global::Ideogram.InvoiceStatus invoiceStatus, - global::System.Collections.Generic.IList lineItems, - string? invoiceId, - global::System.DateTime? issuedTime, - global::System.DateTime? paidDate) - { - this.InvoiceId = invoiceId; - this.StartTime = startTime; - this.EndTime = endTime; - this.IssuedTime = issuedTime; - this.PaidDate = paidDate; - this.TotalSpend = totalSpend ?? throw new global::System.ArgumentNullException(nameof(totalSpend)); - this.InvoiceStatus = invoiceStatus; - this.LineItems = lineItems ?? throw new global::System.ArgumentNullException(nameof(lineItems)); - } - - /// - /// Initializes a new instance of the class. - /// - public Invoice() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.InvoiceLineItem.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.InvoiceLineItem.Json.g.cs deleted file mode 100644 index 06b6d98a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.InvoiceLineItem.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class InvoiceLineItem - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.InvoiceLineItem? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.InvoiceLineItem), - jsonSerializerContext) as global::Ideogram.InvoiceLineItem; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.InvoiceLineItem? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.InvoiceLineItem? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.InvoiceLineItem), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.InvoiceLineItem; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.InvoiceLineItem.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.InvoiceLineItem.g.cs deleted file mode 100644 index cc066c17..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.InvoiceLineItem.g.cs +++ /dev/null @@ -1,106 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"charge_name":"Image Generation - V3","total":{"amount":1050,"currency_code":"USD"},"quantity":1000,"unit_price":{"amount":1050,"currency_code":"USD"},"api_key_id":"api_key_id"} - /// - public sealed partial class InvoiceLineItem - { - /// - /// The name of the charge
- /// Example: Image Generation - V3 - ///
- /// Image Generation - V3 - [global::System.Text.Json.Serialization.JsonPropertyName("charge_name")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string ChargeName { get; set; } - - /// - /// The API key associated with the usage, when available - /// - [global::System.Text.Json.Serialization.JsonPropertyName("api_key_id")] - public string? ApiKeyId { get; set; } - - /// - /// The quantity of the charge
- /// Example: 1000 - ///
- /// 1000 - [global::System.Text.Json.Serialization.JsonPropertyName("quantity")] - [global::System.Text.Json.Serialization.JsonRequired] - public required int Quantity { get; set; } - - /// - /// Represents a price.
- /// Example: {"amount":1050,"currency_code":"USD"} - ///
- /// {"amount":1050,"currency_code":"USD"} - [global::System.Text.Json.Serialization.JsonPropertyName("unit_price")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.Price UnitPrice { get; set; } - - /// - /// Represents a price.
- /// Example: {"amount":1050,"currency_code":"USD"} - ///
- /// {"amount":1050,"currency_code":"USD"} - [global::System.Text.Json.Serialization.JsonPropertyName("total")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.Price Total { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The name of the charge
- /// Example: Image Generation - V3 - /// - /// - /// The quantity of the charge
- /// Example: 1000 - /// - /// - /// Represents a price.
- /// Example: {"amount":1050,"currency_code":"USD"} - /// - /// - /// Represents a price.
- /// Example: {"amount":1050,"currency_code":"USD"} - /// - /// - /// The API key associated with the usage, when available - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public InvoiceLineItem( - string chargeName, - int quantity, - global::Ideogram.Price unitPrice, - global::Ideogram.Price total, - string? apiKeyId) - { - this.ChargeName = chargeName ?? throw new global::System.ArgumentNullException(nameof(chargeName)); - this.ApiKeyId = apiKeyId; - this.Quantity = quantity; - this.UnitPrice = unitPrice ?? throw new global::System.ArgumentNullException(nameof(unitPrice)); - this.Total = total ?? throw new global::System.ArgumentNullException(nameof(total)); - } - - /// - /// Initializes a new instance of the class. - /// - public InvoiceLineItem() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.InvoiceStatus.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.InvoiceStatus.g.cs deleted file mode 100644 index e5b2932c..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.InvoiceStatus.g.cs +++ /dev/null @@ -1,64 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Status of the invoice
- /// Example: PAID - ///
- public enum InvoiceStatus - { - /// - /// - /// - Draft, - /// - /// - /// - Paid, - /// - /// - /// - PendingPayment, - /// - /// - /// - Voided, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class InvoiceStatusExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this InvoiceStatus value) - { - return value switch - { - InvoiceStatus.Draft => "DRAFT", - InvoiceStatus.Paid => "PAID", - InvoiceStatus.PendingPayment => "PENDING_PAYMENT", - InvoiceStatus.Voided => "VOIDED", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static InvoiceStatus? ToEnum(string value) - { - return value switch - { - "DRAFT" => InvoiceStatus.Draft, - "PAID" => InvoiceStatus.Paid, - "PENDING_PAYMENT" => InvoiceStatus.PendingPayment, - "VOIDED" => InvoiceStatus.Voided, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.JsonSerializerContext.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.JsonSerializerContext.g.cs deleted file mode 100644 index 59fe5d5e..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.JsonSerializerContext.g.cs +++ /dev/null @@ -1,210 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull - )] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TrainDatasetModelResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ListModelsResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.CustomModel))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ModelStatus), TypeInfoPropertyName = "ModelStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TrainingRun))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TrainingRunStatus), TypeInfoPropertyName = "TrainingRunStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GetModelResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TrainModelV3Request))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TrainModelV3AdvancedRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TrainModelV4Request))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TrainModelV4AdvancedRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ListCustomModelsScope), TypeInfoPropertyName = "ListCustomModelsScope2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(double?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ModelStatus?), TypeInfoPropertyName = "NullableModelStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TrainingRunStatus?), TypeInfoPropertyName = "NullableTrainingRunStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ListCustomModelsScope?), TypeInfoPropertyName = "NullableListCustomModelsScope2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - internal sealed partial class ModelsSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext - { - } - /// - /// - /// - public sealed partial class ModelsSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext - { - private static readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver Resolver = new LazyChunkResolver(); - - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - internal static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver TypeInfoResolver => Resolver; - - - private static readonly global::System.Text.Json.JsonSerializerOptions DefaultOptions = CreateDefaultOptions(); - - /// - /// - /// - public static ModelsSourceGenerationContext Default { get; } = new(DefaultOptions); - - private ModelsSourceGenerationContext(global::System.Text.Json.JsonSerializerOptions options) - : base(options) - { - } - - /// - protected override global::System.Text.Json.JsonSerializerOptions? GeneratedSerializerOptions => DefaultOptions; - - /// - public override global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo(global::System.Type type) - { - return Resolver.GetTypeInfo(type, Options); - } - - /// - /// Adds this package's converters to . - /// - /// - /// A converter has to be on the options a chained resolver builds its JsonTypeInfo against, - /// and a context resolves types from every package below it. Each package contributes only - /// what it owns and calls down the chain for the rest, so the family's converter table is - /// written once rather than copied into all of them. - /// - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) - { - options.Converters.Add(new global::Ideogram.JsonConverters.UnixTimestampJsonConverter()); - options.Converters.Add(new LazyEnumJsonConverterFactory()); - } - - private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() - { - var options = new global::System.Text.Json.JsonSerializerOptions - { - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, - TypeInfoResolver = Resolver, - }; - AddConverters(options); - - return options; - } - - - private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory - { - public override bool CanConvert(global::System.Type typeToConvert) - { - return - typeToConvert == typeof(global::Ideogram.ModelStatus) - - || typeToConvert == typeof(global::Ideogram.ModelStatus?) - - || typeToConvert == typeof(global::Ideogram.TrainingRunStatus) - - || typeToConvert == typeof(global::Ideogram.TrainingRunStatus?) - - || typeToConvert == typeof(global::Ideogram.ListCustomModelsScope) - - || typeToConvert == typeof(global::Ideogram.ListCustomModelsScope?); - } - - public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - if (typeToConvert == typeof(global::Ideogram.ModelStatus)) - { - return new global::Ideogram.JsonConverters.ModelStatusJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ModelStatus?)) - { - return new global::Ideogram.JsonConverters.ModelStatusNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.TrainingRunStatus)) - { - return new global::Ideogram.JsonConverters.TrainingRunStatusJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.TrainingRunStatus?)) - { - return new global::Ideogram.JsonConverters.TrainingRunStatusNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ListCustomModelsScope)) - { - return new global::Ideogram.JsonConverters.ListCustomModelsScopeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ListCustomModelsScope?)) - { - return new global::Ideogram.JsonConverters.ListCustomModelsScopeNullableJsonConverter(); - } - throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); - } - } - - private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver - { - private readonly object _gate = new(); - private readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[] _resolvers = new global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[1]; - - public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo( - global::System.Type type, - global::System.Text.Json.JsonSerializerOptions options) - { - for (var index = 0; index < _resolvers.Length; index++) - { - var typeInfo = GetResolver(index).GetTypeInfo(type, options); - if (typeInfo is not null) - { - return typeInfo; - } - } - - return null; - } - - private global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver GetResolver(int index) - { - var resolver = global::System.Threading.Volatile.Read(ref _resolvers[index]); - if (resolver is not null) - { - return resolver; - } - - lock (_gate) - { - return _resolvers[index] ??= CreateResolver(index); - } - } - - private static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver CreateResolver(int index) - { - return index switch - { - 0 => new ModelsSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), - _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), - }; - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.LayeredAssetTextShadow.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.LayeredAssetTextShadow.Json.g.cs deleted file mode 100644 index 6b5f359d..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.LayeredAssetTextShadow.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class LayeredAssetTextShadow - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.LayeredAssetTextShadow? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.LayeredAssetTextShadow), - jsonSerializerContext) as global::Ideogram.LayeredAssetTextShadow; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.LayeredAssetTextShadow? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.LayeredAssetTextShadow? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.LayeredAssetTextShadow), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.LayeredAssetTextShadow; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.LayeredAssetTextShadow.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.LayeredAssetTextShadow.g.cs deleted file mode 100644 index d4aca088..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.LayeredAssetTextShadow.g.cs +++ /dev/null @@ -1,95 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Single CSS shadow for V4 vector text. Used by text_shadows and box_shadow. offset_x, offset_y, and blur are in px.
- /// Example: {"color":"color","blur":0.2027123,"offset_x":9.301444,"offset_y":3.6160767} - ///
- public sealed partial class LayeredAssetTextShadow - { - /// - /// Shadow hex color. Accepts both 6-hex (#RRGGBB) and 8-hex
- /// (#RRGGBBAA) — the layered-design extractor emits alpha-included
- /// colors for semi-transparent shadows, and stripping alpha would
- /// lose real visual information. Aligned with the other text-layer
- /// color fields (stroke/border/gradient) which already accept 6,8. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("color")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Color { get; set; } - - /// - /// Horizontal shadow offset in px.
- /// Default Value: 0 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("offset_x")] - public float? OffsetX { get; set; } - - /// - /// Vertical shadow offset in px.
- /// Default Value: 0 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("offset_y")] - public float? OffsetY { get; set; } - - /// - /// Shadow blur radius in px.
- /// Default Value: 0 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("blur")] - public float? Blur { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Shadow hex color. Accepts both 6-hex (#RRGGBB) and 8-hex
- /// (#RRGGBBAA) — the layered-design extractor emits alpha-included
- /// colors for semi-transparent shadows, and stripping alpha would
- /// lose real visual information. Aligned with the other text-layer
- /// color fields (stroke/border/gradient) which already accept 6,8. - /// - /// - /// Horizontal shadow offset in px.
- /// Default Value: 0 - /// - /// - /// Vertical shadow offset in px.
- /// Default Value: 0 - /// - /// - /// Shadow blur radius in px.
- /// Default Value: 0 - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public LayeredAssetTextShadow( - string color, - float? offsetX, - float? offsetY, - float? blur) - { - this.Color = color ?? throw new global::System.ArgumentNullException(nameof(color)); - this.OffsetX = offsetX; - this.OffsetY = offsetY; - this.Blur = blur; - } - - /// - /// Initializes a new instance of the class. - /// - public LayeredAssetTextShadow() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.LayeredImageGenerationObjectV3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.LayeredImageGenerationObjectV3.Json.g.cs deleted file mode 100644 index dd194754..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.LayeredImageGenerationObjectV3.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class LayeredImageGenerationObjectV3 - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.LayeredImageGenerationObjectV3? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.LayeredImageGenerationObjectV3), - jsonSerializerContext) as global::Ideogram.LayeredImageGenerationObjectV3; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.LayeredImageGenerationObjectV3? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.LayeredImageGenerationObjectV3? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.LayeredImageGenerationObjectV3), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.LayeredImageGenerationObjectV3; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.LayeredImageGenerationObjectV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.LayeredImageGenerationObjectV3.g.cs deleted file mode 100644 index dd411aac..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.LayeredImageGenerationObjectV3.g.cs +++ /dev/null @@ -1,77 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"text_containers":[{"id":"id","items":[{"font_candidates":["font_candidates","font_candidates"],"spans":[{"color":"#212121","text":"text","font_fx":["bold","italic"]},{"color":"#212121","text":"text","font_fx":["bold","italic"]}],"text_shadows":[{"color":"color","blur":0.2027123,"offset_x":9.301444,"offset_y":3.6160767},{"color":"color","blur":0.2027123,"offset_x":9.301444,"offset_y":3.6160767}],"font_size":5,"vertical_alignment":"top","text_transform":"none","glyph_type":"bullet","line_height":2.302136,"x":0,"width":1,"style_class":"body","y":6,"angle":0,"alignment":"center","font_file":"font_file","letter_spacing":7.0614014,"height":5},{"font_candidates":["font_candidates","font_candidates"],"spans":[{"color":"#212121","text":"text","font_fx":["bold","italic"]},{"color":"#212121","text":"text","font_fx":["bold","italic"]}],"text_shadows":[{"color":"color","blur":0.2027123,"offset_x":9.301444,"offset_y":3.6160767},{"color":"color","blur":0.2027123,"offset_x":9.301444,"offset_y":3.6160767}],"font_size":5,"vertical_alignment":"top","text_transform":"none","glyph_type":"bullet","line_height":2.302136,"x":0,"width":1,"style_class":"body","y":6,"angle":0,"alignment":"center","font_file":"font_file","letter_spacing":7.0614014,"height":5}]},{"id":"id","items":[{"font_candidates":["font_candidates","font_candidates"],"spans":[{"color":"#212121","text":"text","font_fx":["bold","italic"]},{"color":"#212121","text":"text","font_fx":["bold","italic"]}],"text_shadows":[{"color":"color","blur":0.2027123,"offset_x":9.301444,"offset_y":3.6160767},{"color":"color","blur":0.2027123,"offset_x":9.301444,"offset_y":3.6160767}],"font_size":5,"vertical_alignment":"top","text_transform":"none","glyph_type":"bullet","line_height":2.302136,"x":0,"width":1,"style_class":"body","y":6,"angle":0,"alignment":"center","font_file":"font_file","letter_spacing":7.0614014,"height":5},{"font_candidates":["font_candidates","font_candidates"],"spans":[{"color":"#212121","text":"text","font_fx":["bold","italic"]},{"color":"#212121","text":"text","font_fx":["bold","italic"]}],"text_shadows":[{"color":"color","blur":0.2027123,"offset_x":9.301444,"offset_y":3.6160767},{"color":"color","blur":0.2027123,"offset_x":9.301444,"offset_y":3.6160767}],"font_size":5,"vertical_alignment":"top","text_transform":"none","glyph_type":"bullet","line_height":2.302136,"x":0,"width":1,"style_class":"body","y":6,"angle":0,"alignment":"center","font_file":"font_file","letter_spacing":7.0614014,"height":5}]}],"image_layers":[{"ref_id":"REF_0","x":4,"width":1,"y":7,"height":1},{"ref_id":"REF_0","x":4,"width":1,"y":7,"height":1}],"url":"https://openapi-generator.tech","text_html":"text_html"} - /// - public sealed partial class LayeredImageGenerationObjectV3 - { - /// - /// The direct link to the text-erased base image. This is the background image with text removed, suitable for re-compositing with the text layers. Falls back to the cover image if the text-erased image is unavailable. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("url")] - public string? Url { get; set; } - - /// - /// Hierarchical text container data as a list of TextContainerV3 objects. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("text_containers")] - public global::System.Collections.Generic.IList? TextContainers { get; set; } - - /// - /// Rendered HTML string for text overlays with inline CSS for absolute positioning. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("text_html")] - public string? TextHtml { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image_layers")] - public global::System.Collections.Generic.IList? ImageLayers { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The direct link to the text-erased base image. This is the background image with text removed, suitable for re-compositing with the text layers. Falls back to the cover image if the text-erased image is unavailable. - /// - /// - /// Hierarchical text container data as a list of TextContainerV3 objects. - /// - /// - /// Rendered HTML string for text overlays with inline CSS for absolute positioning. - /// - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public LayeredImageGenerationObjectV3( - string? url, - global::System.Collections.Generic.IList? textContainers, - string? textHtml, - global::System.Collections.Generic.IList? imageLayers) - { - this.Url = url; - this.TextContainers = textContainers; - this.TextHtml = textHtml; - this.ImageLayers = imageLayers; - } - - /// - /// Initializes a new instance of the class. - /// - public LayeredImageGenerationObjectV3() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.LayeredImageGenerationResponseV3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.LayeredImageGenerationResponseV3.Json.g.cs deleted file mode 100644 index d2c8c5a4..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.LayeredImageGenerationResponseV3.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class LayeredImageGenerationResponseV3 - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.LayeredImageGenerationResponseV3? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.LayeredImageGenerationResponseV3), - jsonSerializerContext) as global::Ideogram.LayeredImageGenerationResponseV3; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.LayeredImageGenerationResponseV3? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.LayeredImageGenerationResponseV3? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.LayeredImageGenerationResponseV3), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.LayeredImageGenerationResponseV3; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.LayeredImageGenerationResponseV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.LayeredImageGenerationResponseV3.g.cs deleted file mode 100644 index 79af399d..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.LayeredImageGenerationResponseV3.g.cs +++ /dev/null @@ -1,73 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The response which contains information about the generated image, including the download link and other text layeres.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it.
- /// Example: {"data":[{"text_containers":[{"id":"id","items":[{"font_candidates":["font_candidates","font_candidates"],"spans":[{"color":"#212121","text":"text","font_fx":["bold","italic"]},{"color":"#212121","text":"text","font_fx":["bold","italic"]}],"text_shadows":[{"color":"color","blur":0.2027123,"offset_x":9.301444,"offset_y":3.6160767},{"color":"color","blur":0.2027123,"offset_x":9.301444,"offset_y":3.6160767}],"font_size":5,"vertical_alignment":"top","text_transform":"none","glyph_type":"bullet","line_height":2.302136,"x":0,"width":1,"style_class":"body","y":6,"angle":0,"alignment":"center","font_file":"font_file","letter_spacing":7.0614014,"height":5},{"font_candidates":["font_candidates","font_candidates"],"spans":[{"color":"#212121","text":"text","font_fx":["bold","italic"]},{"color":"#212121","text":"text","font_fx":["bold","italic"]}],"text_shadows":[{"color":"color","blur":0.2027123,"offset_x":9.301444,"offset_y":3.6160767},{"color":"color","blur":0.2027123,"offset_x":9.301444,"offset_y":3.6160767}],"font_size":5,"vertical_alignment":"top","text_transform":"none","glyph_type":"bullet","line_height":2.302136,"x":0,"width":1,"style_class":"body","y":6,"angle":0,"alignment":"center","font_file":"font_file","letter_spacing":7.0614014,"height":5}]},{"id":"id","items":[{"font_candidates":["font_candidates","font_candidates"],"spans":[{"color":"#212121","text":"text","font_fx":["bold","italic"]},{"color":"#212121","text":"text","font_fx":["bold","italic"]}],"text_shadows":[{"color":"color","blur":0.2027123,"offset_x":9.301444,"offset_y":3.6160767},{"color":"color","blur":0.2027123,"offset_x":9.301444,"offset_y":3.6160767}],"font_size":5,"vertical_alignment":"top","text_transform":"none","glyph_type":"bullet","line_height":2.302136,"x":0,"width":1,"style_class":"body","y":6,"angle":0,"alignment":"center","font_file":"font_file","letter_spacing":7.0614014,"height":5},{"font_candidates":["font_candidates","font_candidates"],"spans":[{"color":"#212121","text":"text","font_fx":["bold","italic"]},{"color":"#212121","text":"text","font_fx":["bold","italic"]}],"text_shadows":[{"color":"color","blur":0.2027123,"offset_x":9.301444,"offset_y":3.6160767},{"color":"color","blur":0.2027123,"offset_x":9.301444,"offset_y":3.6160767}],"font_size":5,"vertical_alignment":"top","text_transform":"none","glyph_type":"bullet","line_height":2.302136,"x":0,"width":1,"style_class":"body","y":6,"angle":0,"alignment":"center","font_file":"font_file","letter_spacing":7.0614014,"height":5}]}],"image_layers":[{"ref_id":"REF_0","x":4,"width":1,"y":7,"height":1},{"ref_id":"REF_0","x":4,"width":1,"y":7,"height":1}],"url":"https://openapi-generator.tech","text_html":"text_html"},{"text_containers":[{"id":"id","items":[{"font_candidates":["font_candidates","font_candidates"],"spans":[{"color":"#212121","text":"text","font_fx":["bold","italic"]},{"color":"#212121","text":"text","font_fx":["bold","italic"]}],"text_shadows":[{"color":"color","blur":0.2027123,"offset_x":9.301444,"offset_y":3.6160767},{"color":"color","blur":0.2027123,"offset_x":9.301444,"offset_y":3.6160767}],"font_size":5,"vertical_alignment":"top","text_transform":"none","glyph_type":"bullet","line_height":2.302136,"x":0,"width":1,"style_class":"body","y":6,"angle":0,"alignment":"center","font_file":"font_file","letter_spacing":7.0614014,"height":5},{"font_candidates":["font_candidates","font_candidates"],"spans":[{"color":"#212121","text":"text","font_fx":["bold","italic"]},{"color":"#212121","text":"text","font_fx":["bold","italic"]}],"text_shadows":[{"color":"color","blur":0.2027123,"offset_x":9.301444,"offset_y":3.6160767},{"color":"color","blur":0.2027123,"offset_x":9.301444,"offset_y":3.6160767}],"font_size":5,"vertical_alignment":"top","text_transform":"none","glyph_type":"bullet","line_height":2.302136,"x":0,"width":1,"style_class":"body","y":6,"angle":0,"alignment":"center","font_file":"font_file","letter_spacing":7.0614014,"height":5}]},{"id":"id","items":[{"font_candidates":["font_candidates","font_candidates"],"spans":[{"color":"#212121","text":"text","font_fx":["bold","italic"]},{"color":"#212121","text":"text","font_fx":["bold","italic"]}],"text_shadows":[{"color":"color","blur":0.2027123,"offset_x":9.301444,"offset_y":3.6160767},{"color":"color","blur":0.2027123,"offset_x":9.301444,"offset_y":3.6160767}],"font_size":5,"vertical_alignment":"top","text_transform":"none","glyph_type":"bullet","line_height":2.302136,"x":0,"width":1,"style_class":"body","y":6,"angle":0,"alignment":"center","font_file":"font_file","letter_spacing":7.0614014,"height":5},{"font_candidates":["font_candidates","font_candidates"],"spans":[{"color":"#212121","text":"text","font_fx":["bold","italic"]},{"color":"#212121","text":"text","font_fx":["bold","italic"]}],"text_shadows":[{"color":"color","blur":0.2027123,"offset_x":9.301444,"offset_y":3.6160767},{"color":"color","blur":0.2027123,"offset_x":9.301444,"offset_y":3.6160767}],"font_size":5,"vertical_alignment":"top","text_transform":"none","glyph_type":"bullet","line_height":2.302136,"x":0,"width":1,"style_class":"body","y":6,"angle":0,"alignment":"center","font_file":"font_file","letter_spacing":7.0614014,"height":5}]}],"image_layers":[{"ref_id":"REF_0","x":4,"width":1,"y":7,"height":1},{"ref_id":"REF_0","x":4,"width":1,"y":7,"height":1}],"url":"https://openapi-generator.tech","text_html":"text_html"}],"created":"2000-01-23T04:56:07\u002B00:00","response_type":"layered"} - ///
- public sealed partial class LayeredImageGenerationResponseV3 - { - /// - /// Discriminator for the postGenerateDesignV4 oneOf response. Always "layered" for this shape; absent on the legacy postGenerateDesignV3 endpoint. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("response_type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.LayeredImageGenerationResponseV3ResponseTypeJsonConverter))] - public global::Ideogram.LayeredImageGenerationResponseV3ResponseType? ResponseType { get; set; } - - /// - /// The time the request was created. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("created")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.DateTime Created { get; set; } - - /// - /// A list of ImageObjects that contain the generated image(s). - /// - [global::System.Text.Json.Serialization.JsonPropertyName("data")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList Data { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The time the request was created. - /// - /// - /// A list of ImageObjects that contain the generated image(s). - /// - /// - /// Discriminator for the postGenerateDesignV4 oneOf response. Always "layered" for this shape; absent on the legacy postGenerateDesignV3 endpoint. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public LayeredImageGenerationResponseV3( - global::System.DateTime created, - global::System.Collections.Generic.IList data, - global::Ideogram.LayeredImageGenerationResponseV3ResponseType? responseType) - { - this.ResponseType = responseType; - this.Created = created; - this.Data = data ?? throw new global::System.ArgumentNullException(nameof(data)); - } - - /// - /// Initializes a new instance of the class. - /// - public LayeredImageGenerationResponseV3() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.LayeredImageGenerationResponseV3ResponseType.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.LayeredImageGenerationResponseV3ResponseType.g.cs deleted file mode 100644 index 378fa564..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.LayeredImageGenerationResponseV3ResponseType.g.cs +++ /dev/null @@ -1,45 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Discriminator for the postGenerateDesignV4 oneOf response. Always "layered" for this shape; absent on the legacy postGenerateDesignV3 endpoint. - /// - public enum LayeredImageGenerationResponseV3ResponseType - { - /// - /// - /// - Layered, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class LayeredImageGenerationResponseV3ResponseTypeExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this LayeredImageGenerationResponseV3ResponseType value) - { - return value switch - { - LayeredImageGenerationResponseV3ResponseType.Layered => "layered", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static LayeredImageGenerationResponseV3ResponseType? ToEnum(string value) - { - return value switch - { - "layered" => LayeredImageGenerationResponseV3ResponseType.Layered, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.LayerizeDesignIdeogramV3Request.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.LayerizeDesignIdeogramV3Request.Json.g.cs deleted file mode 100644 index e69a10d3..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.LayerizeDesignIdeogramV3Request.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class LayerizeDesignIdeogramV3Request - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.LayerizeDesignIdeogramV3Request? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.LayerizeDesignIdeogramV3Request), - jsonSerializerContext) as global::Ideogram.LayerizeDesignIdeogramV3Request; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.LayerizeDesignIdeogramV3Request? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.LayerizeDesignIdeogramV3Request? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.LayerizeDesignIdeogramV3Request), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.LayerizeDesignIdeogramV3Request; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.LayerizeDesignIdeogramV3Request.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.LayerizeDesignIdeogramV3Request.g.cs deleted file mode 100644 index 7af5b04c..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.LayerizeDesignIdeogramV3Request.g.cs +++ /dev/null @@ -1,171 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// A request to layerize the text in one image. Upload the source image
- /// as `image` using `multipart/form-data`. - ///
- public sealed partial class LayerizeDesignIdeogramV3Request - { - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - ///
- /// {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - [global::System.Text.Json.Serialization.JsonPropertyName("image_asset_identifier")] - public global::Ideogram.AssetIdentifier? ImageAssetIdentifier { get; set; } - - /// - /// The source image to layerize (max 50MB). Common image formats such as JPEG, PNG, and WEBP are supported. Multipart requests only. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image")] - public byte[]? Image { get; set; } - - /// - /// The source image to layerize (max 50MB). Common image formats such as JPEG, PNG, and WEBP are supported. Multipart requests only. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] - public string? Imagename { get; set; } - - /// - /// A description of the image, used to guide text detection. When omitted, detection runs on the image alone. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - public string? Prompt { get; set; } - - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - ///
- /// 12345 - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// Candidate font files to make available for text style matching. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB each, maximum 5 files). Multipart requests only. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("font_candidate_files")] - public global::System.Collections.Generic.IList? FontCandidateFiles { get; set; } - - /// - /// When false (the default), the request waits until layerization is complete and returns the result in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("async")] - public bool? Async { get; set; } - - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - ///
- /// https://api.example.com/webhooks/ideogram - [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] - public string? WebhookUrl { get; set; } - - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output is added to it when the request completes. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("target_collection_id")] - public string? TargetCollectionId { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The source image to layerize (max 50MB). Common image formats such as JPEG, PNG, and WEBP are supported. Multipart requests only. - /// - /// - /// The source image to layerize (max 50MB). Common image formats such as JPEG, PNG, and WEBP are supported. Multipart requests only. - /// - /// - /// A description of the image, used to guide text detection. When omitted, detection runs on the image alone. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// Candidate font files to make available for text style matching. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB each, maximum 5 files). Multipart requests only. - /// - /// - /// When false (the default), the request waits until layerization is complete and returns the result in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output is added to it when the request completes. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public LayerizeDesignIdeogramV3Request( - global::Ideogram.AssetIdentifier? imageAssetIdentifier, - byte[]? image, - string? imagename, - string? prompt, - int? seed, - global::System.Collections.Generic.IList? fontCandidateFiles, - bool? async, - string? webhookUrl, - bool? @private, - string? targetCollectionId) - { - this.ImageAssetIdentifier = imageAssetIdentifier; - this.Image = image; - this.Imagename = imagename; - this.Prompt = prompt; - this.Seed = seed; - this.FontCandidateFiles = fontCandidateFiles; - this.Async = async; - this.WebhookUrl = webhookUrl; - this.Private = @private; - this.TargetCollectionId = targetCollectionId; - } - - /// - /// Initializes a new instance of the class. - /// - public LayerizeDesignIdeogramV3Request() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.LayerizeDesignIdeogramV3Response.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.LayerizeDesignIdeogramV3Response.g.cs index d7754341..bd96645b 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.LayerizeDesignIdeogramV3Response.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.LayerizeDesignIdeogramV3Response.g.cs @@ -9,8 +9,7 @@ namespace Ideogram /// `data`. Asynchronous requests omit `data`; poll
/// `GET /v2/generations/{generation_id}` with the returned
/// `generation_id`. `seed` is the seed that was used, including when you
- /// did not set one.
- /// Example: {"data":[{"seed":12345,"object_type":"layerized_image","resolution":"1024x1024","url":"https://openapi-generator.tech","base_image_url":"https://openapi-generator.tech","is_image_safe":true,"text_blocks":[{"role":"heading","color":"#212121","font_alternatives":["font_alternatives","font_alternatives"],"font_size":2,"font_name":"font_name","line_height":7.0614014,"x":0,"width":1,"y":6,"angle":5.637377,"text":"Hello World","alignment":"left","formatting":["bold","bold"],"height":5},{"role":"heading","color":"#212121","font_alternatives":["font_alternatives","font_alternatives"],"font_size":2,"font_name":"font_name","line_height":7.0614014,"x":0,"width":1,"y":6,"angle":5.637377,"text":"Hello World","alignment":"left","formatting":["bold","bold"],"height":5}]},{"seed":12345,"object_type":"layerized_image","resolution":"1024x1024","url":"https://openapi-generator.tech","base_image_url":"https://openapi-generator.tech","is_image_safe":true,"text_blocks":[{"role":"heading","color":"#212121","font_alternatives":["font_alternatives","font_alternatives"],"font_size":2,"font_name":"font_name","line_height":7.0614014,"x":0,"width":1,"y":6,"angle":5.637377,"text":"Hello World","alignment":"left","formatting":["bold","bold"],"height":5},{"role":"heading","color":"#212121","font_alternatives":["font_alternatives","font_alternatives"],"font_size":2,"font_name":"font_name","line_height":7.0614014,"x":0,"width":1,"y":6,"angle":5.637377,"text":"Hello World","alignment":"left","formatting":["bold","bold"],"height":5}]}],"seed":12345,"generation_id":"generation_id"} + /// did not set one. /// public sealed partial class LayerizeDesignIdeogramV3Response { @@ -29,10 +28,8 @@ public sealed partial class LayerizeDesignIdeogramV3Response public global::System.Collections.Generic.IList? Data { get; set; } /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. ///
- /// 12345 [global::System.Text.Json.Serialization.JsonPropertyName("seed")] [global::System.Text.Json.Serialization.JsonRequired] public required int Seed { get; set; } @@ -51,8 +48,7 @@ public sealed partial class LayerizeDesignIdeogramV3Response /// `GET /v2/generations/{generation_id}`. /// /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. /// /// /// The layerized design. Present only for synchronous requests (`async` omitted or false). diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.LayerizeDesignRequestV3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.LayerizeDesignRequestV3.Json.g.cs deleted file mode 100644 index a5fdd53b..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.LayerizeDesignRequestV3.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class LayerizeDesignRequestV3 - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.LayerizeDesignRequestV3? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.LayerizeDesignRequestV3), - jsonSerializerContext) as global::Ideogram.LayerizeDesignRequestV3; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.LayerizeDesignRequestV3? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.LayerizeDesignRequestV3? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.LayerizeDesignRequestV3), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.LayerizeDesignRequestV3; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.LayerizeDesignRequestV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.LayerizeDesignRequestV3.g.cs deleted file mode 100644 index 1a7e8ca8..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.LayerizeDesignRequestV3.g.cs +++ /dev/null @@ -1,230 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - public sealed partial class LayerizeDesignRequestV3 - { - /// - /// The flat graphic image to process for text detection and correction. The image should be in JPEG, PNG or WebP format (max size 25MB). - /// - [global::System.Text.Json.Serialization.JsonPropertyName("flat_graphic_image")] - [global::System.Text.Json.Serialization.JsonRequired] - public required byte[] FlatGraphicImage { get; set; } - - /// - /// The flat graphic image to process for text detection and correction. The image should be in JPEG, PNG or WebP format (max size 25MB). - /// - [global::System.Text.Json.Serialization.JsonPropertyName("flat_graphic_imagename")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string FlatGraphicImagename { get; set; } - - /// - /// An optional prompt to describe the image. If not provided, a prompt will be auto-generated from the image via captioning. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - public string? Prompt { get; set; } - - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - ///
- /// 12345 - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// Custom font file for H1 (heading) text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_h1. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("font_file_h1")] - public byte[]? FontFileH1 { get; set; } - - /// - /// Custom font file for H1 (heading) text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_h1. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("font_file_h1name")] - public string? FontFileH1name { get; set; } - - /// - /// Font name from the available font library for H1 text. Ignored if font_file_h1 is provided.
- /// Example: Ubuntu-Bold.ttf - ///
- /// Ubuntu-Bold.ttf - [global::System.Text.Json.Serialization.JsonPropertyName("font_name_h1")] - public string? FontNameH1 { get; set; } - - /// - /// Custom font file for H2 (subheading) text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_h2. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("font_file_h2")] - public byte[]? FontFileH2 { get; set; } - - /// - /// Custom font file for H2 (subheading) text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_h2. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("font_file_h2name")] - public string? FontFileH2name { get; set; } - - /// - /// Font name from the available font library for H2 text. Ignored if font_file_h2 is provided. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("font_name_h2")] - public string? FontNameH2 { get; set; } - - /// - /// Custom font file for body text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_body. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("font_file_body")] - public byte[]? FontFileBody { get; set; } - - /// - /// Custom font file for body text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_body. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("font_file_bodyname")] - public string? FontFileBodyname { get; set; } - - /// - /// Font name from the available font library for body text. Ignored if font_file_body is provided. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("font_name_body")] - public string? FontNameBody { get; set; } - - /// - /// Custom font file for small/caption text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_small. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("font_file_small")] - public byte[]? FontFileSmall { get; set; } - - /// - /// Custom font file for small/caption text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_small. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("font_file_smallname")] - public string? FontFileSmallname { get; set; } - - /// - /// Font name from the available font library for small text. Ignored if font_file_small is provided. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("font_name_small")] - public string? FontNameSmall { get; set; } - - /// - /// A set of asset images (e.g., logos, icons) to use as references for detection and replacement (maximum 10 images). The images should be in JPEG, PNG or WebP format. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("reference_asset_images")] - public global::System.Collections.Generic.IList? ReferenceAssetImages { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The flat graphic image to process for text detection and correction. The image should be in JPEG, PNG or WebP format (max size 25MB). - /// - /// - /// The flat graphic image to process for text detection and correction. The image should be in JPEG, PNG or WebP format (max size 25MB). - /// - /// - /// An optional prompt to describe the image. If not provided, a prompt will be auto-generated from the image via captioning. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// Custom font file for H1 (heading) text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_h1. - /// - /// - /// Custom font file for H1 (heading) text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_h1. - /// - /// - /// Font name from the available font library for H1 text. Ignored if font_file_h1 is provided.
- /// Example: Ubuntu-Bold.ttf - /// - /// - /// Custom font file for H2 (subheading) text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_h2. - /// - /// - /// Custom font file for H2 (subheading) text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_h2. - /// - /// - /// Font name from the available font library for H2 text. Ignored if font_file_h2 is provided. - /// - /// - /// Custom font file for body text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_body. - /// - /// - /// Custom font file for body text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_body. - /// - /// - /// Font name from the available font library for body text. Ignored if font_file_body is provided. - /// - /// - /// Custom font file for small/caption text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_small. - /// - /// - /// Custom font file for small/caption text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_small. - /// - /// - /// Font name from the available font library for small text. Ignored if font_file_small is provided. - /// - /// - /// A set of asset images (e.g., logos, icons) to use as references for detection and replacement (maximum 10 images). The images should be in JPEG, PNG or WebP format. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public LayerizeDesignRequestV3( - byte[] flatGraphicImage, - string flatGraphicImagename, - string? prompt, - int? seed, - byte[]? fontFileH1, - string? fontFileH1name, - string? fontNameH1, - byte[]? fontFileH2, - string? fontFileH2name, - string? fontNameH2, - byte[]? fontFileBody, - string? fontFileBodyname, - string? fontNameBody, - byte[]? fontFileSmall, - string? fontFileSmallname, - string? fontNameSmall, - global::System.Collections.Generic.IList? referenceAssetImages) - { - this.FlatGraphicImage = flatGraphicImage ?? throw new global::System.ArgumentNullException(nameof(flatGraphicImage)); - this.FlatGraphicImagename = flatGraphicImagename ?? throw new global::System.ArgumentNullException(nameof(flatGraphicImagename)); - this.Prompt = prompt; - this.Seed = seed; - this.FontFileH1 = fontFileH1; - this.FontFileH1name = fontFileH1name; - this.FontNameH1 = fontNameH1; - this.FontFileH2 = fontFileH2; - this.FontFileH2name = fontFileH2name; - this.FontNameH2 = fontNameH2; - this.FontFileBody = fontFileBody; - this.FontFileBodyname = fontFileBodyname; - this.FontNameBody = fontNameBody; - this.FontFileSmall = fontFileSmall; - this.FontFileSmallname = fontFileSmallname; - this.FontNameSmall = fontNameSmall; - this.ReferenceAssetImages = referenceAssetImages; - } - - /// - /// Initializes a new instance of the class. - /// - public LayerizeDesignRequestV3() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.LayerizeLogosRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.LayerizeLogosRequest.Json.g.cs deleted file mode 100644 index 344213e1..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.LayerizeLogosRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class LayerizeLogosRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.LayerizeLogosRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.LayerizeLogosRequest), - jsonSerializerContext) as global::Ideogram.LayerizeLogosRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.LayerizeLogosRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.LayerizeLogosRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.LayerizeLogosRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.LayerizeLogosRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.LayerizeLogosRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.LayerizeLogosRequest.g.cs deleted file mode 100644 index 78c9a58b..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.LayerizeLogosRequest.g.cs +++ /dev/null @@ -1,77 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - public sealed partial class LayerizeLogosRequest - { - /// - /// The flat design image to analyze. The image should be in JPEG, PNG, or WebP format (max size 25MB). - /// - [global::System.Text.Json.Serialization.JsonPropertyName("design_image")] - [global::System.Text.Json.Serialization.JsonRequired] - public required byte[] DesignImage { get; set; } - - /// - /// The flat design image to analyze. The image should be in JPEG, PNG, or WebP format (max size 25MB). - /// - [global::System.Text.Json.Serialization.JsonPropertyName("design_imagename")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string DesignImagename { get; set; } - - /// - /// Reference image assets to match against logos and image elements detected in
- /// `design_image`. Each entry is assigned a `ref_id` of `REF_0`, `REF_1`, ...
- /// in the order it appears in the request (maximum 10 images). The images
- /// should be in JPEG, PNG, or WebP format. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("reference_images")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList ReferenceImages { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The flat design image to analyze. The image should be in JPEG, PNG, or WebP format (max size 25MB). - /// - /// - /// The flat design image to analyze. The image should be in JPEG, PNG, or WebP format (max size 25MB). - /// - /// - /// Reference image assets to match against logos and image elements detected in
- /// `design_image`. Each entry is assigned a `ref_id` of `REF_0`, `REF_1`, ...
- /// in the order it appears in the request (maximum 10 images). The images
- /// should be in JPEG, PNG, or WebP format. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public LayerizeLogosRequest( - byte[] designImage, - string designImagename, - global::System.Collections.Generic.IList referenceImages) - { - this.DesignImage = designImage ?? throw new global::System.ArgumentNullException(nameof(designImage)); - this.DesignImagename = designImagename ?? throw new global::System.ArgumentNullException(nameof(designImagename)); - this.ReferenceImages = referenceImages ?? throw new global::System.ArgumentNullException(nameof(referenceImages)); - } - - /// - /// Initializes a new instance of the class. - /// - public LayerizeLogosRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.LayerizeLogosResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.LayerizeLogosResponse.Json.g.cs deleted file mode 100644 index eaf03549..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.LayerizeLogosResponse.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class LayerizeLogosResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.LayerizeLogosResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.LayerizeLogosResponse), - jsonSerializerContext) as global::Ideogram.LayerizeLogosResponse; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.LayerizeLogosResponse? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.LayerizeLogosResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.LayerizeLogosResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.LayerizeLogosResponse; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.LayerizeLogosResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.LayerizeLogosResponse.g.cs deleted file mode 100644 index bff5b24a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.LayerizeLogosResponse.g.cs +++ /dev/null @@ -1,65 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Results of image-reference recognition. The `base_image_url` points at the design
- /// with the detected reference images inpainted out. The `layers` array lists each
- /// matched reference and its bounding box on the original image; it is empty when
- /// no reference image was matched.
- /// Image links are available for a limited period of time; if you would like to keep
- /// the image, you must download it.
- /// Example: {"layers":[{"ref_id":"REF_0","x":4,"width":1,"y":7,"height":1},{"ref_id":"REF_0","x":4,"width":1,"y":7,"height":1}],"base_image_url":"https://openapi-generator.tech"} - ///
- public sealed partial class LayerizeLogosResponse - { - /// - /// URL of the design image with all detected reference images inpainted out. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("base_image_url")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string BaseImageUrl { get; set; } - - /// - /// Matched reference images, each with its bounding box on the original design. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("layers")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList Layers { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// URL of the design image with all detected reference images inpainted out. - /// - /// - /// Matched reference images, each with its bounding box on the original design. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public LayerizeLogosResponse( - string baseImageUrl, - global::System.Collections.Generic.IList layers) - { - this.BaseImageUrl = baseImageUrl ?? throw new global::System.ArgumentNullException(nameof(baseImageUrl)); - this.Layers = layers ?? throw new global::System.ArgumentNullException(nameof(layers)); - } - - /// - /// Initializes a new instance of the class. - /// - public LayerizeLogosResponse() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.LayerizeTextRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.LayerizeTextRequest.Json.g.cs deleted file mode 100644 index 92a521d5..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.LayerizeTextRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class LayerizeTextRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.LayerizeTextRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.LayerizeTextRequest), - jsonSerializerContext) as global::Ideogram.LayerizeTextRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.LayerizeTextRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.LayerizeTextRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.LayerizeTextRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.LayerizeTextRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.LayerizeTextRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.LayerizeTextRequest.g.cs deleted file mode 100644 index 9a9db192..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.LayerizeTextRequest.g.cs +++ /dev/null @@ -1,95 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - public sealed partial class LayerizeTextRequest - { - /// - /// The image to analyze for text detection. The image should be in JPEG, PNG, or WebP format (max size 25MB). - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image")] - [global::System.Text.Json.Serialization.JsonRequired] - public required byte[] Image { get; set; } - - /// - /// The image to analyze for text detection. The image should be in JPEG, PNG, or WebP format (max size 25MB). - /// - [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Imagename { get; set; } - - /// - /// An optional text description of the image. If not provided, a description will be auto-generated from the image. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - public string? Prompt { get; set; } - - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - ///
- /// 12345 - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// Candidate font files to make available for text style matching. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB each, maximum 5 files). - /// - [global::System.Text.Json.Serialization.JsonPropertyName("font_candidate_files")] - public global::System.Collections.Generic.IList? FontCandidateFiles { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The image to analyze for text detection. The image should be in JPEG, PNG, or WebP format (max size 25MB). - /// - /// - /// The image to analyze for text detection. The image should be in JPEG, PNG, or WebP format (max size 25MB). - /// - /// - /// An optional text description of the image. If not provided, a description will be auto-generated from the image. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// Candidate font files to make available for text style matching. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB each, maximum 5 files). - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public LayerizeTextRequest( - byte[] image, - string imagename, - string? prompt, - int? seed, - global::System.Collections.Generic.IList? fontCandidateFiles) - { - this.Image = image ?? throw new global::System.ArgumentNullException(nameof(image)); - this.Imagename = imagename ?? throw new global::System.ArgumentNullException(nameof(imagename)); - this.Prompt = prompt; - this.Seed = seed; - this.FontCandidateFiles = fontCandidateFiles; - } - - /// - /// Initializes a new instance of the class. - /// - public LayerizeTextRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.LayerizeTextResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.LayerizeTextResponse.Json.g.cs deleted file mode 100644 index af902b9b..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.LayerizeTextResponse.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class LayerizeTextResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.LayerizeTextResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.LayerizeTextResponse), - jsonSerializerContext) as global::Ideogram.LayerizeTextResponse; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.LayerizeTextResponse? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.LayerizeTextResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.LayerizeTextResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.LayerizeTextResponse; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.LayerizeTextResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.LayerizeTextResponse.g.cs deleted file mode 100644 index 194103ff..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.LayerizeTextResponse.g.cs +++ /dev/null @@ -1,87 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The response containing detected text blocks and a text-erased base image.
- /// Image links are available for a limited period of time; if you would like to keep the image, you must download it.
- /// Example: {"original_image_url":"https://openapi-generator.tech","seed":12345,"base_image_url":"https://openapi-generator.tech","text_blocks":[{"role":"heading","color":"#212121","font_alternatives":["font_alternatives","font_alternatives"],"font_size":2,"font_name":"font_name","line_height":7.0614014,"x":0,"width":1,"y":6,"angle":5.637377,"text":"Hello World","alignment":"left","formatting":["bold","bold"],"height":5},{"role":"heading","color":"#212121","font_alternatives":["font_alternatives","font_alternatives"],"font_size":2,"font_name":"font_name","line_height":7.0614014,"x":0,"width":1,"y":6,"angle":5.637377,"text":"Hello World","alignment":"left","formatting":["bold","bold"],"height":5}]} - ///
- public sealed partial class LayerizeTextResponse - { - /// - /// URL of the image with all detected text removed. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("base_image_url")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string BaseImageUrl { get; set; } - - /// - /// URL of the original image with text intact. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("original_image_url")] - public string? OriginalImageUrl { get; set; } - - /// - /// Flat list of detected text regions in the image. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("text_blocks")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList TextBlocks { get; set; } - - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - ///
- /// 12345 - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - [global::System.Text.Json.Serialization.JsonRequired] - public required int Seed { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// URL of the image with all detected text removed. - /// - /// - /// Flat list of detected text regions in the image. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// URL of the original image with text intact. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public LayerizeTextResponse( - string baseImageUrl, - global::System.Collections.Generic.IList textBlocks, - int seed, - string? originalImageUrl) - { - this.BaseImageUrl = baseImageUrl ?? throw new global::System.ArgumentNullException(nameof(baseImageUrl)); - this.OriginalImageUrl = originalImageUrl; - this.TextBlocks = textBlocks ?? throw new global::System.ArgumentNullException(nameof(textBlocks)); - this.Seed = seed; - } - - /// - /// Initializes a new instance of the class. - /// - public LayerizeTextResponse() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.LayerizedImageObject.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.LayerizedImageObject.g.cs index 5ec3eb4a..7f34b15e 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.LayerizedImageObject.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.LayerizedImageObject.g.cs @@ -5,18 +5,10 @@ namespace Ideogram { /// /// One layerized design. Image links are available for a limited period
- /// of time; if you would like to keep an image, you must download it.
- /// Example: {"seed":12345,"object_type":"layerized_image","resolution":"1024x1024","url":"https://openapi-generator.tech","base_image_url":"https://openapi-generator.tech","is_image_safe":true,"text_blocks":[{"role":"heading","color":"#212121","font_alternatives":["font_alternatives","font_alternatives"],"font_size":2,"font_name":"font_name","line_height":7.0614014,"x":0,"width":1,"y":6,"angle":5.637377,"text":"Hello World","alignment":"left","formatting":["bold","bold"],"height":5},{"role":"heading","color":"#212121","font_alternatives":["font_alternatives","font_alternatives"],"font_size":2,"font_name":"font_name","line_height":7.0614014,"x":0,"width":1,"y":6,"angle":5.637377,"text":"Hello World","alignment":"left","formatting":["bold","bold"],"height":5}]} + /// of time; if you would like to keep an image, you must download it. ///
public sealed partial class LayerizedImageObject { - /// - /// Discriminates layerized results from other generation output types. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("object_type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.LayerizedImageObjectObjectTypeJsonConverter))] - public global::Ideogram.LayerizedImageObjectObjectType ObjectType { get; set; } - /// /// The direct link to the design image with its text intact. Empty when the image did not pass safety checks. /// @@ -30,10 +22,8 @@ public sealed partial class LayerizedImageObject public string? BaseImageUrl { get; set; } /// - /// The resolution of the design, formatted as "WIDTHxHEIGHT".
- /// Example: 1024x1024 + /// The resolution of the design, formatted as "WIDTHxHEIGHT". ///
- /// 1024x1024 [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] [global::System.Text.Json.Serialization.JsonRequired] public required string Resolution { get; set; } @@ -46,10 +36,8 @@ public sealed partial class LayerizedImageObject public required bool IsImageSafe { get; set; } /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. ///
- /// 12345 [global::System.Text.Json.Serialization.JsonPropertyName("seed")] [global::System.Text.Json.Serialization.JsonRequired] public required int Seed { get; set; } @@ -71,22 +59,17 @@ public sealed partial class LayerizedImageObject /// Initializes a new instance of the class. /// /// - /// The resolution of the design, formatted as "WIDTHxHEIGHT".
- /// Example: 1024x1024 + /// The resolution of the design, formatted as "WIDTHxHEIGHT". /// /// /// Whether the image passed safety checks. If false, the image links are empty. /// /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. /// /// /// Flat list of detected text regions in the design. /// - /// - /// Discriminates layerized results from other generation output types. - /// /// /// The direct link to the design image with its text intact. Empty when the image did not pass safety checks. /// @@ -101,11 +84,9 @@ public LayerizedImageObject( bool isImageSafe, int seed, global::System.Collections.Generic.IList textBlocks, - global::Ideogram.LayerizedImageObjectObjectType objectType, string? url, string? baseImageUrl) { - this.ObjectType = objectType; this.Url = url; this.BaseImageUrl = baseImageUrl; this.Resolution = resolution ?? throw new global::System.ArgumentNullException(nameof(resolution)); diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.LayerizedImageObjectObjectType.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.LayerizedImageObjectObjectType.g.cs deleted file mode 100644 index e444364a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.LayerizedImageObjectObjectType.g.cs +++ /dev/null @@ -1,45 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Discriminates layerized results from other generation output types. - /// - public enum LayerizedImageObjectObjectType - { - /// - /// - /// - LayerizedImage, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class LayerizedImageObjectObjectTypeExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this LayerizedImageObjectObjectType value) - { - return value switch - { - LayerizedImageObjectObjectType.LayerizedImage => "layerized_image", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static LayerizedImageObjectObjectType? ToEnum(string value) - { - return value switch - { - "layerized_image" => LayerizedImageObjectObjectType.LayerizedImage, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.LayerizedTextBlock.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.LayerizedTextBlock.Json.g.cs index 57131014..176b3737 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.LayerizedTextBlock.Json.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.LayerizedTextBlock.Json.g.cs @@ -2,7 +2,7 @@ namespace Ideogram { - public readonly partial struct LayerizedTextBlock + public sealed partial class LayerizedTextBlock { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -54,7 +54,7 @@ public string ToJson( return global::System.Text.Json.JsonSerializer.Deserialize( json, typeof(global::Ideogram.LayerizedTextBlock), - jsonSerializerContext) as global::Ideogram.LayerizedTextBlock?; + jsonSerializerContext) as global::Ideogram.LayerizedTextBlock; } /// @@ -101,7 +101,7 @@ public string ToJson( return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, typeof(global::Ideogram.LayerizedTextBlock), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.LayerizedTextBlock?; + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.LayerizedTextBlock; } /// diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.LayerizedTextBlock.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.LayerizedTextBlock.g.cs index cb34bd3d..d24ebabb 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.LayerizedTextBlock.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.LayerizedTextBlock.g.cs @@ -1,296 +1,226 @@ -#pragma warning disable CS0618 // Type or member is obsolete #nullable enable namespace Ideogram { /// - /// + /// A single detected text region with its position, content, font information, and styling. /// - public readonly partial struct LayerizedTextBlock : global::System.IEquatable + public sealed partial class LayerizedTextBlock { /// - /// A single detected text region with its position, content, font information, and styling.
- /// Example: {"role":"heading","color":"#212121","font_alternatives":["font_alternatives","font_alternatives"],"font_size":2,"font_name":"font_name","line_height":7.0614014,"x":0,"width":1,"y":6,"angle":5.637377,"text":"Hello World","alignment":"left","formatting":["bold","bold"],"height":5} + /// X coordinate in pixels from the top-left corner. ///
-#if NET6_0_OR_GREATER - public global::Ideogram.DetectedTextBlock? DetectedTextBlock { get; init; } -#else - public global::Ideogram.DetectedTextBlock? DetectedTextBlock { get; } -#endif - - /// - /// - /// -#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(DetectedTextBlock))] -#endif - public bool IsDetectedTextBlock => DetectedTextBlock != null; - - /// - /// - /// - public bool TryPickDetectedTextBlock( -#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] -#endif - out global::Ideogram.DetectedTextBlock? value) - { - value = DetectedTextBlock; - return IsDetectedTextBlock; - } - - /// - /// - /// - public global::Ideogram.DetectedTextBlock PickDetectedTextBlock() => DetectedTextBlock is { } value - ? value - : throw new global::System.InvalidOperationException($"Expected union variant 'DetectedTextBlock' but the value was {ToString()}."); - - /// - /// - /// -#if NET6_0_OR_GREATER - public global::Ideogram.LayerizedTextBlockVariant2? LayerizedTextBlockVariant2 { get; init; } -#else - public global::Ideogram.LayerizedTextBlockVariant2? LayerizedTextBlockVariant2 { get; } -#endif - - /// - /// - /// -#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(LayerizedTextBlockVariant2))] -#endif - public bool IsLayerizedTextBlockVariant2 => LayerizedTextBlockVariant2 != null; - - /// - /// - /// - public bool TryPickLayerizedTextBlockVariant2( -#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] -#endif - out global::Ideogram.LayerizedTextBlockVariant2? value) - { - value = LayerizedTextBlockVariant2; - return IsLayerizedTextBlockVariant2; - } - - /// - /// - /// - public global::Ideogram.LayerizedTextBlockVariant2 PickLayerizedTextBlockVariant2() => LayerizedTextBlockVariant2 is { } value - ? value - : throw new global::System.InvalidOperationException($"Expected union variant 'LayerizedTextBlockVariant2' but the value was {ToString()}."); - /// - /// - /// - public static implicit operator LayerizedTextBlock(global::Ideogram.DetectedTextBlock value) => new LayerizedTextBlock((global::Ideogram.DetectedTextBlock?)value); + [global::System.Text.Json.Serialization.JsonPropertyName("x")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int X { get; set; } /// - /// + /// Y coordinate in pixels from the top-left corner. /// - public static implicit operator global::Ideogram.DetectedTextBlock?(LayerizedTextBlock @this) => @this.DetectedTextBlock; + [global::System.Text.Json.Serialization.JsonPropertyName("y")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int Y { get; set; } /// - /// + /// Width of the text region in pixels. /// - public LayerizedTextBlock(global::Ideogram.DetectedTextBlock? value) - { - DetectedTextBlock = value; - } + [global::System.Text.Json.Serialization.JsonPropertyName("width")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int Width { get; set; } /// - /// + /// Height of the text region in pixels. /// - public static LayerizedTextBlock FromDetectedTextBlock(global::Ideogram.DetectedTextBlock? value) => new LayerizedTextBlock(value); + [global::System.Text.Json.Serialization.JsonPropertyName("height")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int Height { get; set; } /// - /// + /// The detected text content. Line breaks are represented as \n. /// - public static implicit operator LayerizedTextBlock(global::Ideogram.LayerizedTextBlockVariant2 value) => new LayerizedTextBlock((global::Ideogram.LayerizedTextBlockVariant2?)value); + [global::System.Text.Json.Serialization.JsonPropertyName("text")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Text { get; set; } /// - /// + /// Detected text alignment. /// - public static implicit operator global::Ideogram.LayerizedTextBlockVariant2?(LayerizedTextBlock @this) => @this.LayerizedTextBlockVariant2; + [global::System.Text.Json.Serialization.JsonPropertyName("alignment")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.LayerizedTextBlockAlignmentJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Ideogram.LayerizedTextBlockAlignment Alignment { get; set; } /// - /// + /// Rotation angle in degrees (clockwise). Defaults to 0.
+ /// Default Value: 0 ///
- public LayerizedTextBlock(global::Ideogram.LayerizedTextBlockVariant2? value) - { - LayerizedTextBlockVariant2 = value; - } + [global::System.Text.Json.Serialization.JsonPropertyName("angle")] + public string? Angle { get; set; } /// - /// + /// Best-matching font name from the font library. /// - public static LayerizedTextBlock FromLayerizedTextBlockVariant2(global::Ideogram.LayerizedTextBlockVariant2? value) => new LayerizedTextBlock(value); + [global::System.Text.Json.Serialization.JsonPropertyName("font_name")] + public string? FontName { get; set; } /// - /// + /// Alternative font matches, ranked by similarity. /// - public LayerizedTextBlock( - global::Ideogram.DetectedTextBlock? detectedTextBlock, - global::Ideogram.LayerizedTextBlockVariant2? layerizedTextBlockVariant2 - ) - { - DetectedTextBlock = detectedTextBlock; - LayerizedTextBlockVariant2 = layerizedTextBlockVariant2; - } + [global::System.Text.Json.Serialization.JsonPropertyName("font_alternatives")] + public global::System.Collections.Generic.IList? FontAlternatives { get; set; } /// - /// + /// Detected font size in points. /// - public object? Object => - LayerizedTextBlockVariant2 as object ?? - DetectedTextBlock as object - ; + [global::System.Text.Json.Serialization.JsonPropertyName("font_size")] + public int? FontSize { get; set; } /// - /// + /// Line height multiplier (e.g., 1.2). /// - public override string? ToString() => - DetectedTextBlock?.ToString() ?? - LayerizedTextBlockVariant2?.ToString() - ; + [global::System.Text.Json.Serialization.JsonPropertyName("line_height")] + public string? LineHeight { get; set; } /// - /// + /// Detected text color in hex format. /// - public bool Validate() - { - return IsDetectedTextBlock && IsLayerizedTextBlockVariant2; - } + [global::System.Text.Json.Serialization.JsonPropertyName("color")] + public string? Color { get; set; } /// - /// + /// Detected text formatting effects. /// - public TResult? Match( - global::System.Func? detectedTextBlock = null, - global::System.Func? layerizedTextBlockVariant2 = null, - bool validate = true) - { - if (validate) - { - Validate(); - } - - if (DetectedTextBlock is { } __value0 && detectedTextBlock != null) - { - return detectedTextBlock(__value0); - } - else if (LayerizedTextBlockVariant2 is { } __value1 && layerizedTextBlockVariant2 != null) - { - return layerizedTextBlockVariant2(__value1); - } - - return default(TResult); - } + [global::System.Text.Json.Serialization.JsonPropertyName("formatting")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Formatting { get; set; } /// - /// + /// Inferred typographic role of this text block. /// - public void Match( - global::System.Action? detectedTextBlock = null, - - global::System.Action? layerizedTextBlockVariant2 = null, - bool validate = true) - { - if (validate) - { - Validate(); - } - - if (DetectedTextBlock is { } __value0) - { - detectedTextBlock?.Invoke(__value0); - } - else if (LayerizedTextBlockVariant2 is { } __value1) - { - layerizedTextBlockVariant2?.Invoke(__value1); - } - } + [global::System.Text.Json.Serialization.JsonPropertyName("role")] + public global::Ideogram.LayerizedTextBlockRole? Role { get; set; } /// - /// + /// Identifier of this block's layer in the page at `html_url`; pass it to the page's editing API. /// - public void Switch( - global::System.Action? detectedTextBlock = null, - global::System.Action? layerizedTextBlockVariant2 = null, - bool validate = true) - { - if (validate) - { - Validate(); - } - - if (DetectedTextBlock is { } __value0) - { - detectedTextBlock?.Invoke(__value0); - } - else if (LayerizedTextBlockVariant2 is { } __value1) - { - layerizedTextBlockVariant2?.Invoke(__value1); - } - } + [global::System.Text.Json.Serialization.JsonPropertyName("layer_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string LayerId { get; set; } /// - /// + /// The block's colour runs in reading order. Present, with at least one
+ /// run, whenever `color` is set; concatenating the runs' `text` reproduces
+ /// the block's `text`. `color` reports the dominant colour. ///
- public override int GetHashCode() - { - var fields = new object?[] - { - DetectedTextBlock, - typeof(global::Ideogram.DetectedTextBlock), - LayerizedTextBlockVariant2, - typeof(global::Ideogram.LayerizedTextBlockVariant2), - }; - const int offset = unchecked((int)2166136261); - const int prime = 16777619; - static int HashCodeAggregator(int hashCode, object? value) => value == null - ? (hashCode ^ 0) * prime - : (hashCode ^ value.GetHashCode()) * prime; - - return global::System.Linq.Enumerable.Aggregate(fields, offset, HashCodeAggregator); - } + [global::System.Text.Json.Serialization.JsonPropertyName("spans")] + public global::System.Collections.Generic.IList? Spans { get; set; } /// - /// + /// Additional properties that are not explicitly defined in the schema /// - public bool Equals(LayerizedTextBlock other) - { - return - global::System.Collections.Generic.EqualityComparer.Default.Equals(DetectedTextBlock, other.DetectedTextBlock) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(LayerizedTextBlockVariant2, other.LayerizedTextBlockVariant2) - ; - } + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); /// - /// + /// Initializes a new instance of the class. /// - public static bool operator ==(LayerizedTextBlock obj1, LayerizedTextBlock obj2) + /// + /// X coordinate in pixels from the top-left corner. + /// + /// + /// Y coordinate in pixels from the top-left corner. + /// + /// + /// Width of the text region in pixels. + /// + /// + /// Height of the text region in pixels. + /// + /// + /// The detected text content. Line breaks are represented as \n. + /// + /// + /// Detected text alignment. + /// + /// + /// Detected text formatting effects. + /// + /// + /// Identifier of this block's layer in the page at `html_url`; pass it to the page's editing API. + /// + /// + /// Rotation angle in degrees (clockwise). Defaults to 0.
+ /// Default Value: 0 + /// + /// + /// Best-matching font name from the font library. + /// + /// + /// Alternative font matches, ranked by similarity. + /// + /// + /// Detected font size in points. + /// + /// + /// Line height multiplier (e.g., 1.2). + /// + /// + /// Detected text color in hex format. + /// + /// + /// Inferred typographic role of this text block. + /// + /// + /// The block's colour runs in reading order. Present, with at least one
+ /// run, whenever `color` is set; concatenating the runs' `text` reproduces
+ /// the block's `text`. `color` reports the dominant colour. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public LayerizedTextBlock( + int x, + int y, + int width, + int height, + string text, + global::Ideogram.LayerizedTextBlockAlignment alignment, + global::System.Collections.Generic.IList formatting, + string layerId, + string? angle, + string? fontName, + global::System.Collections.Generic.IList? fontAlternatives, + int? fontSize, + string? lineHeight, + string? color, + global::Ideogram.LayerizedTextBlockRole? role, + global::System.Collections.Generic.IList? spans) { - return global::System.Collections.Generic.EqualityComparer.Default.Equals(obj1, obj2); + this.X = x; + this.Y = y; + this.Width = width; + this.Height = height; + this.Text = text ?? throw new global::System.ArgumentNullException(nameof(text)); + this.Alignment = alignment; + this.Angle = angle; + this.FontName = fontName; + this.FontAlternatives = fontAlternatives; + this.FontSize = fontSize; + this.LineHeight = lineHeight; + this.Color = color; + this.Formatting = formatting ?? throw new global::System.ArgumentNullException(nameof(formatting)); + this.Role = role; + this.LayerId = layerId ?? throw new global::System.ArgumentNullException(nameof(layerId)); + this.Spans = spans; } /// - /// + /// Initializes a new instance of the class. /// - public static bool operator !=(LayerizedTextBlock obj1, LayerizedTextBlock obj2) + public LayerizedTextBlock() { - return !(obj1 == obj2); } - /// - /// - /// - public override bool Equals(object? obj) - { - return obj is LayerizedTextBlock o && Equals(o); - } } -} +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.LayerizedTextBlockAlignment.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.LayerizedTextBlockAlignment.g.cs new file mode 100644 index 00000000..e6cc24e5 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.LayerizedTextBlockAlignment.g.cs @@ -0,0 +1,57 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Detected text alignment. + /// + public enum LayerizedTextBlockAlignment + { + /// + /// + /// + Center, + /// + /// + /// + Left, + /// + /// + /// + Right, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class LayerizedTextBlockAlignmentExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this LayerizedTextBlockAlignment value) + { + return value switch + { + LayerizedTextBlockAlignment.Center => "center", + LayerizedTextBlockAlignment.Left => "left", + LayerizedTextBlockAlignment.Right => "right", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static LayerizedTextBlockAlignment? ToEnum(string value) + { + return value switch + { + "center" => LayerizedTextBlockAlignment.Center, + "left" => LayerizedTextBlockAlignment.Left, + "right" => LayerizedTextBlockAlignment.Right, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.LayerizedTextBlockFormattingItems.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.LayerizedTextBlockFormattingItems.g.cs new file mode 100644 index 00000000..d2e4b400 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.LayerizedTextBlockFormattingItems.g.cs @@ -0,0 +1,87 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// + /// + public enum LayerizedTextBlockFormattingItems + { + /// + /// + /// + AllCaps, + /// + /// + /// + Bold, + /// + /// + /// + Italic, + /// + /// + /// + SmallCaps, + /// + /// + /// + Strikethrough, + /// + /// + /// + Subscript, + /// + /// + /// + Superscript, + /// + /// + /// + Underline, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class LayerizedTextBlockFormattingItemsExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this LayerizedTextBlockFormattingItems value) + { + return value switch + { + LayerizedTextBlockFormattingItems.AllCaps => "all_caps", + LayerizedTextBlockFormattingItems.Bold => "bold", + LayerizedTextBlockFormattingItems.Italic => "italic", + LayerizedTextBlockFormattingItems.SmallCaps => "small_caps", + LayerizedTextBlockFormattingItems.Strikethrough => "strikethrough", + LayerizedTextBlockFormattingItems.Subscript => "subscript", + LayerizedTextBlockFormattingItems.Superscript => "superscript", + LayerizedTextBlockFormattingItems.Underline => "underline", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static LayerizedTextBlockFormattingItems? ToEnum(string value) + { + return value switch + { + "all_caps" => LayerizedTextBlockFormattingItems.AllCaps, + "bold" => LayerizedTextBlockFormattingItems.Bold, + "italic" => LayerizedTextBlockFormattingItems.Italic, + "small_caps" => LayerizedTextBlockFormattingItems.SmallCaps, + "strikethrough" => LayerizedTextBlockFormattingItems.Strikethrough, + "subscript" => LayerizedTextBlockFormattingItems.Subscript, + "superscript" => LayerizedTextBlockFormattingItems.Superscript, + "underline" => LayerizedTextBlockFormattingItems.Underline, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.LayerizedTextBlockRole.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.LayerizedTextBlockRole.g.cs new file mode 100644 index 00000000..2c816247 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.LayerizedTextBlockRole.g.cs @@ -0,0 +1,63 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Inferred typographic role of this text block. + /// + public enum LayerizedTextBlockRole + { + /// + /// + /// + Body, + /// + /// + /// + Caption, + /// + /// + /// + Heading, + /// + /// + /// + Subheading, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class LayerizedTextBlockRoleExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this LayerizedTextBlockRole value) + { + return value switch + { + LayerizedTextBlockRole.Body => "body", + LayerizedTextBlockRole.Caption => "caption", + LayerizedTextBlockRole.Heading => "heading", + LayerizedTextBlockRole.Subheading => "subheading", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static LayerizedTextBlockRole? ToEnum(string value) + { + return value switch + { + "body" => LayerizedTextBlockRole.Body, + "caption" => LayerizedTextBlockRole.Caption, + "heading" => LayerizedTextBlockRole.Heading, + "subheading" => LayerizedTextBlockRole.Subheading, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.LayerizedTextBlockVariant2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.LayerizedTextBlockVariant2.Json.g.cs deleted file mode 100644 index 39c29f36..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.LayerizedTextBlockVariant2.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class LayerizedTextBlockVariant2 - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.LayerizedTextBlockVariant2? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.LayerizedTextBlockVariant2), - jsonSerializerContext) as global::Ideogram.LayerizedTextBlockVariant2; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.LayerizedTextBlockVariant2? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.LayerizedTextBlockVariant2? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.LayerizedTextBlockVariant2), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.LayerizedTextBlockVariant2; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.LayerizedTextBlockVariant2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.LayerizedTextBlockVariant2.g.cs deleted file mode 100644 index 8835cae5..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.LayerizedTextBlockVariant2.g.cs +++ /dev/null @@ -1,65 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - public sealed partial class LayerizedTextBlockVariant2 - { - /// - /// Identifier of this block's layer in the page at `html_url`; pass it to the page's editing API.
- /// Example: text-0 - ///
- /// text-0 - [global::System.Text.Json.Serialization.JsonPropertyName("layer_id")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string LayerId { get; set; } - - /// - /// The block's colour runs in reading order. Present, with at least one
- /// run, whenever `color` is set; concatenating the runs' `text` reproduces
- /// the block's `text`. `color` reports the dominant colour. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("spans")] - public global::System.Collections.Generic.IList? Spans { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Identifier of this block's layer in the page at `html_url`; pass it to the page's editing API.
- /// Example: text-0 - /// - /// - /// The block's colour runs in reading order. Present, with at least one
- /// run, whenever `color` is set; concatenating the runs' `text` reproduces
- /// the block's `text`. `color` reports the dominant colour. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public LayerizedTextBlockVariant2( - string layerId, - global::System.Collections.Generic.IList? spans) - { - this.LayerId = layerId ?? throw new global::System.ArgumentNullException(nameof(layerId)); - this.Spans = spans; - } - - /// - /// Initializes a new instance of the class. - /// - public LayerizedTextBlockVariant2() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ListAccountApiKeysResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ListAccountApiKeysResponse.g.cs index a3f043e2..7f4c6b2b 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ListAccountApiKeysResponse.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ListAccountApiKeysResponse.g.cs @@ -4,7 +4,7 @@ namespace Ideogram { /// - /// Example: {"api_keys":[{"creation_time":"2000-01-23T04:56:07\u002B00:00","label":"Live production environment","redacted_api_key":"ATG56\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022","api_key_id":"JRPVD7jWR1aTBYiJ0UFVOg","creator_display_label":"John Doe","status":null},{"creation_time":"2000-01-23T04:56:07\u002B00:00","label":"Live production environment","redacted_api_key":"ATG56\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022","api_key_id":"JRPVD7jWR1aTBYiJ0UFVOg","creator_display_label":"John Doe","status":null}]} + /// /// public sealed partial class ListAccountApiKeysResponse { diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ListAccountInvoicesResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ListAccountInvoicesResponse.g.cs index 013ee3bc..0624e066 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ListAccountInvoicesResponse.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ListAccountInvoicesResponse.g.cs @@ -4,7 +4,7 @@ namespace Ideogram { /// - /// Example: {"invoices":[{"start_time":"2000-01-23T04:56:07\u002B00:00","total":"150.00","paid_time":"2000-01-23T04:56:07\u002B00:00","end_time":"2000-01-23T04:56:07\u002B00:00","line_items":[{"cost_total":"84.00","quantity":"2100","api_key":{"redacted_key":"ATG5\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022","id":"JRPVD7jWR1aTBYiJ0UFVOg","label":"Live production environment"},"description":"Ideogram v4 Generation","unit_price":"0.04","currency_code":"USD"},{"cost_total":"84.00","quantity":"2100","api_key":{"redacted_key":"ATG5\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022","id":"JRPVD7jWR1aTBYiJ0UFVOg","label":"Live production environment"},"description":"Ideogram v4 Generation","unit_price":"0.04","currency_code":"USD"}],"issued_time":"2000-01-23T04:56:07\u002B00:00","currency_code":"USD","status":"paid"},{"start_time":"2000-01-23T04:56:07\u002B00:00","total":"150.00","paid_time":"2000-01-23T04:56:07\u002B00:00","end_time":"2000-01-23T04:56:07\u002B00:00","line_items":[{"cost_total":"84.00","quantity":"2100","api_key":{"redacted_key":"ATG5\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022","id":"JRPVD7jWR1aTBYiJ0UFVOg","label":"Live production environment"},"description":"Ideogram v4 Generation","unit_price":"0.04","currency_code":"USD"},{"cost_total":"84.00","quantity":"2100","api_key":{"redacted_key":"ATG5\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022","id":"JRPVD7jWR1aTBYiJ0UFVOg","label":"Live production environment"},"description":"Ideogram v4 Generation","unit_price":"0.04","currency_code":"USD"}],"issued_time":"2000-01-23T04:56:07\u002B00:00","currency_code":"USD","status":"paid"}]} + /// /// public sealed partial class ListAccountInvoicesResponse { diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ListCustomModelsScope.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ListCustomModelsScope.g.cs deleted file mode 100644 index fbe0a4d7..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ListCustomModelsScope.g.cs +++ /dev/null @@ -1,51 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - public enum ListCustomModelsScope - { - /// - /// - /// - Owned, - /// - /// - /// - Shared, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class ListCustomModelsScopeExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this ListCustomModelsScope value) - { - return value switch - { - ListCustomModelsScope.Owned => "owned", - ListCustomModelsScope.Shared => "shared", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static ListCustomModelsScope? ToEnum(string value) - { - return value switch - { - "owned" => ListCustomModelsScope.Owned, - "shared" => ListCustomModelsScope.Shared, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ListDatasetsResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ListDatasetsResponse.Json.g.cs deleted file mode 100644 index e4373eb0..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ListDatasetsResponse.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class ListDatasetsResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.ListDatasetsResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.ListDatasetsResponse), - jsonSerializerContext) as global::Ideogram.ListDatasetsResponse; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.ListDatasetsResponse? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.ListDatasetsResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.ListDatasetsResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ListDatasetsResponse; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ListDatasetsResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ListDatasetsResponse.g.cs deleted file mode 100644 index 73b13a2d..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ListDatasetsResponse.g.cs +++ /dev/null @@ -1,49 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"datasets":[{"creation_time":"2000-01-23T04:56:07\u002B00:00","user_id":"user_id","dataset_id":"dataset_id","name":"name","cover_asset_identifier":{"collection_id":"collection_id","asset_type":null,"asset_id":"asset_id"}},{"creation_time":"2000-01-23T04:56:07\u002B00:00","user_id":"user_id","dataset_id":"dataset_id","name":"name","cover_asset_identifier":{"collection_id":"collection_id","asset_type":null,"asset_id":"asset_id"}}]} - /// - public sealed partial class ListDatasetsResponse - { - /// - /// Matching datasets, most recently updated first.
- /// Default Value: [] - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("datasets")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList Datasets { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Matching datasets, most recently updated first.
- /// Default Value: [] - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ListDatasetsResponse( - global::System.Collections.Generic.IList datasets) - { - this.Datasets = datasets ?? throw new global::System.ArgumentNullException(nameof(datasets)); - } - - /// - /// Initializes a new instance of the class. - /// - public ListDatasetsResponse() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ListModelsResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ListModelsResponse.Json.g.cs deleted file mode 100644 index cbbf1f3f..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ListModelsResponse.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class ListModelsResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.ListModelsResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.ListModelsResponse), - jsonSerializerContext) as global::Ideogram.ListModelsResponse; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.ListModelsResponse? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.ListModelsResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.ListModelsResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ListModelsResponse; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ListModelsResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ListModelsResponse.g.cs deleted file mode 100644 index eb2cebe2..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ListModelsResponse.g.cs +++ /dev/null @@ -1,49 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"models":[{"creation_time":"2000-01-23T04:56:07\u002B00:00","last_update_time":"2000-01-23T04:56:07\u002B00:00","is_available_for_generation":true,"dataset_id":"dataset_id","name":"name","is_owned":true,"training_runs":[{"creation_time":"2000-01-23T04:56:07\u002B00:00","last_update_time":"2000-01-23T04:56:07\u002B00:00","lora_rank":6,"num_chips":1,"training_run_id":"training_run_id","ema":5.962133916683182,"training_steps":0,"learning_rate":5.637376656633329,"status":null},{"creation_time":"2000-01-23T04:56:07\u002B00:00","last_update_time":"2000-01-23T04:56:07\u002B00:00","lora_rank":6,"num_chips":1,"training_run_id":"training_run_id","ema":5.962133916683182,"training_steps":0,"learning_rate":5.637376656633329,"status":null}],"model_id":"model_id","custom_model_uri":"model/my-custom-model/version/1","status":null},{"creation_time":"2000-01-23T04:56:07\u002B00:00","last_update_time":"2000-01-23T04:56:07\u002B00:00","is_available_for_generation":true,"dataset_id":"dataset_id","name":"name","is_owned":true,"training_runs":[{"creation_time":"2000-01-23T04:56:07\u002B00:00","last_update_time":"2000-01-23T04:56:07\u002B00:00","lora_rank":6,"num_chips":1,"training_run_id":"training_run_id","ema":5.962133916683182,"training_steps":0,"learning_rate":5.637376656633329,"status":null},{"creation_time":"2000-01-23T04:56:07\u002B00:00","last_update_time":"2000-01-23T04:56:07\u002B00:00","lora_rank":6,"num_chips":1,"training_run_id":"training_run_id","ema":5.962133916683182,"training_steps":0,"learning_rate":5.637376656633329,"status":null}],"model_id":"model_id","custom_model_uri":"model/my-custom-model/version/1","status":null}]} - /// - public sealed partial class ListModelsResponse - { - /// - /// List of models.
- /// Default Value: [] - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("models")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList Models { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// List of models.
- /// Default Value: [] - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ListModelsResponse( - global::System.Collections.Generic.IList models) - { - this.Models = models ?? throw new global::System.ArgumentNullException(nameof(models)); - } - - /// - /// Initializes a new instance of the class. - /// - public ListModelsResponse() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ListOrganizationInvoicesResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ListOrganizationInvoicesResponse.Json.g.cs deleted file mode 100644 index c45e1a83..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ListOrganizationInvoicesResponse.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class ListOrganizationInvoicesResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.ListOrganizationInvoicesResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.ListOrganizationInvoicesResponse), - jsonSerializerContext) as global::Ideogram.ListOrganizationInvoicesResponse; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.ListOrganizationInvoicesResponse? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.ListOrganizationInvoicesResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.ListOrganizationInvoicesResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ListOrganizationInvoicesResponse; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ListOrganizationInvoicesResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ListOrganizationInvoicesResponse.g.cs deleted file mode 100644 index 6268d64e..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ListOrganizationInvoicesResponse.g.cs +++ /dev/null @@ -1,61 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"invoices":[{"total_spend":{"amount":1050,"currency_code":"USD"},"start_time":"2024-01-01T00:00:00\u002B00:00","end_time":"2024-01-31T23:59:59\u002B00:00","invoice_id":"invoice_123","line_items":[{"charge_name":"Image Generation - V3","total":{"amount":1050,"currency_code":"USD"},"quantity":1000,"unit_price":{"amount":1050,"currency_code":"USD"},"api_key_id":"api_key_id"},{"charge_name":"Image Generation - V3","total":{"amount":1050,"currency_code":"USD"},"quantity":1000,"unit_price":{"amount":1050,"currency_code":"USD"},"api_key_id":"api_key_id"}],"issued_time":"2024-01-01T00:00:00\u002B00:00","paid_date":"2024-02-01T00:00:00\u002B00:00","invoice_status":"PAID"},{"total_spend":{"amount":1050,"currency_code":"USD"},"start_time":"2024-01-01T00:00:00\u002B00:00","end_time":"2024-01-31T23:59:59\u002B00:00","invoice_id":"invoice_123","line_items":[{"charge_name":"Image Generation - V3","total":{"amount":1050,"currency_code":"USD"},"quantity":1000,"unit_price":{"amount":1050,"currency_code":"USD"},"api_key_id":"api_key_id"},{"charge_name":"Image Generation - V3","total":{"amount":1050,"currency_code":"USD"},"quantity":1000,"unit_price":{"amount":1050,"currency_code":"USD"},"api_key_id":"api_key_id"}],"issued_time":"2024-01-01T00:00:00\u002B00:00","paid_date":"2024-02-01T00:00:00\u002B00:00","invoice_status":"PAID"}],"billing_configured":true} - /// - public sealed partial class ListOrganizationInvoicesResponse - { - /// - /// List of invoices
- /// Default Value: [] - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("invoices")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList Invoices { get; set; } - - /// - /// Whether the organization has a billing account that invoices can be issued against. When false, the list is empty because nothing is billed yet, not because nothing was used. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("billing_configured")] - [global::System.Text.Json.Serialization.JsonRequired] - public required bool BillingConfigured { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// List of invoices
- /// Default Value: [] - /// - /// - /// Whether the organization has a billing account that invoices can be issued against. When false, the list is empty because nothing is billed yet, not because nothing was used. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ListOrganizationInvoicesResponse( - global::System.Collections.Generic.IList invoices, - bool billingConfigured) - { - this.Invoices = invoices ?? throw new global::System.ArgumentNullException(nameof(invoices)); - this.BillingConfigured = billingConfigured; - } - - /// - /// Initializes a new instance of the class. - /// - public ListOrganizationInvoicesResponse() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.LiteOrganizationMember.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.LiteOrganizationMember.Json.g.cs deleted file mode 100644 index 8e29710a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.LiteOrganizationMember.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class LiteOrganizationMember - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.LiteOrganizationMember? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.LiteOrganizationMember), - jsonSerializerContext) as global::Ideogram.LiteOrganizationMember; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.LiteOrganizationMember? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.LiteOrganizationMember? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.LiteOrganizationMember), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.LiteOrganizationMember; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.LiteOrganizationMember.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.LiteOrganizationMember.g.cs deleted file mode 100644 index e9cb42d9..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.LiteOrganizationMember.g.cs +++ /dev/null @@ -1,78 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// A lite representation of an organization member with optional fields for identification
- /// Example: {"display_handle":"john_doe","email_address":"john.doe@example.com","user_id":"dXNlcl8xMjM"} - ///
- public sealed partial class LiteOrganizationMember - { - /// - /// Base64 encoded user ID
- /// Example: dXNlcl8xMjM - ///
- /// dXNlcl8xMjM - [global::System.Text.Json.Serialization.JsonPropertyName("user_id")] - public string? UserId { get; set; } - - /// - /// The display handle/username of the member
- /// Example: john_doe - ///
- /// john_doe - [global::System.Text.Json.Serialization.JsonPropertyName("display_handle")] - public string? DisplayHandle { get; set; } - - /// - /// The email address of the member
- /// Example: john.doe@example.com - ///
- /// john.doe@example.com - [global::System.Text.Json.Serialization.JsonPropertyName("email_address")] - public string? EmailAddress { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Base64 encoded user ID
- /// Example: dXNlcl8xMjM - /// - /// - /// The display handle/username of the member
- /// Example: john_doe - /// - /// - /// The email address of the member
- /// Example: john.doe@example.com - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public LiteOrganizationMember( - string? userId, - string? displayHandle, - string? emailAddress) - { - this.UserId = userId; - this.DisplayHandle = displayHandle; - this.EmailAddress = emailAddress; - } - - /// - /// Initializes a new instance of the class. - /// - public LiteOrganizationMember() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.LivingImageQuality.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.LivingImageQuality.g.cs deleted file mode 100644 index 67230712..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.LivingImageQuality.g.cs +++ /dev/null @@ -1,52 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The output resolution tier. `standard` renders at 768P; `high` renders at 2K. Higher tiers cost more.
- /// Default Value: standard - ///
- public enum LivingImageQuality - { - /// - /// - /// - High, - /// - /// - /// - Standard, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class LivingImageQualityExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this LivingImageQuality value) - { - return value switch - { - LivingImageQuality.High => "high", - LivingImageQuality.Standard => "standard", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static LivingImageQuality? ToEnum(string value) - { - return value switch - { - "high" => LivingImageQuality.High, - "standard" => LivingImageQuality.Standard, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.LivingImageRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.LivingImageRequest.Json.g.cs deleted file mode 100644 index 954d03be..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.LivingImageRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class LivingImageRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.LivingImageRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.LivingImageRequest), - jsonSerializerContext) as global::Ideogram.LivingImageRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.LivingImageRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.LivingImageRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.LivingImageRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.LivingImageRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.LivingImageRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.LivingImageRequest.g.cs deleted file mode 100644 index e377e810..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.LivingImageRequest.g.cs +++ /dev/null @@ -1,91 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"duration":8,"target_collection_id":"target_collection_id","image_asset_identifier":{"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"},"quality":null} - /// - public sealed partial class LivingImageRequest - { - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - ///
- /// {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - [global::System.Text.Json.Serialization.JsonPropertyName("image_asset_identifier")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.AssetIdentifier ImageAssetIdentifier { get; set; } - - /// - /// The output resolution tier. `standard` renders at 768P; `high` renders at 2K. Higher tiers cost more.
- /// Default Value: standard - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("quality")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.LivingImageQualityJsonConverter))] - public global::Ideogram.LivingImageQuality? Quality { get; set; } - - /// - /// The length of the generated video in seconds.
- /// Default Value: 8
- /// Example: 8 - ///
- /// 8 - [global::System.Text.Json.Serialization.JsonPropertyName("duration")] - public int? Duration { get; set; } - - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output video is added to it when the request completes. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("target_collection_id")] - public string? TargetCollectionId { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The output resolution tier. `standard` renders at 768P; `high` renders at 2K. Higher tiers cost more.
- /// Default Value: standard - /// - /// - /// The length of the generated video in seconds.
- /// Default Value: 8
- /// Example: 8 - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output video is added to it when the request completes. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public LivingImageRequest( - global::Ideogram.AssetIdentifier imageAssetIdentifier, - global::Ideogram.LivingImageQuality? quality, - int? duration, - string? targetCollectionId) - { - this.ImageAssetIdentifier = imageAssetIdentifier ?? throw new global::System.ArgumentNullException(nameof(imageAssetIdentifier)); - this.Quality = quality; - this.Duration = duration; - this.TargetCollectionId = targetCollectionId; - } - - /// - /// Initializes a new instance of the class. - /// - public LivingImageRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.LivingImageResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.LivingImageResponse.Json.g.cs deleted file mode 100644 index f161b69f..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.LivingImageResponse.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class LivingImageResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.LivingImageResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.LivingImageResponse), - jsonSerializerContext) as global::Ideogram.LivingImageResponse; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.LivingImageResponse? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.LivingImageResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.LivingImageResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.LivingImageResponse; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.LivingImageResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.LivingImageResponse.g.cs deleted file mode 100644 index fb69aa5d..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.LivingImageResponse.g.cs +++ /dev/null @@ -1,62 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Acknowledgement that the living image was accepted. Video generation always runs asynchronously, so the video is never part of this response: poll for it with `GET /v1/generations/{generation_id}` using the returned `generation_id`.
- /// Example: {"generation_id":"generation_id","created":"2000-01-23T04:56:07\u002B00:00"} - ///
- public sealed partial class LivingImageResponse - { - /// - /// URL-safe base64 ID of the accepted generation. Accepted by the
- /// `GET /v1/generations/{generation_id}` polling endpoint. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("generation_id")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string GenerationId { get; set; } - - /// - /// The time the request was accepted. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("created")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.DateTime Created { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// URL-safe base64 ID of the accepted generation. Accepted by the
- /// `GET /v1/generations/{generation_id}` polling endpoint. - /// - /// - /// The time the request was accepted. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public LivingImageResponse( - string generationId, - global::System.DateTime created) - { - this.GenerationId = generationId ?? throw new global::System.ArgumentNullException(nameof(generationId)); - this.Created = created; - } - - /// - /// Initializes a new instance of the class. - /// - public LivingImageResponse() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.LookbookRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.LookbookRequest.Json.g.cs deleted file mode 100644 index 217bec7d..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.LookbookRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class LookbookRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.LookbookRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.LookbookRequest), - jsonSerializerContext) as global::Ideogram.LookbookRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.LookbookRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.LookbookRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.LookbookRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.LookbookRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.LookbookRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.LookbookRequest.g.cs deleted file mode 100644 index 7da18d20..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.LookbookRequest.g.cs +++ /dev/null @@ -1,123 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"aspect_ratio":"aspect_ratio","private":true,"webhook_url":"https://api.example.com/webhooks/ideogram","category":"dresses","num_shoots":1,"product_asset_identifiers":[{"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"},{"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"},{"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"},{"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"},{"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"}]} - /// - public sealed partial class LookbookRequest - { - /// - /// Product images whose appearance must be preserved in the generated looks. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("product_asset_identifiers")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList ProductAssetIdentifiers { get; set; } - - /// - /// Selects the category-specific Lookbook presentation reference. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("category")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.LookbookRequestCategoryJsonConverter))] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.LookbookRequestCategory Category { get; set; } - - /// - /// The aspect ratio of each generated 2x2 composite before it is split into images. Defaults to `1:1` when omitted. Supported values are `1:1`, `3:4`, and `9:16`. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] - public string? AspectRatio { get; set; } - - /// - /// Number of four-image lookbook shoots to create.
- /// Default Value: 3 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("num_shoots")] - public int? NumShoots { get; set; } - - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - ///
- /// https://api.example.com/webhooks/ideogram - [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] - public string? WebhookUrl { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Product images whose appearance must be preserved in the generated looks. - /// - /// - /// Selects the category-specific Lookbook presentation reference. - /// - /// - /// The aspect ratio of each generated 2x2 composite before it is split into images. Defaults to `1:1` when omitted. Supported values are `1:1`, `3:4`, and `9:16`. - /// - /// - /// Number of four-image lookbook shoots to create.
- /// Default Value: 3 - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public LookbookRequest( - global::System.Collections.Generic.IList productAssetIdentifiers, - global::Ideogram.LookbookRequestCategory category, - string? aspectRatio, - int? numShoots, - bool? @private, - string? webhookUrl) - { - this.ProductAssetIdentifiers = productAssetIdentifiers ?? throw new global::System.ArgumentNullException(nameof(productAssetIdentifiers)); - this.Category = category; - this.AspectRatio = aspectRatio; - this.NumShoots = numShoots; - this.Private = @private; - this.WebhookUrl = webhookUrl; - } - - /// - /// Initializes a new instance of the class. - /// - public LookbookRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.LookbookRequestCategory.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.LookbookRequestCategory.g.cs deleted file mode 100644 index 3ec9ec82..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.LookbookRequestCategory.g.cs +++ /dev/null @@ -1,63 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Selects the category-specific Lookbook presentation reference. - /// - public enum LookbookRequestCategory - { - /// - /// - /// - Dresses, - /// - /// - /// - Jeans, - /// - /// - /// - Pants, - /// - /// - /// - Tops, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class LookbookRequestCategoryExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this LookbookRequestCategory value) - { - return value switch - { - LookbookRequestCategory.Dresses => "dresses", - LookbookRequestCategory.Jeans => "jeans", - LookbookRequestCategory.Pants => "pants", - LookbookRequestCategory.Tops => "tops", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static LookbookRequestCategory? ToEnum(string value) - { - return value switch - { - "dresses" => LookbookRequestCategory.Dresses, - "jeans" => LookbookRequestCategory.Jeans, - "pants" => LookbookRequestCategory.Pants, - "tops" => LookbookRequestCategory.Tops, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.LookbookResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.LookbookResponse.Json.g.cs deleted file mode 100644 index ddd11e64..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.LookbookResponse.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class LookbookResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.LookbookResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.LookbookResponse), - jsonSerializerContext) as global::Ideogram.LookbookResponse; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.LookbookResponse? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.LookbookResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.LookbookResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.LookbookResponse; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.LookbookResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.LookbookResponse.g.cs deleted file mode 100644 index a9fe3c8a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.LookbookResponse.g.cs +++ /dev/null @@ -1,49 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Acknowledgement that the Lookbook workflow was accepted. Poll
- /// `GET /v2/generations/{generation_id}` for status and results.
- /// Example: {"generation_id":"generation_id"} - ///
- public sealed partial class LookbookResponse - { - /// - /// URL-safe base64 ID accepted by the generation polling endpoint. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("generation_id")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string GenerationId { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// URL-safe base64 ID accepted by the generation polling endpoint. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public LookbookResponse( - string generationId) - { - this.GenerationId = generationId ?? throw new global::System.ArgumentNullException(nameof(generationId)); - } - - /// - /// Initializes a new instance of the class. - /// - public LookbookResponse() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.MagicPromptMode.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.MagicPromptMode.g.cs index 07b1068c..b26fb4a7 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.MagicPromptMode.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.MagicPromptMode.g.cs @@ -4,8 +4,7 @@ namespace Ideogram { /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: on + /// Determine if MagicPrompt should be used in generating the request or not. ///
public enum MagicPromptMode { diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.MagicPromptOption.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.MagicPromptOption.g.cs deleted file mode 100644 index e693d265..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.MagicPromptOption.g.cs +++ /dev/null @@ -1,58 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - ///
- public enum MagicPromptOption - { - /// - /// - /// - Auto, - /// - /// - /// - Off, - /// - /// - /// - On, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class MagicPromptOptionExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this MagicPromptOption value) - { - return value switch - { - MagicPromptOption.Auto => "AUTO", - MagicPromptOption.Off => "OFF", - MagicPromptOption.On => "ON", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static MagicPromptOption? ToEnum(string value) - { - return value switch - { - "AUTO" => MagicPromptOption.Auto, - "OFF" => MagicPromptOption.Off, - "ON" => MagicPromptOption.On, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.MagicPromptRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.MagicPromptRequest.Json.g.cs deleted file mode 100644 index 21b760d2..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.MagicPromptRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class MagicPromptRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.MagicPromptRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.MagicPromptRequest), - jsonSerializerContext) as global::Ideogram.MagicPromptRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.MagicPromptRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.MagicPromptRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.MagicPromptRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.MagicPromptRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.MagicPromptRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.MagicPromptRequest.g.cs deleted file mode 100644 index 84140344..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.MagicPromptRequest.g.cs +++ /dev/null @@ -1,299 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// A request to generate a magic prompt
- /// Example: {"prompt":"a cat","magic_prompt_version":"V_0_4","classify_prompt_category":true,"style_type":"AUTO","seed":12345} - ///
- public sealed partial class MagicPromptRequest - { - /// - /// The prompt to enhance with a magic prompt. Mutually
- /// exclusive with `messages`; one of the two must be set.
- /// Example: a cat - ///
- /// a cat - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - public string? Prompt { get; set; } - - /// - /// The magic prompt version to use when magic prompt option is set to AUTO or ON.
- /// Example: V_0 - ///
- /// V_0 - [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt_version")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.MagicPromptVersionEnumJsonConverter))] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.MagicPromptVersionEnum MagicPromptVersion { get; set; } - - /// - /// Whether to classify the prompt into a use case category.
- /// Default Value: true
- /// Example: false - ///
- /// false - [global::System.Text.Json.Serialization.JsonPropertyName("classify_prompt_category")] - [global::System.Text.Json.Serialization.JsonRequired] - public required bool ClassifyPromptCategory { get; set; } - - /// - /// The style type to generate with.
- /// Default Value: GENERAL
- /// Example: GENERAL - ///
- /// GENERAL - [global::System.Text.Json.Serialization.JsonPropertyName("style_type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.StyleTypeV3JsonConverter))] - public global::Ideogram.StyleTypeV3? StyleType { get; set; } - - /// - /// Random seed for reproducible generation
- /// Example: 12345 - ///
- /// 12345 - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// Generations with character reference are subject to the character reference pricing. A set of images to use as character references (max size 25MB per image; the whole request must stay under 50MB), currently only supports 1 character reference image. The images should be in JPEG, PNG or WebP format. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("character_reference_images")] - public global::System.Collections.Generic.IList? CharacterReferenceImages { get; set; } - - /// - /// A system prompt to use for the magic prompt.
- /// Example: You are a helpful assistant that generates magic prompts for images. - ///
- /// You are a helpful assistant that generates magic prompts for images. - [global::System.Text.Json.Serialization.JsonPropertyName("system_prompt")] - public string? SystemPrompt { get; set; } - - /// - /// Optional target aspect ratio used to condition the generated
- /// magic prompt's framing. Forwarded to the autoprompt pipeline
- /// so registry-driven system prompts that interpolate
- /// `{{aspect_ratio}}` see the bucket the caller intends. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.AspectRatioV3JsonConverter))] - public global::Ideogram.AspectRatioV3? AspectRatio { get; set; } - - /// - /// Sampling temperature override. Defaults to the trainer-conditioned
- /// value when omitted (0.7 for V4_QWEN_3_5_27B). Only honored with
- /// V4 magic-prompt versions; supplying it with another version
- /// returns 400. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("temperature")] - public float? Temperature { get; set; } - - /// - /// Nucleus-sampling top_p override. Only honored with V4 versions. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("top_p")] - public float? TopP { get; set; } - - /// - /// Top-k sampling override. Only honored with V4 versions. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("top_k")] - public int? TopK { get; set; } - - /// - /// min_p sampling override. Only honored with V4 versions. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("min_p")] - public float? MinP { get; set; } - - /// - /// Cap on the number of tokens the model may generate. Defaults to
- /// 4096 (the trainer's reference cap) when omitted. Only honored
- /// with V4 versions. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("max_tokens")] - public int? MaxTokens { get; set; } - - /// - /// Presence-penalty override. Only honored with V4 versions. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("presence_penalty")] - public float? PresencePenalty { get; set; } - - /// - /// Frequency-penalty override. Only honored with V4 versions. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("frequency_penalty")] - public float? FrequencyPenalty { get; set; } - - /// - /// Repetition-penalty override. Only honored with V4 versions. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("repetition_penalty")] - public float? RepetitionPenalty { get; set; } - - /// - /// Optional override of the LoRA adapter the V4 magic-prompt
- /// wrapper downloads and runs. Pass a `gs://` URI pointing at a
- /// checkpoint directory containing `adapter_config.json`. When
- /// omitted, the wrapper-preloaded production checkpoint is used.
- /// Honored with the wrapper-routed LoRA versions
- /// `V4_QWEN_3_5_27B` and `V4_QWEN_3_5_27B_FULL_FINETUNE_LORA`;
- /// supplying it with `V4_QWEN_3_5_27B_PREFUSED` or
- /// `V4_QWEN_3_5_27B_FULL_FINETUNE` (which serve fixed weights and
- /// cannot swap adapters per request) or any other version returns
- /// 400. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("checkpoint")] - public string? Checkpoint { get; set; } - - /// - /// Pre-formed chat messages forwarded verbatim to V4. Mutually
- /// exclusive with `prompt`; exactly one must be set. V4 only. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("messages")] - public global::System.Collections.Generic.IList? Messages { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The magic prompt version to use when magic prompt option is set to AUTO or ON.
- /// Example: V_0 - /// - /// - /// Whether to classify the prompt into a use case category.
- /// Default Value: true
- /// Example: false - /// - /// - /// The prompt to enhance with a magic prompt. Mutually
- /// exclusive with `messages`; one of the two must be set.
- /// Example: a cat - /// - /// - /// The style type to generate with.
- /// Default Value: GENERAL
- /// Example: GENERAL - /// - /// - /// Random seed for reproducible generation
- /// Example: 12345 - /// - /// - /// Generations with character reference are subject to the character reference pricing. A set of images to use as character references (max size 25MB per image; the whole request must stay under 50MB), currently only supports 1 character reference image. The images should be in JPEG, PNG or WebP format. - /// - /// - /// A system prompt to use for the magic prompt.
- /// Example: You are a helpful assistant that generates magic prompts for images. - /// - /// - /// Optional target aspect ratio used to condition the generated
- /// magic prompt's framing. Forwarded to the autoprompt pipeline
- /// so registry-driven system prompts that interpolate
- /// `{{aspect_ratio}}` see the bucket the caller intends. - /// - /// - /// Sampling temperature override. Defaults to the trainer-conditioned
- /// value when omitted (0.7 for V4_QWEN_3_5_27B). Only honored with
- /// V4 magic-prompt versions; supplying it with another version
- /// returns 400. - /// - /// - /// Nucleus-sampling top_p override. Only honored with V4 versions. - /// - /// - /// Top-k sampling override. Only honored with V4 versions. - /// - /// - /// min_p sampling override. Only honored with V4 versions. - /// - /// - /// Cap on the number of tokens the model may generate. Defaults to
- /// 4096 (the trainer's reference cap) when omitted. Only honored
- /// with V4 versions. - /// - /// - /// Presence-penalty override. Only honored with V4 versions. - /// - /// - /// Frequency-penalty override. Only honored with V4 versions. - /// - /// - /// Repetition-penalty override. Only honored with V4 versions. - /// - /// - /// Optional override of the LoRA adapter the V4 magic-prompt
- /// wrapper downloads and runs. Pass a `gs://` URI pointing at a
- /// checkpoint directory containing `adapter_config.json`. When
- /// omitted, the wrapper-preloaded production checkpoint is used.
- /// Honored with the wrapper-routed LoRA versions
- /// `V4_QWEN_3_5_27B` and `V4_QWEN_3_5_27B_FULL_FINETUNE_LORA`;
- /// supplying it with `V4_QWEN_3_5_27B_PREFUSED` or
- /// `V4_QWEN_3_5_27B_FULL_FINETUNE` (which serve fixed weights and
- /// cannot swap adapters per request) or any other version returns
- /// 400. - /// - /// - /// Pre-formed chat messages forwarded verbatim to V4. Mutually
- /// exclusive with `prompt`; exactly one must be set. V4 only. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public MagicPromptRequest( - global::Ideogram.MagicPromptVersionEnum magicPromptVersion, - bool classifyPromptCategory, - string? prompt, - global::Ideogram.StyleTypeV3? styleType, - int? seed, - global::System.Collections.Generic.IList? characterReferenceImages, - string? systemPrompt, - global::Ideogram.AspectRatioV3? aspectRatio, - float? temperature, - float? topP, - int? topK, - float? minP, - int? maxTokens, - float? presencePenalty, - float? frequencyPenalty, - float? repetitionPenalty, - string? checkpoint, - global::System.Collections.Generic.IList? messages) - { - this.Prompt = prompt; - this.MagicPromptVersion = magicPromptVersion; - this.ClassifyPromptCategory = classifyPromptCategory; - this.StyleType = styleType; - this.Seed = seed; - this.CharacterReferenceImages = characterReferenceImages; - this.SystemPrompt = systemPrompt; - this.AspectRatio = aspectRatio; - this.Temperature = temperature; - this.TopP = topP; - this.TopK = topK; - this.MinP = minP; - this.MaxTokens = maxTokens; - this.PresencePenalty = presencePenalty; - this.FrequencyPenalty = frequencyPenalty; - this.RepetitionPenalty = repetitionPenalty; - this.Checkpoint = checkpoint; - this.Messages = messages; - } - - /// - /// Initializes a new instance of the class. - /// - public MagicPromptRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.MagicPromptRequestMessagesInner.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.MagicPromptRequestMessagesInner.Json.g.cs deleted file mode 100644 index 6af4f4ca..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.MagicPromptRequestMessagesInner.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class MagicPromptRequestMessagesInner - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.MagicPromptRequestMessagesInner? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.MagicPromptRequestMessagesInner), - jsonSerializerContext) as global::Ideogram.MagicPromptRequestMessagesInner; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.MagicPromptRequestMessagesInner? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.MagicPromptRequestMessagesInner? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.MagicPromptRequestMessagesInner), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.MagicPromptRequestMessagesInner; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.MagicPromptRequestMessagesInner.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.MagicPromptRequestMessagesInner.g.cs deleted file mode 100644 index 4c320569..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.MagicPromptRequestMessagesInner.g.cs +++ /dev/null @@ -1,56 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - public sealed partial class MagicPromptRequestMessagesInner - { - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("role")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.MagicPromptRequestMessagesInnerRoleJsonConverter))] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.MagicPromptRequestMessagesInnerRole Role { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("content")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Content { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public MagicPromptRequestMessagesInner( - global::Ideogram.MagicPromptRequestMessagesInnerRole role, - string content) - { - this.Role = role; - this.Content = content ?? throw new global::System.ArgumentNullException(nameof(content)); - } - - /// - /// Initializes a new instance of the class. - /// - public MagicPromptRequestMessagesInner() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.MagicPromptRequestMessagesInnerRole.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.MagicPromptRequestMessagesInnerRole.g.cs deleted file mode 100644 index c651f8db..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.MagicPromptRequestMessagesInnerRole.g.cs +++ /dev/null @@ -1,57 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - public enum MagicPromptRequestMessagesInnerRole - { - /// - /// - /// - Assistant, - /// - /// - /// - System, - /// - /// - /// - User, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class MagicPromptRequestMessagesInnerRoleExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this MagicPromptRequestMessagesInnerRole value) - { - return value switch - { - MagicPromptRequestMessagesInnerRole.Assistant => "assistant", - MagicPromptRequestMessagesInnerRole.System => "system", - MagicPromptRequestMessagesInnerRole.User => "user", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static MagicPromptRequestMessagesInnerRole? ToEnum(string value) - { - return value switch - { - "assistant" => MagicPromptRequestMessagesInnerRole.Assistant, - "system" => MagicPromptRequestMessagesInnerRole.System, - "user" => MagicPromptRequestMessagesInnerRole.User, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.MagicPromptResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.MagicPromptResponse.Json.g.cs deleted file mode 100644 index 13536a68..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.MagicPromptResponse.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class MagicPromptResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.MagicPromptResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.MagicPromptResponse), - jsonSerializerContext) as global::Ideogram.MagicPromptResponse; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.MagicPromptResponse? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.MagicPromptResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.MagicPromptResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.MagicPromptResponse; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.MagicPromptResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.MagicPromptResponse.g.cs deleted file mode 100644 index d54d1c43..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.MagicPromptResponse.g.cs +++ /dev/null @@ -1,77 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The response containing generated magic prompt
- /// Example: {"magic_prompt":"A photorealistic cat with striking green eyes, sitting gracefully on a vintage wooden chair. The cat\u0027s fur has beautiful orange and white markings, and soft natural lighting illuminates the scene from a nearby window.","magic_prompt_version":"V4_QWEN_3_5_27B_EXPERIMENTAL_SLOT_01","served_model_name":"qwen35-27b-magic-prompt-experimental-2026-06-17"} - ///
- public sealed partial class MagicPromptResponse - { - /// - /// The generated magic prompt - /// - [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string MagicPrompt { get; set; } - - /// - /// The magic prompt version that produced this response. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt_version")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.MagicPromptVersionEnumJsonConverter))] - public global::Ideogram.MagicPromptVersionEnum? MagicPromptVersion { get; set; } - - /// - /// Identifier of the underlying model that produced this prompt. For
- /// experimental versions, whose backing model can change over time,
- /// this reports the model that actually served the request. Null when
- /// not applicable. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("served_model_name")] - public string? ServedModelName { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The generated magic prompt - /// - /// - /// The magic prompt version that produced this response. - /// - /// - /// Identifier of the underlying model that produced this prompt. For
- /// experimental versions, whose backing model can change over time,
- /// this reports the model that actually served the request. Null when
- /// not applicable. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public MagicPromptResponse( - string magicPrompt, - global::Ideogram.MagicPromptVersionEnum? magicPromptVersion, - string? servedModelName) - { - this.MagicPrompt = magicPrompt ?? throw new global::System.ArgumentNullException(nameof(magicPrompt)); - this.MagicPromptVersion = magicPromptVersion; - this.ServedModelName = servedModelName; - } - - /// - /// Initializes a new instance of the class. - /// - public MagicPromptResponse() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.MagicPromptV4Request.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.MagicPromptV4Request.Json.g.cs deleted file mode 100644 index 48010d9f..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.MagicPromptV4Request.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class MagicPromptV4Request - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.MagicPromptV4Request? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.MagicPromptV4Request), - jsonSerializerContext) as global::Ideogram.MagicPromptV4Request; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.MagicPromptV4Request? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.MagicPromptV4Request? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.MagicPromptV4Request), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.MagicPromptV4Request; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.MagicPromptV4Request.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.MagicPromptV4Request.g.cs deleted file mode 100644 index 17c41736..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.MagicPromptV4Request.g.cs +++ /dev/null @@ -1,69 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// A request to generate an Ideogram 4.0 magic prompt.
- /// Example: {"text_prompt":"a cat","aspect_ratio":"AUTO"} - ///
- public sealed partial class MagicPromptV4Request - { - /// - /// The natural-language prompt to enhance into an Ideogram 4.0 magic
- /// prompt. Named `text_prompt` to match the Ideogram 4.0 generate
- /// request surface.
- /// Example: a cat - ///
- /// a cat - [global::System.Text.Json.Serialization.JsonPropertyName("text_prompt")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string TextPrompt { get; set; } - - /// - /// Target aspect ratio. Defaults to `AUTO`, which lets the model
- /// select the most suitable ratio and return it in the response. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.AspectRatioV4JsonConverter))] - public global::Ideogram.AspectRatioV4? AspectRatio { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The natural-language prompt to enhance into an Ideogram 4.0 magic
- /// prompt. Named `text_prompt` to match the Ideogram 4.0 generate
- /// request surface.
- /// Example: a cat - /// - /// - /// Target aspect ratio. Defaults to `AUTO`, which lets the model
- /// select the most suitable ratio and return it in the response. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public MagicPromptV4Request( - string textPrompt, - global::Ideogram.AspectRatioV4? aspectRatio) - { - this.TextPrompt = textPrompt ?? throw new global::System.ArgumentNullException(nameof(textPrompt)); - this.AspectRatio = aspectRatio; - } - - /// - /// Initializes a new instance of the class. - /// - public MagicPromptV4Request() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.MagicPromptV4Response.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.MagicPromptV4Response.Json.g.cs deleted file mode 100644 index 71a0cb66..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.MagicPromptV4Response.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class MagicPromptV4Response - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.MagicPromptV4Response? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.MagicPromptV4Response), - jsonSerializerContext) as global::Ideogram.MagicPromptV4Response; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.MagicPromptV4Response? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.MagicPromptV4Response? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.MagicPromptV4Response), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.MagicPromptV4Response; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.MagicPromptV4Response.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.MagicPromptV4Response.g.cs deleted file mode 100644 index 965cf305..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.MagicPromptV4Response.g.cs +++ /dev/null @@ -1,69 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The response containing the generated Ideogram 4.0 magic prompt.
- /// Example: {"json_prompt":{"high_level_description":"A photorealistic ginger cat perched on a vintage wooden chair by a sunlit window.","style_description":{"aesthetics":"warm, cozy, nostalgic","lighting":"soft natural window light","medium":"photograph"},"compositional_deconstruction":{"background":"A dim room with a bright window casting warm light.","elements":[{"type":"obj","desc":"ginger cat with green eyes sitting upright on a vintage wooden chair"}]}},"aspect_ratio":"1x1"} - ///
- public sealed partial class MagicPromptV4Response - { - /// - /// The enhanced prompt as an Ideogram 4.0 structured JSON prompt. This
- /// conforms to the same contract as `json_prompt` on
- /// `/v1/ideogram-v4/generate`, so it can be passed straight back to
- /// that endpoint. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("json_prompt")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.V4JsonPrompt JsonPrompt { get; set; } - - /// - /// The resolved aspect ratio. When the request used `AUTO`, this is
- /// the ratio the model selected; otherwise it echoes the request. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.AspectRatioV4JsonConverter))] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.AspectRatioV4 AspectRatio { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The enhanced prompt as an Ideogram 4.0 structured JSON prompt. This
- /// conforms to the same contract as `json_prompt` on
- /// `/v1/ideogram-v4/generate`, so it can be passed straight back to
- /// that endpoint. - /// - /// - /// The resolved aspect ratio. When the request used `AUTO`, this is
- /// the ratio the model selected; otherwise it echoes the request. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public MagicPromptV4Response( - global::Ideogram.V4JsonPrompt jsonPrompt, - global::Ideogram.AspectRatioV4 aspectRatio) - { - this.JsonPrompt = jsonPrompt ?? throw new global::System.ArgumentNullException(nameof(jsonPrompt)); - this.AspectRatio = aspectRatio; - } - - /// - /// Initializes a new instance of the class. - /// - public MagicPromptV4Response() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.MagicPromptVersionEnum.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.MagicPromptVersionEnum.g.cs deleted file mode 100644 index e96dac8b..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.MagicPromptVersionEnum.g.cs +++ /dev/null @@ -1,232 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The magic prompt version to use when magic prompt option is set to AUTO or ON.
- /// Example: V_0 - ///
- public enum MagicPromptVersionEnum - { - /// - /// - /// - V4Qwen3527b, - /// - /// - /// - V4Qwen3527bExperimental, - /// - /// - /// - V4Qwen3527bExperimentalAltcapBal10k, - /// - /// - /// - V4Qwen3527bExperimentalAltcapBal9k, - /// - /// - /// - V4Qwen3527bExperimentalNonnas2p5k, - /// - /// - /// - V4Qwen3527bExperimentalNonnas5k, - /// - /// - /// - V4Qwen3527bExperimentalQ362p5k, - /// - /// - /// - V4Qwen3527bExperimentalSlot01, - /// - /// - /// - V4Qwen3527bExperimentalSlot02, - /// - /// - /// - V4Qwen3527bExperimentalSlot03, - /// - /// - /// - V4Qwen3527bExperimentalSlot04, - /// - /// - /// - V4Qwen3527bExperimentalSlot05, - /// - /// - /// - V4Qwen3527bExperimentalSlot06, - /// - /// - /// - V4Qwen3527bExperimentalSlot07, - /// - /// - /// - V4Qwen3527bExperimentalSlot08, - /// - /// - /// - V4Qwen3527bExperimentalSlot09, - /// - /// - /// - V4Qwen3527bExperimentalSlot10, - /// - /// - /// - V4Qwen3527bFullFinetune, - /// - /// - /// - V4Qwen3527bFullFinetuneLora, - /// - /// - /// - V4Qwen3527bPrefused, - /// - /// - /// - V4Qwen3527bPrunaFp8, - /// - /// - /// - V4Qwen3527bSglangExperimentalQ362p5k, - /// - /// - /// - V4Qwen3527bSglangExperimentalQ362p5kTp2, - /// - /// - /// - V0, - /// - /// - /// - V01, - /// - /// - /// - V02, - /// - /// - /// - V03, - /// - /// - /// - V04, - /// - /// - /// - V05, - /// - /// - /// - V06, - /// - /// - /// - V07, - /// - /// - /// - V08, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class MagicPromptVersionEnumExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this MagicPromptVersionEnum value) - { - return value switch - { - MagicPromptVersionEnum.V4Qwen3527b => "V4_QWEN_3_5_27B", - MagicPromptVersionEnum.V4Qwen3527bExperimental => "V4_QWEN_3_5_27B_EXPERIMENTAL", - MagicPromptVersionEnum.V4Qwen3527bExperimentalAltcapBal10k => "V4_QWEN_3_5_27B_EXPERIMENTAL_ALTCAP_BAL_10K", - MagicPromptVersionEnum.V4Qwen3527bExperimentalAltcapBal9k => "V4_QWEN_3_5_27B_EXPERIMENTAL_ALTCAP_BAL_9K", - MagicPromptVersionEnum.V4Qwen3527bExperimentalNonnas2p5k => "V4_QWEN_3_5_27B_EXPERIMENTAL_NONNAS_2P5K", - MagicPromptVersionEnum.V4Qwen3527bExperimentalNonnas5k => "V4_QWEN_3_5_27B_EXPERIMENTAL_NONNAS_5K", - MagicPromptVersionEnum.V4Qwen3527bExperimentalQ362p5k => "V4_QWEN_3_5_27B_EXPERIMENTAL_Q36_2P5K", - MagicPromptVersionEnum.V4Qwen3527bExperimentalSlot01 => "V4_QWEN_3_5_27B_EXPERIMENTAL_SLOT_01", - MagicPromptVersionEnum.V4Qwen3527bExperimentalSlot02 => "V4_QWEN_3_5_27B_EXPERIMENTAL_SLOT_02", - MagicPromptVersionEnum.V4Qwen3527bExperimentalSlot03 => "V4_QWEN_3_5_27B_EXPERIMENTAL_SLOT_03", - MagicPromptVersionEnum.V4Qwen3527bExperimentalSlot04 => "V4_QWEN_3_5_27B_EXPERIMENTAL_SLOT_04", - MagicPromptVersionEnum.V4Qwen3527bExperimentalSlot05 => "V4_QWEN_3_5_27B_EXPERIMENTAL_SLOT_05", - MagicPromptVersionEnum.V4Qwen3527bExperimentalSlot06 => "V4_QWEN_3_5_27B_EXPERIMENTAL_SLOT_06", - MagicPromptVersionEnum.V4Qwen3527bExperimentalSlot07 => "V4_QWEN_3_5_27B_EXPERIMENTAL_SLOT_07", - MagicPromptVersionEnum.V4Qwen3527bExperimentalSlot08 => "V4_QWEN_3_5_27B_EXPERIMENTAL_SLOT_08", - MagicPromptVersionEnum.V4Qwen3527bExperimentalSlot09 => "V4_QWEN_3_5_27B_EXPERIMENTAL_SLOT_09", - MagicPromptVersionEnum.V4Qwen3527bExperimentalSlot10 => "V4_QWEN_3_5_27B_EXPERIMENTAL_SLOT_10", - MagicPromptVersionEnum.V4Qwen3527bFullFinetune => "V4_QWEN_3_5_27B_FULL_FINETUNE", - MagicPromptVersionEnum.V4Qwen3527bFullFinetuneLora => "V4_QWEN_3_5_27B_FULL_FINETUNE_LORA", - MagicPromptVersionEnum.V4Qwen3527bPrefused => "V4_QWEN_3_5_27B_PREFUSED", - MagicPromptVersionEnum.V4Qwen3527bPrunaFp8 => "V4_QWEN_3_5_27B_PRUNA_FP8", - MagicPromptVersionEnum.V4Qwen3527bSglangExperimentalQ362p5k => "V4_QWEN_3_5_27B_SGLANG_EXPERIMENTAL_Q36_2P5K", - MagicPromptVersionEnum.V4Qwen3527bSglangExperimentalQ362p5kTp2 => "V4_QWEN_3_5_27B_SGLANG_EXPERIMENTAL_Q36_2P5K_TP2", - MagicPromptVersionEnum.V0 => "V_0", - MagicPromptVersionEnum.V01 => "V_0_1", - MagicPromptVersionEnum.V02 => "V_0_2", - MagicPromptVersionEnum.V03 => "V_0_3", - MagicPromptVersionEnum.V04 => "V_0_4", - MagicPromptVersionEnum.V05 => "V_0_5", - MagicPromptVersionEnum.V06 => "V_0_6", - MagicPromptVersionEnum.V07 => "V_0_7", - MagicPromptVersionEnum.V08 => "V_0_8", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static MagicPromptVersionEnum? ToEnum(string value) - { - return value switch - { - "V4_QWEN_3_5_27B" => MagicPromptVersionEnum.V4Qwen3527b, - "V4_QWEN_3_5_27B_EXPERIMENTAL" => MagicPromptVersionEnum.V4Qwen3527bExperimental, - "V4_QWEN_3_5_27B_EXPERIMENTAL_ALTCAP_BAL_10K" => MagicPromptVersionEnum.V4Qwen3527bExperimentalAltcapBal10k, - "V4_QWEN_3_5_27B_EXPERIMENTAL_ALTCAP_BAL_9K" => MagicPromptVersionEnum.V4Qwen3527bExperimentalAltcapBal9k, - "V4_QWEN_3_5_27B_EXPERIMENTAL_NONNAS_2P5K" => MagicPromptVersionEnum.V4Qwen3527bExperimentalNonnas2p5k, - "V4_QWEN_3_5_27B_EXPERIMENTAL_NONNAS_5K" => MagicPromptVersionEnum.V4Qwen3527bExperimentalNonnas5k, - "V4_QWEN_3_5_27B_EXPERIMENTAL_Q36_2P5K" => MagicPromptVersionEnum.V4Qwen3527bExperimentalQ362p5k, - "V4_QWEN_3_5_27B_EXPERIMENTAL_SLOT_01" => MagicPromptVersionEnum.V4Qwen3527bExperimentalSlot01, - "V4_QWEN_3_5_27B_EXPERIMENTAL_SLOT_02" => MagicPromptVersionEnum.V4Qwen3527bExperimentalSlot02, - "V4_QWEN_3_5_27B_EXPERIMENTAL_SLOT_03" => MagicPromptVersionEnum.V4Qwen3527bExperimentalSlot03, - "V4_QWEN_3_5_27B_EXPERIMENTAL_SLOT_04" => MagicPromptVersionEnum.V4Qwen3527bExperimentalSlot04, - "V4_QWEN_3_5_27B_EXPERIMENTAL_SLOT_05" => MagicPromptVersionEnum.V4Qwen3527bExperimentalSlot05, - "V4_QWEN_3_5_27B_EXPERIMENTAL_SLOT_06" => MagicPromptVersionEnum.V4Qwen3527bExperimentalSlot06, - "V4_QWEN_3_5_27B_EXPERIMENTAL_SLOT_07" => MagicPromptVersionEnum.V4Qwen3527bExperimentalSlot07, - "V4_QWEN_3_5_27B_EXPERIMENTAL_SLOT_08" => MagicPromptVersionEnum.V4Qwen3527bExperimentalSlot08, - "V4_QWEN_3_5_27B_EXPERIMENTAL_SLOT_09" => MagicPromptVersionEnum.V4Qwen3527bExperimentalSlot09, - "V4_QWEN_3_5_27B_EXPERIMENTAL_SLOT_10" => MagicPromptVersionEnum.V4Qwen3527bExperimentalSlot10, - "V4_QWEN_3_5_27B_FULL_FINETUNE" => MagicPromptVersionEnum.V4Qwen3527bFullFinetune, - "V4_QWEN_3_5_27B_FULL_FINETUNE_LORA" => MagicPromptVersionEnum.V4Qwen3527bFullFinetuneLora, - "V4_QWEN_3_5_27B_PREFUSED" => MagicPromptVersionEnum.V4Qwen3527bPrefused, - "V4_QWEN_3_5_27B_PRUNA_FP8" => MagicPromptVersionEnum.V4Qwen3527bPrunaFp8, - "V4_QWEN_3_5_27B_SGLANG_EXPERIMENTAL_Q36_2P5K" => MagicPromptVersionEnum.V4Qwen3527bSglangExperimentalQ362p5k, - "V4_QWEN_3_5_27B_SGLANG_EXPERIMENTAL_Q36_2P5K_TP2" => MagicPromptVersionEnum.V4Qwen3527bSglangExperimentalQ362p5kTp2, - "V_0" => MagicPromptVersionEnum.V0, - "V_0_1" => MagicPromptVersionEnum.V01, - "V_0_2" => MagicPromptVersionEnum.V02, - "V_0_3" => MagicPromptVersionEnum.V03, - "V_0_4" => MagicPromptVersionEnum.V04, - "V_0_5" => MagicPromptVersionEnum.V05, - "V_0_6" => MagicPromptVersionEnum.V06, - "V_0_7" => MagicPromptVersionEnum.V07, - "V_0_8" => MagicPromptVersionEnum.V08, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ManageApiCreditSummaryResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ManageApiCreditSummaryResponse.Json.g.cs deleted file mode 100644 index 93ea253c..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ManageApiCreditSummaryResponse.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class ManageApiCreditSummaryResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.ManageApiCreditSummaryResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.ManageApiCreditSummaryResponse), - jsonSerializerContext) as global::Ideogram.ManageApiCreditSummaryResponse; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.ManageApiCreditSummaryResponse? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.ManageApiCreditSummaryResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.ManageApiCreditSummaryResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ManageApiCreditSummaryResponse; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ManageApiCreditSummaryResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ManageApiCreditSummaryResponse.g.cs deleted file mode 100644 index 9a4013ee..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ManageApiCreditSummaryResponse.g.cs +++ /dev/null @@ -1,92 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"total_issued":{"amount":1050,"currency_code":"USD"},"total_expired":{"amount":1050,"currency_code":"USD"},"total_consumed":{"amount":1050,"currency_code":"USD"},"credit_grants":[{"effective_at":"effective_at","amount_consumed":{"amount":1050,"currency_code":"USD"},"expires_at":"expires_at","amount_available":{"amount":1050,"currency_code":"USD"},"grant_id":"grant_id","name":"name","amount_issued":{"amount":1050,"currency_code":"USD"}},{"effective_at":"effective_at","amount_consumed":{"amount":1050,"currency_code":"USD"},"expires_at":"expires_at","amount_available":{"amount":1050,"currency_code":"USD"},"grant_id":"grant_id","name":"name","amount_issued":{"amount":1050,"currency_code":"USD"}}]} - /// - public sealed partial class ManageApiCreditSummaryResponse - { - /// - /// Represents a price.
- /// Example: {"amount":1050,"currency_code":"USD"} - ///
- /// {"amount":1050,"currency_code":"USD"} - [global::System.Text.Json.Serialization.JsonPropertyName("total_consumed")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.Price TotalConsumed { get; set; } - - /// - /// Represents a price.
- /// Example: {"amount":1050,"currency_code":"USD"} - ///
- /// {"amount":1050,"currency_code":"USD"} - [global::System.Text.Json.Serialization.JsonPropertyName("total_expired")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.Price TotalExpired { get; set; } - - /// - /// Represents a price.
- /// Example: {"amount":1050,"currency_code":"USD"} - ///
- /// {"amount":1050,"currency_code":"USD"} - [global::System.Text.Json.Serialization.JsonPropertyName("total_issued")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.Price TotalIssued { get; set; } - - /// - /// Per-grant breakdown of the user's credit grants. Empty if Metronome is unavailable. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("credit_grants")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList CreditGrants { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Represents a price.
- /// Example: {"amount":1050,"currency_code":"USD"} - /// - /// - /// Represents a price.
- /// Example: {"amount":1050,"currency_code":"USD"} - /// - /// - /// Represents a price.
- /// Example: {"amount":1050,"currency_code":"USD"} - /// - /// - /// Per-grant breakdown of the user's credit grants. Empty if Metronome is unavailable. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ManageApiCreditSummaryResponse( - global::Ideogram.Price totalConsumed, - global::Ideogram.Price totalExpired, - global::Ideogram.Price totalIssued, - global::System.Collections.Generic.IList creditGrants) - { - this.TotalConsumed = totalConsumed ?? throw new global::System.ArgumentNullException(nameof(totalConsumed)); - this.TotalExpired = totalExpired ?? throw new global::System.ArgumentNullException(nameof(totalExpired)); - this.TotalIssued = totalIssued ?? throw new global::System.ArgumentNullException(nameof(totalIssued)); - this.CreditGrants = creditGrants ?? throw new global::System.ArgumentNullException(nameof(creditGrants)); - } - - /// - /// Initializes a new instance of the class. - /// - public ManageApiCreditSummaryResponse() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ManageApiPaymentResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ManageApiPaymentResponse.Json.g.cs deleted file mode 100644 index eca4de5e..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ManageApiPaymentResponse.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class ManageApiPaymentResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.ManageApiPaymentResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.ManageApiPaymentResponse), - jsonSerializerContext) as global::Ideogram.ManageApiPaymentResponse; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.ManageApiPaymentResponse? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.ManageApiPaymentResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.ManageApiPaymentResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ManageApiPaymentResponse; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ManageApiPaymentResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ManageApiPaymentResponse.g.cs deleted file mode 100644 index 8ed7328a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ManageApiPaymentResponse.g.cs +++ /dev/null @@ -1,47 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"client_secret":"client_secret"} - /// - public sealed partial class ManageApiPaymentResponse - { - /// - /// client_secret to be passed to the inline payment Elements on the client. Soft-deprecated — new clients use stripe_payment_setup_url on ManageApiStripeSubscriptionResponse for the hosted Checkout flow. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("client_secret")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string ClientSecret { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// client_secret to be passed to the inline payment Elements on the client. Soft-deprecated — new clients use stripe_payment_setup_url on ManageApiStripeSubscriptionResponse for the hosted Checkout flow. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ManageApiPaymentResponse( - string clientSecret) - { - this.ClientSecret = clientSecret ?? throw new global::System.ArgumentNullException(nameof(clientSecret)); - } - - /// - /// Initializes a new instance of the class. - /// - public ManageApiPaymentResponse() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ManageApiStripeSubscriptionResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ManageApiStripeSubscriptionResponse.Json.g.cs deleted file mode 100644 index e74dd5da..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ManageApiStripeSubscriptionResponse.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class ManageApiStripeSubscriptionResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.ManageApiStripeSubscriptionResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.ManageApiStripeSubscriptionResponse), - jsonSerializerContext) as global::Ideogram.ManageApiStripeSubscriptionResponse; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.ManageApiStripeSubscriptionResponse? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.ManageApiStripeSubscriptionResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.ManageApiStripeSubscriptionResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ManageApiStripeSubscriptionResponse; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ManageApiStripeSubscriptionResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ManageApiStripeSubscriptionResponse.g.cs deleted file mode 100644 index e87c47b3..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ManageApiStripeSubscriptionResponse.g.cs +++ /dev/null @@ -1,66 +0,0 @@ - -#pragma warning disable CS0618 // Type or member is obsolete - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"stripe_subscription_url":"stripe_subscription_url","stripe_billing_url":"stripe_billing_url","stripe_payment_setup_url":"stripe_payment_setup_url"} - /// - public sealed partial class ManageApiStripeSubscriptionResponse - { - /// - /// The URL for the user to checkout the Stripe subscription plan. Soft-deprecated — this is the legacy $0-subscription flow; new clients use stripe_payment_setup_url instead. Removed once no callers reference it. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("stripe_subscription_url")] - public string? StripeSubscriptionUrl { get; set; } - - /// - /// The URL for the user to capture a payment method via hosted Stripe Checkout (mode='setup'). No charge happens during this flow; the captured payment method is attached to the org's Stripe Customer via the checkout.session.completed webhook. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("stripe_payment_setup_url")] - public string? StripePaymentSetupUrl { get; set; } - - /// - /// DEPRECATED. The URL for the user to manage the existing Stripe subscription plan. Get this from ManageApiSubscriptionResponse instead. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("stripe_billing_url")] - [global::System.Obsolete("This property marked as deprecated.")] - public string? StripeBillingUrl { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The URL for the user to checkout the Stripe subscription plan. Soft-deprecated — this is the legacy $0-subscription flow; new clients use stripe_payment_setup_url instead. Removed once no callers reference it. - /// - /// - /// The URL for the user to capture a payment method via hosted Stripe Checkout (mode='setup'). No charge happens during this flow; the captured payment method is attached to the org's Stripe Customer via the checkout.session.completed webhook. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ManageApiStripeSubscriptionResponse( - string? stripeSubscriptionUrl, - string? stripePaymentSetupUrl) - { - this.StripeSubscriptionUrl = stripeSubscriptionUrl; - this.StripePaymentSetupUrl = stripePaymentSetupUrl; - } - - /// - /// Initializes a new instance of the class. - /// - public ManageApiStripeSubscriptionResponse() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ManageApiSubscriptionResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ManageApiSubscriptionResponse.Json.g.cs deleted file mode 100644 index 405aea1c..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ManageApiSubscriptionResponse.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class ManageApiSubscriptionResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.ManageApiSubscriptionResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.ManageApiSubscriptionResponse), - jsonSerializerContext) as global::Ideogram.ManageApiSubscriptionResponse; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.ManageApiSubscriptionResponse? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.ManageApiSubscriptionResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.ManageApiSubscriptionResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ManageApiSubscriptionResponse; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ManageApiSubscriptionResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ManageApiSubscriptionResponse.g.cs deleted file mode 100644 index e5e1dc4f..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ManageApiSubscriptionResponse.g.cs +++ /dev/null @@ -1,125 +0,0 @@ - -#pragma warning disable CS0618 // Type or member is obsolete - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"recharge_settings":{"is_active":true},"has_stripe_setup":true,"metronome_dashboard_dark_mode_url":"metronome_dashboard_dark_mode_url","stripe_billing_url":"stripe_billing_url","current_balance":{"amount":1050,"currency_code":"USD"},"has_accepted_terms":true,"metronome_dashboard_url":"metronome_dashboard_url","metronome_links":{"usage_iframe_url":"usage_iframe_url","usage_iframe_dark_mode_url":"usage_iframe_dark_mode_url","credits_iframe_dark_mode_url":"credits_iframe_dark_mode_url","invoices_iframe_dark_mode_url":"invoices_iframe_dark_mode_url","invoices_iframe_url":"invoices_iframe_url","credits_iframe_url":"credits_iframe_url"}} - /// - public sealed partial class ManageApiSubscriptionResponse - { - /// - /// Whether or not the latest required terms have been accepted. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("has_accepted_terms")] - [global::System.Text.Json.Serialization.JsonRequired] - public required bool HasAcceptedTerms { get; set; } - - /// - /// Whether or not Stripe is setup for API usage. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("has_stripe_setup")] - [global::System.Text.Json.Serialization.JsonRequired] - public required bool HasStripeSetup { get; set; } - - /// - /// The URL to display the customer usage dashboard. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("metronome_dashboard_url")] - [global::System.Obsolete("This property marked as deprecated.")] - public string? MetronomeDashboardUrl { get; set; } - - /// - /// The URL to display the customer usage dashboard, in dark mode. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("metronome_dashboard_dark_mode_url")] - [global::System.Obsolete("This property marked as deprecated.")] - public string? MetronomeDashboardDarkModeUrl { get; set; } - - /// - /// Example: {"usage_iframe_url":"usage_iframe_url","usage_iframe_dark_mode_url":"usage_iframe_dark_mode_url","credits_iframe_dark_mode_url":"credits_iframe_dark_mode_url","invoices_iframe_dark_mode_url":"invoices_iframe_dark_mode_url","invoices_iframe_url":"invoices_iframe_url","credits_iframe_url":"credits_iframe_url"} - /// - /// {"usage_iframe_url":"usage_iframe_url","usage_iframe_dark_mode_url":"usage_iframe_dark_mode_url","credits_iframe_dark_mode_url":"credits_iframe_dark_mode_url","invoices_iframe_dark_mode_url":"invoices_iframe_dark_mode_url","invoices_iframe_url":"invoices_iframe_url","credits_iframe_url":"credits_iframe_url"} - [global::System.Text.Json.Serialization.JsonPropertyName("metronome_links")] - public global::Ideogram.MetronomeLinks? MetronomeLinks { get; set; } - - /// - /// Example: {"is_active":true} - /// - /// {"is_active":true} - [global::System.Text.Json.Serialization.JsonPropertyName("recharge_settings")] - public global::Ideogram.RechargeSettingsResponse? RechargeSettings { get; set; } - - /// - /// The URL for the user to manage the existing Stripe subscription plan. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("stripe_billing_url")] - public string? StripeBillingUrl { get; set; } - - /// - /// Represents a price.
- /// Example: {"amount":1050,"currency_code":"USD"} - ///
- /// {"amount":1050,"currency_code":"USD"} - [global::System.Text.Json.Serialization.JsonPropertyName("current_balance")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.Price CurrentBalance { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Whether or not the latest required terms have been accepted. - /// - /// - /// Whether or not Stripe is setup for API usage. - /// - /// - /// Represents a price.
- /// Example: {"amount":1050,"currency_code":"USD"} - /// - /// - /// Example: {"usage_iframe_url":"usage_iframe_url","usage_iframe_dark_mode_url":"usage_iframe_dark_mode_url","credits_iframe_dark_mode_url":"credits_iframe_dark_mode_url","invoices_iframe_dark_mode_url":"invoices_iframe_dark_mode_url","invoices_iframe_url":"invoices_iframe_url","credits_iframe_url":"credits_iframe_url"} - /// - /// - /// Example: {"is_active":true} - /// - /// - /// The URL for the user to manage the existing Stripe subscription plan. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ManageApiSubscriptionResponse( - bool hasAcceptedTerms, - bool hasStripeSetup, - global::Ideogram.Price currentBalance, - global::Ideogram.MetronomeLinks? metronomeLinks, - global::Ideogram.RechargeSettingsResponse? rechargeSettings, - string? stripeBillingUrl) - { - this.HasAcceptedTerms = hasAcceptedTerms; - this.HasStripeSetup = hasStripeSetup; - this.MetronomeLinks = metronomeLinks; - this.RechargeSettings = rechargeSettings; - this.StripeBillingUrl = stripeBillingUrl; - this.CurrentBalance = currentBalance ?? throw new global::System.ArgumentNullException(nameof(currentBalance)); - } - - /// - /// Initializes a new instance of the class. - /// - public ManageApiSubscriptionResponse() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.MaterialSwapRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.MaterialSwapRequest.Json.g.cs deleted file mode 100644 index f100174b..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.MaterialSwapRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class MaterialSwapRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.MaterialSwapRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.MaterialSwapRequest), - jsonSerializerContext) as global::Ideogram.MaterialSwapRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.MaterialSwapRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.MaterialSwapRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.MaterialSwapRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.MaterialSwapRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.MaterialSwapRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.MaterialSwapRequest.g.cs deleted file mode 100644 index 3a827a66..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.MaterialSwapRequest.g.cs +++ /dev/null @@ -1,241 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Upload the product photo as `image`, up to 4 `masks`, and either one
- /// entry in `materials` for all masks or one per mask, paired by
- /// position. For a single region, send one mask and one material. - ///
- public sealed partial class MaterialSwapRequest - { - /// - /// The product photo to edit, by reference. Everything outside the
- /// masked region is preserved. Provide exactly one of
- /// `image_asset_identifier` or `image`. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("image_asset_identifier")] - public global::Ideogram.AssetIdentifier? ImageAssetIdentifier { get; set; } - - /// - /// The product photo to edit (max size 25MB). JPEG, PNG, and WEBP
- /// formats are supported. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("image")] - public byte[]? Image { get; set; } - - /// - /// The product photo to edit (max size 25MB). JPEG, PNG, and WEBP
- /// formats are supported. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] - public string? Imagename { get; set; } - - /// - /// The masks marking the regions of the product photo to change, by
- /// reference (max 4). Every mask must have the same pixel dimensions
- /// as the product photo. White pixels mark the region to change; black
- /// pixels are preserved. Alpha-only masks are also supported: opaque
- /// pixels mark the region to change and transparent pixels are
- /// preserved. Provide exactly one of `mask_asset_identifiers` or
- /// `masks`. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("mask_asset_identifiers")] - public global::System.Collections.Generic.IList? MaskAssetIdentifiers { get; set; } - - /// - /// Masks marking the regions to change (max 4, max size 25MB each).
- /// JPEG, PNG, and WEBP formats are supported. Every mask must have the
- /// same pixel dimensions as the product photo. White pixels mark the
- /// region to change and black pixels are preserved; alpha-only masks
- /// also work (opaque = change, transparent = preserve). - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("masks")] - public global::System.Collections.Generic.IList? Masks { get; set; } - - /// - /// The material reference images, by reference. Only their material —
- /// color, texture, pattern scale, and orientation — is applied to the
- /// masked regions. Send one material, which every mask takes, or
- /// exactly one per mask paired by position. Provide exactly one of
- /// `material_asset_identifiers` or `materials`. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("material_asset_identifiers")] - public global::System.Collections.Generic.IList? MaterialAssetIdentifiers { get; set; } - - /// - /// Material reference images (max size 25MB each). JPEG, PNG, and WEBP
- /// formats are supported. Only their material (color, texture, pattern
- /// scale, and orientation) is applied to the masked regions. Send one
- /// material for every mask, or exactly one per mask, paired by
- /// position. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("materials")] - public global::System.Collections.Generic.IList? Materials { get; set; } - - /// - /// Output aspect ratio. Defaults to the product photo's aspect ratio,
- /// which keeps the original framing. A different ratio extends the
- /// scene to fill the new shape rather than cropping, so part of the
- /// frame is newly generated. Supported values are `1:1`, `3:4`,
- /// `4:3`, `16:9`, and `9:16`. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] - public string? AspectRatio { get; set; } - - /// - /// The quality tier for the edit. Higher tiers may improve detail and
- /// take longer to complete. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("quality")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.MaterialSwapQualityJsonConverter))] - public global::Ideogram.MaterialSwapQuality? Quality { get; set; } - - /// - /// A collection you can write to, by its URL-safe base64 collection id. Completed outputs are added to it automatically. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("target_collection_id")] - public string? TargetCollectionId { get; set; } - - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - ///
- /// https://api.example.com/webhooks/ideogram - [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] - public string? WebhookUrl { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The product photo to edit, by reference. Everything outside the
- /// masked region is preserved. Provide exactly one of
- /// `image_asset_identifier` or `image`. - /// - /// - /// The product photo to edit (max size 25MB). JPEG, PNG, and WEBP
- /// formats are supported. - /// - /// - /// The product photo to edit (max size 25MB). JPEG, PNG, and WEBP
- /// formats are supported. - /// - /// - /// The masks marking the regions of the product photo to change, by
- /// reference (max 4). Every mask must have the same pixel dimensions
- /// as the product photo. White pixels mark the region to change; black
- /// pixels are preserved. Alpha-only masks are also supported: opaque
- /// pixels mark the region to change and transparent pixels are
- /// preserved. Provide exactly one of `mask_asset_identifiers` or
- /// `masks`. - /// - /// - /// Masks marking the regions to change (max 4, max size 25MB each).
- /// JPEG, PNG, and WEBP formats are supported. Every mask must have the
- /// same pixel dimensions as the product photo. White pixels mark the
- /// region to change and black pixels are preserved; alpha-only masks
- /// also work (opaque = change, transparent = preserve). - /// - /// - /// The material reference images, by reference. Only their material —
- /// color, texture, pattern scale, and orientation — is applied to the
- /// masked regions. Send one material, which every mask takes, or
- /// exactly one per mask paired by position. Provide exactly one of
- /// `material_asset_identifiers` or `materials`. - /// - /// - /// Material reference images (max size 25MB each). JPEG, PNG, and WEBP
- /// formats are supported. Only their material (color, texture, pattern
- /// scale, and orientation) is applied to the masked regions. Send one
- /// material for every mask, or exactly one per mask, paired by
- /// position. - /// - /// - /// Output aspect ratio. Defaults to the product photo's aspect ratio,
- /// which keeps the original framing. A different ratio extends the
- /// scene to fill the new shape rather than cropping, so part of the
- /// frame is newly generated. Supported values are `1:1`, `3:4`,
- /// `4:3`, `16:9`, and `9:16`. - /// - /// - /// The quality tier for the edit. Higher tiers may improve detail and
- /// take longer to complete. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. Completed outputs are added to it automatically. - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public MaterialSwapRequest( - global::Ideogram.AssetIdentifier? imageAssetIdentifier, - byte[]? image, - string? imagename, - global::System.Collections.Generic.IList? maskAssetIdentifiers, - global::System.Collections.Generic.IList? masks, - global::System.Collections.Generic.IList? materialAssetIdentifiers, - global::System.Collections.Generic.IList? materials, - string? aspectRatio, - global::Ideogram.MaterialSwapQuality? quality, - string? targetCollectionId, - bool? @private, - string? webhookUrl) - { - this.ImageAssetIdentifier = imageAssetIdentifier; - this.Image = image; - this.Imagename = imagename; - this.MaskAssetIdentifiers = maskAssetIdentifiers; - this.Masks = masks; - this.MaterialAssetIdentifiers = materialAssetIdentifiers; - this.Materials = materials; - this.AspectRatio = aspectRatio; - this.Quality = quality; - this.TargetCollectionId = targetCollectionId; - this.Private = @private; - this.WebhookUrl = webhookUrl; - } - - /// - /// Initializes a new instance of the class. - /// - public MaterialSwapRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.MaterialSwapResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.MaterialSwapResponse.g.cs index abd19937..b9447365 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.MaterialSwapResponse.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.MaterialSwapResponse.g.cs @@ -5,8 +5,7 @@ namespace Ideogram { /// /// Acknowledgement that the material swap was accepted. Poll
- /// `GET /v2/generations/{generation_id}` for status and results.
- /// Example: {"generation_id":"generation_id"} + /// `GET /v2/generations/{generation_id}` for status and results. ///
public sealed partial class MaterialSwapResponse { diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.MetronomeLinks.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.MetronomeLinks.Json.g.cs deleted file mode 100644 index d3ca1928..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.MetronomeLinks.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class MetronomeLinks - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.MetronomeLinks? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.MetronomeLinks), - jsonSerializerContext) as global::Ideogram.MetronomeLinks; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.MetronomeLinks? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.MetronomeLinks? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.MetronomeLinks), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.MetronomeLinks; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.MetronomeLinks.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.MetronomeLinks.g.cs deleted file mode 100644 index db944242..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.MetronomeLinks.g.cs +++ /dev/null @@ -1,101 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"usage_iframe_url":"usage_iframe_url","usage_iframe_dark_mode_url":"usage_iframe_dark_mode_url","credits_iframe_dark_mode_url":"credits_iframe_dark_mode_url","invoices_iframe_dark_mode_url":"invoices_iframe_dark_mode_url","invoices_iframe_url":"invoices_iframe_url","credits_iframe_url":"credits_iframe_url"} - /// - public sealed partial class MetronomeLinks - { - /// - /// The URL to display the customer invoice and API usage. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("invoices_iframe_url")] - public string? InvoicesIframeUrl { get; set; } - - /// - /// The URL to display the customer invoice and API usage. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("invoices_iframe_dark_mode_url")] - public string? InvoicesIframeDarkModeUrl { get; set; } - - /// - /// The URL to display the customer invoice and API usage. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("credits_iframe_url")] - public string? CreditsIframeUrl { get; set; } - - /// - /// The URL to display the customer invoice and API usage. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("credits_iframe_dark_mode_url")] - public string? CreditsIframeDarkModeUrl { get; set; } - - /// - /// The URL to display the customer usage dashboard. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("usage_iframe_url")] - public string? UsageIframeUrl { get; set; } - - /// - /// The URL to display the customer usage dashboard, in dark mode. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("usage_iframe_dark_mode_url")] - public string? UsageIframeDarkModeUrl { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The URL to display the customer invoice and API usage. - /// - /// - /// The URL to display the customer invoice and API usage. - /// - /// - /// The URL to display the customer invoice and API usage. - /// - /// - /// The URL to display the customer invoice and API usage. - /// - /// - /// The URL to display the customer usage dashboard. - /// - /// - /// The URL to display the customer usage dashboard, in dark mode. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public MetronomeLinks( - string? invoicesIframeUrl, - string? invoicesIframeDarkModeUrl, - string? creditsIframeUrl, - string? creditsIframeDarkModeUrl, - string? usageIframeUrl, - string? usageIframeDarkModeUrl) - { - this.InvoicesIframeUrl = invoicesIframeUrl; - this.InvoicesIframeDarkModeUrl = invoicesIframeDarkModeUrl; - this.CreditsIframeUrl = creditsIframeUrl; - this.CreditsIframeDarkModeUrl = creditsIframeDarkModeUrl; - this.UsageIframeUrl = usageIframeUrl; - this.UsageIframeDarkModeUrl = usageIframeDarkModeUrl; - } - - /// - /// Initializes a new instance of the class. - /// - public MetronomeLinks() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.MiniAppArtwork.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.MiniAppArtwork.Json.g.cs deleted file mode 100644 index 49bd05e3..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.MiniAppArtwork.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class MiniAppArtwork - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.MiniAppArtwork? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.MiniAppArtwork), - jsonSerializerContext) as global::Ideogram.MiniAppArtwork; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.MiniAppArtwork? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.MiniAppArtwork? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.MiniAppArtwork), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.MiniAppArtwork; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.MiniAppArtwork.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.MiniAppArtwork.g.cs deleted file mode 100644 index 0f8f7414..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.MiniAppArtwork.g.cs +++ /dev/null @@ -1,68 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Artwork URLs used to present a mini-app in the app catalog. - /// - public sealed partial class MiniAppArtwork - { - /// - /// Square mini-app icon URL. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("icon")] - public string? Icon { get; set; } - - /// - /// Cover image or video URL used when no card artwork is available. Video URL paths must end in .mp4 or .webm. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("cover")] - public string? Cover { get; set; } - - /// - /// Preferred app catalog image or video thumbnail URL. Video URL paths must end in .mp4 or .webm. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("card")] - public string? Card { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Square mini-app icon URL. - /// - /// - /// Cover image or video URL used when no card artwork is available. Video URL paths must end in .mp4 or .webm. - /// - /// - /// Preferred app catalog image or video thumbnail URL. Video URL paths must end in .mp4 or .webm. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public MiniAppArtwork( - string? icon, - string? cover, - string? card) - { - this.Icon = icon; - this.Cover = cover; - this.Card = card; - } - - /// - /// Initializes a new instance of the class. - /// - public MiniAppArtwork() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.MiniAppMarketingProjectionEntry.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.MiniAppMarketingProjectionEntry.Json.g.cs deleted file mode 100644 index 2f835053..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.MiniAppMarketingProjectionEntry.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class MiniAppMarketingProjectionEntry - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.MiniAppMarketingProjectionEntry? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.MiniAppMarketingProjectionEntry), - jsonSerializerContext) as global::Ideogram.MiniAppMarketingProjectionEntry; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.MiniAppMarketingProjectionEntry? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.MiniAppMarketingProjectionEntry? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.MiniAppMarketingProjectionEntry), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.MiniAppMarketingProjectionEntry; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.MiniAppMarketingProjectionEntry.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.MiniAppMarketingProjectionEntry.g.cs deleted file mode 100644 index cda696ef..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.MiniAppMarketingProjectionEntry.g.cs +++ /dev/null @@ -1,185 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Public-safe metadata for a mini-app marketing page.
- /// Example: {"is_marketing":true,"website":{"key":""},"deployment_time":"2000-01-23T04:56:07\u002B00:00","archived_at":"2000-01-23T04:56:07\u002B00:00","deployment_url":"https://openapi-generator.tech","deployment_commit":"deployment_commit","icon":"icon","description":"description","label":"label","cover":"cover","embed":"iframe","slug":"slug","card":"card"} - ///
- public sealed partial class MiniAppMarketingProjectionEntry - { - /// - /// Unique, stable, URL-safe mini-app identifier. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("slug")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Slug { get; set; } - - /// - /// Human-readable mini-app name. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("label")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Label { get; set; } - - /// - /// Short description of what the mini-app does. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("description")] - public string? Description { get; set; } - - /// - /// How the mini-app runs. Iframe apps use hosted deployments; native apps are bundled into the Ideogram frontend. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("embed")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.MiniAppMarketingProjectionEntryEmbedJsonConverter))] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.MiniAppMarketingProjectionEntryEmbed Embed { get; set; } - - /// - /// Public URL for the mini-app icon. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("icon")] - public string? Icon { get; set; } - - /// - /// Public URL for the mini-app cover image. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("cover")] - public string? Cover { get; set; } - - /// - /// Public URL for the mini-app card image. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("card")] - public string? Card { get; set; } - - /// - /// Structured metadata used to build the mini-app marketing page. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("website")] - [global::System.Text.Json.Serialization.JsonRequired] - public required object Website { get; set; } - - /// - /// Archive timestamp; active projection entries omit this field. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("archived_at")] - public global::System.DateTime? ArchivedAt { get; set; } - - /// - /// Whether the entry is selected for public marketing pages. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("is_marketing")] - [global::System.Text.Json.Serialization.JsonRequired] - public required bool IsMarketing { get; set; } - - /// - /// Public URL where a hosted mini-app is served. Native apps omit this field. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("deployment_url")] - public string? DeploymentUrl { get; set; } - - /// - /// Source commit hash of the deployed build. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("deployment_commit")] - public string? DeploymentCommit { get; set; } - - /// - /// When the deployment that produced this build completed. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("deployment_time")] - public global::System.DateTime? DeploymentTime { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Unique, stable, URL-safe mini-app identifier. - /// - /// - /// Human-readable mini-app name. - /// - /// - /// How the mini-app runs. Iframe apps use hosted deployments; native apps are bundled into the Ideogram frontend. - /// - /// - /// Structured metadata used to build the mini-app marketing page. - /// - /// - /// Whether the entry is selected for public marketing pages. - /// - /// - /// Short description of what the mini-app does. - /// - /// - /// Public URL for the mini-app icon. - /// - /// - /// Public URL for the mini-app cover image. - /// - /// - /// Public URL for the mini-app card image. - /// - /// - /// Archive timestamp; active projection entries omit this field. - /// - /// - /// Public URL where a hosted mini-app is served. Native apps omit this field. - /// - /// - /// Source commit hash of the deployed build. - /// - /// - /// When the deployment that produced this build completed. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public MiniAppMarketingProjectionEntry( - string slug, - string label, - global::Ideogram.MiniAppMarketingProjectionEntryEmbed embed, - object website, - bool isMarketing, - string? description, - string? icon, - string? cover, - string? card, - global::System.DateTime? archivedAt, - string? deploymentUrl, - string? deploymentCommit, - global::System.DateTime? deploymentTime) - { - this.Slug = slug ?? throw new global::System.ArgumentNullException(nameof(slug)); - this.Label = label ?? throw new global::System.ArgumentNullException(nameof(label)); - this.Description = description; - this.Embed = embed; - this.Icon = icon; - this.Cover = cover; - this.Card = card; - this.Website = website ?? throw new global::System.ArgumentNullException(nameof(website)); - this.ArchivedAt = archivedAt; - this.IsMarketing = isMarketing; - this.DeploymentUrl = deploymentUrl; - this.DeploymentCommit = deploymentCommit; - this.DeploymentTime = deploymentTime; - } - - /// - /// Initializes a new instance of the class. - /// - public MiniAppMarketingProjectionEntry() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.MiniAppMarketingProjectionEntryEmbed.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.MiniAppMarketingProjectionEntryEmbed.g.cs deleted file mode 100644 index 873d5b9e..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.MiniAppMarketingProjectionEntryEmbed.g.cs +++ /dev/null @@ -1,51 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// How the mini-app runs. Iframe apps use hosted deployments; native apps are bundled into the Ideogram frontend. - /// - public enum MiniAppMarketingProjectionEntryEmbed - { - /// - /// - /// - Iframe, - /// - /// - /// - Native, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class MiniAppMarketingProjectionEntryEmbedExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this MiniAppMarketingProjectionEntryEmbed value) - { - return value switch - { - MiniAppMarketingProjectionEntryEmbed.Iframe => "iframe", - MiniAppMarketingProjectionEntryEmbed.Native => "native", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static MiniAppMarketingProjectionEntryEmbed? ToEnum(string value) - { - return value switch - { - "iframe" => MiniAppMarketingProjectionEntryEmbed.Iframe, - "native" => MiniAppMarketingProjectionEntryEmbed.Native, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.MiniAppMarketingProjectionEntryWebsite.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.MiniAppMarketingProjectionEntryWebsite.Json.g.cs deleted file mode 100644 index c9b48275..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.MiniAppMarketingProjectionEntryWebsite.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class MiniAppMarketingProjectionEntryWebsite - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.MiniAppMarketingProjectionEntryWebsite? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.MiniAppMarketingProjectionEntryWebsite), - jsonSerializerContext) as global::Ideogram.MiniAppMarketingProjectionEntryWebsite; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.MiniAppMarketingProjectionEntryWebsite? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.MiniAppMarketingProjectionEntryWebsite? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.MiniAppMarketingProjectionEntryWebsite), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.MiniAppMarketingProjectionEntryWebsite; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.MiniAppMarketingProjectionEntryWebsite.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.MiniAppMarketingProjectionEntryWebsite.g.cs deleted file mode 100644 index dd282351..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.MiniAppMarketingProjectionEntryWebsite.g.cs +++ /dev/null @@ -1,19 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Structured metadata used to build the mini-app marketing page. - /// - public sealed partial class MiniAppMarketingProjectionEntryWebsite - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ModelEnum.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ModelEnum.g.cs deleted file mode 100644 index f1dc77b8..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ModelEnum.g.cs +++ /dev/null @@ -1,89 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The model used to generate an image or edit one. /generate and /remix supports all model types, however, /edit is only supported for V_2 and V_2_TURBO.
- /// Default Value: V_2
- /// Example: V_2_TURBO - ///
- public enum ModelEnum - { - /// - /// - /// - Auto, - /// - /// - /// - V1, - /// - /// - /// - V1Turbo, - /// - /// - /// - V2, - /// - /// - /// - V2a, - /// - /// - /// - V2aTurbo, - /// - /// - /// - V2Turbo, - /// - /// - /// - V3, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class ModelEnumExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this ModelEnum value) - { - return value switch - { - ModelEnum.Auto => "AUTO", - ModelEnum.V1 => "V_1", - ModelEnum.V1Turbo => "V_1_TURBO", - ModelEnum.V2 => "V_2", - ModelEnum.V2a => "V_2A", - ModelEnum.V2aTurbo => "V_2A_TURBO", - ModelEnum.V2Turbo => "V_2_TURBO", - ModelEnum.V3 => "V_3", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static ModelEnum? ToEnum(string value) - { - return value switch - { - "AUTO" => ModelEnum.Auto, - "V_1" => ModelEnum.V1, - "V_1_TURBO" => ModelEnum.V1Turbo, - "V_2" => ModelEnum.V2, - "V_2A" => ModelEnum.V2a, - "V_2A_TURBO" => ModelEnum.V2aTurbo, - "V_2_TURBO" => ModelEnum.V2Turbo, - "V_3" => ModelEnum.V3, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ModelPoseVariantsRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ModelPoseVariantsRequest.Json.g.cs deleted file mode 100644 index a3bf3db1..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ModelPoseVariantsRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class ModelPoseVariantsRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.ModelPoseVariantsRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.ModelPoseVariantsRequest), - jsonSerializerContext) as global::Ideogram.ModelPoseVariantsRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.ModelPoseVariantsRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.ModelPoseVariantsRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.ModelPoseVariantsRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ModelPoseVariantsRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ModelPoseVariantsRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ModelPoseVariantsRequest.g.cs deleted file mode 100644 index 41540bad..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ModelPoseVariantsRequest.g.cs +++ /dev/null @@ -1,199 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The edit is full-frame; scene preservation is best effort. - /// - public sealed partial class ModelPoseVariantsRequest - { - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - ///
- /// {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - [global::System.Text.Json.Serialization.JsonPropertyName("source_asset_identifier")] - public global::Ideogram.AssetIdentifier? SourceAssetIdentifier { get; set; } - - /// - /// Fashion image to edit (max size 50MB). JPEG, PNG, WEBP, HEIF,
- /// AVIF, GIF, BMP, TIFF, and MPO formats are supported. Multipart
- /// requests only. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("source_image")] - public byte[]? SourceImage { get; set; } - - /// - /// Fashion image to edit (max size 50MB). JPEG, PNG, WEBP, HEIF,
- /// AVIF, GIF, BMP, TIFF, and MPO formats are supported. Multipart
- /// requests only. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("source_imagename")] - public string? SourceImagename { get; set; } - - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - ///
- /// {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - [global::System.Text.Json.Serialization.JsonPropertyName("pose_reference_asset_identifier")] - public global::Ideogram.AssetIdentifier? PoseReferenceAssetIdentifier { get; set; } - - /// - /// Plain-language pose or camera direction, such as a front-facing
- /// catalog stance or right-facing walking profile. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("instruction")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Instruction { get; set; } - - /// - /// Output aspect ratio. When omitted, the nearest supported ratio is
- /// derived from the source image. Supported values are `1:1`, `3:4`,
- /// `4:3`, `16:9`, and `9:16`. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] - public string? AspectRatio { get; set; } - - /// - /// The quality tier for the edit. Higher tiers may improve detail and
- /// take longer to complete. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("quality")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ModelPoseVariantsQualityJsonConverter))] - public global::Ideogram.ModelPoseVariantsQuality? Quality { get; set; } - - /// - /// Optional seed for repeatable results. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// Number of pose variants to create.
- /// Default Value: 1 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] - public int? NumImages { get; set; } - - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - ///
- /// https://api.example.com/webhooks/ideogram - [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] - public string? WebhookUrl { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Plain-language pose or camera direction, such as a front-facing
- /// catalog stance or right-facing walking profile. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// Fashion image to edit (max size 50MB). JPEG, PNG, WEBP, HEIF,
- /// AVIF, GIF, BMP, TIFF, and MPO formats are supported. Multipart
- /// requests only. - /// - /// - /// Fashion image to edit (max size 50MB). JPEG, PNG, WEBP, HEIF,
- /// AVIF, GIF, BMP, TIFF, and MPO formats are supported. Multipart
- /// requests only. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// Output aspect ratio. When omitted, the nearest supported ratio is
- /// derived from the source image. Supported values are `1:1`, `3:4`,
- /// `4:3`, `16:9`, and `9:16`. - /// - /// - /// The quality tier for the edit. Higher tiers may improve detail and
- /// take longer to complete. - /// - /// - /// Optional seed for repeatable results. - /// - /// - /// Number of pose variants to create.
- /// Default Value: 1 - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ModelPoseVariantsRequest( - string instruction, - global::Ideogram.AssetIdentifier? sourceAssetIdentifier, - byte[]? sourceImage, - string? sourceImagename, - global::Ideogram.AssetIdentifier? poseReferenceAssetIdentifier, - string? aspectRatio, - global::Ideogram.ModelPoseVariantsQuality? quality, - int? seed, - int? numImages, - bool? @private, - string? webhookUrl) - { - this.SourceAssetIdentifier = sourceAssetIdentifier; - this.SourceImage = sourceImage; - this.SourceImagename = sourceImagename; - this.PoseReferenceAssetIdentifier = poseReferenceAssetIdentifier; - this.Instruction = instruction ?? throw new global::System.ArgumentNullException(nameof(instruction)); - this.AspectRatio = aspectRatio; - this.Quality = quality; - this.Seed = seed; - this.NumImages = numImages; - this.Private = @private; - this.WebhookUrl = webhookUrl; - } - - /// - /// Initializes a new instance of the class. - /// - public ModelPoseVariantsRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ModelPoseVariantsResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ModelPoseVariantsResponse.g.cs index 25014759..95b54a12 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ModelPoseVariantsResponse.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ModelPoseVariantsResponse.g.cs @@ -5,8 +5,7 @@ namespace Ideogram { /// /// Acknowledgement that pose-variant generation was accepted. Poll
- /// `GET /v2/generations/{generation_id}` for status and results.
- /// Example: {"generation_id":"generation_id"} + /// `GET /v2/generations/{generation_id}` for status and results. ///
public sealed partial class ModelPoseVariantsResponse { diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ModelStatus.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ModelStatus.g.cs deleted file mode 100644 index 9fb6678e..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ModelStatus.g.cs +++ /dev/null @@ -1,75 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The status of a custom model. - /// - public enum ModelStatus - { - /// - /// - /// - Archived, - /// - /// - /// - Completed, - /// - /// - /// - Creating, - /// - /// - /// - Draft, - /// - /// - /// - Errored, - /// - /// - /// - Training, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class ModelStatusExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this ModelStatus value) - { - return value switch - { - ModelStatus.Archived => "ARCHIVED", - ModelStatus.Completed => "COMPLETED", - ModelStatus.Creating => "CREATING", - ModelStatus.Draft => "DRAFT", - ModelStatus.Errored => "ERRORED", - ModelStatus.Training => "TRAINING", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static ModelStatus? ToEnum(string value) - { - return value switch - { - "ARCHIVED" => ModelStatus.Archived, - "COMPLETED" => ModelStatus.Completed, - "CREATING" => ModelStatus.Creating, - "DRAFT" => ModelStatus.Draft, - "ERRORED" => ModelStatus.Errored, - "TRAINING" => ModelStatus.Training, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ModelSwapQuality.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ModelSwapQuality.g.cs deleted file mode 100644 index cbf59e21..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ModelSwapQuality.g.cs +++ /dev/null @@ -1,58 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The quality tier for the edit. Higher tiers may improve detail and
- /// take longer to complete. - ///
- public enum ModelSwapQuality - { - /// - /// - /// - High, - /// - /// - /// - Low, - /// - /// - /// - Medium, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class ModelSwapQualityExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this ModelSwapQuality value) - { - return value switch - { - ModelSwapQuality.High => "high", - ModelSwapQuality.Low => "low", - ModelSwapQuality.Medium => "medium", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static ModelSwapQuality? ToEnum(string value) - { - return value switch - { - "high" => ModelSwapQuality.High, - "low" => ModelSwapQuality.Low, - "medium" => ModelSwapQuality.Medium, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ModelSwapRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ModelSwapRequest.Json.g.cs deleted file mode 100644 index f3c00c66..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ModelSwapRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class ModelSwapRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.ModelSwapRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.ModelSwapRequest), - jsonSerializerContext) as global::Ideogram.ModelSwapRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.ModelSwapRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.ModelSwapRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.ModelSwapRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ModelSwapRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ModelSwapRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ModelSwapRequest.g.cs deleted file mode 100644 index ac048160..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ModelSwapRequest.g.cs +++ /dev/null @@ -1,182 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The working image (`source_image`) plus one to four ordered target-model references. Results are full-frame edits, so exact pixel preservation is not guaranteed. - /// - public sealed partial class ModelSwapRequest - { - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - ///
- /// {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - [global::System.Text.Json.Serialization.JsonPropertyName("source_asset_identifier")] - public global::Ideogram.AssetIdentifier? SourceAssetIdentifier { get; set; } - - /// - /// The working image whose product, pose, scene, lighting, framing, and camera are preserved. Supported formats and the 50 MB limit match the image upload API. Multipart requests only. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("source_image")] - public byte[]? SourceImage { get; set; } - - /// - /// The working image whose product, pose, scene, lighting, framing, and camera are preserved. Supported formats and the 50 MB limit match the image upload API. Multipart requests only. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("source_imagename")] - public string? SourceImagename { get; set; } - - /// - /// Ordered target-model identity and angle references. These images supply only identity, hair, skin tone, and body proportions. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("model_asset_identifiers")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList ModelAssetIdentifiers { get; set; } - - /// - /// Optional identity details that are not visible in the target-model references. This cannot override the source roles described above. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("instruction")] - public string? Instruction { get; set; } - - /// - /// Output aspect ratio. When omitted, the closest supported ratio is derived from the working image. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] - public string? AspectRatio { get; set; } - - /// - /// The quality tier for the edit. Higher tiers may improve detail and
- /// take longer to complete. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("quality")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ModelSwapQualityJsonConverter))] - public global::Ideogram.ModelSwapQuality? Quality { get; set; } - - /// - /// Optional seed for repeatable results. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// Number of model-swap images to create.
- /// Default Value: 1 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] - public int? NumImages { get; set; } - - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - ///
- /// https://api.example.com/webhooks/ideogram - [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] - public string? WebhookUrl { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Ordered target-model identity and angle references. These images supply only identity, hair, skin tone, and body proportions. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The working image whose product, pose, scene, lighting, framing, and camera are preserved. Supported formats and the 50 MB limit match the image upload API. Multipart requests only. - /// - /// - /// The working image whose product, pose, scene, lighting, framing, and camera are preserved. Supported formats and the 50 MB limit match the image upload API. Multipart requests only. - /// - /// - /// Optional identity details that are not visible in the target-model references. This cannot override the source roles described above. - /// - /// - /// Output aspect ratio. When omitted, the closest supported ratio is derived from the working image. - /// - /// - /// The quality tier for the edit. Higher tiers may improve detail and
- /// take longer to complete. - /// - /// - /// Optional seed for repeatable results. - /// - /// - /// Number of model-swap images to create.
- /// Default Value: 1 - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ModelSwapRequest( - global::System.Collections.Generic.IList modelAssetIdentifiers, - global::Ideogram.AssetIdentifier? sourceAssetIdentifier, - byte[]? sourceImage, - string? sourceImagename, - string? instruction, - string? aspectRatio, - global::Ideogram.ModelSwapQuality? quality, - int? seed, - int? numImages, - bool? @private, - string? webhookUrl) - { - this.SourceAssetIdentifier = sourceAssetIdentifier; - this.SourceImage = sourceImage; - this.SourceImagename = sourceImagename; - this.ModelAssetIdentifiers = modelAssetIdentifiers ?? throw new global::System.ArgumentNullException(nameof(modelAssetIdentifiers)); - this.Instruction = instruction; - this.AspectRatio = aspectRatio; - this.Quality = quality; - this.Seed = seed; - this.NumImages = numImages; - this.Private = @private; - this.WebhookUrl = webhookUrl; - } - - /// - /// Initializes a new instance of the class. - /// - public ModelSwapRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ModelSwapResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ModelSwapResponse.Json.g.cs deleted file mode 100644 index f3b37196..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ModelSwapResponse.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class ModelSwapResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.ModelSwapResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.ModelSwapResponse), - jsonSerializerContext) as global::Ideogram.ModelSwapResponse; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.ModelSwapResponse? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.ModelSwapResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.ModelSwapResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ModelSwapResponse; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ModelSwapResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ModelSwapResponse.g.cs deleted file mode 100644 index 2b21b255..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ModelSwapResponse.g.cs +++ /dev/null @@ -1,49 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Acknowledgement that the model swap was accepted. Poll
- /// `GET /v2/generations/{generation_id}` for status and results.
- /// Example: {"generation_id":"generation_id"} - ///
- public sealed partial class ModelSwapResponse - { - /// - /// URL-safe base64 ID accepted by the generation polling endpoint. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("generation_id")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string GenerationId { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// URL-safe base64 ID accepted by the generation polling endpoint. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ModelSwapResponse( - string generationId) - { - this.GenerationId = generationId ?? throw new global::System.ArgumentNullException(nameof(generationId)); - } - - /// - /// Initializes a new instance of the class. - /// - public ModelSwapResponse() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ModelVersion.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ModelVersion.g.cs deleted file mode 100644 index f51150d1..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ModelVersion.g.cs +++ /dev/null @@ -1,146 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The model_version to use.
- /// - V_0_3: Model 1.0
- /// - V_1_1: Model 1.1
- /// - V_1_5: Model 2.0
- /// - V_2_1: Model 2a
- /// - V_3_0: Model 3.0 March 26
- /// - V_3_1: Model 3.0 Latest
- /// - V_4_0: Model 4.0
- /// - V_4_D: Model 4.0 Layered Design (vector-text path; gated by the access_to_v4_experimental feature flag)
- /// - V_4_LAYOUT2IMAGE: Model 4.0 Layout to Image (HTML layout rasterized as IMAGE_TO_IMAGE conditioning; gated by the access_to_v4_experimental feature flag)
- /// - AUTO: Automatically select the best model version based on the request.
- /// Example: V_0_3 - ///
- public enum ModelVersion - { - /// - /// Automatically select the best model version based on the request. - /// - Auto, - /// - /// - /// - ExternalBytedanceSeedance10Pro, - /// - /// - /// - ExternalGoogleVeo30, - /// - /// - /// - ExternalMinimaxHailuo02, - /// - /// - /// - ExternalModel, - /// - /// - /// - V01, - /// - /// - /// - V02, - /// - /// Model 1.0 - /// - V03, - /// - /// Model 1.1 - /// - V11, - /// - /// Model 2.0 - /// - V15, - /// - /// Model 2a - /// - V21, - /// - /// Model 3.0 March 26 - /// - V30, - /// - /// Model 3.0 Latest - /// - V31, - /// - /// Model 4.0 - /// - V40, - /// - /// Model 4.0 Layered Design (vector-text path; gated by the access_to_v4_experimental feature flag) - /// - V4d, - /// - /// Model 4.0 Layout to Image (HTML layout rasterized as IMAGE_TO_IMAGE conditioning; gated by the access_to_v4_experimental feature flag) - /// - V4Layout2image, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class ModelVersionExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this ModelVersion value) - { - return value switch - { - ModelVersion.Auto => "AUTO", - ModelVersion.ExternalBytedanceSeedance10Pro => "EXTERNAL_BYTEDANCE_SEEDANCE_1_0_PRO", - ModelVersion.ExternalGoogleVeo30 => "EXTERNAL_GOOGLE_VEO_3_0", - ModelVersion.ExternalMinimaxHailuo02 => "EXTERNAL_MINIMAX_HAILUO_02", - ModelVersion.ExternalModel => "EXTERNAL_MODEL", - ModelVersion.V01 => "V_0_1", - ModelVersion.V02 => "V_0_2", - ModelVersion.V03 => "V_0_3", - ModelVersion.V11 => "V_1_1", - ModelVersion.V15 => "V_1_5", - ModelVersion.V21 => "V_2_1", - ModelVersion.V30 => "V_3_0", - ModelVersion.V31 => "V_3_1", - ModelVersion.V40 => "V_4_0", - ModelVersion.V4d => "V_4_D", - ModelVersion.V4Layout2image => "V_4_LAYOUT2IMAGE", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static ModelVersion? ToEnum(string value) - { - return value switch - { - "AUTO" => ModelVersion.Auto, - "EXTERNAL_BYTEDANCE_SEEDANCE_1_0_PRO" => ModelVersion.ExternalBytedanceSeedance10Pro, - "EXTERNAL_GOOGLE_VEO_3_0" => ModelVersion.ExternalGoogleVeo30, - "EXTERNAL_MINIMAX_HAILUO_02" => ModelVersion.ExternalMinimaxHailuo02, - "EXTERNAL_MODEL" => ModelVersion.ExternalModel, - "V_0_1" => ModelVersion.V01, - "V_0_2" => ModelVersion.V02, - "V_0_3" => ModelVersion.V03, - "V_1_1" => ModelVersion.V11, - "V_1_5" => ModelVersion.V15, - "V_2_1" => ModelVersion.V21, - "V_3_0" => ModelVersion.V30, - "V_3_1" => ModelVersion.V31, - "V_4_0" => ModelVersion.V40, - "V_4_D" => ModelVersion.V4d, - "V_4_LAYOUT2IMAGE" => ModelVersion.V4Layout2image, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.NanoBananaProReframeAspectRatio.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.NanoBananaProReframeAspectRatio.g.cs deleted file mode 100644 index 1b0abd5a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.NanoBananaProReframeAspectRatio.g.cs +++ /dev/null @@ -1,99 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Aspect ratios Nano Banana Pro can reframe an image to. - /// - public enum NanoBananaProReframeAspectRatio - { - /// - /// - /// - x16_9, - /// - /// - /// - x1_1, - /// - /// - /// - x21_9, - /// - /// - /// - x2_3, - /// - /// - /// - x3_2, - /// - /// - /// - x3_4, - /// - /// - /// - x4_3, - /// - /// - /// - x4_5, - /// - /// - /// - x5_4, - /// - /// - /// - x9_16, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class NanoBananaProReframeAspectRatioExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this NanoBananaProReframeAspectRatio value) - { - return value switch - { - NanoBananaProReframeAspectRatio.x16_9 => "16:9", - NanoBananaProReframeAspectRatio.x1_1 => "1:1", - NanoBananaProReframeAspectRatio.x21_9 => "21:9", - NanoBananaProReframeAspectRatio.x2_3 => "2:3", - NanoBananaProReframeAspectRatio.x3_2 => "3:2", - NanoBananaProReframeAspectRatio.x3_4 => "3:4", - NanoBananaProReframeAspectRatio.x4_3 => "4:3", - NanoBananaProReframeAspectRatio.x4_5 => "4:5", - NanoBananaProReframeAspectRatio.x5_4 => "5:4", - NanoBananaProReframeAspectRatio.x9_16 => "9:16", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static NanoBananaProReframeAspectRatio? ToEnum(string value) - { - return value switch - { - "16:9" => NanoBananaProReframeAspectRatio.x16_9, - "1:1" => NanoBananaProReframeAspectRatio.x1_1, - "21:9" => NanoBananaProReframeAspectRatio.x21_9, - "2:3" => NanoBananaProReframeAspectRatio.x2_3, - "3:2" => NanoBananaProReframeAspectRatio.x3_2, - "3:4" => NanoBananaProReframeAspectRatio.x3_4, - "4:3" => NanoBananaProReframeAspectRatio.x4_3, - "4:5" => NanoBananaProReframeAspectRatio.x4_5, - "5:4" => NanoBananaProReframeAspectRatio.x5_4, - "9:16" => NanoBananaProReframeAspectRatio.x9_16, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ObjectRemovalPostRemoveObjectFromV2AssetsRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ObjectRemovalPostRemoveObjectFromV2AssetsRequest.Json.g.cs new file mode 100644 index 00000000..cc7d3341 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ObjectRemovalPostRemoveObjectFromV2AssetsRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ObjectRemovalPostRemoveObjectFromV2AssetsRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ObjectRemovalPostRemoveObjectFromV2AssetsRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ObjectRemovalPostRemoveObjectFromV2AssetsRequest), + jsonSerializerContext) as global::Ideogram.ObjectRemovalPostRemoveObjectFromV2AssetsRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ObjectRemovalPostRemoveObjectFromV2AssetsRequest? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ObjectRemovalPostRemoveObjectFromV2AssetsRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ObjectRemovalPostRemoveObjectFromV2AssetsRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ObjectRemovalPostRemoveObjectFromV2AssetsRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ObjectRemovalPostRemoveObjectFromV2AssetsRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ObjectRemovalPostRemoveObjectFromV2AssetsRequest.g.cs new file mode 100644 index 00000000..4e1729e1 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ObjectRemovalPostRemoveObjectFromV2AssetsRequest.g.cs @@ -0,0 +1,94 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// + /// + public sealed partial class ObjectRemovalPostRemoveObjectFromV2AssetsRequest + { + /// + /// The source image to remove an object from. JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("image")] + [global::System.Text.Json.Serialization.JsonRequired] + public required byte[] Image { get; set; } + + /// + /// The source image to remove an object from. JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Imagename { get; set; } + + /// + /// A black-and-white mask the same size as the image; white (>= 128) marks the region to remove. JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("mask")] + [global::System.Text.Json.Serialization.JsonRequired] + public required byte[] Mask { get; set; } + + /// + /// A black-and-white mask the same size as the image; white (>= 128) marks the region to remove. JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("maskname")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Maskname { get; set; } + + /// + /// Random seed. Set for reproducible generation. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("seed")] + public int? Seed { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The source image to remove an object from. JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. + /// + /// + /// The source image to remove an object from. JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. + /// + /// + /// A black-and-white mask the same size as the image; white (>= 128) marks the region to remove. JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. + /// + /// + /// A black-and-white mask the same size as the image; white (>= 128) marks the region to remove. JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. + /// + /// + /// Random seed. Set for reproducible generation. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ObjectRemovalPostRemoveObjectFromV2AssetsRequest( + byte[] image, + string imagename, + byte[] mask, + string maskname, + int? seed) + { + this.Image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + this.Imagename = imagename ?? throw new global::System.ArgumentNullException(nameof(imagename)); + this.Mask = mask ?? throw new global::System.ArgumentNullException(nameof(mask)); + this.Maskname = maskname ?? throw new global::System.ArgumentNullException(nameof(maskname)); + this.Seed = seed; + } + + /// + /// Initializes a new instance of the class. + /// + public ObjectRemovalPostRemoveObjectFromV2AssetsRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ObjectRemovalPostRemoveObjectFromV2AssetsResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ObjectRemovalPostRemoveObjectFromV2AssetsResponse.Json.g.cs new file mode 100644 index 00000000..6e6e4871 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ObjectRemovalPostRemoveObjectFromV2AssetsResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ObjectRemovalPostRemoveObjectFromV2AssetsResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ObjectRemovalPostRemoveObjectFromV2AssetsResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ObjectRemovalPostRemoveObjectFromV2AssetsResponse), + jsonSerializerContext) as global::Ideogram.ObjectRemovalPostRemoveObjectFromV2AssetsResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ObjectRemovalPostRemoveObjectFromV2AssetsResponse? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ObjectRemovalPostRemoveObjectFromV2AssetsResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ObjectRemovalPostRemoveObjectFromV2AssetsResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ObjectRemovalPostRemoveObjectFromV2AssetsResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ObjectRemovalPostRemoveObjectFromV2AssetsResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ObjectRemovalPostRemoveObjectFromV2AssetsResponse.g.cs new file mode 100644 index 00000000..222af9d8 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ObjectRemovalPostRemoveObjectFromV2AssetsResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ObjectRemovalPostRemoveObjectFromV2AssetsResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ObjectRemovalPostRemoveObjectFromV2AssetsResponse2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ObjectRemovalPostRemoveObjectFromV2AssetsResponse2.Json.g.cs new file mode 100644 index 00000000..5f6fa2aa --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ObjectRemovalPostRemoveObjectFromV2AssetsResponse2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ObjectRemovalPostRemoveObjectFromV2AssetsResponse2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ObjectRemovalPostRemoveObjectFromV2AssetsResponse2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ObjectRemovalPostRemoveObjectFromV2AssetsResponse2), + jsonSerializerContext) as global::Ideogram.ObjectRemovalPostRemoveObjectFromV2AssetsResponse2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ObjectRemovalPostRemoveObjectFromV2AssetsResponse2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ObjectRemovalPostRemoveObjectFromV2AssetsResponse2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ObjectRemovalPostRemoveObjectFromV2AssetsResponse2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ObjectRemovalPostRemoveObjectFromV2AssetsResponse2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ObjectRemovalPostRemoveObjectFromV2AssetsResponse2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ObjectRemovalPostRemoveObjectFromV2AssetsResponse2.g.cs new file mode 100644 index 00000000..c978158d --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ObjectRemovalPostRemoveObjectFromV2AssetsResponse2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ObjectRemovalPostRemoveObjectFromV2AssetsResponse2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ObjectRemovalPostRemoveObjectFromV2AssetsResponse3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ObjectRemovalPostRemoveObjectFromV2AssetsResponse3.Json.g.cs new file mode 100644 index 00000000..b987dd6e --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ObjectRemovalPostRemoveObjectFromV2AssetsResponse3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ObjectRemovalPostRemoveObjectFromV2AssetsResponse3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ObjectRemovalPostRemoveObjectFromV2AssetsResponse3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ObjectRemovalPostRemoveObjectFromV2AssetsResponse3), + jsonSerializerContext) as global::Ideogram.ObjectRemovalPostRemoveObjectFromV2AssetsResponse3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ObjectRemovalPostRemoveObjectFromV2AssetsResponse3? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ObjectRemovalPostRemoveObjectFromV2AssetsResponse3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ObjectRemovalPostRemoveObjectFromV2AssetsResponse3), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ObjectRemovalPostRemoveObjectFromV2AssetsResponse3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ObjectRemovalPostRemoveObjectFromV2AssetsResponse3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ObjectRemovalPostRemoveObjectFromV2AssetsResponse3.g.cs new file mode 100644 index 00000000..6f433e9e --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ObjectRemovalPostRemoveObjectFromV2AssetsResponse3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ObjectRemovalPostRemoveObjectFromV2AssetsResponse3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ObjectRemovalPostRemoveObjectFromV2AssetsResponse4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ObjectRemovalPostRemoveObjectFromV2AssetsResponse4.Json.g.cs new file mode 100644 index 00000000..ad248032 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ObjectRemovalPostRemoveObjectFromV2AssetsResponse4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ObjectRemovalPostRemoveObjectFromV2AssetsResponse4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ObjectRemovalPostRemoveObjectFromV2AssetsResponse4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ObjectRemovalPostRemoveObjectFromV2AssetsResponse4), + jsonSerializerContext) as global::Ideogram.ObjectRemovalPostRemoveObjectFromV2AssetsResponse4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ObjectRemovalPostRemoveObjectFromV2AssetsResponse4? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ObjectRemovalPostRemoveObjectFromV2AssetsResponse4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ObjectRemovalPostRemoveObjectFromV2AssetsResponse4), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ObjectRemovalPostRemoveObjectFromV2AssetsResponse4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ObjectRemovalPostRemoveObjectFromV2AssetsResponse4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ObjectRemovalPostRemoveObjectFromV2AssetsResponse4.g.cs new file mode 100644 index 00000000..54173df7 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ObjectRemovalPostRemoveObjectFromV2AssetsResponse4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ObjectRemovalPostRemoveObjectFromV2AssetsResponse4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ObjectRemovalPostRemoveObjectFromV2AssetsResponse5.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ObjectRemovalPostRemoveObjectFromV2AssetsResponse5.Json.g.cs new file mode 100644 index 00000000..5dee3f30 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ObjectRemovalPostRemoveObjectFromV2AssetsResponse5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ObjectRemovalPostRemoveObjectFromV2AssetsResponse5 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ObjectRemovalPostRemoveObjectFromV2AssetsResponse5? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ObjectRemovalPostRemoveObjectFromV2AssetsResponse5), + jsonSerializerContext) as global::Ideogram.ObjectRemovalPostRemoveObjectFromV2AssetsResponse5; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ObjectRemovalPostRemoveObjectFromV2AssetsResponse5? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ObjectRemovalPostRemoveObjectFromV2AssetsResponse5? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ObjectRemovalPostRemoveObjectFromV2AssetsResponse5), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ObjectRemovalPostRemoveObjectFromV2AssetsResponse5; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ObjectRemovalPostRemoveObjectFromV2AssetsResponse5.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ObjectRemovalPostRemoveObjectFromV2AssetsResponse5.g.cs new file mode 100644 index 00000000..768b350f --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ObjectRemovalPostRemoveObjectFromV2AssetsResponse5.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ObjectRemovalPostRemoveObjectFromV2AssetsResponse5 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ObjectRemovalPostRemoveObjectFromV2AssetsResponse6.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ObjectRemovalPostRemoveObjectFromV2AssetsResponse6.Json.g.cs new file mode 100644 index 00000000..7d6ce45c --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ObjectRemovalPostRemoveObjectFromV2AssetsResponse6.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ObjectRemovalPostRemoveObjectFromV2AssetsResponse6 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ObjectRemovalPostRemoveObjectFromV2AssetsResponse6? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ObjectRemovalPostRemoveObjectFromV2AssetsResponse6), + jsonSerializerContext) as global::Ideogram.ObjectRemovalPostRemoveObjectFromV2AssetsResponse6; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ObjectRemovalPostRemoveObjectFromV2AssetsResponse6? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ObjectRemovalPostRemoveObjectFromV2AssetsResponse6? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ObjectRemovalPostRemoveObjectFromV2AssetsResponse6), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ObjectRemovalPostRemoveObjectFromV2AssetsResponse6; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ObjectRemovalPostRemoveObjectFromV2AssetsResponse6.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ObjectRemovalPostRemoveObjectFromV2AssetsResponse6.g.cs new file mode 100644 index 00000000..21ccd933 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ObjectRemovalPostRemoveObjectFromV2AssetsResponse6.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ObjectRemovalPostRemoveObjectFromV2AssetsResponse6 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.OrganizationMember.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.OrganizationMember.Json.g.cs deleted file mode 100644 index 5cd5902f..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.OrganizationMember.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class OrganizationMember - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.OrganizationMember? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.OrganizationMember), - jsonSerializerContext) as global::Ideogram.OrganizationMember; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.OrganizationMember? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.OrganizationMember? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.OrganizationMember), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.OrganizationMember; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.OrganizationMember.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.OrganizationMember.g.cs deleted file mode 100644 index 0cd77fa8..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.OrganizationMember.g.cs +++ /dev/null @@ -1,155 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"invite_id":"invite_id","display_handle":"john_doe","email_address":"john.doe@example.com","role":"OWNER","full_name":"full_name","invite_expiry_time":"2000-01-23T04:56:07\u002B00:00","avatar_url":"https://example.com/avatars/user123.jpg","user_id":"dXNlcl8xMjM","invite_status":"PENDING"} - /// - public sealed partial class OrganizationMember - { - /// - /// Base64 encoded user ID. Null for a pending invite to an email that has no account yet.
- /// Example: dXNlcl8xMjM - ///
- /// dXNlcl8xMjM - [global::System.Text.Json.Serialization.JsonPropertyName("user_id")] - public string? UserId { get; set; } - - /// - /// The display handle/username of the member. Null for a pending invite to an email that has no account yet.
- /// Example: john_doe - ///
- /// john_doe - [global::System.Text.Json.Serialization.JsonPropertyName("display_handle")] - public string? DisplayHandle { get; set; } - - /// - /// The email address of the member
- /// Example: john.doe@example.com - ///
- /// john.doe@example.com - [global::System.Text.Json.Serialization.JsonPropertyName("email_address")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string EmailAddress { get; set; } - - /// - /// URL to the member's avatar image. Null for a pending invite to an email that has no account yet.
- /// Example: https://example.com/avatars/user123.jpg - ///
- /// https://example.com/avatars/user123.jpg - [global::System.Text.Json.Serialization.JsonPropertyName("avatar_url")] - public string? AvatarUrl { get; set; } - - /// - /// Role within an organization profile. ADMIN only exists for ENTERPRISE_PREPAID organizations.
- /// Example: OWNER - ///
- /// OWNER - [global::System.Text.Json.Serialization.JsonPropertyName("role")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ApiProfileRoleJsonConverter))] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.ApiProfileRole Role { get; set; } - - /// - /// User's full name if entered through user profile. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("full_name")] - public string? FullName { get; set; } - - /// - /// Invite status, e.g. PENDING. Only populated while the member is still a pending invite; null for active members.
- /// Example: PENDING - ///
- /// PENDING - [global::System.Text.Json.Serialization.JsonPropertyName("invite_status")] - public string? InviteStatus { get; set; } - - /// - /// Base64 encoded invite ID. Only populated while the member is still a pending invite; null for active members. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("invite_id")] - public string? InviteId { get; set; } - - /// - /// When the pending invite expires. Only populated while the member is still a pending invite; null for active members. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("invite_expiry_time")] - public global::System.DateTime? InviteExpiryTime { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The email address of the member
- /// Example: john.doe@example.com - /// - /// - /// Role within an organization profile. ADMIN only exists for ENTERPRISE_PREPAID organizations.
- /// Example: OWNER - /// - /// - /// Base64 encoded user ID. Null for a pending invite to an email that has no account yet.
- /// Example: dXNlcl8xMjM - /// - /// - /// The display handle/username of the member. Null for a pending invite to an email that has no account yet.
- /// Example: john_doe - /// - /// - /// URL to the member's avatar image. Null for a pending invite to an email that has no account yet.
- /// Example: https://example.com/avatars/user123.jpg - /// - /// - /// User's full name if entered through user profile. - /// - /// - /// Invite status, e.g. PENDING. Only populated while the member is still a pending invite; null for active members.
- /// Example: PENDING - /// - /// - /// Base64 encoded invite ID. Only populated while the member is still a pending invite; null for active members. - /// - /// - /// When the pending invite expires. Only populated while the member is still a pending invite; null for active members. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public OrganizationMember( - string emailAddress, - global::Ideogram.ApiProfileRole role, - string? userId, - string? displayHandle, - string? avatarUrl, - string? fullName, - string? inviteStatus, - string? inviteId, - global::System.DateTime? inviteExpiryTime) - { - this.UserId = userId; - this.DisplayHandle = displayHandle; - this.EmailAddress = emailAddress ?? throw new global::System.ArgumentNullException(nameof(emailAddress)); - this.AvatarUrl = avatarUrl; - this.Role = role; - this.FullName = fullName; - this.InviteStatus = inviteStatus; - this.InviteId = inviteId; - this.InviteExpiryTime = inviteExpiryTime; - } - - /// - /// Initializes a new instance of the class. - /// - public OrganizationMember() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.OrganizationMemberOperationResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.OrganizationMemberOperationResponse.Json.g.cs deleted file mode 100644 index 0f1db0c5..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.OrganizationMemberOperationResponse.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class OrganizationMemberOperationResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.OrganizationMemberOperationResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.OrganizationMemberOperationResponse), - jsonSerializerContext) as global::Ideogram.OrganizationMemberOperationResponse; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.OrganizationMemberOperationResponse? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.OrganizationMemberOperationResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.OrganizationMemberOperationResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.OrganizationMemberOperationResponse; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.OrganizationMemberOperationResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.OrganizationMemberOperationResponse.g.cs deleted file mode 100644 index 54b0dd8f..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.OrganizationMemberOperationResponse.g.cs +++ /dev/null @@ -1,47 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"results":[{"success":true,"message":"message"},{"success":true,"message":"message"}]} - /// - public sealed partial class OrganizationMemberOperationResponse - { - /// - /// List of results for each member operation - /// - [global::System.Text.Json.Serialization.JsonPropertyName("results")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList Results { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// List of results for each member operation - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public OrganizationMemberOperationResponse( - global::System.Collections.Generic.IList results) - { - this.Results = results ?? throw new global::System.ArgumentNullException(nameof(results)); - } - - /// - /// Initializes a new instance of the class. - /// - public OrganizationMemberOperationResponse() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.OrganizationMemberOperationResult.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.OrganizationMemberOperationResult.Json.g.cs deleted file mode 100644 index de21463f..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.OrganizationMemberOperationResult.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class OrganizationMemberOperationResult - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.OrganizationMemberOperationResult? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.OrganizationMemberOperationResult), - jsonSerializerContext) as global::Ideogram.OrganizationMemberOperationResult; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.OrganizationMemberOperationResult? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.OrganizationMemberOperationResult? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.OrganizationMemberOperationResult), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.OrganizationMemberOperationResult; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.OrganizationMemberOperationResult.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.OrganizationMemberOperationResult.g.cs deleted file mode 100644 index e5a907e9..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.OrganizationMemberOperationResult.g.cs +++ /dev/null @@ -1,58 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"success":true,"message":"message"} - /// - public sealed partial class OrganizationMemberOperationResult - { - /// - /// Whether the operation was successful for this member - /// - [global::System.Text.Json.Serialization.JsonPropertyName("success")] - [global::System.Text.Json.Serialization.JsonRequired] - public required bool Success { get; set; } - - /// - /// A message describing the outcome of the operation for this member - /// - [global::System.Text.Json.Serialization.JsonPropertyName("message")] - public string? Message { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Whether the operation was successful for this member - /// - /// - /// A message describing the outcome of the operation for this member - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public OrganizationMemberOperationResult( - bool success, - string? message) - { - this.Success = success; - this.Message = message; - } - - /// - /// Initializes a new instance of the class. - /// - public OrganizationMemberOperationResult() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.OutputResolution.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.OutputResolution.g.cs deleted file mode 100644 index 937c297f..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.OutputResolution.g.cs +++ /dev/null @@ -1,68 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The output resolution tier for the generated image. Tiers are
- /// total-pixel budgets matching a square of the named size (for example,
- /// `8K` delivers at most 8192x8192 total pixels); wide and tall aspect
- /// ratios keep the same pixel budget, so a single dimension may exceed
- /// the named size. Defaults to 1K.
- /// Default Value: 1K - ///
- public enum OutputResolution - { - /// - /// - /// - x1k, - /// - /// - /// - x2k, - /// - /// - /// - x4k, - /// - /// - /// - x8k, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class OutputResolutionExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this OutputResolution value) - { - return value switch - { - OutputResolution.x1k => "1K", - OutputResolution.x2k => "2K", - OutputResolution.x4k => "4K", - OutputResolution.x8k => "8K", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static OutputResolution? ToEnum(string value) - { - return value switch - { - "1K" => OutputResolution.x1k, - "2K" => OutputResolution.x2k, - "4K" => OutputResolution.x4k, - "8K" => OutputResolution.x8k, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PImageResolution.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PImageResolution.g.cs deleted file mode 100644 index 29d19110..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.PImageResolution.g.cs +++ /dev/null @@ -1,51 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The output-size tier for P-Image Ideogram. - /// - public enum PImageResolution - { - /// - /// - /// - x1k, - /// - /// - /// - x2k, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class PImageResolutionExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this PImageResolution value) - { - return value switch - { - PImageResolution.x1k => "1K", - PImageResolution.x2k => "2K", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static PImageResolution? ToEnum(string value) - { - return value switch - { - "1K" => PImageResolution.x1k, - "2K" => PImageResolution.x2k, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PackshotView.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PackshotView.g.cs deleted file mode 100644 index 6f6efb0f..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.PackshotView.g.cs +++ /dev/null @@ -1,63 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Product view to generate. - /// - public enum PackshotView - { - /// - /// - /// - Back, - /// - /// - /// - Detail, - /// - /// - /// - Front, - /// - /// - /// - ThreeQuarter, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class PackshotViewExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this PackshotView value) - { - return value switch - { - PackshotView.Back => "back", - PackshotView.Detail => "detail", - PackshotView.Front => "front", - PackshotView.ThreeQuarter => "three_quarter", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static PackshotView? ToEnum(string value) - { - return value switch - { - "back" => PackshotView.Back, - "detail" => PackshotView.Detail, - "front" => PackshotView.Front, - "three_quarter" => PackshotView.ThreeQuarter, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PackshotsQuality.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PackshotsQuality.g.cs deleted file mode 100644 index cb09dad1..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.PackshotsQuality.g.cs +++ /dev/null @@ -1,58 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The quality tier for the edit. Higher tiers may improve detail and
- /// take longer to complete. - ///
- public enum PackshotsQuality - { - /// - /// - /// - High, - /// - /// - /// - Low, - /// - /// - /// - Medium, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class PackshotsQualityExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this PackshotsQuality value) - { - return value switch - { - PackshotsQuality.High => "high", - PackshotsQuality.Low => "low", - PackshotsQuality.Medium => "medium", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static PackshotsQuality? ToEnum(string value) - { - return value switch - { - "high" => PackshotsQuality.High, - "low" => PackshotsQuality.Low, - "medium" => PackshotsQuality.Medium, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PackshotsRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PackshotsRequest.Json.g.cs deleted file mode 100644 index 4165fba8..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.PackshotsRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class PackshotsRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.PackshotsRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.PackshotsRequest), - jsonSerializerContext) as global::Ideogram.PackshotsRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.PackshotsRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.PackshotsRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.PackshotsRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.PackshotsRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PackshotsRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PackshotsRequest.g.cs deleted file mode 100644 index ca88a1d6..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.PackshotsRequest.g.cs +++ /dev/null @@ -1,159 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"product_asset_identifiers":[{"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"}],"view":"front"} - /// - public sealed partial class PackshotsRequest - { - /// - /// Ordered uploaded or generated product images. Their product color,
- /// construction, materials, logos, proportions, and distinguishing
- /// details guide every output. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("product_asset_identifiers")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList ProductAssetIdentifiers { get; set; } - - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - ///
- /// {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - [global::System.Text.Json.Serialization.JsonPropertyName("style_reference_asset_identifier")] - public global::Ideogram.AssetIdentifier? StyleReferenceAssetIdentifier { get; set; } - - /// - /// Product view to generate. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("view")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.PackshotViewJsonConverter))] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.PackshotView View { get; set; } - - /// - /// Optional art direction for the studio background, lighting,
- /// framing, and presentation. Product fidelity rules always take
- /// precedence. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("instruction")] - public string? Instruction { get; set; } - - /// - /// Aspect ratio for every generated image. Supported values are
- /// `1:1`, `3:4`, `4:3`, `16:9`, and `9:16`. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] - public string? AspectRatio { get; set; } - - /// - /// The quality tier for the edit. Higher tiers may improve detail and
- /// take longer to complete. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("quality")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.PackshotsQualityJsonConverter))] - public global::Ideogram.PackshotsQuality? Quality { get; set; } - - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - ///
- /// https://api.example.com/webhooks/ideogram - [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] - public string? WebhookUrl { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Ordered uploaded or generated product images. Their product color,
- /// construction, materials, logos, proportions, and distinguishing
- /// details guide every output. - /// - /// - /// Product view to generate. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// Optional art direction for the studio background, lighting,
- /// framing, and presentation. Product fidelity rules always take
- /// precedence. - /// - /// - /// Aspect ratio for every generated image. Supported values are
- /// `1:1`, `3:4`, `4:3`, `16:9`, and `9:16`. - /// - /// - /// The quality tier for the edit. Higher tiers may improve detail and
- /// take longer to complete. - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public PackshotsRequest( - global::System.Collections.Generic.IList productAssetIdentifiers, - global::Ideogram.PackshotView view, - global::Ideogram.AssetIdentifier? styleReferenceAssetIdentifier, - string? instruction, - string? aspectRatio, - global::Ideogram.PackshotsQuality? quality, - bool? @private, - string? webhookUrl) - { - this.ProductAssetIdentifiers = productAssetIdentifiers ?? throw new global::System.ArgumentNullException(nameof(productAssetIdentifiers)); - this.StyleReferenceAssetIdentifier = styleReferenceAssetIdentifier; - this.View = view; - this.Instruction = instruction; - this.AspectRatio = aspectRatio; - this.Quality = quality; - this.Private = @private; - this.WebhookUrl = webhookUrl; - } - - /// - /// Initializes a new instance of the class. - /// - public PackshotsRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PackshotsResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PackshotsResponse.Json.g.cs deleted file mode 100644 index c0d362ef..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.PackshotsResponse.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class PackshotsResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.PackshotsResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.PackshotsResponse), - jsonSerializerContext) as global::Ideogram.PackshotsResponse; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.PackshotsResponse? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.PackshotsResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.PackshotsResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.PackshotsResponse; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PackshotsResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PackshotsResponse.g.cs deleted file mode 100644 index 4429ba69..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.PackshotsResponse.g.cs +++ /dev/null @@ -1,49 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Acknowledgement that the packshots workflow was accepted. Poll
- /// `GET /v2/generations/{generation_id}` for status and results.
- /// Example: {"generation_id":"generation_id"} - ///
- public sealed partial class PackshotsResponse - { - /// - /// URL-safe base64 ID accepted by the generation polling endpoint. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("generation_id")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string GenerationId { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// URL-safe base64 ID accepted by the generation polling endpoint. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public PackshotsResponse( - string generationId) - { - this.GenerationId = generationId ?? throw new global::System.ArgumentNullException(nameof(generationId)); - } - - /// - /// Initializes a new instance of the class. - /// - public PackshotsResponse() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PatchApiKeyRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PatchApiKeyRequest.Json.g.cs deleted file mode 100644 index 62e1db99..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.PatchApiKeyRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class PatchApiKeyRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.PatchApiKeyRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.PatchApiKeyRequest), - jsonSerializerContext) as global::Ideogram.PatchApiKeyRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.PatchApiKeyRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.PatchApiKeyRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.PatchApiKeyRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.PatchApiKeyRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PatchApiKeyRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PatchApiKeyRequest.g.cs deleted file mode 100644 index 99608259..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.PatchApiKeyRequest.g.cs +++ /dev/null @@ -1,49 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"label":"Live production environment"} - /// - public sealed partial class PatchApiKeyRequest - { - /// - /// New label for the API key. Pass null (or omit) to clear the existing label.
- /// Example: Live production environment - ///
- /// Live production environment - [global::System.Text.Json.Serialization.JsonPropertyName("label")] - public string? Label { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// New label for the API key. Pass null (or omit) to clear the existing label.
- /// Example: Live production environment - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public PatchApiKeyRequest( - string? label) - { - this.Label = label; - } - - /// - /// Initializes a new instance of the class. - /// - public PatchApiKeyRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PostAddCreditsError.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PostAddCreditsError.Json.g.cs deleted file mode 100644 index 1e3f08a3..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.PostAddCreditsError.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class PostAddCreditsError - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.PostAddCreditsError? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.PostAddCreditsError), - jsonSerializerContext) as global::Ideogram.PostAddCreditsError; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.PostAddCreditsError? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.PostAddCreditsError? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.PostAddCreditsError), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.PostAddCreditsError; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PostAddCreditsError.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PostAddCreditsError.g.cs deleted file mode 100644 index 1c0e2166..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.PostAddCreditsError.g.cs +++ /dev/null @@ -1,47 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Represents an error when attempting to add credits to an API user's account.
- /// Example: {"messages":["messages","messages"]} - ///
- public sealed partial class PostAddCreditsError - { - /// - /// Error messages about what the error could be. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("messages")] - public global::System.Collections.Generic.IList? Messages { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Error messages about what the error could be. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public PostAddCreditsError( - global::System.Collections.Generic.IList? messages) - { - this.Messages = messages; - } - - /// - /// Initializes a new instance of the class. - /// - public PostAddCreditsError() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PostAddCreditsRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PostAddCreditsRequest.Json.g.cs deleted file mode 100644 index 11b84506..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.PostAddCreditsRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class PostAddCreditsRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.PostAddCreditsRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.PostAddCreditsRequest), - jsonSerializerContext) as global::Ideogram.PostAddCreditsRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.PostAddCreditsRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.PostAddCreditsRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.PostAddCreditsRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.PostAddCreditsRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PostAddCreditsRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PostAddCreditsRequest.g.cs deleted file mode 100644 index 6e2392ba..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.PostAddCreditsRequest.g.cs +++ /dev/null @@ -1,50 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"amount":{"amount":1050,"currency_code":"USD"}} - /// - public sealed partial class PostAddCreditsRequest - { - /// - /// Represents a price.
- /// Example: {"amount":1050,"currency_code":"USD"} - ///
- /// {"amount":1050,"currency_code":"USD"} - [global::System.Text.Json.Serialization.JsonPropertyName("amount")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.Price Amount { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Represents a price.
- /// Example: {"amount":1050,"currency_code":"USD"} - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public PostAddCreditsRequest( - global::Ideogram.Price amount) - { - this.Amount = amount ?? throw new global::System.ArgumentNullException(nameof(amount)); - } - - /// - /// Initializes a new instance of the class. - /// - public PostAddCreditsRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PostAddCreditsResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PostAddCreditsResponse.Json.g.cs deleted file mode 100644 index 2f81e187..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.PostAddCreditsResponse.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class PostAddCreditsResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.PostAddCreditsResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.PostAddCreditsResponse), - jsonSerializerContext) as global::Ideogram.PostAddCreditsResponse; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.PostAddCreditsResponse? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.PostAddCreditsResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.PostAddCreditsResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.PostAddCreditsResponse; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PostAddCreditsResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PostAddCreditsResponse.g.cs deleted file mode 100644 index c94bbc61..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.PostAddCreditsResponse.g.cs +++ /dev/null @@ -1,50 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"amount":{"amount":1050,"currency_code":"USD"}} - /// - public sealed partial class PostAddCreditsResponse - { - /// - /// Represents a price.
- /// Example: {"amount":1050,"currency_code":"USD"} - ///
- /// {"amount":1050,"currency_code":"USD"} - [global::System.Text.Json.Serialization.JsonPropertyName("amount")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.Price Amount { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Represents a price.
- /// Example: {"amount":1050,"currency_code":"USD"} - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public PostAddCreditsResponse( - global::Ideogram.Price amount) - { - this.Amount = amount ?? throw new global::System.ArgumentNullException(nameof(amount)); - } - - /// - /// Initializes a new instance of the class. - /// - public PostAddCreditsResponse() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PostApiKeyResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PostApiKeyResponse.Json.g.cs deleted file mode 100644 index 73748944..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.PostApiKeyResponse.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class PostApiKeyResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.PostApiKeyResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.PostApiKeyResponse), - jsonSerializerContext) as global::Ideogram.PostApiKeyResponse; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.PostApiKeyResponse? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.PostApiKeyResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.PostApiKeyResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.PostApiKeyResponse; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PostApiKeyResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PostApiKeyResponse.g.cs deleted file mode 100644 index 68a527e6..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.PostApiKeyResponse.g.cs +++ /dev/null @@ -1,65 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"api_key":"example_api_key_replace_with_your_actual_key","api_key_id":"JRPVD7jWR1aTBYiJ0UFVOg=="} - /// - public sealed partial class PostApiKeyResponse - { - /// - /// The API key to use when making authenticated requests with the API. This key will only be shown once.
- /// Example: example_api_key_replace_with_your_actual_key - ///
- /// example_api_key_replace_with_your_actual_key - [global::System.Text.Json.Serialization.JsonPropertyName("api_key")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string ApiKey { get; set; } - - /// - /// The ID of the API key. A URL safe base64 encoded UUID
- /// Example: JRPVD7jWR1aTBYiJ0UFVOg== - ///
- /// JRPVD7jWR1aTBYiJ0UFVOg== - [global::System.Text.Json.Serialization.JsonPropertyName("api_key_id")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string ApiKeyId { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The API key to use when making authenticated requests with the API. This key will only be shown once.
- /// Example: example_api_key_replace_with_your_actual_key - /// - /// - /// The ID of the API key. A URL safe base64 encoded UUID
- /// Example: JRPVD7jWR1aTBYiJ0UFVOg== - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public PostApiKeyResponse( - string apiKey, - string apiKeyId) - { - this.ApiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey)); - this.ApiKeyId = apiKeyId ?? throw new global::System.ArgumentNullException(nameof(apiKeyId)); - } - - /// - /// Initializes a new instance of the class. - /// - public PostApiKeyResponse() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PostApiSubscriptionError.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PostApiSubscriptionError.Json.g.cs deleted file mode 100644 index 1e8543e2..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.PostApiSubscriptionError.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class PostApiSubscriptionError - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.PostApiSubscriptionError? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.PostApiSubscriptionError), - jsonSerializerContext) as global::Ideogram.PostApiSubscriptionError; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.PostApiSubscriptionError? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.PostApiSubscriptionError? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.PostApiSubscriptionError), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.PostApiSubscriptionError; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PostApiSubscriptionError.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PostApiSubscriptionError.g.cs deleted file mode 100644 index d2eaa136..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.PostApiSubscriptionError.g.cs +++ /dev/null @@ -1,47 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Represents an error when attempting to update the API subscription.
- /// Example: {"messages":["messages","messages"]} - ///
- public sealed partial class PostApiSubscriptionError - { - /// - /// Error messages about what the error could be. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("messages")] - public global::System.Collections.Generic.IList? Messages { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Error messages about what the error could be. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public PostApiSubscriptionError( - global::System.Collections.Generic.IList? messages) - { - this.Messages = messages; - } - - /// - /// Initializes a new instance of the class. - /// - public PostApiSubscriptionError() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PostApiSubscriptionRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PostApiSubscriptionRequest.Json.g.cs deleted file mode 100644 index 709d46a5..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.PostApiSubscriptionRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class PostApiSubscriptionRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.PostApiSubscriptionRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.PostApiSubscriptionRequest), - jsonSerializerContext) as global::Ideogram.PostApiSubscriptionRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.PostApiSubscriptionRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.PostApiSubscriptionRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.PostApiSubscriptionRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.PostApiSubscriptionRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PostApiSubscriptionRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PostApiSubscriptionRequest.g.cs deleted file mode 100644 index 1e32e2e4..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.PostApiSubscriptionRequest.g.cs +++ /dev/null @@ -1,61 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Request to update API settings. Fields which are omitted will be ignored.
- /// Example: {"recharge_settings":{"minimum_balance_threshold":{"amount":1050,"currency_code":"USD"},"top_up_balance":{"amount":1050,"currency_code":"USD"}},"is_active":true} - ///
- public sealed partial class PostApiSubscriptionRequest - { - /// - /// The current recharge settings for the API subscription.
- /// Example: {"minimum_balance_threshold":{"amount":1050,"currency_code":"USD"},"top_up_balance":{"amount":1050,"currency_code":"USD"}} - ///
- /// {"minimum_balance_threshold":{"amount":1050,"currency_code":"USD"},"top_up_balance":{"amount":1050,"currency_code":"USD"}} - [global::System.Text.Json.Serialization.JsonPropertyName("recharge_settings")] - public global::Ideogram.RechargeSettings? RechargeSettings { get; set; } - - /// - /// Whether to enable or disable auto recharge. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("is_active")] - public bool? IsActive { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The current recharge settings for the API subscription.
- /// Example: {"minimum_balance_threshold":{"amount":1050,"currency_code":"USD"},"top_up_balance":{"amount":1050,"currency_code":"USD"}} - /// - /// - /// Whether to enable or disable auto recharge. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public PostApiSubscriptionRequest( - global::Ideogram.RechargeSettings? rechargeSettings, - bool? isActive) - { - this.RechargeSettings = rechargeSettings; - this.IsActive = isActive; - } - - /// - /// Initializes a new instance of the class. - /// - public PostApiSubscriptionRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PostApiSubscriptionResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PostApiSubscriptionResponse.Json.g.cs deleted file mode 100644 index f99917be..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.PostApiSubscriptionResponse.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class PostApiSubscriptionResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.PostApiSubscriptionResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.PostApiSubscriptionResponse), - jsonSerializerContext) as global::Ideogram.PostApiSubscriptionResponse; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.PostApiSubscriptionResponse? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.PostApiSubscriptionResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.PostApiSubscriptionResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.PostApiSubscriptionResponse; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PostApiSubscriptionResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PostApiSubscriptionResponse.g.cs deleted file mode 100644 index c33bce40..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.PostApiSubscriptionResponse.g.cs +++ /dev/null @@ -1,48 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The updated API subscription.
- /// Example: {"recharge_settings":{"is_active":true}} - ///
- public sealed partial class PostApiSubscriptionResponse - { - /// - /// Example: {"is_active":true} - /// - /// {"is_active":true} - [global::System.Text.Json.Serialization.JsonPropertyName("recharge_settings")] - public global::Ideogram.RechargeSettingsResponse? RechargeSettings { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Example: {"is_active":true} - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public PostApiSubscriptionResponse( - global::Ideogram.RechargeSettingsResponse? rechargeSettings) - { - this.RechargeSettings = rechargeSettings; - } - - /// - /// Initializes a new instance of the class. - /// - public PostApiSubscriptionResponse() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PostApiTermsRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PostApiTermsRequest.Json.g.cs deleted file mode 100644 index e4cc98b2..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.PostApiTermsRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class PostApiTermsRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.PostApiTermsRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.PostApiTermsRequest), - jsonSerializerContext) as global::Ideogram.PostApiTermsRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.PostApiTermsRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.PostApiTermsRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.PostApiTermsRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.PostApiTermsRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PostApiTermsRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PostApiTermsRequest.g.cs deleted file mode 100644 index ad7b5bef..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.PostApiTermsRequest.g.cs +++ /dev/null @@ -1,50 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"terms_id":"TOS_2024_04_20"} - /// - public sealed partial class PostApiTermsRequest - { - /// - /// The ID of the terms which are being accepted.
- /// Example: TOS_2024_04_20 - ///
- /// TOS_2024_04_20 - [global::System.Text.Json.Serialization.JsonPropertyName("terms_id")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string TermsId { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The ID of the terms which are being accepted.
- /// Example: TOS_2024_04_20 - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public PostApiTermsRequest( - string termsId) - { - this.TermsId = termsId ?? throw new global::System.ArgumentNullException(nameof(termsId)); - } - - /// - /// Initializes a new instance of the class. - /// - public PostApiTermsRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PostGenerateDesignV4200Response.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PostGenerateDesignV4200Response.Json.g.cs deleted file mode 100644 index 812be47e..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.PostGenerateDesignV4200Response.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public readonly partial struct PostGenerateDesignV4200Response - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.PostGenerateDesignV4200Response? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.PostGenerateDesignV4200Response), - jsonSerializerContext) as global::Ideogram.PostGenerateDesignV4200Response?; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.PostGenerateDesignV4200Response? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.PostGenerateDesignV4200Response? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.PostGenerateDesignV4200Response), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.PostGenerateDesignV4200Response?; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PostGenerateDesignV4200Response.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PostGenerateDesignV4200Response.g.cs deleted file mode 100644 index f1b54e77..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.PostGenerateDesignV4200Response.g.cs +++ /dev/null @@ -1,306 +0,0 @@ -#pragma warning disable CS0618 // Type or member is obsolete - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - public readonly partial struct PostGenerateDesignV4200Response : global::System.IEquatable - { - /// - /// - /// - public global::Ideogram.PostGenerateDesignV4200ResponseDiscriminatorResponseType? ResponseType { get; } - - /// - /// The response which contains information about the generated image, including the download link and other text layeres.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it.
- /// Example: {"data":[{"text_containers":[{"id":"id","items":[{"font_candidates":["font_candidates","font_candidates"],"spans":[{"color":"#212121","text":"text","font_fx":["bold","italic"]},{"color":"#212121","text":"text","font_fx":["bold","italic"]}],"text_shadows":[{"color":"color","blur":0.2027123,"offset_x":9.301444,"offset_y":3.6160767},{"color":"color","blur":0.2027123,"offset_x":9.301444,"offset_y":3.6160767}],"font_size":5,"vertical_alignment":"top","text_transform":"none","glyph_type":"bullet","line_height":2.302136,"x":0,"width":1,"style_class":"body","y":6,"angle":0,"alignment":"center","font_file":"font_file","letter_spacing":7.0614014,"height":5},{"font_candidates":["font_candidates","font_candidates"],"spans":[{"color":"#212121","text":"text","font_fx":["bold","italic"]},{"color":"#212121","text":"text","font_fx":["bold","italic"]}],"text_shadows":[{"color":"color","blur":0.2027123,"offset_x":9.301444,"offset_y":3.6160767},{"color":"color","blur":0.2027123,"offset_x":9.301444,"offset_y":3.6160767}],"font_size":5,"vertical_alignment":"top","text_transform":"none","glyph_type":"bullet","line_height":2.302136,"x":0,"width":1,"style_class":"body","y":6,"angle":0,"alignment":"center","font_file":"font_file","letter_spacing":7.0614014,"height":5}]},{"id":"id","items":[{"font_candidates":["font_candidates","font_candidates"],"spans":[{"color":"#212121","text":"text","font_fx":["bold","italic"]},{"color":"#212121","text":"text","font_fx":["bold","italic"]}],"text_shadows":[{"color":"color","blur":0.2027123,"offset_x":9.301444,"offset_y":3.6160767},{"color":"color","blur":0.2027123,"offset_x":9.301444,"offset_y":3.6160767}],"font_size":5,"vertical_alignment":"top","text_transform":"none","glyph_type":"bullet","line_height":2.302136,"x":0,"width":1,"style_class":"body","y":6,"angle":0,"alignment":"center","font_file":"font_file","letter_spacing":7.0614014,"height":5},{"font_candidates":["font_candidates","font_candidates"],"spans":[{"color":"#212121","text":"text","font_fx":["bold","italic"]},{"color":"#212121","text":"text","font_fx":["bold","italic"]}],"text_shadows":[{"color":"color","blur":0.2027123,"offset_x":9.301444,"offset_y":3.6160767},{"color":"color","blur":0.2027123,"offset_x":9.301444,"offset_y":3.6160767}],"font_size":5,"vertical_alignment":"top","text_transform":"none","glyph_type":"bullet","line_height":2.302136,"x":0,"width":1,"style_class":"body","y":6,"angle":0,"alignment":"center","font_file":"font_file","letter_spacing":7.0614014,"height":5}]}],"image_layers":[{"ref_id":"REF_0","x":4,"width":1,"y":7,"height":1},{"ref_id":"REF_0","x":4,"width":1,"y":7,"height":1}],"url":"https://openapi-generator.tech","text_html":"text_html"},{"text_containers":[{"id":"id","items":[{"font_candidates":["font_candidates","font_candidates"],"spans":[{"color":"#212121","text":"text","font_fx":["bold","italic"]},{"color":"#212121","text":"text","font_fx":["bold","italic"]}],"text_shadows":[{"color":"color","blur":0.2027123,"offset_x":9.301444,"offset_y":3.6160767},{"color":"color","blur":0.2027123,"offset_x":9.301444,"offset_y":3.6160767}],"font_size":5,"vertical_alignment":"top","text_transform":"none","glyph_type":"bullet","line_height":2.302136,"x":0,"width":1,"style_class":"body","y":6,"angle":0,"alignment":"center","font_file":"font_file","letter_spacing":7.0614014,"height":5},{"font_candidates":["font_candidates","font_candidates"],"spans":[{"color":"#212121","text":"text","font_fx":["bold","italic"]},{"color":"#212121","text":"text","font_fx":["bold","italic"]}],"text_shadows":[{"color":"color","blur":0.2027123,"offset_x":9.301444,"offset_y":3.6160767},{"color":"color","blur":0.2027123,"offset_x":9.301444,"offset_y":3.6160767}],"font_size":5,"vertical_alignment":"top","text_transform":"none","glyph_type":"bullet","line_height":2.302136,"x":0,"width":1,"style_class":"body","y":6,"angle":0,"alignment":"center","font_file":"font_file","letter_spacing":7.0614014,"height":5}]},{"id":"id","items":[{"font_candidates":["font_candidates","font_candidates"],"spans":[{"color":"#212121","text":"text","font_fx":["bold","italic"]},{"color":"#212121","text":"text","font_fx":["bold","italic"]}],"text_shadows":[{"color":"color","blur":0.2027123,"offset_x":9.301444,"offset_y":3.6160767},{"color":"color","blur":0.2027123,"offset_x":9.301444,"offset_y":3.6160767}],"font_size":5,"vertical_alignment":"top","text_transform":"none","glyph_type":"bullet","line_height":2.302136,"x":0,"width":1,"style_class":"body","y":6,"angle":0,"alignment":"center","font_file":"font_file","letter_spacing":7.0614014,"height":5},{"font_candidates":["font_candidates","font_candidates"],"spans":[{"color":"#212121","text":"text","font_fx":["bold","italic"]},{"color":"#212121","text":"text","font_fx":["bold","italic"]}],"text_shadows":[{"color":"color","blur":0.2027123,"offset_x":9.301444,"offset_y":3.6160767},{"color":"color","blur":0.2027123,"offset_x":9.301444,"offset_y":3.6160767}],"font_size":5,"vertical_alignment":"top","text_transform":"none","glyph_type":"bullet","line_height":2.302136,"x":0,"width":1,"style_class":"body","y":6,"angle":0,"alignment":"center","font_file":"font_file","letter_spacing":7.0614014,"height":5}]}],"image_layers":[{"ref_id":"REF_0","x":4,"width":1,"y":7,"height":1},{"ref_id":"REF_0","x":4,"width":1,"y":7,"height":1}],"url":"https://openapi-generator.tech","text_html":"text_html"}],"created":"2000-01-23T04:56:07\u002B00:00","response_type":"layered"} - ///
-#if NET6_0_OR_GREATER - public global::Ideogram.LayeredImageGenerationResponseV3? Layered { get; init; } -#else - public global::Ideogram.LayeredImageGenerationResponseV3? Layered { get; } -#endif - - /// - /// - /// -#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Layered))] -#endif - public bool IsLayered => Layered != null; - - /// - /// - /// - public bool TryPickLayered( -#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] -#endif - out global::Ideogram.LayeredImageGenerationResponseV3? value) - { - value = Layered; - return IsLayered; - } - - /// - /// - /// - public global::Ideogram.LayeredImageGenerationResponseV3 PickLayered() => Layered is { } value - ? value - : throw new global::System.InvalidOperationException($"Expected union variant 'Layered' but the value was {ToString()}."); - - /// - /// The response which contains information about the generated layout-to-image output, including the download link.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it. - ///
-#if NET6_0_OR_GREATER - public global::Ideogram.ImageGenerationResponseV4Layout? Url { get; init; } -#else - public global::Ideogram.ImageGenerationResponseV4Layout? Url { get; } -#endif - - /// - /// - /// -#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Url))] -#endif - public bool IsUrl => Url != null; - - /// - /// - /// - public bool TryPickUrl( -#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] -#endif - out global::Ideogram.ImageGenerationResponseV4Layout? value) - { - value = Url; - return IsUrl; - } - - /// - /// - /// - public global::Ideogram.ImageGenerationResponseV4Layout PickUrl() => Url is { } value - ? value - : throw new global::System.InvalidOperationException($"Expected union variant 'Url' but the value was {ToString()}."); - /// - /// - /// - public static implicit operator PostGenerateDesignV4200Response(global::Ideogram.LayeredImageGenerationResponseV3 value) => new PostGenerateDesignV4200Response((global::Ideogram.LayeredImageGenerationResponseV3?)value); - - /// - /// - /// - public static implicit operator global::Ideogram.LayeredImageGenerationResponseV3?(PostGenerateDesignV4200Response @this) => @this.Layered; - - /// - /// - /// - public PostGenerateDesignV4200Response(global::Ideogram.LayeredImageGenerationResponseV3? value) - { - Layered = value; - } - - /// - /// - /// - public static PostGenerateDesignV4200Response FromLayered(global::Ideogram.LayeredImageGenerationResponseV3? value) => new PostGenerateDesignV4200Response(value); - - /// - /// - /// - public static implicit operator PostGenerateDesignV4200Response(global::Ideogram.ImageGenerationResponseV4Layout value) => new PostGenerateDesignV4200Response((global::Ideogram.ImageGenerationResponseV4Layout?)value); - - /// - /// - /// - public static implicit operator global::Ideogram.ImageGenerationResponseV4Layout?(PostGenerateDesignV4200Response @this) => @this.Url; - - /// - /// - /// - public PostGenerateDesignV4200Response(global::Ideogram.ImageGenerationResponseV4Layout? value) - { - Url = value; - } - - /// - /// - /// - public static PostGenerateDesignV4200Response FromUrl(global::Ideogram.ImageGenerationResponseV4Layout? value) => new PostGenerateDesignV4200Response(value); - - /// - /// - /// - public PostGenerateDesignV4200Response( - global::Ideogram.PostGenerateDesignV4200ResponseDiscriminatorResponseType? responseType, - global::Ideogram.LayeredImageGenerationResponseV3? layered, - global::Ideogram.ImageGenerationResponseV4Layout? url - ) - { - ResponseType = responseType; - - Layered = layered; - Url = url; - } - - /// - /// - /// - public object? Object => - Url as object ?? - Layered as object - ; - - /// - /// - /// - public override string? ToString() => - Layered?.ToString() ?? - Url?.ToString() - ; - - /// - /// - /// - public bool Validate() - { - return IsLayered && !IsUrl || !IsLayered && IsUrl; - } - - /// - /// - /// - public TResult? Match( - global::System.Func? layered = null, - global::System.Func? url = null, - bool validate = true) - { - if (validate) - { - Validate(); - } - - if (Layered is { } __value0 && layered != null) - { - return layered(__value0); - } - else if (Url is { } __value1 && url != null) - { - return url(__value1); - } - - return default(TResult); - } - - /// - /// - /// - public void Match( - global::System.Action? layered = null, - - global::System.Action? url = null, - bool validate = true) - { - if (validate) - { - Validate(); - } - - if (Layered is { } __value0) - { - layered?.Invoke(__value0); - } - else if (Url is { } __value1) - { - url?.Invoke(__value1); - } - } - - /// - /// - /// - public void Switch( - global::System.Action? layered = null, - global::System.Action? url = null, - bool validate = true) - { - if (validate) - { - Validate(); - } - - if (Layered is { } __value0) - { - layered?.Invoke(__value0); - } - else if (Url is { } __value1) - { - url?.Invoke(__value1); - } - } - - /// - /// - /// - public override int GetHashCode() - { - var fields = new object?[] - { - Layered, - typeof(global::Ideogram.LayeredImageGenerationResponseV3), - Url, - typeof(global::Ideogram.ImageGenerationResponseV4Layout), - }; - const int offset = unchecked((int)2166136261); - const int prime = 16777619; - static int HashCodeAggregator(int hashCode, object? value) => value == null - ? (hashCode ^ 0) * prime - : (hashCode ^ value.GetHashCode()) * prime; - - return global::System.Linq.Enumerable.Aggregate(fields, offset, HashCodeAggregator); - } - - /// - /// - /// - public bool Equals(PostGenerateDesignV4200Response other) - { - return - global::System.Collections.Generic.EqualityComparer.Default.Equals(Layered, other.Layered) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(Url, other.Url) - ; - } - - /// - /// - /// - public static bool operator ==(PostGenerateDesignV4200Response obj1, PostGenerateDesignV4200Response obj2) - { - return global::System.Collections.Generic.EqualityComparer.Default.Equals(obj1, obj2); - } - - /// - /// - /// - public static bool operator !=(PostGenerateDesignV4200Response obj1, PostGenerateDesignV4200Response obj2) - { - return !(obj1 == obj2); - } - - /// - /// - /// - public override bool Equals(object? obj) - { - return obj is PostGenerateDesignV4200Response o && Equals(o); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PostGenerateDesignV4200ResponseDiscriminator.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PostGenerateDesignV4200ResponseDiscriminator.Json.g.cs deleted file mode 100644 index 3f2ba3db..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.PostGenerateDesignV4200ResponseDiscriminator.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class PostGenerateDesignV4200ResponseDiscriminator - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.PostGenerateDesignV4200ResponseDiscriminator? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.PostGenerateDesignV4200ResponseDiscriminator), - jsonSerializerContext) as global::Ideogram.PostGenerateDesignV4200ResponseDiscriminator; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.PostGenerateDesignV4200ResponseDiscriminator? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.PostGenerateDesignV4200ResponseDiscriminator? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.PostGenerateDesignV4200ResponseDiscriminator), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.PostGenerateDesignV4200ResponseDiscriminator; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PostGenerateDesignV4200ResponseDiscriminator.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PostGenerateDesignV4200ResponseDiscriminator.g.cs deleted file mode 100644 index 30f7dc2b..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.PostGenerateDesignV4200ResponseDiscriminator.g.cs +++ /dev/null @@ -1,45 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - public sealed partial class PostGenerateDesignV4200ResponseDiscriminator - { - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("response_type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.PostGenerateDesignV4200ResponseDiscriminatorResponseTypeJsonConverter))] - public global::Ideogram.PostGenerateDesignV4200ResponseDiscriminatorResponseType? ResponseType { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public PostGenerateDesignV4200ResponseDiscriminator( - global::Ideogram.PostGenerateDesignV4200ResponseDiscriminatorResponseType? responseType) - { - this.ResponseType = responseType; - } - - /// - /// Initializes a new instance of the class. - /// - public PostGenerateDesignV4200ResponseDiscriminator() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PostGenerateDesignV4200ResponseDiscriminatorResponseType.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PostGenerateDesignV4200ResponseDiscriminatorResponseType.g.cs deleted file mode 100644 index d8de9490..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.PostGenerateDesignV4200ResponseDiscriminatorResponseType.g.cs +++ /dev/null @@ -1,51 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - public enum PostGenerateDesignV4200ResponseDiscriminatorResponseType - { - /// - /// - /// - Layered, - /// - /// - /// - Url, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class PostGenerateDesignV4200ResponseDiscriminatorResponseTypeExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this PostGenerateDesignV4200ResponseDiscriminatorResponseType value) - { - return value switch - { - PostGenerateDesignV4200ResponseDiscriminatorResponseType.Layered => "layered", - PostGenerateDesignV4200ResponseDiscriminatorResponseType.Url => "url", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static PostGenerateDesignV4200ResponseDiscriminatorResponseType? ToEnum(string value) - { - return value switch - { - "layered" => PostGenerateDesignV4200ResponseDiscriminatorResponseType.Layered, - "url" => PostGenerateDesignV4200ResponseDiscriminatorResponseType.Url, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PostInternalTesting200Response.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PostInternalTesting200Response.Json.g.cs deleted file mode 100644 index 1b1dd63d..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.PostInternalTesting200Response.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class PostInternalTesting200Response - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.PostInternalTesting200Response? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.PostInternalTesting200Response), - jsonSerializerContext) as global::Ideogram.PostInternalTesting200Response; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.PostInternalTesting200Response? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.PostInternalTesting200Response? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.PostInternalTesting200Response), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.PostInternalTesting200Response; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PostInternalTesting200Response.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PostInternalTesting200Response.g.cs deleted file mode 100644 index 3a34d01f..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.PostInternalTesting200Response.g.cs +++ /dev/null @@ -1,44 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"response_content":"response_content"} - /// - public sealed partial class PostInternalTesting200Response - { - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("response_content")] - public string? ResponseContent { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public PostInternalTesting200Response( - string? responseContent) - { - this.ResponseContent = responseContent; - } - - /// - /// Initializes a new instance of the class. - /// - public PostInternalTesting200Response() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PreciseEditImageIdeogram45Request.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PreciseEditImageIdeogram45Request.Json.g.cs deleted file mode 100644 index 54899c46..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.PreciseEditImageIdeogram45Request.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class PreciseEditImageIdeogram45Request - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.PreciseEditImageIdeogram45Request? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.PreciseEditImageIdeogram45Request), - jsonSerializerContext) as global::Ideogram.PreciseEditImageIdeogram45Request; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.PreciseEditImageIdeogram45Request? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.PreciseEditImageIdeogram45Request? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.PreciseEditImageIdeogram45Request), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.PreciseEditImageIdeogram45Request; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PreciseEditImageIdeogram45Request.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PreciseEditImageIdeogram45Request.g.cs deleted file mode 100644 index 2758df86..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.PreciseEditImageIdeogram45Request.g.cs +++ /dev/null @@ -1,277 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// A request to edit one image. The `image` to edit is required. The
- /// output is always returned at that image's exact width and height, so
- /// this request takes no output size. - ///
- public sealed partial class PreciseEditImageIdeogram45Request - { - /// - /// The edit instruction, in natural language or as a structured JSON
- /// prompt. Natural language is automatically converted into a
- /// structured prompt; valid structured JSON is used as is. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Prompt { get; set; } - - /// - /// The image to edit, as an existing upload or generated image asset. Supply this or `image`, never both. Takes priority over `image` if both are supplied. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image_asset_identifier")] - public global::Ideogram.AssetIdentifier? ImageAssetIdentifier { get; set; } - - /// - /// The image to edit, as raw bytes (max 50MB; JPEG, PNG, or WEBP). Multipart requests only; ignored if `image_asset_identifier` is also supplied. The output always matches this image's width and height, and pixels the edit did not meaningfully change are copied exactly from it. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image")] - public byte[]? Image { get; set; } - - /// - /// The image to edit, as raw bytes (max 50MB; JPEG, PNG, or WEBP). Multipart requests only; ignored if `image_asset_identifier` is also supplied. The output always matches this image's width and height, and pixels the edit did not meaningfully change are copied exactly from it. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] - public string? Imagename { get; set; } - - /// - /// Optional additional images to guide the edit, by reference. These are never edited themselves; only `image_asset_identifier` or `image` is. Requires the image being edited to be supplied by reference too. A request with a mask can include at most three. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("reference_image_asset_identifiers")] - public global::System.Collections.Generic.IList? ReferenceImageAssetIdentifiers { get; set; } - - /// - /// Optional images to guide the edit (max 4, max 50MB each; JPEG, PNG, or WEBP). They are never edited themselves; only `image` is. Multipart requests only; ignored if `reference_image_asset_identifiers` is also supplied. A request with a `mask` can include at most three, because the mask takes up one reference slot. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("reference_images")] - public global::System.Collections.Generic.IList? ReferenceImages { get; set; } - - /// - /// An existing upload or generated image asset to use as the mask, by reference. The same rules as `mask` apply. Takes priority over `mask` if both are supplied. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("mask_asset_identifier")] - public global::Ideogram.AssetIdentifier? MaskAssetIdentifier { get; set; } - - /// - /// An optional mask that limits the edit to part of `image` (max 50MB; JPEG, PNG, or WEBP). Multipart requests only. Black marks the area to edit and white the area to keep; values in between are rounded to the nearer of the two. The mask must have the same width and height as the image being edited and contain both black and white areas. A masked request can include at most three reference images. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("mask")] - public byte[]? Mask { get; set; } - - /// - /// An optional mask that limits the edit to part of `image` (max 50MB; JPEG, PNG, or WEBP). Multipart requests only. Black marks the area to edit and white the area to keep; values in between are rounded to the nearer of the two. The mask must have the same width and height as the image being edited and contain both black and white areas. A masked request can include at most three reference images. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("maskname")] - public string? Maskname { get; set; } - - /// - /// Which region of the image to edit.
- /// `none`, the default, edits the whole image. A large image may come back smaller than it was sent.
- /// `auto` requires a `mask` and automatically selects an appropriate context region around the masked area.
- /// `y_min,x_min,y_max,x_max` names the region explicitly, by its corners. Rows come first, matching the `bbox` ordering used elsewhere in this API, and the values are the edited image's own pixels with the origin at its top-left corner. For example `512,1024,2048,3072` is the region 2048 pixels wide and 1536 tall whose top-left corner is 1024 across and 512 down. The maximum edges are exclusive, so the region measures `x_max - x_min` by `y_max - y_min`. It must lie inside the image, measure at least 256px on each side, have an aspect ratio between 1:6 and 6:1, and cover no more than 4194304 pixels. A `mask` may select only pixels inside it.
- /// With `auto` or an explicit region, only that region changes and the output keeps the image's own width and height.
- /// Default Value: none - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("context_window")] - public string? ContextWindow { get; set; } - - /// - /// The rendering quality to use. `very_low` is the fastest and cheapest, and `high` takes longer and is priced higher.
- /// Default Value: medium - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("quality")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.PreciseEditImageIdeogram45RequestQualityJsonConverter))] - public global::Ideogram.PreciseEditImageIdeogram45RequestQuality? Quality { get; set; } - - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - ///
- /// 12345 - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// The number of images to generate.
- /// Default Value: 1 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] - public int? NumImages { get; set; } - - /// - /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("enable_copyright_detection")] - public bool? EnableCopyrightDetection { get; set; } - - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("async")] - public bool? Async { get; set; } - - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - ///
- /// https://api.example.com/webhooks/ideogram - [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] - public string? WebhookUrl { get; set; } - - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("target_collection_id")] - public string? TargetCollectionId { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The edit instruction, in natural language or as a structured JSON
- /// prompt. Natural language is automatically converted into a
- /// structured prompt; valid structured JSON is used as is. - /// - /// - /// The image to edit, as an existing upload or generated image asset. Supply this or `image`, never both. Takes priority over `image` if both are supplied. - /// - /// - /// The image to edit, as raw bytes (max 50MB; JPEG, PNG, or WEBP). Multipart requests only; ignored if `image_asset_identifier` is also supplied. The output always matches this image's width and height, and pixels the edit did not meaningfully change are copied exactly from it. - /// - /// - /// The image to edit, as raw bytes (max 50MB; JPEG, PNG, or WEBP). Multipart requests only; ignored if `image_asset_identifier` is also supplied. The output always matches this image's width and height, and pixels the edit did not meaningfully change are copied exactly from it. - /// - /// - /// Optional additional images to guide the edit, by reference. These are never edited themselves; only `image_asset_identifier` or `image` is. Requires the image being edited to be supplied by reference too. A request with a mask can include at most three. - /// - /// - /// Optional images to guide the edit (max 4, max 50MB each; JPEG, PNG, or WEBP). They are never edited themselves; only `image` is. Multipart requests only; ignored if `reference_image_asset_identifiers` is also supplied. A request with a `mask` can include at most three, because the mask takes up one reference slot. - /// - /// - /// An existing upload or generated image asset to use as the mask, by reference. The same rules as `mask` apply. Takes priority over `mask` if both are supplied. - /// - /// - /// An optional mask that limits the edit to part of `image` (max 50MB; JPEG, PNG, or WEBP). Multipart requests only. Black marks the area to edit and white the area to keep; values in between are rounded to the nearer of the two. The mask must have the same width and height as the image being edited and contain both black and white areas. A masked request can include at most three reference images. - /// - /// - /// An optional mask that limits the edit to part of `image` (max 50MB; JPEG, PNG, or WEBP). Multipart requests only. Black marks the area to edit and white the area to keep; values in between are rounded to the nearer of the two. The mask must have the same width and height as the image being edited and contain both black and white areas. A masked request can include at most three reference images. - /// - /// - /// Which region of the image to edit.
- /// `none`, the default, edits the whole image. A large image may come back smaller than it was sent.
- /// `auto` requires a `mask` and automatically selects an appropriate context region around the masked area.
- /// `y_min,x_min,y_max,x_max` names the region explicitly, by its corners. Rows come first, matching the `bbox` ordering used elsewhere in this API, and the values are the edited image's own pixels with the origin at its top-left corner. For example `512,1024,2048,3072` is the region 2048 pixels wide and 1536 tall whose top-left corner is 1024 across and 512 down. The maximum edges are exclusive, so the region measures `x_max - x_min` by `y_max - y_min`. It must lie inside the image, measure at least 256px on each side, have an aspect ratio between 1:6 and 6:1, and cover no more than 4194304 pixels. A `mask` may select only pixels inside it.
- /// With `auto` or an explicit region, only that region changes and the output keeps the image's own width and height.
- /// Default Value: none - /// - /// - /// The rendering quality to use. `very_low` is the fastest and cheapest, and `high` takes longer and is priced higher.
- /// Default Value: medium - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. - /// - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public PreciseEditImageIdeogram45Request( - string prompt, - global::Ideogram.AssetIdentifier? imageAssetIdentifier, - byte[]? image, - string? imagename, - global::System.Collections.Generic.IList? referenceImageAssetIdentifiers, - global::System.Collections.Generic.IList? referenceImages, - global::Ideogram.AssetIdentifier? maskAssetIdentifier, - byte[]? mask, - string? maskname, - string? contextWindow, - global::Ideogram.PreciseEditImageIdeogram45RequestQuality? quality, - int? seed, - int? numImages, - bool? enableCopyrightDetection, - bool? async, - string? webhookUrl, - bool? @private, - string? targetCollectionId) - { - this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); - this.ImageAssetIdentifier = imageAssetIdentifier; - this.Image = image; - this.Imagename = imagename; - this.ReferenceImageAssetIdentifiers = referenceImageAssetIdentifiers; - this.ReferenceImages = referenceImages; - this.MaskAssetIdentifier = maskAssetIdentifier; - this.Mask = mask; - this.Maskname = maskname; - this.ContextWindow = contextWindow; - this.Quality = quality; - this.Seed = seed; - this.NumImages = numImages; - this.EnableCopyrightDetection = enableCopyrightDetection; - this.Async = async; - this.WebhookUrl = webhookUrl; - this.Private = @private; - this.TargetCollectionId = targetCollectionId; - } - - /// - /// Initializes a new instance of the class. - /// - public PreciseEditImageIdeogram45Request() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PreciseEditImageIdeogram45RequestQuality.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PreciseEditImageIdeogram45RequestQuality.g.cs deleted file mode 100644 index 14a39bea..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.PreciseEditImageIdeogram45RequestQuality.g.cs +++ /dev/null @@ -1,64 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The rendering quality to use. `very_low` is the fastest and cheapest, and `high` takes longer and is priced higher.
- /// Default Value: medium - ///
- public enum PreciseEditImageIdeogram45RequestQuality - { - /// - /// - /// - High, - /// - /// - /// - Low, - /// - /// - /// - Medium, - /// - /// - /// - VeryLow, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class PreciseEditImageIdeogram45RequestQualityExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this PreciseEditImageIdeogram45RequestQuality value) - { - return value switch - { - PreciseEditImageIdeogram45RequestQuality.High => "high", - PreciseEditImageIdeogram45RequestQuality.Low => "low", - PreciseEditImageIdeogram45RequestQuality.Medium => "medium", - PreciseEditImageIdeogram45RequestQuality.VeryLow => "very_low", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static PreciseEditImageIdeogram45RequestQuality? ToEnum(string value) - { - return value switch - { - "high" => PreciseEditImageIdeogram45RequestQuality.High, - "low" => PreciseEditImageIdeogram45RequestQuality.Low, - "medium" => PreciseEditImageIdeogram45RequestQuality.Medium, - "very_low" => PreciseEditImageIdeogram45RequestQuality.VeryLow, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PreciseEditImageIdeogram45Response.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PreciseEditImageIdeogram45Response.g.cs index e4857560..a22ad1f1 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.PreciseEditImageIdeogram45Response.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.PreciseEditImageIdeogram45Response.g.cs @@ -8,8 +8,7 @@ namespace Ideogram /// Synchronous requests (the default) include the edited images in `data`.
/// Asynchronous requests omit `data`; poll
/// `GET /v2/generations/{generation_id}` with the returned
- /// `generation_id`.
- /// Example: {"generation_kind":null,"data":[{"seed":12345,"prompt":"prompt","resolution":"1024x1024","url":"https://openapi-generator.tech","is_image_safe":true},{"seed":12345,"prompt":"prompt","resolution":"1024x1024","url":"https://openapi-generator.tech","is_image_safe":true}],"seed":0,"generation_id":"generation_id"} + /// `generation_id`. ///
public sealed partial class PreciseEditImageIdeogram45Response { diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PreciseMaskedEditModel.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PreciseMaskedEditModel.g.cs deleted file mode 100644 index 7b193c93..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.PreciseMaskedEditModel.g.cs +++ /dev/null @@ -1,52 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The model used to apply the edit. For Ideogram 4.5, an optional mask is sent as one of the model's five image inputs and therefore reduces the reference-image limit by one.
- /// Default Value: gpt-image-2 - ///
- public enum PreciseMaskedEditModel - { - /// - /// - /// - GptImage2, - /// - /// - /// - Ideogram45, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class PreciseMaskedEditModelExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this PreciseMaskedEditModel value) - { - return value switch - { - PreciseMaskedEditModel.GptImage2 => "gpt-image-2", - PreciseMaskedEditModel.Ideogram45 => "ideogram-4-5", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static PreciseMaskedEditModel? ToEnum(string value) - { - return value switch - { - "gpt-image-2" => PreciseMaskedEditModel.GptImage2, - "ideogram-4-5" => PreciseMaskedEditModel.Ideogram45, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PreciseMaskedEditQuality.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PreciseMaskedEditQuality.g.cs deleted file mode 100644 index f99961e6..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.PreciseMaskedEditQuality.g.cs +++ /dev/null @@ -1,58 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The quality tier for the edit. Higher tiers may improve detail and
- /// take longer to complete. - ///
- public enum PreciseMaskedEditQuality - { - /// - /// - /// - High, - /// - /// - /// - Low, - /// - /// - /// - Medium, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class PreciseMaskedEditQualityExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this PreciseMaskedEditQuality value) - { - return value switch - { - PreciseMaskedEditQuality.High => "high", - PreciseMaskedEditQuality.Low => "low", - PreciseMaskedEditQuality.Medium => "medium", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static PreciseMaskedEditQuality? ToEnum(string value) - { - return value switch - { - "high" => PreciseMaskedEditQuality.High, - "low" => PreciseMaskedEditQuality.Low, - "medium" => PreciseMaskedEditQuality.Medium, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PreciseMaskedEditRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PreciseMaskedEditRequest.Json.g.cs deleted file mode 100644 index 2bab77f7..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.PreciseMaskedEditRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class PreciseMaskedEditRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.PreciseMaskedEditRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.PreciseMaskedEditRequest), - jsonSerializerContext) as global::Ideogram.PreciseMaskedEditRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.PreciseMaskedEditRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.PreciseMaskedEditRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.PreciseMaskedEditRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.PreciseMaskedEditRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PreciseMaskedEditRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PreciseMaskedEditRequest.g.cs deleted file mode 100644 index 098c338d..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.PreciseMaskedEditRequest.g.cs +++ /dev/null @@ -1,225 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Exactly one source is normally supplied. Use `source_asset_identifier` for an existing asset or multipart `source_image` bytes. When both are present, `source_asset_identifier` takes precedence. - /// - public sealed partial class PreciseMaskedEditRequest - { - /// - /// The model used to apply the masked edit. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("model")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.PreciseMaskedEditModelJsonConverter))] - public global::Ideogram.PreciseMaskedEditModel? Model { get; set; } - - /// - /// The generation quality level. Defaults to `high`.
- /// Default Value: high - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("quality")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.PreciseMaskedEditQualityJsonConverter))] - public global::Ideogram.PreciseMaskedEditQuality? Quality { get; set; } - - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - ///
- /// {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - [global::System.Text.Json.Serialization.JsonPropertyName("source_asset_identifier")] - public global::Ideogram.AssetIdentifier? SourceAssetIdentifier { get; set; } - - /// - /// Raw source image bytes. Supported formats and the 50 MB limit match the image upload API. Available only with `multipart/form-data`. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("source_image")] - public byte[]? SourceImage { get; set; } - - /// - /// Raw source image bytes. Supported formats and the 50 MB limit match the image upload API. Available only with `multipart/form-data`. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("source_imagename")] - public string? SourceImagename { get; set; } - - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - ///
- /// {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - [global::System.Text.Json.Serialization.JsonPropertyName("mask_asset_identifier")] - public global::Ideogram.AssetIdentifier? MaskAssetIdentifier { get; set; } - - /// - /// Optional assets that show the desired appearance of the edit. GPT Image 2 accepts up to 15. Ideogram 4.5 accepts up to 4 without a mask, or 3 when a mask is supplied. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("reference_asset_identifiers")] - public global::System.Collections.Generic.IList? ReferenceAssetIdentifiers { get; set; } - - /// - /// Plain-language description of the desired change. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("instruction")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Instruction { get; set; } - - /// - /// Optional seed for repeatable results. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// Number of edited images to create.
- /// Default Value: 1 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] - public int? NumImages { get; set; } - - /// - /// A collection you can write to, by its URL-safe base64 collection id. Completed outputs are added to it automatically. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("target_collection_id")] - public string? TargetCollectionId { get; set; } - - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// When true, decoded pixels outside the mask are copied from the
- /// source image into the final result. Requires `mask_asset_identifier`.
- /// When false, the final result is the model's full edited image.
- /// Default Value: false - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("preserve_unmasked_pixels")] - public bool? PreserveUnmaskedPixels { get; set; } - - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - ///
- /// https://api.example.com/webhooks/ideogram - [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] - public string? WebhookUrl { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Plain-language description of the desired change. - /// - /// - /// The model used to apply the masked edit. - /// - /// - /// The generation quality level. Defaults to `high`.
- /// Default Value: high - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// Raw source image bytes. Supported formats and the 50 MB limit match the image upload API. Available only with `multipart/form-data`. - /// - /// - /// Raw source image bytes. Supported formats and the 50 MB limit match the image upload API. Available only with `multipart/form-data`. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// Optional assets that show the desired appearance of the edit. GPT Image 2 accepts up to 15. Ideogram 4.5 accepts up to 4 without a mask, or 3 when a mask is supplied. - /// - /// - /// Optional seed for repeatable results. - /// - /// - /// Number of edited images to create.
- /// Default Value: 1 - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. Completed outputs are added to it automatically. - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// When true, decoded pixels outside the mask are copied from the
- /// source image into the final result. Requires `mask_asset_identifier`.
- /// When false, the final result is the model's full edited image.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public PreciseMaskedEditRequest( - string instruction, - global::Ideogram.PreciseMaskedEditModel? model, - global::Ideogram.PreciseMaskedEditQuality? quality, - global::Ideogram.AssetIdentifier? sourceAssetIdentifier, - byte[]? sourceImage, - string? sourceImagename, - global::Ideogram.AssetIdentifier? maskAssetIdentifier, - global::System.Collections.Generic.IList? referenceAssetIdentifiers, - int? seed, - int? numImages, - string? targetCollectionId, - bool? @private, - bool? preserveUnmaskedPixels, - string? webhookUrl) - { - this.Model = model; - this.Quality = quality; - this.SourceAssetIdentifier = sourceAssetIdentifier; - this.SourceImage = sourceImage; - this.SourceImagename = sourceImagename; - this.MaskAssetIdentifier = maskAssetIdentifier; - this.ReferenceAssetIdentifiers = referenceAssetIdentifiers; - this.Instruction = instruction ?? throw new global::System.ArgumentNullException(nameof(instruction)); - this.Seed = seed; - this.NumImages = numImages; - this.TargetCollectionId = targetCollectionId; - this.Private = @private; - this.PreserveUnmaskedPixels = preserveUnmaskedPixels; - this.WebhookUrl = webhookUrl; - } - - /// - /// Initializes a new instance of the class. - /// - public PreciseMaskedEditRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PreciseMaskedEditResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PreciseMaskedEditResponse.Json.g.cs deleted file mode 100644 index a600ab9f..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.PreciseMaskedEditResponse.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class PreciseMaskedEditResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.PreciseMaskedEditResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.PreciseMaskedEditResponse), - jsonSerializerContext) as global::Ideogram.PreciseMaskedEditResponse; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.PreciseMaskedEditResponse? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.PreciseMaskedEditResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.PreciseMaskedEditResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.PreciseMaskedEditResponse; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PreciseMaskedEditResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PreciseMaskedEditResponse.g.cs deleted file mode 100644 index 92ad00aa..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.PreciseMaskedEditResponse.g.cs +++ /dev/null @@ -1,48 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Acknowledgement that the workflow was accepted.
- /// Example: {"generation_id":"generation_id"} - ///
- public sealed partial class PreciseMaskedEditResponse - { - /// - /// URL-safe base64 ID accepted by the generation polling endpoint. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("generation_id")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string GenerationId { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// URL-safe base64 ID accepted by the generation polling endpoint. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public PreciseMaskedEditResponse( - string generationId) - { - this.GenerationId = generationId ?? throw new global::System.ArgumentNullException(nameof(generationId)); - } - - /// - /// Initializes a new instance of the class. - /// - public PreciseMaskedEditResponse() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.Price.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.Price.Json.g.cs deleted file mode 100644 index 7be0e872..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.Price.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class Price - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.Price? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.Price), - jsonSerializerContext) as global::Ideogram.Price; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.Price? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.Price? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.Price), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.Price; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.Price.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.Price.g.cs deleted file mode 100644 index 7daecb71..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.Price.g.cs +++ /dev/null @@ -1,66 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Represents a price.
- /// Example: {"amount":1050,"currency_code":"USD"} - ///
- public sealed partial class Price - { - /// - /// The ISO 4217 currency code for the price object.
- /// Example: USD - ///
- /// USD - [global::System.Text.Json.Serialization.JsonPropertyName("currency_code")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string CurrencyCode { get; set; } - - /// - /// The amount of the currency in the common denomination. For example, in USD this is cents.
- /// Example: 1050 - ///
- /// 1050 - [global::System.Text.Json.Serialization.JsonPropertyName("amount")] - [global::System.Text.Json.Serialization.JsonRequired] - public required double Amount { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The ISO 4217 currency code for the price object.
- /// Example: USD - /// - /// - /// The amount of the currency in the common denomination. For example, in USD this is cents.
- /// Example: 1050 - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public Price( - string currencyCode, - double amount) - { - this.CurrencyCode = currencyCode ?? throw new global::System.ArgumentNullException(nameof(currencyCode)); - this.Amount = amount; - } - - /// - /// Initializes a new instance of the class. - /// - public Price() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PriceQualifier.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PriceQualifier.g.cs deleted file mode 100644 index 4261e75e..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.PriceQualifier.g.cs +++ /dev/null @@ -1,53 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Whether a quoted price is what the request would bill (`exact`) or a
- /// computed estimate for a product priced from provider cost after
- /// inference (`estimate`). - ///
- public enum PriceQualifier - { - /// - /// - /// - Estimate, - /// - /// - /// - Exact, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class PriceQualifierExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this PriceQualifier value) - { - return value switch - { - PriceQualifier.Estimate => "estimate", - PriceQualifier.Exact => "exact", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static PriceQualifier? ToEnum(string value) - { - return value switch - { - "estimate" => PriceQualifier.Estimate, - "exact" => PriceQualifier.Exact, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PriceQuote.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PriceQuote.Json.g.cs deleted file mode 100644 index 63307019..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.PriceQuote.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class PriceQuote - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.PriceQuote? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.PriceQuote), - jsonSerializerContext) as global::Ideogram.PriceQuote; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.PriceQuote? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.PriceQuote? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.PriceQuote), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.PriceQuote; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PriceQuote.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PriceQuote.g.cs deleted file mode 100644 index 16f635b3..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.PriceQuote.g.cs +++ /dev/null @@ -1,146 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The price a request would cost, returned in place of the endpoint's
- /// usual response when `dry_run=true`. Money is in millionths of a US
- /// dollar and credits in thousandths of a credit, so a quote can be
- /// compared against `usage_cost_usd_micros` and credit balances without
- /// rounding. - ///
- public sealed partial class PriceQuote - { - /// - /// Always "price_quote". - /// - [global::System.Text.Json.Serialization.JsonPropertyName("object")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.PriceQuoteObjectJsonConverter))] - public global::Ideogram.PriceQuoteObject Object { get; set; } - - /// - /// The catalog product the request would bill.
- /// Example: ideogram_v3_generation - ///
- /// ideogram_v3_generation - [global::System.Text.Json.Serialization.JsonPropertyName("billing_identifier")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string BillingIdentifier { get; set; } - - /// - /// Billable units the request would consume, usually the image count.
- /// Example: 2 - ///
- /// 2 - [global::System.Text.Json.Serialization.JsonPropertyName("quantity")] - [global::System.Text.Json.Serialization.JsonRequired] - public required int Quantity { get; set; } - - /// - /// The price in millionths of a US dollar.
- /// Example: 60000 - ///
- /// 60000 - [global::System.Text.Json.Serialization.JsonPropertyName("usd_micros")] - [global::System.Text.Json.Serialization.JsonRequired] - public required long UsdMicros { get; set; } - - /// - /// The credit charge for callers funded from credits, in thousandths
- /// of a credit at the caller's own credit rate.
- /// Example: 3000 - ///
- /// 3000 - [global::System.Text.Json.Serialization.JsonPropertyName("credit_millis")] - [global::System.Text.Json.Serialization.JsonRequired] - public required long CreditMillis { get; set; } - - /// - /// Whether a quoted price is what the request would bill (`exact`) or a
- /// computed estimate for a product priced from provider cost after
- /// inference (`estimate`). - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("qualifier")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.PriceQualifierJsonConverter))] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.PriceQualifier Qualifier { get; set; } - - /// - /// The most the request can cost, in millionths of a US dollar.
- /// Present only on estimates.
- /// Example: 84000 - ///
- /// 84000 - [global::System.Text.Json.Serialization.JsonPropertyName("upper_bound_usd_micros")] - public long? UpperBoundUsdMicros { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The catalog product the request would bill.
- /// Example: ideogram_v3_generation - /// - /// - /// Billable units the request would consume, usually the image count.
- /// Example: 2 - /// - /// - /// The price in millionths of a US dollar.
- /// Example: 60000 - /// - /// - /// The credit charge for callers funded from credits, in thousandths
- /// of a credit at the caller's own credit rate.
- /// Example: 3000 - /// - /// - /// Whether a quoted price is what the request would bill (`exact`) or a
- /// computed estimate for a product priced from provider cost after
- /// inference (`estimate`). - /// - /// - /// Always "price_quote". - /// - /// - /// The most the request can cost, in millionths of a US dollar.
- /// Present only on estimates.
- /// Example: 84000 - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public PriceQuote( - string billingIdentifier, - int quantity, - long usdMicros, - long creditMillis, - global::Ideogram.PriceQualifier qualifier, - global::Ideogram.PriceQuoteObject @object, - long? upperBoundUsdMicros) - { - this.Object = @object; - this.BillingIdentifier = billingIdentifier ?? throw new global::System.ArgumentNullException(nameof(billingIdentifier)); - this.Quantity = quantity; - this.UsdMicros = usdMicros; - this.CreditMillis = creditMillis; - this.Qualifier = qualifier; - this.UpperBoundUsdMicros = upperBoundUsdMicros; - } - - /// - /// Initializes a new instance of the class. - /// - public PriceQuote() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PriceQuoteObject.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PriceQuoteObject.g.cs deleted file mode 100644 index b9b84f82..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.PriceQuoteObject.g.cs +++ /dev/null @@ -1,45 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Always "price_quote". - /// - public enum PriceQuoteObject - { - /// - /// - /// - PriceQuote, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class PriceQuoteObjectExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this PriceQuoteObject value) - { - return value switch - { - PriceQuoteObject.PriceQuote => "price_quote", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static PriceQuoteObject? ToEnum(string value) - { - return value switch - { - "price_quote" => PriceQuoteObject.PriceQuote, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.Product360VideoDirection.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.Product360VideoDirection.g.cs deleted file mode 100644 index c775314c..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.Product360VideoDirection.g.cs +++ /dev/null @@ -1,51 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Direction the product rotates around its vertical axis. - /// - public enum Product360VideoDirection - { - /// - /// - /// - Clockwise, - /// - /// - /// - CounterClockwise, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class Product360VideoDirectionExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this Product360VideoDirection value) - { - return value switch - { - Product360VideoDirection.Clockwise => "clockwise", - Product360VideoDirection.CounterClockwise => "counter-clockwise", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static Product360VideoDirection? ToEnum(string value) - { - return value switch - { - "clockwise" => Product360VideoDirection.Clockwise, - "counter-clockwise" => Product360VideoDirection.CounterClockwise, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.Product360VideoRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.Product360VideoRequest.Json.g.cs deleted file mode 100644 index 6cab041a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.Product360VideoRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class Product360VideoRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.Product360VideoRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.Product360VideoRequest), - jsonSerializerContext) as global::Ideogram.Product360VideoRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.Product360VideoRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.Product360VideoRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.Product360VideoRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.Product360VideoRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.Product360VideoRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.Product360VideoRequest.g.cs deleted file mode 100644 index 4ce2e410..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.Product360VideoRequest.g.cs +++ /dev/null @@ -1,115 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"duration":5,"target_collection_id":"target_collection_id","image_asset_identifier":{"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"},"product_description":"product_description","resolution":null,"direction":null} - /// - public sealed partial class Product360VideoRequest - { - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - ///
- /// {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - [global::System.Text.Json.Serialization.JsonPropertyName("image_asset_identifier")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.AssetIdentifier ImageAssetIdentifier { get; set; } - - /// - /// Direction the product rotates around its vertical axis. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("direction")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.Product360VideoDirectionJsonConverter))] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.Product360VideoDirection Direction { get; set; } - - /// - /// Optional factual description of the product in the source image. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("product_description")] - public string? ProductDescription { get; set; } - - /// - /// The resolution tier of the generated video.
- /// Default Value: 720p - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.SeedDance25ResolutionJsonConverter))] - public global::Ideogram.SeedDance25Resolution? Resolution { get; set; } - - /// - /// The length of the generated video in seconds. When omitted, the model
- /// picks the best duration for the prompt ("auto").
- /// Example: 5 - ///
- /// 5 - [global::System.Text.Json.Serialization.JsonPropertyName("duration")] - public int? Duration { get; set; } - - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output video is added to it when the request completes. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("target_collection_id")] - public string? TargetCollectionId { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// Direction the product rotates around its vertical axis. - /// - /// - /// Optional factual description of the product in the source image. - /// - /// - /// The resolution tier of the generated video.
- /// Default Value: 720p - /// - /// - /// The length of the generated video in seconds. When omitted, the model
- /// picks the best duration for the prompt ("auto").
- /// Example: 5 - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output video is added to it when the request completes. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public Product360VideoRequest( - global::Ideogram.AssetIdentifier imageAssetIdentifier, - global::Ideogram.Product360VideoDirection direction, - string? productDescription, - global::Ideogram.SeedDance25Resolution? resolution, - int? duration, - string? targetCollectionId) - { - this.ImageAssetIdentifier = imageAssetIdentifier ?? throw new global::System.ArgumentNullException(nameof(imageAssetIdentifier)); - this.Direction = direction; - this.ProductDescription = productDescription; - this.Resolution = resolution; - this.Duration = duration; - this.TargetCollectionId = targetCollectionId; - } - - /// - /// Initializes a new instance of the class. - /// - public Product360VideoRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PromoteOrganizationAdminsRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PromoteOrganizationAdminsRequest.Json.g.cs deleted file mode 100644 index b4dbf31b..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.PromoteOrganizationAdminsRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class PromoteOrganizationAdminsRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.PromoteOrganizationAdminsRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.PromoteOrganizationAdminsRequest), - jsonSerializerContext) as global::Ideogram.PromoteOrganizationAdminsRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.PromoteOrganizationAdminsRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.PromoteOrganizationAdminsRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.PromoteOrganizationAdminsRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.PromoteOrganizationAdminsRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PromoteOrganizationAdminsRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PromoteOrganizationAdminsRequest.g.cs deleted file mode 100644 index c0324e87..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.PromoteOrganizationAdminsRequest.g.cs +++ /dev/null @@ -1,49 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"members":[{"display_handle":"john_doe","email_address":"john.doe@example.com","user_id":"dXNlcl8xMjM"},{"display_handle":"john_doe","email_address":"john.doe@example.com","user_id":"dXNlcl8xMjM"}]} - /// - public sealed partial class PromoteOrganizationAdminsRequest - { - /// - /// List of organization members to promote to ADMIN role
- /// Default Value: [] - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("members")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList Members { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// List of organization members to promote to ADMIN role
- /// Default Value: [] - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public PromoteOrganizationAdminsRequest( - global::System.Collections.Generic.IList members) - { - this.Members = members ?? throw new global::System.ArgumentNullException(nameof(members)); - } - - /// - /// Initializes a new instance of the class. - /// - public PromoteOrganizationAdminsRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ProvenanceVerifyRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ProvenanceVerifyRequest.Json.g.cs deleted file mode 100644 index 9dd691ba..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ProvenanceVerifyRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class ProvenanceVerifyRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.ProvenanceVerifyRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.ProvenanceVerifyRequest), - jsonSerializerContext) as global::Ideogram.ProvenanceVerifyRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.ProvenanceVerifyRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.ProvenanceVerifyRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.ProvenanceVerifyRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ProvenanceVerifyRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ProvenanceVerifyRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ProvenanceVerifyRequest.g.cs deleted file mode 100644 index 230ade01..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ProvenanceVerifyRequest.g.cs +++ /dev/null @@ -1,59 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - public sealed partial class ProvenanceVerifyRequest - { - /// - /// The image file to verify. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("content")] - [global::System.Text.Json.Serialization.JsonRequired] - public required byte[] Content { get; set; } - - /// - /// The image file to verify. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("contentname")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Contentname { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The image file to verify. - /// - /// - /// The image file to verify. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ProvenanceVerifyRequest( - byte[] content, - string contentname) - { - this.Content = content ?? throw new global::System.ArgumentNullException(nameof(content)); - this.Contentname = contentname ?? throw new global::System.ArgumentNullException(nameof(contentname)); - } - - /// - /// Initializes a new instance of the class. - /// - public ProvenanceVerifyRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ProvenanceVerifyResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ProvenanceVerifyResponse.Json.g.cs deleted file mode 100644 index 3f68930e..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ProvenanceVerifyResponse.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class ProvenanceVerifyResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.ProvenanceVerifyResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.ProvenanceVerifyResponse), - jsonSerializerContext) as global::Ideogram.ProvenanceVerifyResponse; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.ProvenanceVerifyResponse? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.ProvenanceVerifyResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.ProvenanceVerifyResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ProvenanceVerifyResponse; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ProvenanceVerifyResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ProvenanceVerifyResponse.g.cs deleted file mode 100644 index 2551d963..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ProvenanceVerifyResponse.g.cs +++ /dev/null @@ -1,107 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"validation_state":"TRUSTED","provider":"provider","generation_id":"generation_id","system_version":"system_version","provenance_detected":true,"created_at":"created_at"} - /// - public sealed partial class ProvenanceVerifyResponse - { - /// - /// Whether an Ideogram provenance manifest was found in the content. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("provenance_detected")] - [global::System.Text.Json.Serialization.JsonRequired] - public required bool ProvenanceDetected { get; set; } - - /// - /// Validation outcome for the detected manifest. `VALID` and `TRUSTED`
- /// both mean the content is unmodified since it was signed; `INVALID`
- /// means the content or its manifest was altered after signing. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("validation_state")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ProvenanceVerifyResponseValidationStateJsonConverter))] - public global::Ideogram.ProvenanceVerifyResponseValidationState? ValidationState { get; set; } - - /// - /// Name of the provider that created the content. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("provider")] - public string? Provider { get; set; } - - /// - /// Version of the generation system that created the content. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("system_version")] - public string? SystemVersion { get; set; } - - /// - /// Creation time of the content, as an ISO 8601 timestamp. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("created_at")] - public string? CreatedAt { get; set; } - - /// - /// Unique identifier of the generation, as a base64 URL-safe string. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("generation_id")] - public string? GenerationId { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Whether an Ideogram provenance manifest was found in the content. - /// - /// - /// Validation outcome for the detected manifest. `VALID` and `TRUSTED`
- /// both mean the content is unmodified since it was signed; `INVALID`
- /// means the content or its manifest was altered after signing. - /// - /// - /// Name of the provider that created the content. - /// - /// - /// Version of the generation system that created the content. - /// - /// - /// Creation time of the content, as an ISO 8601 timestamp. - /// - /// - /// Unique identifier of the generation, as a base64 URL-safe string. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ProvenanceVerifyResponse( - bool provenanceDetected, - global::Ideogram.ProvenanceVerifyResponseValidationState? validationState, - string? provider, - string? systemVersion, - string? createdAt, - string? generationId) - { - this.ProvenanceDetected = provenanceDetected; - this.ValidationState = validationState; - this.Provider = provider; - this.SystemVersion = systemVersion; - this.CreatedAt = createdAt; - this.GenerationId = generationId; - } - - /// - /// Initializes a new instance of the class. - /// - public ProvenanceVerifyResponse() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ProvenanceVerifyResponseValidationState.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ProvenanceVerifyResponseValidationState.g.cs deleted file mode 100644 index d05b4eca..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ProvenanceVerifyResponseValidationState.g.cs +++ /dev/null @@ -1,59 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Validation outcome for the detected manifest. `VALID` and `TRUSTED`
- /// both mean the content is unmodified since it was signed; `INVALID`
- /// means the content or its manifest was altered after signing. - ///
- public enum ProvenanceVerifyResponseValidationState - { - /// - /// - /// - Invalid, - /// - /// - /// - Trusted, - /// - /// - /// - Valid, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class ProvenanceVerifyResponseValidationStateExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this ProvenanceVerifyResponseValidationState value) - { - return value switch - { - ProvenanceVerifyResponseValidationState.Invalid => "INVALID", - ProvenanceVerifyResponseValidationState.Trusted => "TRUSTED", - ProvenanceVerifyResponseValidationState.Valid => "VALID", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static ProvenanceVerifyResponseValidationState? ToEnum(string value) - { - return value switch - { - "INVALID" => ProvenanceVerifyResponseValidationState.Invalid, - "TRUSTED" => ProvenanceVerifyResponseValidationState.Trusted, - "VALID" => ProvenanceVerifyResponseValidationState.Valid, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PublishMiniAppPreviewRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PublishMiniAppPreviewRequest.Json.g.cs deleted file mode 100644 index e8e0e417..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.PublishMiniAppPreviewRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class PublishMiniAppPreviewRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.PublishMiniAppPreviewRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.PublishMiniAppPreviewRequest), - jsonSerializerContext) as global::Ideogram.PublishMiniAppPreviewRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.PublishMiniAppPreviewRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.PublishMiniAppPreviewRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.PublishMiniAppPreviewRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.PublishMiniAppPreviewRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PublishMiniAppPreviewRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PublishMiniAppPreviewRequest.g.cs deleted file mode 100644 index b607216c..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.PublishMiniAppPreviewRequest.g.cs +++ /dev/null @@ -1,162 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The mini-app preview entry to publish. Supply `slug` when the preview is a build of a catalog app so that work created through the preview is credited to that app; omit it for a preview of an app that is not in the catalog.
- /// Example: {"accepts_image_input":true,"deployment_time":"2000-01-23T04:56:07\u002B00:00","website":{"key":""},"preview_id":"preview_id","deployment_url":"deployment_url","deployment_commit":"deployment_commit","description":"description","label":"label","embed":"iframe","scopes":["scopes","scopes"],"slug":"slug"} - ///
- public sealed partial class PublishMiniAppPreviewRequest - { - /// - /// Unique, URL-safe preview identifier composed by the deploy pipeline. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("preview_id")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string PreviewId { get; set; } - - /// - /// Unique, stable, URL-safe mini-app identifier. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("slug")] - public string? Slug { get; set; } - - /// - /// Human-readable display name shown for the preview. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("label")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Label { get; set; } - - /// - /// Short description of what the mini-app does. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("description")] - public string? Description { get; set; } - - /// - /// How the mini-app is embedded. `iframe` loads the app in a sandboxed frame. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("embed")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.PublishMiniAppPreviewRequestEmbedJsonConverter))] - public global::Ideogram.PublishMiniAppPreviewRequestEmbed Embed { get; set; } - - /// - /// Permission scopes the mini-app preview requests. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("scopes")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList Scopes { get; set; } - - /// - /// Optional on publish. Whether the app can receive an existing image as its initial input. Omit this field to preserve the current value when re-publishing an existing preview; new previews default to false. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("accepts_image_input")] - public bool? AcceptsImageInput { get; set; } - - /// - /// URL where the preview mini-app is served. Must be an `https://*.run.app` Cloud Run URL. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("deployment_url")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string DeploymentUrl { get; set; } - - /// - /// Source commit hash of the deployed build. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("deployment_commit")] - public string? DeploymentCommit { get; set; } - - /// - /// When the deployment that produced this build completed. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("deployment_time")] - public global::System.DateTime? DeploymentTime { get; set; } - - /// - /// Structured website metadata for the mini-app. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("website")] - public object? Website { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Unique, URL-safe preview identifier composed by the deploy pipeline. - /// - /// - /// Human-readable display name shown for the preview. - /// - /// - /// Permission scopes the mini-app preview requests. - /// - /// - /// URL where the preview mini-app is served. Must be an `https://*.run.app` Cloud Run URL. - /// - /// - /// Unique, stable, URL-safe mini-app identifier. - /// - /// - /// Short description of what the mini-app does. - /// - /// - /// How the mini-app is embedded. `iframe` loads the app in a sandboxed frame. - /// - /// - /// Optional on publish. Whether the app can receive an existing image as its initial input. Omit this field to preserve the current value when re-publishing an existing preview; new previews default to false. - /// - /// - /// Source commit hash of the deployed build. - /// - /// - /// When the deployment that produced this build completed. - /// - /// - /// Structured website metadata for the mini-app. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public PublishMiniAppPreviewRequest( - string previewId, - string label, - global::System.Collections.Generic.IList scopes, - string deploymentUrl, - string? slug, - string? description, - global::Ideogram.PublishMiniAppPreviewRequestEmbed embed, - bool? acceptsImageInput, - string? deploymentCommit, - global::System.DateTime? deploymentTime, - object? website) - { - this.PreviewId = previewId ?? throw new global::System.ArgumentNullException(nameof(previewId)); - this.Slug = slug; - this.Label = label ?? throw new global::System.ArgumentNullException(nameof(label)); - this.Description = description; - this.Embed = embed; - this.Scopes = scopes ?? throw new global::System.ArgumentNullException(nameof(scopes)); - this.AcceptsImageInput = acceptsImageInput; - this.DeploymentUrl = deploymentUrl ?? throw new global::System.ArgumentNullException(nameof(deploymentUrl)); - this.DeploymentCommit = deploymentCommit; - this.DeploymentTime = deploymentTime; - this.Website = website; - } - - /// - /// Initializes a new instance of the class. - /// - public PublishMiniAppPreviewRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PublishMiniAppPreviewRequestEmbed.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PublishMiniAppPreviewRequestEmbed.g.cs deleted file mode 100644 index 90e50c70..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.PublishMiniAppPreviewRequestEmbed.g.cs +++ /dev/null @@ -1,45 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// How the mini-app is embedded. `iframe` loads the app in a sandboxed frame. - /// - public enum PublishMiniAppPreviewRequestEmbed - { - /// - /// - /// - Iframe, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class PublishMiniAppPreviewRequestEmbedExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this PublishMiniAppPreviewRequestEmbed value) - { - return value switch - { - PublishMiniAppPreviewRequestEmbed.Iframe => "iframe", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static PublishMiniAppPreviewRequestEmbed? ToEnum(string value) - { - return value switch - { - "iframe" => PublishMiniAppPreviewRequestEmbed.Iframe, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PublishMiniAppPreviewRequestWebsite.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PublishMiniAppPreviewRequestWebsite.Json.g.cs deleted file mode 100644 index 5e50e597..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.PublishMiniAppPreviewRequestWebsite.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class PublishMiniAppPreviewRequestWebsite - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.PublishMiniAppPreviewRequestWebsite? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.PublishMiniAppPreviewRequestWebsite), - jsonSerializerContext) as global::Ideogram.PublishMiniAppPreviewRequestWebsite; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.PublishMiniAppPreviewRequestWebsite? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.PublishMiniAppPreviewRequestWebsite? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.PublishMiniAppPreviewRequestWebsite), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.PublishMiniAppPreviewRequestWebsite; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PublishMiniAppPreviewRequestWebsite.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PublishMiniAppPreviewRequestWebsite.g.cs deleted file mode 100644 index 755b6f13..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.PublishMiniAppPreviewRequestWebsite.g.cs +++ /dev/null @@ -1,19 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Structured website metadata for the mini-app. - /// - public sealed partial class PublishMiniAppPreviewRequestWebsite - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PublishMiniAppPreviewResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PublishMiniAppPreviewResponse.Json.g.cs deleted file mode 100644 index 2d721f67..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.PublishMiniAppPreviewResponse.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class PublishMiniAppPreviewResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.PublishMiniAppPreviewResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.PublishMiniAppPreviewResponse), - jsonSerializerContext) as global::Ideogram.PublishMiniAppPreviewResponse; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.PublishMiniAppPreviewResponse? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.PublishMiniAppPreviewResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.PublishMiniAppPreviewResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.PublishMiniAppPreviewResponse; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PublishMiniAppPreviewResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PublishMiniAppPreviewResponse.g.cs deleted file mode 100644 index f7a41679..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.PublishMiniAppPreviewResponse.g.cs +++ /dev/null @@ -1,48 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Confirmation of a published mini-app preview entry.
- /// Example: {"preview_id":"preview_id"} - ///
- public sealed partial class PublishMiniAppPreviewResponse - { - /// - /// Unique, URL-safe preview identifier composed by the deploy pipeline. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("preview_id")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string PreviewId { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Unique, URL-safe preview identifier composed by the deploy pipeline. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public PublishMiniAppPreviewResponse( - string previewId) - { - this.PreviewId = previewId ?? throw new global::System.ArgumentNullException(nameof(previewId)); - } - - /// - /// Initializes a new instance of the class. - /// - public PublishMiniAppPreviewResponse() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PublishMiniAppRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PublishMiniAppRequest.Json.g.cs deleted file mode 100644 index ad312e3e..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.PublishMiniAppRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class PublishMiniAppRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.PublishMiniAppRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.PublishMiniAppRequest), - jsonSerializerContext) as global::Ideogram.PublishMiniAppRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.PublishMiniAppRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.PublishMiniAppRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.PublishMiniAppRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.PublishMiniAppRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PublishMiniAppRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PublishMiniAppRequest.g.cs deleted file mode 100644 index 3b14d5c3..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.PublishMiniAppRequest.g.cs +++ /dev/null @@ -1,150 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The mini-app catalog entry to publish. Artwork initializes a new app; re-publishing an existing slug preserves its current artwork. Optional nullable fields preserve their current values when omitted or null.
- /// Example: {"accepts_image_input":true,"deployment_time":"2000-01-23T04:56:07\u002B00:00","website":{"key":""},"deployment_url":"https://openapi-generator.tech","deployment_commit":"deployment_commit","description":"description","label":"label","embed":"iframe","scopes":["scopes","scopes"],"slug":"slug"} - ///
- public sealed partial class PublishMiniAppRequest - { - /// - /// Unique, stable, URL-safe mini-app identifier. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("slug")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Slug { get; set; } - - /// - /// Human-readable display name shown in the catalog. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("label")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Label { get; set; } - - /// - /// Short description of what the mini-app does. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("description")] - public string? Description { get; set; } - - /// - /// How the mini-app is embedded. `iframe` loads the app in a sandboxed frame. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("embed")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.PublishMiniAppRequestEmbedJsonConverter))] - public global::Ideogram.PublishMiniAppRequestEmbed Embed { get; set; } - - /// - /// Permission scopes the mini-app requests. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("scopes")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList Scopes { get; set; } - - /// - /// Optional on publish. Whether the app can receive an existing image as its initial input. Omit this field to preserve the current value when re-publishing an existing app; new apps default to false. Catalog responses always include the resolved boolean. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("accepts_image_input")] - public bool? AcceptsImageInput { get; set; } - - /// - /// Absolute HTTPS URL where the deployed mini-app is served from. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("deployment_url")] - public string? DeploymentUrl { get; set; } - - /// - /// Source commit hash of the deployed build. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("deployment_commit")] - public string? DeploymentCommit { get; set; } - - /// - /// When the deployment that produced this build completed. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("deployment_time")] - public global::System.DateTime? DeploymentTime { get; set; } - - /// - /// Structured website metadata for the mini-app. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("website")] - public object? Website { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Unique, stable, URL-safe mini-app identifier. - /// - /// - /// Human-readable display name shown in the catalog. - /// - /// - /// Permission scopes the mini-app requests. - /// - /// - /// Short description of what the mini-app does. - /// - /// - /// How the mini-app is embedded. `iframe` loads the app in a sandboxed frame. - /// - /// - /// Optional on publish. Whether the app can receive an existing image as its initial input. Omit this field to preserve the current value when re-publishing an existing app; new apps default to false. Catalog responses always include the resolved boolean. - /// - /// - /// Absolute HTTPS URL where the deployed mini-app is served from. - /// - /// - /// Source commit hash of the deployed build. - /// - /// - /// When the deployment that produced this build completed. - /// - /// - /// Structured website metadata for the mini-app. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public PublishMiniAppRequest( - string slug, - string label, - global::System.Collections.Generic.IList scopes, - string? description, - global::Ideogram.PublishMiniAppRequestEmbed embed, - bool? acceptsImageInput, - string? deploymentUrl, - string? deploymentCommit, - global::System.DateTime? deploymentTime, - object? website) - { - this.Slug = slug ?? throw new global::System.ArgumentNullException(nameof(slug)); - this.Label = label ?? throw new global::System.ArgumentNullException(nameof(label)); - this.Description = description; - this.Embed = embed; - this.Scopes = scopes ?? throw new global::System.ArgumentNullException(nameof(scopes)); - this.AcceptsImageInput = acceptsImageInput; - this.DeploymentUrl = deploymentUrl; - this.DeploymentCommit = deploymentCommit; - this.DeploymentTime = deploymentTime; - this.Website = website; - } - - /// - /// Initializes a new instance of the class. - /// - public PublishMiniAppRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PublishMiniAppRequestEmbed.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PublishMiniAppRequestEmbed.g.cs deleted file mode 100644 index a50ba644..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.PublishMiniAppRequestEmbed.g.cs +++ /dev/null @@ -1,45 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// How the mini-app is embedded. `iframe` loads the app in a sandboxed frame. - /// - public enum PublishMiniAppRequestEmbed - { - /// - /// - /// - Iframe, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class PublishMiniAppRequestEmbedExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this PublishMiniAppRequestEmbed value) - { - return value switch - { - PublishMiniAppRequestEmbed.Iframe => "iframe", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static PublishMiniAppRequestEmbed? ToEnum(string value) - { - return value switch - { - "iframe" => PublishMiniAppRequestEmbed.Iframe, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PublishMiniAppRequestWebsite.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PublishMiniAppRequestWebsite.Json.g.cs deleted file mode 100644 index 1f23a627..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.PublishMiniAppRequestWebsite.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class PublishMiniAppRequestWebsite - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.PublishMiniAppRequestWebsite? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.PublishMiniAppRequestWebsite), - jsonSerializerContext) as global::Ideogram.PublishMiniAppRequestWebsite; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.PublishMiniAppRequestWebsite? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.PublishMiniAppRequestWebsite? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.PublishMiniAppRequestWebsite), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.PublishMiniAppRequestWebsite; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PublishMiniAppRequestWebsite.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PublishMiniAppRequestWebsite.g.cs deleted file mode 100644 index 5e9be81b..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.PublishMiniAppRequestWebsite.g.cs +++ /dev/null @@ -1,19 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Structured website metadata for the mini-app. - /// - public sealed partial class PublishMiniAppRequestWebsite - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PublishMiniAppResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PublishMiniAppResponse.Json.g.cs deleted file mode 100644 index 336240ce..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.PublishMiniAppResponse.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class PublishMiniAppResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.PublishMiniAppResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.PublishMiniAppResponse), - jsonSerializerContext) as global::Ideogram.PublishMiniAppResponse; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.PublishMiniAppResponse? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.PublishMiniAppResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.PublishMiniAppResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.PublishMiniAppResponse; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PublishMiniAppResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PublishMiniAppResponse.g.cs deleted file mode 100644 index 2a597a88..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.PublishMiniAppResponse.g.cs +++ /dev/null @@ -1,84 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Confirmation of a published mini-app catalog entry.
- /// Example: {"archived":true,"mini_app_id":"mini_app_id","requires_membership":true,"slug":"slug"} - ///
- public sealed partial class PublishMiniAppResponse - { - /// - /// Unique identifier of the published mini-app. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("mini_app_id")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string MiniAppId { get; set; } - - /// - /// Unique, stable, URL-safe mini-app identifier. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("slug")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Slug { get; set; } - - /// - /// Whether the mini-app requires a membership to access. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("requires_membership")] - [global::System.Text.Json.Serialization.JsonRequired] - public required bool RequiresMembership { get; set; } - - /// - /// Whether the mini-app is currently archived (hidden from the catalog). - /// - [global::System.Text.Json.Serialization.JsonPropertyName("archived")] - [global::System.Text.Json.Serialization.JsonRequired] - public required bool Archived { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Unique identifier of the published mini-app. - /// - /// - /// Unique, stable, URL-safe mini-app identifier. - /// - /// - /// Whether the mini-app requires a membership to access. - /// - /// - /// Whether the mini-app is currently archived (hidden from the catalog). - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public PublishMiniAppResponse( - string miniAppId, - string slug, - bool requiresMembership, - bool archived) - { - this.MiniAppId = miniAppId ?? throw new global::System.ArgumentNullException(nameof(miniAppId)); - this.Slug = slug ?? throw new global::System.ArgumentNullException(nameof(slug)); - this.RequiresMembership = requiresMembership; - this.Archived = archived; - } - - /// - /// Initializes a new instance of the class. - /// - public PublishMiniAppResponse() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.Quality.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.Quality.g.cs deleted file mode 100644 index aee786ff..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.Quality.g.cs +++ /dev/null @@ -1,71 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The generation quality level. Higher levels may use more inference steps
- /// or additional prompt processing. `VERY_HIGH` has noticeably higher latency
- /// and cost than the other levels. - ///
- public enum Quality - { - /// - /// - /// - High, - /// - /// - /// - Low, - /// - /// - /// - Medium, - /// - /// - /// - VeryHigh, - /// - /// - /// - VeryLow, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class QualityExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this Quality value) - { - return value switch - { - Quality.High => "HIGH", - Quality.Low => "LOW", - Quality.Medium => "MEDIUM", - Quality.VeryHigh => "VERY_HIGH", - Quality.VeryLow => "VERY_LOW", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static Quality? ToEnum(string value) - { - return value switch - { - "HIGH" => Quality.High, - "LOW" => Quality.Low, - "MEDIUM" => Quality.Medium, - "VERY_HIGH" => Quality.VeryHigh, - "VERY_LOW" => Quality.VeryLow, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.RechargeSettings.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.RechargeSettings.Json.g.cs deleted file mode 100644 index 53da7762..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.RechargeSettings.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class RechargeSettings - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.RechargeSettings? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.RechargeSettings), - jsonSerializerContext) as global::Ideogram.RechargeSettings; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.RechargeSettings? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.RechargeSettings? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.RechargeSettings), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.RechargeSettings; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.RechargeSettings.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.RechargeSettings.g.cs deleted file mode 100644 index f8d51c88..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.RechargeSettings.g.cs +++ /dev/null @@ -1,66 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The current recharge settings for the API subscription.
- /// Example: {"minimum_balance_threshold":{"amount":1050,"currency_code":"USD"},"top_up_balance":{"amount":1050,"currency_code":"USD"}} - ///
- public sealed partial class RechargeSettings - { - /// - /// Represents a price.
- /// Example: {"amount":1050,"currency_code":"USD"} - ///
- /// {"amount":1050,"currency_code":"USD"} - [global::System.Text.Json.Serialization.JsonPropertyName("top_up_balance")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.Price TopUpBalance { get; set; } - - /// - /// Represents a price.
- /// Example: {"amount":1050,"currency_code":"USD"} - ///
- /// {"amount":1050,"currency_code":"USD"} - [global::System.Text.Json.Serialization.JsonPropertyName("minimum_balance_threshold")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.Price MinimumBalanceThreshold { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Represents a price.
- /// Example: {"amount":1050,"currency_code":"USD"} - /// - /// - /// Represents a price.
- /// Example: {"amount":1050,"currency_code":"USD"} - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public RechargeSettings( - global::Ideogram.Price topUpBalance, - global::Ideogram.Price minimumBalanceThreshold) - { - this.TopUpBalance = topUpBalance ?? throw new global::System.ArgumentNullException(nameof(topUpBalance)); - this.MinimumBalanceThreshold = minimumBalanceThreshold ?? throw new global::System.ArgumentNullException(nameof(minimumBalanceThreshold)); - } - - /// - /// Initializes a new instance of the class. - /// - public RechargeSettings() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.RechargeSettingsResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.RechargeSettingsResponse.Json.g.cs deleted file mode 100644 index 1a9ef933..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.RechargeSettingsResponse.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class RechargeSettingsResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.RechargeSettingsResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.RechargeSettingsResponse), - jsonSerializerContext) as global::Ideogram.RechargeSettingsResponse; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.RechargeSettingsResponse? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.RechargeSettingsResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.RechargeSettingsResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.RechargeSettingsResponse; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.RechargeSettingsResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.RechargeSettingsResponse.g.cs deleted file mode 100644 index 5708278a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.RechargeSettingsResponse.g.cs +++ /dev/null @@ -1,47 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"is_active":true} - /// - public sealed partial class RechargeSettingsResponse - { - /// - /// Whether or not the recharge setting is currently active. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("is_active")] - [global::System.Text.Json.Serialization.JsonRequired] - public required bool IsActive { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Whether or not the recharge setting is currently active. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public RechargeSettingsResponse( - bool isActive) - { - this.IsActive = isActive; - } - - /// - /// Initializes a new instance of the class. - /// - public RechargeSettingsResponse() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.RedactedApiKey.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.RedactedApiKey.Json.g.cs deleted file mode 100644 index 61cf49f7..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.RedactedApiKey.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class RedactedApiKey - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.RedactedApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.RedactedApiKey), - jsonSerializerContext) as global::Ideogram.RedactedApiKey; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.RedactedApiKey? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.RedactedApiKey? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.RedactedApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.RedactedApiKey; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.RedactedApiKey.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.RedactedApiKey.g.cs deleted file mode 100644 index b8695c5b..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.RedactedApiKey.g.cs +++ /dev/null @@ -1,78 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// A representation of an API key that does not contain the full key.
- /// Example: {"creation_time":"2000-01-23T04:56:07\u002B00:00","redacted_api_key":"vkpDja","api_key_id":"JRPVD7jWR1aTBYiJ0UFVOg=="} - ///
- public sealed partial class RedactedApiKey - { - /// - /// A redacted text snippet of the API key. Contains the first 4 characters of the API key
- /// Example: vkpDja - ///
- /// vkpDja - [global::System.Text.Json.Serialization.JsonPropertyName("redacted_api_key")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string RedactedApiKey1 { get; set; } - - /// - /// The time at which the key was created - /// - [global::System.Text.Json.Serialization.JsonPropertyName("creation_time")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.DateTime CreationTime { get; set; } - - /// - /// A URL safe base64 encoded UUID
- /// Example: JRPVD7jWR1aTBYiJ0UFVOg== - ///
- /// JRPVD7jWR1aTBYiJ0UFVOg== - [global::System.Text.Json.Serialization.JsonPropertyName("api_key_id")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string ApiKeyId { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// A redacted text snippet of the API key. Contains the first 4 characters of the API key
- /// Example: vkpDja - /// - /// - /// The time at which the key was created - /// - /// - /// A URL safe base64 encoded UUID
- /// Example: JRPVD7jWR1aTBYiJ0UFVOg== - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public RedactedApiKey( - string redactedApiKey1, - global::System.DateTime creationTime, - string apiKeyId) - { - this.RedactedApiKey1 = redactedApiKey1 ?? throw new global::System.ArgumentNullException(nameof(redactedApiKey1)); - this.CreationTime = creationTime; - this.ApiKeyId = apiKeyId ?? throw new global::System.ArgumentNullException(nameof(apiKeyId)); - } - - /// - /// Initializes a new instance of the class. - /// - public RedactedApiKey() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeIdeogramV3Request.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeIdeogramV3Request.Json.g.cs new file mode 100644 index 00000000..598e5ec3 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeIdeogramV3Request.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ReframeIdeogramV3Request + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ReframeIdeogramV3Request? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ReframeIdeogramV3Request), + jsonSerializerContext) as global::Ideogram.ReframeIdeogramV3Request; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ReframeIdeogramV3Request? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ReframeIdeogramV3Request? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ReframeIdeogramV3Request), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ReframeIdeogramV3Request; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeIdeogramV3Request.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeIdeogramV3Request.g.cs new file mode 100644 index 00000000..e0471272 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeIdeogramV3Request.g.cs @@ -0,0 +1,167 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// + /// + public sealed partial class ReframeIdeogramV3Request + { + /// + /// The JPEG, PNG, or WEBP image to reframe (max 25MB). Multipart requests only. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("image")] + [global::System.Text.Json.Serialization.JsonRequired] + public required byte[] Image { get; set; } + + /// + /// The JPEG, PNG, or WEBP image to reframe (max 25MB). Multipart requests only. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Imagename { get; set; } + + /// + /// The resolutions supported for Ideogram 3.0. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ResolutionV3JsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Ideogram.ResolutionV3 Resolution { get; set; } + + /// + /// The number of images to generate.
+ /// Default Value: 1 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] + public int? NumImages { get; set; } + + /// + /// Random seed. Set for reproducible generation. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("seed")] + public int? Seed { get; set; } + + /// + /// Default Value: default + /// + [global::System.Text.Json.Serialization.JsonPropertyName("rendering_speed")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.V2ImageReframeIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedJsonConverter))] + public global::Ideogram.V2ImageReframeIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? RenderingSpeed { get; set; } + + /// + /// A predefined style preset that applies a specific artistic style to the generated image. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("style_preset")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.IdeogramV3StylePresetJsonConverter))] + public global::Ideogram.IdeogramV3StylePreset? StylePreset { get; set; } + + /// + /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). + /// + [global::System.Text.Json.Serialization.JsonPropertyName("color_palette")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.IdeogramColorPaletteJsonConverter))] + public global::Ideogram.IdeogramColorPalette? ColorPalette { get; set; } + + /// + /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("style_codes")] + public global::System.Collections.Generic.IList? StyleCodes { get; set; } + + /// + /// JPEG, PNG, or WEBP style reference images (max 10, max 25MB each). Multipart requests only. Cannot be combined with `style_preset` or `style_codes`. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("style_reference_images")] + public global::System.Collections.Generic.IList? StyleReferenceImages { get; set; } + + /// + /// Return immediately instead of waiting for reframed images.
+ /// Default Value: false + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The JPEG, PNG, or WEBP image to reframe (max 25MB). Multipart requests only. + /// + /// + /// The JPEG, PNG, or WEBP image to reframe (max 25MB). Multipart requests only. + /// + /// + /// The resolutions supported for Ideogram 3.0. + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// Default Value: default + /// + /// + /// A predefined style preset that applies a specific artistic style to the generated image. + /// + /// + /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). + /// + /// + /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images. + /// + /// + /// JPEG, PNG, or WEBP style reference images (max 10, max 25MB each). Multipart requests only. Cannot be combined with `style_preset` or `style_codes`. + /// + /// + /// Return immediately instead of waiting for reframed images.
+ /// Default Value: false + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ReframeIdeogramV3Request( + byte[] image, + string imagename, + global::Ideogram.ResolutionV3 resolution, + int? numImages, + int? seed, + global::Ideogram.V2ImageReframeIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed, + global::Ideogram.IdeogramV3StylePreset? stylePreset, + global::Ideogram.IdeogramColorPalette? colorPalette, + global::System.Collections.Generic.IList? styleCodes, + global::System.Collections.Generic.IList? styleReferenceImages, + bool? async) + { + this.Image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + this.Imagename = imagename ?? throw new global::System.ArgumentNullException(nameof(imagename)); + this.Resolution = resolution; + this.NumImages = numImages; + this.Seed = seed; + this.RenderingSpeed = renderingSpeed; + this.StylePreset = stylePreset; + this.ColorPalette = colorPalette; + this.StyleCodes = styleCodes; + this.StyleReferenceImages = styleReferenceImages; + this.Async = async; + } + + /// + /// Initializes a new instance of the class. + /// + public ReframeIdeogramV3Request() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeIdeogramV3Response.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeIdeogramV3Response.Json.g.cs new file mode 100644 index 00000000..9274c589 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeIdeogramV3Response.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ReframeIdeogramV3Response + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ReframeIdeogramV3Response? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ReframeIdeogramV3Response), + jsonSerializerContext) as global::Ideogram.ReframeIdeogramV3Response; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ReframeIdeogramV3Response? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ReframeIdeogramV3Response? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ReframeIdeogramV3Response), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ReframeIdeogramV3Response; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeIdeogramV3Response.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeIdeogramV3Response.g.cs new file mode 100644 index 00000000..e35a9c12 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeIdeogramV3Response.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ReframeIdeogramV3Response + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeIdeogramV3Response2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeIdeogramV3Response2.Json.g.cs new file mode 100644 index 00000000..05708563 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeIdeogramV3Response2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ReframeIdeogramV3Response2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ReframeIdeogramV3Response2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ReframeIdeogramV3Response2), + jsonSerializerContext) as global::Ideogram.ReframeIdeogramV3Response2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ReframeIdeogramV3Response2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ReframeIdeogramV3Response2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ReframeIdeogramV3Response2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ReframeIdeogramV3Response2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeIdeogramV3Response2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeIdeogramV3Response2.g.cs new file mode 100644 index 00000000..99df8dae --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeIdeogramV3Response2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ReframeIdeogramV3Response2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeIdeogramV3Response3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeIdeogramV3Response3.Json.g.cs new file mode 100644 index 00000000..3cf2db7e --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeIdeogramV3Response3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ReframeIdeogramV3Response3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ReframeIdeogramV3Response3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ReframeIdeogramV3Response3), + jsonSerializerContext) as global::Ideogram.ReframeIdeogramV3Response3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ReframeIdeogramV3Response3? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ReframeIdeogramV3Response3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ReframeIdeogramV3Response3), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ReframeIdeogramV3Response3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeIdeogramV3Response3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeIdeogramV3Response3.g.cs new file mode 100644 index 00000000..c957bb65 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeIdeogramV3Response3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ReframeIdeogramV3Response3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeIdeogramV3Response4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeIdeogramV3Response4.Json.g.cs new file mode 100644 index 00000000..dfc01ac9 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeIdeogramV3Response4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ReframeIdeogramV3Response4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ReframeIdeogramV3Response4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ReframeIdeogramV3Response4), + jsonSerializerContext) as global::Ideogram.ReframeIdeogramV3Response4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ReframeIdeogramV3Response4? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ReframeIdeogramV3Response4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ReframeIdeogramV3Response4), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ReframeIdeogramV3Response4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeIdeogramV3Response4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeIdeogramV3Response4.g.cs new file mode 100644 index 00000000..9304fb56 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeIdeogramV3Response4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ReframeIdeogramV3Response4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeIdeogramV3Response5.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeIdeogramV3Response5.Json.g.cs new file mode 100644 index 00000000..16a139cc --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeIdeogramV3Response5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ReframeIdeogramV3Response5 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ReframeIdeogramV3Response5? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ReframeIdeogramV3Response5), + jsonSerializerContext) as global::Ideogram.ReframeIdeogramV3Response5; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ReframeIdeogramV3Response5? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ReframeIdeogramV3Response5? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ReframeIdeogramV3Response5), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ReframeIdeogramV3Response5; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeIdeogramV3Response5.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeIdeogramV3Response5.g.cs new file mode 100644 index 00000000..ca835fff --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeIdeogramV3Response5.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ReframeIdeogramV3Response5 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageAutoRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageAutoRequest.Json.g.cs deleted file mode 100644 index d35ef638..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageAutoRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class ReframeImageAutoRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.ReframeImageAutoRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.ReframeImageAutoRequest), - jsonSerializerContext) as global::Ideogram.ReframeImageAutoRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.ReframeImageAutoRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.ReframeImageAutoRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.ReframeImageAutoRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ReframeImageAutoRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageAutoRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageAutoRequest.g.cs deleted file mode 100644 index 916ae295..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageAutoRequest.g.cs +++ /dev/null @@ -1,132 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Supply exactly one source: `image_asset_identifier` for an existing
- /// Ideogram asset, or `image` for a raw upload. Supplying both or neither
- /// is rejected with a 400. - ///
- public sealed partial class ReframeImageAutoRequest - { - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - ///
- /// {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - [global::System.Text.Json.Serialization.JsonPropertyName("image_asset_identifier")] - public global::Ideogram.AssetIdentifier? ImageAssetIdentifier { get; set; } - - /// - /// The JPEG, PNG, or WEBP image to reframe (max 50MB). - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image")] - public byte[]? Image { get; set; } - - /// - /// The JPEG, PNG, or WEBP image to reframe (max 50MB). - /// - [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] - public string? Imagename { get; set; } - - /// - /// The requested output aspect ratio, as `width:height`.
- /// Example: 16:9 - ///
- /// 16:9 - [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string AspectRatio { get; set; } - - /// - /// API-key requests are always private. For bearer-authenticated
- /// requests, this controls whether the result is private; when
- /// omitted, it follows the caller's plan entitlement. Enterprise
- /// generations are always private. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// The number of output images to generate.
- /// Default Value: 1 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] - public int? NumImages { get; set; } - - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - ///
- /// 12345 - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The requested output aspect ratio, as `width:height`.
- /// Example: 16:9 - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The JPEG, PNG, or WEBP image to reframe (max 50MB). - /// - /// - /// The JPEG, PNG, or WEBP image to reframe (max 50MB). - /// - /// - /// API-key requests are always private. For bearer-authenticated
- /// requests, this controls whether the result is private; when
- /// omitted, it follows the caller's plan entitlement. Enterprise
- /// generations are always private. - /// - /// - /// The number of output images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ReframeImageAutoRequest( - string aspectRatio, - global::Ideogram.AssetIdentifier? imageAssetIdentifier, - byte[]? image, - string? imagename, - bool? @private, - int? numImages, - int? seed) - { - this.ImageAssetIdentifier = imageAssetIdentifier; - this.Image = image; - this.Imagename = imagename; - this.AspectRatio = aspectRatio ?? throw new global::System.ArgumentNullException(nameof(aspectRatio)); - this.Private = @private; - this.NumImages = numImages; - this.Seed = seed; - } - - /// - /// Initializes a new instance of the class. - /// - public ReframeImageAutoRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageAutoResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageAutoResponse.Json.g.cs deleted file mode 100644 index 24923adb..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageAutoResponse.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class ReframeImageAutoResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.ReframeImageAutoResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.ReframeImageAutoResponse), - jsonSerializerContext) as global::Ideogram.ReframeImageAutoResponse; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.ReframeImageAutoResponse? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.ReframeImageAutoResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.ReframeImageAutoResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ReframeImageAutoResponse; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageAutoResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageAutoResponse.g.cs deleted file mode 100644 index ba7c4ca1..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageAutoResponse.g.cs +++ /dev/null @@ -1,91 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Acknowledges an accepted asynchronous Reframe request. Poll
- /// `GET /v2/generations/{generation_id}` for completion and output
- /// images. The seed, width, and height report the values the request resolved to when the caller left them unset.
- /// Example: {"seed":12345,"generation_id":"generation_id","width":0,"height":6} - ///
- public sealed partial class ReframeImageAutoResponse - { - /// - /// URL-safe base64 ID of the accepted generation. Accepted by the
- /// `GET /v2/generations/{generation_id}` polling endpoint. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("generation_id")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string GenerationId { get; set; } - - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - ///
- /// 12345 - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - [global::System.Text.Json.Serialization.JsonRequired] - public required int Seed { get; set; } - - /// - /// The resolved output width in pixels. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("width")] - [global::System.Text.Json.Serialization.JsonRequired] - public required int Width { get; set; } - - /// - /// The resolved output height in pixels. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("height")] - [global::System.Text.Json.Serialization.JsonRequired] - public required int Height { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// URL-safe base64 ID of the accepted generation. Accepted by the
- /// `GET /v2/generations/{generation_id}` polling endpoint. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The resolved output width in pixels. - /// - /// - /// The resolved output height in pixels. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ReframeImageAutoResponse( - string generationId, - int seed, - int width, - int height) - { - this.GenerationId = generationId ?? throw new global::System.ArgumentNullException(nameof(generationId)); - this.Seed = seed; - this.Width = width; - this.Height = height; - } - - /// - /// Initializes a new instance of the class. - /// - public ReframeImageAutoResponse() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageBriaExpandRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageBriaExpandRequest.Json.g.cs deleted file mode 100644 index 08a404d3..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageBriaExpandRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class ReframeImageBriaExpandRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.ReframeImageBriaExpandRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.ReframeImageBriaExpandRequest), - jsonSerializerContext) as global::Ideogram.ReframeImageBriaExpandRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.ReframeImageBriaExpandRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.ReframeImageBriaExpandRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.ReframeImageBriaExpandRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ReframeImageBriaExpandRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageBriaExpandRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageBriaExpandRequest.g.cs deleted file mode 100644 index 75ddc41b..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageBriaExpandRequest.g.cs +++ /dev/null @@ -1,119 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Supply exactly one source: `image_asset_identifier` for an existing
- /// Ideogram asset, or `image` for a raw upload. Supplying both or neither
- /// is rejected with a 400. - ///
- public sealed partial class ReframeImageBriaExpandRequest - { - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - ///
- /// {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - [global::System.Text.Json.Serialization.JsonPropertyName("image_asset_identifier")] - public global::Ideogram.AssetIdentifier? ImageAssetIdentifier { get; set; } - - /// - /// The JPEG, PNG, or WEBP image to reframe (max 50MB). - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image")] - public byte[]? Image { get; set; } - - /// - /// The JPEG, PNG, or WEBP image to reframe (max 50MB). - /// - [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] - public string? Imagename { get; set; } - - /// - /// The requested output aspect ratio, as `width:height`.
- /// Example: 16:9 - ///
- /// 16:9 - [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string AspectRatio { get; set; } - - /// - /// API-key requests are always private. For bearer-authenticated
- /// requests, this controls whether the result is private; when
- /// omitted, it follows the caller's plan entitlement. Enterprise
- /// generations are always private. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - ///
- /// 12345 - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The requested output aspect ratio, as `width:height`.
- /// Example: 16:9 - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The JPEG, PNG, or WEBP image to reframe (max 50MB). - /// - /// - /// The JPEG, PNG, or WEBP image to reframe (max 50MB). - /// - /// - /// API-key requests are always private. For bearer-authenticated
- /// requests, this controls whether the result is private; when
- /// omitted, it follows the caller's plan entitlement. Enterprise
- /// generations are always private. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ReframeImageBriaExpandRequest( - string aspectRatio, - global::Ideogram.AssetIdentifier? imageAssetIdentifier, - byte[]? image, - string? imagename, - bool? @private, - int? seed) - { - this.ImageAssetIdentifier = imageAssetIdentifier; - this.Image = image; - this.Imagename = imagename; - this.AspectRatio = aspectRatio ?? throw new global::System.ArgumentNullException(nameof(aspectRatio)); - this.Private = @private; - this.Seed = seed; - } - - /// - /// Initializes a new instance of the class. - /// - public ReframeImageBriaExpandRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageBriaExpandResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageBriaExpandResponse.Json.g.cs deleted file mode 100644 index fdbbaba6..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageBriaExpandResponse.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class ReframeImageBriaExpandResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.ReframeImageBriaExpandResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.ReframeImageBriaExpandResponse), - jsonSerializerContext) as global::Ideogram.ReframeImageBriaExpandResponse; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.ReframeImageBriaExpandResponse? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.ReframeImageBriaExpandResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.ReframeImageBriaExpandResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ReframeImageBriaExpandResponse; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageBriaExpandResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageBriaExpandResponse.g.cs deleted file mode 100644 index 371ad8a0..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageBriaExpandResponse.g.cs +++ /dev/null @@ -1,91 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Acknowledges an accepted asynchronous Reframe request. Poll
- /// `GET /v2/generations/{generation_id}` for completion and output
- /// images. The width and height are the canvas the source was placed on.
- /// Example: {"seed":12345,"generation_id":"generation_id","width":0,"height":6} - ///
- public sealed partial class ReframeImageBriaExpandResponse - { - /// - /// URL-safe base64 ID of the accepted generation. Accepted by the
- /// `GET /v2/generations/{generation_id}` polling endpoint. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("generation_id")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string GenerationId { get; set; } - - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - ///
- /// 12345 - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - [global::System.Text.Json.Serialization.JsonRequired] - public required int Seed { get; set; } - - /// - /// The resolved output width in pixels. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("width")] - [global::System.Text.Json.Serialization.JsonRequired] - public required int Width { get; set; } - - /// - /// The resolved output height in pixels. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("height")] - [global::System.Text.Json.Serialization.JsonRequired] - public required int Height { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// URL-safe base64 ID of the accepted generation. Accepted by the
- /// `GET /v2/generations/{generation_id}` polling endpoint. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The resolved output width in pixels. - /// - /// - /// The resolved output height in pixels. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ReframeImageBriaExpandResponse( - string generationId, - int seed, - int width, - int height) - { - this.GenerationId = generationId ?? throw new global::System.ArgumentNullException(nameof(generationId)); - this.Seed = seed; - this.Width = width; - this.Height = height; - } - - /// - /// Initializes a new instance of the class. - /// - public ReframeImageBriaExpandResponse() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageGptImage25FlareRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageGptImage25FlareRequest.Json.g.cs deleted file mode 100644 index 8b5ce823..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageGptImage25FlareRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class ReframeImageGptImage25FlareRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.ReframeImageGptImage25FlareRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.ReframeImageGptImage25FlareRequest), - jsonSerializerContext) as global::Ideogram.ReframeImageGptImage25FlareRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.ReframeImageGptImage25FlareRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.ReframeImageGptImage25FlareRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.ReframeImageGptImage25FlareRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ReframeImageGptImage25FlareRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageGptImage25FlareRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageGptImage25FlareRequest.g.cs deleted file mode 100644 index cdbd61c4..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageGptImage25FlareRequest.g.cs +++ /dev/null @@ -1,146 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Supply exactly one source: `image_asset_identifier` for an existing
- /// Ideogram asset, or `image` for a raw upload. Supplying both or neither
- /// is rejected with a 400. - ///
- public sealed partial class ReframeImageGptImage25FlareRequest - { - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - ///
- /// {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - [global::System.Text.Json.Serialization.JsonPropertyName("image_asset_identifier")] - public global::Ideogram.AssetIdentifier? ImageAssetIdentifier { get; set; } - - /// - /// The JPEG, PNG, or WEBP image to reframe (max 50MB). - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image")] - public byte[]? Image { get; set; } - - /// - /// The JPEG, PNG, or WEBP image to reframe (max 50MB). - /// - [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] - public string? Imagename { get; set; } - - /// - /// The requested output aspect ratio, as `width:height`.
- /// Example: 16:9 - ///
- /// 16:9 - [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string AspectRatio { get; set; } - - /// - /// How much rendering effort the model spends. Lower tiers return sooner and cost less; `auto` lets the model choose.
- /// Default Value: auto - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("quality")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ReframeImageGptImage25FlareRequestQualityJsonConverter))] - public global::Ideogram.ReframeImageGptImage25FlareRequestQuality? Quality { get; set; } - - /// - /// API-key requests are always private. For bearer-authenticated
- /// requests, this controls whether the result is private; when
- /// omitted, it follows the caller's plan entitlement. Enterprise
- /// generations are always private. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// The number of output images to generate.
- /// Default Value: 1 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] - public int? NumImages { get; set; } - - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - ///
- /// 12345 - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The requested output aspect ratio, as `width:height`.
- /// Example: 16:9 - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The JPEG, PNG, or WEBP image to reframe (max 50MB). - /// - /// - /// The JPEG, PNG, or WEBP image to reframe (max 50MB). - /// - /// - /// How much rendering effort the model spends. Lower tiers return sooner and cost less; `auto` lets the model choose.
- /// Default Value: auto - /// - /// - /// API-key requests are always private. For bearer-authenticated
- /// requests, this controls whether the result is private; when
- /// omitted, it follows the caller's plan entitlement. Enterprise
- /// generations are always private. - /// - /// - /// The number of output images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ReframeImageGptImage25FlareRequest( - string aspectRatio, - global::Ideogram.AssetIdentifier? imageAssetIdentifier, - byte[]? image, - string? imagename, - global::Ideogram.ReframeImageGptImage25FlareRequestQuality? quality, - bool? @private, - int? numImages, - int? seed) - { - this.ImageAssetIdentifier = imageAssetIdentifier; - this.Image = image; - this.Imagename = imagename; - this.AspectRatio = aspectRatio ?? throw new global::System.ArgumentNullException(nameof(aspectRatio)); - this.Quality = quality; - this.Private = @private; - this.NumImages = numImages; - this.Seed = seed; - } - - /// - /// Initializes a new instance of the class. - /// - public ReframeImageGptImage25FlareRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageGptImage25FlareRequestQuality.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageGptImage25FlareRequestQuality.g.cs deleted file mode 100644 index 26bdfdeb..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageGptImage25FlareRequestQuality.g.cs +++ /dev/null @@ -1,64 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// How much rendering effort the model spends. Lower tiers return sooner and cost less; `auto` lets the model choose.
- /// Default Value: auto - ///
- public enum ReframeImageGptImage25FlareRequestQuality - { - /// - /// - /// - Auto, - /// - /// - /// - High, - /// - /// - /// - Low, - /// - /// - /// - Medium, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class ReframeImageGptImage25FlareRequestQualityExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this ReframeImageGptImage25FlareRequestQuality value) - { - return value switch - { - ReframeImageGptImage25FlareRequestQuality.Auto => "auto", - ReframeImageGptImage25FlareRequestQuality.High => "high", - ReframeImageGptImage25FlareRequestQuality.Low => "low", - ReframeImageGptImage25FlareRequestQuality.Medium => "medium", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static ReframeImageGptImage25FlareRequestQuality? ToEnum(string value) - { - return value switch - { - "auto" => ReframeImageGptImage25FlareRequestQuality.Auto, - "high" => ReframeImageGptImage25FlareRequestQuality.High, - "low" => ReframeImageGptImage25FlareRequestQuality.Low, - "medium" => ReframeImageGptImage25FlareRequestQuality.Medium, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageGptImage25FlareResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageGptImage25FlareResponse.Json.g.cs deleted file mode 100644 index af7f6d82..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageGptImage25FlareResponse.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class ReframeImageGptImage25FlareResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.ReframeImageGptImage25FlareResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.ReframeImageGptImage25FlareResponse), - jsonSerializerContext) as global::Ideogram.ReframeImageGptImage25FlareResponse; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.ReframeImageGptImage25FlareResponse? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.ReframeImageGptImage25FlareResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.ReframeImageGptImage25FlareResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ReframeImageGptImage25FlareResponse; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageGptImage25FlareResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageGptImage25FlareResponse.g.cs deleted file mode 100644 index 14a6d516..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageGptImage25FlareResponse.g.cs +++ /dev/null @@ -1,91 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Acknowledges an accepted asynchronous Reframe request. Poll
- /// `GET /v2/generations/{generation_id}` for completion and output
- /// images. The seed, width, and height report the values the request resolved to when the caller left them unset.
- /// Example: {"seed":12345,"generation_id":"generation_id","width":0,"height":6} - ///
- public sealed partial class ReframeImageGptImage25FlareResponse - { - /// - /// URL-safe base64 ID of the accepted generation. Accepted by the
- /// `GET /v2/generations/{generation_id}` polling endpoint. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("generation_id")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string GenerationId { get; set; } - - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - ///
- /// 12345 - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - [global::System.Text.Json.Serialization.JsonRequired] - public required int Seed { get; set; } - - /// - /// The resolved output width in pixels. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("width")] - [global::System.Text.Json.Serialization.JsonRequired] - public required int Width { get; set; } - - /// - /// The resolved output height in pixels. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("height")] - [global::System.Text.Json.Serialization.JsonRequired] - public required int Height { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// URL-safe base64 ID of the accepted generation. Accepted by the
- /// `GET /v2/generations/{generation_id}` polling endpoint. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The resolved output width in pixels. - /// - /// - /// The resolved output height in pixels. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ReframeImageGptImage25FlareResponse( - string generationId, - int seed, - int width, - int height) - { - this.GenerationId = generationId ?? throw new global::System.ArgumentNullException(nameof(generationId)); - this.Seed = seed; - this.Width = width; - this.Height = height; - } - - /// - /// Initializes a new instance of the class. - /// - public ReframeImageGptImage25FlareResponse() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageIdeogramV3Request.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageIdeogramV3Request.Json.g.cs deleted file mode 100644 index ded90943..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageIdeogramV3Request.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class ReframeImageIdeogramV3Request - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.ReframeImageIdeogramV3Request? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.ReframeImageIdeogramV3Request), - jsonSerializerContext) as global::Ideogram.ReframeImageIdeogramV3Request; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.ReframeImageIdeogramV3Request? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.ReframeImageIdeogramV3Request? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.ReframeImageIdeogramV3Request), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ReframeImageIdeogramV3Request; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageIdeogramV3Request.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageIdeogramV3Request.g.cs deleted file mode 100644 index 44eabeab..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageIdeogramV3Request.g.cs +++ /dev/null @@ -1,204 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Upload the source `image`. Style controls are optional; when used,
- /// supply only one of `style_preset`, `style_codes`, or
- /// `style_reference_images`. - ///
- public sealed partial class ReframeImageIdeogramV3Request - { - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - ///
- /// {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - [global::System.Text.Json.Serialization.JsonPropertyName("image_asset_identifier")] - public global::Ideogram.AssetIdentifier? ImageAssetIdentifier { get; set; } - - /// - /// The JPEG, PNG, or WEBP image to reframe (max 25MB). Multipart requests only. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image")] - public byte[]? Image { get; set; } - - /// - /// The JPEG, PNG, or WEBP image to reframe (max 25MB). Multipart requests only. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] - public string? Imagename { get; set; } - - /// - /// The resolutions supported for Ideogram 3.0.
- /// Example: 1280x800 - ///
- /// 1280x800 - [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ResolutionV3JsonConverter))] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.ResolutionV3 Resolution { get; set; } - - /// - /// The number of images to generate.
- /// Default Value: 1 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] - public int? NumImages { get; set; } - - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - ///
- /// 12345 - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// Default Value: default - /// - [global::System.Text.Json.Serialization.JsonPropertyName("rendering_speed")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ReframeImageIdeogramV3RequestRenderingSpeedJsonConverter))] - public global::Ideogram.ReframeImageIdeogramV3RequestRenderingSpeed? RenderingSpeed { get; set; } - - /// - /// A predefined style preset that applies a specific artistic style to the generated image.
- /// Example: bright_art - ///
- /// bright_art - [global::System.Text.Json.Serialization.JsonPropertyName("style_preset")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.IdeogramV3StylePresetJsonConverter))] - public global::Ideogram.IdeogramV3StylePreset? StylePreset { get; set; } - - /// - /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). - /// - [global::System.Text.Json.Serialization.JsonPropertyName("color_palette")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.IdeogramColorPaletteJsonConverter))] - public global::Ideogram.IdeogramColorPalette? ColorPalette { get; set; } - - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - ///
- /// [AAFF5733, 0133FF57, DE3357FF] - [global::System.Text.Json.Serialization.JsonPropertyName("style_codes")] - public global::System.Collections.Generic.IList? StyleCodes { get; set; } - - /// - /// Existing upload or generated image assets to use as style references. Cannot be combined with a style preset, style codes, or uploaded style reference images. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("style_reference_asset_identifiers")] - public global::System.Collections.Generic.IList? StyleReferenceAssetIdentifiers { get; set; } - - /// - /// JPEG, PNG, or WEBP style reference images (max 10, max 25MB each). Multipart requests only. Cannot be combined with `style_preset` or `style_codes`. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("style_reference_images")] - public global::System.Collections.Generic.IList? StyleReferenceImages { get; set; } - - /// - /// Return immediately instead of waiting for reframed images.
- /// Default Value: false - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("async")] - public bool? Async { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The resolutions supported for Ideogram 3.0.
- /// Example: 1280x800 - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The JPEG, PNG, or WEBP image to reframe (max 25MB). Multipart requests only. - /// - /// - /// The JPEG, PNG, or WEBP image to reframe (max 25MB). Multipart requests only. - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// Default Value: default - /// - /// - /// A predefined style preset that applies a specific artistic style to the generated image.
- /// Example: bright_art - /// - /// - /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). - /// - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - /// - /// - /// Existing upload or generated image assets to use as style references. Cannot be combined with a style preset, style codes, or uploaded style reference images. - /// - /// - /// JPEG, PNG, or WEBP style reference images (max 10, max 25MB each). Multipart requests only. Cannot be combined with `style_preset` or `style_codes`. - /// - /// - /// Return immediately instead of waiting for reframed images.
- /// Default Value: false - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ReframeImageIdeogramV3Request( - global::Ideogram.ResolutionV3 resolution, - global::Ideogram.AssetIdentifier? imageAssetIdentifier, - byte[]? image, - string? imagename, - int? numImages, - int? seed, - global::Ideogram.ReframeImageIdeogramV3RequestRenderingSpeed? renderingSpeed, - global::Ideogram.IdeogramV3StylePreset? stylePreset, - global::Ideogram.IdeogramColorPalette? colorPalette, - global::System.Collections.Generic.IList? styleCodes, - global::System.Collections.Generic.IList? styleReferenceAssetIdentifiers, - global::System.Collections.Generic.IList? styleReferenceImages, - bool? async) - { - this.ImageAssetIdentifier = imageAssetIdentifier; - this.Image = image; - this.Imagename = imagename; - this.Resolution = resolution; - this.NumImages = numImages; - this.Seed = seed; - this.RenderingSpeed = renderingSpeed; - this.StylePreset = stylePreset; - this.ColorPalette = colorPalette; - this.StyleCodes = styleCodes; - this.StyleReferenceAssetIdentifiers = styleReferenceAssetIdentifiers; - this.StyleReferenceImages = styleReferenceImages; - this.Async = async; - } - - /// - /// Initializes a new instance of the class. - /// - public ReframeImageIdeogramV3Request() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageIdeogramV3RequestRenderingSpeed.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageIdeogramV3RequestRenderingSpeed.g.cs deleted file mode 100644 index 62930884..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageIdeogramV3RequestRenderingSpeed.g.cs +++ /dev/null @@ -1,57 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Default Value: default - /// - public enum ReframeImageIdeogramV3RequestRenderingSpeed - { - /// - /// - /// - Default, - /// - /// - /// - Quality, - /// - /// - /// - Turbo, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class ReframeImageIdeogramV3RequestRenderingSpeedExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this ReframeImageIdeogramV3RequestRenderingSpeed value) - { - return value switch - { - ReframeImageIdeogramV3RequestRenderingSpeed.Default => "default", - ReframeImageIdeogramV3RequestRenderingSpeed.Quality => "quality", - ReframeImageIdeogramV3RequestRenderingSpeed.Turbo => "turbo", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static ReframeImageIdeogramV3RequestRenderingSpeed? ToEnum(string value) - { - return value switch - { - "default" => ReframeImageIdeogramV3RequestRenderingSpeed.Default, - "quality" => ReframeImageIdeogramV3RequestRenderingSpeed.Quality, - "turbo" => ReframeImageIdeogramV3RequestRenderingSpeed.Turbo, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageIdeogramV3Response.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageIdeogramV3Response.g.cs index ef88c245..20398d6b 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageIdeogramV3Response.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageIdeogramV3Response.g.cs @@ -8,8 +8,7 @@ namespace Ideogram /// `data`. Requests with `async` set to true omit `data`; poll for
/// completion and results with `GET /v2/generations/{generation_id}`.
/// The seed reports the value the request resolved to when the caller
- /// left it unset.
- /// Example: {"data":[{"seed":12345,"prompt":"prompt","resolution":"1024x1024","url":"https://openapi-generator.tech","is_image_safe":true},{"seed":12345,"prompt":"prompt","resolution":"1024x1024","url":"https://openapi-generator.tech","is_image_safe":true}],"seed":12345,"generation_id":"generation_id"} + /// left it unset. ///
public sealed partial class ReframeImageIdeogramV3Response { @@ -28,10 +27,8 @@ public sealed partial class ReframeImageIdeogramV3Response public global::System.Collections.Generic.IList? Data { get; set; } /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. ///
- /// 12345 [global::System.Text.Json.Serialization.JsonPropertyName("seed")] [global::System.Text.Json.Serialization.JsonRequired] public required int Seed { get; set; } @@ -50,8 +47,7 @@ public sealed partial class ReframeImageIdeogramV3Response /// `GET /v2/generations/{generation_id}` polling endpoint. /// /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. /// /// /// The reframed images, in generation order. Present only for synchronous requests (`async` omitted or false). diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageNanoBanana2Request.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageNanoBanana2Request.Json.g.cs deleted file mode 100644 index fa85de72..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageNanoBanana2Request.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class ReframeImageNanoBanana2Request - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.ReframeImageNanoBanana2Request? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.ReframeImageNanoBanana2Request), - jsonSerializerContext) as global::Ideogram.ReframeImageNanoBanana2Request; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.ReframeImageNanoBanana2Request? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.ReframeImageNanoBanana2Request? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.ReframeImageNanoBanana2Request), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ReframeImageNanoBanana2Request; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageNanoBanana2Request.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageNanoBanana2Request.g.cs deleted file mode 100644 index 52c6dc64..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageNanoBanana2Request.g.cs +++ /dev/null @@ -1,129 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Upload the source `image`. Requests without a source image are
- /// rejected with a 400. - ///
- public sealed partial class ReframeImageNanoBanana2Request - { - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - ///
- /// {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - [global::System.Text.Json.Serialization.JsonPropertyName("image_asset_identifier")] - public global::Ideogram.AssetIdentifier? ImageAssetIdentifier { get; set; } - - /// - /// The JPEG, PNG, or WEBP image to reframe (max 50MB). - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image")] - public byte[]? Image { get; set; } - - /// - /// The JPEG, PNG, or WEBP image to reframe (max 50MB). - /// - [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] - public string? Imagename { get; set; } - - /// - /// Aspect ratios Nano Banana 2 can reframe an image to. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.NanoBanana2ReframeAspectRatioJsonConverter))] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.NanoBanana2ReframeAspectRatio AspectRatio { get; set; } - - /// - /// API-key requests are always private. For bearer-authenticated
- /// requests, this controls whether the result is private; when
- /// omitted, it follows the caller's plan entitlement. Enterprise
- /// generations are always private. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// The number of output images to generate.
- /// Default Value: 1 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] - public int? NumImages { get; set; } - - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - ///
- /// 12345 - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Aspect ratios Nano Banana 2 can reframe an image to. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The JPEG, PNG, or WEBP image to reframe (max 50MB). - /// - /// - /// The JPEG, PNG, or WEBP image to reframe (max 50MB). - /// - /// - /// API-key requests are always private. For bearer-authenticated
- /// requests, this controls whether the result is private; when
- /// omitted, it follows the caller's plan entitlement. Enterprise
- /// generations are always private. - /// - /// - /// The number of output images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ReframeImageNanoBanana2Request( - global::Ideogram.NanoBanana2ReframeAspectRatio aspectRatio, - global::Ideogram.AssetIdentifier? imageAssetIdentifier, - byte[]? image, - string? imagename, - bool? @private, - int? numImages, - int? seed) - { - this.ImageAssetIdentifier = imageAssetIdentifier; - this.Image = image; - this.Imagename = imagename; - this.AspectRatio = aspectRatio; - this.Private = @private; - this.NumImages = numImages; - this.Seed = seed; - } - - /// - /// Initializes a new instance of the class. - /// - public ReframeImageNanoBanana2Request() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageNanoBanana2Response.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageNanoBanana2Response.g.cs index a997f606..df70d1fd 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageNanoBanana2Response.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageNanoBanana2Response.g.cs @@ -7,8 +7,7 @@ namespace Ideogram /// Acknowledges an accepted asynchronous Reframe request. Poll
/// `GET /v2/generations/{generation_id}` for completion and output
/// images. The seed, width, and height report the values the request
- /// resolved to when the caller left them unset.
- /// Example: {"seed":12345,"generation_id":"generation_id","width":0,"height":6} + /// resolved to when the caller left them unset. ///
public sealed partial class ReframeImageNanoBanana2Response { @@ -21,10 +20,8 @@ public sealed partial class ReframeImageNanoBanana2Response public required string GenerationId { get; set; } /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. ///
- /// 12345 [global::System.Text.Json.Serialization.JsonPropertyName("seed")] [global::System.Text.Json.Serialization.JsonRequired] public required int Seed { get; set; } @@ -57,8 +54,7 @@ public sealed partial class ReframeImageNanoBanana2Response /// `GET /v2/generations/{generation_id}` polling endpoint. /// /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. /// /// /// The resolved 1K output width in pixels. diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageNanoBananaProRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageNanoBananaProRequest.Json.g.cs deleted file mode 100644 index db956992..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageNanoBananaProRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class ReframeImageNanoBananaProRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.ReframeImageNanoBananaProRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.ReframeImageNanoBananaProRequest), - jsonSerializerContext) as global::Ideogram.ReframeImageNanoBananaProRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.ReframeImageNanoBananaProRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.ReframeImageNanoBananaProRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.ReframeImageNanoBananaProRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ReframeImageNanoBananaProRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageNanoBananaProRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageNanoBananaProRequest.g.cs deleted file mode 100644 index f4adb71b..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageNanoBananaProRequest.g.cs +++ /dev/null @@ -1,144 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Supply exactly one source: `image_asset_identifier` for an existing
- /// Ideogram asset, or `image` for a raw upload. Supplying both or neither
- /// is rejected with a 400. - ///
- public sealed partial class ReframeImageNanoBananaProRequest - { - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - ///
- /// {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - [global::System.Text.Json.Serialization.JsonPropertyName("image_asset_identifier")] - public global::Ideogram.AssetIdentifier? ImageAssetIdentifier { get; set; } - - /// - /// The JPEG, PNG, or WEBP image to reframe (max 50MB). - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image")] - public byte[]? Image { get; set; } - - /// - /// The JPEG, PNG, or WEBP image to reframe (max 50MB). - /// - [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] - public string? Imagename { get; set; } - - /// - /// Aspect ratios Nano Banana Pro can reframe an image to. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.NanoBananaProReframeAspectRatioJsonConverter))] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.NanoBananaProReframeAspectRatio AspectRatio { get; set; } - - /// - /// The output resolution tier. The model sizes its output by tier at the requested aspect ratio; exact pixel dimensions cannot be requested.
- /// Default Value: 1K - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("resolution_tier")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ReframeImageNanoBananaProRequestResolutionTierJsonConverter))] - public global::Ideogram.ReframeImageNanoBananaProRequestResolutionTier? ResolutionTier { get; set; } - - /// - /// API-key requests are always private. For bearer-authenticated
- /// requests, this controls whether the result is private; when
- /// omitted, it follows the caller's plan entitlement. Enterprise
- /// generations are always private. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// The number of output images to generate.
- /// Default Value: 1 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] - public int? NumImages { get; set; } - - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - ///
- /// 12345 - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Aspect ratios Nano Banana Pro can reframe an image to. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The JPEG, PNG, or WEBP image to reframe (max 50MB). - /// - /// - /// The JPEG, PNG, or WEBP image to reframe (max 50MB). - /// - /// - /// The output resolution tier. The model sizes its output by tier at the requested aspect ratio; exact pixel dimensions cannot be requested.
- /// Default Value: 1K - /// - /// - /// API-key requests are always private. For bearer-authenticated
- /// requests, this controls whether the result is private; when
- /// omitted, it follows the caller's plan entitlement. Enterprise
- /// generations are always private. - /// - /// - /// The number of output images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ReframeImageNanoBananaProRequest( - global::Ideogram.NanoBananaProReframeAspectRatio aspectRatio, - global::Ideogram.AssetIdentifier? imageAssetIdentifier, - byte[]? image, - string? imagename, - global::Ideogram.ReframeImageNanoBananaProRequestResolutionTier? resolutionTier, - bool? @private, - int? numImages, - int? seed) - { - this.ImageAssetIdentifier = imageAssetIdentifier; - this.Image = image; - this.Imagename = imagename; - this.AspectRatio = aspectRatio; - this.ResolutionTier = resolutionTier; - this.Private = @private; - this.NumImages = numImages; - this.Seed = seed; - } - - /// - /// Initializes a new instance of the class. - /// - public ReframeImageNanoBananaProRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageNanoBananaProRequestResolutionTier.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageNanoBananaProRequestResolutionTier.g.cs deleted file mode 100644 index 80534c2b..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageNanoBananaProRequestResolutionTier.g.cs +++ /dev/null @@ -1,58 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The output resolution tier. The model sizes its output by tier at the requested aspect ratio; exact pixel dimensions cannot be requested.
- /// Default Value: 1K - ///
- public enum ReframeImageNanoBananaProRequestResolutionTier - { - /// - /// - /// - x1k, - /// - /// - /// - x2k, - /// - /// - /// - x4k, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class ReframeImageNanoBananaProRequestResolutionTierExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this ReframeImageNanoBananaProRequestResolutionTier value) - { - return value switch - { - ReframeImageNanoBananaProRequestResolutionTier.x1k => "1K", - ReframeImageNanoBananaProRequestResolutionTier.x2k => "2K", - ReframeImageNanoBananaProRequestResolutionTier.x4k => "4K", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static ReframeImageNanoBananaProRequestResolutionTier? ToEnum(string value) - { - return value switch - { - "1K" => ReframeImageNanoBananaProRequestResolutionTier.x1k, - "2K" => ReframeImageNanoBananaProRequestResolutionTier.x2k, - "4K" => ReframeImageNanoBananaProRequestResolutionTier.x4k, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageNanoBananaProResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageNanoBananaProResponse.Json.g.cs deleted file mode 100644 index 4fb9ec6e..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageNanoBananaProResponse.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class ReframeImageNanoBananaProResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.ReframeImageNanoBananaProResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.ReframeImageNanoBananaProResponse), - jsonSerializerContext) as global::Ideogram.ReframeImageNanoBananaProResponse; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.ReframeImageNanoBananaProResponse? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.ReframeImageNanoBananaProResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.ReframeImageNanoBananaProResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ReframeImageNanoBananaProResponse; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageNanoBananaProResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageNanoBananaProResponse.g.cs deleted file mode 100644 index 35431a63..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageNanoBananaProResponse.g.cs +++ /dev/null @@ -1,91 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Acknowledges an accepted asynchronous Reframe request. Poll
- /// `GET /v2/generations/{generation_id}` for completion and output
- /// images. The seed, width, and height report the values the request resolved to when the caller left them unset.
- /// Example: {"seed":12345,"generation_id":"generation_id","width":0,"height":6} - ///
- public sealed partial class ReframeImageNanoBananaProResponse - { - /// - /// URL-safe base64 ID of the accepted generation. Accepted by the
- /// `GET /v2/generations/{generation_id}` polling endpoint. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("generation_id")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string GenerationId { get; set; } - - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - ///
- /// 12345 - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - [global::System.Text.Json.Serialization.JsonRequired] - public required int Seed { get; set; } - - /// - /// The resolved output width in pixels. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("width")] - [global::System.Text.Json.Serialization.JsonRequired] - public required int Width { get; set; } - - /// - /// The resolved output height in pixels. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("height")] - [global::System.Text.Json.Serialization.JsonRequired] - public required int Height { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// URL-safe base64 ID of the accepted generation. Accepted by the
- /// `GET /v2/generations/{generation_id}` polling endpoint. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The resolved output width in pixels. - /// - /// - /// The resolved output height in pixels. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ReframeImageNanoBananaProResponse( - string generationId, - int seed, - int width, - int height) - { - this.GenerationId = generationId ?? throw new global::System.ArgumentNullException(nameof(generationId)); - this.Seed = seed; - this.Width = width; - this.Height = height; - } - - /// - /// Initializes a new instance of the class. - /// - public ReframeImageNanoBananaProResponse() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageRequest.Json.g.cs deleted file mode 100644 index cbd30ed6..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class ReframeImageRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.ReframeImageRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.ReframeImageRequest), - jsonSerializerContext) as global::Ideogram.ReframeImageRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.ReframeImageRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.ReframeImageRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.ReframeImageRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ReframeImageRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageRequest.g.cs deleted file mode 100644 index c6a9ed6c..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageRequest.g.cs +++ /dev/null @@ -1,136 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - public sealed partial class ReframeImageRequest - { - /// - /// The image being reframed (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image_file")] - [global::System.Text.Json.Serialization.JsonRequired] - public required byte[] ImageFile { get; set; } - - /// - /// The image being reframed (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image_filename")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string ImageFilename { get; set; } - - /// - /// (For model_version for 2.0 only, cannot be used in conjunction with aspect_ratio) The resolution to use for image generation, represented in width x height. If not specified, defaults to using aspect_ratio.
- /// Example: RESOLUTION_1024_1024 - ///
- /// RESOLUTION_1024_1024 - [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ResolutionJsonConverter))] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.Resolution Resolution { get; set; } - - /// - /// The model used to generate an image or edit one. /generate and /remix supports all model types, however, /edit is only supported for V_2 and V_2_TURBO.
- /// Default Value: V_2
- /// Example: V_2_TURBO - ///
- /// global::Ideogram.ModelEnum.V2 - /// V_2_TURBO - [global::System.Text.Json.Serialization.JsonPropertyName("model")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ModelEnumJsonConverter))] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.ModelEnum Model { get; set; } = global::Ideogram.ModelEnum.V2; - - /// - /// The number of images to generate.
- /// Default Value: 1 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] - public int? NumImages { get; set; } - - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - ///
- /// 12345 - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// The style type to generate with; this is only applicable for models V_2 and above and should not be specified for model versions V_1.
- /// Example: REALISTIC - ///
- /// REALISTIC - [global::System.Text.Json.Serialization.JsonPropertyName("style_type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.StyleTypeJsonConverter))] - public global::Ideogram.StyleType? StyleType { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The image being reframed (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The image being reframed (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// (For model_version for 2.0 only, cannot be used in conjunction with aspect_ratio) The resolution to use for image generation, represented in width x height. If not specified, defaults to using aspect_ratio.
- /// Example: RESOLUTION_1024_1024 - /// - /// - /// The model used to generate an image or edit one. /generate and /remix supports all model types, however, /edit is only supported for V_2 and V_2_TURBO.
- /// Default Value: V_2
- /// Example: V_2_TURBO - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The style type to generate with; this is only applicable for models V_2 and above and should not be specified for model versions V_1.
- /// Example: REALISTIC - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ReframeImageRequest( - byte[] imageFile, - string imageFilename, - global::Ideogram.Resolution resolution, - global::Ideogram.ModelEnum model, - int? numImages, - int? seed, - global::Ideogram.StyleType? styleType) - { - this.ImageFile = imageFile ?? throw new global::System.ArgumentNullException(nameof(imageFile)); - this.ImageFilename = imageFilename ?? throw new global::System.ArgumentNullException(nameof(imageFilename)); - this.Resolution = resolution; - this.Model = model; - this.NumImages = numImages; - this.Seed = seed; - this.StyleType = styleType; - } - - /// - /// Initializes a new instance of the class. - /// - public ReframeImageRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageRequestV3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageRequestV3.Json.g.cs deleted file mode 100644 index 738d6343..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageRequestV3.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class ReframeImageRequestV3 - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.ReframeImageRequestV3? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.ReframeImageRequestV3), - jsonSerializerContext) as global::Ideogram.ReframeImageRequestV3; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.ReframeImageRequestV3? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.ReframeImageRequestV3? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.ReframeImageRequestV3), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ReframeImageRequestV3; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageRequestV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageRequestV3.g.cs deleted file mode 100644 index 0300c824..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeImageRequestV3.g.cs +++ /dev/null @@ -1,168 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - public sealed partial class ReframeImageRequestV3 - { - /// - /// The image being reframed (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image")] - [global::System.Text.Json.Serialization.JsonRequired] - public required byte[] Image { get; set; } - - /// - /// The image being reframed (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Imagename { get; set; } - - /// - /// The resolutions supported for Ideogram 3.0.
- /// Example: 1280x800 - ///
- /// 1280x800 - [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ResolutionV3JsonConverter))] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.ResolutionV3 Resolution { get; set; } - - /// - /// The number of images to generate.
- /// Default Value: 1 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] - public int? NumImages { get; set; } - - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - ///
- /// 12345 - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("rendering_speed")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.RenderingSpeedJsonConverter))] - public global::Ideogram.RenderingSpeed? RenderingSpeed { get; set; } - - /// - /// A predefined style preset that applies a specific artistic style to the generated image.
- /// Example: BRIGHT_ART - ///
- /// BRIGHT_ART - [global::System.Text.Json.Serialization.JsonPropertyName("style_preset")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.StylePresetV3JsonConverter))] - public global::Ideogram.StylePresetV3? StylePreset { get; set; } - - /// - /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). Not supported by V_1, V_1_TURBO, V_2A and V_2A_TURBO models. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("color_palette")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ColorPaletteWithPresetNameOrMembersJsonConverter))] - public global::Ideogram.ColorPaletteWithPresetNameOrMembers? ColorPalette { get; set; } - - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - ///
- /// [AAFF5733, 0133FF57, DE3357FF] - [global::System.Text.Json.Serialization.JsonPropertyName("style_codes")] - public global::System.Collections.Generic.IList? StyleCodes { get; set; } - - /// - /// A set of images to use as style references (max size 25MB per image; the whole request must stay under 50MB). The images should be in JPEG, PNG or WebP format. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("style_reference_images")] - public global::System.Collections.Generic.IList? StyleReferenceImages { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The image being reframed (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The image being reframed (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The resolutions supported for Ideogram 3.0.
- /// Example: 1280x800 - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - /// - /// - /// A predefined style preset that applies a specific artistic style to the generated image.
- /// Example: BRIGHT_ART - /// - /// - /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). Not supported by V_1, V_1_TURBO, V_2A and V_2A_TURBO models. - /// - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - /// - /// - /// A set of images to use as style references (max size 25MB per image; the whole request must stay under 50MB). The images should be in JPEG, PNG or WebP format. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ReframeImageRequestV3( - byte[] image, - string imagename, - global::Ideogram.ResolutionV3 resolution, - int? numImages, - int? seed, - global::Ideogram.RenderingSpeed? renderingSpeed, - global::Ideogram.StylePresetV3? stylePreset, - global::Ideogram.ColorPaletteWithPresetNameOrMembers? colorPalette, - global::System.Collections.Generic.IList? styleCodes, - global::System.Collections.Generic.IList? styleReferenceImages) - { - this.Image = image ?? throw new global::System.ArgumentNullException(nameof(image)); - this.Imagename = imagename ?? throw new global::System.ArgumentNullException(nameof(imagename)); - this.Resolution = resolution; - this.NumImages = numImages; - this.Seed = seed; - this.RenderingSpeed = renderingSpeed; - this.StylePreset = stylePreset; - this.ColorPalette = colorPalette; - this.StyleCodes = styleCodes; - this.StyleReferenceImages = styleReferenceImages; - } - - /// - /// Initializes a new instance of the class. - /// - public ReframeImageRequestV3() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeNanoBanana2Request.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeNanoBanana2Request.Json.g.cs new file mode 100644 index 00000000..9cd737ef --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeNanoBanana2Request.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ReframeNanoBanana2Request + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ReframeNanoBanana2Request? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ReframeNanoBanana2Request), + jsonSerializerContext) as global::Ideogram.ReframeNanoBanana2Request; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ReframeNanoBanana2Request? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ReframeNanoBanana2Request? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ReframeNanoBanana2Request), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ReframeNanoBanana2Request; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeNanoBanana2Request.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeNanoBanana2Request.g.cs new file mode 100644 index 00000000..b03b2199 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeNanoBanana2Request.g.cs @@ -0,0 +1,113 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// + /// + public sealed partial class ReframeNanoBanana2Request + { + /// + /// The JPEG, PNG, or WEBP image to reframe (max 50MB). + /// + [global::System.Text.Json.Serialization.JsonPropertyName("image")] + [global::System.Text.Json.Serialization.JsonRequired] + public required byte[] Image { get; set; } + + /// + /// The JPEG, PNG, or WEBP image to reframe (max 50MB). + /// + [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Imagename { get; set; } + + /// + /// Aspect ratios Nano Banana 2 can reframe an image to. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.NanoBanana2ReframeAspectRatioJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Ideogram.NanoBanana2ReframeAspectRatio AspectRatio { get; set; } + + /// + /// API-key requests are always private. For bearer-authenticated
+ /// requests, this controls whether the result is private; when
+ /// omitted, it follows the caller's plan entitlement. Enterprise
+ /// generations are always private. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("private")] + public bool? Private { get; set; } + + /// + /// The number of output images to generate.
+ /// Default Value: 1 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] + public int? NumImages { get; set; } + + /// + /// Random seed. Set for reproducible generation. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("seed")] + public int? Seed { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The JPEG, PNG, or WEBP image to reframe (max 50MB). + /// + /// + /// The JPEG, PNG, or WEBP image to reframe (max 50MB). + /// + /// + /// Aspect ratios Nano Banana 2 can reframe an image to. + /// + /// + /// API-key requests are always private. For bearer-authenticated
+ /// requests, this controls whether the result is private; when
+ /// omitted, it follows the caller's plan entitlement. Enterprise
+ /// generations are always private. + /// + /// + /// The number of output images to generate.
+ /// Default Value: 1 + /// + /// + /// Random seed. Set for reproducible generation. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ReframeNanoBanana2Request( + byte[] image, + string imagename, + global::Ideogram.NanoBanana2ReframeAspectRatio aspectRatio, + bool? @private, + int? numImages, + int? seed) + { + this.Image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + this.Imagename = imagename ?? throw new global::System.ArgumentNullException(nameof(imagename)); + this.AspectRatio = aspectRatio; + this.Private = @private; + this.NumImages = numImages; + this.Seed = seed; + } + + /// + /// Initializes a new instance of the class. + /// + public ReframeNanoBanana2Request() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeNanoBanana2Response.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeNanoBanana2Response.Json.g.cs new file mode 100644 index 00000000..c1edd1f9 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeNanoBanana2Response.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ReframeNanoBanana2Response + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ReframeNanoBanana2Response? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ReframeNanoBanana2Response), + jsonSerializerContext) as global::Ideogram.ReframeNanoBanana2Response; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ReframeNanoBanana2Response? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ReframeNanoBanana2Response? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ReframeNanoBanana2Response), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ReframeNanoBanana2Response; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeNanoBanana2Response.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeNanoBanana2Response.g.cs new file mode 100644 index 00000000..449fe773 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeNanoBanana2Response.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ReframeNanoBanana2Response + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeNanoBanana2Response2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeNanoBanana2Response2.Json.g.cs new file mode 100644 index 00000000..dc43a185 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeNanoBanana2Response2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ReframeNanoBanana2Response2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ReframeNanoBanana2Response2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ReframeNanoBanana2Response2), + jsonSerializerContext) as global::Ideogram.ReframeNanoBanana2Response2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ReframeNanoBanana2Response2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ReframeNanoBanana2Response2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ReframeNanoBanana2Response2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ReframeNanoBanana2Response2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeNanoBanana2Response2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeNanoBanana2Response2.g.cs new file mode 100644 index 00000000..b23c250c --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeNanoBanana2Response2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ReframeNanoBanana2Response2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeNanoBanana2Response3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeNanoBanana2Response3.Json.g.cs new file mode 100644 index 00000000..cff7a155 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeNanoBanana2Response3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ReframeNanoBanana2Response3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ReframeNanoBanana2Response3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ReframeNanoBanana2Response3), + jsonSerializerContext) as global::Ideogram.ReframeNanoBanana2Response3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ReframeNanoBanana2Response3? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ReframeNanoBanana2Response3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ReframeNanoBanana2Response3), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ReframeNanoBanana2Response3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeNanoBanana2Response3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeNanoBanana2Response3.g.cs new file mode 100644 index 00000000..d6c29714 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeNanoBanana2Response3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ReframeNanoBanana2Response3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeNanoBanana2Response4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeNanoBanana2Response4.Json.g.cs new file mode 100644 index 00000000..7fe28a56 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeNanoBanana2Response4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ReframeNanoBanana2Response4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ReframeNanoBanana2Response4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ReframeNanoBanana2Response4), + jsonSerializerContext) as global::Ideogram.ReframeNanoBanana2Response4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ReframeNanoBanana2Response4? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ReframeNanoBanana2Response4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ReframeNanoBanana2Response4), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ReframeNanoBanana2Response4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeNanoBanana2Response4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeNanoBanana2Response4.g.cs new file mode 100644 index 00000000..4229344e --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeNanoBanana2Response4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ReframeNanoBanana2Response4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeNanoBanana2Response5.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeNanoBanana2Response5.Json.g.cs new file mode 100644 index 00000000..18f1b678 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeNanoBanana2Response5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ReframeNanoBanana2Response5 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ReframeNanoBanana2Response5? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ReframeNanoBanana2Response5), + jsonSerializerContext) as global::Ideogram.ReframeNanoBanana2Response5; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ReframeNanoBanana2Response5? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ReframeNanoBanana2Response5? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ReframeNanoBanana2Response5), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ReframeNanoBanana2Response5; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ReframeNanoBanana2Response5.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeNanoBanana2Response5.g.cs new file mode 100644 index 00000000..8dff1711 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ReframeNanoBanana2Response5.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ReframeNanoBanana2Response5 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageIdeogramV3CharacterRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageIdeogramV3CharacterRequest.Json.g.cs deleted file mode 100644 index 535b5f4a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageIdeogramV3CharacterRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class RemixImageIdeogramV3CharacterRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.RemixImageIdeogramV3CharacterRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.RemixImageIdeogramV3CharacterRequest), - jsonSerializerContext) as global::Ideogram.RemixImageIdeogramV3CharacterRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.RemixImageIdeogramV3CharacterRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.RemixImageIdeogramV3CharacterRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.RemixImageIdeogramV3CharacterRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.RemixImageIdeogramV3CharacterRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageIdeogramV3CharacterRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageIdeogramV3CharacterRequest.g.cs deleted file mode 100644 index bf51738e..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageIdeogramV3CharacterRequest.g.cs +++ /dev/null @@ -1,394 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Upload one character reference as `character_reference_images` using
- /// `multipart/form-data`. - ///
- public sealed partial class RemixImageIdeogramV3CharacterRequest - { - /// - /// The prompt that guides the remix. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Prompt { get; set; } - - /// - /// The existing upload or generated image to transform. Supply this or `image`, never both. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image_asset_identifier")] - public global::Ideogram.AssetIdentifier? ImageAssetIdentifier { get; set; } - - /// - /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image")] - public byte[]? Image { get; set; } - - /// - /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] - public string? Imagename { get; set; } - - /// - /// Optional. How closely the result should follow the source image, from 1 to 100. When omitted the server chooses a value from your prompt, which is the usual case. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image_weight")] - public int? ImageWeight { get; set; } - - /// - /// Description of what to exclude from the images. Descriptions in the prompt take precedence over descriptions in the negative prompt. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("negative_prompt")] - public string? NegativePrompt { get; set; } - - /// - /// A saved character to feature, by its URL-safe base64 collection id. Takes priority over `character_reference_images` if both are supplied. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("character_reference_collection_id")] - public string? CharacterReferenceCollectionId { get; set; } - - /// - /// Optional URL-safe base64 version id pinning a specific version of the `character_reference_collection_id` collection. Ignored without it. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("character_reference_collection_version_id")] - public string? CharacterReferenceCollectionVersionId { get; set; } - - /// - /// An existing upload or generated image asset to use as the character reference, by reference. Takes priority over `character_reference_images` if both are supplied. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("character_reference_asset_identifiers")] - public global::System.Collections.Generic.IList? CharacterReferenceAssetIdentifiers { get; set; } - - /// - /// An image to use as the character reference (max 25MB). JPEG, PNG, and WEBP are supported. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("character_reference_images")] - public global::System.Collections.Generic.IList? CharacterReferenceImages { get; set; } - - /// - /// An existing upload or generated image asset to use as the character reference mask, by reference. The same rules as `character_reference_mask` apply. Takes priority over `character_reference_mask` if both are supplied. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("character_reference_mask_asset_identifier")] - public global::Ideogram.AssetIdentifier? CharacterReferenceMaskAssetIdentifier { get; set; } - - /// - /// Optional grayscale mask for the character reference image, the same size as that image, marking where the character is. Only JPEG, PNG, and WEBP formats are supported. Multipart requests only; cannot be combined with `character_reference_collection_id`. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("character_reference_mask")] - public byte[]? CharacterReferenceMask { get; set; } - - /// - /// Optional grayscale mask for the character reference image, the same size as that image, marking where the character is. Only JPEG, PNG, and WEBP formats are supported. Multipart requests only; cannot be combined with `character_reference_collection_id`. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("character_reference_maskname")] - public string? CharacterReferenceMaskname { get; set; } - - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - ///
- /// 12345 - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// The resolutions supported for Ideogram 3.0.
- /// Example: 1280x800 - ///
- /// 1280x800 - [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ResolutionV3JsonConverter))] - public global::Ideogram.ResolutionV3? Resolution { get; set; } - - /// - /// Output aspect ratio. Cannot be combined with resolution. Generation defaults to 1x1; remix keeps the source ratio when both fields are omitted. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.AspectRatioV3JsonConverter))] - public global::Ideogram.AspectRatioV3? AspectRatio { get; set; } - - /// - /// The rendering speed to use.
- /// Default Value: default - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("rendering_speed")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.RemixImageIdeogramV3CharacterRequestRenderingSpeedJsonConverter))] - public global::Ideogram.RemixImageIdeogramV3CharacterRequestRenderingSpeed? RenderingSpeed { get; set; } - - /// - /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
- /// Default Value: auto - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.MagicPromptModeJsonConverter))] - public global::Ideogram.MagicPromptMode? MagicPrompt { get; set; } - - /// - /// The number of images to generate.
- /// Default Value: 1 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] - public int? NumImages { get; set; } - - /// - /// The style type to remix the character with. Defaults to `auto`.
- /// Default Value: auto - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("style_type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.RemixImageIdeogramV3CharacterRequestStyleTypeJsonConverter))] - public global::Ideogram.RemixImageIdeogramV3CharacterRequestStyleType? StyleType { get; set; } - - /// - /// A saved style to apply, by its URL-safe base64 collection id. Takes priority over `style_reference_images` if both are supplied. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("style_reference_collection_id")] - public string? StyleReferenceCollectionId { get; set; } - - /// - /// Optional URL-safe base64 version id pinning a specific version of the `style_reference_collection_id` collection. Ignored without it. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("style_reference_collection_version_id")] - public string? StyleReferenceCollectionVersionId { get; set; } - - /// - /// Existing upload or generated image assets to use as style references, by reference. Takes priority over `style_reference_images` if both are supplied. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("style_reference_asset_identifiers")] - public global::System.Collections.Generic.IList? StyleReferenceAssetIdentifiers { get; set; } - - /// - /// Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("style_reference_images")] - public global::System.Collections.Generic.IList? StyleReferenceImages { get; set; } - - /// - /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("enable_copyright_detection")] - public bool? EnableCopyrightDetection { get; set; } - - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
- /// Default Value: false - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("async")] - public bool? Async { get; set; } - - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - ///
- /// https://api.example.com/webhooks/ideogram - [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] - public string? WebhookUrl { get; set; } - - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("target_collection_id")] - public string? TargetCollectionId { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The prompt that guides the remix. - /// - /// - /// The existing upload or generated image to transform. Supply this or `image`, never both. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. - /// - /// - /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. - /// - /// - /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. - /// - /// - /// Optional. How closely the result should follow the source image, from 1 to 100. When omitted the server chooses a value from your prompt, which is the usual case. - /// - /// - /// Description of what to exclude from the images. Descriptions in the prompt take precedence over descriptions in the negative prompt. - /// - /// - /// A saved character to feature, by its URL-safe base64 collection id. Takes priority over `character_reference_images` if both are supplied. - /// - /// - /// Optional URL-safe base64 version id pinning a specific version of the `character_reference_collection_id` collection. Ignored without it. - /// - /// - /// An existing upload or generated image asset to use as the character reference, by reference. Takes priority over `character_reference_images` if both are supplied. - /// - /// - /// An image to use as the character reference (max 25MB). JPEG, PNG, and WEBP are supported. - /// - /// - /// An existing upload or generated image asset to use as the character reference mask, by reference. The same rules as `character_reference_mask` apply. Takes priority over `character_reference_mask` if both are supplied. - /// - /// - /// Optional grayscale mask for the character reference image, the same size as that image, marking where the character is. Only JPEG, PNG, and WEBP formats are supported. Multipart requests only; cannot be combined with `character_reference_collection_id`. - /// - /// - /// Optional grayscale mask for the character reference image, the same size as that image, marking where the character is. Only JPEG, PNG, and WEBP formats are supported. Multipart requests only; cannot be combined with `character_reference_collection_id`. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The resolutions supported for Ideogram 3.0.
- /// Example: 1280x800 - /// - /// - /// Output aspect ratio. Cannot be combined with resolution. Generation defaults to 1x1; remix keeps the source ratio when both fields are omitted. - /// - /// - /// The rendering speed to use.
- /// Default Value: default - /// - /// - /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
- /// Default Value: auto - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// The style type to remix the character with. Defaults to `auto`.
- /// Default Value: auto - /// - /// - /// A saved style to apply, by its URL-safe base64 collection id. Takes priority over `style_reference_images` if both are supplied. - /// - /// - /// Optional URL-safe base64 version id pinning a specific version of the `style_reference_collection_id` collection. Ignored without it. - /// - /// - /// Existing upload or generated image assets to use as style references, by reference. Takes priority over `style_reference_images` if both are supplied. - /// - /// - /// Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported. - /// - /// - /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. - /// - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public RemixImageIdeogramV3CharacterRequest( - string prompt, - global::Ideogram.AssetIdentifier? imageAssetIdentifier, - byte[]? image, - string? imagename, - int? imageWeight, - string? negativePrompt, - string? characterReferenceCollectionId, - string? characterReferenceCollectionVersionId, - global::System.Collections.Generic.IList? characterReferenceAssetIdentifiers, - global::System.Collections.Generic.IList? characterReferenceImages, - global::Ideogram.AssetIdentifier? characterReferenceMaskAssetIdentifier, - byte[]? characterReferenceMask, - string? characterReferenceMaskname, - int? seed, - global::Ideogram.ResolutionV3? resolution, - global::Ideogram.AspectRatioV3? aspectRatio, - global::Ideogram.RemixImageIdeogramV3CharacterRequestRenderingSpeed? renderingSpeed, - global::Ideogram.MagicPromptMode? magicPrompt, - int? numImages, - global::Ideogram.RemixImageIdeogramV3CharacterRequestStyleType? styleType, - string? styleReferenceCollectionId, - string? styleReferenceCollectionVersionId, - global::System.Collections.Generic.IList? styleReferenceAssetIdentifiers, - global::System.Collections.Generic.IList? styleReferenceImages, - bool? enableCopyrightDetection, - bool? async, - string? webhookUrl, - bool? @private, - string? targetCollectionId) - { - this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); - this.ImageAssetIdentifier = imageAssetIdentifier; - this.Image = image; - this.Imagename = imagename; - this.ImageWeight = imageWeight; - this.NegativePrompt = negativePrompt; - this.CharacterReferenceCollectionId = characterReferenceCollectionId; - this.CharacterReferenceCollectionVersionId = characterReferenceCollectionVersionId; - this.CharacterReferenceAssetIdentifiers = characterReferenceAssetIdentifiers; - this.CharacterReferenceImages = characterReferenceImages; - this.CharacterReferenceMaskAssetIdentifier = characterReferenceMaskAssetIdentifier; - this.CharacterReferenceMask = characterReferenceMask; - this.CharacterReferenceMaskname = characterReferenceMaskname; - this.Seed = seed; - this.Resolution = resolution; - this.AspectRatio = aspectRatio; - this.RenderingSpeed = renderingSpeed; - this.MagicPrompt = magicPrompt; - this.NumImages = numImages; - this.StyleType = styleType; - this.StyleReferenceCollectionId = styleReferenceCollectionId; - this.StyleReferenceCollectionVersionId = styleReferenceCollectionVersionId; - this.StyleReferenceAssetIdentifiers = styleReferenceAssetIdentifiers; - this.StyleReferenceImages = styleReferenceImages; - this.EnableCopyrightDetection = enableCopyrightDetection; - this.Async = async; - this.WebhookUrl = webhookUrl; - this.Private = @private; - this.TargetCollectionId = targetCollectionId; - } - - /// - /// Initializes a new instance of the class. - /// - public RemixImageIdeogramV3CharacterRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageIdeogramV3CharacterRequestRenderingSpeed.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageIdeogramV3CharacterRequestRenderingSpeed.g.cs deleted file mode 100644 index 4b5c20b9..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageIdeogramV3CharacterRequestRenderingSpeed.g.cs +++ /dev/null @@ -1,58 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The rendering speed to use.
- /// Default Value: default - ///
- public enum RemixImageIdeogramV3CharacterRequestRenderingSpeed - { - /// - /// - /// - Default, - /// - /// - /// - Quality, - /// - /// - /// - Turbo, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class RemixImageIdeogramV3CharacterRequestRenderingSpeedExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this RemixImageIdeogramV3CharacterRequestRenderingSpeed value) - { - return value switch - { - RemixImageIdeogramV3CharacterRequestRenderingSpeed.Default => "default", - RemixImageIdeogramV3CharacterRequestRenderingSpeed.Quality => "quality", - RemixImageIdeogramV3CharacterRequestRenderingSpeed.Turbo => "turbo", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static RemixImageIdeogramV3CharacterRequestRenderingSpeed? ToEnum(string value) - { - return value switch - { - "default" => RemixImageIdeogramV3CharacterRequestRenderingSpeed.Default, - "quality" => RemixImageIdeogramV3CharacterRequestRenderingSpeed.Quality, - "turbo" => RemixImageIdeogramV3CharacterRequestRenderingSpeed.Turbo, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageIdeogramV3CharacterRequestStyleType.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageIdeogramV3CharacterRequestStyleType.g.cs deleted file mode 100644 index 5a8594b8..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageIdeogramV3CharacterRequestStyleType.g.cs +++ /dev/null @@ -1,58 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The style type to remix the character with. Defaults to `auto`.
- /// Default Value: auto - ///
- public enum RemixImageIdeogramV3CharacterRequestStyleType - { - /// - /// - /// - Auto, - /// - /// - /// - Fiction, - /// - /// - /// - Realistic, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class RemixImageIdeogramV3CharacterRequestStyleTypeExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this RemixImageIdeogramV3CharacterRequestStyleType value) - { - return value switch - { - RemixImageIdeogramV3CharacterRequestStyleType.Auto => "auto", - RemixImageIdeogramV3CharacterRequestStyleType.Fiction => "fiction", - RemixImageIdeogramV3CharacterRequestStyleType.Realistic => "realistic", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static RemixImageIdeogramV3CharacterRequestStyleType? ToEnum(string value) - { - return value switch - { - "auto" => RemixImageIdeogramV3CharacterRequestStyleType.Auto, - "fiction" => RemixImageIdeogramV3CharacterRequestStyleType.Fiction, - "realistic" => RemixImageIdeogramV3CharacterRequestStyleType.Realistic, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageIdeogramV3CharacterResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageIdeogramV3CharacterResponse.g.cs index a5146bce..249c33a4 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageIdeogramV3CharacterResponse.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageIdeogramV3CharacterResponse.g.cs @@ -9,8 +9,7 @@ namespace Ideogram /// `data`. Requests with `async` set to true omit `data`; poll for
/// completion and results with `GET /v2/generations/{generation_id}`
/// using the returned `generation_id`. The seed reports the value the
- /// request resolved to when the caller left it unset.
- /// Example: {"data":[{"seed":12345,"prompt":"prompt","resolution":"1024x1024","url":"https://openapi-generator.tech","is_image_safe":true},{"seed":12345,"prompt":"prompt","resolution":"1024x1024","url":"https://openapi-generator.tech","is_image_safe":true}],"seed":12345,"generation_id":"generation_id"} + /// request resolved to when the caller left it unset. /// public sealed partial class RemixImageIdeogramV3CharacterResponse { @@ -29,10 +28,8 @@ public sealed partial class RemixImageIdeogramV3CharacterResponse public global::System.Collections.Generic.IList? Data { get; set; } /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. ///
- /// 12345 [global::System.Text.Json.Serialization.JsonPropertyName("seed")] [global::System.Text.Json.Serialization.JsonRequired] public required int Seed { get; set; } @@ -51,8 +48,7 @@ public sealed partial class RemixImageIdeogramV3CharacterResponse /// `GET /v2/generations/{generation_id}` polling endpoint. /// /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. /// /// /// The remixed images, in generation order. Present only for synchronous requests (`async` omitted or false). diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageIdeogramV3CustomModelRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageIdeogramV3CustomModelRequest.Json.g.cs deleted file mode 100644 index e403a393..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageIdeogramV3CustomModelRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class RemixImageIdeogramV3CustomModelRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.RemixImageIdeogramV3CustomModelRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.RemixImageIdeogramV3CustomModelRequest), - jsonSerializerContext) as global::Ideogram.RemixImageIdeogramV3CustomModelRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.RemixImageIdeogramV3CustomModelRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.RemixImageIdeogramV3CustomModelRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.RemixImageIdeogramV3CustomModelRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.RemixImageIdeogramV3CustomModelRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageIdeogramV3CustomModelRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageIdeogramV3CustomModelRequest.g.cs deleted file mode 100644 index 2a9e21e6..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageIdeogramV3CustomModelRequest.g.cs +++ /dev/null @@ -1,331 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - public sealed partial class RemixImageIdeogramV3CustomModelRequest - { - /// - /// The prompt that guides the remix. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Prompt { get; set; } - - /// - /// The custom model URI returned by the custom-model API, in the form `model/<model_name>/version/<version_name>`. The authenticated user or organization must have access to the model.
- /// Example: model/my-custom-model/version/1 - ///
- /// model/my-custom-model/version/1 - [global::System.Text.Json.Serialization.JsonPropertyName("custom_model_uri")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string CustomModelUri { get; set; } - - /// - /// The existing upload or generated image to transform. Supply this or `image`, never both. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image_asset_identifier")] - public global::Ideogram.AssetIdentifier? ImageAssetIdentifier { get; set; } - - /// - /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image")] - public byte[]? Image { get; set; } - - /// - /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] - public string? Imagename { get; set; } - - /// - /// Optional. How closely the result should follow the source image, from 1 to 100. When omitted the server chooses a value from your prompt, which is the usual case. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image_weight")] - public int? ImageWeight { get; set; } - - /// - /// Description of what to exclude from the images. Descriptions in the prompt take precedence over descriptions in the negative prompt. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("negative_prompt")] - public string? NegativePrompt { get; set; } - - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - ///
- /// 12345 - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// The resolutions supported for Ideogram 3.0.
- /// Example: 1280x800 - ///
- /// 1280x800 - [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ResolutionV3JsonConverter))] - public global::Ideogram.ResolutionV3? Resolution { get; set; } - - /// - /// Output aspect ratio. Cannot be combined with resolution. Generation defaults to 1x1; remix keeps the source ratio when both fields are omitted. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.AspectRatioV3JsonConverter))] - public global::Ideogram.AspectRatioV3? AspectRatio { get; set; } - - /// - /// The rendering speed to use. When omitted, the server chooses a speed supported by the selected custom model. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("rendering_speed")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.RemixImageIdeogramV3CustomModelRequestRenderingSpeedJsonConverter))] - public global::Ideogram.RemixImageIdeogramV3CustomModelRequestRenderingSpeed? RenderingSpeed { get; set; } - - /// - /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
- /// Default Value: auto - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.MagicPromptModeJsonConverter))] - public global::Ideogram.MagicPromptMode? MagicPrompt { get; set; } - - /// - /// The number of images to generate.
- /// Default Value: 1 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] - public int? NumImages { get; set; } - - /// - /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). - /// - [global::System.Text.Json.Serialization.JsonPropertyName("color_palette")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.IdeogramColorPaletteJsonConverter))] - public global::Ideogram.IdeogramColorPalette? ColorPalette { get; set; } - - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - ///
- /// [AAFF5733, 0133FF57, DE3357FF] - [global::System.Text.Json.Serialization.JsonPropertyName("style_codes")] - public global::System.Collections.Generic.IList? StyleCodes { get; set; } - - /// - /// A predefined style preset to apply to the remixed images. Cannot be combined with style codes or style references. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("style_preset")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.IdeogramV3StylePresetJsonConverter))] - public global::Ideogram.IdeogramV3StylePreset? StylePreset { get; set; } - - /// - /// Existing upload or generated image assets to use as style references, by reference. Takes priority over `style_reference_images` if both are supplied. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("style_reference_asset_identifiers")] - public global::System.Collections.Generic.IList? StyleReferenceAssetIdentifiers { get; set; } - - /// - /// Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported. Multipart requests only. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("style_reference_images")] - public global::System.Collections.Generic.IList? StyleReferenceImages { get; set; } - - /// - /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("enable_copyright_detection")] - public bool? EnableCopyrightDetection { get; set; } - - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
- /// Default Value: false - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("async")] - public bool? Async { get; set; } - - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - ///
- /// https://api.example.com/webhooks/ideogram - [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] - public string? WebhookUrl { get; set; } - - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("target_collection_id")] - public string? TargetCollectionId { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The prompt that guides the remix. - /// - /// - /// The custom model URI returned by the custom-model API, in the form `model/<model_name>/version/<version_name>`. The authenticated user or organization must have access to the model.
- /// Example: model/my-custom-model/version/1 - /// - /// - /// The existing upload or generated image to transform. Supply this or `image`, never both. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. - /// - /// - /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. - /// - /// - /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. - /// - /// - /// Optional. How closely the result should follow the source image, from 1 to 100. When omitted the server chooses a value from your prompt, which is the usual case. - /// - /// - /// Description of what to exclude from the images. Descriptions in the prompt take precedence over descriptions in the negative prompt. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The resolutions supported for Ideogram 3.0.
- /// Example: 1280x800 - /// - /// - /// Output aspect ratio. Cannot be combined with resolution. Generation defaults to 1x1; remix keeps the source ratio when both fields are omitted. - /// - /// - /// The rendering speed to use. When omitted, the server chooses a speed supported by the selected custom model. - /// - /// - /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
- /// Default Value: auto - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). - /// - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - /// - /// - /// A predefined style preset to apply to the remixed images. Cannot be combined with style codes or style references. - /// - /// - /// Existing upload or generated image assets to use as style references, by reference. Takes priority over `style_reference_images` if both are supplied. - /// - /// - /// Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported. Multipart requests only. - /// - /// - /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. - /// - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public RemixImageIdeogramV3CustomModelRequest( - string prompt, - string customModelUri, - global::Ideogram.AssetIdentifier? imageAssetIdentifier, - byte[]? image, - string? imagename, - int? imageWeight, - string? negativePrompt, - int? seed, - global::Ideogram.ResolutionV3? resolution, - global::Ideogram.AspectRatioV3? aspectRatio, - global::Ideogram.RemixImageIdeogramV3CustomModelRequestRenderingSpeed? renderingSpeed, - global::Ideogram.MagicPromptMode? magicPrompt, - int? numImages, - global::Ideogram.IdeogramColorPalette? colorPalette, - global::System.Collections.Generic.IList? styleCodes, - global::Ideogram.IdeogramV3StylePreset? stylePreset, - global::System.Collections.Generic.IList? styleReferenceAssetIdentifiers, - global::System.Collections.Generic.IList? styleReferenceImages, - bool? enableCopyrightDetection, - bool? async, - string? webhookUrl, - bool? @private, - string? targetCollectionId) - { - this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); - this.CustomModelUri = customModelUri ?? throw new global::System.ArgumentNullException(nameof(customModelUri)); - this.ImageAssetIdentifier = imageAssetIdentifier; - this.Image = image; - this.Imagename = imagename; - this.ImageWeight = imageWeight; - this.NegativePrompt = negativePrompt; - this.Seed = seed; - this.Resolution = resolution; - this.AspectRatio = aspectRatio; - this.RenderingSpeed = renderingSpeed; - this.MagicPrompt = magicPrompt; - this.NumImages = numImages; - this.ColorPalette = colorPalette; - this.StyleCodes = styleCodes; - this.StylePreset = stylePreset; - this.StyleReferenceAssetIdentifiers = styleReferenceAssetIdentifiers; - this.StyleReferenceImages = styleReferenceImages; - this.EnableCopyrightDetection = enableCopyrightDetection; - this.Async = async; - this.WebhookUrl = webhookUrl; - this.Private = @private; - this.TargetCollectionId = targetCollectionId; - } - - /// - /// Initializes a new instance of the class. - /// - public RemixImageIdeogramV3CustomModelRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageIdeogramV3CustomModelRequestRenderingSpeed.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageIdeogramV3CustomModelRequestRenderingSpeed.g.cs deleted file mode 100644 index c4e8131c..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageIdeogramV3CustomModelRequestRenderingSpeed.g.cs +++ /dev/null @@ -1,57 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The rendering speed to use. When omitted, the server chooses a speed supported by the selected custom model. - /// - public enum RemixImageIdeogramV3CustomModelRequestRenderingSpeed - { - /// - /// - /// - Default, - /// - /// - /// - Quality, - /// - /// - /// - Turbo, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class RemixImageIdeogramV3CustomModelRequestRenderingSpeedExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this RemixImageIdeogramV3CustomModelRequestRenderingSpeed value) - { - return value switch - { - RemixImageIdeogramV3CustomModelRequestRenderingSpeed.Default => "default", - RemixImageIdeogramV3CustomModelRequestRenderingSpeed.Quality => "quality", - RemixImageIdeogramV3CustomModelRequestRenderingSpeed.Turbo => "turbo", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static RemixImageIdeogramV3CustomModelRequestRenderingSpeed? ToEnum(string value) - { - return value switch - { - "default" => RemixImageIdeogramV3CustomModelRequestRenderingSpeed.Default, - "quality" => RemixImageIdeogramV3CustomModelRequestRenderingSpeed.Quality, - "turbo" => RemixImageIdeogramV3CustomModelRequestRenderingSpeed.Turbo, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageIdeogramV3CustomModelResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageIdeogramV3CustomModelResponse.g.cs index 6c93d474..c6a8a45c 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageIdeogramV3CustomModelResponse.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageIdeogramV3CustomModelResponse.g.cs @@ -9,8 +9,7 @@ namespace Ideogram /// `data`. Requests with `async` set to true omit `data`; poll for
/// completion and results with `GET /v2/generations/{generation_id}`
/// using the returned `generation_id`. The seed reports the value the
- /// request resolved to when the caller left it unset.
- /// Example: {"data":[{"seed":12345,"prompt":"prompt","resolution":"1024x1024","url":"https://openapi-generator.tech","is_image_safe":true},{"seed":12345,"prompt":"prompt","resolution":"1024x1024","url":"https://openapi-generator.tech","is_image_safe":true}],"seed":12345,"generation_id":"generation_id"} + /// request resolved to when the caller left it unset. /// public sealed partial class RemixImageIdeogramV3CustomModelResponse { @@ -29,10 +28,8 @@ public sealed partial class RemixImageIdeogramV3CustomModelResponse public global::System.Collections.Generic.IList? Data { get; set; } /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. ///
- /// 12345 [global::System.Text.Json.Serialization.JsonPropertyName("seed")] [global::System.Text.Json.Serialization.JsonRequired] public required int Seed { get; set; } @@ -51,8 +48,7 @@ public sealed partial class RemixImageIdeogramV3CustomModelResponse /// `GET /v2/generations/{generation_id}` polling endpoint. /// /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. /// /// /// The remixed images, in generation order. Present only for synchronous requests (`async` omitted or false). diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageIdeogramV3Request.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageIdeogramV3Request.Json.g.cs deleted file mode 100644 index a8d5c915..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageIdeogramV3Request.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class RemixImageIdeogramV3Request - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.RemixImageIdeogramV3Request? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.RemixImageIdeogramV3Request), - jsonSerializerContext) as global::Ideogram.RemixImageIdeogramV3Request; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.RemixImageIdeogramV3Request? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.RemixImageIdeogramV3Request? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.RemixImageIdeogramV3Request), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.RemixImageIdeogramV3Request; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageIdeogramV3Request.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageIdeogramV3Request.g.cs deleted file mode 100644 index 88412d57..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageIdeogramV3Request.g.cs +++ /dev/null @@ -1,357 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - public sealed partial class RemixImageIdeogramV3Request - { - /// - /// The prompt that guides the remix. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Prompt { get; set; } - - /// - /// The existing upload or generated image to transform. Supply this or `image`, never both. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image_asset_identifier")] - public global::Ideogram.AssetIdentifier? ImageAssetIdentifier { get; set; } - - /// - /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image")] - public byte[]? Image { get; set; } - - /// - /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] - public string? Imagename { get; set; } - - /// - /// Optional. How closely the result should follow the source image, from 1 to 100. When omitted the server chooses a value from your prompt, which is the usual case. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image_weight")] - public int? ImageWeight { get; set; } - - /// - /// Description of what to exclude from the images. Descriptions in the prompt take precedence over descriptions in the negative prompt. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("negative_prompt")] - public string? NegativePrompt { get; set; } - - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - ///
- /// 12345 - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// The resolutions supported for Ideogram 3.0.
- /// Example: 1280x800 - ///
- /// 1280x800 - [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ResolutionV3JsonConverter))] - public global::Ideogram.ResolutionV3? Resolution { get; set; } - - /// - /// Output aspect ratio. Cannot be combined with resolution. Generation defaults to 1x1; remix keeps the source ratio when both fields are omitted. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.AspectRatioV3JsonConverter))] - public global::Ideogram.AspectRatioV3? AspectRatio { get; set; } - - /// - /// The rendering speed to use.
- /// Default Value: default - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("rendering_speed")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.RemixImageIdeogramV3RequestRenderingSpeedJsonConverter))] - public global::Ideogram.RemixImageIdeogramV3RequestRenderingSpeed? RenderingSpeed { get; set; } - - /// - /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
- /// Default Value: auto - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.MagicPromptModeJsonConverter))] - public global::Ideogram.MagicPromptMode? MagicPrompt { get; set; } - - /// - /// The number of images to generate.
- /// Default Value: 1 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] - public int? NumImages { get; set; } - - /// - /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). - /// - [global::System.Text.Json.Serialization.JsonPropertyName("color_palette")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.IdeogramColorPaletteJsonConverter))] - public global::Ideogram.IdeogramColorPalette? ColorPalette { get; set; } - - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - ///
- /// [AAFF5733, 0133FF57, DE3357FF] - [global::System.Text.Json.Serialization.JsonPropertyName("style_codes")] - public global::System.Collections.Generic.IList? StyleCodes { get; set; } - - /// - /// The style type to generate with.
- /// Default Value: general
- /// Example: general - ///
- /// general - [global::System.Text.Json.Serialization.JsonPropertyName("style_type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.IdeogramV3StyleTypeJsonConverter))] - public global::Ideogram.IdeogramV3StyleType? StyleType { get; set; } - - /// - /// A predefined style preset to apply to the remixed images. Cannot be combined with style codes or style references. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("style_preset")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.IdeogramV3StylePresetJsonConverter))] - public global::Ideogram.IdeogramV3StylePreset? StylePreset { get; set; } - - /// - /// A saved style to apply, by its URL-safe base64 collection id. Cannot be combined with `style_reference_images`. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("style_reference_collection_id")] - public string? StyleReferenceCollectionId { get; set; } - - /// - /// Optional URL-safe base64 version id pinning a specific version of the `style_reference_collection_id` collection. Ignored without it. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("style_reference_collection_version_id")] - public string? StyleReferenceCollectionVersionId { get; set; } - - /// - /// Existing upload or generated image assets to use as style references, by reference. Cannot be combined with `style_reference_collection_id` or `style_reference_images`. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("style_reference_asset_identifiers")] - public global::System.Collections.Generic.IList? StyleReferenceAssetIdentifiers { get; set; } - - /// - /// Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("style_reference_images")] - public global::System.Collections.Generic.IList? StyleReferenceImages { get; set; } - - /// - /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("enable_copyright_detection")] - public bool? EnableCopyrightDetection { get; set; } - - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
- /// Default Value: false - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("async")] - public bool? Async { get; set; } - - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - ///
- /// https://api.example.com/webhooks/ideogram - [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] - public string? WebhookUrl { get; set; } - - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("target_collection_id")] - public string? TargetCollectionId { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The prompt that guides the remix. - /// - /// - /// The existing upload or generated image to transform. Supply this or `image`, never both. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. - /// - /// - /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. - /// - /// - /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first. - /// - /// - /// Optional. How closely the result should follow the source image, from 1 to 100. When omitted the server chooses a value from your prompt, which is the usual case. - /// - /// - /// Description of what to exclude from the images. Descriptions in the prompt take precedence over descriptions in the negative prompt. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The resolutions supported for Ideogram 3.0.
- /// Example: 1280x800 - /// - /// - /// Output aspect ratio. Cannot be combined with resolution. Generation defaults to 1x1; remix keeps the source ratio when both fields are omitted. - /// - /// - /// The rendering speed to use.
- /// Default Value: default - /// - /// - /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.
- /// Default Value: auto - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). - /// - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - /// - /// - /// The style type to generate with.
- /// Default Value: general
- /// Example: general - /// - /// - /// A predefined style preset to apply to the remixed images. Cannot be combined with style codes or style references. - /// - /// - /// A saved style to apply, by its URL-safe base64 collection id. Cannot be combined with `style_reference_images`. - /// - /// - /// Optional URL-safe base64 version id pinning a specific version of the `style_reference_collection_id` collection. Ignored without it. - /// - /// - /// Existing upload or generated image assets to use as style references, by reference. Cannot be combined with `style_reference_collection_id` or `style_reference_images`. - /// - /// - /// Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported. - /// - /// - /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. - /// - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public RemixImageIdeogramV3Request( - string prompt, - global::Ideogram.AssetIdentifier? imageAssetIdentifier, - byte[]? image, - string? imagename, - int? imageWeight, - string? negativePrompt, - int? seed, - global::Ideogram.ResolutionV3? resolution, - global::Ideogram.AspectRatioV3? aspectRatio, - global::Ideogram.RemixImageIdeogramV3RequestRenderingSpeed? renderingSpeed, - global::Ideogram.MagicPromptMode? magicPrompt, - int? numImages, - global::Ideogram.IdeogramColorPalette? colorPalette, - global::System.Collections.Generic.IList? styleCodes, - global::Ideogram.IdeogramV3StyleType? styleType, - global::Ideogram.IdeogramV3StylePreset? stylePreset, - string? styleReferenceCollectionId, - string? styleReferenceCollectionVersionId, - global::System.Collections.Generic.IList? styleReferenceAssetIdentifiers, - global::System.Collections.Generic.IList? styleReferenceImages, - bool? enableCopyrightDetection, - bool? async, - string? webhookUrl, - bool? @private, - string? targetCollectionId) - { - this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); - this.ImageAssetIdentifier = imageAssetIdentifier; - this.Image = image; - this.Imagename = imagename; - this.ImageWeight = imageWeight; - this.NegativePrompt = negativePrompt; - this.Seed = seed; - this.Resolution = resolution; - this.AspectRatio = aspectRatio; - this.RenderingSpeed = renderingSpeed; - this.MagicPrompt = magicPrompt; - this.NumImages = numImages; - this.ColorPalette = colorPalette; - this.StyleCodes = styleCodes; - this.StyleType = styleType; - this.StylePreset = stylePreset; - this.StyleReferenceCollectionId = styleReferenceCollectionId; - this.StyleReferenceCollectionVersionId = styleReferenceCollectionVersionId; - this.StyleReferenceAssetIdentifiers = styleReferenceAssetIdentifiers; - this.StyleReferenceImages = styleReferenceImages; - this.EnableCopyrightDetection = enableCopyrightDetection; - this.Async = async; - this.WebhookUrl = webhookUrl; - this.Private = @private; - this.TargetCollectionId = targetCollectionId; - } - - /// - /// Initializes a new instance of the class. - /// - public RemixImageIdeogramV3Request() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageIdeogramV3RequestRenderingSpeed.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageIdeogramV3RequestRenderingSpeed.g.cs deleted file mode 100644 index 7cb65e40..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageIdeogramV3RequestRenderingSpeed.g.cs +++ /dev/null @@ -1,58 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The rendering speed to use.
- /// Default Value: default - ///
- public enum RemixImageIdeogramV3RequestRenderingSpeed - { - /// - /// - /// - Default, - /// - /// - /// - Quality, - /// - /// - /// - Turbo, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class RemixImageIdeogramV3RequestRenderingSpeedExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this RemixImageIdeogramV3RequestRenderingSpeed value) - { - return value switch - { - RemixImageIdeogramV3RequestRenderingSpeed.Default => "default", - RemixImageIdeogramV3RequestRenderingSpeed.Quality => "quality", - RemixImageIdeogramV3RequestRenderingSpeed.Turbo => "turbo", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static RemixImageIdeogramV3RequestRenderingSpeed? ToEnum(string value) - { - return value switch - { - "default" => RemixImageIdeogramV3RequestRenderingSpeed.Default, - "quality" => RemixImageIdeogramV3RequestRenderingSpeed.Quality, - "turbo" => RemixImageIdeogramV3RequestRenderingSpeed.Turbo, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageIdeogramV3Response.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageIdeogramV3Response.g.cs index 36db33be..b12edb4f 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageIdeogramV3Response.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageIdeogramV3Response.g.cs @@ -9,8 +9,7 @@ namespace Ideogram /// `data`. Requests with `async` set to true omit `data`; poll for
/// completion and results with `GET /v2/generations/{generation_id}`
/// using the returned `generation_id`. The seed reports the value the
- /// request resolved to when the caller left it unset.
- /// Example: {"data":[{"seed":12345,"prompt":"prompt","resolution":"1024x1024","url":"https://openapi-generator.tech","is_image_safe":true},{"seed":12345,"prompt":"prompt","resolution":"1024x1024","url":"https://openapi-generator.tech","is_image_safe":true}],"seed":12345,"generation_id":"generation_id"} + /// request resolved to when the caller left it unset. /// public sealed partial class RemixImageIdeogramV3Response { @@ -29,10 +28,8 @@ public sealed partial class RemixImageIdeogramV3Response public global::System.Collections.Generic.IList? Data { get; set; } /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. ///
- /// 12345 [global::System.Text.Json.Serialization.JsonPropertyName("seed")] [global::System.Text.Json.Serialization.JsonRequired] public required int Seed { get; set; } @@ -51,8 +48,7 @@ public sealed partial class RemixImageIdeogramV3Response /// `GET /v2/generations/{generation_id}` polling endpoint. /// /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. /// /// /// The remixed images, in generation order. Present only for synchronous requests (`async` omitted or false). diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageIdeogramV4Request.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageIdeogramV4Request.Json.g.cs deleted file mode 100644 index 3cdd420f..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageIdeogramV4Request.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class RemixImageIdeogramV4Request - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.RemixImageIdeogramV4Request? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.RemixImageIdeogramV4Request), - jsonSerializerContext) as global::Ideogram.RemixImageIdeogramV4Request; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.RemixImageIdeogramV4Request? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.RemixImageIdeogramV4Request? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.RemixImageIdeogramV4Request), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.RemixImageIdeogramV4Request; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageIdeogramV4Request.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageIdeogramV4Request.g.cs deleted file mode 100644 index f20a56a3..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageIdeogramV4Request.g.cs +++ /dev/null @@ -1,211 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Remixes are not reproducible, so no `seed` is accepted; the response
- /// reports the seed that was used. - ///
- public sealed partial class RemixImageIdeogramV4Request - { - /// - /// The prompt that guides the remix. It is always read as an editing instruction, so there is no `magic_prompt` option. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Prompt { get; set; } - - /// - /// The existing upload or generated image to transform. Supply this or `image`, never both. Omit `resolution` to keep its shape. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image_asset_identifier")] - public global::Ideogram.AssetIdentifier? ImageAssetIdentifier { get; set; } - - /// - /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` to keep its shape. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image")] - public byte[]? Image { get; set; } - - /// - /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` to keep its shape. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] - public string? Imagename { get; set; } - - /// - /// Optional. How closely the result should follow the source image, from 1 to 100. When omitted the server chooses a value from your prompt, which is the usual case. Only accepted when the output keeps the source image's shape: combining `image_weight` with a `resolution` whose aspect ratio differs from the source's is rejected with a 400. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image_weight")] - public int? ImageWeight { get; set; } - - /// - /// The number of images to generate.
- /// Default Value: 1 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] - public int? NumImages { get; set; } - - /// - /// Optional. When supplied, the images are generated at this
- /// resolution. When omitted, the source image's shape is kept. A
- /// resolution whose aspect ratio differs from the source's cannot
- /// be combined with `image_weight`. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ResolutionV4JsonConverter))] - public global::Ideogram.ResolutionV4? Resolution { get; set; } - - /// - /// The rendering speed to use.
- /// Default Value: default - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("rendering_speed")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.RemixImageIdeogramV4RequestRenderingSpeedJsonConverter))] - public global::Ideogram.RemixImageIdeogramV4RequestRenderingSpeed? RenderingSpeed { get; set; } - - /// - /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("enable_copyright_detection")] - public bool? EnableCopyrightDetection { get; set; } - - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
- /// Default Value: false - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("async")] - public bool? Async { get; set; } - - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - ///
- /// https://api.example.com/webhooks/ideogram - [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] - public string? WebhookUrl { get; set; } - - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("target_collection_id")] - public string? TargetCollectionId { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The prompt that guides the remix. It is always read as an editing instruction, so there is no `magic_prompt` option. - /// - /// - /// The existing upload or generated image to transform. Supply this or `image`, never both. Omit `resolution` to keep its shape. - /// - /// - /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` to keep its shape. - /// - /// - /// The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` to keep its shape. - /// - /// - /// Optional. How closely the result should follow the source image, from 1 to 100. When omitted the server chooses a value from your prompt, which is the usual case. Only accepted when the output keeps the source image's shape: combining `image_weight` with a `resolution` whose aspect ratio differs from the source's is rejected with a 400. - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Optional. When supplied, the images are generated at this
- /// resolution. When omitted, the source image's shape is kept. A
- /// resolution whose aspect ratio differs from the source's cannot
- /// be combined with `image_weight`. - /// - /// - /// The rendering speed to use.
- /// Default Value: default - /// - /// - /// Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`. - /// - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public RemixImageIdeogramV4Request( - string prompt, - global::Ideogram.AssetIdentifier? imageAssetIdentifier, - byte[]? image, - string? imagename, - int? imageWeight, - int? numImages, - global::Ideogram.ResolutionV4? resolution, - global::Ideogram.RemixImageIdeogramV4RequestRenderingSpeed? renderingSpeed, - bool? enableCopyrightDetection, - bool? async, - string? webhookUrl, - bool? @private, - string? targetCollectionId) - { - this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); - this.ImageAssetIdentifier = imageAssetIdentifier; - this.Image = image; - this.Imagename = imagename; - this.ImageWeight = imageWeight; - this.NumImages = numImages; - this.Resolution = resolution; - this.RenderingSpeed = renderingSpeed; - this.EnableCopyrightDetection = enableCopyrightDetection; - this.Async = async; - this.WebhookUrl = webhookUrl; - this.Private = @private; - this.TargetCollectionId = targetCollectionId; - } - - /// - /// Initializes a new instance of the class. - /// - public RemixImageIdeogramV4Request() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageIdeogramV4RequestRenderingSpeed.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageIdeogramV4RequestRenderingSpeed.g.cs deleted file mode 100644 index 49044f01..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageIdeogramV4RequestRenderingSpeed.g.cs +++ /dev/null @@ -1,58 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The rendering speed to use.
- /// Default Value: default - ///
- public enum RemixImageIdeogramV4RequestRenderingSpeed - { - /// - /// - /// - Default, - /// - /// - /// - Quality, - /// - /// - /// - Turbo, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class RemixImageIdeogramV4RequestRenderingSpeedExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this RemixImageIdeogramV4RequestRenderingSpeed value) - { - return value switch - { - RemixImageIdeogramV4RequestRenderingSpeed.Default => "default", - RemixImageIdeogramV4RequestRenderingSpeed.Quality => "quality", - RemixImageIdeogramV4RequestRenderingSpeed.Turbo => "turbo", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static RemixImageIdeogramV4RequestRenderingSpeed? ToEnum(string value) - { - return value switch - { - "default" => RemixImageIdeogramV4RequestRenderingSpeed.Default, - "quality" => RemixImageIdeogramV4RequestRenderingSpeed.Quality, - "turbo" => RemixImageIdeogramV4RequestRenderingSpeed.Turbo, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageIdeogramV4Response.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageIdeogramV4Response.g.cs index 0bb79ee3..44ae71c7 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageIdeogramV4Response.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageIdeogramV4Response.g.cs @@ -9,8 +9,7 @@ namespace Ideogram /// `data`. Requests with `async` set to true omit `data`; poll for
/// completion and results with `GET /v2/generations/{generation_id}`
/// using the returned `generation_id`. The seed reports the value the
- /// request resolved to.
- /// Example: {"data":[{"seed":12345,"prompt":"prompt","resolution":"1024x1024","url":"https://openapi-generator.tech","is_image_safe":true},{"seed":12345,"prompt":"prompt","resolution":"1024x1024","url":"https://openapi-generator.tech","is_image_safe":true}],"seed":12345,"generation_id":"generation_id"} + /// request resolved to. /// public sealed partial class RemixImageIdeogramV4Response { @@ -29,10 +28,8 @@ public sealed partial class RemixImageIdeogramV4Response public global::System.Collections.Generic.IList? Data { get; set; } /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. ///
- /// 12345 [global::System.Text.Json.Serialization.JsonPropertyName("seed")] [global::System.Text.Json.Serialization.JsonRequired] public required int Seed { get; set; } @@ -51,8 +48,7 @@ public sealed partial class RemixImageIdeogramV4Response /// `GET /v2/generations/{generation_id}` polling endpoint. /// /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. /// /// /// The remixed images, in generation order. Present only for synchronous requests (`async` omitted or false). diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageRequest.Json.g.cs deleted file mode 100644 index 558fcf84..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class RemixImageRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.RemixImageRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.RemixImageRequest), - jsonSerializerContext) as global::Ideogram.RemixImageRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.RemixImageRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.RemixImageRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.RemixImageRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.RemixImageRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageRequest.g.cs deleted file mode 100644 index 6a68585e..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageRequest.g.cs +++ /dev/null @@ -1,74 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// A request to generate an image from a source image and a provided caption, provided images are cropped to match the chosen output aspect ratio. - /// - public sealed partial class RemixImageRequest - { - /// - /// A request to generate a new image using a provided image and a prompt.
- /// Example: {"aspect_ratio":"ASPECT_10_16","magic_prompt_option":"ON","model":"V_2","prompt":"A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there is an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset.","image_weight":50} - ///
- /// {"aspect_ratio":"ASPECT_10_16","magic_prompt_option":"ON","model":"V_2","prompt":"A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there is an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset.","image_weight":50} - [global::System.Text.Json.Serialization.JsonPropertyName("image_request")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.InitialImageRequest ImageRequest { get; set; } - - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image_file")] - [global::System.Text.Json.Serialization.JsonRequired] - public required byte[] ImageFile { get; set; } - - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image_filename")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string ImageFilename { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// A request to generate a new image using a provided image and a prompt.
- /// Example: {"aspect_ratio":"ASPECT_10_16","magic_prompt_option":"ON","model":"V_2","prompt":"A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there is an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset.","image_weight":50} - /// - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public RemixImageRequest( - global::Ideogram.InitialImageRequest imageRequest, - byte[] imageFile, - string imageFilename) - { - this.ImageRequest = imageRequest ?? throw new global::System.ArgumentNullException(nameof(imageRequest)); - this.ImageFile = imageFile ?? throw new global::System.ArgumentNullException(nameof(imageFile)); - this.ImageFilename = imageFilename ?? throw new global::System.ArgumentNullException(nameof(imageFilename)); - } - - /// - /// Initializes a new instance of the class. - /// - public RemixImageRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageRequestV3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageRequestV3.Json.g.cs deleted file mode 100644 index 815695e4..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageRequestV3.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class RemixImageRequestV3 - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.RemixImageRequestV3? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.RemixImageRequestV3), - jsonSerializerContext) as global::Ideogram.RemixImageRequestV3; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.RemixImageRequestV3? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.RemixImageRequestV3? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.RemixImageRequestV3), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.RemixImageRequestV3; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageRequestV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageRequestV3.g.cs deleted file mode 100644 index b9cf1472..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageRequestV3.g.cs +++ /dev/null @@ -1,305 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - public sealed partial class RemixImageRequestV3 - { - /// - /// The image to remix binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image")] - [global::System.Text.Json.Serialization.JsonRequired] - public required byte[] Image { get; set; } - - /// - /// The image to remix binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Imagename { get; set; } - - /// - /// The prompt to use to generate the image.
- /// Example: A photo of a cat - ///
- /// A photo of a cat - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Prompt { get; set; } - - /// - /// Default Value: 50
- /// Example: 50 - ///
- /// 50 - [global::System.Text.Json.Serialization.JsonPropertyName("image_weight")] - public int? ImageWeight { get; set; } - - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - ///
- /// 12345 - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// The resolutions supported for Ideogram 3.0.
- /// Example: 1280x800 - ///
- /// 1280x800 - [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ResolutionV3JsonConverter))] - public global::Ideogram.ResolutionV3? Resolution { get; set; } - - /// - /// Output aspect ratio. Cannot be combined with resolution. Generation defaults to 1x1; remix keeps the source ratio when both fields are omitted. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.AspectRatioV3JsonConverter))] - public global::Ideogram.AspectRatioV3? AspectRatio { get; set; } - - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("rendering_speed")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.RenderingSpeedJsonConverter))] - public global::Ideogram.RenderingSpeed? RenderingSpeed { get; set; } - - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - ///
- /// ON - [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.MagicPromptOptionJsonConverter))] - public global::Ideogram.MagicPromptOption? MagicPrompt { get; set; } - - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt_system_prompt_config_id")] - public string? MagicPromptSystemPromptConfigId { get; set; } - - /// - /// Description of what to exclude from an image. Descriptions in the prompt take precedence
- /// to descriptions in the negative prompt.
- /// Example: brush strokes, painting - ///
- /// brush strokes, painting - [global::System.Text.Json.Serialization.JsonPropertyName("negative_prompt")] - public string? NegativePrompt { get; set; } - - /// - /// Number of images to generate.
- /// Default Value: 1 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] - public int? NumImages { get; set; } - - /// - /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). Not supported by V_1, V_1_TURBO, V_2A and V_2A_TURBO models. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("color_palette")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ColorPaletteWithPresetNameOrMembersJsonConverter))] - public global::Ideogram.ColorPaletteWithPresetNameOrMembers? ColorPalette { get; set; } - - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - ///
- /// [AAFF5733, 0133FF57, DE3357FF] - [global::System.Text.Json.Serialization.JsonPropertyName("style_codes")] - public global::System.Collections.Generic.IList? StyleCodes { get; set; } - - /// - /// The style type to generate with.
- /// Default Value: GENERAL
- /// Example: GENERAL - ///
- /// GENERAL - [global::System.Text.Json.Serialization.JsonPropertyName("style_type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.StyleTypeV3JsonConverter))] - public global::Ideogram.StyleTypeV3? StyleType { get; set; } - - /// - /// A predefined style preset that applies a specific artistic style to the generated image.
- /// Example: BRIGHT_ART - ///
- /// BRIGHT_ART - [global::System.Text.Json.Serialization.JsonPropertyName("style_preset")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.StylePresetV3JsonConverter))] - public global::Ideogram.StylePresetV3? StylePreset { get; set; } - - /// - /// A custom model URI in the format model/<model_name>/version/<version_name>.
- /// When provided, the model version and style will be resolved from this URI, and style_type is not required.
- /// Example: model/my-custom-model/version/1 - ///
- /// model/my-custom-model/version/1 - [global::System.Text.Json.Serialization.JsonPropertyName("custom_model_uri")] - public string? CustomModelUri { get; set; } - - /// - /// A set of images to use as style references (max size 25MB per image; the whole request must stay under 50MB). The images should be in JPEG, PNG or WebP format. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("style_reference_images")] - public global::System.Collections.Generic.IList? StyleReferenceImages { get; set; } - - /// - /// Generations with character reference are subject to the character reference pricing. A set of images to use as character references (max size 25MB per image; the whole request must stay under 50MB), currently only supports 1 character reference image. The images should be in JPEG, PNG or WebP format. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("character_reference_images")] - public global::System.Collections.Generic.IList? CharacterReferenceImages { get; set; } - - /// - /// Optional masks for character reference images. When provided, must match the number of character_reference_images. Each mask should be a grayscale image of the same dimensions as the corresponding character reference image. The images should be in JPEG, PNG or WebP format. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("character_reference_images_mask")] - public global::System.Collections.Generic.IList? CharacterReferenceImagesMask { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The image to remix binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The image to remix binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The prompt to use to generate the image.
- /// Example: A photo of a cat - /// - /// - /// Default Value: 50
- /// Example: 50 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The resolutions supported for Ideogram 3.0.
- /// Example: 1280x800 - /// - /// - /// Output aspect ratio. Cannot be combined with resolution. Generation defaults to 1x1; remix keeps the source ratio when both fields are omitted. - /// - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// Description of what to exclude from an image. Descriptions in the prompt take precedence
- /// to descriptions in the negative prompt.
- /// Example: brush strokes, painting - /// - /// - /// Number of images to generate.
- /// Default Value: 1 - /// - /// - /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). Not supported by V_1, V_1_TURBO, V_2A and V_2A_TURBO models. - /// - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - /// - /// - /// The style type to generate with.
- /// Default Value: GENERAL
- /// Example: GENERAL - /// - /// - /// A predefined style preset that applies a specific artistic style to the generated image.
- /// Example: BRIGHT_ART - /// - /// - /// A custom model URI in the format model/<model_name>/version/<version_name>.
- /// When provided, the model version and style will be resolved from this URI, and style_type is not required.
- /// Example: model/my-custom-model/version/1 - /// - /// - /// A set of images to use as style references (max size 25MB per image; the whole request must stay under 50MB). The images should be in JPEG, PNG or WebP format. - /// - /// - /// Generations with character reference are subject to the character reference pricing. A set of images to use as character references (max size 25MB per image; the whole request must stay under 50MB), currently only supports 1 character reference image. The images should be in JPEG, PNG or WebP format. - /// - /// - /// Optional masks for character reference images. When provided, must match the number of character_reference_images. Each mask should be a grayscale image of the same dimensions as the corresponding character reference image. The images should be in JPEG, PNG or WebP format. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public RemixImageRequestV3( - byte[] image, - string imagename, - string prompt, - int? imageWeight, - int? seed, - global::Ideogram.ResolutionV3? resolution, - global::Ideogram.AspectRatioV3? aspectRatio, - global::Ideogram.RenderingSpeed? renderingSpeed, - global::Ideogram.MagicPromptOption? magicPrompt, - string? magicPromptSystemPromptConfigId, - string? negativePrompt, - int? numImages, - global::Ideogram.ColorPaletteWithPresetNameOrMembers? colorPalette, - global::System.Collections.Generic.IList? styleCodes, - global::Ideogram.StyleTypeV3? styleType, - global::Ideogram.StylePresetV3? stylePreset, - string? customModelUri, - global::System.Collections.Generic.IList? styleReferenceImages, - global::System.Collections.Generic.IList? characterReferenceImages, - global::System.Collections.Generic.IList? characterReferenceImagesMask) - { - this.Image = image ?? throw new global::System.ArgumentNullException(nameof(image)); - this.Imagename = imagename ?? throw new global::System.ArgumentNullException(nameof(imagename)); - this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); - this.ImageWeight = imageWeight; - this.Seed = seed; - this.Resolution = resolution; - this.AspectRatio = aspectRatio; - this.RenderingSpeed = renderingSpeed; - this.MagicPrompt = magicPrompt; - this.MagicPromptSystemPromptConfigId = magicPromptSystemPromptConfigId; - this.NegativePrompt = negativePrompt; - this.NumImages = numImages; - this.ColorPalette = colorPalette; - this.StyleCodes = styleCodes; - this.StyleType = styleType; - this.StylePreset = stylePreset; - this.CustomModelUri = customModelUri; - this.StyleReferenceImages = styleReferenceImages; - this.CharacterReferenceImages = characterReferenceImages; - this.CharacterReferenceImagesMask = characterReferenceImagesMask; - } - - /// - /// Initializes a new instance of the class. - /// - public RemixImageRequestV3() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageRequestV4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageRequestV4.Json.g.cs deleted file mode 100644 index e9f4d268..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageRequestV4.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class RemixImageRequestV4 - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.RemixImageRequestV4? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.RemixImageRequestV4), - jsonSerializerContext) as global::Ideogram.RemixImageRequestV4; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.RemixImageRequestV4? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.RemixImageRequestV4? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.RemixImageRequestV4), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.RemixImageRequestV4; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageRequestV4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageRequestV4.g.cs deleted file mode 100644 index 72a271e2..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageRequestV4.g.cs +++ /dev/null @@ -1,135 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - public sealed partial class RemixImageRequestV4 - { - /// - /// The initial image binary (max 25MB); only JPEG, WebP and PNG formats are supported. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image")] - [global::System.Text.Json.Serialization.JsonRequired] - public required byte[] Image { get; set; } - - /// - /// The initial image binary (max 25MB); only JPEG, WebP and PNG formats are supported. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Imagename { get; set; } - - /// - /// The text prompt that guides the remix. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("text_prompt")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string TextPrompt { get; set; } - - /// - /// Optional. How strongly the output should resemble the input image. Higher values keep
- /// the input image's structure; lower values allow the prompt to drive the output more.
- /// When omitted, the weight is chosen automatically from the edit instruction; supplying
- /// a value overrides that automatic choice. Only accepted when the output keeps the input
- /// image's shape: combining image_weight with a resolution whose aspect ratio differs
- /// from the input image's is rejected with a 400. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("image_weight")] - public int? ImageWeight { get; set; } - - /// - /// Optional. When supplied, the images are generated at this resolution. When omitted,
- /// the input image's shape is kept. A resolution whose aspect ratio differs from the
- /// input image's cannot be combined with image_weight. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ResolutionV4JsonConverter))] - public global::Ideogram.ResolutionV4? Resolution { get; set; } - - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("rendering_speed")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.RenderingSpeedJsonConverter))] - public global::Ideogram.RenderingSpeed? RenderingSpeed { get; set; } - - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). See GenerateImageRequestV3 for details. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("enable_copyright_detection")] - public bool? EnableCopyrightDetection { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The initial image binary (max 25MB); only JPEG, WebP and PNG formats are supported. - /// - /// - /// The initial image binary (max 25MB); only JPEG, WebP and PNG formats are supported. - /// - /// - /// The text prompt that guides the remix. - /// - /// - /// Optional. How strongly the output should resemble the input image. Higher values keep
- /// the input image's structure; lower values allow the prompt to drive the output more.
- /// When omitted, the weight is chosen automatically from the edit instruction; supplying
- /// a value overrides that automatic choice. Only accepted when the output keeps the input
- /// image's shape: combining image_weight with a resolution whose aspect ratio differs
- /// from the input image's is rejected with a 400. - /// - /// - /// Optional. When supplied, the images are generated at this resolution. When omitted,
- /// the input image's shape is kept. A resolution whose aspect ratio differs from the
- /// input image's cannot be combined with image_weight. - /// - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - /// - /// - /// Optional. Opt this request into post-generation copyright detection (Hive likeness + logo
- /// checks). See GenerateImageRequestV3 for details. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public RemixImageRequestV4( - byte[] image, - string imagename, - string textPrompt, - int? imageWeight, - global::Ideogram.ResolutionV4? resolution, - global::Ideogram.RenderingSpeed? renderingSpeed, - bool? enableCopyrightDetection) - { - this.Image = image ?? throw new global::System.ArgumentNullException(nameof(image)); - this.Imagename = imagename ?? throw new global::System.ArgumentNullException(nameof(imagename)); - this.TextPrompt = textPrompt ?? throw new global::System.ArgumentNullException(nameof(textPrompt)); - this.ImageWeight = imageWeight; - this.Resolution = resolution; - this.RenderingSpeed = renderingSpeed; - this.EnableCopyrightDetection = enableCopyrightDetection; - } - - /// - /// Initializes a new instance of the class. - /// - public RemixImageRequestV4() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.RemixedImageObject.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.RemixedImageObject.g.cs index 7bfe57af..80ca77b8 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.RemixedImageObject.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.RemixedImageObject.g.cs @@ -4,8 +4,7 @@ namespace Ideogram { /// - /// One remixed output image.
- /// Example: {"seed":12345,"prompt":"prompt","resolution":"1024x1024","url":"https://openapi-generator.tech","is_image_safe":true} + /// One remixed output image. ///
public sealed partial class RemixedImageObject { @@ -23,10 +22,8 @@ public sealed partial class RemixedImageObject public required string Prompt { get; set; } /// - /// The resolution of the remixed image, formatted as "WIDTHxHEIGHT".
- /// Example: 1024x1024 + /// The resolution of the remixed image, formatted as "WIDTHxHEIGHT". ///
- /// 1024x1024 [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] [global::System.Text.Json.Serialization.JsonRequired] public required string Resolution { get; set; } @@ -39,10 +36,8 @@ public sealed partial class RemixedImageObject public required bool IsImageSafe { get; set; } /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. ///
- /// 12345 [global::System.Text.Json.Serialization.JsonPropertyName("seed")] [global::System.Text.Json.Serialization.JsonRequired] public required int Seed { get; set; } @@ -60,15 +55,13 @@ public sealed partial class RemixedImageObject /// The final prompt the image was generated from. /// /// - /// The resolution of the remixed image, formatted as "WIDTHxHEIGHT".
- /// Example: 1024x1024 + /// The resolution of the remixed image, formatted as "WIDTHxHEIGHT". /// /// /// Whether the image passed safety checks. If false, `url` is empty. /// /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. /// /// /// The direct link to the remixed image. Empty when the image did not pass safety checks. diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.RemoveBackgroundImageObject.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.RemoveBackgroundImageObject.Json.g.cs deleted file mode 100644 index 67558ee6..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.RemoveBackgroundImageObject.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class RemoveBackgroundImageObject - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.RemoveBackgroundImageObject? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.RemoveBackgroundImageObject), - jsonSerializerContext) as global::Ideogram.RemoveBackgroundImageObject; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.RemoveBackgroundImageObject? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.RemoveBackgroundImageObject? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.RemoveBackgroundImageObject), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.RemoveBackgroundImageObject; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.RemoveBackgroundImageObject.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.RemoveBackgroundImageObject.g.cs deleted file mode 100644 index 723ed680..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.RemoveBackgroundImageObject.g.cs +++ /dev/null @@ -1,61 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - public sealed partial class RemoveBackgroundImageObject - { - /// - /// The direct link to the foreground image. Empty when the image fails safety checks.
- /// Example: https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89 - ///
- /// https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89 - [global::System.Text.Json.Serialization.JsonPropertyName("url")] - public string? Url { get; set; } - - /// - /// Whether the foreground image passes safety checks. If false, the url field will be empty. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("is_image_safe")] - [global::System.Text.Json.Serialization.JsonRequired] - public required bool IsImageSafe { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Whether the foreground image passes safety checks. If false, the url field will be empty. - /// - /// - /// The direct link to the foreground image. Empty when the image fails safety checks.
- /// Example: https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89 - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public RemoveBackgroundImageObject( - bool isImageSafe, - string? url) - { - this.Url = url; - this.IsImageSafe = isImageSafe; - } - - /// - /// Initializes a new instance of the class. - /// - public RemoveBackgroundImageObject() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.RemoveBackgroundRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.RemoveBackgroundRequest.Json.g.cs deleted file mode 100644 index 338734e4..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.RemoveBackgroundRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class RemoveBackgroundRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.RemoveBackgroundRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.RemoveBackgroundRequest), - jsonSerializerContext) as global::Ideogram.RemoveBackgroundRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.RemoveBackgroundRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.RemoveBackgroundRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.RemoveBackgroundRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.RemoveBackgroundRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.RemoveBackgroundRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.RemoveBackgroundRequest.g.cs deleted file mode 100644 index bfe69383..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.RemoveBackgroundRequest.g.cs +++ /dev/null @@ -1,59 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - public sealed partial class RemoveBackgroundRequest - { - /// - /// The image whose background is being removed (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image")] - [global::System.Text.Json.Serialization.JsonRequired] - public required byte[] Image { get; set; } - - /// - /// The image whose background is being removed (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Imagename { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The image whose background is being removed (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The image whose background is being removed (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public RemoveBackgroundRequest( - byte[] image, - string imagename) - { - this.Image = image ?? throw new global::System.ArgumentNullException(nameof(image)); - this.Imagename = imagename ?? throw new global::System.ArgumentNullException(nameof(imagename)); - } - - /// - /// Initializes a new instance of the class. - /// - public RemoveBackgroundRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.RemoveBackgroundResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.RemoveBackgroundResponse.Json.g.cs deleted file mode 100644 index e37a2ea3..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.RemoveBackgroundResponse.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class RemoveBackgroundResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.RemoveBackgroundResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.RemoveBackgroundResponse), - jsonSerializerContext) as global::Ideogram.RemoveBackgroundResponse; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.RemoveBackgroundResponse? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.RemoveBackgroundResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.RemoveBackgroundResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.RemoveBackgroundResponse; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.RemoveBackgroundResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.RemoveBackgroundResponse.g.cs deleted file mode 100644 index 7cd4eca0..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.RemoveBackgroundResponse.g.cs +++ /dev/null @@ -1,61 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The response containing the foreground image with the background removed.
- /// Image links are available for a limited period of time; if you would like to keep the image, you must download it.
- /// Example: {"created":"2000-01-23T04:56:07\u002B00:00","data":[{"url":"https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804\u0026sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89","is_image_safe":true}]} - ///
- public sealed partial class RemoveBackgroundResponse - { - /// - /// The time the request was created. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("created")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.DateTime Created { get; set; } - - /// - /// A list containing the single foreground image. The endpoint always returns exactly one entry. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("data")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList Data { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The time the request was created. - /// - /// - /// A list containing the single foreground image. The endpoint always returns exactly one entry. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public RemoveBackgroundResponse( - global::System.DateTime created, - global::System.Collections.Generic.IList data) - { - this.Created = created; - this.Data = data ?? throw new global::System.ArgumentNullException(nameof(data)); - } - - /// - /// Initializes a new instance of the class. - /// - public RemoveBackgroundResponse() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.RemoveBackgroundV2AssetRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.RemoveBackgroundV2AssetRequest.Json.g.cs deleted file mode 100644 index feabbf9e..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.RemoveBackgroundV2AssetRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class RemoveBackgroundV2AssetRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.RemoveBackgroundV2AssetRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.RemoveBackgroundV2AssetRequest), - jsonSerializerContext) as global::Ideogram.RemoveBackgroundV2AssetRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.RemoveBackgroundV2AssetRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.RemoveBackgroundV2AssetRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.RemoveBackgroundV2AssetRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.RemoveBackgroundV2AssetRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.RemoveBackgroundV2AssetRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.RemoveBackgroundV2AssetRequest.g.cs deleted file mode 100644 index 2226d51c..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.RemoveBackgroundV2AssetRequest.g.cs +++ /dev/null @@ -1,85 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// JSON request body. To upload an image, use `multipart/form-data`. - /// - public sealed partial class RemoveBackgroundV2AssetRequest - { - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - ///
- /// {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - [global::System.Text.Json.Serialization.JsonPropertyName("image_asset_identifier")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.AssetIdentifier ImageAssetIdentifier { get; set; } - - /// - /// A collection you can write to, by its URL-safe base64 collection id. Completed outputs are added to it automatically. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("target_collection_id")] - public string? TargetCollectionId { get; set; } - - /// - /// Whether to keep the result out of the public gallery. Enterprise generations are always private. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// When true, return as soon as the request is accepted; poll `GET /v2/generations/{generation_id}` for the result.
- /// Default Value: false - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("async")] - public bool? Async { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. Completed outputs are added to it automatically. - /// - /// - /// Whether to keep the result out of the public gallery. Enterprise generations are always private. - /// - /// - /// When true, return as soon as the request is accepted; poll `GET /v2/generations/{generation_id}` for the result.
- /// Default Value: false - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public RemoveBackgroundV2AssetRequest( - global::Ideogram.AssetIdentifier imageAssetIdentifier, - string? targetCollectionId, - bool? @private, - bool? async) - { - this.ImageAssetIdentifier = imageAssetIdentifier ?? throw new global::System.ArgumentNullException(nameof(imageAssetIdentifier)); - this.TargetCollectionId = targetCollectionId; - this.Private = @private; - this.Async = async; - } - - /// - /// Initializes a new instance of the class. - /// - public RemoveBackgroundV2AssetRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.RemoveBackgroundV2Request.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.RemoveBackgroundV2Request.Json.g.cs deleted file mode 100644 index af50c755..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.RemoveBackgroundV2Request.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class RemoveBackgroundV2Request - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.RemoveBackgroundV2Request? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.RemoveBackgroundV2Request), - jsonSerializerContext) as global::Ideogram.RemoveBackgroundV2Request; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.RemoveBackgroundV2Request? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.RemoveBackgroundV2Request? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.RemoveBackgroundV2Request), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.RemoveBackgroundV2Request; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.RemoveBackgroundV2Request.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.RemoveBackgroundV2Request.g.cs deleted file mode 100644 index 25d310ba..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.RemoveBackgroundV2Request.g.cs +++ /dev/null @@ -1,110 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Upload the source `image` using `multipart/form-data`. - /// - public sealed partial class RemoveBackgroundV2Request - { - /// - /// The source image. JPEG, PNG, or WebP, up to 25MB. Multipart requests only. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image")] - public byte[]? Image { get; set; } - - /// - /// The source image. JPEG, PNG, or WebP, up to 25MB. Multipart requests only. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] - public string? Imagename { get; set; } - - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - ///
- /// {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - [global::System.Text.Json.Serialization.JsonPropertyName("image_asset_identifier")] - public global::Ideogram.AssetIdentifier? ImageAssetIdentifier { get; set; } - - /// - /// A collection you can write to, by its URL-safe base64 collection id. Completed outputs are added to it automatically. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("target_collection_id")] - public string? TargetCollectionId { get; set; } - - /// - /// Whether to keep the result out of the public gallery. When omitted,
- /// defaults to your plan's setting, or public if your plan has none.
- /// Enterprise generations are always private. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// When false (the default), wait for and return the foreground image. When true, return as soon as the request is accepted; poll `GET /v2/generations/{generation_id}` for the result.
- /// Default Value: false - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("async")] - public bool? Async { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The source image. JPEG, PNG, or WebP, up to 25MB. Multipart requests only. - /// - /// - /// The source image. JPEG, PNG, or WebP, up to 25MB. Multipart requests only. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. Completed outputs are added to it automatically. - /// - /// - /// Whether to keep the result out of the public gallery. When omitted,
- /// defaults to your plan's setting, or public if your plan has none.
- /// Enterprise generations are always private. - /// - /// - /// When false (the default), wait for and return the foreground image. When true, return as soon as the request is accepted; poll `GET /v2/generations/{generation_id}` for the result.
- /// Default Value: false - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public RemoveBackgroundV2Request( - byte[]? image, - string? imagename, - global::Ideogram.AssetIdentifier? imageAssetIdentifier, - string? targetCollectionId, - bool? @private, - bool? async) - { - this.Image = image; - this.Imagename = imagename; - this.ImageAssetIdentifier = imageAssetIdentifier; - this.TargetCollectionId = targetCollectionId; - this.Private = @private; - this.Async = async; - } - - /// - /// Initializes a new instance of the class. - /// - public RemoveBackgroundV2Request() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.RemoveBackgroundV2Response.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.RemoveBackgroundV2Response.g.cs index fed0d2f7..65f52e3c 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.RemoveBackgroundV2Response.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.RemoveBackgroundV2Response.g.cs @@ -8,8 +8,7 @@ namespace Ideogram /// Async requests omit `data`; poll with `generation_id` for the result.
/// If a synchronous request fails after the response has started
/// streaming, the body contains `error` and `status_code` instead of
- /// `generation_id`.
- /// Example: {"generation_id":"zm6IqQd4RPGnwA8gQYEL5Q","data":[{"url":"https://ideogram.ai/assets/foreground.png","is_image_safe":true}]} + /// `generation_id`. /// public sealed partial class RemoveBackgroundV2Response { diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.RemoveObjectFromV2AssetsRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.RemoveObjectFromV2AssetsRequest.Json.g.cs deleted file mode 100644 index 6d717006..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.RemoveObjectFromV2AssetsRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class RemoveObjectFromV2AssetsRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.RemoveObjectFromV2AssetsRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.RemoveObjectFromV2AssetsRequest), - jsonSerializerContext) as global::Ideogram.RemoveObjectFromV2AssetsRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.RemoveObjectFromV2AssetsRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.RemoveObjectFromV2AssetsRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.RemoveObjectFromV2AssetsRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.RemoveObjectFromV2AssetsRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.RemoveObjectFromV2AssetsRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.RemoveObjectFromV2AssetsRequest.g.cs deleted file mode 100644 index fec5a3bd..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.RemoveObjectFromV2AssetsRequest.g.cs +++ /dev/null @@ -1,147 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Upload both the source `image` and the `mask` using `multipart/form-data`. - /// - public sealed partial class RemoveObjectFromV2AssetsRequest - { - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - ///
- /// {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - [global::System.Text.Json.Serialization.JsonPropertyName("image_asset_identifier")] - public global::Ideogram.AssetIdentifier? ImageAssetIdentifier { get; set; } - - /// - /// The source image to remove an object from. JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image")] - public byte[]? Image { get; set; } - - /// - /// The source image to remove an object from. JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] - public string? Imagename { get; set; } - - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - ///
- /// {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - [global::System.Text.Json.Serialization.JsonPropertyName("mask_asset_identifier")] - public global::Ideogram.AssetIdentifier? MaskAssetIdentifier { get; set; } - - /// - /// A black-and-white mask the same size as the image; white (>= 128) marks the region to remove. JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("mask")] - public byte[]? Mask { get; set; } - - /// - /// A black-and-white mask the same size as the image; white (>= 128) marks the region to remove. JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("maskname")] - public string? Maskname { get; set; } - - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - ///
- /// 12345 - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// A collection you can write to, by its URL-safe base64 collection id. Completed outputs are added to it automatically. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("target_collection_id")] - public string? TargetCollectionId { get; set; } - - /// - /// Whether to store the resulting images on Ideogram. Defaults to `false`.
- /// Currently accepted but not yet enforced.
- /// Default Value: false - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("store_assets")] - public bool? StoreAssets { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The source image to remove an object from. JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. - /// - /// - /// The source image to remove an object from. JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// A black-and-white mask the same size as the image; white (>= 128) marks the region to remove. JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. - /// - /// - /// A black-and-white mask the same size as the image; white (>= 128) marks the region to remove. JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. Completed outputs are added to it automatically. - /// - /// - /// Whether to store the resulting images on Ideogram. Defaults to `false`.
- /// Currently accepted but not yet enforced.
- /// Default Value: false - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public RemoveObjectFromV2AssetsRequest( - global::Ideogram.AssetIdentifier? imageAssetIdentifier, - byte[]? image, - string? imagename, - global::Ideogram.AssetIdentifier? maskAssetIdentifier, - byte[]? mask, - string? maskname, - int? seed, - string? targetCollectionId, - bool? storeAssets) - { - this.ImageAssetIdentifier = imageAssetIdentifier; - this.Image = image; - this.Imagename = imagename; - this.MaskAssetIdentifier = maskAssetIdentifier; - this.Mask = mask; - this.Maskname = maskname; - this.Seed = seed; - this.TargetCollectionId = targetCollectionId; - this.StoreAssets = storeAssets; - } - - /// - /// Initializes a new instance of the class. - /// - public RemoveObjectFromV2AssetsRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.RemoveObjectFromV2AssetsResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.RemoveObjectFromV2AssetsResponse.g.cs index 4c5d9eae..7cf47f5e 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.RemoveObjectFromV2AssetsResponse.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.RemoveObjectFromV2AssetsResponse.g.cs @@ -6,8 +6,7 @@ namespace Ideogram /// /// Acknowledgement that the request was accepted. Poll
/// `GET /v2/generations/{generation_id}` with the returned `generation_id`
- /// for the result.
- /// Example: {"generation_id":"generation_id"} + /// for the result. ///
public sealed partial class RemoveObjectFromV2AssetsResponse { diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.RemoveObjectImageObject.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.RemoveObjectImageObject.Json.g.cs deleted file mode 100644 index 86f8f137..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.RemoveObjectImageObject.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class RemoveObjectImageObject - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.RemoveObjectImageObject? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.RemoveObjectImageObject), - jsonSerializerContext) as global::Ideogram.RemoveObjectImageObject; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.RemoveObjectImageObject? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.RemoveObjectImageObject? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.RemoveObjectImageObject), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.RemoveObjectImageObject; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.RemoveObjectImageObject.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.RemoveObjectImageObject.g.cs deleted file mode 100644 index 57971635..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.RemoveObjectImageObject.g.cs +++ /dev/null @@ -1,61 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - public sealed partial class RemoveObjectImageObject - { - /// - /// The direct link to the edited image. Empty when the image fails safety checks.
- /// Example: https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89 - ///
- /// https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89 - [global::System.Text.Json.Serialization.JsonPropertyName("url")] - public string? Url { get; set; } - - /// - /// Whether the edited image passes safety checks. If false, the url field will be empty. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("is_image_safe")] - [global::System.Text.Json.Serialization.JsonRequired] - public required bool IsImageSafe { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Whether the edited image passes safety checks. If false, the url field will be empty. - /// - /// - /// The direct link to the edited image. Empty when the image fails safety checks.
- /// Example: https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89 - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public RemoveObjectImageObject( - bool isImageSafe, - string? url) - { - this.Url = url; - this.IsImageSafe = isImageSafe; - } - - /// - /// Initializes a new instance of the class. - /// - public RemoveObjectImageObject() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.RemoveObjectRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.RemoveObjectRequest.Json.g.cs deleted file mode 100644 index ca9812c9..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.RemoveObjectRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class RemoveObjectRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.RemoveObjectRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.RemoveObjectRequest), - jsonSerializerContext) as global::Ideogram.RemoveObjectRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.RemoveObjectRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.RemoveObjectRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.RemoveObjectRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.RemoveObjectRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.RemoveObjectRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.RemoveObjectRequest.g.cs deleted file mode 100644 index edc5d9c1..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.RemoveObjectRequest.g.cs +++ /dev/null @@ -1,130 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - public sealed partial class RemoveObjectRequest - { - /// - /// The image to remove an object from (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image")] - [global::System.Text.Json.Serialization.JsonRequired] - public required byte[] Image { get; set; } - - /// - /// The image to remove an object from (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Imagename { get; set; } - - /// - /// A binary mask the same size as the image; white (>= 128) marks the region to remove. Only JPEG, WebP and PNG formats are supported. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("mask")] - [global::System.Text.Json.Serialization.JsonRequired] - public required byte[] Mask { get; set; } - - /// - /// A binary mask the same size as the image; white (>= 128) marks the region to remove. Only JPEG, WebP and PNG formats are supported. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("maskname")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Maskname { get; set; } - - /// - /// Optional random seed for reproducible output. When omitted, a random seed is chosen. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// Optional number of diffusion steps. Higher is slower but can improve quality; values are clamped to [1, 128]. When omitted, the model default is used. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("num_inference_steps")] - public int? NumInferenceSteps { get; set; } - - /// - /// Optional classifier-free guidance (CFG) scale. Higher follows the removal instruction more strongly; values are clamped to [1, 10]. When omitted, the model default is used. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("guidance_scale")] - public float? GuidanceScale { get; set; } - - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("rendering_speed")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.RenderingSpeedJsonConverter))] - public global::Ideogram.RenderingSpeed? RenderingSpeed { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The image to remove an object from (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The image to remove an object from (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// A binary mask the same size as the image; white (>= 128) marks the region to remove. Only JPEG, WebP and PNG formats are supported. - /// - /// - /// A binary mask the same size as the image; white (>= 128) marks the region to remove. Only JPEG, WebP and PNG formats are supported. - /// - /// - /// Optional random seed for reproducible output. When omitted, a random seed is chosen. - /// - /// - /// Optional number of diffusion steps. Higher is slower but can improve quality; values are clamped to [1, 128]. When omitted, the model default is used. - /// - /// - /// Optional classifier-free guidance (CFG) scale. Higher follows the removal instruction more strongly; values are clamped to [1, 10]. When omitted, the model default is used. - /// - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public RemoveObjectRequest( - byte[] image, - string imagename, - byte[] mask, - string maskname, - int? seed, - int? numInferenceSteps, - float? guidanceScale, - global::Ideogram.RenderingSpeed? renderingSpeed) - { - this.Image = image ?? throw new global::System.ArgumentNullException(nameof(image)); - this.Imagename = imagename ?? throw new global::System.ArgumentNullException(nameof(imagename)); - this.Mask = mask ?? throw new global::System.ArgumentNullException(nameof(mask)); - this.Maskname = maskname ?? throw new global::System.ArgumentNullException(nameof(maskname)); - this.Seed = seed; - this.NumInferenceSteps = numInferenceSteps; - this.GuidanceScale = guidanceScale; - this.RenderingSpeed = renderingSpeed; - } - - /// - /// Initializes a new instance of the class. - /// - public RemoveObjectRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.RemoveObjectResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.RemoveObjectResponse.Json.g.cs deleted file mode 100644 index c3d0b73d..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.RemoveObjectResponse.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class RemoveObjectResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.RemoveObjectResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.RemoveObjectResponse), - jsonSerializerContext) as global::Ideogram.RemoveObjectResponse; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.RemoveObjectResponse? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.RemoveObjectResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.RemoveObjectResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.RemoveObjectResponse; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.RemoveObjectResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.RemoveObjectResponse.g.cs deleted file mode 100644 index 8f616c44..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.RemoveObjectResponse.g.cs +++ /dev/null @@ -1,61 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The response containing the image with the masked object removed.
- /// Image links are available for a limited period of time; if you would like to keep the image, you must download it.
- /// Example: {"created":"2000-01-23T04:56:07\u002B00:00","data":[{"url":"https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804\u0026sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89","is_image_safe":true}]} - ///
- public sealed partial class RemoveObjectResponse - { - /// - /// The time the request was created. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("created")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.DateTime Created { get; set; } - - /// - /// A list containing the single edited image. The endpoint always returns exactly one entry. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("data")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList Data { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The time the request was created. - /// - /// - /// A list containing the single edited image. The endpoint always returns exactly one entry. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public RemoveObjectResponse( - global::System.DateTime created, - global::System.Collections.Generic.IList data) - { - this.Created = created; - this.Data = data ?? throw new global::System.ArgumentNullException(nameof(data)); - } - - /// - /// Initializes a new instance of the class. - /// - public RemoveObjectResponse() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.RemoveOrganizationMembersRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.RemoveOrganizationMembersRequest.Json.g.cs deleted file mode 100644 index cfa445ef..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.RemoveOrganizationMembersRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class RemoveOrganizationMembersRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.RemoveOrganizationMembersRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.RemoveOrganizationMembersRequest), - jsonSerializerContext) as global::Ideogram.RemoveOrganizationMembersRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.RemoveOrganizationMembersRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.RemoveOrganizationMembersRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.RemoveOrganizationMembersRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.RemoveOrganizationMembersRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.RemoveOrganizationMembersRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.RemoveOrganizationMembersRequest.g.cs deleted file mode 100644 index ec436f09..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.RemoveOrganizationMembersRequest.g.cs +++ /dev/null @@ -1,49 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"members":[{"display_handle":"john_doe","email_address":"john.doe@example.com","user_id":"dXNlcl8xMjM"},{"display_handle":"john_doe","email_address":"john.doe@example.com","user_id":"dXNlcl8xMjM"}]} - /// - public sealed partial class RemoveOrganizationMembersRequest - { - /// - /// List of organization members to remove
- /// Default Value: [] - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("members")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList Members { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// List of organization members to remove
- /// Default Value: [] - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public RemoveOrganizationMembersRequest( - global::System.Collections.Generic.IList members) - { - this.Members = members ?? throw new global::System.ArgumentNullException(nameof(members)); - } - - /// - /// Initializes a new instance of the class. - /// - public RemoveOrganizationMembersRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.RenderingSpeed.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.RenderingSpeed.g.cs deleted file mode 100644 index 1b44f1ae..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.RenderingSpeed.g.cs +++ /dev/null @@ -1,70 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - ///
- public enum RenderingSpeed - { - /// - /// - /// - Balanced, - /// - /// - /// - Default, - /// - /// - /// - Flash, - /// - /// - /// - Quality, - /// - /// - /// - Turbo, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class RenderingSpeedExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this RenderingSpeed value) - { - return value switch - { - RenderingSpeed.Balanced => "BALANCED", - RenderingSpeed.Default => "DEFAULT", - RenderingSpeed.Flash => "FLASH", - RenderingSpeed.Quality => "QUALITY", - RenderingSpeed.Turbo => "TURBO", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static RenderingSpeed? ToEnum(string value) - { - return value switch - { - "BALANCED" => RenderingSpeed.Balanced, - "DEFAULT" => RenderingSpeed.Default, - "FLASH" => RenderingSpeed.Flash, - "QUALITY" => RenderingSpeed.Quality, - "TURBO" => RenderingSpeed.Turbo, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.RenderingSpeedV4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.RenderingSpeedV4.g.cs deleted file mode 100644 index b890b965..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.RenderingSpeedV4.g.cs +++ /dev/null @@ -1,58 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The rendering speed to use. Defaults to DEFAULT.
- /// Default Value: DEFAULT - ///
- public enum RenderingSpeedV4 - { - /// - /// - /// - Default, - /// - /// - /// - Quality, - /// - /// - /// - Turbo, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class RenderingSpeedV4Extensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this RenderingSpeedV4 value) - { - return value switch - { - RenderingSpeedV4.Default => "DEFAULT", - RenderingSpeedV4.Quality => "QUALITY", - RenderingSpeedV4.Turbo => "TURBO", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static RenderingSpeedV4? ToEnum(string value) - { - return value switch - { - "DEFAULT" => RenderingSpeedV4.Default, - "QUALITY" => RenderingSpeedV4.Quality, - "TURBO" => RenderingSpeedV4.Turbo, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ReplaceBackgroundIdeogram45Request.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ReplaceBackgroundIdeogram45Request.Json.g.cs deleted file mode 100644 index 27260282..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ReplaceBackgroundIdeogram45Request.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class ReplaceBackgroundIdeogram45Request - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.ReplaceBackgroundIdeogram45Request? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.ReplaceBackgroundIdeogram45Request), - jsonSerializerContext) as global::Ideogram.ReplaceBackgroundIdeogram45Request; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.ReplaceBackgroundIdeogram45Request? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.ReplaceBackgroundIdeogram45Request? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.ReplaceBackgroundIdeogram45Request), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ReplaceBackgroundIdeogram45Request; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ReplaceBackgroundIdeogram45Request.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ReplaceBackgroundIdeogram45Request.g.cs deleted file mode 100644 index dd6a81fc..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ReplaceBackgroundIdeogram45Request.g.cs +++ /dev/null @@ -1,186 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Upload the source `image` and a `background_reference` using
- /// `multipart/form-data`. The people in `image` are kept. - ///
- public sealed partial class ReplaceBackgroundIdeogram45Request - { - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - ///
- /// {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - [global::System.Text.Json.Serialization.JsonPropertyName("image_asset_identifier")] - public global::Ideogram.AssetIdentifier? ImageAssetIdentifier { get; set; } - - /// - /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
- /// MPO are supported, up to 50 MB. Its longer side may be at most the
- /// model's maximum aspect ratio times its shorter side; a more extreme
- /// proportion is rejected with a 400 that states the allowed range.
- /// Multipart requests only. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("image")] - public byte[]? Image { get; set; } - - /// - /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
- /// MPO are supported, up to 50 MB. Its longer side may be at most the
- /// model's maximum aspect ratio times its shorter side; a more extreme
- /// proportion is rejected with a 400 that states the allowed range.
- /// Multipart requests only. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] - public string? Imagename { get; set; } - - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - ///
- /// {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - [global::System.Text.Json.Serialization.JsonPropertyName("background_reference_asset_identifier")] - public global::Ideogram.AssetIdentifier? BackgroundReferenceAssetIdentifier { get; set; } - - /// - /// A photo of the setting the new background should match. Its people
- /// are not copied. It is held to the same aspect-ratio limit as
- /// `image`. Multipart requests only. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("background_reference")] - public byte[]? BackgroundReference { get; set; } - - /// - /// A photo of the setting the new background should match. Its people
- /// are not copied. It is held to the same aspect-ratio limit as
- /// `image`. Multipart requests only. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("background_referencename")] - public string? BackgroundReferencename { get; set; } - - /// - /// The number of images to generate.
- /// Default Value: 1 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] - public int? NumImages { get; set; } - - /// - /// Whether to keep the result private. When omitted, the result is
- /// private. Enterprise generations are always private. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - ///
- /// https://api.example.com/webhooks/ideogram - [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] - public string? WebhookUrl { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
- /// MPO are supported, up to 50 MB. Its longer side may be at most the
- /// model's maximum aspect ratio times its shorter side; a more extreme
- /// proportion is rejected with a 400 that states the allowed range.
- /// Multipart requests only. - /// - /// - /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
- /// MPO are supported, up to 50 MB. Its longer side may be at most the
- /// model's maximum aspect ratio times its shorter side; a more extreme
- /// proportion is rejected with a 400 that states the allowed range.
- /// Multipart requests only. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// A photo of the setting the new background should match. Its people
- /// are not copied. It is held to the same aspect-ratio limit as
- /// `image`. Multipart requests only. - /// - /// - /// A photo of the setting the new background should match. Its people
- /// are not copied. It is held to the same aspect-ratio limit as
- /// `image`. Multipart requests only. - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Whether to keep the result private. When omitted, the result is
- /// private. Enterprise generations are always private. - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ReplaceBackgroundIdeogram45Request( - global::Ideogram.AssetIdentifier? imageAssetIdentifier, - byte[]? image, - string? imagename, - global::Ideogram.AssetIdentifier? backgroundReferenceAssetIdentifier, - byte[]? backgroundReference, - string? backgroundReferencename, - int? numImages, - bool? @private, - string? webhookUrl) - { - this.ImageAssetIdentifier = imageAssetIdentifier; - this.Image = image; - this.Imagename = imagename; - this.BackgroundReferenceAssetIdentifier = backgroundReferenceAssetIdentifier; - this.BackgroundReference = backgroundReference; - this.BackgroundReferencename = backgroundReferencename; - this.NumImages = numImages; - this.Private = @private; - this.WebhookUrl = webhookUrl; - } - - /// - /// Initializes a new instance of the class. - /// - public ReplaceBackgroundIdeogram45Request() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ReplaceBackgroundIdeogramV3Request.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ReplaceBackgroundIdeogramV3Request.Json.g.cs deleted file mode 100644 index 933b17a5..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ReplaceBackgroundIdeogramV3Request.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class ReplaceBackgroundIdeogramV3Request - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.ReplaceBackgroundIdeogramV3Request? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.ReplaceBackgroundIdeogramV3Request), - jsonSerializerContext) as global::Ideogram.ReplaceBackgroundIdeogramV3Request; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.ReplaceBackgroundIdeogramV3Request? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.ReplaceBackgroundIdeogramV3Request? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.ReplaceBackgroundIdeogramV3Request), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ReplaceBackgroundIdeogramV3Request; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ReplaceBackgroundIdeogramV3Request.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ReplaceBackgroundIdeogramV3Request.g.cs deleted file mode 100644 index 9c6be763..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ReplaceBackgroundIdeogramV3Request.g.cs +++ /dev/null @@ -1,165 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Upload the source `image` using `multipart/form-data`. The prompt
- /// describes only the new background; the foreground subject is detected
- /// and kept automatically. - ///
- public sealed partial class ReplaceBackgroundIdeogramV3Request - { - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - ///
- /// {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - [global::System.Text.Json.Serialization.JsonPropertyName("image_asset_identifier")] - public global::Ideogram.AssetIdentifier? ImageAssetIdentifier { get; set; } - - /// - /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
- /// MPO are supported, up to 50 MB. Multipart requests only.
- /// The longer side must be at most 3 times the shorter side; wider
- /// aspect ratios are rejected with a 400. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("image")] - public byte[]? Image { get; set; } - - /// - /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
- /// MPO are supported, up to 50 MB. Multipart requests only.
- /// The longer side must be at most 3 times the shorter side; wider
- /// aspect ratios are rejected with a 400. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] - public string? Imagename { get; set; } - - /// - /// Plain-language description of the desired new background. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Prompt { get; set; } - - /// - /// The rendering speed to use.
- /// Default Value: default - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("rendering_speed")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ReplaceBackgroundIdeogramV3RequestRenderingSpeedJsonConverter))] - public global::Ideogram.ReplaceBackgroundIdeogramV3RequestRenderingSpeed? RenderingSpeed { get; set; } - - /// - /// The number of images to generate.
- /// Default Value: 1 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] - public int? NumImages { get; set; } - - /// - /// Whether to keep the result private. When omitted, defaults to your
- /// plan's setting. Enterprise generations are always private. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - ///
- /// https://api.example.com/webhooks/ideogram - [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] - public string? WebhookUrl { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Plain-language description of the desired new background. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
- /// MPO are supported, up to 50 MB. Multipart requests only.
- /// The longer side must be at most 3 times the shorter side; wider
- /// aspect ratios are rejected with a 400. - /// - /// - /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
- /// MPO are supported, up to 50 MB. Multipart requests only.
- /// The longer side must be at most 3 times the shorter side; wider
- /// aspect ratios are rejected with a 400. - /// - /// - /// The rendering speed to use.
- /// Default Value: default - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Whether to keep the result private. When omitted, defaults to your
- /// plan's setting. Enterprise generations are always private. - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ReplaceBackgroundIdeogramV3Request( - string prompt, - global::Ideogram.AssetIdentifier? imageAssetIdentifier, - byte[]? image, - string? imagename, - global::Ideogram.ReplaceBackgroundIdeogramV3RequestRenderingSpeed? renderingSpeed, - int? numImages, - bool? @private, - string? webhookUrl) - { - this.ImageAssetIdentifier = imageAssetIdentifier; - this.Image = image; - this.Imagename = imagename; - this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); - this.RenderingSpeed = renderingSpeed; - this.NumImages = numImages; - this.Private = @private; - this.WebhookUrl = webhookUrl; - } - - /// - /// Initializes a new instance of the class. - /// - public ReplaceBackgroundIdeogramV3Request() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ReplaceBackgroundIdeogramV3RequestRenderingSpeed.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ReplaceBackgroundIdeogramV3RequestRenderingSpeed.g.cs deleted file mode 100644 index 783b670a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ReplaceBackgroundIdeogramV3RequestRenderingSpeed.g.cs +++ /dev/null @@ -1,58 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The rendering speed to use.
- /// Default Value: default - ///
- public enum ReplaceBackgroundIdeogramV3RequestRenderingSpeed - { - /// - /// - /// - Default, - /// - /// - /// - Quality, - /// - /// - /// - Turbo, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class ReplaceBackgroundIdeogramV3RequestRenderingSpeedExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this ReplaceBackgroundIdeogramV3RequestRenderingSpeed value) - { - return value switch - { - ReplaceBackgroundIdeogramV3RequestRenderingSpeed.Default => "default", - ReplaceBackgroundIdeogramV3RequestRenderingSpeed.Quality => "quality", - ReplaceBackgroundIdeogramV3RequestRenderingSpeed.Turbo => "turbo", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static ReplaceBackgroundIdeogramV3RequestRenderingSpeed? ToEnum(string value) - { - return value switch - { - "default" => ReplaceBackgroundIdeogramV3RequestRenderingSpeed.Default, - "quality" => ReplaceBackgroundIdeogramV3RequestRenderingSpeed.Quality, - "turbo" => ReplaceBackgroundIdeogramV3RequestRenderingSpeed.Turbo, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ReplaceBackgroundRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ReplaceBackgroundRequest.Json.g.cs deleted file mode 100644 index cd8f09b2..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ReplaceBackgroundRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class ReplaceBackgroundRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.ReplaceBackgroundRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.ReplaceBackgroundRequest), - jsonSerializerContext) as global::Ideogram.ReplaceBackgroundRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.ReplaceBackgroundRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.ReplaceBackgroundRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.ReplaceBackgroundRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ReplaceBackgroundRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ReplaceBackgroundRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ReplaceBackgroundRequest.g.cs deleted file mode 100644 index 9e5017e4..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ReplaceBackgroundRequest.g.cs +++ /dev/null @@ -1,157 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Upload the source `image` using `multipart/form-data`. The prompt
- /// describes only the new background; the foreground subject is detected
- /// and kept automatically. - ///
- public sealed partial class ReplaceBackgroundRequest - { - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - ///
- /// {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - [global::System.Text.Json.Serialization.JsonPropertyName("image_asset_identifier")] - public global::Ideogram.AssetIdentifier? ImageAssetIdentifier { get; set; } - - /// - /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
- /// MPO are supported, up to 50 MB. Multipart requests only. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("image")] - public byte[]? Image { get; set; } - - /// - /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
- /// MPO are supported, up to 50 MB. Multipart requests only. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] - public string? Imagename { get; set; } - - /// - /// Plain-language description of the desired new background. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Prompt { get; set; } - - /// - /// The generation quality level. Defaults to `high`.
- /// Default Value: high - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("quality")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ReplaceBackgroundQualityJsonConverter))] - public global::Ideogram.ReplaceBackgroundQuality? Quality { get; set; } - - /// - /// The number of images to generate.
- /// Default Value: 1 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] - public int? NumImages { get; set; } - - /// - /// Whether to keep the result private. When omitted, defaults to your
- /// plan's setting. Enterprise generations are always private. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - ///
- /// https://api.example.com/webhooks/ideogram - [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] - public string? WebhookUrl { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Plain-language description of the desired new background. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
- /// MPO are supported, up to 50 MB. Multipart requests only. - /// - /// - /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
- /// MPO are supported, up to 50 MB. Multipart requests only. - /// - /// - /// The generation quality level. Defaults to `high`.
- /// Default Value: high - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Whether to keep the result private. When omitted, defaults to your
- /// plan's setting. Enterprise generations are always private. - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ReplaceBackgroundRequest( - string prompt, - global::Ideogram.AssetIdentifier? imageAssetIdentifier, - byte[]? image, - string? imagename, - global::Ideogram.ReplaceBackgroundQuality? quality, - int? numImages, - bool? @private, - string? webhookUrl) - { - this.ImageAssetIdentifier = imageAssetIdentifier; - this.Image = image; - this.Imagename = imagename; - this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); - this.Quality = quality; - this.NumImages = numImages; - this.Private = @private; - this.WebhookUrl = webhookUrl; - } - - /// - /// Initializes a new instance of the class. - /// - public ReplaceBackgroundRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ReplaceBackgroundRequestV3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ReplaceBackgroundRequestV3.Json.g.cs deleted file mode 100644 index 86fb9b91..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ReplaceBackgroundRequestV3.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class ReplaceBackgroundRequestV3 - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.ReplaceBackgroundRequestV3? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.ReplaceBackgroundRequestV3), - jsonSerializerContext) as global::Ideogram.ReplaceBackgroundRequestV3; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.ReplaceBackgroundRequestV3? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.ReplaceBackgroundRequestV3? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.ReplaceBackgroundRequestV3), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ReplaceBackgroundRequestV3; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ReplaceBackgroundRequestV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ReplaceBackgroundRequestV3.g.cs deleted file mode 100644 index 7ac1ae87..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ReplaceBackgroundRequestV3.g.cs +++ /dev/null @@ -1,193 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - public sealed partial class ReplaceBackgroundRequestV3 - { - /// - /// The image whose background is being replaced (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image")] - [global::System.Text.Json.Serialization.JsonRequired] - public required byte[] Image { get; set; } - - /// - /// The image whose background is being replaced (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Imagename { get; set; } - - /// - /// The prompt describing the desired new background.
- /// Example: A vibrant cityscape at night. - ///
- /// A vibrant cityscape at night. - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Prompt { get; set; } - - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - ///
- /// ON - [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.MagicPromptOptionJsonConverter))] - public global::Ideogram.MagicPromptOption? MagicPrompt { get; set; } - - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt_system_prompt_config_id")] - public string? MagicPromptSystemPromptConfigId { get; set; } - - /// - /// The number of images to generate.
- /// Default Value: 1 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] - public int? NumImages { get; set; } - - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - ///
- /// 12345 - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("rendering_speed")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.RenderingSpeedJsonConverter))] - public global::Ideogram.RenderingSpeed? RenderingSpeed { get; set; } - - /// - /// A predefined style preset that applies a specific artistic style to the generated image.
- /// Example: BRIGHT_ART - ///
- /// BRIGHT_ART - [global::System.Text.Json.Serialization.JsonPropertyName("style_preset")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.StylePresetV3JsonConverter))] - public global::Ideogram.StylePresetV3? StylePreset { get; set; } - - /// - /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). Not supported by V_1, V_1_TURBO, V_2A and V_2A_TURBO models. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("color_palette")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ColorPaletteWithPresetNameOrMembersJsonConverter))] - public global::Ideogram.ColorPaletteWithPresetNameOrMembers? ColorPalette { get; set; } - - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - ///
- /// [AAFF5733, 0133FF57, DE3357FF] - [global::System.Text.Json.Serialization.JsonPropertyName("style_codes")] - public global::System.Collections.Generic.IList? StyleCodes { get; set; } - - /// - /// A set of images to use as style references (max size 25MB per image; the whole request must stay under 50MB). The images should be in JPEG, PNG or WebP format. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("style_reference_images")] - public global::System.Collections.Generic.IList? StyleReferenceImages { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The image whose background is being replaced (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The image whose background is being replaced (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The prompt describing the desired new background.
- /// Example: A vibrant cityscape at night. - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - /// - /// - /// A predefined style preset that applies a specific artistic style to the generated image.
- /// Example: BRIGHT_ART - /// - /// - /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). Not supported by V_1, V_1_TURBO, V_2A and V_2A_TURBO models. - /// - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - /// - /// - /// A set of images to use as style references (max size 25MB per image; the whole request must stay under 50MB). The images should be in JPEG, PNG or WebP format. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ReplaceBackgroundRequestV3( - byte[] image, - string imagename, - string prompt, - global::Ideogram.MagicPromptOption? magicPrompt, - string? magicPromptSystemPromptConfigId, - int? numImages, - int? seed, - global::Ideogram.RenderingSpeed? renderingSpeed, - global::Ideogram.StylePresetV3? stylePreset, - global::Ideogram.ColorPaletteWithPresetNameOrMembers? colorPalette, - global::System.Collections.Generic.IList? styleCodes, - global::System.Collections.Generic.IList? styleReferenceImages) - { - this.Image = image ?? throw new global::System.ArgumentNullException(nameof(image)); - this.Imagename = imagename ?? throw new global::System.ArgumentNullException(nameof(imagename)); - this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); - this.MagicPrompt = magicPrompt; - this.MagicPromptSystemPromptConfigId = magicPromptSystemPromptConfigId; - this.NumImages = numImages; - this.Seed = seed; - this.RenderingSpeed = renderingSpeed; - this.StylePreset = stylePreset; - this.ColorPalette = colorPalette; - this.StyleCodes = styleCodes; - this.StyleReferenceImages = styleReferenceImages; - } - - /// - /// Initializes a new instance of the class. - /// - public ReplaceBackgroundRequestV3() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ReplaceBackgroundResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ReplaceBackgroundResponse.g.cs index 2d52466a..f509e331 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ReplaceBackgroundResponse.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ReplaceBackgroundResponse.g.cs @@ -4,8 +4,7 @@ namespace Ideogram { /// - /// Acknowledgement that the request was accepted.
- /// Example: {"generation_id":"generation_id"} + /// Acknowledgement that the request was accepted. ///
public sealed partial class ReplaceBackgroundResponse { diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ResendOrganizationInviteRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ResendOrganizationInviteRequest.Json.g.cs deleted file mode 100644 index 808f9483..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ResendOrganizationInviteRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class ResendOrganizationInviteRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.ResendOrganizationInviteRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.ResendOrganizationInviteRequest), - jsonSerializerContext) as global::Ideogram.ResendOrganizationInviteRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.ResendOrganizationInviteRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.ResendOrganizationInviteRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.ResendOrganizationInviteRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ResendOrganizationInviteRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ResendOrganizationInviteRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ResendOrganizationInviteRequest.g.cs deleted file mode 100644 index 04ffb8a3..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ResendOrganizationInviteRequest.g.cs +++ /dev/null @@ -1,47 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"invite_id":"invite_id"} - /// - public sealed partial class ResendOrganizationInviteRequest - { - /// - /// Base64 URL-safe encoded ID of the invite to resend - /// - [global::System.Text.Json.Serialization.JsonPropertyName("invite_id")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string InviteId { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Base64 URL-safe encoded ID of the invite to resend - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ResendOrganizationInviteRequest( - string inviteId) - { - this.InviteId = inviteId ?? throw new global::System.ArgumentNullException(nameof(inviteId)); - } - - /// - /// Initializes a new instance of the class. - /// - public ResendOrganizationInviteRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ResizeAdImageQuality.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ResizeAdImageQuality.g.cs deleted file mode 100644 index 7def2a64..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ResizeAdImageQuality.g.cs +++ /dev/null @@ -1,57 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - public enum ResizeAdImageQuality - { - /// - /// - /// - High, - /// - /// - /// - Low, - /// - /// - /// - Medium, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class ResizeAdImageQualityExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this ResizeAdImageQuality value) - { - return value switch - { - ResizeAdImageQuality.High => "HIGH", - ResizeAdImageQuality.Low => "LOW", - ResizeAdImageQuality.Medium => "MEDIUM", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static ResizeAdImageQuality? ToEnum(string value) - { - return value switch - { - "HIGH" => ResizeAdImageQuality.High, - "LOW" => ResizeAdImageQuality.Low, - "MEDIUM" => ResizeAdImageQuality.Medium, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ResizeAdImageRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ResizeAdImageRequest.Json.g.cs deleted file mode 100644 index 08a6f5f5..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ResizeAdImageRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class ResizeAdImageRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.ResizeAdImageRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.ResizeAdImageRequest), - jsonSerializerContext) as global::Ideogram.ResizeAdImageRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.ResizeAdImageRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.ResizeAdImageRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.ResizeAdImageRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ResizeAdImageRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ResizeAdImageRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ResizeAdImageRequest.g.cs deleted file mode 100644 index eebe45af..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ResizeAdImageRequest.g.cs +++ /dev/null @@ -1,139 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Supply the source image as raw `image` bytes and the target ad
- /// `resolution`. - ///
- public sealed partial class ResizeAdImageRequest - { - /// - /// The source image asset to reframe, by reference. Provide exactly one of `image_asset_identifier` or `image`. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image_asset_identifier")] - public global::Ideogram.AssetIdentifier? ImageAssetIdentifier { get; set; } - - /// - /// The source image to reframe (max size 25MB), as raw bytes; only JPEG, PNG, and WEBP formats are supported. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image")] - public byte[]? Image { get; set; } - - /// - /// The source image to reframe (max size 25MB), as raw bytes; only JPEG, PNG, and WEBP formats are supported. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] - public string? Imagename { get; set; } - - /// - /// Target ad resolution, formatted as `WIDTHxHEIGHT`. Must be one of
- /// the supported ad resolutions listed above; any other value is
- /// rejected with a 400. Each returned image has exactly these pixel
- /// dimensions. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ResizeAdImageRequestResolutionJsonConverter))] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.ResizeAdImageRequestResolution Resolution { get; set; } - - /// - /// Optional edit instruction to apply while reframing, for example "remove the logo" or "put the price bottom-right". - /// - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - public string? Prompt { get; set; } - - /// - /// Output quality tier. Higher tiers generally improve detail and may take longer to complete. Supported values are LOW, MEDIUM, and HIGH.
- /// Default Value: HIGH - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("quality")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ResizeAdImageQualityJsonConverter))] - public global::Ideogram.ResizeAdImageQuality? Quality { get; set; } - - /// - /// The number of reframed variations to generate.
- /// Default Value: 1 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] - public int? NumImages { get; set; } - - /// - /// Reserved for a future release: accepted for forward compatibility but not yet applied. Resulting assets are not stored to your account regardless of this value.
- /// Default Value: false - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("store_assets")] - public bool? StoreAssets { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Target ad resolution, formatted as `WIDTHxHEIGHT`. Must be one of
- /// the supported ad resolutions listed above; any other value is
- /// rejected with a 400. Each returned image has exactly these pixel
- /// dimensions. - /// - /// - /// The source image asset to reframe, by reference. Provide exactly one of `image_asset_identifier` or `image`. - /// - /// - /// The source image to reframe (max size 25MB), as raw bytes; only JPEG, PNG, and WEBP formats are supported. - /// - /// - /// The source image to reframe (max size 25MB), as raw bytes; only JPEG, PNG, and WEBP formats are supported. - /// - /// - /// Optional edit instruction to apply while reframing, for example "remove the logo" or "put the price bottom-right". - /// - /// - /// Output quality tier. Higher tiers generally improve detail and may take longer to complete. Supported values are LOW, MEDIUM, and HIGH.
- /// Default Value: HIGH - /// - /// - /// The number of reframed variations to generate.
- /// Default Value: 1 - /// - /// - /// Reserved for a future release: accepted for forward compatibility but not yet applied. Resulting assets are not stored to your account regardless of this value.
- /// Default Value: false - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ResizeAdImageRequest( - global::Ideogram.ResizeAdImageRequestResolution resolution, - global::Ideogram.AssetIdentifier? imageAssetIdentifier, - byte[]? image, - string? imagename, - string? prompt, - global::Ideogram.ResizeAdImageQuality? quality, - int? numImages, - bool? storeAssets) - { - this.ImageAssetIdentifier = imageAssetIdentifier; - this.Image = image; - this.Imagename = imagename; - this.Resolution = resolution; - this.Prompt = prompt; - this.Quality = quality; - this.NumImages = numImages; - this.StoreAssets = storeAssets; - } - - /// - /// Initializes a new instance of the class. - /// - public ResizeAdImageRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ResizeAdImageRequestResolution.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ResizeAdImageRequestResolution.g.cs deleted file mode 100644 index 95e8133a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ResizeAdImageRequestResolution.g.cs +++ /dev/null @@ -1,228 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Target ad resolution, formatted as `WIDTHxHEIGHT`. Must be one of
- /// the supported ad resolutions listed above; any other value is
- /// rejected with a 400. Each returned image has exactly these pixel
- /// dimensions. - ///
- public enum ResizeAdImageRequestResolution - { - /// - /// - /// - x1080x1080, - /// - /// - /// - x1080x1350, - /// - /// - /// - x1080x1920, - /// - /// - /// - x1200x3500, - /// - /// - /// - x1280x3840, - /// - /// - /// - x160x600, - /// - /// - /// - x1800x900, - /// - /// - /// - x1920x1080, - /// - /// - /// - x1920x3840, - /// - /// - /// - x2160x3840, - /// - /// - /// - x2240x3584, - /// - /// - /// - x2336x3504, - /// - /// - /// - x2400x2400, - /// - /// - /// - x2448x3264, - /// - /// - /// - x2560x3200, - /// - /// - /// - x2880x2880, - /// - /// - /// - x300x250, - /// - /// - /// - x300x50, - /// - /// - /// - x300x600, - /// - /// - /// - x3200x2560, - /// - /// - /// - x320x100, - /// - /// - /// - x320x50, - /// - /// - /// - x3264x2448, - /// - /// - /// - x336x280, - /// - /// - /// - x3504x2336, - /// - /// - /// - x3584x2240, - /// - /// - /// - x3840x1280, - /// - /// - /// - x3840x1920, - /// - /// - /// - x3840x2160, - /// - /// - /// - x728x90, - /// - /// - /// - x970x250, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class ResizeAdImageRequestResolutionExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this ResizeAdImageRequestResolution value) - { - return value switch - { - ResizeAdImageRequestResolution.x1080x1080 => "1080x1080", - ResizeAdImageRequestResolution.x1080x1350 => "1080x1350", - ResizeAdImageRequestResolution.x1080x1920 => "1080x1920", - ResizeAdImageRequestResolution.x1200x3500 => "1200x3500", - ResizeAdImageRequestResolution.x1280x3840 => "1280x3840", - ResizeAdImageRequestResolution.x160x600 => "160x600", - ResizeAdImageRequestResolution.x1800x900 => "1800x900", - ResizeAdImageRequestResolution.x1920x1080 => "1920x1080", - ResizeAdImageRequestResolution.x1920x3840 => "1920x3840", - ResizeAdImageRequestResolution.x2160x3840 => "2160x3840", - ResizeAdImageRequestResolution.x2240x3584 => "2240x3584", - ResizeAdImageRequestResolution.x2336x3504 => "2336x3504", - ResizeAdImageRequestResolution.x2400x2400 => "2400x2400", - ResizeAdImageRequestResolution.x2448x3264 => "2448x3264", - ResizeAdImageRequestResolution.x2560x3200 => "2560x3200", - ResizeAdImageRequestResolution.x2880x2880 => "2880x2880", - ResizeAdImageRequestResolution.x300x250 => "300x250", - ResizeAdImageRequestResolution.x300x50 => "300x50", - ResizeAdImageRequestResolution.x300x600 => "300x600", - ResizeAdImageRequestResolution.x3200x2560 => "3200x2560", - ResizeAdImageRequestResolution.x320x100 => "320x100", - ResizeAdImageRequestResolution.x320x50 => "320x50", - ResizeAdImageRequestResolution.x3264x2448 => "3264x2448", - ResizeAdImageRequestResolution.x336x280 => "336x280", - ResizeAdImageRequestResolution.x3504x2336 => "3504x2336", - ResizeAdImageRequestResolution.x3584x2240 => "3584x2240", - ResizeAdImageRequestResolution.x3840x1280 => "3840x1280", - ResizeAdImageRequestResolution.x3840x1920 => "3840x1920", - ResizeAdImageRequestResolution.x3840x2160 => "3840x2160", - ResizeAdImageRequestResolution.x728x90 => "728x90", - ResizeAdImageRequestResolution.x970x250 => "970x250", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static ResizeAdImageRequestResolution? ToEnum(string value) - { - return value switch - { - "1080x1080" => ResizeAdImageRequestResolution.x1080x1080, - "1080x1350" => ResizeAdImageRequestResolution.x1080x1350, - "1080x1920" => ResizeAdImageRequestResolution.x1080x1920, - "1200x3500" => ResizeAdImageRequestResolution.x1200x3500, - "1280x3840" => ResizeAdImageRequestResolution.x1280x3840, - "160x600" => ResizeAdImageRequestResolution.x160x600, - "1800x900" => ResizeAdImageRequestResolution.x1800x900, - "1920x1080" => ResizeAdImageRequestResolution.x1920x1080, - "1920x3840" => ResizeAdImageRequestResolution.x1920x3840, - "2160x3840" => ResizeAdImageRequestResolution.x2160x3840, - "2240x3584" => ResizeAdImageRequestResolution.x2240x3584, - "2336x3504" => ResizeAdImageRequestResolution.x2336x3504, - "2400x2400" => ResizeAdImageRequestResolution.x2400x2400, - "2448x3264" => ResizeAdImageRequestResolution.x2448x3264, - "2560x3200" => ResizeAdImageRequestResolution.x2560x3200, - "2880x2880" => ResizeAdImageRequestResolution.x2880x2880, - "300x250" => ResizeAdImageRequestResolution.x300x250, - "300x50" => ResizeAdImageRequestResolution.x300x50, - "300x600" => ResizeAdImageRequestResolution.x300x600, - "3200x2560" => ResizeAdImageRequestResolution.x3200x2560, - "320x100" => ResizeAdImageRequestResolution.x320x100, - "320x50" => ResizeAdImageRequestResolution.x320x50, - "3264x2448" => ResizeAdImageRequestResolution.x3264x2448, - "336x280" => ResizeAdImageRequestResolution.x336x280, - "3504x2336" => ResizeAdImageRequestResolution.x3504x2336, - "3584x2240" => ResizeAdImageRequestResolution.x3584x2240, - "3840x1280" => ResizeAdImageRequestResolution.x3840x1280, - "3840x1920" => ResizeAdImageRequestResolution.x3840x1920, - "3840x2160" => ResizeAdImageRequestResolution.x3840x2160, - "728x90" => ResizeAdImageRequestResolution.x728x90, - "970x250" => ResizeAdImageRequestResolution.x970x250, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.Resolution.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.Resolution.g.cs deleted file mode 100644 index 59773610..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.Resolution.g.cs +++ /dev/null @@ -1,508 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// (For model_version for 2.0 only, cannot be used in conjunction with aspect_ratio) The resolution to use for image generation, represented in width x height. If not specified, defaults to using aspect_ratio.
- /// Example: RESOLUTION_1024_1024 - ///
- public enum Resolution - { - /// - /// - /// - x10241024, - /// - /// - /// - x1024640, - /// - /// - /// - x1024768, - /// - /// - /// - x1024832, - /// - /// - /// - x1024896, - /// - /// - /// - x1024960, - /// - /// - /// - x1088768, - /// - /// - /// - x1088832, - /// - /// - /// - x1088896, - /// - /// - /// - x1088960, - /// - /// - /// - x1120896, - /// - /// - /// - x1152704, - /// - /// - /// - x1152768, - /// - /// - /// - x1152832, - /// - /// - /// - x1152864, - /// - /// - /// - x1152896, - /// - /// - /// - x1216704, - /// - /// - /// - x1216768, - /// - /// - /// - x1216832, - /// - /// - /// - x1232768, - /// - /// - /// - x1248832, - /// - /// - /// - x1280704, - /// - /// - /// - x1280720, - /// - /// - /// - x1280768, - /// - /// - /// - x1280800, - /// - /// - /// - x1312736, - /// - /// - /// - x1344640, - /// - /// - /// - x1344704, - /// - /// - /// - x1344768, - /// - /// - /// - x1408576, - /// - /// - /// - x1408640, - /// - /// - /// - x1408704, - /// - /// - /// - x1472576, - /// - /// - /// - x1472640, - /// - /// - /// - x1472704, - /// - /// - /// - x1536512, - /// - /// - /// - x1536576, - /// - /// - /// - x1536640, - /// - /// - /// - x5121536, - /// - /// - /// - x5761408, - /// - /// - /// - x5761472, - /// - /// - /// - x5761536, - /// - /// - /// - x6401024, - /// - /// - /// - x6401344, - /// - /// - /// - x6401408, - /// - /// - /// - x6401472, - /// - /// - /// - x6401536, - /// - /// - /// - x7041152, - /// - /// - /// - x7041216, - /// - /// - /// - x7041280, - /// - /// - /// - x7041344, - /// - /// - /// - x7041408, - /// - /// - /// - x7041472, - /// - /// - /// - x7201280, - /// - /// - /// - x7361312, - /// - /// - /// - x7681024, - /// - /// - /// - x7681088, - /// - /// - /// - x7681152, - /// - /// - /// - x7681216, - /// - /// - /// - x7681232, - /// - /// - /// - x7681280, - /// - /// - /// - x7681344, - /// - /// - /// - x8321024, - /// - /// - /// - x8321088, - /// - /// - /// - x8321152, - /// - /// - /// - x8321216, - /// - /// - /// - x8321248, - /// - /// - /// - x832960, - /// - /// - /// - x8641152, - /// - /// - /// - x8961024, - /// - /// - /// - x8961088, - /// - /// - /// - x8961120, - /// - /// - /// - x8961152, - /// - /// - /// - x896960, - /// - /// - /// - x9601024, - /// - /// - /// - x9601088, - /// - /// - /// - x960832, - /// - /// - /// - x960896, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class ResolutionExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this Resolution value) - { - return value switch - { - Resolution.x10241024 => "RESOLUTION_1024_1024", - Resolution.x1024640 => "RESOLUTION_1024_640", - Resolution.x1024768 => "RESOLUTION_1024_768", - Resolution.x1024832 => "RESOLUTION_1024_832", - Resolution.x1024896 => "RESOLUTION_1024_896", - Resolution.x1024960 => "RESOLUTION_1024_960", - Resolution.x1088768 => "RESOLUTION_1088_768", - Resolution.x1088832 => "RESOLUTION_1088_832", - Resolution.x1088896 => "RESOLUTION_1088_896", - Resolution.x1088960 => "RESOLUTION_1088_960", - Resolution.x1120896 => "RESOLUTION_1120_896", - Resolution.x1152704 => "RESOLUTION_1152_704", - Resolution.x1152768 => "RESOLUTION_1152_768", - Resolution.x1152832 => "RESOLUTION_1152_832", - Resolution.x1152864 => "RESOLUTION_1152_864", - Resolution.x1152896 => "RESOLUTION_1152_896", - Resolution.x1216704 => "RESOLUTION_1216_704", - Resolution.x1216768 => "RESOLUTION_1216_768", - Resolution.x1216832 => "RESOLUTION_1216_832", - Resolution.x1232768 => "RESOLUTION_1232_768", - Resolution.x1248832 => "RESOLUTION_1248_832", - Resolution.x1280704 => "RESOLUTION_1280_704", - Resolution.x1280720 => "RESOLUTION_1280_720", - Resolution.x1280768 => "RESOLUTION_1280_768", - Resolution.x1280800 => "RESOLUTION_1280_800", - Resolution.x1312736 => "RESOLUTION_1312_736", - Resolution.x1344640 => "RESOLUTION_1344_640", - Resolution.x1344704 => "RESOLUTION_1344_704", - Resolution.x1344768 => "RESOLUTION_1344_768", - Resolution.x1408576 => "RESOLUTION_1408_576", - Resolution.x1408640 => "RESOLUTION_1408_640", - Resolution.x1408704 => "RESOLUTION_1408_704", - Resolution.x1472576 => "RESOLUTION_1472_576", - Resolution.x1472640 => "RESOLUTION_1472_640", - Resolution.x1472704 => "RESOLUTION_1472_704", - Resolution.x1536512 => "RESOLUTION_1536_512", - Resolution.x1536576 => "RESOLUTION_1536_576", - Resolution.x1536640 => "RESOLUTION_1536_640", - Resolution.x5121536 => "RESOLUTION_512_1536", - Resolution.x5761408 => "RESOLUTION_576_1408", - Resolution.x5761472 => "RESOLUTION_576_1472", - Resolution.x5761536 => "RESOLUTION_576_1536", - Resolution.x6401024 => "RESOLUTION_640_1024", - Resolution.x6401344 => "RESOLUTION_640_1344", - Resolution.x6401408 => "RESOLUTION_640_1408", - Resolution.x6401472 => "RESOLUTION_640_1472", - Resolution.x6401536 => "RESOLUTION_640_1536", - Resolution.x7041152 => "RESOLUTION_704_1152", - Resolution.x7041216 => "RESOLUTION_704_1216", - Resolution.x7041280 => "RESOLUTION_704_1280", - Resolution.x7041344 => "RESOLUTION_704_1344", - Resolution.x7041408 => "RESOLUTION_704_1408", - Resolution.x7041472 => "RESOLUTION_704_1472", - Resolution.x7201280 => "RESOLUTION_720_1280", - Resolution.x7361312 => "RESOLUTION_736_1312", - Resolution.x7681024 => "RESOLUTION_768_1024", - Resolution.x7681088 => "RESOLUTION_768_1088", - Resolution.x7681152 => "RESOLUTION_768_1152", - Resolution.x7681216 => "RESOLUTION_768_1216", - Resolution.x7681232 => "RESOLUTION_768_1232", - Resolution.x7681280 => "RESOLUTION_768_1280", - Resolution.x7681344 => "RESOLUTION_768_1344", - Resolution.x8321024 => "RESOLUTION_832_1024", - Resolution.x8321088 => "RESOLUTION_832_1088", - Resolution.x8321152 => "RESOLUTION_832_1152", - Resolution.x8321216 => "RESOLUTION_832_1216", - Resolution.x8321248 => "RESOLUTION_832_1248", - Resolution.x832960 => "RESOLUTION_832_960", - Resolution.x8641152 => "RESOLUTION_864_1152", - Resolution.x8961024 => "RESOLUTION_896_1024", - Resolution.x8961088 => "RESOLUTION_896_1088", - Resolution.x8961120 => "RESOLUTION_896_1120", - Resolution.x8961152 => "RESOLUTION_896_1152", - Resolution.x896960 => "RESOLUTION_896_960", - Resolution.x9601024 => "RESOLUTION_960_1024", - Resolution.x9601088 => "RESOLUTION_960_1088", - Resolution.x960832 => "RESOLUTION_960_832", - Resolution.x960896 => "RESOLUTION_960_896", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static Resolution? ToEnum(string value) - { - return value switch - { - "RESOLUTION_1024_1024" => Resolution.x10241024, - "RESOLUTION_1024_640" => Resolution.x1024640, - "RESOLUTION_1024_768" => Resolution.x1024768, - "RESOLUTION_1024_832" => Resolution.x1024832, - "RESOLUTION_1024_896" => Resolution.x1024896, - "RESOLUTION_1024_960" => Resolution.x1024960, - "RESOLUTION_1088_768" => Resolution.x1088768, - "RESOLUTION_1088_832" => Resolution.x1088832, - "RESOLUTION_1088_896" => Resolution.x1088896, - "RESOLUTION_1088_960" => Resolution.x1088960, - "RESOLUTION_1120_896" => Resolution.x1120896, - "RESOLUTION_1152_704" => Resolution.x1152704, - "RESOLUTION_1152_768" => Resolution.x1152768, - "RESOLUTION_1152_832" => Resolution.x1152832, - "RESOLUTION_1152_864" => Resolution.x1152864, - "RESOLUTION_1152_896" => Resolution.x1152896, - "RESOLUTION_1216_704" => Resolution.x1216704, - "RESOLUTION_1216_768" => Resolution.x1216768, - "RESOLUTION_1216_832" => Resolution.x1216832, - "RESOLUTION_1232_768" => Resolution.x1232768, - "RESOLUTION_1248_832" => Resolution.x1248832, - "RESOLUTION_1280_704" => Resolution.x1280704, - "RESOLUTION_1280_720" => Resolution.x1280720, - "RESOLUTION_1280_768" => Resolution.x1280768, - "RESOLUTION_1280_800" => Resolution.x1280800, - "RESOLUTION_1312_736" => Resolution.x1312736, - "RESOLUTION_1344_640" => Resolution.x1344640, - "RESOLUTION_1344_704" => Resolution.x1344704, - "RESOLUTION_1344_768" => Resolution.x1344768, - "RESOLUTION_1408_576" => Resolution.x1408576, - "RESOLUTION_1408_640" => Resolution.x1408640, - "RESOLUTION_1408_704" => Resolution.x1408704, - "RESOLUTION_1472_576" => Resolution.x1472576, - "RESOLUTION_1472_640" => Resolution.x1472640, - "RESOLUTION_1472_704" => Resolution.x1472704, - "RESOLUTION_1536_512" => Resolution.x1536512, - "RESOLUTION_1536_576" => Resolution.x1536576, - "RESOLUTION_1536_640" => Resolution.x1536640, - "RESOLUTION_512_1536" => Resolution.x5121536, - "RESOLUTION_576_1408" => Resolution.x5761408, - "RESOLUTION_576_1472" => Resolution.x5761472, - "RESOLUTION_576_1536" => Resolution.x5761536, - "RESOLUTION_640_1024" => Resolution.x6401024, - "RESOLUTION_640_1344" => Resolution.x6401344, - "RESOLUTION_640_1408" => Resolution.x6401408, - "RESOLUTION_640_1472" => Resolution.x6401472, - "RESOLUTION_640_1536" => Resolution.x6401536, - "RESOLUTION_704_1152" => Resolution.x7041152, - "RESOLUTION_704_1216" => Resolution.x7041216, - "RESOLUTION_704_1280" => Resolution.x7041280, - "RESOLUTION_704_1344" => Resolution.x7041344, - "RESOLUTION_704_1408" => Resolution.x7041408, - "RESOLUTION_704_1472" => Resolution.x7041472, - "RESOLUTION_720_1280" => Resolution.x7201280, - "RESOLUTION_736_1312" => Resolution.x7361312, - "RESOLUTION_768_1024" => Resolution.x7681024, - "RESOLUTION_768_1088" => Resolution.x7681088, - "RESOLUTION_768_1152" => Resolution.x7681152, - "RESOLUTION_768_1216" => Resolution.x7681216, - "RESOLUTION_768_1232" => Resolution.x7681232, - "RESOLUTION_768_1280" => Resolution.x7681280, - "RESOLUTION_768_1344" => Resolution.x7681344, - "RESOLUTION_832_1024" => Resolution.x8321024, - "RESOLUTION_832_1088" => Resolution.x8321088, - "RESOLUTION_832_1152" => Resolution.x8321152, - "RESOLUTION_832_1216" => Resolution.x8321216, - "RESOLUTION_832_1248" => Resolution.x8321248, - "RESOLUTION_832_960" => Resolution.x832960, - "RESOLUTION_864_1152" => Resolution.x8641152, - "RESOLUTION_896_1024" => Resolution.x8961024, - "RESOLUTION_896_1088" => Resolution.x8961088, - "RESOLUTION_896_1120" => Resolution.x8961120, - "RESOLUTION_896_1152" => Resolution.x8961152, - "RESOLUTION_896_960" => Resolution.x896960, - "RESOLUTION_960_1024" => Resolution.x9601024, - "RESOLUTION_960_1088" => Resolution.x9601088, - "RESOLUTION_960_832" => Resolution.x960832, - "RESOLUTION_960_896" => Resolution.x960896, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ResolutionV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ResolutionV3.g.cs index 2d37afaf..89584dc1 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ResolutionV3.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ResolutionV3.g.cs @@ -4,8 +4,7 @@ namespace Ideogram { /// - /// The resolutions supported for Ideogram 3.0.
- /// Example: 1280x800 + /// The resolutions supported for Ideogram 3.0. ///
public enum ResolutionV3 { diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ResolutionV4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ResolutionV4.g.cs index 8f117696..8b8006f6 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ResolutionV4.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ResolutionV4.g.cs @@ -4,8 +4,7 @@ namespace Ideogram { /// - /// The 1K and 2K resolutions supported for Ideogram 4.0 image generation.
- /// Example: 2048x2048 + /// The 1K and 2K resolutions supported for Ideogram 4.0 image generation. ///
public enum ResolutionV4 { diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ResolutionV4ImageToImage.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ResolutionV4ImageToImage.g.cs deleted file mode 100644 index 3fb2c3c0..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ResolutionV4ImageToImage.g.cs +++ /dev/null @@ -1,274 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Output resolutions for Ideogram 4.0 image-to-image. Superset of ResolutionV4 (the 1K/2K t2im set) plus the small 512-tier (512x512, 768x384, 384x768).
- /// Example: 1024x1024 - ///
- public enum ResolutionV4ImageToImage - { - /// - /// - /// - x1024x1024, - /// - /// - /// - x1024x3072, - /// - /// - /// - x1120x896, - /// - /// - /// - x1152x2944, - /// - /// - /// - x1152x864, - /// - /// - /// - x1248x3328, - /// - /// - /// - x1248x832, - /// - /// - /// - x1280x3072, - /// - /// - /// - x1280x720, - /// - /// - /// - x1280x800, - /// - /// - /// - x1296x3168, - /// - /// - /// - x1440x2560, - /// - /// - /// - x1440x2880, - /// - /// - /// - x1440x720, - /// - /// - /// - x1600x2560, - /// - /// - /// - x1664x2496, - /// - /// - /// - x1728x2304, - /// - /// - /// - x1792x2240, - /// - /// - /// - x2048x2048, - /// - /// - /// - x2240x1792, - /// - /// - /// - x2304x1728, - /// - /// - /// - x2496x1664, - /// - /// - /// - x2560x1440, - /// - /// - /// - x2560x1600, - /// - /// - /// - x2880x1440, - /// - /// - /// - x2944x1152, - /// - /// - /// - x3072x1024, - /// - /// - /// - x3072x1280, - /// - /// - /// - x3168x1296, - /// - /// - /// - x3328x1248, - /// - /// - /// - x384x768, - /// - /// - /// - x512x512, - /// - /// - /// - x720x1280, - /// - /// - /// - x720x1440, - /// - /// - /// - x768x384, - /// - /// - /// - x800x1280, - /// - /// - /// - x832x1248, - /// - /// - /// - x864x1152, - /// - /// - /// - x896x1120, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class ResolutionV4ImageToImageExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this ResolutionV4ImageToImage value) - { - return value switch - { - ResolutionV4ImageToImage.x1024x1024 => "1024x1024", - ResolutionV4ImageToImage.x1024x3072 => "1024x3072", - ResolutionV4ImageToImage.x1120x896 => "1120x896", - ResolutionV4ImageToImage.x1152x2944 => "1152x2944", - ResolutionV4ImageToImage.x1152x864 => "1152x864", - ResolutionV4ImageToImage.x1248x3328 => "1248x3328", - ResolutionV4ImageToImage.x1248x832 => "1248x832", - ResolutionV4ImageToImage.x1280x3072 => "1280x3072", - ResolutionV4ImageToImage.x1280x720 => "1280x720", - ResolutionV4ImageToImage.x1280x800 => "1280x800", - ResolutionV4ImageToImage.x1296x3168 => "1296x3168", - ResolutionV4ImageToImage.x1440x2560 => "1440x2560", - ResolutionV4ImageToImage.x1440x2880 => "1440x2880", - ResolutionV4ImageToImage.x1440x720 => "1440x720", - ResolutionV4ImageToImage.x1600x2560 => "1600x2560", - ResolutionV4ImageToImage.x1664x2496 => "1664x2496", - ResolutionV4ImageToImage.x1728x2304 => "1728x2304", - ResolutionV4ImageToImage.x1792x2240 => "1792x2240", - ResolutionV4ImageToImage.x2048x2048 => "2048x2048", - ResolutionV4ImageToImage.x2240x1792 => "2240x1792", - ResolutionV4ImageToImage.x2304x1728 => "2304x1728", - ResolutionV4ImageToImage.x2496x1664 => "2496x1664", - ResolutionV4ImageToImage.x2560x1440 => "2560x1440", - ResolutionV4ImageToImage.x2560x1600 => "2560x1600", - ResolutionV4ImageToImage.x2880x1440 => "2880x1440", - ResolutionV4ImageToImage.x2944x1152 => "2944x1152", - ResolutionV4ImageToImage.x3072x1024 => "3072x1024", - ResolutionV4ImageToImage.x3072x1280 => "3072x1280", - ResolutionV4ImageToImage.x3168x1296 => "3168x1296", - ResolutionV4ImageToImage.x3328x1248 => "3328x1248", - ResolutionV4ImageToImage.x384x768 => "384x768", - ResolutionV4ImageToImage.x512x512 => "512x512", - ResolutionV4ImageToImage.x720x1280 => "720x1280", - ResolutionV4ImageToImage.x720x1440 => "720x1440", - ResolutionV4ImageToImage.x768x384 => "768x384", - ResolutionV4ImageToImage.x800x1280 => "800x1280", - ResolutionV4ImageToImage.x832x1248 => "832x1248", - ResolutionV4ImageToImage.x864x1152 => "864x1152", - ResolutionV4ImageToImage.x896x1120 => "896x1120", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static ResolutionV4ImageToImage? ToEnum(string value) - { - return value switch - { - "1024x1024" => ResolutionV4ImageToImage.x1024x1024, - "1024x3072" => ResolutionV4ImageToImage.x1024x3072, - "1120x896" => ResolutionV4ImageToImage.x1120x896, - "1152x2944" => ResolutionV4ImageToImage.x1152x2944, - "1152x864" => ResolutionV4ImageToImage.x1152x864, - "1248x3328" => ResolutionV4ImageToImage.x1248x3328, - "1248x832" => ResolutionV4ImageToImage.x1248x832, - "1280x3072" => ResolutionV4ImageToImage.x1280x3072, - "1280x720" => ResolutionV4ImageToImage.x1280x720, - "1280x800" => ResolutionV4ImageToImage.x1280x800, - "1296x3168" => ResolutionV4ImageToImage.x1296x3168, - "1440x2560" => ResolutionV4ImageToImage.x1440x2560, - "1440x2880" => ResolutionV4ImageToImage.x1440x2880, - "1440x720" => ResolutionV4ImageToImage.x1440x720, - "1600x2560" => ResolutionV4ImageToImage.x1600x2560, - "1664x2496" => ResolutionV4ImageToImage.x1664x2496, - "1728x2304" => ResolutionV4ImageToImage.x1728x2304, - "1792x2240" => ResolutionV4ImageToImage.x1792x2240, - "2048x2048" => ResolutionV4ImageToImage.x2048x2048, - "2240x1792" => ResolutionV4ImageToImage.x2240x1792, - "2304x1728" => ResolutionV4ImageToImage.x2304x1728, - "2496x1664" => ResolutionV4ImageToImage.x2496x1664, - "2560x1440" => ResolutionV4ImageToImage.x2560x1440, - "2560x1600" => ResolutionV4ImageToImage.x2560x1600, - "2880x1440" => ResolutionV4ImageToImage.x2880x1440, - "2944x1152" => ResolutionV4ImageToImage.x2944x1152, - "3072x1024" => ResolutionV4ImageToImage.x3072x1024, - "3072x1280" => ResolutionV4ImageToImage.x3072x1280, - "3168x1296" => ResolutionV4ImageToImage.x3168x1296, - "3328x1248" => ResolutionV4ImageToImage.x3328x1248, - "384x768" => ResolutionV4ImageToImage.x384x768, - "512x512" => ResolutionV4ImageToImage.x512x512, - "720x1280" => ResolutionV4ImageToImage.x720x1280, - "720x1440" => ResolutionV4ImageToImage.x720x1440, - "768x384" => ResolutionV4ImageToImage.x768x384, - "800x1280" => ResolutionV4ImageToImage.x800x1280, - "832x1248" => ResolutionV4ImageToImage.x832x1248, - "864x1152" => ResolutionV4ImageToImage.x864x1152, - "896x1120" => ResolutionV4ImageToImage.x896x1120, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ResolutionV4Layout.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ResolutionV4Layout.g.cs deleted file mode 100644 index 5fe7b124..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ResolutionV4Layout.g.cs +++ /dev/null @@ -1,118 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The resolutions supported for Ideogram 4.0 layout-to-image and design generation.
- /// Example: 1024x1024 - ///
- public enum ResolutionV4Layout - { - /// - /// - /// - x1024x1024, - /// - /// - /// - x1120x896, - /// - /// - /// - x1152x864, - /// - /// - /// - x1248x832, - /// - /// - /// - x1280x720, - /// - /// - /// - x1280x800, - /// - /// - /// - x1440x720, - /// - /// - /// - x720x1280, - /// - /// - /// - x720x1440, - /// - /// - /// - x800x1280, - /// - /// - /// - x832x1248, - /// - /// - /// - x864x1152, - /// - /// - /// - x896x1120, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class ResolutionV4LayoutExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this ResolutionV4Layout value) - { - return value switch - { - ResolutionV4Layout.x1024x1024 => "1024x1024", - ResolutionV4Layout.x1120x896 => "1120x896", - ResolutionV4Layout.x1152x864 => "1152x864", - ResolutionV4Layout.x1248x832 => "1248x832", - ResolutionV4Layout.x1280x720 => "1280x720", - ResolutionV4Layout.x1280x800 => "1280x800", - ResolutionV4Layout.x1440x720 => "1440x720", - ResolutionV4Layout.x720x1280 => "720x1280", - ResolutionV4Layout.x720x1440 => "720x1440", - ResolutionV4Layout.x800x1280 => "800x1280", - ResolutionV4Layout.x832x1248 => "832x1248", - ResolutionV4Layout.x864x1152 => "864x1152", - ResolutionV4Layout.x896x1120 => "896x1120", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static ResolutionV4Layout? ToEnum(string value) - { - return value switch - { - "1024x1024" => ResolutionV4Layout.x1024x1024, - "1120x896" => ResolutionV4Layout.x1120x896, - "1152x864" => ResolutionV4Layout.x1152x864, - "1248x832" => ResolutionV4Layout.x1248x832, - "1280x720" => ResolutionV4Layout.x1280x720, - "1280x800" => ResolutionV4Layout.x1280x800, - "1440x720" => ResolutionV4Layout.x1440x720, - "720x1280" => ResolutionV4Layout.x720x1280, - "720x1440" => ResolutionV4Layout.x720x1440, - "800x1280" => ResolutionV4Layout.x800x1280, - "832x1248" => ResolutionV4Layout.x832x1248, - "864x1152" => ResolutionV4Layout.x864x1152, - "896x1120" => ResolutionV4Layout.x896x1120, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.SamplingRequestParams.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.SamplingRequestParams.Json.g.cs deleted file mode 100644 index 5d9a7af9..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.SamplingRequestParams.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class SamplingRequestParams - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.SamplingRequestParams? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.SamplingRequestParams), - jsonSerializerContext) as global::Ideogram.SamplingRequestParams; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.SamplingRequestParams? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.SamplingRequestParams? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.SamplingRequestParams), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.SamplingRequestParams; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.SamplingRequestParams.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.SamplingRequestParams.g.cs deleted file mode 100644 index 8d3b6330..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.SamplingRequestParams.g.cs +++ /dev/null @@ -1,191 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"magic_prompt_system_prompt_config_id":"magic_prompt_system_prompt_config_id","aspect_ratio":"1x1","style_type":"GENERAL","magic_prompt_version":"V_0","seed":12345,"negative_prompt":"brush strokes, painting","magic_prompt_option":"ON","model":"V_2_TURBO","resolution":"1280x800","num_images":1,"color_palette":{"name":"PASTEL"}} - /// - public sealed partial class SamplingRequestParams - { - /// - /// Example: 1x1 - /// - /// 1x1 - [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.AspectRatioV3JsonConverter))] - public global::Ideogram.AspectRatioV3? AspectRatio { get; set; } - - /// - /// The model used to generate an image or edit one. /generate and /remix supports all model types, however, /edit is only supported for V_2 and V_2_TURBO.
- /// Default Value: V_2
- /// Example: V_2_TURBO - ///
- /// V_2_TURBO - [global::System.Text.Json.Serialization.JsonPropertyName("model")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ModelEnumJsonConverter))] - public global::Ideogram.ModelEnum? Model { get; set; } - - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - ///
- /// ON - [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt_option")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.MagicPromptOptionJsonConverter))] - public global::Ideogram.MagicPromptOption? MagicPromptOption { get; set; } - - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt_system_prompt_config_id")] - public string? MagicPromptSystemPromptConfigId { get; set; } - - /// - /// The magic prompt version to use when magic prompt option is set to AUTO or ON.
- /// Example: V_0 - ///
- /// V_0 - [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt_version")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.MagicPromptVersionEnumJsonConverter))] - public global::Ideogram.MagicPromptVersionEnum? MagicPromptVersion { get; set; } - - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - ///
- /// 12345 - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// The style type to generate with.
- /// Default Value: GENERAL
- /// Example: GENERAL - ///
- /// GENERAL - [global::System.Text.Json.Serialization.JsonPropertyName("style_type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.StyleTypeV3JsonConverter))] - public global::Ideogram.StyleTypeV3? StyleType { get; set; } - - /// - /// Only available for model versions V_1, V_1_TURBO, V_2 and V_2_TURBO. Description of what to exclude from an image. Descriptions in the prompt take precedence to descriptions in the negative prompt.
- /// Example: brush strokes, painting - ///
- /// brush strokes, painting - [global::System.Text.Json.Serialization.JsonPropertyName("negative_prompt")] - public string? NegativePrompt { get; set; } - - /// - /// The number of images to generate.
- /// Default Value: 1 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] - public int? NumImages { get; set; } - - /// - /// The resolutions supported for Ideogram 3.0.
- /// Example: 1280x800 - ///
- /// 1280x800 - [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ResolutionV3JsonConverter))] - public global::Ideogram.ResolutionV3? Resolution { get; set; } - - /// - /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). Not supported by V_1, V_1_TURBO, V_2A and V_2A_TURBO models. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("color_palette")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ColorPaletteWithPresetNameOrMembersJsonConverter))] - public global::Ideogram.ColorPaletteWithPresetNameOrMembers? ColorPalette { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Example: 1x1 - /// - /// - /// The model used to generate an image or edit one. /generate and /remix supports all model types, however, /edit is only supported for V_2 and V_2_TURBO.
- /// Default Value: V_2
- /// Example: V_2_TURBO - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// The magic prompt version to use when magic prompt option is set to AUTO or ON.
- /// Example: V_0 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The style type to generate with.
- /// Default Value: GENERAL
- /// Example: GENERAL - /// - /// - /// Only available for model versions V_1, V_1_TURBO, V_2 and V_2_TURBO. Description of what to exclude from an image. Descriptions in the prompt take precedence to descriptions in the negative prompt.
- /// Example: brush strokes, painting - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// The resolutions supported for Ideogram 3.0.
- /// Example: 1280x800 - /// - /// - /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). Not supported by V_1, V_1_TURBO, V_2A and V_2A_TURBO models. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public SamplingRequestParams( - global::Ideogram.AspectRatioV3? aspectRatio, - global::Ideogram.ModelEnum? model, - global::Ideogram.MagicPromptOption? magicPromptOption, - string? magicPromptSystemPromptConfigId, - global::Ideogram.MagicPromptVersionEnum? magicPromptVersion, - int? seed, - global::Ideogram.StyleTypeV3? styleType, - string? negativePrompt, - int? numImages, - global::Ideogram.ResolutionV3? resolution, - global::Ideogram.ColorPaletteWithPresetNameOrMembers? colorPalette) - { - this.AspectRatio = aspectRatio; - this.Model = model; - this.MagicPromptOption = magicPromptOption; - this.MagicPromptSystemPromptConfigId = magicPromptSystemPromptConfigId; - this.MagicPromptVersion = magicPromptVersion; - this.Seed = seed; - this.StyleType = styleType; - this.NegativePrompt = negativePrompt; - this.NumImages = numImages; - this.Resolution = resolution; - this.ColorPalette = colorPalette; - } - - /// - /// Initializes a new instance of the class. - /// - public SamplingRequestParams() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.SegmentBy.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.SegmentBy.g.cs deleted file mode 100644 index 87ea45a9..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.SegmentBy.g.cs +++ /dev/null @@ -1,52 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Time segment granularity for usage breakdown
- /// Example: DAY - ///
- public enum SegmentBy - { - /// - /// - /// - Day, - /// - /// - /// - Hour, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class SegmentByExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this SegmentBy value) - { - return value switch - { - SegmentBy.Day => "DAY", - SegmentBy.Hour => "HOUR", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static SegmentBy? ToEnum(string value) - { - return value switch - { - "DAY" => SegmentBy.Day, - "HOUR" => SegmentBy.Hour, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.SkechersStyleEditQuality.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.SkechersStyleEditQuality.g.cs deleted file mode 100644 index 20f31a28..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.SkechersStyleEditQuality.g.cs +++ /dev/null @@ -1,58 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The quality tier for the edit. Higher tiers may improve detail and
- /// take longer to complete. - ///
- public enum SkechersStyleEditQuality - { - /// - /// - /// - High, - /// - /// - /// - Low, - /// - /// - /// - Medium, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class SkechersStyleEditQualityExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this SkechersStyleEditQuality value) - { - return value switch - { - SkechersStyleEditQuality.High => "high", - SkechersStyleEditQuality.Low => "low", - SkechersStyleEditQuality.Medium => "medium", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static SkechersStyleEditQuality? ToEnum(string value) - { - return value switch - { - "high" => SkechersStyleEditQuality.High, - "low" => SkechersStyleEditQuality.Low, - "medium" => SkechersStyleEditQuality.Medium, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.SkechersStyleEditRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.SkechersStyleEditRequest.Json.g.cs deleted file mode 100644 index 354c7d56..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.SkechersStyleEditRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class SkechersStyleEditRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.SkechersStyleEditRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.SkechersStyleEditRequest), - jsonSerializerContext) as global::Ideogram.SkechersStyleEditRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.SkechersStyleEditRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.SkechersStyleEditRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.SkechersStyleEditRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.SkechersStyleEditRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.SkechersStyleEditRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.SkechersStyleEditRequest.g.cs deleted file mode 100644 index 639560b8..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.SkechersStyleEditRequest.g.cs +++ /dev/null @@ -1,184 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"base_description":"base_description","aspect_ratio":"1:1","private":true,"reference_asset_identifiers":[{"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"},{"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"},{"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"},{"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"},{"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"}],"webhook_url":"https://api.example.com/webhooks/ideogram","base_generation_size":"2k","base_asset_identifier":"","reference_descriptions":["reference_descriptions","reference_descriptions","reference_descriptions","reference_descriptions","reference_descriptions"],"resolved_instruction":"resolved_instruction","num_images":0,"quality":null} - /// - public sealed partial class SkechersStyleEditRequest - { - /// - /// Image to edit, used as image 1 and the output canvas. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("base_asset_identifier")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.AssetIdentifier BaseAssetIdentifier { get; set; } - - /// - /// Ordered reference images, numbered from image 2. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("reference_asset_identifiers")] - public global::System.Collections.Generic.IList? ReferenceAssetIdentifiers { get; set; } - - /// - /// Edit instructions with known image mentions resolved to image numbers. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("resolved_instruction")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string ResolvedInstruction { get; set; } - - /// - /// Optional description of the selected base image or named view. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("base_description")] - public string? BaseDescription { get; set; } - - /// - /// One nonempty description per reference image, in the same order. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("reference_descriptions")] - public global::System.Collections.Generic.IList? ReferenceDescriptions { get; set; } - - /// - /// Output ratio. When omitted, derive the nearest supported ratio from the base. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.SkechersStyleEditRequestAspectRatioJsonConverter))] - public global::Ideogram.SkechersStyleEditRequestAspectRatio? AspectRatio { get; set; } - - /// - /// Output resolution tier; corresponds to the app's low, medium, and high settings.
- /// Default Value: 2k - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("base_generation_size")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.SkechersStyleEditRequestBaseGenerationSizeJsonConverter))] - public global::Ideogram.SkechersStyleEditRequestBaseGenerationSize? BaseGenerationSize { get; set; } - - /// - /// The quality tier for the edit. Higher tiers may improve detail and
- /// take longer to complete. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("quality")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.SkechersStyleEditQualityJsonConverter))] - public global::Ideogram.SkechersStyleEditQuality? Quality { get; set; } - - /// - /// Number of edited images to create.
- /// Default Value: 1 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] - public int? NumImages { get; set; } - - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - ///
- /// https://api.example.com/webhooks/ideogram - [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] - public string? WebhookUrl { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Image to edit, used as image 1 and the output canvas. - /// - /// - /// Edit instructions with known image mentions resolved to image numbers. - /// - /// - /// Ordered reference images, numbered from image 2. - /// - /// - /// Optional description of the selected base image or named view. - /// - /// - /// One nonempty description per reference image, in the same order. - /// - /// - /// Output ratio. When omitted, derive the nearest supported ratio from the base. - /// - /// - /// Output resolution tier; corresponds to the app's low, medium, and high settings.
- /// Default Value: 2k - /// - /// - /// The quality tier for the edit. Higher tiers may improve detail and
- /// take longer to complete. - /// - /// - /// Number of edited images to create.
- /// Default Value: 1 - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public SkechersStyleEditRequest( - global::Ideogram.AssetIdentifier baseAssetIdentifier, - string resolvedInstruction, - global::System.Collections.Generic.IList? referenceAssetIdentifiers, - string? baseDescription, - global::System.Collections.Generic.IList? referenceDescriptions, - global::Ideogram.SkechersStyleEditRequestAspectRatio? aspectRatio, - global::Ideogram.SkechersStyleEditRequestBaseGenerationSize? baseGenerationSize, - global::Ideogram.SkechersStyleEditQuality? quality, - int? numImages, - bool? @private, - string? webhookUrl) - { - this.BaseAssetIdentifier = baseAssetIdentifier ?? throw new global::System.ArgumentNullException(nameof(baseAssetIdentifier)); - this.ReferenceAssetIdentifiers = referenceAssetIdentifiers; - this.ResolvedInstruction = resolvedInstruction ?? throw new global::System.ArgumentNullException(nameof(resolvedInstruction)); - this.BaseDescription = baseDescription; - this.ReferenceDescriptions = referenceDescriptions; - this.AspectRatio = aspectRatio; - this.BaseGenerationSize = baseGenerationSize; - this.Quality = quality; - this.NumImages = numImages; - this.Private = @private; - this.WebhookUrl = webhookUrl; - } - - /// - /// Initializes a new instance of the class. - /// - public SkechersStyleEditRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.SkechersStyleEditRequestAspectRatio.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.SkechersStyleEditRequestAspectRatio.g.cs deleted file mode 100644 index 6cc217ae..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.SkechersStyleEditRequestAspectRatio.g.cs +++ /dev/null @@ -1,69 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Output ratio. When omitted, derive the nearest supported ratio from the base. - /// - public enum SkechersStyleEditRequestAspectRatio - { - /// - /// - /// - x16_9, - /// - /// - /// - x1_1, - /// - /// - /// - x3_4, - /// - /// - /// - x4_3, - /// - /// - /// - x9_16, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class SkechersStyleEditRequestAspectRatioExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this SkechersStyleEditRequestAspectRatio value) - { - return value switch - { - SkechersStyleEditRequestAspectRatio.x16_9 => "16:9", - SkechersStyleEditRequestAspectRatio.x1_1 => "1:1", - SkechersStyleEditRequestAspectRatio.x3_4 => "3:4", - SkechersStyleEditRequestAspectRatio.x4_3 => "4:3", - SkechersStyleEditRequestAspectRatio.x9_16 => "9:16", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static SkechersStyleEditRequestAspectRatio? ToEnum(string value) - { - return value switch - { - "16:9" => SkechersStyleEditRequestAspectRatio.x16_9, - "1:1" => SkechersStyleEditRequestAspectRatio.x1_1, - "3:4" => SkechersStyleEditRequestAspectRatio.x3_4, - "4:3" => SkechersStyleEditRequestAspectRatio.x4_3, - "9:16" => SkechersStyleEditRequestAspectRatio.x9_16, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.SkechersStyleEditRequestBaseGenerationSize.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.SkechersStyleEditRequestBaseGenerationSize.g.cs deleted file mode 100644 index 2b65021e..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.SkechersStyleEditRequestBaseGenerationSize.g.cs +++ /dev/null @@ -1,58 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Output resolution tier; corresponds to the app's low, medium, and high settings.
- /// Default Value: 2k - ///
- public enum SkechersStyleEditRequestBaseGenerationSize - { - /// - /// - /// - x1k, - /// - /// - /// - x2k, - /// - /// - /// - x4k, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class SkechersStyleEditRequestBaseGenerationSizeExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this SkechersStyleEditRequestBaseGenerationSize value) - { - return value switch - { - SkechersStyleEditRequestBaseGenerationSize.x1k => "1k", - SkechersStyleEditRequestBaseGenerationSize.x2k => "2k", - SkechersStyleEditRequestBaseGenerationSize.x4k => "4k", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static SkechersStyleEditRequestBaseGenerationSize? ToEnum(string value) - { - return value switch - { - "1k" => SkechersStyleEditRequestBaseGenerationSize.x1k, - "2k" => SkechersStyleEditRequestBaseGenerationSize.x2k, - "4k" => SkechersStyleEditRequestBaseGenerationSize.x4k, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.SkechersStyleEditResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.SkechersStyleEditResponse.Json.g.cs deleted file mode 100644 index 980a2123..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.SkechersStyleEditResponse.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class SkechersStyleEditResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.SkechersStyleEditResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.SkechersStyleEditResponse), - jsonSerializerContext) as global::Ideogram.SkechersStyleEditResponse; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.SkechersStyleEditResponse? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.SkechersStyleEditResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.SkechersStyleEditResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.SkechersStyleEditResponse; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.SkechersStyleEditResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.SkechersStyleEditResponse.g.cs deleted file mode 100644 index 70ae96f3..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.SkechersStyleEditResponse.g.cs +++ /dev/null @@ -1,47 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"generation_id":"generation_id"} - /// - public sealed partial class SkechersStyleEditResponse - { - /// - /// URL-safe base64 ID accepted by the generation polling endpoint. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("generation_id")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string GenerationId { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// URL-safe base64 ID accepted by the generation polling endpoint. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public SkechersStyleEditResponse( - string generationId) - { - this.GenerationId = generationId ?? throw new global::System.ArgumentNullException(nameof(generationId)); - } - - /// - /// Initializes a new instance of the class. - /// - public SkechersStyleEditResponse() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.SketchToRenderRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.SketchToRenderRequest.Json.g.cs deleted file mode 100644 index 1372369f..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.SketchToRenderRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class SketchToRenderRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.SketchToRenderRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.SketchToRenderRequest), - jsonSerializerContext) as global::Ideogram.SketchToRenderRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.SketchToRenderRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.SketchToRenderRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.SketchToRenderRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.SketchToRenderRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.SketchToRenderRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.SketchToRenderRequest.g.cs deleted file mode 100644 index 63675057..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.SketchToRenderRequest.g.cs +++ /dev/null @@ -1,182 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The whole sketch is transformed from an illustration into a
- /// photograph; masks are not accepted. - ///
- public sealed partial class SketchToRenderRequest - { - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - ///
- /// {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - [global::System.Text.Json.Serialization.JsonPropertyName("sketch_asset_identifier")] - public global::Ideogram.AssetIdentifier? SketchAssetIdentifier { get; set; } - - /// - /// The fashion sketch to render, up to 50 MB. JPEG, PNG, WEBP, HEIF,
- /// AVIF, GIF, BMP, TIFF, and MPO are supported. Multipart requests
- /// only. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("sketch_image")] - public byte[]? SketchImage { get; set; } - - /// - /// The fashion sketch to render, up to 50 MB. JPEG, PNG, WEBP, HEIF,
- /// AVIF, GIF, BMP, TIFF, and MPO are supported. Multipart requests
- /// only. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("sketch_imagename")] - public string? SketchImagename { get; set; } - - /// - /// Material and rendering direction, plus any construction or design
- /// details that are not legible in the sketch. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("instruction")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Instruction { get; set; } - - /// - /// Aspect ratio of each output image. Defaults to `1:1` when omitted. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] - public string? AspectRatio { get; set; } - - /// - /// The quality tier for the edit. Higher tiers may improve detail and
- /// take longer to complete. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("quality")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.SketchToRenderQualityJsonConverter))] - public global::Ideogram.SketchToRenderQuality? Quality { get; set; } - - /// - /// Optional seed for repeatable results. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// Number of product renders to create.
- /// Default Value: 1 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] - public int? NumImages { get; set; } - - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - ///
- /// https://api.example.com/webhooks/ideogram - [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] - public string? WebhookUrl { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Material and rendering direction, plus any construction or design
- /// details that are not legible in the sketch. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The fashion sketch to render, up to 50 MB. JPEG, PNG, WEBP, HEIF,
- /// AVIF, GIF, BMP, TIFF, and MPO are supported. Multipart requests
- /// only. - /// - /// - /// The fashion sketch to render, up to 50 MB. JPEG, PNG, WEBP, HEIF,
- /// AVIF, GIF, BMP, TIFF, and MPO are supported. Multipart requests
- /// only. - /// - /// - /// Aspect ratio of each output image. Defaults to `1:1` when omitted. - /// - /// - /// The quality tier for the edit. Higher tiers may improve detail and
- /// take longer to complete. - /// - /// - /// Optional seed for repeatable results. - /// - /// - /// Number of product renders to create.
- /// Default Value: 1 - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public SketchToRenderRequest( - string instruction, - global::Ideogram.AssetIdentifier? sketchAssetIdentifier, - byte[]? sketchImage, - string? sketchImagename, - string? aspectRatio, - global::Ideogram.SketchToRenderQuality? quality, - int? seed, - int? numImages, - bool? @private, - string? webhookUrl) - { - this.SketchAssetIdentifier = sketchAssetIdentifier; - this.SketchImage = sketchImage; - this.SketchImagename = sketchImagename; - this.Instruction = instruction ?? throw new global::System.ArgumentNullException(nameof(instruction)); - this.AspectRatio = aspectRatio; - this.Quality = quality; - this.Seed = seed; - this.NumImages = numImages; - this.Private = @private; - this.WebhookUrl = webhookUrl; - } - - /// - /// Initializes a new instance of the class. - /// - public SketchToRenderRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.SketchToRenderResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.SketchToRenderResponse.g.cs index 3da51b83..c83d654d 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.SketchToRenderResponse.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.SketchToRenderResponse.g.cs @@ -5,8 +5,7 @@ namespace Ideogram { /// /// Acknowledgement that the sketch rendering was accepted. Poll
- /// `GET /v2/generations/{generation_id}` for status and results.
- /// Example: {"generation_id":"generation_id"} + /// `GET /v2/generations/{generation_id}` for status and results. ///
public sealed partial class SketchToRenderResponse { diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.SnapMaskRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.SnapMaskRequest.Json.g.cs deleted file mode 100644 index e35a4e6b..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.SnapMaskRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class SnapMaskRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.SnapMaskRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.SnapMaskRequest), - jsonSerializerContext) as global::Ideogram.SnapMaskRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.SnapMaskRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.SnapMaskRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.SnapMaskRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.SnapMaskRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.SnapMaskRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.SnapMaskRequest.g.cs deleted file mode 100644 index daddec1f..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.SnapMaskRequest.g.cs +++ /dev/null @@ -1,83 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - public sealed partial class SnapMaskRequest - { - /// - /// The source image containing the object (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image")] - [global::System.Text.Json.Serialization.JsonRequired] - public required byte[] Image { get; set; } - - /// - /// The source image containing the object (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Imagename { get; set; } - - /// - /// A hand-drawn binary mask the same size as the image; white (>= 128) marks the object to snap. Only JPEG, WebP and PNG formats are supported. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("mask")] - [global::System.Text.Json.Serialization.JsonRequired] - public required byte[] Mask { get; set; } - - /// - /// A hand-drawn binary mask the same size as the image; white (>= 128) marks the object to snap. Only JPEG, WebP and PNG formats are supported. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("maskname")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Maskname { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The source image containing the object (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The source image containing the object (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// A hand-drawn binary mask the same size as the image; white (>= 128) marks the object to snap. Only JPEG, WebP and PNG formats are supported. - /// - /// - /// A hand-drawn binary mask the same size as the image; white (>= 128) marks the object to snap. Only JPEG, WebP and PNG formats are supported. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public SnapMaskRequest( - byte[] image, - string imagename, - byte[] mask, - string maskname) - { - this.Image = image ?? throw new global::System.ArgumentNullException(nameof(image)); - this.Imagename = imagename ?? throw new global::System.ArgumentNullException(nameof(imagename)); - this.Mask = mask ?? throw new global::System.ArgumentNullException(nameof(mask)); - this.Maskname = maskname ?? throw new global::System.ArgumentNullException(nameof(maskname)); - } - - /// - /// Initializes a new instance of the class. - /// - public SnapMaskRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.SoleSwapQuality.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.SoleSwapQuality.g.cs deleted file mode 100644 index 05437f1d..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.SoleSwapQuality.g.cs +++ /dev/null @@ -1,58 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The quality tier for the edit. Higher tiers may improve detail and
- /// take longer to complete. - ///
- public enum SoleSwapQuality - { - /// - /// - /// - High, - /// - /// - /// - Low, - /// - /// - /// - Medium, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class SoleSwapQualityExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this SoleSwapQuality value) - { - return value switch - { - SoleSwapQuality.High => "high", - SoleSwapQuality.Low => "low", - SoleSwapQuality.Medium => "medium", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static SoleSwapQuality? ToEnum(string value) - { - return value switch - { - "high" => SoleSwapQuality.High, - "low" => SoleSwapQuality.Low, - "medium" => SoleSwapQuality.Medium, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.SoleSwapRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.SoleSwapRequest.Json.g.cs deleted file mode 100644 index e4935aeb..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.SoleSwapRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class SoleSwapRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.SoleSwapRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.SoleSwapRequest), - jsonSerializerContext) as global::Ideogram.SoleSwapRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.SoleSwapRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.SoleSwapRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.SoleSwapRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.SoleSwapRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.SoleSwapRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.SoleSwapRequest.g.cs deleted file mode 100644 index ff229e41..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.SoleSwapRequest.g.cs +++ /dev/null @@ -1,178 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"aspect_ratio":"aspect_ratio","private":true,"seed":12345,"webhook_url":"https://api.example.com/webhooks/ideogram","base_generation_size":"2k","base_asset_identifier":{"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"},"instruction":"instruction","num_images":0,"upper_asset_identifiers":[{"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"},{"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"},{"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"},{"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"},{"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"}],"quality":null} - /// - public sealed partial class SoleSwapRequest - { - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - ///
- /// {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - [global::System.Text.Json.Serialization.JsonPropertyName("base_asset_identifier")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.AssetIdentifier BaseAssetIdentifier { get; set; } - - /// - /// Ordered upper-donor references. Put the primary upper view first, then additional angles of the same upper to transfer. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("upper_asset_identifiers")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList UpperAssetIdentifiers { get; set; } - - /// - /// Optional additional direction for the sole swap. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("instruction")] - public string? Instruction { get; set; } - - /// - /// Output aspect ratio. When omitted, the closest supported ratio is derived from the sole-donor base image. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] - public string? AspectRatio { get; set; } - - /// - /// Output resolution tier. Defaults to 2k.
- /// Default Value: 2k - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("base_generation_size")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.SoleSwapRequestBaseGenerationSizeJsonConverter))] - public global::Ideogram.SoleSwapRequestBaseGenerationSize? BaseGenerationSize { get; set; } - - /// - /// The quality tier for the edit. Higher tiers may improve detail and
- /// take longer to complete. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("quality")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.SoleSwapQualityJsonConverter))] - public global::Ideogram.SoleSwapQuality? Quality { get; set; } - - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - ///
- /// 12345 - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// Number of sole-swap images to create.
- /// Default Value: 1 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] - public int? NumImages { get; set; } - - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - ///
- /// https://api.example.com/webhooks/ideogram - [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] - public string? WebhookUrl { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// Ordered upper-donor references. Put the primary upper view first, then additional angles of the same upper to transfer. - /// - /// - /// Optional additional direction for the sole swap. - /// - /// - /// Output aspect ratio. When omitted, the closest supported ratio is derived from the sole-donor base image. - /// - /// - /// Output resolution tier. Defaults to 2k.
- /// Default Value: 2k - /// - /// - /// The quality tier for the edit. Higher tiers may improve detail and
- /// take longer to complete. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// Number of sole-swap images to create.
- /// Default Value: 1 - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public SoleSwapRequest( - global::Ideogram.AssetIdentifier baseAssetIdentifier, - global::System.Collections.Generic.IList upperAssetIdentifiers, - string? instruction, - string? aspectRatio, - global::Ideogram.SoleSwapRequestBaseGenerationSize? baseGenerationSize, - global::Ideogram.SoleSwapQuality? quality, - int? seed, - int? numImages, - bool? @private, - string? webhookUrl) - { - this.BaseAssetIdentifier = baseAssetIdentifier ?? throw new global::System.ArgumentNullException(nameof(baseAssetIdentifier)); - this.UpperAssetIdentifiers = upperAssetIdentifiers ?? throw new global::System.ArgumentNullException(nameof(upperAssetIdentifiers)); - this.Instruction = instruction; - this.AspectRatio = aspectRatio; - this.BaseGenerationSize = baseGenerationSize; - this.Quality = quality; - this.Seed = seed; - this.NumImages = numImages; - this.Private = @private; - this.WebhookUrl = webhookUrl; - } - - /// - /// Initializes a new instance of the class. - /// - public SoleSwapRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.SoleSwapRequestBaseGenerationSize.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.SoleSwapRequestBaseGenerationSize.g.cs deleted file mode 100644 index cbff1dda..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.SoleSwapRequestBaseGenerationSize.g.cs +++ /dev/null @@ -1,58 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Output resolution tier. Defaults to 2k.
- /// Default Value: 2k - ///
- public enum SoleSwapRequestBaseGenerationSize - { - /// - /// - /// - x1k, - /// - /// - /// - x2k, - /// - /// - /// - x4k, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class SoleSwapRequestBaseGenerationSizeExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this SoleSwapRequestBaseGenerationSize value) - { - return value switch - { - SoleSwapRequestBaseGenerationSize.x1k => "1k", - SoleSwapRequestBaseGenerationSize.x2k => "2k", - SoleSwapRequestBaseGenerationSize.x4k => "4k", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static SoleSwapRequestBaseGenerationSize? ToEnum(string value) - { - return value switch - { - "1k" => SoleSwapRequestBaseGenerationSize.x1k, - "2k" => SoleSwapRequestBaseGenerationSize.x2k, - "4k" => SoleSwapRequestBaseGenerationSize.x4k, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.SoleSwapResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.SoleSwapResponse.Json.g.cs deleted file mode 100644 index 0f129f05..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.SoleSwapResponse.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class SoleSwapResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.SoleSwapResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.SoleSwapResponse), - jsonSerializerContext) as global::Ideogram.SoleSwapResponse; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.SoleSwapResponse? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.SoleSwapResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.SoleSwapResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.SoleSwapResponse; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.SoleSwapResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.SoleSwapResponse.g.cs deleted file mode 100644 index f46ec3c5..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.SoleSwapResponse.g.cs +++ /dev/null @@ -1,48 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Acknowledgement that the workflow was accepted.
- /// Example: {"generation_id":"generation_id"} - ///
- public sealed partial class SoleSwapResponse - { - /// - /// URL-safe base64 ID accepted by the generation polling endpoint. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("generation_id")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string GenerationId { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// URL-safe base64 ID accepted by the generation polling endpoint. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public SoleSwapResponse( - string generationId) - { - this.GenerationId = generationId ?? throw new global::System.ArgumentNullException(nameof(generationId)); - } - - /// - /// Initializes a new instance of the class. - /// - public SoleSwapResponse() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.SpendCommitInfo.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.SpendCommitInfo.Json.g.cs deleted file mode 100644 index 8bf58f68..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.SpendCommitInfo.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class SpendCommitInfo - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.SpendCommitInfo? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.SpendCommitInfo), - jsonSerializerContext) as global::Ideogram.SpendCommitInfo; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.SpendCommitInfo? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.SpendCommitInfo? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.SpendCommitInfo), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.SpendCommitInfo; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.SpendCommitInfo.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.SpendCommitInfo.g.cs deleted file mode 100644 index cf8e1a57..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.SpendCommitInfo.g.cs +++ /dev/null @@ -1,101 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"commit_start_time":"2000-01-23T04:56:07\u002B00:00","is_postpaid_commit":true,"commit_amount_spent":{"amount":1050,"currency_code":"USD"},"commit_amount":{"amount":1050,"currency_code":"USD"},"commit_end_time":"2000-01-23T04:56:07\u002B00:00"} - /// - public sealed partial class SpendCommitInfo - { - /// - /// Represents a price.
- /// Example: {"amount":1050,"currency_code":"USD"} - ///
- /// {"amount":1050,"currency_code":"USD"} - [global::System.Text.Json.Serialization.JsonPropertyName("commit_amount_spent")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.Price CommitAmountSpent { get; set; } - - /// - /// Represents a price.
- /// Example: {"amount":1050,"currency_code":"USD"} - ///
- /// {"amount":1050,"currency_code":"USD"} - [global::System.Text.Json.Serialization.JsonPropertyName("commit_amount")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.Price CommitAmount { get; set; } - - /// - /// The start time of the commit period - /// - [global::System.Text.Json.Serialization.JsonPropertyName("commit_start_time")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.DateTime CommitStartTime { get; set; } - - /// - /// The end time of the commit period - /// - [global::System.Text.Json.Serialization.JsonPropertyName("commit_end_time")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.DateTime CommitEndTime { get; set; } - - /// - /// Whether the commit is postpaid (true) or prepaid (false) - /// - [global::System.Text.Json.Serialization.JsonPropertyName("is_postpaid_commit")] - [global::System.Text.Json.Serialization.JsonRequired] - public required bool IsPostpaidCommit { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Represents a price.
- /// Example: {"amount":1050,"currency_code":"USD"} - /// - /// - /// Represents a price.
- /// Example: {"amount":1050,"currency_code":"USD"} - /// - /// - /// The start time of the commit period - /// - /// - /// The end time of the commit period - /// - /// - /// Whether the commit is postpaid (true) or prepaid (false) - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public SpendCommitInfo( - global::Ideogram.Price commitAmountSpent, - global::Ideogram.Price commitAmount, - global::System.DateTime commitStartTime, - global::System.DateTime commitEndTime, - bool isPostpaidCommit) - { - this.CommitAmountSpent = commitAmountSpent ?? throw new global::System.ArgumentNullException(nameof(commitAmountSpent)); - this.CommitAmount = commitAmount ?? throw new global::System.ArgumentNullException(nameof(commitAmount)); - this.CommitStartTime = commitStartTime; - this.CommitEndTime = commitEndTime; - this.IsPostpaidCommit = isPostpaidCommit; - } - - /// - /// Initializes a new instance of the class. - /// - public SpendCommitInfo() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.SpendCommitInfoResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.SpendCommitInfoResponse.Json.g.cs deleted file mode 100644 index 4729b8da..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.SpendCommitInfoResponse.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class SpendCommitInfoResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.SpendCommitInfoResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.SpendCommitInfoResponse), - jsonSerializerContext) as global::Ideogram.SpendCommitInfoResponse; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.SpendCommitInfoResponse? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.SpendCommitInfoResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.SpendCommitInfoResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.SpendCommitInfoResponse; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.SpendCommitInfoResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.SpendCommitInfoResponse.g.cs deleted file mode 100644 index 0bf6835c..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.SpendCommitInfoResponse.g.cs +++ /dev/null @@ -1,47 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"commits":[{"commit_start_time":"2000-01-23T04:56:07\u002B00:00","is_postpaid_commit":true,"commit_amount_spent":{"amount":1050,"currency_code":"USD"},"commit_amount":{"amount":1050,"currency_code":"USD"},"commit_end_time":"2000-01-23T04:56:07\u002B00:00"},{"commit_start_time":"2000-01-23T04:56:07\u002B00:00","is_postpaid_commit":true,"commit_amount_spent":{"amount":1050,"currency_code":"USD"},"commit_amount":{"amount":1050,"currency_code":"USD"},"commit_end_time":"2000-01-23T04:56:07\u002B00:00"}]} - /// - public sealed partial class SpendCommitInfoResponse - { - /// - /// A list of spend commit information - /// - [global::System.Text.Json.Serialization.JsonPropertyName("commits")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList Commits { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// A list of spend commit information - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public SpendCommitInfoResponse( - global::System.Collections.Generic.IList commits) - { - this.Commits = commits ?? throw new global::System.ArgumentNullException(nameof(commits)); - } - - /// - /// Initializes a new instance of the class. - /// - public SpendCommitInfoResponse() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.StackedCustomModel.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.StackedCustomModel.Json.g.cs deleted file mode 100644 index ea49673e..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.StackedCustomModel.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class StackedCustomModel - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.StackedCustomModel? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.StackedCustomModel), - jsonSerializerContext) as global::Ideogram.StackedCustomModel; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.StackedCustomModel? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.StackedCustomModel? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.StackedCustomModel), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.StackedCustomModel; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.StackedCustomModel.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.StackedCustomModel.g.cs deleted file mode 100644 index 517911cb..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.StackedCustomModel.g.cs +++ /dev/null @@ -1,66 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - public sealed partial class StackedCustomModel - { - /// - /// Custom model URI of one stacked layer, in the form `model/<model_name>/version/<version_name>`.
- /// Example: model/my-base-plora/version/1 - ///
- /// model/my-base-plora/version/1 - [global::System.Text.Json.Serialization.JsonPropertyName("custom_model_uri")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string CustomModelUri { get; set; } - - /// - /// Scale applied to this layer's pLoRA, multiplied with any weight already registered on its checkpoint(s).
- /// Default Value: 1F
- /// Example: 0.5F - ///
- /// 0.5F - [global::System.Text.Json.Serialization.JsonPropertyName("weight")] - public double? Weight { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Custom model URI of one stacked layer, in the form `model/<model_name>/version/<version_name>`.
- /// Example: model/my-base-plora/version/1 - /// - /// - /// Scale applied to this layer's pLoRA, multiplied with any weight already registered on its checkpoint(s).
- /// Default Value: 1F
- /// Example: 0.5F - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public StackedCustomModel( - string customModelUri, - double? weight) - { - this.CustomModelUri = customModelUri ?? throw new global::System.ArgumentNullException(nameof(customModelUri)); - this.Weight = weight; - } - - /// - /// Initializes a new instance of the class. - /// - public StackedCustomModel() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.StylePresetV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.StylePresetV3.g.cs deleted file mode 100644 index cf0a087a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.StylePresetV3.g.cs +++ /dev/null @@ -1,412 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// A predefined style preset that applies a specific artistic style to the generated image.
- /// Example: BRIGHT_ART - ///
- public enum StylePresetV3 - { - /// - /// - /// - x80sIllustration, - /// - /// - /// - x90sNostalgia, - /// - /// - /// - AbstractOrganic, - /// - /// - /// - AnalogNostalgia, - /// - /// - /// - ArtBrut, - /// - /// - /// - ArtDeco, - /// - /// - /// - ArtPoster, - /// - /// - /// - Aura, - /// - /// - /// - AvantGarde, - /// - /// - /// - Bauhaus, - /// - /// - /// - Blueprint, - /// - /// - /// - BlurryMotion, - /// - /// - /// - BrightArt, - /// - /// - /// - C4dCartoon, - /// - /// - /// - ChildrensBook, - /// - /// - /// - Collage, - /// - /// - /// - ColoringBookI, - /// - /// - /// - ColoringBookIi, - /// - /// - /// - Cubism, - /// - /// - /// - DarkAura, - /// - /// - /// - Doodle, - /// - /// - /// - DoubleExposure, - /// - /// - /// - DramaticCinema, - /// - /// - /// - Editorial, - /// - /// - /// - EmotionalMinimal, - /// - /// - /// - EtherealParty, - /// - /// - /// - ExpiredFilm, - /// - /// - /// - FlatArt, - /// - /// - /// - FlatVector, - /// - /// - /// - ForestReverie, - /// - /// - /// - GeoMinimalist, - /// - /// - /// - GlassPrism, - /// - /// - /// - GoldenHour, - /// - /// - /// - GraffitiI, - /// - /// - /// - GraffitiIi, - /// - /// - /// - HalftonePrint, - /// - /// - /// - HighContrast, - /// - /// - /// - HippieEra, - /// - /// - /// - Iconic, - /// - /// - /// - JapandiFusion, - /// - /// - /// - Jazzy, - /// - /// - /// - LongExposure, - /// - /// - /// - MagazineEditorial, - /// - /// - /// - MinimalIllustration, - /// - /// - /// - MixedMedia, - /// - /// - /// - Monochrome, - /// - /// - /// - Nightlife, - /// - /// - /// - OilPainting, - /// - /// - /// - OldCartoons, - /// - /// - /// - PaintGesture, - /// - /// - /// - PopArt, - /// - /// - /// - RetroEtching, - /// - /// - /// - RivieraPop, - /// - /// - /// - Spotlight80s, - /// - /// - /// - StylizedRed, - /// - /// - /// - SurrealCollage, - /// - /// - /// - TravelPoster, - /// - /// - /// - VintageGeo, - /// - /// - /// - VintagePoster, - /// - /// - /// - Watercolor, - /// - /// - /// - Weird, - /// - /// - /// - WoodblockPrint, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class StylePresetV3Extensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this StylePresetV3 value) - { - return value switch - { - StylePresetV3.x80sIllustration => "80S_ILLUSTRATION", - StylePresetV3.x90sNostalgia => "90S_NOSTALGIA", - StylePresetV3.AbstractOrganic => "ABSTRACT_ORGANIC", - StylePresetV3.AnalogNostalgia => "ANALOG_NOSTALGIA", - StylePresetV3.ArtBrut => "ART_BRUT", - StylePresetV3.ArtDeco => "ART_DECO", - StylePresetV3.ArtPoster => "ART_POSTER", - StylePresetV3.Aura => "AURA", - StylePresetV3.AvantGarde => "AVANT_GARDE", - StylePresetV3.Bauhaus => "BAUHAUS", - StylePresetV3.Blueprint => "BLUEPRINT", - StylePresetV3.BlurryMotion => "BLURRY_MOTION", - StylePresetV3.BrightArt => "BRIGHT_ART", - StylePresetV3.C4dCartoon => "C4D_CARTOON", - StylePresetV3.ChildrensBook => "CHILDRENS_BOOK", - StylePresetV3.Collage => "COLLAGE", - StylePresetV3.ColoringBookI => "COLORING_BOOK_I", - StylePresetV3.ColoringBookIi => "COLORING_BOOK_II", - StylePresetV3.Cubism => "CUBISM", - StylePresetV3.DarkAura => "DARK_AURA", - StylePresetV3.Doodle => "DOODLE", - StylePresetV3.DoubleExposure => "DOUBLE_EXPOSURE", - StylePresetV3.DramaticCinema => "DRAMATIC_CINEMA", - StylePresetV3.Editorial => "EDITORIAL", - StylePresetV3.EmotionalMinimal => "EMOTIONAL_MINIMAL", - StylePresetV3.EtherealParty => "ETHEREAL_PARTY", - StylePresetV3.ExpiredFilm => "EXPIRED_FILM", - StylePresetV3.FlatArt => "FLAT_ART", - StylePresetV3.FlatVector => "FLAT_VECTOR", - StylePresetV3.ForestReverie => "FOREST_REVERIE", - StylePresetV3.GeoMinimalist => "GEO_MINIMALIST", - StylePresetV3.GlassPrism => "GLASS_PRISM", - StylePresetV3.GoldenHour => "GOLDEN_HOUR", - StylePresetV3.GraffitiI => "GRAFFITI_I", - StylePresetV3.GraffitiIi => "GRAFFITI_II", - StylePresetV3.HalftonePrint => "HALFTONE_PRINT", - StylePresetV3.HighContrast => "HIGH_CONTRAST", - StylePresetV3.HippieEra => "HIPPIE_ERA", - StylePresetV3.Iconic => "ICONIC", - StylePresetV3.JapandiFusion => "JAPANDI_FUSION", - StylePresetV3.Jazzy => "JAZZY", - StylePresetV3.LongExposure => "LONG_EXPOSURE", - StylePresetV3.MagazineEditorial => "MAGAZINE_EDITORIAL", - StylePresetV3.MinimalIllustration => "MINIMAL_ILLUSTRATION", - StylePresetV3.MixedMedia => "MIXED_MEDIA", - StylePresetV3.Monochrome => "MONOCHROME", - StylePresetV3.Nightlife => "NIGHTLIFE", - StylePresetV3.OilPainting => "OIL_PAINTING", - StylePresetV3.OldCartoons => "OLD_CARTOONS", - StylePresetV3.PaintGesture => "PAINT_GESTURE", - StylePresetV3.PopArt => "POP_ART", - StylePresetV3.RetroEtching => "RETRO_ETCHING", - StylePresetV3.RivieraPop => "RIVIERA_POP", - StylePresetV3.Spotlight80s => "SPOTLIGHT_80S", - StylePresetV3.StylizedRed => "STYLIZED_RED", - StylePresetV3.SurrealCollage => "SURREAL_COLLAGE", - StylePresetV3.TravelPoster => "TRAVEL_POSTER", - StylePresetV3.VintageGeo => "VINTAGE_GEO", - StylePresetV3.VintagePoster => "VINTAGE_POSTER", - StylePresetV3.Watercolor => "WATERCOLOR", - StylePresetV3.Weird => "WEIRD", - StylePresetV3.WoodblockPrint => "WOODBLOCK_PRINT", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static StylePresetV3? ToEnum(string value) - { - return value switch - { - "80S_ILLUSTRATION" => StylePresetV3.x80sIllustration, - "90S_NOSTALGIA" => StylePresetV3.x90sNostalgia, - "ABSTRACT_ORGANIC" => StylePresetV3.AbstractOrganic, - "ANALOG_NOSTALGIA" => StylePresetV3.AnalogNostalgia, - "ART_BRUT" => StylePresetV3.ArtBrut, - "ART_DECO" => StylePresetV3.ArtDeco, - "ART_POSTER" => StylePresetV3.ArtPoster, - "AURA" => StylePresetV3.Aura, - "AVANT_GARDE" => StylePresetV3.AvantGarde, - "BAUHAUS" => StylePresetV3.Bauhaus, - "BLUEPRINT" => StylePresetV3.Blueprint, - "BLURRY_MOTION" => StylePresetV3.BlurryMotion, - "BRIGHT_ART" => StylePresetV3.BrightArt, - "C4D_CARTOON" => StylePresetV3.C4dCartoon, - "CHILDRENS_BOOK" => StylePresetV3.ChildrensBook, - "COLLAGE" => StylePresetV3.Collage, - "COLORING_BOOK_I" => StylePresetV3.ColoringBookI, - "COLORING_BOOK_II" => StylePresetV3.ColoringBookIi, - "CUBISM" => StylePresetV3.Cubism, - "DARK_AURA" => StylePresetV3.DarkAura, - "DOODLE" => StylePresetV3.Doodle, - "DOUBLE_EXPOSURE" => StylePresetV3.DoubleExposure, - "DRAMATIC_CINEMA" => StylePresetV3.DramaticCinema, - "EDITORIAL" => StylePresetV3.Editorial, - "EMOTIONAL_MINIMAL" => StylePresetV3.EmotionalMinimal, - "ETHEREAL_PARTY" => StylePresetV3.EtherealParty, - "EXPIRED_FILM" => StylePresetV3.ExpiredFilm, - "FLAT_ART" => StylePresetV3.FlatArt, - "FLAT_VECTOR" => StylePresetV3.FlatVector, - "FOREST_REVERIE" => StylePresetV3.ForestReverie, - "GEO_MINIMALIST" => StylePresetV3.GeoMinimalist, - "GLASS_PRISM" => StylePresetV3.GlassPrism, - "GOLDEN_HOUR" => StylePresetV3.GoldenHour, - "GRAFFITI_I" => StylePresetV3.GraffitiI, - "GRAFFITI_II" => StylePresetV3.GraffitiIi, - "HALFTONE_PRINT" => StylePresetV3.HalftonePrint, - "HIGH_CONTRAST" => StylePresetV3.HighContrast, - "HIPPIE_ERA" => StylePresetV3.HippieEra, - "ICONIC" => StylePresetV3.Iconic, - "JAPANDI_FUSION" => StylePresetV3.JapandiFusion, - "JAZZY" => StylePresetV3.Jazzy, - "LONG_EXPOSURE" => StylePresetV3.LongExposure, - "MAGAZINE_EDITORIAL" => StylePresetV3.MagazineEditorial, - "MINIMAL_ILLUSTRATION" => StylePresetV3.MinimalIllustration, - "MIXED_MEDIA" => StylePresetV3.MixedMedia, - "MONOCHROME" => StylePresetV3.Monochrome, - "NIGHTLIFE" => StylePresetV3.Nightlife, - "OIL_PAINTING" => StylePresetV3.OilPainting, - "OLD_CARTOONS" => StylePresetV3.OldCartoons, - "PAINT_GESTURE" => StylePresetV3.PaintGesture, - "POP_ART" => StylePresetV3.PopArt, - "RETRO_ETCHING" => StylePresetV3.RetroEtching, - "RIVIERA_POP" => StylePresetV3.RivieraPop, - "SPOTLIGHT_80S" => StylePresetV3.Spotlight80s, - "STYLIZED_RED" => StylePresetV3.StylizedRed, - "SURREAL_COLLAGE" => StylePresetV3.SurrealCollage, - "TRAVEL_POSTER" => StylePresetV3.TravelPoster, - "VINTAGE_GEO" => StylePresetV3.VintageGeo, - "VINTAGE_POSTER" => StylePresetV3.VintagePoster, - "WATERCOLOR" => StylePresetV3.Watercolor, - "WEIRD" => StylePresetV3.Weird, - "WOODBLOCK_PRINT" => StylePresetV3.WoodblockPrint, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.StyleType.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.StyleType.g.cs deleted file mode 100644 index fc1d37a1..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.StyleType.g.cs +++ /dev/null @@ -1,94 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The style type to generate with; this is only applicable for models V_2 and above and should not be specified for model versions V_1.
- /// Example: REALISTIC - ///
- public enum StyleType - { - /// - /// - /// - Anime, - /// - /// - /// - Auto, - /// - /// - /// - Custom, - /// - /// - /// - Design, - /// - /// - /// - Fiction, - /// - /// - /// - General, - /// - /// - /// - Realistic, - /// - /// - /// - Render3d, - /// - /// - /// - Stylized, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class StyleTypeExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this StyleType value) - { - return value switch - { - StyleType.Anime => "ANIME", - StyleType.Auto => "AUTO", - StyleType.Custom => "CUSTOM", - StyleType.Design => "DESIGN", - StyleType.Fiction => "FICTION", - StyleType.General => "GENERAL", - StyleType.Realistic => "REALISTIC", - StyleType.Render3d => "RENDER_3D", - StyleType.Stylized => "STYLIZED", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static StyleType? ToEnum(string value) - { - return value switch - { - "ANIME" => StyleType.Anime, - "AUTO" => StyleType.Auto, - "CUSTOM" => StyleType.Custom, - "DESIGN" => StyleType.Design, - "FICTION" => StyleType.Fiction, - "GENERAL" => StyleType.General, - "REALISTIC" => StyleType.Realistic, - "RENDER_3D" => StyleType.Render3d, - "STYLIZED" => StyleType.Stylized, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.StyleTypeV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.StyleTypeV3.g.cs deleted file mode 100644 index 1273fe92..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.StyleTypeV3.g.cs +++ /dev/null @@ -1,83 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The style type to generate with.
- /// Default Value: GENERAL
- /// Example: GENERAL - ///
- public enum StyleTypeV3 - { - /// - /// - /// - Auto, - /// - /// - /// - Custom, - /// - /// - /// - Design, - /// - /// - /// - Fiction, - /// - /// - /// - General, - /// - /// - /// - Realistic, - /// - /// - /// - Stylized, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class StyleTypeV3Extensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this StyleTypeV3 value) - { - return value switch - { - StyleTypeV3.Auto => "AUTO", - StyleTypeV3.Custom => "CUSTOM", - StyleTypeV3.Design => "DESIGN", - StyleTypeV3.Fiction => "FICTION", - StyleTypeV3.General => "GENERAL", - StyleTypeV3.Realistic => "REALISTIC", - StyleTypeV3.Stylized => "STYLIZED", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static StyleTypeV3? ToEnum(string value) - { - return value switch - { - "AUTO" => StyleTypeV3.Auto, - "CUSTOM" => StyleTypeV3.Custom, - "DESIGN" => StyleTypeV3.Design, - "FICTION" => StyleTypeV3.Fiction, - "GENERAL" => StyleTypeV3.General, - "REALISTIC" => StyleTypeV3.Realistic, - "STYLIZED" => StyleTypeV3.Stylized, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.SvgGenerationObject.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.SvgGenerationObject.Json.g.cs deleted file mode 100644 index ddeef308..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.SvgGenerationObject.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class SvgGenerationObject - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.SvgGenerationObject? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.SvgGenerationObject), - jsonSerializerContext) as global::Ideogram.SvgGenerationObject; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.SvgGenerationObject? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.SvgGenerationObject? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.SvgGenerationObject), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.SvgGenerationObject; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.SvgGenerationObject.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.SvgGenerationObject.g.cs deleted file mode 100644 index 9c4a4fcc..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.SvgGenerationObject.g.cs +++ /dev/null @@ -1,103 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - public sealed partial class SvgGenerationObject - { - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("object_type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.SvgGenerationObjectObjectTypeJsonConverter))] - public global::Ideogram.SvgGenerationObjectObjectType ObjectType { get; set; } - - /// - /// URL-safe base64 SVG asset ID. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("asset_id")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string AssetId { get; set; } - - /// - /// Signed download URL for the original SVG. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("url")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Url { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("mime_type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.SvgGenerationObjectMimeTypeJsonConverter))] - public global::Ideogram.SvgGenerationObjectMimeType MimeType { get; set; } - - /// - /// Width of the output SVG canvas in pixels. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("width")] - [global::System.Text.Json.Serialization.JsonRequired] - public required int Width { get; set; } - - /// - /// Height of the output SVG canvas in pixels. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("height")] - [global::System.Text.Json.Serialization.JsonRequired] - public required int Height { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// URL-safe base64 SVG asset ID. - /// - /// - /// Signed download URL for the original SVG. - /// - /// - /// Width of the output SVG canvas in pixels. - /// - /// - /// Height of the output SVG canvas in pixels. - /// - /// - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public SvgGenerationObject( - string assetId, - string url, - int width, - int height, - global::Ideogram.SvgGenerationObjectObjectType objectType, - global::Ideogram.SvgGenerationObjectMimeType mimeType) - { - this.ObjectType = objectType; - this.AssetId = assetId ?? throw new global::System.ArgumentNullException(nameof(assetId)); - this.Url = url ?? throw new global::System.ArgumentNullException(nameof(url)); - this.MimeType = mimeType; - this.Width = width; - this.Height = height; - } - - /// - /// Initializes a new instance of the class. - /// - public SvgGenerationObject() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.SvgGenerationObjectMimeType.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.SvgGenerationObjectMimeType.g.cs deleted file mode 100644 index e70f8a18..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.SvgGenerationObjectMimeType.g.cs +++ /dev/null @@ -1,45 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - public enum SvgGenerationObjectMimeType - { - /// - /// - /// - ImageSvgPlusxml, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class SvgGenerationObjectMimeTypeExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this SvgGenerationObjectMimeType value) - { - return value switch - { - SvgGenerationObjectMimeType.ImageSvgPlusxml => "image/svg+xml", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static SvgGenerationObjectMimeType? ToEnum(string value) - { - return value switch - { - "image/svg+xml" => SvgGenerationObjectMimeType.ImageSvgPlusxml, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.SvgGenerationObjectObjectType.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.SvgGenerationObjectObjectType.g.cs deleted file mode 100644 index cb4f8d36..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.SvgGenerationObjectObjectType.g.cs +++ /dev/null @@ -1,45 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - public enum SvgGenerationObjectObjectType - { - /// - /// - /// - SvgGeneration, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class SvgGenerationObjectObjectTypeExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this SvgGenerationObjectObjectType value) - { - return value switch - { - SvgGenerationObjectObjectType.SvgGeneration => "svg.generation", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static SvgGenerationObjectObjectType? ToEnum(string value) - { - return value switch - { - "svg.generation" => SvgGenerationObjectObjectType.SvgGeneration, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.SwanSLogoDesignRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.SwanSLogoDesignRequest.Json.g.cs deleted file mode 100644 index 19f6883a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.SwanSLogoDesignRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class SwanSLogoDesignRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.SwanSLogoDesignRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.SwanSLogoDesignRequest), - jsonSerializerContext) as global::Ideogram.SwanSLogoDesignRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.SwanSLogoDesignRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.SwanSLogoDesignRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.SwanSLogoDesignRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.SwanSLogoDesignRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.SwanSLogoDesignRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.SwanSLogoDesignRequest.g.cs deleted file mode 100644 index 9e724237..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.SwanSLogoDesignRequest.g.cs +++ /dev/null @@ -1,181 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"logo_style":"3d","flat_silhouette_asset_identifier":{"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"},"private":true,"webhook_url":"https://api.example.com/webhooks/ideogram","source_mode":"shoe_swatch","logo_specification_asset_identifier":{"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"},"design_variant":"split_coverage","style_source_asset_identifier":{"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"},"geometry_hero_asset_identifier":{"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"},"quality":null} - /// - public sealed partial class SwanSLogoDesignRequest - { - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("logo_style")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.SwanSLogoDesignRequestLogoStyleJsonConverter))] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.SwanSLogoDesignRequestLogoStyle LogoStyle { get; set; } - - /// - /// Use a shoe color swatch or an uploaded logo reference as the style source. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("source_mode")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.SwanSLogoDesignRequestSourceModeJsonConverter))] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.SwanSLogoDesignRequestSourceMode SourceMode { get; set; } - - /// - /// Required for 3D user_reference designs. Omit for other designs. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("design_variant")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.SwanSLogoDesignRequestDesignVariantJsonConverter))] - public global::Ideogram.SwanSLogoDesignRequestDesignVariant? DesignVariant { get; set; } - - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - ///
- /// {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - [global::System.Text.Json.Serialization.JsonPropertyName("style_source_asset_identifier")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.AssetIdentifier StyleSourceAssetIdentifier { get; set; } - - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - ///
- /// {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - [global::System.Text.Json.Serialization.JsonPropertyName("geometry_hero_asset_identifier")] - public global::Ideogram.AssetIdentifier? GeometryHeroAssetIdentifier { get; set; } - - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - ///
- /// {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - [global::System.Text.Json.Serialization.JsonPropertyName("logo_specification_asset_identifier")] - public global::Ideogram.AssetIdentifier? LogoSpecificationAssetIdentifier { get; set; } - - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - ///
- /// {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - [global::System.Text.Json.Serialization.JsonPropertyName("flat_silhouette_asset_identifier")] - public global::Ideogram.AssetIdentifier? FlatSilhouetteAssetIdentifier { get; set; } - - /// - /// The quality tier for the edit. Higher tiers may improve detail and
- /// take longer to complete. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("quality")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.SwanSLogoQualityJsonConverter))] - public global::Ideogram.SwanSLogoQuality? Quality { get; set; } - - /// - /// When true or omitted, keep outputs private. Enterprise accounts always generate privately. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - ///
- /// https://api.example.com/webhooks/ideogram - [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] - public string? WebhookUrl { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// - /// Use a shoe color swatch or an uploaded logo reference as the style source. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// Required for 3D user_reference designs. Omit for other designs. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The quality tier for the edit. Higher tiers may improve detail and
- /// take longer to complete. - /// - /// - /// When true or omitted, keep outputs private. Enterprise accounts always generate privately. - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public SwanSLogoDesignRequest( - global::Ideogram.SwanSLogoDesignRequestLogoStyle logoStyle, - global::Ideogram.SwanSLogoDesignRequestSourceMode sourceMode, - global::Ideogram.AssetIdentifier styleSourceAssetIdentifier, - global::Ideogram.SwanSLogoDesignRequestDesignVariant? designVariant, - global::Ideogram.AssetIdentifier? geometryHeroAssetIdentifier, - global::Ideogram.AssetIdentifier? logoSpecificationAssetIdentifier, - global::Ideogram.AssetIdentifier? flatSilhouetteAssetIdentifier, - global::Ideogram.SwanSLogoQuality? quality, - bool? @private, - string? webhookUrl) - { - this.LogoStyle = logoStyle; - this.SourceMode = sourceMode; - this.DesignVariant = designVariant; - this.StyleSourceAssetIdentifier = styleSourceAssetIdentifier ?? throw new global::System.ArgumentNullException(nameof(styleSourceAssetIdentifier)); - this.GeometryHeroAssetIdentifier = geometryHeroAssetIdentifier; - this.LogoSpecificationAssetIdentifier = logoSpecificationAssetIdentifier; - this.FlatSilhouetteAssetIdentifier = flatSilhouetteAssetIdentifier; - this.Quality = quality; - this.Private = @private; - this.WebhookUrl = webhookUrl; - } - - /// - /// Initializes a new instance of the class. - /// - public SwanSLogoDesignRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.SwanSLogoDesignRequestDesignVariant.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.SwanSLogoDesignRequestDesignVariant.g.cs deleted file mode 100644 index 2bff7811..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.SwanSLogoDesignRequestDesignVariant.g.cs +++ /dev/null @@ -1,51 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Required for 3D user_reference designs. Omit for other designs. - /// - public enum SwanSLogoDesignRequestDesignVariant - { - /// - /// - /// - FullCoverage, - /// - /// - /// - SplitCoverage, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class SwanSLogoDesignRequestDesignVariantExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this SwanSLogoDesignRequestDesignVariant value) - { - return value switch - { - SwanSLogoDesignRequestDesignVariant.FullCoverage => "full_coverage", - SwanSLogoDesignRequestDesignVariant.SplitCoverage => "split_coverage", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static SwanSLogoDesignRequestDesignVariant? ToEnum(string value) - { - return value switch - { - "full_coverage" => SwanSLogoDesignRequestDesignVariant.FullCoverage, - "split_coverage" => SwanSLogoDesignRequestDesignVariant.SplitCoverage, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.SwanSLogoDesignRequestLogoStyle.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.SwanSLogoDesignRequestLogoStyle.g.cs deleted file mode 100644 index 0e2adc34..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.SwanSLogoDesignRequestLogoStyle.g.cs +++ /dev/null @@ -1,51 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - public enum SwanSLogoDesignRequestLogoStyle - { - /// - /// - /// - x3d, - /// - /// - /// - Flat, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class SwanSLogoDesignRequestLogoStyleExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this SwanSLogoDesignRequestLogoStyle value) - { - return value switch - { - SwanSLogoDesignRequestLogoStyle.x3d => "3d", - SwanSLogoDesignRequestLogoStyle.Flat => "flat", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static SwanSLogoDesignRequestLogoStyle? ToEnum(string value) - { - return value switch - { - "3d" => SwanSLogoDesignRequestLogoStyle.x3d, - "flat" => SwanSLogoDesignRequestLogoStyle.Flat, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.SwanSLogoDesignRequestSourceMode.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.SwanSLogoDesignRequestSourceMode.g.cs deleted file mode 100644 index 34193994..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.SwanSLogoDesignRequestSourceMode.g.cs +++ /dev/null @@ -1,51 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Use a shoe color swatch or an uploaded logo reference as the style source. - /// - public enum SwanSLogoDesignRequestSourceMode - { - /// - /// - /// - ShoeSwatch, - /// - /// - /// - UserReference, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class SwanSLogoDesignRequestSourceModeExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this SwanSLogoDesignRequestSourceMode value) - { - return value switch - { - SwanSLogoDesignRequestSourceMode.ShoeSwatch => "shoe_swatch", - SwanSLogoDesignRequestSourceMode.UserReference => "user_reference", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static SwanSLogoDesignRequestSourceMode? ToEnum(string value) - { - return value switch - { - "shoe_swatch" => SwanSLogoDesignRequestSourceMode.ShoeSwatch, - "user_reference" => SwanSLogoDesignRequestSourceMode.UserReference, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.SwanSLogoDesignResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.SwanSLogoDesignResponse.Json.g.cs deleted file mode 100644 index 6c7f5646..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.SwanSLogoDesignResponse.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class SwanSLogoDesignResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.SwanSLogoDesignResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.SwanSLogoDesignResponse), - jsonSerializerContext) as global::Ideogram.SwanSLogoDesignResponse; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.SwanSLogoDesignResponse? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.SwanSLogoDesignResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.SwanSLogoDesignResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.SwanSLogoDesignResponse; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.SwanSLogoDesignResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.SwanSLogoDesignResponse.g.cs deleted file mode 100644 index 9ac9dc3f..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.SwanSLogoDesignResponse.g.cs +++ /dev/null @@ -1,47 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"generation_id":"generation_id"} - /// - public sealed partial class SwanSLogoDesignResponse - { - /// - /// URL-safe base64 ID accepted by GET /v2/generations/{generation_id}. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("generation_id")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string GenerationId { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// URL-safe base64 ID accepted by GET /v2/generations/{generation_id}. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public SwanSLogoDesignResponse( - string generationId) - { - this.GenerationId = generationId ?? throw new global::System.ArgumentNullException(nameof(generationId)); - } - - /// - /// Initializes a new instance of the class. - /// - public SwanSLogoDesignResponse() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.SwanSLogoInstallRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.SwanSLogoInstallRequest.Json.g.cs deleted file mode 100644 index 4de3395a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.SwanSLogoInstallRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class SwanSLogoInstallRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.SwanSLogoInstallRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.SwanSLogoInstallRequest), - jsonSerializerContext) as global::Ideogram.SwanSLogoInstallRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.SwanSLogoInstallRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.SwanSLogoInstallRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.SwanSLogoInstallRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.SwanSLogoInstallRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.SwanSLogoInstallRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.SwanSLogoInstallRequest.g.cs deleted file mode 100644 index 83863223..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.SwanSLogoInstallRequest.g.cs +++ /dev/null @@ -1,163 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"logo_style":"3d","aspect_ratio":"aspect_ratio","private":true,"webhook_url":"https://api.example.com/webhooks/ideogram","logo_asset_identifier":{"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"},"logo_specification_asset_identifier":{"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"},"shoe_asset_identifiers":[{"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"},{"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"},{"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"},{"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"},{"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"}],"num_images":0,"quality":null} - /// - public sealed partial class SwanSLogoInstallRequest - { - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("logo_style")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.SwanSLogoInstallRequestLogoStyleJsonConverter))] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.SwanSLogoInstallRequestLogoStyle LogoStyle { get; set; } - - /// - /// Ordered shoe views, primary view first. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("shoe_asset_identifiers")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList ShoeAssetIdentifiers { get; set; } - - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - ///
- /// {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - [global::System.Text.Json.Serialization.JsonPropertyName("logo_asset_identifier")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.AssetIdentifier LogoAssetIdentifier { get; set; } - - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - ///
- /// {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - [global::System.Text.Json.Serialization.JsonPropertyName("logo_specification_asset_identifier")] - public global::Ideogram.AssetIdentifier? LogoSpecificationAssetIdentifier { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string AspectRatio { get; set; } - - /// - /// Number of images to create.
- /// Default Value: 4 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] - public int? NumImages { get; set; } - - /// - /// The quality tier for the edit. Higher tiers may improve detail and
- /// take longer to complete. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("quality")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.SwanSLogoQualityJsonConverter))] - public global::Ideogram.SwanSLogoQuality? Quality { get; set; } - - /// - /// When true or omitted, keep outputs private. Enterprise accounts always generate privately. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - ///
- /// https://api.example.com/webhooks/ideogram - [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] - public string? WebhookUrl { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// - /// Ordered shoe views, primary view first. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// Number of images to create.
- /// Default Value: 4 - /// - /// - /// The quality tier for the edit. Higher tiers may improve detail and
- /// take longer to complete. - /// - /// - /// When true or omitted, keep outputs private. Enterprise accounts always generate privately. - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public SwanSLogoInstallRequest( - global::Ideogram.SwanSLogoInstallRequestLogoStyle logoStyle, - global::System.Collections.Generic.IList shoeAssetIdentifiers, - global::Ideogram.AssetIdentifier logoAssetIdentifier, - string aspectRatio, - global::Ideogram.AssetIdentifier? logoSpecificationAssetIdentifier, - int? numImages, - global::Ideogram.SwanSLogoQuality? quality, - bool? @private, - string? webhookUrl) - { - this.LogoStyle = logoStyle; - this.ShoeAssetIdentifiers = shoeAssetIdentifiers ?? throw new global::System.ArgumentNullException(nameof(shoeAssetIdentifiers)); - this.LogoAssetIdentifier = logoAssetIdentifier ?? throw new global::System.ArgumentNullException(nameof(logoAssetIdentifier)); - this.LogoSpecificationAssetIdentifier = logoSpecificationAssetIdentifier; - this.AspectRatio = aspectRatio ?? throw new global::System.ArgumentNullException(nameof(aspectRatio)); - this.NumImages = numImages; - this.Quality = quality; - this.Private = @private; - this.WebhookUrl = webhookUrl; - } - - /// - /// Initializes a new instance of the class. - /// - public SwanSLogoInstallRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.SwanSLogoInstallRequestLogoStyle.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.SwanSLogoInstallRequestLogoStyle.g.cs deleted file mode 100644 index 8d977bcb..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.SwanSLogoInstallRequestLogoStyle.g.cs +++ /dev/null @@ -1,51 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - public enum SwanSLogoInstallRequestLogoStyle - { - /// - /// - /// - x3d, - /// - /// - /// - Flat, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class SwanSLogoInstallRequestLogoStyleExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this SwanSLogoInstallRequestLogoStyle value) - { - return value switch - { - SwanSLogoInstallRequestLogoStyle.x3d => "3d", - SwanSLogoInstallRequestLogoStyle.Flat => "flat", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static SwanSLogoInstallRequestLogoStyle? ToEnum(string value) - { - return value switch - { - "3d" => SwanSLogoInstallRequestLogoStyle.x3d, - "flat" => SwanSLogoInstallRequestLogoStyle.Flat, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.SwanSLogoInstallResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.SwanSLogoInstallResponse.Json.g.cs deleted file mode 100644 index fb738ec5..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.SwanSLogoInstallResponse.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class SwanSLogoInstallResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.SwanSLogoInstallResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.SwanSLogoInstallResponse), - jsonSerializerContext) as global::Ideogram.SwanSLogoInstallResponse; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.SwanSLogoInstallResponse? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.SwanSLogoInstallResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.SwanSLogoInstallResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.SwanSLogoInstallResponse; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.SwanSLogoInstallResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.SwanSLogoInstallResponse.g.cs deleted file mode 100644 index f82aab64..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.SwanSLogoInstallResponse.g.cs +++ /dev/null @@ -1,47 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"generation_id":"generation_id"} - /// - public sealed partial class SwanSLogoInstallResponse - { - /// - /// URL-safe base64 ID accepted by GET /v2/generations/{generation_id}. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("generation_id")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string GenerationId { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// URL-safe base64 ID accepted by GET /v2/generations/{generation_id}. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public SwanSLogoInstallResponse( - string generationId) - { - this.GenerationId = generationId ?? throw new global::System.ArgumentNullException(nameof(generationId)); - } - - /// - /// Initializes a new instance of the class. - /// - public SwanSLogoInstallResponse() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.SwanSLogoQuality.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.SwanSLogoQuality.g.cs deleted file mode 100644 index fc2bf4a5..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.SwanSLogoQuality.g.cs +++ /dev/null @@ -1,58 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The quality tier for the edit. Higher tiers may improve detail and
- /// take longer to complete. - ///
- public enum SwanSLogoQuality - { - /// - /// - /// - High, - /// - /// - /// - Low, - /// - /// - /// - Medium, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class SwanSLogoQualityExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this SwanSLogoQuality value) - { - return value switch - { - SwanSLogoQuality.High => "high", - SwanSLogoQuality.Low => "low", - SwanSLogoQuality.Medium => "medium", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static SwanSLogoQuality? ToEnum(string value) - { - return value switch - { - "high" => SwanSLogoQuality.High, - "low" => SwanSLogoQuality.Low, - "medium" => SwanSLogoQuality.Medium, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.SwapProductMode.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.SwapProductMode.g.cs deleted file mode 100644 index e7d64f3e..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.SwapProductMode.g.cs +++ /dev/null @@ -1,51 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Replace the footwear or match its colorway to the references. - /// - public enum SwapProductMode - { - /// - /// - /// - Recolor, - /// - /// - /// - Replace, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class SwapProductModeExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this SwapProductMode value) - { - return value switch - { - SwapProductMode.Recolor => "recolor", - SwapProductMode.Replace => "replace", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static SwapProductMode? ToEnum(string value) - { - return value switch - { - "recolor" => SwapProductMode.Recolor, - "replace" => SwapProductMode.Replace, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.SwapProductQuality.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.SwapProductQuality.g.cs deleted file mode 100644 index d0f67033..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.SwapProductQuality.g.cs +++ /dev/null @@ -1,58 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The quality tier for the edit. Higher tiers may improve detail and
- /// take longer to complete. - ///
- public enum SwapProductQuality - { - /// - /// - /// - High, - /// - /// - /// - Low, - /// - /// - /// - Medium, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class SwapProductQualityExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this SwapProductQuality value) - { - return value switch - { - SwapProductQuality.High => "high", - SwapProductQuality.Low => "low", - SwapProductQuality.Medium => "medium", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static SwapProductQuality? ToEnum(string value) - { - return value switch - { - "high" => SwapProductQuality.High, - "low" => SwapProductQuality.Low, - "medium" => SwapProductQuality.Medium, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.SwapProductRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.SwapProductRequest.Json.g.cs deleted file mode 100644 index 39084b06..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.SwapProductRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class SwapProductRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.SwapProductRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.SwapProductRequest), - jsonSerializerContext) as global::Ideogram.SwapProductRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.SwapProductRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.SwapProductRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.SwapProductRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.SwapProductRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.SwapProductRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.SwapProductRequest.g.cs deleted file mode 100644 index d4de4eaa..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.SwapProductRequest.g.cs +++ /dev/null @@ -1,165 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"mode":null,"aspect_ratio":"aspect_ratio","private":true,"webhook_url":"https://api.example.com/webhooks/ideogram","instruction":"instruction","source_asset_identifier":{"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"},"num_images":0,"product_asset_identifiers":[{"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"},{"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"},{"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"},{"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"},{"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"}],"quality":null} - /// - public sealed partial class SwapProductRequest - { - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - ///
- /// {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - [global::System.Text.Json.Serialization.JsonPropertyName("source_asset_identifier")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.AssetIdentifier SourceAssetIdentifier { get; set; } - - /// - /// Ordered footwear references, following the source advertisement. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("product_asset_identifiers")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList ProductAssetIdentifiers { get; set; } - - /// - /// Replace the footwear or match its colorway to the references. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("mode")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.SwapProductModeJsonConverter))] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.SwapProductMode Mode { get; set; } - - /// - /// Optional edits that take precedence over the default preservation guidance. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("instruction")] - public string? Instruction { get; set; } - - /// - /// Output aspect ratio. Defaults to the closest supported ratio to the source. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] - public string? AspectRatio { get; set; } - - /// - /// Number of images to generate.
- /// Default Value: 1 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] - public int? NumImages { get; set; } - - /// - /// The quality tier for the edit. Higher tiers may improve detail and
- /// take longer to complete. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("quality")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.SwapProductQualityJsonConverter))] - public global::Ideogram.SwapProductQuality? Quality { get; set; } - - /// - /// Results are private by default. Set false to request public results.
- /// Enterprise accounts always generate privately. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - ///
- /// https://api.example.com/webhooks/ideogram - [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] - public string? WebhookUrl { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// Ordered footwear references, following the source advertisement. - /// - /// - /// Replace the footwear or match its colorway to the references. - /// - /// - /// Optional edits that take precedence over the default preservation guidance. - /// - /// - /// Output aspect ratio. Defaults to the closest supported ratio to the source. - /// - /// - /// Number of images to generate.
- /// Default Value: 1 - /// - /// - /// The quality tier for the edit. Higher tiers may improve detail and
- /// take longer to complete. - /// - /// - /// Results are private by default. Set false to request public results.
- /// Enterprise accounts always generate privately. - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public SwapProductRequest( - global::Ideogram.AssetIdentifier sourceAssetIdentifier, - global::System.Collections.Generic.IList productAssetIdentifiers, - global::Ideogram.SwapProductMode mode, - string? instruction, - string? aspectRatio, - int? numImages, - global::Ideogram.SwapProductQuality? quality, - bool? @private, - string? webhookUrl) - { - this.SourceAssetIdentifier = sourceAssetIdentifier ?? throw new global::System.ArgumentNullException(nameof(sourceAssetIdentifier)); - this.ProductAssetIdentifiers = productAssetIdentifiers ?? throw new global::System.ArgumentNullException(nameof(productAssetIdentifiers)); - this.Mode = mode; - this.Instruction = instruction; - this.AspectRatio = aspectRatio; - this.NumImages = numImages; - this.Quality = quality; - this.Private = @private; - this.WebhookUrl = webhookUrl; - } - - /// - /// Initializes a new instance of the class. - /// - public SwapProductRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.SwapProductResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.SwapProductResponse.Json.g.cs deleted file mode 100644 index b2822ac7..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.SwapProductResponse.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class SwapProductResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.SwapProductResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.SwapProductResponse), - jsonSerializerContext) as global::Ideogram.SwapProductResponse; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.SwapProductResponse? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.SwapProductResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.SwapProductResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.SwapProductResponse; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.SwapProductResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.SwapProductResponse.g.cs deleted file mode 100644 index 29e18ba2..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.SwapProductResponse.g.cs +++ /dev/null @@ -1,47 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"generation_id":"generation_id"} - /// - public sealed partial class SwapProductResponse - { - /// - /// URL-safe base64 ID accepted by the generation polling endpoint. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("generation_id")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string GenerationId { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// URL-safe base64 ID accepted by the generation polling endpoint. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public SwapProductResponse( - string generationId) - { - this.GenerationId = generationId ?? throw new global::System.ArgumentNullException(nameof(generationId)); - } - - /// - /// Initializes a new instance of the class. - /// - public SwapProductResponse() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.TextColorSpan.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.TextColorSpan.g.cs index a7722c0b..2f285759 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.TextColorSpan.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.TextColorSpan.g.cs @@ -12,19 +12,15 @@ namespace Ideogram public sealed partial class TextColorSpan { /// - /// The characters in this run.
- /// Example: T + /// The characters in this run. ///
- /// T [global::System.Text.Json.Serialization.JsonPropertyName("text")] [global::System.Text.Json.Serialization.JsonRequired] public required string Text { get; set; } /// - /// Hex colour for this run.
- /// Example: #F4ACC4 + /// Hex colour for this run. ///
- /// #F4ACC4 [global::System.Text.Json.Serialization.JsonPropertyName("color")] [global::System.Text.Json.Serialization.JsonRequired] public required string Color { get; set; } @@ -39,12 +35,10 @@ public sealed partial class TextColorSpan /// Initializes a new instance of the class. /// /// - /// The characters in this run.
- /// Example: T + /// The characters in this run. /// /// - /// Hex colour for this run.
- /// Example: #F4ACC4 + /// Hex colour for this run. /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.TextContainerV3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.TextContainerV3.Json.g.cs deleted file mode 100644 index 77058051..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.TextContainerV3.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class TextContainerV3 - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.TextContainerV3? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.TextContainerV3), - jsonSerializerContext) as global::Ideogram.TextContainerV3; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.TextContainerV3? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.TextContainerV3? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.TextContainerV3), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.TextContainerV3; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.TextContainerV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.TextContainerV3.g.cs deleted file mode 100644 index 29fce3e0..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.TextContainerV3.g.cs +++ /dev/null @@ -1,60 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// A spatial grouping of related text items that form a cohesive visual unit (e.g., a title group, a list, a card).
- /// Example: {"id":"id","items":[{"font_candidates":["font_candidates","font_candidates"],"spans":[{"color":"#212121","text":"text","font_fx":["bold","italic"]},{"color":"#212121","text":"text","font_fx":["bold","italic"]}],"text_shadows":[{"color":"color","blur":0.2027123,"offset_x":9.301444,"offset_y":3.6160767},{"color":"color","blur":0.2027123,"offset_x":9.301444,"offset_y":3.6160767}],"font_size":5,"vertical_alignment":"top","text_transform":"none","glyph_type":"bullet","line_height":2.302136,"x":0,"width":1,"style_class":"body","y":6,"angle":0,"alignment":"center","font_file":"font_file","letter_spacing":7.0614014,"height":5},{"font_candidates":["font_candidates","font_candidates"],"spans":[{"color":"#212121","text":"text","font_fx":["bold","italic"]},{"color":"#212121","text":"text","font_fx":["bold","italic"]}],"text_shadows":[{"color":"color","blur":0.2027123,"offset_x":9.301444,"offset_y":3.6160767},{"color":"color","blur":0.2027123,"offset_x":9.301444,"offset_y":3.6160767}],"font_size":5,"vertical_alignment":"top","text_transform":"none","glyph_type":"bullet","line_height":2.302136,"x":0,"width":1,"style_class":"body","y":6,"angle":0,"alignment":"center","font_file":"font_file","letter_spacing":7.0614014,"height":5}]} - ///
- public sealed partial class TextContainerV3 - { - /// - /// Unique container identifier (e.g., "container_01"). - /// - [global::System.Text.Json.Serialization.JsonPropertyName("id")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Id { get; set; } - - /// - /// Ordered list of text items in this container. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("items")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList Items { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Unique container identifier (e.g., "container_01"). - /// - /// - /// Ordered list of text items in this container. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public TextContainerV3( - string id, - global::System.Collections.Generic.IList items) - { - this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); - this.Items = items ?? throw new global::System.ArgumentNullException(nameof(items)); - } - - /// - /// Initializes a new instance of the class. - /// - public TextContainerV3() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.TextItemV3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.TextItemV3.Json.g.cs deleted file mode 100644 index 2bb21657..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.TextItemV3.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class TextItemV3 - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.TextItemV3? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.TextItemV3), - jsonSerializerContext) as global::Ideogram.TextItemV3; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.TextItemV3? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.TextItemV3? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.TextItemV3), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.TextItemV3; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.TextItemV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.TextItemV3.g.cs deleted file mode 100644 index 536a061a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.TextItemV3.g.cs +++ /dev/null @@ -1,253 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// A single text block within a container, representing one logical unit of text (e.g., a headline, a paragraph, a list entry).
- /// Example: {"font_candidates":["font_candidates","font_candidates"],"spans":[{"color":"#212121","text":"text","font_fx":["bold","italic"]},{"color":"#212121","text":"text","font_fx":["bold","italic"]}],"text_shadows":[{"color":"color","blur":0.2027123,"offset_x":9.301444,"offset_y":3.6160767},{"color":"color","blur":0.2027123,"offset_x":9.301444,"offset_y":3.6160767}],"font_size":5,"vertical_alignment":"top","text_transform":"none","glyph_type":"bullet","line_height":2.302136,"x":0,"width":1,"style_class":"body","y":6,"angle":0,"alignment":"center","font_file":"font_file","letter_spacing":7.0614014,"height":5} - ///
- public sealed partial class TextItemV3 - { - /// - /// The x coordinate of the item in pixels. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("x")] - [global::System.Text.Json.Serialization.JsonRequired] - public required int X { get; set; } - - /// - /// The y coordinate of the item in pixels. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("y")] - [global::System.Text.Json.Serialization.JsonRequired] - public required int Y { get; set; } - - /// - /// The width of the item in pixels. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("width")] - [global::System.Text.Json.Serialization.JsonRequired] - public required int Width { get; set; } - - /// - /// The height of the item in pixels. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("height")] - [global::System.Text.Json.Serialization.JsonRequired] - public required int Height { get; set; } - - /// - /// The text alignment of the item.
- /// Example: center - ///
- /// center - [global::System.Text.Json.Serialization.JsonPropertyName("alignment")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.TextItemV3AlignmentJsonConverter))] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.TextItemV3Alignment Alignment { get; set; } - - /// - /// The angle rotation of the text, measured clockwise in degrees.
- /// Example: 0 - ///
- /// 0 - [global::System.Text.Json.Serialization.JsonPropertyName("angle")] - public float? Angle { get; set; } - - /// - /// Typographic classification of the text.
- /// Example: body - ///
- /// body - [global::System.Text.Json.Serialization.JsonPropertyName("style_class")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.TextItemV3StyleClassJsonConverter))] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.TextItemV3StyleClass StyleClass { get; set; } - - /// - /// The type of list marker glyph, if any. Null for non-list items.
- /// Example: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464 - ///
- /// openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464 - [global::System.Text.Json.Serialization.JsonPropertyName("glyph_type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.TextItemV3GlyphTypeJsonConverter))] - public global::Ideogram.TextItemV3GlyphType? GlyphType { get; set; } - - /// - /// The matched font file for this item. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("font_file")] - public string? FontFile { get; set; } - - /// - /// A list of alternate matching font files for this item. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("font_candidates")] - public global::System.Collections.Generic.IList? FontCandidates { get; set; } - - /// - /// The font size in points. Null for non-editable items. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("font_size")] - public int? FontSize { get; set; } - - /// - /// The line height multiplier (e.g., 1.2). Null for non-editable items. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("line_height")] - public float? LineHeight { get; set; } - - /// - /// Letter spacing in em units (e.g. 0.05 = 5% of em). V4 vector-text only. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("letter_spacing")] - public float? LetterSpacing { get; set; } - - /// - /// Case folding applied at render time. V4 vector-text only. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("text_transform")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.TextItemV3TextTransformJsonConverter))] - public global::Ideogram.TextItemV3TextTransform? TextTransform { get; set; } - - /// - /// Vertical anchor (top|middle|bottom) for the rendered text within
- /// its bounding box. Maps to SVG `dominant-baseline`. V4 vector-text
- /// only. Distinct from horizontal `alignment` (left|center|right). - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("vertical_alignment")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.TextItemV3VerticalAlignmentJsonConverter))] - public global::Ideogram.TextItemV3VerticalAlignment? VerticalAlignment { get; set; } - - /// - /// Stacked CSS text shadows, composed back-to-front. Phase-1 ships at
- /// most one entry; phase-2 unlocks multi-stack. V4 vector-text only. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("text_shadows")] - public global::System.Collections.Generic.IList? TextShadows { get; set; } - - /// - /// Ordered list of text spans. Concatenating span text values produces the full item text. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("spans")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList Spans { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The x coordinate of the item in pixels. - /// - /// - /// The y coordinate of the item in pixels. - /// - /// - /// The width of the item in pixels. - /// - /// - /// The height of the item in pixels. - /// - /// - /// The text alignment of the item.
- /// Example: center - /// - /// - /// Typographic classification of the text.
- /// Example: body - /// - /// - /// Ordered list of text spans. Concatenating span text values produces the full item text. - /// - /// - /// The angle rotation of the text, measured clockwise in degrees.
- /// Example: 0 - /// - /// - /// The type of list marker glyph, if any. Null for non-list items.
- /// Example: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464 - /// - /// - /// The matched font file for this item. - /// - /// - /// A list of alternate matching font files for this item. - /// - /// - /// The font size in points. Null for non-editable items. - /// - /// - /// The line height multiplier (e.g., 1.2). Null for non-editable items. - /// - /// - /// Letter spacing in em units (e.g. 0.05 = 5% of em). V4 vector-text only. - /// - /// - /// Case folding applied at render time. V4 vector-text only. - /// - /// - /// Vertical anchor (top|middle|bottom) for the rendered text within
- /// its bounding box. Maps to SVG `dominant-baseline`. V4 vector-text
- /// only. Distinct from horizontal `alignment` (left|center|right). - /// - /// - /// Stacked CSS text shadows, composed back-to-front. Phase-1 ships at
- /// most one entry; phase-2 unlocks multi-stack. V4 vector-text only. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public TextItemV3( - int x, - int y, - int width, - int height, - global::Ideogram.TextItemV3Alignment alignment, - global::Ideogram.TextItemV3StyleClass styleClass, - global::System.Collections.Generic.IList spans, - float? angle, - global::Ideogram.TextItemV3GlyphType? glyphType, - string? fontFile, - global::System.Collections.Generic.IList? fontCandidates, - int? fontSize, - float? lineHeight, - float? letterSpacing, - global::Ideogram.TextItemV3TextTransform? textTransform, - global::Ideogram.TextItemV3VerticalAlignment? verticalAlignment, - global::System.Collections.Generic.IList? textShadows) - { - this.X = x; - this.Y = y; - this.Width = width; - this.Height = height; - this.Alignment = alignment; - this.Angle = angle; - this.StyleClass = styleClass; - this.GlyphType = glyphType; - this.FontFile = fontFile; - this.FontCandidates = fontCandidates; - this.FontSize = fontSize; - this.LineHeight = lineHeight; - this.LetterSpacing = letterSpacing; - this.TextTransform = textTransform; - this.VerticalAlignment = verticalAlignment; - this.TextShadows = textShadows; - this.Spans = spans ?? throw new global::System.ArgumentNullException(nameof(spans)); - } - - /// - /// Initializes a new instance of the class. - /// - public TextItemV3() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.TextItemV3Alignment.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.TextItemV3Alignment.g.cs deleted file mode 100644 index b2822828..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.TextItemV3Alignment.g.cs +++ /dev/null @@ -1,58 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The text alignment of the item.
- /// Example: center - ///
- public enum TextItemV3Alignment - { - /// - /// - /// - Center, - /// - /// - /// - Left, - /// - /// - /// - Right, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class TextItemV3AlignmentExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this TextItemV3Alignment value) - { - return value switch - { - TextItemV3Alignment.Center => "center", - TextItemV3Alignment.Left => "left", - TextItemV3Alignment.Right => "right", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static TextItemV3Alignment? ToEnum(string value) - { - return value switch - { - "center" => TextItemV3Alignment.Center, - "left" => TextItemV3Alignment.Left, - "right" => TextItemV3Alignment.Right, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.TextItemV3GlyphType.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.TextItemV3GlyphType.g.cs deleted file mode 100644 index dfaf87b8..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.TextItemV3GlyphType.g.cs +++ /dev/null @@ -1,64 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The type of list marker glyph, if any. Null for non-list items.
- /// Example: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464 - ///
- public enum TextItemV3GlyphType - { - /// - /// - /// - Bullet, - /// - /// - /// - Icon, - /// - /// - /// - Number, - /// - /// - /// - Other, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class TextItemV3GlyphTypeExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this TextItemV3GlyphType value) - { - return value switch - { - TextItemV3GlyphType.Bullet => "bullet", - TextItemV3GlyphType.Icon => "icon", - TextItemV3GlyphType.Number => "number", - TextItemV3GlyphType.Other => "other", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static TextItemV3GlyphType? ToEnum(string value) - { - return value switch - { - "bullet" => TextItemV3GlyphType.Bullet, - "icon" => TextItemV3GlyphType.Icon, - "number" => TextItemV3GlyphType.Number, - "other" => TextItemV3GlyphType.Other, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.TextItemV3StyleClass.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.TextItemV3StyleClass.g.cs deleted file mode 100644 index d7c9f20f..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.TextItemV3StyleClass.g.cs +++ /dev/null @@ -1,64 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Typographic classification of the text.
- /// Example: body - ///
- public enum TextItemV3StyleClass - { - /// - /// - /// - Body, - /// - /// - /// - H1, - /// - /// - /// - H2, - /// - /// - /// - Small, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class TextItemV3StyleClassExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this TextItemV3StyleClass value) - { - return value switch - { - TextItemV3StyleClass.Body => "body", - TextItemV3StyleClass.H1 => "h1", - TextItemV3StyleClass.H2 => "h2", - TextItemV3StyleClass.Small => "small", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static TextItemV3StyleClass? ToEnum(string value) - { - return value switch - { - "body" => TextItemV3StyleClass.Body, - "h1" => TextItemV3StyleClass.H1, - "h2" => TextItemV3StyleClass.H2, - "small" => TextItemV3StyleClass.Small, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.TextItemV3TextTransform.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.TextItemV3TextTransform.g.cs deleted file mode 100644 index 0fdd169b..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.TextItemV3TextTransform.g.cs +++ /dev/null @@ -1,57 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Case folding applied at render time. V4 vector-text only. - /// - public enum TextItemV3TextTransform - { - /// - /// - /// - Lowercase, - /// - /// - /// - None, - /// - /// - /// - Uppercase, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class TextItemV3TextTransformExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this TextItemV3TextTransform value) - { - return value switch - { - TextItemV3TextTransform.Lowercase => "lowercase", - TextItemV3TextTransform.None => "none", - TextItemV3TextTransform.Uppercase => "uppercase", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static TextItemV3TextTransform? ToEnum(string value) - { - return value switch - { - "lowercase" => TextItemV3TextTransform.Lowercase, - "none" => TextItemV3TextTransform.None, - "uppercase" => TextItemV3TextTransform.Uppercase, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.TextItemV3VerticalAlignment.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.TextItemV3VerticalAlignment.g.cs deleted file mode 100644 index 237b9c86..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.TextItemV3VerticalAlignment.g.cs +++ /dev/null @@ -1,59 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Vertical anchor (top|middle|bottom) for the rendered text within
- /// its bounding box. Maps to SVG `dominant-baseline`. V4 vector-text
- /// only. Distinct from horizontal `alignment` (left|center|right). - ///
- public enum TextItemV3VerticalAlignment - { - /// - /// - /// - Bottom, - /// - /// - /// - Middle, - /// - /// - /// - Top, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class TextItemV3VerticalAlignmentExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this TextItemV3VerticalAlignment value) - { - return value switch - { - TextItemV3VerticalAlignment.Bottom => "bottom", - TextItemV3VerticalAlignment.Middle => "middle", - TextItemV3VerticalAlignment.Top => "top", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static TextItemV3VerticalAlignment? ToEnum(string value) - { - return value switch - { - "bottom" => TextItemV3VerticalAlignment.Bottom, - "middle" => TextItemV3VerticalAlignment.Middle, - "top" => TextItemV3VerticalAlignment.Top, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.TextLayerizerRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.TextLayerizerRequest.Json.g.cs deleted file mode 100644 index 55421265..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.TextLayerizerRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class TextLayerizerRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.TextLayerizerRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.TextLayerizerRequest), - jsonSerializerContext) as global::Ideogram.TextLayerizerRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.TextLayerizerRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.TextLayerizerRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.TextLayerizerRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.TextLayerizerRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.TextLayerizerRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.TextLayerizerRequest.g.cs deleted file mode 100644 index 855d602e..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.TextLayerizerRequest.g.cs +++ /dev/null @@ -1,158 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// A request to layerize the text in one image. Provide exactly one of
- /// `image` or `image_asset_identifier`. - ///
- public sealed partial class TextLayerizerRequest - { - /// - /// JPEG, PNG or WEBP source; at most 50 MB. Multipart only. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image")] - public byte[]? Image { get; set; } - - /// - /// JPEG, PNG or WEBP source; at most 50 MB. Multipart only. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] - public string? Imagename { get; set; } - - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - ///
- /// {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - [global::System.Text.Json.Serialization.JsonPropertyName("image_asset_identifier")] - public global::Ideogram.AssetIdentifier? ImageAssetIdentifier { get; set; } - - /// - /// A description of the image, used to guide text detection. When omitted, detection runs on the image alone. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - public string? Prompt { get; set; } - - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - ///
- /// 12345 - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// Candidate font files to make available for text style matching and to embed in the standalone HTML page. Supported formats .ttf, .otf, .woff, .woff2 (max 5 MB each, at most 5 files). Multipart only. You are responsible for holding the rights to embed and redistribute the fonts you upload. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("font_candidate_files")] - public global::System.Collections.Generic.IList? FontCandidateFiles { get; set; } - - /// - /// Outputs are private by default. Enterprise outputs are always private. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// URL-safe base64 ID of a writable destination collection. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("target_collection_id")] - public string? TargetCollectionId { get; set; } - - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - ///
- /// https://api.example.com/webhooks/ideogram - [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] - public string? WebhookUrl { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// JPEG, PNG or WEBP source; at most 50 MB. Multipart only. - /// - /// - /// JPEG, PNG or WEBP source; at most 50 MB. Multipart only. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// A description of the image, used to guide text detection. When omitted, detection runs on the image alone. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// Candidate font files to make available for text style matching and to embed in the standalone HTML page. Supported formats .ttf, .otf, .woff, .woff2 (max 5 MB each, at most 5 files). Multipart only. You are responsible for holding the rights to embed and redistribute the fonts you upload. - /// - /// - /// Outputs are private by default. Enterprise outputs are always private. - /// - /// - /// URL-safe base64 ID of a writable destination collection. - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public TextLayerizerRequest( - byte[]? image, - string? imagename, - global::Ideogram.AssetIdentifier? imageAssetIdentifier, - string? prompt, - int? seed, - global::System.Collections.Generic.IList? fontCandidateFiles, - bool? @private, - string? targetCollectionId, - string? webhookUrl) - { - this.Image = image; - this.Imagename = imagename; - this.ImageAssetIdentifier = imageAssetIdentifier; - this.Prompt = prompt; - this.Seed = seed; - this.FontCandidateFiles = fontCandidateFiles; - this.Private = @private; - this.TargetCollectionId = targetCollectionId; - this.WebhookUrl = webhookUrl; - } - - /// - /// Initializes a new instance of the class. - /// - public TextLayerizerRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.TextLayerizerResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.TextLayerizerResponse.Json.g.cs deleted file mode 100644 index 26195f33..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.TextLayerizerResponse.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class TextLayerizerResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.TextLayerizerResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.TextLayerizerResponse), - jsonSerializerContext) as global::Ideogram.TextLayerizerResponse; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.TextLayerizerResponse? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.TextLayerizerResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.TextLayerizerResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.TextLayerizerResponse; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.TextLayerizerResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.TextLayerizerResponse.g.cs deleted file mode 100644 index 98145f67..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.TextLayerizerResponse.g.cs +++ /dev/null @@ -1,47 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"generation_id":"generation_id"} - /// - public sealed partial class TextLayerizerResponse - { - /// - /// URL-safe base64 generation ID. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("generation_id")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string GenerationId { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// URL-safe base64 generation ID. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public TextLayerizerResponse( - string generationId) - { - this.GenerationId = generationId ?? throw new global::System.ArgumentNullException(nameof(generationId)); - } - - /// - /// Initializes a new instance of the class. - /// - public TextLayerizerResponse() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.TextLayerizerResultObject.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.TextLayerizerResultObject.Json.g.cs deleted file mode 100644 index a5976095..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.TextLayerizerResultObject.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class TextLayerizerResultObject - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.TextLayerizerResultObject? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.TextLayerizerResultObject), - jsonSerializerContext) as global::Ideogram.TextLayerizerResultObject; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.TextLayerizerResultObject? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.TextLayerizerResultObject? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.TextLayerizerResultObject), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.TextLayerizerResultObject; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.TextLayerizerResultObject.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.TextLayerizerResultObject.g.cs deleted file mode 100644 index 453d2cf0..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.TextLayerizerResultObject.g.cs +++ /dev/null @@ -1,169 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// One layerized design. Links are available for a limited period of time;
- /// if you would like to keep a file, you must download it. - ///
- public sealed partial class TextLayerizerResultObject - { - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("object_type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.TextLayerizerResultObjectObjectTypeJsonConverter))] - public global::Ideogram.TextLayerizerResultObjectObjectType ObjectType { get; set; } - - /// - /// Signed link to the design image with its text intact. Empty when the image did not pass safety checks. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("url")] - public string? Url { get; set; } - - /// - /// Signed link to the base image with all detected text removed. Empty when the image did not pass safety checks. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("base_image_url")] - public string? BaseImageUrl { get; set; } - - /// - /// The resolution of the design, formatted as "WIDTHxHEIGHT".
- /// Example: 1024x1024 - ///
- /// 1024x1024 - [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Resolution { get; set; } - - /// - /// Whether the image passed safety checks. If false, the links are empty. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("is_image_safe")] - [global::System.Text.Json.Serialization.JsonRequired] - public required bool IsImageSafe { get; set; } - - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - ///
- /// 12345 - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - [global::System.Text.Json.Serialization.JsonRequired] - public required int Seed { get; set; } - - /// - /// Flat list of detected text regions in the design. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("text_blocks")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList TextBlocks { get; set; } - - /// - /// Signed link to a self-contained HTML page displaying the editable
- /// design, including curved text, gradients, outlines, and shadows. The
- /// renderer, images, and fonts are embedded in the page, so it keeps
- /// working offline once downloaded; the link itself expires after 24
- /// hours. Uploaded `font_candidate_files` are embedded as supplied, so
- /// redistributing the page is subject to those fonts' licenses. Empty
- /// when the image did not pass safety checks or the page could not be
- /// built.
- /// The page exposes one editing API for every text layer, whether it
- /// is drawn as HTML or on a canvas. Each layer is addressed by its
- /// `text_blocks[].layer_id`. Scripts in the page can call
- /// `window.layerize` (`ready`, `getTextLayers()`, `setText(id, text)`,
- /// `update(id, patch)`, `toJSON()`, `toPNG()`); a parent page that
- /// embeds it in an iframe sends `postMessage` requests such as
- /// `{"type": "layerize:set-text", "id": "text-0", "text": "Hello"}`
- /// and receives `layerize:ready`, `layerize:updated`, and
- /// `layerize:error` replies. The page is served sandboxed with an
- /// opaque origin, so it cannot read cookies or storage of the site
- /// that embeds it. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("html_url")] - public string? HtmlUrl { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The resolution of the design, formatted as "WIDTHxHEIGHT".
- /// Example: 1024x1024 - /// - /// - /// Whether the image passed safety checks. If false, the links are empty. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// Flat list of detected text regions in the design. - /// - /// - /// - /// Signed link to the design image with its text intact. Empty when the image did not pass safety checks. - /// - /// - /// Signed link to the base image with all detected text removed. Empty when the image did not pass safety checks. - /// - /// - /// Signed link to a self-contained HTML page displaying the editable
- /// design, including curved text, gradients, outlines, and shadows. The
- /// renderer, images, and fonts are embedded in the page, so it keeps
- /// working offline once downloaded; the link itself expires after 24
- /// hours. Uploaded `font_candidate_files` are embedded as supplied, so
- /// redistributing the page is subject to those fonts' licenses. Empty
- /// when the image did not pass safety checks or the page could not be
- /// built.
- /// The page exposes one editing API for every text layer, whether it
- /// is drawn as HTML or on a canvas. Each layer is addressed by its
- /// `text_blocks[].layer_id`. Scripts in the page can call
- /// `window.layerize` (`ready`, `getTextLayers()`, `setText(id, text)`,
- /// `update(id, patch)`, `toJSON()`, `toPNG()`); a parent page that
- /// embeds it in an iframe sends `postMessage` requests such as
- /// `{"type": "layerize:set-text", "id": "text-0", "text": "Hello"}`
- /// and receives `layerize:ready`, `layerize:updated`, and
- /// `layerize:error` replies. The page is served sandboxed with an
- /// opaque origin, so it cannot read cookies or storage of the site
- /// that embeds it. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public TextLayerizerResultObject( - string resolution, - bool isImageSafe, - int seed, - global::System.Collections.Generic.IList textBlocks, - global::Ideogram.TextLayerizerResultObjectObjectType objectType, - string? url, - string? baseImageUrl, - string? htmlUrl) - { - this.ObjectType = objectType; - this.Url = url; - this.BaseImageUrl = baseImageUrl; - this.Resolution = resolution ?? throw new global::System.ArgumentNullException(nameof(resolution)); - this.IsImageSafe = isImageSafe; - this.Seed = seed; - this.TextBlocks = textBlocks ?? throw new global::System.ArgumentNullException(nameof(textBlocks)); - this.HtmlUrl = htmlUrl; - } - - /// - /// Initializes a new instance of the class. - /// - public TextLayerizerResultObject() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.TextLayerizerResultObjectObjectType.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.TextLayerizerResultObjectObjectType.g.cs deleted file mode 100644 index e5f7ec3f..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.TextLayerizerResultObjectObjectType.g.cs +++ /dev/null @@ -1,45 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - public enum TextLayerizerResultObjectObjectType - { - /// - /// - /// - LayerizedDesignGeneration, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class TextLayerizerResultObjectObjectTypeExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this TextLayerizerResultObjectObjectType value) - { - return value switch - { - TextLayerizerResultObjectObjectType.LayerizedDesignGeneration => "layerized_design.generation", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static TextLayerizerResultObjectObjectType? ToEnum(string value) - { - return value switch - { - "layerized_design.generation" => TextLayerizerResultObjectObjectType.LayerizedDesignGeneration, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.TextSpanV3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.TextSpanV3.Json.g.cs deleted file mode 100644 index e2efe107..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.TextSpanV3.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class TextSpanV3 - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.TextSpanV3? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.TextSpanV3), - jsonSerializerContext) as global::Ideogram.TextSpanV3; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.TextSpanV3? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.TextSpanV3? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.TextSpanV3), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.TextSpanV3; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.TextSpanV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.TextSpanV3.g.cs deleted file mode 100644 index f82c34ae..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.TextSpanV3.g.cs +++ /dev/null @@ -1,80 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// An atomic text segment within a text item, carrying text content and visual styling.
- /// Example: {"color":"#212121","text":"text","font_fx":["bold","italic"]} - ///
- public sealed partial class TextSpanV3 - { - /// - /// The text content for this segment. Line breaks within the span are represented as \n. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("text")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Text { get; set; } - - /// - /// Ordered list of style effects applied to this text span.
- /// This is the primary style field for layered text.
- /// Example: [bold, italic] - ///
- /// [bold, italic] - [global::System.Text.Json.Serialization.JsonPropertyName("font_fx")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList FontFx { get; set; } - - /// - /// The hex color of the text (e.g. "#FF0000" for red).
- /// Example: #212121 - ///
- /// #212121 - [global::System.Text.Json.Serialization.JsonPropertyName("color")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Color { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The text content for this segment. Line breaks within the span are represented as \n. - /// - /// - /// Ordered list of style effects applied to this text span.
- /// This is the primary style field for layered text.
- /// Example: [bold, italic] - /// - /// - /// The hex color of the text (e.g. "#FF0000" for red).
- /// Example: #212121 - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public TextSpanV3( - string text, - global::System.Collections.Generic.IList fontFx, - string color) - { - this.Text = text ?? throw new global::System.ArgumentNullException(nameof(text)); - this.FontFx = fontFx ?? throw new global::System.ArgumentNullException(nameof(fontFx)); - this.Color = color ?? throw new global::System.ArgumentNullException(nameof(color)); - } - - /// - /// Initializes a new instance of the class. - /// - public TextSpanV3() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.TextSpanV3FontFxItem.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.TextSpanV3FontFxItem.g.cs deleted file mode 100644 index bd2c318b..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.TextSpanV3FontFxItem.g.cs +++ /dev/null @@ -1,87 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - public enum TextSpanV3FontFxItem - { - /// - /// - /// - AllCaps, - /// - /// - /// - Bold, - /// - /// - /// - Italic, - /// - /// - /// - SmallCaps, - /// - /// - /// - Strikethrough, - /// - /// - /// - Subscript, - /// - /// - /// - Superscript, - /// - /// - /// - Underline, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class TextSpanV3FontFxItemExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this TextSpanV3FontFxItem value) - { - return value switch - { - TextSpanV3FontFxItem.AllCaps => "all_caps", - TextSpanV3FontFxItem.Bold => "bold", - TextSpanV3FontFxItem.Italic => "italic", - TextSpanV3FontFxItem.SmallCaps => "small_caps", - TextSpanV3FontFxItem.Strikethrough => "strikethrough", - TextSpanV3FontFxItem.Subscript => "subscript", - TextSpanV3FontFxItem.Superscript => "superscript", - TextSpanV3FontFxItem.Underline => "underline", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static TextSpanV3FontFxItem? ToEnum(string value) - { - return value switch - { - "all_caps" => TextSpanV3FontFxItem.AllCaps, - "bold" => TextSpanV3FontFxItem.Bold, - "italic" => TextSpanV3FontFxItem.Italic, - "small_caps" => TextSpanV3FontFxItem.SmallCaps, - "strikethrough" => TextSpanV3FontFxItem.Strikethrough, - "subscript" => TextSpanV3FontFxItem.Subscript, - "superscript" => TextSpanV3FontFxItem.Superscript, - "underline" => TextSpanV3FontFxItem.Underline, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolRemixRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolRemixRequest.Json.g.cs deleted file mode 100644 index f9b30b4e..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ToolRemixRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class ToolRemixRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.ToolRemixRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.ToolRemixRequest), - jsonSerializerContext) as global::Ideogram.ToolRemixRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.ToolRemixRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.ToolRemixRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.ToolRemixRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ToolRemixRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolRemixRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolRemixRequest.g.cs deleted file mode 100644 index 21ecf2dc..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ToolRemixRequest.g.cs +++ /dev/null @@ -1,335 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - public sealed partial class ToolRemixRequest - { - /// - /// The prompt that guides the remix. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Prompt { get; set; } - - /// - /// The existing upload or generated image to transform. Supply this or `image`, never both. Omit `resolution` and `aspect_ratio` to keep its shape. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image_asset_identifier")] - public global::Ideogram.AssetIdentifier? ImageAssetIdentifier { get; set; } - - /// - /// The image to remix (max 50MB; JPEG, PNG, or WEBP). Multipart requests only. The image is used only for this request and is not saved to your account. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image")] - public byte[]? Image { get; set; } - - /// - /// The image to remix (max 50MB; JPEG, PNG, or WEBP). Multipart requests only. The image is used only for this request and is not saved to your account. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] - public string? Imagename { get; set; } - - /// - /// Optional. How closely the result should follow the source image, from 1 to 100. When omitted the selected model chooses its usual strength. Combining a weight with a `resolution` or `aspect_ratio` that changes the source's aspect ratio crops the source to the new shape; this is only available at the 1K tier and is rejected at 2K. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image_weight")] - public int? ImageWeight { get; set; } - - /// - /// Description of what to exclude from the images. The prompt takes precedence over the negative prompt. Not every model uses it. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("negative_prompt")] - public string? NegativePrompt { get; set; } - - /// - /// The requested output resolution, formatted as "WIDTHxHEIGHT" (for example "1280x800"). The output uses the closest supported resolution in the matching 1K or 2K tier. Omit `aspect_ratio` when supplying a resolution. If `resolution_tier` is also supplied, it must match the tier these dimensions fall in. Combining a shape-changing value with `image_weight` requires the 1K tier. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] - public string? Resolution { get; set; } - - /// - /// The requested output aspect ratio. Omit it to keep the source image's shape. `auto` also keeps the source shape. Omit `resolution` when supplying a concrete value. Combining a shape-changing value with `image_weight` requires the 1K tier. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.IdeogramV4AspectRatioJsonConverter))] - public global::Ideogram.IdeogramV4AspectRatio? AspectRatio { get; set; } - - /// - /// The output resolution tier. When omitted, the tier is inferred from `resolution`, or defaults to 1k. A color palette, style codes, style preset, or non-`auto` style type are only supported at 1k. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("resolution_tier")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ToolRemixRequestResolutionTierJsonConverter))] - public global::Ideogram.ToolRemixRequestResolutionTier? ResolutionTier { get; set; } - - /// - /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`. The selected model decides how to interpret it.
- /// Default Value: auto - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.MagicPromptModeJsonConverter))] - public global::Ideogram.MagicPromptMode? MagicPrompt { get; set; } - - /// - /// Optional. Only honored when the request uses a model that supports reproducible remixes; results from the default model are not reproducible. The response reports the seed used.
- /// Example: 12345 - ///
- /// 12345 - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// Existing upload or generated image assets whose style should guide the remix, by reference. Supplying style references restricts the server to a model that supports them and requires the 1K resolution tier. Ignored if `style_reference_collection_id` is also supplied. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("style_reference_asset_identifiers")] - public global::System.Collections.Generic.IList? StyleReferenceAssetIdentifiers { get; set; } - - /// - /// A saved style to apply, by its URL-safe base64 collection id. Limits the request to a model that supports style references and requires the 1K resolution tier. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("style_reference_collection_id")] - public string? StyleReferenceCollectionId { get; set; } - - /// - /// Optional URL-safe base64 version id of the saved style in `style_reference_collection_id`. Ignored without it. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("style_reference_collection_version_id")] - public string? StyleReferenceCollectionVersionId { get; set; } - - /// - /// A predefined style preset to apply. Limits the request to a model that supports it and requires the 1K resolution tier. Cannot be combined with style codes. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("style_preset")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.IdeogramV3StylePresetJsonConverter))] - public global::Ideogram.IdeogramV3StylePreset? StylePreset { get; set; } - - /// - /// A color palette to apply. Limits the request to a model that supports palettes and requires the 1K resolution tier. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("color_palette")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.IdeogramColorPaletteJsonConverter))] - public global::Ideogram.IdeogramColorPalette? ColorPalette { get; set; } - - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - ///
- /// [AAFF5733, 0133FF57, DE3357FF] - [global::System.Text.Json.Serialization.JsonPropertyName("style_codes")] - public global::System.Collections.Generic.IList? StyleCodes { get; set; } - - /// - /// The style type to generate with. A value other than `auto` limits the request to a model that supports it and requires the 1K resolution tier. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("style_type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.IdeogramV3StyleTypeJsonConverter))] - public global::Ideogram.IdeogramV3StyleType? StyleType { get; set; } - - /// - /// The number of images to generate.
- /// Default Value: 1 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] - public int? NumImages { get; set; } - - /// - /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("enable_copyright_detection")] - public bool? EnableCopyrightDetection { get; set; } - - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("async")] - public bool? Async { get; set; } - - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - ///
- /// https://api.example.com/webhooks/ideogram - [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] - public string? WebhookUrl { get; set; } - - /// - /// Whether the generated images should be kept private. Omitted or true keeps them private. False publishes them unless the caller's plan always generates privately. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("target_collection_id")] - public string? TargetCollectionId { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The prompt that guides the remix. - /// - /// - /// The existing upload or generated image to transform. Supply this or `image`, never both. Omit `resolution` and `aspect_ratio` to keep its shape. - /// - /// - /// The image to remix (max 50MB; JPEG, PNG, or WEBP). Multipart requests only. The image is used only for this request and is not saved to your account. - /// - /// - /// The image to remix (max 50MB; JPEG, PNG, or WEBP). Multipart requests only. The image is used only for this request and is not saved to your account. - /// - /// - /// Optional. How closely the result should follow the source image, from 1 to 100. When omitted the selected model chooses its usual strength. Combining a weight with a `resolution` or `aspect_ratio` that changes the source's aspect ratio crops the source to the new shape; this is only available at the 1K tier and is rejected at 2K. - /// - /// - /// Description of what to exclude from the images. The prompt takes precedence over the negative prompt. Not every model uses it. - /// - /// - /// The requested output resolution, formatted as "WIDTHxHEIGHT" (for example "1280x800"). The output uses the closest supported resolution in the matching 1K or 2K tier. Omit `aspect_ratio` when supplying a resolution. If `resolution_tier` is also supplied, it must match the tier these dimensions fall in. Combining a shape-changing value with `image_weight` requires the 1K tier. - /// - /// - /// The requested output aspect ratio. Omit it to keep the source image's shape. `auto` also keeps the source shape. Omit `resolution` when supplying a concrete value. Combining a shape-changing value with `image_weight` requires the 1K tier. - /// - /// - /// The output resolution tier. When omitted, the tier is inferred from `resolution`, or defaults to 1k. A color palette, style codes, style preset, or non-`auto` style type are only supported at 1k. - /// - /// - /// Controls magic prompt (automatic prompt rewriting). Defaults to `auto`. The selected model decides how to interpret it.
- /// Default Value: auto - /// - /// - /// Optional. Only honored when the request uses a model that supports reproducible remixes; results from the default model are not reproducible. The response reports the seed used.
- /// Example: 12345 - /// - /// - /// Existing upload or generated image assets whose style should guide the remix, by reference. Supplying style references restricts the server to a model that supports them and requires the 1K resolution tier. Ignored if `style_reference_collection_id` is also supplied. - /// - /// - /// A saved style to apply, by its URL-safe base64 collection id. Limits the request to a model that supports style references and requires the 1K resolution tier. - /// - /// - /// Optional URL-safe base64 version id of the saved style in `style_reference_collection_id`. Ignored without it. - /// - /// - /// A predefined style preset to apply. Limits the request to a model that supports it and requires the 1K resolution tier. Cannot be combined with style codes. - /// - /// - /// A color palette to apply. Limits the request to a model that supports palettes and requires the 1K resolution tier. - /// - /// - /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.
- /// Example: [AAFF5733, 0133FF57, DE3357FF] - /// - /// - /// The style type to generate with. A value other than `auto` limits the request to a model that supports it and requires the 1K resolution tier. - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`. - /// - /// - /// When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// Whether the generated images should be kept private. Omitted or true keeps them private. False publishes them unless the caller's plan always generates privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ToolRemixRequest( - string prompt, - global::Ideogram.AssetIdentifier? imageAssetIdentifier, - byte[]? image, - string? imagename, - int? imageWeight, - string? negativePrompt, - string? resolution, - global::Ideogram.IdeogramV4AspectRatio? aspectRatio, - global::Ideogram.ToolRemixRequestResolutionTier? resolutionTier, - global::Ideogram.MagicPromptMode? magicPrompt, - int? seed, - global::System.Collections.Generic.IList? styleReferenceAssetIdentifiers, - string? styleReferenceCollectionId, - string? styleReferenceCollectionVersionId, - global::Ideogram.IdeogramV3StylePreset? stylePreset, - global::Ideogram.IdeogramColorPalette? colorPalette, - global::System.Collections.Generic.IList? styleCodes, - global::Ideogram.IdeogramV3StyleType? styleType, - int? numImages, - bool? enableCopyrightDetection, - bool? async, - string? webhookUrl, - bool? @private, - string? targetCollectionId) - { - this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); - this.ImageAssetIdentifier = imageAssetIdentifier; - this.Image = image; - this.Imagename = imagename; - this.ImageWeight = imageWeight; - this.NegativePrompt = negativePrompt; - this.Resolution = resolution; - this.AspectRatio = aspectRatio; - this.ResolutionTier = resolutionTier; - this.MagicPrompt = magicPrompt; - this.Seed = seed; - this.StyleReferenceAssetIdentifiers = styleReferenceAssetIdentifiers; - this.StyleReferenceCollectionId = styleReferenceCollectionId; - this.StyleReferenceCollectionVersionId = styleReferenceCollectionVersionId; - this.StylePreset = stylePreset; - this.ColorPalette = colorPalette; - this.StyleCodes = styleCodes; - this.StyleType = styleType; - this.NumImages = numImages; - this.EnableCopyrightDetection = enableCopyrightDetection; - this.Async = async; - this.WebhookUrl = webhookUrl; - this.Private = @private; - this.TargetCollectionId = targetCollectionId; - } - - /// - /// Initializes a new instance of the class. - /// - public ToolRemixRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolRemixRequestResolutionTier.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolRemixRequestResolutionTier.g.cs deleted file mode 100644 index 6efedebb..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ToolRemixRequestResolutionTier.g.cs +++ /dev/null @@ -1,51 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The output resolution tier. When omitted, the tier is inferred from `resolution`, or defaults to 1k. A color palette, style codes, style preset, or non-`auto` style type are only supported at 1k. - /// - public enum ToolRemixRequestResolutionTier - { - /// - /// - /// - x1k, - /// - /// - /// - x2k, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class ToolRemixRequestResolutionTierExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this ToolRemixRequestResolutionTier value) - { - return value switch - { - ToolRemixRequestResolutionTier.x1k => "1k", - ToolRemixRequestResolutionTier.x2k => "2k", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static ToolRemixRequestResolutionTier? ToEnum(string value) - { - return value switch - { - "1k" => ToolRemixRequestResolutionTier.x1k, - "2k" => ToolRemixRequestResolutionTier.x2k, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolRemixResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolRemixResponse.g.cs index 5633b73d..f0a6eb39 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ToolRemixResponse.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ToolRemixResponse.g.cs @@ -8,8 +8,7 @@ namespace Ideogram /// requests (the default) include the remixed images in `data`.
/// Asynchronous requests omit `data`; poll
/// `GET /v2/generations/{generation_id}` with the returned
- /// `generation_id`.
- /// Example: {"data":[{"seed":12345,"prompt":"prompt","resolution":"1024x1024","url":"https://openapi-generator.tech","is_image_safe":true},{"seed":12345,"prompt":"prompt","resolution":"1024x1024","url":"https://openapi-generator.tech","is_image_safe":true}],"seed":"","generation_id":"generation_id"} + /// `generation_id`. /// public sealed partial class ToolRemixResponse { diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolRemoveBackgroundRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolRemoveBackgroundRequest.Json.g.cs new file mode 100644 index 00000000..64d61163 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ToolRemoveBackgroundRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ToolRemoveBackgroundRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ToolRemoveBackgroundRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ToolRemoveBackgroundRequest), + jsonSerializerContext) as global::Ideogram.ToolRemoveBackgroundRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ToolRemoveBackgroundRequest? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ToolRemoveBackgroundRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ToolRemoveBackgroundRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ToolRemoveBackgroundRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolRemoveBackgroundRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolRemoveBackgroundRequest.g.cs new file mode 100644 index 00000000..769789d7 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ToolRemoveBackgroundRequest.g.cs @@ -0,0 +1,87 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// + /// + public sealed partial class ToolRemoveBackgroundRequest + { + /// + /// The source image. JPEG, PNG, or WebP, up to 25MB. Multipart requests only. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("image")] + [global::System.Text.Json.Serialization.JsonRequired] + public required byte[] Image { get; set; } + + /// + /// The source image. JPEG, PNG, or WebP, up to 25MB. Multipart requests only. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Imagename { get; set; } + + /// + /// Whether to keep the result out of the public gallery. When omitted,
+ /// defaults to your plan's setting, or public if your plan has none.
+ /// Enterprise generations are always private. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("private")] + public bool? Private { get; set; } + + /// + /// When false (the default), wait for and return the foreground image. When true, return as soon as the request is accepted; poll `GET /v2/generations/{generation_id}` for the result.
+ /// Default Value: false + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The source image. JPEG, PNG, or WebP, up to 25MB. Multipart requests only. + /// + /// + /// The source image. JPEG, PNG, or WebP, up to 25MB. Multipart requests only. + /// + /// + /// Whether to keep the result out of the public gallery. When omitted,
+ /// defaults to your plan's setting, or public if your plan has none.
+ /// Enterprise generations are always private. + /// + /// + /// When false (the default), wait for and return the foreground image. When true, return as soon as the request is accepted; poll `GET /v2/generations/{generation_id}` for the result.
+ /// Default Value: false + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ToolRemoveBackgroundRequest( + byte[] image, + string imagename, + bool? @private, + bool? async) + { + this.Image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + this.Imagename = imagename ?? throw new global::System.ArgumentNullException(nameof(imagename)); + this.Private = @private; + this.Async = async; + } + + /// + /// Initializes a new instance of the class. + /// + public ToolRemoveBackgroundRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolRemoveBackgroundResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolRemoveBackgroundResponse.Json.g.cs new file mode 100644 index 00000000..8a573e14 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ToolRemoveBackgroundResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ToolRemoveBackgroundResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ToolRemoveBackgroundResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ToolRemoveBackgroundResponse), + jsonSerializerContext) as global::Ideogram.ToolRemoveBackgroundResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ToolRemoveBackgroundResponse? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ToolRemoveBackgroundResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ToolRemoveBackgroundResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ToolRemoveBackgroundResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolRemoveBackgroundResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolRemoveBackgroundResponse.g.cs new file mode 100644 index 00000000..1c70c106 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ToolRemoveBackgroundResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ToolRemoveBackgroundResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolRemoveBackgroundResponse2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolRemoveBackgroundResponse2.Json.g.cs new file mode 100644 index 00000000..3e9f631b --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ToolRemoveBackgroundResponse2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ToolRemoveBackgroundResponse2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ToolRemoveBackgroundResponse2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ToolRemoveBackgroundResponse2), + jsonSerializerContext) as global::Ideogram.ToolRemoveBackgroundResponse2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ToolRemoveBackgroundResponse2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ToolRemoveBackgroundResponse2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ToolRemoveBackgroundResponse2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ToolRemoveBackgroundResponse2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolRemoveBackgroundResponse2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolRemoveBackgroundResponse2.g.cs new file mode 100644 index 00000000..0d72be55 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ToolRemoveBackgroundResponse2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ToolRemoveBackgroundResponse2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolRemoveBackgroundResponse3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolRemoveBackgroundResponse3.Json.g.cs new file mode 100644 index 00000000..b73bcb02 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ToolRemoveBackgroundResponse3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ToolRemoveBackgroundResponse3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ToolRemoveBackgroundResponse3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ToolRemoveBackgroundResponse3), + jsonSerializerContext) as global::Ideogram.ToolRemoveBackgroundResponse3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ToolRemoveBackgroundResponse3? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ToolRemoveBackgroundResponse3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ToolRemoveBackgroundResponse3), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ToolRemoveBackgroundResponse3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolRemoveBackgroundResponse3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolRemoveBackgroundResponse3.g.cs new file mode 100644 index 00000000..6592c68d --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ToolRemoveBackgroundResponse3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ToolRemoveBackgroundResponse3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolRemoveBackgroundResponse4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolRemoveBackgroundResponse4.Json.g.cs new file mode 100644 index 00000000..122740cf --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ToolRemoveBackgroundResponse4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ToolRemoveBackgroundResponse4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ToolRemoveBackgroundResponse4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ToolRemoveBackgroundResponse4), + jsonSerializerContext) as global::Ideogram.ToolRemoveBackgroundResponse4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ToolRemoveBackgroundResponse4? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ToolRemoveBackgroundResponse4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ToolRemoveBackgroundResponse4), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ToolRemoveBackgroundResponse4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolRemoveBackgroundResponse4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolRemoveBackgroundResponse4.g.cs new file mode 100644 index 00000000..205e7a31 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ToolRemoveBackgroundResponse4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ToolRemoveBackgroundResponse4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolRemoveBackgroundResponse5.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolRemoveBackgroundResponse5.Json.g.cs new file mode 100644 index 00000000..9b72e13d --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ToolRemoveBackgroundResponse5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ToolRemoveBackgroundResponse5 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ToolRemoveBackgroundResponse5? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ToolRemoveBackgroundResponse5), + jsonSerializerContext) as global::Ideogram.ToolRemoveBackgroundResponse5; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ToolRemoveBackgroundResponse5? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ToolRemoveBackgroundResponse5? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ToolRemoveBackgroundResponse5), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ToolRemoveBackgroundResponse5; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolRemoveBackgroundResponse5.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolRemoveBackgroundResponse5.g.cs new file mode 100644 index 00000000..6726144b --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ToolRemoveBackgroundResponse5.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ToolRemoveBackgroundResponse5 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolRemoveBackgroundResponse6.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolRemoveBackgroundResponse6.Json.g.cs new file mode 100644 index 00000000..5788c5e5 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ToolRemoveBackgroundResponse6.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ToolRemoveBackgroundResponse6 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ToolRemoveBackgroundResponse6? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ToolRemoveBackgroundResponse6), + jsonSerializerContext) as global::Ideogram.ToolRemoveBackgroundResponse6; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ToolRemoveBackgroundResponse6? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ToolRemoveBackgroundResponse6? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ToolRemoveBackgroundResponse6), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ToolRemoveBackgroundResponse6; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolRemoveBackgroundResponse6.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolRemoveBackgroundResponse6.g.cs new file mode 100644 index 00000000..4dd9644d --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ToolRemoveBackgroundResponse6.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ToolRemoveBackgroundResponse6 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogram45Request.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogram45Request.Json.g.cs new file mode 100644 index 00000000..70db7274 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogram45Request.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ToolReplaceBackgroundIdeogram45Request + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ToolReplaceBackgroundIdeogram45Request? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ToolReplaceBackgroundIdeogram45Request), + jsonSerializerContext) as global::Ideogram.ToolReplaceBackgroundIdeogram45Request; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ToolReplaceBackgroundIdeogram45Request? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ToolReplaceBackgroundIdeogram45Request? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ToolReplaceBackgroundIdeogram45Request), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ToolReplaceBackgroundIdeogram45Request; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogram45Request.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogram45Request.g.cs new file mode 100644 index 00000000..598c21e4 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogram45Request.g.cs @@ -0,0 +1,158 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// + /// + public sealed partial class ToolReplaceBackgroundIdeogram45Request + { + /// + /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
+ /// MPO are supported, up to 50 MB. Its longer side may be at most the
+ /// model's maximum aspect ratio times its shorter side; a more extreme
+ /// proportion is rejected with a 400 that states the allowed range.
+ /// Multipart requests only. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("image")] + [global::System.Text.Json.Serialization.JsonRequired] + public required byte[] Image { get; set; } + + /// + /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
+ /// MPO are supported, up to 50 MB. Its longer side may be at most the
+ /// model's maximum aspect ratio times its shorter side; a more extreme
+ /// proportion is rejected with a 400 that states the allowed range.
+ /// Multipart requests only. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Imagename { get; set; } + + /// + /// A photo of the setting the new background should match. Its people
+ /// are not copied. It is held to the same aspect-ratio limit as
+ /// `image`. Multipart requests only. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("background_reference")] + [global::System.Text.Json.Serialization.JsonRequired] + public required byte[] BackgroundReference { get; set; } + + /// + /// A photo of the setting the new background should match. Its people
+ /// are not copied. It is held to the same aspect-ratio limit as
+ /// `image`. Multipart requests only. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("background_referencename")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string BackgroundReferencename { get; set; } + + /// + /// The number of images to generate.
+ /// Default Value: 1 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] + public int? NumImages { get; set; } + + /// + /// Whether to keep the result private. When omitted, the result is
+ /// private. Enterprise generations are always private. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("private")] + public bool? Private { get; set; } + + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] + public string? WebhookUrl { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
+ /// MPO are supported, up to 50 MB. Its longer side may be at most the
+ /// model's maximum aspect ratio times its shorter side; a more extreme
+ /// proportion is rejected with a 400 that states the allowed range.
+ /// Multipart requests only. + /// + /// + /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
+ /// MPO are supported, up to 50 MB. Its longer side may be at most the
+ /// model's maximum aspect ratio times its shorter side; a more extreme
+ /// proportion is rejected with a 400 that states the allowed range.
+ /// Multipart requests only. + /// + /// + /// A photo of the setting the new background should match. Its people
+ /// are not copied. It is held to the same aspect-ratio limit as
+ /// `image`. Multipart requests only. + /// + /// + /// A photo of the setting the new background should match. Its people
+ /// are not copied. It is held to the same aspect-ratio limit as
+ /// `image`. Multipart requests only. + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Whether to keep the result private. When omitted, the result is
+ /// private. Enterprise generations are always private. + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ToolReplaceBackgroundIdeogram45Request( + byte[] image, + string imagename, + byte[] backgroundReference, + string backgroundReferencename, + int? numImages, + bool? @private, + string? webhookUrl) + { + this.Image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + this.Imagename = imagename ?? throw new global::System.ArgumentNullException(nameof(imagename)); + this.BackgroundReference = backgroundReference ?? throw new global::System.ArgumentNullException(nameof(backgroundReference)); + this.BackgroundReferencename = backgroundReferencename ?? throw new global::System.ArgumentNullException(nameof(backgroundReferencename)); + this.NumImages = numImages; + this.Private = @private; + this.WebhookUrl = webhookUrl; + } + + /// + /// Initializes a new instance of the class. + /// + public ToolReplaceBackgroundIdeogram45Request() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogram45Response.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogram45Response.Json.g.cs new file mode 100644 index 00000000..dca1ff8f --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogram45Response.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ToolReplaceBackgroundIdeogram45Response + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ToolReplaceBackgroundIdeogram45Response? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ToolReplaceBackgroundIdeogram45Response), + jsonSerializerContext) as global::Ideogram.ToolReplaceBackgroundIdeogram45Response; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ToolReplaceBackgroundIdeogram45Response? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ToolReplaceBackgroundIdeogram45Response? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ToolReplaceBackgroundIdeogram45Response), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ToolReplaceBackgroundIdeogram45Response; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogram45Response.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogram45Response.g.cs new file mode 100644 index 00000000..6c85b9f3 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogram45Response.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ToolReplaceBackgroundIdeogram45Response + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogram45Response2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogram45Response2.Json.g.cs new file mode 100644 index 00000000..1aa467db --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogram45Response2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ToolReplaceBackgroundIdeogram45Response2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ToolReplaceBackgroundIdeogram45Response2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ToolReplaceBackgroundIdeogram45Response2), + jsonSerializerContext) as global::Ideogram.ToolReplaceBackgroundIdeogram45Response2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ToolReplaceBackgroundIdeogram45Response2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ToolReplaceBackgroundIdeogram45Response2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ToolReplaceBackgroundIdeogram45Response2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ToolReplaceBackgroundIdeogram45Response2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogram45Response2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogram45Response2.g.cs new file mode 100644 index 00000000..2d68a0b1 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogram45Response2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ToolReplaceBackgroundIdeogram45Response2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogram45Response3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogram45Response3.Json.g.cs new file mode 100644 index 00000000..7a8112c4 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogram45Response3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ToolReplaceBackgroundIdeogram45Response3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ToolReplaceBackgroundIdeogram45Response3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ToolReplaceBackgroundIdeogram45Response3), + jsonSerializerContext) as global::Ideogram.ToolReplaceBackgroundIdeogram45Response3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ToolReplaceBackgroundIdeogram45Response3? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ToolReplaceBackgroundIdeogram45Response3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ToolReplaceBackgroundIdeogram45Response3), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ToolReplaceBackgroundIdeogram45Response3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogram45Response3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogram45Response3.g.cs new file mode 100644 index 00000000..194d17ee --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogram45Response3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ToolReplaceBackgroundIdeogram45Response3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogram45Response4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogram45Response4.Json.g.cs new file mode 100644 index 00000000..e5705d6f --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogram45Response4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ToolReplaceBackgroundIdeogram45Response4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ToolReplaceBackgroundIdeogram45Response4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ToolReplaceBackgroundIdeogram45Response4), + jsonSerializerContext) as global::Ideogram.ToolReplaceBackgroundIdeogram45Response4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ToolReplaceBackgroundIdeogram45Response4? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ToolReplaceBackgroundIdeogram45Response4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ToolReplaceBackgroundIdeogram45Response4), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ToolReplaceBackgroundIdeogram45Response4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogram45Response4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogram45Response4.g.cs new file mode 100644 index 00000000..006d56ff --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogram45Response4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ToolReplaceBackgroundIdeogram45Response4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogram45Response5.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogram45Response5.Json.g.cs new file mode 100644 index 00000000..f97b0084 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogram45Response5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ToolReplaceBackgroundIdeogram45Response5 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ToolReplaceBackgroundIdeogram45Response5? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ToolReplaceBackgroundIdeogram45Response5), + jsonSerializerContext) as global::Ideogram.ToolReplaceBackgroundIdeogram45Response5; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ToolReplaceBackgroundIdeogram45Response5? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ToolReplaceBackgroundIdeogram45Response5? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ToolReplaceBackgroundIdeogram45Response5), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ToolReplaceBackgroundIdeogram45Response5; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogram45Response5.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogram45Response5.g.cs new file mode 100644 index 00000000..360a8fdd --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogram45Response5.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ToolReplaceBackgroundIdeogram45Response5 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogramV3Request.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogramV3Request.Json.g.cs new file mode 100644 index 00000000..f0b31dd5 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogramV3Request.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ToolReplaceBackgroundIdeogramV3Request + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ToolReplaceBackgroundIdeogramV3Request? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ToolReplaceBackgroundIdeogramV3Request), + jsonSerializerContext) as global::Ideogram.ToolReplaceBackgroundIdeogramV3Request; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ToolReplaceBackgroundIdeogramV3Request? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ToolReplaceBackgroundIdeogramV3Request? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ToolReplaceBackgroundIdeogramV3Request), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ToolReplaceBackgroundIdeogramV3Request; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogramV3Request.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogramV3Request.g.cs new file mode 100644 index 00000000..17fff93e --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogramV3Request.g.cs @@ -0,0 +1,148 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// + /// + public sealed partial class ToolReplaceBackgroundIdeogramV3Request + { + /// + /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
+ /// MPO are supported, up to 50 MB. Multipart requests only.
+ /// The longer side must be at most 3 times the shorter side; wider
+ /// aspect ratios are rejected with a 400. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("image")] + [global::System.Text.Json.Serialization.JsonRequired] + public required byte[] Image { get; set; } + + /// + /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
+ /// MPO are supported, up to 50 MB. Multipart requests only.
+ /// The longer side must be at most 3 times the shorter side; wider
+ /// aspect ratios are rejected with a 400. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Imagename { get; set; } + + /// + /// Plain-language description of the desired new background. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Prompt { get; set; } + + /// + /// The rendering speed to use.
+ /// Default Value: default + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("rendering_speed")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.V2ImageReplaceBackgroundIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedJsonConverter))] + public global::Ideogram.V2ImageReplaceBackgroundIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? RenderingSpeed { get; set; } + + /// + /// The number of images to generate.
+ /// Default Value: 1 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] + public int? NumImages { get; set; } + + /// + /// Whether to keep the result private. When omitted, defaults to your
+ /// plan's setting. Enterprise generations are always private. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("private")] + public bool? Private { get; set; } + + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] + public string? WebhookUrl { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
+ /// MPO are supported, up to 50 MB. Multipart requests only.
+ /// The longer side must be at most 3 times the shorter side; wider
+ /// aspect ratios are rejected with a 400. + /// + /// + /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
+ /// MPO are supported, up to 50 MB. Multipart requests only.
+ /// The longer side must be at most 3 times the shorter side; wider
+ /// aspect ratios are rejected with a 400. + /// + /// + /// Plain-language description of the desired new background. + /// + /// + /// The rendering speed to use.
+ /// Default Value: default + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Whether to keep the result private. When omitted, defaults to your
+ /// plan's setting. Enterprise generations are always private. + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ToolReplaceBackgroundIdeogramV3Request( + byte[] image, + string imagename, + string prompt, + global::Ideogram.V2ImageReplaceBackgroundIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed, + int? numImages, + bool? @private, + string? webhookUrl) + { + this.Image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + this.Imagename = imagename ?? throw new global::System.ArgumentNullException(nameof(imagename)); + this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); + this.RenderingSpeed = renderingSpeed; + this.NumImages = numImages; + this.Private = @private; + this.WebhookUrl = webhookUrl; + } + + /// + /// Initializes a new instance of the class. + /// + public ToolReplaceBackgroundIdeogramV3Request() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogramV3Response.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogramV3Response.Json.g.cs new file mode 100644 index 00000000..4a8f0ea8 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogramV3Response.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ToolReplaceBackgroundIdeogramV3Response + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ToolReplaceBackgroundIdeogramV3Response? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ToolReplaceBackgroundIdeogramV3Response), + jsonSerializerContext) as global::Ideogram.ToolReplaceBackgroundIdeogramV3Response; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ToolReplaceBackgroundIdeogramV3Response? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ToolReplaceBackgroundIdeogramV3Response? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ToolReplaceBackgroundIdeogramV3Response), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ToolReplaceBackgroundIdeogramV3Response; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogramV3Response.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogramV3Response.g.cs new file mode 100644 index 00000000..0ff45f31 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogramV3Response.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ToolReplaceBackgroundIdeogramV3Response + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogramV3Response2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogramV3Response2.Json.g.cs new file mode 100644 index 00000000..4bb51ac3 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogramV3Response2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ToolReplaceBackgroundIdeogramV3Response2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ToolReplaceBackgroundIdeogramV3Response2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ToolReplaceBackgroundIdeogramV3Response2), + jsonSerializerContext) as global::Ideogram.ToolReplaceBackgroundIdeogramV3Response2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ToolReplaceBackgroundIdeogramV3Response2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ToolReplaceBackgroundIdeogramV3Response2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ToolReplaceBackgroundIdeogramV3Response2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ToolReplaceBackgroundIdeogramV3Response2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogramV3Response2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogramV3Response2.g.cs new file mode 100644 index 00000000..9f889585 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogramV3Response2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ToolReplaceBackgroundIdeogramV3Response2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogramV3Response3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogramV3Response3.Json.g.cs new file mode 100644 index 00000000..cc67f7bd --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogramV3Response3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ToolReplaceBackgroundIdeogramV3Response3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ToolReplaceBackgroundIdeogramV3Response3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ToolReplaceBackgroundIdeogramV3Response3), + jsonSerializerContext) as global::Ideogram.ToolReplaceBackgroundIdeogramV3Response3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ToolReplaceBackgroundIdeogramV3Response3? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ToolReplaceBackgroundIdeogramV3Response3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ToolReplaceBackgroundIdeogramV3Response3), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ToolReplaceBackgroundIdeogramV3Response3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogramV3Response3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogramV3Response3.g.cs new file mode 100644 index 00000000..d848c067 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogramV3Response3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ToolReplaceBackgroundIdeogramV3Response3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogramV3Response4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogramV3Response4.Json.g.cs new file mode 100644 index 00000000..da449ffb --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogramV3Response4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ToolReplaceBackgroundIdeogramV3Response4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ToolReplaceBackgroundIdeogramV3Response4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ToolReplaceBackgroundIdeogramV3Response4), + jsonSerializerContext) as global::Ideogram.ToolReplaceBackgroundIdeogramV3Response4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ToolReplaceBackgroundIdeogramV3Response4? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ToolReplaceBackgroundIdeogramV3Response4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ToolReplaceBackgroundIdeogramV3Response4), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ToolReplaceBackgroundIdeogramV3Response4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogramV3Response4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogramV3Response4.g.cs new file mode 100644 index 00000000..17a706eb --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogramV3Response4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ToolReplaceBackgroundIdeogramV3Response4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogramV3Response5.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogramV3Response5.Json.g.cs new file mode 100644 index 00000000..6f876e88 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogramV3Response5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ToolReplaceBackgroundIdeogramV3Response5 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ToolReplaceBackgroundIdeogramV3Response5? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ToolReplaceBackgroundIdeogramV3Response5), + jsonSerializerContext) as global::Ideogram.ToolReplaceBackgroundIdeogramV3Response5; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ToolReplaceBackgroundIdeogramV3Response5? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ToolReplaceBackgroundIdeogramV3Response5? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ToolReplaceBackgroundIdeogramV3Response5), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ToolReplaceBackgroundIdeogramV3Response5; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogramV3Response5.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogramV3Response5.g.cs new file mode 100644 index 00000000..9b5f77e9 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogramV3Response5.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ToolReplaceBackgroundIdeogramV3Response5 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogramV3Response6.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogramV3Response6.Json.g.cs new file mode 100644 index 00000000..b3d4ee57 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogramV3Response6.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ToolReplaceBackgroundIdeogramV3Response6 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ToolReplaceBackgroundIdeogramV3Response6? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ToolReplaceBackgroundIdeogramV3Response6), + jsonSerializerContext) as global::Ideogram.ToolReplaceBackgroundIdeogramV3Response6; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ToolReplaceBackgroundIdeogramV3Response6? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ToolReplaceBackgroundIdeogramV3Response6? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ToolReplaceBackgroundIdeogramV3Response6), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ToolReplaceBackgroundIdeogramV3Response6; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogramV3Response6.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogramV3Response6.g.cs new file mode 100644 index 00000000..eca3fbfe --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundIdeogramV3Response6.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ToolReplaceBackgroundIdeogramV3Response6 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundRequest.Json.g.cs new file mode 100644 index 00000000..9aa0e0ec --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ToolReplaceBackgroundRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ToolReplaceBackgroundRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ToolReplaceBackgroundRequest), + jsonSerializerContext) as global::Ideogram.ToolReplaceBackgroundRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ToolReplaceBackgroundRequest? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ToolReplaceBackgroundRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ToolReplaceBackgroundRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ToolReplaceBackgroundRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundRequest.g.cs new file mode 100644 index 00000000..74181f7d --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundRequest.g.cs @@ -0,0 +1,140 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// + /// + public sealed partial class ToolReplaceBackgroundRequest + { + /// + /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
+ /// MPO are supported, up to 50 MB. Multipart requests only. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("image")] + [global::System.Text.Json.Serialization.JsonRequired] + public required byte[] Image { get; set; } + + /// + /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
+ /// MPO are supported, up to 50 MB. Multipart requests only. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Imagename { get; set; } + + /// + /// Plain-language description of the desired new background. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Prompt { get; set; } + + /// + /// The generation quality level. Defaults to `high`.
+ /// Default Value: high + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("quality")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ReplaceBackgroundQualityJsonConverter))] + public global::Ideogram.ReplaceBackgroundQuality? Quality { get; set; } + + /// + /// The number of images to generate.
+ /// Default Value: 1 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] + public int? NumImages { get; set; } + + /// + /// Whether to keep the result private. When omitted, defaults to your
+ /// plan's setting. Enterprise generations are always private. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("private")] + public bool? Private { get; set; } + + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] + public string? WebhookUrl { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
+ /// MPO are supported, up to 50 MB. Multipart requests only. + /// + /// + /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
+ /// MPO are supported, up to 50 MB. Multipart requests only. + /// + /// + /// Plain-language description of the desired new background. + /// + /// + /// The generation quality level. Defaults to `high`.
+ /// Default Value: high + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Whether to keep the result private. When omitted, defaults to your
+ /// plan's setting. Enterprise generations are always private. + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ToolReplaceBackgroundRequest( + byte[] image, + string imagename, + string prompt, + global::Ideogram.ReplaceBackgroundQuality? quality, + int? numImages, + bool? @private, + string? webhookUrl) + { + this.Image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + this.Imagename = imagename ?? throw new global::System.ArgumentNullException(nameof(imagename)); + this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); + this.Quality = quality; + this.NumImages = numImages; + this.Private = @private; + this.WebhookUrl = webhookUrl; + } + + /// + /// Initializes a new instance of the class. + /// + public ToolReplaceBackgroundRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundResponse.Json.g.cs new file mode 100644 index 00000000..6fc9e94e --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ToolReplaceBackgroundResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ToolReplaceBackgroundResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ToolReplaceBackgroundResponse), + jsonSerializerContext) as global::Ideogram.ToolReplaceBackgroundResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ToolReplaceBackgroundResponse? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ToolReplaceBackgroundResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ToolReplaceBackgroundResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ToolReplaceBackgroundResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundResponse.g.cs new file mode 100644 index 00000000..ee60484e --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ToolReplaceBackgroundResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundResponse2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundResponse2.Json.g.cs new file mode 100644 index 00000000..efb52e2f --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundResponse2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ToolReplaceBackgroundResponse2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ToolReplaceBackgroundResponse2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ToolReplaceBackgroundResponse2), + jsonSerializerContext) as global::Ideogram.ToolReplaceBackgroundResponse2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ToolReplaceBackgroundResponse2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ToolReplaceBackgroundResponse2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ToolReplaceBackgroundResponse2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ToolReplaceBackgroundResponse2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundResponse2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundResponse2.g.cs new file mode 100644 index 00000000..eba5a538 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundResponse2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ToolReplaceBackgroundResponse2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundResponse3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundResponse3.Json.g.cs new file mode 100644 index 00000000..b5af3c10 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundResponse3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ToolReplaceBackgroundResponse3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ToolReplaceBackgroundResponse3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ToolReplaceBackgroundResponse3), + jsonSerializerContext) as global::Ideogram.ToolReplaceBackgroundResponse3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ToolReplaceBackgroundResponse3? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ToolReplaceBackgroundResponse3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ToolReplaceBackgroundResponse3), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ToolReplaceBackgroundResponse3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundResponse3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundResponse3.g.cs new file mode 100644 index 00000000..fbe7c83e --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundResponse3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ToolReplaceBackgroundResponse3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundResponse4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundResponse4.Json.g.cs new file mode 100644 index 00000000..28ed9df7 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundResponse4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ToolReplaceBackgroundResponse4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ToolReplaceBackgroundResponse4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ToolReplaceBackgroundResponse4), + jsonSerializerContext) as global::Ideogram.ToolReplaceBackgroundResponse4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ToolReplaceBackgroundResponse4? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ToolReplaceBackgroundResponse4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ToolReplaceBackgroundResponse4), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ToolReplaceBackgroundResponse4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundResponse4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundResponse4.g.cs new file mode 100644 index 00000000..0483cb1e --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundResponse4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ToolReplaceBackgroundResponse4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundResponse5.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundResponse5.Json.g.cs new file mode 100644 index 00000000..bb650511 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundResponse5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ToolReplaceBackgroundResponse5 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ToolReplaceBackgroundResponse5? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ToolReplaceBackgroundResponse5), + jsonSerializerContext) as global::Ideogram.ToolReplaceBackgroundResponse5; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ToolReplaceBackgroundResponse5? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ToolReplaceBackgroundResponse5? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ToolReplaceBackgroundResponse5), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ToolReplaceBackgroundResponse5; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundResponse5.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundResponse5.g.cs new file mode 100644 index 00000000..5fbee9e5 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundResponse5.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ToolReplaceBackgroundResponse5 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundResponse6.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundResponse6.Json.g.cs new file mode 100644 index 00000000..a693938d --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundResponse6.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ToolReplaceBackgroundResponse6 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ToolReplaceBackgroundResponse6? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ToolReplaceBackgroundResponse6), + jsonSerializerContext) as global::Ideogram.ToolReplaceBackgroundResponse6; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ToolReplaceBackgroundResponse6? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ToolReplaceBackgroundResponse6? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ToolReplaceBackgroundResponse6), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ToolReplaceBackgroundResponse6; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundResponse6.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundResponse6.g.cs new file mode 100644 index 00000000..3b8a2b05 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ToolReplaceBackgroundResponse6.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ToolReplaceBackgroundResponse6 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolType.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolType.g.cs deleted file mode 100644 index 9a55a93c..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ToolType.g.cs +++ /dev/null @@ -1,76 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Tool type for filtering usage information
- /// Example: GENERATE - ///
- public enum ToolType - { - /// - /// - /// - Describe, - /// - /// - /// - Edit, - /// - /// - /// - Generate, - /// - /// - /// - Other, - /// - /// - /// - Remix, - /// - /// - /// - Upscale, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class ToolTypeExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this ToolType value) - { - return value switch - { - ToolType.Describe => "DESCRIBE", - ToolType.Edit => "EDIT", - ToolType.Generate => "GENERATE", - ToolType.Other => "OTHER", - ToolType.Remix => "REMIX", - ToolType.Upscale => "UPSCALE", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static ToolType? ToEnum(string value) - { - return value switch - { - "DESCRIBE" => ToolType.Describe, - "EDIT" => ToolType.Edit, - "GENERATE" => ToolType.Generate, - "OTHER" => ToolType.Other, - "REMIX" => ToolType.Remix, - "UPSCALE" => ToolType.Upscale, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolUsage.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolUsage.Json.g.cs deleted file mode 100644 index 0f5b6a94..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ToolUsage.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class ToolUsage - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.ToolUsage? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.ToolUsage), - jsonSerializerContext) as global::Ideogram.ToolUsage; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.ToolUsage? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.ToolUsage? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.ToolUsage), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ToolUsage; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolUsage.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolUsage.g.cs deleted file mode 100644 index 83c7c562..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ToolUsage.g.cs +++ /dev/null @@ -1,144 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"user_email_address":"user@company.com","model_version":"V_0_3","full_tool_name":"Turbo Image Generation V3","amount":{"amount":1050,"currency_code":"USD"},"tool_type":"GENERATE","api_key_id":"JRPVD7jWR1aTBYiJ0UFVOg"} - /// - public sealed partial class ToolUsage - { - /// - /// Name of the tool used
- /// Example: Turbo Image Generation V3 - ///
- /// Turbo Image Generation V3 - [global::System.Text.Json.Serialization.JsonPropertyName("full_tool_name")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string FullToolName { get; set; } - - /// - /// Represents a price.
- /// Example: {"amount":1050,"currency_code":"USD"} - ///
- /// {"amount":1050,"currency_code":"USD"} - [global::System.Text.Json.Serialization.JsonPropertyName("amount")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.Price Amount { get; set; } - - /// - /// Base64 encoded API key ID (for API usage)
- /// Example: JRPVD7jWR1aTBYiJ0UFVOg - ///
- /// JRPVD7jWR1aTBYiJ0UFVOg - [global::System.Text.Json.Serialization.JsonPropertyName("api_key_id")] - public string? ApiKeyId { get; set; } - - /// - /// User email address (for web app usage)
- /// Example: user@company.com - ///
- /// user@company.com - [global::System.Text.Json.Serialization.JsonPropertyName("user_email_address")] - public string? UserEmailAddress { get; set; } - - /// - /// Tool type for filtering usage information
- /// Example: GENERATE - ///
- /// GENERATE - [global::System.Text.Json.Serialization.JsonPropertyName("tool_type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ToolTypeJsonConverter))] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.ToolType ToolType { get; set; } - - /// - /// The model_version to use.
- /// - V_0_3: Model 1.0
- /// - V_1_1: Model 1.1
- /// - V_1_5: Model 2.0
- /// - V_2_1: Model 2a
- /// - V_3_0: Model 3.0 March 26
- /// - V_3_1: Model 3.0 Latest
- /// - V_4_0: Model 4.0
- /// - V_4_D: Model 4.0 Layered Design (vector-text path; gated by the access_to_v4_experimental feature flag)
- /// - V_4_LAYOUT2IMAGE: Model 4.0 Layout to Image (HTML layout rasterized as IMAGE_TO_IMAGE conditioning; gated by the access_to_v4_experimental feature flag)
- /// - AUTO: Automatically select the best model version based on the request.
- /// Example: V_0_3 - ///
- /// V_0_3 - [global::System.Text.Json.Serialization.JsonPropertyName("model_version")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ModelVersionJsonConverter))] - public global::Ideogram.ModelVersion? ModelVersion { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Name of the tool used
- /// Example: Turbo Image Generation V3 - /// - /// - /// Represents a price.
- /// Example: {"amount":1050,"currency_code":"USD"} - /// - /// - /// Tool type for filtering usage information
- /// Example: GENERATE - /// - /// - /// Base64 encoded API key ID (for API usage)
- /// Example: JRPVD7jWR1aTBYiJ0UFVOg - /// - /// - /// User email address (for web app usage)
- /// Example: user@company.com - /// - /// - /// The model_version to use.
- /// - V_0_3: Model 1.0
- /// - V_1_1: Model 1.1
- /// - V_1_5: Model 2.0
- /// - V_2_1: Model 2a
- /// - V_3_0: Model 3.0 March 26
- /// - V_3_1: Model 3.0 Latest
- /// - V_4_0: Model 4.0
- /// - V_4_D: Model 4.0 Layered Design (vector-text path; gated by the access_to_v4_experimental feature flag)
- /// - V_4_LAYOUT2IMAGE: Model 4.0 Layout to Image (HTML layout rasterized as IMAGE_TO_IMAGE conditioning; gated by the access_to_v4_experimental feature flag)
- /// - AUTO: Automatically select the best model version based on the request.
- /// Example: V_0_3 - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ToolUsage( - string fullToolName, - global::Ideogram.Price amount, - global::Ideogram.ToolType toolType, - string? apiKeyId, - string? userEmailAddress, - global::Ideogram.ModelVersion? modelVersion) - { - this.FullToolName = fullToolName ?? throw new global::System.ArgumentNullException(nameof(fullToolName)); - this.Amount = amount ?? throw new global::System.ArgumentNullException(nameof(amount)); - this.ApiKeyId = apiKeyId; - this.UserEmailAddress = userEmailAddress; - this.ToolType = toolType; - this.ModelVersion = modelVersion; - } - - /// - /// Initializes a new instance of the class. - /// - public ToolUsage() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolsPostUpscaleRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolsPostUpscaleRequest.Json.g.cs new file mode 100644 index 00000000..10a98c12 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ToolsPostUpscaleRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ToolsPostUpscaleRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ToolsPostUpscaleRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ToolsPostUpscaleRequest), + jsonSerializerContext) as global::Ideogram.ToolsPostUpscaleRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ToolsPostUpscaleRequest? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ToolsPostUpscaleRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ToolsPostUpscaleRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ToolsPostUpscaleRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolsPostUpscaleRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolsPostUpscaleRequest.g.cs new file mode 100644 index 00000000..f9ecd524 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ToolsPostUpscaleRequest.g.cs @@ -0,0 +1,122 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// + /// + public sealed partial class ToolsPostUpscaleRequest + { + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("image")] + [global::System.Text.Json.Serialization.JsonRequired] + public required byte[] Image { get; set; } + + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Imagename { get; set; } + + /// + /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
+ /// Default Value: x2 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("upscale_factor")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.V2ImageUpscaleAutoPostRequestBodyContentMultipartFormDataSchemaUpscaleFactorJsonConverter))] + public global::Ideogram.V2ImageUpscaleAutoPostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? UpscaleFactor { get; set; } + + /// + /// Random seed. Set for reproducible generation. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("seed")] + public int? Seed { get; set; } + + /// + /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
+ /// Default Value: false + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] + public string? WebhookUrl { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
+ /// Default Value: x2 + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ToolsPostUpscaleRequest( + byte[] image, + string imagename, + global::Ideogram.V2ImageUpscaleAutoPostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? upscaleFactor, + int? seed, + bool? async, + string? webhookUrl) + { + this.Image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + this.Imagename = imagename ?? throw new global::System.ArgumentNullException(nameof(imagename)); + this.UpscaleFactor = upscaleFactor; + this.Seed = seed; + this.Async = async; + this.WebhookUrl = webhookUrl; + } + + /// + /// Initializes a new instance of the class. + /// + public ToolsPostUpscaleRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolsPostUpscaleResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolsPostUpscaleResponse.Json.g.cs new file mode 100644 index 00000000..61025b52 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ToolsPostUpscaleResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ToolsPostUpscaleResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ToolsPostUpscaleResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ToolsPostUpscaleResponse), + jsonSerializerContext) as global::Ideogram.ToolsPostUpscaleResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ToolsPostUpscaleResponse? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ToolsPostUpscaleResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ToolsPostUpscaleResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ToolsPostUpscaleResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolsPostUpscaleResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolsPostUpscaleResponse.g.cs new file mode 100644 index 00000000..c0fcd81f --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ToolsPostUpscaleResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ToolsPostUpscaleResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolsPostUpscaleResponse2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolsPostUpscaleResponse2.Json.g.cs new file mode 100644 index 00000000..cac5fe6e --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ToolsPostUpscaleResponse2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ToolsPostUpscaleResponse2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ToolsPostUpscaleResponse2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ToolsPostUpscaleResponse2), + jsonSerializerContext) as global::Ideogram.ToolsPostUpscaleResponse2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ToolsPostUpscaleResponse2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ToolsPostUpscaleResponse2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ToolsPostUpscaleResponse2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ToolsPostUpscaleResponse2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolsPostUpscaleResponse2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolsPostUpscaleResponse2.g.cs new file mode 100644 index 00000000..395a1728 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ToolsPostUpscaleResponse2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ToolsPostUpscaleResponse2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolsPostUpscaleResponse3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolsPostUpscaleResponse3.Json.g.cs new file mode 100644 index 00000000..bf04eb56 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ToolsPostUpscaleResponse3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ToolsPostUpscaleResponse3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ToolsPostUpscaleResponse3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ToolsPostUpscaleResponse3), + jsonSerializerContext) as global::Ideogram.ToolsPostUpscaleResponse3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ToolsPostUpscaleResponse3? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ToolsPostUpscaleResponse3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ToolsPostUpscaleResponse3), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ToolsPostUpscaleResponse3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolsPostUpscaleResponse3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolsPostUpscaleResponse3.g.cs new file mode 100644 index 00000000..01cabd56 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ToolsPostUpscaleResponse3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ToolsPostUpscaleResponse3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolsPostUpscaleResponse4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolsPostUpscaleResponse4.Json.g.cs new file mode 100644 index 00000000..18d2cbb1 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ToolsPostUpscaleResponse4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ToolsPostUpscaleResponse4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ToolsPostUpscaleResponse4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ToolsPostUpscaleResponse4), + jsonSerializerContext) as global::Ideogram.ToolsPostUpscaleResponse4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ToolsPostUpscaleResponse4? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ToolsPostUpscaleResponse4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ToolsPostUpscaleResponse4), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ToolsPostUpscaleResponse4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolsPostUpscaleResponse4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolsPostUpscaleResponse4.g.cs new file mode 100644 index 00000000..407fb168 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ToolsPostUpscaleResponse4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ToolsPostUpscaleResponse4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolsPostUpscaleResponse5.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolsPostUpscaleResponse5.Json.g.cs new file mode 100644 index 00000000..bc3deb7e --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ToolsPostUpscaleResponse5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ToolsPostUpscaleResponse5 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ToolsPostUpscaleResponse5? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ToolsPostUpscaleResponse5), + jsonSerializerContext) as global::Ideogram.ToolsPostUpscaleResponse5; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ToolsPostUpscaleResponse5? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ToolsPostUpscaleResponse5? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ToolsPostUpscaleResponse5), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ToolsPostUpscaleResponse5; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolsPostUpscaleResponse5.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolsPostUpscaleResponse5.g.cs new file mode 100644 index 00000000..b1228b6a --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ToolsPostUpscaleResponse5.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ToolsPostUpscaleResponse5 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolsPostUpscaleResponse6.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolsPostUpscaleResponse6.Json.g.cs new file mode 100644 index 00000000..f8661292 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ToolsPostUpscaleResponse6.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ToolsPostUpscaleResponse6 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ToolsPostUpscaleResponse6? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ToolsPostUpscaleResponse6), + jsonSerializerContext) as global::Ideogram.ToolsPostUpscaleResponse6; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.ToolsPostUpscaleResponse6? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ToolsPostUpscaleResponse6? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ToolsPostUpscaleResponse6), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ToolsPostUpscaleResponse6; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ToolsPostUpscaleResponse6.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ToolsPostUpscaleResponse6.g.cs new file mode 100644 index 00000000..3590fb50 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ToolsPostUpscaleResponse6.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class ToolsPostUpscaleResponse6 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.TrainDatasetModelRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.TrainDatasetModelRequest.Json.g.cs deleted file mode 100644 index e8a3a0ca..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.TrainDatasetModelRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class TrainDatasetModelRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.TrainDatasetModelRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.TrainDatasetModelRequest), - jsonSerializerContext) as global::Ideogram.TrainDatasetModelRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.TrainDatasetModelRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.TrainDatasetModelRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.TrainDatasetModelRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.TrainDatasetModelRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.TrainDatasetModelRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.TrainDatasetModelRequest.g.cs deleted file mode 100644 index ad1cf582..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.TrainDatasetModelRequest.g.cs +++ /dev/null @@ -1,51 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Custom Model training request.
- /// Example: {"model_name":"my-custom-model"} - ///
- public sealed partial class TrainDatasetModelRequest - { - /// - /// Name after trimming surrounding whitespace: 5–30 Unicode letters, numbers, spaces, underscores, parentheses, periods, or hyphens.
- /// Example: my-custom-model - ///
- /// my-custom-model - [global::System.Text.Json.Serialization.JsonPropertyName("model_name")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string ModelName { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Name after trimming surrounding whitespace: 5–30 Unicode letters, numbers, spaces, underscores, parentheses, periods, or hyphens.
- /// Example: my-custom-model - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public TrainDatasetModelRequest( - string modelName) - { - this.ModelName = modelName ?? throw new global::System.ArgumentNullException(nameof(modelName)); - } - - /// - /// Initializes a new instance of the class. - /// - public TrainDatasetModelRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.TrainDatasetModelResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.TrainDatasetModelResponse.Json.g.cs deleted file mode 100644 index 17c19d6f..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.TrainDatasetModelResponse.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class TrainDatasetModelResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.TrainDatasetModelResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.TrainDatasetModelResponse), - jsonSerializerContext) as global::Ideogram.TrainDatasetModelResponse; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.TrainDatasetModelResponse? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.TrainDatasetModelResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.TrainDatasetModelResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.TrainDatasetModelResponse; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.TrainDatasetModelResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.TrainDatasetModelResponse.g.cs deleted file mode 100644 index 91471261..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.TrainDatasetModelResponse.g.cs +++ /dev/null @@ -1,83 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"training_status":"training_status","model_name":"model_name","dataset_id":"dataset_id","model_id":"model_id"} - /// - public sealed partial class TrainDatasetModelResponse - { - /// - /// Unique identifier of the created model. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("model_id")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string ModelId { get; set; } - - /// - /// Identifier of the dataset used for training. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("dataset_id")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string DatasetId { get; set; } - - /// - /// Current training status of the model. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("training_status")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string TrainingStatus { get; set; } - - /// - /// Name of the model. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("model_name")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string ModelName { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Unique identifier of the created model. - /// - /// - /// Identifier of the dataset used for training. - /// - /// - /// Current training status of the model. - /// - /// - /// Name of the model. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public TrainDatasetModelResponse( - string modelId, - string datasetId, - string trainingStatus, - string modelName) - { - this.ModelId = modelId ?? throw new global::System.ArgumentNullException(nameof(modelId)); - this.DatasetId = datasetId ?? throw new global::System.ArgumentNullException(nameof(datasetId)); - this.TrainingStatus = trainingStatus ?? throw new global::System.ArgumentNullException(nameof(trainingStatus)); - this.ModelName = modelName ?? throw new global::System.ArgumentNullException(nameof(modelName)); - } - - /// - /// Initializes a new instance of the class. - /// - public TrainDatasetModelResponse() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.TrainModelV3AdvancedRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.TrainModelV3AdvancedRequest.Json.g.cs deleted file mode 100644 index c86d375e..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.TrainModelV3AdvancedRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class TrainModelV3AdvancedRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.TrainModelV3AdvancedRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.TrainModelV3AdvancedRequest), - jsonSerializerContext) as global::Ideogram.TrainModelV3AdvancedRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.TrainModelV3AdvancedRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.TrainModelV3AdvancedRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.TrainModelV3AdvancedRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.TrainModelV3AdvancedRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.TrainModelV3AdvancedRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.TrainModelV3AdvancedRequest.g.cs deleted file mode 100644 index 7abd7b04..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.TrainModelV3AdvancedRequest.g.cs +++ /dev/null @@ -1,122 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Advanced training request for a custom Ideogram v3 model. Hyperparameters are optional and fall back to defaults when omitted.
- /// Example: {"model_name":"my-custom-model","lora_rank":64,"dataset_id":"abc123","ema":0.999,"training_steps":1000,"learning_rate":0.0001} - ///
- public sealed partial class TrainModelV3AdvancedRequest - { - /// - /// ID of the dataset to train the model from.
- /// Example: abc123 - ///
- /// abc123 - [global::System.Text.Json.Serialization.JsonPropertyName("dataset_id")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string DatasetId { get; set; } - - /// - /// Name for the trained model. Must be 5-30 characters, alphanumeric with spaces and hyphens allowed.
- /// Example: my-custom-model - ///
- /// my-custom-model - [global::System.Text.Json.Serialization.JsonPropertyName("model_name")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string ModelName { get; set; } - - /// - /// Number of training steps. Must be between 100 and 10000 and a multiple of 100. Defaults to 1000.
- /// Example: 1000 - ///
- /// 1000 - [global::System.Text.Json.Serialization.JsonPropertyName("training_steps")] - public int? TrainingSteps { get; set; } - - /// - /// LoRA rank for model training. Must be one of 64 or 128. Defaults to 128. Higher rank increases model capacity at the cost of longer training and larger weights.
- /// Example: 64 - ///
- /// 64 - [global::System.Text.Json.Serialization.JsonPropertyName("lora_rank")] - public int? LoraRank { get; set; } - - /// - /// Exponential moving average decay rate for the model weights. Must be between 0 and 1 (exclusive). Typical values are 0.99-0.9999; higher values produce smoother weight averages but respond more slowly to training updates.
- /// Example: 0.999F - ///
- /// 0.999F - [global::System.Text.Json.Serialization.JsonPropertyName("ema")] - public double? Ema { get; set; } - - /// - /// Learning rate for the optimizer. Must be greater than 0. Typical values for LoRA fine-tuning are 1e-5 to 1e-4; larger values train faster but risk instability.
- /// Example: 0.0001F - ///
- /// 0.0001F - [global::System.Text.Json.Serialization.JsonPropertyName("learning_rate")] - public double? LearningRate { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// ID of the dataset to train the model from.
- /// Example: abc123 - /// - /// - /// Name for the trained model. Must be 5-30 characters, alphanumeric with spaces and hyphens allowed.
- /// Example: my-custom-model - /// - /// - /// Number of training steps. Must be between 100 and 10000 and a multiple of 100. Defaults to 1000.
- /// Example: 1000 - /// - /// - /// LoRA rank for model training. Must be one of 64 or 128. Defaults to 128. Higher rank increases model capacity at the cost of longer training and larger weights.
- /// Example: 64 - /// - /// - /// Exponential moving average decay rate for the model weights. Must be between 0 and 1 (exclusive). Typical values are 0.99-0.9999; higher values produce smoother weight averages but respond more slowly to training updates.
- /// Example: 0.999F - /// - /// - /// Learning rate for the optimizer. Must be greater than 0. Typical values for LoRA fine-tuning are 1e-5 to 1e-4; larger values train faster but risk instability.
- /// Example: 0.0001F - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public TrainModelV3AdvancedRequest( - string datasetId, - string modelName, - int? trainingSteps, - int? loraRank, - double? ema, - double? learningRate) - { - this.DatasetId = datasetId ?? throw new global::System.ArgumentNullException(nameof(datasetId)); - this.ModelName = modelName ?? throw new global::System.ArgumentNullException(nameof(modelName)); - this.TrainingSteps = trainingSteps; - this.LoraRank = loraRank; - this.Ema = ema; - this.LearningRate = learningRate; - } - - /// - /// Initializes a new instance of the class. - /// - public TrainModelV3AdvancedRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.TrainModelV3Request.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.TrainModelV3Request.Json.g.cs deleted file mode 100644 index 296688f2..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.TrainModelV3Request.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class TrainModelV3Request - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.TrainModelV3Request? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.TrainModelV3Request), - jsonSerializerContext) as global::Ideogram.TrainModelV3Request; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.TrainModelV3Request? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.TrainModelV3Request? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.TrainModelV3Request), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.TrainModelV3Request; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.TrainModelV3Request.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.TrainModelV3Request.g.cs deleted file mode 100644 index b347c063..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.TrainModelV3Request.g.cs +++ /dev/null @@ -1,66 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Training request for a custom Ideogram v3 model using default hyperparameters.
- /// Example: {"model_name":"my-custom-model","dataset_id":"abc123"} - ///
- public sealed partial class TrainModelV3Request - { - /// - /// ID of the dataset to train the model from.
- /// Example: abc123 - ///
- /// abc123 - [global::System.Text.Json.Serialization.JsonPropertyName("dataset_id")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string DatasetId { get; set; } - - /// - /// Name for the trained model. Must be 5-30 characters, alphanumeric with spaces and hyphens allowed.
- /// Example: my-custom-model - ///
- /// my-custom-model - [global::System.Text.Json.Serialization.JsonPropertyName("model_name")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string ModelName { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// ID of the dataset to train the model from.
- /// Example: abc123 - /// - /// - /// Name for the trained model. Must be 5-30 characters, alphanumeric with spaces and hyphens allowed.
- /// Example: my-custom-model - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public TrainModelV3Request( - string datasetId, - string modelName) - { - this.DatasetId = datasetId ?? throw new global::System.ArgumentNullException(nameof(datasetId)); - this.ModelName = modelName ?? throw new global::System.ArgumentNullException(nameof(modelName)); - } - - /// - /// Initializes a new instance of the class. - /// - public TrainModelV3Request() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.TrainModelV4AdvancedRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.TrainModelV4AdvancedRequest.Json.g.cs deleted file mode 100644 index d7b5fbae..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.TrainModelV4AdvancedRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class TrainModelV4AdvancedRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.TrainModelV4AdvancedRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.TrainModelV4AdvancedRequest), - jsonSerializerContext) as global::Ideogram.TrainModelV4AdvancedRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.TrainModelV4AdvancedRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.TrainModelV4AdvancedRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.TrainModelV4AdvancedRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.TrainModelV4AdvancedRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.TrainModelV4AdvancedRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.TrainModelV4AdvancedRequest.g.cs deleted file mode 100644 index 8be64dc7..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.TrainModelV4AdvancedRequest.g.cs +++ /dev/null @@ -1,164 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Advanced training request for a custom Ideogram v4 model. Hyperparameters are optional and fall back to defaults when omitted.
- /// Example: {"batch_size":8,"wandb_project":"my-wandb-project","model_name":"my-custom-model","lora_rank":64,"base_variant":"distilled_gd","dataset_id":"abc123","ema":0.999,"training_steps":1000,"learning_rate":0.0001} - ///
- public sealed partial class TrainModelV4AdvancedRequest - { - /// - /// ID of the dataset to train the model from.
- /// Example: abc123 - ///
- /// abc123 - [global::System.Text.Json.Serialization.JsonPropertyName("dataset_id")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string DatasetId { get; set; } - - /// - /// Name for the trained model. Must be 5-30 characters, alphanumeric with spaces and hyphens allowed.
- /// Example: my-custom-model - ///
- /// my-custom-model - [global::System.Text.Json.Serialization.JsonPropertyName("model_name")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string ModelName { get; set; } - - /// - /// Number of training steps. Must be between 100 and 10000 and a multiple of 100. Defaults to 1000.
- /// Example: 1000 - ///
- /// 1000 - [global::System.Text.Json.Serialization.JsonPropertyName("training_steps")] - public int? TrainingSteps { get; set; } - - /// - /// LoRA rank for model training. Must be one of 64 or 128. Defaults to 128. Higher rank increases model capacity at the cost of longer training and larger weights.
- /// Example: 64 - ///
- /// 64 - [global::System.Text.Json.Serialization.JsonPropertyName("lora_rank")] - public int? LoraRank { get; set; } - - /// - /// Exponential moving average decay rate for the model weights. Must be between 0 and 1 (exclusive). Typical values are 0.99-0.9999; higher values produce smoother weight averages but respond more slowly to training updates.
- /// Example: 0.999F - ///
- /// 0.999F - [global::System.Text.Json.Serialization.JsonPropertyName("ema")] - public double? Ema { get; set; } - - /// - /// Learning rate for the optimizer. Must be greater than 0. Typical values for LoRA fine-tuning are 1e-5 to 1e-4; larger values train faster but risk instability.
- /// Example: 0.0001F - ///
- /// 0.0001F - [global::System.Text.Json.Serialization.JsonPropertyName("learning_rate")] - public double? LearningRate { get; set; } - - /// - /// Per-step training batch size. Must be one of 1, 2, 4, 8, 16, or 32. Defaults to a trainer-side value when omitted. Larger batches can improve throughput at the cost of more memory.
- /// Example: 8 - ///
- /// 8 - [global::System.Text.Json.Serialization.JsonPropertyName("batch_size")] - public int? BatchSize { get; set; } - - /// - /// Weights & Biases project to log this training run to. When set, the run streams metrics to this W&B project; when omitted, no W&B logging happens.
- /// Example: my-wandb-project - ///
- /// my-wandb-project - [global::System.Text.Json.Serialization.JsonPropertyName("wandb_project")] - public string? WandbProject { get; set; } - - /// - /// Frozen v4 backbone the custom LoRA is trained on. Must be one of `distilled_gd` (the guidance-distilled base, default) or `oldbase_farzad_fused` (the fused non-distilled base). Omit to use the default.
- /// Example: distilled_gd - ///
- /// distilled_gd - [global::System.Text.Json.Serialization.JsonPropertyName("base_variant")] - public string? BaseVariant { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// ID of the dataset to train the model from.
- /// Example: abc123 - /// - /// - /// Name for the trained model. Must be 5-30 characters, alphanumeric with spaces and hyphens allowed.
- /// Example: my-custom-model - /// - /// - /// Number of training steps. Must be between 100 and 10000 and a multiple of 100. Defaults to 1000.
- /// Example: 1000 - /// - /// - /// LoRA rank for model training. Must be one of 64 or 128. Defaults to 128. Higher rank increases model capacity at the cost of longer training and larger weights.
- /// Example: 64 - /// - /// - /// Exponential moving average decay rate for the model weights. Must be between 0 and 1 (exclusive). Typical values are 0.99-0.9999; higher values produce smoother weight averages but respond more slowly to training updates.
- /// Example: 0.999F - /// - /// - /// Learning rate for the optimizer. Must be greater than 0. Typical values for LoRA fine-tuning are 1e-5 to 1e-4; larger values train faster but risk instability.
- /// Example: 0.0001F - /// - /// - /// Per-step training batch size. Must be one of 1, 2, 4, 8, 16, or 32. Defaults to a trainer-side value when omitted. Larger batches can improve throughput at the cost of more memory.
- /// Example: 8 - /// - /// - /// Weights & Biases project to log this training run to. When set, the run streams metrics to this W&B project; when omitted, no W&B logging happens.
- /// Example: my-wandb-project - /// - /// - /// Frozen v4 backbone the custom LoRA is trained on. Must be one of `distilled_gd` (the guidance-distilled base, default) or `oldbase_farzad_fused` (the fused non-distilled base). Omit to use the default.
- /// Example: distilled_gd - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public TrainModelV4AdvancedRequest( - string datasetId, - string modelName, - int? trainingSteps, - int? loraRank, - double? ema, - double? learningRate, - int? batchSize, - string? wandbProject, - string? baseVariant) - { - this.DatasetId = datasetId ?? throw new global::System.ArgumentNullException(nameof(datasetId)); - this.ModelName = modelName ?? throw new global::System.ArgumentNullException(nameof(modelName)); - this.TrainingSteps = trainingSteps; - this.LoraRank = loraRank; - this.Ema = ema; - this.LearningRate = learningRate; - this.BatchSize = batchSize; - this.WandbProject = wandbProject; - this.BaseVariant = baseVariant; - } - - /// - /// Initializes a new instance of the class. - /// - public TrainModelV4AdvancedRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.TrainModelV4Request.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.TrainModelV4Request.Json.g.cs deleted file mode 100644 index bf855be5..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.TrainModelV4Request.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class TrainModelV4Request - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.TrainModelV4Request? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.TrainModelV4Request), - jsonSerializerContext) as global::Ideogram.TrainModelV4Request; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.TrainModelV4Request? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.TrainModelV4Request? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.TrainModelV4Request), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.TrainModelV4Request; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.TrainModelV4Request.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.TrainModelV4Request.g.cs deleted file mode 100644 index 9796eb6b..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.TrainModelV4Request.g.cs +++ /dev/null @@ -1,66 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Training request for a custom Ideogram v4 model using default hyperparameters.
- /// Example: {"model_name":"my-custom-model","dataset_id":"abc123"} - ///
- public sealed partial class TrainModelV4Request - { - /// - /// ID of the dataset to train the model from.
- /// Example: abc123 - ///
- /// abc123 - [global::System.Text.Json.Serialization.JsonPropertyName("dataset_id")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string DatasetId { get; set; } - - /// - /// Name for the trained model. Must be 5-30 characters, alphanumeric with spaces and hyphens allowed.
- /// Example: my-custom-model - ///
- /// my-custom-model - [global::System.Text.Json.Serialization.JsonPropertyName("model_name")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string ModelName { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// ID of the dataset to train the model from.
- /// Example: abc123 - /// - /// - /// Name for the trained model. Must be 5-30 characters, alphanumeric with spaces and hyphens allowed.
- /// Example: my-custom-model - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public TrainModelV4Request( - string datasetId, - string modelName) - { - this.DatasetId = datasetId ?? throw new global::System.ArgumentNullException(nameof(datasetId)); - this.ModelName = modelName ?? throw new global::System.ArgumentNullException(nameof(modelName)); - } - - /// - /// Initializes a new instance of the class. - /// - public TrainModelV4Request() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.TrainingRun.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.TrainingRun.Json.g.cs deleted file mode 100644 index d49d96e5..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.TrainingRun.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class TrainingRun - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.TrainingRun? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.TrainingRun), - jsonSerializerContext) as global::Ideogram.TrainingRun; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.TrainingRun? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.TrainingRun? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.TrainingRun), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.TrainingRun; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.TrainingRun.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.TrainingRun.g.cs deleted file mode 100644 index 7eb5b5ae..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.TrainingRun.g.cs +++ /dev/null @@ -1,139 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// A training run for a custom model.
- /// Example: {"creation_time":"2000-01-23T04:56:07\u002B00:00","last_update_time":"2000-01-23T04:56:07\u002B00:00","lora_rank":6,"num_chips":1,"training_run_id":"training_run_id","ema":5.962133916683182,"training_steps":0,"learning_rate":5.637376656633329,"status":null} - ///
- public sealed partial class TrainingRun - { - /// - /// Unique identifier for the training run. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("training_run_id")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string TrainingRunId { get; set; } - - /// - /// The status of a training run. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("status")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.TrainingRunStatusJsonConverter))] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.TrainingRunStatus Status { get; set; } - - /// - /// Number of training steps configured. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("training_steps")] - public int? TrainingSteps { get; set; } - - /// - /// LoRA rank used for training. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("lora_rank")] - public int? LoraRank { get; set; } - - /// - /// Number of TPU chips used. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("num_chips")] - public int? NumChips { get; set; } - - /// - /// Exponential moving average decay rate. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("ema")] - public double? Ema { get; set; } - - /// - /// Learning rate for the optimizer. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("learning_rate")] - public double? LearningRate { get; set; } - - /// - /// When the training run was created. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("creation_time")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.DateTime CreationTime { get; set; } - - /// - /// When the training run was last updated. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("last_update_time")] - public global::System.DateTime? LastUpdateTime { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Unique identifier for the training run. - /// - /// - /// The status of a training run. - /// - /// - /// When the training run was created. - /// - /// - /// Number of training steps configured. - /// - /// - /// LoRA rank used for training. - /// - /// - /// Number of TPU chips used. - /// - /// - /// Exponential moving average decay rate. - /// - /// - /// Learning rate for the optimizer. - /// - /// - /// When the training run was last updated. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public TrainingRun( - string trainingRunId, - global::Ideogram.TrainingRunStatus status, - global::System.DateTime creationTime, - int? trainingSteps, - int? loraRank, - int? numChips, - double? ema, - double? learningRate, - global::System.DateTime? lastUpdateTime) - { - this.TrainingRunId = trainingRunId ?? throw new global::System.ArgumentNullException(nameof(trainingRunId)); - this.Status = status; - this.TrainingSteps = trainingSteps; - this.LoraRank = loraRank; - this.NumChips = numChips; - this.Ema = ema; - this.LearningRate = learningRate; - this.CreationTime = creationTime; - this.LastUpdateTime = lastUpdateTime; - } - - /// - /// Initializes a new instance of the class. - /// - public TrainingRun() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.TrainingRunStatus.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.TrainingRunStatus.g.cs deleted file mode 100644 index df5a00ae..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.TrainingRunStatus.g.cs +++ /dev/null @@ -1,75 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The status of a training run. - /// - public enum TrainingRunStatus - { - /// - /// - /// - Completed, - /// - /// - /// - Failed, - /// - /// - /// - Finalizing, - /// - /// - /// - PreparingData, - /// - /// - /// - Queued, - /// - /// - /// - Training, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class TrainingRunStatusExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this TrainingRunStatus value) - { - return value switch - { - TrainingRunStatus.Completed => "COMPLETED", - TrainingRunStatus.Failed => "FAILED", - TrainingRunStatus.Finalizing => "FINALIZING", - TrainingRunStatus.PreparingData => "PREPARING_DATA", - TrainingRunStatus.Queued => "QUEUED", - TrainingRunStatus.Training => "TRAINING", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static TrainingRunStatus? ToEnum(string value) - { - return value switch - { - "COMPLETED" => TrainingRunStatus.Completed, - "FAILED" => TrainingRunStatus.Failed, - "FINALIZING" => TrainingRunStatus.Finalizing, - "PREPARING_DATA" => TrainingRunStatus.PreparingData, - "QUEUED" => TrainingRunStatus.Queued, - "TRAINING" => TrainingRunStatus.Training, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.TransparencyOption.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.TransparencyOption.g.cs deleted file mode 100644 index 2388d4c5..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.TransparencyOption.g.cs +++ /dev/null @@ -1,64 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Controls whether the edited output has a transparent background.
- /// - `TRANSPARENT`: the output is produced with a transparent background.
- /// - `OPAQUE`: the output is produced with an opaque background.
- /// - `AUTO`: the server decides based on the prompt and the image being
- /// edited (e.g. whether it already has a transparent background). This is
- /// the default. When the prompt asks only for background removal, the
- /// output may be the edited image with its background removed.
- /// Default Value: AUTO - ///
- public enum TransparencyOption - { - /// - /// the server decides based on the prompt and the image being - /// - Auto, - /// - /// the output is produced with an opaque background. - /// - Opaque, - /// - /// the output is produced with a transparent background. - /// - Transparent, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class TransparencyOptionExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this TransparencyOption value) - { - return value switch - { - TransparencyOption.Auto => "AUTO", - TransparencyOption.Opaque => "OPAQUE", - TransparencyOption.Transparent => "TRANSPARENT", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static TransparencyOption? ToEnum(string value) - { - return value switch - { - "AUTO" => TransparencyOption.Auto, - "OPAQUE" => TransparencyOption.Opaque, - "TRANSPARENT" => TransparencyOption.Transparent, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.TryOnRequestV3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.TryOnRequestV3.Json.g.cs deleted file mode 100644 index 024626e1..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.TryOnRequestV3.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class TryOnRequestV3 - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.TryOnRequestV3? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.TryOnRequestV3), - jsonSerializerContext) as global::Ideogram.TryOnRequestV3; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.TryOnRequestV3? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.TryOnRequestV3? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.TryOnRequestV3), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.TryOnRequestV3; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.TryOnRequestV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.TryOnRequestV3.g.cs deleted file mode 100644 index 5ff31927..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.TryOnRequestV3.g.cs +++ /dev/null @@ -1,186 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - public sealed partial class TryOnRequestV3 - { - /// - /// The image containing a person wearing clothing to be modified (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image")] - [global::System.Text.Json.Serialization.JsonRequired] - public required byte[] Image { get; set; } - - /// - /// The image containing a person wearing clothing to be modified (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Imagename { get; set; } - - /// - /// The prompt describing the desired clothing change. Defaults to "Person wearing this piece of clothing" if omitted or empty.
- /// Default Value: Person wearing this piece of clothing
- /// Example: Change his shirt to a pink shirt - ///
- /// Change his shirt to a pink shirt - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - public string? Prompt { get; set; } - - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - ///
- /// ON - [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.MagicPromptOptionJsonConverter))] - public global::Ideogram.MagicPromptOption? MagicPrompt { get; set; } - - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt_system_prompt_config_id")] - public string? MagicPromptSystemPromptConfigId { get; set; } - - /// - /// The number of images to generate.
- /// Default Value: 1 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] - public int? NumImages { get; set; } - - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - ///
- /// 12345 - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("rendering_speed")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.RenderingSpeedJsonConverter))] - public global::Ideogram.RenderingSpeed? RenderingSpeed { get; set; } - - /// - /// The style type to generate with.
- /// Default Value: GENERAL
- /// Example: GENERAL - ///
- /// GENERAL - [global::System.Text.Json.Serialization.JsonPropertyName("style_type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.StyleTypeV3JsonConverter))] - public global::Ideogram.StyleTypeV3? StyleType { get; set; } - - /// - /// A predefined style preset that applies a specific artistic style to the generated image.
- /// Example: BRIGHT_ART - ///
- /// BRIGHT_ART - [global::System.Text.Json.Serialization.JsonPropertyName("style_preset")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.StylePresetV3JsonConverter))] - public global::Ideogram.StylePresetV3? StylePreset { get; set; } - - /// - /// An image to use as the product reference for the try-on (exactly 1 image required). The image should be in JPEG, PNG or WebP format. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("product_reference_images")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList ProductReferenceImages { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The image containing a person wearing clothing to be modified (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The image containing a person wearing clothing to be modified (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// An image to use as the product reference for the try-on (exactly 1 image required). The image should be in JPEG, PNG or WebP format. - /// - /// - /// The prompt describing the desired clothing change. Defaults to "Person wearing this piece of clothing" if omitted or empty.
- /// Default Value: Person wearing this piece of clothing
- /// Example: Change his shirt to a pink shirt - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The rendering speed to use.
- /// Default Value: DEFAULT - /// - /// - /// The style type to generate with.
- /// Default Value: GENERAL
- /// Example: GENERAL - /// - /// - /// A predefined style preset that applies a specific artistic style to the generated image.
- /// Example: BRIGHT_ART - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public TryOnRequestV3( - byte[] image, - string imagename, - global::System.Collections.Generic.IList productReferenceImages, - string? prompt, - global::Ideogram.MagicPromptOption? magicPrompt, - string? magicPromptSystemPromptConfigId, - int? numImages, - int? seed, - global::Ideogram.RenderingSpeed? renderingSpeed, - global::Ideogram.StyleTypeV3? styleType, - global::Ideogram.StylePresetV3? stylePreset) - { - this.Image = image ?? throw new global::System.ArgumentNullException(nameof(image)); - this.Imagename = imagename ?? throw new global::System.ArgumentNullException(nameof(imagename)); - this.Prompt = prompt; - this.MagicPrompt = magicPrompt; - this.MagicPromptSystemPromptConfigId = magicPromptSystemPromptConfigId; - this.NumImages = numImages; - this.Seed = seed; - this.RenderingSpeed = renderingSpeed; - this.StyleType = styleType; - this.StylePreset = stylePreset; - this.ProductReferenceImages = productReferenceImages ?? throw new global::System.ArgumentNullException(nameof(productReferenceImages)); - } - - /// - /// Initializes a new instance of the class. - /// - public TryOnRequestV3() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.UnpublishMiniAppPreviewResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.UnpublishMiniAppPreviewResponse.Json.g.cs deleted file mode 100644 index 3d73d78f..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.UnpublishMiniAppPreviewResponse.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class UnpublishMiniAppPreviewResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.UnpublishMiniAppPreviewResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.UnpublishMiniAppPreviewResponse), - jsonSerializerContext) as global::Ideogram.UnpublishMiniAppPreviewResponse; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.UnpublishMiniAppPreviewResponse? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.UnpublishMiniAppPreviewResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.UnpublishMiniAppPreviewResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.UnpublishMiniAppPreviewResponse; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.UnpublishMiniAppPreviewResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.UnpublishMiniAppPreviewResponse.g.cs deleted file mode 100644 index b00d1a79..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.UnpublishMiniAppPreviewResponse.g.cs +++ /dev/null @@ -1,48 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Confirmation of an unpublished mini-app preview entry.
- /// Example: {"preview_id":"preview_id"} - ///
- public sealed partial class UnpublishMiniAppPreviewResponse - { - /// - /// Unique, URL-safe preview identifier composed by the deploy pipeline. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("preview_id")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string PreviewId { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Unique, URL-safe preview identifier composed by the deploy pipeline. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public UnpublishMiniAppPreviewResponse( - string previewId) - { - this.PreviewId = previewId ?? throw new global::System.ArgumentNullException(nameof(previewId)); - } - - /// - /// Initializes a new instance of the class. - /// - public UnpublishMiniAppPreviewResponse() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.UpdateOrganizationApiPropertiesRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.UpdateOrganizationApiPropertiesRequest.Json.g.cs deleted file mode 100644 index 9fbf1784..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.UpdateOrganizationApiPropertiesRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class UpdateOrganizationApiPropertiesRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.UpdateOrganizationApiPropertiesRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.UpdateOrganizationApiPropertiesRequest), - jsonSerializerContext) as global::Ideogram.UpdateOrganizationApiPropertiesRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.UpdateOrganizationApiPropertiesRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.UpdateOrganizationApiPropertiesRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.UpdateOrganizationApiPropertiesRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.UpdateOrganizationApiPropertiesRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.UpdateOrganizationApiPropertiesRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.UpdateOrganizationApiPropertiesRequest.g.cs deleted file mode 100644 index 9f52f884..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.UpdateOrganizationApiPropertiesRequest.g.cs +++ /dev/null @@ -1,47 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Partial update for an organization's API-only properties. Only fields explicitly present are written; unset fields preserve their current value.
- /// Example: {"copyright_detection_enabled":true} - ///
- public sealed partial class UpdateOrganizationApiPropertiesRequest - { - /// - /// Toggle post-generation Hive likeness + logo detection for this organization. See ApiProfile.copyright_detection_enabled for behavior. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("copyright_detection_enabled")] - public bool? CopyrightDetectionEnabled { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Toggle post-generation Hive likeness + logo detection for this organization. See ApiProfile.copyright_detection_enabled for behavior. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public UpdateOrganizationApiPropertiesRequest( - bool? copyrightDetectionEnabled) - { - this.CopyrightDetectionEnabled = copyrightDetectionEnabled; - } - - /// - /// Initializes a new instance of the class. - /// - public UpdateOrganizationApiPropertiesRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.UpdateOrganizationApiPropertiesResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.UpdateOrganizationApiPropertiesResponse.Json.g.cs deleted file mode 100644 index 66cd7021..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.UpdateOrganizationApiPropertiesResponse.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class UpdateOrganizationApiPropertiesResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.UpdateOrganizationApiPropertiesResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.UpdateOrganizationApiPropertiesResponse), - jsonSerializerContext) as global::Ideogram.UpdateOrganizationApiPropertiesResponse; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.UpdateOrganizationApiPropertiesResponse? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.UpdateOrganizationApiPropertiesResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.UpdateOrganizationApiPropertiesResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.UpdateOrganizationApiPropertiesResponse; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.UpdateOrganizationApiPropertiesResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.UpdateOrganizationApiPropertiesResponse.g.cs deleted file mode 100644 index 338bc43e..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.UpdateOrganizationApiPropertiesResponse.g.cs +++ /dev/null @@ -1,47 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"copyright_detection_enabled":true} - /// - public sealed partial class UpdateOrganizationApiPropertiesResponse - { - /// - /// The setting after the update. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("copyright_detection_enabled")] - [global::System.Text.Json.Serialization.JsonRequired] - public required bool CopyrightDetectionEnabled { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The setting after the update. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public UpdateOrganizationApiPropertiesResponse( - bool copyrightDetectionEnabled) - { - this.CopyrightDetectionEnabled = copyrightDetectionEnabled; - } - - /// - /// Initializes a new instance of the class. - /// - public UpdateOrganizationApiPropertiesResponse() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.UploadDatasetAssetsRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.UploadDatasetAssetsRequest.Json.g.cs deleted file mode 100644 index 3cba8486..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.UploadDatasetAssetsRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class UploadDatasetAssetsRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.UploadDatasetAssetsRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.UploadDatasetAssetsRequest), - jsonSerializerContext) as global::Ideogram.UploadDatasetAssetsRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.UploadDatasetAssetsRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.UploadDatasetAssetsRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.UploadDatasetAssetsRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.UploadDatasetAssetsRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.UploadDatasetAssetsRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.UploadDatasetAssetsRequest.g.cs deleted file mode 100644 index cc8cb275..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.UploadDatasetAssetsRequest.g.cs +++ /dev/null @@ -1,47 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - public sealed partial class UploadDatasetAssetsRequest - { - /// - /// Image files (JPEG, PNG, WebP), .txt caption sidecar files, and/or ZIP archives containing images and captions. Caption .txt files are matched to images by filename stem (e.g. sunset.txt provides the caption for sunset.jpg). Captions are optional! - /// - [global::System.Text.Json.Serialization.JsonPropertyName("files")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList Files { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Image files (JPEG, PNG, WebP), .txt caption sidecar files, and/or ZIP archives containing images and captions. Caption .txt files are matched to images by filename stem (e.g. sunset.txt provides the caption for sunset.jpg). Captions are optional! - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public UploadDatasetAssetsRequest( - global::System.Collections.Generic.IList files) - { - this.Files = files ?? throw new global::System.ArgumentNullException(nameof(files)); - } - - /// - /// Initializes a new instance of the class. - /// - public UploadDatasetAssetsRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.UploadDatasetAssetsResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.UploadDatasetAssetsResponse.Json.g.cs deleted file mode 100644 index 9895dd41..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.UploadDatasetAssetsResponse.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class UploadDatasetAssetsResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.UploadDatasetAssetsResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.UploadDatasetAssetsResponse), - jsonSerializerContext) as global::Ideogram.UploadDatasetAssetsResponse; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.UploadDatasetAssetsResponse? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.UploadDatasetAssetsResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.UploadDatasetAssetsResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.UploadDatasetAssetsResponse; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.UploadDatasetAssetsResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.UploadDatasetAssetsResponse.g.cs deleted file mode 100644 index 49e92e0a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.UploadDatasetAssetsResponse.g.cs +++ /dev/null @@ -1,97 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"successful_assets":[{"asset_identifier":"","file_name":"file_name"},{"asset_identifier":"","file_name":"file_name"}],"total_count":0,"failed_assets":[{"file_name":"file_name","failure_reason":null},{"file_name":"file_name","failure_reason":null}],"success_count":6,"failure_count":1} - /// - public sealed partial class UploadDatasetAssetsResponse - { - /// - /// Total number of images processed. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("total_count")] - [global::System.Text.Json.Serialization.JsonRequired] - public required int TotalCount { get; set; } - - /// - /// Number of images successfully uploaded. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("success_count")] - [global::System.Text.Json.Serialization.JsonRequired] - public required int SuccessCount { get; set; } - - /// - /// Number of images that failed to upload. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("failure_count")] - [global::System.Text.Json.Serialization.JsonRequired] - public required int FailureCount { get; set; } - - /// - /// Details of successfully uploaded assets.
- /// Default Value: [] - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("successful_assets")] - public global::System.Collections.Generic.IList? SuccessfulAssets { get; set; } - - /// - /// Details of assets that failed to upload.
- /// Default Value: [] - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("failed_assets")] - public global::System.Collections.Generic.IList? FailedAssets { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Total number of images processed. - /// - /// - /// Number of images successfully uploaded. - /// - /// - /// Number of images that failed to upload. - /// - /// - /// Details of successfully uploaded assets.
- /// Default Value: [] - /// - /// - /// Details of assets that failed to upload.
- /// Default Value: [] - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public UploadDatasetAssetsResponse( - int totalCount, - int successCount, - int failureCount, - global::System.Collections.Generic.IList? successfulAssets, - global::System.Collections.Generic.IList? failedAssets) - { - this.TotalCount = totalCount; - this.SuccessCount = successCount; - this.FailureCount = failureCount; - this.SuccessfulAssets = successfulAssets; - this.FailedAssets = failedAssets; - } - - /// - /// Initializes a new instance of the class. - /// - public UploadDatasetAssetsResponse() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleFactor.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleFactor.g.cs deleted file mode 100644 index b177a575..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleFactor.g.cs +++ /dev/null @@ -1,59 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Upscale the initially generated image by the given factor. Upscale factors other than X1 will incur additional cost.
- /// Default Value: X1
- /// Example: X2 - ///
- public enum UpscaleFactor - { - /// - /// - /// - X1, - /// - /// - /// - X2, - /// - /// - /// - X4, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class UpscaleFactorExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this UpscaleFactor value) - { - return value switch - { - UpscaleFactor.X1 => "X1", - UpscaleFactor.X2 => "X2", - UpscaleFactor.X4 => "X4", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static UpscaleFactor? ToEnum(string value) - { - return value switch - { - "X1" => UpscaleFactor.X1, - "X2" => UpscaleFactor.X2, - "X4" => UpscaleFactor.X4, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageNanoBananaProRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageNanoBananaProRequest.Json.g.cs deleted file mode 100644 index 4ee23fa2..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageNanoBananaProRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class UpscaleImageNanoBananaProRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.UpscaleImageNanoBananaProRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.UpscaleImageNanoBananaProRequest), - jsonSerializerContext) as global::Ideogram.UpscaleImageNanoBananaProRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.UpscaleImageNanoBananaProRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.UpscaleImageNanoBananaProRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.UpscaleImageNanoBananaProRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.UpscaleImageNanoBananaProRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageNanoBananaProRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageNanoBananaProRequest.g.cs deleted file mode 100644 index dabce5ef..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageNanoBananaProRequest.g.cs +++ /dev/null @@ -1,173 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Upload the source `image` using `multipart/form-data`. - /// - public sealed partial class UpscaleImageNanoBananaProRequest - { - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - ///
- /// {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - [global::System.Text.Json.Serialization.JsonPropertyName("image_asset_identifier")] - public global::Ideogram.AssetIdentifier? ImageAssetIdentifier { get; set; } - - /// - /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image")] - public byte[]? Image { get; set; } - - /// - /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] - public string? Imagename { get; set; } - - /// - /// Optional short guidance for the enhancement, appended to the model's upscaling instruction. When omitted, the image is upscaled as-is. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - public string? Prompt { get; set; } - - /// - /// The output resolution tier. The model sizes its output by tier at the source image's aspect ratio; exact pixel dimensions cannot be requested. Rejected when the source is already at or above the requested tier. Defaults to "2K".
- /// Default Value: 2K - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("resolution_tier")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.UpscaleImageNanoBananaProRequestResolutionTierJsonConverter))] - public global::Ideogram.UpscaleImageNanoBananaProRequestResolutionTier? ResolutionTier { get; set; } - - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - ///
- /// 12345 - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
- /// Default Value: false - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("async")] - public bool? Async { get; set; } - - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - ///
- /// https://api.example.com/webhooks/ideogram - [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] - public string? WebhookUrl { get; set; } - - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("target_collection_id")] - public string? TargetCollectionId { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - /// - /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - /// - /// Optional short guidance for the enhancement, appended to the model's upscaling instruction. When omitted, the image is upscaled as-is. - /// - /// - /// The output resolution tier. The model sizes its output by tier at the source image's aspect ratio; exact pixel dimensions cannot be requested. Rejected when the source is already at or above the requested tier. Defaults to "2K".
- /// Default Value: 2K - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public UpscaleImageNanoBananaProRequest( - global::Ideogram.AssetIdentifier? imageAssetIdentifier, - byte[]? image, - string? imagename, - string? prompt, - global::Ideogram.UpscaleImageNanoBananaProRequestResolutionTier? resolutionTier, - int? seed, - bool? async, - string? webhookUrl, - bool? @private, - string? targetCollectionId) - { - this.ImageAssetIdentifier = imageAssetIdentifier; - this.Image = image; - this.Imagename = imagename; - this.Prompt = prompt; - this.ResolutionTier = resolutionTier; - this.Seed = seed; - this.Async = async; - this.WebhookUrl = webhookUrl; - this.Private = @private; - this.TargetCollectionId = targetCollectionId; - } - - /// - /// Initializes a new instance of the class. - /// - public UpscaleImageNanoBananaProRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageNanoBananaProRequestResolutionTier.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageNanoBananaProRequestResolutionTier.g.cs deleted file mode 100644 index 9df293fe..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageNanoBananaProRequestResolutionTier.g.cs +++ /dev/null @@ -1,58 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The output resolution tier. The model sizes its output by tier at the source image's aspect ratio; exact pixel dimensions cannot be requested. Rejected when the source is already at or above the requested tier. Defaults to "2K".
- /// Default Value: 2K - ///
- public enum UpscaleImageNanoBananaProRequestResolutionTier - { - /// - /// - /// - x1k, - /// - /// - /// - x2k, - /// - /// - /// - x4k, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class UpscaleImageNanoBananaProRequestResolutionTierExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this UpscaleImageNanoBananaProRequestResolutionTier value) - { - return value switch - { - UpscaleImageNanoBananaProRequestResolutionTier.x1k => "1K", - UpscaleImageNanoBananaProRequestResolutionTier.x2k => "2K", - UpscaleImageNanoBananaProRequestResolutionTier.x4k => "4K", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static UpscaleImageNanoBananaProRequestResolutionTier? ToEnum(string value) - { - return value switch - { - "1K" => UpscaleImageNanoBananaProRequestResolutionTier.x1k, - "2K" => UpscaleImageNanoBananaProRequestResolutionTier.x2k, - "4K" => UpscaleImageNanoBananaProRequestResolutionTier.x4k, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageNanoBananaProResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageNanoBananaProResponse.g.cs index f383a790..0ce201fc 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageNanoBananaProResponse.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageNanoBananaProResponse.g.cs @@ -7,8 +7,7 @@ namespace Ideogram /// Synchronous requests (the default) include the upscaled image in `data`.
/// Async requests omit `data`; poll `GET /v2/generations/{generation_id}`
/// with the returned `generation_id`. `seed` is the seed actually used,
- /// and `width` and `height` are the output dimensions.
- /// Example: {"data":[{"seed":12345,"resolution":"2048x2048","url":"https://openapi-generator.tech","is_image_safe":true},{"seed":12345,"resolution":"2048x2048","url":"https://openapi-generator.tech","is_image_safe":true}],"seed":12345,"generation_id":"generation_id","width":0,"height":6} + /// and `width` and `height` are the output dimensions. /// public sealed partial class UpscaleImageNanoBananaProResponse { @@ -26,10 +25,8 @@ public sealed partial class UpscaleImageNanoBananaProResponse public global::System.Collections.Generic.IList? Data { get; set; } /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. ///
- /// 12345 [global::System.Text.Json.Serialization.JsonPropertyName("seed")] [global::System.Text.Json.Serialization.JsonRequired] public required int Seed { get; set; } @@ -61,8 +58,7 @@ public sealed partial class UpscaleImageNanoBananaProResponse /// The generation ID to poll with `GET /v2/generations/{generation_id}`. /// /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. /// /// /// The output width in pixels. diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageObject.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageObject.g.cs index cd88a715..75b7949f 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageObject.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageObject.g.cs @@ -4,8 +4,7 @@ namespace Ideogram { /// - /// One upscaled output image.
- /// Example: {"seed":12345,"resolution":"2048x2048","url":"https://openapi-generator.tech","is_image_safe":true} + /// One upscaled output image. ///
public sealed partial class UpscaleImageObject { @@ -16,10 +15,8 @@ public sealed partial class UpscaleImageObject public string? Url { get; set; } /// - /// The resolution of the upscaled image, formatted as "WIDTHxHEIGHT".
- /// Example: 2048x2048 + /// The resolution of the upscaled image, formatted as "WIDTHxHEIGHT". ///
- /// 2048x2048 [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] [global::System.Text.Json.Serialization.JsonRequired] public required string Resolution { get; set; } @@ -32,10 +29,8 @@ public sealed partial class UpscaleImageObject public required bool IsImageSafe { get; set; } /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. ///
- /// 12345 [global::System.Text.Json.Serialization.JsonPropertyName("seed")] [global::System.Text.Json.Serialization.JsonRequired] public required int Seed { get; set; } @@ -50,15 +45,13 @@ public sealed partial class UpscaleImageObject /// Initializes a new instance of the class. /// /// - /// The resolution of the upscaled image, formatted as "WIDTHxHEIGHT".
- /// Example: 2048x2048 + /// The resolution of the upscaled image, formatted as "WIDTHxHEIGHT". /// /// /// Whether the image passed safety checks. If false, `url` is empty. /// /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. /// /// /// The direct link to the upscaled image. Empty when the image did not pass safety checks. diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageRequest.Json.g.cs deleted file mode 100644 index 431d3b83..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class UpscaleImageRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.UpscaleImageRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.UpscaleImageRequest), - jsonSerializerContext) as global::Ideogram.UpscaleImageRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.UpscaleImageRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.UpscaleImageRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.UpscaleImageRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.UpscaleImageRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageRequest.g.cs deleted file mode 100644 index bbd50130..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageRequest.g.cs +++ /dev/null @@ -1,71 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - public sealed partial class UpscaleImageRequest - { - /// - /// A request to upscale a provided image with the help of an optional prompt. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image_request")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Ideogram.UpscaleInitialImageRequest ImageRequest { get; set; } - - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image_file")] - [global::System.Text.Json.Serialization.JsonRequired] - public required byte[] ImageFile { get; set; } - - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image_filename")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string ImageFilename { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// A request to upscale a provided image with the help of an optional prompt. - /// - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public UpscaleImageRequest( - global::Ideogram.UpscaleInitialImageRequest imageRequest, - byte[] imageFile, - string imageFilename) - { - this.ImageRequest = imageRequest ?? throw new global::System.ArgumentNullException(nameof(imageRequest)); - this.ImageFile = imageFile ?? throw new global::System.ArgumentNullException(nameof(imageFile)); - this.ImageFilename = imageFilename ?? throw new global::System.ArgumentNullException(nameof(imageFilename)); - } - - /// - /// Initializes a new instance of the class. - /// - public UpscaleImageRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazBloom2Request.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazBloom2Request.Json.g.cs deleted file mode 100644 index b91323aa..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazBloom2Request.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class UpscaleImageTopazBloom2Request - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.UpscaleImageTopazBloom2Request? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.UpscaleImageTopazBloom2Request), - jsonSerializerContext) as global::Ideogram.UpscaleImageTopazBloom2Request; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.UpscaleImageTopazBloom2Request? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.UpscaleImageTopazBloom2Request? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.UpscaleImageTopazBloom2Request), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.UpscaleImageTopazBloom2Request; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazBloom2Request.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazBloom2Request.g.cs deleted file mode 100644 index 4135a74a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazBloom2Request.g.cs +++ /dev/null @@ -1,199 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Upload the source `image` using `multipart/form-data`. - /// - public sealed partial class UpscaleImageTopazBloom2Request - { - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - ///
- /// {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - [global::System.Text.Json.Serialization.JsonPropertyName("image_asset_identifier")] - public global::Ideogram.AssetIdentifier? ImageAssetIdentifier { get; set; } - - /// - /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image")] - public byte[]? Image { get; set; } - - /// - /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] - public string? Imagename { get; set; } - - /// - /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
- /// Default Value: x2 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("upscale_factor")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.UpscaleImageTopazBloom2RequestUpscaleFactorJsonConverter))] - public global::Ideogram.UpscaleImageTopazBloom2RequestUpscaleFactor? UpscaleFactor { get; set; } - - /// - /// An optional prompt guiding the detail the model regenerates while enlarging the image. Leave empty to enhance the source image as-is. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - public string? Prompt { get; set; } - - /// - /// How strongly the model reinterprets the source while enlarging it, from 1 (most faithful) to 9 (most creative).
- /// Default Value: 3 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("creativity")] - public int? Creativity { get; set; } - - /// - /// When true (the default), the output keeps the source image's colors. Set to false to let the model adjust colors while enhancing.
- /// Default Value: true - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("color_preservation")] - public bool? ColorPreservation { get; set; } - - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - ///
- /// 12345 - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
- /// Default Value: false - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("async")] - public bool? Async { get; set; } - - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - ///
- /// https://api.example.com/webhooks/ideogram - [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] - public string? WebhookUrl { get; set; } - - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("target_collection_id")] - public string? TargetCollectionId { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - /// - /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - /// - /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
- /// Default Value: x2 - /// - /// - /// An optional prompt guiding the detail the model regenerates while enlarging the image. Leave empty to enhance the source image as-is. - /// - /// - /// How strongly the model reinterprets the source while enlarging it, from 1 (most faithful) to 9 (most creative).
- /// Default Value: 3 - /// - /// - /// When true (the default), the output keeps the source image's colors. Set to false to let the model adjust colors while enhancing.
- /// Default Value: true - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public UpscaleImageTopazBloom2Request( - global::Ideogram.AssetIdentifier? imageAssetIdentifier, - byte[]? image, - string? imagename, - global::Ideogram.UpscaleImageTopazBloom2RequestUpscaleFactor? upscaleFactor, - string? prompt, - int? creativity, - bool? colorPreservation, - int? seed, - bool? async, - string? webhookUrl, - bool? @private, - string? targetCollectionId) - { - this.ImageAssetIdentifier = imageAssetIdentifier; - this.Image = image; - this.Imagename = imagename; - this.UpscaleFactor = upscaleFactor; - this.Prompt = prompt; - this.Creativity = creativity; - this.ColorPreservation = colorPreservation; - this.Seed = seed; - this.Async = async; - this.WebhookUrl = webhookUrl; - this.Private = @private; - this.TargetCollectionId = targetCollectionId; - } - - /// - /// Initializes a new instance of the class. - /// - public UpscaleImageTopazBloom2Request() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazBloom2RequestUpscaleFactor.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazBloom2RequestUpscaleFactor.g.cs deleted file mode 100644 index 44fff468..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazBloom2RequestUpscaleFactor.g.cs +++ /dev/null @@ -1,58 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
- /// Default Value: x2 - ///
- public enum UpscaleImageTopazBloom2RequestUpscaleFactor - { - /// - /// - /// - X2, - /// - /// - /// - X4, - /// - /// - /// - X8, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class UpscaleImageTopazBloom2RequestUpscaleFactorExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this UpscaleImageTopazBloom2RequestUpscaleFactor value) - { - return value switch - { - UpscaleImageTopazBloom2RequestUpscaleFactor.X2 => "x2", - UpscaleImageTopazBloom2RequestUpscaleFactor.X4 => "x4", - UpscaleImageTopazBloom2RequestUpscaleFactor.X8 => "x8", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static UpscaleImageTopazBloom2RequestUpscaleFactor? ToEnum(string value) - { - return value switch - { - "x2" => UpscaleImageTopazBloom2RequestUpscaleFactor.X2, - "x4" => UpscaleImageTopazBloom2RequestUpscaleFactor.X4, - "x8" => UpscaleImageTopazBloom2RequestUpscaleFactor.X8, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazBloom2Response.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazBloom2Response.g.cs index 12618972..e828ba2c 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazBloom2Response.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazBloom2Response.g.cs @@ -7,8 +7,7 @@ namespace Ideogram /// Synchronous requests (the default) include the upscaled image in `data`.
/// Async requests omit `data`; poll `GET /v2/generations/{generation_id}`
/// with the returned `generation_id`. `seed` is the seed actually used,
- /// and `width` and `height` are the output dimensions.
- /// Example: {"data":[{"seed":12345,"resolution":"2048x2048","url":"https://openapi-generator.tech","is_image_safe":true},{"seed":12345,"resolution":"2048x2048","url":"https://openapi-generator.tech","is_image_safe":true}],"seed":12345,"generation_id":"generation_id","width":0,"height":6} + /// and `width` and `height` are the output dimensions. /// public sealed partial class UpscaleImageTopazBloom2Response { @@ -26,10 +25,8 @@ public sealed partial class UpscaleImageTopazBloom2Response public global::System.Collections.Generic.IList? Data { get; set; } /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. ///
- /// 12345 [global::System.Text.Json.Serialization.JsonPropertyName("seed")] [global::System.Text.Json.Serialization.JsonRequired] public required int Seed { get; set; } @@ -61,8 +58,7 @@ public sealed partial class UpscaleImageTopazBloom2Response /// The generation ID to poll with `GET /v2/generations/{generation_id}`. /// /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. /// /// /// The output width in pixels. diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazRedefineRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazRedefineRequest.Json.g.cs deleted file mode 100644 index 4e756154..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazRedefineRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class UpscaleImageTopazRedefineRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.UpscaleImageTopazRedefineRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.UpscaleImageTopazRedefineRequest), - jsonSerializerContext) as global::Ideogram.UpscaleImageTopazRedefineRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.UpscaleImageTopazRedefineRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.UpscaleImageTopazRedefineRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.UpscaleImageTopazRedefineRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.UpscaleImageTopazRedefineRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazRedefineRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazRedefineRequest.g.cs deleted file mode 100644 index 49788b55..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazRedefineRequest.g.cs +++ /dev/null @@ -1,303 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Upload the source `image` using `multipart/form-data`. - /// - public sealed partial class UpscaleImageTopazRedefineRequest - { - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - ///
- /// {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - [global::System.Text.Json.Serialization.JsonPropertyName("image_asset_identifier")] - public global::Ideogram.AssetIdentifier? ImageAssetIdentifier { get; set; } - - /// - /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image")] - public byte[]? Image { get; set; } - - /// - /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] - public string? Imagename { get; set; } - - /// - /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
- /// Default Value: x2 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("upscale_factor")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.UpscaleImageTopazRedefineRequestUpscaleFactorJsonConverter))] - public global::Ideogram.UpscaleImageTopazRedefineRequestUpscaleFactor? UpscaleFactor { get; set; } - - /// - /// An optional prompt guiding the detail the model regenerates while enlarging the image. Leave empty to enhance the source image as-is. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - public string? Prompt { get; set; } - - /// - /// How strongly the model reinterprets the source while enlarging it, from 1 (most faithful) to 9 (most creative).
- /// Default Value: 3 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("creativity")] - public int? Creativity { get; set; } - - /// - /// When true, the model describes the image itself and any `prompt` is ignored.
- /// Default Value: false - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("autoprompt")] - public bool? Autoprompt { get; set; } - - /// - /// How much fine texture the model adds, from 1 to 5. Keep it low at low creativity.
- /// Default Value: 1 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("texture")] - public int? Texture { get; set; } - - /// - /// Apply a detail adjustment after rendering. When true, `detail_strength` sets how much.
- /// Default Value: false - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("detail")] - public bool? Detail { get; set; } - - /// - /// Detail adjustment intensity, from 0 to 10. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("detail_strength")] - public float? DetailStrength { get; set; } - - /// - /// Edge sharpening applied after enlarging, from 0 to 1. Omit to let the model choose per image. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("sharpen")] - public float? Sharpen { get; set; } - - /// - /// Noise and grain reduction, from 0 to 1. Omit to let the model choose per image. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("denoise")] - public float? Denoise { get; set; } - - /// - /// Recover detail in faces. When true, `face_enhancement_strength` and `face_enhancement_creativity` are required. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("face_enhancement")] - public bool? FaceEnhancement { get; set; } - - /// - /// How strongly faces are recovered, from 0 to 1. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("face_enhancement_strength")] - public float? FaceEnhancementStrength { get; set; } - - /// - /// How freely face recovery may reinterpret features, from 0 (faithful) to 1 (creative). - /// - [global::System.Text.Json.Serialization.JsonPropertyName("face_enhancement_creativity")] - public float? FaceEnhancementCreativity { get; set; } - - /// - /// Where enhancements apply. Omit to let the model choose per image. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("subject_detection")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.UpscaleImageTopazRedefineRequestSubjectDetectionJsonConverter))] - public global::Ideogram.UpscaleImageTopazRedefineRequestSubjectDetection? SubjectDetection { get; set; } - - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - ///
- /// 12345 - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
- /// Default Value: false - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("async")] - public bool? Async { get; set; } - - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - ///
- /// https://api.example.com/webhooks/ideogram - [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] - public string? WebhookUrl { get; set; } - - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("target_collection_id")] - public string? TargetCollectionId { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - /// - /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - /// - /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
- /// Default Value: x2 - /// - /// - /// An optional prompt guiding the detail the model regenerates while enlarging the image. Leave empty to enhance the source image as-is. - /// - /// - /// How strongly the model reinterprets the source while enlarging it, from 1 (most faithful) to 9 (most creative).
- /// Default Value: 3 - /// - /// - /// When true, the model describes the image itself and any `prompt` is ignored.
- /// Default Value: false - /// - /// - /// How much fine texture the model adds, from 1 to 5. Keep it low at low creativity.
- /// Default Value: 1 - /// - /// - /// Apply a detail adjustment after rendering. When true, `detail_strength` sets how much.
- /// Default Value: false - /// - /// - /// Detail adjustment intensity, from 0 to 10. - /// - /// - /// Edge sharpening applied after enlarging, from 0 to 1. Omit to let the model choose per image. - /// - /// - /// Noise and grain reduction, from 0 to 1. Omit to let the model choose per image. - /// - /// - /// Recover detail in faces. When true, `face_enhancement_strength` and `face_enhancement_creativity` are required. - /// - /// - /// How strongly faces are recovered, from 0 to 1. - /// - /// - /// How freely face recovery may reinterpret features, from 0 (faithful) to 1 (creative). - /// - /// - /// Where enhancements apply. Omit to let the model choose per image. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public UpscaleImageTopazRedefineRequest( - global::Ideogram.AssetIdentifier? imageAssetIdentifier, - byte[]? image, - string? imagename, - global::Ideogram.UpscaleImageTopazRedefineRequestUpscaleFactor? upscaleFactor, - string? prompt, - int? creativity, - bool? autoprompt, - int? texture, - bool? detail, - float? detailStrength, - float? sharpen, - float? denoise, - bool? faceEnhancement, - float? faceEnhancementStrength, - float? faceEnhancementCreativity, - global::Ideogram.UpscaleImageTopazRedefineRequestSubjectDetection? subjectDetection, - int? seed, - bool? async, - string? webhookUrl, - bool? @private, - string? targetCollectionId) - { - this.ImageAssetIdentifier = imageAssetIdentifier; - this.Image = image; - this.Imagename = imagename; - this.UpscaleFactor = upscaleFactor; - this.Prompt = prompt; - this.Creativity = creativity; - this.Autoprompt = autoprompt; - this.Texture = texture; - this.Detail = detail; - this.DetailStrength = detailStrength; - this.Sharpen = sharpen; - this.Denoise = denoise; - this.FaceEnhancement = faceEnhancement; - this.FaceEnhancementStrength = faceEnhancementStrength; - this.FaceEnhancementCreativity = faceEnhancementCreativity; - this.SubjectDetection = subjectDetection; - this.Seed = seed; - this.Async = async; - this.WebhookUrl = webhookUrl; - this.Private = @private; - this.TargetCollectionId = targetCollectionId; - } - - /// - /// Initializes a new instance of the class. - /// - public UpscaleImageTopazRedefineRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazRedefineRequestSubjectDetection.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazRedefineRequestSubjectDetection.g.cs deleted file mode 100644 index d21fc870..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazRedefineRequestSubjectDetection.g.cs +++ /dev/null @@ -1,57 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Where enhancements apply. Omit to let the model choose per image. - /// - public enum UpscaleImageTopazRedefineRequestSubjectDetection - { - /// - /// - /// - All, - /// - /// - /// - Background, - /// - /// - /// - Foreground, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class UpscaleImageTopazRedefineRequestSubjectDetectionExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this UpscaleImageTopazRedefineRequestSubjectDetection value) - { - return value switch - { - UpscaleImageTopazRedefineRequestSubjectDetection.All => "all", - UpscaleImageTopazRedefineRequestSubjectDetection.Background => "background", - UpscaleImageTopazRedefineRequestSubjectDetection.Foreground => "foreground", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static UpscaleImageTopazRedefineRequestSubjectDetection? ToEnum(string value) - { - return value switch - { - "all" => UpscaleImageTopazRedefineRequestSubjectDetection.All, - "background" => UpscaleImageTopazRedefineRequestSubjectDetection.Background, - "foreground" => UpscaleImageTopazRedefineRequestSubjectDetection.Foreground, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazRedefineRequestUpscaleFactor.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazRedefineRequestUpscaleFactor.g.cs deleted file mode 100644 index 160865b5..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazRedefineRequestUpscaleFactor.g.cs +++ /dev/null @@ -1,58 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
- /// Default Value: x2 - ///
- public enum UpscaleImageTopazRedefineRequestUpscaleFactor - { - /// - /// - /// - X2, - /// - /// - /// - X4, - /// - /// - /// - X8, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class UpscaleImageTopazRedefineRequestUpscaleFactorExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this UpscaleImageTopazRedefineRequestUpscaleFactor value) - { - return value switch - { - UpscaleImageTopazRedefineRequestUpscaleFactor.X2 => "x2", - UpscaleImageTopazRedefineRequestUpscaleFactor.X4 => "x4", - UpscaleImageTopazRedefineRequestUpscaleFactor.X8 => "x8", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static UpscaleImageTopazRedefineRequestUpscaleFactor? ToEnum(string value) - { - return value switch - { - "x2" => UpscaleImageTopazRedefineRequestUpscaleFactor.X2, - "x4" => UpscaleImageTopazRedefineRequestUpscaleFactor.X4, - "x8" => UpscaleImageTopazRedefineRequestUpscaleFactor.X8, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazRedefineResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazRedefineResponse.g.cs index 5805b3b1..f5ec8ab7 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazRedefineResponse.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazRedefineResponse.g.cs @@ -7,8 +7,7 @@ namespace Ideogram /// Synchronous requests (the default) include the upscaled image in `data`.
/// Async requests omit `data`; poll `GET /v2/generations/{generation_id}`
/// with the returned `generation_id`. `seed` is the seed actually used,
- /// and `width` and `height` are the output dimensions.
- /// Example: {"data":[{"seed":12345,"resolution":"2048x2048","url":"https://openapi-generator.tech","is_image_safe":true},{"seed":12345,"resolution":"2048x2048","url":"https://openapi-generator.tech","is_image_safe":true}],"seed":12345,"generation_id":"generation_id","width":0,"height":6} + /// and `width` and `height` are the output dimensions. /// public sealed partial class UpscaleImageTopazRedefineResponse { @@ -26,10 +25,8 @@ public sealed partial class UpscaleImageTopazRedefineResponse public global::System.Collections.Generic.IList? Data { get; set; } /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. ///
- /// 12345 [global::System.Text.Json.Serialization.JsonPropertyName("seed")] [global::System.Text.Json.Serialization.JsonRequired] public required int Seed { get; set; } @@ -61,8 +58,7 @@ public sealed partial class UpscaleImageTopazRedefineResponse /// The generation ID to poll with `GET /v2/generations/{generation_id}`. /// /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. /// /// /// The output width in pixels. diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazStandardV2Request.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazStandardV2Request.Json.g.cs deleted file mode 100644 index 4a0b0e5b..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazStandardV2Request.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class UpscaleImageTopazStandardV2Request - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.UpscaleImageTopazStandardV2Request? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.UpscaleImageTopazStandardV2Request), - jsonSerializerContext) as global::Ideogram.UpscaleImageTopazStandardV2Request; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.UpscaleImageTopazStandardV2Request? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.UpscaleImageTopazStandardV2Request? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.UpscaleImageTopazStandardV2Request), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.UpscaleImageTopazStandardV2Request; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazStandardV2Request.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazStandardV2Request.g.cs deleted file mode 100644 index 9f0a1183..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazStandardV2Request.g.cs +++ /dev/null @@ -1,237 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Upload the source `image` using `multipart/form-data`. - /// - public sealed partial class UpscaleImageTopazStandardV2Request - { - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - ///
- /// {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - [global::System.Text.Json.Serialization.JsonPropertyName("image_asset_identifier")] - public global::Ideogram.AssetIdentifier? ImageAssetIdentifier { get; set; } - - /// - /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image")] - public byte[]? Image { get; set; } - - /// - /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] - public string? Imagename { get; set; } - - /// - /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
- /// Default Value: x2 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("upscale_factor")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.UpscaleImageTopazStandardV2RequestUpscaleFactorJsonConverter))] - public global::Ideogram.UpscaleImageTopazStandardV2RequestUpscaleFactor? UpscaleFactor { get; set; } - - /// - /// Overall intensity of the enhancement model, from 0.01 to 1. Higher values look crisper but can turn unrealistic. Omit to let the model choose per image. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("strength")] - public float? Strength { get; set; } - - /// - /// Edge sharpening applied after enlarging, from 0 to 1. Omit to let the model choose per image. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("sharpen")] - public float? Sharpen { get; set; } - - /// - /// Noise and grain reduction, from 0 to 1. Omit to let the model choose per image. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("denoise")] - public float? Denoise { get; set; } - - /// - /// Compression artifact removal, from 0 to 1. Omit to let the model choose per image. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("fix_compression")] - public float? FixCompression { get; set; } - - /// - /// Recover detail in faces. When true, `face_enhancement_strength` and `face_enhancement_creativity` are required. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("face_enhancement")] - public bool? FaceEnhancement { get; set; } - - /// - /// How strongly faces are recovered, from 0 to 1. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("face_enhancement_strength")] - public float? FaceEnhancementStrength { get; set; } - - /// - /// How freely face recovery may reinterpret features, from 0 (faithful) to 1 (creative). - /// - [global::System.Text.Json.Serialization.JsonPropertyName("face_enhancement_creativity")] - public float? FaceEnhancementCreativity { get; set; } - - /// - /// Where enhancements apply. Omit to let the model choose per image. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("subject_detection")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.UpscaleImageTopazStandardV2RequestSubjectDetectionJsonConverter))] - public global::Ideogram.UpscaleImageTopazStandardV2RequestSubjectDetection? SubjectDetection { get; set; } - - /// - /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
- /// Default Value: false - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("async")] - public bool? Async { get; set; } - - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - ///
- /// https://api.example.com/webhooks/ideogram - [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] - public string? WebhookUrl { get; set; } - - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("target_collection_id")] - public string? TargetCollectionId { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - /// - /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - /// - /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
- /// Default Value: x2 - /// - /// - /// Overall intensity of the enhancement model, from 0.01 to 1. Higher values look crisper but can turn unrealistic. Omit to let the model choose per image. - /// - /// - /// Edge sharpening applied after enlarging, from 0 to 1. Omit to let the model choose per image. - /// - /// - /// Noise and grain reduction, from 0 to 1. Omit to let the model choose per image. - /// - /// - /// Compression artifact removal, from 0 to 1. Omit to let the model choose per image. - /// - /// - /// Recover detail in faces. When true, `face_enhancement_strength` and `face_enhancement_creativity` are required. - /// - /// - /// How strongly faces are recovered, from 0 to 1. - /// - /// - /// How freely face recovery may reinterpret features, from 0 (faithful) to 1 (creative). - /// - /// - /// Where enhancements apply. Omit to let the model choose per image. - /// - /// - /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public UpscaleImageTopazStandardV2Request( - global::Ideogram.AssetIdentifier? imageAssetIdentifier, - byte[]? image, - string? imagename, - global::Ideogram.UpscaleImageTopazStandardV2RequestUpscaleFactor? upscaleFactor, - float? strength, - float? sharpen, - float? denoise, - float? fixCompression, - bool? faceEnhancement, - float? faceEnhancementStrength, - float? faceEnhancementCreativity, - global::Ideogram.UpscaleImageTopazStandardV2RequestSubjectDetection? subjectDetection, - bool? async, - string? webhookUrl, - bool? @private, - string? targetCollectionId) - { - this.ImageAssetIdentifier = imageAssetIdentifier; - this.Image = image; - this.Imagename = imagename; - this.UpscaleFactor = upscaleFactor; - this.Strength = strength; - this.Sharpen = sharpen; - this.Denoise = denoise; - this.FixCompression = fixCompression; - this.FaceEnhancement = faceEnhancement; - this.FaceEnhancementStrength = faceEnhancementStrength; - this.FaceEnhancementCreativity = faceEnhancementCreativity; - this.SubjectDetection = subjectDetection; - this.Async = async; - this.WebhookUrl = webhookUrl; - this.Private = @private; - this.TargetCollectionId = targetCollectionId; - } - - /// - /// Initializes a new instance of the class. - /// - public UpscaleImageTopazStandardV2Request() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazStandardV2RequestSubjectDetection.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazStandardV2RequestSubjectDetection.g.cs deleted file mode 100644 index 758c6b1d..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazStandardV2RequestSubjectDetection.g.cs +++ /dev/null @@ -1,57 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Where enhancements apply. Omit to let the model choose per image. - /// - public enum UpscaleImageTopazStandardV2RequestSubjectDetection - { - /// - /// - /// - All, - /// - /// - /// - Background, - /// - /// - /// - Foreground, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class UpscaleImageTopazStandardV2RequestSubjectDetectionExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this UpscaleImageTopazStandardV2RequestSubjectDetection value) - { - return value switch - { - UpscaleImageTopazStandardV2RequestSubjectDetection.All => "all", - UpscaleImageTopazStandardV2RequestSubjectDetection.Background => "background", - UpscaleImageTopazStandardV2RequestSubjectDetection.Foreground => "foreground", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static UpscaleImageTopazStandardV2RequestSubjectDetection? ToEnum(string value) - { - return value switch - { - "all" => UpscaleImageTopazStandardV2RequestSubjectDetection.All, - "background" => UpscaleImageTopazStandardV2RequestSubjectDetection.Background, - "foreground" => UpscaleImageTopazStandardV2RequestSubjectDetection.Foreground, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazStandardV2RequestUpscaleFactor.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazStandardV2RequestUpscaleFactor.g.cs deleted file mode 100644 index 4f326974..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazStandardV2RequestUpscaleFactor.g.cs +++ /dev/null @@ -1,58 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
- /// Default Value: x2 - ///
- public enum UpscaleImageTopazStandardV2RequestUpscaleFactor - { - /// - /// - /// - X2, - /// - /// - /// - X4, - /// - /// - /// - X8, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class UpscaleImageTopazStandardV2RequestUpscaleFactorExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this UpscaleImageTopazStandardV2RequestUpscaleFactor value) - { - return value switch - { - UpscaleImageTopazStandardV2RequestUpscaleFactor.X2 => "x2", - UpscaleImageTopazStandardV2RequestUpscaleFactor.X4 => "x4", - UpscaleImageTopazStandardV2RequestUpscaleFactor.X8 => "x8", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static UpscaleImageTopazStandardV2RequestUpscaleFactor? ToEnum(string value) - { - return value switch - { - "x2" => UpscaleImageTopazStandardV2RequestUpscaleFactor.X2, - "x4" => UpscaleImageTopazStandardV2RequestUpscaleFactor.X4, - "x8" => UpscaleImageTopazStandardV2RequestUpscaleFactor.X8, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazStandardV2Response.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazStandardV2Response.g.cs index 9f566d37..64bfe01f 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazStandardV2Response.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazStandardV2Response.g.cs @@ -7,8 +7,7 @@ namespace Ideogram /// Synchronous requests (the default) include the upscaled image in `data`.
/// Async requests omit `data`; poll `GET /v2/generations/{generation_id}`
/// with the returned `generation_id`. `seed` is the seed actually used,
- /// and `width` and `height` are the output dimensions.
- /// Example: {"data":[{"seed":12345,"resolution":"2048x2048","url":"https://openapi-generator.tech","is_image_safe":true},{"seed":12345,"resolution":"2048x2048","url":"https://openapi-generator.tech","is_image_safe":true}],"seed":12345,"generation_id":"generation_id","width":0,"height":6} + /// and `width` and `height` are the output dimensions. /// public sealed partial class UpscaleImageTopazStandardV2Response { @@ -26,10 +25,8 @@ public sealed partial class UpscaleImageTopazStandardV2Response public global::System.Collections.Generic.IList? Data { get; set; } /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. ///
- /// 12345 [global::System.Text.Json.Serialization.JsonPropertyName("seed")] [global::System.Text.Json.Serialization.JsonRequired] public required int Seed { get; set; } @@ -61,8 +58,7 @@ public sealed partial class UpscaleImageTopazStandardV2Response /// The generation ID to poll with `GET /v2/generations/{generation_id}`. /// /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. /// /// /// The output width in pixels. diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazTextRefineRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazTextRefineRequest.Json.g.cs deleted file mode 100644 index 26a814d6..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazTextRefineRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class UpscaleImageTopazTextRefineRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.UpscaleImageTopazTextRefineRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.UpscaleImageTopazTextRefineRequest), - jsonSerializerContext) as global::Ideogram.UpscaleImageTopazTextRefineRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.UpscaleImageTopazTextRefineRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.UpscaleImageTopazTextRefineRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.UpscaleImageTopazTextRefineRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.UpscaleImageTopazTextRefineRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazTextRefineRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazTextRefineRequest.g.cs deleted file mode 100644 index 5f1fc494..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazTextRefineRequest.g.cs +++ /dev/null @@ -1,251 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Upload the source `image` using `multipart/form-data`. - /// - public sealed partial class UpscaleImageTopazTextRefineRequest - { - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - ///
- /// {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - [global::System.Text.Json.Serialization.JsonPropertyName("image_asset_identifier")] - public global::Ideogram.AssetIdentifier? ImageAssetIdentifier { get; set; } - - /// - /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image")] - public byte[]? Image { get; set; } - - /// - /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] - public string? Imagename { get; set; } - - /// - /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
- /// Default Value: x2 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("upscale_factor")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.UpscaleImageTopazTextRefineRequestUpscaleFactorJsonConverter))] - public global::Ideogram.UpscaleImageTopazTextRefineRequestUpscaleFactor? UpscaleFactor { get; set; } - - /// - /// Overall intensity of the enhancement model, from 0.01 to 1. Higher values look crisper but can turn unrealistic. Omit to let the model choose per image. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("strength")] - public float? Strength { get; set; } - - /// - /// Edge sharpening applied after enlarging, from 0 to 1. Omit to let the model choose per image. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("sharpen")] - public float? Sharpen { get; set; } - - /// - /// Noise and grain reduction, from 0 to 1. Omit to let the model choose per image. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("denoise")] - public float? Denoise { get; set; } - - /// - /// Compression artifact removal, from 0 to 1. Omit to let the model choose per image. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("fix_compression")] - public float? FixCompression { get; set; } - - /// - /// Recover detail in faces. When true, `face_enhancement_strength` and `face_enhancement_creativity` are required. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("face_enhancement")] - public bool? FaceEnhancement { get; set; } - - /// - /// How strongly faces are recovered, from 0 to 1. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("face_enhancement_strength")] - public float? FaceEnhancementStrength { get; set; } - - /// - /// How freely face recovery may reinterpret features, from 0 (faithful) to 1 (creative). - /// - [global::System.Text.Json.Serialization.JsonPropertyName("face_enhancement_creativity")] - public float? FaceEnhancementCreativity { get; set; } - - /// - /// Where enhancements apply. Omit to let the model choose per image. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("subject_detection")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.UpscaleImageTopazTextRefineRequestSubjectDetectionJsonConverter))] - public global::Ideogram.UpscaleImageTopazTextRefineRequestSubjectDetection? SubjectDetection { get; set; } - - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - ///
- /// 12345 - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
- /// Default Value: false - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("async")] - public bool? Async { get; set; } - - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - ///
- /// https://api.example.com/webhooks/ideogram - [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] - public string? WebhookUrl { get; set; } - - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("target_collection_id")] - public string? TargetCollectionId { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - /// - /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - /// - /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
- /// Default Value: x2 - /// - /// - /// Overall intensity of the enhancement model, from 0.01 to 1. Higher values look crisper but can turn unrealistic. Omit to let the model choose per image. - /// - /// - /// Edge sharpening applied after enlarging, from 0 to 1. Omit to let the model choose per image. - /// - /// - /// Noise and grain reduction, from 0 to 1. Omit to let the model choose per image. - /// - /// - /// Compression artifact removal, from 0 to 1. Omit to let the model choose per image. - /// - /// - /// Recover detail in faces. When true, `face_enhancement_strength` and `face_enhancement_creativity` are required. - /// - /// - /// How strongly faces are recovered, from 0 to 1. - /// - /// - /// How freely face recovery may reinterpret features, from 0 (faithful) to 1 (creative). - /// - /// - /// Where enhancements apply. Omit to let the model choose per image. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public UpscaleImageTopazTextRefineRequest( - global::Ideogram.AssetIdentifier? imageAssetIdentifier, - byte[]? image, - string? imagename, - global::Ideogram.UpscaleImageTopazTextRefineRequestUpscaleFactor? upscaleFactor, - float? strength, - float? sharpen, - float? denoise, - float? fixCompression, - bool? faceEnhancement, - float? faceEnhancementStrength, - float? faceEnhancementCreativity, - global::Ideogram.UpscaleImageTopazTextRefineRequestSubjectDetection? subjectDetection, - int? seed, - bool? async, - string? webhookUrl, - bool? @private, - string? targetCollectionId) - { - this.ImageAssetIdentifier = imageAssetIdentifier; - this.Image = image; - this.Imagename = imagename; - this.UpscaleFactor = upscaleFactor; - this.Strength = strength; - this.Sharpen = sharpen; - this.Denoise = denoise; - this.FixCompression = fixCompression; - this.FaceEnhancement = faceEnhancement; - this.FaceEnhancementStrength = faceEnhancementStrength; - this.FaceEnhancementCreativity = faceEnhancementCreativity; - this.SubjectDetection = subjectDetection; - this.Seed = seed; - this.Async = async; - this.WebhookUrl = webhookUrl; - this.Private = @private; - this.TargetCollectionId = targetCollectionId; - } - - /// - /// Initializes a new instance of the class. - /// - public UpscaleImageTopazTextRefineRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazTextRefineRequestSubjectDetection.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazTextRefineRequestSubjectDetection.g.cs deleted file mode 100644 index a249b305..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazTextRefineRequestSubjectDetection.g.cs +++ /dev/null @@ -1,57 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Where enhancements apply. Omit to let the model choose per image. - /// - public enum UpscaleImageTopazTextRefineRequestSubjectDetection - { - /// - /// - /// - All, - /// - /// - /// - Background, - /// - /// - /// - Foreground, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class UpscaleImageTopazTextRefineRequestSubjectDetectionExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this UpscaleImageTopazTextRefineRequestSubjectDetection value) - { - return value switch - { - UpscaleImageTopazTextRefineRequestSubjectDetection.All => "all", - UpscaleImageTopazTextRefineRequestSubjectDetection.Background => "background", - UpscaleImageTopazTextRefineRequestSubjectDetection.Foreground => "foreground", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static UpscaleImageTopazTextRefineRequestSubjectDetection? ToEnum(string value) - { - return value switch - { - "all" => UpscaleImageTopazTextRefineRequestSubjectDetection.All, - "background" => UpscaleImageTopazTextRefineRequestSubjectDetection.Background, - "foreground" => UpscaleImageTopazTextRefineRequestSubjectDetection.Foreground, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazTextRefineRequestUpscaleFactor.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazTextRefineRequestUpscaleFactor.g.cs deleted file mode 100644 index 0bd9bed1..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazTextRefineRequestUpscaleFactor.g.cs +++ /dev/null @@ -1,58 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
- /// Default Value: x2 - ///
- public enum UpscaleImageTopazTextRefineRequestUpscaleFactor - { - /// - /// - /// - X2, - /// - /// - /// - X4, - /// - /// - /// - X8, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class UpscaleImageTopazTextRefineRequestUpscaleFactorExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this UpscaleImageTopazTextRefineRequestUpscaleFactor value) - { - return value switch - { - UpscaleImageTopazTextRefineRequestUpscaleFactor.X2 => "x2", - UpscaleImageTopazTextRefineRequestUpscaleFactor.X4 => "x4", - UpscaleImageTopazTextRefineRequestUpscaleFactor.X8 => "x8", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static UpscaleImageTopazTextRefineRequestUpscaleFactor? ToEnum(string value) - { - return value switch - { - "x2" => UpscaleImageTopazTextRefineRequestUpscaleFactor.X2, - "x4" => UpscaleImageTopazTextRefineRequestUpscaleFactor.X4, - "x8" => UpscaleImageTopazTextRefineRequestUpscaleFactor.X8, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazTextRefineResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazTextRefineResponse.g.cs index ee4207ab..2e6a24e9 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazTextRefineResponse.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazTextRefineResponse.g.cs @@ -7,8 +7,7 @@ namespace Ideogram /// Synchronous requests (the default) include the upscaled image in `data`.
/// Async requests omit `data`; poll `GET /v2/generations/{generation_id}`
/// with the returned `generation_id`. `seed` is the seed actually used,
- /// and `width` and `height` are the output dimensions.
- /// Example: {"data":[{"seed":12345,"resolution":"2048x2048","url":"https://openapi-generator.tech","is_image_safe":true},{"seed":12345,"resolution":"2048x2048","url":"https://openapi-generator.tech","is_image_safe":true}],"seed":12345,"generation_id":"generation_id","width":0,"height":6} + /// and `width` and `height` are the output dimensions. /// public sealed partial class UpscaleImageTopazTextRefineResponse { @@ -26,10 +25,8 @@ public sealed partial class UpscaleImageTopazTextRefineResponse public global::System.Collections.Generic.IList? Data { get; set; } /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. ///
- /// 12345 [global::System.Text.Json.Serialization.JsonPropertyName("seed")] [global::System.Text.Json.Serialization.JsonRequired] public required int Seed { get; set; } @@ -61,8 +58,7 @@ public sealed partial class UpscaleImageTopazTextRefineResponse /// The generation ID to poll with `GET /v2/generations/{generation_id}`. /// /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. /// /// /// The output width in pixels. diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazWonder35Request.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazWonder35Request.Json.g.cs deleted file mode 100644 index c8942c1e..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazWonder35Request.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class UpscaleImageTopazWonder35Request - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.UpscaleImageTopazWonder35Request? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.UpscaleImageTopazWonder35Request), - jsonSerializerContext) as global::Ideogram.UpscaleImageTopazWonder35Request; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.UpscaleImageTopazWonder35Request? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.UpscaleImageTopazWonder35Request? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.UpscaleImageTopazWonder35Request), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.UpscaleImageTopazWonder35Request; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazWonder35Request.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazWonder35Request.g.cs deleted file mode 100644 index e60f56d9..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazWonder35Request.g.cs +++ /dev/null @@ -1,176 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Upload the source `image` using `multipart/form-data`. - /// - public sealed partial class UpscaleImageTopazWonder35Request - { - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - ///
- /// {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - [global::System.Text.Json.Serialization.JsonPropertyName("image_asset_identifier")] - public global::Ideogram.AssetIdentifier? ImageAssetIdentifier { get; set; } - - /// - /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image")] - public byte[]? Image { get; set; } - - /// - /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] - public string? Imagename { get; set; } - - /// - /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
- /// Default Value: x2 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("upscale_factor")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.UpscaleImageTopazWonder35RequestUpscaleFactorJsonConverter))] - public global::Ideogram.UpscaleImageTopazWonder35RequestUpscaleFactor? UpscaleFactor { get; set; } - - /// - /// How strongly the generative model reconstructs detail while upscaling. Lower values stay closer to the source image; higher values produce a more enhanced result.
- /// Default Value: high - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("enhancement_strength")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.UpscaleImageTopazWonder35RequestEnhancementStrengthJsonConverter))] - public global::Ideogram.UpscaleImageTopazWonder35RequestEnhancementStrength? EnhancementStrength { get; set; } - - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - ///
- /// 12345 - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
- /// Default Value: false - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("async")] - public bool? Async { get; set; } - - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - ///
- /// https://api.example.com/webhooks/ideogram - [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] - public string? WebhookUrl { get; set; } - - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("target_collection_id")] - public string? TargetCollectionId { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - /// - /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - /// - /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
- /// Default Value: x2 - /// - /// - /// How strongly the generative model reconstructs detail while upscaling. Lower values stay closer to the source image; higher values produce a more enhanced result.
- /// Default Value: high - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public UpscaleImageTopazWonder35Request( - global::Ideogram.AssetIdentifier? imageAssetIdentifier, - byte[]? image, - string? imagename, - global::Ideogram.UpscaleImageTopazWonder35RequestUpscaleFactor? upscaleFactor, - global::Ideogram.UpscaleImageTopazWonder35RequestEnhancementStrength? enhancementStrength, - int? seed, - bool? async, - string? webhookUrl, - bool? @private, - string? targetCollectionId) - { - this.ImageAssetIdentifier = imageAssetIdentifier; - this.Image = image; - this.Imagename = imagename; - this.UpscaleFactor = upscaleFactor; - this.EnhancementStrength = enhancementStrength; - this.Seed = seed; - this.Async = async; - this.WebhookUrl = webhookUrl; - this.Private = @private; - this.TargetCollectionId = targetCollectionId; - } - - /// - /// Initializes a new instance of the class. - /// - public UpscaleImageTopazWonder35Request() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazWonder35RequestEnhancementStrength.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazWonder35RequestEnhancementStrength.g.cs deleted file mode 100644 index 91a1bf68..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazWonder35RequestEnhancementStrength.g.cs +++ /dev/null @@ -1,58 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// How strongly the generative model reconstructs detail while upscaling. Lower values stay closer to the source image; higher values produce a more enhanced result.
- /// Default Value: high - ///
- public enum UpscaleImageTopazWonder35RequestEnhancementStrength - { - /// - /// - /// - High, - /// - /// - /// - Low, - /// - /// - /// - Medium, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class UpscaleImageTopazWonder35RequestEnhancementStrengthExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this UpscaleImageTopazWonder35RequestEnhancementStrength value) - { - return value switch - { - UpscaleImageTopazWonder35RequestEnhancementStrength.High => "high", - UpscaleImageTopazWonder35RequestEnhancementStrength.Low => "low", - UpscaleImageTopazWonder35RequestEnhancementStrength.Medium => "medium", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static UpscaleImageTopazWonder35RequestEnhancementStrength? ToEnum(string value) - { - return value switch - { - "high" => UpscaleImageTopazWonder35RequestEnhancementStrength.High, - "low" => UpscaleImageTopazWonder35RequestEnhancementStrength.Low, - "medium" => UpscaleImageTopazWonder35RequestEnhancementStrength.Medium, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazWonder35RequestUpscaleFactor.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazWonder35RequestUpscaleFactor.g.cs deleted file mode 100644 index 4c14bfcb..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazWonder35RequestUpscaleFactor.g.cs +++ /dev/null @@ -1,58 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
- /// Default Value: x2 - ///
- public enum UpscaleImageTopazWonder35RequestUpscaleFactor - { - /// - /// - /// - X2, - /// - /// - /// - X4, - /// - /// - /// - X8, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class UpscaleImageTopazWonder35RequestUpscaleFactorExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this UpscaleImageTopazWonder35RequestUpscaleFactor value) - { - return value switch - { - UpscaleImageTopazWonder35RequestUpscaleFactor.X2 => "x2", - UpscaleImageTopazWonder35RequestUpscaleFactor.X4 => "x4", - UpscaleImageTopazWonder35RequestUpscaleFactor.X8 => "x8", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static UpscaleImageTopazWonder35RequestUpscaleFactor? ToEnum(string value) - { - return value switch - { - "x2" => UpscaleImageTopazWonder35RequestUpscaleFactor.X2, - "x4" => UpscaleImageTopazWonder35RequestUpscaleFactor.X4, - "x8" => UpscaleImageTopazWonder35RequestUpscaleFactor.X8, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazWonder35Response.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazWonder35Response.g.cs index a23c8826..2dde0d94 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazWonder35Response.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageTopazWonder35Response.g.cs @@ -7,8 +7,7 @@ namespace Ideogram /// Synchronous requests (the default) include the upscaled image in `data`.
/// Async requests omit `data`; poll `GET /v2/generations/{generation_id}`
/// with the returned `generation_id`. `seed` is the seed actually used,
- /// and `width` and `height` are the output dimensions.
- /// Example: {"data":[{"seed":12345,"resolution":"2048x2048","url":"https://openapi-generator.tech","is_image_safe":true},{"seed":12345,"resolution":"2048x2048","url":"https://openapi-generator.tech","is_image_safe":true}],"seed":12345,"generation_id":"generation_id","width":0,"height":6} + /// and `width` and `height` are the output dimensions. /// public sealed partial class UpscaleImageTopazWonder35Response { @@ -26,10 +25,8 @@ public sealed partial class UpscaleImageTopazWonder35Response public global::System.Collections.Generic.IList? Data { get; set; } /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. ///
- /// 12345 [global::System.Text.Json.Serialization.JsonPropertyName("seed")] [global::System.Text.Json.Serialization.JsonRequired] public required int Seed { get; set; } @@ -61,8 +58,7 @@ public sealed partial class UpscaleImageTopazWonder35Response /// The generation ID to poll with `GET /v2/generations/{generation_id}`. /// /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. /// /// /// The output width in pixels. diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleInitialImageRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleInitialImageRequest.Json.g.cs deleted file mode 100644 index 87ef8b40..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleInitialImageRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class UpscaleInitialImageRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.UpscaleInitialImageRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.UpscaleInitialImageRequest), - jsonSerializerContext) as global::Ideogram.UpscaleInitialImageRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.UpscaleInitialImageRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.UpscaleInitialImageRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.UpscaleInitialImageRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.UpscaleInitialImageRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleInitialImageRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleInitialImageRequest.g.cs deleted file mode 100644 index 73309c1d..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleInitialImageRequest.g.cs +++ /dev/null @@ -1,140 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// A request to upscale a provided image with the help of an optional prompt. - /// - public sealed partial class UpscaleInitialImageRequest - { - /// - /// An optional prompt to guide the upscale
- /// Example: A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there is an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset. - ///
- /// A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there is an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset. - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - public string? Prompt { get; set; } - - /// - /// Default Value: 50
- /// Example: 50 - ///
- /// 50 - [global::System.Text.Json.Serialization.JsonPropertyName("resemblance")] - public int? Resemblance { get; set; } - - /// - /// Default Value: 50
- /// Example: 50 - ///
- /// 50 - [global::System.Text.Json.Serialization.JsonPropertyName("detail")] - public int? Detail { get; set; } - - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - ///
- /// ON - [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt_option")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.MagicPromptOptionJsonConverter))] - public global::Ideogram.MagicPromptOption? MagicPromptOption { get; set; } - - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt_system_prompt_config_id")] - public string? MagicPromptSystemPromptConfigId { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt_version")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.MagicPromptVersionEnumJsonConverter))] - public global::Ideogram.MagicPromptVersionEnum? MagicPromptVersion { get; set; } - - /// - /// The number of images to generate.
- /// Default Value: 1 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] - public int? NumImages { get; set; } - - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - ///
- /// 12345 - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// An optional prompt to guide the upscale
- /// Example: A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there is an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset. - /// - /// - /// Default Value: 50
- /// Example: 50 - /// - /// - /// Default Value: 50
- /// Example: 50 - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public UpscaleInitialImageRequest( - string? prompt, - int? resemblance, - int? detail, - global::Ideogram.MagicPromptOption? magicPromptOption, - string? magicPromptSystemPromptConfigId, - global::Ideogram.MagicPromptVersionEnum? magicPromptVersion, - int? numImages, - int? seed) - { - this.Prompt = prompt; - this.Resemblance = resemblance; - this.Detail = detail; - this.MagicPromptOption = magicPromptOption; - this.MagicPromptSystemPromptConfigId = magicPromptSystemPromptConfigId; - this.MagicPromptVersion = magicPromptVersion; - this.NumImages = numImages; - this.Seed = seed; - } - - /// - /// Initializes a new instance of the class. - /// - public UpscaleInitialImageRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleToolRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleToolRequest.Json.g.cs deleted file mode 100644 index 52eebdb9..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleToolRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class UpscaleToolRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.UpscaleToolRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.UpscaleToolRequest), - jsonSerializerContext) as global::Ideogram.UpscaleToolRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.UpscaleToolRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.UpscaleToolRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.UpscaleToolRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.UpscaleToolRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleToolRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleToolRequest.g.cs deleted file mode 100644 index 1c30e981..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleToolRequest.g.cs +++ /dev/null @@ -1,175 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Upload the source `image` using `multipart/form-data`. - /// - public sealed partial class UpscaleToolRequest - { - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - ///
- /// {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - [global::System.Text.Json.Serialization.JsonPropertyName("image_asset_identifier")] - public global::Ideogram.AssetIdentifier? ImageAssetIdentifier { get; set; } - - /// - /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image")] - public byte[]? Image { get; set; } - - /// - /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] - public string? Imagename { get; set; } - - /// - /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
- /// Default Value: x2 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("upscale_factor")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.UpscaleToolRequestUpscaleFactorJsonConverter))] - public global::Ideogram.UpscaleToolRequestUpscaleFactor? UpscaleFactor { get; set; } - - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - ///
- /// 12345 - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// When true, the upscale is excluded from the user's gallery and feeds.
- /// Default Value: false - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("internal")] - public bool? Internal { get; set; } - - /// - /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
- /// Default Value: false - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("async")] - public bool? Async { get; set; } - - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - ///
- /// https://api.example.com/webhooks/ideogram - [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] - public string? WebhookUrl { get; set; } - - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("target_collection_id")] - public string? TargetCollectionId { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - /// - /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - /// - /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
- /// Default Value: x2 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// When true, the upscale is excluded from the user's gallery and feeds.
- /// Default Value: false - /// - /// - /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public UpscaleToolRequest( - global::Ideogram.AssetIdentifier? imageAssetIdentifier, - byte[]? image, - string? imagename, - global::Ideogram.UpscaleToolRequestUpscaleFactor? upscaleFactor, - int? seed, - bool? @internal, - bool? async, - string? webhookUrl, - bool? @private, - string? targetCollectionId) - { - this.ImageAssetIdentifier = imageAssetIdentifier; - this.Image = image; - this.Imagename = imagename; - this.UpscaleFactor = upscaleFactor; - this.Seed = seed; - this.Internal = @internal; - this.Async = async; - this.WebhookUrl = webhookUrl; - this.Private = @private; - this.TargetCollectionId = targetCollectionId; - } - - /// - /// Initializes a new instance of the class. - /// - public UpscaleToolRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleToolRequestUpscaleFactor.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleToolRequestUpscaleFactor.g.cs deleted file mode 100644 index fac616f9..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleToolRequestUpscaleFactor.g.cs +++ /dev/null @@ -1,58 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
- /// Default Value: x2 - ///
- public enum UpscaleToolRequestUpscaleFactor - { - /// - /// - /// - X2, - /// - /// - /// - X4, - /// - /// - /// - X8, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class UpscaleToolRequestUpscaleFactorExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this UpscaleToolRequestUpscaleFactor value) - { - return value switch - { - UpscaleToolRequestUpscaleFactor.X2 => "x2", - UpscaleToolRequestUpscaleFactor.X4 => "x4", - UpscaleToolRequestUpscaleFactor.X8 => "x8", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static UpscaleToolRequestUpscaleFactor? ToEnum(string value) - { - return value switch - { - "x2" => UpscaleToolRequestUpscaleFactor.X2, - "x4" => UpscaleToolRequestUpscaleFactor.X4, - "x8" => UpscaleToolRequestUpscaleFactor.X8, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleToolResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleToolResponse.g.cs index 2af37fac..d962b1c6 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleToolResponse.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleToolResponse.g.cs @@ -7,8 +7,7 @@ namespace Ideogram /// Synchronous requests (the default) include the upscaled image in `data`.
/// Async requests omit `data`; poll `GET /v2/generations/{generation_id}`
/// with the returned `generation_id`. `seed` is the seed actually used,
- /// and `width` and `height` are the output dimensions.
- /// Example: {"data":[{"seed":12345,"resolution":"2048x2048","url":"https://openapi-generator.tech","is_image_safe":true},{"seed":12345,"resolution":"2048x2048","url":"https://openapi-generator.tech","is_image_safe":true}],"seed":12345,"generation_id":"generation_id","width":0,"height":6} + /// and `width` and `height` are the output dimensions. /// public sealed partial class UpscaleToolResponse { @@ -26,10 +25,8 @@ public sealed partial class UpscaleToolResponse public global::System.Collections.Generic.IList? Data { get; set; } /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. ///
- /// 12345 [global::System.Text.Json.Serialization.JsonPropertyName("seed")] [global::System.Text.Json.Serialization.JsonRequired] public required int Seed { get; set; } @@ -61,8 +58,7 @@ public sealed partial class UpscaleToolResponse /// The generation ID to poll with `GET /v2/generations/{generation_id}`. /// /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 + /// Random seed. Set for reproducible generation. /// /// /// The output width in pixels. diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.UsageSegment.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.UsageSegment.Json.g.cs deleted file mode 100644 index ce22220e..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.UsageSegment.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class UsageSegment - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.UsageSegment? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.UsageSegment), - jsonSerializerContext) as global::Ideogram.UsageSegment; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.UsageSegment? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.UsageSegment? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.UsageSegment), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.UsageSegment; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.UsageSegment.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.UsageSegment.g.cs deleted file mode 100644 index ca44505e..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.UsageSegment.g.cs +++ /dev/null @@ -1,77 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"segment_start":"2023-08-09T00:00:00\u002B00:00","tool_usage":[{"user_email_address":"user@company.com","model_version":"V_0_3","full_tool_name":"Turbo Image Generation V3","amount":{"amount":1050,"currency_code":"USD"},"tool_type":"GENERATE","api_key_id":"JRPVD7jWR1aTBYiJ0UFVOg"},{"user_email_address":"user@company.com","model_version":"V_0_3","full_tool_name":"Turbo Image Generation V3","amount":{"amount":1050,"currency_code":"USD"},"tool_type":"GENERATE","api_key_id":"JRPVD7jWR1aTBYiJ0UFVOg"}],"segment_end":"2023-08-09T23:59:59\u002B00:00"} - /// - public sealed partial class UsageSegment - { - /// - /// Start time of the usage segment
- /// Example: 2023-08-09T00:00:00+00:00 - ///
- /// 2023-08-09T00:00:00+00:00 - [global::System.Text.Json.Serialization.JsonPropertyName("segment_start")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.DateTime SegmentStart { get; set; } - - /// - /// End time of the usage segment
- /// Example: 2023-08-09T23:59:59+00:00 - ///
- /// 2023-08-09T23:59:59+00:00 - [global::System.Text.Json.Serialization.JsonPropertyName("segment_end")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.DateTime SegmentEnd { get; set; } - - /// - /// Tool-specific usage breakdown within this segment - /// - [global::System.Text.Json.Serialization.JsonPropertyName("tool_usage")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList ToolUsage { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Start time of the usage segment
- /// Example: 2023-08-09T00:00:00+00:00 - /// - /// - /// End time of the usage segment
- /// Example: 2023-08-09T23:59:59+00:00 - /// - /// - /// Tool-specific usage breakdown within this segment - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public UsageSegment( - global::System.DateTime segmentStart, - global::System.DateTime segmentEnd, - global::System.Collections.Generic.IList toolUsage) - { - this.SegmentStart = segmentStart; - this.SegmentEnd = segmentEnd; - this.ToolUsage = toolUsage ?? throw new global::System.ArgumentNullException(nameof(toolUsage)); - } - - /// - /// Initializes a new instance of the class. - /// - public UsageSegment() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.UsageSource.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.UsageSource.g.cs deleted file mode 100644 index c8fec63b..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.UsageSource.g.cs +++ /dev/null @@ -1,52 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Filter usage by source - API for programmatic API usage, APP for web application usage
- /// Default Value: API - ///
- public enum UsageSource - { - /// - /// - /// - Api, - /// - /// - /// - App, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class UsageSourceExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this UsageSource value) - { - return value switch - { - UsageSource.Api => "API", - UsageSource.App => "APP", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static UsageSource? ToEnum(string value) - { - return value switch - { - "API" => UsageSource.Api, - "APP" => UsageSource.App, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.V1EditImageObject.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.V1EditImageObject.Json.g.cs deleted file mode 100644 index de8c8c31..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.V1EditImageObject.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class V1EditImageObject - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.V1EditImageObject? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.V1EditImageObject), - jsonSerializerContext) as global::Ideogram.V1EditImageObject; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.V1EditImageObject? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.V1EditImageObject? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.V1EditImageObject), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.V1EditImageObject; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.V1EditImageObject.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.V1EditImageObject.g.cs deleted file mode 100644 index 9dd9873d..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.V1EditImageObject.g.cs +++ /dev/null @@ -1,137 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"style_type":"GENERAL","seed":12345,"upscaled_resolution":"4096x4096","prompt":"A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there\u0027s an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset.","resolution":"4096x4096","url":"https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804\u0026sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89","is_image_safe":true} - /// - public sealed partial class V1EditImageObject - { - /// - /// The direct link to the image generated.
- /// Example: https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89 - ///
- /// https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89 - [global::System.Text.Json.Serialization.JsonPropertyName("url")] - public string? Url { get; set; } - - /// - /// The prompt used for the generation. This may be different from the original prompt.
- /// Example: A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there's an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset. - ///
- /// A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there's an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset. - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Prompt { get; set; } - - /// - /// Output resolution, only used if operations alters image dimensions, such as upscale, crop etc.
- /// Example: 4096x4096 - ///
- /// 4096x4096 - [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Resolution { get; set; } - - /// - /// Output resolution, only used if operations alters image dimensions, such as upscale, crop etc.
- /// Example: 4096x4096 - ///
- /// 4096x4096 - [global::System.Text.Json.Serialization.JsonPropertyName("upscaled_resolution")] - public string? UpscaledResolution { get; set; } - - /// - /// Whether this request passes safety checks. If false, the url field will be empty. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("is_image_safe")] - [global::System.Text.Json.Serialization.JsonRequired] - public required bool IsImageSafe { get; set; } - - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - ///
- /// 12345 - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - [global::System.Text.Json.Serialization.JsonRequired] - public required int Seed { get; set; } - - /// - /// The style type to generate with.
- /// Default Value: GENERAL
- /// Example: GENERAL - ///
- /// GENERAL - [global::System.Text.Json.Serialization.JsonPropertyName("style_type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.StyleTypeV3JsonConverter))] - public global::Ideogram.StyleTypeV3? StyleType { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The prompt used for the generation. This may be different from the original prompt.
- /// Example: A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there's an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset. - /// - /// - /// Output resolution, only used if operations alters image dimensions, such as upscale, crop etc.
- /// Example: 4096x4096 - /// - /// - /// Whether this request passes safety checks. If false, the url field will be empty. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// The direct link to the image generated.
- /// Example: https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89 - /// - /// - /// Output resolution, only used if operations alters image dimensions, such as upscale, crop etc.
- /// Example: 4096x4096 - /// - /// - /// The style type to generate with.
- /// Default Value: GENERAL
- /// Example: GENERAL - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public V1EditImageObject( - string prompt, - string resolution, - bool isImageSafe, - int seed, - string? url, - string? upscaledResolution, - global::Ideogram.StyleTypeV3? styleType) - { - this.Url = url; - this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); - this.Resolution = resolution ?? throw new global::System.ArgumentNullException(nameof(resolution)); - this.UpscaledResolution = upscaledResolution; - this.IsImageSafe = isImageSafe; - this.Seed = seed; - this.StyleType = styleType; - } - - /// - /// Initializes a new instance of the class. - /// - public V1EditImageObject() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.V1EditImagesRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.V1EditImagesRequest.Json.g.cs deleted file mode 100644 index 8d589397..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.V1EditImagesRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class V1EditImagesRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.V1EditImagesRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.V1EditImagesRequest), - jsonSerializerContext) as global::Ideogram.V1EditImagesRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.V1EditImagesRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.V1EditImagesRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.V1EditImagesRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.V1EditImagesRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.V1EditImagesRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.V1EditImagesRequest.g.cs deleted file mode 100644 index eeac5f3b..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.V1EditImagesRequest.g.cs +++ /dev/null @@ -1,169 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - public sealed partial class V1EditImagesRequest - { - /// - /// The prompt describing the desired edit.
- /// Example: Change the background to a beach sunset. - ///
- /// Change the background to a beach sunset. - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Prompt { get; set; } - - /// - /// Images to edit (max 10 images, max size 25MB each); JPEG, WebP and PNG formats are supported. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("images")] - public global::System.Collections.Generic.IList? Images { get; set; } - - /// - /// URLs to Ideogram images to use as references (max 10). Supports URLs from generation responses and image uploads. Alternative to uploading via the images field. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image_urls")] - public global::System.Collections.Generic.IList? ImageUrls { get; set; } - - /// - /// The number of images to generate.
- /// Default Value: 1 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] - public int? NumImages { get; set; } - - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - ///
- /// 12345 - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - ///
- /// ON - [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.MagicPromptOptionJsonConverter))] - public global::Ideogram.MagicPromptOption? MagicPrompt { get; set; } - - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt_system_prompt_config_id")] - public string? MagicPromptSystemPromptConfigId { get; set; } - - /// - /// The resolutions supported for Ideogram 3.0.
- /// Example: 1280x800 - ///
- /// 1280x800 - [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ResolutionV3JsonConverter))] - public global::Ideogram.ResolutionV3? Resolution { get; set; } - - /// - /// Output aspect ratio. Cannot be combined with resolution. Generation defaults to 1x1; remix keeps the source ratio when both fields are omitted. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.AspectRatioV3JsonConverter))] - public global::Ideogram.AspectRatioV3? AspectRatio { get; set; } - - /// - /// Whether the output should have a transparent background. Default false.
- /// When more than one image is supplied, the first image is treated as
- /// the image being edited and drives the transparency decision.
- /// Default Value: false - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("transparent_background")] - public bool? TransparentBackground { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The prompt describing the desired edit.
- /// Example: Change the background to a beach sunset. - /// - /// - /// Images to edit (max 10 images, max size 25MB each); JPEG, WebP and PNG formats are supported. - /// - /// - /// URLs to Ideogram images to use as references (max 10). Supports URLs from generation responses and image uploads. Alternative to uploading via the images field. - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// The resolutions supported for Ideogram 3.0.
- /// Example: 1280x800 - /// - /// - /// Output aspect ratio. Cannot be combined with resolution. Generation defaults to 1x1; remix keeps the source ratio when both fields are omitted. - /// - /// - /// Whether the output should have a transparent background. Default false.
- /// When more than one image is supplied, the first image is treated as
- /// the image being edited and drives the transparency decision.
- /// Default Value: false - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public V1EditImagesRequest( - string prompt, - global::System.Collections.Generic.IList? images, - global::System.Collections.Generic.IList? imageUrls, - int? numImages, - int? seed, - global::Ideogram.MagicPromptOption? magicPrompt, - string? magicPromptSystemPromptConfigId, - global::Ideogram.ResolutionV3? resolution, - global::Ideogram.AspectRatioV3? aspectRatio, - bool? transparentBackground) - { - this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); - this.Images = images; - this.ImageUrls = imageUrls; - this.NumImages = numImages; - this.Seed = seed; - this.MagicPrompt = magicPrompt; - this.MagicPromptSystemPromptConfigId = magicPromptSystemPromptConfigId; - this.Resolution = resolution; - this.AspectRatio = aspectRatio; - this.TransparentBackground = transparentBackground; - } - - /// - /// Initializes a new instance of the class. - /// - public V1EditImagesRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.V1EditImagesResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.V1EditImagesResponse.Json.g.cs deleted file mode 100644 index 2755da1b..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.V1EditImagesResponse.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class V1EditImagesResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.V1EditImagesResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.V1EditImagesResponse), - jsonSerializerContext) as global::Ideogram.V1EditImagesResponse; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.V1EditImagesResponse? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.V1EditImagesResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.V1EditImagesResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.V1EditImagesResponse; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.V1EditImagesResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.V1EditImagesResponse.g.cs deleted file mode 100644 index db711ffd..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.V1EditImagesResponse.g.cs +++ /dev/null @@ -1,61 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// The response which contains information about the edited image, including the download link.
- /// Images links are available for a limited period of time; if you would like to keep the image, you must download it.
- /// Example: {"data":[{"style_type":"GENERAL","seed":12345,"upscaled_resolution":"4096x4096","prompt":"A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there\u0027s an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset.","resolution":"4096x4096","url":"https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804\u0026sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89","is_image_safe":true},{"style_type":"GENERAL","seed":12345,"upscaled_resolution":"4096x4096","prompt":"A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there\u0027s an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset.","resolution":"4096x4096","url":"https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804\u0026sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89","is_image_safe":true}],"created":"2000-01-23T04:56:07\u002B00:00"} - ///
- public sealed partial class V1EditImagesResponse - { - /// - /// The time the request was created. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("created")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.DateTime Created { get; set; } - - /// - /// A list of ImageObjects that contain the edited image(s). - /// - [global::System.Text.Json.Serialization.JsonPropertyName("data")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList Data { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The time the request was created. - /// - /// - /// A list of ImageObjects that contain the edited image(s). - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public V1EditImagesResponse( - global::System.DateTime created, - global::System.Collections.Generic.IList data) - { - this.Created = created; - this.Data = data ?? throw new global::System.ArgumentNullException(nameof(data)); - } - - /// - /// Initializes a new instance of the class. - /// - public V1EditImagesResponse() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.V1EditLiteImagesRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.V1EditLiteImagesRequest.Json.g.cs deleted file mode 100644 index 180571a3..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.V1EditLiteImagesRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class V1EditLiteImagesRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.V1EditLiteImagesRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.V1EditLiteImagesRequest), - jsonSerializerContext) as global::Ideogram.V1EditLiteImagesRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.V1EditLiteImagesRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.V1EditLiteImagesRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.V1EditLiteImagesRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.V1EditLiteImagesRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.V1EditLiteImagesRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.V1EditLiteImagesRequest.g.cs deleted file mode 100644 index 7cf00c0a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.V1EditLiteImagesRequest.g.cs +++ /dev/null @@ -1,185 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Request to edit an image with a prompt.
- /// The `image` field identifies the image being edited; it drives the
- /// output aspect ratio and transparency decisions. Up to 9 additional
- /// reference images may be supplied via `reference_images`, for a total of
- /// 10 images. - ///
- public sealed partial class V1EditLiteImagesRequest - { - /// - /// The prompt describing the desired edit.
- /// Example: Remove the person from the photo. - ///
- /// Remove the person from the photo. - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Prompt { get; set; } - - /// - /// The image being edited (max size 25MB); JPEG, WebP and PNG formats are supported. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image")] - [global::System.Text.Json.Serialization.JsonRequired] - public required byte[] Image { get; set; } - - /// - /// The image being edited (max size 25MB); JPEG, WebP and PNG formats are supported. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Imagename { get; set; } - - /// - /// Optional additional reference images to guide the edit (max 9, max size 25MB each); JPEG, WebP and PNG formats are supported. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("reference_images")] - public global::System.Collections.Generic.IList? ReferenceImages { get; set; } - - /// - /// The number of images to generate.
- /// Default Value: 1 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("num_images")] - public int? NumImages { get; set; } - - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - ///
- /// 12345 - [global::System.Text.Json.Serialization.JsonPropertyName("seed")] - public int? Seed { get; set; } - - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - ///
- /// ON - [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.MagicPromptOptionJsonConverter))] - public global::Ideogram.MagicPromptOption? MagicPrompt { get; set; } - - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt_system_prompt_config_id")] - public string? MagicPromptSystemPromptConfigId { get; set; } - - /// - /// The aspect ratio of the edited output. When omitted, the output
- /// follows the aspect ratio of the image being edited.
- /// Example: 16x9 - ///
- /// 16x9 - [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.AspectRatioEditLiteJsonConverter))] - public global::Ideogram.AspectRatioEditLite? AspectRatio { get; set; } - - /// - /// Controls whether the edited output has a transparent background.
- /// - `TRANSPARENT`: the output is produced with a transparent background.
- /// - `OPAQUE`: the output is produced with an opaque background.
- /// - `AUTO`: the server decides based on the prompt and the image being
- /// edited (e.g. whether it already has a transparent background). This is
- /// the default. When the prompt asks only for background removal, the
- /// output may be the edited image with its background removed.
- /// Default Value: AUTO - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("transparency")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.TransparencyOptionJsonConverter))] - public global::Ideogram.TransparencyOption? Transparency { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The prompt describing the desired edit.
- /// Example: Remove the person from the photo. - /// - /// - /// The image being edited (max size 25MB); JPEG, WebP and PNG formats are supported. - /// - /// - /// The image being edited (max size 25MB); JPEG, WebP and PNG formats are supported. - /// - /// - /// Optional additional reference images to guide the edit (max 9, max size 25MB each); JPEG, WebP and PNG formats are supported. - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// Determine if MagicPrompt should be used in generating the request or not.
- /// Example: ON - /// - /// - /// A base64url-encoded magic prompt system prompt config ID to use for this request. - /// - /// - /// The aspect ratio of the edited output. When omitted, the output
- /// follows the aspect ratio of the image being edited.
- /// Example: 16x9 - /// - /// - /// Controls whether the edited output has a transparent background.
- /// - `TRANSPARENT`: the output is produced with a transparent background.
- /// - `OPAQUE`: the output is produced with an opaque background.
- /// - `AUTO`: the server decides based on the prompt and the image being
- /// edited (e.g. whether it already has a transparent background). This is
- /// the default. When the prompt asks only for background removal, the
- /// output may be the edited image with its background removed.
- /// Default Value: AUTO - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public V1EditLiteImagesRequest( - string prompt, - byte[] image, - string imagename, - global::System.Collections.Generic.IList? referenceImages, - int? numImages, - int? seed, - global::Ideogram.MagicPromptOption? magicPrompt, - string? magicPromptSystemPromptConfigId, - global::Ideogram.AspectRatioEditLite? aspectRatio, - global::Ideogram.TransparencyOption? transparency) - { - this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); - this.Image = image ?? throw new global::System.ArgumentNullException(nameof(image)); - this.Imagename = imagename ?? throw new global::System.ArgumentNullException(nameof(imagename)); - this.ReferenceImages = referenceImages; - this.NumImages = numImages; - this.Seed = seed; - this.MagicPrompt = magicPrompt; - this.MagicPromptSystemPromptConfigId = magicPromptSystemPromptConfigId; - this.AspectRatio = aspectRatio; - this.Transparency = transparency; - } - - /// - /// Initializes a new instance of the class. - /// - public V1EditLiteImagesRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.V2AccountUsageGetParametersBucketWidth.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.V2AccountUsageGetParametersBucketWidth.g.cs new file mode 100644 index 00000000..97df110a --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.V2AccountUsageGetParametersBucketWidth.g.cs @@ -0,0 +1,51 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Default Value: 1d + /// + public enum V2AccountUsageGetParametersBucketWidth + { + /// + /// + /// + x1d, + /// + /// + /// + x1h, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class V2AccountUsageGetParametersBucketWidthExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this V2AccountUsageGetParametersBucketWidth value) + { + return value switch + { + V2AccountUsageGetParametersBucketWidth.x1d => "1d", + V2AccountUsageGetParametersBucketWidth.x1h => "1h", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static V2AccountUsageGetParametersBucketWidth? ToEnum(string value) + { + return value switch + { + "1d" => V2AccountUsageGetParametersBucketWidth.x1d, + "1h" => V2AccountUsageGetParametersBucketWidth.x1h, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.V2AccountUsageGetParametersSourcesSchemaItems.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.V2AccountUsageGetParametersSourcesSchemaItems.g.cs new file mode 100644 index 00000000..ca9e7cfe --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.V2AccountUsageGetParametersSourcesSchemaItems.g.cs @@ -0,0 +1,51 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// + /// + public enum V2AccountUsageGetParametersSourcesSchemaItems + { + /// + /// + /// + Api, + /// + /// + /// + App, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class V2AccountUsageGetParametersSourcesSchemaItemsExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this V2AccountUsageGetParametersSourcesSchemaItems value) + { + return value switch + { + V2AccountUsageGetParametersSourcesSchemaItems.Api => "api", + V2AccountUsageGetParametersSourcesSchemaItems.App => "app", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static V2AccountUsageGetParametersSourcesSchemaItems? ToEnum(string value) + { + return value switch + { + "api" => V2AccountUsageGetParametersSourcesSchemaItems.Api, + "app" => V2AccountUsageGetParametersSourcesSchemaItems.App, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageGenerateAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageGenerateAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier.g.cs new file mode 100644 index 00000000..bfbb04c2 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageGenerateAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier.g.cs @@ -0,0 +1,57 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// The output resolution tier. Affects which model serves the request, since not every model offers every tier. When omitted, the selected model's default tier is used. + /// + public enum V2ImageGenerateAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier + { + /// + /// + /// + x1k, + /// + /// + /// + x2k, + /// + /// + /// + x4k, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class V2ImageGenerateAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTierExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this V2ImageGenerateAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier value) + { + return value switch + { + V2ImageGenerateAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier.x1k => "1k", + V2ImageGenerateAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier.x2k => "2k", + V2ImageGenerateAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier.x4k => "4k", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static V2ImageGenerateAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier? ToEnum(string value) + { + return value switch + { + "1k" => V2ImageGenerateAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier.x1k, + "2k" => V2ImageGenerateAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier.x2k, + "4k" => V2ImageGenerateAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier.x4k, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaBackground.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaBackground.g.cs new file mode 100644 index 00000000..bd01000f --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaBackground.g.cs @@ -0,0 +1,58 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// The output background. `transparent` returns images with an alpha channel, `opaque` forces a solid background, and `auto` lets the model decide from the prompt.
+ /// Default Value: auto + ///
+ public enum V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaBackground + { + /// + /// + /// + Auto, + /// + /// + /// + Opaque, + /// + /// + /// + Transparent, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaBackgroundExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaBackground value) + { + return value switch + { + V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaBackground.Auto => "auto", + V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaBackground.Opaque => "opaque", + V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaBackground.Transparent => "transparent", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaBackground? ToEnum(string value) + { + return value switch + { + "auto" => V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaBackground.Auto, + "opaque" => V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaBackground.Opaque, + "transparent" => V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaBackground.Transparent, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaQuality.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaQuality.g.cs new file mode 100644 index 00000000..6fdabc7b --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaQuality.g.cs @@ -0,0 +1,64 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// How much rendering effort the model spends. Lower tiers return sooner and cost less; `auto` lets the model choose, which it currently renders at `high`.
+ /// Default Value: auto + ///
+ public enum V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaQuality + { + /// + /// + /// + Auto, + /// + /// + /// + High, + /// + /// + /// + Low, + /// + /// + /// + Medium, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaQualityExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaQuality value) + { + return value switch + { + V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaQuality.Auto => "auto", + V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaQuality.High => "high", + V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaQuality.Low => "low", + V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaQuality.Medium => "medium", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaQuality? ToEnum(string value) + { + return value switch + { + "auto" => V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaQuality.Auto, + "high" => V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaQuality.High, + "low" => V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaQuality.Low, + "medium" => V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaQuality.Medium, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaBackground.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaBackground.g.cs new file mode 100644 index 00000000..6c951723 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaBackground.g.cs @@ -0,0 +1,58 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// The output background. `transparent` returns images with an alpha channel, `opaque` forces a solid background, and `auto` lets the model decide from the prompt.
+ /// Default Value: auto + ///
+ public enum V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaBackground + { + /// + /// + /// + Auto, + /// + /// + /// + Opaque, + /// + /// + /// + Transparent, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaBackgroundExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaBackground value) + { + return value switch + { + V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaBackground.Auto => "auto", + V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaBackground.Opaque => "opaque", + V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaBackground.Transparent => "transparent", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaBackground? ToEnum(string value) + { + return value switch + { + "auto" => V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaBackground.Auto, + "opaque" => V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaBackground.Opaque, + "transparent" => V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaBackground.Transparent, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaQuality.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaQuality.g.cs new file mode 100644 index 00000000..fef29f64 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaQuality.g.cs @@ -0,0 +1,64 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// How much rendering effort the model spends. Lower tiers return sooner and cost less; `auto` lets the model choose, which it currently renders at `high`.
+ /// Default Value: auto + ///
+ public enum V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaQuality + { + /// + /// + /// + Auto, + /// + /// + /// + High, + /// + /// + /// + Low, + /// + /// + /// + Medium, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaQualityExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaQuality value) + { + return value switch + { + V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaQuality.Auto => "auto", + V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaQuality.High => "high", + V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaQuality.Low => "low", + V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaQuality.Medium => "medium", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaQuality? ToEnum(string value) + { + return value switch + { + "auto" => V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaQuality.Auto, + "high" => V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaQuality.High, + "low" => V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaQuality.Low, + "medium" => V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaQuality.Medium, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs new file mode 100644 index 00000000..a2ddb908 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs @@ -0,0 +1,58 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// The rendering speed to use.
+ /// Default Value: default + ///
+ public enum V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed + { + /// + /// + /// + Default, + /// + /// + /// + Quality, + /// + /// + /// + Turbo, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed value) + { + return value switch + { + V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Default => "default", + V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Quality => "quality", + V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Turbo => "turbo", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? ToEnum(string value) + { + return value switch + { + "default" => V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Default, + "quality" => V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Quality, + "turbo" => V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Turbo, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType.g.cs new file mode 100644 index 00000000..b4057ba3 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType.g.cs @@ -0,0 +1,58 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// The style type to generate the character with. Defaults to `auto`.
+ /// Default Value: auto + ///
+ public enum V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType + { + /// + /// + /// + Auto, + /// + /// + /// + Fiction, + /// + /// + /// + Realistic, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType value) + { + return value switch + { + V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType.Auto => "auto", + V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType.Fiction => "fiction", + V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType.Realistic => "realistic", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType? ToEnum(string value) + { + return value switch + { + "auto" => V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType.Auto, + "fiction" => V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType.Fiction, + "realistic" => V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType.Realistic, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageGenerateIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageGenerateIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs new file mode 100644 index 00000000..2a02ce4a --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageGenerateIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs @@ -0,0 +1,57 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// The rendering speed to use. When omitted, a speed supported by the custom model is used. + /// + public enum V2ImageGenerateIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed + { + /// + /// + /// + Default, + /// + /// + /// + Quality, + /// + /// + /// + Turbo, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class V2ImageGenerateIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this V2ImageGenerateIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed value) + { + return value switch + { + V2ImageGenerateIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Default => "default", + V2ImageGenerateIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Quality => "quality", + V2ImageGenerateIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Turbo => "turbo", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static V2ImageGenerateIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? ToEnum(string value) + { + return value switch + { + "default" => V2ImageGenerateIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Default, + "quality" => V2ImageGenerateIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Quality, + "turbo" => V2ImageGenerateIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Turbo, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageGenerateIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageGenerateIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs new file mode 100644 index 00000000..afc15d53 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageGenerateIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs @@ -0,0 +1,58 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// The rendering speed to use.
+ /// Default Value: default + ///
+ public enum V2ImageGenerateIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed + { + /// + /// + /// + Default, + /// + /// + /// + Quality, + /// + /// + /// + Turbo, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class V2ImageGenerateIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this V2ImageGenerateIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed value) + { + return value switch + { + V2ImageGenerateIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Default => "default", + V2ImageGenerateIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Quality => "quality", + V2ImageGenerateIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Turbo => "turbo", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static V2ImageGenerateIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? ToEnum(string value) + { + return value switch + { + "default" => V2ImageGenerateIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Default, + "quality" => V2ImageGenerateIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Quality, + "turbo" => V2ImageGenerateIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Turbo, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaBackground.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaBackground.g.cs new file mode 100644 index 00000000..1e669487 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaBackground.g.cs @@ -0,0 +1,58 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// The output background. `transparent` returns images with an alpha channel, `opaque` returns a solid one, and `auto` decides for you.
+ /// Default Value: auto + ///
+ public enum V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaBackground + { + /// + /// + /// + Auto, + /// + /// + /// + Opaque, + /// + /// + /// + Transparent, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaBackgroundExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaBackground value) + { + return value switch + { + V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaBackground.Auto => "auto", + V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaBackground.Opaque => "opaque", + V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaBackground.Transparent => "transparent", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaBackground? ToEnum(string value) + { + return value switch + { + "auto" => V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaBackground.Auto, + "opaque" => V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaBackground.Opaque, + "transparent" => V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaBackground.Transparent, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality.g.cs new file mode 100644 index 00000000..b3518452 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality.g.cs @@ -0,0 +1,63 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// The rendering quality to use. Higher quality takes longer and costs more. Defaults to `medium` with source images and `high` without. `very_low`, the fastest and cheapest, requires source images. + /// + public enum V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality + { + /// + /// + /// + High, + /// + /// + /// + Low, + /// + /// + /// + Medium, + /// + /// + /// + VeryLow, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaQualityExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality value) + { + return value switch + { + V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality.High => "high", + V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality.Low => "low", + V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality.Medium => "medium", + V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality.VeryLow => "very_low", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality? ToEnum(string value) + { + return value switch + { + "high" => V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality.High, + "low" => V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality.Low, + "medium" => V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality.Medium, + "very_low" => V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality.VeryLow, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageGenerateNanoBanana21PostRequestBodyContentMultipartFormDataSchemaResolutionTier.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageGenerateNanoBanana21PostRequestBodyContentMultipartFormDataSchemaResolutionTier.g.cs new file mode 100644 index 00000000..6a5b4bef --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageGenerateNanoBanana21PostRequestBodyContentMultipartFormDataSchemaResolutionTier.g.cs @@ -0,0 +1,58 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// The output resolution tier.
+ /// Default Value: 1K + ///
+ public enum V2ImageGenerateNanoBanana21PostRequestBodyContentMultipartFormDataSchemaResolutionTier + { + /// + /// + /// + x1k, + /// + /// + /// + x2k, + /// + /// + /// + x4k, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class V2ImageGenerateNanoBanana21PostRequestBodyContentMultipartFormDataSchemaResolutionTierExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this V2ImageGenerateNanoBanana21PostRequestBodyContentMultipartFormDataSchemaResolutionTier value) + { + return value switch + { + V2ImageGenerateNanoBanana21PostRequestBodyContentMultipartFormDataSchemaResolutionTier.x1k => "1K", + V2ImageGenerateNanoBanana21PostRequestBodyContentMultipartFormDataSchemaResolutionTier.x2k => "2K", + V2ImageGenerateNanoBanana21PostRequestBodyContentMultipartFormDataSchemaResolutionTier.x4k => "4K", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static V2ImageGenerateNanoBanana21PostRequestBodyContentMultipartFormDataSchemaResolutionTier? ToEnum(string value) + { + return value switch + { + "1K" => V2ImageGenerateNanoBanana21PostRequestBodyContentMultipartFormDataSchemaResolutionTier.x1k, + "2K" => V2ImageGenerateNanoBanana21PostRequestBodyContentMultipartFormDataSchemaResolutionTier.x2k, + "4K" => V2ImageGenerateNanoBanana21PostRequestBodyContentMultipartFormDataSchemaResolutionTier.x4k, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageGenerateNanoBanana2PostRequestBodyContentMultipartFormDataSchemaResolutionTier.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageGenerateNanoBanana2PostRequestBodyContentMultipartFormDataSchemaResolutionTier.g.cs new file mode 100644 index 00000000..5fd67900 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageGenerateNanoBanana2PostRequestBodyContentMultipartFormDataSchemaResolutionTier.g.cs @@ -0,0 +1,58 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// The output resolution tier.
+ /// Default Value: 1K + ///
+ public enum V2ImageGenerateNanoBanana2PostRequestBodyContentMultipartFormDataSchemaResolutionTier + { + /// + /// + /// + x1k, + /// + /// + /// + x2k, + /// + /// + /// + x4k, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class V2ImageGenerateNanoBanana2PostRequestBodyContentMultipartFormDataSchemaResolutionTierExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this V2ImageGenerateNanoBanana2PostRequestBodyContentMultipartFormDataSchemaResolutionTier value) + { + return value switch + { + V2ImageGenerateNanoBanana2PostRequestBodyContentMultipartFormDataSchemaResolutionTier.x1k => "1K", + V2ImageGenerateNanoBanana2PostRequestBodyContentMultipartFormDataSchemaResolutionTier.x2k => "2K", + V2ImageGenerateNanoBanana2PostRequestBodyContentMultipartFormDataSchemaResolutionTier.x4k => "4K", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static V2ImageGenerateNanoBanana2PostRequestBodyContentMultipartFormDataSchemaResolutionTier? ToEnum(string value) + { + return value switch + { + "1K" => V2ImageGenerateNanoBanana2PostRequestBodyContentMultipartFormDataSchemaResolutionTier.x1k, + "2K" => V2ImageGenerateNanoBanana2PostRequestBodyContentMultipartFormDataSchemaResolutionTier.x2k, + "4K" => V2ImageGenerateNanoBanana2PostRequestBodyContentMultipartFormDataSchemaResolutionTier.x4k, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageGenerateNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageGenerateNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier.g.cs new file mode 100644 index 00000000..69f9cce7 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageGenerateNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier.g.cs @@ -0,0 +1,58 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// The output resolution tier.
+ /// Default Value: 1K + ///
+ public enum V2ImageGenerateNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier + { + /// + /// + /// + x1k, + /// + /// + /// + x2k, + /// + /// + /// + x4k, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class V2ImageGenerateNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTierExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this V2ImageGenerateNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier value) + { + return value switch + { + V2ImageGenerateNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier.x1k => "1K", + V2ImageGenerateNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier.x2k => "2K", + V2ImageGenerateNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier.x4k => "4K", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static V2ImageGenerateNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier? ToEnum(string value) + { + return value switch + { + "1K" => V2ImageGenerateNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier.x1k, + "2K" => V2ImageGenerateNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier.x2k, + "4K" => V2ImageGenerateNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier.x4k, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs new file mode 100644 index 00000000..b200844d --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs @@ -0,0 +1,58 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// The rendering speed to use.
+ /// Default Value: default + ///
+ public enum V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed + { + /// + /// + /// + Default, + /// + /// + /// + Quality, + /// + /// + /// + Turbo, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed value) + { + return value switch + { + V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Default => "default", + V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Quality => "quality", + V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Turbo => "turbo", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? ToEnum(string value) + { + return value switch + { + "default" => V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Default, + "quality" => V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Quality, + "turbo" => V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Turbo, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType.g.cs new file mode 100644 index 00000000..6d2779d6 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType.g.cs @@ -0,0 +1,58 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// The style type to repaint the character with. Defaults to `auto`. `realistic` and `fiction` are supported for character-only requests; style codes or style references (not both) require `auto`. For API-key callers, combining a style with a character requires that feature to be enabled for their account.
+ /// Default Value: auto + ///
+ public enum V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType + { + /// + /// + /// + Auto, + /// + /// + /// + Fiction, + /// + /// + /// + Realistic, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType value) + { + return value switch + { + V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType.Auto => "auto", + V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType.Fiction => "fiction", + V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType.Realistic => "realistic", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType? ToEnum(string value) + { + return value switch + { + "auto" => V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType.Auto, + "fiction" => V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType.Fiction, + "realistic" => V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType.Realistic, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageInpaintIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageInpaintIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs new file mode 100644 index 00000000..81be6688 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageInpaintIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs @@ -0,0 +1,57 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// The rendering speed to use. When omitted, the server chooses a speed supported by the selected custom model. + /// + public enum V2ImageInpaintIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed + { + /// + /// + /// + Default, + /// + /// + /// + Quality, + /// + /// + /// + Turbo, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class V2ImageInpaintIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this V2ImageInpaintIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed value) + { + return value switch + { + V2ImageInpaintIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Default => "default", + V2ImageInpaintIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Quality => "quality", + V2ImageInpaintIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Turbo => "turbo", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static V2ImageInpaintIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? ToEnum(string value) + { + return value switch + { + "default" => V2ImageInpaintIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Default, + "quality" => V2ImageInpaintIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Quality, + "turbo" => V2ImageInpaintIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Turbo, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageInpaintIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageInpaintIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs new file mode 100644 index 00000000..7a5068f6 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageInpaintIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs @@ -0,0 +1,58 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// The rendering speed to use.
+ /// Default Value: default + ///
+ public enum V2ImageInpaintIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed + { + /// + /// + /// + Default, + /// + /// + /// + Quality, + /// + /// + /// + Turbo, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class V2ImageInpaintIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this V2ImageInpaintIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed value) + { + return value switch + { + V2ImageInpaintIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Default => "default", + V2ImageInpaintIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Quality => "quality", + V2ImageInpaintIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Turbo => "turbo", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static V2ImageInpaintIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? ToEnum(string value) + { + return value switch + { + "default" => V2ImageInpaintIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Default, + "quality" => V2ImageInpaintIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Quality, + "turbo" => V2ImageInpaintIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Turbo, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.V2ImagePreciseEditIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImagePreciseEditIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality.g.cs new file mode 100644 index 00000000..28f1ae6d --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImagePreciseEditIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality.g.cs @@ -0,0 +1,64 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// The rendering quality to use. `very_low` is the fastest and cheapest, and `high` takes longer and is priced higher.
+ /// Default Value: medium + ///
+ public enum V2ImagePreciseEditIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality + { + /// + /// + /// + High, + /// + /// + /// + Low, + /// + /// + /// + Medium, + /// + /// + /// + VeryLow, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class V2ImagePreciseEditIdeogram45PostRequestBodyContentMultipartFormDataSchemaQualityExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this V2ImagePreciseEditIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality value) + { + return value switch + { + V2ImagePreciseEditIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality.High => "high", + V2ImagePreciseEditIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality.Low => "low", + V2ImagePreciseEditIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality.Medium => "medium", + V2ImagePreciseEditIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality.VeryLow => "very_low", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static V2ImagePreciseEditIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality? ToEnum(string value) + { + return value switch + { + "high" => V2ImagePreciseEditIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality.High, + "low" => V2ImagePreciseEditIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality.Low, + "medium" => V2ImagePreciseEditIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality.Medium, + "very_low" => V2ImagePreciseEditIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality.VeryLow, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageReframeIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageReframeIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs new file mode 100644 index 00000000..8f709250 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageReframeIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs @@ -0,0 +1,57 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Default Value: default + /// + public enum V2ImageReframeIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed + { + /// + /// + /// + Default, + /// + /// + /// + Quality, + /// + /// + /// + Turbo, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class V2ImageReframeIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this V2ImageReframeIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed value) + { + return value switch + { + V2ImageReframeIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Default => "default", + V2ImageReframeIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Quality => "quality", + V2ImageReframeIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Turbo => "turbo", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static V2ImageReframeIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? ToEnum(string value) + { + return value switch + { + "default" => V2ImageReframeIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Default, + "quality" => V2ImageReframeIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Quality, + "turbo" => V2ImageReframeIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Turbo, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageRemixAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageRemixAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier.g.cs new file mode 100644 index 00000000..b2075080 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageRemixAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier.g.cs @@ -0,0 +1,51 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// The output resolution tier. When omitted, the tier is inferred from `resolution`, or defaults to 1k. A color palette, style codes, style preset, or non-`auto` style type are only supported at 1k. + /// + public enum V2ImageRemixAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier + { + /// + /// + /// + x1k, + /// + /// + /// + x2k, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class V2ImageRemixAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTierExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this V2ImageRemixAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier value) + { + return value switch + { + V2ImageRemixAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier.x1k => "1k", + V2ImageRemixAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier.x2k => "2k", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static V2ImageRemixAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier? ToEnum(string value) + { + return value switch + { + "1k" => V2ImageRemixAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier.x1k, + "2k" => V2ImageRemixAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier.x2k, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs new file mode 100644 index 00000000..7c6508c5 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs @@ -0,0 +1,58 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// The rendering speed to use.
+ /// Default Value: default + ///
+ public enum V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed + { + /// + /// + /// + Default, + /// + /// + /// + Quality, + /// + /// + /// + Turbo, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed value) + { + return value switch + { + V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Default => "default", + V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Quality => "quality", + V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Turbo => "turbo", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? ToEnum(string value) + { + return value switch + { + "default" => V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Default, + "quality" => V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Quality, + "turbo" => V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Turbo, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType.g.cs new file mode 100644 index 00000000..547461c1 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType.g.cs @@ -0,0 +1,58 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// The style type to remix the character with. Defaults to `auto`.
+ /// Default Value: auto + ///
+ public enum V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType + { + /// + /// + /// + Auto, + /// + /// + /// + Fiction, + /// + /// + /// + Realistic, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType value) + { + return value switch + { + V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType.Auto => "auto", + V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType.Fiction => "fiction", + V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType.Realistic => "realistic", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType? ToEnum(string value) + { + return value switch + { + "auto" => V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType.Auto, + "fiction" => V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType.Fiction, + "realistic" => V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType.Realistic, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageRemixIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageRemixIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs new file mode 100644 index 00000000..c25cc64e --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageRemixIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs @@ -0,0 +1,57 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// The rendering speed to use. When omitted, the server chooses a speed supported by the selected custom model. + /// + public enum V2ImageRemixIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed + { + /// + /// + /// + Default, + /// + /// + /// + Quality, + /// + /// + /// + Turbo, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class V2ImageRemixIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeedExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this V2ImageRemixIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed value) + { + return value switch + { + V2ImageRemixIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Default => "default", + V2ImageRemixIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Quality => "quality", + V2ImageRemixIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Turbo => "turbo", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static V2ImageRemixIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? ToEnum(string value) + { + return value switch + { + "default" => V2ImageRemixIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Default, + "quality" => V2ImageRemixIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Quality, + "turbo" => V2ImageRemixIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Turbo, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageRemixIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageRemixIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs new file mode 100644 index 00000000..56e2cb94 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageRemixIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs @@ -0,0 +1,58 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// The rendering speed to use.
+ /// Default Value: default + ///
+ public enum V2ImageRemixIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed + { + /// + /// + /// + Default, + /// + /// + /// + Quality, + /// + /// + /// + Turbo, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class V2ImageRemixIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this V2ImageRemixIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed value) + { + return value switch + { + V2ImageRemixIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Default => "default", + V2ImageRemixIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Quality => "quality", + V2ImageRemixIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Turbo => "turbo", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static V2ImageRemixIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? ToEnum(string value) + { + return value switch + { + "default" => V2ImageRemixIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Default, + "quality" => V2ImageRemixIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Quality, + "turbo" => V2ImageRemixIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Turbo, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageRemixIdeogram4PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageRemixIdeogram4PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs new file mode 100644 index 00000000..29078ca2 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageRemixIdeogram4PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs @@ -0,0 +1,58 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// The rendering speed to use.
+ /// Default Value: default + ///
+ public enum V2ImageRemixIdeogram4PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed + { + /// + /// + /// + Default, + /// + /// + /// + Quality, + /// + /// + /// + Turbo, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class V2ImageRemixIdeogram4PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this V2ImageRemixIdeogram4PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed value) + { + return value switch + { + V2ImageRemixIdeogram4PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Default => "default", + V2ImageRemixIdeogram4PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Quality => "quality", + V2ImageRemixIdeogram4PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Turbo => "turbo", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static V2ImageRemixIdeogram4PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? ToEnum(string value) + { + return value switch + { + "default" => V2ImageRemixIdeogram4PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Default, + "quality" => V2ImageRemixIdeogram4PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Quality, + "turbo" => V2ImageRemixIdeogram4PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Turbo, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageReplaceBackgroundIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageReplaceBackgroundIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs new file mode 100644 index 00000000..77360472 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageReplaceBackgroundIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.g.cs @@ -0,0 +1,58 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// The rendering speed to use.
+ /// Default Value: default + ///
+ public enum V2ImageReplaceBackgroundIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed + { + /// + /// + /// + Default, + /// + /// + /// + Quality, + /// + /// + /// + Turbo, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class V2ImageReplaceBackgroundIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this V2ImageReplaceBackgroundIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed value) + { + return value switch + { + V2ImageReplaceBackgroundIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Default => "default", + V2ImageReplaceBackgroundIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Quality => "quality", + V2ImageReplaceBackgroundIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Turbo => "turbo", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static V2ImageReplaceBackgroundIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? ToEnum(string value) + { + return value switch + { + "default" => V2ImageReplaceBackgroundIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Default, + "quality" => V2ImageReplaceBackgroundIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Quality, + "turbo" => V2ImageReplaceBackgroundIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed.Turbo, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageUpscaleAutoPostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageUpscaleAutoPostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.g.cs new file mode 100644 index 00000000..6b3a305b --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageUpscaleAutoPostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.g.cs @@ -0,0 +1,58 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
+ /// Default Value: x2 + ///
+ public enum V2ImageUpscaleAutoPostRequestBodyContentMultipartFormDataSchemaUpscaleFactor + { + /// + /// + /// + X2, + /// + /// + /// + X4, + /// + /// + /// + X8, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class V2ImageUpscaleAutoPostRequestBodyContentMultipartFormDataSchemaUpscaleFactorExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this V2ImageUpscaleAutoPostRequestBodyContentMultipartFormDataSchemaUpscaleFactor value) + { + return value switch + { + V2ImageUpscaleAutoPostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.X2 => "x2", + V2ImageUpscaleAutoPostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.X4 => "x4", + V2ImageUpscaleAutoPostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.X8 => "x8", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static V2ImageUpscaleAutoPostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? ToEnum(string value) + { + return value switch + { + "x2" => V2ImageUpscaleAutoPostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.X2, + "x4" => V2ImageUpscaleAutoPostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.X4, + "x8" => V2ImageUpscaleAutoPostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.X8, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageUpscaleNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageUpscaleNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier.g.cs new file mode 100644 index 00000000..75708803 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageUpscaleNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier.g.cs @@ -0,0 +1,58 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// The output resolution tier. The model sizes its output by tier at the source image's aspect ratio; exact pixel dimensions cannot be requested. Rejected when the source is already at or above the requested tier. Defaults to "2K".
+ /// Default Value: 2K + ///
+ public enum V2ImageUpscaleNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier + { + /// + /// + /// + x1k, + /// + /// + /// + x2k, + /// + /// + /// + x4k, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class V2ImageUpscaleNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTierExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this V2ImageUpscaleNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier value) + { + return value switch + { + V2ImageUpscaleNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier.x1k => "1K", + V2ImageUpscaleNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier.x2k => "2K", + V2ImageUpscaleNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier.x4k => "4K", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static V2ImageUpscaleNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier? ToEnum(string value) + { + return value switch + { + "1K" => V2ImageUpscaleNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier.x1k, + "2K" => V2ImageUpscaleNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier.x2k, + "4K" => V2ImageUpscaleNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier.x4k, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageUpscaleTopazBloom2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageUpscaleTopazBloom2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.g.cs new file mode 100644 index 00000000..7ed40545 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageUpscaleTopazBloom2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.g.cs @@ -0,0 +1,58 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
+ /// Default Value: x2 + ///
+ public enum V2ImageUpscaleTopazBloom2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor + { + /// + /// + /// + X2, + /// + /// + /// + X4, + /// + /// + /// + X8, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class V2ImageUpscaleTopazBloom2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactorExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this V2ImageUpscaleTopazBloom2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor value) + { + return value switch + { + V2ImageUpscaleTopazBloom2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.X2 => "x2", + V2ImageUpscaleTopazBloom2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.X4 => "x4", + V2ImageUpscaleTopazBloom2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.X8 => "x8", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static V2ImageUpscaleTopazBloom2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? ToEnum(string value) + { + return value switch + { + "x2" => V2ImageUpscaleTopazBloom2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.X2, + "x4" => V2ImageUpscaleTopazBloom2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.X4, + "x8" => V2ImageUpscaleTopazBloom2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.X8, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection.g.cs new file mode 100644 index 00000000..7fd02293 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection.g.cs @@ -0,0 +1,57 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Where enhancements apply. Omit to let the model choose per image. + /// + public enum V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection + { + /// + /// + /// + All, + /// + /// + /// + Background, + /// + /// + /// + Foreground, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetectionExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection value) + { + return value switch + { + V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection.All => "all", + V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection.Background => "background", + V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection.Foreground => "foreground", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection? ToEnum(string value) + { + return value switch + { + "all" => V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection.All, + "background" => V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection.Background, + "foreground" => V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection.Foreground, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.g.cs new file mode 100644 index 00000000..55d11292 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.g.cs @@ -0,0 +1,58 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
+ /// Default Value: x2 + ///
+ public enum V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor + { + /// + /// + /// + X2, + /// + /// + /// + X4, + /// + /// + /// + X8, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactorExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor value) + { + return value switch + { + V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.X2 => "x2", + V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.X4 => "x4", + V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.X8 => "x8", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? ToEnum(string value) + { + return value switch + { + "x2" => V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.X2, + "x4" => V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.X4, + "x8" => V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.X8, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaSubjectDetection.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaSubjectDetection.g.cs new file mode 100644 index 00000000..b7b48bf9 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaSubjectDetection.g.cs @@ -0,0 +1,57 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Where enhancements apply. Omit to let the model choose per image. + /// + public enum V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaSubjectDetection + { + /// + /// + /// + All, + /// + /// + /// + Background, + /// + /// + /// + Foreground, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaSubjectDetectionExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaSubjectDetection value) + { + return value switch + { + V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaSubjectDetection.All => "all", + V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaSubjectDetection.Background => "background", + V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaSubjectDetection.Foreground => "foreground", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaSubjectDetection? ToEnum(string value) + { + return value switch + { + "all" => V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaSubjectDetection.All, + "background" => V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaSubjectDetection.Background, + "foreground" => V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaSubjectDetection.Foreground, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.g.cs new file mode 100644 index 00000000..e5aeba3c --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.g.cs @@ -0,0 +1,58 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
+ /// Default Value: x2 + ///
+ public enum V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor + { + /// + /// + /// + X2, + /// + /// + /// + X4, + /// + /// + /// + X8, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactorExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor value) + { + return value switch + { + V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.X2 => "x2", + V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.X4 => "x4", + V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.X8 => "x8", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? ToEnum(string value) + { + return value switch + { + "x2" => V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.X2, + "x4" => V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.X4, + "x8" => V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.X8, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection.g.cs new file mode 100644 index 00000000..4b9dbf74 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection.g.cs @@ -0,0 +1,57 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Where enhancements apply. Omit to let the model choose per image. + /// + public enum V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection + { + /// + /// + /// + All, + /// + /// + /// + Background, + /// + /// + /// + Foreground, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetectionExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection value) + { + return value switch + { + V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection.All => "all", + V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection.Background => "background", + V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection.Foreground => "foreground", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection? ToEnum(string value) + { + return value switch + { + "all" => V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection.All, + "background" => V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection.Background, + "foreground" => V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection.Foreground, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.g.cs new file mode 100644 index 00000000..1bd9f81f --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.g.cs @@ -0,0 +1,58 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
+ /// Default Value: x2 + ///
+ public enum V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor + { + /// + /// + /// + X2, + /// + /// + /// + X4, + /// + /// + /// + X8, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactorExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor value) + { + return value switch + { + V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.X2 => "x2", + V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.X4 => "x4", + V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.X8 => "x8", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? ToEnum(string value) + { + return value switch + { + "x2" => V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.X2, + "x4" => V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.X4, + "x8" => V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.X8, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaEnhancementStrength.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaEnhancementStrength.g.cs new file mode 100644 index 00000000..4dc69ce5 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaEnhancementStrength.g.cs @@ -0,0 +1,58 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// How strongly the generative model reconstructs detail while upscaling. Lower values stay closer to the source image; higher values produce a more enhanced result.
+ /// Default Value: high + ///
+ public enum V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaEnhancementStrength + { + /// + /// + /// + High, + /// + /// + /// + Low, + /// + /// + /// + Medium, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaEnhancementStrengthExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaEnhancementStrength value) + { + return value switch + { + V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaEnhancementStrength.High => "high", + V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaEnhancementStrength.Low => "low", + V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaEnhancementStrength.Medium => "medium", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaEnhancementStrength? ToEnum(string value) + { + return value switch + { + "high" => V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaEnhancementStrength.High, + "low" => V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaEnhancementStrength.Low, + "medium" => V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaEnhancementStrength.Medium, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.g.cs new file mode 100644 index 00000000..8b053212 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.g.cs @@ -0,0 +1,58 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
+ /// Default Value: x2 + ///
+ public enum V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor + { + /// + /// + /// + X2, + /// + /// + /// + X4, + /// + /// + /// + X8, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaUpscaleFactorExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor value) + { + return value switch + { + V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.X2 => "x2", + V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.X4 => "x4", + V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.X8 => "x8", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? ToEnum(string value) + { + return value switch + { + "x2" => V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.X2, + "x4" => V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.X4, + "x8" => V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor.X8, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage.g.cs new file mode 100644 index 00000000..04693e2f --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage.g.cs @@ -0,0 +1,141 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// The target language for the copy. Arabic is rendered right-to-left. Each request covers one language; send one request per language. + /// + public enum V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage + { + /// + /// + /// + Ar, + /// + /// + /// + Cs, + /// + /// + /// + Da, + /// + /// + /// + De, + /// + /// + /// + En, + /// + /// + /// + Es, + /// + /// + /// + Fi, + /// + /// + /// + Fr, + /// + /// + /// + FrCa, + /// + /// + /// + Hu, + /// + /// + /// + It, + /// + /// + /// + Ja, + /// + /// + /// + Nl, + /// + /// + /// + No, + /// + /// + /// + Pl, + /// + /// + /// + Pt, + /// + /// + /// + Sv, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguageExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage value) + { + return value switch + { + V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage.Ar => "ar", + V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage.Cs => "cs", + V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage.Da => "da", + V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage.De => "de", + V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage.En => "en", + V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage.Es => "es", + V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage.Fi => "fi", + V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage.Fr => "fr", + V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage.FrCa => "fr-ca", + V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage.Hu => "hu", + V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage.It => "it", + V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage.Ja => "ja", + V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage.Nl => "nl", + V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage.No => "no", + V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage.Pl => "pl", + V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage.Pt => "pt", + V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage.Sv => "sv", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage? ToEnum(string value) + { + return value switch + { + "ar" => V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage.Ar, + "cs" => V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage.Cs, + "da" => V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage.Da, + "de" => V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage.De, + "en" => V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage.En, + "es" => V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage.Es, + "fi" => V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage.Fi, + "fr" => V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage.Fr, + "fr-ca" => V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage.FrCa, + "hu" => V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage.Hu, + "it" => V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage.It, + "ja" => V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage.Ja, + "nl" => V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage.Nl, + "no" => V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage.No, + "pl" => V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage.Pl, + "pt" => V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage.Pt, + "sv" => V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage.Sv, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaPlatform.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaPlatform.g.cs new file mode 100644 index 00000000..df15d2ce --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaPlatform.g.cs @@ -0,0 +1,95 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// The ad platform whose published safe zone the ad must stay inside.
+ /// The ad is generated inside the largest rectangle that fits the
+ /// platform's safe zone for the requested aspect ratio, and the space
+ /// around it is filled in so the output is still exactly the requested
+ /// `resolution`. `google` covers YouTube and Google Ads placements.
+ /// Use `meta_stories` or `meta_reels` for Meta placements; Reels uses
+ /// the largest rectangle inside its notched safe zone. The legacy
+ /// `meta` value is still supported and uses a more conservative safe
+ /// zone. When omitted, the ad fills the whole frame and every
+ /// supported `resolution` is accepted. Any other value is rejected
+ /// with a 400.
+ /// Each platform accepts only the resolutions for which it publishes a
+ /// safe zone; any other `resolution` is rejected with a 400:
+ /// | Platform | Accepted resolutions |
+ /// | --- | --- |
+ /// | `google` | `1920x1080`, `3840x2160`, `1080x1080`, `2400x2400`, `2880x2880`, `1080x1920`, `2160x3840` |
+ /// | `tiktok` | `1920x1080`, `3840x2160`, `1080x1080`, `2400x2400`, `2880x2880`, `1080x1920`, `2160x3840` |
+ /// | `meta_stories` | `1080x1920`, `2160x3840` |
+ /// | `meta_reels` | `1080x1920`, `2160x3840` |
+ /// | `meta` (legacy) | `1080x1920`, `2160x3840` |
+ /// | `snapchat` | `1080x1920`, `2160x3840` | + ///
+ public enum V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaPlatform + { + /// + /// + /// + Google, + /// + /// + /// + Meta, + /// + /// + /// + MetaReels, + /// + /// + /// + MetaStories, + /// + /// + /// + Snapchat, + /// + /// + /// + Tiktok, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaPlatformExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaPlatform value) + { + return value switch + { + V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaPlatform.Google => "google", + V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaPlatform.Meta => "meta", + V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaPlatform.MetaReels => "meta_reels", + V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaPlatform.MetaStories => "meta_stories", + V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaPlatform.Snapchat => "snapchat", + V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaPlatform.Tiktok => "tiktok", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaPlatform? ToEnum(string value) + { + return value switch + { + "google" => V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaPlatform.Google, + "meta" => V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaPlatform.Meta, + "meta_reels" => V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaPlatform.MetaReels, + "meta_stories" => V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaPlatform.MetaStories, + "snapchat" => V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaPlatform.Snapchat, + "tiktok" => V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaPlatform.Tiktok, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.g.cs new file mode 100644 index 00000000..9ccc6842 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.g.cs @@ -0,0 +1,227 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Target ad resolution, formatted as `WIDTHxHEIGHT`. Any value not in
+ /// the list is rejected with a 400. Each output image has exactly these
+ /// pixel dimensions, with or without a `platform`. + ///
+ public enum V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution + { + /// + /// + /// + x1080x1080, + /// + /// + /// + x1080x1350, + /// + /// + /// + x1080x1920, + /// + /// + /// + x1200x3500, + /// + /// + /// + x1280x3840, + /// + /// + /// + x160x600, + /// + /// + /// + x1800x900, + /// + /// + /// + x1920x1080, + /// + /// + /// + x1920x3840, + /// + /// + /// + x2160x3840, + /// + /// + /// + x2240x3584, + /// + /// + /// + x2336x3504, + /// + /// + /// + x2400x2400, + /// + /// + /// + x2448x3264, + /// + /// + /// + x2560x3200, + /// + /// + /// + x2880x2880, + /// + /// + /// + x300x250, + /// + /// + /// + x300x50, + /// + /// + /// + x300x600, + /// + /// + /// + x3200x2560, + /// + /// + /// + x320x100, + /// + /// + /// + x320x50, + /// + /// + /// + x3264x2448, + /// + /// + /// + x336x280, + /// + /// + /// + x3504x2336, + /// + /// + /// + x3584x2240, + /// + /// + /// + x3840x1280, + /// + /// + /// + x3840x1920, + /// + /// + /// + x3840x2160, + /// + /// + /// + x728x90, + /// + /// + /// + x970x250, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolutionExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution value) + { + return value switch + { + V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.x1080x1080 => "1080x1080", + V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.x1080x1350 => "1080x1350", + V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.x1080x1920 => "1080x1920", + V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.x1200x3500 => "1200x3500", + V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.x1280x3840 => "1280x3840", + V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.x160x600 => "160x600", + V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.x1800x900 => "1800x900", + V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.x1920x1080 => "1920x1080", + V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.x1920x3840 => "1920x3840", + V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.x2160x3840 => "2160x3840", + V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.x2240x3584 => "2240x3584", + V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.x2336x3504 => "2336x3504", + V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.x2400x2400 => "2400x2400", + V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.x2448x3264 => "2448x3264", + V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.x2560x3200 => "2560x3200", + V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.x2880x2880 => "2880x2880", + V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.x300x250 => "300x250", + V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.x300x50 => "300x50", + V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.x300x600 => "300x600", + V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.x3200x2560 => "3200x2560", + V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.x320x100 => "320x100", + V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.x320x50 => "320x50", + V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.x3264x2448 => "3264x2448", + V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.x336x280 => "336x280", + V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.x3504x2336 => "3504x2336", + V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.x3584x2240 => "3584x2240", + V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.x3840x1280 => "3840x1280", + V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.x3840x1920 => "3840x1920", + V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.x3840x2160 => "3840x2160", + V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.x728x90 => "728x90", + V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.x970x250 => "970x250", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution? ToEnum(string value) + { + return value switch + { + "1080x1080" => V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.x1080x1080, + "1080x1350" => V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.x1080x1350, + "1080x1920" => V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.x1080x1920, + "1200x3500" => V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.x1200x3500, + "1280x3840" => V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.x1280x3840, + "160x600" => V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.x160x600, + "1800x900" => V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.x1800x900, + "1920x1080" => V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.x1920x1080, + "1920x3840" => V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.x1920x3840, + "2160x3840" => V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.x2160x3840, + "2240x3584" => V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.x2240x3584, + "2336x3504" => V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.x2336x3504, + "2400x2400" => V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.x2400x2400, + "2448x3264" => V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.x2448x3264, + "2560x3200" => V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.x2560x3200, + "2880x2880" => V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.x2880x2880, + "300x250" => V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.x300x250, + "300x50" => V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.x300x50, + "300x600" => V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.x300x600, + "3200x2560" => V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.x3200x2560, + "320x100" => V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.x320x100, + "320x50" => V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.x320x50, + "3264x2448" => V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.x3264x2448, + "336x280" => V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.x336x280, + "3504x2336" => V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.x3504x2336, + "3584x2240" => V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.x3584x2240, + "3840x1280" => V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.x3840x1280, + "3840x1920" => V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.x3840x1920, + "3840x2160" => V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.x3840x2160, + "728x90" => V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.x728x90, + "970x250" => V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution.x970x250, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.V2ToolAdVariationsPostRequestBodyContentMultipartFormDataSchemaVariationType.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.V2ToolAdVariationsPostRequestBodyContentMultipartFormDataSchemaVariationType.g.cs new file mode 100644 index 00000000..332abd71 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.V2ToolAdVariationsPostRequestBodyContentMultipartFormDataSchemaVariationType.g.cs @@ -0,0 +1,67 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// The axis to vary. `people`
+ /// replaces the people in the ad with different talent. `setting`
+ /// moves the same subject and product to a different environment.
+ /// `group_size` changes how many people appear. `scene` shifts the
+ /// moment or occasion (time of day, season, or activity). + ///
+ public enum V2ToolAdVariationsPostRequestBodyContentMultipartFormDataSchemaVariationType + { + /// + /// + /// + GroupSize, + /// + /// + /// + People, + /// + /// + /// + Scene, + /// + /// + /// + Setting, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class V2ToolAdVariationsPostRequestBodyContentMultipartFormDataSchemaVariationTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this V2ToolAdVariationsPostRequestBodyContentMultipartFormDataSchemaVariationType value) + { + return value switch + { + V2ToolAdVariationsPostRequestBodyContentMultipartFormDataSchemaVariationType.GroupSize => "group_size", + V2ToolAdVariationsPostRequestBodyContentMultipartFormDataSchemaVariationType.People => "people", + V2ToolAdVariationsPostRequestBodyContentMultipartFormDataSchemaVariationType.Scene => "scene", + V2ToolAdVariationsPostRequestBodyContentMultipartFormDataSchemaVariationType.Setting => "setting", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static V2ToolAdVariationsPostRequestBodyContentMultipartFormDataSchemaVariationType? ToEnum(string value) + { + return value switch + { + "group_size" => V2ToolAdVariationsPostRequestBodyContentMultipartFormDataSchemaVariationType.GroupSize, + "people" => V2ToolAdVariationsPostRequestBodyContentMultipartFormDataSchemaVariationType.People, + "scene" => V2ToolAdVariationsPostRequestBodyContentMultipartFormDataSchemaVariationType.Scene, + "setting" => V2ToolAdVariationsPostRequestBodyContentMultipartFormDataSchemaVariationType.Setting, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.V2ToolGhostMannequinPostRequestBodyContentMultipartFormDataSchemaView.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.V2ToolGhostMannequinPostRequestBodyContentMultipartFormDataSchemaView.g.cs new file mode 100644 index 00000000..4ef9732f --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.V2ToolGhostMannequinPostRequestBodyContentMultipartFormDataSchemaView.g.cs @@ -0,0 +1,57 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Camera view for the output garment. + /// + public enum V2ToolGhostMannequinPostRequestBodyContentMultipartFormDataSchemaView + { + /// + /// + /// + Back, + /// + /// + /// + Front, + /// + /// + /// + ThreeQuarter, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class V2ToolGhostMannequinPostRequestBodyContentMultipartFormDataSchemaViewExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this V2ToolGhostMannequinPostRequestBodyContentMultipartFormDataSchemaView value) + { + return value switch + { + V2ToolGhostMannequinPostRequestBodyContentMultipartFormDataSchemaView.Back => "back", + V2ToolGhostMannequinPostRequestBodyContentMultipartFormDataSchemaView.Front => "front", + V2ToolGhostMannequinPostRequestBodyContentMultipartFormDataSchemaView.ThreeQuarter => "three_quarter", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static V2ToolGhostMannequinPostRequestBodyContentMultipartFormDataSchemaView? ToEnum(string value) + { + return value switch + { + "back" => V2ToolGhostMannequinPostRequestBodyContentMultipartFormDataSchemaView.Back, + "front" => V2ToolGhostMannequinPostRequestBodyContentMultipartFormDataSchemaView.Front, + "three_quarter" => V2ToolGhostMannequinPostRequestBodyContentMultipartFormDataSchemaView.ThreeQuarter, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.V4CompositionalDeconstruction.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.V4CompositionalDeconstruction.g.cs index e23a3de8..49e3676d 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.V4CompositionalDeconstruction.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.V4CompositionalDeconstruction.g.cs @@ -4,8 +4,7 @@ namespace Ideogram { /// - /// The compositional breakdown of a V4 prompt — background plus an ordered list of elements.
- /// Example: {"background":"background","elements":[{"bbox":[0,0,1000,1000],"type":"obj","desc":"desc","color_palette":["#FFD700","#FFD700"]},{"bbox":[0,0,1000,1000],"type":"obj","desc":"desc","color_palette":["#FFD700","#FFD700"]}]} + /// The compositional breakdown of a V4 prompt — background plus an ordered list of elements. ///
public sealed partial class V4CompositionalDeconstruction { diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.V4JsonPrompt.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.V4JsonPrompt.g.cs index 40d61ac5..4c972028 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.V4JsonPrompt.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.V4JsonPrompt.g.cs @@ -7,8 +7,7 @@ namespace Ideogram /// Structured prompt for Ideogram 4.0 generation. When `json_prompt` is
/// supplied, magic-prompt is disabled and the diffusion model consumes
/// the JSON contract directly. Mutually exclusive with `text_prompt`
- /// and the legacy `prompt` field.
- /// Example: {"high_level_description":"high_level_description","style_description":{"photo":"photo","art_style":"art_style","medium":"medium","aesthetics":"aesthetics","lighting":"lighting","color_palette":["#FFD700","#FFD700"]},"compositional_deconstruction":{"background":"background","elements":[{"bbox":[0,0,1000,1000],"type":"obj","desc":"desc","color_palette":["#FFD700","#FFD700"]},{"bbox":[0,0,1000,1000],"type":"obj","desc":"desc","color_palette":["#FFD700","#FFD700"]}]},"tags":["tags","tags"]} + /// and the legacy `prompt` field. /// public sealed partial class V4JsonPrompt { @@ -20,29 +19,18 @@ public sealed partial class V4JsonPrompt public required string HighLevelDescription { get; set; } /// - /// Optional style description supplied alongside a V4 JSON prompt.
- /// Example: {"photo":"photo","art_style":"art_style","medium":"medium","aesthetics":"aesthetics","lighting":"lighting","color_palette":["#FFD700","#FFD700"]} + /// Optional style description supplied alongside a V4 JSON prompt. ///
- /// {"photo":"photo","art_style":"art_style","medium":"medium","aesthetics":"aesthetics","lighting":"lighting","color_palette":["#FFD700","#FFD700"]} [global::System.Text.Json.Serialization.JsonPropertyName("style_description")] public global::Ideogram.V4StyleDescription? StyleDescription { get; set; } /// - /// The compositional breakdown of a V4 prompt — background plus an ordered list of elements.
- /// Example: {"background":"background","elements":[{"bbox":[0,0,1000,1000],"type":"obj","desc":"desc","color_palette":["#FFD700","#FFD700"]},{"bbox":[0,0,1000,1000],"type":"obj","desc":"desc","color_palette":["#FFD700","#FFD700"]}]} + /// The compositional breakdown of a V4 prompt — background plus an ordered list of elements. ///
- /// {"background":"background","elements":[{"bbox":[0,0,1000,1000],"type":"obj","desc":"desc","color_palette":["#FFD700","#FFD700"]},{"bbox":[0,0,1000,1000],"type":"obj","desc":"desc","color_palette":["#FFD700","#FFD700"]}]} [global::System.Text.Json.Serialization.JsonPropertyName("compositional_deconstruction")] [global::System.Text.Json.Serialization.JsonRequired] public required global::Ideogram.V4CompositionalDeconstruction CompositionalDeconstruction { get; set; } - /// - /// Round-trip metadata surfaced by the describe endpoint when
- /// `strip_tags=false`. Ignored by the v4 sampler on generate input. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("tags")] - public global::System.Collections.Generic.IList? Tags { get; set; } - /// /// Additional properties that are not explicitly defined in the schema /// @@ -56,16 +44,10 @@ public sealed partial class V4JsonPrompt /// One- or two-sentence overall description of the desired image. /// /// - /// The compositional breakdown of a V4 prompt — background plus an ordered list of elements.
- /// Example: {"background":"background","elements":[{"bbox":[0,0,1000,1000],"type":"obj","desc":"desc","color_palette":["#FFD700","#FFD700"]},{"bbox":[0,0,1000,1000],"type":"obj","desc":"desc","color_palette":["#FFD700","#FFD700"]}]} + /// The compositional breakdown of a V4 prompt — background plus an ordered list of elements. /// /// - /// Optional style description supplied alongside a V4 JSON prompt.
- /// Example: {"photo":"photo","art_style":"art_style","medium":"medium","aesthetics":"aesthetics","lighting":"lighting","color_palette":["#FFD700","#FFD700"]} - /// - /// - /// Round-trip metadata surfaced by the describe endpoint when
- /// `strip_tags=false`. Ignored by the v4 sampler on generate input. + /// Optional style description supplied alongside a V4 JSON prompt. /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -73,13 +55,11 @@ public sealed partial class V4JsonPrompt public V4JsonPrompt( string highLevelDescription, global::Ideogram.V4CompositionalDeconstruction compositionalDeconstruction, - global::Ideogram.V4StyleDescription? styleDescription, - global::System.Collections.Generic.IList? tags) + global::Ideogram.V4StyleDescription? styleDescription) { this.HighLevelDescription = highLevelDescription ?? throw new global::System.ArgumentNullException(nameof(highLevelDescription)); this.StyleDescription = styleDescription; this.CompositionalDeconstruction = compositionalDeconstruction ?? throw new global::System.ArgumentNullException(nameof(compositionalDeconstruction)); - this.Tags = tags; } /// diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.V4ObjPromptElement.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.V4ObjPromptElement.Json.g.cs deleted file mode 100644 index a7880d66..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.V4ObjPromptElement.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class V4ObjPromptElement - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.V4ObjPromptElement? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.V4ObjPromptElement), - jsonSerializerContext) as global::Ideogram.V4ObjPromptElement; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.V4ObjPromptElement? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.V4ObjPromptElement? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.V4ObjPromptElement), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.V4ObjPromptElement; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.V4ObjPromptElement.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.V4ObjPromptElement.g.cs deleted file mode 100644 index 59556fa4..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.V4ObjPromptElement.g.cs +++ /dev/null @@ -1,95 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// A non-text element (object, character, background detail) in the V4 prompt layout.
- /// Example: {"bbox":[0,0,1000,1000],"type":"obj","desc":"desc","color_palette":["#FFD700","#FFD700"]} - ///
- public sealed partial class V4ObjPromptElement - { - /// - /// Discriminator. Must be `obj`. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.V4ObjPromptElementTypeJsonConverter))] - public global::Ideogram.V4ObjPromptElementType Type { get; set; } - - /// - /// Bounding box for an element, expressed as four integers in `[0, 1000]`
- /// with `[y_min, x_min, y_max, x_max]` semantics (row-first). Values are
- /// normalized so the canvas is `1000 x 1000` regardless of the final
- /// resolution.
- /// Example: [0, 0, 1000, 1000] - ///
- /// [0, 0, 1000, 1000] - [global::System.Text.Json.Serialization.JsonPropertyName("bbox")] - public global::System.Collections.Generic.IList? Bbox { get; set; } - - /// - /// Description of the object element. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("desc")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Desc { get; set; } - - /// - /// Optional list of hex color strings (e.g. "#FFD700") that bias the
- /// Ideogram 4.0 output toward this palette. Applied as a soft color bias,
- /// not an exact per-pixel lock. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("color_palette")] - public global::System.Collections.Generic.IList? ColorPalette { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Description of the object element. - /// - /// - /// Discriminator. Must be `obj`. - /// - /// - /// Bounding box for an element, expressed as four integers in `[0, 1000]`
- /// with `[y_min, x_min, y_max, x_max]` semantics (row-first). Values are
- /// normalized so the canvas is `1000 x 1000` regardless of the final
- /// resolution.
- /// Example: [0, 0, 1000, 1000] - /// - /// - /// Optional list of hex color strings (e.g. "#FFD700") that bias the
- /// Ideogram 4.0 output toward this palette. Applied as a soft color bias,
- /// not an exact per-pixel lock. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public V4ObjPromptElement( - string desc, - global::Ideogram.V4ObjPromptElementType type, - global::System.Collections.Generic.IList? bbox, - global::System.Collections.Generic.IList? colorPalette) - { - this.Type = type; - this.Bbox = bbox; - this.Desc = desc ?? throw new global::System.ArgumentNullException(nameof(desc)); - this.ColorPalette = colorPalette; - } - - /// - /// Initializes a new instance of the class. - /// - public V4ObjPromptElement() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.V4PromptElement.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.V4PromptElement.g.cs index f554ac98..e6227af5 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.V4PromptElement.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.V4PromptElement.g.cs @@ -16,13 +16,12 @@ namespace Ideogram public global::Ideogram.V4PromptElementDiscriminatorType? Type { get; } /// - /// A non-text element (object, character, background detail) in the V4 prompt layout.
- /// Example: {"bbox":[0,0,1000,1000],"type":"obj","desc":"desc","color_palette":["#FFD700","#FFD700"]} + /// A non-text element (object, character, background detail) in the V4 prompt layout. ///
#if NET6_0_OR_GREATER - public global::Ideogram.V4ObjPromptElement? Obj { get; init; } + public global::Ideogram.V4PromptElementVariant1? Obj { get; init; } #else - public global::Ideogram.V4ObjPromptElement? Obj { get; } + public global::Ideogram.V4PromptElementVariant1? Obj { get; } #endif /// @@ -40,7 +39,7 @@ public bool TryPickObj( #if NET6_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] #endif - out global::Ideogram.V4ObjPromptElement? value) + out global::Ideogram.V4PromptElementVariant1? value) { value = Obj; return IsObj; @@ -49,7 +48,7 @@ public bool TryPickObj( /// /// /// - public global::Ideogram.V4ObjPromptElement PickObj() => Obj is { } value + public global::Ideogram.V4PromptElementVariant1 PickObj() => Obj is { } value ? value : throw new global::System.InvalidOperationException($"Expected union variant 'Obj' but the value was {ToString()}."); @@ -57,9 +56,9 @@ public bool TryPickObj( /// A text element to render in the V4 prompt layout. /// #if NET6_0_OR_GREATER - public global::Ideogram.V4TextPromptElement? Text { get; init; } + public global::Ideogram.V4PromptElementVariant2? Text { get; init; } #else - public global::Ideogram.V4TextPromptElement? Text { get; } + public global::Ideogram.V4PromptElementVariant2? Text { get; } #endif /// @@ -77,7 +76,7 @@ public bool TryPickText( #if NET6_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] #endif - out global::Ideogram.V4TextPromptElement? value) + out global::Ideogram.V4PromptElementVariant2? value) { value = Text; return IsText; @@ -86,23 +85,23 @@ public bool TryPickText( /// /// /// - public global::Ideogram.V4TextPromptElement PickText() => Text is { } value + public global::Ideogram.V4PromptElementVariant2 PickText() => Text is { } value ? value : throw new global::System.InvalidOperationException($"Expected union variant 'Text' but the value was {ToString()}."); /// /// /// - public static implicit operator V4PromptElement(global::Ideogram.V4ObjPromptElement value) => new V4PromptElement((global::Ideogram.V4ObjPromptElement?)value); + public static implicit operator V4PromptElement(global::Ideogram.V4PromptElementVariant1 value) => new V4PromptElement((global::Ideogram.V4PromptElementVariant1?)value); /// /// /// - public static implicit operator global::Ideogram.V4ObjPromptElement?(V4PromptElement @this) => @this.Obj; + public static implicit operator global::Ideogram.V4PromptElementVariant1?(V4PromptElement @this) => @this.Obj; /// /// /// - public V4PromptElement(global::Ideogram.V4ObjPromptElement? value) + public V4PromptElement(global::Ideogram.V4PromptElementVariant1? value) { Obj = value; } @@ -110,22 +109,22 @@ public V4PromptElement(global::Ideogram.V4ObjPromptElement? value) /// /// /// - public static V4PromptElement FromObj(global::Ideogram.V4ObjPromptElement? value) => new V4PromptElement(value); + public static V4PromptElement FromObj(global::Ideogram.V4PromptElementVariant1? value) => new V4PromptElement(value); /// /// /// - public static implicit operator V4PromptElement(global::Ideogram.V4TextPromptElement value) => new V4PromptElement((global::Ideogram.V4TextPromptElement?)value); + public static implicit operator V4PromptElement(global::Ideogram.V4PromptElementVariant2 value) => new V4PromptElement((global::Ideogram.V4PromptElementVariant2?)value); /// /// /// - public static implicit operator global::Ideogram.V4TextPromptElement?(V4PromptElement @this) => @this.Text; + public static implicit operator global::Ideogram.V4PromptElementVariant2?(V4PromptElement @this) => @this.Text; /// /// /// - public V4PromptElement(global::Ideogram.V4TextPromptElement? value) + public V4PromptElement(global::Ideogram.V4PromptElementVariant2? value) { Text = value; } @@ -133,15 +132,15 @@ public V4PromptElement(global::Ideogram.V4TextPromptElement? value) /// /// /// - public static V4PromptElement FromText(global::Ideogram.V4TextPromptElement? value) => new V4PromptElement(value); + public static V4PromptElement FromText(global::Ideogram.V4PromptElementVariant2? value) => new V4PromptElement(value); /// /// /// public V4PromptElement( global::Ideogram.V4PromptElementDiscriminatorType? type, - global::Ideogram.V4ObjPromptElement? obj, - global::Ideogram.V4TextPromptElement? text + global::Ideogram.V4PromptElementVariant1? obj, + global::Ideogram.V4PromptElementVariant2? text ) { Type = type; @@ -178,8 +177,8 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? obj = null, - global::System.Func? text = null, + global::System.Func? obj = null, + global::System.Func? text = null, bool validate = true) { if (validate) @@ -203,9 +202,9 @@ public bool Validate() /// ///
public void Match( - global::System.Action? obj = null, + global::System.Action? obj = null, - global::System.Action? text = null, + global::System.Action? text = null, bool validate = true) { if (validate) @@ -227,8 +226,8 @@ public void Match( /// /// public void Switch( - global::System.Action? obj = null, - global::System.Action? text = null, + global::System.Action? obj = null, + global::System.Action? text = null, bool validate = true) { if (validate) @@ -254,9 +253,9 @@ public override int GetHashCode() var fields = new object?[] { Obj, - typeof(global::Ideogram.V4ObjPromptElement), + typeof(global::Ideogram.V4PromptElementVariant1), Text, - typeof(global::Ideogram.V4TextPromptElement), + typeof(global::Ideogram.V4PromptElementVariant2), }; const int offset = unchecked((int)2166136261); const int prime = 16777619; @@ -273,8 +272,8 @@ static int HashCodeAggregator(int hashCode, object? value) => value == null public bool Equals(V4PromptElement other) { return - global::System.Collections.Generic.EqualityComparer.Default.Equals(Obj, other.Obj) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(Text, other.Text) + global::System.Collections.Generic.EqualityComparer.Default.Equals(Obj, other.Obj) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Text, other.Text) ; } diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.V4PromptElementVariant1.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.V4PromptElementVariant1.Json.g.cs new file mode 100644 index 00000000..ad62abf0 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.V4PromptElementVariant1.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class V4PromptElementVariant1 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.V4PromptElementVariant1? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.V4PromptElementVariant1), + jsonSerializerContext) as global::Ideogram.V4PromptElementVariant1; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.V4PromptElementVariant1? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.V4PromptElementVariant1? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.V4PromptElementVariant1), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.V4PromptElementVariant1; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.V4PromptElementVariant1.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.V4PromptElementVariant1.g.cs new file mode 100644 index 00000000..708a600a --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.V4PromptElementVariant1.g.cs @@ -0,0 +1,91 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// A non-text element (object, character, background detail) in the V4 prompt layout. + /// + public sealed partial class V4PromptElementVariant1 + { + /// + /// Discriminator. Must be `obj`. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.V4ObjPromptElementTypeJsonConverter))] + public global::Ideogram.V4ObjPromptElementType Type { get; set; } + + /// + /// Bounding box for an element, expressed as four integers in `[0, 1000]`
+ /// with `[y_min, x_min, y_max, x_max]` semantics (row-first). Values are
+ /// normalized so the canvas is `1000 x 1000` regardless of the final
+ /// resolution. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("bbox")] + public global::System.Collections.Generic.IList? Bbox { get; set; } + + /// + /// Description of the object element. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("desc")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Desc { get; set; } + + /// + /// Optional list of hex color strings (e.g. "#FFD700") that bias the
+ /// Ideogram 4.0 output toward this palette. Applied as a soft color bias,
+ /// not an exact per-pixel lock. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("color_palette")] + public global::System.Collections.Generic.IList? ColorPalette { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Description of the object element. + /// + /// + /// Discriminator. Must be `obj`. + /// + /// + /// Bounding box for an element, expressed as four integers in `[0, 1000]`
+ /// with `[y_min, x_min, y_max, x_max]` semantics (row-first). Values are
+ /// normalized so the canvas is `1000 x 1000` regardless of the final
+ /// resolution. + /// + /// + /// Optional list of hex color strings (e.g. "#FFD700") that bias the
+ /// Ideogram 4.0 output toward this palette. Applied as a soft color bias,
+ /// not an exact per-pixel lock. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public V4PromptElementVariant1( + string desc, + global::Ideogram.V4ObjPromptElementType type, + global::System.Collections.Generic.IList? bbox, + global::System.Collections.Generic.IList? colorPalette) + { + this.Type = type; + this.Bbox = bbox; + this.Desc = desc ?? throw new global::System.ArgumentNullException(nameof(desc)); + this.ColorPalette = colorPalette; + } + + /// + /// Initializes a new instance of the class. + /// + public V4PromptElementVariant1() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.V4PromptElementVariant2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.V4PromptElementVariant2.Json.g.cs new file mode 100644 index 00000000..d1266736 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.V4PromptElementVariant2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class V4PromptElementVariant2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.V4PromptElementVariant2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.V4PromptElementVariant2), + jsonSerializerContext) as global::Ideogram.V4PromptElementVariant2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.V4PromptElementVariant2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.V4PromptElementVariant2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.V4PromptElementVariant2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.V4PromptElementVariant2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.V4PromptElementVariant2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.V4PromptElementVariant2.g.cs new file mode 100644 index 00000000..4947f0af --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.V4PromptElementVariant2.g.cs @@ -0,0 +1,103 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// A text element to render in the V4 prompt layout. + /// + public sealed partial class V4PromptElementVariant2 + { + /// + /// Discriminator. Must be `text`. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.V4TextPromptElementTypeJsonConverter))] + public global::Ideogram.V4TextPromptElementType Type { get; set; } + + /// + /// Bounding box for an element, expressed as four integers in `[0, 1000]`
+ /// with `[y_min, x_min, y_max, x_max]` semantics (row-first). Values are
+ /// normalized so the canvas is `1000 x 1000` regardless of the final
+ /// resolution. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("bbox")] + public global::System.Collections.Generic.IList? Bbox { get; set; } + + /// + /// The literal text to render in the image. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("text")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Text { get; set; } + + /// + /// Description of the text element (style, role, placement notes). + /// + [global::System.Text.Json.Serialization.JsonPropertyName("desc")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Desc { get; set; } + + /// + /// Optional list of hex color strings (e.g. "#FFD700") that bias the
+ /// Ideogram 4.0 output toward this palette. Applied as a soft color bias,
+ /// not an exact per-pixel lock. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("color_palette")] + public global::System.Collections.Generic.IList? ColorPalette { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The literal text to render in the image. + /// + /// + /// Description of the text element (style, role, placement notes). + /// + /// + /// Discriminator. Must be `text`. + /// + /// + /// Bounding box for an element, expressed as four integers in `[0, 1000]`
+ /// with `[y_min, x_min, y_max, x_max]` semantics (row-first). Values are
+ /// normalized so the canvas is `1000 x 1000` regardless of the final
+ /// resolution. + /// + /// + /// Optional list of hex color strings (e.g. "#FFD700") that bias the
+ /// Ideogram 4.0 output toward this palette. Applied as a soft color bias,
+ /// not an exact per-pixel lock. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public V4PromptElementVariant2( + string text, + string desc, + global::Ideogram.V4TextPromptElementType type, + global::System.Collections.Generic.IList? bbox, + global::System.Collections.Generic.IList? colorPalette) + { + this.Type = type; + this.Bbox = bbox; + this.Text = text ?? throw new global::System.ArgumentNullException(nameof(text)); + this.Desc = desc ?? throw new global::System.ArgumentNullException(nameof(desc)); + this.ColorPalette = colorPalette; + } + + /// + /// Initializes a new instance of the class. + /// + public V4PromptElementVariant2() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.V4StyleDescription.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.V4StyleDescription.g.cs index 4dac3fba..0166fa7d 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.V4StyleDescription.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.V4StyleDescription.g.cs @@ -4,8 +4,7 @@ namespace Ideogram { /// - /// Optional style description supplied alongside a V4 JSON prompt.
- /// Example: {"photo":"photo","art_style":"art_style","medium":"medium","aesthetics":"aesthetics","lighting":"lighting","color_palette":["#FFD700","#FFD700"]} + /// Optional style description supplied alongside a V4 JSON prompt. ///
public sealed partial class V4StyleDescription { diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.V4TextPromptElement.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.V4TextPromptElement.Json.g.cs deleted file mode 100644 index 9b4df7c4..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.V4TextPromptElement.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class V4TextPromptElement - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.V4TextPromptElement? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.V4TextPromptElement), - jsonSerializerContext) as global::Ideogram.V4TextPromptElement; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.V4TextPromptElement? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.V4TextPromptElement? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.V4TextPromptElement), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.V4TextPromptElement; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.V4TextPromptElement.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.V4TextPromptElement.g.cs deleted file mode 100644 index ed294da1..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.V4TextPromptElement.g.cs +++ /dev/null @@ -1,106 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// A text element to render in the V4 prompt layout. - /// - public sealed partial class V4TextPromptElement - { - /// - /// Discriminator. Must be `text`. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.V4TextPromptElementTypeJsonConverter))] - public global::Ideogram.V4TextPromptElementType Type { get; set; } - - /// - /// Bounding box for an element, expressed as four integers in `[0, 1000]`
- /// with `[y_min, x_min, y_max, x_max]` semantics (row-first). Values are
- /// normalized so the canvas is `1000 x 1000` regardless of the final
- /// resolution.
- /// Example: [0, 0, 1000, 1000] - ///
- /// [0, 0, 1000, 1000] - [global::System.Text.Json.Serialization.JsonPropertyName("bbox")] - public global::System.Collections.Generic.IList? Bbox { get; set; } - - /// - /// The literal text to render in the image. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("text")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Text { get; set; } - - /// - /// Description of the text element (style, role, placement notes). - /// - [global::System.Text.Json.Serialization.JsonPropertyName("desc")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Desc { get; set; } - - /// - /// Optional list of hex color strings (e.g. "#FFD700") that bias the
- /// Ideogram 4.0 output toward this palette. Applied as a soft color bias,
- /// not an exact per-pixel lock. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("color_palette")] - public global::System.Collections.Generic.IList? ColorPalette { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The literal text to render in the image. - /// - /// - /// Description of the text element (style, role, placement notes). - /// - /// - /// Discriminator. Must be `text`. - /// - /// - /// Bounding box for an element, expressed as four integers in `[0, 1000]`
- /// with `[y_min, x_min, y_max, x_max]` semantics (row-first). Values are
- /// normalized so the canvas is `1000 x 1000` regardless of the final
- /// resolution.
- /// Example: [0, 0, 1000, 1000] - /// - /// - /// Optional list of hex color strings (e.g. "#FFD700") that bias the
- /// Ideogram 4.0 output toward this palette. Applied as a soft color bias,
- /// not an exact per-pixel lock. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public V4TextPromptElement( - string text, - string desc, - global::Ideogram.V4TextPromptElementType type, - global::System.Collections.Generic.IList? bbox, - global::System.Collections.Generic.IList? colorPalette) - { - this.Type = type; - this.Bbox = bbox; - this.Text = text ?? throw new global::System.ArgumentNullException(nameof(text)); - this.Desc = desc ?? throw new global::System.ArgumentNullException(nameof(desc)); - this.ColorPalette = colorPalette; - } - - /// - /// Initializes a new instance of the class. - /// - public V4TextPromptElement() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VectorizerRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VectorizerRequest.Json.g.cs deleted file mode 100644 index 10552fc3..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.VectorizerRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class VectorizerRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.VectorizerRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.VectorizerRequest), - jsonSerializerContext) as global::Ideogram.VectorizerRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.VectorizerRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.VectorizerRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.VectorizerRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VectorizerRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VectorizerRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VectorizerRequest.g.cs deleted file mode 100644 index 0499b6e3..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.VectorizerRequest.g.cs +++ /dev/null @@ -1,148 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - public sealed partial class VectorizerRequest - { - /// - /// JPEG, PNG or WEBP source; at most 50 MB. Multipart only. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image")] - public byte[]? Image { get; set; } - - /// - /// JPEG, PNG or WEBP source; at most 50 MB. Multipart only. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] - public string? Imagename { get; set; } - - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - ///
- /// {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - [global::System.Text.Json.Serialization.JsonPropertyName("image_asset_identifier")] - public global::Ideogram.AssetIdentifier? ImageAssetIdentifier { get; set; } - - /// - /// Default draws fewer, simpler shapes; detailed preserves more fine detail.
- /// Default Value: default - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("mode")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.VectorizerRequestModeJsonConverter))] - public global::Ideogram.VectorizerRequestMode? Mode { get; set; } - - /// - /// Request grouping of shapes into layers. Grouping is not yet available.
- /// Default Value: false - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("group")] - public bool? Group { get; set; } - - /// - /// Outputs are private by default. Enterprise outputs are always private. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// URL-safe base64 ID of a writable destination collection. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("target_collection_id")] - public string? TargetCollectionId { get; set; } - - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - ///
- /// https://api.example.com/webhooks/ideogram - [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] - public string? WebhookUrl { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// JPEG, PNG or WEBP source; at most 50 MB. Multipart only. - /// - /// - /// JPEG, PNG or WEBP source; at most 50 MB. Multipart only. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// Default draws fewer, simpler shapes; detailed preserves more fine detail.
- /// Default Value: default - /// - /// - /// Request grouping of shapes into layers. Grouping is not yet available.
- /// Default Value: false - /// - /// - /// Outputs are private by default. Enterprise outputs are always private. - /// - /// - /// URL-safe base64 ID of a writable destination collection. - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public VectorizerRequest( - byte[]? image, - string? imagename, - global::Ideogram.AssetIdentifier? imageAssetIdentifier, - global::Ideogram.VectorizerRequestMode? mode, - bool? group, - bool? @private, - string? targetCollectionId, - string? webhookUrl) - { - this.Image = image; - this.Imagename = imagename; - this.ImageAssetIdentifier = imageAssetIdentifier; - this.Mode = mode; - this.Group = group; - this.Private = @private; - this.TargetCollectionId = targetCollectionId; - this.WebhookUrl = webhookUrl; - } - - /// - /// Initializes a new instance of the class. - /// - public VectorizerRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VectorizerRequestMode.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VectorizerRequestMode.g.cs deleted file mode 100644 index c101c429..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.VectorizerRequestMode.g.cs +++ /dev/null @@ -1,52 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Default draws fewer, simpler shapes; detailed preserves more fine detail.
- /// Default Value: default - ///
- public enum VectorizerRequestMode - { - /// - /// - /// - Default, - /// - /// - /// - Detailed, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class VectorizerRequestModeExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this VectorizerRequestMode value) - { - return value switch - { - VectorizerRequestMode.Default => "default", - VectorizerRequestMode.Detailed => "detailed", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static VectorizerRequestMode? ToEnum(string value) - { - return value switch - { - "default" => VectorizerRequestMode.Default, - "detailed" => VectorizerRequestMode.Detailed, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VectorizerResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VectorizerResponse.Json.g.cs deleted file mode 100644 index 171500d2..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.VectorizerResponse.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class VectorizerResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.VectorizerResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.VectorizerResponse), - jsonSerializerContext) as global::Ideogram.VectorizerResponse; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.VectorizerResponse? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.VectorizerResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.VectorizerResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VectorizerResponse; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VectorizerResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VectorizerResponse.g.cs deleted file mode 100644 index ae1d39a9..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.VectorizerResponse.g.cs +++ /dev/null @@ -1,47 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Example: {"generation_id":"generation_id"} - /// - public sealed partial class VectorizerResponse - { - /// - /// URL-safe base64 generation ID. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("generation_id")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string GenerationId { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// URL-safe base64 generation ID. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public VectorizerResponse( - string generationId) - { - this.GenerationId = generationId ?? throw new global::System.ArgumentNullException(nameof(generationId)); - } - - /// - /// Initializes a new instance of the class. - /// - public VectorizerResponse() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoEditPostEditVideoMinimaxH3ReferenceToVideoRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoEditPostEditVideoMinimaxH3ReferenceToVideoRequest.Json.g.cs new file mode 100644 index 00000000..7647569f --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoEditPostEditVideoMinimaxH3ReferenceToVideoRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoEditPostEditVideoMinimaxH3ReferenceToVideoRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoEditPostEditVideoMinimaxH3ReferenceToVideoRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoEditPostEditVideoMinimaxH3ReferenceToVideoRequest), + jsonSerializerContext) as global::Ideogram.VideoEditPostEditVideoMinimaxH3ReferenceToVideoRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoEditPostEditVideoMinimaxH3ReferenceToVideoRequest? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoEditPostEditVideoMinimaxH3ReferenceToVideoRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoEditPostEditVideoMinimaxH3ReferenceToVideoRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoEditPostEditVideoMinimaxH3ReferenceToVideoRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoEditPostEditVideoMinimaxH3ReferenceToVideoRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoEditPostEditVideoMinimaxH3ReferenceToVideoRequest.g.cs new file mode 100644 index 00000000..20428459 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoEditPostEditVideoMinimaxH3ReferenceToVideoRequest.g.cs @@ -0,0 +1,159 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// + /// + public sealed partial class VideoEditPostEditVideoMinimaxH3ReferenceToVideoRequest + { + /// + /// A natural-language prompt describing the video to produce. Reference media is addressed by position, as in "Image 1 walks toward the camera with the motion of Video 1". + /// + [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Prompt { get; set; } + + /// + /// Images to use as references (max size 50MB each), as raw bytes, in prompt order; only common image formats such as JPEG, PNG, and WEBP are supported. Uploaded images are used for this request only and are not stored. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("reference_images")] + public global::System.Collections.Generic.IList? ReferenceImages { get; set; } + + /// + /// MP3 or WAV audio references, in prompt order as Audio 1, Audio 2, and Audio 3. Multipart uploads only; up to 15 MB per file and 2–15 seconds each. Audio and video references must total no more than 15 seconds. Requires a reference image or video. At most 12 references across images, videos, and audio. Used only for this request and not saved as assets. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("reference_audios")] + public global::System.Collections.Generic.IList? ReferenceAudios { get; set; } + + /// + /// The aspect ratio of the generated video.
+ /// Default Value: 16x9 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.MinimaxH3AspectRatioJsonConverter))] + public global::Ideogram.MinimaxH3AspectRatio? AspectRatio { get; set; } + + /// + /// The resolution tier of the generated video, spelled the way MiniMax
+ /// spells it. `480P` and `768P` are generated natively; `2K` and `4K` are
+ /// upscaled from a `768P` result.
+ /// Higher tiers cost more.
+ /// Default Value: 2K + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.MinimaxH3ResolutionJsonConverter))] + public global::Ideogram.MinimaxH3Resolution? Resolution { get; set; } + + /// + /// The length of the generated video in seconds.
+ /// Default Value: 5 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("duration")] + public int? Duration { get; set; } + + /// + /// How much the model may rewrite the prompt before generating. `disabled`
+ /// uses the prompt as written; the other modes trade latency for a richer
+ /// rewrite.
+ /// Default Value: balanced + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("prompt_expansion_mode")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.MinimaxH3PromptExpansionModeJsonConverter))] + public global::Ideogram.MinimaxH3PromptExpansionMode? PromptExpansionMode { get; set; } + + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] + public string? WebhookUrl { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// A natural-language prompt describing the video to produce. Reference media is addressed by position, as in "Image 1 walks toward the camera with the motion of Video 1". + /// + /// + /// Images to use as references (max size 50MB each), as raw bytes, in prompt order; only common image formats such as JPEG, PNG, and WEBP are supported. Uploaded images are used for this request only and are not stored. + /// + /// + /// MP3 or WAV audio references, in prompt order as Audio 1, Audio 2, and Audio 3. Multipart uploads only; up to 15 MB per file and 2–15 seconds each. Audio and video references must total no more than 15 seconds. Requires a reference image or video. At most 12 references across images, videos, and audio. Used only for this request and not saved as assets. + /// + /// + /// The aspect ratio of the generated video.
+ /// Default Value: 16x9 + /// + /// + /// The resolution tier of the generated video, spelled the way MiniMax
+ /// spells it. `480P` and `768P` are generated natively; `2K` and `4K` are
+ /// upscaled from a `768P` result.
+ /// Higher tiers cost more.
+ /// Default Value: 2K + /// + /// + /// The length of the generated video in seconds.
+ /// Default Value: 5 + /// + /// + /// How much the model may rewrite the prompt before generating. `disabled`
+ /// uses the prompt as written; the other modes trade latency for a richer
+ /// rewrite.
+ /// Default Value: balanced + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public VideoEditPostEditVideoMinimaxH3ReferenceToVideoRequest( + string prompt, + global::System.Collections.Generic.IList? referenceImages, + global::System.Collections.Generic.IList? referenceAudios, + global::Ideogram.MinimaxH3AspectRatio? aspectRatio, + global::Ideogram.MinimaxH3Resolution? resolution, + int? duration, + global::Ideogram.MinimaxH3PromptExpansionMode? promptExpansionMode, + string? webhookUrl) + { + this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); + this.ReferenceImages = referenceImages; + this.ReferenceAudios = referenceAudios; + this.AspectRatio = aspectRatio; + this.Resolution = resolution; + this.Duration = duration; + this.PromptExpansionMode = promptExpansionMode; + this.WebhookUrl = webhookUrl; + } + + /// + /// Initializes a new instance of the class. + /// + public VideoEditPostEditVideoMinimaxH3ReferenceToVideoRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse.Json.g.cs new file mode 100644 index 00000000..74cc02a3 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse), + jsonSerializerContext) as global::Ideogram.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse.g.cs new file mode 100644 index 00000000..505c734e --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse2.Json.g.cs new file mode 100644 index 00000000..8cc8a6af --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse2), + jsonSerializerContext) as global::Ideogram.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse2.g.cs new file mode 100644 index 00000000..b87cc121 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse3.Json.g.cs new file mode 100644 index 00000000..53e710b3 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse3), + jsonSerializerContext) as global::Ideogram.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse3? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse3), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse3.g.cs new file mode 100644 index 00000000..bab6d74f --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse4.Json.g.cs new file mode 100644 index 00000000..595204a5 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse4), + jsonSerializerContext) as global::Ideogram.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse4? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse4), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse4.g.cs new file mode 100644 index 00000000..c3308fd5 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse5.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse5.Json.g.cs new file mode 100644 index 00000000..9cbe83af --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse5 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse5? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse5), + jsonSerializerContext) as global::Ideogram.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse5; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse5? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse5? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse5), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse5; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse5.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse5.g.cs new file mode 100644 index 00000000..9c514325 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse5.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse5 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse6.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse6.Json.g.cs new file mode 100644 index 00000000..88d4376a --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse6.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse6 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse6? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse6), + jsonSerializerContext) as global::Ideogram.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse6; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse6? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse6? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse6), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse6; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse6.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse6.g.cs new file mode 100644 index 00000000..09eea06e --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse6.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse6 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse7.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse7.Json.g.cs new file mode 100644 index 00000000..c45718fe --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse7.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse7 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse7? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse7), + jsonSerializerContext) as global::Ideogram.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse7; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse7? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse7? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse7), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse7; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse7.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse7.g.cs new file mode 100644 index 00000000..aa574f67 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse7.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse7 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoRequest.Json.g.cs new file mode 100644 index 00000000..fc4834e6 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoRequest), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoRequest? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoRequest.g.cs new file mode 100644 index 00000000..827afa45 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoRequest.g.cs @@ -0,0 +1,186 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// + /// + public sealed partial class VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoRequest + { + /// + /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("image")] + [global::System.Text.Json.Serialization.JsonRequired] + public required byte[] Image { get; set; } + + /// + /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Imagename { get; set; } + + /// + /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("end_image")] + public byte[]? EndImage { get; set; } + + /// + /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("end_imagename")] + public string? EndImagename { get; set; } + + /// + /// A natural-language prompt describing how the first frame should animate. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Prompt { get; set; } + + /// + /// Description of what to keep out of the video. Descriptions in the prompt take precedence over descriptions in the negative prompt. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("negative_prompt")] + public string? NegativePrompt { get; set; } + + /// + /// The length of the generated video in seconds. Defaults to 5 seconds
+ /// when omitted. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("duration")] + public int? Duration { get; set; } + + /// + /// Whether to generate an audio track for the video. Audio roughly
+ /// doubles the provider cost and is subject to stricter output moderation.
+ /// Default Value: false + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("generate_audio")] + public bool? GenerateAudio { get; set; } + + /// + /// How the prompt is staged. `customize` follows the prompt as written;
+ /// `intelligent` lets the model break the prompt into its own shots.
+ /// Default Value: customize + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("shot_type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.KlingV3ShotTypeJsonConverter))] + public global::Ideogram.KlingV3ShotType? ShotType { get; set; } + + /// + /// How closely the video follows the prompt, from 0 to 1. Lower values
+ /// leave the model more freedom. Defaults to 0.5 when omitted. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("cfg_scale")] + public string? CfgScale { get; set; } + + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] + public string? WebhookUrl { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// A natural-language prompt describing how the first frame should animate. + /// + /// + /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. + /// + /// + /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. + /// + /// + /// Description of what to keep out of the video. Descriptions in the prompt take precedence over descriptions in the negative prompt. + /// + /// + /// The length of the generated video in seconds. Defaults to 5 seconds
+ /// when omitted. + /// + /// + /// Whether to generate an audio track for the video. Audio roughly
+ /// doubles the provider cost and is subject to stricter output moderation.
+ /// Default Value: false + /// + /// + /// How the prompt is staged. `customize` follows the prompt as written;
+ /// `intelligent` lets the model break the prompt into its own shots.
+ /// Default Value: customize + /// + /// + /// How closely the video follows the prompt, from 0 to 1. Lower values
+ /// leave the model more freedom. Defaults to 0.5 when omitted. + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoRequest( + byte[] image, + string imagename, + string prompt, + byte[]? endImage, + string? endImagename, + string? negativePrompt, + int? duration, + bool? generateAudio, + global::Ideogram.KlingV3ShotType? shotType, + string? cfgScale, + string? webhookUrl) + { + this.Image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + this.Imagename = imagename ?? throw new global::System.ArgumentNullException(nameof(imagename)); + this.EndImage = endImage; + this.EndImagename = endImagename; + this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); + this.NegativePrompt = negativePrompt; + this.Duration = duration; + this.GenerateAudio = generateAudio; + this.ShotType = shotType; + this.CfgScale = cfgScale; + this.WebhookUrl = webhookUrl; + } + + /// + /// Initializes a new instance of the class. + /// + public VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse.Json.g.cs new file mode 100644 index 00000000..057e24c2 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse.g.cs new file mode 100644 index 00000000..1d432727 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse2.Json.g.cs new file mode 100644 index 00000000..99ab05e8 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse2), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse2.g.cs new file mode 100644 index 00000000..0f43b5f9 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse3.Json.g.cs new file mode 100644 index 00000000..b1756782 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse3), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse3? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse3), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse3.g.cs new file mode 100644 index 00000000..40a621f4 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse4.Json.g.cs new file mode 100644 index 00000000..12438a82 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse4), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse4? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse4), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse4.g.cs new file mode 100644 index 00000000..bb253b75 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse5.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse5.Json.g.cs new file mode 100644 index 00000000..de748d40 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse5 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse5? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse5), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse5; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse5? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse5? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse5), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse5; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse5.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse5.g.cs new file mode 100644 index 00000000..21bdbd01 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse5.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse5 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse6.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse6.Json.g.cs new file mode 100644 index 00000000..3e940dca --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse6.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse6 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse6? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse6), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse6; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse6? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse6? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse6), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse6; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse6.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse6.g.cs new file mode 100644 index 00000000..d99642ef --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse6.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse6 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse7.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse7.Json.g.cs new file mode 100644 index 00000000..af3ad5d2 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse7.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse7 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse7? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse7), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse7; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse7? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse7? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse7), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse7; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse7.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse7.g.cs new file mode 100644 index 00000000..8cf6510f --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse7.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse7 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse.Json.g.cs new file mode 100644 index 00000000..fadb6b52 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse.g.cs new file mode 100644 index 00000000..6548800f --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse2.Json.g.cs new file mode 100644 index 00000000..94dc4958 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse2), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse2.g.cs new file mode 100644 index 00000000..4b538066 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse3.Json.g.cs new file mode 100644 index 00000000..82c2abb2 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse3), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse3? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse3), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse3.g.cs new file mode 100644 index 00000000..7acc1238 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse4.Json.g.cs new file mode 100644 index 00000000..6d3c795b --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse4), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse4? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse4), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse4.g.cs new file mode 100644 index 00000000..137f595d --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse5.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse5.Json.g.cs new file mode 100644 index 00000000..41547c2d --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse5 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse5? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse5), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse5; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse5? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse5? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse5), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse5; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse5.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse5.g.cs new file mode 100644 index 00000000..576058e0 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse5.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse5 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse6.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse6.Json.g.cs new file mode 100644 index 00000000..9f67f5ee --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse6.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse6 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse6? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse6), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse6; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse6? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse6? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse6), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse6; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse6.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse6.g.cs new file mode 100644 index 00000000..e5c16123 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse6.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse6 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoRequest.Json.g.cs new file mode 100644 index 00000000..f526b5dd --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoRequest), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoRequest? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoRequest.g.cs new file mode 100644 index 00000000..7e3e40b7 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoRequest.g.cs @@ -0,0 +1,151 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// + /// + public sealed partial class VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoRequest + { + /// + /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("image")] + [global::System.Text.Json.Serialization.JsonRequired] + public required byte[] Image { get; set; } + + /// + /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Imagename { get; set; } + + /// + /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("end_image")] + public byte[]? EndImage { get; set; } + + /// + /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("end_imagename")] + public string? EndImagename { get; set; } + + /// + /// A natural-language prompt describing how the first frame should animate. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Prompt { get; set; } + + /// + /// The resolution tier of the generated video, spelled the way MiniMax
+ /// spells it. `480P` and `768P` are generated natively; `2K` and `4K` are
+ /// upscaled from a `768P` result.
+ /// Higher tiers cost more.
+ /// Default Value: 2K + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.MinimaxH3ResolutionJsonConverter))] + public global::Ideogram.MinimaxH3Resolution? Resolution { get; set; } + + /// + /// The length of the generated video in seconds.
+ /// Default Value: 5 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("duration")] + public int? Duration { get; set; } + + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] + public string? WebhookUrl { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// A natural-language prompt describing how the first frame should animate. + /// + /// + /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. + /// + /// + /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. + /// + /// + /// The resolution tier of the generated video, spelled the way MiniMax
+ /// spells it. `480P` and `768P` are generated natively; `2K` and `4K` are
+ /// upscaled from a `768P` result.
+ /// Higher tiers cost more.
+ /// Default Value: 2K + /// + /// + /// The length of the generated video in seconds.
+ /// Default Value: 5 + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoRequest( + byte[] image, + string imagename, + string prompt, + byte[]? endImage, + string? endImagename, + global::Ideogram.MinimaxH3Resolution? resolution, + int? duration, + string? webhookUrl) + { + this.Image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + this.Imagename = imagename ?? throw new global::System.ArgumentNullException(nameof(imagename)); + this.EndImage = endImage; + this.EndImagename = endImagename; + this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); + this.Resolution = resolution; + this.Duration = duration; + this.WebhookUrl = webhookUrl; + } + + /// + /// Initializes a new instance of the class. + /// + public VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse.Json.g.cs new file mode 100644 index 00000000..8e22ab18 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse.g.cs new file mode 100644 index 00000000..5f19d4f4 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse2.Json.g.cs new file mode 100644 index 00000000..12d4bc24 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse2), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse2.g.cs new file mode 100644 index 00000000..9d4c53ac --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse3.Json.g.cs new file mode 100644 index 00000000..92ee3ad2 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse3), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse3? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse3), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse3.g.cs new file mode 100644 index 00000000..42c589ba --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse4.Json.g.cs new file mode 100644 index 00000000..9bbec0dd --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse4), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse4? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse4), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse4.g.cs new file mode 100644 index 00000000..a37aa244 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse5.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse5.Json.g.cs new file mode 100644 index 00000000..1dea1b75 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse5 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse5? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse5), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse5; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse5? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse5? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse5), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse5; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse5.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse5.g.cs new file mode 100644 index 00000000..c92dc2cf --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse5.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse5 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse6.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse6.Json.g.cs new file mode 100644 index 00000000..31f805d8 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse6.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse6 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse6? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse6), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse6; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse6? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse6? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse6), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse6; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse6.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse6.g.cs new file mode 100644 index 00000000..0d665589 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse6.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse6 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse7.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse7.Json.g.cs new file mode 100644 index 00000000..e851d211 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse7.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse7 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse7? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse7), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse7; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse7? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse7? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse7), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse7; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse7.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse7.g.cs new file mode 100644 index 00000000..5f9f18bf --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse7.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse7 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse.Json.g.cs new file mode 100644 index 00000000..6544c93c --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse.g.cs new file mode 100644 index 00000000..9af4678d --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse2.Json.g.cs new file mode 100644 index 00000000..adc732d6 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse2), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse2.g.cs new file mode 100644 index 00000000..9dbb096b --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse3.Json.g.cs new file mode 100644 index 00000000..f6f59180 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse3), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse3? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse3), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse3.g.cs new file mode 100644 index 00000000..adaadd91 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse4.Json.g.cs new file mode 100644 index 00000000..cc56a531 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse4), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse4? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse4), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse4.g.cs new file mode 100644 index 00000000..36c10359 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse5.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse5.Json.g.cs new file mode 100644 index 00000000..58ba2ea8 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse5 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse5? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse5), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse5; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse5? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse5? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse5), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse5; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse5.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse5.g.cs new file mode 100644 index 00000000..74bd30d5 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse5.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse5 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse6.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse6.Json.g.cs new file mode 100644 index 00000000..150d0904 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse6.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse6 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse6? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse6), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse6; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse6? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse6? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse6), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse6; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse6.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse6.g.cs new file mode 100644 index 00000000..e22ede7b --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse6.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse6 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoRequest.Json.g.cs new file mode 100644 index 00000000..6b81648e --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoSeedDance25ImageToVideoRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoRequest), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoRequest? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoRequest.g.cs new file mode 100644 index 00000000..0336b088 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoRequest.g.cs @@ -0,0 +1,160 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// + /// + public sealed partial class VideoGeneratePostGenerateVideoSeedDance25ImageToVideoRequest + { + /// + /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("image")] + [global::System.Text.Json.Serialization.JsonRequired] + public required byte[] Image { get; set; } + + /// + /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Imagename { get; set; } + + /// + /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("end_image")] + public byte[]? EndImage { get; set; } + + /// + /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("end_imagename")] + public string? EndImagename { get; set; } + + /// + /// A natural-language prompt describing how the first frame should animate. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Prompt { get; set; } + + /// + /// The resolution tier of the generated video.
+ /// Default Value: 720p + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.SeedDance25ResolutionJsonConverter))] + public global::Ideogram.SeedDance25Resolution? Resolution { get; set; } + + /// + /// The length of the generated video in seconds. When omitted, the model
+ /// picks the best duration for the prompt ("auto"). + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("duration")] + public int? Duration { get; set; } + + /// + /// Whether to generate an audio track for the video. Audio roughly
+ /// doubles the provider cost and is subject to stricter output moderation.
+ /// Default Value: false + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("generate_audio")] + public bool? GenerateAudio { get; set; } + + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] + public string? WebhookUrl { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// A natural-language prompt describing how the first frame should animate. + /// + /// + /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. + /// + /// + /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. + /// + /// + /// The resolution tier of the generated video.
+ /// Default Value: 720p + /// + /// + /// The length of the generated video in seconds. When omitted, the model
+ /// picks the best duration for the prompt ("auto"). + /// + /// + /// Whether to generate an audio track for the video. Audio roughly
+ /// doubles the provider cost and is subject to stricter output moderation.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public VideoGeneratePostGenerateVideoSeedDance25ImageToVideoRequest( + byte[] image, + string imagename, + string prompt, + byte[]? endImage, + string? endImagename, + global::Ideogram.SeedDance25Resolution? resolution, + int? duration, + bool? generateAudio, + string? webhookUrl) + { + this.Image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + this.Imagename = imagename ?? throw new global::System.ArgumentNullException(nameof(imagename)); + this.EndImage = endImage; + this.EndImagename = endImagename; + this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); + this.Resolution = resolution; + this.Duration = duration; + this.GenerateAudio = generateAudio; + this.WebhookUrl = webhookUrl; + } + + /// + /// Initializes a new instance of the class. + /// + public VideoGeneratePostGenerateVideoSeedDance25ImageToVideoRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse.Json.g.cs new file mode 100644 index 00000000..6a6f7f69 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse.g.cs new file mode 100644 index 00000000..573904f7 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse2.Json.g.cs new file mode 100644 index 00000000..fd1c28db --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse2), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse2.g.cs new file mode 100644 index 00000000..3b9c1399 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse3.Json.g.cs new file mode 100644 index 00000000..3d43554a --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse3), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse3? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse3), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse3.g.cs new file mode 100644 index 00000000..e803b3a6 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse4.Json.g.cs new file mode 100644 index 00000000..785da14d --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse4), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse4? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse4), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse4.g.cs new file mode 100644 index 00000000..05c94c3d --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse5.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse5.Json.g.cs new file mode 100644 index 00000000..d7596e4b --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse5 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse5? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse5), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse5; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse5? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse5? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse5), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse5; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse5.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse5.g.cs new file mode 100644 index 00000000..d0d8beb9 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse5.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse5 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse6.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse6.Json.g.cs new file mode 100644 index 00000000..9997c7ee --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse6.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse6 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse6? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse6), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse6; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse6? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse6? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse6), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse6; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse6.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse6.g.cs new file mode 100644 index 00000000..02fb9299 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse6.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse6 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse7.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse7.Json.g.cs new file mode 100644 index 00000000..b1a09def --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse7.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse7 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse7? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse7), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse7; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse7? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse7? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse7), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse7; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse7.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse7.g.cs new file mode 100644 index 00000000..bf5511f3 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse7.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse7 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoRequest.Json.g.cs new file mode 100644 index 00000000..7df1ab24 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoRequest), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoRequest? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoRequest.g.cs new file mode 100644 index 00000000..0300177c --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoRequest.g.cs @@ -0,0 +1,152 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// + /// + public sealed partial class VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoRequest + { + /// + /// A natural-language prompt describing the video to produce. Refer to references by position, as in "[Image1] walks toward the camera". + /// + [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Prompt { get; set; } + + /// + /// Reference images, in prompt order. Common formats such as JPEG, PNG, and WEBP are supported, up to 50MB each. Multipart requests only. Uploaded images are used for this request only and are not stored. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("reference_images")] + public global::System.Collections.Generic.IList? ReferenceImages { get; set; } + + /// + /// MP3 or WAV audio references, in prompt order. Multipart requests only. Each file must be at most 15 MB and between 2 and 30 seconds long, with a combined duration of at most 30 seconds. Requires at least one reference image. Audio is used for this request only and is not saved to your library. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("reference_audios")] + public global::System.Collections.Generic.IList? ReferenceAudios { get; set; } + + /// + /// The aspect ratio of the generated video. `auto` lets the model choose the
+ /// most suitable ratio from the prompt; any other value pins the ratio.
+ /// Default Value: auto + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.SeedDance2AspectRatioJsonConverter))] + public global::Ideogram.SeedDance2AspectRatio? AspectRatio { get; set; } + + /// + /// The resolution tier of the generated video.
+ /// Default Value: 720p + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.SeedDance25ResolutionJsonConverter))] + public global::Ideogram.SeedDance25Resolution? Resolution { get; set; } + + /// + /// The length of the generated video in seconds. When omitted, the model
+ /// picks the best duration for the prompt ("auto"). + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("duration")] + public int? Duration { get; set; } + + /// + /// Whether to generate an audio track for the video. Audio roughly
+ /// doubles the provider cost and is subject to stricter output moderation.
+ /// Default Value: false + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("generate_audio")] + public bool? GenerateAudio { get; set; } + + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] + public string? WebhookUrl { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// A natural-language prompt describing the video to produce. Refer to references by position, as in "[Image1] walks toward the camera". + /// + /// + /// Reference images, in prompt order. Common formats such as JPEG, PNG, and WEBP are supported, up to 50MB each. Multipart requests only. Uploaded images are used for this request only and are not stored. + /// + /// + /// MP3 or WAV audio references, in prompt order. Multipart requests only. Each file must be at most 15 MB and between 2 and 30 seconds long, with a combined duration of at most 30 seconds. Requires at least one reference image. Audio is used for this request only and is not saved to your library. + /// + /// + /// The aspect ratio of the generated video. `auto` lets the model choose the
+ /// most suitable ratio from the prompt; any other value pins the ratio.
+ /// Default Value: auto + /// + /// + /// The resolution tier of the generated video.
+ /// Default Value: 720p + /// + /// + /// The length of the generated video in seconds. When omitted, the model
+ /// picks the best duration for the prompt ("auto"). + /// + /// + /// Whether to generate an audio track for the video. Audio roughly
+ /// doubles the provider cost and is subject to stricter output moderation.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoRequest( + string prompt, + global::System.Collections.Generic.IList? referenceImages, + global::System.Collections.Generic.IList? referenceAudios, + global::Ideogram.SeedDance2AspectRatio? aspectRatio, + global::Ideogram.SeedDance25Resolution? resolution, + int? duration, + bool? generateAudio, + string? webhookUrl) + { + this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); + this.ReferenceImages = referenceImages; + this.ReferenceAudios = referenceAudios; + this.AspectRatio = aspectRatio; + this.Resolution = resolution; + this.Duration = duration; + this.GenerateAudio = generateAudio; + this.WebhookUrl = webhookUrl; + } + + /// + /// Initializes a new instance of the class. + /// + public VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse.Json.g.cs new file mode 100644 index 00000000..37bfd660 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse.g.cs new file mode 100644 index 00000000..e5d44307 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse2.Json.g.cs new file mode 100644 index 00000000..de9cb4b5 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse2), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse2.g.cs new file mode 100644 index 00000000..18b6b979 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse3.Json.g.cs new file mode 100644 index 00000000..d85a7795 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse3), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse3? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse3), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse3.g.cs new file mode 100644 index 00000000..53cad3db --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse4.Json.g.cs new file mode 100644 index 00000000..77277f20 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse4), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse4? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse4), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse4.g.cs new file mode 100644 index 00000000..4ab80bd2 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse5.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse5.Json.g.cs new file mode 100644 index 00000000..17ecf928 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse5 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse5? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse5), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse5; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse5? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse5? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse5), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse5; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse5.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse5.g.cs new file mode 100644 index 00000000..a4f7c882 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse5.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse5 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse6.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse6.Json.g.cs new file mode 100644 index 00000000..26ced5a9 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse6.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse6 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse6? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse6), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse6; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse6? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse6? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse6), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse6; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse6.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse6.g.cs new file mode 100644 index 00000000..e5f09fcf --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse6.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse6 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse7.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse7.Json.g.cs new file mode 100644 index 00000000..f26eeca3 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse7.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse7 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse7? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse7), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse7; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse7? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse7? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse7), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse7; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse7.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse7.g.cs new file mode 100644 index 00000000..18a66ca4 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse7.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse7 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse.Json.g.cs new file mode 100644 index 00000000..b71965eb --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse.g.cs new file mode 100644 index 00000000..31231169 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse2.Json.g.cs new file mode 100644 index 00000000..bad1ee38 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse2), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse2.g.cs new file mode 100644 index 00000000..74adadc8 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse3.Json.g.cs new file mode 100644 index 00000000..5cecc6a3 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse3), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse3? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse3), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse3.g.cs new file mode 100644 index 00000000..ac890fa2 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse4.Json.g.cs new file mode 100644 index 00000000..619bdb80 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse4), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse4? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse4), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse4.g.cs new file mode 100644 index 00000000..93e3f290 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse5.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse5.Json.g.cs new file mode 100644 index 00000000..62c7c33c --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse5 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse5? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse5), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse5; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse5? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse5? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse5), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse5; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse5.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse5.g.cs new file mode 100644 index 00000000..5d0e68a6 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse5.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse5 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse6.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse6.Json.g.cs new file mode 100644 index 00000000..86e1a8c6 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse6.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse6 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse6? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse6), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse6; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse6? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse6? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse6), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse6; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse6.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse6.g.cs new file mode 100644 index 00000000..28a6c378 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse6.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse6 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoRequest.Json.g.cs new file mode 100644 index 00000000..7252c392 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoSeedDance2ImageToVideoRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoRequest), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoRequest? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoRequest.g.cs new file mode 100644 index 00000000..b91dcdb2 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoRequest.g.cs @@ -0,0 +1,176 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// + /// + public sealed partial class VideoGeneratePostGenerateVideoSeedDance2ImageToVideoRequest + { + /// + /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("image")] + [global::System.Text.Json.Serialization.JsonRequired] + public required byte[] Image { get; set; } + + /// + /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Imagename { get; set; } + + /// + /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("end_image")] + public byte[]? EndImage { get; set; } + + /// + /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("end_imagename")] + public string? EndImagename { get; set; } + + /// + /// A natural-language prompt describing how the first frame should animate. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Prompt { get; set; } + + /// + /// The aspect ratio of the generated video. `auto` lets the model choose the
+ /// most suitable ratio from the prompt; any other value pins the ratio.
+ /// Default Value: auto + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.SeedDance2AspectRatioJsonConverter))] + public global::Ideogram.SeedDance2AspectRatio? AspectRatio { get; set; } + + /// + /// The resolution tier of the generated video.
+ /// Default Value: 720p + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.SeedDance2ResolutionJsonConverter))] + public global::Ideogram.SeedDance2Resolution? Resolution { get; set; } + + /// + /// The length of the generated video in seconds. When omitted, the model
+ /// picks the best duration for the prompt ("auto"). + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("duration")] + public int? Duration { get; set; } + + /// + /// Whether to generate an audio track for the video. Audio roughly
+ /// doubles the provider cost and is subject to stricter output moderation.
+ /// Default Value: false + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("generate_audio")] + public bool? GenerateAudio { get; set; } + + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] + public string? WebhookUrl { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// A natural-language prompt describing how the first frame should animate. + /// + /// + /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. + /// + /// + /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. + /// + /// + /// The aspect ratio of the generated video. `auto` lets the model choose the
+ /// most suitable ratio from the prompt; any other value pins the ratio.
+ /// Default Value: auto + /// + /// + /// The resolution tier of the generated video.
+ /// Default Value: 720p + /// + /// + /// The length of the generated video in seconds. When omitted, the model
+ /// picks the best duration for the prompt ("auto"). + /// + /// + /// Whether to generate an audio track for the video. Audio roughly
+ /// doubles the provider cost and is subject to stricter output moderation.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public VideoGeneratePostGenerateVideoSeedDance2ImageToVideoRequest( + byte[] image, + string imagename, + string prompt, + byte[]? endImage, + string? endImagename, + global::Ideogram.SeedDance2AspectRatio? aspectRatio, + global::Ideogram.SeedDance2Resolution? resolution, + int? duration, + bool? generateAudio, + string? webhookUrl) + { + this.Image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + this.Imagename = imagename ?? throw new global::System.ArgumentNullException(nameof(imagename)); + this.EndImage = endImage; + this.EndImagename = endImagename; + this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); + this.AspectRatio = aspectRatio; + this.Resolution = resolution; + this.Duration = duration; + this.GenerateAudio = generateAudio; + this.WebhookUrl = webhookUrl; + } + + /// + /// Initializes a new instance of the class. + /// + public VideoGeneratePostGenerateVideoSeedDance2ImageToVideoRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse.Json.g.cs new file mode 100644 index 00000000..1b1c0cae --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse.g.cs new file mode 100644 index 00000000..d2174f4c --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse2.Json.g.cs new file mode 100644 index 00000000..e4892212 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse2), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse2.g.cs new file mode 100644 index 00000000..3173b223 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse3.Json.g.cs new file mode 100644 index 00000000..461b96e3 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse3), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse3? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse3), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse3.g.cs new file mode 100644 index 00000000..bf4eed43 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse4.Json.g.cs new file mode 100644 index 00000000..a59d678c --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse4), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse4? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse4), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse4.g.cs new file mode 100644 index 00000000..225e6936 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse5.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse5.Json.g.cs new file mode 100644 index 00000000..39cc708a --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse5 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse5? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse5), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse5; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse5? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse5? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse5), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse5; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse5.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse5.g.cs new file mode 100644 index 00000000..63bea205 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse5.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse5 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse6.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse6.Json.g.cs new file mode 100644 index 00000000..38e01ca9 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse6.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse6 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse6? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse6), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse6; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse6? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse6? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse6), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse6; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse6.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse6.g.cs new file mode 100644 index 00000000..ef76cbdb --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse6.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse6 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse7.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse7.Json.g.cs new file mode 100644 index 00000000..cd35f371 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse7.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse7 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse7? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse7), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse7; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse7? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse7? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse7), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse7; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse7.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse7.g.cs new file mode 100644 index 00000000..9ac14cca --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse7.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse7 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoRequest.Json.g.cs new file mode 100644 index 00000000..ebd4fc16 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoRequest), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoRequest? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoRequest.g.cs new file mode 100644 index 00000000..bb8f02ba --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoRequest.g.cs @@ -0,0 +1,152 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// + /// + public sealed partial class VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoRequest + { + /// + /// A natural-language prompt describing the video to produce. Refer to references by position, as in "@Image1 walks toward the camera". + /// + [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Prompt { get; set; } + + /// + /// Reference images, in prompt order. Common formats such as JPEG, PNG, and WEBP are supported, up to 50MB each. Multipart requests only. Uploaded images are used for this request only and are not stored. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("reference_images")] + public global::System.Collections.Generic.IList? ReferenceImages { get; set; } + + /// + /// MP3 or WAV audio references, in prompt order. Multipart requests only. Each file must be at most 15 MB and between 2 and 15 seconds long, with a combined duration of at most 15 seconds. Requires at least one reference image. Audio is used for this request only and is not saved to your library. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("reference_audios")] + public global::System.Collections.Generic.IList? ReferenceAudios { get; set; } + + /// + /// The aspect ratio of the generated video. `auto` lets the model choose the
+ /// most suitable ratio from the prompt; any other value pins the ratio.
+ /// Default Value: auto + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.SeedDance2AspectRatioJsonConverter))] + public global::Ideogram.SeedDance2AspectRatio? AspectRatio { get; set; } + + /// + /// The resolution tier of the generated video.
+ /// Default Value: 720p + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.SeedDance2ResolutionJsonConverter))] + public global::Ideogram.SeedDance2Resolution? Resolution { get; set; } + + /// + /// The length of the generated video in seconds. When omitted, the model
+ /// picks the best duration for the prompt ("auto"). + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("duration")] + public int? Duration { get; set; } + + /// + /// Whether to generate an audio track for the video. Audio roughly
+ /// doubles the provider cost and is subject to stricter output moderation.
+ /// Default Value: false + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("generate_audio")] + public bool? GenerateAudio { get; set; } + + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] + public string? WebhookUrl { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// A natural-language prompt describing the video to produce. Refer to references by position, as in "@Image1 walks toward the camera". + /// + /// + /// Reference images, in prompt order. Common formats such as JPEG, PNG, and WEBP are supported, up to 50MB each. Multipart requests only. Uploaded images are used for this request only and are not stored. + /// + /// + /// MP3 or WAV audio references, in prompt order. Multipart requests only. Each file must be at most 15 MB and between 2 and 15 seconds long, with a combined duration of at most 15 seconds. Requires at least one reference image. Audio is used for this request only and is not saved to your library. + /// + /// + /// The aspect ratio of the generated video. `auto` lets the model choose the
+ /// most suitable ratio from the prompt; any other value pins the ratio.
+ /// Default Value: auto + /// + /// + /// The resolution tier of the generated video.
+ /// Default Value: 720p + /// + /// + /// The length of the generated video in seconds. When omitted, the model
+ /// picks the best duration for the prompt ("auto"). + /// + /// + /// Whether to generate an audio track for the video. Audio roughly
+ /// doubles the provider cost and is subject to stricter output moderation.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoRequest( + string prompt, + global::System.Collections.Generic.IList? referenceImages, + global::System.Collections.Generic.IList? referenceAudios, + global::Ideogram.SeedDance2AspectRatio? aspectRatio, + global::Ideogram.SeedDance2Resolution? resolution, + int? duration, + bool? generateAudio, + string? webhookUrl) + { + this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); + this.ReferenceImages = referenceImages; + this.ReferenceAudios = referenceAudios; + this.AspectRatio = aspectRatio; + this.Resolution = resolution; + this.Duration = duration; + this.GenerateAudio = generateAudio; + this.WebhookUrl = webhookUrl; + } + + /// + /// Initializes a new instance of the class. + /// + public VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse.Json.g.cs new file mode 100644 index 00000000..067a2360 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse.g.cs new file mode 100644 index 00000000..9a30f81c --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse2.Json.g.cs new file mode 100644 index 00000000..fb4010be --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse2), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse2.g.cs new file mode 100644 index 00000000..1c12f3cb --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse3.Json.g.cs new file mode 100644 index 00000000..c75c4a37 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse3), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse3? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse3), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse3.g.cs new file mode 100644 index 00000000..30ee343b --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse4.Json.g.cs new file mode 100644 index 00000000..cc1d174d --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse4), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse4? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse4), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse4.g.cs new file mode 100644 index 00000000..0d6f1c48 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse5.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse5.Json.g.cs new file mode 100644 index 00000000..6c97df47 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse5 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse5? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse5), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse5; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse5? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse5? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse5), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse5; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse5.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse5.g.cs new file mode 100644 index 00000000..fee0ba57 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse5.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse5 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse6.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse6.Json.g.cs new file mode 100644 index 00000000..2719a641 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse6.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse6 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse6? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse6), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse6; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse6? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse6? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse6), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse6; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse6.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse6.g.cs new file mode 100644 index 00000000..2538a980 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse6.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse6 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse7.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse7.Json.g.cs new file mode 100644 index 00000000..de944887 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse7.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse7 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse7? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse7), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse7; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse7? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse7? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse7), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse7; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse7.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse7.g.cs new file mode 100644 index 00000000..a0405010 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse7.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse7 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse.Json.g.cs new file mode 100644 index 00000000..f25ad292 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse.g.cs new file mode 100644 index 00000000..6eafbef0 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse2.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse2.Json.g.cs new file mode 100644 index 00000000..047b5c94 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse2), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse2? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse2), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse2.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse2.g.cs new file mode 100644 index 00000000..9d77c054 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse3.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse3.Json.g.cs new file mode 100644 index 00000000..fe8d74c6 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse3), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse3? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse3), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse3.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse3.g.cs new file mode 100644 index 00000000..be2e2f7d --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse4.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse4.Json.g.cs new file mode 100644 index 00000000..a638ba7e --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse4), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse4? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse4), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse4.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse4.g.cs new file mode 100644 index 00000000..22deaad7 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse5.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse5.Json.g.cs new file mode 100644 index 00000000..1dd8161c --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse5 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse5? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse5), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse5; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse5? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse5? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse5), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse5; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse5.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse5.g.cs new file mode 100644 index 00000000..869489f7 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse5.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse5 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse6.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse6.Json.g.cs new file mode 100644 index 00000000..b1d954c0 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse6.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse6 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse6? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse6), + jsonSerializerContext) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse6; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse6? FromJson( + string json) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse6? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse6), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse6; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Ideogram.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse6.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse6.g.cs new file mode 100644 index 00000000..20bd7e21 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse6.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Any type + /// + public sealed partial class VideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse6 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoObject.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoObject.Json.g.cs deleted file mode 100644 index 5e57af6a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.VideoObject.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class VideoObject - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.VideoObject? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.VideoObject), - jsonSerializerContext) as global::Ideogram.VideoObject; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.VideoObject? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.VideoObject? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.VideoObject), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VideoObject; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoObject.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoObject.g.cs deleted file mode 100644 index 7bafba5f..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.VideoObject.g.cs +++ /dev/null @@ -1,129 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// A single generated video returned by the generation polling endpoint. - /// - public sealed partial class VideoObject - { - /// - /// The generated video's asset ID. Use it with asset_type RESPONSE in video_asset_identifier for a follow-up video edit. This is distinct from the generation ID used for polling. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("asset_id")] - public string? AssetId { get; set; } - - /// - /// Discriminator marking this entry as a generated video in the polling endpoint's mixed data array. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("object_type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.VideoObjectObjectTypeJsonConverter))] - public global::Ideogram.VideoObjectObjectType? ObjectType { get; set; } - - /// - /// The direct link to the generated video.
- /// Example: https://ideogram.ai/assets/video/lossless/response/xtdZiqPwRxqY1Y7NExFmzB.mp4?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89 - ///
- /// https://ideogram.ai/assets/video/lossless/response/xtdZiqPwRxqY1Y7NExFmzB.mp4?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89 - [global::System.Text.Json.Serialization.JsonPropertyName("url")] - public string? Url { get; set; } - - /// - /// The prompt used for the generation. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Prompt { get; set; } - - /// - /// The resolution tier of the generated video.
- /// Example: 720p - ///
- /// 720p - [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Resolution { get; set; } - - /// - /// The actual aspect ratio of the produced video, formatted as "{width}:{height}".
- /// Example: 16:9 - ///
- /// 16:9 - [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string AspectRatio { get; set; } - - /// - /// The actual measured length of the produced video in seconds.
- /// Example: 5 - ///
- /// 5 - [global::System.Text.Json.Serialization.JsonPropertyName("duration")] - [global::System.Text.Json.Serialization.JsonRequired] - public required int Duration { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The prompt used for the generation. - /// - /// - /// The resolution tier of the generated video.
- /// Example: 720p - /// - /// - /// The actual aspect ratio of the produced video, formatted as "{width}:{height}".
- /// Example: 16:9 - /// - /// - /// The actual measured length of the produced video in seconds.
- /// Example: 5 - /// - /// - /// The generated video's asset ID. Use it with asset_type RESPONSE in video_asset_identifier for a follow-up video edit. This is distinct from the generation ID used for polling. - /// - /// - /// Discriminator marking this entry as a generated video in the polling endpoint's mixed data array. - /// - /// - /// The direct link to the generated video.
- /// Example: https://ideogram.ai/assets/video/lossless/response/xtdZiqPwRxqY1Y7NExFmzB.mp4?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89 - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public VideoObject( - string prompt, - string resolution, - string aspectRatio, - int duration, - string? assetId, - global::Ideogram.VideoObjectObjectType? objectType, - string? url) - { - this.AssetId = assetId; - this.ObjectType = objectType; - this.Url = url; - this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); - this.Resolution = resolution ?? throw new global::System.ArgumentNullException(nameof(resolution)); - this.AspectRatio = aspectRatio ?? throw new global::System.ArgumentNullException(nameof(aspectRatio)); - this.Duration = duration; - } - - /// - /// Initializes a new instance of the class. - /// - public VideoObject() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VideoObjectObjectType.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VideoObjectObjectType.g.cs deleted file mode 100644 index e1440b3a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.VideoObjectObjectType.g.cs +++ /dev/null @@ -1,45 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Discriminator marking this entry as a generated video in the polling endpoint's mixed data array. - /// - public enum VideoObjectObjectType - { - /// - /// - /// - VideoGeneration, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class VideoObjectObjectTypeExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this VideoObjectObjectType value) - { - return value switch - { - VideoObjectObjectType.VideoGeneration => "video.generation", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static VideoObjectObjectType? ToEnum(string value) - { - return value switch - { - "video.generation" => VideoObjectObjectType.VideoGeneration, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VirtualTryOnRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VirtualTryOnRequest.Json.g.cs deleted file mode 100644 index 8a722ba3..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.VirtualTryOnRequest.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class VirtualTryOnRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.VirtualTryOnRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.VirtualTryOnRequest), - jsonSerializerContext) as global::Ideogram.VirtualTryOnRequest; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.VirtualTryOnRequest? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.VirtualTryOnRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.VirtualTryOnRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VirtualTryOnRequest; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VirtualTryOnRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VirtualTryOnRequest.g.cs deleted file mode 100644 index 965c4f00..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.VirtualTryOnRequest.g.cs +++ /dev/null @@ -1,187 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Supply the person as either an `AssetIdentifier` reference or
- /// (multipart requests only) raw image bytes, and the garments likewise;
- /// for each source provide exactly one of the two forms. Supplying both
- /// forms of a source, or neither, is rejected with a 400. - ///
- public sealed partial class VirtualTryOnRequest - { - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - ///
- /// {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - [global::System.Text.Json.Serialization.JsonPropertyName("person_asset_identifier")] - public global::Ideogram.AssetIdentifier? PersonAssetIdentifier { get; set; } - - /// - /// Photo of the person to dress (max size 25MB), as raw bytes; only
- /// JPEG, PNG, and WEBP formats are supported. Multipart requests only.
- /// Provide exactly one of `person_asset_identifier` or `person_image`. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("person_image")] - public byte[]? PersonImage { get; set; } - - /// - /// Photo of the person to dress (max size 25MB), as raw bytes; only
- /// JPEG, PNG, and WEBP formats are supported. Multipart requests only.
- /// Provide exactly one of `person_asset_identifier` or `person_image`. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("person_imagename")] - public string? PersonImagename { get; set; } - - /// - /// Photos of the clothing items to put on the person, by reference.
- /// Multiple garments are layered into one coherent outfit. Provide
- /// exactly one of `garment_asset_identifiers` or `garment_images`. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("garment_asset_identifiers")] - public global::System.Collections.Generic.IList? GarmentAssetIdentifiers { get; set; } - - /// - /// Photos of the clothing items to put on the person (max 7, max size
- /// 25MB per image), as raw bytes; only JPEG, PNG, and WEBP formats are
- /// supported. Multipart requests only. Provide exactly one of
- /// `garment_asset_identifiers` or `garment_images`. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("garment_images")] - public global::System.Collections.Generic.IList? GarmentImages { get; set; } - - /// - /// The aspect ratio of the generated image. Defaults to the aspect
- /// ratio of the person's photo when omitted. Supported values are
- /// `1:1`, `3:4`, `4:3`, `16:9`, and `9:16`. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] - public string? AspectRatio { get; set; } - - /// - /// Free-text art direction, for example which garments to name, how to
- /// pose the person, and what background to place them in. The person's
- /// identity and each garment's exact appearance are always preserved,
- /// whatever this says. When omitted, the person keeps the pose and
- /// background from their photo. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("instruction")] - public string? Instruction { get; set; } - - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("private")] - public bool? Private { get; set; } - - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - ///
- /// https://api.example.com/webhooks/ideogram - [global::System.Text.Json.Serialization.JsonPropertyName("webhook_url")] - public string? WebhookUrl { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// Photo of the person to dress (max size 25MB), as raw bytes; only
- /// JPEG, PNG, and WEBP formats are supported. Multipart requests only.
- /// Provide exactly one of `person_asset_identifier` or `person_image`. - /// - /// - /// Photo of the person to dress (max size 25MB), as raw bytes; only
- /// JPEG, PNG, and WEBP formats are supported. Multipart requests only.
- /// Provide exactly one of `person_asset_identifier` or `person_image`. - /// - /// - /// Photos of the clothing items to put on the person, by reference.
- /// Multiple garments are layered into one coherent outfit. Provide
- /// exactly one of `garment_asset_identifiers` or `garment_images`. - /// - /// - /// Photos of the clothing items to put on the person (max 7, max size
- /// 25MB per image), as raw bytes; only JPEG, PNG, and WEBP formats are
- /// supported. Multipart requests only. Provide exactly one of
- /// `garment_asset_identifiers` or `garment_images`. - /// - /// - /// The aspect ratio of the generated image. Defaults to the aspect
- /// ratio of the person's photo when omitted. Supported values are
- /// `1:1`, `3:4`, `4:3`, `16:9`, and `9:16`. - /// - /// - /// Free-text art direction, for example which garments to name, how to
- /// pose the person, and what background to place them in. The person's
- /// identity and each garment's exact appearance are always preserved,
- /// whatever this says. When omitted, the person keeps the pose and
- /// background from their photo. - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public VirtualTryOnRequest( - global::Ideogram.AssetIdentifier? personAssetIdentifier, - byte[]? personImage, - string? personImagename, - global::System.Collections.Generic.IList? garmentAssetIdentifiers, - global::System.Collections.Generic.IList? garmentImages, - string? aspectRatio, - string? instruction, - bool? @private, - string? webhookUrl) - { - this.PersonAssetIdentifier = personAssetIdentifier; - this.PersonImage = personImage; - this.PersonImagename = personImagename; - this.GarmentAssetIdentifiers = garmentAssetIdentifiers; - this.GarmentImages = garmentImages; - this.AspectRatio = aspectRatio; - this.Instruction = instruction; - this.Private = @private; - this.WebhookUrl = webhookUrl; - } - - /// - /// Initializes a new instance of the class. - /// - public VirtualTryOnRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VirtualTryOnResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VirtualTryOnResponse.Json.g.cs deleted file mode 100644 index 72d2e49b..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.VirtualTryOnResponse.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class VirtualTryOnResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.VirtualTryOnResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.VirtualTryOnResponse), - jsonSerializerContext) as global::Ideogram.VirtualTryOnResponse; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.VirtualTryOnResponse? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.VirtualTryOnResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.VirtualTryOnResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.VirtualTryOnResponse; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.VirtualTryOnResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.VirtualTryOnResponse.g.cs deleted file mode 100644 index f475a33a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.VirtualTryOnResponse.g.cs +++ /dev/null @@ -1,49 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Acknowledgement that the try-on was accepted. Poll
- /// `GET /v2/generations/{generation_id}` for status and results.
- /// Example: {"generation_id":"generation_id"} - ///
- public sealed partial class VirtualTryOnResponse - { - /// - /// URL-safe base64 ID accepted by the generation polling endpoint. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("generation_id")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string GenerationId { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// URL-safe base64 ID accepted by the generation polling endpoint. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public VirtualTryOnResponse( - string generationId) - { - this.GenerationId = generationId ?? throw new global::System.ArgumentNullException(nameof(generationId)); - } - - /// - /// Initializes a new instance of the class. - /// - public VirtualTryOnResponse() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.WebhookSigningJwk.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.WebhookSigningJwk.Json.g.cs deleted file mode 100644 index bd31b94f..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.WebhookSigningJwk.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class WebhookSigningJwk - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.WebhookSigningJwk? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.WebhookSigningJwk), - jsonSerializerContext) as global::Ideogram.WebhookSigningJwk; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.WebhookSigningJwk? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.WebhookSigningJwk? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.WebhookSigningJwk), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.WebhookSigningJwk; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.WebhookSigningJwk.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.WebhookSigningJwk.g.cs deleted file mode 100644 index e1db4f22..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.WebhookSigningJwk.g.cs +++ /dev/null @@ -1,130 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// A single Ed25519 public key. The `x` field carries the 32-byte public
- /// key as base64url without padding; `kid` matches the
- /// `X-Ideogram-Webhook-Key-Id` header on outbound webhooks for cache hints,
- /// but verifiers SHOULD try every key in the set rather than relying on
- /// `kid` alone.
- /// Example: {"kty":"OKP","crv":"Ed25519","use":"sig","kid":"v1","x":"11qYAYKxCrfVS_7TyWQHOg7hcvPapiMlrwIaaPcHURo","alg":"EdDSA"} - ///
- public sealed partial class WebhookSigningJwk - { - /// - /// Key type. Always `"OKP"` for Ed25519.
- /// Example: OKP - ///
- /// OKP - [global::System.Text.Json.Serialization.JsonPropertyName("kty")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Kty { get; set; } - - /// - /// Curve. Always `"Ed25519"`.
- /// Example: Ed25519 - ///
- /// Ed25519 - [global::System.Text.Json.Serialization.JsonPropertyName("crv")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Crv { get; set; } - - /// - /// The 32-byte public key, base64url-encoded without padding.
- /// Example: 11qYAYKxCrfVS_7TyWQHOg7hcvPapiMlrwIaaPcHURo - ///
- /// 11qYAYKxCrfVS_7TyWQHOg7hcvPapiMlrwIaaPcHURo - [global::System.Text.Json.Serialization.JsonPropertyName("x")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string X { get; set; } - - /// - /// Opaque key identifier; stable across rotations of the same key.
- /// Example: v1 - ///
- /// v1 - [global::System.Text.Json.Serialization.JsonPropertyName("kid")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Kid { get; set; } - - /// - /// Always `"EdDSA"`.
- /// Example: EdDSA - ///
- /// EdDSA - [global::System.Text.Json.Serialization.JsonPropertyName("alg")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Alg { get; set; } - - /// - /// Always `"sig"` (signing-only).
- /// Example: sig - ///
- /// sig - [global::System.Text.Json.Serialization.JsonPropertyName("use")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Use { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Key type. Always `"OKP"` for Ed25519.
- /// Example: OKP - /// - /// - /// Curve. Always `"Ed25519"`.
- /// Example: Ed25519 - /// - /// - /// The 32-byte public key, base64url-encoded without padding.
- /// Example: 11qYAYKxCrfVS_7TyWQHOg7hcvPapiMlrwIaaPcHURo - /// - /// - /// Opaque key identifier; stable across rotations of the same key.
- /// Example: v1 - /// - /// - /// Always `"EdDSA"`.
- /// Example: EdDSA - /// - /// - /// Always `"sig"` (signing-only).
- /// Example: sig - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public WebhookSigningJwk( - string kty, - string crv, - string x, - string kid, - string alg, - string use) - { - this.Kty = kty ?? throw new global::System.ArgumentNullException(nameof(kty)); - this.Crv = crv ?? throw new global::System.ArgumentNullException(nameof(crv)); - this.X = x ?? throw new global::System.ArgumentNullException(nameof(x)); - this.Kid = kid ?? throw new global::System.ArgumentNullException(nameof(kid)); - this.Alg = alg ?? throw new global::System.ArgumentNullException(nameof(alg)); - this.Use = use ?? throw new global::System.ArgumentNullException(nameof(use)); - } - - /// - /// Initializes a new instance of the class. - /// - public WebhookSigningJwk() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.WebhookSigningJwks.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.WebhookSigningJwks.Json.g.cs deleted file mode 100644 index 224ff425..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.WebhookSigningJwks.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Ideogram -{ - public sealed partial class WebhookSigningJwks - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.WebhookSigningJwks? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.WebhookSigningJwks), - jsonSerializerContext) as global::Ideogram.WebhookSigningJwks; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Ideogram.WebhookSigningJwks? FromJson( - string json) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.WebhookSigningJwks? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.WebhookSigningJwks), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.WebhookSigningJwks; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::Ideogram.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.WebhookSigningJwks.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.WebhookSigningJwks.g.cs deleted file mode 100644 index eb0de69c..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Models.WebhookSigningJwks.g.cs +++ /dev/null @@ -1,51 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// JSON Web Key Set listing the Ed25519 public keys Ideogram uses to sign
- /// webhook payloads. Each entry follows RFC 7517 conventions for OKP keys.
- /// Example: {"keys":[{"kty":"OKP","crv":"Ed25519","use":"sig","kid":"v1","x":"11qYAYKxCrfVS_7TyWQHOg7hcvPapiMlrwIaaPcHURo","alg":"EdDSA"},{"kty":"OKP","crv":"Ed25519","use":"sig","kid":"v1","x":"11qYAYKxCrfVS_7TyWQHOg7hcvPapiMlrwIaaPcHURo","alg":"EdDSA"}]} - ///
- public sealed partial class WebhookSigningJwks - { - /// - /// Active and recently-rotated signing keys. A webhook is authentic if
- /// its signature verifies against any key in this list. - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("keys")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList Keys { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Active and recently-rotated signing keys. A webhook is authentic if
- /// its signature verifies against any key in this list. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public WebhookSigningJwks( - global::System.Collections.Generic.IList keys) - { - this.Keys = keys ?? throw new global::System.ArgumentNullException(nameof(keys)); - } - - /// - /// Initializes a new instance of the class. - /// - public WebhookSigningJwks() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ModelsClient.Authorizations.Bearer.g.cs b/src/libs/Ideogram/Generated/Ideogram.ModelsClient.Authorizations.Bearer.g.cs deleted file mode 100644 index a66fc989..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ModelsClient.Authorizations.Bearer.g.cs +++ /dev/null @@ -1,35 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public sealed partial class ModelsClient - { - - /// - public void AuthorizeUsingBearer( - string apiKey) - { - apiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey)); - - for (var i = Authorizations.Count - 1; i >= 0; i--) - { - var __authorization = Authorizations[i]; - if (__authorization.Type == "Http" && - __authorization.Name == "Bearer") - { - Authorizations.RemoveAt(i); - } - } - - Authorizations.Add(new global::Ideogram.EndPointAuthorization - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - Value = apiKey, - }); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ModelsClient.Constructors.Bearer.g.cs b/src/libs/Ideogram/Generated/Ideogram.ModelsClient.Constructors.Bearer.g.cs deleted file mode 100644 index a619a070..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ModelsClient.Constructors.Bearer.g.cs +++ /dev/null @@ -1,31 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public sealed partial class ModelsClient - { - /// - - public ModelsClient( - string apiKey, - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - bool disposeHttpClient = true) : this(httpClient, baseUri, authorizations, disposeHttpClient) - { - Authorizing(HttpClient, ref apiKey); - - AuthorizeUsingBearer(apiKey); - - Authorized(HttpClient); - } - - partial void Authorizing( - global::System.Net.Http.HttpClient client, - ref string apiKey); - partial void Authorized( - global::System.Net.Http.HttpClient client); - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ModelsClient.GetCustomModel.g.cs b/src/libs/Ideogram/Generated/Ideogram.ModelsClient.GetCustomModel.g.cs deleted file mode 100644 index 31696c27..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ModelsClient.GetCustomModel.g.cs +++ /dev/null @@ -1,490 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ModelsClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_GetCustomModelSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_GetCustomModelSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_GetCustomModelSecurityRequirement0, - }; - partial void PrepareGetCustomModelArguments( - global::System.Net.Http.HttpClient httpClient, - ref string modelId); - partial void PrepareGetCustomModelRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string modelId); - partial void ProcessGetCustomModelResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessGetCustomModelResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Get model details
- /// Get detailed information about a specific custom model. The user must either own the model or the model must be shared with the user's organization via the model registry. Returns 404 if the model is not found or not accessible. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task GetCustomModelAsync( - string modelId, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await GetCustomModelAsResponseAsync( - modelId: modelId, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Get model details
- /// Get detailed information about a specific custom model. The user must either own the model or the model must be shared with the user's organization via the model registry. Returns 404 if the model is not found or not accessible. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> GetCustomModelAsResponseAsync( - string modelId, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareGetCustomModelArguments( - httpClient: HttpClient, - modelId: ref modelId); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_GetCustomModelSecurityRequirements, - operationName: "GetCustomModelAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: $"/models/{modelId}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetCustomModelRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - modelId: modelId); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetCustomModel", - methodName: "GetCustomModelAsync", - pathTemplate: "$\"/models/{modelId}\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetCustomModel", - methodName: "GetCustomModelAsync", - pathTemplate: "$\"/models/{modelId}\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetCustomModel", - methodName: "GetCustomModelAsync", - pathTemplate: "$\"/models/{modelId}\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetCustomModelResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetCustomModel", - methodName: "GetCustomModelAsync", - pathTemplate: "$\"/models/{modelId}\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetCustomModel", - methodName: "GetCustomModelAsync", - pathTemplate: "$\"/models/{modelId}\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetCustomModelResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.GetModelResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.GetModelResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ModelsClient.ListCustomModels.g.cs b/src/libs/Ideogram/Generated/Ideogram.ModelsClient.ListCustomModels.g.cs deleted file mode 100644 index 5e5298e1..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ModelsClient.ListCustomModels.g.cs +++ /dev/null @@ -1,471 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ModelsClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_ListCustomModelsSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_ListCustomModelsSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_ListCustomModelsSecurityRequirement0, - }; - partial void PrepareListCustomModelsArguments( - global::System.Net.Http.HttpClient httpClient, - ref global::Ideogram.ListCustomModelsScope? scope, - global::System.Collections.Generic.IList? status); - partial void PrepareListCustomModelsRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.ListCustomModelsScope? scope, - global::System.Collections.Generic.IList? status); - partial void ProcessListCustomModelsResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessListCustomModelsResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// List models
- /// Lists custom models for the authenticated user. Use the `scope` parameter to control which models are returned. If omitted, returns both owned models and models shared with the user's organization via the model registry. `owned` returns only models created by the user. `shared` returns only models shared via the model registry, excluding the user's own models. - ///
- /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task ListCustomModelsAsync( - global::Ideogram.ListCustomModelsScope? scope = default, - global::System.Collections.Generic.IList? status = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await ListCustomModelsAsResponseAsync( - scope: scope, - status: status, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// List models
- /// Lists custom models for the authenticated user. Use the `scope` parameter to control which models are returned. If omitted, returns both owned models and models shared with the user's organization via the model registry. `owned` returns only models created by the user. `shared` returns only models shared via the model registry, excluding the user's own models. - ///
- /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> ListCustomModelsAsResponseAsync( - global::Ideogram.ListCustomModelsScope? scope = default, - global::System.Collections.Generic.IList? status = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareListCustomModelsArguments( - httpClient: HttpClient, - scope: ref scope, - status: status); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_ListCustomModelsSecurityRequirements, - operationName: "ListCustomModelsAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/models", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("scope", scope?.ToValueString()) - .AddOptionalParameter("status", status, selector: static x => x.ToValueString(), delimiter: ",", explode: true) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareListCustomModelsRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - scope: scope, - status: status); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "ListCustomModels", - methodName: "ListCustomModelsAsync", - pathTemplate: "\"/models\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "ListCustomModels", - methodName: "ListCustomModelsAsync", - pathTemplate: "\"/models\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "ListCustomModels", - methodName: "ListCustomModelsAsync", - pathTemplate: "\"/models\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessListCustomModelsResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "ListCustomModels", - methodName: "ListCustomModelsAsync", - pathTemplate: "\"/models\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "ListCustomModels", - methodName: "ListCustomModelsAsync", - pathTemplate: "\"/models\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessListCustomModelsResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.ListModelsResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.ListModelsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ModelsClient.TrainModelV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.ModelsClient.TrainModelV3.g.cs deleted file mode 100644 index 061363cd..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ModelsClient.TrainModelV3.g.cs +++ /dev/null @@ -1,565 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ModelsClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_TrainModelV3SecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_TrainModelV3SecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_TrainModelV3SecurityRequirement0, - }; - partial void PrepareTrainModelV3Arguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.TrainModelV3Request request); - partial void PrepareTrainModelV3Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.TrainModelV3Request request); - partial void ProcessTrainModelV3Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessTrainModelV3ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Train a custom Ideogram v3 model
- /// Start training a custom Ideogram v3 model from a dataset using default hyperparameters. The dataset must contain at least 15 images and a maximum of 100 images. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task TrainModelV3Async( - - global::Ideogram.TrainModelV3Request request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await TrainModelV3AsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Train a custom Ideogram v3 model
- /// Start training a custom Ideogram v3 model from a dataset using default hyperparameters. The dataset must contain at least 15 images and a maximum of 100 images. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> TrainModelV3AsResponseAsync( - - global::Ideogram.TrainModelV3Request request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareTrainModelV3Arguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_TrainModelV3SecurityRequirements, - operationName: "TrainModelV3Async"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/ideogram-v3/train-model", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareTrainModelV3Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "TrainModelV3", - methodName: "TrainModelV3Async", - pathTemplate: "\"/v1/ideogram-v3/train-model\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "TrainModelV3", - methodName: "TrainModelV3Async", - pathTemplate: "\"/v1/ideogram-v3/train-model\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "TrainModelV3", - methodName: "TrainModelV3Async", - pathTemplate: "\"/v1/ideogram-v3/train-model\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessTrainModelV3Response( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "TrainModelV3", - methodName: "TrainModelV3Async", - pathTemplate: "\"/v1/ideogram-v3/train-model\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "TrainModelV3", - methodName: "TrainModelV3Async", - pathTemplate: "\"/v1/ideogram-v3/train-model\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessTrainModelV3ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.TrainDatasetModelResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.TrainDatasetModelResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Train a custom Ideogram v3 model
- /// Start training a custom Ideogram v3 model from a dataset using default hyperparameters. The dataset must contain at least 15 images and a maximum of 100 images. - ///
- /// - /// ID of the dataset to train the model from.
- /// Example: abc123 - /// - /// - /// Name for the trained model. Must be 5-30 characters, alphanumeric with spaces and hyphens allowed.
- /// Example: my-custom-model - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task TrainModelV3Async( - string datasetId, - string modelName, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.TrainModelV3Request - { - DatasetId = datasetId, - ModelName = modelName, - }; - - return await TrainModelV3Async( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ModelsClient.TrainModelV3Advanced.g.cs b/src/libs/Ideogram/Generated/Ideogram.ModelsClient.TrainModelV3Advanced.g.cs deleted file mode 100644 index 5c939c7d..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ModelsClient.TrainModelV3Advanced.g.cs +++ /dev/null @@ -1,589 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ModelsClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_TrainModelV3AdvancedSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_TrainModelV3AdvancedSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_TrainModelV3AdvancedSecurityRequirement0, - }; - partial void PrepareTrainModelV3AdvancedArguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.TrainModelV3AdvancedRequest request); - partial void PrepareTrainModelV3AdvancedRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.TrainModelV3AdvancedRequest request); - partial void ProcessTrainModelV3AdvancedResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessTrainModelV3AdvancedResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Train a custom Ideogram v3 model with advanced hyperparameters
- /// Start training a custom Ideogram v3 model from a dataset with caller-supplied hyperparameters (training steps, LoRA rank, EMA decay, learning rate). All hyperparameters are optional and fall back to defaults when omitted. The dataset must contain at least 15 images and a maximum of 100 images. Returns the model ID and training status. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task TrainModelV3AdvancedAsync( - - global::Ideogram.TrainModelV3AdvancedRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await TrainModelV3AdvancedAsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Train a custom Ideogram v3 model with advanced hyperparameters
- /// Start training a custom Ideogram v3 model from a dataset with caller-supplied hyperparameters (training steps, LoRA rank, EMA decay, learning rate). All hyperparameters are optional and fall back to defaults when omitted. The dataset must contain at least 15 images and a maximum of 100 images. Returns the model ID and training status. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> TrainModelV3AdvancedAsResponseAsync( - - global::Ideogram.TrainModelV3AdvancedRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareTrainModelV3AdvancedArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_TrainModelV3AdvancedSecurityRequirements, - operationName: "TrainModelV3AdvancedAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/ideogram-v3/train-model-advanced", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareTrainModelV3AdvancedRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "TrainModelV3Advanced", - methodName: "TrainModelV3AdvancedAsync", - pathTemplate: "\"/v1/ideogram-v3/train-model-advanced\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "TrainModelV3Advanced", - methodName: "TrainModelV3AdvancedAsync", - pathTemplate: "\"/v1/ideogram-v3/train-model-advanced\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "TrainModelV3Advanced", - methodName: "TrainModelV3AdvancedAsync", - pathTemplate: "\"/v1/ideogram-v3/train-model-advanced\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessTrainModelV3AdvancedResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "TrainModelV3Advanced", - methodName: "TrainModelV3AdvancedAsync", - pathTemplate: "\"/v1/ideogram-v3/train-model-advanced\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "TrainModelV3Advanced", - methodName: "TrainModelV3AdvancedAsync", - pathTemplate: "\"/v1/ideogram-v3/train-model-advanced\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessTrainModelV3AdvancedResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.TrainDatasetModelResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.TrainDatasetModelResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Train a custom Ideogram v3 model with advanced hyperparameters
- /// Start training a custom Ideogram v3 model from a dataset with caller-supplied hyperparameters (training steps, LoRA rank, EMA decay, learning rate). All hyperparameters are optional and fall back to defaults when omitted. The dataset must contain at least 15 images and a maximum of 100 images. Returns the model ID and training status. - ///
- /// - /// ID of the dataset to train the model from.
- /// Example: abc123 - /// - /// - /// Name for the trained model. Must be 5-30 characters, alphanumeric with spaces and hyphens allowed.
- /// Example: my-custom-model - /// - /// - /// Number of training steps. Must be between 100 and 10000 and a multiple of 100. Defaults to 1000.
- /// Example: 1000 - /// - /// - /// LoRA rank for model training. Must be one of 64 or 128. Defaults to 128. Higher rank increases model capacity at the cost of longer training and larger weights.
- /// Example: 64 - /// - /// - /// Exponential moving average decay rate for the model weights. Must be between 0 and 1 (exclusive). Typical values are 0.99-0.9999; higher values produce smoother weight averages but respond more slowly to training updates.
- /// Example: 0.999F - /// - /// - /// Learning rate for the optimizer. Must be greater than 0. Typical values for LoRA fine-tuning are 1e-5 to 1e-4; larger values train faster but risk instability.
- /// Example: 0.0001F - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task TrainModelV3AdvancedAsync( - string datasetId, - string modelName, - int? trainingSteps = default, - int? loraRank = default, - double? ema = default, - double? learningRate = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.TrainModelV3AdvancedRequest - { - DatasetId = datasetId, - ModelName = modelName, - TrainingSteps = trainingSteps, - LoraRank = loraRank, - Ema = ema, - LearningRate = learningRate, - }; - - return await TrainModelV3AdvancedAsync( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ModelsClient.TrainModelV4.g.cs b/src/libs/Ideogram/Generated/Ideogram.ModelsClient.TrainModelV4.g.cs deleted file mode 100644 index e0419b9b..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ModelsClient.TrainModelV4.g.cs +++ /dev/null @@ -1,565 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ModelsClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_TrainModelV4SecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_TrainModelV4SecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_TrainModelV4SecurityRequirement0, - }; - partial void PrepareTrainModelV4Arguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.TrainModelV4Request request); - partial void PrepareTrainModelV4Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.TrainModelV4Request request); - partial void ProcessTrainModelV4Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessTrainModelV4ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Train a custom Ideogram v4 model
- /// Start training a custom Ideogram v4 model from a dataset using default hyperparameters. The dataset must contain at least 15 images and a maximum of 100 images. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task TrainModelV4Async( - - global::Ideogram.TrainModelV4Request request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await TrainModelV4AsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Train a custom Ideogram v4 model
- /// Start training a custom Ideogram v4 model from a dataset using default hyperparameters. The dataset must contain at least 15 images and a maximum of 100 images. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> TrainModelV4AsResponseAsync( - - global::Ideogram.TrainModelV4Request request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareTrainModelV4Arguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_TrainModelV4SecurityRequirements, - operationName: "TrainModelV4Async"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/ideogram-v4/train-model", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareTrainModelV4Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "TrainModelV4", - methodName: "TrainModelV4Async", - pathTemplate: "\"/v1/ideogram-v4/train-model\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "TrainModelV4", - methodName: "TrainModelV4Async", - pathTemplate: "\"/v1/ideogram-v4/train-model\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "TrainModelV4", - methodName: "TrainModelV4Async", - pathTemplate: "\"/v1/ideogram-v4/train-model\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessTrainModelV4Response( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "TrainModelV4", - methodName: "TrainModelV4Async", - pathTemplate: "\"/v1/ideogram-v4/train-model\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "TrainModelV4", - methodName: "TrainModelV4Async", - pathTemplate: "\"/v1/ideogram-v4/train-model\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessTrainModelV4ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.TrainDatasetModelResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.TrainDatasetModelResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Train a custom Ideogram v4 model
- /// Start training a custom Ideogram v4 model from a dataset using default hyperparameters. The dataset must contain at least 15 images and a maximum of 100 images. - ///
- /// - /// ID of the dataset to train the model from.
- /// Example: abc123 - /// - /// - /// Name for the trained model. Must be 5-30 characters, alphanumeric with spaces and hyphens allowed.
- /// Example: my-custom-model - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task TrainModelV4Async( - string datasetId, - string modelName, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.TrainModelV4Request - { - DatasetId = datasetId, - ModelName = modelName, - }; - - return await TrainModelV4Async( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ModelsClient.TrainModelV4Advanced.g.cs b/src/libs/Ideogram/Generated/Ideogram.ModelsClient.TrainModelV4Advanced.g.cs deleted file mode 100644 index 49e3cb20..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ModelsClient.TrainModelV4Advanced.g.cs +++ /dev/null @@ -1,607 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ModelsClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_TrainModelV4AdvancedSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_TrainModelV4AdvancedSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_TrainModelV4AdvancedSecurityRequirement0, - }; - partial void PrepareTrainModelV4AdvancedArguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.TrainModelV4AdvancedRequest request); - partial void PrepareTrainModelV4AdvancedRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.TrainModelV4AdvancedRequest request); - partial void ProcessTrainModelV4AdvancedResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessTrainModelV4AdvancedResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Train a custom Ideogram v4 model with advanced hyperparameters
- /// Start training a custom Ideogram v4 model from a dataset with caller-supplied hyperparameters (training steps, LoRA rank, EMA decay, learning rate). All hyperparameters are optional and fall back to defaults when omitted. The dataset must contain at least 15 images and a maximum of 100 images. Returns the model ID and training status. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task TrainModelV4AdvancedAsync( - - global::Ideogram.TrainModelV4AdvancedRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await TrainModelV4AdvancedAsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Train a custom Ideogram v4 model with advanced hyperparameters
- /// Start training a custom Ideogram v4 model from a dataset with caller-supplied hyperparameters (training steps, LoRA rank, EMA decay, learning rate). All hyperparameters are optional and fall back to defaults when omitted. The dataset must contain at least 15 images and a maximum of 100 images. Returns the model ID and training status. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> TrainModelV4AdvancedAsResponseAsync( - - global::Ideogram.TrainModelV4AdvancedRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareTrainModelV4AdvancedArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_TrainModelV4AdvancedSecurityRequirements, - operationName: "TrainModelV4AdvancedAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/ideogram-v4/train-model-advanced", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareTrainModelV4AdvancedRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "TrainModelV4Advanced", - methodName: "TrainModelV4AdvancedAsync", - pathTemplate: "\"/v1/ideogram-v4/train-model-advanced\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "TrainModelV4Advanced", - methodName: "TrainModelV4AdvancedAsync", - pathTemplate: "\"/v1/ideogram-v4/train-model-advanced\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "TrainModelV4Advanced", - methodName: "TrainModelV4AdvancedAsync", - pathTemplate: "\"/v1/ideogram-v4/train-model-advanced\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessTrainModelV4AdvancedResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "TrainModelV4Advanced", - methodName: "TrainModelV4AdvancedAsync", - pathTemplate: "\"/v1/ideogram-v4/train-model-advanced\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "TrainModelV4Advanced", - methodName: "TrainModelV4AdvancedAsync", - pathTemplate: "\"/v1/ideogram-v4/train-model-advanced\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessTrainModelV4AdvancedResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.TrainDatasetModelResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.TrainDatasetModelResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Train a custom Ideogram v4 model with advanced hyperparameters
- /// Start training a custom Ideogram v4 model from a dataset with caller-supplied hyperparameters (training steps, LoRA rank, EMA decay, learning rate). All hyperparameters are optional and fall back to defaults when omitted. The dataset must contain at least 15 images and a maximum of 100 images. Returns the model ID and training status. - ///
- /// - /// ID of the dataset to train the model from.
- /// Example: abc123 - /// - /// - /// Name for the trained model. Must be 5-30 characters, alphanumeric with spaces and hyphens allowed.
- /// Example: my-custom-model - /// - /// - /// Number of training steps. Must be between 100 and 10000 and a multiple of 100. Defaults to 1000.
- /// Example: 1000 - /// - /// - /// LoRA rank for model training. Must be one of 64 or 128. Defaults to 128. Higher rank increases model capacity at the cost of longer training and larger weights.
- /// Example: 64 - /// - /// - /// Exponential moving average decay rate for the model weights. Must be between 0 and 1 (exclusive). Typical values are 0.99-0.9999; higher values produce smoother weight averages but respond more slowly to training updates.
- /// Example: 0.999F - /// - /// - /// Learning rate for the optimizer. Must be greater than 0. Typical values for LoRA fine-tuning are 1e-5 to 1e-4; larger values train faster but risk instability.
- /// Example: 0.0001F - /// - /// - /// Per-step training batch size. Must be one of 1, 2, 4, 8, 16, or 32. Defaults to a trainer-side value when omitted. Larger batches can improve throughput at the cost of more memory.
- /// Example: 8 - /// - /// - /// Weights & Biases project to log this training run to. When set, the run streams metrics to this W&B project; when omitted, no W&B logging happens.
- /// Example: my-wandb-project - /// - /// - /// Frozen v4 backbone the custom LoRA is trained on. Must be one of `distilled_gd` (the guidance-distilled base, default) or `oldbase_farzad_fused` (the fused non-distilled base). Omit to use the default.
- /// Example: distilled_gd - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task TrainModelV4AdvancedAsync( - string datasetId, - string modelName, - int? trainingSteps = default, - int? loraRank = default, - double? ema = default, - double? learningRate = default, - int? batchSize = default, - string? wandbProject = default, - string? baseVariant = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.TrainModelV4AdvancedRequest - { - DatasetId = datasetId, - ModelName = modelName, - TrainingSteps = trainingSteps, - LoraRank = loraRank, - Ema = ema, - LearningRate = learningRate, - BatchSize = batchSize, - WandbProject = wandbProject, - BaseVariant = baseVariant, - }; - - return await TrainModelV4AdvancedAsync( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ModelsClient.g.cs b/src/libs/Ideogram/Generated/Ideogram.ModelsClient.g.cs deleted file mode 100644 index 821f5d6f..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ModelsClient.g.cs +++ /dev/null @@ -1,144 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Operations related to managing custom models
- /// If no httpClient is provided, a new one will be created.
- /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. - ///
- public sealed partial class ModelsClient : global::Ideogram.IModelsClient, global::System.IDisposable - { - /// - /// - /// - public const string DefaultBaseUrl = "https://api.ideogram.ai/"; - - private bool _disposeHttpClient = true; - - /// - public global::System.Net.Http.HttpClient HttpClient { get; } - - /// - public System.Uri? BaseUri => HttpClient.BaseAddress; - - /// - public global::System.Collections.Generic.List Authorizations { get; } - - /// - public bool ReadResponseAsString { get; set; } -#if DEBUG - = true; -#endif - - /// - public global::Ideogram.AutoSDKClientOptions Options { get; } - - internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::Ideogram.ModelsSourceGenerationContext.Default); - - /// - /// - /// - public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext - { - get => JsonSerializerContextProvider.Value; - set => JsonSerializerContextProvider = new(() => value); - } - - - /// - /// Creates a new instance of the ModelsClient. - /// If no httpClient is provided, a new one will be created. - /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. - /// - /// The HttpClient instance. If not provided, a new one will be created. - /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. - /// The authorizations to use for the requests. - /// Dispose the HttpClient when the instance is disposed. True by default. - public ModelsClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - bool disposeHttpClient = true) : this( - httpClient, - baseUri, - authorizations, - options: null, - disposeHttpClient: disposeHttpClient) - { - } - - /// - /// Creates a new instance of the ModelsClient with explicit options but no base URL override. - /// Skips passing baseUri so the default base URL from the OpenAPI spec applies. - /// - /// The HttpClient instance. If not provided, a new one will be created. - /// The authorizations to use for the requests. - /// Client-wide request defaults such as headers, query parameters, retries, and timeout. - /// Dispose the HttpClient when the instance is disposed. True by default. - public ModelsClient( - global::System.Net.Http.HttpClient? httpClient, - global::System.Collections.Generic.List? authorizations, - global::Ideogram.AutoSDKClientOptions? options, - bool disposeHttpClient = true) : this( - httpClient, - baseUri: null, - authorizations, - options, - disposeHttpClient: disposeHttpClient) - { - } - - /// - /// Creates a new instance of the ModelsClient. - /// If no httpClient is provided, a new one will be created. - /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. - /// - /// The HttpClient instance. If not provided, a new one will be created. - /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. - /// The authorizations to use for the requests. - /// Client-wide request defaults such as headers, query parameters, retries, and timeout. - /// Dispose the HttpClient when the instance is disposed. True by default. - public ModelsClient( - global::System.Net.Http.HttpClient? httpClient, - global::System.Uri? baseUri, - global::System.Collections.Generic.List? authorizations, - global::Ideogram.AutoSDKClientOptions? options, - bool disposeHttpClient = true) - { - - HttpClient = httpClient ?? new global::System.Net.Http.HttpClient(); - HttpClient.BaseAddress ??= baseUri ?? new global::System.Uri(DefaultBaseUrl); - Authorizations = authorizations ?? new global::System.Collections.Generic.List(); - Options = options ?? new global::Ideogram.AutoSDKClientOptions(); - _disposeHttpClient = disposeHttpClient; - - Initialized(HttpClient); - } - - /// - public void Dispose() - { - if (_disposeHttpClient) - { - HttpClient.Dispose(); - } - } - - partial void Initialized( - global::System.Net.Http.HttpClient client); - partial void PrepareArguments( - global::System.Net.Http.HttpClient client); - partial void PrepareRequest( - global::System.Net.Http.HttpClient client, - global::System.Net.Http.HttpRequestMessage request); - partial void ProcessResponse( - global::System.Net.Http.HttpClient client, - global::System.Net.Http.HttpResponseMessage response); - partial void ProcessResponseContent( - global::System.Net.Http.HttpClient client, - global::System.Net.Http.HttpResponseMessage response, - ref string content); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ObjectRemoval.JsonSerializerContext.g.cs b/src/libs/Ideogram/Generated/Ideogram.ObjectRemoval.JsonSerializerContext.g.cs index 5308b0b1..baecf7e9 100644 --- a/src/libs/Ideogram/Generated/Ideogram.ObjectRemoval.JsonSerializerContext.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.ObjectRemoval.JsonSerializerContext.g.cs @@ -14,21 +14,19 @@ namespace Ideogram [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(byte[]))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AssetIdentifier))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationErrorResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationRejectReason), TypeInfoPropertyName = "GenerationRejectReason2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed), TypeInfoPropertyName = "GenerationErrorResponseTaskCompletionSpeed2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationErrorResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemoveObjectFromV2AssetsResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemoveObjectFromV2AssetsRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AssetType), TypeInfoPropertyName = "AssetType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(byte[]))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ObjectRemovalPostRemoveObjectFromV2AssetsRequest))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationRejectReason?), TypeInfoPropertyName = "NullableGenerationRejectReason2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?), TypeInfoPropertyName = "NullableGenerationErrorResponseTaskCompletionSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AssetType?), TypeInfoPropertyName = "NullableAssetType2")] internal sealed partial class ObjectRemovalSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext { } @@ -98,33 +96,19 @@ private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Ser public override bool CanConvert(global::System.Type typeToConvert) { return - typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed) - - || typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?) - - || typeToConvert == typeof(global::Ideogram.GenerationRejectReason) + typeToConvert == typeof(global::Ideogram.GenerationRejectReason) || typeToConvert == typeof(global::Ideogram.GenerationRejectReason?) - || typeToConvert == typeof(global::Ideogram.AssetType) + || typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed) - || typeToConvert == typeof(global::Ideogram.AssetType?); + || typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?); } public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) { - if (typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed)) - { - return new global::Ideogram.JsonConverters.GenerationErrorResponseTaskCompletionSpeedJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?)) - { - return new global::Ideogram.JsonConverters.GenerationErrorResponseTaskCompletionSpeedNullableJsonConverter(); - } - if (typeToConvert == typeof(global::Ideogram.GenerationRejectReason)) { return new global::Ideogram.JsonConverters.GenerationRejectReasonJsonConverter(); @@ -135,14 +119,14 @@ public override bool CanConvert(global::System.Type typeToConvert) return new global::Ideogram.JsonConverters.GenerationRejectReasonNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.AssetType)) + if (typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed)) { - return new global::Ideogram.JsonConverters.AssetTypeJsonConverter(); + return new global::Ideogram.JsonConverters.GenerationErrorResponseTaskCompletionSpeedJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.AssetType?)) + if (typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?)) { - return new global::Ideogram.JsonConverters.AssetTypeNullableJsonConverter(); + return new global::Ideogram.JsonConverters.GenerationErrorResponseTaskCompletionSpeedNullableJsonConverter(); } throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); } diff --git a/src/libs/Ideogram/Generated/Ideogram.ObjectRemovalClient.ObjectRemovalPostRemoveObjectFromV2Assets.g.cs b/src/libs/Ideogram/Generated/Ideogram.ObjectRemovalClient.ObjectRemovalPostRemoveObjectFromV2Assets.g.cs new file mode 100644 index 00000000..18711413 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.ObjectRemovalClient.ObjectRemovalPostRemoveObjectFromV2Assets.g.cs @@ -0,0 +1,2456 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class ObjectRemovalClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_ObjectRemovalPostRemoveObjectFromV2AssetsSecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_ObjectRemovalPostRemoveObjectFromV2AssetsSecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_ObjectRemovalPostRemoveObjectFromV2AssetsSecurityRequirement0, + }; + partial void PrepareObjectRemovalPostRemoveObjectFromV2AssetsArguments( + global::System.Net.Http.HttpClient httpClient, + ref bool? dryRun, + global::Ideogram.ObjectRemovalPostRemoveObjectFromV2AssetsRequest request); + partial void PrepareObjectRemovalPostRemoveObjectFromV2AssetsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + bool? dryRun, + global::Ideogram.ObjectRemovalPostRemoveObjectFromV2AssetsRequest request); + partial void ProcessObjectRemovalPostRemoveObjectFromV2AssetsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessObjectRemovalPostRemoveObjectFromV2AssetsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Remove an object
+ /// Remove a masked object from an image. Upload the source `image` and a
+ /// `mask` of the same size using `multipart/form-data`. Returns a
+ /// `generation_id`; poll `GET /v2/generations/{generation_id}` for the
+ /// result. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ObjectRemovalPostRemoveObjectFromV2AssetsAsync( + + global::Ideogram.ObjectRemovalPostRemoveObjectFromV2AssetsRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ObjectRemovalPostRemoveObjectFromV2AssetsAsResponseAsync( + + request: request, + dryRun: dryRun, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Remove an object
+ /// Remove a masked object from an image. Upload the source `image` and a
+ /// `mask` of the same size using `multipart/form-data`. Returns a
+ /// `generation_id`; poll `GET /v2/generations/{generation_id}` for the
+ /// result. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ObjectRemovalPostRemoveObjectFromV2AssetsAsResponseAsync( + + global::Ideogram.ObjectRemovalPostRemoveObjectFromV2AssetsRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareObjectRemovalPostRemoveObjectFromV2AssetsArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ObjectRemovalPostRemoveObjectFromV2AssetsSecurityRequirements, + operationName: "ObjectRemovalPostRemoveObjectFromV2AssetsAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/remove-object/ideogram-1", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + var __contentMask = new global::System.Net.Http.ByteArrayContent(request.Mask ?? global::System.Array.Empty()); + __contentMask.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Maskname is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Maskname) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentMask, + name: "\"mask\"", + fileName: request.Maskname != null ? $"\"{request.Maskname}\"" : string.Empty); + if (__contentMask.Headers.ContentDisposition != null) + { + __contentMask.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareObjectRemovalPostRemoveObjectFromV2AssetsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ObjectRemovalPostRemoveObjectFromV2Assets", + methodName: "ObjectRemovalPostRemoveObjectFromV2AssetsAsync", + pathTemplate: "\"/v2/image/remove-object/ideogram-1\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ObjectRemovalPostRemoveObjectFromV2Assets", + methodName: "ObjectRemovalPostRemoveObjectFromV2AssetsAsync", + pathTemplate: "\"/v2/image/remove-object/ideogram-1\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ObjectRemovalPostRemoveObjectFromV2Assets", + methodName: "ObjectRemovalPostRemoveObjectFromV2AssetsAsync", + pathTemplate: "\"/v2/image/remove-object/ideogram-1\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessObjectRemovalPostRemoveObjectFromV2AssetsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ObjectRemovalPostRemoveObjectFromV2Assets", + methodName: "ObjectRemovalPostRemoveObjectFromV2AssetsAsync", + pathTemplate: "\"/v2/image/remove-object/ideogram-1\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ObjectRemovalPostRemoveObjectFromV2Assets", + methodName: "ObjectRemovalPostRemoveObjectFromV2AssetsAsync", + pathTemplate: "\"/v2/image/remove-object/ideogram-1\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not authorized to remove an object. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The source image or mask was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // An uploaded source or mask image is too large. + if ((int)__response.StatusCode == 413) + { + string? __content_413 = null; + global::System.Exception? __exception_413 = null; + string? __value_413 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_413 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_413, typeof(string), JsonSerializerContext); + } + else + { + __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_413 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_413, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_413 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_413 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_413, + responseBody: __content_413, + responseObject: __value_413, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessObjectRemovalPostRemoveObjectFromV2AssetsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.RemoveObjectFromV2AssetsResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.RemoveObjectFromV2AssetsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Remove an object
+ /// Remove a masked object from an image. Upload the source `image` and a
+ /// `mask` of the same size using `multipart/form-data`. Returns a
+ /// `generation_id`; poll `GET /v2/generations/{generation_id}` for the
+ /// result. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image to remove an object from. JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. + /// + /// + /// The source image to remove an object from. JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. + /// + /// + /// A black-and-white mask the same size as the image; white (>= 128) marks the region to remove. JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. + /// + /// + /// A black-and-white mask the same size as the image; white (>= 128) marks the region to remove. JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ObjectRemovalPostRemoveObjectFromV2AssetsAsync( + byte[] image, + string imagename, + byte[] mask, + string maskname, + bool? dryRun = default, + int? seed = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Ideogram.ObjectRemovalPostRemoveObjectFromV2AssetsRequest + { + Image = image, + Imagename = imagename, + Mask = mask, + Maskname = maskname, + Seed = seed, + }; + + return await ObjectRemovalPostRemoveObjectFromV2AssetsAsync( + dryRun: dryRun, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// Remove an object
+ /// Remove a masked object from an image. Upload the source `image` and a
+ /// `mask` of the same size using `multipart/form-data`. Returns a
+ /// `generation_id`; poll `GET /v2/generations/{generation_id}` for the
+ /// result. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image to remove an object from. JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. + /// + /// + /// The source image to remove an object from. JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. + /// + /// + /// A black-and-white mask the same size as the image; white (>= 128) marks the region to remove. JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. + /// + /// + /// A black-and-white mask the same size as the image; white (>= 128) marks the region to remove. JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ObjectRemovalPostRemoveObjectFromV2AssetsAsync( + global::System.IO.Stream image, + string imagename, + global::System.IO.Stream mask, + string maskname, + bool? dryRun = default, + int? seed = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + mask = mask ?? throw new global::System.ArgumentNullException(nameof(mask)); + var request = new global::Ideogram.ObjectRemovalPostRemoveObjectFromV2AssetsRequest + { + Image = global::System.Array.Empty(), + Imagename = imagename, + Mask = global::System.Array.Empty(), + Maskname = maskname, + Seed = seed, + }; + PrepareArguments( + client: HttpClient); + PrepareObjectRemovalPostRemoveObjectFromV2AssetsArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ObjectRemovalPostRemoveObjectFromV2AssetsSecurityRequirements, + operationName: "ObjectRemovalPostRemoveObjectFromV2AssetsAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/remove-object/ideogram-1", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + var __contentMask = new global::System.Net.Http.StreamContent(mask); + __contentMask.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Maskname is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Maskname) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentMask, + name: "\"mask\"", + fileName: request.Maskname != null ? $"\"{request.Maskname}\"" : string.Empty); + if (__contentMask.Headers.ContentDisposition != null) + { + __contentMask.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareObjectRemovalPostRemoveObjectFromV2AssetsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ObjectRemovalPostRemoveObjectFromV2Assets", + methodName: "ObjectRemovalPostRemoveObjectFromV2AssetsAsync", + pathTemplate: "\"/v2/image/remove-object/ideogram-1\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ObjectRemovalPostRemoveObjectFromV2Assets", + methodName: "ObjectRemovalPostRemoveObjectFromV2AssetsAsync", + pathTemplate: "\"/v2/image/remove-object/ideogram-1\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ObjectRemovalPostRemoveObjectFromV2Assets", + methodName: "ObjectRemovalPostRemoveObjectFromV2AssetsAsync", + pathTemplate: "\"/v2/image/remove-object/ideogram-1\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessObjectRemovalPostRemoveObjectFromV2AssetsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ObjectRemovalPostRemoveObjectFromV2Assets", + methodName: "ObjectRemovalPostRemoveObjectFromV2AssetsAsync", + pathTemplate: "\"/v2/image/remove-object/ideogram-1\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ObjectRemovalPostRemoveObjectFromV2Assets", + methodName: "ObjectRemovalPostRemoveObjectFromV2AssetsAsync", + pathTemplate: "\"/v2/image/remove-object/ideogram-1\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not authorized to remove an object. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The source image or mask was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // An uploaded source or mask image is too large. + if ((int)__response.StatusCode == 413) + { + string? __content_413 = null; + global::System.Exception? __exception_413 = null; + string? __value_413 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_413 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_413, typeof(string), JsonSerializerContext); + } + else + { + __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_413 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_413, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_413 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_413 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_413, + responseBody: __content_413, + responseObject: __value_413, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessObjectRemovalPostRemoveObjectFromV2AssetsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::Ideogram.RemoveObjectFromV2AssetsResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::Ideogram.RemoveObjectFromV2AssetsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Remove an object
+ /// Remove a masked object from an image. Upload the source `image` and a
+ /// `mask` of the same size using `multipart/form-data`. Returns a
+ /// `generation_id`; poll `GET /v2/generations/{generation_id}` for the
+ /// result. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image to remove an object from. JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. + /// + /// + /// The source image to remove an object from. JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. + /// + /// + /// A black-and-white mask the same size as the image; white (>= 128) marks the region to remove. JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. + /// + /// + /// A black-and-white mask the same size as the image; white (>= 128) marks the region to remove. JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ObjectRemovalPostRemoveObjectFromV2AssetsAsResponseAsync( + global::System.IO.Stream image, + string imagename, + global::System.IO.Stream mask, + string maskname, + bool? dryRun = default, + int? seed = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + mask = mask ?? throw new global::System.ArgumentNullException(nameof(mask)); + var request = new global::Ideogram.ObjectRemovalPostRemoveObjectFromV2AssetsRequest + { + Image = global::System.Array.Empty(), + Imagename = imagename, + Mask = global::System.Array.Empty(), + Maskname = maskname, + Seed = seed, + }; + PrepareArguments( + client: HttpClient); + PrepareObjectRemovalPostRemoveObjectFromV2AssetsArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ObjectRemovalPostRemoveObjectFromV2AssetsSecurityRequirements, + operationName: "ObjectRemovalPostRemoveObjectFromV2AssetsAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/remove-object/ideogram-1", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + var __contentMask = new global::System.Net.Http.StreamContent(mask); + __contentMask.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Maskname is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Maskname) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentMask, + name: "\"mask\"", + fileName: request.Maskname != null ? $"\"{request.Maskname}\"" : string.Empty); + if (__contentMask.Headers.ContentDisposition != null) + { + __contentMask.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareObjectRemovalPostRemoveObjectFromV2AssetsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ObjectRemovalPostRemoveObjectFromV2Assets", + methodName: "ObjectRemovalPostRemoveObjectFromV2AssetsAsync", + pathTemplate: "\"/v2/image/remove-object/ideogram-1\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ObjectRemovalPostRemoveObjectFromV2Assets", + methodName: "ObjectRemovalPostRemoveObjectFromV2AssetsAsync", + pathTemplate: "\"/v2/image/remove-object/ideogram-1\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ObjectRemovalPostRemoveObjectFromV2Assets", + methodName: "ObjectRemovalPostRemoveObjectFromV2AssetsAsync", + pathTemplate: "\"/v2/image/remove-object/ideogram-1\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessObjectRemovalPostRemoveObjectFromV2AssetsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ObjectRemovalPostRemoveObjectFromV2Assets", + methodName: "ObjectRemovalPostRemoveObjectFromV2AssetsAsync", + pathTemplate: "\"/v2/image/remove-object/ideogram-1\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ObjectRemovalPostRemoveObjectFromV2Assets", + methodName: "ObjectRemovalPostRemoveObjectFromV2AssetsAsync", + pathTemplate: "\"/v2/image/remove-object/ideogram-1\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not authorized to remove an object. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The source image or mask was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // An uploaded source or mask image is too large. + if ((int)__response.StatusCode == 413) + { + string? __content_413 = null; + global::System.Exception? __exception_413 = null; + string? __value_413 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_413 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_413, typeof(string), JsonSerializerContext); + } + else + { + __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_413 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_413, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_413 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_413 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_413, + responseBody: __content_413, + responseObject: __value_413, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessObjectRemovalPostRemoveObjectFromV2AssetsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.RemoveObjectFromV2AssetsResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.RemoveObjectFromV2AssetsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ObjectRemovalClient.PostRemoveObjectFromV2Assets.g.cs b/src/libs/Ideogram/Generated/Ideogram.ObjectRemovalClient.PostRemoveObjectFromV2Assets.g.cs deleted file mode 100644 index 3529a0ff..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ObjectRemovalClient.PostRemoveObjectFromV2Assets.g.cs +++ /dev/null @@ -1,926 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ObjectRemovalClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostRemoveObjectFromV2AssetsSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostRemoveObjectFromV2AssetsSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostRemoveObjectFromV2AssetsSecurityRequirement0, - }; - partial void PreparePostRemoveObjectFromV2AssetsArguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? dryRun, - global::Ideogram.RemoveObjectFromV2AssetsRequest request); - partial void PreparePostRemoveObjectFromV2AssetsRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? dryRun, - global::Ideogram.RemoveObjectFromV2AssetsRequest request); - partial void ProcessPostRemoveObjectFromV2AssetsResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostRemoveObjectFromV2AssetsResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Remove an object
- /// Remove a masked object from an image. Upload the source `image` and a
- /// `mask` of the same size using `multipart/form-data`. Returns a
- /// `generation_id`; poll `GET /v2/generations/{generation_id}` for the
- /// result. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostRemoveObjectFromV2AssetsAsync( - - global::Ideogram.RemoveObjectFromV2AssetsRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostRemoveObjectFromV2AssetsAsResponseAsync( - - request: request, - dryRun: dryRun, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Remove an object
- /// Remove a masked object from an image. Upload the source `image` and a
- /// `mask` of the same size using `multipart/form-data`. Returns a
- /// `generation_id`; poll `GET /v2/generations/{generation_id}` for the
- /// result. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostRemoveObjectFromV2AssetsAsResponseAsync( - - global::Ideogram.RemoveObjectFromV2AssetsRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostRemoveObjectFromV2AssetsArguments( - httpClient: HttpClient, - dryRun: ref dryRun, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostRemoveObjectFromV2AssetsSecurityRequirements, - operationName: "PostRemoveObjectFromV2AssetsAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/image/remove-object/ideogram-1", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (request.ImageAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ImageAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"image_asset_identifier\""); - - } - if (request.Image != default) - { - - var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.MaskAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.MaskAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"mask_asset_identifier\""); - - } - if (request.Mask != default) - { - - var __contentMask = new global::System.Net.Http.ByteArrayContent(request.Mask ?? global::System.Array.Empty()); - __contentMask.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Maskname is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Maskname) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentMask, - name: "\"mask\"", - fileName: request.Maskname != null ? $"\"{request.Maskname}\"" : string.Empty); - if (__contentMask.Headers.ContentDisposition != null) - { - __contentMask.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.TargetCollectionId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.TargetCollectionId ?? string.Empty), - name: "\"target_collection_id\""); - - } - if (request.StoreAssets != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.StoreAssets, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"store_assets\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostRemoveObjectFromV2AssetsRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - dryRun: dryRun, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemoveObjectFromV2Assets", - methodName: "PostRemoveObjectFromV2AssetsAsync", - pathTemplate: "\"/v2/image/remove-object/ideogram-1\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemoveObjectFromV2Assets", - methodName: "PostRemoveObjectFromV2AssetsAsync", - pathTemplate: "\"/v2/image/remove-object/ideogram-1\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemoveObjectFromV2Assets", - methodName: "PostRemoveObjectFromV2AssetsAsync", - pathTemplate: "\"/v2/image/remove-object/ideogram-1\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostRemoveObjectFromV2AssetsResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemoveObjectFromV2Assets", - methodName: "PostRemoveObjectFromV2AssetsAsync", - pathTemplate: "\"/v2/image/remove-object/ideogram-1\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostRemoveObjectFromV2Assets", - methodName: "PostRemoveObjectFromV2AssetsAsync", - pathTemplate: "\"/v2/image/remove-object/ideogram-1\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 413) - { - string? __content_413 = null; - global::System.Exception? __exception_413 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_413 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_413 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_413, - responseBody: __content_413, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostRemoveObjectFromV2AssetsResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.RemoveObjectFromV2AssetsResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.RemoveObjectFromV2AssetsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Remove an object
- /// Remove a masked object from an image. Upload the source `image` and a
- /// `mask` of the same size using `multipart/form-data`. Returns a
- /// `generation_id`; poll `GET /v2/generations/{generation_id}` for the
- /// result. - ///
- /// - /// Default Value: false - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The source image to remove an object from. JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. - /// - /// - /// The source image to remove an object from. JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// A black-and-white mask the same size as the image; white (>= 128) marks the region to remove. JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. - /// - /// - /// A black-and-white mask the same size as the image; white (>= 128) marks the region to remove. JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. Completed outputs are added to it automatically. - /// - /// - /// Whether to store the resulting images on Ideogram. Defaults to `false`.
- /// Currently accepted but not yet enforced.
- /// Default Value: false - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostRemoveObjectFromV2AssetsAsync( - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - global::Ideogram.AssetIdentifier? maskAssetIdentifier = default, - byte[]? mask = default, - string? maskname = default, - int? seed = default, - string? targetCollectionId = default, - bool? storeAssets = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.RemoveObjectFromV2AssetsRequest - { - ImageAssetIdentifier = imageAssetIdentifier, - Image = image, - Imagename = imagename, - MaskAssetIdentifier = maskAssetIdentifier, - Mask = mask, - Maskname = maskname, - Seed = seed, - TargetCollectionId = targetCollectionId, - StoreAssets = storeAssets, - }; - - return await PostRemoveObjectFromV2AssetsAsync( - dryRun: dryRun, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ObjectRemovalClient.g.cs b/src/libs/Ideogram/Generated/Ideogram.ObjectRemovalClient.g.cs index 8a9df2c7..4d548bb5 100644 --- a/src/libs/Ideogram/Generated/Ideogram.ObjectRemovalClient.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.ObjectRemovalClient.g.cs @@ -4,8 +4,6 @@ namespace Ideogram { /// - /// Remove unwanted objects from an image. Requests return a generation id
- /// to poll with `GET /v2/generations/{generation_id}`.
/// If no httpClient is provided, a new one will be created.
/// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. ///
diff --git a/src/libs/Ideogram/Generated/Ideogram.Prompt.JsonSerializerContext.g.cs b/src/libs/Ideogram/Generated/Ideogram.Prompt.JsonSerializerContext.g.cs deleted file mode 100644 index 54aa1e79..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Prompt.JsonSerializerContext.g.cs +++ /dev/null @@ -1,298 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull - )] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4JsonPrompt))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AspectRatioV4), TypeInfoPropertyName = "AspectRatioV42")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AspectRatioV3), TypeInfoPropertyName = "AspectRatioV32")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(byte[]))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.StyleTypeV3), TypeInfoPropertyName = "StyleTypeV32")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(float))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MagicPromptVersionEnum), TypeInfoPropertyName = "MagicPromptVersionEnum2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MagicPromptRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MagicPromptRequestMessagesInner))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MagicPromptResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MagicPromptV4Request))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MagicPromptV4Response))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4StyleDescription))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4CompositionalDeconstruction))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4PromptElement), TypeInfoPropertyName = "V4PromptElement2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4ObjPromptElement))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4TextPromptElement))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4PromptElementDiscriminator))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4PromptElementDiscriminatorType), TypeInfoPropertyName = "V4PromptElementDiscriminatorType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4ObjPromptElementType), TypeInfoPropertyName = "V4ObjPromptElementType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4TextPromptElementType), TypeInfoPropertyName = "V4TextPromptElementType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MagicPromptRequestMessagesInnerRole), TypeInfoPropertyName = "MagicPromptRequestMessagesInnerRole2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AspectRatioV4?), TypeInfoPropertyName = "NullableAspectRatioV42")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AspectRatioV3?), TypeInfoPropertyName = "NullableAspectRatioV32")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.StyleTypeV3?), TypeInfoPropertyName = "NullableStyleTypeV32")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(float?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MagicPromptVersionEnum?), TypeInfoPropertyName = "NullableMagicPromptVersionEnum2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4PromptElement?), TypeInfoPropertyName = "NullableV4PromptElement2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4PromptElementDiscriminatorType?), TypeInfoPropertyName = "NullableV4PromptElementDiscriminatorType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4ObjPromptElementType?), TypeInfoPropertyName = "NullableV4ObjPromptElementType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4TextPromptElementType?), TypeInfoPropertyName = "NullableV4TextPromptElementType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MagicPromptRequestMessagesInnerRole?), TypeInfoPropertyName = "NullableMagicPromptRequestMessagesInnerRole2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - internal sealed partial class PromptSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext - { - } - /// - /// - /// - public sealed partial class PromptSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext - { - private static readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver Resolver = new LazyChunkResolver(); - - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - internal static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver TypeInfoResolver => Resolver; - - - private static readonly global::System.Text.Json.JsonSerializerOptions DefaultOptions = CreateDefaultOptions(); - - /// - /// - /// - public static PromptSourceGenerationContext Default { get; } = new(DefaultOptions); - - private PromptSourceGenerationContext(global::System.Text.Json.JsonSerializerOptions options) - : base(options) - { - } - - /// - protected override global::System.Text.Json.JsonSerializerOptions? GeneratedSerializerOptions => DefaultOptions; - - /// - public override global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo(global::System.Type type) - { - return Resolver.GetTypeInfo(type, Options); - } - - /// - /// Adds this package's converters to . - /// - /// - /// A converter has to be on the options a chained resolver builds its JsonTypeInfo against, - /// and a context resolves types from every package below it. Each package contributes only - /// what it owns and calls down the chain for the rest, so the family's converter table is - /// written once rather than copied into all of them. - /// - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) - { - options.Converters.Add(new global::Ideogram.JsonConverters.V4PromptElementJsonConverter()); - options.Converters.Add(new global::Ideogram.JsonConverters.UnixTimestampJsonConverter()); - options.Converters.Add(new LazyEnumJsonConverterFactory()); - } - - private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() - { - var options = new global::System.Text.Json.JsonSerializerOptions - { - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, - TypeInfoResolver = Resolver, - }; - AddConverters(options); - - return options; - } - - - private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory - { - public override bool CanConvert(global::System.Type typeToConvert) - { - return - typeToConvert == typeof(global::Ideogram.V4PromptElementDiscriminatorType) - - || typeToConvert == typeof(global::Ideogram.V4PromptElementDiscriminatorType?) - - || typeToConvert == typeof(global::Ideogram.V4ObjPromptElementType) - - || typeToConvert == typeof(global::Ideogram.V4ObjPromptElementType?) - - || typeToConvert == typeof(global::Ideogram.V4TextPromptElementType) - - || typeToConvert == typeof(global::Ideogram.V4TextPromptElementType?) - - || typeToConvert == typeof(global::Ideogram.AspectRatioV4) - - || typeToConvert == typeof(global::Ideogram.AspectRatioV4?) - - || typeToConvert == typeof(global::Ideogram.AspectRatioV3) - - || typeToConvert == typeof(global::Ideogram.AspectRatioV3?) - - || typeToConvert == typeof(global::Ideogram.StyleTypeV3) - - || typeToConvert == typeof(global::Ideogram.StyleTypeV3?) - - || typeToConvert == typeof(global::Ideogram.MagicPromptVersionEnum) - - || typeToConvert == typeof(global::Ideogram.MagicPromptVersionEnum?) - - || typeToConvert == typeof(global::Ideogram.MagicPromptRequestMessagesInnerRole) - - || typeToConvert == typeof(global::Ideogram.MagicPromptRequestMessagesInnerRole?); - } - - public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - if (typeToConvert == typeof(global::Ideogram.V4PromptElementDiscriminatorType)) - { - return new global::Ideogram.JsonConverters.V4PromptElementDiscriminatorTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.V4PromptElementDiscriminatorType?)) - { - return new global::Ideogram.JsonConverters.V4PromptElementDiscriminatorTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.V4ObjPromptElementType)) - { - return new global::Ideogram.JsonConverters.V4ObjPromptElementTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.V4ObjPromptElementType?)) - { - return new global::Ideogram.JsonConverters.V4ObjPromptElementTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.V4TextPromptElementType)) - { - return new global::Ideogram.JsonConverters.V4TextPromptElementTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.V4TextPromptElementType?)) - { - return new global::Ideogram.JsonConverters.V4TextPromptElementTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.AspectRatioV4)) - { - return new global::Ideogram.JsonConverters.AspectRatioV4JsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.AspectRatioV4?)) - { - return new global::Ideogram.JsonConverters.AspectRatioV4NullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.AspectRatioV3)) - { - return new global::Ideogram.JsonConverters.AspectRatioV3JsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.AspectRatioV3?)) - { - return new global::Ideogram.JsonConverters.AspectRatioV3NullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.StyleTypeV3)) - { - return new global::Ideogram.JsonConverters.StyleTypeV3JsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.StyleTypeV3?)) - { - return new global::Ideogram.JsonConverters.StyleTypeV3NullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.MagicPromptVersionEnum)) - { - return new global::Ideogram.JsonConverters.MagicPromptVersionEnumJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.MagicPromptVersionEnum?)) - { - return new global::Ideogram.JsonConverters.MagicPromptVersionEnumNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.MagicPromptRequestMessagesInnerRole)) - { - return new global::Ideogram.JsonConverters.MagicPromptRequestMessagesInnerRoleJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.MagicPromptRequestMessagesInnerRole?)) - { - return new global::Ideogram.JsonConverters.MagicPromptRequestMessagesInnerRoleNullableJsonConverter(); - } - throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); - } - } - - private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver - { - private readonly object _gate = new(); - private readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[] _resolvers = new global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[1]; - - public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo( - global::System.Type type, - global::System.Text.Json.JsonSerializerOptions options) - { - for (var index = 0; index < _resolvers.Length; index++) - { - var typeInfo = GetResolver(index).GetTypeInfo(type, options); - if (typeInfo is not null) - { - return typeInfo; - } - } - - return null; - } - - private global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver GetResolver(int index) - { - var resolver = global::System.Threading.Volatile.Read(ref _resolvers[index]); - if (resolver is not null) - { - return resolver; - } - - lock (_gate) - { - return _resolvers[index] ??= CreateResolver(index); - } - } - - private static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver CreateResolver(int index) - { - return index switch - { - 0 => new PromptSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), - _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), - }; - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.PromptClient.Authorizations.Bearer.g.cs b/src/libs/Ideogram/Generated/Ideogram.PromptClient.Authorizations.Bearer.g.cs deleted file mode 100644 index 306d15ff..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.PromptClient.Authorizations.Bearer.g.cs +++ /dev/null @@ -1,35 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public sealed partial class PromptClient - { - - /// - public void AuthorizeUsingBearer( - string apiKey) - { - apiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey)); - - for (var i = Authorizations.Count - 1; i >= 0; i--) - { - var __authorization = Authorizations[i]; - if (__authorization.Type == "Http" && - __authorization.Name == "Bearer") - { - Authorizations.RemoveAt(i); - } - } - - Authorizations.Add(new global::Ideogram.EndPointAuthorization - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - Value = apiKey, - }); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.PromptClient.Constructors.Bearer.g.cs b/src/libs/Ideogram/Generated/Ideogram.PromptClient.Constructors.Bearer.g.cs deleted file mode 100644 index 7085e8e3..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.PromptClient.Constructors.Bearer.g.cs +++ /dev/null @@ -1,31 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public sealed partial class PromptClient - { - /// - - public PromptClient( - string apiKey, - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - bool disposeHttpClient = true) : this(httpClient, baseUri, authorizations, disposeHttpClient) - { - Authorizing(HttpClient, ref apiKey); - - AuthorizeUsingBearer(apiKey); - - Authorized(HttpClient); - } - - partial void Authorizing( - global::System.Net.Http.HttpClient client, - ref string apiKey); - partial void Authorized( - global::System.Net.Http.HttpClient client); - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.PromptClient.PostMagicPrompt.g.cs b/src/libs/Ideogram/Generated/Ideogram.PromptClient.PostMagicPrompt.g.cs deleted file mode 100644 index 0e2125a9..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.PromptClient.PostMagicPrompt.g.cs +++ /dev/null @@ -1,847 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class PromptClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostMagicPromptSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostMagicPromptSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostMagicPromptSecurityRequirement0, - }; - partial void PreparePostMagicPromptArguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.MagicPromptRequest request); - partial void PreparePostMagicPromptRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.MagicPromptRequest request); - partial void ProcessPostMagicPromptResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostMagicPromptResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Generate Magic Prompt
- /// Transforms basic prompts into a magic prompt. Internal use only (feature flagged). TODO: update description if enabled externally. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostMagicPromptAsync( - - global::Ideogram.MagicPromptRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostMagicPromptAsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Generate Magic Prompt
- /// Transforms basic prompts into a magic prompt. Internal use only (feature flagged). TODO: update description if enabled externally. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostMagicPromptAsResponseAsync( - - global::Ideogram.MagicPromptRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostMagicPromptArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostMagicPromptSecurityRequirements, - operationName: "PostMagicPromptAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/magic-prompt", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (request.Prompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - } - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.MagicPromptVersion.ToValueString()), - name: "\"magic_prompt_version\""); - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.ClassifyPromptCategory, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"classify_prompt_category\""); - - if (request.StyleType != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.StyleType).HasValue ? (request.StyleType).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"style_type\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.CharacterReferenceImages != default) - { - - for (var __iCharacterReferenceImages = 0; __iCharacterReferenceImages < request.CharacterReferenceImages.Count; __iCharacterReferenceImages++) - { - var __contentCharacterReferenceImages = new global::System.Net.Http.ByteArrayContent(request.CharacterReferenceImages[__iCharacterReferenceImages]); - __contentCharacterReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); - __httpRequestContent.Add( - content: __contentCharacterReferenceImages, - name: "\"character_reference_images\"", - fileName: $"\"file{__iCharacterReferenceImages}.bin\""); - if (__contentCharacterReferenceImages.Headers.ContentDisposition != null) - { - __contentCharacterReferenceImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - if (request.SystemPrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.SystemPrompt ?? string.Empty), - name: "\"system_prompt\""); - - } - if (request.AspectRatio != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.AspectRatio).HasValue ? (request.AspectRatio).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"aspect_ratio\""); - - } - if (request.Temperature != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Temperature, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"temperature\""); - - } - if (request.TopP != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.TopP, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"top_p\""); - - } - if (request.TopK != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.TopK, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"top_k\""); - - } - if (request.MinP != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.MinP, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"min_p\""); - - } - if (request.MaxTokens != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.MaxTokens, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"max_tokens\""); - - } - if (request.PresencePenalty != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.PresencePenalty, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"presence_penalty\""); - - } - if (request.FrequencyPenalty != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.FrequencyPenalty, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"frequency_penalty\""); - - } - if (request.RepetitionPenalty != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.RepetitionPenalty, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"repetition_penalty\""); - - } - if (request.Checkpoint != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Checkpoint ?? string.Empty), - name: "\"checkpoint\""); - - } - if (request.Messages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.Messages!, x => x.ToJson(JsonSerializerContext)))}]"), - name: "\"messages\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostMagicPromptRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostMagicPrompt", - methodName: "PostMagicPromptAsync", - pathTemplate: "\"/magic-prompt\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostMagicPrompt", - methodName: "PostMagicPromptAsync", - pathTemplate: "\"/magic-prompt\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostMagicPrompt", - methodName: "PostMagicPromptAsync", - pathTemplate: "\"/magic-prompt\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostMagicPromptResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostMagicPrompt", - methodName: "PostMagicPromptAsync", - pathTemplate: "\"/magic-prompt\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostMagicPrompt", - methodName: "PostMagicPromptAsync", - pathTemplate: "\"/magic-prompt\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 500) - { - string? __content_500 = null; - global::System.Exception? __exception_500 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_500 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_500, - responseBody: __content_500, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostMagicPromptResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.MagicPromptResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.MagicPromptResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Generate Magic Prompt
- /// Transforms basic prompts into a magic prompt. Internal use only (feature flagged). TODO: update description if enabled externally. - ///
- /// - /// The prompt to enhance with a magic prompt. Mutually
- /// exclusive with `messages`; one of the two must be set.
- /// Example: a cat - /// - /// - /// The magic prompt version to use when magic prompt option is set to AUTO or ON.
- /// Example: V_0 - /// - /// - /// Whether to classify the prompt into a use case category.
- /// Default Value: true
- /// Example: false - /// - /// - /// The style type to generate with.
- /// Default Value: GENERAL
- /// Example: GENERAL - /// - /// - /// Random seed for reproducible generation
- /// Example: 12345 - /// - /// - /// Generations with character reference are subject to the character reference pricing. A set of images to use as character references (max size 25MB per image; the whole request must stay under 50MB), currently only supports 1 character reference image. The images should be in JPEG, PNG or WebP format. - /// - /// - /// A system prompt to use for the magic prompt.
- /// Example: You are a helpful assistant that generates magic prompts for images. - /// - /// - /// Optional target aspect ratio used to condition the generated
- /// magic prompt's framing. Forwarded to the autoprompt pipeline
- /// so registry-driven system prompts that interpolate
- /// `{{aspect_ratio}}` see the bucket the caller intends. - /// - /// - /// Sampling temperature override. Defaults to the trainer-conditioned
- /// value when omitted (0.7 for V4_QWEN_3_5_27B). Only honored with
- /// V4 magic-prompt versions; supplying it with another version
- /// returns 400. - /// - /// - /// Nucleus-sampling top_p override. Only honored with V4 versions. - /// - /// - /// Top-k sampling override. Only honored with V4 versions. - /// - /// - /// min_p sampling override. Only honored with V4 versions. - /// - /// - /// Cap on the number of tokens the model may generate. Defaults to
- /// 4096 (the trainer's reference cap) when omitted. Only honored
- /// with V4 versions. - /// - /// - /// Presence-penalty override. Only honored with V4 versions. - /// - /// - /// Frequency-penalty override. Only honored with V4 versions. - /// - /// - /// Repetition-penalty override. Only honored with V4 versions. - /// - /// - /// Optional override of the LoRA adapter the V4 magic-prompt
- /// wrapper downloads and runs. Pass a `gs://` URI pointing at a
- /// checkpoint directory containing `adapter_config.json`. When
- /// omitted, the wrapper-preloaded production checkpoint is used.
- /// Honored with the wrapper-routed LoRA versions
- /// `V4_QWEN_3_5_27B` and `V4_QWEN_3_5_27B_FULL_FINETUNE_LORA`;
- /// supplying it with `V4_QWEN_3_5_27B_PREFUSED` or
- /// `V4_QWEN_3_5_27B_FULL_FINETUNE` (which serve fixed weights and
- /// cannot swap adapters per request) or any other version returns
- /// 400. - /// - /// - /// Pre-formed chat messages forwarded verbatim to V4. Mutually
- /// exclusive with `prompt`; exactly one must be set. V4 only. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostMagicPromptAsync( - global::Ideogram.MagicPromptVersionEnum magicPromptVersion, - bool classifyPromptCategory, - string? prompt = default, - global::Ideogram.StyleTypeV3? styleType = default, - int? seed = default, - global::System.Collections.Generic.IList? characterReferenceImages = default, - string? systemPrompt = default, - global::Ideogram.AspectRatioV3? aspectRatio = default, - float? temperature = default, - float? topP = default, - int? topK = default, - float? minP = default, - int? maxTokens = default, - float? presencePenalty = default, - float? frequencyPenalty = default, - float? repetitionPenalty = default, - string? checkpoint = default, - global::System.Collections.Generic.IList? messages = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.MagicPromptRequest - { - Prompt = prompt, - MagicPromptVersion = magicPromptVersion, - ClassifyPromptCategory = classifyPromptCategory, - StyleType = styleType, - Seed = seed, - CharacterReferenceImages = characterReferenceImages, - SystemPrompt = systemPrompt, - AspectRatio = aspectRatio, - Temperature = temperature, - TopP = topP, - TopK = topK, - MinP = minP, - MaxTokens = maxTokens, - PresencePenalty = presencePenalty, - FrequencyPenalty = frequencyPenalty, - RepetitionPenalty = repetitionPenalty, - Checkpoint = checkpoint, - Messages = messages, - }; - - return await PostMagicPromptAsync( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.PromptClient.PostMagicPromptV4.g.cs b/src/libs/Ideogram/Generated/Ideogram.PromptClient.PostMagicPromptV4.g.cs deleted file mode 100644 index eacc938c..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.PromptClient.PostMagicPromptV4.g.cs +++ /dev/null @@ -1,608 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class PromptClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostMagicPromptV4SecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostMagicPromptV4SecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostMagicPromptV4SecurityRequirement0, - }; - partial void PreparePostMagicPromptV4Arguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.MagicPromptV4Request request); - partial void PreparePostMagicPromptV4Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.MagicPromptV4Request request); - partial void ProcessPostMagicPromptV4Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostMagicPromptV4ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Generate a Magic Prompt with Ideogram 4.0
- /// Transforms a basic prompt into an enhanced Ideogram 4.0 magic prompt.
- /// The magic prompt model version is fixed; callers cannot select it.
- /// When `aspect_ratio` is `AUTO` (the default), the model selects the most
- /// suitable aspect ratio for the prompt and returns it in the response. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostMagicPromptV4Async( - - global::Ideogram.MagicPromptV4Request request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostMagicPromptV4AsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Generate a Magic Prompt with Ideogram 4.0
- /// Transforms a basic prompt into an enhanced Ideogram 4.0 magic prompt.
- /// The magic prompt model version is fixed; callers cannot select it.
- /// When `aspect_ratio` is `AUTO` (the default), the model selects the most
- /// suitable aspect ratio for the prompt and returns it in the response. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostMagicPromptV4AsResponseAsync( - - global::Ideogram.MagicPromptV4Request request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostMagicPromptV4Arguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostMagicPromptV4SecurityRequirements, - operationName: "PostMagicPromptV4Async"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/ideogram-v4/magic-prompt", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostMagicPromptV4Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostMagicPromptV4", - methodName: "PostMagicPromptV4Async", - pathTemplate: "\"/v1/ideogram-v4/magic-prompt\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostMagicPromptV4", - methodName: "PostMagicPromptV4Async", - pathTemplate: "\"/v1/ideogram-v4/magic-prompt\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostMagicPromptV4", - methodName: "PostMagicPromptV4Async", - pathTemplate: "\"/v1/ideogram-v4/magic-prompt\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostMagicPromptV4Response( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostMagicPromptV4", - methodName: "PostMagicPromptV4Async", - pathTemplate: "\"/v1/ideogram-v4/magic-prompt\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostMagicPromptV4", - methodName: "PostMagicPromptV4Async", - pathTemplate: "\"/v1/ideogram-v4/magic-prompt\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 500) - { - string? __content_500 = null; - global::System.Exception? __exception_500 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_500 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_500, - responseBody: __content_500, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostMagicPromptV4ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.MagicPromptV4Response.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.MagicPromptV4Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Generate a Magic Prompt with Ideogram 4.0
- /// Transforms a basic prompt into an enhanced Ideogram 4.0 magic prompt.
- /// The magic prompt model version is fixed; callers cannot select it.
- /// When `aspect_ratio` is `AUTO` (the default), the model selects the most
- /// suitable aspect ratio for the prompt and returns it in the response. - ///
- /// - /// The natural-language prompt to enhance into an Ideogram 4.0 magic
- /// prompt. Named `text_prompt` to match the Ideogram 4.0 generate
- /// request surface.
- /// Example: a cat - /// - /// - /// Target aspect ratio. Defaults to `AUTO`, which lets the model
- /// select the most suitable ratio and return it in the response. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostMagicPromptV4Async( - string textPrompt, - global::Ideogram.AspectRatioV4? aspectRatio = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.MagicPromptV4Request - { - TextPrompt = textPrompt, - AspectRatio = aspectRatio, - }; - - return await PostMagicPromptV4Async( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.PromptClient.g.cs b/src/libs/Ideogram/Generated/Ideogram.PromptClient.g.cs deleted file mode 100644 index 0f243ee0..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.PromptClient.g.cs +++ /dev/null @@ -1,143 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// If no httpClient is provided, a new one will be created.
- /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. - ///
- public sealed partial class PromptClient : global::Ideogram.IPromptClient, global::System.IDisposable - { - /// - /// - /// - public const string DefaultBaseUrl = "https://api.ideogram.ai/"; - - private bool _disposeHttpClient = true; - - /// - public global::System.Net.Http.HttpClient HttpClient { get; } - - /// - public System.Uri? BaseUri => HttpClient.BaseAddress; - - /// - public global::System.Collections.Generic.List Authorizations { get; } - - /// - public bool ReadResponseAsString { get; set; } -#if DEBUG - = true; -#endif - - /// - public global::Ideogram.AutoSDKClientOptions Options { get; } - - internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::Ideogram.PromptSourceGenerationContext.Default); - - /// - /// - /// - public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext - { - get => JsonSerializerContextProvider.Value; - set => JsonSerializerContextProvider = new(() => value); - } - - - /// - /// Creates a new instance of the PromptClient. - /// If no httpClient is provided, a new one will be created. - /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. - /// - /// The HttpClient instance. If not provided, a new one will be created. - /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. - /// The authorizations to use for the requests. - /// Dispose the HttpClient when the instance is disposed. True by default. - public PromptClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - bool disposeHttpClient = true) : this( - httpClient, - baseUri, - authorizations, - options: null, - disposeHttpClient: disposeHttpClient) - { - } - - /// - /// Creates a new instance of the PromptClient with explicit options but no base URL override. - /// Skips passing baseUri so the default base URL from the OpenAPI spec applies. - /// - /// The HttpClient instance. If not provided, a new one will be created. - /// The authorizations to use for the requests. - /// Client-wide request defaults such as headers, query parameters, retries, and timeout. - /// Dispose the HttpClient when the instance is disposed. True by default. - public PromptClient( - global::System.Net.Http.HttpClient? httpClient, - global::System.Collections.Generic.List? authorizations, - global::Ideogram.AutoSDKClientOptions? options, - bool disposeHttpClient = true) : this( - httpClient, - baseUri: null, - authorizations, - options, - disposeHttpClient: disposeHttpClient) - { - } - - /// - /// Creates a new instance of the PromptClient. - /// If no httpClient is provided, a new one will be created. - /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. - /// - /// The HttpClient instance. If not provided, a new one will be created. - /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. - /// The authorizations to use for the requests. - /// Client-wide request defaults such as headers, query parameters, retries, and timeout. - /// Dispose the HttpClient when the instance is disposed. True by default. - public PromptClient( - global::System.Net.Http.HttpClient? httpClient, - global::System.Uri? baseUri, - global::System.Collections.Generic.List? authorizations, - global::Ideogram.AutoSDKClientOptions? options, - bool disposeHttpClient = true) - { - - HttpClient = httpClient ?? new global::System.Net.Http.HttpClient(); - HttpClient.BaseAddress ??= baseUri ?? new global::System.Uri(DefaultBaseUrl); - Authorizations = authorizations ?? new global::System.Collections.Generic.List(); - Options = options ?? new global::Ideogram.AutoSDKClientOptions(); - _disposeHttpClient = disposeHttpClient; - - Initialized(HttpClient); - } - - /// - public void Dispose() - { - if (_disposeHttpClient) - { - HttpClient.Dispose(); - } - } - - partial void Initialized( - global::System.Net.Http.HttpClient client); - partial void PrepareArguments( - global::System.Net.Http.HttpClient client); - partial void PrepareRequest( - global::System.Net.Http.HttpClient client, - global::System.Net.Http.HttpRequestMessage request); - partial void ProcessResponse( - global::System.Net.Http.HttpClient client, - global::System.Net.Http.HttpResponseMessage response); - partial void ProcessResponseContent( - global::System.Net.Http.HttpClient client, - global::System.Net.Http.HttpResponseMessage response, - ref string content); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Provenance.JsonSerializerContext.g.cs b/src/libs/Ideogram/Generated/Ideogram.Provenance.JsonSerializerContext.g.cs deleted file mode 100644 index 620bff02..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Provenance.JsonSerializerContext.g.cs +++ /dev/null @@ -1,160 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull - )] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(byte[]))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ProvenanceVerifyResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ProvenanceVerifyResponseValidationState), TypeInfoPropertyName = "ProvenanceVerifyResponseValidationState2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ProvenanceVerifyRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ProvenanceVerifyResponseValidationState?), TypeInfoPropertyName = "NullableProvenanceVerifyResponseValidationState2")] - internal sealed partial class ProvenanceSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext - { - } - /// - /// - /// - public sealed partial class ProvenanceSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext - { - private static readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver Resolver = new LazyChunkResolver(); - - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - internal static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver TypeInfoResolver => Resolver; - - - private static readonly global::System.Text.Json.JsonSerializerOptions DefaultOptions = CreateDefaultOptions(); - - /// - /// - /// - public static ProvenanceSourceGenerationContext Default { get; } = new(DefaultOptions); - - private ProvenanceSourceGenerationContext(global::System.Text.Json.JsonSerializerOptions options) - : base(options) - { - } - - /// - protected override global::System.Text.Json.JsonSerializerOptions? GeneratedSerializerOptions => DefaultOptions; - - /// - public override global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo(global::System.Type type) - { - return Resolver.GetTypeInfo(type, Options); - } - - /// - /// Adds this package's converters to . - /// - /// - /// A converter has to be on the options a chained resolver builds its JsonTypeInfo against, - /// and a context resolves types from every package below it. Each package contributes only - /// what it owns and calls down the chain for the rest, so the family's converter table is - /// written once rather than copied into all of them. - /// - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) - { - options.Converters.Add(new global::Ideogram.JsonConverters.UnixTimestampJsonConverter()); - options.Converters.Add(new LazyEnumJsonConverterFactory()); - } - - private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() - { - var options = new global::System.Text.Json.JsonSerializerOptions - { - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, - TypeInfoResolver = Resolver, - }; - AddConverters(options); - - return options; - } - - - private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory - { - public override bool CanConvert(global::System.Type typeToConvert) - { - return - typeToConvert == typeof(global::Ideogram.ProvenanceVerifyResponseValidationState) - - || typeToConvert == typeof(global::Ideogram.ProvenanceVerifyResponseValidationState?); - } - - public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - if (typeToConvert == typeof(global::Ideogram.ProvenanceVerifyResponseValidationState)) - { - return new global::Ideogram.JsonConverters.ProvenanceVerifyResponseValidationStateJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.ProvenanceVerifyResponseValidationState?)) - { - return new global::Ideogram.JsonConverters.ProvenanceVerifyResponseValidationStateNullableJsonConverter(); - } - throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); - } - } - - private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver - { - private readonly object _gate = new(); - private readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[] _resolvers = new global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[1]; - - public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo( - global::System.Type type, - global::System.Text.Json.JsonSerializerOptions options) - { - for (var index = 0; index < _resolvers.Length; index++) - { - var typeInfo = GetResolver(index).GetTypeInfo(type, options); - if (typeInfo is not null) - { - return typeInfo; - } - } - - return null; - } - - private global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver GetResolver(int index) - { - var resolver = global::System.Threading.Volatile.Read(ref _resolvers[index]); - if (resolver is not null) - { - return resolver; - } - - lock (_gate) - { - return _resolvers[index] ??= CreateResolver(index); - } - } - - private static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver CreateResolver(int index) - { - return index switch - { - 0 => new ProvenanceSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), - _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), - }; - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ProvenanceClient.Authorizations.Bearer.g.cs b/src/libs/Ideogram/Generated/Ideogram.ProvenanceClient.Authorizations.Bearer.g.cs deleted file mode 100644 index d8ad6de9..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ProvenanceClient.Authorizations.Bearer.g.cs +++ /dev/null @@ -1,35 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public sealed partial class ProvenanceClient - { - - /// - public void AuthorizeUsingBearer( - string apiKey) - { - apiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey)); - - for (var i = Authorizations.Count - 1; i >= 0; i--) - { - var __authorization = Authorizations[i]; - if (__authorization.Type == "Http" && - __authorization.Name == "Bearer") - { - Authorizations.RemoveAt(i); - } - } - - Authorizations.Add(new global::Ideogram.EndPointAuthorization - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - Value = apiKey, - }); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ProvenanceClient.Constructors.Bearer.g.cs b/src/libs/Ideogram/Generated/Ideogram.ProvenanceClient.Constructors.Bearer.g.cs deleted file mode 100644 index e216b533..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ProvenanceClient.Constructors.Bearer.g.cs +++ /dev/null @@ -1,31 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public sealed partial class ProvenanceClient - { - /// - - public ProvenanceClient( - string apiKey, - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - bool disposeHttpClient = true) : this(httpClient, baseUri, authorizations, disposeHttpClient) - { - Authorizing(HttpClient, ref apiKey); - - AuthorizeUsingBearer(apiKey); - - Authorized(HttpClient); - } - - partial void Authorizing( - global::System.Net.Http.HttpClient client, - ref string apiKey); - partial void Authorized( - global::System.Net.Http.HttpClient client); - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ProvenanceClient.PostProvenanceVerify.g.cs b/src/libs/Ideogram/Generated/Ideogram.ProvenanceClient.PostProvenanceVerify.g.cs deleted file mode 100644 index f454b1db..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ProvenanceClient.PostProvenanceVerify.g.cs +++ /dev/null @@ -1,1644 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ProvenanceClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostProvenanceVerifySecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostProvenanceVerifySecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostProvenanceVerifySecurityRequirement0, - }; - partial void PreparePostProvenanceVerifyArguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.ProvenanceVerifyRequest request); - partial void PreparePostProvenanceVerifyRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.ProvenanceVerifyRequest request); - partial void ProcessPostProvenanceVerifyResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostProvenanceVerifyResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Check whether content was created by Ideogram
- /// Checks image content for an Ideogram provenance manifest (C2PA Content
- /// Credentials) and returns the disclosure it carries: the provider name,
- /// the generating system and its version, the creation time, and the
- /// content's unique identifier.
- /// Upload the image to verify as the `content` part.
- /// This endpoint is public and unauthenticated — no API key is required.
- /// Submitted content is analyzed in memory and never stored. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostProvenanceVerifyAsync( - - global::Ideogram.ProvenanceVerifyRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostProvenanceVerifyAsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Check whether content was created by Ideogram
- /// Checks image content for an Ideogram provenance manifest (C2PA Content
- /// Credentials) and returns the disclosure it carries: the provider name,
- /// the generating system and its version, the creation time, and the
- /// content's unique identifier.
- /// Upload the image to verify as the `content` part.
- /// This endpoint is public and unauthenticated — no API key is required.
- /// Submitted content is analyzed in memory and never stored. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostProvenanceVerifyAsResponseAsync( - - global::Ideogram.ProvenanceVerifyRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostProvenanceVerifyArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostProvenanceVerifySecurityRequirements, - operationName: "PostProvenanceVerifyAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/provenance/verify", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - var __contentContent = new global::System.Net.Http.ByteArrayContent(request.Content ?? global::System.Array.Empty()); - __contentContent.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Contentname is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Contentname) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentContent, - name: "\"content\"", - fileName: request.Contentname != null ? $"\"{request.Contentname}\"" : string.Empty); - if (__contentContent.Headers.ContentDisposition != null) - { - __contentContent.Headers.ContentDisposition.FileNameStar = null; - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostProvenanceVerifyRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostProvenanceVerify", - methodName: "PostProvenanceVerifyAsync", - pathTemplate: "\"/v1/provenance/verify\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostProvenanceVerify", - methodName: "PostProvenanceVerifyAsync", - pathTemplate: "\"/v1/provenance/verify\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostProvenanceVerify", - methodName: "PostProvenanceVerifyAsync", - pathTemplate: "\"/v1/provenance/verify\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostProvenanceVerifyResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostProvenanceVerify", - methodName: "PostProvenanceVerifyAsync", - pathTemplate: "\"/v1/provenance/verify\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostProvenanceVerify", - methodName: "PostProvenanceVerifyAsync", - pathTemplate: "\"/v1/provenance/verify\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 413) - { - string? __content_413 = null; - global::System.Exception? __exception_413 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_413 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_413 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_413, - responseBody: __content_413, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostProvenanceVerifyResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.ProvenanceVerifyResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.ProvenanceVerifyResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Check whether content was created by Ideogram
- /// Checks image content for an Ideogram provenance manifest (C2PA Content
- /// Credentials) and returns the disclosure it carries: the provider name,
- /// the generating system and its version, the creation time, and the
- /// content's unique identifier.
- /// Upload the image to verify as the `content` part.
- /// This endpoint is public and unauthenticated — no API key is required.
- /// Submitted content is analyzed in memory and never stored. - ///
- /// - /// The image file to verify. - /// - /// - /// The image file to verify. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostProvenanceVerifyAsync( - byte[] content, - string contentname, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.ProvenanceVerifyRequest - { - Content = content, - Contentname = contentname, - }; - - return await PostProvenanceVerifyAsync( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - - /// - /// Check whether content was created by Ideogram
- /// Checks image content for an Ideogram provenance manifest (C2PA Content
- /// Credentials) and returns the disclosure it carries: the provider name,
- /// the generating system and its version, the creation time, and the
- /// content's unique identifier.
- /// Upload the image to verify as the `content` part.
- /// This endpoint is public and unauthenticated — no API key is required.
- /// Submitted content is analyzed in memory and never stored. - ///
- /// - /// The image file to verify. - /// - /// - /// The image file to verify. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostProvenanceVerifyAsync( - global::System.IO.Stream content, - string contentname, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - - content = content ?? throw new global::System.ArgumentNullException(nameof(content)); - var request = new global::Ideogram.ProvenanceVerifyRequest - { - Content = global::System.Array.Empty(), - Contentname = contentname, - }; - PrepareArguments( - client: HttpClient); - PreparePostProvenanceVerifyArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostProvenanceVerifySecurityRequirements, - operationName: "PostProvenanceVerifyAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/provenance/verify", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - var __contentContent = new global::System.Net.Http.StreamContent(content); - __contentContent.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Contentname is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Contentname) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentContent, - name: "\"content\"", - fileName: request.Contentname != null ? $"\"{request.Contentname}\"" : string.Empty); - if (__contentContent.Headers.ContentDisposition != null) - { - __contentContent.Headers.ContentDisposition.FileNameStar = null; - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostProvenanceVerifyRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostProvenanceVerify", - methodName: "PostProvenanceVerifyAsync", - pathTemplate: "\"/v1/provenance/verify\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostProvenanceVerify", - methodName: "PostProvenanceVerifyAsync", - pathTemplate: "\"/v1/provenance/verify\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostProvenanceVerify", - methodName: "PostProvenanceVerifyAsync", - pathTemplate: "\"/v1/provenance/verify\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostProvenanceVerifyResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostProvenanceVerify", - methodName: "PostProvenanceVerifyAsync", - pathTemplate: "\"/v1/provenance/verify\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostProvenanceVerify", - methodName: "PostProvenanceVerifyAsync", - pathTemplate: "\"/v1/provenance/verify\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 413) - { - string? __content_413 = null; - global::System.Exception? __exception_413 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_413 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_413 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_413, - responseBody: __content_413, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostProvenanceVerifyResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::Ideogram.ProvenanceVerifyResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - return - await global::Ideogram.ProvenanceVerifyResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Check whether content was created by Ideogram
- /// Checks image content for an Ideogram provenance manifest (C2PA Content
- /// Credentials) and returns the disclosure it carries: the provider name,
- /// the generating system and its version, the creation time, and the
- /// content's unique identifier.
- /// Upload the image to verify as the `content` part.
- /// This endpoint is public and unauthenticated — no API key is required.
- /// Submitted content is analyzed in memory and never stored. - ///
- /// - /// The image file to verify. - /// - /// - /// The image file to verify. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostProvenanceVerifyAsResponseAsync( - global::System.IO.Stream content, - string contentname, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - - content = content ?? throw new global::System.ArgumentNullException(nameof(content)); - var request = new global::Ideogram.ProvenanceVerifyRequest - { - Content = global::System.Array.Empty(), - Contentname = contentname, - }; - PrepareArguments( - client: HttpClient); - PreparePostProvenanceVerifyArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostProvenanceVerifySecurityRequirements, - operationName: "PostProvenanceVerifyAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/provenance/verify", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - var __contentContent = new global::System.Net.Http.StreamContent(content); - __contentContent.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Contentname is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Contentname) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentContent, - name: "\"content\"", - fileName: request.Contentname != null ? $"\"{request.Contentname}\"" : string.Empty); - if (__contentContent.Headers.ContentDisposition != null) - { - __contentContent.Headers.ContentDisposition.FileNameStar = null; - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostProvenanceVerifyRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostProvenanceVerify", - methodName: "PostProvenanceVerifyAsync", - pathTemplate: "\"/v1/provenance/verify\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostProvenanceVerify", - methodName: "PostProvenanceVerifyAsync", - pathTemplate: "\"/v1/provenance/verify\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostProvenanceVerify", - methodName: "PostProvenanceVerifyAsync", - pathTemplate: "\"/v1/provenance/verify\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostProvenanceVerifyResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostProvenanceVerify", - methodName: "PostProvenanceVerifyAsync", - pathTemplate: "\"/v1/provenance/verify\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostProvenanceVerify", - methodName: "PostProvenanceVerifyAsync", - pathTemplate: "\"/v1/provenance/verify\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 413) - { - string? __content_413 = null; - global::System.Exception? __exception_413 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_413 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_413 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_413, - responseBody: __content_413, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostProvenanceVerifyResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.ProvenanceVerifyResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.ProvenanceVerifyResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ProvenanceClient.g.cs b/src/libs/Ideogram/Generated/Ideogram.ProvenanceClient.g.cs deleted file mode 100644 index 1b4d1e4f..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ProvenanceClient.g.cs +++ /dev/null @@ -1,143 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// If no httpClient is provided, a new one will be created.
- /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. - ///
- public sealed partial class ProvenanceClient : global::Ideogram.IProvenanceClient, global::System.IDisposable - { - /// - /// - /// - public const string DefaultBaseUrl = "https://api.ideogram.ai/"; - - private bool _disposeHttpClient = true; - - /// - public global::System.Net.Http.HttpClient HttpClient { get; } - - /// - public System.Uri? BaseUri => HttpClient.BaseAddress; - - /// - public global::System.Collections.Generic.List Authorizations { get; } - - /// - public bool ReadResponseAsString { get; set; } -#if DEBUG - = true; -#endif - - /// - public global::Ideogram.AutoSDKClientOptions Options { get; } - - internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::Ideogram.ProvenanceSourceGenerationContext.Default); - - /// - /// - /// - public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext - { - get => JsonSerializerContextProvider.Value; - set => JsonSerializerContextProvider = new(() => value); - } - - - /// - /// Creates a new instance of the ProvenanceClient. - /// If no httpClient is provided, a new one will be created. - /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. - /// - /// The HttpClient instance. If not provided, a new one will be created. - /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. - /// The authorizations to use for the requests. - /// Dispose the HttpClient when the instance is disposed. True by default. - public ProvenanceClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - bool disposeHttpClient = true) : this( - httpClient, - baseUri, - authorizations, - options: null, - disposeHttpClient: disposeHttpClient) - { - } - - /// - /// Creates a new instance of the ProvenanceClient with explicit options but no base URL override. - /// Skips passing baseUri so the default base URL from the OpenAPI spec applies. - /// - /// The HttpClient instance. If not provided, a new one will be created. - /// The authorizations to use for the requests. - /// Client-wide request defaults such as headers, query parameters, retries, and timeout. - /// Dispose the HttpClient when the instance is disposed. True by default. - public ProvenanceClient( - global::System.Net.Http.HttpClient? httpClient, - global::System.Collections.Generic.List? authorizations, - global::Ideogram.AutoSDKClientOptions? options, - bool disposeHttpClient = true) : this( - httpClient, - baseUri: null, - authorizations, - options, - disposeHttpClient: disposeHttpClient) - { - } - - /// - /// Creates a new instance of the ProvenanceClient. - /// If no httpClient is provided, a new one will be created. - /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. - /// - /// The HttpClient instance. If not provided, a new one will be created. - /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. - /// The authorizations to use for the requests. - /// Client-wide request defaults such as headers, query parameters, retries, and timeout. - /// Dispose the HttpClient when the instance is disposed. True by default. - public ProvenanceClient( - global::System.Net.Http.HttpClient? httpClient, - global::System.Uri? baseUri, - global::System.Collections.Generic.List? authorizations, - global::Ideogram.AutoSDKClientOptions? options, - bool disposeHttpClient = true) - { - - HttpClient = httpClient ?? new global::System.Net.Http.HttpClient(); - HttpClient.BaseAddress ??= baseUri ?? new global::System.Uri(DefaultBaseUrl); - Authorizations = authorizations ?? new global::System.Collections.Generic.List(); - Options = options ?? new global::Ideogram.AutoSDKClientOptions(); - _disposeHttpClient = disposeHttpClient; - - Initialized(HttpClient); - } - - /// - public void Dispose() - { - if (_disposeHttpClient) - { - HttpClient.Dispose(); - } - } - - partial void Initialized( - global::System.Net.Http.HttpClient client); - partial void PrepareArguments( - global::System.Net.Http.HttpClient client); - partial void PrepareRequest( - global::System.Net.Http.HttpClient client, - global::System.Net.Http.HttpRequestMessage request); - partial void ProcessResponse( - global::System.Net.Http.HttpClient client, - global::System.Net.Http.HttpResponseMessage response); - partial void ProcessResponseContent( - global::System.Net.Http.HttpClient client, - global::System.Net.Http.HttpResponseMessage response, - ref string content); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Reframe.JsonSerializerContext.g.cs b/src/libs/Ideogram/Generated/Ideogram.Reframe.JsonSerializerContext.g.cs new file mode 100644 index 00000000..c02c51e9 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Reframe.JsonSerializerContext.g.cs @@ -0,0 +1,279 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// + /// + [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull + )] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GeneratedImageObject))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationRejectReason), TypeInfoPropertyName = "GenerationRejectReason2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed), TypeInfoPropertyName = "GenerationErrorResponseTaskCompletionSpeed2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationErrorResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ResolutionV3), TypeInfoPropertyName = "ResolutionV32")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramColorPalettePresetName), TypeInfoPropertyName = "IdeogramColorPalettePresetName2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramColorPaletteWithPresetName))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ColorPaletteMember))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ColorPaletteWithMembers))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramColorPalette), TypeInfoPropertyName = "IdeogramColorPalette2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramV3StylePreset), TypeInfoPropertyName = "IdeogramV3StylePreset2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageReframeIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed), TypeInfoPropertyName = "V2ImageReframeIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReframeImageIdeogramV3Response))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.NanoBanana2ReframeAspectRatio), TypeInfoPropertyName = "NanoBanana2ReframeAspectRatio2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReframeImageNanoBanana2Response))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(byte[]))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReframeIdeogramV3Request))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReframeNanoBanana2Request))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationRejectReason?), TypeInfoPropertyName = "NullableGenerationRejectReason2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?), TypeInfoPropertyName = "NullableGenerationErrorResponseTaskCompletionSpeed2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ResolutionV3?), TypeInfoPropertyName = "NullableResolutionV32")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramColorPalettePresetName?), TypeInfoPropertyName = "NullableIdeogramColorPalettePresetName2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(double?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramColorPalette?), TypeInfoPropertyName = "NullableIdeogramColorPalette2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.IdeogramV3StylePreset?), TypeInfoPropertyName = "NullableIdeogramV3StylePreset2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageReframeIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed?), TypeInfoPropertyName = "NullableV2ImageReframeIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.NanoBanana2ReframeAspectRatio?), TypeInfoPropertyName = "NullableNanoBanana2ReframeAspectRatio2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + internal sealed partial class ReframeSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext + { + } + /// + /// + /// + public sealed partial class ReframeSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext + { + private static readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver Resolver = new LazyChunkResolver(); + + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + internal static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver TypeInfoResolver => Resolver; + + + private static readonly global::System.Text.Json.JsonSerializerOptions DefaultOptions = CreateDefaultOptions(); + + /// + /// + /// + public static ReframeSourceGenerationContext Default { get; } = new(DefaultOptions); + + private ReframeSourceGenerationContext(global::System.Text.Json.JsonSerializerOptions options) + : base(options) + { + } + + /// + protected override global::System.Text.Json.JsonSerializerOptions? GeneratedSerializerOptions => DefaultOptions; + + /// + public override global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo(global::System.Type type) + { + return Resolver.GetTypeInfo(type, Options); + } + + /// + /// Adds this package's converters to . + /// + /// + /// A converter has to be on the options a chained resolver builds its JsonTypeInfo against, + /// and a context resolves types from every package below it. Each package contributes only + /// what it owns and calls down the chain for the rest, so the family's converter table is + /// written once rather than copied into all of them. + /// + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) + { + options.Converters.Add(new global::Ideogram.JsonConverters.IdeogramColorPaletteJsonConverter()); + options.Converters.Add(new global::Ideogram.JsonConverters.UnixTimestampJsonConverter()); + options.Converters.Add(new LazyEnumJsonConverterFactory()); + } + + private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() + { + var options = new global::System.Text.Json.JsonSerializerOptions + { + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + TypeInfoResolver = Resolver, + }; + AddConverters(options); + + return options; + } + + + private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory + { + public override bool CanConvert(global::System.Type typeToConvert) + { + return + typeToConvert == typeof(global::Ideogram.GenerationRejectReason) + + || typeToConvert == typeof(global::Ideogram.GenerationRejectReason?) + + || typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed) + + || typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?) + + || typeToConvert == typeof(global::Ideogram.ResolutionV3) + + || typeToConvert == typeof(global::Ideogram.ResolutionV3?) + + || typeToConvert == typeof(global::Ideogram.IdeogramColorPalettePresetName) + + || typeToConvert == typeof(global::Ideogram.IdeogramColorPalettePresetName?) + + || typeToConvert == typeof(global::Ideogram.IdeogramV3StylePreset) + + || typeToConvert == typeof(global::Ideogram.IdeogramV3StylePreset?) + + || typeToConvert == typeof(global::Ideogram.V2ImageReframeIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed) + + || typeToConvert == typeof(global::Ideogram.V2ImageReframeIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed?) + + || typeToConvert == typeof(global::Ideogram.NanoBanana2ReframeAspectRatio) + + || typeToConvert == typeof(global::Ideogram.NanoBanana2ReframeAspectRatio?); + } + + public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + if (typeToConvert == typeof(global::Ideogram.GenerationRejectReason)) + { + return new global::Ideogram.JsonConverters.GenerationRejectReasonJsonConverter(); + } + + if (typeToConvert == typeof(global::Ideogram.GenerationRejectReason?)) + { + return new global::Ideogram.JsonConverters.GenerationRejectReasonNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed)) + { + return new global::Ideogram.JsonConverters.GenerationErrorResponseTaskCompletionSpeedJsonConverter(); + } + + if (typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?)) + { + return new global::Ideogram.JsonConverters.GenerationErrorResponseTaskCompletionSpeedNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::Ideogram.ResolutionV3)) + { + return new global::Ideogram.JsonConverters.ResolutionV3JsonConverter(); + } + + if (typeToConvert == typeof(global::Ideogram.ResolutionV3?)) + { + return new global::Ideogram.JsonConverters.ResolutionV3NullableJsonConverter(); + } + + if (typeToConvert == typeof(global::Ideogram.IdeogramColorPalettePresetName)) + { + return new global::Ideogram.JsonConverters.IdeogramColorPalettePresetNameJsonConverter(); + } + + if (typeToConvert == typeof(global::Ideogram.IdeogramColorPalettePresetName?)) + { + return new global::Ideogram.JsonConverters.IdeogramColorPalettePresetNameNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::Ideogram.IdeogramV3StylePreset)) + { + return new global::Ideogram.JsonConverters.IdeogramV3StylePresetJsonConverter(); + } + + if (typeToConvert == typeof(global::Ideogram.IdeogramV3StylePreset?)) + { + return new global::Ideogram.JsonConverters.IdeogramV3StylePresetNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::Ideogram.V2ImageReframeIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed)) + { + return new global::Ideogram.JsonConverters.V2ImageReframeIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedJsonConverter(); + } + + if (typeToConvert == typeof(global::Ideogram.V2ImageReframeIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed?)) + { + return new global::Ideogram.JsonConverters.V2ImageReframeIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::Ideogram.NanoBanana2ReframeAspectRatio)) + { + return new global::Ideogram.JsonConverters.NanoBanana2ReframeAspectRatioJsonConverter(); + } + + if (typeToConvert == typeof(global::Ideogram.NanoBanana2ReframeAspectRatio?)) + { + return new global::Ideogram.JsonConverters.NanoBanana2ReframeAspectRatioNullableJsonConverter(); + } + throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); + } + } + + private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver + { + private readonly object _gate = new(); + private readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[] _resolvers = new global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[1]; + + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo( + global::System.Type type, + global::System.Text.Json.JsonSerializerOptions options) + { + for (var index = 0; index < _resolvers.Length; index++) + { + var typeInfo = GetResolver(index).GetTypeInfo(type, options); + if (typeInfo is not null) + { + return typeInfo; + } + } + + return null; + } + + private global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver GetResolver(int index) + { + var resolver = global::System.Threading.Volatile.Read(ref _resolvers[index]); + if (resolver is not null) + { + return resolver; + } + + lock (_gate) + { + return _resolvers[index] ??= CreateResolver(index); + } + } + + private static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver CreateResolver(int index) + { + return index switch + { + 0 => new ReframeSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), + }; + } + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ReframeClient.Authorizations.Bearer.g.cs b/src/libs/Ideogram/Generated/Ideogram.ReframeClient.Authorizations.Bearer.g.cs new file mode 100644 index 00000000..e63f5461 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.ReframeClient.Authorizations.Bearer.g.cs @@ -0,0 +1,35 @@ + +#nullable enable + +namespace Ideogram +{ + public sealed partial class ReframeClient + { + + /// + public void AuthorizeUsingBearer( + string apiKey) + { + apiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey)); + + for (var i = Authorizations.Count - 1; i >= 0; i--) + { + var __authorization = Authorizations[i]; + if (__authorization.Type == "Http" && + __authorization.Name == "Bearer") + { + Authorizations.RemoveAt(i); + } + } + + Authorizations.Add(new global::Ideogram.EndPointAuthorization + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + Value = apiKey, + }); + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ReframeClient.Constructors.Bearer.g.cs b/src/libs/Ideogram/Generated/Ideogram.ReframeClient.Constructors.Bearer.g.cs new file mode 100644 index 00000000..7d427928 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.ReframeClient.Constructors.Bearer.g.cs @@ -0,0 +1,31 @@ + +#nullable enable + +namespace Ideogram +{ + public sealed partial class ReframeClient + { + /// + + public ReframeClient( + string apiKey, + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this(httpClient, baseUri, authorizations, disposeHttpClient) + { + Authorizing(HttpClient, ref apiKey); + + AuthorizeUsingBearer(apiKey); + + Authorized(HttpClient); + } + + partial void Authorizing( + global::System.Net.Http.HttpClient client, + ref string apiKey); + partial void Authorized( + global::System.Net.Http.HttpClient client); + + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ReframeClient.ReframeIdeogramV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.ReframeClient.ReframeIdeogramV3.g.cs new file mode 100644 index 00000000..8047e8d6 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.ReframeClient.ReframeIdeogramV3.g.cs @@ -0,0 +1,2612 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class ReframeClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_ReframeIdeogramV3SecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_ReframeIdeogramV3SecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_ReframeIdeogramV3SecurityRequirement0, + }; + partial void PrepareReframeIdeogramV3Arguments( + global::System.Net.Http.HttpClient httpClient, + ref bool? dryRun, + global::Ideogram.ReframeIdeogramV3Request request); + partial void PrepareReframeIdeogramV3Request( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + bool? dryRun, + global::Ideogram.ReframeIdeogramV3Request request); + partial void ProcessReframeIdeogramV3Response( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessReframeIdeogramV3ResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Reframe with Ideogram 3.0
+ /// Expand an image to a new Ideogram 3.0 resolution, keeping the source
+ /// pixels in the center and filling the new area. Upload the source
+ /// `image` using `multipart/form-data`. Returns results directly by
+ /// default; set `async` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ReframeIdeogramV3Async( + + global::Ideogram.ReframeIdeogramV3Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ReframeIdeogramV3AsResponseAsync( + + request: request, + dryRun: dryRun, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Reframe with Ideogram 3.0
+ /// Expand an image to a new Ideogram 3.0 resolution, keeping the source
+ /// pixels in the center and filling the new area. Upload the source
+ /// `image` using `multipart/form-data`. Returns results directly by
+ /// default; set `async` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ReframeIdeogramV3AsResponseAsync( + + global::Ideogram.ReframeIdeogramV3Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareReframeIdeogramV3Arguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ReframeIdeogramV3SecurityRequirements, + operationName: "ReframeIdeogramV3Async"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/reframe/ideogram-3", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Resolution.ToValueString()), + name: "\"resolution\""); + + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (request.RenderingSpeed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"rendering_speed\""); + + } + if (request.StylePreset != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.StylePreset).HasValue ? (request.StylePreset).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"style_preset\""); + + } + if (request.ColorPalette != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.ColorPalette.ToString() ?? string.Empty), + name: "\"color_palette\""); + + } + if (request.StyleCodes != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.StyleCodes!, x => x))}]"), + name: "\"style_codes\""); + + } + if (request.StyleReferenceImages != default) + { + + for (var __iStyleReferenceImages = 0; __iStyleReferenceImages < request.StyleReferenceImages.Count; __iStyleReferenceImages++) + { + var __contentStyleReferenceImages = new global::System.Net.Http.ByteArrayContent(request.StyleReferenceImages[__iStyleReferenceImages]); + __contentStyleReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); + __httpRequestContent.Add( + content: __contentStyleReferenceImages, + name: "\"style_reference_images\"", + fileName: $"\"file{__iStyleReferenceImages}.bin\""); + if (__contentStyleReferenceImages.Headers.ContentDisposition != null) + { + __contentStyleReferenceImages.Headers.ContentDisposition.FileNameStar = null; + } + } + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareReframeIdeogramV3Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ReframeIdeogramV3", + methodName: "ReframeIdeogramV3Async", + pathTemplate: "\"/v2/image/reframe/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ReframeIdeogramV3", + methodName: "ReframeIdeogramV3Async", + pathTemplate: "\"/v2/image/reframe/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ReframeIdeogramV3", + methodName: "ReframeIdeogramV3Async", + pathTemplate: "\"/v2/image/reframe/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessReframeIdeogramV3Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ReframeIdeogramV3", + methodName: "ReframeIdeogramV3Async", + pathTemplate: "\"/v2/image/reframe/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ReframeIdeogramV3", + methodName: "ReframeIdeogramV3Async", + pathTemplate: "\"/v2/image/reframe/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // A referenced resource was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessReframeIdeogramV3ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.ReframeImageIdeogramV3Response.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.ReframeImageIdeogramV3Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Reframe with Ideogram 3.0
+ /// Expand an image to a new Ideogram 3.0 resolution, keeping the source
+ /// pixels in the center and filling the new area. Upload the source
+ /// `image` using `multipart/form-data`. Returns results directly by
+ /// default; set `async` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The JPEG, PNG, or WEBP image to reframe (max 25MB). Multipart requests only. + /// + /// + /// The JPEG, PNG, or WEBP image to reframe (max 25MB). Multipart requests only. + /// + /// + /// The resolutions supported for Ideogram 3.0. + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// Default Value: default + /// + /// + /// A predefined style preset that applies a specific artistic style to the generated image. + /// + /// + /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). + /// + /// + /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images. + /// + /// + /// JPEG, PNG, or WEBP style reference images (max 10, max 25MB each). Multipart requests only. Cannot be combined with `style_preset` or `style_codes`. + /// + /// + /// Return immediately instead of waiting for reframed images.
+ /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ReframeIdeogramV3Async( + byte[] image, + string imagename, + global::Ideogram.ResolutionV3 resolution, + bool? dryRun = default, + int? numImages = default, + int? seed = default, + global::Ideogram.V2ImageReframeIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed = default, + global::Ideogram.IdeogramV3StylePreset? stylePreset = default, + global::Ideogram.IdeogramColorPalette? colorPalette = default, + global::System.Collections.Generic.IList? styleCodes = default, + global::System.Collections.Generic.IList? styleReferenceImages = default, + bool? async = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Ideogram.ReframeIdeogramV3Request + { + Image = image, + Imagename = imagename, + Resolution = resolution, + NumImages = numImages, + Seed = seed, + RenderingSpeed = renderingSpeed, + StylePreset = stylePreset, + ColorPalette = colorPalette, + StyleCodes = styleCodes, + StyleReferenceImages = styleReferenceImages, + Async = async, + }; + + return await ReframeIdeogramV3Async( + dryRun: dryRun, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// Reframe with Ideogram 3.0
+ /// Expand an image to a new Ideogram 3.0 resolution, keeping the source
+ /// pixels in the center and filling the new area. Upload the source
+ /// `image` using `multipart/form-data`. Returns results directly by
+ /// default; set `async` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The JPEG, PNG, or WEBP image to reframe (max 25MB). Multipart requests only. + /// + /// + /// The JPEG, PNG, or WEBP image to reframe (max 25MB). Multipart requests only. + /// + /// + /// The resolutions supported for Ideogram 3.0. + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// Default Value: default + /// + /// + /// A predefined style preset that applies a specific artistic style to the generated image. + /// + /// + /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). + /// + /// + /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images. + /// + /// + /// JPEG, PNG, or WEBP style reference images (max 10, max 25MB each). Multipart requests only. Cannot be combined with `style_preset` or `style_codes`. + /// + /// + /// Optional file names to use for the multipart 'style_reference_images' file parts. + /// + /// + /// Return immediately instead of waiting for reframed images.
+ /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ReframeIdeogramV3Async( + global::System.IO.Stream image, + string imagename, + global::Ideogram.ResolutionV3 resolution, + bool? dryRun = default, + int? numImages = default, + int? seed = default, + global::Ideogram.V2ImageReframeIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed = default, + global::Ideogram.IdeogramV3StylePreset? stylePreset = default, + global::Ideogram.IdeogramColorPalette? colorPalette = default, + global::System.Collections.Generic.IList? styleCodes = default, + global::System.Collections.Generic.IReadOnlyList? styleReferenceImages = default, + global::System.Collections.Generic.IReadOnlyList? styleReferenceImagesFileNames = default, + bool? async = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + var request = new global::Ideogram.ReframeIdeogramV3Request + { + Image = global::System.Array.Empty(), + Imagename = imagename, + Resolution = resolution, + NumImages = numImages, + Seed = seed, + RenderingSpeed = renderingSpeed, + StylePreset = stylePreset, + ColorPalette = colorPalette, + StyleCodes = styleCodes, + StyleReferenceImages = new global::System.Collections.Generic.List(), + Async = async, + }; + PrepareArguments( + client: HttpClient); + PrepareReframeIdeogramV3Arguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ReframeIdeogramV3SecurityRequirements, + operationName: "ReframeIdeogramV3Async"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/reframe/ideogram-3", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Resolution.ToValueString()), + name: "\"resolution\""); + + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (request.RenderingSpeed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"rendering_speed\""); + + } + if (request.StylePreset != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.StylePreset).HasValue ? (request.StylePreset).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"style_preset\""); + + } + if (request.ColorPalette != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.ColorPalette.ToString() ?? string.Empty), + name: "\"color_palette\""); + + } + if (request.StyleCodes != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.StyleCodes!, x => x))}]"), + name: "\"style_codes\""); + + } + if (styleReferenceImages != default) + { + + for (var __iStyleReferenceImages = 0; __iStyleReferenceImages < styleReferenceImages.Count; __iStyleReferenceImages++) + { + var __fileNameStyleReferenceImages = styleReferenceImagesFileNames != null && + __iStyleReferenceImages < styleReferenceImagesFileNames.Count && + styleReferenceImagesFileNames[__iStyleReferenceImages] != null + ? styleReferenceImagesFileNames[__iStyleReferenceImages] + : $"file{__iStyleReferenceImages}.bin"; + var __contentStyleReferenceImages = new global::System.Net.Http.StreamContent(styleReferenceImages[__iStyleReferenceImages]); + __contentStyleReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + __fileNameStyleReferenceImages is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(__fileNameStyleReferenceImages) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentStyleReferenceImages, + name: "\"style_reference_images\"", + fileName: $"\"{__fileNameStyleReferenceImages}\""); + if (__contentStyleReferenceImages.Headers.ContentDisposition != null) + { + __contentStyleReferenceImages.Headers.ContentDisposition.FileNameStar = null; + } + } + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareReframeIdeogramV3Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ReframeIdeogramV3", + methodName: "ReframeIdeogramV3Async", + pathTemplate: "\"/v2/image/reframe/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ReframeIdeogramV3", + methodName: "ReframeIdeogramV3Async", + pathTemplate: "\"/v2/image/reframe/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ReframeIdeogramV3", + methodName: "ReframeIdeogramV3Async", + pathTemplate: "\"/v2/image/reframe/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessReframeIdeogramV3Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ReframeIdeogramV3", + methodName: "ReframeIdeogramV3Async", + pathTemplate: "\"/v2/image/reframe/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ReframeIdeogramV3", + methodName: "ReframeIdeogramV3Async", + pathTemplate: "\"/v2/image/reframe/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // A referenced resource was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessReframeIdeogramV3ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::Ideogram.ReframeImageIdeogramV3Response.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::Ideogram.ReframeImageIdeogramV3Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Reframe with Ideogram 3.0
+ /// Expand an image to a new Ideogram 3.0 resolution, keeping the source
+ /// pixels in the center and filling the new area. Upload the source
+ /// `image` using `multipart/form-data`. Returns results directly by
+ /// default; set `async` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The JPEG, PNG, or WEBP image to reframe (max 25MB). Multipart requests only. + /// + /// + /// The JPEG, PNG, or WEBP image to reframe (max 25MB). Multipart requests only. + /// + /// + /// The resolutions supported for Ideogram 3.0. + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// Default Value: default + /// + /// + /// A predefined style preset that applies a specific artistic style to the generated image. + /// + /// + /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). + /// + /// + /// A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images. + /// + /// + /// JPEG, PNG, or WEBP style reference images (max 10, max 25MB each). Multipart requests only. Cannot be combined with `style_preset` or `style_codes`. + /// + /// + /// Optional file names to use for the multipart 'style_reference_images' file parts. + /// + /// + /// Return immediately instead of waiting for reframed images.
+ /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ReframeIdeogramV3AsResponseAsync( + global::System.IO.Stream image, + string imagename, + global::Ideogram.ResolutionV3 resolution, + bool? dryRun = default, + int? numImages = default, + int? seed = default, + global::Ideogram.V2ImageReframeIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed = default, + global::Ideogram.IdeogramV3StylePreset? stylePreset = default, + global::Ideogram.IdeogramColorPalette? colorPalette = default, + global::System.Collections.Generic.IList? styleCodes = default, + global::System.Collections.Generic.IReadOnlyList? styleReferenceImages = default, + global::System.Collections.Generic.IReadOnlyList? styleReferenceImagesFileNames = default, + bool? async = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + var request = new global::Ideogram.ReframeIdeogramV3Request + { + Image = global::System.Array.Empty(), + Imagename = imagename, + Resolution = resolution, + NumImages = numImages, + Seed = seed, + RenderingSpeed = renderingSpeed, + StylePreset = stylePreset, + ColorPalette = colorPalette, + StyleCodes = styleCodes, + StyleReferenceImages = new global::System.Collections.Generic.List(), + Async = async, + }; + PrepareArguments( + client: HttpClient); + PrepareReframeIdeogramV3Arguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ReframeIdeogramV3SecurityRequirements, + operationName: "ReframeIdeogramV3Async"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/reframe/ideogram-3", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Resolution.ToValueString()), + name: "\"resolution\""); + + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (request.RenderingSpeed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"rendering_speed\""); + + } + if (request.StylePreset != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.StylePreset).HasValue ? (request.StylePreset).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"style_preset\""); + + } + if (request.ColorPalette != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.ColorPalette.ToString() ?? string.Empty), + name: "\"color_palette\""); + + } + if (request.StyleCodes != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.StyleCodes!, x => x))}]"), + name: "\"style_codes\""); + + } + if (styleReferenceImages != default) + { + + for (var __iStyleReferenceImages = 0; __iStyleReferenceImages < styleReferenceImages.Count; __iStyleReferenceImages++) + { + var __fileNameStyleReferenceImages = styleReferenceImagesFileNames != null && + __iStyleReferenceImages < styleReferenceImagesFileNames.Count && + styleReferenceImagesFileNames[__iStyleReferenceImages] != null + ? styleReferenceImagesFileNames[__iStyleReferenceImages] + : $"file{__iStyleReferenceImages}.bin"; + var __contentStyleReferenceImages = new global::System.Net.Http.StreamContent(styleReferenceImages[__iStyleReferenceImages]); + __contentStyleReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + __fileNameStyleReferenceImages is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(__fileNameStyleReferenceImages) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentStyleReferenceImages, + name: "\"style_reference_images\"", + fileName: $"\"{__fileNameStyleReferenceImages}\""); + if (__contentStyleReferenceImages.Headers.ContentDisposition != null) + { + __contentStyleReferenceImages.Headers.ContentDisposition.FileNameStar = null; + } + } + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareReframeIdeogramV3Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ReframeIdeogramV3", + methodName: "ReframeIdeogramV3Async", + pathTemplate: "\"/v2/image/reframe/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ReframeIdeogramV3", + methodName: "ReframeIdeogramV3Async", + pathTemplate: "\"/v2/image/reframe/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ReframeIdeogramV3", + methodName: "ReframeIdeogramV3Async", + pathTemplate: "\"/v2/image/reframe/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessReframeIdeogramV3Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ReframeIdeogramV3", + methodName: "ReframeIdeogramV3Async", + pathTemplate: "\"/v2/image/reframe/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ReframeIdeogramV3", + methodName: "ReframeIdeogramV3Async", + pathTemplate: "\"/v2/image/reframe/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // A referenced resource was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessReframeIdeogramV3ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.ReframeImageIdeogramV3Response.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.ReframeImageIdeogramV3Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ReframeClient.ReframeNanoBanana2.g.cs b/src/libs/Ideogram/Generated/Ideogram.ReframeClient.ReframeNanoBanana2.g.cs new file mode 100644 index 00000000..552eaf85 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.ReframeClient.ReframeNanoBanana2.g.cs @@ -0,0 +1,2316 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class ReframeClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_ReframeNanoBanana2SecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_ReframeNanoBanana2SecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_ReframeNanoBanana2SecurityRequirement0, + }; + partial void PrepareReframeNanoBanana2Arguments( + global::System.Net.Http.HttpClient httpClient, + ref bool? dryRun, + global::Ideogram.ReframeNanoBanana2Request request); + partial void PrepareReframeNanoBanana2Request( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + bool? dryRun, + global::Ideogram.ReframeNanoBanana2Request request); + partial void ProcessReframeNanoBanana2Response( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessReframeNanoBanana2ResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Reframe with Nano Banana 2
+ /// Expand an image to a new aspect ratio with Nano Banana 2. Upload the
+ /// source `image` using `multipart/form-data`. Always asynchronous:
+ /// returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// for results. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ReframeNanoBanana2Async( + + global::Ideogram.ReframeNanoBanana2Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ReframeNanoBanana2AsResponseAsync( + + request: request, + dryRun: dryRun, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Reframe with Nano Banana 2
+ /// Expand an image to a new aspect ratio with Nano Banana 2. Upload the
+ /// source `image` using `multipart/form-data`. Always asynchronous:
+ /// returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// for results. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ReframeNanoBanana2AsResponseAsync( + + global::Ideogram.ReframeNanoBanana2Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareReframeNanoBanana2Arguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ReframeNanoBanana2SecurityRequirements, + operationName: "ReframeNanoBanana2Async"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/reframe/nano-banana-2", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.AspectRatio.ToValueString()), + name: "\"aspect_ratio\""); + + if (request.Private != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"private\""); + + } + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareReframeNanoBanana2Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ReframeNanoBanana2", + methodName: "ReframeNanoBanana2Async", + pathTemplate: "\"/v2/image/reframe/nano-banana-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ReframeNanoBanana2", + methodName: "ReframeNanoBanana2Async", + pathTemplate: "\"/v2/image/reframe/nano-banana-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ReframeNanoBanana2", + methodName: "ReframeNanoBanana2Async", + pathTemplate: "\"/v2/image/reframe/nano-banana-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessReframeNanoBanana2Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ReframeNanoBanana2", + methodName: "ReframeNanoBanana2Async", + pathTemplate: "\"/v2/image/reframe/nano-banana-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ReframeNanoBanana2", + methodName: "ReframeNanoBanana2Async", + pathTemplate: "\"/v2/image/reframe/nano-banana-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // A referenced resource was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessReframeNanoBanana2ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.ReframeImageNanoBanana2Response.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.ReframeImageNanoBanana2Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Reframe with Nano Banana 2
+ /// Expand an image to a new aspect ratio with Nano Banana 2. Upload the
+ /// source `image` using `multipart/form-data`. Always asynchronous:
+ /// returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// for results. + ///
+ /// + /// Default Value: false + /// + /// + /// The JPEG, PNG, or WEBP image to reframe (max 50MB). + /// + /// + /// The JPEG, PNG, or WEBP image to reframe (max 50MB). + /// + /// + /// Aspect ratios Nano Banana 2 can reframe an image to. + /// + /// + /// API-key requests are always private. For bearer-authenticated
+ /// requests, this controls whether the result is private; when
+ /// omitted, it follows the caller's plan entitlement. Enterprise
+ /// generations are always private. + /// + /// + /// The number of output images to generate.
+ /// Default Value: 1 + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ReframeNanoBanana2Async( + byte[] image, + string imagename, + global::Ideogram.NanoBanana2ReframeAspectRatio aspectRatio, + bool? dryRun = default, + bool? @private = default, + int? numImages = default, + int? seed = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Ideogram.ReframeNanoBanana2Request + { + Image = image, + Imagename = imagename, + AspectRatio = aspectRatio, + Private = @private, + NumImages = numImages, + Seed = seed, + }; + + return await ReframeNanoBanana2Async( + dryRun: dryRun, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// Reframe with Nano Banana 2
+ /// Expand an image to a new aspect ratio with Nano Banana 2. Upload the
+ /// source `image` using `multipart/form-data`. Always asynchronous:
+ /// returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// for results. + ///
+ /// + /// Default Value: false + /// + /// + /// The JPEG, PNG, or WEBP image to reframe (max 50MB). + /// + /// + /// The JPEG, PNG, or WEBP image to reframe (max 50MB). + /// + /// + /// Aspect ratios Nano Banana 2 can reframe an image to. + /// + /// + /// API-key requests are always private. For bearer-authenticated
+ /// requests, this controls whether the result is private; when
+ /// omitted, it follows the caller's plan entitlement. Enterprise
+ /// generations are always private. + /// + /// + /// The number of output images to generate.
+ /// Default Value: 1 + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ReframeNanoBanana2Async( + global::System.IO.Stream image, + string imagename, + global::Ideogram.NanoBanana2ReframeAspectRatio aspectRatio, + bool? dryRun = default, + bool? @private = default, + int? numImages = default, + int? seed = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + var request = new global::Ideogram.ReframeNanoBanana2Request + { + Image = global::System.Array.Empty(), + Imagename = imagename, + AspectRatio = aspectRatio, + Private = @private, + NumImages = numImages, + Seed = seed, + }; + PrepareArguments( + client: HttpClient); + PrepareReframeNanoBanana2Arguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ReframeNanoBanana2SecurityRequirements, + operationName: "ReframeNanoBanana2Async"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/reframe/nano-banana-2", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.AspectRatio.ToValueString()), + name: "\"aspect_ratio\""); + + if (request.Private != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"private\""); + + } + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareReframeNanoBanana2Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ReframeNanoBanana2", + methodName: "ReframeNanoBanana2Async", + pathTemplate: "\"/v2/image/reframe/nano-banana-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ReframeNanoBanana2", + methodName: "ReframeNanoBanana2Async", + pathTemplate: "\"/v2/image/reframe/nano-banana-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ReframeNanoBanana2", + methodName: "ReframeNanoBanana2Async", + pathTemplate: "\"/v2/image/reframe/nano-banana-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessReframeNanoBanana2Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ReframeNanoBanana2", + methodName: "ReframeNanoBanana2Async", + pathTemplate: "\"/v2/image/reframe/nano-banana-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ReframeNanoBanana2", + methodName: "ReframeNanoBanana2Async", + pathTemplate: "\"/v2/image/reframe/nano-banana-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // A referenced resource was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessReframeNanoBanana2ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::Ideogram.ReframeImageNanoBanana2Response.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::Ideogram.ReframeImageNanoBanana2Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Reframe with Nano Banana 2
+ /// Expand an image to a new aspect ratio with Nano Banana 2. Upload the
+ /// source `image` using `multipart/form-data`. Always asynchronous:
+ /// returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// for results. + ///
+ /// + /// Default Value: false + /// + /// + /// The JPEG, PNG, or WEBP image to reframe (max 50MB). + /// + /// + /// The JPEG, PNG, or WEBP image to reframe (max 50MB). + /// + /// + /// Aspect ratios Nano Banana 2 can reframe an image to. + /// + /// + /// API-key requests are always private. For bearer-authenticated
+ /// requests, this controls whether the result is private; when
+ /// omitted, it follows the caller's plan entitlement. Enterprise
+ /// generations are always private. + /// + /// + /// The number of output images to generate.
+ /// Default Value: 1 + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ReframeNanoBanana2AsResponseAsync( + global::System.IO.Stream image, + string imagename, + global::Ideogram.NanoBanana2ReframeAspectRatio aspectRatio, + bool? dryRun = default, + bool? @private = default, + int? numImages = default, + int? seed = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + var request = new global::Ideogram.ReframeNanoBanana2Request + { + Image = global::System.Array.Empty(), + Imagename = imagename, + AspectRatio = aspectRatio, + Private = @private, + NumImages = numImages, + Seed = seed, + }; + PrepareArguments( + client: HttpClient); + PrepareReframeNanoBanana2Arguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ReframeNanoBanana2SecurityRequirements, + operationName: "ReframeNanoBanana2Async"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/reframe/nano-banana-2", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.AspectRatio.ToValueString()), + name: "\"aspect_ratio\""); + + if (request.Private != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"private\""); + + } + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareReframeNanoBanana2Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ReframeNanoBanana2", + methodName: "ReframeNanoBanana2Async", + pathTemplate: "\"/v2/image/reframe/nano-banana-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ReframeNanoBanana2", + methodName: "ReframeNanoBanana2Async", + pathTemplate: "\"/v2/image/reframe/nano-banana-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ReframeNanoBanana2", + methodName: "ReframeNanoBanana2Async", + pathTemplate: "\"/v2/image/reframe/nano-banana-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessReframeNanoBanana2Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ReframeNanoBanana2", + methodName: "ReframeNanoBanana2Async", + pathTemplate: "\"/v2/image/reframe/nano-banana-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ReframeNanoBanana2", + methodName: "ReframeNanoBanana2Async", + pathTemplate: "\"/v2/image/reframe/nano-banana-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // A referenced resource was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessReframeNanoBanana2ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.ReframeImageNanoBanana2Response.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.ReframeImageNanoBanana2Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ReframeClient.g.cs b/src/libs/Ideogram/Generated/Ideogram.ReframeClient.g.cs new file mode 100644 index 00000000..5a11acc5 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.ReframeClient.g.cs @@ -0,0 +1,143 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public sealed partial class ReframeClient : global::Ideogram.IReframeClient, global::System.IDisposable + { + /// + /// + /// + public const string DefaultBaseUrl = "https://api.ideogram.ai/"; + + private bool _disposeHttpClient = true; + + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + public System.Uri? BaseUri => HttpClient.BaseAddress; + + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif + + /// + public global::Ideogram.AutoSDKClientOptions Options { get; } + + internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::Ideogram.ReframeSourceGenerationContext.Default); + + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext + { + get => JsonSerializerContextProvider.Value; + set => JsonSerializerContextProvider = new(() => value); + } + + + /// + /// Creates a new instance of the ReframeClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Dispose the HttpClient when the instance is disposed. True by default. + public ReframeClient( + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this( + httpClient, + baseUri, + authorizations, + options: null, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the ReframeClient with explicit options but no base URL override. + /// Skips passing baseUri so the default base URL from the OpenAPI spec applies. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public ReframeClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::Ideogram.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the ReframeClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public ReframeClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Ideogram.AutoSDKClientOptions? options, + bool disposeHttpClient = true) + { + + HttpClient = httpClient ?? new global::System.Net.Http.HttpClient(); + HttpClient.BaseAddress ??= baseUri ?? new global::System.Uri(DefaultBaseUrl); + Authorizations = authorizations ?? new global::System.Collections.Generic.List(); + Options = options ?? new global::Ideogram.AutoSDKClientOptions(); + _disposeHttpClient = disposeHttpClient; + + Initialized(HttpClient); + } + + /// + public void Dispose() + { + if (_disposeHttpClient) + { + HttpClient.Dispose(); + } + } + + partial void Initialized( + global::System.Net.Http.HttpClient client); + partial void PrepareArguments( + global::System.Net.Http.HttpClient client); + partial void PrepareRequest( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpRequestMessage request); + partial void ProcessResponse( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response); + partial void ProcessResponseContent( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response, + ref string content); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ResponseStream.g.cs b/src/libs/Ideogram/Generated/Ideogram.ResponseStream.g.cs deleted file mode 100644 index 0cb4e34c..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ResponseStream.g.cs +++ /dev/null @@ -1,117 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - internal sealed class ResponseStream : global::System.IO.Stream - { - private readonly global::System.Net.Http.HttpResponseMessage _response; - private readonly global::System.IO.Stream _stream; - private bool _disposed; - - public ResponseStream( - global::System.Net.Http.HttpResponseMessage response, - global::System.IO.Stream stream) - { - _response = response ?? throw new global::System.ArgumentNullException(nameof(response)); - _stream = stream ?? throw new global::System.ArgumentNullException(nameof(stream)); - } - - public override bool CanRead => _stream.CanRead; - public override bool CanSeek => _stream.CanSeek; - public override bool CanWrite => _stream.CanWrite; - public override bool CanTimeout => _stream.CanTimeout; - public override long Length => _stream.Length; - - public override long Position - { - get => _stream.Position; - set => _stream.Position = value; - } - - public override int ReadTimeout - { - get => _stream.ReadTimeout; - set => _stream.ReadTimeout = value; - } - - public override int WriteTimeout - { - get => _stream.WriteTimeout; - set => _stream.WriteTimeout = value; - } - - public override void Flush() => _stream.Flush(); - - public override global::System.Threading.Tasks.Task FlushAsync( - global::System.Threading.CancellationToken cancellationToken) => - _stream.FlushAsync(cancellationToken); - - public override int Read(byte[] buffer, int offset, int count) => - _stream.Read(buffer, offset, count); - - public override global::System.Threading.Tasks.Task ReadAsync( - byte[] buffer, - int offset, - int count, - global::System.Threading.CancellationToken cancellationToken) => - _stream.ReadAsync(buffer, offset, count, cancellationToken); - -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_0_OR_GREATER || NET5_0_OR_GREATER - public override global::System.Threading.Tasks.ValueTask ReadAsync( - global::System.Memory buffer, - global::System.Threading.CancellationToken cancellationToken = default) => - _stream.ReadAsync(buffer, cancellationToken); -#endif - - public override long Seek(long offset, global::System.IO.SeekOrigin origin) => - _stream.Seek(offset, origin); - - public override void SetLength(long value) => - _stream.SetLength(value); - - public override void Write(byte[] buffer, int offset, int count) => - _stream.Write(buffer, offset, count); - - public override global::System.Threading.Tasks.Task WriteAsync( - byte[] buffer, - int offset, - int count, - global::System.Threading.CancellationToken cancellationToken) => - _stream.WriteAsync(buffer, offset, count, cancellationToken); - -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_0_OR_GREATER || NET5_0_OR_GREATER - public override global::System.Threading.Tasks.ValueTask WriteAsync( - global::System.ReadOnlyMemory buffer, - global::System.Threading.CancellationToken cancellationToken = default) => - _stream.WriteAsync(buffer, cancellationToken); -#endif - - protected override void Dispose(bool disposing) - { - if (!_disposed && disposing) - { - _disposed = true; - _stream.Dispose(); - _response.Dispose(); - } - - base.Dispose(disposing); - } - -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_0_OR_GREATER || NET5_0_OR_GREATER - public override async global::System.Threading.Tasks.ValueTask DisposeAsync() - { - if (_disposed) - { - return; - } - - _disposed = true; - await _stream.DisposeAsync().ConfigureAwait(false); - _response.Dispose(); - await base.DisposeAsync().ConfigureAwait(false); - } -#endif - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Tool.JsonSerializerContext.g.cs b/src/libs/Ideogram/Generated/Ideogram.Tool.JsonSerializerContext.g.cs index d75acd9c..4559cc1f 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Tool.JsonSerializerContext.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Tool.JsonSerializerContext.g.cs @@ -14,24 +14,29 @@ namespace Ideogram [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(byte[]))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AssetIdentifier))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationErrorResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationRejectReason), TypeInfoPropertyName = "GenerationRejectReason2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed), TypeInfoPropertyName = "GenerationErrorResponseTaskCompletionSpeed2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationErrorResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageReplaceBackgroundIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed), TypeInfoPropertyName = "V2ImageReplaceBackgroundIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReplaceBackgroundResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReplaceBackgroundQuality), TypeInfoPropertyName = "ReplaceBackgroundQuality2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.BackgroundRemovedImageObject))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemoveBackgroundV2Response))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.BackgroundRemovedImageObject))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemoveBackgroundV2Request))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.RemoveBackgroundV2AssetRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AssetType), TypeInfoPropertyName = "AssetType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(byte[]))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ToolReplaceBackgroundIdeogramV3Request))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ToolReplaceBackgroundRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ToolRemoveBackgroundRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ToolReplaceBackgroundIdeogram45Request))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationRejectReason?), TypeInfoPropertyName = "NullableGenerationRejectReason2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?), TypeInfoPropertyName = "NullableGenerationErrorResponseTaskCompletionSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AssetType?), TypeInfoPropertyName = "NullableAssetType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageReplaceBackgroundIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed?), TypeInfoPropertyName = "NullableV2ImageReplaceBackgroundIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ReplaceBackgroundQuality?), TypeInfoPropertyName = "NullableReplaceBackgroundQuality2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] internal sealed partial class ToolSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext { @@ -102,23 +107,37 @@ private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Ser public override bool CanConvert(global::System.Type typeToConvert) { return - typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed) + typeToConvert == typeof(global::Ideogram.GenerationRejectReason) + + || typeToConvert == typeof(global::Ideogram.GenerationRejectReason?) + + || typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed) || typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?) - || typeToConvert == typeof(global::Ideogram.GenerationRejectReason) + || typeToConvert == typeof(global::Ideogram.V2ImageReplaceBackgroundIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed) - || typeToConvert == typeof(global::Ideogram.GenerationRejectReason?) + || typeToConvert == typeof(global::Ideogram.V2ImageReplaceBackgroundIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed?) - || typeToConvert == typeof(global::Ideogram.AssetType) + || typeToConvert == typeof(global::Ideogram.ReplaceBackgroundQuality) - || typeToConvert == typeof(global::Ideogram.AssetType?); + || typeToConvert == typeof(global::Ideogram.ReplaceBackgroundQuality?); } public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) { + if (typeToConvert == typeof(global::Ideogram.GenerationRejectReason)) + { + return new global::Ideogram.JsonConverters.GenerationRejectReasonJsonConverter(); + } + + if (typeToConvert == typeof(global::Ideogram.GenerationRejectReason?)) + { + return new global::Ideogram.JsonConverters.GenerationRejectReasonNullableJsonConverter(); + } + if (typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed)) { return new global::Ideogram.JsonConverters.GenerationErrorResponseTaskCompletionSpeedJsonConverter(); @@ -129,24 +148,24 @@ public override bool CanConvert(global::System.Type typeToConvert) return new global::Ideogram.JsonConverters.GenerationErrorResponseTaskCompletionSpeedNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.GenerationRejectReason)) + if (typeToConvert == typeof(global::Ideogram.V2ImageReplaceBackgroundIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed)) { - return new global::Ideogram.JsonConverters.GenerationRejectReasonJsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageReplaceBackgroundIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.GenerationRejectReason?)) + if (typeToConvert == typeof(global::Ideogram.V2ImageReplaceBackgroundIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed?)) { - return new global::Ideogram.JsonConverters.GenerationRejectReasonNullableJsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageReplaceBackgroundIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeedNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.AssetType)) + if (typeToConvert == typeof(global::Ideogram.ReplaceBackgroundQuality)) { - return new global::Ideogram.JsonConverters.AssetTypeJsonConverter(); + return new global::Ideogram.JsonConverters.ReplaceBackgroundQualityJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.AssetType?)) + if (typeToConvert == typeof(global::Ideogram.ReplaceBackgroundQuality?)) { - return new global::Ideogram.JsonConverters.AssetTypeNullableJsonConverter(); + return new global::Ideogram.JsonConverters.ReplaceBackgroundQualityNullableJsonConverter(); } throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); } diff --git a/src/libs/Ideogram/Generated/Ideogram.ToolClient.RemoveBackground.g.cs b/src/libs/Ideogram/Generated/Ideogram.ToolClient.RemoveBackground.g.cs deleted file mode 100644 index f6cbab1a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ToolClient.RemoveBackground.g.cs +++ /dev/null @@ -1,860 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ToolClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_RemoveBackgroundSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_RemoveBackgroundSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_RemoveBackgroundSecurityRequirement0, - }; - partial void PrepareRemoveBackgroundArguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? dryRun, - global::Ideogram.RemoveBackgroundV2Request request); - partial void PrepareRemoveBackgroundRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? dryRun, - global::Ideogram.RemoveBackgroundV2Request request); - partial void ProcessRemoveBackgroundResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessRemoveBackgroundResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Remove background
- /// Remove the background from an image and return the foreground as a
- /// transparent PNG. Upload the source `image` using `multipart/form-data`.
- /// Returns the result directly by default; set `async` to get a
- /// `generation_id` and poll `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task RemoveBackgroundAsync( - - global::Ideogram.RemoveBackgroundV2Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await RemoveBackgroundAsResponseAsync( - - request: request, - dryRun: dryRun, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Remove background
- /// Remove the background from an image and return the foreground as a
- /// transparent PNG. Upload the source `image` using `multipart/form-data`.
- /// Returns the result directly by default; set `async` to get a
- /// `generation_id` and poll `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> RemoveBackgroundAsResponseAsync( - - global::Ideogram.RemoveBackgroundV2Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareRemoveBackgroundArguments( - httpClient: HttpClient, - dryRun: ref dryRun, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_RemoveBackgroundSecurityRequirements, - operationName: "RemoveBackgroundAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/image/remove-background/ideogram-1", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (request.Image != default) - { - - var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.ImageAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ImageAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"image_asset_identifier\""); - - } - if (request.TargetCollectionId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.TargetCollectionId ?? string.Empty), - name: "\"target_collection_id\""); - - } - if (request.Private != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"private\""); - - } - if (request.Async != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"async\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareRemoveBackgroundRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - dryRun: dryRun, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "RemoveBackground", - methodName: "RemoveBackgroundAsync", - pathTemplate: "\"/v2/image/remove-background/ideogram-1\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "RemoveBackground", - methodName: "RemoveBackgroundAsync", - pathTemplate: "\"/v2/image/remove-background/ideogram-1\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "RemoveBackground", - methodName: "RemoveBackgroundAsync", - pathTemplate: "\"/v2/image/remove-background/ideogram-1\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessRemoveBackgroundResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "RemoveBackground", - methodName: "RemoveBackgroundAsync", - pathTemplate: "\"/v2/image/remove-background/ideogram-1\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "RemoveBackground", - methodName: "RemoveBackgroundAsync", - pathTemplate: "\"/v2/image/remove-background/ideogram-1\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 500) - { - string? __content_500 = null; - global::System.Exception? __exception_500 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_500 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_500, - responseBody: __content_500, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessRemoveBackgroundResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.RemoveBackgroundV2Response.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.RemoveBackgroundV2Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Remove background
- /// Remove the background from an image and return the foreground as a
- /// transparent PNG. Upload the source `image` using `multipart/form-data`.
- /// Returns the result directly by default; set `async` to get a
- /// `generation_id` and poll `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// The source image. JPEG, PNG, or WebP, up to 25MB. Multipart requests only. - /// - /// - /// The source image. JPEG, PNG, or WebP, up to 25MB. Multipart requests only. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. Completed outputs are added to it automatically. - /// - /// - /// Whether to keep the result out of the public gallery. When omitted,
- /// defaults to your plan's setting, or public if your plan has none.
- /// Enterprise generations are always private. - /// - /// - /// When false (the default), wait for and return the foreground image. When true, return as soon as the request is accepted; poll `GET /v2/generations/{generation_id}` for the result.
- /// Default Value: false - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task RemoveBackgroundAsync( - bool? dryRun = default, - byte[]? image = default, - string? imagename = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - string? targetCollectionId = default, - bool? @private = default, - bool? async = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.RemoveBackgroundV2Request - { - Image = image, - Imagename = imagename, - ImageAssetIdentifier = imageAssetIdentifier, - TargetCollectionId = targetCollectionId, - Private = @private, - Async = async, - }; - - return await RemoveBackgroundAsync( - dryRun: dryRun, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ToolClient.ReplaceBackground.g.cs b/src/libs/Ideogram/Generated/Ideogram.ToolClient.ReplaceBackground.g.cs deleted file mode 100644 index 393775ee..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ToolClient.ReplaceBackground.g.cs +++ /dev/null @@ -1,895 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ToolClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_ReplaceBackgroundSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_ReplaceBackgroundSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_ReplaceBackgroundSecurityRequirement0, - }; - partial void PrepareReplaceBackgroundArguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? dryRun, - global::Ideogram.ReplaceBackgroundRequest request); - partial void PrepareReplaceBackgroundRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? dryRun, - global::Ideogram.ReplaceBackgroundRequest request); - partial void ProcessReplaceBackgroundResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessReplaceBackgroundResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Replace background with GPT Image 2
- /// Replace the background of an image from a text prompt while keeping the
- /// automatically detected foreground subject; no mask is needed. Upload
- /// the source `image` using `multipart/form-data`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task ReplaceBackgroundAsync( - - global::Ideogram.ReplaceBackgroundRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await ReplaceBackgroundAsResponseAsync( - - request: request, - dryRun: dryRun, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Replace background with GPT Image 2
- /// Replace the background of an image from a text prompt while keeping the
- /// automatically detected foreground subject; no mask is needed. Upload
- /// the source `image` using `multipart/form-data`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> ReplaceBackgroundAsResponseAsync( - - global::Ideogram.ReplaceBackgroundRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareReplaceBackgroundArguments( - httpClient: HttpClient, - dryRun: ref dryRun, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_ReplaceBackgroundSecurityRequirements, - operationName: "ReplaceBackgroundAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/image/replace-background/gpt-image-2", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (request.ImageAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ImageAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"image_asset_identifier\""); - - } - if (request.Image != default) - { - - var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - } - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - if (request.Quality != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Quality).HasValue ? (request.Quality).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"quality\""); - - } - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.Private != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"private\""); - - } - if (request.WebhookUrl != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), - name: "\"webhook_url\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareReplaceBackgroundRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - dryRun: dryRun, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "ReplaceBackground", - methodName: "ReplaceBackgroundAsync", - pathTemplate: "\"/v2/image/replace-background/gpt-image-2\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "ReplaceBackground", - methodName: "ReplaceBackgroundAsync", - pathTemplate: "\"/v2/image/replace-background/gpt-image-2\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "ReplaceBackground", - methodName: "ReplaceBackgroundAsync", - pathTemplate: "\"/v2/image/replace-background/gpt-image-2\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessReplaceBackgroundResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "ReplaceBackground", - methodName: "ReplaceBackgroundAsync", - pathTemplate: "\"/v2/image/replace-background/gpt-image-2\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "ReplaceBackground", - methodName: "ReplaceBackgroundAsync", - pathTemplate: "\"/v2/image/replace-background/gpt-image-2\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessReplaceBackgroundResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.ReplaceBackgroundResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.ReplaceBackgroundResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Replace background with GPT Image 2
- /// Replace the background of an image from a text prompt while keeping the
- /// automatically detected foreground subject; no mask is needed. Upload
- /// the source `image` using `multipart/form-data`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
- /// MPO are supported, up to 50 MB. Multipart requests only. - /// - /// - /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
- /// MPO are supported, up to 50 MB. Multipart requests only. - /// - /// - /// Plain-language description of the desired new background. - /// - /// - /// The generation quality level. Defaults to `high`.
- /// Default Value: high - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Whether to keep the result private. When omitted, defaults to your
- /// plan's setting. Enterprise generations are always private. - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task ReplaceBackgroundAsync( - string prompt, - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - global::Ideogram.ReplaceBackgroundQuality? quality = default, - int? numImages = default, - bool? @private = default, - string? webhookUrl = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.ReplaceBackgroundRequest - { - ImageAssetIdentifier = imageAssetIdentifier, - Image = image, - Imagename = imagename, - Prompt = prompt, - Quality = quality, - NumImages = numImages, - Private = @private, - WebhookUrl = webhookUrl, - }; - - return await ReplaceBackgroundAsync( - dryRun: dryRun, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ToolClient.ReplaceBackgroundIdeogram45.g.cs b/src/libs/Ideogram/Generated/Ideogram.ToolClient.ReplaceBackgroundIdeogram45.g.cs deleted file mode 100644 index 2ab6c40a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ToolClient.ReplaceBackgroundIdeogram45.g.cs +++ /dev/null @@ -1,919 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ToolClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_ReplaceBackgroundIdeogram45SecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_ReplaceBackgroundIdeogram45SecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_ReplaceBackgroundIdeogram45SecurityRequirement0, - }; - partial void PrepareReplaceBackgroundIdeogram45Arguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? dryRun, - global::Ideogram.ReplaceBackgroundIdeogram45Request request); - partial void PrepareReplaceBackgroundIdeogram45Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? dryRun, - global::Ideogram.ReplaceBackgroundIdeogram45Request request); - partial void ProcessReplaceBackgroundIdeogram45Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessReplaceBackgroundIdeogram45ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Replace background with Ideogram 4.5
- /// Rebuild the background of an image as the setting shown in a
- /// `background_reference` image, with Ideogram 4.5 at its highest
- /// quality. The people in the source image are kept, people in the
- /// reference are left out, and results keep the source image's aspect
- /// ratio. Returns a `generation_id`; poll
- /// `GET /v2/generations/{generation_id}` or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task ReplaceBackgroundIdeogram45Async( - - global::Ideogram.ReplaceBackgroundIdeogram45Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await ReplaceBackgroundIdeogram45AsResponseAsync( - - request: request, - dryRun: dryRun, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Replace background with Ideogram 4.5
- /// Rebuild the background of an image as the setting shown in a
- /// `background_reference` image, with Ideogram 4.5 at its highest
- /// quality. The people in the source image are kept, people in the
- /// reference are left out, and results keep the source image's aspect
- /// ratio. Returns a `generation_id`; poll
- /// `GET /v2/generations/{generation_id}` or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> ReplaceBackgroundIdeogram45AsResponseAsync( - - global::Ideogram.ReplaceBackgroundIdeogram45Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareReplaceBackgroundIdeogram45Arguments( - httpClient: HttpClient, - dryRun: ref dryRun, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_ReplaceBackgroundIdeogram45SecurityRequirements, - operationName: "ReplaceBackgroundIdeogram45Async"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/image/replace-background/ideogram-4-5", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (request.ImageAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ImageAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"image_asset_identifier\""); - - } - if (request.Image != default) - { - - var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.BackgroundReferenceAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.BackgroundReferenceAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"background_reference_asset_identifier\""); - - } - if (request.BackgroundReference != default) - { - - var __contentBackgroundReference = new global::System.Net.Http.ByteArrayContent(request.BackgroundReference ?? global::System.Array.Empty()); - __contentBackgroundReference.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.BackgroundReferencename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.BackgroundReferencename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentBackgroundReference, - name: "\"background_reference\"", - fileName: request.BackgroundReferencename != null ? $"\"{request.BackgroundReferencename}\"" : string.Empty); - if (__contentBackgroundReference.Headers.ContentDisposition != null) - { - __contentBackgroundReference.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.Private != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"private\""); - - } - if (request.WebhookUrl != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), - name: "\"webhook_url\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareReplaceBackgroundIdeogram45Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - dryRun: dryRun, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "ReplaceBackgroundIdeogram45", - methodName: "ReplaceBackgroundIdeogram45Async", - pathTemplate: "\"/v2/image/replace-background/ideogram-4-5\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "ReplaceBackgroundIdeogram45", - methodName: "ReplaceBackgroundIdeogram45Async", - pathTemplate: "\"/v2/image/replace-background/ideogram-4-5\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "ReplaceBackgroundIdeogram45", - methodName: "ReplaceBackgroundIdeogram45Async", - pathTemplate: "\"/v2/image/replace-background/ideogram-4-5\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessReplaceBackgroundIdeogram45Response( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "ReplaceBackgroundIdeogram45", - methodName: "ReplaceBackgroundIdeogram45Async", - pathTemplate: "\"/v2/image/replace-background/ideogram-4-5\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "ReplaceBackgroundIdeogram45", - methodName: "ReplaceBackgroundIdeogram45Async", - pathTemplate: "\"/v2/image/replace-background/ideogram-4-5\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessReplaceBackgroundIdeogram45ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.ReplaceBackgroundResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.ReplaceBackgroundResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Replace background with Ideogram 4.5
- /// Rebuild the background of an image as the setting shown in a
- /// `background_reference` image, with Ideogram 4.5 at its highest
- /// quality. The people in the source image are kept, people in the
- /// reference are left out, and results keep the source image's aspect
- /// ratio. Returns a `generation_id`; poll
- /// `GET /v2/generations/{generation_id}` or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
- /// MPO are supported, up to 50 MB. Its longer side may be at most the
- /// model's maximum aspect ratio times its shorter side; a more extreme
- /// proportion is rejected with a 400 that states the allowed range.
- /// Multipart requests only. - /// - /// - /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
- /// MPO are supported, up to 50 MB. Its longer side may be at most the
- /// model's maximum aspect ratio times its shorter side; a more extreme
- /// proportion is rejected with a 400 that states the allowed range.
- /// Multipart requests only. - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// A photo of the setting the new background should match. Its people
- /// are not copied. It is held to the same aspect-ratio limit as
- /// `image`. Multipart requests only. - /// - /// - /// A photo of the setting the new background should match. Its people
- /// are not copied. It is held to the same aspect-ratio limit as
- /// `image`. Multipart requests only. - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Whether to keep the result private. When omitted, the result is
- /// private. Enterprise generations are always private. - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task ReplaceBackgroundIdeogram45Async( - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - global::Ideogram.AssetIdentifier? backgroundReferenceAssetIdentifier = default, - byte[]? backgroundReference = default, - string? backgroundReferencename = default, - int? numImages = default, - bool? @private = default, - string? webhookUrl = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.ReplaceBackgroundIdeogram45Request - { - ImageAssetIdentifier = imageAssetIdentifier, - Image = image, - Imagename = imagename, - BackgroundReferenceAssetIdentifier = backgroundReferenceAssetIdentifier, - BackgroundReference = backgroundReference, - BackgroundReferencename = backgroundReferencename, - NumImages = numImages, - Private = @private, - WebhookUrl = webhookUrl, - }; - - return await ReplaceBackgroundIdeogram45Async( - dryRun: dryRun, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ToolClient.ReplaceBackgroundIdeogramV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.ToolClient.ReplaceBackgroundIdeogramV3.g.cs deleted file mode 100644 index 5c7d74cc..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ToolClient.ReplaceBackgroundIdeogramV3.g.cs +++ /dev/null @@ -1,899 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ToolClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_ReplaceBackgroundIdeogramV3SecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_ReplaceBackgroundIdeogramV3SecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_ReplaceBackgroundIdeogramV3SecurityRequirement0, - }; - partial void PrepareReplaceBackgroundIdeogramV3Arguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? dryRun, - global::Ideogram.ReplaceBackgroundIdeogramV3Request request); - partial void PrepareReplaceBackgroundIdeogramV3Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? dryRun, - global::Ideogram.ReplaceBackgroundIdeogramV3Request request); - partial void ProcessReplaceBackgroundIdeogramV3Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessReplaceBackgroundIdeogramV3ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Replace background with Ideogram 3.0
- /// Replace the background of an image from a text prompt with Ideogram 3.0,
- /// keeping the automatically detected foreground subject; no mask is
- /// needed. Upload the source `image` using `multipart/form-data`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task ReplaceBackgroundIdeogramV3Async( - - global::Ideogram.ReplaceBackgroundIdeogramV3Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await ReplaceBackgroundIdeogramV3AsResponseAsync( - - request: request, - dryRun: dryRun, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Replace background with Ideogram 3.0
- /// Replace the background of an image from a text prompt with Ideogram 3.0,
- /// keeping the automatically detected foreground subject; no mask is
- /// needed. Upload the source `image` using `multipart/form-data`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> ReplaceBackgroundIdeogramV3AsResponseAsync( - - global::Ideogram.ReplaceBackgroundIdeogramV3Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareReplaceBackgroundIdeogramV3Arguments( - httpClient: HttpClient, - dryRun: ref dryRun, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_ReplaceBackgroundIdeogramV3SecurityRequirements, - operationName: "ReplaceBackgroundIdeogramV3Async"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/image/replace-background/ideogram-3", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (request.ImageAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ImageAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"image_asset_identifier\""); - - } - if (request.Image != default) - { - - var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - } - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - if (request.RenderingSpeed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"rendering_speed\""); - - } - if (request.NumImages != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"num_images\""); - - } - if (request.Private != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"private\""); - - } - if (request.WebhookUrl != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), - name: "\"webhook_url\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareReplaceBackgroundIdeogramV3Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - dryRun: dryRun, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "ReplaceBackgroundIdeogramV3", - methodName: "ReplaceBackgroundIdeogramV3Async", - pathTemplate: "\"/v2/image/replace-background/ideogram-3\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "ReplaceBackgroundIdeogramV3", - methodName: "ReplaceBackgroundIdeogramV3Async", - pathTemplate: "\"/v2/image/replace-background/ideogram-3\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "ReplaceBackgroundIdeogramV3", - methodName: "ReplaceBackgroundIdeogramV3Async", - pathTemplate: "\"/v2/image/replace-background/ideogram-3\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessReplaceBackgroundIdeogramV3Response( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "ReplaceBackgroundIdeogramV3", - methodName: "ReplaceBackgroundIdeogramV3Async", - pathTemplate: "\"/v2/image/replace-background/ideogram-3\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "ReplaceBackgroundIdeogramV3", - methodName: "ReplaceBackgroundIdeogramV3Async", - pathTemplate: "\"/v2/image/replace-background/ideogram-3\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessReplaceBackgroundIdeogramV3ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.ReplaceBackgroundResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.ReplaceBackgroundResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Replace background with Ideogram 3.0
- /// Replace the background of an image from a text prompt with Ideogram 3.0,
- /// keeping the automatically detected foreground subject; no mask is
- /// needed. Upload the source `image` using `multipart/form-data`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
- /// MPO are supported, up to 50 MB. Multipart requests only.
- /// The longer side must be at most 3 times the shorter side; wider
- /// aspect ratios are rejected with a 400. - /// - /// - /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
- /// MPO are supported, up to 50 MB. Multipart requests only.
- /// The longer side must be at most 3 times the shorter side; wider
- /// aspect ratios are rejected with a 400. - /// - /// - /// Plain-language description of the desired new background. - /// - /// - /// The rendering speed to use.
- /// Default Value: default - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// Whether to keep the result private. When omitted, defaults to your
- /// plan's setting. Enterprise generations are always private. - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task ReplaceBackgroundIdeogramV3Async( - string prompt, - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - global::Ideogram.ReplaceBackgroundIdeogramV3RequestRenderingSpeed? renderingSpeed = default, - int? numImages = default, - bool? @private = default, - string? webhookUrl = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.ReplaceBackgroundIdeogramV3Request - { - ImageAssetIdentifier = imageAssetIdentifier, - Image = image, - Imagename = imagename, - Prompt = prompt, - RenderingSpeed = renderingSpeed, - NumImages = numImages, - Private = @private, - WebhookUrl = webhookUrl, - }; - - return await ReplaceBackgroundIdeogramV3Async( - dryRun: dryRun, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ToolClient.ToolRemoveBackground.g.cs b/src/libs/Ideogram/Generated/Ideogram.ToolClient.ToolRemoveBackground.g.cs new file mode 100644 index 00000000..d4832c48 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.ToolClient.ToolRemoveBackground.g.cs @@ -0,0 +1,2358 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class ToolClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_ToolRemoveBackgroundSecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_ToolRemoveBackgroundSecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_ToolRemoveBackgroundSecurityRequirement0, + }; + partial void PrepareToolRemoveBackgroundArguments( + global::System.Net.Http.HttpClient httpClient, + ref bool? dryRun, + global::Ideogram.ToolRemoveBackgroundRequest request); + partial void PrepareToolRemoveBackgroundRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + bool? dryRun, + global::Ideogram.ToolRemoveBackgroundRequest request); + partial void ProcessToolRemoveBackgroundResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessToolRemoveBackgroundResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Remove background
+ /// Remove the background from an image and return the foreground as a
+ /// transparent PNG. Upload the source `image` using `multipart/form-data`.
+ /// Returns the result directly by default; set `async` to get a
+ /// `generation_id` and poll `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ToolRemoveBackgroundAsync( + + global::Ideogram.ToolRemoveBackgroundRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ToolRemoveBackgroundAsResponseAsync( + + request: request, + dryRun: dryRun, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Remove background
+ /// Remove the background from an image and return the foreground as a
+ /// transparent PNG. Upload the source `image` using `multipart/form-data`.
+ /// Returns the result directly by default; set `async` to get a
+ /// `generation_id` and poll `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ToolRemoveBackgroundAsResponseAsync( + + global::Ideogram.ToolRemoveBackgroundRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareToolRemoveBackgroundArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ToolRemoveBackgroundSecurityRequirements, + operationName: "ToolRemoveBackgroundAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/remove-background/ideogram-1", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.Private != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"private\""); + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareToolRemoveBackgroundRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolRemoveBackground", + methodName: "ToolRemoveBackgroundAsync", + pathTemplate: "\"/v2/image/remove-background/ideogram-1\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolRemoveBackground", + methodName: "ToolRemoveBackgroundAsync", + pathTemplate: "\"/v2/image/remove-background/ideogram-1\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolRemoveBackground", + methodName: "ToolRemoveBackgroundAsync", + pathTemplate: "\"/v2/image/remove-background/ideogram-1\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessToolRemoveBackgroundResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolRemoveBackground", + methodName: "ToolRemoveBackgroundAsync", + pathTemplate: "\"/v2/image/remove-background/ideogram-1\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolRemoveBackground", + methodName: "ToolRemoveBackgroundAsync", + pathTemplate: "\"/v2/image/remove-background/ideogram-1\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not authorized to remove backgrounds. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The source image was not found or is not readable. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The background-removal request failed. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Background removal is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessToolRemoveBackgroundResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.RemoveBackgroundV2Response.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.RemoveBackgroundV2Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Remove background
+ /// Remove the background from an image and return the foreground as a
+ /// transparent PNG. Upload the source `image` using `multipart/form-data`.
+ /// Returns the result directly by default; set `async` to get a
+ /// `generation_id` and poll `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image. JPEG, PNG, or WebP, up to 25MB. Multipart requests only. + /// + /// + /// The source image. JPEG, PNG, or WebP, up to 25MB. Multipart requests only. + /// + /// + /// Whether to keep the result out of the public gallery. When omitted,
+ /// defaults to your plan's setting, or public if your plan has none.
+ /// Enterprise generations are always private. + /// + /// + /// When false (the default), wait for and return the foreground image. When true, return as soon as the request is accepted; poll `GET /v2/generations/{generation_id}` for the result.
+ /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ToolRemoveBackgroundAsync( + byte[] image, + string imagename, + bool? dryRun = default, + bool? @private = default, + bool? async = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Ideogram.ToolRemoveBackgroundRequest + { + Image = image, + Imagename = imagename, + Private = @private, + Async = async, + }; + + return await ToolRemoveBackgroundAsync( + dryRun: dryRun, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// Remove background
+ /// Remove the background from an image and return the foreground as a
+ /// transparent PNG. Upload the source `image` using `multipart/form-data`.
+ /// Returns the result directly by default; set `async` to get a
+ /// `generation_id` and poll `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image. JPEG, PNG, or WebP, up to 25MB. Multipart requests only. + /// + /// + /// The source image. JPEG, PNG, or WebP, up to 25MB. Multipart requests only. + /// + /// + /// Whether to keep the result out of the public gallery. When omitted,
+ /// defaults to your plan's setting, or public if your plan has none.
+ /// Enterprise generations are always private. + /// + /// + /// When false (the default), wait for and return the foreground image. When true, return as soon as the request is accepted; poll `GET /v2/generations/{generation_id}` for the result.
+ /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ToolRemoveBackgroundAsync( + global::System.IO.Stream image, + string imagename, + bool? dryRun = default, + bool? @private = default, + bool? async = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + var request = new global::Ideogram.ToolRemoveBackgroundRequest + { + Image = global::System.Array.Empty(), + Imagename = imagename, + Private = @private, + Async = async, + }; + PrepareArguments( + client: HttpClient); + PrepareToolRemoveBackgroundArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ToolRemoveBackgroundSecurityRequirements, + operationName: "ToolRemoveBackgroundAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/remove-background/ideogram-1", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.Private != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"private\""); + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareToolRemoveBackgroundRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolRemoveBackground", + methodName: "ToolRemoveBackgroundAsync", + pathTemplate: "\"/v2/image/remove-background/ideogram-1\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolRemoveBackground", + methodName: "ToolRemoveBackgroundAsync", + pathTemplate: "\"/v2/image/remove-background/ideogram-1\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolRemoveBackground", + methodName: "ToolRemoveBackgroundAsync", + pathTemplate: "\"/v2/image/remove-background/ideogram-1\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessToolRemoveBackgroundResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolRemoveBackground", + methodName: "ToolRemoveBackgroundAsync", + pathTemplate: "\"/v2/image/remove-background/ideogram-1\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolRemoveBackground", + methodName: "ToolRemoveBackgroundAsync", + pathTemplate: "\"/v2/image/remove-background/ideogram-1\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not authorized to remove backgrounds. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The source image was not found or is not readable. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The background-removal request failed. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Background removal is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessToolRemoveBackgroundResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::Ideogram.RemoveBackgroundV2Response.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::Ideogram.RemoveBackgroundV2Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Remove background
+ /// Remove the background from an image and return the foreground as a
+ /// transparent PNG. Upload the source `image` using `multipart/form-data`.
+ /// Returns the result directly by default; set `async` to get a
+ /// `generation_id` and poll `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image. JPEG, PNG, or WebP, up to 25MB. Multipart requests only. + /// + /// + /// The source image. JPEG, PNG, or WebP, up to 25MB. Multipart requests only. + /// + /// + /// Whether to keep the result out of the public gallery. When omitted,
+ /// defaults to your plan's setting, or public if your plan has none.
+ /// Enterprise generations are always private. + /// + /// + /// When false (the default), wait for and return the foreground image. When true, return as soon as the request is accepted; poll `GET /v2/generations/{generation_id}` for the result.
+ /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ToolRemoveBackgroundAsResponseAsync( + global::System.IO.Stream image, + string imagename, + bool? dryRun = default, + bool? @private = default, + bool? async = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + var request = new global::Ideogram.ToolRemoveBackgroundRequest + { + Image = global::System.Array.Empty(), + Imagename = imagename, + Private = @private, + Async = async, + }; + PrepareArguments( + client: HttpClient); + PrepareToolRemoveBackgroundArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ToolRemoveBackgroundSecurityRequirements, + operationName: "ToolRemoveBackgroundAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/remove-background/ideogram-1", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.Private != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"private\""); + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareToolRemoveBackgroundRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolRemoveBackground", + methodName: "ToolRemoveBackgroundAsync", + pathTemplate: "\"/v2/image/remove-background/ideogram-1\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolRemoveBackground", + methodName: "ToolRemoveBackgroundAsync", + pathTemplate: "\"/v2/image/remove-background/ideogram-1\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolRemoveBackground", + methodName: "ToolRemoveBackgroundAsync", + pathTemplate: "\"/v2/image/remove-background/ideogram-1\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessToolRemoveBackgroundResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolRemoveBackground", + methodName: "ToolRemoveBackgroundAsync", + pathTemplate: "\"/v2/image/remove-background/ideogram-1\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolRemoveBackground", + methodName: "ToolRemoveBackgroundAsync", + pathTemplate: "\"/v2/image/remove-background/ideogram-1\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not authorized to remove backgrounds. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The source image was not found or is not readable. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The background-removal request failed. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Background removal is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessToolRemoveBackgroundResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.RemoveBackgroundV2Response.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.RemoveBackgroundV2Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ToolClient.ToolReplaceBackground.g.cs b/src/libs/Ideogram/Generated/Ideogram.ToolClient.ToolReplaceBackground.g.cs new file mode 100644 index 00000000..ffd39c2d --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.ToolClient.ToolReplaceBackground.g.cs @@ -0,0 +1,2495 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class ToolClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_ToolReplaceBackgroundSecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_ToolReplaceBackgroundSecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_ToolReplaceBackgroundSecurityRequirement0, + }; + partial void PrepareToolReplaceBackgroundArguments( + global::System.Net.Http.HttpClient httpClient, + ref bool? dryRun, + global::Ideogram.ToolReplaceBackgroundRequest request); + partial void PrepareToolReplaceBackgroundRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + bool? dryRun, + global::Ideogram.ToolReplaceBackgroundRequest request); + partial void ProcessToolReplaceBackgroundResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessToolReplaceBackgroundResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Replace background with GPT Image 2
+ /// Replace the background of an image from a text prompt while keeping the
+ /// automatically detected foreground subject; no mask is needed. Upload
+ /// the source `image` using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ToolReplaceBackgroundAsync( + + global::Ideogram.ToolReplaceBackgroundRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ToolReplaceBackgroundAsResponseAsync( + + request: request, + dryRun: dryRun, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Replace background with GPT Image 2
+ /// Replace the background of an image from a text prompt while keeping the
+ /// automatically detected foreground subject; no mask is needed. Upload
+ /// the source `image` using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ToolReplaceBackgroundAsResponseAsync( + + global::Ideogram.ToolReplaceBackgroundRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareToolReplaceBackgroundArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ToolReplaceBackgroundSecurityRequirements, + operationName: "ToolReplaceBackgroundAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/replace-background/gpt-image-2", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + if (request.Quality != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Quality).HasValue ? (request.Quality).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"quality\""); + + } + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.Private != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"private\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareToolReplaceBackgroundRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolReplaceBackground", + methodName: "ToolReplaceBackgroundAsync", + pathTemplate: "\"/v2/image/replace-background/gpt-image-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolReplaceBackground", + methodName: "ToolReplaceBackgroundAsync", + pathTemplate: "\"/v2/image/replace-background/gpt-image-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolReplaceBackground", + methodName: "ToolReplaceBackgroundAsync", + pathTemplate: "\"/v2/image/replace-background/gpt-image-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessToolReplaceBackgroundResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolReplaceBackground", + methodName: "ToolReplaceBackgroundAsync", + pathTemplate: "\"/v2/image/replace-background/gpt-image-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolReplaceBackground", + methodName: "ToolReplaceBackgroundAsync", + pathTemplate: "\"/v2/image/replace-background/gpt-image-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not authorized to replace backgrounds. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The source image was not found or is not readable. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Background replacement is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessToolReplaceBackgroundResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.ReplaceBackgroundResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.ReplaceBackgroundResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Replace background with GPT Image 2
+ /// Replace the background of an image from a text prompt while keeping the
+ /// automatically detected foreground subject; no mask is needed. Upload
+ /// the source `image` using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
+ /// MPO are supported, up to 50 MB. Multipart requests only. + /// + /// + /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
+ /// MPO are supported, up to 50 MB. Multipart requests only. + /// + /// + /// Plain-language description of the desired new background. + /// + /// + /// The generation quality level. Defaults to `high`.
+ /// Default Value: high + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Whether to keep the result private. When omitted, defaults to your
+ /// plan's setting. Enterprise generations are always private. + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ToolReplaceBackgroundAsync( + byte[] image, + string imagename, + string prompt, + bool? dryRun = default, + global::Ideogram.ReplaceBackgroundQuality? quality = default, + int? numImages = default, + bool? @private = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Ideogram.ToolReplaceBackgroundRequest + { + Image = image, + Imagename = imagename, + Prompt = prompt, + Quality = quality, + NumImages = numImages, + Private = @private, + WebhookUrl = webhookUrl, + }; + + return await ToolReplaceBackgroundAsync( + dryRun: dryRun, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// Replace background with GPT Image 2
+ /// Replace the background of an image from a text prompt while keeping the
+ /// automatically detected foreground subject; no mask is needed. Upload
+ /// the source `image` using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
+ /// MPO are supported, up to 50 MB. Multipart requests only. + /// + /// + /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
+ /// MPO are supported, up to 50 MB. Multipart requests only. + /// + /// + /// Plain-language description of the desired new background. + /// + /// + /// The generation quality level. Defaults to `high`.
+ /// Default Value: high + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Whether to keep the result private. When omitted, defaults to your
+ /// plan's setting. Enterprise generations are always private. + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ToolReplaceBackgroundAsync( + global::System.IO.Stream image, + string imagename, + string prompt, + bool? dryRun = default, + global::Ideogram.ReplaceBackgroundQuality? quality = default, + int? numImages = default, + bool? @private = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + var request = new global::Ideogram.ToolReplaceBackgroundRequest + { + Image = global::System.Array.Empty(), + Imagename = imagename, + Prompt = prompt, + Quality = quality, + NumImages = numImages, + Private = @private, + WebhookUrl = webhookUrl, + }; + PrepareArguments( + client: HttpClient); + PrepareToolReplaceBackgroundArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ToolReplaceBackgroundSecurityRequirements, + operationName: "ToolReplaceBackgroundAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/replace-background/gpt-image-2", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + if (request.Quality != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Quality).HasValue ? (request.Quality).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"quality\""); + + } + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.Private != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"private\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareToolReplaceBackgroundRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolReplaceBackground", + methodName: "ToolReplaceBackgroundAsync", + pathTemplate: "\"/v2/image/replace-background/gpt-image-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolReplaceBackground", + methodName: "ToolReplaceBackgroundAsync", + pathTemplate: "\"/v2/image/replace-background/gpt-image-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolReplaceBackground", + methodName: "ToolReplaceBackgroundAsync", + pathTemplate: "\"/v2/image/replace-background/gpt-image-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessToolReplaceBackgroundResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolReplaceBackground", + methodName: "ToolReplaceBackgroundAsync", + pathTemplate: "\"/v2/image/replace-background/gpt-image-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolReplaceBackground", + methodName: "ToolReplaceBackgroundAsync", + pathTemplate: "\"/v2/image/replace-background/gpt-image-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not authorized to replace backgrounds. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The source image was not found or is not readable. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Background replacement is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessToolReplaceBackgroundResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::Ideogram.ReplaceBackgroundResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::Ideogram.ReplaceBackgroundResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Replace background with GPT Image 2
+ /// Replace the background of an image from a text prompt while keeping the
+ /// automatically detected foreground subject; no mask is needed. Upload
+ /// the source `image` using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
+ /// MPO are supported, up to 50 MB. Multipart requests only. + /// + /// + /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
+ /// MPO are supported, up to 50 MB. Multipart requests only. + /// + /// + /// Plain-language description of the desired new background. + /// + /// + /// The generation quality level. Defaults to `high`.
+ /// Default Value: high + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Whether to keep the result private. When omitted, defaults to your
+ /// plan's setting. Enterprise generations are always private. + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ToolReplaceBackgroundAsResponseAsync( + global::System.IO.Stream image, + string imagename, + string prompt, + bool? dryRun = default, + global::Ideogram.ReplaceBackgroundQuality? quality = default, + int? numImages = default, + bool? @private = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + var request = new global::Ideogram.ToolReplaceBackgroundRequest + { + Image = global::System.Array.Empty(), + Imagename = imagename, + Prompt = prompt, + Quality = quality, + NumImages = numImages, + Private = @private, + WebhookUrl = webhookUrl, + }; + PrepareArguments( + client: HttpClient); + PrepareToolReplaceBackgroundArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ToolReplaceBackgroundSecurityRequirements, + operationName: "ToolReplaceBackgroundAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/replace-background/gpt-image-2", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + if (request.Quality != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Quality).HasValue ? (request.Quality).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"quality\""); + + } + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.Private != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"private\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareToolReplaceBackgroundRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolReplaceBackground", + methodName: "ToolReplaceBackgroundAsync", + pathTemplate: "\"/v2/image/replace-background/gpt-image-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolReplaceBackground", + methodName: "ToolReplaceBackgroundAsync", + pathTemplate: "\"/v2/image/replace-background/gpt-image-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolReplaceBackground", + methodName: "ToolReplaceBackgroundAsync", + pathTemplate: "\"/v2/image/replace-background/gpt-image-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessToolReplaceBackgroundResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolReplaceBackground", + methodName: "ToolReplaceBackgroundAsync", + pathTemplate: "\"/v2/image/replace-background/gpt-image-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolReplaceBackground", + methodName: "ToolReplaceBackgroundAsync", + pathTemplate: "\"/v2/image/replace-background/gpt-image-2\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not authorized to replace backgrounds. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The source image was not found or is not readable. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Background replacement is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessToolReplaceBackgroundResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.ReplaceBackgroundResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.ReplaceBackgroundResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ToolClient.ToolReplaceBackgroundIdeogram45.g.cs b/src/libs/Ideogram/Generated/Ideogram.ToolClient.ToolReplaceBackgroundIdeogram45.g.cs new file mode 100644 index 00000000..bfc7cbaf --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.ToolClient.ToolReplaceBackgroundIdeogram45.g.cs @@ -0,0 +1,2496 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class ToolClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_ToolReplaceBackgroundIdeogram45SecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_ToolReplaceBackgroundIdeogram45SecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_ToolReplaceBackgroundIdeogram45SecurityRequirement0, + }; + partial void PrepareToolReplaceBackgroundIdeogram45Arguments( + global::System.Net.Http.HttpClient httpClient, + ref bool? dryRun, + global::Ideogram.ToolReplaceBackgroundIdeogram45Request request); + partial void PrepareToolReplaceBackgroundIdeogram45Request( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + bool? dryRun, + global::Ideogram.ToolReplaceBackgroundIdeogram45Request request); + partial void ProcessToolReplaceBackgroundIdeogram45Response( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessToolReplaceBackgroundIdeogram45ResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Replace background with Ideogram 4.5
+ /// Rebuild the background of an image as the setting shown in a
+ /// `background_reference` image, with Ideogram 4.5 at its highest
+ /// quality. The people in the source image are kept, people in the
+ /// reference are left out, and results keep the source image's aspect
+ /// ratio. Returns a `generation_id`; poll
+ /// `GET /v2/generations/{generation_id}` or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ToolReplaceBackgroundIdeogram45Async( + + global::Ideogram.ToolReplaceBackgroundIdeogram45Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ToolReplaceBackgroundIdeogram45AsResponseAsync( + + request: request, + dryRun: dryRun, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Replace background with Ideogram 4.5
+ /// Rebuild the background of an image as the setting shown in a
+ /// `background_reference` image, with Ideogram 4.5 at its highest
+ /// quality. The people in the source image are kept, people in the
+ /// reference are left out, and results keep the source image's aspect
+ /// ratio. Returns a `generation_id`; poll
+ /// `GET /v2/generations/{generation_id}` or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ToolReplaceBackgroundIdeogram45AsResponseAsync( + + global::Ideogram.ToolReplaceBackgroundIdeogram45Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareToolReplaceBackgroundIdeogram45Arguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ToolReplaceBackgroundIdeogram45SecurityRequirements, + operationName: "ToolReplaceBackgroundIdeogram45Async"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/replace-background/ideogram-4-5", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + var __contentBackgroundReference = new global::System.Net.Http.ByteArrayContent(request.BackgroundReference ?? global::System.Array.Empty()); + __contentBackgroundReference.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.BackgroundReferencename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.BackgroundReferencename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentBackgroundReference, + name: "\"background_reference\"", + fileName: request.BackgroundReferencename != null ? $"\"{request.BackgroundReferencename}\"" : string.Empty); + if (__contentBackgroundReference.Headers.ContentDisposition != null) + { + __contentBackgroundReference.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.Private != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"private\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareToolReplaceBackgroundIdeogram45Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolReplaceBackgroundIdeogram45", + methodName: "ToolReplaceBackgroundIdeogram45Async", + pathTemplate: "\"/v2/image/replace-background/ideogram-4-5\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolReplaceBackgroundIdeogram45", + methodName: "ToolReplaceBackgroundIdeogram45Async", + pathTemplate: "\"/v2/image/replace-background/ideogram-4-5\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolReplaceBackgroundIdeogram45", + methodName: "ToolReplaceBackgroundIdeogram45Async", + pathTemplate: "\"/v2/image/replace-background/ideogram-4-5\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessToolReplaceBackgroundIdeogram45Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolReplaceBackgroundIdeogram45", + methodName: "ToolReplaceBackgroundIdeogram45Async", + pathTemplate: "\"/v2/image/replace-background/ideogram-4-5\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolReplaceBackgroundIdeogram45", + methodName: "ToolReplaceBackgroundIdeogram45Async", + pathTemplate: "\"/v2/image/replace-background/ideogram-4-5\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not authorized to replace backgrounds. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // An image was not found or is not readable. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Background replacement is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessToolReplaceBackgroundIdeogram45ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.ReplaceBackgroundResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.ReplaceBackgroundResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Replace background with Ideogram 4.5
+ /// Rebuild the background of an image as the setting shown in a
+ /// `background_reference` image, with Ideogram 4.5 at its highest
+ /// quality. The people in the source image are kept, people in the
+ /// reference are left out, and results keep the source image's aspect
+ /// ratio. Returns a `generation_id`; poll
+ /// `GET /v2/generations/{generation_id}` or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
+ /// MPO are supported, up to 50 MB. Its longer side may be at most the
+ /// model's maximum aspect ratio times its shorter side; a more extreme
+ /// proportion is rejected with a 400 that states the allowed range.
+ /// Multipart requests only. + /// + /// + /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
+ /// MPO are supported, up to 50 MB. Its longer side may be at most the
+ /// model's maximum aspect ratio times its shorter side; a more extreme
+ /// proportion is rejected with a 400 that states the allowed range.
+ /// Multipart requests only. + /// + /// + /// A photo of the setting the new background should match. Its people
+ /// are not copied. It is held to the same aspect-ratio limit as
+ /// `image`. Multipart requests only. + /// + /// + /// A photo of the setting the new background should match. Its people
+ /// are not copied. It is held to the same aspect-ratio limit as
+ /// `image`. Multipart requests only. + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Whether to keep the result private. When omitted, the result is
+ /// private. Enterprise generations are always private. + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ToolReplaceBackgroundIdeogram45Async( + byte[] image, + string imagename, + byte[] backgroundReference, + string backgroundReferencename, + bool? dryRun = default, + int? numImages = default, + bool? @private = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Ideogram.ToolReplaceBackgroundIdeogram45Request + { + Image = image, + Imagename = imagename, + BackgroundReference = backgroundReference, + BackgroundReferencename = backgroundReferencename, + NumImages = numImages, + Private = @private, + WebhookUrl = webhookUrl, + }; + + return await ToolReplaceBackgroundIdeogram45Async( + dryRun: dryRun, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// Replace background with Ideogram 4.5
+ /// Rebuild the background of an image as the setting shown in a
+ /// `background_reference` image, with Ideogram 4.5 at its highest
+ /// quality. The people in the source image are kept, people in the
+ /// reference are left out, and results keep the source image's aspect
+ /// ratio. Returns a `generation_id`; poll
+ /// `GET /v2/generations/{generation_id}` or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
+ /// MPO are supported, up to 50 MB. Its longer side may be at most the
+ /// model's maximum aspect ratio times its shorter side; a more extreme
+ /// proportion is rejected with a 400 that states the allowed range.
+ /// Multipart requests only. + /// + /// + /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
+ /// MPO are supported, up to 50 MB. Its longer side may be at most the
+ /// model's maximum aspect ratio times its shorter side; a more extreme
+ /// proportion is rejected with a 400 that states the allowed range.
+ /// Multipart requests only. + /// + /// + /// A photo of the setting the new background should match. Its people
+ /// are not copied. It is held to the same aspect-ratio limit as
+ /// `image`. Multipart requests only. + /// + /// + /// A photo of the setting the new background should match. Its people
+ /// are not copied. It is held to the same aspect-ratio limit as
+ /// `image`. Multipart requests only. + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Whether to keep the result private. When omitted, the result is
+ /// private. Enterprise generations are always private. + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ToolReplaceBackgroundIdeogram45Async( + global::System.IO.Stream image, + string imagename, + global::System.IO.Stream backgroundReference, + string backgroundReferencename, + bool? dryRun = default, + int? numImages = default, + bool? @private = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + backgroundReference = backgroundReference ?? throw new global::System.ArgumentNullException(nameof(backgroundReference)); + var request = new global::Ideogram.ToolReplaceBackgroundIdeogram45Request + { + Image = global::System.Array.Empty(), + Imagename = imagename, + BackgroundReference = global::System.Array.Empty(), + BackgroundReferencename = backgroundReferencename, + NumImages = numImages, + Private = @private, + WebhookUrl = webhookUrl, + }; + PrepareArguments( + client: HttpClient); + PrepareToolReplaceBackgroundIdeogram45Arguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ToolReplaceBackgroundIdeogram45SecurityRequirements, + operationName: "ToolReplaceBackgroundIdeogram45Async"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/replace-background/ideogram-4-5", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + var __contentBackgroundReference = new global::System.Net.Http.StreamContent(backgroundReference); + __contentBackgroundReference.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.BackgroundReferencename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.BackgroundReferencename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentBackgroundReference, + name: "\"background_reference\"", + fileName: request.BackgroundReferencename != null ? $"\"{request.BackgroundReferencename}\"" : string.Empty); + if (__contentBackgroundReference.Headers.ContentDisposition != null) + { + __contentBackgroundReference.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.Private != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"private\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareToolReplaceBackgroundIdeogram45Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolReplaceBackgroundIdeogram45", + methodName: "ToolReplaceBackgroundIdeogram45Async", + pathTemplate: "\"/v2/image/replace-background/ideogram-4-5\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolReplaceBackgroundIdeogram45", + methodName: "ToolReplaceBackgroundIdeogram45Async", + pathTemplate: "\"/v2/image/replace-background/ideogram-4-5\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolReplaceBackgroundIdeogram45", + methodName: "ToolReplaceBackgroundIdeogram45Async", + pathTemplate: "\"/v2/image/replace-background/ideogram-4-5\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessToolReplaceBackgroundIdeogram45Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolReplaceBackgroundIdeogram45", + methodName: "ToolReplaceBackgroundIdeogram45Async", + pathTemplate: "\"/v2/image/replace-background/ideogram-4-5\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolReplaceBackgroundIdeogram45", + methodName: "ToolReplaceBackgroundIdeogram45Async", + pathTemplate: "\"/v2/image/replace-background/ideogram-4-5\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not authorized to replace backgrounds. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // An image was not found or is not readable. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Background replacement is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessToolReplaceBackgroundIdeogram45ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::Ideogram.ReplaceBackgroundResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::Ideogram.ReplaceBackgroundResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Replace background with Ideogram 4.5
+ /// Rebuild the background of an image as the setting shown in a
+ /// `background_reference` image, with Ideogram 4.5 at its highest
+ /// quality. The people in the source image are kept, people in the
+ /// reference are left out, and results keep the source image's aspect
+ /// ratio. Returns a `generation_id`; poll
+ /// `GET /v2/generations/{generation_id}` or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
+ /// MPO are supported, up to 50 MB. Its longer side may be at most the
+ /// model's maximum aspect ratio times its shorter side; a more extreme
+ /// proportion is rejected with a 400 that states the allowed range.
+ /// Multipart requests only. + /// + /// + /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
+ /// MPO are supported, up to 50 MB. Its longer side may be at most the
+ /// model's maximum aspect ratio times its shorter side; a more extreme
+ /// proportion is rejected with a 400 that states the allowed range.
+ /// Multipart requests only. + /// + /// + /// A photo of the setting the new background should match. Its people
+ /// are not copied. It is held to the same aspect-ratio limit as
+ /// `image`. Multipart requests only. + /// + /// + /// A photo of the setting the new background should match. Its people
+ /// are not copied. It is held to the same aspect-ratio limit as
+ /// `image`. Multipart requests only. + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Whether to keep the result private. When omitted, the result is
+ /// private. Enterprise generations are always private. + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ToolReplaceBackgroundIdeogram45AsResponseAsync( + global::System.IO.Stream image, + string imagename, + global::System.IO.Stream backgroundReference, + string backgroundReferencename, + bool? dryRun = default, + int? numImages = default, + bool? @private = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + backgroundReference = backgroundReference ?? throw new global::System.ArgumentNullException(nameof(backgroundReference)); + var request = new global::Ideogram.ToolReplaceBackgroundIdeogram45Request + { + Image = global::System.Array.Empty(), + Imagename = imagename, + BackgroundReference = global::System.Array.Empty(), + BackgroundReferencename = backgroundReferencename, + NumImages = numImages, + Private = @private, + WebhookUrl = webhookUrl, + }; + PrepareArguments( + client: HttpClient); + PrepareToolReplaceBackgroundIdeogram45Arguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ToolReplaceBackgroundIdeogram45SecurityRequirements, + operationName: "ToolReplaceBackgroundIdeogram45Async"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/replace-background/ideogram-4-5", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + var __contentBackgroundReference = new global::System.Net.Http.StreamContent(backgroundReference); + __contentBackgroundReference.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.BackgroundReferencename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.BackgroundReferencename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentBackgroundReference, + name: "\"background_reference\"", + fileName: request.BackgroundReferencename != null ? $"\"{request.BackgroundReferencename}\"" : string.Empty); + if (__contentBackgroundReference.Headers.ContentDisposition != null) + { + __contentBackgroundReference.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.Private != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"private\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareToolReplaceBackgroundIdeogram45Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolReplaceBackgroundIdeogram45", + methodName: "ToolReplaceBackgroundIdeogram45Async", + pathTemplate: "\"/v2/image/replace-background/ideogram-4-5\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolReplaceBackgroundIdeogram45", + methodName: "ToolReplaceBackgroundIdeogram45Async", + pathTemplate: "\"/v2/image/replace-background/ideogram-4-5\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolReplaceBackgroundIdeogram45", + methodName: "ToolReplaceBackgroundIdeogram45Async", + pathTemplate: "\"/v2/image/replace-background/ideogram-4-5\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessToolReplaceBackgroundIdeogram45Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolReplaceBackgroundIdeogram45", + methodName: "ToolReplaceBackgroundIdeogram45Async", + pathTemplate: "\"/v2/image/replace-background/ideogram-4-5\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolReplaceBackgroundIdeogram45", + methodName: "ToolReplaceBackgroundIdeogram45Async", + pathTemplate: "\"/v2/image/replace-background/ideogram-4-5\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not authorized to replace backgrounds. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // An image was not found or is not readable. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Background replacement is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessToolReplaceBackgroundIdeogram45ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.ReplaceBackgroundResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.ReplaceBackgroundResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ToolClient.ToolReplaceBackgroundIdeogramV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.ToolClient.ToolReplaceBackgroundIdeogramV3.g.cs new file mode 100644 index 00000000..7466cbe8 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.ToolClient.ToolReplaceBackgroundIdeogramV3.g.cs @@ -0,0 +1,2507 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class ToolClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_ToolReplaceBackgroundIdeogramV3SecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_ToolReplaceBackgroundIdeogramV3SecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_ToolReplaceBackgroundIdeogramV3SecurityRequirement0, + }; + partial void PrepareToolReplaceBackgroundIdeogramV3Arguments( + global::System.Net.Http.HttpClient httpClient, + ref bool? dryRun, + global::Ideogram.ToolReplaceBackgroundIdeogramV3Request request); + partial void PrepareToolReplaceBackgroundIdeogramV3Request( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + bool? dryRun, + global::Ideogram.ToolReplaceBackgroundIdeogramV3Request request); + partial void ProcessToolReplaceBackgroundIdeogramV3Response( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessToolReplaceBackgroundIdeogramV3ResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Replace background with Ideogram 3.0
+ /// Replace the background of an image from a text prompt with Ideogram 3.0,
+ /// keeping the automatically detected foreground subject; no mask is
+ /// needed. Upload the source `image` using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ToolReplaceBackgroundIdeogramV3Async( + + global::Ideogram.ToolReplaceBackgroundIdeogramV3Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ToolReplaceBackgroundIdeogramV3AsResponseAsync( + + request: request, + dryRun: dryRun, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Replace background with Ideogram 3.0
+ /// Replace the background of an image from a text prompt with Ideogram 3.0,
+ /// keeping the automatically detected foreground subject; no mask is
+ /// needed. Upload the source `image` using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ToolReplaceBackgroundIdeogramV3AsResponseAsync( + + global::Ideogram.ToolReplaceBackgroundIdeogramV3Request request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareToolReplaceBackgroundIdeogramV3Arguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ToolReplaceBackgroundIdeogramV3SecurityRequirements, + operationName: "ToolReplaceBackgroundIdeogramV3Async"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/replace-background/ideogram-3", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + if (request.RenderingSpeed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"rendering_speed\""); + + } + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.Private != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"private\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareToolReplaceBackgroundIdeogramV3Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolReplaceBackgroundIdeogramV3", + methodName: "ToolReplaceBackgroundIdeogramV3Async", + pathTemplate: "\"/v2/image/replace-background/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolReplaceBackgroundIdeogramV3", + methodName: "ToolReplaceBackgroundIdeogramV3Async", + pathTemplate: "\"/v2/image/replace-background/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolReplaceBackgroundIdeogramV3", + methodName: "ToolReplaceBackgroundIdeogramV3Async", + pathTemplate: "\"/v2/image/replace-background/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessToolReplaceBackgroundIdeogramV3Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolReplaceBackgroundIdeogramV3", + methodName: "ToolReplaceBackgroundIdeogramV3Async", + pathTemplate: "\"/v2/image/replace-background/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolReplaceBackgroundIdeogramV3", + methodName: "ToolReplaceBackgroundIdeogramV3Async", + pathTemplate: "\"/v2/image/replace-background/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not authorized to replace backgrounds. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The source image was not found or is not readable. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Background replacement is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessToolReplaceBackgroundIdeogramV3ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.ReplaceBackgroundResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.ReplaceBackgroundResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Replace background with Ideogram 3.0
+ /// Replace the background of an image from a text prompt with Ideogram 3.0,
+ /// keeping the automatically detected foreground subject; no mask is
+ /// needed. Upload the source `image` using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
+ /// MPO are supported, up to 50 MB. Multipart requests only.
+ /// The longer side must be at most 3 times the shorter side; wider
+ /// aspect ratios are rejected with a 400. + /// + /// + /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
+ /// MPO are supported, up to 50 MB. Multipart requests only.
+ /// The longer side must be at most 3 times the shorter side; wider
+ /// aspect ratios are rejected with a 400. + /// + /// + /// Plain-language description of the desired new background. + /// + /// + /// The rendering speed to use.
+ /// Default Value: default + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Whether to keep the result private. When omitted, defaults to your
+ /// plan's setting. Enterprise generations are always private. + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ToolReplaceBackgroundIdeogramV3Async( + byte[] image, + string imagename, + string prompt, + bool? dryRun = default, + global::Ideogram.V2ImageReplaceBackgroundIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed = default, + int? numImages = default, + bool? @private = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Ideogram.ToolReplaceBackgroundIdeogramV3Request + { + Image = image, + Imagename = imagename, + Prompt = prompt, + RenderingSpeed = renderingSpeed, + NumImages = numImages, + Private = @private, + WebhookUrl = webhookUrl, + }; + + return await ToolReplaceBackgroundIdeogramV3Async( + dryRun: dryRun, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// Replace background with Ideogram 3.0
+ /// Replace the background of an image from a text prompt with Ideogram 3.0,
+ /// keeping the automatically detected foreground subject; no mask is
+ /// needed. Upload the source `image` using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
+ /// MPO are supported, up to 50 MB. Multipart requests only.
+ /// The longer side must be at most 3 times the shorter side; wider
+ /// aspect ratios are rejected with a 400. + /// + /// + /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
+ /// MPO are supported, up to 50 MB. Multipart requests only.
+ /// The longer side must be at most 3 times the shorter side; wider
+ /// aspect ratios are rejected with a 400. + /// + /// + /// Plain-language description of the desired new background. + /// + /// + /// The rendering speed to use.
+ /// Default Value: default + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Whether to keep the result private. When omitted, defaults to your
+ /// plan's setting. Enterprise generations are always private. + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ToolReplaceBackgroundIdeogramV3Async( + global::System.IO.Stream image, + string imagename, + string prompt, + bool? dryRun = default, + global::Ideogram.V2ImageReplaceBackgroundIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed = default, + int? numImages = default, + bool? @private = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + var request = new global::Ideogram.ToolReplaceBackgroundIdeogramV3Request + { + Image = global::System.Array.Empty(), + Imagename = imagename, + Prompt = prompt, + RenderingSpeed = renderingSpeed, + NumImages = numImages, + Private = @private, + WebhookUrl = webhookUrl, + }; + PrepareArguments( + client: HttpClient); + PrepareToolReplaceBackgroundIdeogramV3Arguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ToolReplaceBackgroundIdeogramV3SecurityRequirements, + operationName: "ToolReplaceBackgroundIdeogramV3Async"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/replace-background/ideogram-3", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + if (request.RenderingSpeed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"rendering_speed\""); + + } + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.Private != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"private\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareToolReplaceBackgroundIdeogramV3Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolReplaceBackgroundIdeogramV3", + methodName: "ToolReplaceBackgroundIdeogramV3Async", + pathTemplate: "\"/v2/image/replace-background/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolReplaceBackgroundIdeogramV3", + methodName: "ToolReplaceBackgroundIdeogramV3Async", + pathTemplate: "\"/v2/image/replace-background/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolReplaceBackgroundIdeogramV3", + methodName: "ToolReplaceBackgroundIdeogramV3Async", + pathTemplate: "\"/v2/image/replace-background/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessToolReplaceBackgroundIdeogramV3Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolReplaceBackgroundIdeogramV3", + methodName: "ToolReplaceBackgroundIdeogramV3Async", + pathTemplate: "\"/v2/image/replace-background/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolReplaceBackgroundIdeogramV3", + methodName: "ToolReplaceBackgroundIdeogramV3Async", + pathTemplate: "\"/v2/image/replace-background/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not authorized to replace backgrounds. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The source image was not found or is not readable. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Background replacement is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessToolReplaceBackgroundIdeogramV3ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::Ideogram.ReplaceBackgroundResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::Ideogram.ReplaceBackgroundResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Replace background with Ideogram 3.0
+ /// Replace the background of an image from a text prompt with Ideogram 3.0,
+ /// keeping the automatically detected foreground subject; no mask is
+ /// needed. Upload the source `image` using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
+ /// MPO are supported, up to 50 MB. Multipart requests only.
+ /// The longer side must be at most 3 times the shorter side; wider
+ /// aspect ratios are rejected with a 400. + /// + /// + /// The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and
+ /// MPO are supported, up to 50 MB. Multipart requests only.
+ /// The longer side must be at most 3 times the shorter side; wider
+ /// aspect ratios are rejected with a 400. + /// + /// + /// Plain-language description of the desired new background. + /// + /// + /// The rendering speed to use.
+ /// Default Value: default + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// Whether to keep the result private. When omitted, defaults to your
+ /// plan's setting. Enterprise generations are always private. + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ToolReplaceBackgroundIdeogramV3AsResponseAsync( + global::System.IO.Stream image, + string imagename, + string prompt, + bool? dryRun = default, + global::Ideogram.V2ImageReplaceBackgroundIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed? renderingSpeed = default, + int? numImages = default, + bool? @private = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + var request = new global::Ideogram.ToolReplaceBackgroundIdeogramV3Request + { + Image = global::System.Array.Empty(), + Imagename = imagename, + Prompt = prompt, + RenderingSpeed = renderingSpeed, + NumImages = numImages, + Private = @private, + WebhookUrl = webhookUrl, + }; + PrepareArguments( + client: HttpClient); + PrepareToolReplaceBackgroundIdeogramV3Arguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ToolReplaceBackgroundIdeogramV3SecurityRequirements, + operationName: "ToolReplaceBackgroundIdeogramV3Async"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/replace-background/ideogram-3", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + if (request.RenderingSpeed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.RenderingSpeed).HasValue ? (request.RenderingSpeed).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"rendering_speed\""); + + } + if (request.NumImages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"num_images\""); + + } + if (request.Private != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"private\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareToolReplaceBackgroundIdeogramV3Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolReplaceBackgroundIdeogramV3", + methodName: "ToolReplaceBackgroundIdeogramV3Async", + pathTemplate: "\"/v2/image/replace-background/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolReplaceBackgroundIdeogramV3", + methodName: "ToolReplaceBackgroundIdeogramV3Async", + pathTemplate: "\"/v2/image/replace-background/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolReplaceBackgroundIdeogramV3", + methodName: "ToolReplaceBackgroundIdeogramV3Async", + pathTemplate: "\"/v2/image/replace-background/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessToolReplaceBackgroundIdeogramV3Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolReplaceBackgroundIdeogramV3", + methodName: "ToolReplaceBackgroundIdeogramV3Async", + pathTemplate: "\"/v2/image/replace-background/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolReplaceBackgroundIdeogramV3", + methodName: "ToolReplaceBackgroundIdeogramV3Async", + pathTemplate: "\"/v2/image/replace-background/ideogram-3\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not authorized to replace backgrounds. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The source image was not found or is not readable. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Background replacement is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessToolReplaceBackgroundIdeogramV3ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.ReplaceBackgroundResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.ReplaceBackgroundResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ToolClient.g.cs b/src/libs/Ideogram/Generated/Ideogram.ToolClient.g.cs index d26c9928..b519bc5f 100644 --- a/src/libs/Ideogram/Generated/Ideogram.ToolClient.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.ToolClient.g.cs @@ -4,7 +4,6 @@ namespace Ideogram { /// - /// Outcome-focused image tools with implementation details managed by Ideogram.
/// If no httpClient is provided, a new one will be created.
/// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. ///
diff --git a/src/libs/Ideogram/Generated/Ideogram.Tools.JsonSerializerContext.g.cs b/src/libs/Ideogram/Generated/Ideogram.Tools.JsonSerializerContext.g.cs index 7a9a0c8e..a385b26e 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Tools.JsonSerializerContext.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Tools.JsonSerializerContext.g.cs @@ -14,25 +14,23 @@ namespace Ideogram [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(byte[]))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AssetIdentifier))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationErrorResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationRejectReason), TypeInfoPropertyName = "GenerationRejectReason2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed), TypeInfoPropertyName = "GenerationErrorResponseTaskCompletionSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationErrorResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageUpscaleAutoPostRequestBodyContentMultipartFormDataSchemaUpscaleFactor), TypeInfoPropertyName = "V2ImageUpscaleAutoPostRequestBodyContentMultipartFormDataSchemaUpscaleFactor2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleImageObject))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleToolResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleToolRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleToolRequestUpscaleFactor), TypeInfoPropertyName = "UpscaleToolRequestUpscaleFactor2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AssetType), TypeInfoPropertyName = "AssetType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(byte[]))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ToolsPostUpscaleRequest))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationRejectReason?), TypeInfoPropertyName = "NullableGenerationRejectReason2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?), TypeInfoPropertyName = "NullableGenerationErrorResponseTaskCompletionSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.UpscaleToolRequestUpscaleFactor?), TypeInfoPropertyName = "NullableUpscaleToolRequestUpscaleFactor2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AssetType?), TypeInfoPropertyName = "NullableAssetType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V2ImageUpscaleAutoPostRequestBodyContentMultipartFormDataSchemaUpscaleFactor?), TypeInfoPropertyName = "NullableV2ImageUpscaleAutoPostRequestBodyContentMultipartFormDataSchemaUpscaleFactor2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] internal sealed partial class ToolsSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext { @@ -103,37 +101,23 @@ private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Ser public override bool CanConvert(global::System.Type typeToConvert) { return - typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed) - - || typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?) - - || typeToConvert == typeof(global::Ideogram.GenerationRejectReason) + typeToConvert == typeof(global::Ideogram.GenerationRejectReason) || typeToConvert == typeof(global::Ideogram.GenerationRejectReason?) - || typeToConvert == typeof(global::Ideogram.UpscaleToolRequestUpscaleFactor) + || typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed) - || typeToConvert == typeof(global::Ideogram.UpscaleToolRequestUpscaleFactor?) + || typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?) - || typeToConvert == typeof(global::Ideogram.AssetType) + || typeToConvert == typeof(global::Ideogram.V2ImageUpscaleAutoPostRequestBodyContentMultipartFormDataSchemaUpscaleFactor) - || typeToConvert == typeof(global::Ideogram.AssetType?); + || typeToConvert == typeof(global::Ideogram.V2ImageUpscaleAutoPostRequestBodyContentMultipartFormDataSchemaUpscaleFactor?); } public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) { - if (typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed)) - { - return new global::Ideogram.JsonConverters.GenerationErrorResponseTaskCompletionSpeedJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?)) - { - return new global::Ideogram.JsonConverters.GenerationErrorResponseTaskCompletionSpeedNullableJsonConverter(); - } - if (typeToConvert == typeof(global::Ideogram.GenerationRejectReason)) { return new global::Ideogram.JsonConverters.GenerationRejectReasonJsonConverter(); @@ -144,24 +128,24 @@ public override bool CanConvert(global::System.Type typeToConvert) return new global::Ideogram.JsonConverters.GenerationRejectReasonNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.UpscaleToolRequestUpscaleFactor)) + if (typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed)) { - return new global::Ideogram.JsonConverters.UpscaleToolRequestUpscaleFactorJsonConverter(); + return new global::Ideogram.JsonConverters.GenerationErrorResponseTaskCompletionSpeedJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.UpscaleToolRequestUpscaleFactor?)) + if (typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?)) { - return new global::Ideogram.JsonConverters.UpscaleToolRequestUpscaleFactorNullableJsonConverter(); + return new global::Ideogram.JsonConverters.GenerationErrorResponseTaskCompletionSpeedNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.AssetType)) + if (typeToConvert == typeof(global::Ideogram.V2ImageUpscaleAutoPostRequestBodyContentMultipartFormDataSchemaUpscaleFactor)) { - return new global::Ideogram.JsonConverters.AssetTypeJsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageUpscaleAutoPostRequestBodyContentMultipartFormDataSchemaUpscaleFactorJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.AssetType?)) + if (typeToConvert == typeof(global::Ideogram.V2ImageUpscaleAutoPostRequestBodyContentMultipartFormDataSchemaUpscaleFactor?)) { - return new global::Ideogram.JsonConverters.AssetTypeNullableJsonConverter(); + return new global::Ideogram.JsonConverters.V2ImageUpscaleAutoPostRequestBodyContentMultipartFormDataSchemaUpscaleFactorNullableJsonConverter(); } throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); } diff --git a/src/libs/Ideogram/Generated/Ideogram.ToolsClient.PostUpscale.g.cs b/src/libs/Ideogram/Generated/Ideogram.ToolsClient.PostUpscale.g.cs deleted file mode 100644 index d0b132a1..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.ToolsClient.PostUpscale.g.cs +++ /dev/null @@ -1,927 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class ToolsClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostUpscaleSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostUpscaleSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostUpscaleSecurityRequirement0, - }; - partial void PreparePostUpscaleArguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? dryRun, - global::Ideogram.UpscaleToolRequest request); - partial void PreparePostUpscaleRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? dryRun, - global::Ideogram.UpscaleToolRequest request); - partial void ProcessPostUpscaleResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostUpscaleResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Upscale with automatic model selection
- /// Upscale an image to 2x, 4x, or 8x its original resolution with a model
- /// Ideogram picks per request; the choice may change over time. Upload the
- /// source `image` using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostUpscaleAsync( - - global::Ideogram.UpscaleToolRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostUpscaleAsResponseAsync( - - request: request, - dryRun: dryRun, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Upscale with automatic model selection
- /// Upscale an image to 2x, 4x, or 8x its original resolution with a model
- /// Ideogram picks per request; the choice may change over time. Upload the
- /// source `image` using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostUpscaleAsResponseAsync( - - global::Ideogram.UpscaleToolRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostUpscaleArguments( - httpClient: HttpClient, - dryRun: ref dryRun, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostUpscaleSecurityRequirements, - operationName: "PostUpscaleAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/image/upscale/auto", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (request.ImageAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ImageAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"image_asset_identifier\""); - - } - if (request.Image != default) - { - - var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.UpscaleFactor != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.UpscaleFactor).HasValue ? (request.UpscaleFactor).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"upscale_factor\""); - - } - if (request.Seed != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"seed\""); - - } - if (request.Internal != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Internal, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"internal\""); - - } - if (request.Async != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"async\""); - - } - if (request.WebhookUrl != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), - name: "\"webhook_url\""); - - } - if (request.Private != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"private\""); - - } - if (request.TargetCollectionId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.TargetCollectionId ?? string.Empty), - name: "\"target_collection_id\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostUpscaleRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - dryRun: dryRun, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostUpscale", - methodName: "PostUpscaleAsync", - pathTemplate: "\"/v2/image/upscale/auto\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostUpscale", - methodName: "PostUpscaleAsync", - pathTemplate: "\"/v2/image/upscale/auto\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostUpscale", - methodName: "PostUpscaleAsync", - pathTemplate: "\"/v2/image/upscale/auto\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostUpscaleResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostUpscale", - methodName: "PostUpscaleAsync", - pathTemplate: "\"/v2/image/upscale/auto\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostUpscale", - methodName: "PostUpscaleAsync", - pathTemplate: "\"/v2/image/upscale/auto\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 500) - { - string? __content_500 = null; - global::System.Exception? __exception_500 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_500 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_500, - responseBody: __content_500, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostUpscaleResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.UpscaleToolResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.UpscaleToolResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Upscale with automatic model selection
- /// Upscale an image to 2x, 4x, or 8x its original resolution with a model
- /// Ideogram picks per request; the choice may change over time. Upload the
- /// source `image` using `multipart/form-data`.
- /// Returns results directly by default; set `async` or supply a
- /// `webhook_url` to get a `generation_id` and poll
- /// `GET /v2/generations/{generation_id}`. - ///
- /// - /// Default Value: false - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - /// - /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - /// - /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
- /// Default Value: x2 - /// - /// - /// Random seed. Set for reproducible generation.
- /// Example: 12345 - /// - /// - /// When true, the upscale is excluded from the user's gallery and feeds.
- /// Default Value: false - /// - /// - /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostUpscaleAsync( - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - global::Ideogram.UpscaleToolRequestUpscaleFactor? upscaleFactor = default, - int? seed = default, - bool? @internal = default, - bool? async = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.UpscaleToolRequest - { - ImageAssetIdentifier = imageAssetIdentifier, - Image = image, - Imagename = imagename, - UpscaleFactor = upscaleFactor, - Seed = seed, - Internal = @internal, - Async = async, - WebhookUrl = webhookUrl, - Private = @private, - TargetCollectionId = targetCollectionId, - }; - - return await PostUpscaleAsync( - dryRun: dryRun, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ToolsClient.ToolsPostUpscale.g.cs b/src/libs/Ideogram/Generated/Ideogram.ToolsClient.ToolsPostUpscale.g.cs new file mode 100644 index 00000000..0dcb77ff --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.ToolsClient.ToolsPostUpscale.g.cs @@ -0,0 +1,2464 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class ToolsClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_ToolsPostUpscaleSecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_ToolsPostUpscaleSecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_ToolsPostUpscaleSecurityRequirement0, + }; + partial void PrepareToolsPostUpscaleArguments( + global::System.Net.Http.HttpClient httpClient, + ref bool? dryRun, + global::Ideogram.ToolsPostUpscaleRequest request); + partial void PrepareToolsPostUpscaleRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + bool? dryRun, + global::Ideogram.ToolsPostUpscaleRequest request); + partial void ProcessToolsPostUpscaleResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessToolsPostUpscaleResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Upscale with automatic model selection
+ /// Upscale an image to 2x, 4x, or 8x its original resolution with a model
+ /// Ideogram picks per request; the choice may change over time. Upload the
+ /// source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ToolsPostUpscaleAsync( + + global::Ideogram.ToolsPostUpscaleRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ToolsPostUpscaleAsResponseAsync( + + request: request, + dryRun: dryRun, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Upscale with automatic model selection
+ /// Upscale an image to 2x, 4x, or 8x its original resolution with a model
+ /// Ideogram picks per request; the choice may change over time. Upload the
+ /// source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ToolsPostUpscaleAsResponseAsync( + + global::Ideogram.ToolsPostUpscaleRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareToolsPostUpscaleArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ToolsPostUpscaleSecurityRequirements, + operationName: "ToolsPostUpscaleAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/upscale/auto", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.UpscaleFactor != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.UpscaleFactor).HasValue ? (request.UpscaleFactor).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"upscale_factor\""); + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareToolsPostUpscaleRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolsPostUpscale", + methodName: "ToolsPostUpscaleAsync", + pathTemplate: "\"/v2/image/upscale/auto\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolsPostUpscale", + methodName: "ToolsPostUpscaleAsync", + pathTemplate: "\"/v2/image/upscale/auto\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolsPostUpscale", + methodName: "ToolsPostUpscaleAsync", + pathTemplate: "\"/v2/image/upscale/auto\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessToolsPostUpscaleResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolsPostUpscale", + methodName: "ToolsPostUpscaleAsync", + pathTemplate: "\"/v2/image/upscale/auto\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolsPostUpscale", + methodName: "ToolsPostUpscaleAsync", + pathTemplate: "\"/v2/image/upscale/auto\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided, or the output would exceed the 8K limit. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not authorized to upscale images. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The source image was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessToolsPostUpscaleResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.UpscaleToolResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.UpscaleToolResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Upscale with automatic model selection
+ /// Upscale an image to 2x, 4x, or 8x its original resolution with a model
+ /// Ideogram picks per request; the choice may change over time. Upload the
+ /// source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
+ /// Default Value: x2 + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ToolsPostUpscaleAsync( + byte[] image, + string imagename, + bool? dryRun = default, + global::Ideogram.V2ImageUpscaleAutoPostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? upscaleFactor = default, + int? seed = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Ideogram.ToolsPostUpscaleRequest + { + Image = image, + Imagename = imagename, + UpscaleFactor = upscaleFactor, + Seed = seed, + Async = async, + WebhookUrl = webhookUrl, + }; + + return await ToolsPostUpscaleAsync( + dryRun: dryRun, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// Upscale with automatic model selection
+ /// Upscale an image to 2x, 4x, or 8x its original resolution with a model
+ /// Ideogram picks per request; the choice may change over time. Upload the
+ /// source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
+ /// Default Value: x2 + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ToolsPostUpscaleAsync( + global::System.IO.Stream image, + string imagename, + bool? dryRun = default, + global::Ideogram.V2ImageUpscaleAutoPostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? upscaleFactor = default, + int? seed = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + var request = new global::Ideogram.ToolsPostUpscaleRequest + { + Image = global::System.Array.Empty(), + Imagename = imagename, + UpscaleFactor = upscaleFactor, + Seed = seed, + Async = async, + WebhookUrl = webhookUrl, + }; + PrepareArguments( + client: HttpClient); + PrepareToolsPostUpscaleArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ToolsPostUpscaleSecurityRequirements, + operationName: "ToolsPostUpscaleAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/upscale/auto", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.UpscaleFactor != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.UpscaleFactor).HasValue ? (request.UpscaleFactor).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"upscale_factor\""); + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareToolsPostUpscaleRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolsPostUpscale", + methodName: "ToolsPostUpscaleAsync", + pathTemplate: "\"/v2/image/upscale/auto\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolsPostUpscale", + methodName: "ToolsPostUpscaleAsync", + pathTemplate: "\"/v2/image/upscale/auto\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolsPostUpscale", + methodName: "ToolsPostUpscaleAsync", + pathTemplate: "\"/v2/image/upscale/auto\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessToolsPostUpscaleResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolsPostUpscale", + methodName: "ToolsPostUpscaleAsync", + pathTemplate: "\"/v2/image/upscale/auto\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolsPostUpscale", + methodName: "ToolsPostUpscaleAsync", + pathTemplate: "\"/v2/image/upscale/auto\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided, or the output would exceed the 8K limit. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not authorized to upscale images. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The source image was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessToolsPostUpscaleResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::Ideogram.UpscaleToolResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::Ideogram.UpscaleToolResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Upscale with automatic model selection
+ /// Upscale an image to 2x, 4x, or 8x its original resolution with a model
+ /// Ideogram picks per request; the choice may change over time. Upload the
+ /// source `image` using `multipart/form-data`.
+ /// Returns results directly by default; set `async` or supply a
+ /// `webhook_url` to get a `generation_id` and poll
+ /// `GET /v2/generations/{generation_id}`. + ///
+ /// + /// Default Value: false + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.
+ /// Default Value: x2 + /// + /// + /// Random seed. Set for reproducible generation. + /// + /// + /// When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ToolsPostUpscaleAsResponseAsync( + global::System.IO.Stream image, + string imagename, + bool? dryRun = default, + global::Ideogram.V2ImageUpscaleAutoPostRequestBodyContentMultipartFormDataSchemaUpscaleFactor? upscaleFactor = default, + int? seed = default, + bool? async = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + var request = new global::Ideogram.ToolsPostUpscaleRequest + { + Image = global::System.Array.Empty(), + Imagename = imagename, + UpscaleFactor = upscaleFactor, + Seed = seed, + Async = async, + WebhookUrl = webhookUrl, + }; + PrepareArguments( + client: HttpClient); + PrepareToolsPostUpscaleArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ToolsPostUpscaleSecurityRequirements, + operationName: "ToolsPostUpscaleAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/image/upscale/auto", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.UpscaleFactor != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.UpscaleFactor).HasValue ? (request.UpscaleFactor).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"upscale_factor\""); + + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"seed\""); + + } + if (request.Async != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Async, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"async\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareToolsPostUpscaleRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolsPostUpscale", + methodName: "ToolsPostUpscaleAsync", + pathTemplate: "\"/v2/image/upscale/auto\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolsPostUpscale", + methodName: "ToolsPostUpscaleAsync", + pathTemplate: "\"/v2/image/upscale/auto\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolsPostUpscale", + methodName: "ToolsPostUpscaleAsync", + pathTemplate: "\"/v2/image/upscale/auto\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessToolsPostUpscaleResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolsPostUpscale", + methodName: "ToolsPostUpscaleAsync", + pathTemplate: "\"/v2/image/upscale/auto\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ToolsPostUpscale", + methodName: "ToolsPostUpscaleAsync", + pathTemplate: "\"/v2/image/upscale/auto\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided, or the output would exceed the 8K limit. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not authorized to upscale images. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The source image was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessToolsPostUpscaleResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.UpscaleToolResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.UpscaleToolResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.VideoEdit.JsonSerializerContext.g.cs b/src/libs/Ideogram/Generated/Ideogram.VideoEdit.JsonSerializerContext.g.cs index f4a29536..a3312e9d 100644 --- a/src/libs/Ideogram/Generated/Ideogram.VideoEdit.JsonSerializerContext.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.VideoEdit.JsonSerializerContext.g.cs @@ -14,39 +14,29 @@ namespace Ideogram [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(byte[]))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(float))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AssetIdentifier))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateVideoSeedDance2Response))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SeedDance2Resolution), TypeInfoPropertyName = "SeedDance2Resolution2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationErrorResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationRejectReason), TypeInfoPropertyName = "GenerationRejectReason2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed), TypeInfoPropertyName = "GenerationErrorResponseTaskCompletionSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MinimaxH3AspectRatio), TypeInfoPropertyName = "MinimaxH3AspectRatio2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationErrorResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MinimaxH3Resolution), TypeInfoPropertyName = "MinimaxH3Resolution2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateVideoMinimaxH3Response))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.EditVideoMinimaxH3ReferenceToVideoRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MinimaxH3AspectRatio), TypeInfoPropertyName = "MinimaxH3AspectRatio2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MinimaxH3PromptExpansionMode), TypeInfoPropertyName = "MinimaxH3PromptExpansionMode2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.EditVideoSeedDance2Request))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AssetType), TypeInfoPropertyName = "AssetType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(byte[]))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.VideoEditPostEditVideoMinimaxH3ReferenceToVideoRequest))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(float?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SeedDance2Resolution?), TypeInfoPropertyName = "NullableSeedDance2Resolution2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationRejectReason?), TypeInfoPropertyName = "NullableGenerationRejectReason2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?), TypeInfoPropertyName = "NullableGenerationErrorResponseTaskCompletionSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MinimaxH3AspectRatio?), TypeInfoPropertyName = "NullableMinimaxH3AspectRatio2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime?))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MinimaxH3Resolution?), TypeInfoPropertyName = "NullableMinimaxH3Resolution2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MinimaxH3AspectRatio?), TypeInfoPropertyName = "NullableMinimaxH3AspectRatio2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MinimaxH3PromptExpansionMode?), TypeInfoPropertyName = "NullableMinimaxH3PromptExpansionMode2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AssetType?), TypeInfoPropertyName = "NullableAssetType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] internal sealed partial class VideoEditSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext { } @@ -116,30 +106,22 @@ private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Ser public override bool CanConvert(global::System.Type typeToConvert) { return - typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed) - - || typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?) - - || typeToConvert == typeof(global::Ideogram.GenerationRejectReason) + typeToConvert == typeof(global::Ideogram.GenerationRejectReason) || typeToConvert == typeof(global::Ideogram.GenerationRejectReason?) - || typeToConvert == typeof(global::Ideogram.AssetType) + || typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed) - || typeToConvert == typeof(global::Ideogram.AssetType?) + || typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?) - || typeToConvert == typeof(global::Ideogram.SeedDance2Resolution) + || typeToConvert == typeof(global::Ideogram.MinimaxH3Resolution) - || typeToConvert == typeof(global::Ideogram.SeedDance2Resolution?) + || typeToConvert == typeof(global::Ideogram.MinimaxH3Resolution?) || typeToConvert == typeof(global::Ideogram.MinimaxH3AspectRatio) || typeToConvert == typeof(global::Ideogram.MinimaxH3AspectRatio?) - || typeToConvert == typeof(global::Ideogram.MinimaxH3Resolution) - - || typeToConvert == typeof(global::Ideogram.MinimaxH3Resolution?) - || typeToConvert == typeof(global::Ideogram.MinimaxH3PromptExpansionMode) || typeToConvert == typeof(global::Ideogram.MinimaxH3PromptExpansionMode?); @@ -149,16 +131,6 @@ public override bool CanConvert(global::System.Type typeToConvert) global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) { - if (typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed)) - { - return new global::Ideogram.JsonConverters.GenerationErrorResponseTaskCompletionSpeedJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?)) - { - return new global::Ideogram.JsonConverters.GenerationErrorResponseTaskCompletionSpeedNullableJsonConverter(); - } - if (typeToConvert == typeof(global::Ideogram.GenerationRejectReason)) { return new global::Ideogram.JsonConverters.GenerationRejectReasonJsonConverter(); @@ -169,24 +141,24 @@ public override bool CanConvert(global::System.Type typeToConvert) return new global::Ideogram.JsonConverters.GenerationRejectReasonNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.AssetType)) + if (typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed)) { - return new global::Ideogram.JsonConverters.AssetTypeJsonConverter(); + return new global::Ideogram.JsonConverters.GenerationErrorResponseTaskCompletionSpeedJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.AssetType?)) + if (typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?)) { - return new global::Ideogram.JsonConverters.AssetTypeNullableJsonConverter(); + return new global::Ideogram.JsonConverters.GenerationErrorResponseTaskCompletionSpeedNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.SeedDance2Resolution)) + if (typeToConvert == typeof(global::Ideogram.MinimaxH3Resolution)) { - return new global::Ideogram.JsonConverters.SeedDance2ResolutionJsonConverter(); + return new global::Ideogram.JsonConverters.MinimaxH3ResolutionJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.SeedDance2Resolution?)) + if (typeToConvert == typeof(global::Ideogram.MinimaxH3Resolution?)) { - return new global::Ideogram.JsonConverters.SeedDance2ResolutionNullableJsonConverter(); + return new global::Ideogram.JsonConverters.MinimaxH3ResolutionNullableJsonConverter(); } if (typeToConvert == typeof(global::Ideogram.MinimaxH3AspectRatio)) @@ -199,16 +171,6 @@ public override bool CanConvert(global::System.Type typeToConvert) return new global::Ideogram.JsonConverters.MinimaxH3AspectRatioNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.MinimaxH3Resolution)) - { - return new global::Ideogram.JsonConverters.MinimaxH3ResolutionJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.MinimaxH3Resolution?)) - { - return new global::Ideogram.JsonConverters.MinimaxH3ResolutionNullableJsonConverter(); - } - if (typeToConvert == typeof(global::Ideogram.MinimaxH3PromptExpansionMode)) { return new global::Ideogram.JsonConverters.MinimaxH3PromptExpansionModeJsonConverter(); diff --git a/src/libs/Ideogram/Generated/Ideogram.VideoEditClient.PostEditVideoMinimaxH3ReferenceToVideo.g.cs b/src/libs/Ideogram/Generated/Ideogram.VideoEditClient.PostEditVideoMinimaxH3ReferenceToVideo.g.cs deleted file mode 100644 index 504f3ace..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.VideoEditClient.PostEditVideoMinimaxH3ReferenceToVideo.g.cs +++ /dev/null @@ -1,978 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class VideoEditClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostEditVideoMinimaxH3ReferenceToVideoSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostEditVideoMinimaxH3ReferenceToVideoSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostEditVideoMinimaxH3ReferenceToVideoSecurityRequirement0, - }; - partial void PreparePostEditVideoMinimaxH3ReferenceToVideoArguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? dryRun, - global::Ideogram.EditVideoMinimaxH3ReferenceToVideoRequest request); - partial void PreparePostEditVideoMinimaxH3ReferenceToVideoRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? dryRun, - global::Ideogram.EditVideoMinimaxH3ReferenceToVideoRequest request); - partial void ProcessPostEditVideoMinimaxH3ReferenceToVideoResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostEditVideoMinimaxH3ReferenceToVideoResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Reference to video with MiniMax H3
- /// Produce a video from a text prompt and optional reference media with
- /// MiniMax H3. Upload `reference_images` and `reference_audios` using
- /// `multipart/form-data`, and address them in the prompt by position
- /// (`Image 1`, `Audio 1`, …). Returns a `generation_id`; poll
- /// `GET /v2/generations/{generation_id}` or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostEditVideoMinimaxH3ReferenceToVideoAsync( - - global::Ideogram.EditVideoMinimaxH3ReferenceToVideoRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostEditVideoMinimaxH3ReferenceToVideoAsResponseAsync( - - request: request, - dryRun: dryRun, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Reference to video with MiniMax H3
- /// Produce a video from a text prompt and optional reference media with
- /// MiniMax H3. Upload `reference_images` and `reference_audios` using
- /// `multipart/form-data`, and address them in the prompt by position
- /// (`Image 1`, `Audio 1`, …). Returns a `generation_id`; poll
- /// `GET /v2/generations/{generation_id}` or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostEditVideoMinimaxH3ReferenceToVideoAsResponseAsync( - - global::Ideogram.EditVideoMinimaxH3ReferenceToVideoRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostEditVideoMinimaxH3ReferenceToVideoArguments( - httpClient: HttpClient, - dryRun: ref dryRun, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostEditVideoMinimaxH3ReferenceToVideoSecurityRequirements, - operationName: "PostEditVideoMinimaxH3ReferenceToVideoAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/video/generate/minimax-h3-reference-to-video", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - if (request.ReferenceImageAssetIdentifiers != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.ReferenceImageAssetIdentifiers!, x => x.ToJson(JsonSerializerContext)))}]"), - name: "\"reference_image_asset_identifiers\""); - - } - if (request.ReferenceImages != default) - { - - for (var __iReferenceImages = 0; __iReferenceImages < request.ReferenceImages.Count; __iReferenceImages++) - { - var __contentReferenceImages = new global::System.Net.Http.ByteArrayContent(request.ReferenceImages[__iReferenceImages]); - __contentReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); - __httpRequestContent.Add( - content: __contentReferenceImages, - name: "\"reference_images\"", - fileName: $"\"file{__iReferenceImages}.bin\""); - if (__contentReferenceImages.Headers.ContentDisposition != null) - { - __contentReferenceImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - if (request.ReferenceVideoAssetIdentifiers != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.ReferenceVideoAssetIdentifiers!, x => x.ToJson(JsonSerializerContext)))}]"), - name: "\"reference_video_asset_identifiers\""); - - } - if (request.ReferenceAudios != default) - { - - for (var __iReferenceAudios = 0; __iReferenceAudios < request.ReferenceAudios.Count; __iReferenceAudios++) - { - var __contentReferenceAudios = new global::System.Net.Http.ByteArrayContent(request.ReferenceAudios[__iReferenceAudios]); - __contentReferenceAudios.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); - __httpRequestContent.Add( - content: __contentReferenceAudios, - name: "\"reference_audios\"", - fileName: $"\"file{__iReferenceAudios}.bin\""); - if (__contentReferenceAudios.Headers.ContentDisposition != null) - { - __contentReferenceAudios.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - if (request.AspectRatio != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.AspectRatio).HasValue ? (request.AspectRatio).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"aspect_ratio\""); - - } - if (request.Resolution != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"resolution\""); - - } - if (request.Duration != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Duration, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"duration\""); - - } - if (request.PromptExpansionMode != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.PromptExpansionMode).HasValue ? (request.PromptExpansionMode).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"prompt_expansion_mode\""); - - } - if (request.WebhookUrl != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), - name: "\"webhook_url\""); - - } - if (request.Private != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"private\""); - - } - if (request.TargetCollectionId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.TargetCollectionId ?? string.Empty), - name: "\"target_collection_id\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostEditVideoMinimaxH3ReferenceToVideoRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - dryRun: dryRun, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostEditVideoMinimaxH3ReferenceToVideo", - methodName: "PostEditVideoMinimaxH3ReferenceToVideoAsync", - pathTemplate: "\"/v2/video/generate/minimax-h3-reference-to-video\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostEditVideoMinimaxH3ReferenceToVideo", - methodName: "PostEditVideoMinimaxH3ReferenceToVideoAsync", - pathTemplate: "\"/v2/video/generate/minimax-h3-reference-to-video\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostEditVideoMinimaxH3ReferenceToVideo", - methodName: "PostEditVideoMinimaxH3ReferenceToVideoAsync", - pathTemplate: "\"/v2/video/generate/minimax-h3-reference-to-video\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostEditVideoMinimaxH3ReferenceToVideoResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostEditVideoMinimaxH3ReferenceToVideo", - methodName: "PostEditVideoMinimaxH3ReferenceToVideoAsync", - pathTemplate: "\"/v2/video/generate/minimax-h3-reference-to-video\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostEditVideoMinimaxH3ReferenceToVideo", - methodName: "PostEditVideoMinimaxH3ReferenceToVideoAsync", - pathTemplate: "\"/v2/video/generate/minimax-h3-reference-to-video\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 500) - { - string? __content_500 = null; - global::System.Exception? __exception_500 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_500 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_500, - responseBody: __content_500, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostEditVideoMinimaxH3ReferenceToVideoResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.GenerateVideoMinimaxH3Response.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.GenerateVideoMinimaxH3Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Reference to video with MiniMax H3
- /// Produce a video from a text prompt and optional reference media with
- /// MiniMax H3. Upload `reference_images` and `reference_audios` using
- /// `multipart/form-data`, and address them in the prompt by position
- /// (`Image 1`, `Audio 1`, …). Returns a `generation_id`; poll
- /// `GET /v2/generations/{generation_id}` or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// A natural-language prompt describing the video to produce. Reference media is addressed by position, as in "Image 1 walks toward the camera with the motion of Video 1".
- /// Example: Image 1 walks through the snowy forest at dawn. - /// - /// - /// Images already stored with Ideogram to use as references, by reference, in prompt order. Cannot be combined with `reference_images`. Only image assets are accepted. - /// - /// - /// Images to use as references (max size 50MB each), as raw bytes, in prompt order; only common image formats such as JPEG, PNG, and WEBP are supported. Uploaded images are used for this request only and are not stored. - /// - /// - /// Videos generated or uploaded with Ideogram to use as motion references, by reference, in prompt order. Each clip must be between 2 and 15 seconds long, and the clips must total no more than 15 seconds. Raw video uploads are not accepted. - /// - /// - /// MP3 or WAV audio references, in prompt order as Audio 1, Audio 2, and Audio 3. Multipart uploads only; up to 15 MB per file and 2–15 seconds each. Audio and video references must total no more than 15 seconds. Requires a reference image or video. At most 12 references across images, videos, and audio. Used only for this request and not saved as assets. - /// - /// - /// The aspect ratio of the generated video.
- /// Default Value: 16x9 - /// - /// - /// The resolution tier of the generated video, spelled the way MiniMax
- /// spells it. `480P` and `768P` are generated natively; `2K` and `4K` are
- /// upscaled from a `768P` result.
- /// Higher tiers cost more.
- /// Default Value: 2K - /// - /// - /// The length of the generated video in seconds.
- /// Default Value: 5
- /// Example: 5 - /// - /// - /// How much the model may rewrite the prompt before generating. `disabled`
- /// uses the prompt as written; the other modes trade latency for a richer
- /// rewrite.
- /// Default Value: balanced - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output videos are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostEditVideoMinimaxH3ReferenceToVideoAsync( - string prompt, - bool? dryRun = default, - global::System.Collections.Generic.IList? referenceImageAssetIdentifiers = default, - global::System.Collections.Generic.IList? referenceImages = default, - global::System.Collections.Generic.IList? referenceVideoAssetIdentifiers = default, - global::System.Collections.Generic.IList? referenceAudios = default, - global::Ideogram.MinimaxH3AspectRatio? aspectRatio = default, - global::Ideogram.MinimaxH3Resolution? resolution = default, - int? duration = default, - global::Ideogram.MinimaxH3PromptExpansionMode? promptExpansionMode = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.EditVideoMinimaxH3ReferenceToVideoRequest - { - Prompt = prompt, - ReferenceImageAssetIdentifiers = referenceImageAssetIdentifiers, - ReferenceImages = referenceImages, - ReferenceVideoAssetIdentifiers = referenceVideoAssetIdentifiers, - ReferenceAudios = referenceAudios, - AspectRatio = aspectRatio, - Resolution = resolution, - Duration = duration, - PromptExpansionMode = promptExpansionMode, - WebhookUrl = webhookUrl, - Private = @private, - TargetCollectionId = targetCollectionId, - }; - - return await PostEditVideoMinimaxH3ReferenceToVideoAsync( - dryRun: dryRun, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.VideoEditClient.PostEditVideoSeedDance2.g.cs b/src/libs/Ideogram/Generated/Ideogram.VideoEditClient.PostEditVideoSeedDance2.g.cs deleted file mode 100644 index 28abb144..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.VideoEditClient.PostEditVideoSeedDance2.g.cs +++ /dev/null @@ -1,932 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class VideoEditClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostEditVideoSeedDance2SecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostEditVideoSeedDance2SecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostEditVideoSeedDance2SecurityRequirement0, - }; - partial void PreparePostEditVideoSeedDance2Arguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? dryRun, - global::Ideogram.EditVideoSeedDance2Request request); - partial void PreparePostEditVideoSeedDance2Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? dryRun, - global::Ideogram.EditVideoSeedDance2Request request); - partial void ProcessPostEditVideoSeedDance2Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostEditVideoSeedDance2ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Edit video with Seedance 2.0
- /// Edit a video you already have stored with Ideogram by replacing part of
- /// it. Reference the source video with `video_asset_identifier` and mark the
- /// span to replace with `start_frame_time` and `end_frame_time`, in seconds.
- /// Seedance 2.0 generates a new clip for that span from your prompt, and the
- /// result is the source video with the generated clip spliced in over the
- /// span: everything before `start_frame_time`, then the generated clip, then
- /// everything from `end_frame_time` on. That edited video is the asset the
- /// request produces.
- /// `is_start_frame_included` and `is_end_frame_included` anchor the generated
- /// clip on the span's own end frames, so it joins the surrounding footage
- /// instead of cutting to something unrelated. Anchoring the start opens the
- /// clip on the frame already at `start_frame_time`; anchoring the end lands
- /// it on the frame at `end_frame_time`; anchoring both joins at each seam. At
- /// least one must be anchored.
- /// The generated clip is used at its own length, which the model rarely makes
- /// exactly the span's, so the edited video is usually a different length from
- /// the source. Request a `duration` close to the span to keep them near each
- /// other. The clip is scaled and cropped to fill the source's frame and
- /// conformed to its frame rate, so resolution and aspect ratio follow the
- /// source rather than being requested.
- /// Video generation always runs asynchronously: the response returns as
- /// soon as the request is accepted and carries only a `generation_id`.
- /// Poll for completion and results with
- /// `GET /v2/generations/{generation_id}` using that id, or supply a
- /// `webhook_url` to have the finished result POSTed to your server
- /// instead.
- /// Video links are available for a limited period of time; download the
- /// video if you want to keep it. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostEditVideoSeedDance2Async( - - global::Ideogram.EditVideoSeedDance2Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostEditVideoSeedDance2AsResponseAsync( - - request: request, - dryRun: dryRun, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Edit video with Seedance 2.0
- /// Edit a video you already have stored with Ideogram by replacing part of
- /// it. Reference the source video with `video_asset_identifier` and mark the
- /// span to replace with `start_frame_time` and `end_frame_time`, in seconds.
- /// Seedance 2.0 generates a new clip for that span from your prompt, and the
- /// result is the source video with the generated clip spliced in over the
- /// span: everything before `start_frame_time`, then the generated clip, then
- /// everything from `end_frame_time` on. That edited video is the asset the
- /// request produces.
- /// `is_start_frame_included` and `is_end_frame_included` anchor the generated
- /// clip on the span's own end frames, so it joins the surrounding footage
- /// instead of cutting to something unrelated. Anchoring the start opens the
- /// clip on the frame already at `start_frame_time`; anchoring the end lands
- /// it on the frame at `end_frame_time`; anchoring both joins at each seam. At
- /// least one must be anchored.
- /// The generated clip is used at its own length, which the model rarely makes
- /// exactly the span's, so the edited video is usually a different length from
- /// the source. Request a `duration` close to the span to keep them near each
- /// other. The clip is scaled and cropped to fill the source's frame and
- /// conformed to its frame rate, so resolution and aspect ratio follow the
- /// source rather than being requested.
- /// Video generation always runs asynchronously: the response returns as
- /// soon as the request is accepted and carries only a `generation_id`.
- /// Poll for completion and results with
- /// `GET /v2/generations/{generation_id}` using that id, or supply a
- /// `webhook_url` to have the finished result POSTed to your server
- /// instead.
- /// Video links are available for a limited period of time; download the
- /// video if you want to keep it. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostEditVideoSeedDance2AsResponseAsync( - - global::Ideogram.EditVideoSeedDance2Request request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostEditVideoSeedDance2Arguments( - httpClient: HttpClient, - dryRun: ref dryRun, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostEditVideoSeedDance2SecurityRequirements, - operationName: "PostEditVideoSeedDance2Async"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/video/edit/seedance-2", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostEditVideoSeedDance2Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - dryRun: dryRun, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostEditVideoSeedDance2", - methodName: "PostEditVideoSeedDance2Async", - pathTemplate: "\"/v2/video/edit/seedance-2\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostEditVideoSeedDance2", - methodName: "PostEditVideoSeedDance2Async", - pathTemplate: "\"/v2/video/edit/seedance-2\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostEditVideoSeedDance2", - methodName: "PostEditVideoSeedDance2Async", - pathTemplate: "\"/v2/video/edit/seedance-2\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostEditVideoSeedDance2Response( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostEditVideoSeedDance2", - methodName: "PostEditVideoSeedDance2Async", - pathTemplate: "\"/v2/video/edit/seedance-2\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostEditVideoSeedDance2", - methodName: "PostEditVideoSeedDance2Async", - pathTemplate: "\"/v2/video/edit/seedance-2\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 500) - { - string? __content_500 = null; - global::System.Exception? __exception_500 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_500 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_500, - responseBody: __content_500, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostEditVideoSeedDance2ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.GenerateVideoSeedDance2Response.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.GenerateVideoSeedDance2Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Edit video with Seedance 2.0
- /// Edit a video you already have stored with Ideogram by replacing part of
- /// it. Reference the source video with `video_asset_identifier` and mark the
- /// span to replace with `start_frame_time` and `end_frame_time`, in seconds.
- /// Seedance 2.0 generates a new clip for that span from your prompt, and the
- /// result is the source video with the generated clip spliced in over the
- /// span: everything before `start_frame_time`, then the generated clip, then
- /// everything from `end_frame_time` on. That edited video is the asset the
- /// request produces.
- /// `is_start_frame_included` and `is_end_frame_included` anchor the generated
- /// clip on the span's own end frames, so it joins the surrounding footage
- /// instead of cutting to something unrelated. Anchoring the start opens the
- /// clip on the frame already at `start_frame_time`; anchoring the end lands
- /// it on the frame at `end_frame_time`; anchoring both joins at each seam. At
- /// least one must be anchored.
- /// The generated clip is used at its own length, which the model rarely makes
- /// exactly the span's, so the edited video is usually a different length from
- /// the source. Request a `duration` close to the span to keep them near each
- /// other. The clip is scaled and cropped to fill the source's frame and
- /// conformed to its frame rate, so resolution and aspect ratio follow the
- /// source rather than being requested.
- /// Video generation always runs asynchronously: the response returns as
- /// soon as the request is accepted and carries only a `generation_id`.
- /// Poll for completion and results with
- /// `GET /v2/generations/{generation_id}` using that id, or supply a
- /// `webhook_url` to have the finished result POSTed to your server
- /// instead.
- /// Video links are available for a limited period of time; download the
- /// video if you want to keep it. - ///
- /// - /// Default Value: false - /// - /// - /// A reference to a video already stored with Ideogram to take the frames from. Only video assets are accepted. - /// - /// - /// Where the replaced span of the source video begins. Everything before it is kept as-is. - /// - /// - /// Whether the generated clip is anchored on the frame already at `start_frame_time`, so it opens on the footage it replaces. Set it to false to anchor on the end frame alone, in which case `is_end_frame_included` must be true.
- /// Default Value: true - /// - /// - /// Where the replaced span of the source video ends; must come after `start_frame_time`. Everything from here on is kept as-is. - /// - /// - /// Whether the generated clip is anchored on the frame at `end_frame_time`, so it lands on the footage that follows the span.
- /// Default Value: false - /// - /// - /// A natural-language prompt describing what the replaced span should show.
- /// Example: The camera pushes in as the dancer turns towards the light. - /// - /// - /// The resolution tier the replaced span is generated at. The clip is then scaled to the source video's own frame, so this affects the detail generated rather than the edited video's dimensions. - /// - /// - /// The length of the generated video in seconds. When omitted, the model
- /// picks the best duration for the prompt ("auto").
- /// Example: 5 - /// - /// - /// Whether to generate an audio track for the video. Audio roughly
- /// doubles the provider cost and is subject to stricter output moderation.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output videos are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostEditVideoSeedDance2Async( - global::Ideogram.AssetIdentifier videoAssetIdentifier, - float startFrameTime, - float endFrameTime, - string prompt, - bool? dryRun = default, - bool? isStartFrameIncluded = default, - bool? isEndFrameIncluded = default, - global::Ideogram.SeedDance2Resolution? resolution = default, - int? duration = default, - bool? generateAudio = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.EditVideoSeedDance2Request - { - VideoAssetIdentifier = videoAssetIdentifier, - StartFrameTime = startFrameTime, - IsStartFrameIncluded = isStartFrameIncluded, - EndFrameTime = endFrameTime, - IsEndFrameIncluded = isEndFrameIncluded, - Prompt = prompt, - Resolution = resolution, - Duration = duration, - GenerateAudio = generateAudio, - WebhookUrl = webhookUrl, - Private = @private, - TargetCollectionId = targetCollectionId, - }; - - return await PostEditVideoSeedDance2Async( - dryRun: dryRun, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.VideoEditClient.VideoEditPostEditVideoMinimaxH3ReferenceToVideo.g.cs b/src/libs/Ideogram/Generated/Ideogram.VideoEditClient.VideoEditPostEditVideoMinimaxH3ReferenceToVideo.g.cs new file mode 100644 index 00000000..09243cf9 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.VideoEditClient.VideoEditPostEditVideoMinimaxH3ReferenceToVideo.g.cs @@ -0,0 +1,958 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class VideoEditClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_VideoEditPostEditVideoMinimaxH3ReferenceToVideoSecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_VideoEditPostEditVideoMinimaxH3ReferenceToVideoSecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_VideoEditPostEditVideoMinimaxH3ReferenceToVideoSecurityRequirement0, + }; + partial void PrepareVideoEditPostEditVideoMinimaxH3ReferenceToVideoArguments( + global::System.Net.Http.HttpClient httpClient, + ref bool? dryRun, + global::Ideogram.VideoEditPostEditVideoMinimaxH3ReferenceToVideoRequest request); + partial void PrepareVideoEditPostEditVideoMinimaxH3ReferenceToVideoRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + bool? dryRun, + global::Ideogram.VideoEditPostEditVideoMinimaxH3ReferenceToVideoRequest request); + partial void ProcessVideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessVideoEditPostEditVideoMinimaxH3ReferenceToVideoResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Reference to video with MiniMax H3
+ /// Produce a video from a text prompt and optional reference media with
+ /// MiniMax H3. Upload `reference_images` and `reference_audios` using
+ /// `multipart/form-data`, and address them in the prompt by position
+ /// (`Image 1`, `Audio 1`, …). Returns a `generation_id`; poll
+ /// `GET /v2/generations/{generation_id}` or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task VideoEditPostEditVideoMinimaxH3ReferenceToVideoAsync( + + global::Ideogram.VideoEditPostEditVideoMinimaxH3ReferenceToVideoRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await VideoEditPostEditVideoMinimaxH3ReferenceToVideoAsResponseAsync( + + request: request, + dryRun: dryRun, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Reference to video with MiniMax H3
+ /// Produce a video from a text prompt and optional reference media with
+ /// MiniMax H3. Upload `reference_images` and `reference_audios` using
+ /// `multipart/form-data`, and address them in the prompt by position
+ /// (`Image 1`, `Audio 1`, …). Returns a `generation_id`; poll
+ /// `GET /v2/generations/{generation_id}` or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> VideoEditPostEditVideoMinimaxH3ReferenceToVideoAsResponseAsync( + + global::Ideogram.VideoEditPostEditVideoMinimaxH3ReferenceToVideoRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareVideoEditPostEditVideoMinimaxH3ReferenceToVideoArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_VideoEditPostEditVideoMinimaxH3ReferenceToVideoSecurityRequirements, + operationName: "VideoEditPostEditVideoMinimaxH3ReferenceToVideoAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/video/generate/minimax-h3-reference-to-video", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + if (request.ReferenceImages != default) + { + + for (var __iReferenceImages = 0; __iReferenceImages < request.ReferenceImages.Count; __iReferenceImages++) + { + var __contentReferenceImages = new global::System.Net.Http.ByteArrayContent(request.ReferenceImages[__iReferenceImages]); + __contentReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); + __httpRequestContent.Add( + content: __contentReferenceImages, + name: "\"reference_images\"", + fileName: $"\"file{__iReferenceImages}.bin\""); + if (__contentReferenceImages.Headers.ContentDisposition != null) + { + __contentReferenceImages.Headers.ContentDisposition.FileNameStar = null; + } + } + + } + if (request.ReferenceAudios != default) + { + + for (var __iReferenceAudios = 0; __iReferenceAudios < request.ReferenceAudios.Count; __iReferenceAudios++) + { + var __contentReferenceAudios = new global::System.Net.Http.ByteArrayContent(request.ReferenceAudios[__iReferenceAudios]); + __contentReferenceAudios.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); + __httpRequestContent.Add( + content: __contentReferenceAudios, + name: "\"reference_audios\"", + fileName: $"\"file{__iReferenceAudios}.bin\""); + if (__contentReferenceAudios.Headers.ContentDisposition != null) + { + __contentReferenceAudios.Headers.ContentDisposition.FileNameStar = null; + } + } + + } + if (request.AspectRatio != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.AspectRatio).HasValue ? (request.AspectRatio).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"aspect_ratio\""); + + } + if (request.Resolution != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"resolution\""); + + } + if (request.Duration != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Duration, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"duration\""); + + } + if (request.PromptExpansionMode != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.PromptExpansionMode).HasValue ? (request.PromptExpansionMode).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"prompt_expansion_mode\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareVideoEditPostEditVideoMinimaxH3ReferenceToVideoRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoEditPostEditVideoMinimaxH3ReferenceToVideo", + methodName: "VideoEditPostEditVideoMinimaxH3ReferenceToVideoAsync", + pathTemplate: "\"/v2/video/generate/minimax-h3-reference-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoEditPostEditVideoMinimaxH3ReferenceToVideo", + methodName: "VideoEditPostEditVideoMinimaxH3ReferenceToVideoAsync", + pathTemplate: "\"/v2/video/generate/minimax-h3-reference-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoEditPostEditVideoMinimaxH3ReferenceToVideo", + methodName: "VideoEditPostEditVideoMinimaxH3ReferenceToVideoAsync", + pathTemplate: "\"/v2/video/generate/minimax-h3-reference-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessVideoEditPostEditVideoMinimaxH3ReferenceToVideoResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoEditPostEditVideoMinimaxH3ReferenceToVideo", + methodName: "VideoEditPostEditVideoMinimaxH3ReferenceToVideoAsync", + pathTemplate: "\"/v2/video/generate/minimax-h3-reference-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoEditPostEditVideoMinimaxH3ReferenceToVideo", + methodName: "VideoEditPostEditVideoMinimaxH3ReferenceToVideoAsync", + pathTemplate: "\"/v2/video/generate/minimax-h3-reference-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // This account does not have access to this model. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // A referenced asset was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessVideoEditPostEditVideoMinimaxH3ReferenceToVideoResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.GenerateVideoMinimaxH3Response.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.GenerateVideoMinimaxH3Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Reference to video with MiniMax H3
+ /// Produce a video from a text prompt and optional reference media with
+ /// MiniMax H3. Upload `reference_images` and `reference_audios` using
+ /// `multipart/form-data`, and address them in the prompt by position
+ /// (`Image 1`, `Audio 1`, …). Returns a `generation_id`; poll
+ /// `GET /v2/generations/{generation_id}` or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// A natural-language prompt describing the video to produce. Reference media is addressed by position, as in "Image 1 walks toward the camera with the motion of Video 1". + /// + /// + /// Images to use as references (max size 50MB each), as raw bytes, in prompt order; only common image formats such as JPEG, PNG, and WEBP are supported. Uploaded images are used for this request only and are not stored. + /// + /// + /// MP3 or WAV audio references, in prompt order as Audio 1, Audio 2, and Audio 3. Multipart uploads only; up to 15 MB per file and 2–15 seconds each. Audio and video references must total no more than 15 seconds. Requires a reference image or video. At most 12 references across images, videos, and audio. Used only for this request and not saved as assets. + /// + /// + /// The aspect ratio of the generated video.
+ /// Default Value: 16x9 + /// + /// + /// The resolution tier of the generated video, spelled the way MiniMax
+ /// spells it. `480P` and `768P` are generated natively; `2K` and `4K` are
+ /// upscaled from a `768P` result.
+ /// Higher tiers cost more.
+ /// Default Value: 2K + /// + /// + /// The length of the generated video in seconds.
+ /// Default Value: 5 + /// + /// + /// How much the model may rewrite the prompt before generating. `disabled`
+ /// uses the prompt as written; the other modes trade latency for a richer
+ /// rewrite.
+ /// Default Value: balanced + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task VideoEditPostEditVideoMinimaxH3ReferenceToVideoAsync( + string prompt, + bool? dryRun = default, + global::System.Collections.Generic.IList? referenceImages = default, + global::System.Collections.Generic.IList? referenceAudios = default, + global::Ideogram.MinimaxH3AspectRatio? aspectRatio = default, + global::Ideogram.MinimaxH3Resolution? resolution = default, + int? duration = default, + global::Ideogram.MinimaxH3PromptExpansionMode? promptExpansionMode = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Ideogram.VideoEditPostEditVideoMinimaxH3ReferenceToVideoRequest + { + Prompt = prompt, + ReferenceImages = referenceImages, + ReferenceAudios = referenceAudios, + AspectRatio = aspectRatio, + Resolution = resolution, + Duration = duration, + PromptExpansionMode = promptExpansionMode, + WebhookUrl = webhookUrl, + }; + + return await VideoEditPostEditVideoMinimaxH3ReferenceToVideoAsync( + dryRun: dryRun, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.VideoGenerate.JsonSerializerContext.g.cs b/src/libs/Ideogram/Generated/Ideogram.VideoGenerate.JsonSerializerContext.g.cs index 7364c20b..5a622a8f 100644 --- a/src/libs/Ideogram/Generated/Ideogram.VideoGenerate.JsonSerializerContext.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.VideoGenerate.JsonSerializerContext.g.cs @@ -14,62 +14,49 @@ namespace Ideogram [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(byte[]))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(float))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AssetIdentifier))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateVideoSeedDance2Response))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateVideoSeedDance2TextToVideoRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SeedDance2AspectRatio), TypeInfoPropertyName = "SeedDance2AspectRatio2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SeedDance2Resolution), TypeInfoPropertyName = "SeedDance2Resolution2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationErrorResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationRejectReason), TypeInfoPropertyName = "GenerationRejectReason2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed), TypeInfoPropertyName = "GenerationErrorResponseTaskCompletionSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateVideoSeedDance2ImageToVideoRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateVideoSeedDance25Response))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateVideoSeedDance25TextToVideoRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SeedDance25Resolution), TypeInfoPropertyName = "SeedDance25Resolution2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateVideoSeedDance25ImageToVideoRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateVideoMinimaxH3TextToVideoRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MinimaxH3AspectRatio), TypeInfoPropertyName = "MinimaxH3AspectRatio2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MinimaxH3Resolution), TypeInfoPropertyName = "MinimaxH3Resolution2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateVideoMinimaxH3Response))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateVideoMinimaxH3ImageToVideoRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationErrorResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.KlingV3ShotType), TypeInfoPropertyName = "KlingV3ShotType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateVideoKlingV3Response))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateVideoKlingV3StandardTextToVideoRequest))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.KlingV3AspectRatio), TypeInfoPropertyName = "KlingV3AspectRatio2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.KlingV3ShotType), TypeInfoPropertyName = "KlingV3ShotType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateVideoKlingV3StandardImageToVideoRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateVideoSeedDance2ReferenceToVideoRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateVideoSeedDance25ReferenceToVideoRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.Product360VideoRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.Product360VideoDirection), TypeInfoPropertyName = "Product360VideoDirection2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LivingImageResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LivingImageRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LivingImageQuality), TypeInfoPropertyName = "LivingImageQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AssetType), TypeInfoPropertyName = "AssetType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateVideoKlingV3StandardTextToVideoRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MinimaxH3Resolution), TypeInfoPropertyName = "MinimaxH3Resolution2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateVideoMinimaxH3Response))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MinimaxH3AspectRatio), TypeInfoPropertyName = "MinimaxH3AspectRatio2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateVideoMinimaxH3TextToVideoRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SeedDance25Resolution), TypeInfoPropertyName = "SeedDance25Resolution2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateVideoSeedDance25Response))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SeedDance2AspectRatio), TypeInfoPropertyName = "SeedDance2AspectRatio2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateVideoSeedDance25TextToVideoRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SeedDance2Resolution), TypeInfoPropertyName = "SeedDance2Resolution2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateVideoSeedDance2Response))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerateVideoSeedDance2TextToVideoRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(byte[]))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoRequest))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(float?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SeedDance2AspectRatio?), TypeInfoPropertyName = "NullableSeedDance2AspectRatio2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SeedDance2Resolution?), TypeInfoPropertyName = "NullableSeedDance2Resolution2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationRejectReason?), TypeInfoPropertyName = "NullableGenerationRejectReason2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?), TypeInfoPropertyName = "NullableGenerationErrorResponseTaskCompletionSpeed2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SeedDance25Resolution?), TypeInfoPropertyName = "NullableSeedDance25Resolution2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MinimaxH3AspectRatio?), TypeInfoPropertyName = "NullableMinimaxH3AspectRatio2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MinimaxH3Resolution?), TypeInfoPropertyName = "NullableMinimaxH3Resolution2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.KlingV3AspectRatio?), TypeInfoPropertyName = "NullableKlingV3AspectRatio2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime?))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.KlingV3ShotType?), TypeInfoPropertyName = "NullableKlingV3ShotType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.Product360VideoDirection?), TypeInfoPropertyName = "NullableProduct360VideoDirection2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LivingImageQuality?), TypeInfoPropertyName = "NullableLivingImageQuality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AssetType?), TypeInfoPropertyName = "NullableAssetType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.KlingV3AspectRatio?), TypeInfoPropertyName = "NullableKlingV3AspectRatio2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MinimaxH3Resolution?), TypeInfoPropertyName = "NullableMinimaxH3Resolution2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.MinimaxH3AspectRatio?), TypeInfoPropertyName = "NullableMinimaxH3AspectRatio2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SeedDance25Resolution?), TypeInfoPropertyName = "NullableSeedDance25Resolution2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SeedDance2AspectRatio?), TypeInfoPropertyName = "NullableSeedDance2AspectRatio2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.SeedDance2Resolution?), TypeInfoPropertyName = "NullableSeedDance2Resolution2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] internal sealed partial class VideoGenerateSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext { } @@ -139,69 +126,47 @@ private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Ser public override bool CanConvert(global::System.Type typeToConvert) { return - typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed) - - || typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?) - - || typeToConvert == typeof(global::Ideogram.GenerationRejectReason) + typeToConvert == typeof(global::Ideogram.GenerationRejectReason) || typeToConvert == typeof(global::Ideogram.GenerationRejectReason?) - || typeToConvert == typeof(global::Ideogram.SeedDance25Resolution) - - || typeToConvert == typeof(global::Ideogram.SeedDance25Resolution?) - - || typeToConvert == typeof(global::Ideogram.Product360VideoDirection) - - || typeToConvert == typeof(global::Ideogram.Product360VideoDirection?) - - || typeToConvert == typeof(global::Ideogram.LivingImageQuality) + || typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed) - || typeToConvert == typeof(global::Ideogram.LivingImageQuality?) + || typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?) - || typeToConvert == typeof(global::Ideogram.AssetType) + || typeToConvert == typeof(global::Ideogram.KlingV3ShotType) - || typeToConvert == typeof(global::Ideogram.AssetType?) + || typeToConvert == typeof(global::Ideogram.KlingV3ShotType?) - || typeToConvert == typeof(global::Ideogram.SeedDance2AspectRatio) + || typeToConvert == typeof(global::Ideogram.KlingV3AspectRatio) - || typeToConvert == typeof(global::Ideogram.SeedDance2AspectRatio?) + || typeToConvert == typeof(global::Ideogram.KlingV3AspectRatio?) - || typeToConvert == typeof(global::Ideogram.SeedDance2Resolution) + || typeToConvert == typeof(global::Ideogram.MinimaxH3Resolution) - || typeToConvert == typeof(global::Ideogram.SeedDance2Resolution?) + || typeToConvert == typeof(global::Ideogram.MinimaxH3Resolution?) || typeToConvert == typeof(global::Ideogram.MinimaxH3AspectRatio) || typeToConvert == typeof(global::Ideogram.MinimaxH3AspectRatio?) - || typeToConvert == typeof(global::Ideogram.MinimaxH3Resolution) + || typeToConvert == typeof(global::Ideogram.SeedDance25Resolution) - || typeToConvert == typeof(global::Ideogram.MinimaxH3Resolution?) + || typeToConvert == typeof(global::Ideogram.SeedDance25Resolution?) - || typeToConvert == typeof(global::Ideogram.KlingV3AspectRatio) + || typeToConvert == typeof(global::Ideogram.SeedDance2AspectRatio) - || typeToConvert == typeof(global::Ideogram.KlingV3AspectRatio?) + || typeToConvert == typeof(global::Ideogram.SeedDance2AspectRatio?) - || typeToConvert == typeof(global::Ideogram.KlingV3ShotType) + || typeToConvert == typeof(global::Ideogram.SeedDance2Resolution) - || typeToConvert == typeof(global::Ideogram.KlingV3ShotType?); + || typeToConvert == typeof(global::Ideogram.SeedDance2Resolution?); } public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) { - if (typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed)) - { - return new global::Ideogram.JsonConverters.GenerationErrorResponseTaskCompletionSpeedJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?)) - { - return new global::Ideogram.JsonConverters.GenerationErrorResponseTaskCompletionSpeedNullableJsonConverter(); - } - if (typeToConvert == typeof(global::Ideogram.GenerationRejectReason)) { return new global::Ideogram.JsonConverters.GenerationRejectReasonJsonConverter(); @@ -212,64 +177,44 @@ public override bool CanConvert(global::System.Type typeToConvert) return new global::Ideogram.JsonConverters.GenerationRejectReasonNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.SeedDance25Resolution)) - { - return new global::Ideogram.JsonConverters.SeedDance25ResolutionJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.SeedDance25Resolution?)) - { - return new global::Ideogram.JsonConverters.SeedDance25ResolutionNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.Product360VideoDirection)) - { - return new global::Ideogram.JsonConverters.Product360VideoDirectionJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.Product360VideoDirection?)) - { - return new global::Ideogram.JsonConverters.Product360VideoDirectionNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.LivingImageQuality)) + if (typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed)) { - return new global::Ideogram.JsonConverters.LivingImageQualityJsonConverter(); + return new global::Ideogram.JsonConverters.GenerationErrorResponseTaskCompletionSpeedJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.LivingImageQuality?)) + if (typeToConvert == typeof(global::Ideogram.GenerationErrorResponseTaskCompletionSpeed?)) { - return new global::Ideogram.JsonConverters.LivingImageQualityNullableJsonConverter(); + return new global::Ideogram.JsonConverters.GenerationErrorResponseTaskCompletionSpeedNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.AssetType)) + if (typeToConvert == typeof(global::Ideogram.KlingV3ShotType)) { - return new global::Ideogram.JsonConverters.AssetTypeJsonConverter(); + return new global::Ideogram.JsonConverters.KlingV3ShotTypeJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.AssetType?)) + if (typeToConvert == typeof(global::Ideogram.KlingV3ShotType?)) { - return new global::Ideogram.JsonConverters.AssetTypeNullableJsonConverter(); + return new global::Ideogram.JsonConverters.KlingV3ShotTypeNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.SeedDance2AspectRatio)) + if (typeToConvert == typeof(global::Ideogram.KlingV3AspectRatio)) { - return new global::Ideogram.JsonConverters.SeedDance2AspectRatioJsonConverter(); + return new global::Ideogram.JsonConverters.KlingV3AspectRatioJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.SeedDance2AspectRatio?)) + if (typeToConvert == typeof(global::Ideogram.KlingV3AspectRatio?)) { - return new global::Ideogram.JsonConverters.SeedDance2AspectRatioNullableJsonConverter(); + return new global::Ideogram.JsonConverters.KlingV3AspectRatioNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.SeedDance2Resolution)) + if (typeToConvert == typeof(global::Ideogram.MinimaxH3Resolution)) { - return new global::Ideogram.JsonConverters.SeedDance2ResolutionJsonConverter(); + return new global::Ideogram.JsonConverters.MinimaxH3ResolutionJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.SeedDance2Resolution?)) + if (typeToConvert == typeof(global::Ideogram.MinimaxH3Resolution?)) { - return new global::Ideogram.JsonConverters.SeedDance2ResolutionNullableJsonConverter(); + return new global::Ideogram.JsonConverters.MinimaxH3ResolutionNullableJsonConverter(); } if (typeToConvert == typeof(global::Ideogram.MinimaxH3AspectRatio)) @@ -282,34 +227,34 @@ public override bool CanConvert(global::System.Type typeToConvert) return new global::Ideogram.JsonConverters.MinimaxH3AspectRatioNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.MinimaxH3Resolution)) + if (typeToConvert == typeof(global::Ideogram.SeedDance25Resolution)) { - return new global::Ideogram.JsonConverters.MinimaxH3ResolutionJsonConverter(); + return new global::Ideogram.JsonConverters.SeedDance25ResolutionJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.MinimaxH3Resolution?)) + if (typeToConvert == typeof(global::Ideogram.SeedDance25Resolution?)) { - return new global::Ideogram.JsonConverters.MinimaxH3ResolutionNullableJsonConverter(); + return new global::Ideogram.JsonConverters.SeedDance25ResolutionNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.KlingV3AspectRatio)) + if (typeToConvert == typeof(global::Ideogram.SeedDance2AspectRatio)) { - return new global::Ideogram.JsonConverters.KlingV3AspectRatioJsonConverter(); + return new global::Ideogram.JsonConverters.SeedDance2AspectRatioJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.KlingV3AspectRatio?)) + if (typeToConvert == typeof(global::Ideogram.SeedDance2AspectRatio?)) { - return new global::Ideogram.JsonConverters.KlingV3AspectRatioNullableJsonConverter(); + return new global::Ideogram.JsonConverters.SeedDance2AspectRatioNullableJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.KlingV3ShotType)) + if (typeToConvert == typeof(global::Ideogram.SeedDance2Resolution)) { - return new global::Ideogram.JsonConverters.KlingV3ShotTypeJsonConverter(); + return new global::Ideogram.JsonConverters.SeedDance2ResolutionJsonConverter(); } - if (typeToConvert == typeof(global::Ideogram.KlingV3ShotType?)) + if (typeToConvert == typeof(global::Ideogram.SeedDance2Resolution?)) { - return new global::Ideogram.JsonConverters.KlingV3ShotTypeNullableJsonConverter(); + return new global::Ideogram.JsonConverters.SeedDance2ResolutionNullableJsonConverter(); } throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); } diff --git a/src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.PostGenerateVideoKlingV3StandardImageToVideo.g.cs b/src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.PostGenerateVideoKlingV3StandardImageToVideo.g.cs deleted file mode 100644 index 8715df99..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.PostGenerateVideoKlingV3StandardImageToVideo.g.cs +++ /dev/null @@ -1,1047 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class VideoGenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostGenerateVideoKlingV3StandardImageToVideoSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostGenerateVideoKlingV3StandardImageToVideoSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostGenerateVideoKlingV3StandardImageToVideoSecurityRequirement0, - }; - partial void PreparePostGenerateVideoKlingV3StandardImageToVideoArguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? dryRun, - global::Ideogram.GenerateVideoKlingV3StandardImageToVideoRequest request); - partial void PreparePostGenerateVideoKlingV3StandardImageToVideoRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? dryRun, - global::Ideogram.GenerateVideoKlingV3StandardImageToVideoRequest request); - partial void ProcessPostGenerateVideoKlingV3StandardImageToVideoResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostGenerateVideoKlingV3StandardImageToVideoResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Image to video with Kling v3 Standard
- /// Generate a video from a first-frame image and a text prompt with Kling
- /// v3 Standard. Upload the first frame as `image`, and optionally a final
- /// frame as `end_image`, using `multipart/form-data`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateVideoKlingV3StandardImageToVideoAsync( - - global::Ideogram.GenerateVideoKlingV3StandardImageToVideoRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostGenerateVideoKlingV3StandardImageToVideoAsResponseAsync( - - request: request, - dryRun: dryRun, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Image to video with Kling v3 Standard
- /// Generate a video from a first-frame image and a text prompt with Kling
- /// v3 Standard. Upload the first frame as `image`, and optionally a final
- /// frame as `end_image`, using `multipart/form-data`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostGenerateVideoKlingV3StandardImageToVideoAsResponseAsync( - - global::Ideogram.GenerateVideoKlingV3StandardImageToVideoRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostGenerateVideoKlingV3StandardImageToVideoArguments( - httpClient: HttpClient, - dryRun: ref dryRun, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostGenerateVideoKlingV3StandardImageToVideoSecurityRequirements, - operationName: "PostGenerateVideoKlingV3StandardImageToVideoAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/video/generate/kling-3-standard-image-to-video", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (request.ImageAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ImageAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"image_asset_identifier\""); - - } - if (request.Image != default) - { - - var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.EndImageAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.EndImageAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"end_image_asset_identifier\""); - - } - if (request.EndImage != default) - { - - var __contentEndImage = new global::System.Net.Http.ByteArrayContent(request.EndImage ?? global::System.Array.Empty()); - __contentEndImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.EndImagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.EndImagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentEndImage, - name: "\"end_image\"", - fileName: request.EndImagename != null ? $"\"{request.EndImagename}\"" : string.Empty); - if (__contentEndImage.Headers.ContentDisposition != null) - { - __contentEndImage.Headers.ContentDisposition.FileNameStar = null; - } - - } - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - if (request.NegativePrompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.NegativePrompt ?? string.Empty), - name: "\"negative_prompt\""); - - } - if (request.Duration != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Duration, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"duration\""); - - } - if (request.GenerateAudio != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.GenerateAudio, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"generate_audio\""); - - } - if (request.ShotType != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.ShotType).HasValue ? (request.ShotType).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"shot_type\""); - - } - if (request.CfgScale != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.CfgScale, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"cfg_scale\""); - - } - if (request.WebhookUrl != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), - name: "\"webhook_url\""); - - } - if (request.Private != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"private\""); - - } - if (request.TargetCollectionId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.TargetCollectionId ?? string.Empty), - name: "\"target_collection_id\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostGenerateVideoKlingV3StandardImageToVideoRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - dryRun: dryRun, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateVideoKlingV3StandardImageToVideo", - methodName: "PostGenerateVideoKlingV3StandardImageToVideoAsync", - pathTemplate: "\"/v2/video/generate/kling-3-standard-image-to-video\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateVideoKlingV3StandardImageToVideo", - methodName: "PostGenerateVideoKlingV3StandardImageToVideoAsync", - pathTemplate: "\"/v2/video/generate/kling-3-standard-image-to-video\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateVideoKlingV3StandardImageToVideo", - methodName: "PostGenerateVideoKlingV3StandardImageToVideoAsync", - pathTemplate: "\"/v2/video/generate/kling-3-standard-image-to-video\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostGenerateVideoKlingV3StandardImageToVideoResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateVideoKlingV3StandardImageToVideo", - methodName: "PostGenerateVideoKlingV3StandardImageToVideoAsync", - pathTemplate: "\"/v2/video/generate/kling-3-standard-image-to-video\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateVideoKlingV3StandardImageToVideo", - methodName: "PostGenerateVideoKlingV3StandardImageToVideoAsync", - pathTemplate: "\"/v2/video/generate/kling-3-standard-image-to-video\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 500) - { - string? __content_500 = null; - global::System.Exception? __exception_500 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_500 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_500, - responseBody: __content_500, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostGenerateVideoKlingV3StandardImageToVideoResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.GenerateVideoKlingV3Response.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.GenerateVideoKlingV3Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Image to video with Kling v3 Standard
- /// Generate a video from a first-frame image and a text prompt with Kling
- /// v3 Standard. Upload the first frame as `image`, and optionally a final
- /// frame as `end_image`, using `multipart/form-data`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// A reference to an image already stored with Ideogram to use as the first frame, in place of uploading `image`. Only image assets are accepted. - /// - /// - /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - /// - /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - /// - /// An optional final frame, as a reference to an image already stored with Ideogram. When supplied, the generated video transitions from the first frame to this one. Only image assets are accepted. - /// - /// - /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. - /// - /// - /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. - /// - /// - /// A natural-language prompt describing how the first frame should animate.
- /// Example: The camera slowly pans right as the waves roll in. - /// - /// - /// Description of what to keep out of the video. Descriptions in the prompt take precedence over descriptions in the negative prompt. - /// - /// - /// The length of the generated video in seconds. Defaults to 5 seconds
- /// when omitted.
- /// Example: 5 - /// - /// - /// Whether to generate an audio track for the video. Audio roughly
- /// doubles the provider cost and is subject to stricter output moderation.
- /// Default Value: false - /// - /// - /// How the prompt is staged. `customize` follows the prompt as written;
- /// `intelligent` lets the model break the prompt into its own shots.
- /// Default Value: customize - /// - /// - /// How closely the video follows the prompt, from 0 to 1. Lower values
- /// leave the model more freedom. Defaults to 0.5 when omitted.
- /// Example: 0.5F - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output videos are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateVideoKlingV3StandardImageToVideoAsync( - string prompt, - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - global::Ideogram.AssetIdentifier? endImageAssetIdentifier = default, - byte[]? endImage = default, - string? endImagename = default, - string? negativePrompt = default, - int? duration = default, - bool? generateAudio = default, - global::Ideogram.KlingV3ShotType? shotType = default, - float? cfgScale = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.GenerateVideoKlingV3StandardImageToVideoRequest - { - ImageAssetIdentifier = imageAssetIdentifier, - Image = image, - Imagename = imagename, - EndImageAssetIdentifier = endImageAssetIdentifier, - EndImage = endImage, - EndImagename = endImagename, - Prompt = prompt, - NegativePrompt = negativePrompt, - Duration = duration, - GenerateAudio = generateAudio, - ShotType = shotType, - CfgScale = cfgScale, - WebhookUrl = webhookUrl, - Private = @private, - TargetCollectionId = targetCollectionId, - }; - - return await PostGenerateVideoKlingV3StandardImageToVideoAsync( - dryRun: dryRun, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.PostGenerateVideoKlingV3StandardTextToVideo.g.cs b/src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.PostGenerateVideoKlingV3StandardTextToVideo.g.cs deleted file mode 100644 index ba19d1a4..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.PostGenerateVideoKlingV3StandardTextToVideo.g.cs +++ /dev/null @@ -1,818 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class VideoGenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostGenerateVideoKlingV3StandardTextToVideoSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostGenerateVideoKlingV3StandardTextToVideoSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostGenerateVideoKlingV3StandardTextToVideoSecurityRequirement0, - }; - partial void PreparePostGenerateVideoKlingV3StandardTextToVideoArguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? dryRun, - global::Ideogram.GenerateVideoKlingV3StandardTextToVideoRequest request); - partial void PreparePostGenerateVideoKlingV3StandardTextToVideoRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? dryRun, - global::Ideogram.GenerateVideoKlingV3StandardTextToVideoRequest request); - partial void ProcessPostGenerateVideoKlingV3StandardTextToVideoResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostGenerateVideoKlingV3StandardTextToVideoResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Text to video with Kling v3 Standard
- /// Generate a video from a text prompt with Kling v3 Standard.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateVideoKlingV3StandardTextToVideoAsync( - - global::Ideogram.GenerateVideoKlingV3StandardTextToVideoRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostGenerateVideoKlingV3StandardTextToVideoAsResponseAsync( - - request: request, - dryRun: dryRun, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Text to video with Kling v3 Standard
- /// Generate a video from a text prompt with Kling v3 Standard.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostGenerateVideoKlingV3StandardTextToVideoAsResponseAsync( - - global::Ideogram.GenerateVideoKlingV3StandardTextToVideoRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostGenerateVideoKlingV3StandardTextToVideoArguments( - httpClient: HttpClient, - dryRun: ref dryRun, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostGenerateVideoKlingV3StandardTextToVideoSecurityRequirements, - operationName: "PostGenerateVideoKlingV3StandardTextToVideoAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/video/generate/kling-3-standard-text-to-video", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostGenerateVideoKlingV3StandardTextToVideoRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - dryRun: dryRun, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateVideoKlingV3StandardTextToVideo", - methodName: "PostGenerateVideoKlingV3StandardTextToVideoAsync", - pathTemplate: "\"/v2/video/generate/kling-3-standard-text-to-video\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateVideoKlingV3StandardTextToVideo", - methodName: "PostGenerateVideoKlingV3StandardTextToVideoAsync", - pathTemplate: "\"/v2/video/generate/kling-3-standard-text-to-video\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateVideoKlingV3StandardTextToVideo", - methodName: "PostGenerateVideoKlingV3StandardTextToVideoAsync", - pathTemplate: "\"/v2/video/generate/kling-3-standard-text-to-video\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostGenerateVideoKlingV3StandardTextToVideoResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateVideoKlingV3StandardTextToVideo", - methodName: "PostGenerateVideoKlingV3StandardTextToVideoAsync", - pathTemplate: "\"/v2/video/generate/kling-3-standard-text-to-video\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateVideoKlingV3StandardTextToVideo", - methodName: "PostGenerateVideoKlingV3StandardTextToVideoAsync", - pathTemplate: "\"/v2/video/generate/kling-3-standard-text-to-video\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 500) - { - string? __content_500 = null; - global::System.Exception? __exception_500 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_500 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_500, - responseBody: __content_500, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostGenerateVideoKlingV3StandardTextToVideoResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.GenerateVideoKlingV3Response.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.GenerateVideoKlingV3Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Text to video with Kling v3 Standard
- /// Generate a video from a text prompt with Kling v3 Standard.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// A natural-language prompt describing the video to generate.
- /// Example: A red fox running through a snowy forest at dawn. - /// - /// - /// Description of what to keep out of the video. Descriptions in the prompt take precedence over descriptions in the negative prompt. - /// - /// - /// The aspect ratio of the generated video.
- /// Default Value: 16x9 - /// - /// - /// The length of the generated video in seconds. Defaults to 5 seconds
- /// when omitted.
- /// Example: 5 - /// - /// - /// Whether to generate an audio track for the video. Audio roughly
- /// doubles the provider cost and is subject to stricter output moderation.
- /// Default Value: false - /// - /// - /// How the prompt is staged. `customize` follows the prompt as written;
- /// `intelligent` lets the model break the prompt into its own shots.
- /// Default Value: customize - /// - /// - /// How closely the video follows the prompt, from 0 to 1. Lower values
- /// leave the model more freedom. Defaults to 0.5 when omitted.
- /// Example: 0.5F - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output videos are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateVideoKlingV3StandardTextToVideoAsync( - string prompt, - bool? dryRun = default, - string? negativePrompt = default, - global::Ideogram.KlingV3AspectRatio? aspectRatio = default, - int? duration = default, - bool? generateAudio = default, - global::Ideogram.KlingV3ShotType? shotType = default, - float? cfgScale = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.GenerateVideoKlingV3StandardTextToVideoRequest - { - Prompt = prompt, - NegativePrompt = negativePrompt, - AspectRatio = aspectRatio, - Duration = duration, - GenerateAudio = generateAudio, - ShotType = shotType, - CfgScale = cfgScale, - WebhookUrl = webhookUrl, - Private = @private, - TargetCollectionId = targetCollectionId, - }; - - return await PostGenerateVideoKlingV3StandardTextToVideoAsync( - dryRun: dryRun, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.PostGenerateVideoMinimaxH3ImageToVideo.g.cs b/src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.PostGenerateVideoMinimaxH3ImageToVideo.g.cs deleted file mode 100644 index 094a3321..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.PostGenerateVideoMinimaxH3ImageToVideo.g.cs +++ /dev/null @@ -1,1006 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class VideoGenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostGenerateVideoMinimaxH3ImageToVideoSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostGenerateVideoMinimaxH3ImageToVideoSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostGenerateVideoMinimaxH3ImageToVideoSecurityRequirement0, - }; - partial void PreparePostGenerateVideoMinimaxH3ImageToVideoArguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? dryRun, - global::Ideogram.GenerateVideoMinimaxH3ImageToVideoRequest request); - partial void PreparePostGenerateVideoMinimaxH3ImageToVideoRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? dryRun, - global::Ideogram.GenerateVideoMinimaxH3ImageToVideoRequest request); - partial void ProcessPostGenerateVideoMinimaxH3ImageToVideoResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostGenerateVideoMinimaxH3ImageToVideoResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Image to video with MiniMax H3
- /// Generate a video from a first-frame image and a text prompt with
- /// MiniMax H3. Upload the first frame as `image`, and optionally a final
- /// frame as `end_image`, using `multipart/form-data`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateVideoMinimaxH3ImageToVideoAsync( - - global::Ideogram.GenerateVideoMinimaxH3ImageToVideoRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostGenerateVideoMinimaxH3ImageToVideoAsResponseAsync( - - request: request, - dryRun: dryRun, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Image to video with MiniMax H3
- /// Generate a video from a first-frame image and a text prompt with
- /// MiniMax H3. Upload the first frame as `image`, and optionally a final
- /// frame as `end_image`, using `multipart/form-data`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostGenerateVideoMinimaxH3ImageToVideoAsResponseAsync( - - global::Ideogram.GenerateVideoMinimaxH3ImageToVideoRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostGenerateVideoMinimaxH3ImageToVideoArguments( - httpClient: HttpClient, - dryRun: ref dryRun, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostGenerateVideoMinimaxH3ImageToVideoSecurityRequirements, - operationName: "PostGenerateVideoMinimaxH3ImageToVideoAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/video/generate/minimax-h3-image-to-video", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (request.ImageAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ImageAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"image_asset_identifier\""); - - } - if (request.Image != default) - { - - var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.EndImageAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.EndImageAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"end_image_asset_identifier\""); - - } - if (request.EndImage != default) - { - - var __contentEndImage = new global::System.Net.Http.ByteArrayContent(request.EndImage ?? global::System.Array.Empty()); - __contentEndImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.EndImagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.EndImagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentEndImage, - name: "\"end_image\"", - fileName: request.EndImagename != null ? $"\"{request.EndImagename}\"" : string.Empty); - if (__contentEndImage.Headers.ContentDisposition != null) - { - __contentEndImage.Headers.ContentDisposition.FileNameStar = null; - } - - } - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - if (request.Resolution != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"resolution\""); - - } - if (request.Duration != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Duration, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"duration\""); - - } - if (request.WebhookUrl != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), - name: "\"webhook_url\""); - - } - if (request.Private != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"private\""); - - } - if (request.TargetCollectionId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.TargetCollectionId ?? string.Empty), - name: "\"target_collection_id\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostGenerateVideoMinimaxH3ImageToVideoRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - dryRun: dryRun, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateVideoMinimaxH3ImageToVideo", - methodName: "PostGenerateVideoMinimaxH3ImageToVideoAsync", - pathTemplate: "\"/v2/video/generate/minimax-h3-image-to-video\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateVideoMinimaxH3ImageToVideo", - methodName: "PostGenerateVideoMinimaxH3ImageToVideoAsync", - pathTemplate: "\"/v2/video/generate/minimax-h3-image-to-video\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateVideoMinimaxH3ImageToVideo", - methodName: "PostGenerateVideoMinimaxH3ImageToVideoAsync", - pathTemplate: "\"/v2/video/generate/minimax-h3-image-to-video\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostGenerateVideoMinimaxH3ImageToVideoResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateVideoMinimaxH3ImageToVideo", - methodName: "PostGenerateVideoMinimaxH3ImageToVideoAsync", - pathTemplate: "\"/v2/video/generate/minimax-h3-image-to-video\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateVideoMinimaxH3ImageToVideo", - methodName: "PostGenerateVideoMinimaxH3ImageToVideoAsync", - pathTemplate: "\"/v2/video/generate/minimax-h3-image-to-video\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 500) - { - string? __content_500 = null; - global::System.Exception? __exception_500 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_500 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_500, - responseBody: __content_500, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostGenerateVideoMinimaxH3ImageToVideoResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.GenerateVideoMinimaxH3Response.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.GenerateVideoMinimaxH3Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Image to video with MiniMax H3
- /// Generate a video from a first-frame image and a text prompt with
- /// MiniMax H3. Upload the first frame as `image`, and optionally a final
- /// frame as `end_image`, using `multipart/form-data`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// A reference to an image already stored with Ideogram to use as the first frame, in place of uploading `image`. Only image assets are accepted. - /// - /// - /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - /// - /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - /// - /// An optional final frame, as a reference to an image already stored with Ideogram. When supplied, the generated video transitions from the first frame to this one. Only image assets are accepted. - /// - /// - /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. - /// - /// - /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. - /// - /// - /// A natural-language prompt describing how the first frame should animate.
- /// Example: The camera slowly pans right as the waves roll in. - /// - /// - /// The resolution tier of the generated video, spelled the way MiniMax
- /// spells it. `480P` and `768P` are generated natively; `2K` and `4K` are
- /// upscaled from a `768P` result.
- /// Higher tiers cost more.
- /// Default Value: 2K - /// - /// - /// The length of the generated video in seconds.
- /// Default Value: 5
- /// Example: 5 - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output video is added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateVideoMinimaxH3ImageToVideoAsync( - string prompt, - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - global::Ideogram.AssetIdentifier? endImageAssetIdentifier = default, - byte[]? endImage = default, - string? endImagename = default, - global::Ideogram.MinimaxH3Resolution? resolution = default, - int? duration = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.GenerateVideoMinimaxH3ImageToVideoRequest - { - ImageAssetIdentifier = imageAssetIdentifier, - Image = image, - Imagename = imagename, - EndImageAssetIdentifier = endImageAssetIdentifier, - EndImage = endImage, - EndImagename = endImagename, - Prompt = prompt, - Resolution = resolution, - Duration = duration, - WebhookUrl = webhookUrl, - Private = @private, - TargetCollectionId = targetCollectionId, - }; - - return await PostGenerateVideoMinimaxH3ImageToVideoAsync( - dryRun: dryRun, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.PostGenerateVideoMinimaxH3TextToVideo.g.cs b/src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.PostGenerateVideoMinimaxH3TextToVideo.g.cs deleted file mode 100644 index 1f61d146..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.PostGenerateVideoMinimaxH3TextToVideo.g.cs +++ /dev/null @@ -1,801 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class VideoGenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostGenerateVideoMinimaxH3TextToVideoSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostGenerateVideoMinimaxH3TextToVideoSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostGenerateVideoMinimaxH3TextToVideoSecurityRequirement0, - }; - partial void PreparePostGenerateVideoMinimaxH3TextToVideoArguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? dryRun, - global::Ideogram.GenerateVideoMinimaxH3TextToVideoRequest request); - partial void PreparePostGenerateVideoMinimaxH3TextToVideoRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? dryRun, - global::Ideogram.GenerateVideoMinimaxH3TextToVideoRequest request); - partial void ProcessPostGenerateVideoMinimaxH3TextToVideoResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostGenerateVideoMinimaxH3TextToVideoResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Text to video with MiniMax H3
- /// Generate a video from a text prompt with MiniMax H3.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateVideoMinimaxH3TextToVideoAsync( - - global::Ideogram.GenerateVideoMinimaxH3TextToVideoRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostGenerateVideoMinimaxH3TextToVideoAsResponseAsync( - - request: request, - dryRun: dryRun, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Text to video with MiniMax H3
- /// Generate a video from a text prompt with MiniMax H3.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostGenerateVideoMinimaxH3TextToVideoAsResponseAsync( - - global::Ideogram.GenerateVideoMinimaxH3TextToVideoRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostGenerateVideoMinimaxH3TextToVideoArguments( - httpClient: HttpClient, - dryRun: ref dryRun, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostGenerateVideoMinimaxH3TextToVideoSecurityRequirements, - operationName: "PostGenerateVideoMinimaxH3TextToVideoAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/video/generate/minimax-h3-text-to-video", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostGenerateVideoMinimaxH3TextToVideoRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - dryRun: dryRun, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateVideoMinimaxH3TextToVideo", - methodName: "PostGenerateVideoMinimaxH3TextToVideoAsync", - pathTemplate: "\"/v2/video/generate/minimax-h3-text-to-video\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateVideoMinimaxH3TextToVideo", - methodName: "PostGenerateVideoMinimaxH3TextToVideoAsync", - pathTemplate: "\"/v2/video/generate/minimax-h3-text-to-video\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateVideoMinimaxH3TextToVideo", - methodName: "PostGenerateVideoMinimaxH3TextToVideoAsync", - pathTemplate: "\"/v2/video/generate/minimax-h3-text-to-video\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostGenerateVideoMinimaxH3TextToVideoResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateVideoMinimaxH3TextToVideo", - methodName: "PostGenerateVideoMinimaxH3TextToVideoAsync", - pathTemplate: "\"/v2/video/generate/minimax-h3-text-to-video\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateVideoMinimaxH3TextToVideo", - methodName: "PostGenerateVideoMinimaxH3TextToVideoAsync", - pathTemplate: "\"/v2/video/generate/minimax-h3-text-to-video\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 500) - { - string? __content_500 = null; - global::System.Exception? __exception_500 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_500 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_500, - responseBody: __content_500, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostGenerateVideoMinimaxH3TextToVideoResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.GenerateVideoMinimaxH3Response.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.GenerateVideoMinimaxH3Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Text to video with MiniMax H3
- /// Generate a video from a text prompt with MiniMax H3.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// A natural-language prompt describing the video to generate.
- /// Example: A red fox running through a snowy forest at dawn. - /// - /// - /// The aspect ratio of the generated video.
- /// Default Value: 16x9 - /// - /// - /// The resolution tier of the generated video, spelled the way MiniMax
- /// spells it. `480P` and `768P` are generated natively; `2K` and `4K` are
- /// upscaled from a `768P` result.
- /// Higher tiers cost more.
- /// Default Value: 2K - /// - /// - /// The length of the generated video in seconds.
- /// Default Value: 5
- /// Example: 5 - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output video is added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateVideoMinimaxH3TextToVideoAsync( - string prompt, - bool? dryRun = default, - global::Ideogram.MinimaxH3AspectRatio? aspectRatio = default, - global::Ideogram.MinimaxH3Resolution? resolution = default, - int? duration = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.GenerateVideoMinimaxH3TextToVideoRequest - { - Prompt = prompt, - AspectRatio = aspectRatio, - Resolution = resolution, - Duration = duration, - WebhookUrl = webhookUrl, - Private = @private, - TargetCollectionId = targetCollectionId, - }; - - return await PostGenerateVideoMinimaxH3TextToVideoAsync( - dryRun: dryRun, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.PostGenerateVideoSeedDance25ImageToVideo.g.cs b/src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.PostGenerateVideoSeedDance25ImageToVideo.g.cs deleted file mode 100644 index 054268a0..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.PostGenerateVideoSeedDance25ImageToVideo.g.cs +++ /dev/null @@ -1,1018 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class VideoGenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostGenerateVideoSeedDance25ImageToVideoSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostGenerateVideoSeedDance25ImageToVideoSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostGenerateVideoSeedDance25ImageToVideoSecurityRequirement0, - }; - partial void PreparePostGenerateVideoSeedDance25ImageToVideoArguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? dryRun, - global::Ideogram.GenerateVideoSeedDance25ImageToVideoRequest request); - partial void PreparePostGenerateVideoSeedDance25ImageToVideoRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? dryRun, - global::Ideogram.GenerateVideoSeedDance25ImageToVideoRequest request); - partial void ProcessPostGenerateVideoSeedDance25ImageToVideoResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostGenerateVideoSeedDance25ImageToVideoResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Image to video with Seedance 2.5
- /// Generate a video from a first-frame image and a text prompt with
- /// Seedance 2.5. Upload the first frame as `image`, and optionally a final
- /// frame as `end_image`, using `multipart/form-data`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateVideoSeedDance25ImageToVideoAsync( - - global::Ideogram.GenerateVideoSeedDance25ImageToVideoRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostGenerateVideoSeedDance25ImageToVideoAsResponseAsync( - - request: request, - dryRun: dryRun, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Image to video with Seedance 2.5
- /// Generate a video from a first-frame image and a text prompt with
- /// Seedance 2.5. Upload the first frame as `image`, and optionally a final
- /// frame as `end_image`, using `multipart/form-data`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostGenerateVideoSeedDance25ImageToVideoAsResponseAsync( - - global::Ideogram.GenerateVideoSeedDance25ImageToVideoRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostGenerateVideoSeedDance25ImageToVideoArguments( - httpClient: HttpClient, - dryRun: ref dryRun, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostGenerateVideoSeedDance25ImageToVideoSecurityRequirements, - operationName: "PostGenerateVideoSeedDance25ImageToVideoAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/video/generate/seedance-2-5-image-to-video", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (request.ImageAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ImageAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"image_asset_identifier\""); - - } - if (request.Image != default) - { - - var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.EndImageAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.EndImageAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"end_image_asset_identifier\""); - - } - if (request.EndImage != default) - { - - var __contentEndImage = new global::System.Net.Http.ByteArrayContent(request.EndImage ?? global::System.Array.Empty()); - __contentEndImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.EndImagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.EndImagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentEndImage, - name: "\"end_image\"", - fileName: request.EndImagename != null ? $"\"{request.EndImagename}\"" : string.Empty); - if (__contentEndImage.Headers.ContentDisposition != null) - { - __contentEndImage.Headers.ContentDisposition.FileNameStar = null; - } - - } - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - if (request.Resolution != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"resolution\""); - - } - if (request.Duration != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Duration, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"duration\""); - - } - if (request.GenerateAudio != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.GenerateAudio, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"generate_audio\""); - - } - if (request.WebhookUrl != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), - name: "\"webhook_url\""); - - } - if (request.Private != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"private\""); - - } - if (request.TargetCollectionId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.TargetCollectionId ?? string.Empty), - name: "\"target_collection_id\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostGenerateVideoSeedDance25ImageToVideoRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - dryRun: dryRun, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateVideoSeedDance25ImageToVideo", - methodName: "PostGenerateVideoSeedDance25ImageToVideoAsync", - pathTemplate: "\"/v2/video/generate/seedance-2-5-image-to-video\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateVideoSeedDance25ImageToVideo", - methodName: "PostGenerateVideoSeedDance25ImageToVideoAsync", - pathTemplate: "\"/v2/video/generate/seedance-2-5-image-to-video\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateVideoSeedDance25ImageToVideo", - methodName: "PostGenerateVideoSeedDance25ImageToVideoAsync", - pathTemplate: "\"/v2/video/generate/seedance-2-5-image-to-video\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostGenerateVideoSeedDance25ImageToVideoResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateVideoSeedDance25ImageToVideo", - methodName: "PostGenerateVideoSeedDance25ImageToVideoAsync", - pathTemplate: "\"/v2/video/generate/seedance-2-5-image-to-video\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateVideoSeedDance25ImageToVideo", - methodName: "PostGenerateVideoSeedDance25ImageToVideoAsync", - pathTemplate: "\"/v2/video/generate/seedance-2-5-image-to-video\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 500) - { - string? __content_500 = null; - global::System.Exception? __exception_500 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_500 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_500, - responseBody: __content_500, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostGenerateVideoSeedDance25ImageToVideoResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.GenerateVideoSeedDance25Response.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.GenerateVideoSeedDance25Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Image to video with Seedance 2.5
- /// Generate a video from a first-frame image and a text prompt with
- /// Seedance 2.5. Upload the first frame as `image`, and optionally a final
- /// frame as `end_image`, using `multipart/form-data`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// A reference to an image already stored with Ideogram to use as the first frame, in place of uploading `image`. Only image assets are accepted. - /// - /// - /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - /// - /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - /// - /// An optional final frame, as a reference to an image already stored with Ideogram. When supplied, the generated video transitions from the first frame to this one. Only image assets are accepted. - /// - /// - /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. - /// - /// - /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. - /// - /// - /// A natural-language prompt describing how the first frame should animate.
- /// Example: The camera slowly pans right as the waves roll in. - /// - /// - /// The resolution tier of the generated video.
- /// Default Value: 720p - /// - /// - /// The length of the generated video in seconds. When omitted, the model
- /// picks the best duration for the prompt ("auto").
- /// Example: 5 - /// - /// - /// Whether to generate an audio track for the video. Audio roughly
- /// doubles the provider cost and is subject to stricter output moderation.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output video is added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateVideoSeedDance25ImageToVideoAsync( - string prompt, - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - global::Ideogram.AssetIdentifier? endImageAssetIdentifier = default, - byte[]? endImage = default, - string? endImagename = default, - global::Ideogram.SeedDance25Resolution? resolution = default, - int? duration = default, - bool? generateAudio = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.GenerateVideoSeedDance25ImageToVideoRequest - { - ImageAssetIdentifier = imageAssetIdentifier, - Image = image, - Imagename = imagename, - EndImageAssetIdentifier = endImageAssetIdentifier, - EndImage = endImage, - EndImagename = endImagename, - Prompt = prompt, - Resolution = resolution, - Duration = duration, - GenerateAudio = generateAudio, - WebhookUrl = webhookUrl, - Private = @private, - TargetCollectionId = targetCollectionId, - }; - - return await PostGenerateVideoSeedDance25ImageToVideoAsync( - dryRun: dryRun, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.PostGenerateVideoSeedDance25ReferenceToVideo.g.cs b/src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.PostGenerateVideoSeedDance25ReferenceToVideo.g.cs deleted file mode 100644 index 89aeaeec..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.PostGenerateVideoSeedDance25ReferenceToVideo.g.cs +++ /dev/null @@ -1,975 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class VideoGenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostGenerateVideoSeedDance25ReferenceToVideoSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostGenerateVideoSeedDance25ReferenceToVideoSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostGenerateVideoSeedDance25ReferenceToVideoSecurityRequirement0, - }; - partial void PreparePostGenerateVideoSeedDance25ReferenceToVideoArguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? dryRun, - global::Ideogram.GenerateVideoSeedDance25ReferenceToVideoRequest request); - partial void PreparePostGenerateVideoSeedDance25ReferenceToVideoRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? dryRun, - global::Ideogram.GenerateVideoSeedDance25ReferenceToVideoRequest request); - partial void ProcessPostGenerateVideoSeedDance25ReferenceToVideoResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostGenerateVideoSeedDance25ReferenceToVideoResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Reference to video with Seedance 2.5
- /// Generate a video from a text prompt and reference media with
- /// Seedance 2.5. Upload at least one image in `reference_images`, plus optional
- /// `reference_audios`, using `multipart/form-data`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateVideoSeedDance25ReferenceToVideoAsync( - - global::Ideogram.GenerateVideoSeedDance25ReferenceToVideoRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostGenerateVideoSeedDance25ReferenceToVideoAsResponseAsync( - - request: request, - dryRun: dryRun, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Reference to video with Seedance 2.5
- /// Generate a video from a text prompt and reference media with
- /// Seedance 2.5. Upload at least one image in `reference_images`, plus optional
- /// `reference_audios`, using `multipart/form-data`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostGenerateVideoSeedDance25ReferenceToVideoAsResponseAsync( - - global::Ideogram.GenerateVideoSeedDance25ReferenceToVideoRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostGenerateVideoSeedDance25ReferenceToVideoArguments( - httpClient: HttpClient, - dryRun: ref dryRun, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostGenerateVideoSeedDance25ReferenceToVideoSecurityRequirements, - operationName: "PostGenerateVideoSeedDance25ReferenceToVideoAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/video/generate/seedance-2-5-reference-to-video", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - if (request.ReferenceImageAssetIdentifiers != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.ReferenceImageAssetIdentifiers!, x => x.ToJson(JsonSerializerContext)))}]"), - name: "\"reference_image_asset_identifiers\""); - - } - if (request.ReferenceImages != default) - { - - for (var __iReferenceImages = 0; __iReferenceImages < request.ReferenceImages.Count; __iReferenceImages++) - { - var __contentReferenceImages = new global::System.Net.Http.ByteArrayContent(request.ReferenceImages[__iReferenceImages]); - __contentReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); - __httpRequestContent.Add( - content: __contentReferenceImages, - name: "\"reference_images\"", - fileName: $"\"file{__iReferenceImages}.bin\""); - if (__contentReferenceImages.Headers.ContentDisposition != null) - { - __contentReferenceImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - if (request.ReferenceVideoAssetIdentifiers != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.ReferenceVideoAssetIdentifiers!, x => x.ToJson(JsonSerializerContext)))}]"), - name: "\"reference_video_asset_identifiers\""); - - } - if (request.ReferenceAudios != default) - { - - for (var __iReferenceAudios = 0; __iReferenceAudios < request.ReferenceAudios.Count; __iReferenceAudios++) - { - var __contentReferenceAudios = new global::System.Net.Http.ByteArrayContent(request.ReferenceAudios[__iReferenceAudios]); - __contentReferenceAudios.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); - __httpRequestContent.Add( - content: __contentReferenceAudios, - name: "\"reference_audios\"", - fileName: $"\"file{__iReferenceAudios}.bin\""); - if (__contentReferenceAudios.Headers.ContentDisposition != null) - { - __contentReferenceAudios.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - if (request.AspectRatio != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.AspectRatio).HasValue ? (request.AspectRatio).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"aspect_ratio\""); - - } - if (request.Resolution != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"resolution\""); - - } - if (request.Duration != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Duration, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"duration\""); - - } - if (request.GenerateAudio != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.GenerateAudio, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"generate_audio\""); - - } - if (request.WebhookUrl != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), - name: "\"webhook_url\""); - - } - if (request.Private != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"private\""); - - } - if (request.TargetCollectionId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.TargetCollectionId ?? string.Empty), - name: "\"target_collection_id\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostGenerateVideoSeedDance25ReferenceToVideoRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - dryRun: dryRun, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateVideoSeedDance25ReferenceToVideo", - methodName: "PostGenerateVideoSeedDance25ReferenceToVideoAsync", - pathTemplate: "\"/v2/video/generate/seedance-2-5-reference-to-video\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateVideoSeedDance25ReferenceToVideo", - methodName: "PostGenerateVideoSeedDance25ReferenceToVideoAsync", - pathTemplate: "\"/v2/video/generate/seedance-2-5-reference-to-video\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateVideoSeedDance25ReferenceToVideo", - methodName: "PostGenerateVideoSeedDance25ReferenceToVideoAsync", - pathTemplate: "\"/v2/video/generate/seedance-2-5-reference-to-video\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostGenerateVideoSeedDance25ReferenceToVideoResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateVideoSeedDance25ReferenceToVideo", - methodName: "PostGenerateVideoSeedDance25ReferenceToVideoAsync", - pathTemplate: "\"/v2/video/generate/seedance-2-5-reference-to-video\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateVideoSeedDance25ReferenceToVideo", - methodName: "PostGenerateVideoSeedDance25ReferenceToVideoAsync", - pathTemplate: "\"/v2/video/generate/seedance-2-5-reference-to-video\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 500) - { - string? __content_500 = null; - global::System.Exception? __exception_500 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_500 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_500, - responseBody: __content_500, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostGenerateVideoSeedDance25ReferenceToVideoResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.GenerateVideoSeedDance25Response.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.GenerateVideoSeedDance25Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Reference to video with Seedance 2.5
- /// Generate a video from a text prompt and reference media with
- /// Seedance 2.5. Upload at least one image in `reference_images`, plus optional
- /// `reference_audios`, using `multipart/form-data`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// A natural-language prompt describing the video to produce. Refer to references by position, as in "[Image1] walks toward the camera".
- /// Example: [Image1] walks through the snowy forest at dawn. - /// - /// - /// Images already stored with Ideogram to use as references, by reference, in prompt order. Cannot be combined with `reference_images`. Only image assets are accepted. - /// - /// - /// Reference images, in prompt order. Common formats such as JPEG, PNG, and WEBP are supported, up to 50MB each. Multipart requests only. Uploaded images are used for this request only and are not stored. - /// - /// - /// Uploaded or generated videos to use as references, by reference, in prompt order. Each clip must be between 2 and 30 seconds long, and the clips must total no more than 30 seconds. Upload video files first and pass their asset identifiers. - /// - /// - /// MP3 or WAV audio references, in prompt order. Multipart requests only. Each file must be at most 15 MB and between 2 and 30 seconds long, with a combined duration of at most 30 seconds. Requires at least one reference image. Audio is used for this request only and is not saved to your library. - /// - /// - /// The aspect ratio of the generated video. `auto` lets the model choose the
- /// most suitable ratio from the prompt; any other value pins the ratio.
- /// Default Value: auto - /// - /// - /// The resolution tier of the generated video.
- /// Default Value: 720p - /// - /// - /// The length of the generated video in seconds. When omitted, the model
- /// picks the best duration for the prompt ("auto").
- /// Example: 5 - /// - /// - /// Whether to generate an audio track for the video. Audio roughly
- /// doubles the provider cost and is subject to stricter output moderation.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output videos are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateVideoSeedDance25ReferenceToVideoAsync( - string prompt, - bool? dryRun = default, - global::System.Collections.Generic.IList? referenceImageAssetIdentifiers = default, - global::System.Collections.Generic.IList? referenceImages = default, - global::System.Collections.Generic.IList? referenceVideoAssetIdentifiers = default, - global::System.Collections.Generic.IList? referenceAudios = default, - global::Ideogram.SeedDance2AspectRatio? aspectRatio = default, - global::Ideogram.SeedDance25Resolution? resolution = default, - int? duration = default, - bool? generateAudio = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.GenerateVideoSeedDance25ReferenceToVideoRequest - { - Prompt = prompt, - ReferenceImageAssetIdentifiers = referenceImageAssetIdentifiers, - ReferenceImages = referenceImages, - ReferenceVideoAssetIdentifiers = referenceVideoAssetIdentifiers, - ReferenceAudios = referenceAudios, - AspectRatio = aspectRatio, - Resolution = resolution, - Duration = duration, - GenerateAudio = generateAudio, - WebhookUrl = webhookUrl, - Private = @private, - TargetCollectionId = targetCollectionId, - }; - - return await PostGenerateVideoSeedDance25ReferenceToVideoAsync( - dryRun: dryRun, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.PostGenerateVideoSeedDance25TextToVideo.g.cs b/src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.PostGenerateVideoSeedDance25TextToVideo.g.cs deleted file mode 100644 index 6417589f..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.PostGenerateVideoSeedDance25TextToVideo.g.cs +++ /dev/null @@ -1,806 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class VideoGenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostGenerateVideoSeedDance25TextToVideoSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostGenerateVideoSeedDance25TextToVideoSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostGenerateVideoSeedDance25TextToVideoSecurityRequirement0, - }; - partial void PreparePostGenerateVideoSeedDance25TextToVideoArguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? dryRun, - global::Ideogram.GenerateVideoSeedDance25TextToVideoRequest request); - partial void PreparePostGenerateVideoSeedDance25TextToVideoRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? dryRun, - global::Ideogram.GenerateVideoSeedDance25TextToVideoRequest request); - partial void ProcessPostGenerateVideoSeedDance25TextToVideoResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostGenerateVideoSeedDance25TextToVideoResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Text to video with Seedance 2.5
- /// Generate a video from a text prompt with Seedance 2.5, at up to 1080p and
- /// 30 seconds. Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateVideoSeedDance25TextToVideoAsync( - - global::Ideogram.GenerateVideoSeedDance25TextToVideoRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostGenerateVideoSeedDance25TextToVideoAsResponseAsync( - - request: request, - dryRun: dryRun, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Text to video with Seedance 2.5
- /// Generate a video from a text prompt with Seedance 2.5, at up to 1080p and
- /// 30 seconds. Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostGenerateVideoSeedDance25TextToVideoAsResponseAsync( - - global::Ideogram.GenerateVideoSeedDance25TextToVideoRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostGenerateVideoSeedDance25TextToVideoArguments( - httpClient: HttpClient, - dryRun: ref dryRun, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostGenerateVideoSeedDance25TextToVideoSecurityRequirements, - operationName: "PostGenerateVideoSeedDance25TextToVideoAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/video/generate/seedance-2-5-text-to-video", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostGenerateVideoSeedDance25TextToVideoRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - dryRun: dryRun, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateVideoSeedDance25TextToVideo", - methodName: "PostGenerateVideoSeedDance25TextToVideoAsync", - pathTemplate: "\"/v2/video/generate/seedance-2-5-text-to-video\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateVideoSeedDance25TextToVideo", - methodName: "PostGenerateVideoSeedDance25TextToVideoAsync", - pathTemplate: "\"/v2/video/generate/seedance-2-5-text-to-video\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateVideoSeedDance25TextToVideo", - methodName: "PostGenerateVideoSeedDance25TextToVideoAsync", - pathTemplate: "\"/v2/video/generate/seedance-2-5-text-to-video\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostGenerateVideoSeedDance25TextToVideoResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateVideoSeedDance25TextToVideo", - methodName: "PostGenerateVideoSeedDance25TextToVideoAsync", - pathTemplate: "\"/v2/video/generate/seedance-2-5-text-to-video\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateVideoSeedDance25TextToVideo", - methodName: "PostGenerateVideoSeedDance25TextToVideoAsync", - pathTemplate: "\"/v2/video/generate/seedance-2-5-text-to-video\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 500) - { - string? __content_500 = null; - global::System.Exception? __exception_500 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_500 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_500, - responseBody: __content_500, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostGenerateVideoSeedDance25TextToVideoResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.GenerateVideoSeedDance25Response.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.GenerateVideoSeedDance25Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Text to video with Seedance 2.5
- /// Generate a video from a text prompt with Seedance 2.5, at up to 1080p and
- /// 30 seconds. Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// A natural-language prompt describing the video to generate.
- /// Example: A red fox running through a snowy forest at dawn. - /// - /// - /// The aspect ratio of the generated video. `auto` lets the model choose the
- /// most suitable ratio from the prompt; any other value pins the ratio.
- /// Default Value: auto - /// - /// - /// The resolution tier of the generated video.
- /// Default Value: 720p - /// - /// - /// The length of the generated video in seconds. When omitted, the model
- /// picks the best duration for the prompt ("auto").
- /// Example: 5 - /// - /// - /// Whether to generate an audio track for the video. Audio roughly
- /// doubles the provider cost and is subject to stricter output moderation.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output video is added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateVideoSeedDance25TextToVideoAsync( - string prompt, - bool? dryRun = default, - global::Ideogram.SeedDance2AspectRatio? aspectRatio = default, - global::Ideogram.SeedDance25Resolution? resolution = default, - int? duration = default, - bool? generateAudio = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.GenerateVideoSeedDance25TextToVideoRequest - { - Prompt = prompt, - AspectRatio = aspectRatio, - Resolution = resolution, - Duration = duration, - GenerateAudio = generateAudio, - WebhookUrl = webhookUrl, - Private = @private, - TargetCollectionId = targetCollectionId, - }; - - return await PostGenerateVideoSeedDance25TextToVideoAsync( - dryRun: dryRun, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.PostGenerateVideoSeedDance2ImageToVideo.g.cs b/src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.PostGenerateVideoSeedDance2ImageToVideo.g.cs deleted file mode 100644 index d69ce447..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.PostGenerateVideoSeedDance2ImageToVideo.g.cs +++ /dev/null @@ -1,1033 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class VideoGenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostGenerateVideoSeedDance2ImageToVideoSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostGenerateVideoSeedDance2ImageToVideoSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostGenerateVideoSeedDance2ImageToVideoSecurityRequirement0, - }; - partial void PreparePostGenerateVideoSeedDance2ImageToVideoArguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? dryRun, - global::Ideogram.GenerateVideoSeedDance2ImageToVideoRequest request); - partial void PreparePostGenerateVideoSeedDance2ImageToVideoRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? dryRun, - global::Ideogram.GenerateVideoSeedDance2ImageToVideoRequest request); - partial void ProcessPostGenerateVideoSeedDance2ImageToVideoResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostGenerateVideoSeedDance2ImageToVideoResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Image to video with Seedance 2.0
- /// Generate one or more videos from a first-frame image and a text prompt
- /// with Seedance 2.0. Upload the first frame as `image`, and optionally a final
- /// frame as `end_image`, using `multipart/form-data`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateVideoSeedDance2ImageToVideoAsync( - - global::Ideogram.GenerateVideoSeedDance2ImageToVideoRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostGenerateVideoSeedDance2ImageToVideoAsResponseAsync( - - request: request, - dryRun: dryRun, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Image to video with Seedance 2.0
- /// Generate one or more videos from a first-frame image and a text prompt
- /// with Seedance 2.0. Upload the first frame as `image`, and optionally a final
- /// frame as `end_image`, using `multipart/form-data`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostGenerateVideoSeedDance2ImageToVideoAsResponseAsync( - - global::Ideogram.GenerateVideoSeedDance2ImageToVideoRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostGenerateVideoSeedDance2ImageToVideoArguments( - httpClient: HttpClient, - dryRun: ref dryRun, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostGenerateVideoSeedDance2ImageToVideoSecurityRequirements, - operationName: "PostGenerateVideoSeedDance2ImageToVideoAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/video/generate/seedance-2-image-to-video", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (request.ImageAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.ImageAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"image_asset_identifier\""); - - } - if (request.Image != default) - { - - var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); - __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.Imagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - - } - if (request.EndImageAssetIdentifier != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.EndImageAssetIdentifier.ToJson(JsonSerializerContext)), - name: "\"end_image_asset_identifier\""); - - } - if (request.EndImage != default) - { - - var __contentEndImage = new global::System.Net.Http.ByteArrayContent(request.EndImage ?? global::System.Array.Empty()); - __contentEndImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.EndImagename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.EndImagename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentEndImage, - name: "\"end_image\"", - fileName: request.EndImagename != null ? $"\"{request.EndImagename}\"" : string.Empty); - if (__contentEndImage.Headers.ContentDisposition != null) - { - __contentEndImage.Headers.ContentDisposition.FileNameStar = null; - } - - } - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - if (request.AspectRatio != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.AspectRatio).HasValue ? (request.AspectRatio).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"aspect_ratio\""); - - } - if (request.Resolution != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"resolution\""); - - } - if (request.Duration != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Duration, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"duration\""); - - } - if (request.GenerateAudio != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.GenerateAudio, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"generate_audio\""); - - } - if (request.WebhookUrl != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), - name: "\"webhook_url\""); - - } - if (request.Private != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"private\""); - - } - if (request.TargetCollectionId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.TargetCollectionId ?? string.Empty), - name: "\"target_collection_id\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostGenerateVideoSeedDance2ImageToVideoRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - dryRun: dryRun, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateVideoSeedDance2ImageToVideo", - methodName: "PostGenerateVideoSeedDance2ImageToVideoAsync", - pathTemplate: "\"/v2/video/generate/seedance-2-image-to-video\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateVideoSeedDance2ImageToVideo", - methodName: "PostGenerateVideoSeedDance2ImageToVideoAsync", - pathTemplate: "\"/v2/video/generate/seedance-2-image-to-video\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateVideoSeedDance2ImageToVideo", - methodName: "PostGenerateVideoSeedDance2ImageToVideoAsync", - pathTemplate: "\"/v2/video/generate/seedance-2-image-to-video\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostGenerateVideoSeedDance2ImageToVideoResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateVideoSeedDance2ImageToVideo", - methodName: "PostGenerateVideoSeedDance2ImageToVideoAsync", - pathTemplate: "\"/v2/video/generate/seedance-2-image-to-video\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateVideoSeedDance2ImageToVideo", - methodName: "PostGenerateVideoSeedDance2ImageToVideoAsync", - pathTemplate: "\"/v2/video/generate/seedance-2-image-to-video\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 500) - { - string? __content_500 = null; - global::System.Exception? __exception_500 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_500 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_500, - responseBody: __content_500, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostGenerateVideoSeedDance2ImageToVideoResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.GenerateVideoSeedDance2Response.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.GenerateVideoSeedDance2Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Image to video with Seedance 2.0
- /// Generate one or more videos from a first-frame image and a text prompt
- /// with Seedance 2.0. Upload the first frame as `image`, and optionally a final
- /// frame as `end_image`, using `multipart/form-data`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// A reference to an image already stored with Ideogram to use as the first frame, in place of uploading `image`. Only image assets are accepted. - /// - /// - /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - /// - /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. - /// - /// - /// An optional final frame, as a reference to an image already stored with Ideogram. When supplied, the generated video transitions from the first frame to this one. Only image assets are accepted. - /// - /// - /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. - /// - /// - /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. - /// - /// - /// A natural-language prompt describing how the first frame should animate.
- /// Example: The camera slowly pans right as the waves roll in. - /// - /// - /// The aspect ratio of the generated video. `auto` lets the model choose the
- /// most suitable ratio from the prompt; any other value pins the ratio.
- /// Default Value: auto - /// - /// - /// The resolution tier of the generated video.
- /// Default Value: 720p - /// - /// - /// The length of the generated video in seconds. When omitted, the model
- /// picks the best duration for the prompt ("auto").
- /// Example: 5 - /// - /// - /// Whether to generate an audio track for the video. Audio roughly
- /// doubles the provider cost and is subject to stricter output moderation.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output videos are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateVideoSeedDance2ImageToVideoAsync( - string prompt, - bool? dryRun = default, - global::Ideogram.AssetIdentifier? imageAssetIdentifier = default, - byte[]? image = default, - string? imagename = default, - global::Ideogram.AssetIdentifier? endImageAssetIdentifier = default, - byte[]? endImage = default, - string? endImagename = default, - global::Ideogram.SeedDance2AspectRatio? aspectRatio = default, - global::Ideogram.SeedDance2Resolution? resolution = default, - int? duration = default, - bool? generateAudio = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.GenerateVideoSeedDance2ImageToVideoRequest - { - ImageAssetIdentifier = imageAssetIdentifier, - Image = image, - Imagename = imagename, - EndImageAssetIdentifier = endImageAssetIdentifier, - EndImage = endImage, - EndImagename = endImagename, - Prompt = prompt, - AspectRatio = aspectRatio, - Resolution = resolution, - Duration = duration, - GenerateAudio = generateAudio, - WebhookUrl = webhookUrl, - Private = @private, - TargetCollectionId = targetCollectionId, - }; - - return await PostGenerateVideoSeedDance2ImageToVideoAsync( - dryRun: dryRun, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.PostGenerateVideoSeedDance2ReferenceToVideo.g.cs b/src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.PostGenerateVideoSeedDance2ReferenceToVideo.g.cs deleted file mode 100644 index 2e001170..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.PostGenerateVideoSeedDance2ReferenceToVideo.g.cs +++ /dev/null @@ -1,975 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class VideoGenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostGenerateVideoSeedDance2ReferenceToVideoSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostGenerateVideoSeedDance2ReferenceToVideoSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostGenerateVideoSeedDance2ReferenceToVideoSecurityRequirement0, - }; - partial void PreparePostGenerateVideoSeedDance2ReferenceToVideoArguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? dryRun, - global::Ideogram.GenerateVideoSeedDance2ReferenceToVideoRequest request); - partial void PreparePostGenerateVideoSeedDance2ReferenceToVideoRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? dryRun, - global::Ideogram.GenerateVideoSeedDance2ReferenceToVideoRequest request); - partial void ProcessPostGenerateVideoSeedDance2ReferenceToVideoResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostGenerateVideoSeedDance2ReferenceToVideoResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Reference to video with Seedance 2.0
- /// Generate a video from a text prompt and reference media with
- /// Seedance 2.0. Upload at least one image in `reference_images`, plus optional
- /// `reference_audios`, using `multipart/form-data`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateVideoSeedDance2ReferenceToVideoAsync( - - global::Ideogram.GenerateVideoSeedDance2ReferenceToVideoRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostGenerateVideoSeedDance2ReferenceToVideoAsResponseAsync( - - request: request, - dryRun: dryRun, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Reference to video with Seedance 2.0
- /// Generate a video from a text prompt and reference media with
- /// Seedance 2.0. Upload at least one image in `reference_images`, plus optional
- /// `reference_audios`, using `multipart/form-data`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostGenerateVideoSeedDance2ReferenceToVideoAsResponseAsync( - - global::Ideogram.GenerateVideoSeedDance2ReferenceToVideoRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostGenerateVideoSeedDance2ReferenceToVideoArguments( - httpClient: HttpClient, - dryRun: ref dryRun, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostGenerateVideoSeedDance2ReferenceToVideoSecurityRequirements, - operationName: "PostGenerateVideoSeedDance2ReferenceToVideoAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/video/generate/seedance-2-reference-to-video", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), - name: "\"prompt\""); - - if (request.ReferenceImageAssetIdentifiers != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.ReferenceImageAssetIdentifiers!, x => x.ToJson(JsonSerializerContext)))}]"), - name: "\"reference_image_asset_identifiers\""); - - } - if (request.ReferenceImages != default) - { - - for (var __iReferenceImages = 0; __iReferenceImages < request.ReferenceImages.Count; __iReferenceImages++) - { - var __contentReferenceImages = new global::System.Net.Http.ByteArrayContent(request.ReferenceImages[__iReferenceImages]); - __contentReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); - __httpRequestContent.Add( - content: __contentReferenceImages, - name: "\"reference_images\"", - fileName: $"\"file{__iReferenceImages}.bin\""); - if (__contentReferenceImages.Headers.ContentDisposition != null) - { - __contentReferenceImages.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - if (request.ReferenceVideoAssetIdentifiers != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.ReferenceVideoAssetIdentifiers!, x => x.ToJson(JsonSerializerContext)))}]"), - name: "\"reference_video_asset_identifiers\""); - - } - if (request.ReferenceAudios != default) - { - - for (var __iReferenceAudios = 0; __iReferenceAudios < request.ReferenceAudios.Count; __iReferenceAudios++) - { - var __contentReferenceAudios = new global::System.Net.Http.ByteArrayContent(request.ReferenceAudios[__iReferenceAudios]); - __contentReferenceAudios.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); - __httpRequestContent.Add( - content: __contentReferenceAudios, - name: "\"reference_audios\"", - fileName: $"\"file{__iReferenceAudios}.bin\""); - if (__contentReferenceAudios.Headers.ContentDisposition != null) - { - __contentReferenceAudios.Headers.ContentDisposition.FileNameStar = null; - } - } - - } - if (request.AspectRatio != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.AspectRatio).HasValue ? (request.AspectRatio).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"aspect_ratio\""); - - } - if (request.Resolution != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"resolution\""); - - } - if (request.Duration != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Duration, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), - name: "\"duration\""); - - } - if (request.GenerateAudio != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.GenerateAudio, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"generate_audio\""); - - } - if (request.WebhookUrl != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), - name: "\"webhook_url\""); - - } - if (request.Private != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Private, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"private\""); - - } - if (request.TargetCollectionId != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent(request.TargetCollectionId ?? string.Empty), - name: "\"target_collection_id\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostGenerateVideoSeedDance2ReferenceToVideoRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - dryRun: dryRun, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateVideoSeedDance2ReferenceToVideo", - methodName: "PostGenerateVideoSeedDance2ReferenceToVideoAsync", - pathTemplate: "\"/v2/video/generate/seedance-2-reference-to-video\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateVideoSeedDance2ReferenceToVideo", - methodName: "PostGenerateVideoSeedDance2ReferenceToVideoAsync", - pathTemplate: "\"/v2/video/generate/seedance-2-reference-to-video\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateVideoSeedDance2ReferenceToVideo", - methodName: "PostGenerateVideoSeedDance2ReferenceToVideoAsync", - pathTemplate: "\"/v2/video/generate/seedance-2-reference-to-video\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostGenerateVideoSeedDance2ReferenceToVideoResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateVideoSeedDance2ReferenceToVideo", - methodName: "PostGenerateVideoSeedDance2ReferenceToVideoAsync", - pathTemplate: "\"/v2/video/generate/seedance-2-reference-to-video\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateVideoSeedDance2ReferenceToVideo", - methodName: "PostGenerateVideoSeedDance2ReferenceToVideoAsync", - pathTemplate: "\"/v2/video/generate/seedance-2-reference-to-video\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 500) - { - string? __content_500 = null; - global::System.Exception? __exception_500 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_500 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_500, - responseBody: __content_500, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostGenerateVideoSeedDance2ReferenceToVideoResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.GenerateVideoSeedDance2Response.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.GenerateVideoSeedDance2Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Reference to video with Seedance 2.0
- /// Generate a video from a text prompt and reference media with
- /// Seedance 2.0. Upload at least one image in `reference_images`, plus optional
- /// `reference_audios`, using `multipart/form-data`.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// A natural-language prompt describing the video to produce. Refer to references by position, as in "@Image1 walks toward the camera".
- /// Example: @Image1 walks through the snowy forest at dawn. - /// - /// - /// Images already stored with Ideogram to use as references, by reference, in prompt order. Cannot be combined with `reference_images`. Only image assets are accepted. - /// - /// - /// Reference images, in prompt order. Common formats such as JPEG, PNG, and WEBP are supported, up to 50MB each. Multipart requests only. Uploaded images are used for this request only and are not stored. - /// - /// - /// Uploaded or generated videos to use as references, by reference, in prompt order. Each clip must be between 2 and 15 seconds long, and the clips must total no more than 15 seconds. Upload video files first and pass their asset identifiers. - /// - /// - /// MP3 or WAV audio references, in prompt order. Multipart requests only. Each file must be at most 15 MB and between 2 and 15 seconds long, with a combined duration of at most 15 seconds. Requires at least one reference image. Audio is used for this request only and is not saved to your library. - /// - /// - /// The aspect ratio of the generated video. `auto` lets the model choose the
- /// most suitable ratio from the prompt; any other value pins the ratio.
- /// Default Value: auto - /// - /// - /// The resolution tier of the generated video.
- /// Default Value: 720p - /// - /// - /// The length of the generated video in seconds. When omitted, the model
- /// picks the best duration for the prompt ("auto").
- /// Example: 5 - /// - /// - /// Whether to generate an audio track for the video. Audio roughly
- /// doubles the provider cost and is subject to stricter output moderation.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output videos are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateVideoSeedDance2ReferenceToVideoAsync( - string prompt, - bool? dryRun = default, - global::System.Collections.Generic.IList? referenceImageAssetIdentifiers = default, - global::System.Collections.Generic.IList? referenceImages = default, - global::System.Collections.Generic.IList? referenceVideoAssetIdentifiers = default, - global::System.Collections.Generic.IList? referenceAudios = default, - global::Ideogram.SeedDance2AspectRatio? aspectRatio = default, - global::Ideogram.SeedDance2Resolution? resolution = default, - int? duration = default, - bool? generateAudio = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.GenerateVideoSeedDance2ReferenceToVideoRequest - { - Prompt = prompt, - ReferenceImageAssetIdentifiers = referenceImageAssetIdentifiers, - ReferenceImages = referenceImages, - ReferenceVideoAssetIdentifiers = referenceVideoAssetIdentifiers, - ReferenceAudios = referenceAudios, - AspectRatio = aspectRatio, - Resolution = resolution, - Duration = duration, - GenerateAudio = generateAudio, - WebhookUrl = webhookUrl, - Private = @private, - TargetCollectionId = targetCollectionId, - }; - - return await PostGenerateVideoSeedDance2ReferenceToVideoAsync( - dryRun: dryRun, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.PostGenerateVideoSeedDance2TextToVideo.g.cs b/src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.PostGenerateVideoSeedDance2TextToVideo.g.cs deleted file mode 100644 index 4c94c1e3..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.PostGenerateVideoSeedDance2TextToVideo.g.cs +++ /dev/null @@ -1,806 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class VideoGenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostGenerateVideoSeedDance2TextToVideoSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostGenerateVideoSeedDance2TextToVideoSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostGenerateVideoSeedDance2TextToVideoSecurityRequirement0, - }; - partial void PreparePostGenerateVideoSeedDance2TextToVideoArguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? dryRun, - global::Ideogram.GenerateVideoSeedDance2TextToVideoRequest request); - partial void PreparePostGenerateVideoSeedDance2TextToVideoRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? dryRun, - global::Ideogram.GenerateVideoSeedDance2TextToVideoRequest request); - partial void ProcessPostGenerateVideoSeedDance2TextToVideoResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostGenerateVideoSeedDance2TextToVideoResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Text to video with Seedance 2.0
- /// Generate one or more videos from a text prompt with Seedance 2.0.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateVideoSeedDance2TextToVideoAsync( - - global::Ideogram.GenerateVideoSeedDance2TextToVideoRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostGenerateVideoSeedDance2TextToVideoAsResponseAsync( - - request: request, - dryRun: dryRun, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Text to video with Seedance 2.0
- /// Generate one or more videos from a text prompt with Seedance 2.0.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostGenerateVideoSeedDance2TextToVideoAsResponseAsync( - - global::Ideogram.GenerateVideoSeedDance2TextToVideoRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostGenerateVideoSeedDance2TextToVideoArguments( - httpClient: HttpClient, - dryRun: ref dryRun, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostGenerateVideoSeedDance2TextToVideoSecurityRequirements, - operationName: "PostGenerateVideoSeedDance2TextToVideoAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/video/generate/seedance-2-text-to-video", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostGenerateVideoSeedDance2TextToVideoRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - dryRun: dryRun, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateVideoSeedDance2TextToVideo", - methodName: "PostGenerateVideoSeedDance2TextToVideoAsync", - pathTemplate: "\"/v2/video/generate/seedance-2-text-to-video\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateVideoSeedDance2TextToVideo", - methodName: "PostGenerateVideoSeedDance2TextToVideoAsync", - pathTemplate: "\"/v2/video/generate/seedance-2-text-to-video\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateVideoSeedDance2TextToVideo", - methodName: "PostGenerateVideoSeedDance2TextToVideoAsync", - pathTemplate: "\"/v2/video/generate/seedance-2-text-to-video\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostGenerateVideoSeedDance2TextToVideoResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateVideoSeedDance2TextToVideo", - methodName: "PostGenerateVideoSeedDance2TextToVideoAsync", - pathTemplate: "\"/v2/video/generate/seedance-2-text-to-video\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostGenerateVideoSeedDance2TextToVideo", - methodName: "PostGenerateVideoSeedDance2TextToVideoAsync", - pathTemplate: "\"/v2/video/generate/seedance-2-text-to-video\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 500) - { - string? __content_500 = null; - global::System.Exception? __exception_500 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_500 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_500, - responseBody: __content_500, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostGenerateVideoSeedDance2TextToVideoResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.GenerateVideoSeedDance2Response.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.GenerateVideoSeedDance2Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Text to video with Seedance 2.0
- /// Generate one or more videos from a text prompt with Seedance 2.0.
- /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
- /// or supply a `webhook_url`. - ///
- /// - /// Default Value: false - /// - /// - /// A natural-language prompt describing the video to generate.
- /// Example: A red fox running through a snowy forest at dawn. - /// - /// - /// The aspect ratio of the generated video. `auto` lets the model choose the
- /// most suitable ratio from the prompt; any other value pins the ratio.
- /// Default Value: auto - /// - /// - /// The resolution tier of the generated video.
- /// Default Value: 720p - /// - /// - /// The length of the generated video in seconds. When omitted, the model
- /// picks the best duration for the prompt ("auto").
- /// Example: 5 - /// - /// - /// Whether to generate an audio track for the video. Audio roughly
- /// doubles the provider cost and is subject to stricter output moderation.
- /// Default Value: false - /// - /// - /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
- /// JSON POST to this URL once all images for the request have finished
- /// generating. The body mirrors the synchronous generate response:
- /// `request_id`, `created`, and a `data` array
- /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
- /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
- /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
- /// private and loopback hosts and the cloud metadata service are rejected.
- /// Example: https://api.example.com/webhooks/ideogram - /// - /// - /// When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately. - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output videos are added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostGenerateVideoSeedDance2TextToVideoAsync( - string prompt, - bool? dryRun = default, - global::Ideogram.SeedDance2AspectRatio? aspectRatio = default, - global::Ideogram.SeedDance2Resolution? resolution = default, - int? duration = default, - bool? generateAudio = default, - string? webhookUrl = default, - bool? @private = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.GenerateVideoSeedDance2TextToVideoRequest - { - Prompt = prompt, - AspectRatio = aspectRatio, - Resolution = resolution, - Duration = duration, - GenerateAudio = generateAudio, - WebhookUrl = webhookUrl, - Private = @private, - TargetCollectionId = targetCollectionId, - }; - - return await PostGenerateVideoSeedDance2TextToVideoAsync( - dryRun: dryRun, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.PostLivingImage.g.cs b/src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.PostLivingImage.g.cs deleted file mode 100644 index 3e682f7f..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.PostLivingImage.g.cs +++ /dev/null @@ -1,739 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class VideoGenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostLivingImageSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostLivingImageSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostLivingImageSecurityRequirement0, - }; - partial void PreparePostLivingImageArguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? dryRun, - global::Ideogram.LivingImageRequest request); - partial void PreparePostLivingImageRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? dryRun, - global::Ideogram.LivingImageRequest request); - partial void ProcessPostLivingImageResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostLivingImageResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Turn a still image into a subtle looping video
- /// Animates one image into a short, loop-ready clip for use as a living background. The camera stays fixed and only the parts of the scene that would move in real life move: water, light, mist, particles, fabric, creatures. Ideogram inspects the image and writes the motion prompt, so the request needs only the image.
- /// Video generation runs asynchronously. Poll `GET /v1/generations/{generation_id}` with the returned `generation_id` until the generation completes or fails. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostLivingImageAsync( - - global::Ideogram.LivingImageRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostLivingImageAsResponseAsync( - - request: request, - dryRun: dryRun, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Turn a still image into a subtle looping video
- /// Animates one image into a short, loop-ready clip for use as a living background. The camera stays fixed and only the parts of the scene that would move in real life move: water, light, mist, particles, fabric, creatures. Ideogram inspects the image and writes the motion prompt, so the request needs only the image.
- /// Video generation runs asynchronously. Poll `GET /v1/generations/{generation_id}` with the returned `generation_id` until the generation completes or fails. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostLivingImageAsResponseAsync( - - global::Ideogram.LivingImageRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostLivingImageArguments( - httpClient: HttpClient, - dryRun: ref dryRun, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostLivingImageSecurityRequirements, - operationName: "PostLivingImageAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/tool/living-image", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostLivingImageRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - dryRun: dryRun, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostLivingImage", - methodName: "PostLivingImageAsync", - pathTemplate: "\"/v2/tool/living-image\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostLivingImage", - methodName: "PostLivingImageAsync", - pathTemplate: "\"/v2/tool/living-image\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostLivingImage", - methodName: "PostLivingImageAsync", - pathTemplate: "\"/v2/tool/living-image\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostLivingImageResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostLivingImage", - methodName: "PostLivingImageAsync", - pathTemplate: "\"/v2/tool/living-image\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostLivingImage", - methodName: "PostLivingImageAsync", - pathTemplate: "\"/v2/tool/living-image\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostLivingImageResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.LivingImageResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.LivingImageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Turn a still image into a subtle looping video
- /// Animates one image into a short, loop-ready clip for use as a living background. The camera stays fixed and only the parts of the scene that would move in real life move: water, light, mist, particles, fabric, creatures. Ideogram inspects the image and writes the motion prompt, so the request needs only the image.
- /// Video generation runs asynchronously. Poll `GET /v1/generations/{generation_id}` with the returned `generation_id` until the generation completes or fails. - ///
- /// - /// Default Value: false - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// The output resolution tier. `standard` renders at 768P; `high` renders at 2K. Higher tiers cost more.
- /// Default Value: standard - /// - /// - /// The length of the generated video in seconds.
- /// Default Value: 8
- /// Example: 8 - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output video is added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostLivingImageAsync( - global::Ideogram.AssetIdentifier imageAssetIdentifier, - bool? dryRun = default, - global::Ideogram.LivingImageQuality? quality = default, - int? duration = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.LivingImageRequest - { - ImageAssetIdentifier = imageAssetIdentifier, - Quality = quality, - Duration = duration, - TargetCollectionId = targetCollectionId, - }; - - return await PostLivingImageAsync( - dryRun: dryRun, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.PostProduct360Video.g.cs b/src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.PostProduct360Video.g.cs deleted file mode 100644 index 0a9832c3..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.PostProduct360Video.g.cs +++ /dev/null @@ -1,781 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class VideoGenerateClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostProduct360VideoSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostProduct360VideoSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostProduct360VideoSecurityRequirement0, - }; - partial void PreparePostProduct360VideoArguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? dryRun, - global::Ideogram.Product360VideoRequest request); - partial void PreparePostProduct360VideoRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? dryRun, - global::Ideogram.Product360VideoRequest request); - partial void ProcessPostProduct360VideoResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostProduct360VideoResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Product 360 Video
- /// Animates one product image through a complete turntable revolution and returns to the starting pose so the result loops cleanly.
- /// Video generation runs asynchronously. Poll `GET /v2/generations/{generation_id}` with the returned `generation_id` until the generation completes or fails. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostProduct360VideoAsync( - - global::Ideogram.Product360VideoRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostProduct360VideoAsResponseAsync( - - request: request, - dryRun: dryRun, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Product 360 Video
- /// Animates one product image through a complete turntable revolution and returns to the starting pose so the result loops cleanly.
- /// Video generation runs asynchronously. Poll `GET /v2/generations/{generation_id}` with the returned `generation_id` until the generation completes or fails. - ///
- /// - /// Default Value: false - /// - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostProduct360VideoAsResponseAsync( - - global::Ideogram.Product360VideoRequest request, - bool? dryRun = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostProduct360VideoArguments( - httpClient: HttpClient, - dryRun: ref dryRun, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostProduct360VideoSecurityRequirements, - operationName: "PostProduct360VideoAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v2/tool/product-360-video", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostProduct360VideoRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - dryRun: dryRun, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostProduct360Video", - methodName: "PostProduct360VideoAsync", - pathTemplate: "\"/v2/tool/product-360-video\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostProduct360Video", - methodName: "PostProduct360VideoAsync", - pathTemplate: "\"/v2/tool/product-360-video\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostProduct360Video", - methodName: "PostProduct360VideoAsync", - pathTemplate: "\"/v2/tool/product-360-video\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostProduct360VideoResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostProduct360Video", - methodName: "PostProduct360VideoAsync", - pathTemplate: "\"/v2/tool/product-360-video\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostProduct360Video", - methodName: "PostProduct360VideoAsync", - pathTemplate: "\"/v2/tool/product-360-video\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - responseBody: __content_401, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Insufficient credits or quota. - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::Ideogram.GenerationErrorResponse? __value_402 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - responseBody: __content_402, - responseObject: __value_402, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Too many requests. - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::Ideogram.GenerationErrorResponse? __value_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseObject: __value_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostProduct360VideoResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.GenerateVideoSeedDance25Response.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.GenerateVideoSeedDance25Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Product 360 Video
- /// Animates one product image through a complete turntable revolution and returns to the starting pose so the result loops cleanly.
- /// Video generation runs asynchronously. Poll `GET /v2/generations/{generation_id}` with the returned `generation_id` until the generation completes or fails. - ///
- /// - /// Default Value: false - /// - /// - /// An identifier for an ideogram asset.
- /// Example: {"asset_type":"RESPONSE","asset_id":"7uS_VESkRI6O3-sVgHQp_A"} - /// - /// - /// Direction the product rotates around its vertical axis. - /// - /// - /// Optional factual description of the product in the source image. - /// - /// - /// The resolution tier of the generated video.
- /// Default Value: 720p - /// - /// - /// The length of the generated video in seconds. When omitted, the model
- /// picks the best duration for the prompt ("auto").
- /// Example: 5 - /// - /// - /// A collection you can write to, by its URL-safe base64 collection id. The output video is added to it when the request completes. - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostProduct360VideoAsync( - global::Ideogram.AssetIdentifier imageAssetIdentifier, - global::Ideogram.Product360VideoDirection direction, - bool? dryRun = default, - string? productDescription = default, - global::Ideogram.SeedDance25Resolution? resolution = default, - int? duration = default, - string? targetCollectionId = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.Product360VideoRequest - { - ImageAssetIdentifier = imageAssetIdentifier, - Direction = direction, - ProductDescription = productDescription, - Resolution = resolution, - Duration = duration, - TargetCollectionId = targetCollectionId, - }; - - return await PostProduct360VideoAsync( - dryRun: dryRun, - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideo.g.cs b/src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideo.g.cs new file mode 100644 index 00000000..241b953f --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideo.g.cs @@ -0,0 +1,2843 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class VideoGenerateClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoSecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoSecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoSecurityRequirement0, + }; + partial void PrepareVideoGeneratePostGenerateVideoKlingV3StandardImageToVideoArguments( + global::System.Net.Http.HttpClient httpClient, + ref bool? dryRun, + global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoRequest request); + partial void PrepareVideoGeneratePostGenerateVideoKlingV3StandardImageToVideoRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + bool? dryRun, + global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoRequest request); + partial void ProcessVideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessVideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Image to video with Kling v3 Standard
+ /// Generate a video from a first-frame image and a text prompt with Kling
+ /// v3 Standard. Upload the first frame as `image`, and optionally a final
+ /// frame as `end_image`, using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoAsync( + + global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoAsResponseAsync( + + request: request, + dryRun: dryRun, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Image to video with Kling v3 Standard
+ /// Generate a video from a first-frame image and a text prompt with Kling
+ /// v3 Standard. Upload the first frame as `image`, and optionally a final
+ /// frame as `end_image`, using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoAsResponseAsync( + + global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareVideoGeneratePostGenerateVideoKlingV3StandardImageToVideoArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoSecurityRequirements, + operationName: "VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/video/generate/kling-3-standard-image-to-video", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.EndImage != default) + { + + var __contentEndImage = new global::System.Net.Http.ByteArrayContent(request.EndImage ?? global::System.Array.Empty()); + __contentEndImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.EndImagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.EndImagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentEndImage, + name: "\"end_image\"", + fileName: request.EndImagename != null ? $"\"{request.EndImagename}\"" : string.Empty); + if (__contentEndImage.Headers.ContentDisposition != null) + { + __contentEndImage.Headers.ContentDisposition.FileNameStar = null; + } + + } + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + if (request.NegativePrompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.NegativePrompt ?? string.Empty), + name: "\"negative_prompt\""); + + } + if (request.Duration != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Duration, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"duration\""); + + } + if (request.GenerateAudio != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.GenerateAudio, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"generate_audio\""); + + } + if (request.ShotType != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.ShotType).HasValue ? (request.ShotType).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"shot_type\""); + + } + if (request.CfgScale != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.CfgScale ?? string.Empty), + name: "\"cfg_scale\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareVideoGeneratePostGenerateVideoKlingV3StandardImageToVideoRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoKlingV3StandardImageToVideo", + methodName: "VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoAsync", + pathTemplate: "\"/v2/video/generate/kling-3-standard-image-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoKlingV3StandardImageToVideo", + methodName: "VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoAsync", + pathTemplate: "\"/v2/video/generate/kling-3-standard-image-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoKlingV3StandardImageToVideo", + methodName: "VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoAsync", + pathTemplate: "\"/v2/video/generate/kling-3-standard-image-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessVideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoKlingV3StandardImageToVideo", + methodName: "VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoAsync", + pathTemplate: "\"/v2/video/generate/kling-3-standard-image-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoKlingV3StandardImageToVideo", + methodName: "VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoAsync", + pathTemplate: "\"/v2/video/generate/kling-3-standard-image-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // This account does not have access to this model. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The first-frame image was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessVideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.GenerateVideoKlingV3Response.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.GenerateVideoKlingV3Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Image to video with Kling v3 Standard
+ /// Generate a video from a first-frame image and a text prompt with Kling
+ /// v3 Standard. Upload the first frame as `image`, and optionally a final
+ /// frame as `end_image`, using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. + /// + /// + /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. + /// + /// + /// A natural-language prompt describing how the first frame should animate. + /// + /// + /// Description of what to keep out of the video. Descriptions in the prompt take precedence over descriptions in the negative prompt. + /// + /// + /// The length of the generated video in seconds. Defaults to 5 seconds
+ /// when omitted. + /// + /// + /// Whether to generate an audio track for the video. Audio roughly
+ /// doubles the provider cost and is subject to stricter output moderation.
+ /// Default Value: false + /// + /// + /// How the prompt is staged. `customize` follows the prompt as written;
+ /// `intelligent` lets the model break the prompt into its own shots.
+ /// Default Value: customize + /// + /// + /// How closely the video follows the prompt, from 0 to 1. Lower values
+ /// leave the model more freedom. Defaults to 0.5 when omitted. + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoAsync( + byte[] image, + string imagename, + string prompt, + bool? dryRun = default, + byte[]? endImage = default, + string? endImagename = default, + string? negativePrompt = default, + int? duration = default, + bool? generateAudio = default, + global::Ideogram.KlingV3ShotType? shotType = default, + string? cfgScale = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoRequest + { + Image = image, + Imagename = imagename, + EndImage = endImage, + EndImagename = endImagename, + Prompt = prompt, + NegativePrompt = negativePrompt, + Duration = duration, + GenerateAudio = generateAudio, + ShotType = shotType, + CfgScale = cfgScale, + WebhookUrl = webhookUrl, + }; + + return await VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoAsync( + dryRun: dryRun, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// Image to video with Kling v3 Standard
+ /// Generate a video from a first-frame image and a text prompt with Kling
+ /// v3 Standard. Upload the first frame as `image`, and optionally a final
+ /// frame as `end_image`, using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. + /// + /// + /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. + /// + /// + /// A natural-language prompt describing how the first frame should animate. + /// + /// + /// Description of what to keep out of the video. Descriptions in the prompt take precedence over descriptions in the negative prompt. + /// + /// + /// The length of the generated video in seconds. Defaults to 5 seconds
+ /// when omitted. + /// + /// + /// Whether to generate an audio track for the video. Audio roughly
+ /// doubles the provider cost and is subject to stricter output moderation.
+ /// Default Value: false + /// + /// + /// How the prompt is staged. `customize` follows the prompt as written;
+ /// `intelligent` lets the model break the prompt into its own shots.
+ /// Default Value: customize + /// + /// + /// How closely the video follows the prompt, from 0 to 1. Lower values
+ /// leave the model more freedom. Defaults to 0.5 when omitted. + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoAsync( + global::System.IO.Stream image, + string imagename, + string prompt, + bool? dryRun = default, + global::System.IO.Stream? endImage = default, + string? endImagename = default, + string? negativePrompt = default, + int? duration = default, + bool? generateAudio = default, + global::Ideogram.KlingV3ShotType? shotType = default, + string? cfgScale = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + var request = new global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoRequest + { + Image = global::System.Array.Empty(), + Imagename = imagename, + EndImage = global::System.Array.Empty(), + EndImagename = endImagename, + Prompt = prompt, + NegativePrompt = negativePrompt, + Duration = duration, + GenerateAudio = generateAudio, + ShotType = shotType, + CfgScale = cfgScale, + WebhookUrl = webhookUrl, + }; + PrepareArguments( + client: HttpClient); + PrepareVideoGeneratePostGenerateVideoKlingV3StandardImageToVideoArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoSecurityRequirements, + operationName: "VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/video/generate/kling-3-standard-image-to-video", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (endImage != default) + { + + var __contentEndImage = new global::System.Net.Http.StreamContent(endImage); + __contentEndImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.EndImagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.EndImagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentEndImage, + name: "\"end_image\"", + fileName: request.EndImagename != null ? $"\"{request.EndImagename}\"" : string.Empty); + if (__contentEndImage.Headers.ContentDisposition != null) + { + __contentEndImage.Headers.ContentDisposition.FileNameStar = null; + } + + } + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + if (request.NegativePrompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.NegativePrompt ?? string.Empty), + name: "\"negative_prompt\""); + + } + if (request.Duration != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Duration, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"duration\""); + + } + if (request.GenerateAudio != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.GenerateAudio, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"generate_audio\""); + + } + if (request.ShotType != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.ShotType).HasValue ? (request.ShotType).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"shot_type\""); + + } + if (request.CfgScale != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.CfgScale ?? string.Empty), + name: "\"cfg_scale\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareVideoGeneratePostGenerateVideoKlingV3StandardImageToVideoRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoKlingV3StandardImageToVideo", + methodName: "VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoAsync", + pathTemplate: "\"/v2/video/generate/kling-3-standard-image-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoKlingV3StandardImageToVideo", + methodName: "VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoAsync", + pathTemplate: "\"/v2/video/generate/kling-3-standard-image-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoKlingV3StandardImageToVideo", + methodName: "VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoAsync", + pathTemplate: "\"/v2/video/generate/kling-3-standard-image-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessVideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoKlingV3StandardImageToVideo", + methodName: "VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoAsync", + pathTemplate: "\"/v2/video/generate/kling-3-standard-image-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoKlingV3StandardImageToVideo", + methodName: "VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoAsync", + pathTemplate: "\"/v2/video/generate/kling-3-standard-image-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // This account does not have access to this model. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The first-frame image was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessVideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::Ideogram.GenerateVideoKlingV3Response.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::Ideogram.GenerateVideoKlingV3Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Image to video with Kling v3 Standard
+ /// Generate a video from a first-frame image and a text prompt with Kling
+ /// v3 Standard. Upload the first frame as `image`, and optionally a final
+ /// frame as `end_image`, using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. + /// + /// + /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. + /// + /// + /// A natural-language prompt describing how the first frame should animate. + /// + /// + /// Description of what to keep out of the video. Descriptions in the prompt take precedence over descriptions in the negative prompt. + /// + /// + /// The length of the generated video in seconds. Defaults to 5 seconds
+ /// when omitted. + /// + /// + /// Whether to generate an audio track for the video. Audio roughly
+ /// doubles the provider cost and is subject to stricter output moderation.
+ /// Default Value: false + /// + /// + /// How the prompt is staged. `customize` follows the prompt as written;
+ /// `intelligent` lets the model break the prompt into its own shots.
+ /// Default Value: customize + /// + /// + /// How closely the video follows the prompt, from 0 to 1. Lower values
+ /// leave the model more freedom. Defaults to 0.5 when omitted. + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoAsResponseAsync( + global::System.IO.Stream image, + string imagename, + string prompt, + bool? dryRun = default, + global::System.IO.Stream? endImage = default, + string? endImagename = default, + string? negativePrompt = default, + int? duration = default, + bool? generateAudio = default, + global::Ideogram.KlingV3ShotType? shotType = default, + string? cfgScale = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + var request = new global::Ideogram.VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoRequest + { + Image = global::System.Array.Empty(), + Imagename = imagename, + EndImage = global::System.Array.Empty(), + EndImagename = endImagename, + Prompt = prompt, + NegativePrompt = negativePrompt, + Duration = duration, + GenerateAudio = generateAudio, + ShotType = shotType, + CfgScale = cfgScale, + WebhookUrl = webhookUrl, + }; + PrepareArguments( + client: HttpClient); + PrepareVideoGeneratePostGenerateVideoKlingV3StandardImageToVideoArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoSecurityRequirements, + operationName: "VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/video/generate/kling-3-standard-image-to-video", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (endImage != default) + { + + var __contentEndImage = new global::System.Net.Http.StreamContent(endImage); + __contentEndImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.EndImagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.EndImagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentEndImage, + name: "\"end_image\"", + fileName: request.EndImagename != null ? $"\"{request.EndImagename}\"" : string.Empty); + if (__contentEndImage.Headers.ContentDisposition != null) + { + __contentEndImage.Headers.ContentDisposition.FileNameStar = null; + } + + } + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + if (request.NegativePrompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.NegativePrompt ?? string.Empty), + name: "\"negative_prompt\""); + + } + if (request.Duration != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Duration, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"duration\""); + + } + if (request.GenerateAudio != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.GenerateAudio, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"generate_audio\""); + + } + if (request.ShotType != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.ShotType).HasValue ? (request.ShotType).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"shot_type\""); + + } + if (request.CfgScale != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.CfgScale ?? string.Empty), + name: "\"cfg_scale\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareVideoGeneratePostGenerateVideoKlingV3StandardImageToVideoRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoKlingV3StandardImageToVideo", + methodName: "VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoAsync", + pathTemplate: "\"/v2/video/generate/kling-3-standard-image-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoKlingV3StandardImageToVideo", + methodName: "VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoAsync", + pathTemplate: "\"/v2/video/generate/kling-3-standard-image-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoKlingV3StandardImageToVideo", + methodName: "VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoAsync", + pathTemplate: "\"/v2/video/generate/kling-3-standard-image-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessVideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoKlingV3StandardImageToVideo", + methodName: "VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoAsync", + pathTemplate: "\"/v2/video/generate/kling-3-standard-image-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoKlingV3StandardImageToVideo", + methodName: "VideoGeneratePostGenerateVideoKlingV3StandardImageToVideoAsync", + pathTemplate: "\"/v2/video/generate/kling-3-standard-image-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // This account does not have access to this model. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The first-frame image was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessVideoGeneratePostGenerateVideoKlingV3StandardImageToVideoResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.GenerateVideoKlingV3Response.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.GenerateVideoKlingV3Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideo.g.cs b/src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideo.g.cs new file mode 100644 index 00000000..b0f35a63 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.VideoGeneratePostGenerateVideoKlingV3StandardTextToVideo.g.cs @@ -0,0 +1,834 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class VideoGenerateClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoSecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoSecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoSecurityRequirement0, + }; + partial void PrepareVideoGeneratePostGenerateVideoKlingV3StandardTextToVideoArguments( + global::System.Net.Http.HttpClient httpClient, + ref bool? dryRun, + global::Ideogram.GenerateVideoKlingV3StandardTextToVideoRequest request); + partial void PrepareVideoGeneratePostGenerateVideoKlingV3StandardTextToVideoRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + bool? dryRun, + global::Ideogram.GenerateVideoKlingV3StandardTextToVideoRequest request); + partial void ProcessVideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessVideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Text to video with Kling v3 Standard
+ /// Generate a video from a text prompt with Kling v3 Standard.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoAsync( + + global::Ideogram.GenerateVideoKlingV3StandardTextToVideoRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoAsResponseAsync( + + request: request, + dryRun: dryRun, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Text to video with Kling v3 Standard
+ /// Generate a video from a text prompt with Kling v3 Standard.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoAsResponseAsync( + + global::Ideogram.GenerateVideoKlingV3StandardTextToVideoRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareVideoGeneratePostGenerateVideoKlingV3StandardTextToVideoArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoSecurityRequirements, + operationName: "VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/video/generate/kling-3-standard-text-to-video", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareVideoGeneratePostGenerateVideoKlingV3StandardTextToVideoRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoKlingV3StandardTextToVideo", + methodName: "VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoAsync", + pathTemplate: "\"/v2/video/generate/kling-3-standard-text-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoKlingV3StandardTextToVideo", + methodName: "VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoAsync", + pathTemplate: "\"/v2/video/generate/kling-3-standard-text-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoKlingV3StandardTextToVideo", + methodName: "VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoAsync", + pathTemplate: "\"/v2/video/generate/kling-3-standard-text-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessVideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoKlingV3StandardTextToVideo", + methodName: "VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoAsync", + pathTemplate: "\"/v2/video/generate/kling-3-standard-text-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoKlingV3StandardTextToVideo", + methodName: "VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoAsync", + pathTemplate: "\"/v2/video/generate/kling-3-standard-text-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // This account does not have access to this model. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessVideoGeneratePostGenerateVideoKlingV3StandardTextToVideoResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.GenerateVideoKlingV3Response.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.GenerateVideoKlingV3Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Text to video with Kling v3 Standard
+ /// Generate a video from a text prompt with Kling v3 Standard.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// A natural-language prompt describing the video to generate. + /// + /// + /// Description of what to keep out of the video. Descriptions in the prompt take precedence over descriptions in the negative prompt. + /// + /// + /// The aspect ratio of the generated video.
+ /// Default Value: 16x9 + /// + /// + /// The length of the generated video in seconds. Defaults to 5 seconds
+ /// when omitted. + /// + /// + /// Whether to generate an audio track for the video. Audio roughly
+ /// doubles the provider cost and is subject to stricter output moderation.
+ /// Default Value: false + /// + /// + /// How the prompt is staged. `customize` follows the prompt as written;
+ /// `intelligent` lets the model break the prompt into its own shots.
+ /// Default Value: customize + /// + /// + /// How closely the video follows the prompt, from 0 to 1. Lower values
+ /// leave the model more freedom. Defaults to 0.5 when omitted. + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoAsync( + string prompt, + bool? dryRun = default, + string? negativePrompt = default, + global::Ideogram.KlingV3AspectRatio? aspectRatio = default, + int? duration = default, + bool? generateAudio = default, + global::Ideogram.KlingV3ShotType? shotType = default, + string? cfgScale = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Ideogram.GenerateVideoKlingV3StandardTextToVideoRequest + { + Prompt = prompt, + NegativePrompt = negativePrompt, + AspectRatio = aspectRatio, + Duration = duration, + GenerateAudio = generateAudio, + ShotType = shotType, + CfgScale = cfgScale, + WebhookUrl = webhookUrl, + }; + + return await VideoGeneratePostGenerateVideoKlingV3StandardTextToVideoAsync( + dryRun: dryRun, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideo.g.cs b/src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideo.g.cs new file mode 100644 index 00000000..954bbcb2 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideo.g.cs @@ -0,0 +1,2723 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class VideoGenerateClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoSecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoSecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoSecurityRequirement0, + }; + partial void PrepareVideoGeneratePostGenerateVideoMinimaxH3ImageToVideoArguments( + global::System.Net.Http.HttpClient httpClient, + ref bool? dryRun, + global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoRequest request); + partial void PrepareVideoGeneratePostGenerateVideoMinimaxH3ImageToVideoRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + bool? dryRun, + global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoRequest request); + partial void ProcessVideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessVideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Image to video with MiniMax H3
+ /// Generate a video from a first-frame image and a text prompt with
+ /// MiniMax H3. Upload the first frame as `image`, and optionally a final
+ /// frame as `end_image`, using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoAsync( + + global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoAsResponseAsync( + + request: request, + dryRun: dryRun, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Image to video with MiniMax H3
+ /// Generate a video from a first-frame image and a text prompt with
+ /// MiniMax H3. Upload the first frame as `image`, and optionally a final
+ /// frame as `end_image`, using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoAsResponseAsync( + + global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareVideoGeneratePostGenerateVideoMinimaxH3ImageToVideoArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoSecurityRequirements, + operationName: "VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/video/generate/minimax-h3-image-to-video", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.EndImage != default) + { + + var __contentEndImage = new global::System.Net.Http.ByteArrayContent(request.EndImage ?? global::System.Array.Empty()); + __contentEndImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.EndImagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.EndImagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentEndImage, + name: "\"end_image\"", + fileName: request.EndImagename != null ? $"\"{request.EndImagename}\"" : string.Empty); + if (__contentEndImage.Headers.ContentDisposition != null) + { + __contentEndImage.Headers.ContentDisposition.FileNameStar = null; + } + + } + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + if (request.Resolution != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"resolution\""); + + } + if (request.Duration != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Duration, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"duration\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareVideoGeneratePostGenerateVideoMinimaxH3ImageToVideoRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoMinimaxH3ImageToVideo", + methodName: "VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoAsync", + pathTemplate: "\"/v2/video/generate/minimax-h3-image-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoMinimaxH3ImageToVideo", + methodName: "VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoAsync", + pathTemplate: "\"/v2/video/generate/minimax-h3-image-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoMinimaxH3ImageToVideo", + methodName: "VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoAsync", + pathTemplate: "\"/v2/video/generate/minimax-h3-image-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessVideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoMinimaxH3ImageToVideo", + methodName: "VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoAsync", + pathTemplate: "\"/v2/video/generate/minimax-h3-image-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoMinimaxH3ImageToVideo", + methodName: "VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoAsync", + pathTemplate: "\"/v2/video/generate/minimax-h3-image-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // This account does not have access to this model. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The first-frame image was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessVideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.GenerateVideoMinimaxH3Response.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.GenerateVideoMinimaxH3Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Image to video with MiniMax H3
+ /// Generate a video from a first-frame image and a text prompt with
+ /// MiniMax H3. Upload the first frame as `image`, and optionally a final
+ /// frame as `end_image`, using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. + /// + /// + /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. + /// + /// + /// A natural-language prompt describing how the first frame should animate. + /// + /// + /// The resolution tier of the generated video, spelled the way MiniMax
+ /// spells it. `480P` and `768P` are generated natively; `2K` and `4K` are
+ /// upscaled from a `768P` result.
+ /// Higher tiers cost more.
+ /// Default Value: 2K + /// + /// + /// The length of the generated video in seconds.
+ /// Default Value: 5 + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoAsync( + byte[] image, + string imagename, + string prompt, + bool? dryRun = default, + byte[]? endImage = default, + string? endImagename = default, + global::Ideogram.MinimaxH3Resolution? resolution = default, + int? duration = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoRequest + { + Image = image, + Imagename = imagename, + EndImage = endImage, + EndImagename = endImagename, + Prompt = prompt, + Resolution = resolution, + Duration = duration, + WebhookUrl = webhookUrl, + }; + + return await VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoAsync( + dryRun: dryRun, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// Image to video with MiniMax H3
+ /// Generate a video from a first-frame image and a text prompt with
+ /// MiniMax H3. Upload the first frame as `image`, and optionally a final
+ /// frame as `end_image`, using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. + /// + /// + /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. + /// + /// + /// A natural-language prompt describing how the first frame should animate. + /// + /// + /// The resolution tier of the generated video, spelled the way MiniMax
+ /// spells it. `480P` and `768P` are generated natively; `2K` and `4K` are
+ /// upscaled from a `768P` result.
+ /// Higher tiers cost more.
+ /// Default Value: 2K + /// + /// + /// The length of the generated video in seconds.
+ /// Default Value: 5 + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoAsync( + global::System.IO.Stream image, + string imagename, + string prompt, + bool? dryRun = default, + global::System.IO.Stream? endImage = default, + string? endImagename = default, + global::Ideogram.MinimaxH3Resolution? resolution = default, + int? duration = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + var request = new global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoRequest + { + Image = global::System.Array.Empty(), + Imagename = imagename, + EndImage = global::System.Array.Empty(), + EndImagename = endImagename, + Prompt = prompt, + Resolution = resolution, + Duration = duration, + WebhookUrl = webhookUrl, + }; + PrepareArguments( + client: HttpClient); + PrepareVideoGeneratePostGenerateVideoMinimaxH3ImageToVideoArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoSecurityRequirements, + operationName: "VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/video/generate/minimax-h3-image-to-video", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (endImage != default) + { + + var __contentEndImage = new global::System.Net.Http.StreamContent(endImage); + __contentEndImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.EndImagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.EndImagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentEndImage, + name: "\"end_image\"", + fileName: request.EndImagename != null ? $"\"{request.EndImagename}\"" : string.Empty); + if (__contentEndImage.Headers.ContentDisposition != null) + { + __contentEndImage.Headers.ContentDisposition.FileNameStar = null; + } + + } + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + if (request.Resolution != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"resolution\""); + + } + if (request.Duration != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Duration, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"duration\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareVideoGeneratePostGenerateVideoMinimaxH3ImageToVideoRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoMinimaxH3ImageToVideo", + methodName: "VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoAsync", + pathTemplate: "\"/v2/video/generate/minimax-h3-image-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoMinimaxH3ImageToVideo", + methodName: "VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoAsync", + pathTemplate: "\"/v2/video/generate/minimax-h3-image-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoMinimaxH3ImageToVideo", + methodName: "VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoAsync", + pathTemplate: "\"/v2/video/generate/minimax-h3-image-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessVideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoMinimaxH3ImageToVideo", + methodName: "VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoAsync", + pathTemplate: "\"/v2/video/generate/minimax-h3-image-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoMinimaxH3ImageToVideo", + methodName: "VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoAsync", + pathTemplate: "\"/v2/video/generate/minimax-h3-image-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // This account does not have access to this model. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The first-frame image was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessVideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::Ideogram.GenerateVideoMinimaxH3Response.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::Ideogram.GenerateVideoMinimaxH3Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Image to video with MiniMax H3
+ /// Generate a video from a first-frame image and a text prompt with
+ /// MiniMax H3. Upload the first frame as `image`, and optionally a final
+ /// frame as `end_image`, using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. + /// + /// + /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. + /// + /// + /// A natural-language prompt describing how the first frame should animate. + /// + /// + /// The resolution tier of the generated video, spelled the way MiniMax
+ /// spells it. `480P` and `768P` are generated natively; `2K` and `4K` are
+ /// upscaled from a `768P` result.
+ /// Higher tiers cost more.
+ /// Default Value: 2K + /// + /// + /// The length of the generated video in seconds.
+ /// Default Value: 5 + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoAsResponseAsync( + global::System.IO.Stream image, + string imagename, + string prompt, + bool? dryRun = default, + global::System.IO.Stream? endImage = default, + string? endImagename = default, + global::Ideogram.MinimaxH3Resolution? resolution = default, + int? duration = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + var request = new global::Ideogram.VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoRequest + { + Image = global::System.Array.Empty(), + Imagename = imagename, + EndImage = global::System.Array.Empty(), + EndImagename = endImagename, + Prompt = prompt, + Resolution = resolution, + Duration = duration, + WebhookUrl = webhookUrl, + }; + PrepareArguments( + client: HttpClient); + PrepareVideoGeneratePostGenerateVideoMinimaxH3ImageToVideoArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoSecurityRequirements, + operationName: "VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/video/generate/minimax-h3-image-to-video", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (endImage != default) + { + + var __contentEndImage = new global::System.Net.Http.StreamContent(endImage); + __contentEndImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.EndImagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.EndImagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentEndImage, + name: "\"end_image\"", + fileName: request.EndImagename != null ? $"\"{request.EndImagename}\"" : string.Empty); + if (__contentEndImage.Headers.ContentDisposition != null) + { + __contentEndImage.Headers.ContentDisposition.FileNameStar = null; + } + + } + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + if (request.Resolution != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"resolution\""); + + } + if (request.Duration != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Duration, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"duration\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareVideoGeneratePostGenerateVideoMinimaxH3ImageToVideoRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoMinimaxH3ImageToVideo", + methodName: "VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoAsync", + pathTemplate: "\"/v2/video/generate/minimax-h3-image-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoMinimaxH3ImageToVideo", + methodName: "VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoAsync", + pathTemplate: "\"/v2/video/generate/minimax-h3-image-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoMinimaxH3ImageToVideo", + methodName: "VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoAsync", + pathTemplate: "\"/v2/video/generate/minimax-h3-image-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessVideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoMinimaxH3ImageToVideo", + methodName: "VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoAsync", + pathTemplate: "\"/v2/video/generate/minimax-h3-image-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoMinimaxH3ImageToVideo", + methodName: "VideoGeneratePostGenerateVideoMinimaxH3ImageToVideoAsync", + pathTemplate: "\"/v2/video/generate/minimax-h3-image-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // This account does not have access to this model. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The first-frame image was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessVideoGeneratePostGenerateVideoMinimaxH3ImageToVideoResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.GenerateVideoMinimaxH3Response.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.GenerateVideoMinimaxH3Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.VideoGeneratePostGenerateVideoMinimaxH3TextToVideo.g.cs b/src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.VideoGeneratePostGenerateVideoMinimaxH3TextToVideo.g.cs new file mode 100644 index 00000000..cb03a066 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.VideoGeneratePostGenerateVideoMinimaxH3TextToVideo.g.cs @@ -0,0 +1,818 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class VideoGenerateClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_VideoGeneratePostGenerateVideoMinimaxH3TextToVideoSecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_VideoGeneratePostGenerateVideoMinimaxH3TextToVideoSecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_VideoGeneratePostGenerateVideoMinimaxH3TextToVideoSecurityRequirement0, + }; + partial void PrepareVideoGeneratePostGenerateVideoMinimaxH3TextToVideoArguments( + global::System.Net.Http.HttpClient httpClient, + ref bool? dryRun, + global::Ideogram.GenerateVideoMinimaxH3TextToVideoRequest request); + partial void PrepareVideoGeneratePostGenerateVideoMinimaxH3TextToVideoRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + bool? dryRun, + global::Ideogram.GenerateVideoMinimaxH3TextToVideoRequest request); + partial void ProcessVideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessVideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Text to video with MiniMax H3
+ /// Generate a video from a text prompt with MiniMax H3.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task VideoGeneratePostGenerateVideoMinimaxH3TextToVideoAsync( + + global::Ideogram.GenerateVideoMinimaxH3TextToVideoRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await VideoGeneratePostGenerateVideoMinimaxH3TextToVideoAsResponseAsync( + + request: request, + dryRun: dryRun, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Text to video with MiniMax H3
+ /// Generate a video from a text prompt with MiniMax H3.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> VideoGeneratePostGenerateVideoMinimaxH3TextToVideoAsResponseAsync( + + global::Ideogram.GenerateVideoMinimaxH3TextToVideoRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareVideoGeneratePostGenerateVideoMinimaxH3TextToVideoArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_VideoGeneratePostGenerateVideoMinimaxH3TextToVideoSecurityRequirements, + operationName: "VideoGeneratePostGenerateVideoMinimaxH3TextToVideoAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/video/generate/minimax-h3-text-to-video", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareVideoGeneratePostGenerateVideoMinimaxH3TextToVideoRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoMinimaxH3TextToVideo", + methodName: "VideoGeneratePostGenerateVideoMinimaxH3TextToVideoAsync", + pathTemplate: "\"/v2/video/generate/minimax-h3-text-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoMinimaxH3TextToVideo", + methodName: "VideoGeneratePostGenerateVideoMinimaxH3TextToVideoAsync", + pathTemplate: "\"/v2/video/generate/minimax-h3-text-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoMinimaxH3TextToVideo", + methodName: "VideoGeneratePostGenerateVideoMinimaxH3TextToVideoAsync", + pathTemplate: "\"/v2/video/generate/minimax-h3-text-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessVideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoMinimaxH3TextToVideo", + methodName: "VideoGeneratePostGenerateVideoMinimaxH3TextToVideoAsync", + pathTemplate: "\"/v2/video/generate/minimax-h3-text-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoMinimaxH3TextToVideo", + methodName: "VideoGeneratePostGenerateVideoMinimaxH3TextToVideoAsync", + pathTemplate: "\"/v2/video/generate/minimax-h3-text-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // This account does not have access to this model. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessVideoGeneratePostGenerateVideoMinimaxH3TextToVideoResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.GenerateVideoMinimaxH3Response.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.GenerateVideoMinimaxH3Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Text to video with MiniMax H3
+ /// Generate a video from a text prompt with MiniMax H3.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// A natural-language prompt describing the video to generate. + /// + /// + /// The aspect ratio of the generated video.
+ /// Default Value: 16x9 + /// + /// + /// The resolution tier of the generated video, spelled the way MiniMax
+ /// spells it. `480P` and `768P` are generated natively; `2K` and `4K` are
+ /// upscaled from a `768P` result.
+ /// Higher tiers cost more.
+ /// Default Value: 2K + /// + /// + /// The length of the generated video in seconds.
+ /// Default Value: 5 + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task VideoGeneratePostGenerateVideoMinimaxH3TextToVideoAsync( + string prompt, + bool? dryRun = default, + global::Ideogram.MinimaxH3AspectRatio? aspectRatio = default, + global::Ideogram.MinimaxH3Resolution? resolution = default, + int? duration = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Ideogram.GenerateVideoMinimaxH3TextToVideoRequest + { + Prompt = prompt, + AspectRatio = aspectRatio, + Resolution = resolution, + Duration = duration, + WebhookUrl = webhookUrl, + }; + + return await VideoGeneratePostGenerateVideoMinimaxH3TextToVideoAsync( + dryRun: dryRun, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.VideoGeneratePostGenerateVideoSeedDance25ImageToVideo.g.cs b/src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.VideoGeneratePostGenerateVideoSeedDance25ImageToVideo.g.cs new file mode 100644 index 00000000..ad7432d2 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.VideoGeneratePostGenerateVideoSeedDance25ImageToVideo.g.cs @@ -0,0 +1,2759 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class VideoGenerateClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_VideoGeneratePostGenerateVideoSeedDance25ImageToVideoSecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_VideoGeneratePostGenerateVideoSeedDance25ImageToVideoSecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_VideoGeneratePostGenerateVideoSeedDance25ImageToVideoSecurityRequirement0, + }; + partial void PrepareVideoGeneratePostGenerateVideoSeedDance25ImageToVideoArguments( + global::System.Net.Http.HttpClient httpClient, + ref bool? dryRun, + global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoRequest request); + partial void PrepareVideoGeneratePostGenerateVideoSeedDance25ImageToVideoRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + bool? dryRun, + global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoRequest request); + partial void ProcessVideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessVideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Image to video with Seedance 2.5
+ /// Generate a video from a first-frame image and a text prompt with
+ /// Seedance 2.5. Upload the first frame as `image`, and optionally a final
+ /// frame as `end_image`, using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task VideoGeneratePostGenerateVideoSeedDance25ImageToVideoAsync( + + global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await VideoGeneratePostGenerateVideoSeedDance25ImageToVideoAsResponseAsync( + + request: request, + dryRun: dryRun, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Image to video with Seedance 2.5
+ /// Generate a video from a first-frame image and a text prompt with
+ /// Seedance 2.5. Upload the first frame as `image`, and optionally a final
+ /// frame as `end_image`, using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> VideoGeneratePostGenerateVideoSeedDance25ImageToVideoAsResponseAsync( + + global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareVideoGeneratePostGenerateVideoSeedDance25ImageToVideoArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_VideoGeneratePostGenerateVideoSeedDance25ImageToVideoSecurityRequirements, + operationName: "VideoGeneratePostGenerateVideoSeedDance25ImageToVideoAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/video/generate/seedance-2-5-image-to-video", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.EndImage != default) + { + + var __contentEndImage = new global::System.Net.Http.ByteArrayContent(request.EndImage ?? global::System.Array.Empty()); + __contentEndImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.EndImagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.EndImagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentEndImage, + name: "\"end_image\"", + fileName: request.EndImagename != null ? $"\"{request.EndImagename}\"" : string.Empty); + if (__contentEndImage.Headers.ContentDisposition != null) + { + __contentEndImage.Headers.ContentDisposition.FileNameStar = null; + } + + } + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + if (request.Resolution != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"resolution\""); + + } + if (request.Duration != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Duration, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"duration\""); + + } + if (request.GenerateAudio != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.GenerateAudio, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"generate_audio\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareVideoGeneratePostGenerateVideoSeedDance25ImageToVideoRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoSeedDance25ImageToVideo", + methodName: "VideoGeneratePostGenerateVideoSeedDance25ImageToVideoAsync", + pathTemplate: "\"/v2/video/generate/seedance-2-5-image-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoSeedDance25ImageToVideo", + methodName: "VideoGeneratePostGenerateVideoSeedDance25ImageToVideoAsync", + pathTemplate: "\"/v2/video/generate/seedance-2-5-image-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoSeedDance25ImageToVideo", + methodName: "VideoGeneratePostGenerateVideoSeedDance25ImageToVideoAsync", + pathTemplate: "\"/v2/video/generate/seedance-2-5-image-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessVideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoSeedDance25ImageToVideo", + methodName: "VideoGeneratePostGenerateVideoSeedDance25ImageToVideoAsync", + pathTemplate: "\"/v2/video/generate/seedance-2-5-image-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoSeedDance25ImageToVideo", + methodName: "VideoGeneratePostGenerateVideoSeedDance25ImageToVideoAsync", + pathTemplate: "\"/v2/video/generate/seedance-2-5-image-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // This account does not have access to this model. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The first-frame image was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessVideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.GenerateVideoSeedDance25Response.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.GenerateVideoSeedDance25Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Image to video with Seedance 2.5
+ /// Generate a video from a first-frame image and a text prompt with
+ /// Seedance 2.5. Upload the first frame as `image`, and optionally a final
+ /// frame as `end_image`, using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. + /// + /// + /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. + /// + /// + /// A natural-language prompt describing how the first frame should animate. + /// + /// + /// The resolution tier of the generated video.
+ /// Default Value: 720p + /// + /// + /// The length of the generated video in seconds. When omitted, the model
+ /// picks the best duration for the prompt ("auto"). + /// + /// + /// Whether to generate an audio track for the video. Audio roughly
+ /// doubles the provider cost and is subject to stricter output moderation.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task VideoGeneratePostGenerateVideoSeedDance25ImageToVideoAsync( + byte[] image, + string imagename, + string prompt, + bool? dryRun = default, + byte[]? endImage = default, + string? endImagename = default, + global::Ideogram.SeedDance25Resolution? resolution = default, + int? duration = default, + bool? generateAudio = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoRequest + { + Image = image, + Imagename = imagename, + EndImage = endImage, + EndImagename = endImagename, + Prompt = prompt, + Resolution = resolution, + Duration = duration, + GenerateAudio = generateAudio, + WebhookUrl = webhookUrl, + }; + + return await VideoGeneratePostGenerateVideoSeedDance25ImageToVideoAsync( + dryRun: dryRun, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// Image to video with Seedance 2.5
+ /// Generate a video from a first-frame image and a text prompt with
+ /// Seedance 2.5. Upload the first frame as `image`, and optionally a final
+ /// frame as `end_image`, using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. + /// + /// + /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. + /// + /// + /// A natural-language prompt describing how the first frame should animate. + /// + /// + /// The resolution tier of the generated video.
+ /// Default Value: 720p + /// + /// + /// The length of the generated video in seconds. When omitted, the model
+ /// picks the best duration for the prompt ("auto"). + /// + /// + /// Whether to generate an audio track for the video. Audio roughly
+ /// doubles the provider cost and is subject to stricter output moderation.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task VideoGeneratePostGenerateVideoSeedDance25ImageToVideoAsync( + global::System.IO.Stream image, + string imagename, + string prompt, + bool? dryRun = default, + global::System.IO.Stream? endImage = default, + string? endImagename = default, + global::Ideogram.SeedDance25Resolution? resolution = default, + int? duration = default, + bool? generateAudio = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + var request = new global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoRequest + { + Image = global::System.Array.Empty(), + Imagename = imagename, + EndImage = global::System.Array.Empty(), + EndImagename = endImagename, + Prompt = prompt, + Resolution = resolution, + Duration = duration, + GenerateAudio = generateAudio, + WebhookUrl = webhookUrl, + }; + PrepareArguments( + client: HttpClient); + PrepareVideoGeneratePostGenerateVideoSeedDance25ImageToVideoArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_VideoGeneratePostGenerateVideoSeedDance25ImageToVideoSecurityRequirements, + operationName: "VideoGeneratePostGenerateVideoSeedDance25ImageToVideoAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/video/generate/seedance-2-5-image-to-video", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (endImage != default) + { + + var __contentEndImage = new global::System.Net.Http.StreamContent(endImage); + __contentEndImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.EndImagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.EndImagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentEndImage, + name: "\"end_image\"", + fileName: request.EndImagename != null ? $"\"{request.EndImagename}\"" : string.Empty); + if (__contentEndImage.Headers.ContentDisposition != null) + { + __contentEndImage.Headers.ContentDisposition.FileNameStar = null; + } + + } + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + if (request.Resolution != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"resolution\""); + + } + if (request.Duration != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Duration, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"duration\""); + + } + if (request.GenerateAudio != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.GenerateAudio, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"generate_audio\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareVideoGeneratePostGenerateVideoSeedDance25ImageToVideoRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoSeedDance25ImageToVideo", + methodName: "VideoGeneratePostGenerateVideoSeedDance25ImageToVideoAsync", + pathTemplate: "\"/v2/video/generate/seedance-2-5-image-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoSeedDance25ImageToVideo", + methodName: "VideoGeneratePostGenerateVideoSeedDance25ImageToVideoAsync", + pathTemplate: "\"/v2/video/generate/seedance-2-5-image-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoSeedDance25ImageToVideo", + methodName: "VideoGeneratePostGenerateVideoSeedDance25ImageToVideoAsync", + pathTemplate: "\"/v2/video/generate/seedance-2-5-image-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessVideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoSeedDance25ImageToVideo", + methodName: "VideoGeneratePostGenerateVideoSeedDance25ImageToVideoAsync", + pathTemplate: "\"/v2/video/generate/seedance-2-5-image-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoSeedDance25ImageToVideo", + methodName: "VideoGeneratePostGenerateVideoSeedDance25ImageToVideoAsync", + pathTemplate: "\"/v2/video/generate/seedance-2-5-image-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // This account does not have access to this model. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The first-frame image was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessVideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::Ideogram.GenerateVideoSeedDance25Response.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::Ideogram.GenerateVideoSeedDance25Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Image to video with Seedance 2.5
+ /// Generate a video from a first-frame image and a text prompt with
+ /// Seedance 2.5. Upload the first frame as `image`, and optionally a final
+ /// frame as `end_image`, using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. + /// + /// + /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. + /// + /// + /// A natural-language prompt describing how the first frame should animate. + /// + /// + /// The resolution tier of the generated video.
+ /// Default Value: 720p + /// + /// + /// The length of the generated video in seconds. When omitted, the model
+ /// picks the best duration for the prompt ("auto"). + /// + /// + /// Whether to generate an audio track for the video. Audio roughly
+ /// doubles the provider cost and is subject to stricter output moderation.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> VideoGeneratePostGenerateVideoSeedDance25ImageToVideoAsResponseAsync( + global::System.IO.Stream image, + string imagename, + string prompt, + bool? dryRun = default, + global::System.IO.Stream? endImage = default, + string? endImagename = default, + global::Ideogram.SeedDance25Resolution? resolution = default, + int? duration = default, + bool? generateAudio = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + var request = new global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ImageToVideoRequest + { + Image = global::System.Array.Empty(), + Imagename = imagename, + EndImage = global::System.Array.Empty(), + EndImagename = endImagename, + Prompt = prompt, + Resolution = resolution, + Duration = duration, + GenerateAudio = generateAudio, + WebhookUrl = webhookUrl, + }; + PrepareArguments( + client: HttpClient); + PrepareVideoGeneratePostGenerateVideoSeedDance25ImageToVideoArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_VideoGeneratePostGenerateVideoSeedDance25ImageToVideoSecurityRequirements, + operationName: "VideoGeneratePostGenerateVideoSeedDance25ImageToVideoAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/video/generate/seedance-2-5-image-to-video", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (endImage != default) + { + + var __contentEndImage = new global::System.Net.Http.StreamContent(endImage); + __contentEndImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.EndImagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.EndImagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentEndImage, + name: "\"end_image\"", + fileName: request.EndImagename != null ? $"\"{request.EndImagename}\"" : string.Empty); + if (__contentEndImage.Headers.ContentDisposition != null) + { + __contentEndImage.Headers.ContentDisposition.FileNameStar = null; + } + + } + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + if (request.Resolution != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"resolution\""); + + } + if (request.Duration != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Duration, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"duration\""); + + } + if (request.GenerateAudio != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.GenerateAudio, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"generate_audio\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareVideoGeneratePostGenerateVideoSeedDance25ImageToVideoRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoSeedDance25ImageToVideo", + methodName: "VideoGeneratePostGenerateVideoSeedDance25ImageToVideoAsync", + pathTemplate: "\"/v2/video/generate/seedance-2-5-image-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoSeedDance25ImageToVideo", + methodName: "VideoGeneratePostGenerateVideoSeedDance25ImageToVideoAsync", + pathTemplate: "\"/v2/video/generate/seedance-2-5-image-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoSeedDance25ImageToVideo", + methodName: "VideoGeneratePostGenerateVideoSeedDance25ImageToVideoAsync", + pathTemplate: "\"/v2/video/generate/seedance-2-5-image-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessVideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoSeedDance25ImageToVideo", + methodName: "VideoGeneratePostGenerateVideoSeedDance25ImageToVideoAsync", + pathTemplate: "\"/v2/video/generate/seedance-2-5-image-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoSeedDance25ImageToVideo", + methodName: "VideoGeneratePostGenerateVideoSeedDance25ImageToVideoAsync", + pathTemplate: "\"/v2/video/generate/seedance-2-5-image-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // This account does not have access to this model. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The first-frame image was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessVideoGeneratePostGenerateVideoSeedDance25ImageToVideoResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.GenerateVideoSeedDance25Response.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.GenerateVideoSeedDance25Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideo.g.cs b/src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideo.g.cs new file mode 100644 index 00000000..4de64a1b --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideo.g.cs @@ -0,0 +1,955 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class VideoGenerateClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoSecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoSecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoSecurityRequirement0, + }; + partial void PrepareVideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoArguments( + global::System.Net.Http.HttpClient httpClient, + ref bool? dryRun, + global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoRequest request); + partial void PrepareVideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + bool? dryRun, + global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoRequest request); + partial void ProcessVideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessVideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Reference to video with Seedance 2.5
+ /// Generate a video from a text prompt and reference media with
+ /// Seedance 2.5. Upload at least one image in `reference_images`, plus optional
+ /// `reference_audios`, using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoAsync( + + global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoAsResponseAsync( + + request: request, + dryRun: dryRun, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Reference to video with Seedance 2.5
+ /// Generate a video from a text prompt and reference media with
+ /// Seedance 2.5. Upload at least one image in `reference_images`, plus optional
+ /// `reference_audios`, using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoAsResponseAsync( + + global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareVideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoSecurityRequirements, + operationName: "VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/video/generate/seedance-2-5-reference-to-video", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + if (request.ReferenceImages != default) + { + + for (var __iReferenceImages = 0; __iReferenceImages < request.ReferenceImages.Count; __iReferenceImages++) + { + var __contentReferenceImages = new global::System.Net.Http.ByteArrayContent(request.ReferenceImages[__iReferenceImages]); + __contentReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); + __httpRequestContent.Add( + content: __contentReferenceImages, + name: "\"reference_images\"", + fileName: $"\"file{__iReferenceImages}.bin\""); + if (__contentReferenceImages.Headers.ContentDisposition != null) + { + __contentReferenceImages.Headers.ContentDisposition.FileNameStar = null; + } + } + + } + if (request.ReferenceAudios != default) + { + + for (var __iReferenceAudios = 0; __iReferenceAudios < request.ReferenceAudios.Count; __iReferenceAudios++) + { + var __contentReferenceAudios = new global::System.Net.Http.ByteArrayContent(request.ReferenceAudios[__iReferenceAudios]); + __contentReferenceAudios.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); + __httpRequestContent.Add( + content: __contentReferenceAudios, + name: "\"reference_audios\"", + fileName: $"\"file{__iReferenceAudios}.bin\""); + if (__contentReferenceAudios.Headers.ContentDisposition != null) + { + __contentReferenceAudios.Headers.ContentDisposition.FileNameStar = null; + } + } + + } + if (request.AspectRatio != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.AspectRatio).HasValue ? (request.AspectRatio).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"aspect_ratio\""); + + } + if (request.Resolution != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"resolution\""); + + } + if (request.Duration != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Duration, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"duration\""); + + } + if (request.GenerateAudio != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.GenerateAudio, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"generate_audio\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareVideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideo", + methodName: "VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoAsync", + pathTemplate: "\"/v2/video/generate/seedance-2-5-reference-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideo", + methodName: "VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoAsync", + pathTemplate: "\"/v2/video/generate/seedance-2-5-reference-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideo", + methodName: "VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoAsync", + pathTemplate: "\"/v2/video/generate/seedance-2-5-reference-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessVideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideo", + methodName: "VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoAsync", + pathTemplate: "\"/v2/video/generate/seedance-2-5-reference-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideo", + methodName: "VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoAsync", + pathTemplate: "\"/v2/video/generate/seedance-2-5-reference-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // This account does not have access to this model. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // A reference was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessVideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.GenerateVideoSeedDance25Response.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.GenerateVideoSeedDance25Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Reference to video with Seedance 2.5
+ /// Generate a video from a text prompt and reference media with
+ /// Seedance 2.5. Upload at least one image in `reference_images`, plus optional
+ /// `reference_audios`, using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// A natural-language prompt describing the video to produce. Refer to references by position, as in "[Image1] walks toward the camera". + /// + /// + /// Reference images, in prompt order. Common formats such as JPEG, PNG, and WEBP are supported, up to 50MB each. Multipart requests only. Uploaded images are used for this request only and are not stored. + /// + /// + /// MP3 or WAV audio references, in prompt order. Multipart requests only. Each file must be at most 15 MB and between 2 and 30 seconds long, with a combined duration of at most 30 seconds. Requires at least one reference image. Audio is used for this request only and is not saved to your library. + /// + /// + /// The aspect ratio of the generated video. `auto` lets the model choose the
+ /// most suitable ratio from the prompt; any other value pins the ratio.
+ /// Default Value: auto + /// + /// + /// The resolution tier of the generated video.
+ /// Default Value: 720p + /// + /// + /// The length of the generated video in seconds. When omitted, the model
+ /// picks the best duration for the prompt ("auto"). + /// + /// + /// Whether to generate an audio track for the video. Audio roughly
+ /// doubles the provider cost and is subject to stricter output moderation.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoAsync( + string prompt, + bool? dryRun = default, + global::System.Collections.Generic.IList? referenceImages = default, + global::System.Collections.Generic.IList? referenceAudios = default, + global::Ideogram.SeedDance2AspectRatio? aspectRatio = default, + global::Ideogram.SeedDance25Resolution? resolution = default, + int? duration = default, + bool? generateAudio = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Ideogram.VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoRequest + { + Prompt = prompt, + ReferenceImages = referenceImages, + ReferenceAudios = referenceAudios, + AspectRatio = aspectRatio, + Resolution = resolution, + Duration = duration, + GenerateAudio = generateAudio, + WebhookUrl = webhookUrl, + }; + + return await VideoGeneratePostGenerateVideoSeedDance25ReferenceToVideoAsync( + dryRun: dryRun, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.VideoGeneratePostGenerateVideoSeedDance25TextToVideo.g.cs b/src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.VideoGeneratePostGenerateVideoSeedDance25TextToVideo.g.cs new file mode 100644 index 00000000..e86dda2e --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.VideoGeneratePostGenerateVideoSeedDance25TextToVideo.g.cs @@ -0,0 +1,823 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class VideoGenerateClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_VideoGeneratePostGenerateVideoSeedDance25TextToVideoSecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_VideoGeneratePostGenerateVideoSeedDance25TextToVideoSecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_VideoGeneratePostGenerateVideoSeedDance25TextToVideoSecurityRequirement0, + }; + partial void PrepareVideoGeneratePostGenerateVideoSeedDance25TextToVideoArguments( + global::System.Net.Http.HttpClient httpClient, + ref bool? dryRun, + global::Ideogram.GenerateVideoSeedDance25TextToVideoRequest request); + partial void PrepareVideoGeneratePostGenerateVideoSeedDance25TextToVideoRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + bool? dryRun, + global::Ideogram.GenerateVideoSeedDance25TextToVideoRequest request); + partial void ProcessVideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessVideoGeneratePostGenerateVideoSeedDance25TextToVideoResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Text to video with Seedance 2.5
+ /// Generate a video from a text prompt with Seedance 2.5, at up to 1080p and
+ /// 30 seconds. Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task VideoGeneratePostGenerateVideoSeedDance25TextToVideoAsync( + + global::Ideogram.GenerateVideoSeedDance25TextToVideoRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await VideoGeneratePostGenerateVideoSeedDance25TextToVideoAsResponseAsync( + + request: request, + dryRun: dryRun, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Text to video with Seedance 2.5
+ /// Generate a video from a text prompt with Seedance 2.5, at up to 1080p and
+ /// 30 seconds. Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> VideoGeneratePostGenerateVideoSeedDance25TextToVideoAsResponseAsync( + + global::Ideogram.GenerateVideoSeedDance25TextToVideoRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareVideoGeneratePostGenerateVideoSeedDance25TextToVideoArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_VideoGeneratePostGenerateVideoSeedDance25TextToVideoSecurityRequirements, + operationName: "VideoGeneratePostGenerateVideoSeedDance25TextToVideoAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/video/generate/seedance-2-5-text-to-video", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareVideoGeneratePostGenerateVideoSeedDance25TextToVideoRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoSeedDance25TextToVideo", + methodName: "VideoGeneratePostGenerateVideoSeedDance25TextToVideoAsync", + pathTemplate: "\"/v2/video/generate/seedance-2-5-text-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoSeedDance25TextToVideo", + methodName: "VideoGeneratePostGenerateVideoSeedDance25TextToVideoAsync", + pathTemplate: "\"/v2/video/generate/seedance-2-5-text-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoSeedDance25TextToVideo", + methodName: "VideoGeneratePostGenerateVideoSeedDance25TextToVideoAsync", + pathTemplate: "\"/v2/video/generate/seedance-2-5-text-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessVideoGeneratePostGenerateVideoSeedDance25TextToVideoResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoSeedDance25TextToVideo", + methodName: "VideoGeneratePostGenerateVideoSeedDance25TextToVideoAsync", + pathTemplate: "\"/v2/video/generate/seedance-2-5-text-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoSeedDance25TextToVideo", + methodName: "VideoGeneratePostGenerateVideoSeedDance25TextToVideoAsync", + pathTemplate: "\"/v2/video/generate/seedance-2-5-text-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // This account does not have access to this model. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessVideoGeneratePostGenerateVideoSeedDance25TextToVideoResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.GenerateVideoSeedDance25Response.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.GenerateVideoSeedDance25Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Text to video with Seedance 2.5
+ /// Generate a video from a text prompt with Seedance 2.5, at up to 1080p and
+ /// 30 seconds. Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// A natural-language prompt describing the video to generate. + /// + /// + /// The aspect ratio of the generated video. `auto` lets the model choose the
+ /// most suitable ratio from the prompt; any other value pins the ratio.
+ /// Default Value: auto + /// + /// + /// The resolution tier of the generated video.
+ /// Default Value: 720p + /// + /// + /// The length of the generated video in seconds. When omitted, the model
+ /// picks the best duration for the prompt ("auto"). + /// + /// + /// Whether to generate an audio track for the video. Audio roughly
+ /// doubles the provider cost and is subject to stricter output moderation.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task VideoGeneratePostGenerateVideoSeedDance25TextToVideoAsync( + string prompt, + bool? dryRun = default, + global::Ideogram.SeedDance2AspectRatio? aspectRatio = default, + global::Ideogram.SeedDance25Resolution? resolution = default, + int? duration = default, + bool? generateAudio = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Ideogram.GenerateVideoSeedDance25TextToVideoRequest + { + Prompt = prompt, + AspectRatio = aspectRatio, + Resolution = resolution, + Duration = duration, + GenerateAudio = generateAudio, + WebhookUrl = webhookUrl, + }; + + return await VideoGeneratePostGenerateVideoSeedDance25TextToVideoAsync( + dryRun: dryRun, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.VideoGeneratePostGenerateVideoSeedDance2ImageToVideo.g.cs b/src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.VideoGeneratePostGenerateVideoSeedDance2ImageToVideo.g.cs new file mode 100644 index 00000000..81bf6f17 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.VideoGeneratePostGenerateVideoSeedDance2ImageToVideo.g.cs @@ -0,0 +1,2804 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class VideoGenerateClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_VideoGeneratePostGenerateVideoSeedDance2ImageToVideoSecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_VideoGeneratePostGenerateVideoSeedDance2ImageToVideoSecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_VideoGeneratePostGenerateVideoSeedDance2ImageToVideoSecurityRequirement0, + }; + partial void PrepareVideoGeneratePostGenerateVideoSeedDance2ImageToVideoArguments( + global::System.Net.Http.HttpClient httpClient, + ref bool? dryRun, + global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoRequest request); + partial void PrepareVideoGeneratePostGenerateVideoSeedDance2ImageToVideoRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + bool? dryRun, + global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoRequest request); + partial void ProcessVideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessVideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Image to video with Seedance 2.0
+ /// Generate one or more videos from a first-frame image and a text prompt
+ /// with Seedance 2.0. Upload the first frame as `image`, and optionally a final
+ /// frame as `end_image`, using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task VideoGeneratePostGenerateVideoSeedDance2ImageToVideoAsync( + + global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await VideoGeneratePostGenerateVideoSeedDance2ImageToVideoAsResponseAsync( + + request: request, + dryRun: dryRun, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Image to video with Seedance 2.0
+ /// Generate one or more videos from a first-frame image and a text prompt
+ /// with Seedance 2.0. Upload the first frame as `image`, and optionally a final
+ /// frame as `end_image`, using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> VideoGeneratePostGenerateVideoSeedDance2ImageToVideoAsResponseAsync( + + global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareVideoGeneratePostGenerateVideoSeedDance2ImageToVideoArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_VideoGeneratePostGenerateVideoSeedDance2ImageToVideoSecurityRequirements, + operationName: "VideoGeneratePostGenerateVideoSeedDance2ImageToVideoAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/video/generate/seedance-2-image-to-video", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.EndImage != default) + { + + var __contentEndImage = new global::System.Net.Http.ByteArrayContent(request.EndImage ?? global::System.Array.Empty()); + __contentEndImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.EndImagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.EndImagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentEndImage, + name: "\"end_image\"", + fileName: request.EndImagename != null ? $"\"{request.EndImagename}\"" : string.Empty); + if (__contentEndImage.Headers.ContentDisposition != null) + { + __contentEndImage.Headers.ContentDisposition.FileNameStar = null; + } + + } + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + if (request.AspectRatio != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.AspectRatio).HasValue ? (request.AspectRatio).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"aspect_ratio\""); + + } + if (request.Resolution != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"resolution\""); + + } + if (request.Duration != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Duration, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"duration\""); + + } + if (request.GenerateAudio != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.GenerateAudio, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"generate_audio\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareVideoGeneratePostGenerateVideoSeedDance2ImageToVideoRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoSeedDance2ImageToVideo", + methodName: "VideoGeneratePostGenerateVideoSeedDance2ImageToVideoAsync", + pathTemplate: "\"/v2/video/generate/seedance-2-image-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoSeedDance2ImageToVideo", + methodName: "VideoGeneratePostGenerateVideoSeedDance2ImageToVideoAsync", + pathTemplate: "\"/v2/video/generate/seedance-2-image-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoSeedDance2ImageToVideo", + methodName: "VideoGeneratePostGenerateVideoSeedDance2ImageToVideoAsync", + pathTemplate: "\"/v2/video/generate/seedance-2-image-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessVideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoSeedDance2ImageToVideo", + methodName: "VideoGeneratePostGenerateVideoSeedDance2ImageToVideoAsync", + pathTemplate: "\"/v2/video/generate/seedance-2-image-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoSeedDance2ImageToVideo", + methodName: "VideoGeneratePostGenerateVideoSeedDance2ImageToVideoAsync", + pathTemplate: "\"/v2/video/generate/seedance-2-image-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // This account does not have access to this model. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The first-frame image was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessVideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.GenerateVideoSeedDance2Response.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.GenerateVideoSeedDance2Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Image to video with Seedance 2.0
+ /// Generate one or more videos from a first-frame image and a text prompt
+ /// with Seedance 2.0. Upload the first frame as `image`, and optionally a final
+ /// frame as `end_image`, using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. + /// + /// + /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. + /// + /// + /// A natural-language prompt describing how the first frame should animate. + /// + /// + /// The aspect ratio of the generated video. `auto` lets the model choose the
+ /// most suitable ratio from the prompt; any other value pins the ratio.
+ /// Default Value: auto + /// + /// + /// The resolution tier of the generated video.
+ /// Default Value: 720p + /// + /// + /// The length of the generated video in seconds. When omitted, the model
+ /// picks the best duration for the prompt ("auto"). + /// + /// + /// Whether to generate an audio track for the video. Audio roughly
+ /// doubles the provider cost and is subject to stricter output moderation.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task VideoGeneratePostGenerateVideoSeedDance2ImageToVideoAsync( + byte[] image, + string imagename, + string prompt, + bool? dryRun = default, + byte[]? endImage = default, + string? endImagename = default, + global::Ideogram.SeedDance2AspectRatio? aspectRatio = default, + global::Ideogram.SeedDance2Resolution? resolution = default, + int? duration = default, + bool? generateAudio = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoRequest + { + Image = image, + Imagename = imagename, + EndImage = endImage, + EndImagename = endImagename, + Prompt = prompt, + AspectRatio = aspectRatio, + Resolution = resolution, + Duration = duration, + GenerateAudio = generateAudio, + WebhookUrl = webhookUrl, + }; + + return await VideoGeneratePostGenerateVideoSeedDance2ImageToVideoAsync( + dryRun: dryRun, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// Image to video with Seedance 2.0
+ /// Generate one or more videos from a first-frame image and a text prompt
+ /// with Seedance 2.0. Upload the first frame as `image`, and optionally a final
+ /// frame as `end_image`, using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. + /// + /// + /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. + /// + /// + /// A natural-language prompt describing how the first frame should animate. + /// + /// + /// The aspect ratio of the generated video. `auto` lets the model choose the
+ /// most suitable ratio from the prompt; any other value pins the ratio.
+ /// Default Value: auto + /// + /// + /// The resolution tier of the generated video.
+ /// Default Value: 720p + /// + /// + /// The length of the generated video in seconds. When omitted, the model
+ /// picks the best duration for the prompt ("auto"). + /// + /// + /// Whether to generate an audio track for the video. Audio roughly
+ /// doubles the provider cost and is subject to stricter output moderation.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task VideoGeneratePostGenerateVideoSeedDance2ImageToVideoAsync( + global::System.IO.Stream image, + string imagename, + string prompt, + bool? dryRun = default, + global::System.IO.Stream? endImage = default, + string? endImagename = default, + global::Ideogram.SeedDance2AspectRatio? aspectRatio = default, + global::Ideogram.SeedDance2Resolution? resolution = default, + int? duration = default, + bool? generateAudio = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + var request = new global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoRequest + { + Image = global::System.Array.Empty(), + Imagename = imagename, + EndImage = global::System.Array.Empty(), + EndImagename = endImagename, + Prompt = prompt, + AspectRatio = aspectRatio, + Resolution = resolution, + Duration = duration, + GenerateAudio = generateAudio, + WebhookUrl = webhookUrl, + }; + PrepareArguments( + client: HttpClient); + PrepareVideoGeneratePostGenerateVideoSeedDance2ImageToVideoArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_VideoGeneratePostGenerateVideoSeedDance2ImageToVideoSecurityRequirements, + operationName: "VideoGeneratePostGenerateVideoSeedDance2ImageToVideoAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/video/generate/seedance-2-image-to-video", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (endImage != default) + { + + var __contentEndImage = new global::System.Net.Http.StreamContent(endImage); + __contentEndImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.EndImagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.EndImagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentEndImage, + name: "\"end_image\"", + fileName: request.EndImagename != null ? $"\"{request.EndImagename}\"" : string.Empty); + if (__contentEndImage.Headers.ContentDisposition != null) + { + __contentEndImage.Headers.ContentDisposition.FileNameStar = null; + } + + } + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + if (request.AspectRatio != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.AspectRatio).HasValue ? (request.AspectRatio).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"aspect_ratio\""); + + } + if (request.Resolution != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"resolution\""); + + } + if (request.Duration != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Duration, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"duration\""); + + } + if (request.GenerateAudio != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.GenerateAudio, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"generate_audio\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareVideoGeneratePostGenerateVideoSeedDance2ImageToVideoRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoSeedDance2ImageToVideo", + methodName: "VideoGeneratePostGenerateVideoSeedDance2ImageToVideoAsync", + pathTemplate: "\"/v2/video/generate/seedance-2-image-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoSeedDance2ImageToVideo", + methodName: "VideoGeneratePostGenerateVideoSeedDance2ImageToVideoAsync", + pathTemplate: "\"/v2/video/generate/seedance-2-image-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoSeedDance2ImageToVideo", + methodName: "VideoGeneratePostGenerateVideoSeedDance2ImageToVideoAsync", + pathTemplate: "\"/v2/video/generate/seedance-2-image-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessVideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoSeedDance2ImageToVideo", + methodName: "VideoGeneratePostGenerateVideoSeedDance2ImageToVideoAsync", + pathTemplate: "\"/v2/video/generate/seedance-2-image-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoSeedDance2ImageToVideo", + methodName: "VideoGeneratePostGenerateVideoSeedDance2ImageToVideoAsync", + pathTemplate: "\"/v2/video/generate/seedance-2-image-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // This account does not have access to this model. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The first-frame image was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessVideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::Ideogram.GenerateVideoSeedDance2Response.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::Ideogram.GenerateVideoSeedDance2Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Image to video with Seedance 2.0
+ /// Generate one or more videos from a first-frame image and a text prompt
+ /// with Seedance 2.0. Upload the first frame as `image`, and optionally a final
+ /// frame as `end_image`, using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored. + /// + /// + /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. + /// + /// + /// An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one. + /// + /// + /// A natural-language prompt describing how the first frame should animate. + /// + /// + /// The aspect ratio of the generated video. `auto` lets the model choose the
+ /// most suitable ratio from the prompt; any other value pins the ratio.
+ /// Default Value: auto + /// + /// + /// The resolution tier of the generated video.
+ /// Default Value: 720p + /// + /// + /// The length of the generated video in seconds. When omitted, the model
+ /// picks the best duration for the prompt ("auto"). + /// + /// + /// Whether to generate an audio track for the video. Audio roughly
+ /// doubles the provider cost and is subject to stricter output moderation.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> VideoGeneratePostGenerateVideoSeedDance2ImageToVideoAsResponseAsync( + global::System.IO.Stream image, + string imagename, + string prompt, + bool? dryRun = default, + global::System.IO.Stream? endImage = default, + string? endImagename = default, + global::Ideogram.SeedDance2AspectRatio? aspectRatio = default, + global::Ideogram.SeedDance2Resolution? resolution = default, + int? duration = default, + bool? generateAudio = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + var request = new global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ImageToVideoRequest + { + Image = global::System.Array.Empty(), + Imagename = imagename, + EndImage = global::System.Array.Empty(), + EndImagename = endImagename, + Prompt = prompt, + AspectRatio = aspectRatio, + Resolution = resolution, + Duration = duration, + GenerateAudio = generateAudio, + WebhookUrl = webhookUrl, + }; + PrepareArguments( + client: HttpClient); + PrepareVideoGeneratePostGenerateVideoSeedDance2ImageToVideoArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_VideoGeneratePostGenerateVideoSeedDance2ImageToVideoSecurityRequirements, + operationName: "VideoGeneratePostGenerateVideoSeedDance2ImageToVideoAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/video/generate/seedance-2-image-to-video", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (endImage != default) + { + + var __contentEndImage = new global::System.Net.Http.StreamContent(endImage); + __contentEndImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.EndImagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.EndImagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentEndImage, + name: "\"end_image\"", + fileName: request.EndImagename != null ? $"\"{request.EndImagename}\"" : string.Empty); + if (__contentEndImage.Headers.ContentDisposition != null) + { + __contentEndImage.Headers.ContentDisposition.FileNameStar = null; + } + + } + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + if (request.AspectRatio != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.AspectRatio).HasValue ? (request.AspectRatio).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"aspect_ratio\""); + + } + if (request.Resolution != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"resolution\""); + + } + if (request.Duration != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Duration, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"duration\""); + + } + if (request.GenerateAudio != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.GenerateAudio, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"generate_audio\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareVideoGeneratePostGenerateVideoSeedDance2ImageToVideoRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoSeedDance2ImageToVideo", + methodName: "VideoGeneratePostGenerateVideoSeedDance2ImageToVideoAsync", + pathTemplate: "\"/v2/video/generate/seedance-2-image-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoSeedDance2ImageToVideo", + methodName: "VideoGeneratePostGenerateVideoSeedDance2ImageToVideoAsync", + pathTemplate: "\"/v2/video/generate/seedance-2-image-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoSeedDance2ImageToVideo", + methodName: "VideoGeneratePostGenerateVideoSeedDance2ImageToVideoAsync", + pathTemplate: "\"/v2/video/generate/seedance-2-image-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessVideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoSeedDance2ImageToVideo", + methodName: "VideoGeneratePostGenerateVideoSeedDance2ImageToVideoAsync", + pathTemplate: "\"/v2/video/generate/seedance-2-image-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoSeedDance2ImageToVideo", + methodName: "VideoGeneratePostGenerateVideoSeedDance2ImageToVideoAsync", + pathTemplate: "\"/v2/video/generate/seedance-2-image-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // This account does not have access to this model. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The first-frame image was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessVideoGeneratePostGenerateVideoSeedDance2ImageToVideoResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.GenerateVideoSeedDance2Response.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.GenerateVideoSeedDance2Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideo.g.cs b/src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideo.g.cs new file mode 100644 index 00000000..b5b43421 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideo.g.cs @@ -0,0 +1,955 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class VideoGenerateClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoSecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoSecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoSecurityRequirement0, + }; + partial void PrepareVideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoArguments( + global::System.Net.Http.HttpClient httpClient, + ref bool? dryRun, + global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoRequest request); + partial void PrepareVideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + bool? dryRun, + global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoRequest request); + partial void ProcessVideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessVideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Reference to video with Seedance 2.0
+ /// Generate a video from a text prompt and reference media with
+ /// Seedance 2.0. Upload at least one image in `reference_images`, plus optional
+ /// `reference_audios`, using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoAsync( + + global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoAsResponseAsync( + + request: request, + dryRun: dryRun, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Reference to video with Seedance 2.0
+ /// Generate a video from a text prompt and reference media with
+ /// Seedance 2.0. Upload at least one image in `reference_images`, plus optional
+ /// `reference_audios`, using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoAsResponseAsync( + + global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareVideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoSecurityRequirements, + operationName: "VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/video/generate/seedance-2-reference-to-video", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + if (request.ReferenceImages != default) + { + + for (var __iReferenceImages = 0; __iReferenceImages < request.ReferenceImages.Count; __iReferenceImages++) + { + var __contentReferenceImages = new global::System.Net.Http.ByteArrayContent(request.ReferenceImages[__iReferenceImages]); + __contentReferenceImages.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); + __httpRequestContent.Add( + content: __contentReferenceImages, + name: "\"reference_images\"", + fileName: $"\"file{__iReferenceImages}.bin\""); + if (__contentReferenceImages.Headers.ContentDisposition != null) + { + __contentReferenceImages.Headers.ContentDisposition.FileNameStar = null; + } + } + + } + if (request.ReferenceAudios != default) + { + + for (var __iReferenceAudios = 0; __iReferenceAudios < request.ReferenceAudios.Count; __iReferenceAudios++) + { + var __contentReferenceAudios = new global::System.Net.Http.ByteArrayContent(request.ReferenceAudios[__iReferenceAudios]); + __contentReferenceAudios.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); + __httpRequestContent.Add( + content: __contentReferenceAudios, + name: "\"reference_audios\"", + fileName: $"\"file{__iReferenceAudios}.bin\""); + if (__contentReferenceAudios.Headers.ContentDisposition != null) + { + __contentReferenceAudios.Headers.ContentDisposition.FileNameStar = null; + } + } + + } + if (request.AspectRatio != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.AspectRatio).HasValue ? (request.AspectRatio).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"aspect_ratio\""); + + } + if (request.Resolution != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Resolution).HasValue ? (request.Resolution).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"resolution\""); + + } + if (request.Duration != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Duration, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"duration\""); + + } + if (request.GenerateAudio != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.GenerateAudio, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"generate_audio\""); + + } + if (request.WebhookUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.WebhookUrl ?? string.Empty), + name: "\"webhook_url\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareVideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideo", + methodName: "VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoAsync", + pathTemplate: "\"/v2/video/generate/seedance-2-reference-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideo", + methodName: "VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoAsync", + pathTemplate: "\"/v2/video/generate/seedance-2-reference-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideo", + methodName: "VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoAsync", + pathTemplate: "\"/v2/video/generate/seedance-2-reference-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessVideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideo", + methodName: "VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoAsync", + pathTemplate: "\"/v2/video/generate/seedance-2-reference-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideo", + methodName: "VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoAsync", + pathTemplate: "\"/v2/video/generate/seedance-2-reference-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // This account does not have access to this model. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // A reference was not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + string? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_404, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessVideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.GenerateVideoSeedDance2Response.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.GenerateVideoSeedDance2Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Reference to video with Seedance 2.0
+ /// Generate a video from a text prompt and reference media with
+ /// Seedance 2.0. Upload at least one image in `reference_images`, plus optional
+ /// `reference_audios`, using `multipart/form-data`.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// A natural-language prompt describing the video to produce. Refer to references by position, as in "@Image1 walks toward the camera". + /// + /// + /// Reference images, in prompt order. Common formats such as JPEG, PNG, and WEBP are supported, up to 50MB each. Multipart requests only. Uploaded images are used for this request only and are not stored. + /// + /// + /// MP3 or WAV audio references, in prompt order. Multipart requests only. Each file must be at most 15 MB and between 2 and 15 seconds long, with a combined duration of at most 15 seconds. Requires at least one reference image. Audio is used for this request only and is not saved to your library. + /// + /// + /// The aspect ratio of the generated video. `auto` lets the model choose the
+ /// most suitable ratio from the prompt; any other value pins the ratio.
+ /// Default Value: auto + /// + /// + /// The resolution tier of the generated video.
+ /// Default Value: 720p + /// + /// + /// The length of the generated video in seconds. When omitted, the model
+ /// picks the best duration for the prompt ("auto"). + /// + /// + /// Whether to generate an audio track for the video. Audio roughly
+ /// doubles the provider cost and is subject to stricter output moderation.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoAsync( + string prompt, + bool? dryRun = default, + global::System.Collections.Generic.IList? referenceImages = default, + global::System.Collections.Generic.IList? referenceAudios = default, + global::Ideogram.SeedDance2AspectRatio? aspectRatio = default, + global::Ideogram.SeedDance2Resolution? resolution = default, + int? duration = default, + bool? generateAudio = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Ideogram.VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoRequest + { + Prompt = prompt, + ReferenceImages = referenceImages, + ReferenceAudios = referenceAudios, + AspectRatio = aspectRatio, + Resolution = resolution, + Duration = duration, + GenerateAudio = generateAudio, + WebhookUrl = webhookUrl, + }; + + return await VideoGeneratePostGenerateVideoSeedDance2ReferenceToVideoAsync( + dryRun: dryRun, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.VideoGeneratePostGenerateVideoSeedDance2TextToVideo.g.cs b/src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.VideoGeneratePostGenerateVideoSeedDance2TextToVideo.g.cs new file mode 100644 index 00000000..9a000748 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.VideoGenerateClient.VideoGeneratePostGenerateVideoSeedDance2TextToVideo.g.cs @@ -0,0 +1,823 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class VideoGenerateClient + { + + + private static readonly global::Ideogram.EndPointSecurityRequirement s_VideoGeneratePostGenerateVideoSeedDance2TextToVideoSecurityRequirement0 = + new global::Ideogram.EndPointSecurityRequirement + { + Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] + { new global::Ideogram.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Ideogram.EndPointSecurityRequirement[] s_VideoGeneratePostGenerateVideoSeedDance2TextToVideoSecurityRequirements = + new global::Ideogram.EndPointSecurityRequirement[] + { s_VideoGeneratePostGenerateVideoSeedDance2TextToVideoSecurityRequirement0, + }; + partial void PrepareVideoGeneratePostGenerateVideoSeedDance2TextToVideoArguments( + global::System.Net.Http.HttpClient httpClient, + ref bool? dryRun, + global::Ideogram.GenerateVideoSeedDance2TextToVideoRequest request); + partial void PrepareVideoGeneratePostGenerateVideoSeedDance2TextToVideoRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + bool? dryRun, + global::Ideogram.GenerateVideoSeedDance2TextToVideoRequest request); + partial void ProcessVideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessVideoGeneratePostGenerateVideoSeedDance2TextToVideoResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Text to video with Seedance 2.0
+ /// Generate one or more videos from a text prompt with Seedance 2.0.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task VideoGeneratePostGenerateVideoSeedDance2TextToVideoAsync( + + global::Ideogram.GenerateVideoSeedDance2TextToVideoRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await VideoGeneratePostGenerateVideoSeedDance2TextToVideoAsResponseAsync( + + request: request, + dryRun: dryRun, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Text to video with Seedance 2.0
+ /// Generate one or more videos from a text prompt with Seedance 2.0.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> VideoGeneratePostGenerateVideoSeedDance2TextToVideoAsResponseAsync( + + global::Ideogram.GenerateVideoSeedDance2TextToVideoRequest request, + bool? dryRun = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareVideoGeneratePostGenerateVideoSeedDance2TextToVideoArguments( + httpClient: HttpClient, + dryRun: ref dryRun, + request: request); + + + var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_VideoGeneratePostGenerateVideoSeedDance2TextToVideoSecurityRequirements, + operationName: "VideoGeneratePostGenerateVideoSeedDance2TextToVideoAsync"); + + using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v2/video/generate/seedance-2-text-to-video", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareVideoGeneratePostGenerateVideoSeedDance2TextToVideoRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dryRun: dryRun, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoSeedDance2TextToVideo", + methodName: "VideoGeneratePostGenerateVideoSeedDance2TextToVideoAsync", + pathTemplate: "\"/v2/video/generate/seedance-2-text-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoSeedDance2TextToVideo", + methodName: "VideoGeneratePostGenerateVideoSeedDance2TextToVideoAsync", + pathTemplate: "\"/v2/video/generate/seedance-2-text-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoSeedDance2TextToVideo", + methodName: "VideoGeneratePostGenerateVideoSeedDance2TextToVideoAsync", + pathTemplate: "\"/v2/video/generate/seedance-2-text-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessVideoGeneratePostGenerateVideoSeedDance2TextToVideoResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoSeedDance2TextToVideo", + methodName: "VideoGeneratePostGenerateVideoSeedDance2TextToVideoAsync", + pathTemplate: "\"/v2/video/generate/seedance-2-text-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "VideoGeneratePostGenerateVideoSeedDance2TextToVideo", + methodName: "VideoGeneratePostGenerateVideoSeedDance2TextToVideoAsync", + pathTemplate: "\"/v2/video/generate/seedance-2-text-to-video\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input provided. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + string? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_400, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + string? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_401, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient credits or quota. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::Ideogram.GenerationErrorResponse? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::Ideogram.GenerationErrorResponse.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // This account does not have access to this model. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + string? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_403, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The prompt did not pass safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + string? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_422, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many requests. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Ideogram.GenerationErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Ideogram.GenerationErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + string? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_500, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The endpoint is temporarily unavailable. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + string? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_503, typeof(string), JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessVideoGeneratePostGenerateVideoSeedDance2TextToVideoResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Ideogram.GenerateVideoSeedDance2Response.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Ideogram.GenerateVideoSeedDance2Response.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Ideogram.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Ideogram.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Text to video with Seedance 2.0
+ /// Generate one or more videos from a text prompt with Seedance 2.0.
+ /// Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`
+ /// or supply a `webhook_url`. + ///
+ /// + /// Default Value: false + /// + /// + /// A natural-language prompt describing the video to generate. + /// + /// + /// The aspect ratio of the generated video. `auto` lets the model choose the
+ /// most suitable ratio from the prompt; any other value pins the ratio.
+ /// Default Value: auto + /// + /// + /// The resolution tier of the generated video.
+ /// Default Value: 720p + /// + /// + /// The length of the generated video in seconds. When omitted, the model
+ /// picks the best duration for the prompt ("auto"). + /// + /// + /// Whether to generate an audio track for the video. Audio roughly
+ /// doubles the provider cost and is subject to stricter output moderation.
+ /// Default Value: false + /// + /// + /// HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a
+ /// JSON POST to this URL once all images for the request have finished
+ /// generating. The body mirrors the synchronous generate response:
+ /// `request_id`, `created`, and a `data` array
+ /// containing every generated image (`url`, `prompt`, `resolution`, `seed`,
+ /// `is_image_safe`). Each delivery is signed with Ed25519 and verifiable
+ /// against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;
+ /// private and loopback hosts and the cloud metadata service are rejected. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task VideoGeneratePostGenerateVideoSeedDance2TextToVideoAsync( + string prompt, + bool? dryRun = default, + global::Ideogram.SeedDance2AspectRatio? aspectRatio = default, + global::Ideogram.SeedDance2Resolution? resolution = default, + int? duration = default, + bool? generateAudio = default, + string? webhookUrl = default, + global::Ideogram.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Ideogram.GenerateVideoSeedDance2TextToVideoRequest + { + Prompt = prompt, + AspectRatio = aspectRatio, + Resolution = resolution, + Duration = duration, + GenerateAudio = generateAudio, + WebhookUrl = webhookUrl, + }; + + return await VideoGeneratePostGenerateVideoSeedDance2TextToVideoAsync( + dryRun: dryRun, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Vision.JsonSerializerContext.g.cs b/src/libs/Ideogram/Generated/Ideogram.Vision.JsonSerializerContext.g.cs deleted file mode 100644 index ebac11bb..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Vision.JsonSerializerContext.g.cs +++ /dev/null @@ -1,231 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull - )] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4JsonPrompt))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(byte[]))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DescribeResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.Description))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DescribeRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DescribeModelVersion), TypeInfoPropertyName = "DescribeModelVersion2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DescribeRequestV4))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DescribeResponseV4))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.ImageSafetyError))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4StyleDescription))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4CompositionalDeconstruction))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4PromptElement), TypeInfoPropertyName = "V4PromptElement2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4ObjPromptElement))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4TextPromptElement))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4PromptElementDiscriminator))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4PromptElementDiscriminatorType), TypeInfoPropertyName = "V4PromptElementDiscriminatorType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4ObjPromptElementType), TypeInfoPropertyName = "V4ObjPromptElementType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4TextPromptElementType), TypeInfoPropertyName = "V4TextPromptElementType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DescribeModelVersion?), TypeInfoPropertyName = "NullableDescribeModelVersion2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4PromptElement?), TypeInfoPropertyName = "NullableV4PromptElement2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4PromptElementDiscriminatorType?), TypeInfoPropertyName = "NullableV4PromptElementDiscriminatorType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4ObjPromptElementType?), TypeInfoPropertyName = "NullableV4ObjPromptElementType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.V4TextPromptElementType?), TypeInfoPropertyName = "NullableV4TextPromptElementType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - internal sealed partial class VisionSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext - { - } - /// - /// - /// - public sealed partial class VisionSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext - { - private static readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver Resolver = new LazyChunkResolver(); - - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - internal static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver TypeInfoResolver => Resolver; - - - private static readonly global::System.Text.Json.JsonSerializerOptions DefaultOptions = CreateDefaultOptions(); - - /// - /// - /// - public static VisionSourceGenerationContext Default { get; } = new(DefaultOptions); - - private VisionSourceGenerationContext(global::System.Text.Json.JsonSerializerOptions options) - : base(options) - { - } - - /// - protected override global::System.Text.Json.JsonSerializerOptions? GeneratedSerializerOptions => DefaultOptions; - - /// - public override global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo(global::System.Type type) - { - return Resolver.GetTypeInfo(type, Options); - } - - /// - /// Adds this package's converters to . - /// - /// - /// A converter has to be on the options a chained resolver builds its JsonTypeInfo against, - /// and a context resolves types from every package below it. Each package contributes only - /// what it owns and calls down the chain for the rest, so the family's converter table is - /// written once rather than copied into all of them. - /// - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) - { - options.Converters.Add(new global::Ideogram.JsonConverters.V4PromptElementJsonConverter()); - options.Converters.Add(new global::Ideogram.JsonConverters.UnixTimestampJsonConverter()); - options.Converters.Add(new LazyEnumJsonConverterFactory()); - } - - private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() - { - var options = new global::System.Text.Json.JsonSerializerOptions - { - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, - TypeInfoResolver = Resolver, - }; - AddConverters(options); - - return options; - } - - - private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory - { - public override bool CanConvert(global::System.Type typeToConvert) - { - return - typeToConvert == typeof(global::Ideogram.V4PromptElementDiscriminatorType) - - || typeToConvert == typeof(global::Ideogram.V4PromptElementDiscriminatorType?) - - || typeToConvert == typeof(global::Ideogram.V4ObjPromptElementType) - - || typeToConvert == typeof(global::Ideogram.V4ObjPromptElementType?) - - || typeToConvert == typeof(global::Ideogram.V4TextPromptElementType) - - || typeToConvert == typeof(global::Ideogram.V4TextPromptElementType?) - - || typeToConvert == typeof(global::Ideogram.DescribeModelVersion) - - || typeToConvert == typeof(global::Ideogram.DescribeModelVersion?); - } - - public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - if (typeToConvert == typeof(global::Ideogram.V4PromptElementDiscriminatorType)) - { - return new global::Ideogram.JsonConverters.V4PromptElementDiscriminatorTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.V4PromptElementDiscriminatorType?)) - { - return new global::Ideogram.JsonConverters.V4PromptElementDiscriminatorTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.V4ObjPromptElementType)) - { - return new global::Ideogram.JsonConverters.V4ObjPromptElementTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.V4ObjPromptElementType?)) - { - return new global::Ideogram.JsonConverters.V4ObjPromptElementTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.V4TextPromptElementType)) - { - return new global::Ideogram.JsonConverters.V4TextPromptElementTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.V4TextPromptElementType?)) - { - return new global::Ideogram.JsonConverters.V4TextPromptElementTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.DescribeModelVersion)) - { - return new global::Ideogram.JsonConverters.DescribeModelVersionJsonConverter(); - } - - if (typeToConvert == typeof(global::Ideogram.DescribeModelVersion?)) - { - return new global::Ideogram.JsonConverters.DescribeModelVersionNullableJsonConverter(); - } - throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); - } - } - - private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver - { - private readonly object _gate = new(); - private readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[] _resolvers = new global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[1]; - - public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo( - global::System.Type type, - global::System.Text.Json.JsonSerializerOptions options) - { - for (var index = 0; index < _resolvers.Length; index++) - { - var typeInfo = GetResolver(index).GetTypeInfo(type, options); - if (typeInfo is not null) - { - return typeInfo; - } - } - - return null; - } - - private global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver GetResolver(int index) - { - var resolver = global::System.Threading.Volatile.Read(ref _resolvers[index]); - if (resolver is not null) - { - return resolver; - } - - lock (_gate) - { - return _resolvers[index] ??= CreateResolver(index); - } - } - - private static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver CreateResolver(int index) - { - return index switch - { - 0 => new VisionSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), - _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), - }; - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.VisionClient.Authorizations.Bearer.g.cs b/src/libs/Ideogram/Generated/Ideogram.VisionClient.Authorizations.Bearer.g.cs deleted file mode 100644 index d1c135db..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.VisionClient.Authorizations.Bearer.g.cs +++ /dev/null @@ -1,35 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public sealed partial class VisionClient - { - - /// - public void AuthorizeUsingBearer( - string apiKey) - { - apiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey)); - - for (var i = Authorizations.Count - 1; i >= 0; i--) - { - var __authorization = Authorizations[i]; - if (__authorization.Type == "Http" && - __authorization.Name == "Bearer") - { - Authorizations.RemoveAt(i); - } - } - - Authorizations.Add(new global::Ideogram.EndPointAuthorization - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - Value = apiKey, - }); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.VisionClient.Constructors.Bearer.g.cs b/src/libs/Ideogram/Generated/Ideogram.VisionClient.Constructors.Bearer.g.cs deleted file mode 100644 index 3668a6f0..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.VisionClient.Constructors.Bearer.g.cs +++ /dev/null @@ -1,31 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public sealed partial class VisionClient - { - /// - - public VisionClient( - string apiKey, - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - bool disposeHttpClient = true) : this(httpClient, baseUri, authorizations, disposeHttpClient) - { - Authorizing(HttpClient, ref apiKey); - - AuthorizeUsingBearer(apiKey); - - Authorized(HttpClient); - } - - partial void Authorizing( - global::System.Net.Http.HttpClient client, - ref string apiKey); - partial void Authorized( - global::System.Net.Http.HttpClient client); - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.VisionClient.PostDescribe.g.cs b/src/libs/Ideogram/Generated/Ideogram.VisionClient.PostDescribe.g.cs deleted file mode 100644 index af231c24..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.VisionClient.PostDescribe.g.cs +++ /dev/null @@ -1,1679 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class VisionClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostDescribeSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostDescribeSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostDescribeSecurityRequirement0, - }; - partial void PreparePostDescribeArguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.DescribeRequest request); - partial void PreparePostDescribeRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.DescribeRequest request); - partial void ProcessPostDescribeResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostDescribeResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Describe
- /// Describe an image.
- /// Supported image formats include JPEG, PNG, and WebP. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostDescribeAsync( - - global::Ideogram.DescribeRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostDescribeAsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Describe
- /// Describe an image.
- /// Supported image formats include JPEG, PNG, and WebP. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostDescribeAsResponseAsync( - - global::Ideogram.DescribeRequest request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostDescribeArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostDescribeSecurityRequirements, - operationName: "PostDescribeAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/describe", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - var __contentImageFile = new global::System.Net.Http.ByteArrayContent(request.ImageFile ?? global::System.Array.Empty()); - __contentImageFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.ImageFilename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.ImageFilename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImageFile, - name: "\"image_file\"", - fileName: request.ImageFilename != null ? $"\"{request.ImageFilename}\"" : string.Empty); - if (__contentImageFile.Headers.ContentDisposition != null) - { - __contentImageFile.Headers.ContentDisposition.FileNameStar = null; - } - - if (request.DescribeModelVersion != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.DescribeModelVersion).HasValue ? (request.DescribeModelVersion).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"describe_model_version\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostDescribeRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostDescribe", - methodName: "PostDescribeAsync", - pathTemplate: "\"/describe\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostDescribe", - methodName: "PostDescribeAsync", - pathTemplate: "\"/describe\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostDescribe", - methodName: "PostDescribeAsync", - pathTemplate: "\"/describe\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostDescribeResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostDescribe", - methodName: "PostDescribeAsync", - pathTemplate: "\"/describe\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostDescribe", - methodName: "PostDescribeAsync", - pathTemplate: "\"/describe\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Image failed the safety check. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.ImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.ImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.ImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostDescribeResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.DescribeResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.DescribeResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Describe
- /// Describe an image.
- /// Supported image formats include JPEG, PNG, and WebP. - ///
- /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The model version to use for describing images. Defaults to V_3.
- /// Default Value: V_3 - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostDescribeAsync( - byte[] imageFile, - string imageFilename, - global::Ideogram.DescribeModelVersion? describeModelVersion = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.DescribeRequest - { - ImageFile = imageFile, - ImageFilename = imageFilename, - DescribeModelVersion = describeModelVersion, - }; - - return await PostDescribeAsync( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - - /// - /// Describe
- /// Describe an image.
- /// Supported image formats include JPEG, PNG, and WebP. - ///
- /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The model version to use for describing images. Defaults to V_3.
- /// Default Value: V_3 - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostDescribeAsync( - global::System.IO.Stream imageFile, - string imageFilename, - global::Ideogram.DescribeModelVersion? describeModelVersion = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - - imageFile = imageFile ?? throw new global::System.ArgumentNullException(nameof(imageFile)); - var request = new global::Ideogram.DescribeRequest - { - ImageFile = global::System.Array.Empty(), - ImageFilename = imageFilename, - DescribeModelVersion = describeModelVersion, - }; - PrepareArguments( - client: HttpClient); - PreparePostDescribeArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostDescribeSecurityRequirements, - operationName: "PostDescribeAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/describe", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - var __contentImageFile = new global::System.Net.Http.StreamContent(imageFile); - __contentImageFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.ImageFilename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.ImageFilename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImageFile, - name: "\"image_file\"", - fileName: request.ImageFilename != null ? $"\"{request.ImageFilename}\"" : string.Empty); - if (__contentImageFile.Headers.ContentDisposition != null) - { - __contentImageFile.Headers.ContentDisposition.FileNameStar = null; - } - - if (request.DescribeModelVersion != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.DescribeModelVersion).HasValue ? (request.DescribeModelVersion).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"describe_model_version\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostDescribeRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostDescribe", - methodName: "PostDescribeAsync", - pathTemplate: "\"/describe\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostDescribe", - methodName: "PostDescribeAsync", - pathTemplate: "\"/describe\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostDescribe", - methodName: "PostDescribeAsync", - pathTemplate: "\"/describe\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostDescribeResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostDescribe", - methodName: "PostDescribeAsync", - pathTemplate: "\"/describe\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostDescribe", - methodName: "PostDescribeAsync", - pathTemplate: "\"/describe\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Image failed the safety check. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.ImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.ImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.ImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostDescribeResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::Ideogram.DescribeResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - return - await global::Ideogram.DescribeResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Describe
- /// Describe an image.
- /// Supported image formats include JPEG, PNG, and WebP. - ///
- /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// The model version to use for describing images. Defaults to V_3.
- /// Default Value: V_3 - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostDescribeAsResponseAsync( - global::System.IO.Stream imageFile, - string imageFilename, - global::Ideogram.DescribeModelVersion? describeModelVersion = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - - imageFile = imageFile ?? throw new global::System.ArgumentNullException(nameof(imageFile)); - var request = new global::Ideogram.DescribeRequest - { - ImageFile = global::System.Array.Empty(), - ImageFilename = imageFilename, - DescribeModelVersion = describeModelVersion, - }; - PrepareArguments( - client: HttpClient); - PreparePostDescribeArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostDescribeSecurityRequirements, - operationName: "PostDescribeAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/describe", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - var __contentImageFile = new global::System.Net.Http.StreamContent(imageFile); - __contentImageFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.ImageFilename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.ImageFilename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImageFile, - name: "\"image_file\"", - fileName: request.ImageFilename != null ? $"\"{request.ImageFilename}\"" : string.Empty); - if (__contentImageFile.Headers.ContentDisposition != null) - { - __contentImageFile.Headers.ContentDisposition.FileNameStar = null; - } - - if (request.DescribeModelVersion != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((request.DescribeModelVersion).HasValue ? (request.DescribeModelVersion).GetValueOrDefault().ToValueString() : string.Empty), - name: "\"describe_model_version\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostDescribeRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostDescribe", - methodName: "PostDescribeAsync", - pathTemplate: "\"/describe\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostDescribe", - methodName: "PostDescribeAsync", - pathTemplate: "\"/describe\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostDescribe", - methodName: "PostDescribeAsync", - pathTemplate: "\"/describe\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostDescribeResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostDescribe", - methodName: "PostDescribeAsync", - pathTemplate: "\"/describe\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostDescribe", - methodName: "PostDescribeAsync", - pathTemplate: "\"/describe\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Image failed the safety check. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.ImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.ImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.ImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostDescribeResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.DescribeResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.DescribeResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.VisionClient.PostDescribeV4.g.cs b/src/libs/Ideogram/Generated/Ideogram.VisionClient.PostDescribeV4.g.cs deleted file mode 100644 index 19f9c5ca..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.VisionClient.PostDescribeV4.g.cs +++ /dev/null @@ -1,1901 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class VisionClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_PostDescribeV4SecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_PostDescribeV4SecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_PostDescribeV4SecurityRequirement0, - }; - partial void PreparePostDescribeV4Arguments( - global::System.Net.Http.HttpClient httpClient, - global::Ideogram.DescribeRequestV4 request); - partial void PreparePostDescribeV4Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::Ideogram.DescribeRequestV4 request); - partial void ProcessPostDescribeV4Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostDescribeV4ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Describe with Ideogram 4.0
- /// Describe an image with Ideogram 4.0 and return a structured
- /// `V4JsonPrompt`. The returned `json_prompt` is a working JSON prompt
- /// that can be passed directly as `json_prompt` to the
- /// `/v1/ideogram-v4/generate` family of endpoints.
- /// Supported image formats include JPEG, PNG, and WebP. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostDescribeV4Async( - - global::Ideogram.DescribeRequestV4 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await PostDescribeV4AsResponseAsync( - - request: request, - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Describe with Ideogram 4.0
- /// Describe an image with Ideogram 4.0 and return a structured
- /// `V4JsonPrompt`. The returned `json_prompt` is a working JSON prompt
- /// that can be passed directly as `json_prompt` to the
- /// `/v1/ideogram-v4/generate` family of endpoints.
- /// Supported image formats include JPEG, PNG, and WebP. - ///
- /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostDescribeV4AsResponseAsync( - - global::Ideogram.DescribeRequestV4 request, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostDescribeV4Arguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostDescribeV4SecurityRequirements, - operationName: "PostDescribeV4Async"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/ideogram-v4/describe", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - var __contentImageFile = new global::System.Net.Http.ByteArrayContent(request.ImageFile ?? global::System.Array.Empty()); - __contentImageFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.ImageFilename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.ImageFilename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImageFile, - name: "\"image_file\"", - fileName: request.ImageFilename != null ? $"\"{request.ImageFilename}\"" : string.Empty); - if (__contentImageFile.Headers.ContentDisposition != null) - { - __contentImageFile.Headers.ContentDisposition.FileNameStar = null; - } - - if (request.IncludeBbox != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.IncludeBbox, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"include_bbox\""); - - } - if (request.IncludeStyleDescriptions != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.IncludeStyleDescriptions, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"include_style_descriptions\""); - - } - if (request.IncludeTags != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.IncludeTags, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"include_tags\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostDescribeV4Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostDescribeV4", - methodName: "PostDescribeV4Async", - pathTemplate: "\"/v1/ideogram-v4/describe\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostDescribeV4", - methodName: "PostDescribeV4Async", - pathTemplate: "\"/v1/ideogram-v4/describe\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostDescribeV4", - methodName: "PostDescribeV4Async", - pathTemplate: "\"/v1/ideogram-v4/describe\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostDescribeV4Response( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostDescribeV4", - methodName: "PostDescribeV4Async", - pathTemplate: "\"/v1/ideogram-v4/describe\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostDescribeV4", - methodName: "PostDescribeV4Async", - pathTemplate: "\"/v1/ideogram-v4/describe\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Image failed the safety check. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.ImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.ImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.ImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostDescribeV4ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.DescribeResponseV4.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.DescribeResponseV4.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Describe with Ideogram 4.0
- /// Describe an image with Ideogram 4.0 and return a structured
- /// `V4JsonPrompt`. The returned `json_prompt` is a working JSON prompt
- /// that can be passed directly as `json_prompt` to the
- /// `/v1/ideogram-v4/generate` family of endpoints.
- /// Supported image formats include JPEG, PNG, and WebP. - ///
- /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// When true (default), the response preserves bounding boxes on each
- /// element so the prompt can be pasted into `/v1/ideogram-v4/generate`
- /// as `json_prompt` and reproduce the source layout. Set to false to
- /// drop bounding boxes and let the sampler place elements freely.
- /// Default Value: true - /// - /// - /// When false (default), the response omits `json_prompt.style_description`
- /// to match the contract used by `/v1/ideogram-v4/generate`'s `json_prompt`
- /// input. Set to true to surface the captioner's source-image style
- /// description in the response.
- /// Default Value: false - /// - /// - /// When false (default), the response omits `json_prompt.tags` to match
- /// the contract used by `/v1/ideogram-v4/generate`'s `json_prompt`
- /// input. Set to true to surface the captioner's free-form tags on the
- /// response.
- /// Default Value: false - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostDescribeV4Async( - byte[] imageFile, - string imageFilename, - bool? includeBbox = default, - bool? includeStyleDescriptions = default, - bool? includeTags = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::Ideogram.DescribeRequestV4 - { - ImageFile = imageFile, - ImageFilename = imageFilename, - IncludeBbox = includeBbox, - IncludeStyleDescriptions = includeStyleDescriptions, - IncludeTags = includeTags, - }; - - return await PostDescribeV4Async( - request: __request, - requestOptions: requestOptions, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - - /// - /// Describe with Ideogram 4.0
- /// Describe an image with Ideogram 4.0 and return a structured
- /// `V4JsonPrompt`. The returned `json_prompt` is a working JSON prompt
- /// that can be passed directly as `json_prompt` to the
- /// `/v1/ideogram-v4/generate` family of endpoints.
- /// Supported image formats include JPEG, PNG, and WebP. - ///
- /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// When true (default), the response preserves bounding boxes on each
- /// element so the prompt can be pasted into `/v1/ideogram-v4/generate`
- /// as `json_prompt` and reproduce the source layout. Set to false to
- /// drop bounding boxes and let the sampler place elements freely.
- /// Default Value: true - /// - /// - /// When false (default), the response omits `json_prompt.style_description`
- /// to match the contract used by `/v1/ideogram-v4/generate`'s `json_prompt`
- /// input. Set to true to surface the captioner's source-image style
- /// description in the response.
- /// Default Value: false - /// - /// - /// When false (default), the response omits `json_prompt.tags` to match
- /// the contract used by `/v1/ideogram-v4/generate`'s `json_prompt`
- /// input. Set to true to surface the captioner's free-form tags on the
- /// response.
- /// Default Value: false - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostDescribeV4Async( - global::System.IO.Stream imageFile, - string imageFilename, - bool? includeBbox = default, - bool? includeStyleDescriptions = default, - bool? includeTags = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - - imageFile = imageFile ?? throw new global::System.ArgumentNullException(nameof(imageFile)); - var request = new global::Ideogram.DescribeRequestV4 - { - ImageFile = global::System.Array.Empty(), - ImageFilename = imageFilename, - IncludeBbox = includeBbox, - IncludeStyleDescriptions = includeStyleDescriptions, - IncludeTags = includeTags, - }; - PrepareArguments( - client: HttpClient); - PreparePostDescribeV4Arguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostDescribeV4SecurityRequirements, - operationName: "PostDescribeV4Async"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/ideogram-v4/describe", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - var __contentImageFile = new global::System.Net.Http.StreamContent(imageFile); - __contentImageFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.ImageFilename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.ImageFilename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImageFile, - name: "\"image_file\"", - fileName: request.ImageFilename != null ? $"\"{request.ImageFilename}\"" : string.Empty); - if (__contentImageFile.Headers.ContentDisposition != null) - { - __contentImageFile.Headers.ContentDisposition.FileNameStar = null; - } - - if (request.IncludeBbox != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.IncludeBbox, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"include_bbox\""); - - } - if (request.IncludeStyleDescriptions != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.IncludeStyleDescriptions, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"include_style_descriptions\""); - - } - if (request.IncludeTags != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.IncludeTags, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"include_tags\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostDescribeV4Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostDescribeV4", - methodName: "PostDescribeV4Async", - pathTemplate: "\"/v1/ideogram-v4/describe\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostDescribeV4", - methodName: "PostDescribeV4Async", - pathTemplate: "\"/v1/ideogram-v4/describe\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostDescribeV4", - methodName: "PostDescribeV4Async", - pathTemplate: "\"/v1/ideogram-v4/describe\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostDescribeV4Response( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostDescribeV4", - methodName: "PostDescribeV4Async", - pathTemplate: "\"/v1/ideogram-v4/describe\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostDescribeV4", - methodName: "PostDescribeV4Async", - pathTemplate: "\"/v1/ideogram-v4/describe\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Image failed the safety check. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.ImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.ImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.ImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostDescribeV4ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::Ideogram.DescribeResponseV4.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - return - await global::Ideogram.DescribeResponseV4.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - /// - /// Describe with Ideogram 4.0
- /// Describe an image with Ideogram 4.0 and return a structured
- /// `V4JsonPrompt`. The returned `json_prompt` is a working JSON prompt
- /// that can be passed directly as `json_prompt` to the
- /// `/v1/ideogram-v4/generate` family of endpoints.
- /// Supported image formats include JPEG, PNG, and WebP. - ///
- /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time. - /// - /// - /// When true (default), the response preserves bounding boxes on each
- /// element so the prompt can be pasted into `/v1/ideogram-v4/generate`
- /// as `json_prompt` and reproduce the source layout. Set to false to
- /// drop bounding boxes and let the sampler place elements freely.
- /// Default Value: true - /// - /// - /// When false (default), the response omits `json_prompt.style_description`
- /// to match the contract used by `/v1/ideogram-v4/generate`'s `json_prompt`
- /// input. Set to true to surface the captioner's source-image style
- /// description in the response.
- /// Default Value: false - /// - /// - /// When false (default), the response omits `json_prompt.tags` to match
- /// the contract used by `/v1/ideogram-v4/generate`'s `json_prompt`
- /// input. Set to true to surface the captioner's free-form tags on the
- /// response.
- /// Default Value: false - /// - /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PostDescribeV4AsResponseAsync( - global::System.IO.Stream imageFile, - string imageFilename, - bool? includeBbox = default, - bool? includeStyleDescriptions = default, - bool? includeTags = default, - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - - imageFile = imageFile ?? throw new global::System.ArgumentNullException(nameof(imageFile)); - var request = new global::Ideogram.DescribeRequestV4 - { - ImageFile = global::System.Array.Empty(), - ImageFilename = imageFilename, - IncludeBbox = includeBbox, - IncludeStyleDescriptions = includeStyleDescriptions, - IncludeTags = includeTags, - }; - PrepareArguments( - client: HttpClient); - PreparePostDescribeV4Arguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostDescribeV4SecurityRequirements, - operationName: "PostDescribeV4Async"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: false); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/ideogram-v4/describe", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - var __contentImageFile = new global::System.Net.Http.StreamContent(imageFile); - __contentImageFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( - request.ImageFilename is null - ? "application/octet-stream" - : (global::System.IO.Path.GetExtension(request.ImageFilename) ?? string.Empty).ToLowerInvariant() switch - { - ".aac" => "audio/aac", - ".flac" => "audio/flac", - ".gif" => "image/gif", - ".jpeg" => "image/jpeg", - ".jpg" => "image/jpeg", - ".json" => "application/json", - ".m4a" => "audio/mp4", - ".mp3" => "audio/mpeg", - ".mp4" => "video/mp4", - ".mpeg" => "audio/mpeg", - ".mpga" => "audio/mpeg", - ".oga" => "audio/ogg", - ".ogg" => "audio/ogg", - ".opus" => "audio/ogg", - ".pdf" => "application/pdf", - ".png" => "image/png", - ".txt" => "text/plain", - ".wav" => "audio/wav", - ".weba" => "audio/webm", - ".webm" => "video/webm", - ".webp" => "image/webp", - _ => "application/octet-stream", - }); - __httpRequestContent.Add( - content: __contentImageFile, - name: "\"image_file\"", - fileName: request.ImageFilename != null ? $"\"{request.ImageFilename}\"" : string.Empty); - if (__contentImageFile.Headers.ContentDisposition != null) - { - __contentImageFile.Headers.ContentDisposition.FileNameStar = null; - } - - if (request.IncludeBbox != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.IncludeBbox, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"include_bbox\""); - - } - if (request.IncludeStyleDescriptions != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.IncludeStyleDescriptions, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"include_style_descriptions\""); - - } - if (request.IncludeTags != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.IncludeTags, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), - name: "\"include_tags\""); - - } - - __httpRequest.Content = __httpRequestContent; - - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePostDescribeV4Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostDescribeV4", - methodName: "PostDescribeV4Async", - pathTemplate: "\"/v1/ideogram-v4/describe\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostDescribeV4", - methodName: "PostDescribeV4Async", - pathTemplate: "\"/v1/ideogram-v4/describe\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostDescribeV4", - methodName: "PostDescribeV4Async", - pathTemplate: "\"/v1/ideogram-v4/describe\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPostDescribeV4Response( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostDescribeV4", - methodName: "PostDescribeV4Async", - pathTemplate: "\"/v1/ideogram-v4/describe\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "PostDescribeV4", - methodName: "PostDescribeV4Async", - pathTemplate: "\"/v1/ideogram-v4/describe\"", - httpMethod: "POST", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - // - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Image failed the safety check. - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::Ideogram.ImageSafetyError? __value_422 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_422 = global::Ideogram.ImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_422 = global::Ideogram.ImageSafetyError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - responseBody: __content_422, - responseObject: __value_422, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - responseBody: __content_429, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostDescribeV4ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.DescribeResponseV4.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.DescribeResponseV4.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.VisionClient.g.cs b/src/libs/Ideogram/Generated/Ideogram.VisionClient.g.cs deleted file mode 100644 index d0359158..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.VisionClient.g.cs +++ /dev/null @@ -1,144 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Operations related to understanding visual content
- /// If no httpClient is provided, a new one will be created.
- /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. - ///
- public sealed partial class VisionClient : global::Ideogram.IVisionClient, global::System.IDisposable - { - /// - /// - /// - public const string DefaultBaseUrl = "https://api.ideogram.ai/"; - - private bool _disposeHttpClient = true; - - /// - public global::System.Net.Http.HttpClient HttpClient { get; } - - /// - public System.Uri? BaseUri => HttpClient.BaseAddress; - - /// - public global::System.Collections.Generic.List Authorizations { get; } - - /// - public bool ReadResponseAsString { get; set; } -#if DEBUG - = true; -#endif - - /// - public global::Ideogram.AutoSDKClientOptions Options { get; } - - internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::Ideogram.VisionSourceGenerationContext.Default); - - /// - /// - /// - public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext - { - get => JsonSerializerContextProvider.Value; - set => JsonSerializerContextProvider = new(() => value); - } - - - /// - /// Creates a new instance of the VisionClient. - /// If no httpClient is provided, a new one will be created. - /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. - /// - /// The HttpClient instance. If not provided, a new one will be created. - /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. - /// The authorizations to use for the requests. - /// Dispose the HttpClient when the instance is disposed. True by default. - public VisionClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - bool disposeHttpClient = true) : this( - httpClient, - baseUri, - authorizations, - options: null, - disposeHttpClient: disposeHttpClient) - { - } - - /// - /// Creates a new instance of the VisionClient with explicit options but no base URL override. - /// Skips passing baseUri so the default base URL from the OpenAPI spec applies. - /// - /// The HttpClient instance. If not provided, a new one will be created. - /// The authorizations to use for the requests. - /// Client-wide request defaults such as headers, query parameters, retries, and timeout. - /// Dispose the HttpClient when the instance is disposed. True by default. - public VisionClient( - global::System.Net.Http.HttpClient? httpClient, - global::System.Collections.Generic.List? authorizations, - global::Ideogram.AutoSDKClientOptions? options, - bool disposeHttpClient = true) : this( - httpClient, - baseUri: null, - authorizations, - options, - disposeHttpClient: disposeHttpClient) - { - } - - /// - /// Creates a new instance of the VisionClient. - /// If no httpClient is provided, a new one will be created. - /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. - /// - /// The HttpClient instance. If not provided, a new one will be created. - /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. - /// The authorizations to use for the requests. - /// Client-wide request defaults such as headers, query parameters, retries, and timeout. - /// Dispose the HttpClient when the instance is disposed. True by default. - public VisionClient( - global::System.Net.Http.HttpClient? httpClient, - global::System.Uri? baseUri, - global::System.Collections.Generic.List? authorizations, - global::Ideogram.AutoSDKClientOptions? options, - bool disposeHttpClient = true) - { - - HttpClient = httpClient ?? new global::System.Net.Http.HttpClient(); - HttpClient.BaseAddress ??= baseUri ?? new global::System.Uri(DefaultBaseUrl); - Authorizations = authorizations ?? new global::System.Collections.Generic.List(); - Options = options ?? new global::Ideogram.AutoSDKClientOptions(); - _disposeHttpClient = disposeHttpClient; - - Initialized(HttpClient); - } - - /// - public void Dispose() - { - if (_disposeHttpClient) - { - HttpClient.Dispose(); - } - } - - partial void Initialized( - global::System.Net.Http.HttpClient client); - partial void PrepareArguments( - global::System.Net.Http.HttpClient client); - partial void PrepareRequest( - global::System.Net.Http.HttpClient client, - global::System.Net.Http.HttpRequestMessage request); - partial void ProcessResponse( - global::System.Net.Http.HttpClient client, - global::System.Net.Http.HttpResponseMessage response); - partial void ProcessResponseContent( - global::System.Net.Http.HttpClient client, - global::System.Net.Http.HttpResponseMessage response, - ref string content); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Webhooks.JsonSerializerContext.g.cs b/src/libs/Ideogram/Generated/Ideogram.Webhooks.JsonSerializerContext.g.cs deleted file mode 100644 index ccf55e50..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.Webhooks.JsonSerializerContext.g.cs +++ /dev/null @@ -1,128 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// - /// - [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull - )] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.WebhookSigningJwks))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.WebhookSigningJwk))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - internal sealed partial class WebhooksSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext - { - } - /// - /// - /// - public sealed partial class WebhooksSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext - { - private static readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver Resolver = new LazyChunkResolver(); - - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - internal static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver TypeInfoResolver => Resolver; - - - private static readonly global::System.Text.Json.JsonSerializerOptions DefaultOptions = CreateDefaultOptions(); - - /// - /// - /// - public static WebhooksSourceGenerationContext Default { get; } = new(DefaultOptions); - - private WebhooksSourceGenerationContext(global::System.Text.Json.JsonSerializerOptions options) - : base(options) - { - } - - /// - protected override global::System.Text.Json.JsonSerializerOptions? GeneratedSerializerOptions => DefaultOptions; - - /// - public override global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo(global::System.Type type) - { - return Resolver.GetTypeInfo(type, Options); - } - - /// - /// Adds this package's converters to . - /// - /// - /// A converter has to be on the options a chained resolver builds its JsonTypeInfo against, - /// and a context resolves types from every package below it. Each package contributes only - /// what it owns and calls down the chain for the rest, so the family's converter table is - /// written once rather than copied into all of them. - /// - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) - { - options.Converters.Add(new global::Ideogram.JsonConverters.UnixTimestampJsonConverter()); - } - - private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() - { - var options = new global::System.Text.Json.JsonSerializerOptions - { - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, - TypeInfoResolver = Resolver, - }; - AddConverters(options); - - return options; - } - - private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver - { - private readonly object _gate = new(); - private readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[] _resolvers = new global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[1]; - - public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo( - global::System.Type type, - global::System.Text.Json.JsonSerializerOptions options) - { - for (var index = 0; index < _resolvers.Length; index++) - { - var typeInfo = GetResolver(index).GetTypeInfo(type, options); - if (typeInfo is not null) - { - return typeInfo; - } - } - - return null; - } - - private global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver GetResolver(int index) - { - var resolver = global::System.Threading.Volatile.Read(ref _resolvers[index]); - if (resolver is not null) - { - return resolver; - } - - lock (_gate) - { - return _resolvers[index] ??= CreateResolver(index); - } - } - - private static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver CreateResolver(int index) - { - return index switch - { - 0 => new WebhooksSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), - _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), - }; - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.WebhooksClient.Authorizations.Bearer.g.cs b/src/libs/Ideogram/Generated/Ideogram.WebhooksClient.Authorizations.Bearer.g.cs deleted file mode 100644 index 149a2022..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.WebhooksClient.Authorizations.Bearer.g.cs +++ /dev/null @@ -1,35 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public sealed partial class WebhooksClient - { - - /// - public void AuthorizeUsingBearer( - string apiKey) - { - apiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey)); - - for (var i = Authorizations.Count - 1; i >= 0; i--) - { - var __authorization = Authorizations[i]; - if (__authorization.Type == "Http" && - __authorization.Name == "Bearer") - { - Authorizations.RemoveAt(i); - } - } - - Authorizations.Add(new global::Ideogram.EndPointAuthorization - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - Value = apiKey, - }); - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.WebhooksClient.Constructors.Bearer.g.cs b/src/libs/Ideogram/Generated/Ideogram.WebhooksClient.Constructors.Bearer.g.cs deleted file mode 100644 index c2f79c7a..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.WebhooksClient.Constructors.Bearer.g.cs +++ /dev/null @@ -1,31 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public sealed partial class WebhooksClient - { - /// - - public WebhooksClient( - string apiKey, - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - bool disposeHttpClient = true) : this(httpClient, baseUri, authorizations, disposeHttpClient) - { - Authorizing(HttpClient, ref apiKey); - - AuthorizeUsingBearer(apiKey); - - Authorized(HttpClient); - } - - partial void Authorizing( - global::System.Net.Http.HttpClient client, - ref string apiKey); - partial void Authorized( - global::System.Net.Http.HttpClient client); - - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.WebhooksClient.GetWebhookSigningJwks.g.cs b/src/libs/Ideogram/Generated/Ideogram.WebhooksClient.GetWebhookSigningJwks.g.cs deleted file mode 100644 index 65de071e..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.WebhooksClient.GetWebhookSigningJwks.g.cs +++ /dev/null @@ -1,435 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - public partial class WebhooksClient - { - - - private static readonly global::Ideogram.EndPointSecurityRequirement s_GetWebhookSigningJwksSecurityRequirement0 = - new global::Ideogram.EndPointSecurityRequirement - { - Authorizations = new global::Ideogram.EndPointAuthorizationRequirement[] - { new global::Ideogram.EndPointAuthorizationRequirement - { - Type = "Http", - SchemeId = "HttpBearer", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::Ideogram.EndPointSecurityRequirement[] s_GetWebhookSigningJwksSecurityRequirements = - new global::Ideogram.EndPointSecurityRequirement[] - { s_GetWebhookSigningJwksSecurityRequirement0, - }; - partial void PrepareGetWebhookSigningJwksArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareGetWebhookSigningJwksRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessGetWebhookSigningJwksResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessGetWebhookSigningJwksResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Get the public keys used to verify webhook signatures
- /// Returns the set of Ed25519 public keys Ideogram uses to sign outbound
- /// webhook payloads. Customers verify incoming webhooks by recomputing the
- /// canonical signed message (`request_id\nuser_id\ntimestamp\nsha256_hex(body)`)
- /// and checking the `X-Ideogram-Webhook-Signature` header against any key
- /// in this document.
- /// The document includes the current signing key plus any keys recently
- /// rotated out, so signatures already in flight remain verifiable across
- /// rotations. Cache for up to 24 hours; refresh sooner if a signature
- /// fails to verify against the cached set.
- /// This endpoint is public and unauthenticated — no API key is required. - ///
- /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task GetWebhookSigningJwksAsync( - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __response = await GetWebhookSigningJwksAsResponseAsync( - requestOptions: requestOptions, - cancellationToken: cancellationToken - ).ConfigureAwait(false); - - return __response.Body; - } - /// - /// Get the public keys used to verify webhook signatures
- /// Returns the set of Ed25519 public keys Ideogram uses to sign outbound
- /// webhook payloads. Customers verify incoming webhooks by recomputing the
- /// canonical signed message (`request_id\nuser_id\ntimestamp\nsha256_hex(body)`)
- /// and checking the `X-Ideogram-Webhook-Signature` header against any key
- /// in this document.
- /// The document includes the current signing key plus any keys recently
- /// rotated out, so signatures already in flight remain verifiable across
- /// rotations. Cache for up to 24 hours; refresh sooner if a signature
- /// fails to verify against the cached set.
- /// This endpoint is public and unauthenticated — no API key is required. - ///
- /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> GetWebhookSigningJwksAsResponseAsync( - global::Ideogram.AutoSDKRequestOptions? requestOptions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareGetWebhookSigningJwksArguments( - httpClient: HttpClient); - - - var __authorizations = global::Ideogram.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_GetWebhookSigningJwksSecurityRequirements, - operationName: "GetWebhookSigningJwksAsync"); - - using var __timeoutCancellationTokenSource = global::Ideogram.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( - clientOptions: Options, - requestOptions: requestOptions, - cancellationToken: cancellationToken); - var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; - var __effectiveReadResponseAsString = global::Ideogram.AutoSDKRequestOptionsSupport.GetReadResponseAsString( - clientOptions: Options, - requestOptions: requestOptions, - fallbackValue: ReadResponseAsString); - var __maxAttempts = global::Ideogram.AutoSDKRequestOptionsSupport.GetMaxAttempts( - clientOptions: Options, - requestOptions: requestOptions, - supportsRetry: true); - - global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() - { - - var __pathBuilder = new global::Ideogram.PathBuilder( - path: "/v1/.well-known/jwks.json", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - __path = global::Ideogram.AutoSDKRequestOptionsSupport.AppendQueryParameters( - path: __path, - clientParameters: Options.QueryParameters, - requestParameters: requestOptions?.QueryParameters); - var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in __authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2" || - __authorization.Type == "OpenIdConnect") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - global::Ideogram.AutoSDKRequestOptionsSupport.ApplyHeaders( - request: __httpRequest, - clientHeaders: Options.Headers, - requestHeaders: requestOptions?.Headers); - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetWebhookSigningJwksRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - return __httpRequest; - } - - global::System.Net.Http.HttpRequestMessage? __httpRequest = null; - global::System.Net.Http.HttpResponseMessage? __response = null; - var __attemptNumber = 0; - try - { - for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) - { - __attemptNumber = __attempt; - __httpRequest = __CreateHttpRequest(); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetWebhookSigningJwks", - methodName: "GetWebhookSigningJwksAsync", - pathTemplate: "\"/v1/.well-known/jwks.json\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - try - { - __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - } - catch (global::System.Net.Http.HttpRequestException __exception) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: null, - attempt: __attempt); - var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetWebhookSigningJwks", - methodName: "GetWebhookSigningJwksAsync", - pathTemplate: "\"/v1/.well-known/jwks.json\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: null, - exception: __exception, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: __willRetry, - retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, - retryReason: "exception", - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - if (!__willRetry) - { - throw; - } - - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - if (__response != null && - __attempt < __maxAttempts && - global::Ideogram.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) - { - var __retryDelay = global::Ideogram.AutoSDKRequestOptionsSupport.GetRetryDelay( - clientOptions: Options, - requestOptions: requestOptions, - response: __response, - attempt: __attempt); - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetWebhookSigningJwks", - methodName: "GetWebhookSigningJwksAsync", - pathTemplate: "\"/v1/.well-known/jwks.json\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attempt, - maxAttempts: __maxAttempts, - willRetry: true, - retryDelay: __retryDelay, - retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - __response.Dispose(); - __response = null; - __httpRequest.Dispose(); - __httpRequest = null; - await global::Ideogram.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - retryDelay: __retryDelay, - cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); - continue; - } - - break; - } - - if (__response == null) - { - throw new global::System.InvalidOperationException("No response received."); - } - - using (__response) - { - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetWebhookSigningJwksResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - if (__response.IsSuccessStatusCode) - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetWebhookSigningJwks", - methodName: "GetWebhookSigningJwksAsync", - pathTemplate: "\"/v1/.well-known/jwks.json\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - else - { - await global::Ideogram.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( - clientOptions: Options, - context: global::Ideogram.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetWebhookSigningJwks", - methodName: "GetWebhookSigningJwksAsync", - pathTemplate: "\"/v1/.well-known/jwks.json\"", - httpMethod: "GET", - baseUri: BaseUri, - request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), - response: __response, - exception: null, - clientOptions: Options, - requestOptions: requestOptions, - attempt: __attemptNumber, - maxAttempts: __maxAttempts, - willRetry: false, - retryDelay: null, - retryReason: global::System.String.Empty, - cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); - } - - if (__effectiveReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetWebhookSigningJwksResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - var __value = global::Ideogram.WebhookSigningJwks.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - - var __value = await global::Ideogram.WebhookSigningJwks.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - return new global::Ideogram.AutoSDKHttpResponse( - statusCode: __response.StatusCode, - headers: global::Ideogram.AutoSDKHttpResponse.CreateHeaders(__response), - requestUri: __response.RequestMessage?.RequestUri, - body: __value); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( - #if NET5_0_OR_GREATER - __effectiveCancellationToken - #endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw global::Ideogram.ApiException.Create( - statusCode: __response.StatusCode, - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - responseBody: __content, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - } - - } - } - finally - { - __httpRequest?.Dispose(); - } - } - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.WebhooksClient.g.cs b/src/libs/Ideogram/Generated/Ideogram.WebhooksClient.g.cs deleted file mode 100644 index 133d17ed..00000000 --- a/src/libs/Ideogram/Generated/Ideogram.WebhooksClient.g.cs +++ /dev/null @@ -1,146 +0,0 @@ - -#nullable enable - -namespace Ideogram -{ - /// - /// Endpoints related to webhook delivery and verification. The JWKS
- /// endpoint publishes the Ed25519 public keys customers use to verify
- /// that an inbound webhook genuinely originated from Ideogram.
- /// If no httpClient is provided, a new one will be created.
- /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. - ///
- public sealed partial class WebhooksClient : global::Ideogram.IWebhooksClient, global::System.IDisposable - { - /// - /// - /// - public const string DefaultBaseUrl = "https://api.ideogram.ai/"; - - private bool _disposeHttpClient = true; - - /// - public global::System.Net.Http.HttpClient HttpClient { get; } - - /// - public System.Uri? BaseUri => HttpClient.BaseAddress; - - /// - public global::System.Collections.Generic.List Authorizations { get; } - - /// - public bool ReadResponseAsString { get; set; } -#if DEBUG - = true; -#endif - - /// - public global::Ideogram.AutoSDKClientOptions Options { get; } - - internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::Ideogram.WebhooksSourceGenerationContext.Default); - - /// - /// - /// - public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext - { - get => JsonSerializerContextProvider.Value; - set => JsonSerializerContextProvider = new(() => value); - } - - - /// - /// Creates a new instance of the WebhooksClient. - /// If no httpClient is provided, a new one will be created. - /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. - /// - /// The HttpClient instance. If not provided, a new one will be created. - /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. - /// The authorizations to use for the requests. - /// Dispose the HttpClient when the instance is disposed. True by default. - public WebhooksClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - bool disposeHttpClient = true) : this( - httpClient, - baseUri, - authorizations, - options: null, - disposeHttpClient: disposeHttpClient) - { - } - - /// - /// Creates a new instance of the WebhooksClient with explicit options but no base URL override. - /// Skips passing baseUri so the default base URL from the OpenAPI spec applies. - /// - /// The HttpClient instance. If not provided, a new one will be created. - /// The authorizations to use for the requests. - /// Client-wide request defaults such as headers, query parameters, retries, and timeout. - /// Dispose the HttpClient when the instance is disposed. True by default. - public WebhooksClient( - global::System.Net.Http.HttpClient? httpClient, - global::System.Collections.Generic.List? authorizations, - global::Ideogram.AutoSDKClientOptions? options, - bool disposeHttpClient = true) : this( - httpClient, - baseUri: null, - authorizations, - options, - disposeHttpClient: disposeHttpClient) - { - } - - /// - /// Creates a new instance of the WebhooksClient. - /// If no httpClient is provided, a new one will be created. - /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. - /// - /// The HttpClient instance. If not provided, a new one will be created. - /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. - /// The authorizations to use for the requests. - /// Client-wide request defaults such as headers, query parameters, retries, and timeout. - /// Dispose the HttpClient when the instance is disposed. True by default. - public WebhooksClient( - global::System.Net.Http.HttpClient? httpClient, - global::System.Uri? baseUri, - global::System.Collections.Generic.List? authorizations, - global::Ideogram.AutoSDKClientOptions? options, - bool disposeHttpClient = true) - { - - HttpClient = httpClient ?? new global::System.Net.Http.HttpClient(); - HttpClient.BaseAddress ??= baseUri ?? new global::System.Uri(DefaultBaseUrl); - Authorizations = authorizations ?? new global::System.Collections.Generic.List(); - Options = options ?? new global::Ideogram.AutoSDKClientOptions(); - _disposeHttpClient = disposeHttpClient; - - Initialized(HttpClient); - } - - /// - public void Dispose() - { - if (_disposeHttpClient) - { - HttpClient.Dispose(); - } - } - - partial void Initialized( - global::System.Net.Http.HttpClient client); - partial void PrepareArguments( - global::System.Net.Http.HttpClient client); - partial void PrepareRequest( - global::System.Net.Http.HttpClient client, - global::System.Net.Http.HttpRequestMessage request); - partial void ProcessResponse( - global::System.Net.Http.HttpClient client, - global::System.Net.Http.HttpResponseMessage response); - partial void ProcessResponseContent( - global::System.Net.Http.HttpClient client, - global::System.Net.Http.HttpResponseMessage response, - ref string content); - } -} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/autosdk.generated-examples.json b/src/libs/Ideogram/Generated/autosdk.generated-examples.json deleted file mode 100644 index b07c4615..00000000 --- a/src/libs/Ideogram/Generated/autosdk.generated-examples.json +++ /dev/null @@ -1,2160 +0,0 @@ -{ - "Examples": [ - { - "Order": 1, - "Title": "List API keys", - "Slug": "get-account-api-keys", - "Description": "Lists the API keys in your organization. Key material is redacted \u2014\nthe full key is only shown once, when it is created. Disabled and\narchived keys are included (see each key\u0027s \u0060status\u0060) so historical\nusage can always be matched to the key that generated it.\n\nRequires an API key whose owner is an organization admin. Keys owned\nby other members receive a 404.", - "Language": "csharp", - "Code": "using var client = new IdeogramClient(apiKey);\nvar response = await client.Account.GetAccountApiKeysAsync();\n\n// Example response:\n// {\n// \u0022api_keys\u0022: [\n// {\n// \u0022creation_time\u0022: \u00222000-01-23T04:56:07\\u002B00:00\u0022,\n// \u0022label\u0022: \u0022Live production environment\u0022,\n// \u0022redacted_api_key\u0022: \u0022ATG56\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\u0022,\n// \u0022api_key_id\u0022: \u0022JRPVD7jWR1aTBYiJ0UFVOg\u0022,\n// \u0022creator_display_label\u0022: \u0022John Doe\u0022,\n// \u0022status\u0022: null\n// },\n// {\n// \u0022creation_time\u0022: \u00222000-01-23T04:56:07\\u002B00:00\u0022,\n// \u0022label\u0022: \u0022Live production environment\u0022,\n// \u0022redacted_api_key\u0022: \u0022ATG56\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\u0022,\n// \u0022api_key_id\u0022: \u0022JRPVD7jWR1aTBYiJ0UFVOg\u0022,\n// \u0022creator_display_label\u0022: \u0022John Doe\u0022,\n// \u0022status\u0022: null\n// }\n// ]\n// }", - "Format": "sdk", - "OperationId": "get_account_api_keys", - "Setup": "This example assumes \u0060using Ideogram;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." - }, - { - "Order": 2, - "Title": "List invoices", - "Slug": "get-account-invoices", - "Description": "Returns your organization\u0027s invoices with their line items \u2014 the\nbilling record your usage reports reconcile against. Amounts are\ndecimal strings in the invoice\u0027s currency.\n\nRequires an API key whose owner is an organization admin. Keys owned\nby other members receive a 404.", - "Language": "csharp", - "Code": "using var client = new IdeogramClient(apiKey);\nvar response = await client.Account.GetAccountInvoicesAsync();\n\n// Example response:\n// {\n// \u0022invoices\u0022: [\n// {\n// \u0022start_time\u0022: \u00222000-01-23T04:56:07\\u002B00:00\u0022,\n// \u0022total\u0022: \u0022150.00\u0022,\n// \u0022paid_time\u0022: \u00222000-01-23T04:56:07\\u002B00:00\u0022,\n// \u0022end_time\u0022: \u00222000-01-23T04:56:07\\u002B00:00\u0022,\n// \u0022line_items\u0022: [\n// {\n// \u0022cost_total\u0022: \u002284.00\u0022,\n// \u0022quantity\u0022: \u00222100\u0022,\n// \u0022api_key\u0022: {\n// \u0022redacted_key\u0022: \u0022ATG5\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\u0022,\n// \u0022id\u0022: \u0022JRPVD7jWR1aTBYiJ0UFVOg\u0022,\n// \u0022label\u0022: \u0022Live production environment\u0022\n// },\n// \u0022description\u0022: \u0022Ideogram v4 Generation\u0022,\n// \u0022unit_price\u0022: \u00220.04\u0022,\n// \u0022currency_code\u0022: \u0022USD\u0022\n// },\n// {\n// \u0022cost_total\u0022: \u002284.00\u0022,\n// \u0022quantity\u0022: \u00222100\u0022,\n// \u0022api_key\u0022: {\n// \u0022redacted_key\u0022: \u0022ATG5\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\u0022,\n// \u0022id\u0022: \u0022JRPVD7jWR1aTBYiJ0UFVOg\u0022,\n// \u0022label\u0022: \u0022Live production environment\u0022\n// },\n// \u0022description\u0022: \u0022Ideogram v4 Generation\u0022,\n// \u0022unit_price\u0022: \u00220.04\u0022,\n// \u0022currency_code\u0022: \u0022USD\u0022\n// }\n// ],\n// \u0022issued_time\u0022: \u00222000-01-23T04:56:07\\u002B00:00\u0022,\n// \u0022currency_code\u0022: \u0022USD\u0022,\n// \u0022status\u0022: \u0022paid\u0022\n// },\n// {\n// \u0022start_time\u0022: \u00222000-01-23T04:56:07\\u002B00:00\u0022,\n// \u0022total\u0022: \u0022150.00\u0022,\n// \u0022paid_time\u0022: \u00222000-01-23T04:56:07\\u002B00:00\u0022,\n// \u0022end_time\u0022: \u00222000-01-23T04:56:07\\u002B00:00\u0022,\n// \u0022line_items\u0022: [\n// {\n// \u0022cost_total\u0022: \u002284.00\u0022,\n// \u0022quantity\u0022: \u00222100\u0022,\n// \u0022api_key\u0022: {\n// \u0022redacted_key\u0022: \u0022ATG5\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\u0022,\n// \u0022id\u0022: \u0022JRPVD7jWR1aTBYiJ0UFVOg\u0022,\n// \u0022label\u0022: \u0022Live production environment\u0022\n// },\n// \u0022description\u0022: \u0022Ideogram v4 Generation\u0022,\n// \u0022unit_price\u0022: \u00220.04\u0022,\n// \u0022currency_code\u0022: \u0022USD\u0022\n// },\n// {\n// \u0022cost_total\u0022: \u002284.00\u0022,\n// \u0022quantity\u0022: \u00222100\u0022,\n// \u0022api_key\u0022: {\n// \u0022redacted_key\u0022: \u0022ATG5\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\u0022,\n// \u0022id\u0022: \u0022JRPVD7jWR1aTBYiJ0UFVOg\u0022,\n// \u0022label\u0022: \u0022Live production environment\u0022\n// },\n// \u0022description\u0022: \u0022Ideogram v4 Generation\u0022,\n// \u0022unit_price\u0022: \u00220.04\u0022,\n// \u0022currency_code\u0022: \u0022USD\u0022\n// }\n// ],\n// \u0022issued_time\u0022: \u00222000-01-23T04:56:07\\u002B00:00\u0022,\n// \u0022currency_code\u0022: \u0022USD\u0022,\n// \u0022status\u0022: \u0022paid\u0022\n// }\n// ]\n// }", - "Format": "sdk", - "OperationId": "get_account_invoices", - "Setup": "This example assumes \u0060using Ideogram;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." - }, - { - "Order": 3, - "Title": "Get usage and spend", - "Slug": "get-account-usage", - "Description": "Returns your organization\u0027s billed API usage as dense time buckets of\nline items. Every line item carries the billed dollar amount; products\nbilled per item also carry \u0060billed_units\u0060 (unit, quantity, and unit\nprice, where \u0060quantity \u00D7 unit_price = cost_total\u0060). Usage-priced\nproducts (billed by metered provider usage) report \u0060cost_total\u0060 only.\n\nBuckets cover the requested range completely \u2014 a bucket with no line\nitems means no billed usage in that window. Line items are unique per\nbucket on (\u0060product\u0060, \u0060dimensions\u0060, \u0060api_key.id\u0060, unit price). Usage\nbilled without an API key (requests authenticated as a user session)\nis included with \u0060api_key\u0060 absent, so totals always reconcile with\nyour invoices.\n\u0060product\u0060 and \u0060endpoint\u0060 are stable identifiers safe to aggregate on;\n\u0060description\u0060 is display text and may be reworded at any time.\n\nUsage data may lag live traffic by a few minutes, and responses may be\ncached briefly, so this endpoint is for reporting rather than\nreal-time monitoring.\n\nRequires an API key whose owner is an organization admin. Keys owned\nby other members receive a 404.", - "Language": "http", - "Code": "### Get usage and spend\n# @name get_account_usage\nGET {{host}}/v2/account/usage?start_time={{start_time}}\u0026end_time={{end_time}}\u0026bucket_width=1d\u0026sources=[\n \u0022api\u0022,\n \u0022app\u0022\n]\nAuthorization: Bearer {{token}}\nAccept: application/json\n\n## Responses\n# 200\n# Description: Bucketed usage for the requested range.\n# Content-Type: application/json\n# 400\n# Description: Invalid time range, bucket width, or filters.\n# 401\n# Description: Unauthorized.\n# 404\n# Description: No organization with billing access was found for this credential.\n# 429\n# Description: Too many requests.", - "Format": "http", - "OperationId": "get_account_usage", - "Setup": null - }, - { - "Order": 4, - "Title": "Rank edit reference assets used by organization requests", - "Slug": "get-asset-reference-usage", - "Description": "Counts completed requests made by the authenticated organization that used each existing asset as an edit input during the UTC date range. Direct file uploads without saved asset identifiers are excluded. Results are independent of current asset ownership, collection membership, and sharing. Returning an identifier does not grant access to its image. Tracking begins when enabled; earlier history is not included. Returns 50 assets per page by default, up to 100 with limit. Rankings may change between pages when daily counts are updated; cursors do not pin a historical snapshot.", - "Language": "http", - "Code": "### Rank edit reference assets used by organization requests\n# @name get_asset_reference_usage\nGET {{host}}/v2/assets/reference-usage?limit=50\u0026collection_ids={{collection_ids}}\u0026include_collections=false\u0026start_date={{start_date}}\u0026end_date={{end_date}}\u0026cursor={{cursor}}\nAuthorization: Bearer {{token}}\nAccept: application/json\n\n## Responses\n# 200\n# Description: Ranked edit reference assets\n# Content-Type: application/json\n# 400\n# Description: Invalid date range or cursor, or missing organization context\n# 401\n# Description: Unauthorized\n# 503\n# Description: Usage data temporarily unavailable", - "Format": "http", - "OperationId": "get_asset_reference_usage", - "Setup": null - }, - { - "Order": 5, - "Title": "Generate with automatic model selection", - "Slug": "post-generate-image-v2-auto", - "Description": "Generate images with the model Ideogram picks as best suited to each\nrequest. Optionally upload source images as \u0060images\u0060 using\n\u0060multipart/form-data\u0060 to edit them with the prompt. Returns results\ndirectly by default; set \u0060async\u0060 to get a \u0060generation_id\u0060 and poll\n\u0060GET /v2/generations/{generation_id}\u0060.", - "Language": "http", - "Code": "### Generate with automatic model selection\n# @name post_generate_image_v2_auto\nPOST {{host}}/v2/image/generate/auto?dry_run=false\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image_asset_identifiers\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022images\u0022; filename=\u0022images.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./images.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022negative_prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_reference_asset_identifiers\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022aspect_ratio\u0022\n\nauto\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022resolution\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022resolution_tier\u0022\n\n1k\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022magic_prompt\u0022\n\nauto\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022num_images\u0022\n\n1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n12345\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022private\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022target_collection_id\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022category_id\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022async\u0022\n\nfalse\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: The generated images (synchronous requests), or an acknowledgement to poll with \u0060GET /v2/generations/{generation_id}\u0060 (\u0060async\u0060 requests).\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Unauthorized.\n# 402\n# Description: Insufficient credits or quota.\n# Content-Type: application/json\n# 404\n# Description: A source image was not found.\n# 422\n# Description: The prompt did not pass safety checks, or the request combined source images with text-to-image-only fields.\n# 429\n# Description: Too many requests.\n# Content-Type: application/json\n# 500\n# Description: Internal server error.\n# 503\n# Description: The endpoint is temporarily unavailable.", - "Format": "http", - "OperationId": "post_generate_image_v2_auto", - "Setup": null - }, - { - "Order": 6, - "Title": "Remix with automatic model selection", - "Slug": "post-tool-remix", - "Description": "Remix an image guided by a text prompt, with Ideogram choosing the\nmodel. Upload the source image as \u0060image\u0060 using \u0060multipart/form-data\u0060.\nReturns results directly by default; set \u0060async\u0060 or supply a\n\u0060webhook_url\u0060 to get a \u0060generation_id\u0060 and poll\n\u0060GET /v2/generations/{generation_id}\u0060.", - "Language": "http", - "Code": "### Remix with automatic model selection\n# @name post_tool_remix\nPOST {{host}}/v2/image/remix/auto?dry_run=false\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image_asset_identifier\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image\u0022; filename=\u0022image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image_weight\u0022\n\n0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022negative_prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022resolution\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022aspect_ratio\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022resolution_tier\u0022\n\n1k\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022magic_prompt\u0022\n\nauto\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n12345\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_reference_asset_identifiers\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_reference_collection_id\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_reference_collection_version_id\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_preset\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022color_palette\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_codes\u0022\n\nABCD1234\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_type\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022num_images\u0022\n\n1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022enable_copyright_detection\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022async\u0022\n\nfalse\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022webhook_url\u0022\n\nhttps://api.example.com/webhooks/ideogram\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022private\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022target_collection_id\u0022\n\nstring\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: The remixed images (synchronous requests), or an acknowledgement to poll with \u0060GET /v2/generations/{generation_id}\u0060 (\u0060async\u0060 requests).\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Unauthorized.\n# 402\n# Description: Insufficient credits or quota.\n# Content-Type: application/json\n# 404\n# Description: A referenced resource was not found.\n# 422\n# Description: The prompt did not pass safety checks.\n# 429\n# Description: Too many requests.\n# Content-Type: application/json\n# 500\n# Description: Internal server error.\n# 503\n# Description: The endpoint is temporarily unavailable.", - "Format": "http", - "OperationId": "post_tool_remix", - "Setup": null - }, - { - "Order": 7, - "Title": "Get Batch Magic Prompt Job Results if available.", - "Slug": "get-maybe-batch-results", - "Description": "Gets the results of a batch magic prompt job if available.", - "Language": "http", - "Code": "### Get Batch Magic Prompt Job Results if available.\n# @name get_maybe_batch_results\nGET {{host}}/internal/batch/get-maybe-batch-results/{{job_id}}\nAuthorization: Bearer {{token}}\nAccept: application/json\n\n## Responses\n# 200\n# Description: Batch magic prompt job results if available.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Not authorized for batch magic prompt job results request.\n# 429\n# Description: Too many requests.\n# 500\n# Description: Internal server error.", - "Format": "http", - "OperationId": "get_maybe_batch_results", - "Setup": null - }, - { - "Order": 8, - "Title": "Initiate Batch Magic Prompt Evalution", - "Slug": "post-batch", - "Description": "Runs automated evaluation of multiple LLM models and system prompts for magic prompt generation. \nGenerates images using large batches of user prompt inputs. Internal use only (feature flagged).", - "Language": "csharp", - "Code": "using var client = new IdeogramClient(apiKey);\n\nvar request = global::System.Text.Json.JsonSerializer.Deserialize\u003Cglobal::Ideogram.InternalBatchRequest\u003E(\n @\u0022{\n \u0022\u0022user_prompts\u0022\u0022: [\n \u0022\u0022a cat\u0022\u0022,\n \u0022\u0022a dog\u0022\u0022\n ],\n \u0022\u0022sampling_request_params\u0022\u0022: {\n \u0022\u0022magic_prompt_system_prompt_config_id\u0022\u0022: \u0022\u0022magic_prompt_system_prompt_config_id\u0022\u0022,\n \u0022\u0022aspect_ratio\u0022\u0022: \u0022\u00221x1\u0022\u0022,\n \u0022\u0022style_type\u0022\u0022: \u0022\u0022GENERAL\u0022\u0022,\n \u0022\u0022magic_prompt_version\u0022\u0022: \u0022\u0022V_0\u0022\u0022,\n \u0022\u0022seed\u0022\u0022: 12345,\n \u0022\u0022negative_prompt\u0022\u0022: \u0022\u0022brush strokes, painting\u0022\u0022,\n \u0022\u0022magic_prompt_option\u0022\u0022: \u0022\u0022ON\u0022\u0022,\n \u0022\u0022model\u0022\u0022: \u0022\u0022V_2_TURBO\u0022\u0022,\n \u0022\u0022resolution\u0022\u0022: \u0022\u00221280x800\u0022\u0022,\n \u0022\u0022num_images\u0022\u0022: 1,\n \u0022\u0022color_palette\u0022\u0022: {\n \u0022\u0022name\u0022\u0022: \u0022\u0022PASTEL\u0022\u0022\n }\n },\n \u0022\u0022experiment_variant\u0022\u0022: \u0022\u0022MAGIC_PROMPT_NO_TEXT\u0022\u0022\n}\u0022)!;\n\nvar response = await client.Batch.PostBatchAsync(\n request: request\n);\n\n// Example response:\n// {\n// \u0022job_id\u0022: \u0022job_id\u0022\n// }", - "Format": "sdk", - "OperationId": "post_batch", - "Setup": "This example assumes \u0060using Ideogram;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." - }, - { - "Order": 9, - "Title": "Create a new dataset", - "Slug": "create-dataset", - "Description": "Creates a new dataset", - "Language": "csharp", - "Code": "using var client = new IdeogramClient(apiKey);\n\nvar request = global::System.Text.Json.JsonSerializer.Deserialize\u003Cglobal::Ideogram.CreateDatasetRequest\u003E(\n @\u0022{\n \u0022\u0022name\u0022\u0022: \u0022\u0022name\u0022\u0022\n}\u0022)!;\n\nvar response = await client.Datasets.CreateDatasetAsync(\n request: request\n);\n\n// Example response:\n// {\n// \u0022creation_time\u0022: \u00222000-01-23T04:56:07\\u002B00:00\u0022,\n// \u0022user_id\u0022: \u0022user_id\u0022,\n// \u0022dataset_id\u0022: \u0022dataset_id\u0022,\n// \u0022name\u0022: \u0022name\u0022,\n// \u0022cover_asset_identifier\u0022: {\n// \u0022collection_id\u0022: \u0022collection_id\u0022,\n// \u0022asset_type\u0022: null,\n// \u0022asset_id\u0022: \u0022asset_id\u0022\n// }\n// }", - "Format": "sdk", - "OperationId": "create_dataset", - "Setup": "This example assumes \u0060using Ideogram;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." - }, - { - "Order": 10, - "Title": "Get a dataset", - "Slug": "get-dataset", - "Description": "Returns a dataset by ID, including the total number of files and a list of each file\u0027s name and size in bytes.", - "Language": "http", - "Code": "### Get a dataset\n# @name get_dataset\nGET {{host}}/datasets/{{dataset_id}}\nAuthorization: Bearer {{token}}\nAccept: application/json\n\n## Responses\n# 200\n# Description: Dataset retrieved successfully\n# Content-Type: application/json\n# 401\n# Description: Unauthorized\n# 404\n# Description: Dataset not found", - "Format": "http", - "OperationId": "get_dataset", - "Setup": null - }, - { - "Order": 11, - "Title": "List datasets", - "Slug": "list-datasets", - "Description": "Lists datasets for the authenticated user, most recently updated first. Supports an optional case-insensitive name search.", - "Language": "csharp", - "Code": "using var client = new IdeogramClient(apiKey);\nvar response = await client.Datasets.ListDatasetsAsync();\n\n// Example response:\n// {\n// \u0022datasets\u0022: [\n// {\n// \u0022creation_time\u0022: \u00222000-01-23T04:56:07\\u002B00:00\u0022,\n// \u0022user_id\u0022: \u0022user_id\u0022,\n// \u0022dataset_id\u0022: \u0022dataset_id\u0022,\n// \u0022name\u0022: \u0022name\u0022,\n// \u0022cover_asset_identifier\u0022: {\n// \u0022collection_id\u0022: \u0022collection_id\u0022,\n// \u0022asset_type\u0022: null,\n// \u0022asset_id\u0022: \u0022asset_id\u0022\n// }\n// },\n// {\n// \u0022creation_time\u0022: \u00222000-01-23T04:56:07\\u002B00:00\u0022,\n// \u0022user_id\u0022: \u0022user_id\u0022,\n// \u0022dataset_id\u0022: \u0022dataset_id\u0022,\n// \u0022name\u0022: \u0022name\u0022,\n// \u0022cover_asset_identifier\u0022: {\n// \u0022collection_id\u0022: \u0022collection_id\u0022,\n// \u0022asset_type\u0022: null,\n// \u0022asset_id\u0022: \u0022asset_id\u0022\n// }\n// }\n// ]\n// }", - "Format": "sdk", - "OperationId": "list_datasets", - "Setup": "This example assumes \u0060using Ideogram;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." - }, - { - "Order": 12, - "Title": "Train a model from a dataset", - "Slug": "train-dataset-model", - "Description": "Start training a custom model from a dataset. The dataset must contain at least 15 images and a maximum of 100 images. Returns the model ID and training status.", - "Language": "http", - "Code": "### Train a model from a dataset\n# @name train_dataset_model\nPOST {{host}}/datasets/{{dataset_id}}/train_model\nAuthorization: Bearer {{token}}\nContent-Type: application/json\nAccept: application/json\n\n{\n \u0022model_name\u0022: \u0022my-custom-model\u0022\n}\n\n## Responses\n# 200\n# Description: Training started successfully\n# Content-Type: application/json\n# 400\n# Description: Bad request\n# 401\n# Description: Unauthorized\n# 404\n# Description: Dataset not found", - "Format": "http", - "OperationId": "train_dataset_model", - "Setup": null - }, - { - "Order": 13, - "Title": "Upload assets to a dataset", - "Slug": "upload-dataset-assets", - "Description": "Upload image assets to a dataset for model training. Accepts individual images (JPEG, PNG, WebP), optional .txt caption sidecar files, and/or ZIP archives containing images and captions. A dataset can contain up to 100 images.", - "Language": "http", - "Code": "### Upload assets to a dataset\n# @name upload_dataset_assets\nPOST {{host}}/datasets/{{dataset_id}}/upload_assets\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022files\u0022; filename=\u0022files.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./files.bin\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Upload summary\n# Content-Type: application/json\n# 400\n# Description: Bad request\n# 401\n# Description: Unauthorized\n# 404\n# Description: Dataset not found", - "Format": "http", - "OperationId": "upload_dataset_assets", - "Setup": null - }, - { - "Order": 14, - "Title": "Layerize text with Ideogram 3.0", - "Slug": "post-layerize-design-ideogram-v3", - "Description": "Turn a flat image into an editable design: detected text is returned as\npositioned text blocks with matched fonts, sizes, and colors, alongside\na text-free base image. Upload the image as \u0060image\u0060 using\n\u0060multipart/form-data\u0060. Returns results directly by default; set \u0060async\u0060\nor supply a \u0060webhook_url\u0060 to get a \u0060generation_id\u0060 and poll\n\u0060GET /v2/generations/{generation_id}\u0060.", - "Language": "http", - "Code": "### Layerize text with Ideogram 3.0\n# @name post_layerize_design_ideogram_v3\nPOST {{host}}/v2/design/layerize/ideogram-3?dry_run=false\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image_asset_identifier\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image\u0022; filename=\u0022image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n12345\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022font_candidate_files\u0022; filename=\u0022font_candidate_files.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./font_candidate_files.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022async\u0022\n\nfalse\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022webhook_url\u0022\n\nhttps://api.example.com/webhooks/ideogram\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022private\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022target_collection_id\u0022\n\nstring\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: The layerized design (synchronous requests), or an acknowledgement to poll with \u0060GET /v2/generations/{generation_id}\u0060 (\u0060async\u0060 requests).\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Unauthorized.\n# 402\n# Description: Insufficient credits or quota.\n# Content-Type: application/json\n# 403\n# Description: Not authorized to layerize images.\n# 404\n# Description: The source image was not found.\n# 429\n# Description: Too many requests.\n# Content-Type: application/json\n# 500\n# Description: Internal server error.\n# 503\n# Description: The endpoint is temporarily unavailable.", - "Format": "http", - "OperationId": "post_layerize_design_ideogram_v3", - "Setup": null - }, - { - "Order": 15, - "Title": "Ad Localizer", - "Slug": "post-ad-localizer", - "Description": "Rebuilds an ad in one target language, preserving its layout, logos,\nbrand type, and product so only the visible marketing copy changes.\nUpload the source ad as \u0060image\u0060 using \u0060multipart/form-data\u0060; the copy\nis translated unless you supply \u0060exact_copy\u0060.\nReturns a \u0060generation_id\u0060; poll \u0060GET /v2/generations/{generation_id}\u0060 or\nsupply a \u0060webhook_url\u0060.", - "Language": "http", - "Code": "### Ad Localizer\n# @name post_ad_localizer\nPOST {{host}}/v2/tool/ad-localizer?dry_run=false\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image_asset_identifier\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image\u0022; filename=\u0022image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022language\u0022\n\nar\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022exact_copy\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022quality\u0022\n\nlow\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n12345\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022num_images\u0022\n\n1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022target_collection_id\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022private\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022webhook_url\u0022\n\nhttps://api.example.com/webhooks/ideogram\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Ad localization accepted for asynchronous processing.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Unauthorized.\n# 402\n# Description: Insufficient credits or quota.\n# Content-Type: application/json\n# 403\n# Description: Not authorized to use Ad Localizer.\n# 404\n# Description: An input asset was not found or is not readable.\n# 422\n# Description: The instruction did not pass prompt safety checks.\n# 429\n# Description: Too many requests.\n# Content-Type: application/json", - "Format": "http", - "OperationId": "post_ad_localizer", - "Setup": null - }, - { - "Order": 16, - "Title": "Ad Resizer", - "Slug": "post-ad-resizer", - "Description": "Reframes an ad creative to an exact ad resolution, regenerating the\nlayout so text and key elements stay legible at the new size. Upload\nthe source creative as \u0060image\u0060 using \u0060multipart/form-data\u0060, and supply\n\u0060platform\u0060 to keep the ad inside that platform\u0027s safe zone.\nReturns a \u0060generation_id\u0060; poll \u0060GET /v2/generations/{generation_id}\u0060 or\nsupply a \u0060webhook_url\u0060.", - "Language": "http", - "Code": "### Ad Resizer\n# @name post_ad_resizer\nPOST {{host}}/v2/tool/ad-resizer?dry_run=false\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image_asset_identifier\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image\u0022; filename=\u0022image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022resolution\u0022\n\n300x250\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022platform\u0022\n\ngoogle\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022quality\u0022\n\nlow\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022num_images\u0022\n\n1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022target_collection_id\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022private\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022webhook_url\u0022\n\nhttps://api.example.com/webhooks/ideogram\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Ad resize accepted for asynchronous processing.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Unauthorized.\n# 402\n# Description: Insufficient credits or quota.\n# Content-Type: application/json\n# 403\n# Description: Not authorized to resize an ad.\n# 404\n# Description: Source asset not found.\n# 422\n# Description: The prompt was rejected by safety checks.\n# 429\n# Description: Too many requests.\n# Content-Type: application/json", - "Format": "http", - "OperationId": "post_ad_resizer", - "Setup": null - }, - { - "Order": 17, - "Title": "Ad Variations", - "Slug": "post-ad-variations", - "Description": "Creates on-brand variations of an ad along one axis, preserving logos,\nbrand colors, the product, and all on-image text. Upload the source\ncreative as \u0060image\u0060 using \u0060multipart/form-data\u0060 and choose a\n\u0060variation_type\u0060.\nReturns a \u0060generation_id\u0060; poll \u0060GET /v2/generations/{generation_id}\u0060 or\nsupply a \u0060webhook_url\u0060.", - "Language": "http", - "Code": "### Ad Variations\n# @name post_ad_variations\nPOST {{host}}/v2/tool/ad-variations\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image_asset_identifier\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image\u0022; filename=\u0022image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022variation_type\u0022\n\npeople\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022quality\u0022\n\nlow\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022num_images\u0022\n\n1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022private\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022webhook_url\u0022\n\nhttps://api.example.com/webhooks/ideogram\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Ad variation accepted for asynchronous processing.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Unauthorized.\n# 402\n# Description: Insufficient credits or quota.\n# Content-Type: application/json\n# 403\n# Description: Not authorized to generate ad variations.\n# 404\n# Description: Source asset not found.\n# 422\n# Description: The prompt was rejected by safety checks.\n# 429\n# Description: Too many requests.\n# Content-Type: application/json", - "Format": "http", - "OperationId": "post_ad_variations", - "Setup": null - }, - { - "Order": 18, - "Title": "Colorways", - "Slug": "post-colorways", - "Description": "Recolors masked regions of a product photo, each to its own target\ncolor, preserving the product\u0027s geometry, materials, prints, logos, and\neverything outside the masks. Upload the \u0060image\u0060 and up to 4 \u0060masks\u0060\nusing \u0060multipart/form-data\u0060, with one entry in \u0060colors\u0060 per mask.\nReturns a \u0060generation_id\u0060; poll \u0060GET /v2/generations/{generation_id}\u0060 or\nsupply a \u0060webhook_url\u0060.", - "Language": "http", - "Code": "### Colorways\n# @name post_colorways\nPOST {{host}}/v2/tool/colorways?dry_run=false\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image_asset_identifier\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image\u0022; filename=\u0022image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022mask_asset_identifiers\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022masks\u0022; filename=\u0022masks.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./masks.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022colors\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022aspect_ratio\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022quality\u0022\n\nlow\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022target_collection_id\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022private\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022webhook_url\u0022\n\nhttps://api.example.com/webhooks/ideogram\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Colorway accepted for asynchronous processing.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Unauthorized.\n# 402\n# Description: Insufficient credits or quota.\n# Content-Type: application/json\n# 403\n# Description: Not authorized to create a colorway.\n# 429\n# Description: Too many requests.\n# Content-Type: application/json", - "Format": "http", - "OperationId": "post_colorways", - "Setup": null - }, - { - "Order": 19, - "Title": "Ghost Mannequin", - "Slug": "post-ghost-mannequin", - "Description": "Turns photos of one garment into a ghost-mannequin product image on a\nclean white studio background, removing the person, mannequin, hanger,\nand other clothing. Upload the photos using \u0060multipart/form-data\u0060, in\nthe directional fields (such as \u0060front_image\u0060) when the camera\ndirection is known and in \u0060garment_images\u0060 otherwise.\nReturns a \u0060generation_id\u0060; poll \u0060GET /v2/generations/{generation_id}\u0060 or\nsupply a \u0060webhook_url\u0060.", - "Language": "http", - "Code": "### Ghost Mannequin\n# @name post_ghost_mannequin\nPOST {{host}}/v2/tool/ghost-mannequin?dry_run=false\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022garment_asset_identifiers\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022garment_images\u0022; filename=\u0022garment_images.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./garment_images.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022front_asset_identifier\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022front_image\u0022; filename=\u0022front_image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./front_image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022back_asset_identifier\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022back_image\u0022; filename=\u0022back_image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./back_image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022left_asset_identifier\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022left_image\u0022; filename=\u0022left_image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./left_image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022right_asset_identifier\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022right_image\u0022; filename=\u0022right_image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./right_image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022top_asset_identifier\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022top_image\u0022; filename=\u0022top_image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./top_image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022bottom_asset_identifier\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022bottom_image\u0022; filename=\u0022bottom_image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./bottom_image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022output_reference_asset_identifier\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022output_reference_image\u0022; filename=\u0022output_reference_image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./output_reference_image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022view\u0022\n\nfront\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022instruction\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022metadata\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022aspect_ratio\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022quality\u0022\n\nlow\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022target_collection_id\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022private\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022webhook_url\u0022\n\nhttps://api.example.com/webhooks/ideogram\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Ghost-mannequin generation accepted for asynchronous processing.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Unauthorized.\n# 402\n# Description: Insufficient credits or quota.\n# Content-Type: application/json\n# 403\n# Description: Not authorized to create ghost-mannequin images.\n# 404\n# Description: An input asset was not found or is not readable.\n# 413\n# Description: The combined raw image uploads exceed 100 MB.\n# 422\n# Description: The instruction did not pass prompt safety validation.\n# 429\n# Description: Too many requests.\n# Content-Type: application/json", - "Format": "http", - "OperationId": "post_ghost_mannequin", - "Setup": null - }, - { - "Order": 20, - "Title": "Create a fashion lookbook", - "Slug": "post-lookbook", - "Description": "Creates polished fashion product imagery from one or more product\nreferences and an aesthetic reference. Each generated shoot is returned\nas four individual lookbook images.\n\nThe request is processed asynchronously. Poll\n\u0060GET /v2/generations/{generation_id}\u0060 with the returned \u0060generation_id\u0060\nuntil the generation is completed or failed.", - "Language": "csharp", - "Code": "using var client = new IdeogramClient(apiKey);\n\nvar request = global::System.Text.Json.JsonSerializer.Deserialize\u003Cglobal::Ideogram.LookbookRequest\u003E(\n @\u0022{\n \u0022\u0022aspect_ratio\u0022\u0022: \u0022\u0022aspect_ratio\u0022\u0022,\n \u0022\u0022private\u0022\u0022: true,\n \u0022\u0022webhook_url\u0022\u0022: \u0022\u0022https://api.example.com/webhooks/ideogram\u0022\u0022,\n \u0022\u0022category\u0022\u0022: \u0022\u0022dresses\u0022\u0022,\n \u0022\u0022num_shoots\u0022\u0022: 1,\n \u0022\u0022product_asset_identifiers\u0022\u0022: [\n {\n \u0022\u0022asset_type\u0022\u0022: \u0022\u0022RESPONSE\u0022\u0022,\n \u0022\u0022asset_id\u0022\u0022: \u0022\u00227uS_VESkRI6O3-sVgHQp_A\u0022\u0022\n },\n {\n \u0022\u0022asset_type\u0022\u0022: \u0022\u0022RESPONSE\u0022\u0022,\n \u0022\u0022asset_id\u0022\u0022: \u0022\u00227uS_VESkRI6O3-sVgHQp_A\u0022\u0022\n },\n {\n \u0022\u0022asset_type\u0022\u0022: \u0022\u0022RESPONSE\u0022\u0022,\n \u0022\u0022asset_id\u0022\u0022: \u0022\u00227uS_VESkRI6O3-sVgHQp_A\u0022\u0022\n },\n {\n \u0022\u0022asset_type\u0022\u0022: \u0022\u0022RESPONSE\u0022\u0022,\n \u0022\u0022asset_id\u0022\u0022: \u0022\u00227uS_VESkRI6O3-sVgHQp_A\u0022\u0022\n },\n {\n \u0022\u0022asset_type\u0022\u0022: \u0022\u0022RESPONSE\u0022\u0022,\n \u0022\u0022asset_id\u0022\u0022: \u0022\u00227uS_VESkRI6O3-sVgHQp_A\u0022\u0022\n }\n ]\n}\u0022)!;\n\nvar response = await client.EditWorkflow.PostLookbookAsync(\n request: request\n);\n\n// Example response:\n// {\n// \u0022generation_id\u0022: \u0022generation_id\u0022\n// }", - "Format": "sdk", - "OperationId": "post_lookbook", - "Setup": "This example assumes \u0060using Ideogram;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." - }, - { - "Order": 21, - "Title": "Material Swap", - "Slug": "post-material-swap", - "Description": "Re-renders masked regions of a product photo in the materials shown in\nreference images, preserving the product\u0027s construction and everything\noutside the masks. Upload the \u0060image\u0060, up to 4 \u0060masks\u0060, and the\n\u0060materials\u0060 using \u0060multipart/form-data\u0060.\nReturns a \u0060generation_id\u0060; poll \u0060GET /v2/generations/{generation_id}\u0060 or\nsupply a \u0060webhook_url\u0060.", - "Language": "http", - "Code": "### Material Swap\n# @name post_material_swap\nPOST {{host}}/v2/tool/material-swap?dry_run=false\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image_asset_identifier\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image\u0022; filename=\u0022image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022mask_asset_identifiers\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022masks\u0022; filename=\u0022masks.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./masks.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022material_asset_identifiers\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022materials\u0022; filename=\u0022materials.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./materials.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022aspect_ratio\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022quality\u0022\n\nlow\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022target_collection_id\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022private\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022webhook_url\u0022\n\nhttps://api.example.com/webhooks/ideogram\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Material swap accepted for asynchronous processing.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Unauthorized.\n# 402\n# Description: Insufficient credits or quota.\n# Content-Type: application/json\n# 403\n# Description: Not authorized to create a material swap.\n# 429\n# Description: Too many requests.\n# Content-Type: application/json", - "Format": "http", - "OperationId": "post_material_swap", - "Setup": null - }, - { - "Order": 22, - "Title": "Model Pose Variants", - "Slug": "post-model-pose-variants", - "Description": "Changes the model\u0027s pose or camera angle in a fashion image while\npreserving the model, garment, styling, and scene. Upload the\n\u0060source_image\u0060 using \u0060multipart/form-data\u0060 and describe the new pose in\n\u0060instruction\u0060.\nReturns a \u0060generation_id\u0060; poll \u0060GET /v2/generations/{generation_id}\u0060 or\nsupply a \u0060webhook_url\u0060.", - "Language": "http", - "Code": "### Model Pose Variants\n# @name post_model_pose_variants\nPOST {{host}}/v2/tool/model-pose-variants\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022source_asset_identifier\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022source_image\u0022; filename=\u0022source_image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./source_image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022pose_reference_asset_identifier\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022instruction\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022aspect_ratio\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022quality\u0022\n\nlow\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022num_images\u0022\n\n1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022private\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022webhook_url\u0022\n\nhttps://api.example.com/webhooks/ideogram\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Pose-variant generation accepted for asynchronous processing.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Unauthorized.\n# 402\n# Description: Insufficient credits or quota.\n# Content-Type: application/json\n# 403\n# Description: Not authorized to generate pose variants.\n# 404\n# Description: An input asset was not found or is not readable.\n# 422\n# Description: The instruction did not pass prompt safety checks.\n# 429\n# Description: Too many requests.\n# Content-Type: application/json", - "Format": "http", - "OperationId": "post_model_pose_variants", - "Setup": null - }, - { - "Order": 23, - "Title": "Model Swap", - "Slug": "post-model-swap", - "Description": "Replaces the model in a fashion image with the person shown in one to\nfour target-model references, keeping the product, pose, scene,\nlighting, and framing. Upload the working image as \u0060source_image\u0060 using\n\u0060multipart/form-data\u0060.\nReturns a \u0060generation_id\u0060; poll \u0060GET /v2/generations/{generation_id}\u0060 or\nsupply a \u0060webhook_url\u0060.", - "Language": "http", - "Code": "### Model Swap\n# @name post_model_swap\nPOST {{host}}/v2/tool/model-swap\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022source_asset_identifier\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022source_image\u0022; filename=\u0022source_image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./source_image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022model_asset_identifiers\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022instruction\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022aspect_ratio\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022quality\u0022\n\nlow\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022num_images\u0022\n\n1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022private\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022webhook_url\u0022\n\nhttps://api.example.com/webhooks/ideogram\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Model swap accepted for asynchronous processing.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Unauthorized.\n# 402\n# Description: Insufficient credits or quota.\n# Content-Type: application/json\n# 403\n# Description: Not authorized to use model swap.\n# 404\n# Description: An input asset was not found or is not readable.\n# 422\n# Description: The instruction did not pass prompt safety checks.\n# 429\n# Description: Too many requests.\n# Content-Type: application/json", - "Format": "http", - "OperationId": "post_model_swap", - "Setup": null - }, - { - "Order": 24, - "Title": "Packshots", - "Slug": "post-packshots", - "Description": "Creates one polished product photograph from one or more ordered product\nreferences. An optional style reference may guide framing, crop,\nbackground, and lighting without changing the product\u0027s identity.\n\nThe request is processed asynchronously. Poll\n\u0060GET /v2/generations/{generation_id}\u0060 with the returned \u0060generation_id\u0060\nuntil the generation is completed or failed. Product fidelity is\nbest-effort and details absent from every reference may be reconstructed.", - "Language": "csharp", - "Code": "using var client = new IdeogramClient(apiKey);\n\nvar request = global::System.Text.Json.JsonSerializer.Deserialize\u003Cglobal::Ideogram.PackshotsRequest\u003E(\n @\u0022{\n \u0022\u0022product_asset_identifiers\u0022\u0022: [\n {\n \u0022\u0022asset_type\u0022\u0022: \u0022\u0022RESPONSE\u0022\u0022,\n \u0022\u0022asset_id\u0022\u0022: \u0022\u00227uS_VESkRI6O3-sVgHQp_A\u0022\u0022\n }\n ],\n \u0022\u0022view\u0022\u0022: \u0022\u0022front\u0022\u0022\n}\u0022)!;\n\nvar response = await client.EditWorkflow.PostPackshotsAsync(\n request: request\n);\n\n// Example response:\n// {\n// \u0022generation_id\u0022: \u0022generation_id\u0022\n// }", - "Format": "sdk", - "OperationId": "post_packshots", - "Setup": "This example assumes \u0060using Ideogram;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." - }, - { - "Order": 25, - "Title": "Edit an image, optionally using a mask", - "Slug": "post-precise-masked-edit", - "Description": "Applies an instruction to an image. When a mask is supplied, it identifies\nthe primary edit region. Without a mask, the model edits the full image.\nOptional reference images can guide the requested appearance. Set\n\u0060preserve_unmasked_pixels\u0060 to keep decoded pixels outside a supplied mask\nunchanged in the final image.\n\nThe request runs asynchronously. Poll\n\u0060GET /v2/generations/{generation_id}\u0060 with the returned \u0060generation_id\u0060\nuntil the generation is completed or failed.", - "Language": "http", - "Code": "### Edit an image, optionally using a mask\n# @name post_precise_masked_edit\nPOST {{host}}/v2/workflow/precise-masked-edit\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022model\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022quality\u0022\n\nhigh\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022source_asset_identifier\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022source_image\u0022; filename=\u0022source_image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./source_image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022mask_asset_identifier\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022reference_asset_identifiers\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022instruction\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022num_images\u0022\n\n1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022target_collection_id\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022private\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022preserve_unmasked_pixels\u0022\n\nfalse\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022webhook_url\u0022\n\nhttps://api.example.com/webhooks/ideogram\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Precise masked edit accepted for asynchronous processing.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Unauthorized.\n# 402\n# Description: Insufficient credits or quota.\n# Content-Type: application/json\n# 403\n# Description: Not authorized to use precise masked editing.\n# 404\n# Description: An input asset was not found or is not readable.\n# 429\n# Description: Too many requests.\n# Content-Type: application/json\n# 503\n# Description: Precise masked editing is temporarily unavailable.", - "Format": "http", - "OperationId": "post_precise_masked_edit", - "Setup": null - }, - { - "Order": 26, - "Title": "Edit a product image using an instruction and ordered references", - "Slug": "post-skechers-style-edit", - "Description": "Edits the base image while preserving details the instruction does not\nchange. Image 1 is the base; reference images are numbered from image 2\nin the supplied order. Resolve image mentions to these numbers before\nsubmitting. Descriptions identify the selected view or reference.\n\nPoll GET /v2/generations/{generation_id} with the returned generation_id\nuntil the workflow completes or fails.", - "Language": "csharp", - "Code": "using var client = new IdeogramClient(apiKey);\n\nvar request = global::System.Text.Json.JsonSerializer.Deserialize\u003Cglobal::Ideogram.SkechersStyleEditRequest\u003E(\n @\u0022{\n \u0022\u0022base_description\u0022\u0022: \u0022\u0022base_description\u0022\u0022,\n \u0022\u0022aspect_ratio\u0022\u0022: \u0022\u00221:1\u0022\u0022,\n \u0022\u0022private\u0022\u0022: true,\n \u0022\u0022reference_asset_identifiers\u0022\u0022: [\n {\n \u0022\u0022asset_type\u0022\u0022: \u0022\u0022RESPONSE\u0022\u0022,\n \u0022\u0022asset_id\u0022\u0022: \u0022\u00227uS_VESkRI6O3-sVgHQp_A\u0022\u0022\n },\n {\n \u0022\u0022asset_type\u0022\u0022: \u0022\u0022RESPONSE\u0022\u0022,\n \u0022\u0022asset_id\u0022\u0022: \u0022\u00227uS_VESkRI6O3-sVgHQp_A\u0022\u0022\n },\n {\n \u0022\u0022asset_type\u0022\u0022: \u0022\u0022RESPONSE\u0022\u0022,\n \u0022\u0022asset_id\u0022\u0022: \u0022\u00227uS_VESkRI6O3-sVgHQp_A\u0022\u0022\n },\n {\n \u0022\u0022asset_type\u0022\u0022: \u0022\u0022RESPONSE\u0022\u0022,\n \u0022\u0022asset_id\u0022\u0022: \u0022\u00227uS_VESkRI6O3-sVgHQp_A\u0022\u0022\n },\n {\n \u0022\u0022asset_type\u0022\u0022: \u0022\u0022RESPONSE\u0022\u0022,\n \u0022\u0022asset_id\u0022\u0022: \u0022\u00227uS_VESkRI6O3-sVgHQp_A\u0022\u0022\n }\n ],\n \u0022\u0022webhook_url\u0022\u0022: \u0022\u0022https://api.example.com/webhooks/ideogram\u0022\u0022,\n \u0022\u0022base_generation_size\u0022\u0022: \u0022\u00222k\u0022\u0022,\n \u0022\u0022base_asset_identifier\u0022\u0022: \u0022\u0022\u0022\u0022,\n \u0022\u0022reference_descriptions\u0022\u0022: [\n \u0022\u0022reference_descriptions\u0022\u0022,\n \u0022\u0022reference_descriptions\u0022\u0022,\n \u0022\u0022reference_descriptions\u0022\u0022,\n \u0022\u0022reference_descriptions\u0022\u0022,\n \u0022\u0022reference_descriptions\u0022\u0022\n ],\n \u0022\u0022resolved_instruction\u0022\u0022: \u0022\u0022resolved_instruction\u0022\u0022,\n \u0022\u0022num_images\u0022\u0022: 0,\n \u0022\u0022quality\u0022\u0022: null\n}\u0022)!;\n\nvar response = await client.EditWorkflow.PostSkechersStyleEditAsync(\n request: request\n);\n\n// Example response:\n// {\n// \u0022generation_id\u0022: \u0022generation_id\u0022\n// }", - "Format": "sdk", - "OperationId": "post_skechers_style_edit", - "Setup": "This example assumes \u0060using Ideogram;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." - }, - { - "Order": 27, - "Title": "Sketch to Render", - "Slug": "post-sketch-to-render", - "Description": "Turns a fashion sketch into photorealistic garment or product imagery,\npreserving its silhouette, construction, colors, and design details.\nUpload the \u0060sketch_image\u0060 using \u0060multipart/form-data\u0060 and describe\nmaterials and rendering in \u0060instruction\u0060.\nReturns a \u0060generation_id\u0060; poll \u0060GET /v2/generations/{generation_id}\u0060 or\nsupply a \u0060webhook_url\u0060.", - "Language": "http", - "Code": "### Sketch to Render\n# @name post_sketch_to_render\nPOST {{host}}/v2/tool/sketch-to-render\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022sketch_asset_identifier\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022sketch_image\u0022; filename=\u0022sketch_image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./sketch_image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022instruction\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022aspect_ratio\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022quality\u0022\n\nlow\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022num_images\u0022\n\n1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022private\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022webhook_url\u0022\n\nhttps://api.example.com/webhooks/ideogram\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Sketch rendering accepted for asynchronous processing.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Unauthorized.\n# 402\n# Description: Insufficient credits or quota.\n# Content-Type: application/json\n# 403\n# Description: Not authorized to render sketches.\n# 404\n# Description: The referenced sketch was not found or is not readable.\n# 422\n# Description: The instruction did not pass prompt safety validation.\n# 429\n# Description: Too many requests.\n# Content-Type: application/json", - "Format": "http", - "OperationId": "post_sketch_to_render", - "Setup": null - }, - { - "Order": 28, - "Title": "Sole Swap", - "Slug": "post-sole-swap", - "Description": "Uses the sole-donor shoe as the output canvas, preserving its sole, camera,\nbackground, and lighting while transferring the upper from ordered references.\n\nThe request is processed asynchronously. Poll\n\u0060GET /v2/generations/{generation_id}\u0060 with the returned\n\u0060generation_id\u0060 until the generation is completed or failed.", - "Language": "csharp", - "Code": "using var client = new IdeogramClient(apiKey);\n\nvar request = global::System.Text.Json.JsonSerializer.Deserialize\u003Cglobal::Ideogram.SoleSwapRequest\u003E(\n @\u0022{\n \u0022\u0022aspect_ratio\u0022\u0022: \u0022\u0022aspect_ratio\u0022\u0022,\n \u0022\u0022private\u0022\u0022: true,\n \u0022\u0022seed\u0022\u0022: 12345,\n \u0022\u0022webhook_url\u0022\u0022: \u0022\u0022https://api.example.com/webhooks/ideogram\u0022\u0022,\n \u0022\u0022base_generation_size\u0022\u0022: \u0022\u00222k\u0022\u0022,\n \u0022\u0022base_asset_identifier\u0022\u0022: {\n \u0022\u0022asset_type\u0022\u0022: \u0022\u0022RESPONSE\u0022\u0022,\n \u0022\u0022asset_id\u0022\u0022: \u0022\u00227uS_VESkRI6O3-sVgHQp_A\u0022\u0022\n },\n \u0022\u0022instruction\u0022\u0022: \u0022\u0022instruction\u0022\u0022,\n \u0022\u0022num_images\u0022\u0022: 0,\n \u0022\u0022upper_asset_identifiers\u0022\u0022: [\n {\n \u0022\u0022asset_type\u0022\u0022: \u0022\u0022RESPONSE\u0022\u0022,\n \u0022\u0022asset_id\u0022\u0022: \u0022\u00227uS_VESkRI6O3-sVgHQp_A\u0022\u0022\n },\n {\n \u0022\u0022asset_type\u0022\u0022: \u0022\u0022RESPONSE\u0022\u0022,\n \u0022\u0022asset_id\u0022\u0022: \u0022\u00227uS_VESkRI6O3-sVgHQp_A\u0022\u0022\n },\n {\n \u0022\u0022asset_type\u0022\u0022: \u0022\u0022RESPONSE\u0022\u0022,\n \u0022\u0022asset_id\u0022\u0022: \u0022\u00227uS_VESkRI6O3-sVgHQp_A\u0022\u0022\n },\n {\n \u0022\u0022asset_type\u0022\u0022: \u0022\u0022RESPONSE\u0022\u0022,\n \u0022\u0022asset_id\u0022\u0022: \u0022\u00227uS_VESkRI6O3-sVgHQp_A\u0022\u0022\n },\n {\n \u0022\u0022asset_type\u0022\u0022: \u0022\u0022RESPONSE\u0022\u0022,\n \u0022\u0022asset_id\u0022\u0022: \u0022\u00227uS_VESkRI6O3-sVgHQp_A\u0022\u0022\n }\n ],\n \u0022\u0022quality\u0022\u0022: null\n}\u0022)!;\n\nvar response = await client.EditWorkflow.PostSoleSwapAsync(\n request: request\n);\n\n// Example response:\n// {\n// \u0022generation_id\u0022: \u0022generation_id\u0022\n// }", - "Format": "sdk", - "OperationId": "post_sole_swap", - "Setup": "This example assumes \u0060using Ideogram;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." - }, - { - "Order": 29, - "Title": "Design one Swan S logo candidate", - "Slug": "post-swan-s-logo-design", - "Description": "Creates one isolated logo candidate using either a shoe swatch or a supplied style reference. For 3D reference designs, choose split or full coverage with design_variant. Send a separate request for each candidate; each request completes and is billed independently. Processing is asynchronous. Poll GET /v2/generations/{generation_id} until completed or failed.", - "Language": "csharp", - "Code": "using var client = new IdeogramClient(apiKey);\n\nvar request = global::System.Text.Json.JsonSerializer.Deserialize\u003Cglobal::Ideogram.SwanSLogoDesignRequest\u003E(\n @\u0022{\n \u0022\u0022logo_style\u0022\u0022: \u0022\u00223d\u0022\u0022,\n \u0022\u0022flat_silhouette_asset_identifier\u0022\u0022: {\n \u0022\u0022asset_type\u0022\u0022: \u0022\u0022RESPONSE\u0022\u0022,\n \u0022\u0022asset_id\u0022\u0022: \u0022\u00227uS_VESkRI6O3-sVgHQp_A\u0022\u0022\n },\n \u0022\u0022private\u0022\u0022: true,\n \u0022\u0022webhook_url\u0022\u0022: \u0022\u0022https://api.example.com/webhooks/ideogram\u0022\u0022,\n \u0022\u0022source_mode\u0022\u0022: \u0022\u0022shoe_swatch\u0022\u0022,\n \u0022\u0022logo_specification_asset_identifier\u0022\u0022: {\n \u0022\u0022asset_type\u0022\u0022: \u0022\u0022RESPONSE\u0022\u0022,\n \u0022\u0022asset_id\u0022\u0022: \u0022\u00227uS_VESkRI6O3-sVgHQp_A\u0022\u0022\n },\n \u0022\u0022design_variant\u0022\u0022: \u0022\u0022split_coverage\u0022\u0022,\n \u0022\u0022style_source_asset_identifier\u0022\u0022: {\n \u0022\u0022asset_type\u0022\u0022: \u0022\u0022RESPONSE\u0022\u0022,\n \u0022\u0022asset_id\u0022\u0022: \u0022\u00227uS_VESkRI6O3-sVgHQp_A\u0022\u0022\n },\n \u0022\u0022geometry_hero_asset_identifier\u0022\u0022: {\n \u0022\u0022asset_type\u0022\u0022: \u0022\u0022RESPONSE\u0022\u0022,\n \u0022\u0022asset_id\u0022\u0022: \u0022\u00227uS_VESkRI6O3-sVgHQp_A\u0022\u0022\n },\n \u0022\u0022quality\u0022\u0022: null\n}\u0022)!;\n\nvar response = await client.EditWorkflow.PostSwanSLogoDesignAsync(\n request: request\n);\n\n// Example response:\n// {\n// \u0022generation_id\u0022: \u0022generation_id\u0022\n// }", - "Format": "sdk", - "OperationId": "post_swan_s_logo_design", - "Setup": "This example assumes \u0060using Ideogram;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." - }, - { - "Order": 30, - "Title": "Install a Swan S logo on a shoe", - "Slug": "post-swan-s-logo-install", - "Description": "Installs the selected logo onto the ordered shoe views, preserving the shoe and chosen camera framing. Processing is asynchronous. Poll GET /v2/generations/{generation_id} until completed or failed.", - "Language": "csharp", - "Code": "using var client = new IdeogramClient(apiKey);\n\nvar request = global::System.Text.Json.JsonSerializer.Deserialize\u003Cglobal::Ideogram.SwanSLogoInstallRequest\u003E(\n @\u0022{\n \u0022\u0022logo_style\u0022\u0022: \u0022\u00223d\u0022\u0022,\n \u0022\u0022aspect_ratio\u0022\u0022: \u0022\u0022aspect_ratio\u0022\u0022,\n \u0022\u0022private\u0022\u0022: true,\n \u0022\u0022webhook_url\u0022\u0022: \u0022\u0022https://api.example.com/webhooks/ideogram\u0022\u0022,\n \u0022\u0022logo_asset_identifier\u0022\u0022: {\n \u0022\u0022asset_type\u0022\u0022: \u0022\u0022RESPONSE\u0022\u0022,\n \u0022\u0022asset_id\u0022\u0022: \u0022\u00227uS_VESkRI6O3-sVgHQp_A\u0022\u0022\n },\n \u0022\u0022logo_specification_asset_identifier\u0022\u0022: {\n \u0022\u0022asset_type\u0022\u0022: \u0022\u0022RESPONSE\u0022\u0022,\n \u0022\u0022asset_id\u0022\u0022: \u0022\u00227uS_VESkRI6O3-sVgHQp_A\u0022\u0022\n },\n \u0022\u0022shoe_asset_identifiers\u0022\u0022: [\n {\n \u0022\u0022asset_type\u0022\u0022: \u0022\u0022RESPONSE\u0022\u0022,\n \u0022\u0022asset_id\u0022\u0022: \u0022\u00227uS_VESkRI6O3-sVgHQp_A\u0022\u0022\n },\n {\n \u0022\u0022asset_type\u0022\u0022: \u0022\u0022RESPONSE\u0022\u0022,\n \u0022\u0022asset_id\u0022\u0022: \u0022\u00227uS_VESkRI6O3-sVgHQp_A\u0022\u0022\n },\n {\n \u0022\u0022asset_type\u0022\u0022: \u0022\u0022RESPONSE\u0022\u0022,\n \u0022\u0022asset_id\u0022\u0022: \u0022\u00227uS_VESkRI6O3-sVgHQp_A\u0022\u0022\n },\n {\n \u0022\u0022asset_type\u0022\u0022: \u0022\u0022RESPONSE\u0022\u0022,\n \u0022\u0022asset_id\u0022\u0022: \u0022\u00227uS_VESkRI6O3-sVgHQp_A\u0022\u0022\n },\n {\n \u0022\u0022asset_type\u0022\u0022: \u0022\u0022RESPONSE\u0022\u0022,\n \u0022\u0022asset_id\u0022\u0022: \u0022\u00227uS_VESkRI6O3-sVgHQp_A\u0022\u0022\n }\n ],\n \u0022\u0022num_images\u0022\u0022: 0,\n \u0022\u0022quality\u0022\u0022: null\n}\u0022)!;\n\nvar response = await client.EditWorkflow.PostSwanSLogoInstallAsync(\n request: request\n);\n\n// Example response:\n// {\n// \u0022generation_id\u0022: \u0022generation_id\u0022\n// }", - "Format": "sdk", - "OperationId": "post_swan_s_logo_install", - "Setup": "This example assumes \u0060using Ideogram;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." - }, - { - "Order": 31, - "Title": "Swap Product", - "Slug": "post-swap-product", - "Description": "Edits the footwear in a source advertisement using ordered product references.\nPoll \u0060GET /v2/generations/{generation_id}\u0060 for status and image results.", - "Language": "csharp", - "Code": "using var client = new IdeogramClient(apiKey);\n\nvar request = global::System.Text.Json.JsonSerializer.Deserialize\u003Cglobal::Ideogram.SwapProductRequest\u003E(\n @\u0022{\n \u0022\u0022mode\u0022\u0022: null,\n \u0022\u0022aspect_ratio\u0022\u0022: \u0022\u0022aspect_ratio\u0022\u0022,\n \u0022\u0022private\u0022\u0022: true,\n \u0022\u0022webhook_url\u0022\u0022: \u0022\u0022https://api.example.com/webhooks/ideogram\u0022\u0022,\n \u0022\u0022instruction\u0022\u0022: \u0022\u0022instruction\u0022\u0022,\n \u0022\u0022source_asset_identifier\u0022\u0022: {\n \u0022\u0022asset_type\u0022\u0022: \u0022\u0022RESPONSE\u0022\u0022,\n \u0022\u0022asset_id\u0022\u0022: \u0022\u00227uS_VESkRI6O3-sVgHQp_A\u0022\u0022\n },\n \u0022\u0022num_images\u0022\u0022: 0,\n \u0022\u0022product_asset_identifiers\u0022\u0022: [\n {\n \u0022\u0022asset_type\u0022\u0022: \u0022\u0022RESPONSE\u0022\u0022,\n \u0022\u0022asset_id\u0022\u0022: \u0022\u00227uS_VESkRI6O3-sVgHQp_A\u0022\u0022\n },\n {\n \u0022\u0022asset_type\u0022\u0022: \u0022\u0022RESPONSE\u0022\u0022,\n \u0022\u0022asset_id\u0022\u0022: \u0022\u00227uS_VESkRI6O3-sVgHQp_A\u0022\u0022\n },\n {\n \u0022\u0022asset_type\u0022\u0022: \u0022\u0022RESPONSE\u0022\u0022,\n \u0022\u0022asset_id\u0022\u0022: \u0022\u00227uS_VESkRI6O3-sVgHQp_A\u0022\u0022\n },\n {\n \u0022\u0022asset_type\u0022\u0022: \u0022\u0022RESPONSE\u0022\u0022,\n \u0022\u0022asset_id\u0022\u0022: \u0022\u00227uS_VESkRI6O3-sVgHQp_A\u0022\u0022\n },\n {\n \u0022\u0022asset_type\u0022\u0022: \u0022\u0022RESPONSE\u0022\u0022,\n \u0022\u0022asset_id\u0022\u0022: \u0022\u00227uS_VESkRI6O3-sVgHQp_A\u0022\u0022\n }\n ],\n \u0022\u0022quality\u0022\u0022: null\n}\u0022)!;\n\nvar response = await client.EditWorkflow.PostSwapProductAsync(\n request: request\n);\n\n// Example response:\n// {\n// \u0022generation_id\u0022: \u0022generation_id\u0022\n// }", - "Format": "sdk", - "OperationId": "post_swap_product", - "Setup": "This example assumes \u0060using Ideogram;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." - }, - { - "Order": 32, - "Title": "Text Layerizer", - "Slug": "post-text-layerizer", - "Description": "Turns a flat image into an editable design asynchronously: detected text\nis returned as positioned text blocks with matched fonts, sizes, and\ncolors, alongside a text-free base image and a standalone HTML page of\nthe editable design. Returns a \u0060generation_id\u0060; poll\n\u0060GET /v2/generations/{generation_id}\u0060 or supply a \u0060webhook_url\u0060.", - "Language": "http", - "Code": "### Text Layerizer\n# @name post_text_layerizer\nPOST {{host}}/v2/tool/text-layerizer?dry_run=false\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image\u0022; filename=\u0022image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image_asset_identifier\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n12345\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022font_candidate_files\u0022; filename=\u0022font_candidate_files.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./font_candidate_files.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022private\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022target_collection_id\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022webhook_url\u0022\n\nhttps://api.example.com/webhooks/ideogram\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Layerization accepted; dry runs return the shared PriceQuote response.\n# Content-Type: application/json\n# 400\n# Description: Invalid source image, font file, or input combination.\n# 401\n# Description: Authentication required.\n# 402\n# Description: Insufficient credits.\n# Content-Type: application/json\n# 403\n# Description: Access denied.\n# 404\n# Description: Source not found.\n# 429\n# Description: Too many requests.\n# Content-Type: application/json\n# 503\n# Description: Layerization is unavailable.", - "Format": "http", - "OperationId": "post_text_layerizer", - "Setup": null - }, - { - "Order": 33, - "Title": "Vectorizer", - "Slug": "post-vectorizer", - "Description": "Converts an image to SVG asynchronously.", - "Language": "http", - "Code": "### Vectorizer\n# @name post_vectorizer\nPOST {{host}}/v2/tool/vectorizer?dry_run=false\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image\u0022; filename=\u0022image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image_asset_identifier\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022mode\u0022\n\ndefault\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022group\u0022\n\nfalse\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022private\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022target_collection_id\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022webhook_url\u0022\n\nhttps://api.example.com/webhooks/ideogram\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Conversion accepted; dry runs return the shared PriceQuote response.\n# Content-Type: application/json\n# 400\n# Description: Invalid source image or input combination.\n# 401\n# Description: Authentication required.\n# 402\n# Description: Insufficient credits.\n# Content-Type: application/json\n# 403\n# Description: Access denied.\n# 404\n# Description: Source not found.\n# 429\n# Description: Too many requests.\n# Content-Type: application/json\n# 503\n# Description: Conversion is unavailable.", - "Format": "http", - "OperationId": "post_vectorizer", - "Setup": null - }, - { - "Order": 34, - "Title": "Dress a person in one or more garments", - "Slug": "post-virtual-try-on", - "Description": "Generates a photorealistic image of the person in the supplied photo\nwearing the supplied garments, preserving their face, body, and\nbackground.\n\nThe request is processed asynchronously. Poll\n\u0060GET /v2/generations/{generation_id}\u0060 with the returned \u0060generation_id\u0060\nuntil the generation is completed or failed.\n\nSupply the person as either an \u0060AssetIdentifier\u0060 reference\n(\u0060person_asset_identifier\u0060) or the raw image bytes directly\n(\u0060person_image\u0060, multipart requests only), and likewise the garments as\neither \u0060garment_asset_identifiers\u0060 or \u0060garment_images\u0060. For each of the\ntwo sources, provide exactly one of the two forms; supplying both, or\nneither, is rejected with a 400.", - "Language": "http", - "Code": "### Dress a person in one or more garments\n# @name post_virtual_try_on\nPOST {{host}}/v2/workflow/virtual-try-on\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022person_asset_identifier\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022person_image\u0022; filename=\u0022person_image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./person_image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022garment_asset_identifiers\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022garment_images\u0022; filename=\u0022garment_images.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./garment_images.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022aspect_ratio\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022instruction\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022private\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022webhook_url\u0022\n\nhttps://api.example.com/webhooks/ideogram\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Try-on accepted for asynchronous processing.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Unauthorized.\n# 402\n# Description: Insufficient credits or quota.\n# Content-Type: application/json\n# 403\n# Description: Not authorized to create a try-on.\n# 429\n# Description: Too many requests.\n# Content-Type: application/json", - "Format": "http", - "OperationId": "post_virtual_try_on", - "Setup": null - }, - { - "Order": 35, - "Title": "Poll a generation", - "Slug": "get-generation", - "Description": "Retrieves the current status of an asynchronous generation, and its results once complete. Use the \u0060generation_id\u0060 returned by the async generation endpoint. While the generation is \u0060pending\u0060 or has \u0060failed\u0060, the response contains only \u0060generation_id\u0060, \u0060status\u0060, and \u0060created\u0060. Once \u0060status\u0060 is \u0060completed\u0060, the response includes \u0060response_type\u0060 and \u0060data\u0060, and may include \u0060usage_cost_usd_micros\u0060 when the request uses variable usage-based pricing.", - "Language": "http", - "Code": "### Poll a generation\n# @name get_generation\nGET {{host}}/v1/generations/{{generation_id}}\nAuthorization: Bearer {{token}}\nAccept: application/json\n\n## Responses\n# 200\n# Description: Generation status retrieved successfully.\n# Content-Type: application/json\n# 400\n# Description: Invalid request ID provided.\n# 401\n# Description: Not authorized.\n# 404\n# Description: Request not found.\n# 429\n# Description: Too many requests.", - "Format": "http", - "OperationId": "get_generation", - "Setup": null - }, - { - "Order": 36, - "Title": "Edit (legacy)", - "Slug": "post-edit-image", - "Description": "Edit a given image synchronously using the provided mask. The mask indicates which part of the image\nshould be edited, while the prompt and chosen style type can further guide the edit.\n\nSupported image formats include JPEG, PNG, and WebP.\n\nImages links are available for a limited period of time; if you would like to keep the image, you must download it.", - "Language": "http", - "Code": "### Edit (legacy)\n# @name post_edit_image\nPOST {{host}}/edit\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image_file\u0022; filename=\u0022image_file.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./image_file.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022mask\u0022; filename=\u0022mask.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./mask.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\nA serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there is an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset.\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022model\u0022\n\nV_2_TURBO\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022magic_prompt_option\u0022\n\nON\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022magic_prompt_system_prompt_config_id\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022num_images\u0022\n\n1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n12345\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_type\u0022\n\nREALISTIC\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Image edits generated successfully.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Not authorized to generate an image.\n# 422\n# Description: Prompt or Initial Image failed the safety checks.\n# Content-Type: application/json\n# 429\n# Description: Too many requests.", - "Format": "http", - "OperationId": "post_edit_image", - "Setup": null - }, - { - "Order": 37, - "Title": "Generate a design from a text prompt with text detection and correction", - "Slug": "post-generate-design-v3", - "Description": "Generates a design synchronously from a text prompt using the Ideogram 3.0 model, then detects and corrects text layers within the generated image.\n\nThe response includes the generated image URL along with detected text layers (with font, size, color, position) and image asset layers.\n\nImages links are available for a limited period of time; if you would like to keep the image, you must download it.", - "Language": "http", - "Code": "### Generate a design from a text prompt with text detection and correction\n# @name post_generate_design_v3\nPOST {{host}}/v1/ideogram-v3/generate-design\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\nA birthday card saying \u0027Happy Birthday\u0027\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n12345\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022resolution\u0022\n\n1280x800\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022aspect_ratio\u0022\n\n1x3\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022rendering_speed\u0022\n\nDEFAULT\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022magic_prompt\u0022\n\nON\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022magic_prompt_system_prompt_config_id\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022negative_prompt\u0022\n\nbrush strokes, painting\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022num_images\u0022\n\n1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022color_palette\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_codes\u0022\n\nABCD1234\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_type\u0022\n\nGENERAL\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_preset\u0022\n\nBRIGHT_ART\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022custom_model_uri\u0022\n\nmodel/my-custom-model/version/1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022font_file_h1\u0022; filename=\u0022font_file_h1.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./font_file_h1.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022font_name_h1\u0022\n\nUbuntu-Bold.ttf\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022font_file_h2\u0022; filename=\u0022font_file_h2.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./font_file_h2.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022font_name_h2\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022font_file_body\u0022; filename=\u0022font_file_body.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./font_file_body.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022font_name_body\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022font_file_small\u0022; filename=\u0022font_file_small.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./font_file_small.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022font_name_small\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_reference_images\u0022; filename=\u0022style_reference_images.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./style_reference_images.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022reference_asset_images\u0022; filename=\u0022reference_asset_images.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./reference_asset_images.bin\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Design(s) generated successfully with text correction.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Not authorized to generate an image.\n# 422\n# Description: Prompt failed the safety check.\n# Content-Type: application/json\n# 429\n# Description: Too many requests.", - "Format": "http", - "OperationId": "post_generate_design_v3", - "Setup": null - }, - { - "Order": 38, - "Title": "Generate an editable design with Ideogram 4.0 HTML", - "Slug": "post-generate-design-v4", - "Description": "Experimental prototype endpoint for generating an editable V4 HTML design from a prompt.\n\nOptionally accepts inspiration reference images to guide transferable visual style. Inspiration images are design/style references only and are not edit targets.\n\nImages links are available for a limited period of time; if you would like to keep the image, you must download it.", - "Language": "http", - "Code": "### Generate an editable design with Ideogram 4.0 HTML\n# @name post_generate_design_v4\nPOST {{host}}/v1/ideogram-v4/generate-design\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json, image/png, text/html\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022magic_prompt_option\u0022\n\nON\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022magic_prompt_system_prompt_config_id\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022resolution\u0022\n\n1024x1024\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022rendering_speed\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022inspiration_reference_images\u0022; filename=\u0022inspiration_reference_images.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./inspiration_reference_images.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022inspiration_reference_model\u0022\n\nclaude-sonnet-4-6\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022artifact_generation_model\u0022\n\nclaude-sonnet-4-6\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022layout2image_variant\u0022\n\nopus_4_7\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022response_type\u0022\n\nlayered\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Design(s) generated successfully.\n# Content-Type: application/json, image/png, text/html\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Not authorized.\n# 422\n# Description: Prompt failed the safety check.\n# Content-Type: application/json\n# 429\n# Description: Too many requests.", - "Format": "http", - "OperationId": "post_generate_design_v4", - "Setup": null - }, - { - "Order": 39, - "Title": "Generate an editable V4 HTML design asynchronously via webhook", - "Slug": "post-generate-design-v4-async", - "Description": "Accepts an Ideogram 4.0 HTML design request for asynchronous processing and\nreturns immediately with a request_id. The generated design is POSTed to the\nsupplied \u0060webhook_url\u0060 once ready.", - "Language": "http", - "Code": "### Generate an editable V4 HTML design asynchronously via webhook\n# @name post_generate_design_v4_async\nPOST {{host}}/v1/ideogram-v4/async/generate-design?webhook_url={{webhook_url}}\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022magic_prompt_option\u0022\n\nON\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022magic_prompt_system_prompt_config_id\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022resolution\u0022\n\n1024x1024\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022rendering_speed\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022inspiration_reference_images\u0022; filename=\u0022inspiration_reference_images.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./inspiration_reference_images.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022inspiration_reference_model\u0022\n\nclaude-sonnet-4-6\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022artifact_generation_model\u0022\n\nclaude-sonnet-4-6\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022layout2image_variant\u0022\n\nopus_4_7\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022response_type\u0022\n\nlayered\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Request accepted for asynchronous delivery.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Not authorized.\n# 422\n# Description: Prompt failed the safety check.\n# Content-Type: application/json\n# 429\n# Description: Too many requests.", - "Format": "http", - "OperationId": "post_generate_design_v4_async", - "Setup": null - }, - { - "Order": 40, - "Title": "Generate (legacy)", - "Slug": "post-generate-image", - "Description": "Generates images synchronously based on a given prompt and optional parameters.\n\nImages links are available for a limited period of time; if you would like to keep the image, you must download it.", - "Language": "csharp", - "Code": "using var client = new IdeogramClient(apiKey);\n\nvar request = global::System.Text.Json.JsonSerializer.Deserialize\u003Cglobal::Ideogram.GenerateImageRequest\u003E(\n @\u0022{\n \u0022\u0022image_request\u0022\u0022: {\n \u0022\u0022aspect_ratio\u0022\u0022: \u0022\u0022ASPECT_10_16\u0022\u0022,\n \u0022\u0022magic_prompt_option\u0022\u0022: \u0022\u0022AUTO\u0022\u0022,\n \u0022\u0022model\u0022\u0022: \u0022\u0022V_2\u0022\u0022,\n \u0022\u0022prompt\u0022\u0022: \u0022\u0022A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there is an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset.\u0022\u0022\n }\n}\u0022)!;\n\nvar response = await client.Generate.PostGenerateImageAsync(\n request: request\n);\n\n// Example response:\n// {\n// \u0022data\u0022: [\n// {\n// \u0022style_type\u0022: \u0022REALISTIC\u0022,\n// \u0022seed\u0022: 12345,\n// \u0022upscaled_resolution\u0022: \u00224096x4096\u0022,\n// \u0022prompt\u0022: \u0022A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there\\u0027s an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset.\u0022,\n// \u0022resolution\u0022: \u00221024x1024\u0022,\n// \u0022url\u0022: \u0022https://ideogram.ai/api/images/direct/8YEpFzHuS-S6xXEGmCsf7g\u0022,\n// \u0022is_image_safe\u0022: true\n// },\n// {\n// \u0022style_type\u0022: \u0022REALISTIC\u0022,\n// \u0022seed\u0022: 12345,\n// \u0022upscaled_resolution\u0022: \u00224096x4096\u0022,\n// \u0022prompt\u0022: \u0022A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there\\u0027s an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset.\u0022,\n// \u0022resolution\u0022: \u00221024x1024\u0022,\n// \u0022url\u0022: \u0022https://ideogram.ai/api/images/direct/8YEpFzHuS-S6xXEGmCsf7g\u0022,\n// \u0022is_image_safe\u0022: true\n// }\n// ],\n// \u0022created\u0022: \u00222000-01-23T04:56:07\\u002B00:00\u0022,\n// \u0022request_id\u0022: \u0022request_id\u0022\n// }", - "Format": "sdk", - "OperationId": "post_generate_image", - "Setup": "This example assumes \u0060using Ideogram;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." - }, - { - "Order": 41, - "Title": "Generate with ERNIE-Image-Turbo", - "Slug": "post-generate-image-ernie", - "Description": "Generates images synchronously using the ERNIE-Image-Turbo model. Width\nand height must each be a positive multiple of 16 and the total area\nmust not exceed 1,075,200 pixels (896\u00D71200); the server validates these\nagainst the model\u0027s resolution constraints.\n\nImages links are available for a limited period of time; if you would like to keep the image, you must download it.", - "Language": "http", - "Code": "### Generate with ERNIE-Image-Turbo\n# @name post_generate_image_ernie\nPOST {{host}}/v1/ernie/generate\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\nA poster with bold typography reading \u0022GRAND OPENING\u0022, art deco style.\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022system_prompt\u0022\n\nDo not include any text in the image.\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022width\u0022\n\n1024\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022height\u0022\n\n1024\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022num_inference_steps\u0022\n\n8\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022num_images\u0022\n\n1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022custom_model_uri\u0022\n\nmodel/my-ernie-lora/version/0\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Image(s) generated successfully.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Not authorized.\n# 422\n# Description: Prompt failed the safety check.\n# Content-Type: application/json\n# 429\n# Description: Too many requests.", - "Format": "http", - "OperationId": "post_generate_image_ernie", - "Setup": null - }, - { - "Order": 42, - "Title": "Generate with ERNIE-Image-Turbo asynchronously via webhook", - "Slug": "post-generate-image-ernie-async", - "Description": "Accepts an ERNIE-Image-Turbo generation request for asynchronous\nprocessing and returns immediately with a generation_id. The generated\nimages are POSTed to the supplied \u0060webhook_url\u0060 once ready, in a payload\nthat mirrors the synchronous response with an added generation_id for\ncorrelation.\n\nSee [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures.", - "Language": "http", - "Code": "### Generate with ERNIE-Image-Turbo asynchronously via webhook\n# @name post_generate_image_ernie_async\nPOST {{host}}/v1/ernie/async/generate?webhook_url={{webhook_url}}\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\nA poster with bold typography reading \u0022GRAND OPENING\u0022, art deco style.\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022system_prompt\u0022\n\nDo not include any text in the image.\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022width\u0022\n\n1024\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022height\u0022\n\n1024\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022num_inference_steps\u0022\n\n8\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022num_images\u0022\n\n1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022custom_model_uri\u0022\n\nmodel/my-ernie-lora/version/0\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Request accepted for asynchronous delivery.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Not authorized.\n# 422\n# Description: Prompt failed the safety check.\n# Content-Type: application/json\n# 429\n# Description: Too many requests.", - "Format": "http", - "OperationId": "post_generate_image_ernie_async", - "Setup": null - }, - { - "Order": 43, - "Title": "Generate with FLUX.2-Klein", - "Slug": "post-generate-image-flux2-klein", - "Description": "Generates images synchronously using the FLUX.2-Klein model. Width and\nheight must each be a positive multiple of 16 and the total area must\nnot exceed 1,048,576 pixels (1024\u00D71024); the server validates these\nagainst the model\u0027s resolution constraints.\n\nImages links are available for a limited period of time; if you would like to keep the image, you must download it.", - "Language": "http", - "Code": "### Generate with FLUX.2-Klein\n# @name post_generate_image_flux2_klein\nPOST {{host}}/v1/flux-2-klein/generate\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\nA photo of a tabby cat sleeping on a couch, soft daylight.\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022system_prompt\u0022\n\nDo not include any text in the image.\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022width\u0022\n\n1024\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022height\u0022\n\n1024\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022num_inference_steps\u0022\n\n4\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022num_images\u0022\n\n1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022custom_model_uri\u0022\n\nmodel/my-flux-klein-lora/version/0\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Image(s) generated successfully.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Not authorized.\n# 422\n# Description: Prompt failed the safety check.\n# Content-Type: application/json\n# 429\n# Description: Too many requests.", - "Format": "http", - "OperationId": "post_generate_image_flux2_klein", - "Setup": null - }, - { - "Order": 44, - "Title": "Generate with FLUX.2-Klein asynchronously via webhook", - "Slug": "post-generate-image-flux2-klein-async", - "Description": "Accepts a FLUX.2-Klein generation request for asynchronous processing and\nreturns immediately with a generation_id. The generated images are POSTed to\nthe supplied \u0060webhook_url\u0060 once ready, in a payload that mirrors the\nsynchronous response with an added generation_id for correlation.\n\nSee [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures.", - "Language": "http", - "Code": "### Generate with FLUX.2-Klein asynchronously via webhook\n# @name post_generate_image_flux2_klein_async\nPOST {{host}}/v1/flux-2-klein/async/generate?webhook_url={{webhook_url}}\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\nA photo of a tabby cat sleeping on a couch, soft daylight.\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022system_prompt\u0022\n\nDo not include any text in the image.\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022width\u0022\n\n1024\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022height\u0022\n\n1024\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022num_inference_steps\u0022\n\n4\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022num_images\u0022\n\n1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022custom_model_uri\u0022\n\nmodel/my-flux-klein-lora/version/0\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Request accepted for asynchronous delivery.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Not authorized.\n# 422\n# Description: Prompt failed the safety check.\n# Content-Type: application/json\n# 429\n# Description: Too many requests.", - "Format": "http", - "OperationId": "post_generate_image_flux2_klein_async", - "Setup": null - }, - { - "Order": 45, - "Title": "Generate with FLUX.2-Klein (undistilled base)", - "Slug": "post-generate-image-flux2-klein-base", - "Description": "Generates images synchronously using the UNDISTILLED FLUX.2-Klein base \u2014 the 50-step quality tier (vs the distilled /v1/flux-2-klein fast tier). Width and\nheight must each be a positive multiple of 16 and the total area must\nnot exceed 1,048,576 pixels (1024\u00D71024); the server validates these\nagainst the model\u0027s resolution constraints.\n\nImages links are available for a limited period of time; if you would like to keep the image, you must download it.", - "Language": "http", - "Code": "### Generate with FLUX.2-Klein (undistilled base)\n# @name post_generate_image_flux2_klein_base\nPOST {{host}}/v1/flux-2-klein-base/generate\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\nA photo of a tabby cat sleeping on a couch, soft daylight.\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022system_prompt\u0022\n\nDo not include any text in the image.\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022width\u0022\n\n1024\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022height\u0022\n\n1024\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022num_inference_steps\u0022\n\n50\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022num_images\u0022\n\n1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022custom_model_uri\u0022\n\nmodel/my-flux-klein-base-lora/version/0\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Image(s) generated successfully.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Not authorized.\n# 422\n# Description: Prompt failed the safety check.\n# Content-Type: application/json\n# 429\n# Description: Too many requests.", - "Format": "http", - "OperationId": "post_generate_image_flux2_klein_base", - "Setup": null - }, - { - "Order": 46, - "Title": "Generate with FLUX.2-Klein (undistilled base) asynchronously via webhook", - "Slug": "post-generate-image-flux2-klein-base-async", - "Description": "Accepts an undistilled-base FLUX.2-Klein generation request for asynchronous processing and\nreturns immediately with a generation_id. The generated images are POSTed to\nthe supplied \u0060webhook_url\u0060 once ready, in a payload that mirrors the\nsynchronous response with an added generation_id for correlation.\n\nSee [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures.", - "Language": "http", - "Code": "### Generate with FLUX.2-Klein (undistilled base) asynchronously via webhook\n# @name post_generate_image_flux2_klein_base_async\nPOST {{host}}/v1/flux-2-klein-base/async/generate?webhook_url={{webhook_url}}\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\nA photo of a tabby cat sleeping on a couch, soft daylight.\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022system_prompt\u0022\n\nDo not include any text in the image.\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022width\u0022\n\n1024\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022height\u0022\n\n1024\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022num_inference_steps\u0022\n\n50\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022num_images\u0022\n\n1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022custom_model_uri\u0022\n\nmodel/my-flux-klein-base-lora/version/0\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Request accepted for asynchronous delivery.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Not authorized.\n# 422\n# Description: Prompt failed the safety check.\n# Content-Type: application/json\n# 429\n# Description: Too many requests.", - "Format": "http", - "OperationId": "post_generate_image_flux2_klein_base_async", - "Setup": null - }, - { - "Order": 47, - "Title": "Generate with the distilled few-step Ideogram model (high speed tier)", - "Slug": "post-generate-image-p-image-high", - "Description": "Generates images synchronously using the distilled few-step Ideogram\nmodel at the high speed tier \u2014 the highest quality, at the highest cost.\nThe speed tier controls the number of diffusion steps and the per-image\nprice.\n\nImages links are available for a limited period of time; if you would like to keep the image, you must download it.", - "Language": "http", - "Code": "### Generate with the distilled few-step Ideogram model (high speed tier)\n# @name post_generate_image_p_image_high\nPOST {{host}}/v1/p-image-ideogram/high/generate\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt_upsampling\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022magic_prompt_system_prompt_config_id\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022resolution\u0022\n\n2048x2048\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022enable_copyright_detection\u0022\n\ntrue\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Image(s) generated successfully.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Not authorized.\n# 422\n# Description: Prompt failed the safety check.\n# Content-Type: application/json\n# 429\n# Description: Too many requests.", - "Format": "http", - "OperationId": "post_generate_image_p_image_high", - "Setup": null - }, - { - "Order": 48, - "Title": "Generate with P-Image Ideogram", - "Slug": "post-generate-image-p-image-ideogram", - "Description": "Generates images synchronously using P-Image Ideogram. \u0060quality\u0060 selects\nthe generation quality level and \u0060resolution\u0060 selects the output-size\ntier. Both parameters have defaults.\n\nImages links are available for a limited period of time; if you would like to keep the image, you must download them.", - "Language": "http", - "Code": "### Generate with P-Image Ideogram\n# @name post_generate_image_p_image_ideogram\nPOST {{host}}/v1/text-to-image/p-image-ideogram\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt_upsampling\u0022\n\nAUTO\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022magic_prompt_system_prompt_config_id\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022quality\u0022\n\nMEDIUM\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022resolution\u0022\n\n1K\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022aspect_ratio\u0022\n\n1x1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022custom_width\u0022\n\n0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022custom_height\u0022\n\n0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022enable_copyright_detection\u0022\n\ntrue\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Image(s) generated successfully.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Not authorized.\n# 422\n# Description: Prompt failed the safety check.\n# Content-Type: application/json\n# 429\n# Description: Too many requests.", - "Format": "http", - "OperationId": "post_generate_image_p_image_ideogram", - "Setup": null - }, - { - "Order": 49, - "Title": "Generate with P-Image Ideogram asynchronously", - "Slug": "post-generate-image-p-image-ideogram-async", - "Description": "Accepts a P-Image Ideogram generation request for asynchronous processing\nand returns immediately with a generation_id. Poll\n\u0060GET /v1/generations/{generation_id}\u0060 to retrieve the result. If a\n\u0060webhook_url\u0060 is supplied, the generated images are additionally POSTed\nto it once ready, in a payload that mirrors the synchronous response with\nan added generation_id for correlation.\n\nSee [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures.", - "Language": "http", - "Code": "### Generate with P-Image Ideogram asynchronously\n# @name post_generate_image_p_image_ideogram_async\nPOST {{host}}/v1/async/text-to-image/p-image-ideogram?webhook_url={{webhook_url}}\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt_upsampling\u0022\n\nAUTO\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022magic_prompt_system_prompt_config_id\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022quality\u0022\n\nMEDIUM\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022resolution\u0022\n\n1K\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022aspect_ratio\u0022\n\n1x1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022custom_width\u0022\n\n0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022custom_height\u0022\n\n0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022enable_copyright_detection\u0022\n\ntrue\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Request accepted for asynchronous delivery.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Not authorized.\n# 422\n# Description: Prompt failed the safety check.\n# Content-Type: application/json\n# 429\n# Description: Too many requests.", - "Format": "http", - "OperationId": "post_generate_image_p_image_ideogram_async", - "Setup": null - }, - { - "Order": 50, - "Title": "Generate with the distilled few-step Ideogram model (low speed tier)", - "Slug": "post-generate-image-p-image-low", - "Description": "Generates images synchronously using the distilled few-step Ideogram\nmodel at the low speed tier \u2014 fast and low-cost, with a modest quality\ntrade-off. The speed tier controls the number of diffusion steps and the\nper-image price.\n\nImages links are available for a limited period of time; if you would like to keep the image, you must download it.", - "Language": "http", - "Code": "### Generate with the distilled few-step Ideogram model (low speed tier)\n# @name post_generate_image_p_image_low\nPOST {{host}}/v1/p-image-ideogram/low/generate\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt_upsampling\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022magic_prompt_system_prompt_config_id\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022resolution\u0022\n\n2048x2048\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022enable_copyright_detection\u0022\n\ntrue\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Image(s) generated successfully.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Not authorized.\n# 422\n# Description: Prompt failed the safety check.\n# Content-Type: application/json\n# 429\n# Description: Too many requests.", - "Format": "http", - "OperationId": "post_generate_image_p_image_low", - "Setup": null - }, - { - "Order": 51, - "Title": "Generate with the distilled few-step Ideogram model (medium speed tier)", - "Slug": "post-generate-image-p-image-medium", - "Description": "Generates images synchronously using the distilled few-step Ideogram\nmodel at the medium speed tier \u2014 the balanced default of speed, cost, and\nquality. The speed tier controls the number of diffusion steps and the\nper-image price.\n\nImages links are available for a limited period of time; if you would like to keep the image, you must download it.", - "Language": "http", - "Code": "### Generate with the distilled few-step Ideogram model (medium speed tier)\n# @name post_generate_image_p_image_medium\nPOST {{host}}/v1/p-image-ideogram/medium/generate\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt_upsampling\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022magic_prompt_system_prompt_config_id\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022resolution\u0022\n\n2048x2048\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022enable_copyright_detection\u0022\n\ntrue\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Image(s) generated successfully.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Not authorized.\n# 422\n# Description: Prompt failed the safety check.\n# Content-Type: application/json\n# 429\n# Description: Too many requests.", - "Format": "http", - "OperationId": "post_generate_image_p_image_medium", - "Setup": null - }, - { - "Order": 52, - "Title": "Generate with the distilled few-step Ideogram model (very-low speed tier)", - "Slug": "post-generate-image-p-image-very-low", - "Description": "Generates images synchronously using the distilled few-step Ideogram\nmodel at the very-low speed tier \u2014 the fastest and lowest-cost option.\nThe speed tier controls the number of diffusion steps and the per-image\nprice.\n\nImages links are available for a limited period of time; if you would like to keep the image, you must download it.", - "Language": "http", - "Code": "### Generate with the distilled few-step Ideogram model (very-low speed tier)\n# @name post_generate_image_p_image_very_low\nPOST {{host}}/v1/p-image-ideogram/very-low/generate\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt_upsampling\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022magic_prompt_system_prompt_config_id\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022resolution\u0022\n\n2048x2048\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022enable_copyright_detection\u0022\n\ntrue\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Image(s) generated successfully.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Not authorized.\n# 422\n# Description: Prompt failed the safety check.\n# Content-Type: application/json\n# 429\n# Description: Too many requests.", - "Format": "http", - "OperationId": "post_generate_image_p_image_very_low", - "Setup": null - }, - { - "Order": 53, - "Title": "Generate with Ideogram 3.0", - "Slug": "post-generate-image-v3", - "Description": "Generates images synchronously based on a given prompt and optional parameters using the Ideogram 3.0 model.\n\nImages links are available for a limited period of time; if you would like to keep the image, you must download it.", - "Language": "http", - "Code": "### Generate with Ideogram 3.0\n# @name post_generate_image_v3\nPOST {{host}}/v1/ideogram-v3/generate\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\nA photo of a cat\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n12345\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022resolution\u0022\n\n1280x800\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022aspect_ratio\u0022\n\n1x3\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022rendering_speed\u0022\n\nDEFAULT\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022magic_prompt\u0022\n\nON\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022magic_prompt_system_prompt_config_id\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022negative_prompt\u0022\n\nbrush strokes, painting\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022num_images\u0022\n\n1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022color_palette\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_codes\u0022\n\nABCD1234\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_type\u0022\n\nGENERAL\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_preset\u0022\n\nBRIGHT_ART\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022custom_model_uri\u0022\n\nmodel/my-custom-model/version/1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_reference_images\u0022; filename=\u0022style_reference_images.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./style_reference_images.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022character_reference_images\u0022; filename=\u0022character_reference_images.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./character_reference_images.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022character_reference_images_mask\u0022; filename=\u0022character_reference_images_mask.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./character_reference_images_mask.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022enable_copyright_detection\u0022\n\ntrue\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Image(s) generated successfully.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Not authorized to generate an image.\n# 422\n# Description: Prompt failed the safety check.\n# Content-Type: application/json\n# 429\n# Description: Too many requests.", - "Format": "http", - "OperationId": "post_generate_image_v3", - "Setup": null - }, - { - "Order": 54, - "Title": "Generate with Ideogram 3.0 (Transparent Background)", - "Slug": "post-generate-image-v3-transparent", - "Description": "Generates images with transparent background synchronously based on a given prompt and optional parameters using\nthe Ideogram 3.0 model. Images will be generated using maximum supported resolution at the specified aspect ratio\nto allow best results with upscaler. The selected resolution is written to the response, not the upscaled final\nresolution.\n\n\u0060rendering_speed=FLASH\u0060 is not supported for transparent-background generation; the request will return a 400.\nUse \u0060TURBO\u0060, \u0060DEFAULT\u0060, or \u0060QUALITY\u0060 instead.\n\nImages links are available for a limited period of time; if you would like to keep the image, you must download it.", - "Language": "http", - "Code": "### Generate with Ideogram 3.0 (Transparent Background)\n# @name post_generate_image_v3_transparent\nPOST {{host}}/v1/ideogram-v3/generate-transparent\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\nA photo of a cat\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n12345\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022upscale_factor\u0022\n\nX2\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022aspect_ratio\u0022\n\n1x3\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022rendering_speed\u0022\n\nDEFAULT\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022magic_prompt\u0022\n\nON\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022magic_prompt_system_prompt_config_id\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022negative_prompt\u0022\n\nbrush strokes, painting\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022num_images\u0022\n\n1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022custom_model_uri\u0022\n\nmodel/my-custom-model/version/1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022enable_copyright_detection\u0022\n\ntrue\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Image(s) generated successfully.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Not authorized to generate an image.\n# 422\n# Description: Prompt failed the safety check.\n# Content-Type: application/json\n# 429\n# Description: Too many requests.", - "Format": "http", - "OperationId": "post_generate_image_v3_transparent", - "Setup": null - }, - { - "Order": 55, - "Title": "Generate with Ideogram 4.0", - "Slug": "post-generate-image-v4", - "Description": "Generates images synchronously using the Ideogram 4.0 model.\n\nImages links are available for a limited period of time; if you would like to keep the image, you must download it.", - "Language": "http", - "Code": "### Generate with Ideogram 4.0\n# @name post_generate_image_v4\nPOST {{host}}/v1/ideogram-v4/generate\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022text_prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022json_prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022magic_prompt_system_prompt_config_id\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022custom_model_uri\u0022\n\nmodel/my-custom-model/version/0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022resolution\u0022\n\n2048x2048\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022rendering_speed\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022enable_copyright_detection\u0022\n\ntrue\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Image(s) generated successfully.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Not authorized.\n# 422\n# Description: Prompt failed the safety check.\n# Content-Type: application/json\n# 429\n# Description: Too many requests.", - "Format": "http", - "OperationId": "post_generate_image_v4", - "Setup": null - }, - { - "Order": 56, - "Title": "Generate with Ideogram 4.5", - "Slug": "post-generate-image-v45", - "Description": "Generates images synchronously using the Ideogram 4.5 multimodal model.\n\nImages links are available for a limited period of time; if you would like to keep the image, you must download it.", - "Language": "http", - "Code": "### Generate with Ideogram 4.5\n# @name post_generate_image_v45\nPOST {{host}}/v1/ideogram-v45/generate\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022text_prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022json_prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022magic_prompt_system_prompt_config_id\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022custom_model_uri\u0022\n\nmodel/my-custom-model/version/0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022resolution\u0022\n\n2048x2048\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022rendering_speed\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022enable_copyright_detection\u0022\n\ntrue\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Image(s) generated successfully.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Not authorized.\n# 422\n# Description: Prompt failed the safety check.\n# Content-Type: application/json\n# 429\n# Description: Too many requests.", - "Format": "http", - "OperationId": "post_generate_image_v45", - "Setup": null - }, - { - "Order": 57, - "Title": "Generate with Ideogram 4.5 asynchronously via webhook", - "Slug": "post-generate-image-v45-async", - "Description": "Accepts an Ideogram 4.5 generation request for asynchronous processing and\nreturns immediately with a generation_id. The generated images are POSTed to\nthe supplied \u0060webhook_url\u0060 once ready, in a payload that mirrors the\nsynchronous response with an added generation_id for correlation.\n\nSee [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures.", - "Language": "http", - "Code": "### Generate with Ideogram 4.5 asynchronously via webhook\n# @name post_generate_image_v45_async\nPOST {{host}}/v1/ideogram-v45/async/generate?webhook_url={{webhook_url}}\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022text_prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022json_prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022magic_prompt_system_prompt_config_id\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022custom_model_uri\u0022\n\nmodel/my-custom-model/version/0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022resolution\u0022\n\n2048x2048\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022rendering_speed\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022enable_copyright_detection\u0022\n\ntrue\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Request accepted for asynchronous delivery.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Not authorized.\n# 422\n# Description: Prompt failed the safety check.\n# Content-Type: application/json\n# 429\n# Description: Too many requests.", - "Format": "http", - "OperationId": "post_generate_image_v45_async", - "Setup": null - }, - { - "Order": 58, - "Title": "Generate with Ideogram 4.0 asynchronously", - "Slug": "post-generate-image-v4-async", - "Description": "Accepts an Ideogram 4.0 generation request for asynchronous processing and\nreturns immediately with a generation_id. Poll \u0060GET /v1/generations/{generation_id}\u0060\nto retrieve the result. If a \u0060webhook_url\u0060 is supplied, the generated images are\nadditionally POSTed to it once ready, in a payload that mirrors the synchronous\nresponse with an added generation_id for correlation.\n\nSee [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures.", - "Language": "http", - "Code": "### Generate with Ideogram 4.0 asynchronously\n# @name post_generate_image_v4_async\nPOST {{host}}/v1/ideogram-v4/async/generate?webhook_url={{webhook_url}}\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022text_prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022json_prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022magic_prompt_system_prompt_config_id\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022custom_model_uri\u0022\n\nmodel/my-custom-model/version/0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022resolution\u0022\n\n2048x2048\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022rendering_speed\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022enable_copyright_detection\u0022\n\ntrue\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Request accepted for asynchronous delivery.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Not authorized.\n# 422\n# Description: Prompt failed the safety check.\n# Content-Type: application/json\n# 429\n# Description: Too many requests.", - "Format": "http", - "OperationId": "post_generate_image_v4_async", - "Setup": null - }, - { - "Order": 59, - "Title": "Generate with the CFG-distilled Ideogram 4.0 model", - "Slug": "post-generate-image-v4-cfg-distilled", - "Description": "Generates images synchronously using the CFG/guidance-distilled Ideogram\n4.0 model, served guidance-free.\n\nImages links are available for a limited period of time; if you would like to keep the image, you must download it.", - "Language": "http", - "Code": "### Generate with the CFG-distilled Ideogram 4.0 model\n# @name post_generate_image_v4_cfg_distilled\nPOST {{host}}/v1/ideogram-v4-cfg-distilled/generate\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022text_prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022json_prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022magic_prompt_system_prompt_config_id\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022resolution\u0022\n\n2048x2048\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022rendering_speed\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022enable_copyright_detection\u0022\n\ntrue\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Image(s) generated successfully.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Not authorized.\n# 422\n# Description: Prompt failed the safety check.\n# Content-Type: application/json\n# 429\n# Description: Too many requests.", - "Format": "http", - "OperationId": "post_generate_image_v4_cfg_distilled", - "Setup": null - }, - { - "Order": 60, - "Title": "Generate with the CFG-distilled Ideogram 4.0 model asynchronously via webhook", - "Slug": "post-generate-image-v4-cfg-distilled-async", - "Description": "Accepts a CFG-distilled Ideogram 4.0 generation request for asynchronous\nprocessing and returns immediately with a generation_id. The generated\nimages are POSTed to the supplied \u0060webhook_url\u0060 once ready, in a payload\nthat mirrors the synchronous response with an added generation_id for\ncorrelation.\n\nSee [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures.", - "Language": "http", - "Code": "### Generate with the CFG-distilled Ideogram 4.0 model asynchronously via webhook\n# @name post_generate_image_v4_cfg_distilled_async\nPOST {{host}}/v1/ideogram-v4-cfg-distilled/async/generate?webhook_url={{webhook_url}}\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022text_prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022json_prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022magic_prompt_system_prompt_config_id\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022resolution\u0022\n\n2048x2048\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022rendering_speed\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022enable_copyright_detection\u0022\n\ntrue\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Request accepted for asynchronous delivery.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Not authorized.\n# 422\n# Description: Prompt failed the safety check.\n# Content-Type: application/json\n# 429\n# Description: Too many requests.", - "Format": "http", - "OperationId": "post_generate_image_v4_cfg_distilled_async", - "Setup": null - }, - { - "Order": 61, - "Title": "Generate with the fp8-quantized Ideogram 4.0 model", - "Slug": "post-generate-image-v4-fp8", - "Description": "Generates images synchronously using the fp8-quantized Ideogram 4.0 model.\nA LoRA checkpoint can be layered on the base via the\n\u0060X-Ideogram-Positive-Lora-Ckpt-Path\u0060 header.\n\nImages links are available for a limited period of time; if you would like to keep the image, you must download it.", - "Language": "http", - "Code": "### Generate with the fp8-quantized Ideogram 4.0 model\n# @name post_generate_image_v4_fp8\nPOST {{host}}/v1/ideogram-v4-fp8/generate\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022text_prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022json_prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022magic_prompt_system_prompt_config_id\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022resolution\u0022\n\n2048x2048\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022rendering_speed\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022enable_copyright_detection\u0022\n\ntrue\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Image(s) generated successfully.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Not authorized.\n# 422\n# Description: Prompt failed the safety check.\n# Content-Type: application/json\n# 429\n# Description: Too many requests.", - "Format": "http", - "OperationId": "post_generate_image_v4_fp8", - "Setup": null - }, - { - "Order": 62, - "Title": "Image-to-image with Ideogram 4.0", - "Slug": "post-generate-image-v4-im2-im", - "Description": "Generates images synchronously using the Ideogram 4.0 model with an initial image as input.\n\nImages links are available for a limited period of time; if you would like to keep the image, you must download it.", - "Language": "http", - "Code": "### Image-to-image with Ideogram 4.0\n# @name post_generate_image_v4_im2_im\nPOST {{host}}/v1/ideogram-v4/image-to-image\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image\u0022; filename=\u0022image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022additional_images\u0022; filename=\u0022additional_images.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./additional_images.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n12345\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022magic_prompt_option\u0022\n\nON\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022magic_prompt_system_prompt_config_id\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022resolution\u0022\n\n1024x1024\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022rendering_speed\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022enable_copyright_detection\u0022\n\ntrue\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Image(s) generated successfully.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Not authorized.\n# 422\n# Description: Prompt failed the safety check.\n# Content-Type: application/json\n# 429\n# Description: Too many requests.", - "Format": "http", - "OperationId": "post_generate_image_v4_im2_im", - "Setup": null - }, - { - "Order": 63, - "Title": "Image-to-image with Ideogram 4.0 asynchronously via webhook", - "Slug": "post-generate-image-v4-im2-im-async", - "Description": "Accepts an Ideogram 4.0 image-to-image request for asynchronous processing\nand returns immediately with a request_id. The generated images are POSTed\nto the supplied \u0060webhook_url\u0060 once ready.", - "Language": "http", - "Code": "### Image-to-image with Ideogram 4.0 asynchronously via webhook\n# @name post_generate_image_v4_im2_im_async\nPOST {{host}}/v1/ideogram-v4/async/image-to-image?webhook_url={{webhook_url}}\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image\u0022; filename=\u0022image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022additional_images\u0022; filename=\u0022additional_images.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./additional_images.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n12345\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022magic_prompt_option\u0022\n\nON\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022magic_prompt_system_prompt_config_id\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022resolution\u0022\n\n1024x1024\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022rendering_speed\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022enable_copyright_detection\u0022\n\ntrue\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Request accepted for asynchronous delivery.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Not authorized.\n# 422\n# Description: Prompt failed the safety check.\n# Content-Type: application/json\n# 429\n# Description: Too many requests.", - "Format": "http", - "OperationId": "post_generate_image_v4_im2_im_async", - "Setup": null - }, - { - "Order": 64, - "Title": "Generate with Ideogram 4.0 (stable model)", - "Slug": "post-generate-image-v4-stable", - "Description": "Generates images synchronously using a pinned stable build of the\nIdeogram 4.0 model. This endpoint is intentionally minimal: it accepts\nonly a prompt (and optional seed), pins the underlying model URI, and\nlets the server pick the output resolution automatically.\n\nImages links are available for a limited period of time; if you would\nlike to keep the image, you must download it.", - "Language": "http", - "Code": "### Generate with Ideogram 4.0 (stable model)\n# @name post_generate_image_v4_stable\nPOST {{host}}/v1/ideogram-v4/generate/stable\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022text_prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022json_prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022resolution\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022version\u0022\n\nstable_may29\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Image(s) generated successfully.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Not authorized.\n# 422\n# Description: Prompt failed the safety check.\n# Content-Type: application/json\n# 429\n# Description: Too many requests.", - "Format": "http", - "OperationId": "post_generate_image_v4_stable", - "Setup": null - }, - { - "Order": 65, - "Title": "Generate with Ideogram 4.0 (Transparent Background)", - "Slug": "post-generate-image-v4-transparent", - "Description": "Generates images with a transparent background synchronously using the\nIdeogram 4.0 model. The result is delivered as a PNG with an alpha\nchannel.\n\nAll Ideogram 4.0 aspect ratios are supported, including \u0060AUTO\u0060, which\nlets the model select the most suitable ratio from the prompt.\n\n\u0060output_resolution\u0060 selects the delivered resolution tier. Tiers are\ntotal-pixel budgets: wide and tall aspect ratios keep the same pixel\nbudget as the square of the named size, so a single dimension may\nexceed it. The response reports the final delivered resolution.\n\nImage links are available for a limited period of time; if you would\nlike to keep the image, you must download it.", - "Language": "http", - "Code": "### Generate with Ideogram 4.0 (Transparent Background)\n# @name post_generate_image_v4_transparent\nPOST {{host}}/v1/ideogram-v4/generate-transparent\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022text_prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022json_prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022magic_prompt_system_prompt_config_id\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022aspect_ratio\u0022\n\nAUTO\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022output_resolution\u0022\n\n1K\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022rendering_speed\u0022\n\nDEFAULT\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022enable_copyright_detection\u0022\n\ntrue\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Image generated successfully.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Not authorized.\n# 422\n# Description: Prompt failed the safety check.\n# Content-Type: application/json\n# 429\n# Description: Too many requests.", - "Format": "http", - "OperationId": "post_generate_image_v4_transparent", - "Setup": null - }, - { - "Order": 66, - "Title": "Generate with Ideogram 4.0 (Transparent Background) asynchronously", - "Slug": "post-generate-image-v4-transparent-async", - "Description": "Accepts an Ideogram 4.0 transparent-background generation request for\nasynchronous processing and returns immediately with a generation_id.\nPoll \u0060GET /v1/generations/{generation_id}\u0060 to retrieve the result. If a\n\u0060webhook_url\u0060 is supplied, the generated images are additionally POSTed\nto it once ready, in a payload that mirrors the synchronous response\nwith an added generation_id for correlation.\n\nSee the synchronous \u0060/v1/ideogram-v4/generate-transparent\u0060 endpoint for\nthe request semantics, including \u0060output_resolution\u0060 tiers.\n\nSee [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures.", - "Language": "http", - "Code": "### Generate with Ideogram 4.0 (Transparent Background) asynchronously\n# @name post_generate_image_v4_transparent_async\nPOST {{host}}/v1/ideogram-v4/async/generate-transparent?webhook_url={{webhook_url}}\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022text_prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022json_prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022magic_prompt_system_prompt_config_id\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022aspect_ratio\u0022\n\nAUTO\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022output_resolution\u0022\n\n1K\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022rendering_speed\u0022\n\nDEFAULT\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022enable_copyright_detection\u0022\n\ntrue\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Request accepted for asynchronous delivery.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Not authorized.\n# 422\n# Description: Prompt failed the safety check.\n# Content-Type: application/json\n# 429\n# Description: Too many requests.", - "Format": "http", - "OperationId": "post_generate_image_v4_transparent_async", - "Setup": null - }, - { - "Order": 67, - "Title": "Generate with Z-Image", - "Slug": "post-generate-image-z-image", - "Description": "Generates images synchronously using the Z-Image model. Width and height\nmust each be a positive multiple of 16 and the total area must not exceed\n1,048,576 pixels (1024\u00D71024); the server validates these against the\nmodel\u0027s resolution constraints.\n\nImages links are available for a limited period of time; if you would like to keep the image, you must download it.", - "Language": "http", - "Code": "### Generate with Z-Image\n# @name post_generate_image_z_image\nPOST {{host}}/v1/z-image/generate\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\nA futuristic cityscape at golden hour, highly detailed.\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022system_prompt\u0022\n\nDo not include any text in the image.\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022width\u0022\n\n1024\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022height\u0022\n\n1024\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022num_inference_steps\u0022\n\n8\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022num_images\u0022\n\n1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022custom_model_uri\u0022\n\nmodel/my-z-image-lora/version/0\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Image(s) generated successfully.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Not authorized.\n# 422\n# Description: Prompt failed the safety check.\n# Content-Type: application/json\n# 429\n# Description: Too many requests.", - "Format": "http", - "OperationId": "post_generate_image_z_image", - "Setup": null - }, - { - "Order": 68, - "Title": "Generate with Z-Image asynchronously via webhook", - "Slug": "post-generate-image-z-image-async", - "Description": "Accepts a Z-Image generation request for asynchronous processing and\nreturns immediately with a generation_id. The generated images are POSTed to\nthe supplied \u0060webhook_url\u0060 once ready, in a payload that mirrors the\nsynchronous response with an added generation_id for correlation.\n\nSee [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures.", - "Language": "http", - "Code": "### Generate with Z-Image asynchronously via webhook\n# @name post_generate_image_z_image_async\nPOST {{host}}/v1/z-image/async/generate?webhook_url={{webhook_url}}\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\nA futuristic cityscape at golden hour, highly detailed.\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022system_prompt\u0022\n\nDo not include any text in the image.\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022width\u0022\n\n1024\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022height\u0022\n\n1024\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022num_inference_steps\u0022\n\n8\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022num_images\u0022\n\n1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022custom_model_uri\u0022\n\nmodel/my-z-image-lora/version/0\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Request accepted for asynchronous delivery.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Not authorized.\n# 422\n# Description: Prompt failed the safety check.\n# Content-Type: application/json\n# 429\n# Description: Too many requests.", - "Format": "http", - "OperationId": "post_generate_image_z_image_async", - "Setup": null - }, - { - "Order": 69, - "Title": "Inpaint with Ideogram 3.0", - "Slug": "post-inpaint-image-v3", - "Description": "Inpaint a given image synchronously using the provided mask with Ideogram 3.0. The mask indicates which part of the image\nshould be edited, while the prompt and chosen style can further guide the edit.\n\nSupported image formats include JPEG, PNG, and WebP.\n\nImages links are available for a limited period of time; if you would like to keep the image, you must download it.", - "Language": "http", - "Code": "### Inpaint with Ideogram 3.0\n# @name post_inpaint_image_v3\nPOST {{host}}/v1/ideogram-v3/inpaint\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image\u0022; filename=\u0022image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022mask\u0022; filename=\u0022mask.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./mask.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\nA photo of a cat.\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022magic_prompt\u0022\n\nON\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022magic_prompt_system_prompt_config_id\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022num_images\u0022\n\n1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n12345\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022rendering_speed\u0022\n\nDEFAULT\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_type\u0022\n\nGENERAL\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_preset\u0022\n\nBRIGHT_ART\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022custom_model_uri\u0022\n\nmodel/my-custom-model/version/1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022color_palette\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_codes\u0022\n\nABCD1234\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_reference_images\u0022; filename=\u0022style_reference_images.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./style_reference_images.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022character_reference_images\u0022; filename=\u0022character_reference_images.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./character_reference_images.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022character_reference_images_mask\u0022; filename=\u0022character_reference_images_mask.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./character_reference_images_mask.bin\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Image edits generated successfully.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Not authorized to generate an image.\n# 422\n# Description: Prompt or Initial Image failed the safety checks.\n# Content-Type: application/json\n# 429\n# Description: Too many requests.", - "Format": "http", - "OperationId": "post_inpaint_image_v3", - "Setup": null - }, - { - "Order": 70, - "Title": "Layerize an existing flat graphic image with text detection and correction", - "Slug": "post-layerize-design-v3", - "Description": "Processes an existing flat graphic image to detect and correct text layers without generating a new image from scratch.\n\nThe uploaded image is analyzed for text content, which is then removed and returned as structured text layers with font matching, sizing, and color information.\n\nSupported image formats include JPEG, PNG, and WebP (max size 25MB).\n\nImages links are available for a limited period of time; if you would like to keep the image, you must download it.", - "Language": "http", - "Code": "### Layerize an existing flat graphic image with text detection and correction\n# @name post_layerize_design_v3\nPOST {{host}}/v1/ideogram-v3/layerize-design\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022flat_graphic_image\u0022; filename=\u0022flat_graphic_image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./flat_graphic_image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n12345\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022font_file_h1\u0022; filename=\u0022font_file_h1.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./font_file_h1.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022font_name_h1\u0022\n\nUbuntu-Bold.ttf\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022font_file_h2\u0022; filename=\u0022font_file_h2.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./font_file_h2.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022font_name_h2\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022font_file_body\u0022; filename=\u0022font_file_body.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./font_file_body.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022font_name_body\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022font_file_small\u0022; filename=\u0022font_file_small.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./font_file_small.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022font_name_small\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022reference_asset_images\u0022; filename=\u0022reference_asset_images.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./reference_asset_images.bin\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Design layerized successfully with text correction.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Not authorized to generate an image.\n# 429\n# Description: Too many requests.", - "Format": "http", - "OperationId": "post_layerize_design_v3", - "Setup": null - }, - { - "Order": 71, - "Title": "Detect and remove reference logos from an image", - "Slug": "post-layerize-logos", - "Description": "Detects caller-supplied reference logos in a flat design image, inpaints\nthem out, and returns the cleaned image together with the matched\nbounding boxes (each tagged with the matching reference\u0027s \u0060REF_\u003Cn\u003E\u0060).", - "Language": "http", - "Code": "### Detect and remove reference logos from an image\n# @name post_layerize_logos\nPOST {{host}}/v1/layerize-logos\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022design_image\u0022; filename=\u0022design_image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./design_image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022reference_images\u0022; filename=\u0022reference_images.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./reference_images.bin\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Detection completed (may contain zero matches).\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 429\n# Description: Too many requests.", - "Format": "http", - "OperationId": "post_layerize_logos", - "Setup": null - }, - { - "Order": 72, - "Title": "Layerize Text", - "Slug": "post-layerize-text-v3", - "Description": "Analyzes an image to detect text regions, then returns each detected text block with its position, content, font information, and styling.\n\nThe response includes a text-erased base image (background with all text removed) and a flat list of detected text blocks.\n\nSupported image formats include JPEG, PNG, and WebP (max size 25MB).\n\nImage links are available for a limited period of time; if you would like to keep the image, you must download it.", - "Language": "http", - "Code": "### Layerize Text\n# @name post_layerize_text_v3\nPOST {{host}}/v1/ideogram-v3/layerize-text\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image\u0022; filename=\u0022image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n12345\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022font_candidate_files\u0022; filename=\u0022font_candidate_files.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./font_candidate_files.bin\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Text layers detected and extracted successfully.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Not authorized.\n# 429\n# Description: Too many requests.", - "Format": "http", - "OperationId": "post_layerize_text_v3", - "Setup": null - }, - { - "Order": 73, - "Title": "Reframe (legacy)", - "Slug": "post-reframe-image", - "Description": "Reframe a square image to a chosen resolution. The supported image formats include JPEG, PNG, and WebP.\n\nImage links are available for a limited period of time; if you would like to keep the image, you must download it.", - "Language": "http", - "Code": "### Reframe (legacy)\n# @name post_reframe_image\nPOST {{host}}/reframe\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image_file\u0022; filename=\u0022image_file.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./image_file.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022resolution\u0022\n\nRESOLUTION_1024_1024\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022model\u0022\n\nV_2_TURBO\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022num_images\u0022\n\n1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n12345\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_type\u0022\n\nREALISTIC\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Image re-frames generated successfully.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Not authorized to generate an image.\n# 422\n# Description: Prompt or Image failed the safety checks.\n# Content-Type: application/json\n# 429\n# Description: Too many requests.", - "Format": "http", - "OperationId": "post_reframe_image", - "Setup": null - }, - { - "Order": 74, - "Title": "Reframe with Ideogram 3.0", - "Slug": "post-reframe-image-v3", - "Description": "Reframe a square image to a chosen resolution with Ideogram 3.0. The supported image formats include JPEG, PNG, and WebP.\n\nImage links are available for a limited period of time; if you would like to keep the image, you must download it.", - "Language": "http", - "Code": "### Reframe with Ideogram 3.0\n# @name post_reframe_image_v3\nPOST {{host}}/v1/ideogram-v3/reframe\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image\u0022; filename=\u0022image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022resolution\u0022\n\n1280x800\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022num_images\u0022\n\n1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n12345\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022rendering_speed\u0022\n\nDEFAULT\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_preset\u0022\n\nBRIGHT_ART\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022color_palette\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_codes\u0022\n\nABCD1234\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_reference_images\u0022; filename=\u0022style_reference_images.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./style_reference_images.bin\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Image re-frames generated successfully.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Not authorized to generate an image.\n# 422\n# Description: Prompt or Image failed the safety checks.\n# Content-Type: application/json\n# 429\n# Description: Too many requests.", - "Format": "http", - "OperationId": "post_reframe_image_v3", - "Setup": null - }, - { - "Order": 75, - "Title": "Remix (legacy)", - "Slug": "post-remix-image", - "Description": "Remix provided images synchronously based on a given prompt and optional parameters.\n\nInput images are cropped to the chosen aspect ratio before being remixed.\n\nSupported image formats include JPEG, PNG, and WebP.\n\nImages links are available for a limited period of time; if you would like to keep the image, you must download it.", - "Language": "http", - "Code": "### Remix (legacy)\n# @name post_remix_image\nPOST {{host}}/remix\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image_request\u0022\n\n{\u0022aspect_ratio\u0022:\u0022ASPECT_10_16\u0022,\u0022magic_prompt_option\u0022:\u0022ON\u0022,\u0022model\u0022:\u0022V_2\u0022,\u0022prompt\u0022:\u0022A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there is an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset.\u0022,\u0022image_weight\u0022:50}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image_file\u0022; filename=\u0022image_file.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./image_file.bin\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Image(s) generated successfully.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 403\n# Description: Not authorized to generate an image.\n# 422\n# Description: Prompt or provided image failed safety check.\n# Content-Type: application/json\n# 429\n# Description: Too many requests.", - "Format": "http", - "OperationId": "post_remix_image", - "Setup": null - }, - { - "Order": 76, - "Title": "Remix with Ideogram 3.0", - "Slug": "post-remix-image-v3", - "Description": "Remix provided images synchronously based on a given prompt and optional parameters with the Ideogram 3.0 model.\n\nInput images are cropped to the chosen aspect ratio before being remixed.\n\nSupported image formats include JPEG, PNG, and WebP.\n\nImages links are available for a limited period of time; if you would like to keep the image, you must download it.", - "Language": "http", - "Code": "### Remix with Ideogram 3.0\n# @name post_remix_image_v3\nPOST {{host}}/v1/ideogram-v3/remix\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image\u0022; filename=\u0022image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\nA photo of a cat\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image_weight\u0022\n\n50\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n12345\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022resolution\u0022\n\n1280x800\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022aspect_ratio\u0022\n\n1x3\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022rendering_speed\u0022\n\nDEFAULT\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022magic_prompt\u0022\n\nON\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022magic_prompt_system_prompt_config_id\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022negative_prompt\u0022\n\nbrush strokes, painting\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022num_images\u0022\n\n1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022color_palette\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_codes\u0022\n\nABCD1234\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_type\u0022\n\nGENERAL\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_preset\u0022\n\nBRIGHT_ART\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022custom_model_uri\u0022\n\nmodel/my-custom-model/version/1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_reference_images\u0022; filename=\u0022style_reference_images.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./style_reference_images.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022character_reference_images\u0022; filename=\u0022character_reference_images.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./character_reference_images.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022character_reference_images_mask\u0022; filename=\u0022character_reference_images_mask.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./character_reference_images_mask.bin\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Image(s) generated successfully.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 403\n# Description: Not authorized to generate an image.\n# 422\n# Description: Prompt or provided image failed safety check.\n# Content-Type: application/json\n# 429\n# Description: Too many requests.", - "Format": "http", - "OperationId": "post_remix_image_v3", - "Setup": null - }, - { - "Order": 77, - "Title": "Remix with Ideogram 4.0", - "Slug": "post-remix-image-v4", - "Description": "Remix an image synchronously using the Ideogram 4.0 model with an initial image and a prompt.\n\nMirrors \u0060/v1/ideogram-v3/remix\u0060 semantics (including \u0060image_weight\u0060 for how strongly the\noutput should resemble the input image) but routes the request through the V_4_0 model.\n\nImages links are available for a limited period of time; if you would like to keep the image, you must download it.", - "Language": "http", - "Code": "### Remix with Ideogram 4.0\n# @name post_remix_image_v4\nPOST {{host}}/v1/ideogram-v4/remix\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image\u0022; filename=\u0022image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022text_prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image_weight\u0022\n\n0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022resolution\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022rendering_speed\u0022\n\nDEFAULT\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022enable_copyright_detection\u0022\n\ntrue\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Image(s) generated successfully.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Not authorized.\n# 422\n# Description: Prompt failed the safety check.\n# Content-Type: application/json\n# 429\n# Description: Too many requests.", - "Format": "http", - "OperationId": "post_remix_image_v4", - "Setup": null - }, - { - "Order": 78, - "Title": "Remix with Ideogram 4.0 asynchronously", - "Slug": "post-remix-image-v4-async", - "Description": "Accepts an Ideogram 4.0 remix request for asynchronous processing and returns\nimmediately with a \u0060generation_id\u0060. Poll \u0060GET /v1/generations/{generation_id}\u0060\nto retrieve the result. If a \u0060webhook_url\u0060 is supplied, the generated images\nare additionally POSTed to it once ready.", - "Language": "http", - "Code": "### Remix with Ideogram 4.0 asynchronously\n# @name post_remix_image_v4_async\nPOST {{host}}/v1/ideogram-v4/async/remix?webhook_url={{webhook_url}}\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image\u0022; filename=\u0022image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022text_prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image_weight\u0022\n\n0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022resolution\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022rendering_speed\u0022\n\nDEFAULT\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022enable_copyright_detection\u0022\n\ntrue\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Request accepted for asynchronous processing.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Not authorized.\n# 422\n# Description: Prompt failed the safety check.\n# Content-Type: application/json\n# 429\n# Description: Too many requests.", - "Format": "http", - "OperationId": "post_remix_image_v4_async", - "Setup": null - }, - { - "Order": 79, - "Title": "Remove Background", - "Slug": "post-remove-background", - "Description": "Remove the background of a given image synchronously. The foreground subject\nis identified and returned on a transparent background. Supported image formats include JPEG,\nPNG, and WebP.\nImage links are available for a limited period of time; if you would like to keep the image,\nyou must download it.", - "Language": "http", - "Code": "### Remove Background\n# @name post_remove_background\nPOST {{host}}/v1/remove-background\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image\u0022; filename=\u0022image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./image.bin\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Background removed successfully.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Not authorized to remove background.\n# 422\n# Description: Initial image failed the safety checks.\n# Content-Type: application/json\n# 429\n# Description: Too many requests.", - "Format": "http", - "OperationId": "post_remove_background", - "Setup": null - }, - { - "Order": 80, - "Title": "Remove Object", - "Slug": "post-remove-object", - "Description": "Remove a masked object from a given image synchronously. Supply the image and a binary mask marking the region to remove (white = remove); the masked region is regenerated to blend with the surrounding scene. Supported image formats include JPEG, PNG, and WebP. Image links are available for a limited period of time; if you would like to keep the image, you must download it.", - "Language": "http", - "Code": "### Remove Object\n# @name post_remove_object\nPOST {{host}}/v1/remove-object\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image\u0022; filename=\u0022image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022mask\u0022; filename=\u0022mask.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./mask.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022num_inference_steps\u0022\n\n0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022guidance_scale\u0022\n\n0.0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022rendering_speed\u0022\n\nDEFAULT\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Object removed successfully.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Not authorized to remove object.\n# 422\n# Description: Initial image failed the safety checks.\n# Content-Type: application/json\n# 429\n# Description: Too many requests.", - "Format": "http", - "OperationId": "post_remove_object", - "Setup": null - }, - { - "Order": 81, - "Title": "Replace Background with Ideogram 3.0", - "Slug": "post-replace-background-v3", - "Description": "Replace the background of a given image synchronously using a prompt with Ideogram 3.0. The foreground subject\nwill be identified and kept, while the background is replaced based on the prompt and chosen style.\nSupported image formats include JPEG, PNG, and WebP.\nImages links are available for a limited period of time; if you would like to keep the image, you must download it.", - "Language": "http", - "Code": "### Replace Background with Ideogram 3.0\n# @name post_replace_background_v3\nPOST {{host}}/v1/ideogram-v3/replace-background\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image\u0022; filename=\u0022image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\nA vibrant cityscape at night.\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022magic_prompt\u0022\n\nON\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022magic_prompt_system_prompt_config_id\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022num_images\u0022\n\n1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n12345\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022rendering_speed\u0022\n\nDEFAULT\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_preset\u0022\n\nBRIGHT_ART\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022color_palette\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_codes\u0022\n\nABCD1234\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_reference_images\u0022; filename=\u0022style_reference_images.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./style_reference_images.bin\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Background replacement generated successfully.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Not authorized to generate an image.\n# 422\n# Description: Prompt or Initial Image failed the safety checks.\n# Content-Type: application/json\n# 429\n# Description: Too many requests.", - "Format": "http", - "OperationId": "post_replace_background_v3", - "Setup": null - }, - { - "Order": 82, - "Title": "Advertisement Resizer", - "Slug": "post-resize-image-async", - "Description": "Resizes an advertisement image to the exact target size. Supply \u0060prompt\u0060\nto provide specific instructions for how the advertisement should look\nafter resizing.\n\nThe request is processed asynchronously and immediately returns a\n\u0060generation_id\u0060. Poll \u0060GET /v1/generations/{generation_id}\u0060 until \u0060status\u0060\nis \u0060completed\u0060 or \u0060failed\u0060. The completed polling response contains the\nfinal resized image(s) in \u0060data\u0060 and the amount charged for variable\nusage-based pricing in \u0060usage_cost_usd_micros\u0060. If a \u0060webhook_url\u0060 is\nsupplied, the completed result is also POSTed to that URL.\n\nSupply the advertisement image as raw \u0060image\u0060 bytes via\n\u0060multipart/form-data\u0060.\n\nThe required \u0060resolution\u0060 (\u0060WIDTHxHEIGHT\u0060) sets the exact output\ndimensions.\n\nThe model is fixed by the route, so no \u0060model\u0060 field is accepted.", - "Language": "http", - "Code": "### Advertisement Resizer\n# @name post_resize_image_async\nPOST {{host}}/v1/async/ad-resizer?webhook_url={{webhook_url}}\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image_asset_identifier\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image\u0022; filename=\u0022image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022resolution\u0022\n\n300x250\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022quality\u0022\n\nHIGH\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022num_images\u0022\n\n1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022store_assets\u0022\n\nfalse\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Request accepted for asynchronous processing.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Unauthorized.\n# 402\n# Description: Insufficient credits or quota.\n# 403\n# Description: Not authorized to edit an image.\n# 404\n# Description: Source asset not found.\n# 429\n# Description: Too many requests.", - "Format": "http", - "OperationId": "post_resize_image_async", - "Setup": null - }, - { - "Order": 83, - "Title": "Virtual Try-On with Ideogram 3.0", - "Slug": "post-try-on-v3", - "Description": "Performs virtual clothing try-on by automatically segmenting the clothing in the provided image\nand replacing it based on the prompt. The user provides an image and an optional prompt describing\nthe desired clothing change (e.g., \u0022change his shirt to a pink shirt\u0022).\n\nSupported image formats include JPEG, PNG, and WebP.\n\nImages links are available for a limited period of time; if you would like to keep the image, you must download it.", - "Language": "http", - "Code": "### Virtual Try-On with Ideogram 3.0\n# @name post_try_on_v3\nPOST {{host}}/v1/ideogram-v3/try-on\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image\u0022; filename=\u0022image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\nChange his shirt to a pink shirt\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022magic_prompt\u0022\n\nON\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022magic_prompt_system_prompt_config_id\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022num_images\u0022\n\n1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n12345\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022rendering_speed\u0022\n\nDEFAULT\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_type\u0022\n\nGENERAL\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_preset\u0022\n\nBRIGHT_ART\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022product_reference_images\u0022; filename=\u0022product_reference_images.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./product_reference_images.bin\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Try-on completed successfully.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Not authorized to generate an image.\n# 422\n# Description: Prompt or provided image failed safety check, or clothing segmentation failed.\n# Content-Type: application/json\n# 429\n# Description: Too many requests.", - "Format": "http", - "OperationId": "post_try_on_v3", - "Setup": null - }, - { - "Order": 84, - "Title": "Upscale", - "Slug": "post-upscale-image", - "Description": "Upscale provided images synchronously with an optional prompt.\n\nSupported image formats include JPEG, PNG, and WebP.\n\nImages links are available for a limited period of time; if you would like to keep the image, you must download it.", - "Language": "http", - "Code": "### Upscale\n# @name post_upscale_image\nPOST {{host}}/upscale\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image_request\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image_file\u0022; filename=\u0022image_file.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./image_file.bin\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Image(s) generated successfully.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 403\n# Description: Not authorized to generate an image.\n# 422\n# Description: Prompt or provided image failed safety check.\n# Content-Type: application/json\n# 429\n# Description: Too many requests.", - "Format": "http", - "OperationId": "post_upscale_image", - "Setup": null - }, - { - "Order": 85, - "Title": "Edit images with a prompt", - "Slug": "post-v1-edit-image", - "Description": "Edit one or more images using a text prompt. Provide images via file upload\nor Ideogram image URLs, and describe the desired edit in your prompt.\n\nSupported image formats include JPEG, PNG, and WebP.\n\nImages links are available for a limited period of time; if you would like to keep the image, you must download it.", - "Language": "http", - "Code": "### Edit images with a prompt\n# @name post_v1_edit_image\nPOST {{host}}/v1/edit\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\nChange the background to a beach sunset.\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022images\u0022; filename=\u0022images.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./images.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image_urls\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022num_images\u0022\n\n1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n12345\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022magic_prompt\u0022\n\nON\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022magic_prompt_system_prompt_config_id\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022resolution\u0022\n\n1280x800\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022aspect_ratio\u0022\n\n1x3\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022transparent_background\u0022\n\nfalse\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Image edits generated successfully.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Not authorized to generate an image.\n# 402\n# Description: Insufficient credits or quota.\n# 422\n# Description: Prompt or provided image failed safety checks.\n# Content-Type: application/json\n# 429\n# Description: Too many requests.\n# 503\n# Description: Image generation service temporarily unavailable.", - "Format": "http", - "OperationId": "post_v1_edit_image", - "Setup": null - }, - { - "Order": 86, - "Title": "Edit an image with a prompt at lower cost and latency", - "Slug": "post-v1-edit-lite-image", - "Description": "Edit an image using a text prompt, optimized for lower cost and\nlatency. Upload the image being edited via the \u0060image\u0060 field. Up to 9\nadditional \u0060reference_images\u0060 may be supplied to guide the edit.\n\nOutput is always generated at 1K resolution. Input images larger than\n1024px on their long edge are downscaled before processing. The\n\u0060aspect_ratio\u0060 field controls the output aspect ratio only; when\nomitted, the output follows the aspect ratio of the image being\nedited.\n\nSupported image formats include JPEG, PNG, and WebP.\n\nImages links are available for a limited period of time; if you would like to keep the image, you must download it.", - "Language": "http", - "Code": "### Edit an image with a prompt at lower cost and latency\n# @name post_v1_edit_lite_image\nPOST {{host}}/v1/edit-lite\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\nRemove the person from the photo.\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image\u0022; filename=\u0022image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022reference_images\u0022; filename=\u0022reference_images.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./reference_images.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022num_images\u0022\n\n1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n12345\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022magic_prompt\u0022\n\nON\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022magic_prompt_system_prompt_config_id\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022aspect_ratio\u0022\n\n16x9\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022transparency\u0022\n\nAUTO\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Image edits generated successfully.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Not authorized to generate an image.\n# 402\n# Description: Insufficient credits or quota.\n# 422\n# Description: Prompt or provided image failed safety checks.\n# Content-Type: application/json\n# 429\n# Description: Too many requests.\n# 503\n# Description: Image generation service temporarily unavailable.", - "Format": "http", - "OperationId": "post_v1_edit_lite_image", - "Setup": null - }, - { - "Order": 87, - "Title": "Poll a generation", - "Slug": "get-generation-v2", - "Description": "Retrieves the current status of an asynchronous generation, and its\nresults once complete. Use the \u0060generation_id\u0060 returned by any \u0060/v2\u0060\nendpoint that runs asynchronously: every video and tool endpoint, and\nany image endpoint called with \u0060async\u0060 or a \u0060webhook_url\u0060.\n\nWhile the generation is \u0060pending\u0060 or has \u0060failed\u0060, the response\ncontains only \u0060generation_id\u0060, \u0060status\u0060, and \u0060created\u0060 (plus\n\u0060failure_reason\u0060 once failed). Once \u0060status\u0060 is \u0060completed\u0060, the\nresponse includes \u0060response_type\u0060 and \u0060data\u0060. Each \u0060data\u0060 item carries\nan \u0060object_type\u0060 that identifies its shape, so image and video results\ncan be told apart. \u0060usage_cost_usd_micros\u0060 reports the amount billed\nwhen the request uses variable usage-based pricing.\n\nPolling is rate limited per organization; a 429 response carries a\n\u0060Retry-After\u0060 header with the number of seconds to wait.", - "Language": "http", - "Code": "### Poll a generation\n# @name get_generation_v2\nGET {{host}}/v2/generations/{{generation_id}}\nAuthorization: Bearer {{token}}\nAccept: application/json\n\n## Responses\n# 200\n# Description: Generation status retrieved successfully.\n# Content-Type: application/json\n# 400\n# Description: The generation ID is not a valid URL-safe base64 ID.\n# 401\n# Description: Not authorized.\n# 404\n# Description: Generation not found.\n# 429\n# Description: Too many requests.", - "Format": "http", - "OperationId": "get_generation_v2", - "Setup": null - }, - { - "Order": 88, - "Title": "Describe with Ideogram 3.0", - "Slug": "post-describe-image-ideogram-v3", - "Description": "Generate a natural-language description of an image with Ideogram\u0027s 3.0\nimage captioner (a fine-tune of the Qwen2-VL vision-language model).\nUpload the image as \u0060image\u0060 using \u0060multipart/form-data\u0060; the description\nis returned directly.", - "Language": "http", - "Code": "### Describe with Ideogram 3.0\n# @name post_describe_image_ideogram_v3\nPOST {{host}}/v2/image/describe/ideogram-3\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image_asset_identifier\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image\u0022; filename=\u0022image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./image.bin\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Description(s) generated successfully.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Unauthorized.\n# 402\n# Description: Insufficient credits or quota.\n# Content-Type: application/json\n# 404\n# Description: The source image was not found.\n# 422\n# Description: Image failed the safety check.\n# Content-Type: application/json\n# 429\n# Description: Too many requests.\n# Content-Type: application/json\n# 500\n# Description: Internal server error.\n# 503\n# Description: The endpoint is temporarily unavailable.", - "Format": "http", - "OperationId": "post_describe_image_ideogram_v3", - "Setup": null - }, - { - "Order": 89, - "Title": "Describe with Ideogram 4.0", - "Slug": "post-describe-image-ideogram-v4", - "Description": "Describe an image as a structured \u0060V4JsonPrompt\u0060 with Ideogram\u0027s 4.0\nimage captioner (a fine-tune of the Qwen3-VL vision-language model).\nUpload the image as \u0060image\u0060 using \u0060multipart/form-data\u0060; the\n\u0060json_prompt\u0060 is returned directly and can be passed to the\n\u0060/v1/ideogram-v4/generate\u0060 endpoints.", - "Language": "http", - "Code": "### Describe with Ideogram 4.0\n# @name post_describe_image_ideogram_v4\nPOST {{host}}/v2/image/describe/ideogram-4\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image_asset_identifier\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image\u0022; filename=\u0022image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022include_bbox\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022include_style_descriptions\u0022\n\nfalse\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022include_tags\u0022\n\nfalse\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Structured prompt generated successfully.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Unauthorized.\n# 402\n# Description: Insufficient credits or quota.\n# Content-Type: application/json\n# 404\n# Description: The source image was not found.\n# 422\n# Description: Image failed the safety check.\n# Content-Type: application/json\n# 429\n# Description: Too many requests.\n# Content-Type: application/json\n# 500\n# Description: Internal server error.\n# 503\n# Description: The endpoint is temporarily unavailable.", - "Format": "http", - "OperationId": "post_describe_image_ideogram_v4", - "Setup": null - }, - { - "Order": 90, - "Title": "Generate with GPT Image 2", - "Slug": "post-generate-image-v2-gpt-image2", - "Description": "Generate images with GPT Image 2. Optionally upload source images as\n\u0060images\u0060 using \u0060multipart/form-data\u0060 to edit them with the prompt.\nReturns results directly by default; set \u0060async\u0060 or supply a\n\u0060webhook_url\u0060 to get a \u0060generation_id\u0060 and poll\n\u0060GET /v2/generations/{generation_id}\u0060.", - "Language": "http", - "Code": "### Generate with GPT Image 2\n# @name post_generate_image_v2_gpt_image2\nPOST {{host}}/v2/image/generate/gpt-image-2?dry_run=false\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image_asset_identifiers\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022images\u0022; filename=\u0022images.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./images.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022num_images\u0022\n\n1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n12345\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022aspect_ratio\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022resolution\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022async\u0022\n\nfalse\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022webhook_url\u0022\n\nhttps://api.example.com/webhooks/ideogram\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022private\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022target_collection_id\u0022\n\nstring\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: The generated images (synchronous requests), or an acknowledgement to poll with \u0060GET /v2/generations/{generation_id}\u0060 (\u0060async\u0060 requests).\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Unauthorized.\n# 402\n# Description: Insufficient credits or quota.\n# Content-Type: application/json\n# 422\n# Description: The prompt did not pass safety checks.\n# 429\n# Description: Too many requests.\n# Content-Type: application/json\n# 500\n# Description: Internal server error.\n# 503\n# Description: The endpoint is temporarily unavailable.", - "Format": "http", - "OperationId": "post_generate_image_v2_gpt_image2", - "Setup": null - }, - { - "Order": 91, - "Title": "Generate with GPT Image 2.5 Flare", - "Slug": "post-generate-image-v2-gpt-image25-flare", - "Description": "Generate images with GPT Image 2.5 Flare, the fast variant of GPT Image\n2.5. Optionally upload source images as \u0060images\u0060 using\n\u0060multipart/form-data\u0060 to edit them with the prompt. Returns results\ndirectly by default; set \u0060async\u0060 or supply a \u0060webhook_url\u0060 to get a\n\u0060generation_id\u0060 and poll \u0060GET /v2/generations/{generation_id}\u0060.", - "Language": "http", - "Code": "### Generate with GPT Image 2.5 Flare\n# @name post_generate_image_v2_gpt_image25_flare\nPOST {{host}}/v2/image/generate/gpt-image-2-5-flare?dry_run=false\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image_asset_identifiers\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022images\u0022; filename=\u0022images.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./images.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022mask_asset_identifier\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022mask\u0022; filename=\u0022mask.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./mask.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022background\u0022\n\nauto\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022quality\u0022\n\nauto\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022num_images\u0022\n\n1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n12345\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022aspect_ratio\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022resolution\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022async\u0022\n\nfalse\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022webhook_url\u0022\n\nhttps://api.example.com/webhooks/ideogram\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022private\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022target_collection_id\u0022\n\nstring\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: The generated images (synchronous requests), or an acknowledgement to poll with \u0060GET /v2/generations/{generation_id}\u0060 (\u0060async\u0060 requests).\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Unauthorized.\n# 402\n# Description: Insufficient credits or quota.\n# Content-Type: application/json\n# 422\n# Description: The prompt did not pass safety checks.\n# 429\n# Description: Too many requests.\n# Content-Type: application/json\n# 500\n# Description: Internal server error.\n# 503\n# Description: The endpoint is temporarily unavailable.", - "Format": "http", - "OperationId": "post_generate_image_v2_gpt_image25_flare", - "Setup": null - }, - { - "Order": 92, - "Title": "Generate with GPT Image 2.5 Sunburst", - "Slug": "post-generate-image-v2-gpt-image25-sunburst", - "Description": "Generate images with GPT Image 2.5 Sunburst, the quality variant of GPT\nImage 2.5, with finer detail at higher latency than Flare. Optionally\nupload source images as \u0060images\u0060 using \u0060multipart/form-data\u0060 to edit\nthem with the prompt. Returns results directly by default; set \u0060async\u0060\nor supply a \u0060webhook_url\u0060 to get a \u0060generation_id\u0060 and poll\n\u0060GET /v2/generations/{generation_id}\u0060.", - "Language": "http", - "Code": "### Generate with GPT Image 2.5 Sunburst\n# @name post_generate_image_v2_gpt_image25_sunburst\nPOST {{host}}/v2/image/generate/gpt-image-2-5-sunburst?dry_run=false\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image_asset_identifiers\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022images\u0022; filename=\u0022images.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./images.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022mask_asset_identifier\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022mask\u0022; filename=\u0022mask.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./mask.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022background\u0022\n\nauto\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022quality\u0022\n\nauto\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022num_images\u0022\n\n1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n12345\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022aspect_ratio\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022resolution\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022async\u0022\n\nfalse\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022webhook_url\u0022\n\nhttps://api.example.com/webhooks/ideogram\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022private\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022target_collection_id\u0022\n\nstring\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: The generated images (synchronous requests), or an acknowledgement to poll with \u0060GET /v2/generations/{generation_id}\u0060 (\u0060async\u0060 requests).\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Unauthorized.\n# 402\n# Description: Insufficient credits or quota.\n# Content-Type: application/json\n# 422\n# Description: The prompt did not pass safety checks.\n# 429\n# Description: Too many requests.\n# Content-Type: application/json\n# 500\n# Description: Internal server error.\n# 503\n# Description: The endpoint is temporarily unavailable.", - "Format": "http", - "OperationId": "post_generate_image_v2_gpt_image25_sunburst", - "Setup": null - }, - { - "Order": 93, - "Title": "Generate with Ideogram 4.5", - "Slug": "post-generate-image-v2-ideogram45", - "Description": "Generate images with Ideogram 4.5 from a natural-language or structured\nJSON prompt. Optionally upload source images as \u0060images\u0060 using\n\u0060multipart/form-data\u0060 to edit them with the prompt. Returns results\ndirectly by default; set \u0060async\u0060 or supply a \u0060webhook_url\u0060 to get a\n\u0060generation_id\u0060 and poll \u0060GET /v2/generations/{generation_id}\u0060.", - "Language": "http", - "Code": "### Generate with Ideogram 4.5\n# @name post_generate_image_v2_ideogram45\nPOST {{host}}/v2/image/generate/ideogram-4-5?dry_run=false\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022magic_prompt\u0022\n\nauto\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image_asset_identifiers\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022images\u0022; filename=\u0022images.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./images.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022mask_asset_identifier\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022mask\u0022; filename=\u0022mask.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./mask.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022size\u0022\n\n2048x2048\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022background\u0022\n\nauto\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022quality\u0022\n\nvery_low\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n12345\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022num_images\u0022\n\n1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022enable_copyright_detection\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022async\u0022\n\nfalse\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022webhook_url\u0022\n\nhttps://api.example.com/webhooks/ideogram\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022private\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022target_collection_id\u0022\n\nstring\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: The generated images (synchronous requests), or an acknowledgement to poll with \u0060GET /v2/generations/{generation_id}\u0060 (\u0060async\u0060 requests).\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Unauthorized.\n# 402\n# Description: Insufficient credits or quota.\n# Content-Type: application/json\n# 422\n# Description: The prompt did not pass safety checks.\n# 429\n# Description: Too many requests.\n# Content-Type: application/json\n# 500\n# Description: Internal server error.\n# 503\n# Description: The endpoint is temporarily unavailable.", - "Format": "http", - "OperationId": "post_generate_image_v2_ideogram45", - "Setup": null - }, - { - "Order": 94, - "Title": "Generate with Ideogram 2.0", - "Slug": "post-generate-image-v2-ideogram-v2", - "Description": "Generate images from a text prompt with Ideogram 2.0. Returns results\ndirectly by default; set \u0060async\u0060 or supply a \u0060webhook_url\u0060 to get a\n\u0060generation_id\u0060 and poll \u0060GET /v2/generations/{generation_id}\u0060.", - "Language": "csharp", - "Code": "using var client = new IdeogramClient(apiKey);\n\nvar request = global::System.Text.Json.JsonSerializer.Deserialize\u003Cglobal::Ideogram.GenerateImageIdeogramV2Request\u003E(\n @\u0022{\n \u0022\u0022aspect_ratio\u0022\u0022: null,\n \u0022\u0022private\u0022\u0022: true,\n \u0022\u0022seed\u0022\u0022: 12345,\n \u0022\u0022rendering_speed\u0022\u0022: \u0022\u0022default\u0022\u0022,\n \u0022\u0022webhook_url\u0022\u0022: \u0022\u0022https://api.example.com/webhooks/ideogram\u0022\u0022,\n \u0022\u0022target_collection_id\u0022\u0022: \u0022\u0022target_collection_id\u0022\u0022,\n \u0022\u0022num_images\u0022\u0022: 1,\n \u0022\u0022magic_prompt\u0022\u0022: \u0022\u0022\u0022\u0022,\n \u0022\u0022async\u0022\u0022: false,\n \u0022\u0022style_type\u0022\u0022: \u0022\u0022realistic\u0022\u0022,\n \u0022\u0022negative_prompt\u0022\u0022: \u0022\u0022negative_prompt\u0022\u0022,\n \u0022\u0022enable_copyright_detection\u0022\u0022: true,\n \u0022\u0022prompt\u0022\u0022: \u0022\u0022prompt\u0022\u0022\n}\u0022)!;\n\nvar response = await client.ImagesGenerate.PostGenerateImageV2IdeogramV2Async(\n request: request\n);\n\n// Example response:\n// {\n// \u0022data\u0022: [\n// {\n// \u0022seed\u0022: 12345,\n// \u0022prompt\u0022: \u0022prompt\u0022,\n// \u0022resolution\u0022: \u00221024x1024\u0022,\n// \u0022url\u0022: \u0022https://openapi-generator.tech\u0022,\n// \u0022is_image_safe\u0022: true\n// },\n// {\n// \u0022seed\u0022: 12345,\n// \u0022prompt\u0022: \u0022prompt\u0022,\n// \u0022resolution\u0022: \u00221024x1024\u0022,\n// \u0022url\u0022: \u0022https://openapi-generator.tech\u0022,\n// \u0022is_image_safe\u0022: true\n// }\n// ],\n// \u0022seed\u0022: 12345,\n// \u0022generation_id\u0022: \u0022generation_id\u0022\n// }", - "Format": "sdk", - "OperationId": "post_generate_image_v2_ideogram_v2", - "Setup": "This example assumes \u0060using Ideogram;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." - }, - { - "Order": 95, - "Title": "Generate with Ideogram 2a", - "Slug": "post-generate-image-v2-ideogram-v2-a", - "Description": "Generate images from a text prompt with Ideogram 2a, a fast, lower-cost\nmodel. Returns results directly by default; set \u0060async\u0060 or supply a\n\u0060webhook_url\u0060 to get a \u0060generation_id\u0060 and poll\n\u0060GET /v2/generations/{generation_id}\u0060.", - "Language": "csharp", - "Code": "using var client = new IdeogramClient(apiKey);\n\nvar request = global::System.Text.Json.JsonSerializer.Deserialize\u003Cglobal::Ideogram.GenerateImageIdeogramV2ARequest\u003E(\n @\u0022{\n \u0022\u0022magic_prompt\u0022\u0022: \u0022\u0022\u0022\u0022,\n \u0022\u0022aspect_ratio\u0022\u0022: null,\n \u0022\u0022async\u0022\u0022: false,\n \u0022\u0022style_type\u0022\u0022: \u0022\u0022realistic\u0022\u0022,\n \u0022\u0022private\u0022\u0022: true,\n \u0022\u0022seed\u0022\u0022: 12345,\n \u0022\u0022rendering_speed\u0022\u0022: \u0022\u0022default\u0022\u0022,\n \u0022\u0022webhook_url\u0022\u0022: \u0022\u0022https://api.example.com/webhooks/ideogram\u0022\u0022,\n \u0022\u0022enable_copyright_detection\u0022\u0022: true,\n \u0022\u0022target_collection_id\u0022\u0022: \u0022\u0022target_collection_id\u0022\u0022,\n \u0022\u0022prompt\u0022\u0022: \u0022\u0022prompt\u0022\u0022,\n \u0022\u0022num_images\u0022\u0022: 1\n}\u0022)!;\n\nvar response = await client.ImagesGenerate.PostGenerateImageV2IdeogramV2AAsync(\n request: request\n);\n\n// Example response:\n// {\n// \u0022data\u0022: [\n// {\n// \u0022seed\u0022: 12345,\n// \u0022prompt\u0022: \u0022prompt\u0022,\n// \u0022resolution\u0022: \u00221024x1024\u0022,\n// \u0022url\u0022: \u0022https://openapi-generator.tech\u0022,\n// \u0022is_image_safe\u0022: true\n// },\n// {\n// \u0022seed\u0022: 12345,\n// \u0022prompt\u0022: \u0022prompt\u0022,\n// \u0022resolution\u0022: \u00221024x1024\u0022,\n// \u0022url\u0022: \u0022https://openapi-generator.tech\u0022,\n// \u0022is_image_safe\u0022: true\n// }\n// ],\n// \u0022seed\u0022: 12345,\n// \u0022generation_id\u0022: \u0022generation_id\u0022\n// }", - "Format": "sdk", - "OperationId": "post_generate_image_v2_ideogram_v2_a", - "Setup": "This example assumes \u0060using Ideogram;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." - }, - { - "Order": 96, - "Title": "Generate with Ideogram 3.0", - "Slug": "post-generate-image-v2-ideogram-v3", - "Description": "Generate images from a text prompt with Ideogram 3.0. Optional style\ncontrols include style codes, a style preset, a color palette, and style\nreferences (uploaded \u0060style_reference_images\u0060). Returns\nresults directly by default; set \u0060async\u0060 or supply a \u0060webhook_url\u0060 to\nget a \u0060generation_id\u0060 and poll \u0060GET /v2/generations/{generation_id}\u0060.", - "Language": "http", - "Code": "### Generate with Ideogram 3.0\n# @name post_generate_image_v2_ideogram_v3\nPOST {{host}}/v2/image/generate/ideogram-3?dry_run=false\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022negative_prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n12345\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022resolution\u0022\n\n1280x800\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022aspect_ratio\u0022\n\nauto\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022rendering_speed\u0022\n\ndefault\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022magic_prompt\u0022\n\nauto\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022num_images\u0022\n\n1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022color_palette\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_codes\u0022\n\nABCD1234\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_type\u0022\n\ngeneral\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_preset\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_reference_collection_id\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_reference_collection_version_id\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_reference_asset_identifiers\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_reference_images\u0022; filename=\u0022style_reference_images.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./style_reference_images.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022enable_copyright_detection\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022async\u0022\n\nfalse\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022webhook_url\u0022\n\nhttps://api.example.com/webhooks/ideogram\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022private\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022target_collection_id\u0022\n\nstring\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: The generated images (synchronous requests), or an acknowledgement to poll with \u0060GET /v2/generations/{generation_id}\u0060 (\u0060async\u0060 requests).\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Unauthorized.\n# 402\n# Description: Insufficient credits or quota.\n# Content-Type: application/json\n# 404\n# Description: A referenced resource was not found.\n# 422\n# Description: The prompt did not pass safety checks.\n# 429\n# Description: Too many requests.\n# Content-Type: application/json\n# 500\n# Description: Internal server error.\n# 503\n# Description: The endpoint is temporarily unavailable.", - "Format": "http", - "OperationId": "post_generate_image_v2_ideogram_v3", - "Setup": null - }, - { - "Order": 97, - "Title": "Generate a consistent character with Ideogram 3.0", - "Slug": "post-generate-image-v2-ideogram-v3-character", - "Description": "Generate images featuring a consistent character with Ideogram 3.0.\nUpload the character as \u0060character_reference_images\u0060 using\n\u0060multipart/form-data\u0060. Returns\nresults directly by default; set \u0060async\u0060 or supply a \u0060webhook_url\u0060 to\nget a \u0060generation_id\u0060 and poll \u0060GET /v2/generations/{generation_id}\u0060.", - "Language": "http", - "Code": "### Generate a consistent character with Ideogram 3.0\n# @name post_generate_image_v2_ideogram_v3_character\nPOST {{host}}/v2/image/generate/ideogram-3-character?dry_run=false\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022negative_prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022character_reference_collection_id\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022character_reference_collection_version_id\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022character_reference_asset_identifiers\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022character_reference_images\u0022; filename=\u0022character_reference_images.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./character_reference_images.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022character_reference_mask_asset_identifier\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022character_reference_mask\u0022; filename=\u0022character_reference_mask.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./character_reference_mask.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n12345\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022resolution\u0022\n\n1280x800\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022aspect_ratio\u0022\n\nauto\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022rendering_speed\u0022\n\ndefault\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022magic_prompt\u0022\n\nauto\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022num_images\u0022\n\n1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_type\u0022\n\nauto\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_reference_collection_id\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_reference_collection_version_id\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_reference_asset_identifiers\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_reference_images\u0022; filename=\u0022style_reference_images.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./style_reference_images.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022enable_copyright_detection\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022async\u0022\n\nfalse\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022webhook_url\u0022\n\nhttps://api.example.com/webhooks/ideogram\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022private\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022target_collection_id\u0022\n\nstring\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: The generated images (synchronous requests), or an acknowledgement to poll with \u0060GET /v2/generations/{generation_id}\u0060 (\u0060async\u0060 requests).\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Unauthorized.\n# 402\n# Description: Insufficient credits or quota.\n# Content-Type: application/json\n# 404\n# Description: A referenced resource was not found.\n# 422\n# Description: The prompt did not pass safety checks.\n# 429\n# Description: Too many requests.\n# Content-Type: application/json\n# 500\n# Description: Internal server error.\n# 503\n# Description: The endpoint is temporarily unavailable.", - "Format": "http", - "OperationId": "post_generate_image_v2_ideogram_v3_character", - "Setup": null - }, - { - "Order": 98, - "Title": "Generate with a custom Ideogram 3.0 model", - "Slug": "post-generate-image-v2-ideogram-v3-custom-model", - "Description": "Generate images with a custom Ideogram 3.0 model that you or your\norganization can access, selected by \u0060custom_model_uri\u0060. Returns results\ndirectly by default; set \u0060async\u0060 or supply a \u0060webhook_url\u0060 to get a\n\u0060generation_id\u0060 and poll \u0060GET /v2/generations/{generation_id}\u0060.", - "Language": "http", - "Code": "### Generate with a custom Ideogram 3.0 model\n# @name post_generate_image_v2_ideogram_v3_custom_model\nPOST {{host}}/v2/image/generate/ideogram-3-custom-model?dry_run=false\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022custom_model_uri\u0022\n\nmodel/my-custom-model/version/1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022transparent_background\u0022\n\nfalse\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022negative_prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n12345\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022resolution\u0022\n\n1280x800\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022aspect_ratio\u0022\n\nauto\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022rendering_speed\u0022\n\nturbo\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022magic_prompt\u0022\n\nauto\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022num_images\u0022\n\n1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022color_palette\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_codes\u0022\n\nABCD1234\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_preset\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_reference_asset_identifiers\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_reference_images\u0022; filename=\u0022style_reference_images.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./style_reference_images.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022enable_copyright_detection\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022async\u0022\n\nfalse\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022webhook_url\u0022\n\nhttps://api.example.com/webhooks/ideogram\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022private\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022target_collection_id\u0022\n\nstring\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: The generated images (synchronous requests), or an acknowledgement to poll with \u0060GET /v2/generations/{generation_id}\u0060 (\u0060async\u0060 requests).\n# Content-Type: application/json\n# 400\n# Description: Invalid input or an unsupported model option.\n# 401\n# Description: Unauthorized.\n# 402\n# Description: Insufficient credits or quota.\n# Content-Type: application/json\n# 403\n# Description: The custom model does not exist or is not accessible to this user or organization.\n# 404\n# Description: A requested resource was not found.\n# 422\n# Description: The prompt did not pass safety checks.\n# 429\n# Description: Too many requests.\n# Content-Type: application/json\n# 500\n# Description: Internal server error.\n# 503\n# Description: The endpoint is temporarily unavailable.", - "Format": "http", - "OperationId": "post_generate_image_v2_ideogram_v3_custom_model", - "Setup": null - }, - { - "Order": 99, - "Title": "Generate transparent images with Ideogram 3.0", - "Slug": "post-generate-image-v2-ideogram-v3-transparent", - "Description": "Generate images on a transparent background with Ideogram 3.0, delivered\nas PNGs with alpha. Returns results directly by default; set \u0060async\u0060 or\nsupply a \u0060webhook_url\u0060 to get a \u0060generation_id\u0060 and poll\n\u0060GET /v2/generations/{generation_id}\u0060.", - "Language": "csharp", - "Code": "using var client = new IdeogramClient(apiKey);\n\nvar request = global::System.Text.Json.JsonSerializer.Deserialize\u003Cglobal::Ideogram.GenerateImageIdeogramV3TransparentRequest\u003E(\n @\u0022{\n \u0022\u0022aspect_ratio\u0022\u0022: null,\n \u0022\u0022private\u0022\u0022: true,\n \u0022\u0022seed\u0022\u0022: 12345,\n \u0022\u0022upscale_factor\u0022\u0022: \u0022\u0022x1\u0022\u0022,\n \u0022\u0022rendering_speed\u0022\u0022: \u0022\u0022default\u0022\u0022,\n \u0022\u0022webhook_url\u0022\u0022: \u0022\u0022https://api.example.com/webhooks/ideogram\u0022\u0022,\n \u0022\u0022target_collection_id\u0022\u0022: \u0022\u0022target_collection_id\u0022\u0022,\n \u0022\u0022num_images\u0022\u0022: 1,\n \u0022\u0022magic_prompt\u0022\u0022: \u0022\u0022\u0022\u0022,\n \u0022\u0022async\u0022\u0022: false,\n \u0022\u0022negative_prompt\u0022\u0022: \u0022\u0022negative_prompt\u0022\u0022,\n \u0022\u0022enable_copyright_detection\u0022\u0022: true,\n \u0022\u0022prompt\u0022\u0022: \u0022\u0022prompt\u0022\u0022\n}\u0022)!;\n\nvar response = await client.ImagesGenerate.PostGenerateImageV2IdeogramV3TransparentAsync(\n request: request\n);\n\n// Example response:\n// {\n// \u0022data\u0022: [\n// {\n// \u0022seed\u0022: 12345,\n// \u0022prompt\u0022: \u0022prompt\u0022,\n// \u0022resolution\u0022: \u00221024x1024\u0022,\n// \u0022url\u0022: \u0022https://openapi-generator.tech\u0022,\n// \u0022is_image_safe\u0022: true\n// },\n// {\n// \u0022seed\u0022: 12345,\n// \u0022prompt\u0022: \u0022prompt\u0022,\n// \u0022resolution\u0022: \u00221024x1024\u0022,\n// \u0022url\u0022: \u0022https://openapi-generator.tech\u0022,\n// \u0022is_image_safe\u0022: true\n// }\n// ],\n// \u0022seed\u0022: 12345,\n// \u0022generation_id\u0022: \u0022generation_id\u0022\n// }", - "Format": "sdk", - "OperationId": "post_generate_image_v2_ideogram_v3_transparent", - "Setup": "This example assumes \u0060using Ideogram;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." - }, - { - "Order": 100, - "Title": "Generate with Ideogram 4.0", - "Slug": "post-generate-image-v2-ideogram-v4", - "Description": "Generate images with Ideogram 4.0 from a natural-language or structured\nJSON prompt. Returns results directly by default; set \u0060async\u0060 or supply\na \u0060webhook_url\u0060 to get a \u0060generation_id\u0060 and poll\n\u0060GET /v2/generations/{generation_id}\u0060.", - "Language": "csharp", - "Code": "using var client = new IdeogramClient(apiKey);\n\nvar request = global::System.Text.Json.JsonSerializer.Deserialize\u003Cglobal::Ideogram.GenerateImageIdeogramV4Request\u003E(\n @\u0022{\n \u0022\u0022magic_prompt\u0022\u0022: \u0022\u0022\u0022\u0022,\n \u0022\u0022async\u0022\u0022: false,\n \u0022\u0022private\u0022\u0022: true,\n \u0022\u0022seed\u0022\u0022: 12345,\n \u0022\u0022rendering_speed\u0022\u0022: \u0022\u0022default\u0022\u0022,\n \u0022\u0022webhook_url\u0022\u0022: \u0022\u0022https://api.example.com/webhooks/ideogram\u0022\u0022,\n \u0022\u0022enable_copyright_detection\u0022\u0022: true,\n \u0022\u0022target_collection_id\u0022\u0022: \u0022\u0022target_collection_id\u0022\u0022,\n \u0022\u0022prompt\u0022\u0022: \u0022\u0022prompt\u0022\u0022,\n \u0022\u0022resolution\u0022\u0022: \u0022\u0022\u0022\u0022,\n \u0022\u0022num_images\u0022\u0022: 1\n}\u0022)!;\n\nvar response = await client.ImagesGenerate.PostGenerateImageV2IdeogramV4Async(\n request: request\n);\n\n// Example response:\n// {\n// \u0022data\u0022: [\n// {\n// \u0022seed\u0022: 12345,\n// \u0022prompt\u0022: \u0022prompt\u0022,\n// \u0022resolution\u0022: \u00221024x1024\u0022,\n// \u0022url\u0022: \u0022https://openapi-generator.tech\u0022,\n// \u0022is_image_safe\u0022: true\n// },\n// {\n// \u0022seed\u0022: 12345,\n// \u0022prompt\u0022: \u0022prompt\u0022,\n// \u0022resolution\u0022: \u00221024x1024\u0022,\n// \u0022url\u0022: \u0022https://openapi-generator.tech\u0022,\n// \u0022is_image_safe\u0022: true\n// }\n// ],\n// \u0022seed\u0022: 12345,\n// \u0022generation_id\u0022: \u0022generation_id\u0022\n// }", - "Format": "sdk", - "OperationId": "post_generate_image_v2_ideogram_v4", - "Setup": "This example assumes \u0060using Ideogram;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." - }, - { - "Order": 101, - "Title": "Generate with a custom Ideogram 4.0 model", - "Slug": "post-generate-image-v2-ideogram-v4-custom-model", - "Description": "Generate images with a custom Ideogram 4.0 model that you or your\norganization can access, selected by \u0060custom_model_uri\u0060. Returns results\ndirectly by default; set \u0060async\u0060 or supply a \u0060webhook_url\u0060 to get a\n\u0060generation_id\u0060 and poll \u0060GET /v2/generations/{generation_id}\u0060.", - "Language": "csharp", - "Code": "using var client = new IdeogramClient(apiKey);\n\nvar request = global::System.Text.Json.JsonSerializer.Deserialize\u003Cglobal::Ideogram.GenerateImageIdeogramV4CustomModelRequest\u003E(\n @\u0022{\n \u0022\u0022private\u0022\u0022: true,\n \u0022\u0022seed\u0022\u0022: 12345,\n \u0022\u0022rendering_speed\u0022\u0022: \u0022\u0022turbo\u0022\u0022,\n \u0022\u0022webhook_url\u0022\u0022: \u0022\u0022https://api.example.com/webhooks/ideogram\u0022\u0022,\n \u0022\u0022target_collection_id\u0022\u0022: \u0022\u0022target_collection_id\u0022\u0022,\n \u0022\u0022custom_model_uri\u0022\u0022: \u0022\u0022model/my-custom-v4-model/version/1\u0022\u0022,\n \u0022\u0022resolution\u0022\u0022: \u0022\u0022\u0022\u0022,\n \u0022\u0022transparent_background\u0022\u0022: false,\n \u0022\u0022num_images\u0022\u0022: 1,\n \u0022\u0022magic_prompt\u0022\u0022: \u0022\u0022\u0022\u0022,\n \u0022\u0022async\u0022\u0022: false,\n \u0022\u0022enable_copyright_detection\u0022\u0022: true,\n \u0022\u0022stacked_custom_models\u0022\u0022: [\n {\n \u0022\u0022custom_model_uri\u0022\u0022: \u0022\u0022model/my-base-plora/version/1\u0022\u0022,\n \u0022\u0022weight\u0022\u0022: 0.5\n }\n ],\n \u0022\u0022prompt\u0022\u0022: \u0022\u0022prompt\u0022\u0022\n}\u0022)!;\n\nvar response = await client.ImagesGenerate.PostGenerateImageV2IdeogramV4CustomModelAsync(\n request: request\n);\n\n// Example response:\n// {\n// \u0022data\u0022: [\n// {\n// \u0022seed\u0022: 12345,\n// \u0022prompt\u0022: \u0022prompt\u0022,\n// \u0022resolution\u0022: \u00221024x1024\u0022,\n// \u0022url\u0022: \u0022https://openapi-generator.tech\u0022,\n// \u0022is_image_safe\u0022: true\n// },\n// {\n// \u0022seed\u0022: 12345,\n// \u0022prompt\u0022: \u0022prompt\u0022,\n// \u0022resolution\u0022: \u00221024x1024\u0022,\n// \u0022url\u0022: \u0022https://openapi-generator.tech\u0022,\n// \u0022is_image_safe\u0022: true\n// }\n// ],\n// \u0022seed\u0022: 12345,\n// \u0022generation_id\u0022: \u0022generation_id\u0022\n// }", - "Format": "sdk", - "OperationId": "post_generate_image_v2_ideogram_v4_custom_model", - "Setup": "This example assumes \u0060using Ideogram;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." - }, - { - "Order": 102, - "Title": "Generate transparent images with Ideogram 4.0", - "Slug": "post-generate-image-v2-ideogram-v4-transparent", - "Description": "Generate images on a transparent background with Ideogram 4.0, delivered\nas PNGs with alpha. Returns results directly by default; set \u0060async\u0060 or\nsupply a \u0060webhook_url\u0060 to get a \u0060generation_id\u0060 and poll\n\u0060GET /v2/generations/{generation_id}\u0060.", - "Language": "csharp", - "Code": "using var client = new IdeogramClient(apiKey);\n\nvar request = global::System.Text.Json.JsonSerializer.Deserialize\u003Cglobal::Ideogram.GenerateImageIdeogramV4TransparentRequest\u003E(\n @\u0022{\n \u0022\u0022magic_prompt\u0022\u0022: \u0022\u0022\u0022\u0022,\n \u0022\u0022aspect_ratio\u0022\u0022: null,\n \u0022\u0022async\u0022\u0022: false,\n \u0022\u0022private\u0022\u0022: true,\n \u0022\u0022seed\u0022\u0022: 12345,\n \u0022\u0022rendering_speed\u0022\u0022: \u0022\u0022default\u0022\u0022,\n \u0022\u0022webhook_url\u0022\u0022: \u0022\u0022https://api.example.com/webhooks/ideogram\u0022\u0022,\n \u0022\u0022enable_copyright_detection\u0022\u0022: true,\n \u0022\u0022target_collection_id\u0022\u0022: \u0022\u0022target_collection_id\u0022\u0022,\n \u0022\u0022output_resolution\u0022\u0022: \u0022\u00221k\u0022\u0022,\n \u0022\u0022prompt\u0022\u0022: \u0022\u0022prompt\u0022\u0022,\n \u0022\u0022num_images\u0022\u0022: 1\n}\u0022)!;\n\nvar response = await client.ImagesGenerate.PostGenerateImageV2IdeogramV4TransparentAsync(\n request: request\n);\n\n// Example response:\n// {\n// \u0022data\u0022: [\n// {\n// \u0022seed\u0022: 12345,\n// \u0022prompt\u0022: \u0022prompt\u0022,\n// \u0022resolution\u0022: \u00221024x1024\u0022,\n// \u0022url\u0022: \u0022https://openapi-generator.tech\u0022,\n// \u0022is_image_safe\u0022: true\n// },\n// {\n// \u0022seed\u0022: 12345,\n// \u0022prompt\u0022: \u0022prompt\u0022,\n// \u0022resolution\u0022: \u00221024x1024\u0022,\n// \u0022url\u0022: \u0022https://openapi-generator.tech\u0022,\n// \u0022is_image_safe\u0022: true\n// }\n// ],\n// \u0022seed\u0022: 12345,\n// \u0022generation_id\u0022: \u0022generation_id\u0022\n// }", - "Format": "sdk", - "OperationId": "post_generate_image_v2_ideogram_v4_transparent", - "Setup": "This example assumes \u0060using Ideogram;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." - }, - { - "Order": 103, - "Title": "Generate with Nano Banana 2", - "Slug": "post-generate-image-v2-nano-banana2", - "Description": "Generate images with Nano Banana 2. Optionally upload source images as\n\u0060images\u0060 using \u0060multipart/form-data\u0060 to edit them with the prompt.\nReturns results directly by default; set \u0060async\u0060 or supply a\n\u0060webhook_url\u0060 to get a \u0060generation_id\u0060 and poll\n\u0060GET /v2/generations/{generation_id}\u0060.", - "Language": "http", - "Code": "### Generate with Nano Banana 2\n# @name post_generate_image_v2_nano_banana2\nPOST {{host}}/v2/image/generate/nano-banana-2?dry_run=false\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image_asset_identifiers\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022images\u0022; filename=\u0022images.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./images.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022aspect_ratio\u0022\n\nauto\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022resolution_tier\u0022\n\n1K\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022num_images\u0022\n\n1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n12345\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022async\u0022\n\nfalse\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022webhook_url\u0022\n\nhttps://api.example.com/webhooks/ideogram\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022private\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022target_collection_id\u0022\n\nstring\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: The generated images (synchronous requests), or an acknowledgement to poll with \u0060GET /v2/generations/{generation_id}\u0060 (\u0060async\u0060 requests).\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Unauthorized.\n# 402\n# Description: Insufficient credits or quota.\n# Content-Type: application/json\n# 422\n# Description: The prompt did not pass safety checks.\n# 429\n# Description: Too many requests.\n# Content-Type: application/json\n# 500\n# Description: Internal server error.\n# 503\n# Description: The endpoint is temporarily unavailable.", - "Format": "http", - "OperationId": "post_generate_image_v2_nano_banana2", - "Setup": null - }, - { - "Order": 104, - "Title": "Generate with Nano Banana 2.1", - "Slug": "post-generate-image-v2-nano-banana21", - "Description": "Generate images with Nano Banana 2.1. Optionally upload source images as\n\u0060images\u0060 using \u0060multipart/form-data\u0060 to edit them with the prompt.\nReturns results directly by default; set \u0060async\u0060 or supply a\n\u0060webhook_url\u0060 to get a \u0060generation_id\u0060 and poll\n\u0060GET /v2/generations/{generation_id}\u0060.", - "Language": "http", - "Code": "### Generate with Nano Banana 2.1\n# @name post_generate_image_v2_nano_banana21\nPOST {{host}}/v2/image/generate/nano-banana-2-1?dry_run=false\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image_asset_identifiers\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022images\u0022; filename=\u0022images.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./images.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022aspect_ratio\u0022\n\nauto\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022resolution_tier\u0022\n\n1K\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022num_images\u0022\n\n1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n12345\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022async\u0022\n\nfalse\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022webhook_url\u0022\n\nhttps://api.example.com/webhooks/ideogram\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022private\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022target_collection_id\u0022\n\nstring\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: The generated images (synchronous requests), or an acknowledgement to poll with \u0060GET /v2/generations/{generation_id}\u0060 (\u0060async\u0060 requests).\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Unauthorized.\n# 402\n# Description: Insufficient credits or quota.\n# Content-Type: application/json\n# 422\n# Description: The prompt did not pass safety checks.\n# 429\n# Description: Too many requests.\n# Content-Type: application/json\n# 500\n# Description: Internal server error.\n# 503\n# Description: The endpoint is temporarily unavailable.", - "Format": "http", - "OperationId": "post_generate_image_v2_nano_banana21", - "Setup": null - }, - { - "Order": 105, - "Title": "Generate with Nano Banana Pro", - "Slug": "post-generate-image-v2-nano-banana-pro", - "Description": "Generate images with Nano Banana Pro. Optionally upload source images as\n\u0060images\u0060 using \u0060multipart/form-data\u0060 to edit them with the prompt.\nReturns results directly by default; set \u0060async\u0060 or supply a\n\u0060webhook_url\u0060 to get a \u0060generation_id\u0060 and poll\n\u0060GET /v2/generations/{generation_id}\u0060.", - "Language": "http", - "Code": "### Generate with Nano Banana Pro\n# @name post_generate_image_v2_nano_banana_pro\nPOST {{host}}/v2/image/generate/nano-banana-pro?dry_run=false\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image_asset_identifiers\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022images\u0022; filename=\u0022images.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./images.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022aspect_ratio\u0022\n\nauto\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022resolution_tier\u0022\n\n1K\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022num_images\u0022\n\n1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n12345\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022async\u0022\n\nfalse\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022webhook_url\u0022\n\nhttps://api.example.com/webhooks/ideogram\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022private\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022target_collection_id\u0022\n\nstring\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: The generated images (synchronous requests), or an acknowledgement to poll with \u0060GET /v2/generations/{generation_id}\u0060 (\u0060async\u0060 requests).\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Unauthorized.\n# 402\n# Description: Insufficient credits or quota.\n# Content-Type: application/json\n# 422\n# Description: The prompt did not pass safety checks.\n# 429\n# Description: Too many requests.\n# Content-Type: application/json\n# 500\n# Description: Internal server error.\n# 503\n# Description: The endpoint is temporarily unavailable.", - "Format": "http", - "OperationId": "post_generate_image_v2_nano_banana_pro", - "Setup": null - }, - { - "Order": 106, - "Title": "Generate with P-Image Ideogram", - "Slug": "post-generate-image-v2-p-image-ideogram", - "Description": "Generate images with P-Image Ideogram, a fast model with selectable\nquality and resolution tiers. Returns results directly by default; set\n\u0060async\u0060 or supply a \u0060webhook_url\u0060 to get a \u0060generation_id\u0060 and poll\n\u0060GET /v2/generations/{generation_id}\u0060.", - "Language": "csharp", - "Code": "using var client = new IdeogramClient(apiKey);\n\nvar request = global::System.Text.Json.JsonSerializer.Deserialize\u003Cglobal::Ideogram.GenerateImagePImageIdeogramRequest\u003E(\n @\u0022{\n \u0022\u0022aspect_ratio\u0022\u0022: \u0022\u0022\u0022\u0022,\n \u0022\u0022custom_height\u0022\u0022: 1,\n \u0022\u0022private\u0022\u0022: true,\n \u0022\u0022seed\u0022\u0022: 12345,\n \u0022\u0022webhook_url\u0022\u0022: \u0022\u0022https://api.example.com/webhooks/ideogram\u0022\u0022,\n \u0022\u0022custom_width\u0022\u0022: 6,\n \u0022\u0022target_collection_id\u0022\u0022: \u0022\u0022target_collection_id\u0022\u0022,\n \u0022\u0022resolution\u0022\u0022: \u0022\u00221k\u0022\u0022,\n \u0022\u0022num_images\u0022\u0022: 1,\n \u0022\u0022quality\u0022\u0022: \u0022\u0022\u0022\u0022,\n \u0022\u0022magic_prompt\u0022\u0022: \u0022\u0022\u0022\u0022,\n \u0022\u0022async\u0022\u0022: false,\n \u0022\u0022enable_copyright_detection\u0022\u0022: true,\n \u0022\u0022prompt\u0022\u0022: \u0022\u0022prompt\u0022\u0022\n}\u0022)!;\n\nvar response = await client.ImagesGenerate.PostGenerateImageV2PImageIdeogramAsync(\n request: request\n);\n\n// Example response:\n// {\n// \u0022data\u0022: [\n// {\n// \u0022seed\u0022: 12345,\n// \u0022prompt\u0022: \u0022prompt\u0022,\n// \u0022resolution\u0022: \u00221024x1024\u0022,\n// \u0022url\u0022: \u0022https://openapi-generator.tech\u0022,\n// \u0022is_image_safe\u0022: true\n// },\n// {\n// \u0022seed\u0022: 12345,\n// \u0022prompt\u0022: \u0022prompt\u0022,\n// \u0022resolution\u0022: \u00221024x1024\u0022,\n// \u0022url\u0022: \u0022https://openapi-generator.tech\u0022,\n// \u0022is_image_safe\u0022: true\n// }\n// ],\n// \u0022seed\u0022: 12345,\n// \u0022generation_id\u0022: \u0022generation_id\u0022\n// }", - "Format": "sdk", - "OperationId": "post_generate_image_v2_p_image_ideogram", - "Setup": "This example assumes \u0060using Ideogram;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." - }, - { - "Order": 107, - "Title": "Generate with Z-Image", - "Slug": "post-generate-image-v2-z-image", - "Description": "Generate images from a text prompt with Z-Image. Returns results\ndirectly by default; set \u0060async\u0060 or supply a \u0060webhook_url\u0060 to get a\n\u0060generation_id\u0060 and poll \u0060GET /v2/generations/{generation_id}\u0060.", - "Language": "csharp", - "Code": "using var client = new IdeogramClient(apiKey);\n\nvar request = global::System.Text.Json.JsonSerializer.Deserialize\u003Cglobal::Ideogram.GenerateImageZImageRequest\u003E(\n @\u0022{\n \u0022\u0022async\u0022\u0022: false,\n \u0022\u0022private\u0022\u0022: true,\n \u0022\u0022seed\u0022\u0022: 12345,\n \u0022\u0022webhook_url\u0022\u0022: \u0022\u0022https://api.example.com/webhooks/ideogram\u0022\u0022,\n \u0022\u0022target_collection_id\u0022\u0022: \u0022\u0022target_collection_id\u0022\u0022,\n \u0022\u0022prompt\u0022\u0022: \u0022\u0022A futuristic cityscape at golden hour, highly detailed.\u0022\u0022,\n \u0022\u0022resolution\u0022\u0022: \u0022\u00221024x1024\u0022\u0022,\n \u0022\u0022num_images\u0022\u0022: 1,\n \u0022\u0022num_inference_steps\u0022\u0022: 8\n}\u0022)!;\n\nvar response = await client.ImagesGenerate.PostGenerateImageV2ZImageAsync(\n request: request\n);\n\n// Example response:\n// {\n// \u0022data\u0022: [\n// {\n// \u0022seed\u0022: 12345,\n// \u0022prompt\u0022: \u0022prompt\u0022,\n// \u0022resolution\u0022: \u00221024x1024\u0022,\n// \u0022url\u0022: \u0022https://openapi-generator.tech\u0022,\n// \u0022is_image_safe\u0022: true\n// },\n// {\n// \u0022seed\u0022: 12345,\n// \u0022prompt\u0022: \u0022prompt\u0022,\n// \u0022resolution\u0022: \u00221024x1024\u0022,\n// \u0022url\u0022: \u0022https://openapi-generator.tech\u0022,\n// \u0022is_image_safe\u0022: true\n// }\n// ],\n// \u0022seed\u0022: 12345,\n// \u0022generation_id\u0022: \u0022generation_id\u0022\n// }", - "Format": "sdk", - "OperationId": "post_generate_image_v2_z_image", - "Setup": "This example assumes \u0060using Ideogram;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." - }, - { - "Order": 108, - "Title": "Inpaint with Ideogram 3.0", - "Slug": "post-inpaint-image-v2-ideogram-v3", - "Description": "Repaint the masked region of a source image with Ideogram 3.0, guided\nby a text prompt. Upload the source \u0060image\u0060 and its \u0060mask\u0060 using\n\u0060multipart/form-data\u0060.\nReturns results directly by default; set \u0060async\u0060 or supply a\n\u0060webhook_url\u0060 to get a \u0060generation_id\u0060 and poll\n\u0060GET /v2/generations/{generation_id}\u0060.", - "Language": "http", - "Code": "### Inpaint with Ideogram 3.0\n# @name post_inpaint_image_v2_ideogram_v3\nPOST {{host}}/v2/image/inpaint/ideogram-3?dry_run=false\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image_asset_identifier\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image\u0022; filename=\u0022image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022mask_asset_identifier\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022mask\u0022; filename=\u0022mask.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./mask.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022magic_prompt\u0022\n\nauto\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022num_images\u0022\n\n1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n12345\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022rendering_speed\u0022\n\ndefault\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_type\u0022\n\ngeneral\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_preset\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_codes\u0022\n\nABCD1234\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_reference_collection_id\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_reference_collection_version_id\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_reference_asset_identifiers\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_reference_images\u0022; filename=\u0022style_reference_images.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./style_reference_images.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022enable_copyright_detection\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022async\u0022\n\nfalse\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022webhook_url\u0022\n\nhttps://api.example.com/webhooks/ideogram\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022private\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022target_collection_id\u0022\n\nstring\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: The repainted images (synchronous requests), or an acknowledgement to poll with \u0060GET /v2/generations/{generation_id}\u0060 (\u0060async\u0060 requests).\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Unauthorized.\n# 402\n# Description: Insufficient credits or quota.\n# Content-Type: application/json\n# 404\n# Description: A referenced resource was not found.\n# 422\n# Description: The prompt did not pass safety checks.\n# 429\n# Description: Too many requests.\n# Content-Type: application/json\n# 500\n# Description: Internal server error.\n# 503\n# Description: The endpoint is temporarily unavailable.", - "Format": "http", - "OperationId": "post_inpaint_image_v2_ideogram_v3", - "Setup": null - }, - { - "Order": 109, - "Title": "Inpaint a consistent character with Ideogram 3.0", - "Slug": "post-inpaint-image-v2-ideogram-v3-character", - "Description": "Repaint the masked region of a source image with Ideogram 3.0 so it\nfeatures a consistent character. Upload the source \u0060image\u0060, its\n\u0060mask\u0060, and a \u0060character_reference_images\u0060 image (or use a saved\ncharacter) using \u0060multipart/form-data\u0060.\nReturns results directly by default; set \u0060async\u0060 or supply a\n\u0060webhook_url\u0060 to get a \u0060generation_id\u0060 and poll\n\u0060GET /v2/generations/{generation_id}\u0060.", - "Language": "http", - "Code": "### Inpaint a consistent character with Ideogram 3.0\n# @name post_inpaint_image_v2_ideogram_v3_character\nPOST {{host}}/v2/image/inpaint/ideogram-3-character?dry_run=false\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image_asset_identifier\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image\u0022; filename=\u0022image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022mask_asset_identifier\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022mask\u0022; filename=\u0022mask.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./mask.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022character_reference_collection_id\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022character_reference_collection_version_id\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022character_reference_asset_identifiers\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022character_reference_images\u0022; filename=\u0022character_reference_images.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./character_reference_images.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022character_reference_mask_asset_identifier\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022character_reference_mask\u0022; filename=\u0022character_reference_mask.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./character_reference_mask.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022magic_prompt\u0022\n\nauto\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022num_images\u0022\n\n1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n12345\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022rendering_speed\u0022\n\ndefault\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_type\u0022\n\nauto\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_codes\u0022\n\nABCD1234\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_reference_collection_id\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_reference_collection_version_id\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_reference_asset_identifiers\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_reference_images\u0022; filename=\u0022style_reference_images.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./style_reference_images.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022enable_copyright_detection\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022async\u0022\n\nfalse\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022webhook_url\u0022\n\nhttps://api.example.com/webhooks/ideogram\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022private\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022target_collection_id\u0022\n\nstring\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: The repainted images (synchronous requests), or an acknowledgement to poll with \u0060GET /v2/generations/{generation_id}\u0060 (\u0060async\u0060 requests).\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Unauthorized.\n# 402\n# Description: Insufficient credits or quota.\n# Content-Type: application/json\n# 404\n# Description: A referenced resource was not found.\n# 422\n# Description: The prompt did not pass safety checks.\n# 429\n# Description: Too many requests.\n# Content-Type: application/json\n# 500\n# Description: Internal server error.\n# 503\n# Description: The endpoint is temporarily unavailable.", - "Format": "http", - "OperationId": "post_inpaint_image_v2_ideogram_v3_character", - "Setup": null - }, - { - "Order": 110, - "Title": "Inpaint with a custom Ideogram 3.0 model", - "Slug": "post-inpaint-image-v2-ideogram-v3-custom-model", - "Description": "Repaint the masked region of a source image with a custom Ideogram 3.0\nmodel, passed as \u0060custom_model_uri\u0060. Upload the source \u0060image\u0060 and its\n\u0060mask\u0060 using \u0060multipart/form-data\u0060. Returns results directly by\ndefault; set \u0060async\u0060 to get a \u0060generation_id\u0060 and poll\n\u0060GET /v2/generations/{generation_id}\u0060.", - "Language": "http", - "Code": "### Inpaint with a custom Ideogram 3.0 model\n# @name post_inpaint_image_v2_ideogram_v3_custom_model\nPOST {{host}}/v2/image/inpaint/ideogram-3-custom-model?dry_run=false\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022custom_model_uri\u0022\n\nmodel/my-custom-model/version/1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image_asset_identifier\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image\u0022; filename=\u0022image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022mask_asset_identifier\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022mask\u0022; filename=\u0022mask.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./mask.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022magic_prompt\u0022\n\nauto\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022num_images\u0022\n\n1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n12345\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022rendering_speed\u0022\n\nturbo\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_preset\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_codes\u0022\n\nABCD1234\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_reference_collection_id\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_reference_collection_version_id\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_reference_asset_identifiers\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_reference_images\u0022; filename=\u0022style_reference_images.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./style_reference_images.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022enable_copyright_detection\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022async\u0022\n\nfalse\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022private\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022target_collection_id\u0022\n\nstring\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: The repainted images, or an acknowledgement for an asynchronous request.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Unauthorized.\n# 402\n# Description: Insufficient credits or quota.\n# Content-Type: application/json\n# 403\n# Description: The caller cannot use the requested custom model.\n# 404\n# Description: A referenced resource was not found.\n# 422\n# Description: The prompt did not pass safety checks.\n# 429\n# Description: Too many requests.\n# Content-Type: application/json\n# 500\n# Description: Internal server error.\n# 503\n# Description: The endpoint is temporarily unavailable.", - "Format": "http", - "OperationId": "post_inpaint_image_v2_ideogram_v3_custom_model", - "Setup": null - }, - { - "Order": 111, - "Title": "Precise edit with Ideogram 4.5", - "Slug": "post-precise-edit-image-v2-ideogram45", - "Description": "Edit an image with Ideogram 4.5 and get the result back at that image\u0027s\nexact width and height. Upload the image as \u0060image\u0060 using\n\u0060multipart/form-data\u0060, with optional \u0060reference_images\u0060 and a \u0060mask\u0060.\nReturns results directly by default; set \u0060async\u0060 or supply a\n\u0060webhook_url\u0060 to get a \u0060generation_id\u0060 and poll\n\u0060GET /v2/generations/{generation_id}\u0060.\n\n\u0060context_window\u0060 confines the edit to one region of the image, so a\nlarge image keeps its detail: pass \u0060y_min,x_min,y_max,x_max\u0060, or \u0060auto\u0060\ntogether with a \u0060mask\u0060. The result always keeps the image\u0027s own width\nand height.", - "Language": "http", - "Code": "### Precise edit with Ideogram 4.5\n# @name post_precise_edit_image_v2_ideogram45\nPOST {{host}}/v2/image/precise-edit/ideogram-4-5?dry_run=false\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image_asset_identifier\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image\u0022; filename=\u0022image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022reference_image_asset_identifiers\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022reference_images\u0022; filename=\u0022reference_images.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./reference_images.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022mask_asset_identifier\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022mask\u0022; filename=\u0022mask.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./mask.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022context_window\u0022\n\nnone\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022quality\u0022\n\nmedium\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n12345\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022num_images\u0022\n\n1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022enable_copyright_detection\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022async\u0022\n\nfalse\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022webhook_url\u0022\n\nhttps://api.example.com/webhooks/ideogram\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022private\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022target_collection_id\u0022\n\nstring\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: The edited images (synchronous requests), or an acknowledgement to poll with \u0060GET /v2/generations/{generation_id}\u0060 (\u0060async\u0060 requests).\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Unauthorized.\n# 402\n# Description: Insufficient credits or quota.\n# Content-Type: application/json\n# 422\n# Description: The prompt did not pass safety checks.\n# 429\n# Description: Too many requests.\n# Content-Type: application/json\n# 500\n# Description: Internal server error.\n# 503\n# Description: The endpoint is temporarily unavailable.", - "Format": "http", - "OperationId": "post_precise_edit_image_v2_ideogram45", - "Setup": null - }, - { - "Order": 112, - "Title": "Reframe an image, letting Ideogram pick the model", - "Slug": "post-reframe-image-auto", - "Description": "Reframe one image to a new aspect ratio without choosing a model.\nIdeogram selects the model best suited to the source and may route\ndifferent requests to different models; the request is billed at the\nchosen model\u0027s price. Supply either an existing Ideogram image asset\nor raw image bytes, but not both.\n\nThis operation is asynchronous. It returns as soon as the request is\naccepted; poll \u0060GET /v2/generations/{generation_id}\u0060 for completion\nand results.", - "Language": "http", - "Code": "### Reframe an image, letting Ideogram pick the model\n# @name post_reframe_image_auto\nPOST {{host}}/v2/image/reframe/auto?dry_run=false\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image_asset_identifier\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image\u0022; filename=\u0022image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022aspect_ratio\u0022\n\n16:9\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022private\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022num_images\u0022\n\n1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n12345\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: An acknowledgement to poll with \u0060GET /v2/generations/{generation_id}\u0060.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Unauthorized.\n# 402\n# Description: Insufficient credits or quota.\n# Content-Type: application/json\n# 404\n# Description: The referenced source asset was not found.\n# 429\n# Description: Too many requests.\n# Content-Type: application/json\n# 500\n# Description: Internal server error.\n# 503\n# Description: The endpoint is temporarily unavailable.", - "Format": "http", - "OperationId": "post_reframe_image_auto", - "Setup": null - }, - { - "Order": 113, - "Title": "Reframe an image with Bria Expand", - "Slug": "post-reframe-image-bria-expand", - "Description": "Extend one image to a new aspect ratio with Bria Expand. The source\npixels are kept exactly as they are, centered on the new canvas, and\nthe model paints only the added area. Supply either an existing\nIdeogram image asset or raw image bytes, but not both. The canvas is\nsized from the source so that the whole source fits.\n\nThis operation is asynchronous. It returns as soon as the request is\naccepted; poll \u0060GET /v2/generations/{generation_id}\u0060 for completion\nand results.", - "Language": "http", - "Code": "### Reframe an image with Bria Expand\n# @name post_reframe_image_bria_expand\nPOST {{host}}/v2/image/reframe/bria-expand?dry_run=false\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image_asset_identifier\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image\u0022; filename=\u0022image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022aspect_ratio\u0022\n\n16:9\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022private\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n12345\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: An acknowledgement to poll with \u0060GET /v2/generations/{generation_id}\u0060.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Unauthorized.\n# 402\n# Description: Insufficient credits or quota.\n# Content-Type: application/json\n# 404\n# Description: The referenced source asset was not found.\n# 429\n# Description: Too many requests.\n# Content-Type: application/json\n# 500\n# Description: Internal server error.\n# 503\n# Description: The endpoint is temporarily unavailable.", - "Format": "http", - "OperationId": "post_reframe_image_bria_expand", - "Setup": null - }, - { - "Order": 114, - "Title": "Reframe an image with GPT Image 2.5 Flare", - "Slug": "post-reframe-image-gpt-image25-flare", - "Description": "Recompose one image for a new aspect ratio with GPT Image 2.5 Flare.\nSupply either an existing Ideogram image asset or raw image bytes, but\nnot both. The requested aspect ratio is resolved to the closest output\nsize the model supports.\n\nThis operation is asynchronous. It returns as soon as the request is\naccepted; poll \u0060GET /v2/generations/{generation_id}\u0060 for completion\nand results.", - "Language": "http", - "Code": "### Reframe an image with GPT Image 2.5 Flare\n# @name post_reframe_image_gpt_image25_flare\nPOST {{host}}/v2/image/reframe/gpt-image-2-5-flare?dry_run=false\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image_asset_identifier\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image\u0022; filename=\u0022image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022aspect_ratio\u0022\n\n16:9\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022quality\u0022\n\nauto\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022private\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022num_images\u0022\n\n1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n12345\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: An acknowledgement to poll with \u0060GET /v2/generations/{generation_id}\u0060.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Unauthorized.\n# 402\n# Description: Insufficient credits or quota.\n# Content-Type: application/json\n# 404\n# Description: The referenced source asset was not found.\n# 429\n# Description: Too many requests.\n# Content-Type: application/json\n# 500\n# Description: Internal server error.\n# 503\n# Description: The endpoint is temporarily unavailable.", - "Format": "http", - "OperationId": "post_reframe_image_gpt_image25_flare", - "Setup": null - }, - { - "Order": 115, - "Title": "Reframe with Ideogram 3.0", - "Slug": "post-reframe-image-v2-ideogram-v3", - "Description": "Expand an image to a new Ideogram 3.0 resolution, keeping the source\npixels in the center and filling the new area. Upload the source\n\u0060image\u0060 using \u0060multipart/form-data\u0060. Returns results directly by\ndefault; set \u0060async\u0060 to get a \u0060generation_id\u0060 and poll\n\u0060GET /v2/generations/{generation_id}\u0060.", - "Language": "http", - "Code": "### Reframe with Ideogram 3.0\n# @name post_reframe_image_v2_ideogram_v3\nPOST {{host}}/v2/image/reframe/ideogram-3?dry_run=false\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image_asset_identifier\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image\u0022; filename=\u0022image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022resolution\u0022\n\n1280x800\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022num_images\u0022\n\n1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n12345\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022rendering_speed\u0022\n\ndefault\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_preset\u0022\n\nbright_art\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022color_palette\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_codes\u0022\n\nABCD1234\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_reference_asset_identifiers\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_reference_images\u0022; filename=\u0022style_reference_images.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./style_reference_images.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022async\u0022\n\nfalse\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: The reframed images, or an acknowledgement for an asynchronous request.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Unauthorized.\n# 402\n# Description: Insufficient credits or quota.\n# Content-Type: application/json\n# 404\n# Description: A referenced resource was not found.\n# 429\n# Description: Too many requests.\n# Content-Type: application/json\n# 500\n# Description: Internal server error.\n# 503\n# Description: The endpoint is temporarily unavailable.", - "Format": "http", - "OperationId": "post_reframe_image_v2_ideogram_v3", - "Setup": null - }, - { - "Order": 116, - "Title": "Reframe with Nano Banana 2", - "Slug": "post-reframe-image-nano-banana2", - "Description": "Expand an image to a new aspect ratio with Nano Banana 2. Upload the\nsource \u0060image\u0060 using \u0060multipart/form-data\u0060. Always asynchronous:\nreturns a \u0060generation_id\u0060; poll \u0060GET /v2/generations/{generation_id}\u0060\nfor results.", - "Language": "http", - "Code": "### Reframe with Nano Banana 2\n# @name post_reframe_image_nano_banana2\nPOST {{host}}/v2/image/reframe/nano-banana-2?dry_run=false\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image_asset_identifier\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image\u0022; filename=\u0022image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022aspect_ratio\u0022\n\n1:1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022private\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022num_images\u0022\n\n1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n12345\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: An acknowledgement to poll with \u0060GET /v2/generations/{generation_id}\u0060.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Unauthorized.\n# 402\n# Description: Insufficient credits or quota.\n# Content-Type: application/json\n# 404\n# Description: A referenced resource was not found.\n# 429\n# Description: Too many requests.\n# Content-Type: application/json\n# 500\n# Description: Internal server error.\n# 503\n# Description: The endpoint is temporarily unavailable.", - "Format": "http", - "OperationId": "post_reframe_image_nano_banana2", - "Setup": null - }, - { - "Order": 117, - "Title": "Reframe an image with Nano Banana Pro", - "Slug": "post-reframe-image-nano-banana-pro", - "Description": "Recompose one image for a new aspect ratio with Nano Banana Pro, at a\n1K, 2K, or 4K output tier. Supply either an existing Ideogram image\nasset or raw image bytes, but not both. The requested aspect ratio is\nresolved to the closest dimensions the model supports at that tier.\n\nThis operation is asynchronous. It returns as soon as the request is\naccepted; poll \u0060GET /v2/generations/{generation_id}\u0060 for completion\nand results.", - "Language": "http", - "Code": "### Reframe an image with Nano Banana Pro\n# @name post_reframe_image_nano_banana_pro\nPOST {{host}}/v2/image/reframe/nano-banana-pro?dry_run=false\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image_asset_identifier\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image\u0022; filename=\u0022image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022aspect_ratio\u0022\n\n1:1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022resolution_tier\u0022\n\n1K\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022private\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022num_images\u0022\n\n1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n12345\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: An acknowledgement to poll with \u0060GET /v2/generations/{generation_id}\u0060.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Unauthorized.\n# 402\n# Description: Insufficient credits or quota.\n# Content-Type: application/json\n# 404\n# Description: The referenced source asset was not found.\n# 429\n# Description: Too many requests.\n# Content-Type: application/json\n# 500\n# Description: Internal server error.\n# 503\n# Description: The endpoint is temporarily unavailable.", - "Format": "http", - "OperationId": "post_reframe_image_nano_banana_pro", - "Setup": null - }, - { - "Order": 118, - "Title": "Remix with Ideogram 3.0", - "Slug": "post-remix-image-v2-ideogram-v3", - "Description": "Transform an existing image with Ideogram 3.0, guided by a text\nprompt. Upload the source \u0060image\u0060 using \u0060multipart/form-data\u0060.\nReturns results directly by default; set \u0060async\u0060 or supply a\n\u0060webhook_url\u0060 to get a \u0060generation_id\u0060 and poll\n\u0060GET /v2/generations/{generation_id}\u0060.", - "Language": "http", - "Code": "### Remix with Ideogram 3.0\n# @name post_remix_image_v2_ideogram_v3\nPOST {{host}}/v2/image/remix/ideogram-3?dry_run=false\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image_asset_identifier\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image\u0022; filename=\u0022image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image_weight\u0022\n\n0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022negative_prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n12345\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022resolution\u0022\n\n1280x800\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022aspect_ratio\u0022\n\n1x3\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022rendering_speed\u0022\n\ndefault\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022magic_prompt\u0022\n\nauto\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022num_images\u0022\n\n1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022color_palette\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_codes\u0022\n\nABCD1234\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_type\u0022\n\ngeneral\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_preset\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_reference_collection_id\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_reference_collection_version_id\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_reference_asset_identifiers\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_reference_images\u0022; filename=\u0022style_reference_images.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./style_reference_images.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022enable_copyright_detection\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022async\u0022\n\nfalse\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022webhook_url\u0022\n\nhttps://api.example.com/webhooks/ideogram\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022private\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022target_collection_id\u0022\n\nstring\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: The remixed images (synchronous requests), or an acknowledgement to poll with \u0060GET /v2/generations/{generation_id}\u0060 (\u0060async\u0060 requests).\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Unauthorized.\n# 402\n# Description: Insufficient credits or quota.\n# Content-Type: application/json\n# 404\n# Description: A referenced resource was not found.\n# 422\n# Description: The prompt did not pass safety checks.\n# 429\n# Description: Too many requests.\n# Content-Type: application/json\n# 500\n# Description: Internal server error.\n# 503\n# Description: The endpoint is temporarily unavailable.", - "Format": "http", - "OperationId": "post_remix_image_v2_ideogram_v3", - "Setup": null - }, - { - "Order": 119, - "Title": "Remix a consistent character with Ideogram 3.0", - "Slug": "post-remix-image-v2-ideogram-v3-character", - "Description": "Transform an existing image with Ideogram 3.0 so it features a\nconsistent character, guided by a text prompt. Upload the source\n\u0060image\u0060 and a \u0060character_reference_images\u0060 image (or use a saved\ncharacter) using \u0060multipart/form-data\u0060.\nReturns results directly by default; set \u0060async\u0060 or supply a\n\u0060webhook_url\u0060 to get a \u0060generation_id\u0060 and poll\n\u0060GET /v2/generations/{generation_id}\u0060.", - "Language": "http", - "Code": "### Remix a consistent character with Ideogram 3.0\n# @name post_remix_image_v2_ideogram_v3_character\nPOST {{host}}/v2/image/remix/ideogram-3-character?dry_run=false\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image_asset_identifier\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image\u0022; filename=\u0022image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image_weight\u0022\n\n0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022negative_prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022character_reference_collection_id\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022character_reference_collection_version_id\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022character_reference_asset_identifiers\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022character_reference_images\u0022; filename=\u0022character_reference_images.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./character_reference_images.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022character_reference_mask_asset_identifier\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022character_reference_mask\u0022; filename=\u0022character_reference_mask.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./character_reference_mask.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n12345\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022resolution\u0022\n\n1280x800\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022aspect_ratio\u0022\n\n1x3\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022rendering_speed\u0022\n\ndefault\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022magic_prompt\u0022\n\nauto\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022num_images\u0022\n\n1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_type\u0022\n\nauto\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_reference_collection_id\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_reference_collection_version_id\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_reference_asset_identifiers\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_reference_images\u0022; filename=\u0022style_reference_images.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./style_reference_images.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022enable_copyright_detection\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022async\u0022\n\nfalse\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022webhook_url\u0022\n\nhttps://api.example.com/webhooks/ideogram\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022private\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022target_collection_id\u0022\n\nstring\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: The remixed images (synchronous requests), or an acknowledgement to poll with \u0060GET /v2/generations/{generation_id}\u0060 (\u0060async\u0060 requests).\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Unauthorized.\n# 402\n# Description: Insufficient credits or quota.\n# Content-Type: application/json\n# 404\n# Description: A referenced resource was not found.\n# 422\n# Description: The prompt did not pass safety checks.\n# 429\n# Description: Too many requests.\n# Content-Type: application/json\n# 500\n# Description: Internal server error.\n# 503\n# Description: The endpoint is temporarily unavailable.", - "Format": "http", - "OperationId": "post_remix_image_v2_ideogram_v3_character", - "Setup": null - }, - { - "Order": 120, - "Title": "Remix with a custom Ideogram 3.0 model", - "Slug": "post-remix-image-v2-ideogram-v3-custom-model", - "Description": "Transform an existing image with a custom Ideogram 3.0 model that your\nuser or organization can access, guided by a text prompt. Upload the\nsource \u0060image\u0060 using \u0060multipart/form-data\u0060.\nReturns results directly by default; set \u0060async\u0060 or supply a\n\u0060webhook_url\u0060 to get a \u0060generation_id\u0060 and poll\n\u0060GET /v2/generations/{generation_id}\u0060.", - "Language": "http", - "Code": "### Remix with a custom Ideogram 3.0 model\n# @name post_remix_image_v2_ideogram_v3_custom_model\nPOST {{host}}/v2/image/remix/ideogram-3-custom-model?dry_run=false\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022custom_model_uri\u0022\n\nmodel/my-custom-model/version/1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image_asset_identifier\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image\u0022; filename=\u0022image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image_weight\u0022\n\n0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022negative_prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n12345\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022resolution\u0022\n\n1280x800\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022aspect_ratio\u0022\n\n1x3\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022rendering_speed\u0022\n\nturbo\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022magic_prompt\u0022\n\nauto\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022num_images\u0022\n\n1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022color_palette\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_codes\u0022\n\nABCD1234\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_preset\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_reference_asset_identifiers\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_reference_images\u0022; filename=\u0022style_reference_images.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./style_reference_images.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022enable_copyright_detection\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022async\u0022\n\nfalse\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022webhook_url\u0022\n\nhttps://api.example.com/webhooks/ideogram\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022private\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022target_collection_id\u0022\n\nstring\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: The remixed images (synchronous requests), or an acknowledgement to poll with \u0060GET /v2/generations/{generation_id}\u0060 (\u0060async\u0060 requests).\n# Content-Type: application/json\n# 400\n# Description: Invalid input or an unsupported model option.\n# 401\n# Description: Unauthorized.\n# 402\n# Description: Insufficient credits or quota.\n# Content-Type: application/json\n# 403\n# Description: The custom model does not exist or is not accessible to this user or organization.\n# 404\n# Description: A referenced resource was not found.\n# 422\n# Description: The prompt did not pass safety checks.\n# 429\n# Description: Too many requests.\n# Content-Type: application/json\n# 500\n# Description: Internal server error.\n# 503\n# Description: The endpoint is temporarily unavailable.", - "Format": "http", - "OperationId": "post_remix_image_v2_ideogram_v3_custom_model", - "Setup": null - }, - { - "Order": 121, - "Title": "Remix with Ideogram 4.0", - "Slug": "post-remix-image-v2-ideogram-v4", - "Description": "Transform an existing image with Ideogram 4.0, guided by a text\nprompt. Upload the source \u0060image\u0060 using \u0060multipart/form-data\u0060.\nReturns results directly by default; set \u0060async\u0060 or supply a\n\u0060webhook_url\u0060 to get a \u0060generation_id\u0060 and poll\n\u0060GET /v2/generations/{generation_id}\u0060.", - "Language": "http", - "Code": "### Remix with Ideogram 4.0\n# @name post_remix_image_v2_ideogram_v4\nPOST {{host}}/v2/image/remix/ideogram-4?dry_run=false\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image_asset_identifier\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image\u0022; filename=\u0022image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image_weight\u0022\n\n0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022num_images\u0022\n\n1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022resolution\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022rendering_speed\u0022\n\ndefault\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022enable_copyright_detection\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022async\u0022\n\nfalse\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022webhook_url\u0022\n\nhttps://api.example.com/webhooks/ideogram\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022private\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022target_collection_id\u0022\n\nstring\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: The remixed images (synchronous requests), or an acknowledgement to poll with \u0060GET /v2/generations/{generation_id}\u0060 (\u0060async\u0060 requests).\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Unauthorized.\n# 402\n# Description: Insufficient credits or quota.\n# Content-Type: application/json\n# 404\n# Description: A referenced resource was not found.\n# 422\n# Description: The prompt did not pass safety checks.\n# 429\n# Description: Too many requests.\n# Content-Type: application/json\n# 500\n# Description: Internal server error.\n# 503\n# Description: The endpoint is temporarily unavailable.", - "Format": "http", - "OperationId": "post_remix_image_v2_ideogram_v4", - "Setup": null - }, - { - "Order": 122, - "Title": "Upscale with Nano Banana Pro", - "Slug": "post-upscale-image-nano-banana-pro", - "Description": "Regenerate an image at a higher \u0060resolution_tier\u0060 (1K, 2K, or 4K) while\npreserving its content, composition, and style. Upload the source\n\u0060image\u0060 using \u0060multipart/form-data\u0060.\nReturns results directly by default; set \u0060async\u0060 or supply a\n\u0060webhook_url\u0060 to get a \u0060generation_id\u0060 and poll\n\u0060GET /v2/generations/{generation_id}\u0060.", - "Language": "http", - "Code": "### Upscale with Nano Banana Pro\n# @name post_upscale_image_nano_banana_pro\nPOST {{host}}/v2/image/upscale/nano-banana-pro?dry_run=false\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image_asset_identifier\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image\u0022; filename=\u0022image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022resolution_tier\u0022\n\n2K\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n12345\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022async\u0022\n\nfalse\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022webhook_url\u0022\n\nhttps://api.example.com/webhooks/ideogram\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022private\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022target_collection_id\u0022\n\nstring\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: The upscaled image (synchronous requests), or an acknowledgement to poll with \u0060GET /v2/generations/{generation_id}\u0060 (\u0060async\u0060 requests).\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Unauthorized.\n# 402\n# Description: Insufficient credits or quota.\n# Content-Type: application/json\n# 404\n# Description: The source image was not found.\n# 422\n# Description: The prompt did not pass safety checks.\n# 429\n# Description: Too many requests.\n# Content-Type: application/json\n# 500\n# Description: Internal server error.\n# 503\n# Description: The endpoint is temporarily unavailable.", - "Format": "http", - "OperationId": "post_upscale_image_nano_banana_pro", - "Setup": null - }, - { - "Order": 123, - "Title": "Upscale with Topaz Bloom 2", - "Slug": "post-upscale-image-topaz-bloom2", - "Description": "Creatively upscale an image to 2x, 4x, or 8x its original resolution,\noptionally guided by a \u0060prompt\u0060. Upload the source \u0060image\u0060 using\n\u0060multipart/form-data\u0060.\nReturns results directly by default; set \u0060async\u0060 or supply a\n\u0060webhook_url\u0060 to get a \u0060generation_id\u0060 and poll\n\u0060GET /v2/generations/{generation_id}\u0060.", - "Language": "http", - "Code": "### Upscale with Topaz Bloom 2\n# @name post_upscale_image_topaz_bloom2\nPOST {{host}}/v2/image/upscale/topaz-bloom-2?dry_run=false\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image_asset_identifier\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image\u0022; filename=\u0022image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022upscale_factor\u0022\n\nx2\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022creativity\u0022\n\n3\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022color_preservation\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n12345\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022async\u0022\n\nfalse\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022webhook_url\u0022\n\nhttps://api.example.com/webhooks/ideogram\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022private\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022target_collection_id\u0022\n\nstring\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: The upscaled image (synchronous requests), or an acknowledgement to poll with \u0060GET /v2/generations/{generation_id}\u0060 (\u0060async\u0060 requests).\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided, or the output would exceed the 8K limit.\n# 401\n# Description: Unauthorized.\n# 402\n# Description: Insufficient credits or quota.\n# Content-Type: application/json\n# 404\n# Description: The source image was not found.\n# 422\n# Description: The prompt did not pass safety checks.\n# 429\n# Description: Too many requests.\n# Content-Type: application/json\n# 500\n# Description: Internal server error.\n# 503\n# Description: The endpoint is temporarily unavailable.", - "Format": "http", - "OperationId": "post_upscale_image_topaz_bloom2", - "Setup": null - }, - { - "Order": 124, - "Title": "Upscale with Topaz Redefine", - "Slug": "post-upscale-image-topaz-redefine", - "Description": "Creatively upscale an image to 2x, 4x, or 8x its original resolution,\nguided by an optional \u0060prompt\u0060 or \u0060autoprompt\u0060. Upload the source\n\u0060image\u0060 using \u0060multipart/form-data\u0060.\nReturns results directly by default; set \u0060async\u0060 or supply a\n\u0060webhook_url\u0060 to get a \u0060generation_id\u0060 and poll\n\u0060GET /v2/generations/{generation_id}\u0060.", - "Language": "http", - "Code": "### Upscale with Topaz Redefine\n# @name post_upscale_image_topaz_redefine\nPOST {{host}}/v2/image/upscale/topaz-redefine?dry_run=false\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image_asset_identifier\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image\u0022; filename=\u0022image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022upscale_factor\u0022\n\nx2\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022creativity\u0022\n\n3\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022autoprompt\u0022\n\nfalse\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022texture\u0022\n\n1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022detail\u0022\n\nfalse\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022detail_strength\u0022\n\n0.0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022sharpen\u0022\n\n0.0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022denoise\u0022\n\n0.0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022face_enhancement\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022face_enhancement_strength\u0022\n\n0.0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022face_enhancement_creativity\u0022\n\n0.0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022subject_detection\u0022\n\nall\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n12345\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022async\u0022\n\nfalse\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022webhook_url\u0022\n\nhttps://api.example.com/webhooks/ideogram\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022private\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022target_collection_id\u0022\n\nstring\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: The upscaled image (synchronous requests), or an acknowledgement to poll with \u0060GET /v2/generations/{generation_id}\u0060 (\u0060async\u0060 requests).\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided, or the output would exceed the 8K limit.\n# 401\n# Description: Unauthorized.\n# 402\n# Description: Insufficient credits or quota.\n# Content-Type: application/json\n# 404\n# Description: The source image was not found.\n# 422\n# Description: The prompt did not pass safety checks.\n# 429\n# Description: Too many requests.\n# Content-Type: application/json\n# 500\n# Description: Internal server error.\n# 503\n# Description: The endpoint is temporarily unavailable.", - "Format": "http", - "OperationId": "post_upscale_image_topaz_redefine", - "Setup": null - }, - { - "Order": 125, - "Title": "Upscale with Topaz Standard V2", - "Slug": "post-upscale-image-topaz-standard-v2", - "Description": "Upscale an image to 2x, 4x, or 8x its original resolution; no prompt is\nneeded. Upload the source \u0060image\u0060 using \u0060multipart/form-data\u0060.\nReturns results directly by default; set \u0060async\u0060 or supply a\n\u0060webhook_url\u0060 to get a \u0060generation_id\u0060 and poll\n\u0060GET /v2/generations/{generation_id}\u0060.", - "Language": "http", - "Code": "### Upscale with Topaz Standard V2\n# @name post_upscale_image_topaz_standard_v2\nPOST {{host}}/v2/image/upscale/topaz-standard-2?dry_run=false\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image_asset_identifier\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image\u0022; filename=\u0022image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022upscale_factor\u0022\n\nx2\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022strength\u0022\n\n0.0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022sharpen\u0022\n\n0.0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022denoise\u0022\n\n0.0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022fix_compression\u0022\n\n0.0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022face_enhancement\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022face_enhancement_strength\u0022\n\n0.0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022face_enhancement_creativity\u0022\n\n0.0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022subject_detection\u0022\n\nall\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022async\u0022\n\nfalse\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022webhook_url\u0022\n\nhttps://api.example.com/webhooks/ideogram\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022private\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022target_collection_id\u0022\n\nstring\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: The upscaled image (synchronous requests), or an acknowledgement to poll with \u0060GET /v2/generations/{generation_id}\u0060 (\u0060async\u0060 requests).\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided, or the output would exceed the 8K limit.\n# 401\n# Description: Unauthorized.\n# 402\n# Description: Insufficient credits or quota.\n# Content-Type: application/json\n# 404\n# Description: The source image was not found.\n# 429\n# Description: Too many requests.\n# Content-Type: application/json\n# 500\n# Description: Internal server error.\n# 503\n# Description: The endpoint is temporarily unavailable.", - "Format": "http", - "OperationId": "post_upscale_image_topaz_standard_v2", - "Setup": null - }, - { - "Order": 126, - "Title": "Upscale with Topaz Text Refine", - "Slug": "post-upscale-image-topaz-text-refine", - "Description": "Upscale an image to 2x, 4x, or 8x its original resolution; no prompt is\nneeded. Upload the source \u0060image\u0060 using \u0060multipart/form-data\u0060.\nReturns results directly by default; set \u0060async\u0060 or supply a\n\u0060webhook_url\u0060 to get a \u0060generation_id\u0060 and poll\n\u0060GET /v2/generations/{generation_id}\u0060.", - "Language": "http", - "Code": "### Upscale with Topaz Text Refine\n# @name post_upscale_image_topaz_text_refine\nPOST {{host}}/v2/image/upscale/topaz-text-refine?dry_run=false\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image_asset_identifier\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image\u0022; filename=\u0022image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022upscale_factor\u0022\n\nx2\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022strength\u0022\n\n0.0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022sharpen\u0022\n\n0.0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022denoise\u0022\n\n0.0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022fix_compression\u0022\n\n0.0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022face_enhancement\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022face_enhancement_strength\u0022\n\n0.0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022face_enhancement_creativity\u0022\n\n0.0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022subject_detection\u0022\n\nall\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n12345\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022async\u0022\n\nfalse\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022webhook_url\u0022\n\nhttps://api.example.com/webhooks/ideogram\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022private\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022target_collection_id\u0022\n\nstring\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: The upscaled image (synchronous requests), or an acknowledgement to poll with \u0060GET /v2/generations/{generation_id}\u0060 (\u0060async\u0060 requests).\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided, or the output would exceed the 8K limit.\n# 401\n# Description: Unauthorized.\n# 402\n# Description: Insufficient credits or quota.\n# Content-Type: application/json\n# 404\n# Description: The source image was not found.\n# 429\n# Description: Too many requests.\n# Content-Type: application/json\n# 500\n# Description: Internal server error.\n# 503\n# Description: The endpoint is temporarily unavailable.", - "Format": "http", - "OperationId": "post_upscale_image_topaz_text_refine", - "Setup": null - }, - { - "Order": 127, - "Title": "Upscale with Topaz Wonder 3.5", - "Slug": "post-upscale-image-topaz-wonder35", - "Description": "Upscale an image to 2x, 4x, or 8x its original resolution, with\n\u0060enhancement_strength\u0060 controlling how strongly detail is reconstructed.\nUpload the source \u0060image\u0060 using \u0060multipart/form-data\u0060.\nReturns results directly by default; set \u0060async\u0060 or supply a\n\u0060webhook_url\u0060 to get a \u0060generation_id\u0060 and poll\n\u0060GET /v2/generations/{generation_id}\u0060.", - "Language": "http", - "Code": "### Upscale with Topaz Wonder 3.5\n# @name post_upscale_image_topaz_wonder35\nPOST {{host}}/v2/image/upscale/topaz-wonder-3-5?dry_run=false\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image_asset_identifier\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image\u0022; filename=\u0022image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022upscale_factor\u0022\n\nx2\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022enhancement_strength\u0022\n\nhigh\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n12345\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022async\u0022\n\nfalse\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022webhook_url\u0022\n\nhttps://api.example.com/webhooks/ideogram\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022private\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022target_collection_id\u0022\n\nstring\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: The upscaled image (synchronous requests), or an acknowledgement to poll with \u0060GET /v2/generations/{generation_id}\u0060 (\u0060async\u0060 requests).\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided, or the output would exceed the 8K limit.\n# 401\n# Description: Unauthorized.\n# 402\n# Description: Insufficient credits or quota.\n# Content-Type: application/json\n# 404\n# Description: The source image was not found.\n# 429\n# Description: Too many requests.\n# Content-Type: application/json\n# 500\n# Description: Internal server error.\n# 503\n# Description: The endpoint is temporarily unavailable.", - "Format": "http", - "OperationId": "post_upscale_image_topaz_wonder35", - "Setup": null - }, - { - "Order": 128, - "Title": "Fetch the media bytes for an integration asset", - "Slug": "get-integration-asset-delivery", - "Description": "Redeems the short-lived signed delivery reference returned by an integration asset search and streams the asset\u0027s media bytes. The signed reference is the sole authorization for this endpoint; it is rejected once it expires or when the integration it names has changed.", - "Language": "http", - "Code": "### Fetch the media bytes for an integration asset\n# @name get_integration_asset_delivery\nGET {{host}}/integration-assets/{{external_ref}}\nAuthorization: Bearer {{token}}\nAccept: application/json, application/octet-stream\n\n## Responses\n# 200\n# Description: The asset\u0027s media bytes. The Content-Type header carries the asset\u0027s media type, and the response is never cacheable by shared caches.\n# Content-Type: application/octet-stream\n# 404\n# Description: The delivery reference is invalid or has expired.\n# Content-Type: application/json\n# 409\n# Description: The referenced integration changed after the search.\n# Content-Type: application/json\n# 503\n# Description: Integration delivery is not available.\n# Content-Type: application/json", - "Format": "http", - "OperationId": "get_integration_asset_delivery", - "Setup": null - }, - { - "Order": 129, - "Title": "List enabled integration types", - "Slug": "get-integrations", - "Description": "Lists the distinct integration types enabled for the authenticated organization. The response does not expose configured integration rows, provider details, configuration, or credentials.", - "Language": "csharp", - "Code": "using var client = new IdeogramClient(apiKey);\nvar response = await client.Integrations.GetIntegrationsAsync();\n\n// Example response:\n// {\n// \u0022integration_types\u0022: [\n// null,\n// null\n// ]\n// }", - "Format": "sdk", - "OperationId": "get_integrations", - "Setup": "This example assumes \u0060using Ideogram;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." - }, - { - "Order": 130, - "Title": "Search assets from an enabled integration type", - "Slug": "post-integration-assets-search", - "Description": "Generated from OpenAPI examples.", - "Language": "csharp", - "Code": "using var client = new IdeogramClient(apiKey);\n\nvar request = global::System.Text.Json.JsonSerializer.Deserialize\u003Cglobal::Ideogram.IntegrationAssetSearchRequest\u003E(\n @\u0022{\n \u0022\u0022query\u0022\u0022: \u0022\u0022query\u0022\u0022,\n \u0022\u0022limit\u0022\u0022: 1\n}\u0022)!;\n\nvar response = await client.Integrations.PostIntegrationAssetsSearchAsync(\n integrationType: global::Ideogram.IntegrationType.DigitalAssetManagement,\n request: request\n);\n\n// Example response:\n// {\n// \u0022assets\u0022: [\n// {\n// \u0022delivery\u0022: \u0022\u0022,\n// \u0022metadata\u0022: {\n// \u0022key\u0022: \u0022metadata\u0022\n// },\n// \u0022media_type\u0022: \u0022media_type\u0022,\n// \u0022external_ref\u0022: \u0022external_ref\u0022,\n// \u0022width\u0022: 1,\n// \u0022label\u0022: \u0022label\u0022,\n// \u0022height\u0022: 1\n// },\n// {\n// \u0022delivery\u0022: \u0022\u0022,\n// \u0022metadata\u0022: {\n// \u0022key\u0022: \u0022metadata\u0022\n// },\n// \u0022media_type\u0022: \u0022media_type\u0022,\n// \u0022external_ref\u0022: \u0022external_ref\u0022,\n// \u0022width\u0022: 1,\n// \u0022label\u0022: \u0022label\u0022,\n// \u0022height\u0022: 1\n// }\n// ]\n// }", - "Format": "sdk", - "OperationId": "post_integration_assets_search", - "Setup": "This example assumes \u0060using Ideogram;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." - }, - { - "Order": 131, - "Title": "Testing", - "Slug": "post-internal-testing", - "Description": "Just a testing endpoint", - "Language": "http", - "Code": "### Testing\n# @name post_internal_testing\nPOST {{host}}/internal-testing\nAuthorization: Bearer {{token}}\nX-Test-Header: {{X-Test-Header}}\nX-Test-Header-2: {{X-Test-Header-2}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022x_position\u0022\n\n0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image_file\u0022; filename=\u0022image_file.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./image_file.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022another_image_file\u0022; filename=\u0022another_image_file.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./another_image_file.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022some_text\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022nested_object\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022nested_object_required_fields\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022date_type_field\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022required_date_type_field\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022date_time_type_field\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022repeated_primitive_field\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022repeated_complex_field\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022enum_type_field\u0022\n\nEIN\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Success\n# Content-Type: application/json", - "Format": "http", - "OperationId": "post_internal_testing", - "Setup": null - }, - { - "Order": 132, - "Title": "Add members to a specific organization", - "Slug": "add-organization-members", - "Description": "Generated from OpenAPI examples.", - "Language": "http", - "Code": "### Add members to a specific organization\n# @name add_organization_members\nPOST {{host}}/manage/api/organization/add_members?organization_id={{organization_id}}\nAuthorization: Bearer {{token}}\nContent-Type: application/json\nAccept: application/json\n\n{\n \u0022members\u0022: [\n {\n \u0022display_handle\u0022: \u0022john_doe\u0022,\n \u0022email_address\u0022: \u0022john.doe@example.com\u0022,\n \u0022user_id\u0022: \u0022dXNlcl8xMjM\u0022\n },\n {\n \u0022display_handle\u0022: \u0022john_doe\u0022,\n \u0022email_address\u0022: \u0022john.doe@example.com\u0022,\n \u0022user_id\u0022: \u0022dXNlcl8xMjM\u0022\n }\n ]\n}\n\n## Responses\n# 200\n# Description: Results of adding members to the organization\n# Content-Type: application/json\n# 400\n# Description: Bad Request\n# 401\n# Description: Not authorized\n# 403\n# Description: Not authorized - must be an organization owner\n# 404\n# Description: Organization not found", - "Format": "http", - "OperationId": "add_organization_members", - "Setup": null - }, - { - "Order": 133, - "Title": "Cancel a pending invite for an organization", - "Slug": "cancel-organization-invite", - "Description": "Generated from OpenAPI examples.", - "Language": "http", - "Code": "### Cancel a pending invite for an organization\n# @name cancel_organization_invite\nPOST {{host}}/manage/api/organization/cancel_invite?organization_id={{organization_id}}\nAuthorization: Bearer {{token}}\nContent-Type: application/json\nAccept: application/json\n\n{\n \u0022invite_id\u0022: \u0022invite_id\u0022\n}\n\n## Responses\n# 200\n# Description: Result of cancelling the invite\n# Content-Type: application/json\n# 400\n# Description: Bad Request\n# 401\n# Description: Not authorized\n# 403\n# Description: Not authorized - must be an organization owner or admin\n# 404\n# Description: Organization or invite not found", - "Format": "http", - "OperationId": "cancel_organization_invite", - "Setup": null - }, - { - "Order": 134, - "Title": "Creates an API key.", - "Slug": "create-api-key", - "Description": "Generated from OpenAPI examples.", - "Language": "csharp", - "Code": "using var client = new IdeogramClient(apiKey);\n\nvar request = global::System.Text.Json.JsonSerializer.Deserialize\u003Cglobal::Ideogram.CreateApiKeyRequest\u003E(\n @\u0022{\n \u0022\u0022label\u0022\u0022: \u0022\u0022label\u0022\u0022\n}\u0022)!;\n\nvar response = await client.Manage.CreateApiKeyAsync(\n request: request\n);\n\n// Example response:\n// {\n// \u0022api_key\u0022: \u0022example_api_key_replace_with_your_actual_key\u0022,\n// \u0022api_key_id\u0022: \u0022JRPVD7jWR1aTBYiJ0UFVOg==\u0022\n// }", - "Format": "sdk", - "OperationId": "create_api_key", - "Setup": "This example assumes \u0060using Ideogram;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." - }, - { - "Order": 135, - "Title": "Create an API key for a specific organization", - "Slug": "create-api-key-v2", - "Description": "Generated from OpenAPI examples.", - "Language": "http", - "Code": "### Create an API key for a specific organization\n# @name create_api_key_v2\nPOST {{host}}/manage/api/api_keys_v2?organization_id={{organization_id}}\nAuthorization: Bearer {{token}}\nContent-Type: application/json\nAccept: application/json\n\n{\n \u0022label\u0022: \u0022label\u0022\n}\n\n## Responses\n# 200\n# Description: API key created successfully\n# Content-Type: application/json\n# 401\n# Description: Not authorized\n# 402\n# Description: Payment is required before creating an API key.\n# 403\n# Description: Not authorized", - "Format": "http", - "OperationId": "create_api_key_v2", - "Setup": null - }, - { - "Order": 136, - "Title": "Create a payment setup session for inline card collection.", - "Slug": "create-api-payment", - "Description": "Returns a client_secret for the org\u0027s payment customer so the inline payment\nmodal can save a card without leaving the app.\n\nSoft-deprecated: the inline Elements flow was removed in the Stripe.js\neager-bundle incident (2026-05-20). New clients should use the\nstripe_payment_setup_url field on ManageApiStripeSubscriptionResponse, which\nreturns a hosted Stripe Checkout URL instead. This endpoint will be formally\ndeprecated and then removed once no callers reference it.", - "Language": "http", - "Code": "### Create a payment setup session for inline card collection.\n# @name create_api_payment\nPOST {{host}}/manage/api/payment?organization_id={{organization_id}}\nAuthorization: Bearer {{token}}\nAccept: application/json\n\n## Responses\n# 200\n# Description: client_secret for inline card collection.\n# Content-Type: application/json\n# 401\n# Description: Not authorized\n# 403\n# Description: Not authorized", - "Format": "http", - "OperationId": "create_api_payment", - "Setup": null - }, - { - "Order": 137, - "Title": "Delete an API key.", - "Slug": "delete-single-api-key", - "Description": "Generated from OpenAPI examples.", - "Language": "csharp", - "Code": "using var client = new IdeogramClient(apiKey);\n\nawait client.Manage.DeleteSingleApiKeyAsync(\n apiKeyId: \u0022d7abd0cd4ae94db78676e986a4ebd8dc\u0022\n);", - "Format": "sdk", - "OperationId": "delete_single_api_key", - "Setup": "This example assumes \u0060using Ideogram;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." - }, - { - "Order": 138, - "Title": "Demote admins back to member role in an ENTERPRISE_PREPAID or ENTERPRISE_API organization", - "Slug": "demote-organization-admins", - "Description": "Generated from OpenAPI examples.", - "Language": "http", - "Code": "### Demote admins back to member role in an ENTERPRISE_PREPAID or ENTERPRISE_API organization\n# @name demote_organization_admins\nPOST {{host}}/manage/api/organization/demote_admins?organization_id={{organization_id}}\nAuthorization: Bearer {{token}}\nContent-Type: application/json\nAccept: application/json\n\n{\n \u0022members\u0022: [\n {\n \u0022display_handle\u0022: \u0022john_doe\u0022,\n \u0022email_address\u0022: \u0022john.doe@example.com\u0022,\n \u0022user_id\u0022: \u0022dXNlcl8xMjM\u0022\n },\n {\n \u0022display_handle\u0022: \u0022john_doe\u0022,\n \u0022email_address\u0022: \u0022john.doe@example.com\u0022,\n \u0022user_id\u0022: \u0022dXNlcl8xMjM\u0022\n }\n ]\n}\n\n## Responses\n# 200\n# Description: Results of demoting admins\n# Content-Type: application/json\n# 400\n# Description: Bad Request\n# 401\n# Description: Not authorized\n# 403\n# Description: Not authorized - must be an organization owner\n# 404\n# Description: Organization not found", - "Format": "http", - "OperationId": "demote_organization_admins", - "Setup": null - }, - { - "Order": 139, - "Title": "Lifetime credit totals for the API user\u0027s account.", - "Slug": "get-api-credit-summary", - "Description": "Returns the lifetime credit KPIs (consumed, expired, issued) used to\nrender the API credit dashboard strip. All values default to $0 when\nMetronome is unavailable so the FE can always render.", - "Language": "http", - "Code": "### Lifetime credit totals for the API user\u0027s account.\n# @name get_api_credit_summary\nGET {{host}}/manage/api/credit_summary?organization_id={{organization_id}}\nAuthorization: Bearer {{token}}\nAccept: application/json\n\n## Responses\n# 200\n# Description: API credit summary content\n# Content-Type: application/json\n# 401\n# Description: Not authorized\n# 403\n# Description: Not authorized", - "Format": "http", - "OperationId": "get_api_credit_summary", - "Setup": null - }, - { - "Order": 140, - "Title": "Retrieve current API keys and their respective data.", - "Slug": "get-api-keys", - "Description": "Generated from OpenAPI examples.", - "Language": "csharp", - "Code": "using var client = new IdeogramClient(apiKey);\nvar response = await client.Manage.GetApiKeysAsync();\n\n// Example response:\n// {\n// \u0022current_api_keys\u0022: [\n// {\n// \u0022creation_time\u0022: \u00222000-01-23T04:56:07\\u002B00:00\u0022,\n// \u0022redacted_api_key\u0022: \u0022vkpDja\u0022,\n// \u0022api_key_id\u0022: \u0022JRPVD7jWR1aTBYiJ0UFVOg==\u0022\n// },\n// {\n// \u0022creation_time\u0022: \u00222000-01-23T04:56:07\\u002B00:00\u0022,\n// \u0022redacted_api_key\u0022: \u0022vkpDja\u0022,\n// \u0022api_key_id\u0022: \u0022JRPVD7jWR1aTBYiJ0UFVOg==\u0022\n// }\n// ]\n// }", - "Format": "sdk", - "OperationId": "get_api_keys", - "Setup": "This example assumes \u0060using Ideogram;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." - }, - { - "Order": 141, - "Title": "Retrieve API keys for a specific organization", - "Slug": "get-api-keys-v2", - "Description": "Generated from OpenAPI examples.", - "Language": "http", - "Code": "### Retrieve API keys for a specific organization\n# @name get_api_keys_v2\nGET {{host}}/manage/api/organization/api_keys?organization_id={{organization_id}}\nAuthorization: Bearer {{token}}\nAccept: application/json\n\n## Responses\n# 200\n# Description: API keys retrieved successfully\n# Content-Type: application/json\n# 401\n# Description: Not authorized\n# 403\n# Description: Not authorized\n# 404\n# Description: Organization not found", - "Format": "http", - "OperationId": "get_api_keys_v2", - "Setup": null - }, - { - "Order": 142, - "Title": "Get search results for user handles with suggestions for a particular organization.", - "Slug": "get-api-organization-user-suggestions", - "Description": "Generated from OpenAPI examples.", - "Language": "http", - "Code": "### Get search results for user handles with suggestions for a particular organization.\n# @name get_api_organization_user_suggestions\nGET {{host}}/manage/api/organization/user_suggestions?organization_id={{organization_id}}\u0026user_handle_prefix=sar\u0026maxItems=3\nAuthorization: Bearer {{token}}\nAccept: application/json\n\n## Responses\n# 200\n# Description: A list of the top responses in alphabetical order by user handle \u002B whether the user has joined the current organization already.\n# Content-Type: application/json\n# 401\n# Description: Not authorized\n# 403\n# Description: Not authorized\n# 404\n# Description: Organization not found", - "Format": "http", - "OperationId": "get_api_organization_user_suggestions", - "Setup": null - }, - { - "Order": 143, - "Title": "Retrieve the user\u0027s current API profiles", - "Slug": "get-api-profiles", - "Description": "Generated from OpenAPI examples.", - "Language": "csharp", - "Code": "using var client = new IdeogramClient(apiKey);\nvar response = await client.Manage.GetApiProfilesAsync();\n\n// Example response:\n// {\n// \u0022profiles\u0022: [\n// {\n// \u0022is_metronome_2_user\u0022: true,\n// \u0022copyright_detection_enabled\u0022: true,\n// \u0022role\u0022: \u0022OWNER\u0022,\n// \u0022avatar_url\u0022: \u0022https://example.com/avatar.jpg\u0022,\n// \u0022organization_id\u0022: \u0022b3JnYW5pemF0aW9uXzEyMw\u0022,\n// \u0022name\u0022: \u0022Gamma\u0022,\n// \u0022type\u0022: \u0022INDIVIDUAL\u0022,\n// \u0022api_keys\u0022: [\n// {\n// \u0022creation_time\u0022: \u00222000-01-23T04:56:07\\u002B00:00\u0022,\n// \u0022label\u0022: \u0022Live production environment\u0022,\n// \u0022redacted_api_key\u0022: \u0022ATG56\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\u0022,\n// \u0022api_key_id\u0022: \u0022JRPVD7jWR1aTBYiJ0UFVOg\u0022,\n// \u0022creator_display_label\u0022: \u0022John Doe\u0022,\n// \u0022status\u0022: null\n// },\n// {\n// \u0022creation_time\u0022: \u00222000-01-23T04:56:07\\u002B00:00\u0022,\n// \u0022label\u0022: \u0022Live production environment\u0022,\n// \u0022redacted_api_key\u0022: \u0022ATG56\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\u0022,\n// \u0022api_key_id\u0022: \u0022JRPVD7jWR1aTBYiJ0UFVOg\u0022,\n// \u0022creator_display_label\u0022: \u0022John Doe\u0022,\n// \u0022status\u0022: null\n// }\n// ],\n// \u0022max_num_inflight_requests_permitted\u0022: 10\n// },\n// {\n// \u0022is_metronome_2_user\u0022: true,\n// \u0022copyright_detection_enabled\u0022: true,\n// \u0022role\u0022: \u0022OWNER\u0022,\n// \u0022avatar_url\u0022: \u0022https://example.com/avatar.jpg\u0022,\n// \u0022organization_id\u0022: \u0022b3JnYW5pemF0aW9uXzEyMw\u0022,\n// \u0022name\u0022: \u0022Gamma\u0022,\n// \u0022type\u0022: \u0022INDIVIDUAL\u0022,\n// \u0022api_keys\u0022: [\n// {\n// \u0022creation_time\u0022: \u00222000-01-23T04:56:07\\u002B00:00\u0022,\n// \u0022label\u0022: \u0022Live production environment\u0022,\n// \u0022redacted_api_key\u0022: \u0022ATG56\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\u0022,\n// \u0022api_key_id\u0022: \u0022JRPVD7jWR1aTBYiJ0UFVOg\u0022,\n// \u0022creator_display_label\u0022: \u0022John Doe\u0022,\n// \u0022status\u0022: null\n// },\n// {\n// \u0022creation_time\u0022: \u00222000-01-23T04:56:07\\u002B00:00\u0022,\n// \u0022label\u0022: \u0022Live production environment\u0022,\n// \u0022redacted_api_key\u0022: \u0022ATG56\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\u0022,\n// \u0022api_key_id\u0022: \u0022JRPVD7jWR1aTBYiJ0UFVOg\u0022,\n// \u0022creator_display_label\u0022: \u0022John Doe\u0022,\n// \u0022status\u0022: null\n// }\n// ],\n// \u0022max_num_inflight_requests_permitted\u0022: 10\n// }\n// ]\n// }", - "Format": "sdk", - "OperationId": "get_api_profiles", - "Setup": "This example assumes \u0060using Ideogram;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." - }, - { - "Order": 144, - "Title": "Retrieve data relevant to connecting to Stripe.", - "Slug": "get-api-stripe-subscription", - "Description": "Generated from OpenAPI examples.", - "Language": "http", - "Code": "### Retrieve data relevant to connecting to Stripe.\n# @name get_api_stripe_subscription\nGET {{host}}/manage/api/stripe_subscription?organization_id={{organization_id}}\u0026isBusiness={{isBusiness}}\nAuthorization: Bearer {{token}}\nAccept: application/json\n\n## Responses\n# 200\n# Description: API subscription content related to connecting to Stripe\n# Content-Type: application/json\n# 401\n# Description: Not authorized\n# 403\n# Description: Not authorized", - "Format": "http", - "OperationId": "get_api_stripe_subscription", - "Setup": null - }, - { - "Order": 145, - "Title": "Retrieve data relevant to creating an API subscription.", - "Slug": "get-api-subscription", - "Description": "Generated from OpenAPI examples.", - "Language": "http", - "Code": "### Retrieve data relevant to creating an API subscription.\n# @name get_api_subscription\nGET {{host}}/manage/api/subscription?organization_id={{organization_id}}\nAuthorization: Bearer {{token}}\nAccept: application/json\n\n## Responses\n# 200\n# Description: API subscription content\n# Content-Type: application/json\n# 401\n# Description: Not authorized\n# 403\n# Description: Not authorized", - "Format": "http", - "OperationId": "get_api_subscription", - "Setup": null - }, - { - "Order": 146, - "Title": "Retrieve the latest terms of service for API usage.", - "Slug": "get-api-terms", - "Description": "Generated from OpenAPI examples.", - "Language": "csharp", - "Code": "using var client = new IdeogramClient(apiKey);\nvar response = await client.Manage.GetApiTermsAsync();\n\n// Example response:\n// {\n// \u0022has_accepted_terms\u0022: true,\n// \u0022api_terms\u0022: {\n// \u0022terms_url\u0022: \u0022terms_url\u0022,\n// \u0022terms_id\u0022: \u0022terms_id\u0022\n// }\n// }", - "Format": "sdk", - "OperationId": "get_api_terms", - "Setup": "This example assumes \u0060using Ideogram;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." - }, - { - "Order": 147, - "Title": "Retrieve the Stripe billing portal URL for a specific organization", - "Slug": "get-organization-billing-portal", - "Description": "Generated from OpenAPI examples.", - "Language": "http", - "Code": "### Retrieve the Stripe billing portal URL for a specific organization\n# @name get_organization_billing_portal\nGET {{host}}/manage/api/organization/billing_portal?organization_id={{organization_id}}\nAuthorization: Bearer {{token}}\nAccept: application/json\n\n## Responses\n# 200\n# Description: Billing portal URL retrieved successfully\n# Content-Type: application/json\n# 401\n# Description: Not authorized\n# 403\n# Description: Not authorized\n# 404\n# Description: Organization not found", - "Format": "http", - "OperationId": "get_organization_billing_portal", - "Setup": null - }, - { - "Order": 148, - "Title": "Retrieve members of a specific organization", - "Slug": "get-organization-members", - "Description": "Returns both active members and pending invites for the organization. A pending invite is identified by a non-null invite_status (e.g. PENDING); active members have a null invite_status.", - "Language": "http", - "Code": "### Retrieve members of a specific organization\n# @name get_organization_members\nGET {{host}}/manage/api/organization/members?organization_id={{organization_id}}\nAuthorization: Bearer {{token}}\nAccept: application/json\n\n## Responses\n# 200\n# Description: Organization members retrieved successfully\n# Content-Type: application/json\n# 401\n# Description: Not authorized\n# 403\n# Description: Not authorized\n# 404\n# Description: Organization not found", - "Format": "http", - "OperationId": "get_organization_members", - "Setup": null - }, - { - "Order": 149, - "Title": "Retrieve usage information segmented by time period with tool-specific breakdowns", - "Slug": "get-usage-info", - "Description": "Generated from OpenAPI examples.", - "Language": "http", - "Code": "### Retrieve usage information segmented by time period with tool-specific breakdowns\n# @name get_usage_info\nGET {{host}}/manage/api/usage?organization_id={{organization_id}}\u0026segment_by=DAY\u0026start_time={{start_time}}\u0026end_time={{end_time}}\u0026model_versions=[]\u0026tools=[]\u0026api_key_ids=[]\u0026user_emails=[]\u0026source=API\nAuthorization: Bearer {{token}}\nAccept: application/json\n\n## Responses\n# 200\n# Description: Usage information retrieved successfully\n# Content-Type: application/json\n# 401\n# Description: Not authorized\n# 403\n# Description: Not authorized", - "Format": "http", - "OperationId": "get_usage_info", - "Setup": null - }, - { - "Order": 150, - "Title": "Retrieve user credit information and spending metrics", - "Slug": "get-user-credits", - "Description": "Generated from OpenAPI examples.", - "Language": "http", - "Code": "### Retrieve user credit information and spending metrics\n# @name get_user_credits\nGET {{host}}/manage/api/credits?organization_id={{organization_id}}\u0026start_time={{start_time}}\u0026end_time={{end_time}}\nAuthorization: Bearer {{token}}\nAccept: application/json\n\n## Responses\n# 200\n# Description: User credit information retrieved successfully\n# Content-Type: application/json\n# 401\n# Description: Not authorized\n# 403\n# Description: Not authorized", - "Format": "http", - "OperationId": "get_user_credits", - "Setup": null - }, - { - "Order": 151, - "Title": "Retrieve user spend commit information", - "Slug": "get-user-spend-commit-info", - "Description": "Generated from OpenAPI examples.", - "Language": "http", - "Code": "### Retrieve user spend commit information\n# @name get_user_spend_commit_info\nGET {{host}}/manage/api/spend_commit?organization_id={{organization_id}}\u0026postpaid_only={{postpaid_only}}\nAuthorization: Bearer {{token}}\nAccept: application/json\n\n## Responses\n# 200\n# Description: User spend commit information retrieved successfully\n# Content-Type: application/json\n# 401\n# Description: Not authorized\n# 403\n# Description: Not authorized", - "Format": "http", - "OperationId": "get_user_spend_commit_info", - "Setup": null - }, - { - "Order": 152, - "Title": "Retrieve invoices for a specific organization", - "Slug": "list-organization-invoices", - "Description": "Generated from OpenAPI examples.", - "Language": "http", - "Code": "### Retrieve invoices for a specific organization\n# @name list_organization_invoices\nGET {{host}}/manage/api/organization/list_invoices?organization_id={{organization_id}}\nAuthorization: Bearer {{token}}\nAccept: application/json\n\n## Responses\n# 200\n# Description: Invoices retrieved successfully\n# Content-Type: application/json\n# 401\n# Description: Not authorized\n# 403\n# Description: Not authorized\n# 404\n# Description: Organization not found", - "Format": "http", - "OperationId": "list_organization_invoices", - "Setup": null - }, - { - "Order": 153, - "Title": "Add credits to an API user\u0027s account.", - "Slug": "post-add-credits-for-api", - "Description": "Generated from OpenAPI examples.", - "Language": "http", - "Code": "### Add credits to an API user\u0027s account.\n# @name post_add_credits_for_api\nPOST {{host}}/manage/api/add_credits?organization_id={{organization_id}}\nAuthorization: Bearer {{token}}\nContent-Type: application/json\nAccept: application/json\n\n{\n \u0022amount\u0022: {\n \u0022amount\u0022: 1050,\n \u0022currency_code\u0022: \u0022USD\u0022\n }\n}\n\n## Responses\n# 200\n# Description: API subscription content\n# Content-Type: application/json\n# 400\n# Description: Bad request\n# Content-Type: application/json\n# 401\n# Description: Not authorized\n# 403\n# Description: Not authorized", - "Format": "http", - "OperationId": "post_add_credits_for_api", - "Setup": null - }, - { - "Order": 154, - "Title": "Update API subscription settings", - "Slug": "post-api-subscription", - "Description": "Generated from OpenAPI examples.", - "Language": "http", - "Code": "### Update API subscription settings\n# @name post_api_subscription\nPOST {{host}}/manage/api/subscription?organization_id={{organization_id}}\nAuthorization: Bearer {{token}}\nContent-Type: application/json\nAccept: application/json\n\n{\n \u0022recharge_settings\u0022: {\n \u0022minimum_balance_threshold\u0022: {\n \u0022amount\u0022: 1050,\n \u0022currency_code\u0022: \u0022USD\u0022\n },\n \u0022top_up_balance\u0022: {\n \u0022amount\u0022: 1050,\n \u0022currency_code\u0022: \u0022USD\u0022\n }\n },\n \u0022is_active\u0022: true\n}\n\n## Responses\n# 200\n# Description: API subscription content\n# Content-Type: application/json\n# 400\n# Description: Bad request\n# Content-Type: application/json\n# 401\n# Description: Not authorized\n# 403\n# Description: Not authorized", - "Format": "http", - "OperationId": "post_api_subscription", - "Setup": null - }, - { - "Order": 155, - "Title": "Accept terms", - "Slug": "post-api-terms", - "Description": "Generated from OpenAPI examples.", - "Language": "csharp", - "Code": "using var client = new IdeogramClient(apiKey);\n\nvar request = global::System.Text.Json.JsonSerializer.Deserialize\u003Cglobal::Ideogram.PostApiTermsRequest\u003E(\n @\u0022{\n \u0022\u0022terms_id\u0022\u0022: \u0022\u0022TOS_2024_04_20\u0022\u0022\n}\u0022)!;\n\nawait client.Manage.PostApiTermsAsync(\n request: request\n);", - "Format": "sdk", - "OperationId": "post_api_terms", - "Setup": "This example assumes \u0060using Ideogram;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." - }, - { - "Order": 156, - "Title": "Promote members to ADMIN role in an ENTERPRISE_PREPAID or ENTERPRISE_API organization", - "Slug": "promote-organization-admins", - "Description": "Generated from OpenAPI examples.", - "Language": "http", - "Code": "### Promote members to ADMIN role in an ENTERPRISE_PREPAID or ENTERPRISE_API organization\n# @name promote_organization_admins\nPOST {{host}}/manage/api/organization/promote_admins?organization_id={{organization_id}}\nAuthorization: Bearer {{token}}\nContent-Type: application/json\nAccept: application/json\n\n{\n \u0022members\u0022: [\n {\n \u0022display_handle\u0022: \u0022john_doe\u0022,\n \u0022email_address\u0022: \u0022john.doe@example.com\u0022,\n \u0022user_id\u0022: \u0022dXNlcl8xMjM\u0022\n },\n {\n \u0022display_handle\u0022: \u0022john_doe\u0022,\n \u0022email_address\u0022: \u0022john.doe@example.com\u0022,\n \u0022user_id\u0022: \u0022dXNlcl8xMjM\u0022\n }\n ]\n}\n\n## Responses\n# 200\n# Description: Results of promoting members to admin\n# Content-Type: application/json\n# 400\n# Description: Bad Request\n# 401\n# Description: Not authorized\n# 403\n# Description: Not authorized - must be an organization owner or admin\n# 404\n# Description: Organization not found", - "Format": "http", - "OperationId": "promote_organization_admins", - "Setup": null - }, - { - "Order": 157, - "Title": "Remove members from a specific organization", - "Slug": "remove-organization-members", - "Description": "Generated from OpenAPI examples.", - "Language": "http", - "Code": "### Remove members from a specific organization\n# @name remove_organization_members\nPOST {{host}}/manage/api/organization/remove_members?organization_id={{organization_id}}\nAuthorization: Bearer {{token}}\nContent-Type: application/json\nAccept: application/json\n\n{\n \u0022members\u0022: [\n {\n \u0022display_handle\u0022: \u0022john_doe\u0022,\n \u0022email_address\u0022: \u0022john.doe@example.com\u0022,\n \u0022user_id\u0022: \u0022dXNlcl8xMjM\u0022\n },\n {\n \u0022display_handle\u0022: \u0022john_doe\u0022,\n \u0022email_address\u0022: \u0022john.doe@example.com\u0022,\n \u0022user_id\u0022: \u0022dXNlcl8xMjM\u0022\n }\n ]\n}\n\n## Responses\n# 200\n# Description: Results of removing members from the organization\n# Content-Type: application/json\n# 400\n# Description: Bad Request\n# 401\n# Description: Not authorized\n# 403\n# Description: Not authorized - must be an organization owner\n# 404\n# Description: Organization not found", - "Format": "http", - "OperationId": "remove_organization_members", - "Setup": null - }, - { - "Order": 158, - "Title": "Resend a pending invite for an organization", - "Slug": "resend-organization-invite", - "Description": "Generated from OpenAPI examples.", - "Language": "http", - "Code": "### Resend a pending invite for an organization\n# @name resend_organization_invite\nPOST {{host}}/manage/api/organization/resend_invite?organization_id={{organization_id}}\nAuthorization: Bearer {{token}}\nContent-Type: application/json\nAccept: application/json\n\n{\n \u0022invite_id\u0022: \u0022invite_id\u0022\n}\n\n## Responses\n# 200\n# Description: Result of resending the invite\n# Content-Type: application/json\n# 400\n# Description: Bad Request\n# 401\n# Description: Not authorized\n# 403\n# Description: Not authorized - must be an organization owner or admin\n# 404\n# Description: Organization or invite not found", - "Format": "http", - "OperationId": "resend_organization_invite", - "Setup": null - }, - { - "Order": 159, - "Title": "Update a single field on an organization\u0027s API properties.", - "Slug": "update-organization-api-properties", - "Description": "Lets an organization owner toggle API-only settings such as\ncopyright_detection_enabled. Updates only the fields explicitly present\nin the request body; absent fields are left unchanged.", - "Language": "http", - "Code": "### Update a single field on an organization\u0027s API properties.\n# @name update_organization_api_properties\nPATCH {{host}}/manage/api/organization/{{organization_id}}/api_properties\nAuthorization: Bearer {{token}}\nContent-Type: application/json\nAccept: application/json\n\n{\n \u0022copyright_detection_enabled\u0022: true\n}\n\n## Responses\n# 200\n# Description: Updated API properties.\n# Content-Type: application/json\n# 401\n# Description: Not authorized\n# 403\n# Description: Not authorized \u2014 must be an organization owner\n# 404\n# Description: Organization not found", - "Format": "http", - "OperationId": "update_organization_api_properties", - "Setup": null - }, - { - "Order": 160, - "Title": "Update an API key\u0027s user-supplied label.", - "Slug": "update-single-api-key", - "Description": "Generated from OpenAPI examples.", - "Language": "csharp", - "Code": "using var client = new IdeogramClient(apiKey);\n\nvar request = global::System.Text.Json.JsonSerializer.Deserialize\u003Cglobal::Ideogram.PatchApiKeyRequest\u003E(\n @\u0022{\n \u0022\u0022label\u0022\u0022: \u0022\u0022Live production environment\u0022\u0022\n}\u0022)!;\n\nvar response = await client.Manage.UpdateSingleApiKeyAsync(\n apiKeyId: \u0022d7abd0cd4ae94db78676e986a4ebd8dc\u0022,\n request: request\n);\n\n// Example response:\n// {\n// \u0022creation_time\u0022: \u00222000-01-23T04:56:07\\u002B00:00\u0022,\n// \u0022label\u0022: \u0022Live production environment\u0022,\n// \u0022redacted_api_key\u0022: \u0022ATG56\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\\u2022\u0022,\n// \u0022api_key_id\u0022: \u0022JRPVD7jWR1aTBYiJ0UFVOg\u0022,\n// \u0022creator_display_label\u0022: \u0022John Doe\u0022,\n// \u0022status\u0022: null\n// }", - "Format": "sdk", - "OperationId": "update_single_api_key", - "Setup": "This example assumes \u0060using Ideogram;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." - }, - { - "Order": 161, - "Title": "Get stale mini-app preview entries", - "Slug": "get-stale-preview-mini-apps", - "Description": "Returns preview ids whose most recent successful publish is older than the cutoff. This read-only endpoint does not delete preview entries.", - "Language": "http", - "Code": "### Get stale mini-app preview entries\n# @name get_stale_preview_mini_apps\nGET {{host}}/mini-apps/stale-previews?cutoff={{cutoff}}\nAuthorization: Bearer {{token}}\nAccept: application/json\n\n## Responses\n# 200\n# Description: Stale mini-app previews retrieved successfully\n# Content-Type: application/json\n# 400\n# Description: Bad request\n# 401\n# Description: Unauthorized\n# 403\n# Description: Forbidden\n# 503\n# Description: Service unavailable", - "Format": "http", - "OperationId": "get_stale_preview_mini_apps", - "Setup": null - }, - { - "Order": 162, - "Title": "Publish a mini-app catalog entry", - "Slug": "publish-mini-app", - "Description": "Publishes a mini-app\u0027s catalog entry. Called by the mini-apps deploy pipeline after a deploy to register or refresh a single app, keyed by its unique slug. Re-publishing an existing app refreshes the deploy-managed fields (label, description, embed mode, scopes, image-input support, deployment details, and website) while leaving administrator-managed settings and artwork untouched. Artwork from the request is used only when creating a new app.", - "Language": "csharp", - "Code": "using var client = new IdeogramClient(apiKey);\n\nvar request = global::System.Text.Json.JsonSerializer.Deserialize\u003Cglobal::Ideogram.PublishMiniAppRequest\u003E(\n @\u0022{\n \u0022\u0022accepts_image_input\u0022\u0022: true,\n \u0022\u0022deployment_time\u0022\u0022: \u0022\u00222000-01-23T04:56:07\\u002B00:00\u0022\u0022,\n \u0022\u0022website\u0022\u0022: {\n \u0022\u0022key\u0022\u0022: \u0022\u0022\u0022\u0022\n },\n \u0022\u0022deployment_url\u0022\u0022: \u0022\u0022https://openapi-generator.tech\u0022\u0022,\n \u0022\u0022deployment_commit\u0022\u0022: \u0022\u0022deployment_commit\u0022\u0022,\n \u0022\u0022description\u0022\u0022: \u0022\u0022description\u0022\u0022,\n \u0022\u0022label\u0022\u0022: \u0022\u0022label\u0022\u0022,\n \u0022\u0022embed\u0022\u0022: \u0022\u0022iframe\u0022\u0022,\n \u0022\u0022scopes\u0022\u0022: [\n \u0022\u0022scopes\u0022\u0022,\n \u0022\u0022scopes\u0022\u0022\n ],\n \u0022\u0022slug\u0022\u0022: \u0022\u0022slug\u0022\u0022\n}\u0022)!;\n\nvar response = await client.MiniApps.PublishMiniAppAsync(\n request: request\n);\n\n// Example response:\n// {\n// \u0022archived\u0022: true,\n// \u0022mini_app_id\u0022: \u0022mini_app_id\u0022,\n// \u0022requires_membership\u0022: true,\n// \u0022slug\u0022: \u0022slug\u0022\n// }", - "Format": "sdk", - "OperationId": "publish_mini_app", - "Setup": "This example assumes \u0060using Ideogram;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." - }, - { - "Order": 163, - "Title": "Publish a mini-app preview entry", - "Slug": "publish-preview-mini-app", - "Description": "Publishes a mini-app preview entry. Called by the mini-apps preview deploy pipeline to register a throwaway preview deploy, keyed by its unique preview id. Re-publishing an existing preview id refreshes every deploy-managed field. Preview entries are independent from the main catalog: they carry no slug, owner, or membership gating, and anyone with the preview link can access the app.", - "Language": "csharp", - "Code": "using var client = new IdeogramClient(apiKey);\n\nvar request = global::System.Text.Json.JsonSerializer.Deserialize\u003Cglobal::Ideogram.PublishMiniAppPreviewRequest\u003E(\n @\u0022{\n \u0022\u0022accepts_image_input\u0022\u0022: true,\n \u0022\u0022deployment_time\u0022\u0022: \u0022\u00222000-01-23T04:56:07\\u002B00:00\u0022\u0022,\n \u0022\u0022website\u0022\u0022: {\n \u0022\u0022key\u0022\u0022: \u0022\u0022\u0022\u0022\n },\n \u0022\u0022preview_id\u0022\u0022: \u0022\u0022preview_id\u0022\u0022,\n \u0022\u0022deployment_url\u0022\u0022: \u0022\u0022deployment_url\u0022\u0022,\n \u0022\u0022deployment_commit\u0022\u0022: \u0022\u0022deployment_commit\u0022\u0022,\n \u0022\u0022description\u0022\u0022: \u0022\u0022description\u0022\u0022,\n \u0022\u0022label\u0022\u0022: \u0022\u0022label\u0022\u0022,\n \u0022\u0022embed\u0022\u0022: \u0022\u0022iframe\u0022\u0022,\n \u0022\u0022scopes\u0022\u0022: [\n \u0022\u0022scopes\u0022\u0022,\n \u0022\u0022scopes\u0022\u0022\n ],\n \u0022\u0022slug\u0022\u0022: \u0022\u0022slug\u0022\u0022\n}\u0022)!;\n\nvar response = await client.MiniApps.PublishPreviewMiniAppAsync(\n request: request\n);\n\n// Example response:\n// {\n// \u0022preview_id\u0022: \u0022preview_id\u0022\n// }", - "Format": "sdk", - "OperationId": "publish_preview_mini_app", - "Setup": "This example assumes \u0060using Ideogram;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." - }, - { - "Order": 164, - "Title": "Unpublish a mini-app preview entry", - "Slug": "unpublish-preview-mini-app", - "Description": "Deletes a mini-app preview entry by its preview id. Repeated requests succeed when the entry is already absent, so preview teardown can retry safely.", - "Language": "http", - "Code": "### Unpublish a mini-app preview entry\n# @name unpublish_preview_mini_app\nPOST {{host}}/mini-apps/unpublish-preview/{{preview_id}}\nAuthorization: Bearer {{token}}\nAccept: application/json\n\n## Responses\n# 200\n# Description: Mini-app preview unpublished successfully\n# Content-Type: application/json\n# 400\n# Description: Bad request\n# 401\n# Description: Unauthorized\n# 403\n# Description: Forbidden", - "Format": "http", - "OperationId": "unpublish_preview_mini_app", - "Setup": null - }, - { - "Order": 165, - "Title": "Get model details", - "Slug": "get-custom-model", - "Description": "Get detailed information about a specific custom model. The user must either own the model or the model must be shared with the user\u0027s organization via the model registry. Returns 404 if the model is not found or not accessible.", - "Language": "http", - "Code": "### Get model details\n# @name get_custom_model\nGET {{host}}/models/{{model_id}}\nAuthorization: Bearer {{token}}\nAccept: application/json\n\n## Responses\n# 200\n# Description: Model retrieved successfully\n# Content-Type: application/json\n# 401\n# Description: Unauthorized\n# 404\n# Description: Model not found", - "Format": "http", - "OperationId": "get_custom_model", - "Setup": null - }, - { - "Order": 166, - "Title": "List models", - "Slug": "list-custom-models", - "Description": "Lists custom models for the authenticated user. Use the \u0060scope\u0060 parameter to control which models are returned. If omitted, returns both owned models and models shared with the user\u0027s organization via the model registry. \u0060owned\u0060 returns only models created by the user. \u0060shared\u0060 returns only models shared via the model registry, excluding the user\u0027s own models.", - "Language": "csharp", - "Code": "using var client = new IdeogramClient(apiKey);\nvar response = await client.Models.ListCustomModelsAsync();\n\n// Example response:\n// {\n// \u0022models\u0022: [\n// {\n// \u0022creation_time\u0022: \u00222000-01-23T04:56:07\\u002B00:00\u0022,\n// \u0022last_update_time\u0022: \u00222000-01-23T04:56:07\\u002B00:00\u0022,\n// \u0022is_available_for_generation\u0022: true,\n// \u0022dataset_id\u0022: \u0022dataset_id\u0022,\n// \u0022name\u0022: \u0022name\u0022,\n// \u0022is_owned\u0022: true,\n// \u0022training_runs\u0022: [\n// {\n// \u0022creation_time\u0022: \u00222000-01-23T04:56:07\\u002B00:00\u0022,\n// \u0022last_update_time\u0022: \u00222000-01-23T04:56:07\\u002B00:00\u0022,\n// \u0022lora_rank\u0022: 6,\n// \u0022num_chips\u0022: 1,\n// \u0022training_run_id\u0022: \u0022training_run_id\u0022,\n// \u0022ema\u0022: 5.962133916683182,\n// \u0022training_steps\u0022: 0,\n// \u0022learning_rate\u0022: 5.637376656633329,\n// \u0022status\u0022: null\n// },\n// {\n// \u0022creation_time\u0022: \u00222000-01-23T04:56:07\\u002B00:00\u0022,\n// \u0022last_update_time\u0022: \u00222000-01-23T04:56:07\\u002B00:00\u0022,\n// \u0022lora_rank\u0022: 6,\n// \u0022num_chips\u0022: 1,\n// \u0022training_run_id\u0022: \u0022training_run_id\u0022,\n// \u0022ema\u0022: 5.962133916683182,\n// \u0022training_steps\u0022: 0,\n// \u0022learning_rate\u0022: 5.637376656633329,\n// \u0022status\u0022: null\n// }\n// ],\n// \u0022model_id\u0022: \u0022model_id\u0022,\n// \u0022custom_model_uri\u0022: \u0022model/my-custom-model/version/1\u0022,\n// \u0022status\u0022: null\n// },\n// {\n// \u0022creation_time\u0022: \u00222000-01-23T04:56:07\\u002B00:00\u0022,\n// \u0022last_update_time\u0022: \u00222000-01-23T04:56:07\\u002B00:00\u0022,\n// \u0022is_available_for_generation\u0022: true,\n// \u0022dataset_id\u0022: \u0022dataset_id\u0022,\n// \u0022name\u0022: \u0022name\u0022,\n// \u0022is_owned\u0022: true,\n// \u0022training_runs\u0022: [\n// {\n// \u0022creation_time\u0022: \u00222000-01-23T04:56:07\\u002B00:00\u0022,\n// \u0022last_update_time\u0022: \u00222000-01-23T04:56:07\\u002B00:00\u0022,\n// \u0022lora_rank\u0022: 6,\n// \u0022num_chips\u0022: 1,\n// \u0022training_run_id\u0022: \u0022training_run_id\u0022,\n// \u0022ema\u0022: 5.962133916683182,\n// \u0022training_steps\u0022: 0,\n// \u0022learning_rate\u0022: 5.637376656633329,\n// \u0022status\u0022: null\n// },\n// {\n// \u0022creation_time\u0022: \u00222000-01-23T04:56:07\\u002B00:00\u0022,\n// \u0022last_update_time\u0022: \u00222000-01-23T04:56:07\\u002B00:00\u0022,\n// \u0022lora_rank\u0022: 6,\n// \u0022num_chips\u0022: 1,\n// \u0022training_run_id\u0022: \u0022training_run_id\u0022,\n// \u0022ema\u0022: 5.962133916683182,\n// \u0022training_steps\u0022: 0,\n// \u0022learning_rate\u0022: 5.637376656633329,\n// \u0022status\u0022: null\n// }\n// ],\n// \u0022model_id\u0022: \u0022model_id\u0022,\n// \u0022custom_model_uri\u0022: \u0022model/my-custom-model/version/1\u0022,\n// \u0022status\u0022: null\n// }\n// ]\n// }", - "Format": "sdk", - "OperationId": "list_custom_models", - "Setup": "This example assumes \u0060using Ideogram;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." - }, - { - "Order": 167, - "Title": "Train a custom Ideogram v3 model", - "Slug": "train-model-v3", - "Description": "Start training a custom Ideogram v3 model from a dataset using default hyperparameters. The dataset must contain at least 15 images and a maximum of 100 images.", - "Language": "csharp", - "Code": "using var client = new IdeogramClient(apiKey);\n\nvar request = global::System.Text.Json.JsonSerializer.Deserialize\u003Cglobal::Ideogram.TrainModelV3Request\u003E(\n @\u0022{\n \u0022\u0022model_name\u0022\u0022: \u0022\u0022my-custom-model\u0022\u0022,\n \u0022\u0022dataset_id\u0022\u0022: \u0022\u0022abc123\u0022\u0022\n}\u0022)!;\n\nvar response = await client.Models.TrainModelV3Async(\n request: request\n);\n\n// Example response:\n// {\n// \u0022training_status\u0022: \u0022training_status\u0022,\n// \u0022model_name\u0022: \u0022model_name\u0022,\n// \u0022dataset_id\u0022: \u0022dataset_id\u0022,\n// \u0022model_id\u0022: \u0022model_id\u0022\n// }", - "Format": "sdk", - "OperationId": "train_model_v3", - "Setup": "This example assumes \u0060using Ideogram;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." - }, - { - "Order": 168, - "Title": "Train a custom Ideogram v3 model with advanced hyperparameters", - "Slug": "train-model-v3-advanced", - "Description": "Start training a custom Ideogram v3 model from a dataset with caller-supplied hyperparameters (training steps, LoRA rank, EMA decay, learning rate). All hyperparameters are optional and fall back to defaults when omitted. The dataset must contain at least 15 images and a maximum of 100 images. Returns the model ID and training status.", - "Language": "csharp", - "Code": "using var client = new IdeogramClient(apiKey);\n\nvar request = global::System.Text.Json.JsonSerializer.Deserialize\u003Cglobal::Ideogram.TrainModelV3AdvancedRequest\u003E(\n @\u0022{\n \u0022\u0022model_name\u0022\u0022: \u0022\u0022my-custom-model\u0022\u0022,\n \u0022\u0022lora_rank\u0022\u0022: 64,\n \u0022\u0022dataset_id\u0022\u0022: \u0022\u0022abc123\u0022\u0022,\n \u0022\u0022ema\u0022\u0022: 0.999,\n \u0022\u0022training_steps\u0022\u0022: 1000,\n \u0022\u0022learning_rate\u0022\u0022: 0.0001\n}\u0022)!;\n\nvar response = await client.Models.TrainModelV3AdvancedAsync(\n request: request\n);\n\n// Example response:\n// {\n// \u0022training_status\u0022: \u0022training_status\u0022,\n// \u0022model_name\u0022: \u0022model_name\u0022,\n// \u0022dataset_id\u0022: \u0022dataset_id\u0022,\n// \u0022model_id\u0022: \u0022model_id\u0022\n// }", - "Format": "sdk", - "OperationId": "train_model_v3_advanced", - "Setup": "This example assumes \u0060using Ideogram;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." - }, - { - "Order": 169, - "Title": "Train a custom Ideogram v4 model", - "Slug": "train-model-v4", - "Description": "Start training a custom Ideogram v4 model from a dataset using default hyperparameters. The dataset must contain at least 15 images and a maximum of 100 images.", - "Language": "csharp", - "Code": "using var client = new IdeogramClient(apiKey);\n\nvar request = global::System.Text.Json.JsonSerializer.Deserialize\u003Cglobal::Ideogram.TrainModelV4Request\u003E(\n @\u0022{\n \u0022\u0022model_name\u0022\u0022: \u0022\u0022my-custom-model\u0022\u0022,\n \u0022\u0022dataset_id\u0022\u0022: \u0022\u0022abc123\u0022\u0022\n}\u0022)!;\n\nvar response = await client.Models.TrainModelV4Async(\n request: request\n);\n\n// Example response:\n// {\n// \u0022training_status\u0022: \u0022training_status\u0022,\n// \u0022model_name\u0022: \u0022model_name\u0022,\n// \u0022dataset_id\u0022: \u0022dataset_id\u0022,\n// \u0022model_id\u0022: \u0022model_id\u0022\n// }", - "Format": "sdk", - "OperationId": "train_model_v4", - "Setup": "This example assumes \u0060using Ideogram;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." - }, - { - "Order": 170, - "Title": "Train a custom Ideogram v4 model with advanced hyperparameters", - "Slug": "train-model-v4-advanced", - "Description": "Start training a custom Ideogram v4 model from a dataset with caller-supplied hyperparameters (training steps, LoRA rank, EMA decay, learning rate). All hyperparameters are optional and fall back to defaults when omitted. The dataset must contain at least 15 images and a maximum of 100 images. Returns the model ID and training status.", - "Language": "csharp", - "Code": "using var client = new IdeogramClient(apiKey);\n\nvar request = global::System.Text.Json.JsonSerializer.Deserialize\u003Cglobal::Ideogram.TrainModelV4AdvancedRequest\u003E(\n @\u0022{\n \u0022\u0022batch_size\u0022\u0022: 8,\n \u0022\u0022wandb_project\u0022\u0022: \u0022\u0022my-wandb-project\u0022\u0022,\n \u0022\u0022model_name\u0022\u0022: \u0022\u0022my-custom-model\u0022\u0022,\n \u0022\u0022lora_rank\u0022\u0022: 64,\n \u0022\u0022base_variant\u0022\u0022: \u0022\u0022distilled_gd\u0022\u0022,\n \u0022\u0022dataset_id\u0022\u0022: \u0022\u0022abc123\u0022\u0022,\n \u0022\u0022ema\u0022\u0022: 0.999,\n \u0022\u0022training_steps\u0022\u0022: 1000,\n \u0022\u0022learning_rate\u0022\u0022: 0.0001\n}\u0022)!;\n\nvar response = await client.Models.TrainModelV4AdvancedAsync(\n request: request\n);\n\n// Example response:\n// {\n// \u0022training_status\u0022: \u0022training_status\u0022,\n// \u0022model_name\u0022: \u0022model_name\u0022,\n// \u0022dataset_id\u0022: \u0022dataset_id\u0022,\n// \u0022model_id\u0022: \u0022model_id\u0022\n// }", - "Format": "sdk", - "OperationId": "train_model_v4_advanced", - "Setup": "This example assumes \u0060using Ideogram;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." - }, - { - "Order": 171, - "Title": "Remove an object", - "Slug": "post-remove-object-from-v2-assets", - "Description": "Remove a masked object from an image. Upload the source \u0060image\u0060 and a\n\u0060mask\u0060 of the same size using \u0060multipart/form-data\u0060. Returns a\n\u0060generation_id\u0060; poll \u0060GET /v2/generations/{generation_id}\u0060 for the\nresult.", - "Language": "http", - "Code": "### Remove an object\n# @name post_remove_object_from_v2_assets\nPOST {{host}}/v2/image/remove-object/ideogram-1?dry_run=false\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image_asset_identifier\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image\u0022; filename=\u0022image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022mask_asset_identifier\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022mask\u0022; filename=\u0022mask.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./mask.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n12345\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022target_collection_id\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022store_assets\u0022\n\nfalse\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Object removal request accepted; poll for completion with \u0060GET /v2/generations/{generation_id}\u0060.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Unauthorized.\n# 402\n# Description: Insufficient credits or quota.\n# Content-Type: application/json\n# 403\n# Description: Not authorized to remove an object.\n# 404\n# Description: The source image or mask was not found.\n# 413\n# Description: An uploaded source or mask image is too large.\n# 429\n# Description: Too many requests.\n# Content-Type: application/json\n# 503\n# Description: The endpoint is temporarily unavailable.", - "Format": "http", - "OperationId": "post_remove_object_from_v2_assets", - "Setup": null - }, - { - "Order": 172, - "Title": "Generate Magic Prompt", - "Slug": "post-magic-prompt", - "Description": "Transforms basic prompts into a magic prompt. Internal use only (feature flagged). TODO: update description if enabled externally.", - "Language": "http", - "Code": "### Generate Magic Prompt\n# @name post_magic_prompt\nPOST {{host}}/magic-prompt\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\na cat\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022magic_prompt_version\u0022\n\nV_0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022classify_prompt_category\u0022\n\nfalse\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022style_type\u0022\n\nGENERAL\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n12345\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022character_reference_images\u0022; filename=\u0022character_reference_images.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./character_reference_images.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022system_prompt\u0022\n\nYou are a helpful assistant that generates magic prompts for images.\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022aspect_ratio\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022temperature\u0022\n\n0.0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022top_p\u0022\n\n0.0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022top_k\u0022\n\n0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022min_p\u0022\n\n0.0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022max_tokens\u0022\n\n0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022presence_penalty\u0022\n\n0.0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022frequency_penalty\u0022\n\n0.0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022repetition_penalty\u0022\n\n0.0\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022checkpoint\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022messages\u0022\n\nstring\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Magic prompt generated successfully.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Not authorized to generate magic prompts.\n# 429\n# Description: Too many requests.\n# 500\n# Description: Internal server error.", - "Format": "http", - "OperationId": "post_magic_prompt", - "Setup": null - }, - { - "Order": 173, - "Title": "Generate a Magic Prompt with Ideogram 4.0", - "Slug": "post-magic-prompt-v4", - "Description": "Transforms a basic prompt into an enhanced Ideogram 4.0 magic prompt.\nThe magic prompt model version is fixed; callers cannot select it.\nWhen \u0060aspect_ratio\u0060 is \u0060AUTO\u0060 (the default), the model selects the most\nsuitable aspect ratio for the prompt and returns it in the response.", - "Language": "csharp", - "Code": "using var client = new IdeogramClient(apiKey);\n\nvar request = global::System.Text.Json.JsonSerializer.Deserialize\u003Cglobal::Ideogram.MagicPromptV4Request\u003E(\n @\u0022{\n \u0022\u0022text_prompt\u0022\u0022: \u0022\u0022a cat\u0022\u0022,\n \u0022\u0022aspect_ratio\u0022\u0022: \u0022\u0022AUTO\u0022\u0022\n}\u0022)!;\n\nvar response = await client.Prompt.PostMagicPromptV4Async(\n request: request\n);\n\n// Example response:\n// {\n// \u0022json_prompt\u0022: {\n// \u0022high_level_description\u0022: \u0022A photorealistic ginger cat perched on a vintage wooden chair by a sunlit window.\u0022,\n// \u0022style_description\u0022: {\n// \u0022aesthetics\u0022: \u0022warm, cozy, nostalgic\u0022,\n// \u0022lighting\u0022: \u0022soft natural window light\u0022,\n// \u0022medium\u0022: \u0022photograph\u0022\n// },\n// \u0022compositional_deconstruction\u0022: {\n// \u0022background\u0022: \u0022A dim room with a bright window casting warm light.\u0022,\n// \u0022elements\u0022: [\n// {\n// \u0022type\u0022: \u0022obj\u0022,\n// \u0022desc\u0022: \u0022ginger cat with green eyes sitting upright on a vintage wooden chair\u0022\n// }\n// ]\n// }\n// },\n// \u0022aspect_ratio\u0022: \u00221x1\u0022\n// }", - "Format": "sdk", - "OperationId": "post_magic_prompt_v4", - "Setup": "This example assumes \u0060using Ideogram;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." - }, - { - "Order": 174, - "Title": "Check whether content was created by Ideogram", - "Slug": "post-provenance-verify", - "Description": "Checks image content for an Ideogram provenance manifest (C2PA Content\nCredentials) and returns the disclosure it carries: the provider name,\nthe generating system and its version, the creation time, and the\ncontent\u0027s unique identifier.\n\nUpload the image to verify as the \u0060content\u0060 part.\n\nThis endpoint is public and unauthenticated \u2014 no API key is required.\nSubmitted content is analyzed in memory and never stored.", - "Language": "http", - "Code": "### Check whether content was created by Ideogram\n# @name post_provenance_verify\nPOST {{host}}/v1/provenance/verify\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022content\u0022; filename=\u0022content.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./content.bin\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: The verification result.\n# Content-Type: application/json\n# 400\n# Description: Invalid input, such as missing or unreadable content.\n# 413\n# Description: The uploaded content is too large.\n# 429\n# Description: Too many requests.", - "Format": "http", - "OperationId": "post_provenance_verify", - "Setup": null - }, - { - "Order": 175, - "Title": "Remove background", - "Slug": "post-remove-background-v2", - "Description": "Remove the background from an image and return the foreground as a\ntransparent PNG. Upload the source \u0060image\u0060 using \u0060multipart/form-data\u0060.\nReturns the result directly by default; set \u0060async\u0060 to get a\n\u0060generation_id\u0060 and poll \u0060GET /v2/generations/{generation_id}\u0060.", - "Language": "http", - "Code": "### Remove background\n# @name post_remove_background_v2\nPOST {{host}}/v2/image/remove-background/ideogram-1?dry_run=false\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image\u0022; filename=\u0022image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image_asset_identifier\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022target_collection_id\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022private\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022async\u0022\n\nfalse\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: The foreground image (synchronous requests), or an acknowledgement to poll (\u0060async\u0060 requests). If a synchronous request fails after the response has started streaming, the HTTP status is already 200; the body contains \u0060error\u0060 and \u0060status_code\u0060 instead.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Unauthorized.\n# 402\n# Description: Insufficient credits or quota.\n# Content-Type: application/json\n# 403\n# Description: Not authorized to remove backgrounds.\n# 404\n# Description: The source image was not found or is not readable.\n# 429\n# Description: Too many requests.\n# Content-Type: application/json\n# 500\n# Description: The background-removal request failed.\n# 503\n# Description: Background removal is temporarily unavailable.", - "Format": "http", - "OperationId": "post_remove_background_v2", - "Setup": null - }, - { - "Order": 176, - "Title": "Replace background with GPT Image 2", - "Slug": "post-replace-background", - "Description": "Replace the background of an image from a text prompt while keeping the\nautomatically detected foreground subject; no mask is needed. Upload\nthe source \u0060image\u0060 using \u0060multipart/form-data\u0060.\nReturns a \u0060generation_id\u0060; poll \u0060GET /v2/generations/{generation_id}\u0060\nor supply a \u0060webhook_url\u0060.", - "Language": "http", - "Code": "### Replace background with GPT Image 2\n# @name post_replace_background\nPOST {{host}}/v2/image/replace-background/gpt-image-2?dry_run=false\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image_asset_identifier\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image\u0022; filename=\u0022image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022quality\u0022\n\nhigh\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022num_images\u0022\n\n1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022private\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022webhook_url\u0022\n\nhttps://api.example.com/webhooks/ideogram\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Background replacement accepted for asynchronous processing.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Unauthorized.\n# 402\n# Description: Insufficient credits or quota.\n# Content-Type: application/json\n# 403\n# Description: Not authorized to replace backgrounds.\n# 404\n# Description: The source image was not found or is not readable.\n# 422\n# Description: The prompt did not pass safety checks.\n# 429\n# Description: Too many requests.\n# Content-Type: application/json\n# 503\n# Description: Background replacement is temporarily unavailable.", - "Format": "http", - "OperationId": "post_replace_background", - "Setup": null - }, - { - "Order": 177, - "Title": "Replace background with Ideogram 4.5", - "Slug": "post-replace-background-ideogram45", - "Description": "Rebuild the background of an image as the setting shown in a\n\u0060background_reference\u0060 image, with Ideogram 4.5 at its highest\nquality. The people in the source image are kept, people in the\nreference are left out, and results keep the source image\u0027s aspect\nratio. Returns a \u0060generation_id\u0060; poll\n\u0060GET /v2/generations/{generation_id}\u0060 or supply a \u0060webhook_url\u0060.", - "Language": "http", - "Code": "### Replace background with Ideogram 4.5\n# @name post_replace_background_ideogram45\nPOST {{host}}/v2/image/replace-background/ideogram-4-5?dry_run=false\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image_asset_identifier\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image\u0022; filename=\u0022image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022background_reference_asset_identifier\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022background_reference\u0022; filename=\u0022background_reference.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./background_reference.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022num_images\u0022\n\n1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022private\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022webhook_url\u0022\n\nhttps://api.example.com/webhooks/ideogram\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Background replacement accepted for asynchronous processing.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Unauthorized.\n# 402\n# Description: Insufficient credits or quota.\n# Content-Type: application/json\n# 403\n# Description: Not authorized to replace backgrounds.\n# 404\n# Description: An image was not found or is not readable.\n# 429\n# Description: Too many requests.\n# Content-Type: application/json\n# 503\n# Description: Background replacement is temporarily unavailable.", - "Format": "http", - "OperationId": "post_replace_background_ideogram45", - "Setup": null - }, - { - "Order": 178, - "Title": "Replace background with Ideogram 3.0", - "Slug": "post-replace-background-ideogram-v3", - "Description": "Replace the background of an image from a text prompt with Ideogram 3.0,\nkeeping the automatically detected foreground subject; no mask is\nneeded. Upload the source \u0060image\u0060 using \u0060multipart/form-data\u0060.\nReturns a \u0060generation_id\u0060; poll \u0060GET /v2/generations/{generation_id}\u0060\nor supply a \u0060webhook_url\u0060.", - "Language": "http", - "Code": "### Replace background with Ideogram 3.0\n# @name post_replace_background_ideogram_v3\nPOST {{host}}/v2/image/replace-background/ideogram-3?dry_run=false\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image_asset_identifier\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image\u0022; filename=\u0022image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022rendering_speed\u0022\n\ndefault\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022num_images\u0022\n\n1\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022private\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022webhook_url\u0022\n\nhttps://api.example.com/webhooks/ideogram\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Background replacement accepted for asynchronous processing.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Unauthorized.\n# 402\n# Description: Insufficient credits or quota.\n# Content-Type: application/json\n# 403\n# Description: Not authorized to replace backgrounds.\n# 404\n# Description: The source image was not found or is not readable.\n# 422\n# Description: The prompt did not pass safety checks.\n# 429\n# Description: Too many requests.\n# Content-Type: application/json\n# 503\n# Description: Background replacement is temporarily unavailable.", - "Format": "http", - "OperationId": "post_replace_background_ideogram_v3", - "Setup": null - }, - { - "Order": 179, - "Title": "Upscale with automatic model selection", - "Slug": "post-upscale", - "Description": "Upscale an image to 2x, 4x, or 8x its original resolution with a model\nIdeogram picks per request; the choice may change over time. Upload the\nsource \u0060image\u0060 using \u0060multipart/form-data\u0060.\nReturns results directly by default; set \u0060async\u0060 or supply a\n\u0060webhook_url\u0060 to get a \u0060generation_id\u0060 and poll\n\u0060GET /v2/generations/{generation_id}\u0060.", - "Language": "http", - "Code": "### Upscale with automatic model selection\n# @name post_upscale\nPOST {{host}}/v2/image/upscale/auto?dry_run=false\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image_asset_identifier\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image\u0022; filename=\u0022image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022upscale_factor\u0022\n\nx2\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022seed\u0022\n\n12345\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022internal\u0022\n\nfalse\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022async\u0022\n\nfalse\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022webhook_url\u0022\n\nhttps://api.example.com/webhooks/ideogram\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022private\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022target_collection_id\u0022\n\nstring\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: The upscaled image (synchronous requests), or an acknowledgement to poll with \u0060GET /v2/generations/{generation_id}\u0060 (\u0060async\u0060 requests).\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided, or the output would exceed the 8K limit.\n# 401\n# Description: Unauthorized.\n# 402\n# Description: Insufficient credits or quota.\n# Content-Type: application/json\n# 403\n# Description: Not authorized to upscale images.\n# 404\n# Description: The source image was not found.\n# 429\n# Description: Too many requests.\n# Content-Type: application/json\n# 500\n# Description: Internal server error.\n# 503\n# Description: The endpoint is temporarily unavailable.", - "Format": "http", - "OperationId": "post_upscale", - "Setup": null - }, - { - "Order": 180, - "Title": "Reference to video with MiniMax H3", - "Slug": "post-edit-video-minimax-h3-reference-to-video", - "Description": "Produce a video from a text prompt and optional reference media with\nMiniMax H3. Upload \u0060reference_images\u0060 and \u0060reference_audios\u0060 using\n\u0060multipart/form-data\u0060, and address them in the prompt by position\n(\u0060Image 1\u0060, \u0060Audio 1\u0060, \u2026). Returns a \u0060generation_id\u0060; poll\n\u0060GET /v2/generations/{generation_id}\u0060 or supply a \u0060webhook_url\u0060.", - "Language": "http", - "Code": "### Reference to video with MiniMax H3\n# @name post_edit_video_minimax_h3_reference_to_video\nPOST {{host}}/v2/video/generate/minimax-h3-reference-to-video?dry_run=false\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\nImage 1 walks through the snowy forest at dawn.\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022reference_image_asset_identifiers\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022reference_images\u0022; filename=\u0022reference_images.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./reference_images.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022reference_video_asset_identifiers\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022reference_audios\u0022; filename=\u0022reference_audios.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./reference_audios.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022aspect_ratio\u0022\n\n16x9\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022resolution\u0022\n\n2K\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022duration\u0022\n\n5\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt_expansion_mode\u0022\n\nbalanced\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022webhook_url\u0022\n\nhttps://api.example.com/webhooks/ideogram\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022private\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022target_collection_id\u0022\n\nstring\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: An acknowledgement to poll with \u0060GET /v2/generations/{generation_id}\u0060.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Unauthorized.\n# 402\n# Description: Insufficient credits or quota.\n# Content-Type: application/json\n# 403\n# Description: This account does not have access to this model.\n# 404\n# Description: A referenced asset was not found.\n# 422\n# Description: The prompt did not pass safety checks.\n# 429\n# Description: Too many requests.\n# Content-Type: application/json\n# 500\n# Description: Internal server error.\n# 503\n# Description: The endpoint is temporarily unavailable.", - "Format": "http", - "OperationId": "post_edit_video_minimax_h3_reference_to_video", - "Setup": null - }, - { - "Order": 181, - "Title": "Edit video with Seedance 2.0", - "Slug": "post-edit-video-seed-dance2", - "Description": "Edit a video you already have stored with Ideogram by replacing part of\nit. Reference the source video with \u0060video_asset_identifier\u0060 and mark the\nspan to replace with \u0060start_frame_time\u0060 and \u0060end_frame_time\u0060, in seconds.\nSeedance 2.0 generates a new clip for that span from your prompt, and the\nresult is the source video with the generated clip spliced in over the\nspan: everything before \u0060start_frame_time\u0060, then the generated clip, then\neverything from \u0060end_frame_time\u0060 on. That edited video is the asset the\nrequest produces.\n\n\u0060is_start_frame_included\u0060 and \u0060is_end_frame_included\u0060 anchor the generated\nclip on the span\u0027s own end frames, so it joins the surrounding footage\ninstead of cutting to something unrelated. Anchoring the start opens the\nclip on the frame already at \u0060start_frame_time\u0060; anchoring the end lands\nit on the frame at \u0060end_frame_time\u0060; anchoring both joins at each seam. At\nleast one must be anchored.\n\nThe generated clip is used at its own length, which the model rarely makes\nexactly the span\u0027s, so the edited video is usually a different length from\nthe source. Request a \u0060duration\u0060 close to the span to keep them near each\nother. The clip is scaled and cropped to fill the source\u0027s frame and\nconformed to its frame rate, so resolution and aspect ratio follow the\nsource rather than being requested.\n\nVideo generation always runs asynchronously: the response returns as\nsoon as the request is accepted and carries only a \u0060generation_id\u0060.\nPoll for completion and results with\n\u0060GET /v2/generations/{generation_id}\u0060 using that id, or supply a\n\u0060webhook_url\u0060 to have the finished result POSTed to your server\ninstead.\n\nVideo links are available for a limited period of time; download the\nvideo if you want to keep it.", - "Language": "csharp", - "Code": "using var client = new IdeogramClient(apiKey);\n\nvar request = global::System.Text.Json.JsonSerializer.Deserialize\u003Cglobal::Ideogram.EditVideoSeedDance2Request\u003E(\n @\u0022{\n \u0022\u0022duration\u0022\u0022: 5,\n \u0022\u0022private\u0022\u0022: true,\n \u0022\u0022end_frame_time\u0022\u0022: \u0022\u0022\u0022\u0022,\n \u0022\u0022is_end_frame_included\u0022\u0022: false,\n \u0022\u0022webhook_url\u0022\u0022: \u0022\u0022https://api.example.com/webhooks/ideogram\u0022\u0022,\n \u0022\u0022video_asset_identifier\u0022\u0022: \u0022\u0022\u0022\u0022,\n \u0022\u0022target_collection_id\u0022\u0022: \u0022\u0022target_collection_id\u0022\u0022,\n \u0022\u0022generate_audio\u0022\u0022: false,\n \u0022\u0022is_start_frame_included\u0022\u0022: true,\n \u0022\u0022prompt\u0022\u0022: \u0022\u0022The camera pushes in as the dancer turns towards the light.\u0022\u0022,\n \u0022\u0022resolution\u0022\u0022: \u0022\u0022\u0022\u0022,\n \u0022\u0022start_frame_time\u0022\u0022: \u0022\u0022\u0022\u0022\n}\u0022)!;\n\nvar response = await client.VideoEdit.PostEditVideoSeedDance2Async(\n request: request\n);\n\n// Example response:\n// {\n// \u0022generation_id\u0022: \u0022generation_id\u0022,\n// \u0022created\u0022: \u00222000-01-23T04:56:07\\u002B00:00\u0022\n// }", - "Format": "sdk", - "OperationId": "post_edit_video_seed_dance2", - "Setup": "This example assumes \u0060using Ideogram;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." - }, - { - "Order": 182, - "Title": "Image to video with Kling v3 Standard", - "Slug": "post-generate-video-kling-v3-standard-image-to-video", - "Description": "Generate a video from a first-frame image and a text prompt with Kling\nv3 Standard. Upload the first frame as \u0060image\u0060, and optionally a final\nframe as \u0060end_image\u0060, using \u0060multipart/form-data\u0060.\nReturns a \u0060generation_id\u0060; poll \u0060GET /v2/generations/{generation_id}\u0060\nor supply a \u0060webhook_url\u0060.", - "Language": "http", - "Code": "### Image to video with Kling v3 Standard\n# @name post_generate_video_kling_v3_standard_image_to_video\nPOST {{host}}/v2/video/generate/kling-3-standard-image-to-video?dry_run=false\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image_asset_identifier\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image\u0022; filename=\u0022image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022end_image_asset_identifier\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022end_image\u0022; filename=\u0022end_image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./end_image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\nThe camera slowly pans right as the waves roll in.\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022negative_prompt\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022duration\u0022\n\n5\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022generate_audio\u0022\n\nfalse\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022shot_type\u0022\n\ncustomize\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022cfg_scale\u0022\n\n0.5\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022webhook_url\u0022\n\nhttps://api.example.com/webhooks/ideogram\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022private\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022target_collection_id\u0022\n\nstring\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: An acknowledgement to poll with \u0060GET /v2/generations/{generation_id}\u0060.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Unauthorized.\n# 402\n# Description: Insufficient credits or quota.\n# Content-Type: application/json\n# 403\n# Description: This account does not have access to this model.\n# 404\n# Description: The first-frame image was not found.\n# 422\n# Description: The prompt did not pass safety checks.\n# 429\n# Description: Too many requests.\n# Content-Type: application/json\n# 500\n# Description: Internal server error.\n# 503\n# Description: The endpoint is temporarily unavailable.", - "Format": "http", - "OperationId": "post_generate_video_kling_v3_standard_image_to_video", - "Setup": null - }, - { - "Order": 183, - "Title": "Text to video with Kling v3 Standard", - "Slug": "post-generate-video-kling-v3-standard-text-to-video", - "Description": "Generate a video from a text prompt with Kling v3 Standard.\nReturns a \u0060generation_id\u0060; poll \u0060GET /v2/generations/{generation_id}\u0060\nor supply a \u0060webhook_url\u0060.", - "Language": "csharp", - "Code": "using var client = new IdeogramClient(apiKey);\n\nvar request = global::System.Text.Json.JsonSerializer.Deserialize\u003Cglobal::Ideogram.GenerateVideoKlingV3StandardTextToVideoRequest\u003E(\n @\u0022{\n \u0022\u0022duration\u0022\u0022: 5,\n \u0022\u0022shot_type\u0022\u0022: null,\n \u0022\u0022aspect_ratio\u0022\u0022: null,\n \u0022\u0022private\u0022\u0022: true,\n \u0022\u0022webhook_url\u0022\u0022: \u0022\u0022https://api.example.com/webhooks/ideogram\u0022\u0022,\n \u0022\u0022negative_prompt\u0022\u0022: \u0022\u0022negative_prompt\u0022\u0022,\n \u0022\u0022target_collection_id\u0022\u0022: \u0022\u0022target_collection_id\u0022\u0022,\n \u0022\u0022generate_audio\u0022\u0022: false,\n \u0022\u0022prompt\u0022\u0022: \u0022\u0022A red fox running through a snowy forest at dawn.\u0022\u0022,\n \u0022\u0022cfg_scale\u0022\u0022: 0.5\n}\u0022)!;\n\nvar response = await client.VideoGenerate.PostGenerateVideoKlingV3StandardTextToVideoAsync(\n request: request\n);\n\n// Example response:\n// {\n// \u0022generation_id\u0022: \u0022generation_id\u0022,\n// \u0022created\u0022: \u00222000-01-23T04:56:07\\u002B00:00\u0022\n// }", - "Format": "sdk", - "OperationId": "post_generate_video_kling_v3_standard_text_to_video", - "Setup": "This example assumes \u0060using Ideogram;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." - }, - { - "Order": 184, - "Title": "Image to video with MiniMax H3", - "Slug": "post-generate-video-minimax-h3-image-to-video", - "Description": "Generate a video from a first-frame image and a text prompt with\nMiniMax H3. Upload the first frame as \u0060image\u0060, and optionally a final\nframe as \u0060end_image\u0060, using \u0060multipart/form-data\u0060.\nReturns a \u0060generation_id\u0060; poll \u0060GET /v2/generations/{generation_id}\u0060\nor supply a \u0060webhook_url\u0060.", - "Language": "http", - "Code": "### Image to video with MiniMax H3\n# @name post_generate_video_minimax_h3_image_to_video\nPOST {{host}}/v2/video/generate/minimax-h3-image-to-video?dry_run=false\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image_asset_identifier\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image\u0022; filename=\u0022image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022end_image_asset_identifier\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022end_image\u0022; filename=\u0022end_image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./end_image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\nThe camera slowly pans right as the waves roll in.\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022resolution\u0022\n\n2K\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022duration\u0022\n\n5\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022webhook_url\u0022\n\nhttps://api.example.com/webhooks/ideogram\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022private\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022target_collection_id\u0022\n\nstring\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: An acknowledgement to poll with \u0060GET /v2/generations/{generation_id}\u0060.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Unauthorized.\n# 402\n# Description: Insufficient credits or quota.\n# Content-Type: application/json\n# 403\n# Description: This account does not have access to this model.\n# 404\n# Description: The first-frame image was not found.\n# 422\n# Description: The prompt did not pass safety checks.\n# 429\n# Description: Too many requests.\n# Content-Type: application/json\n# 500\n# Description: Internal server error.\n# 503\n# Description: The endpoint is temporarily unavailable.", - "Format": "http", - "OperationId": "post_generate_video_minimax_h3_image_to_video", - "Setup": null - }, - { - "Order": 185, - "Title": "Text to video with MiniMax H3", - "Slug": "post-generate-video-minimax-h3-text-to-video", - "Description": "Generate a video from a text prompt with MiniMax H3.\nReturns a \u0060generation_id\u0060; poll \u0060GET /v2/generations/{generation_id}\u0060\nor supply a \u0060webhook_url\u0060.", - "Language": "csharp", - "Code": "using var client = new IdeogramClient(apiKey);\n\nvar request = global::System.Text.Json.JsonSerializer.Deserialize\u003Cglobal::Ideogram.GenerateVideoMinimaxH3TextToVideoRequest\u003E(\n @\u0022{\n \u0022\u0022duration\u0022\u0022: 5,\n \u0022\u0022aspect_ratio\u0022\u0022: null,\n \u0022\u0022private\u0022\u0022: true,\n \u0022\u0022webhook_url\u0022\u0022: \u0022\u0022https://api.example.com/webhooks/ideogram\u0022\u0022,\n \u0022\u0022target_collection_id\u0022\u0022: \u0022\u0022target_collection_id\u0022\u0022,\n \u0022\u0022prompt\u0022\u0022: \u0022\u0022A red fox running through a snowy forest at dawn.\u0022\u0022,\n \u0022\u0022resolution\u0022\u0022: null\n}\u0022)!;\n\nvar response = await client.VideoGenerate.PostGenerateVideoMinimaxH3TextToVideoAsync(\n request: request\n);\n\n// Example response:\n// {\n// \u0022generation_id\u0022: \u0022generation_id\u0022,\n// \u0022created\u0022: \u00222000-01-23T04:56:07\\u002B00:00\u0022\n// }", - "Format": "sdk", - "OperationId": "post_generate_video_minimax_h3_text_to_video", - "Setup": "This example assumes \u0060using Ideogram;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." - }, - { - "Order": 186, - "Title": "Image to video with Seedance 2.5", - "Slug": "post-generate-video-seed-dance25-image-to-video", - "Description": "Generate a video from a first-frame image and a text prompt with\nSeedance 2.5. Upload the first frame as \u0060image\u0060, and optionally a final\nframe as \u0060end_image\u0060, using \u0060multipart/form-data\u0060.\nReturns a \u0060generation_id\u0060; poll \u0060GET /v2/generations/{generation_id}\u0060\nor supply a \u0060webhook_url\u0060.", - "Language": "http", - "Code": "### Image to video with Seedance 2.5\n# @name post_generate_video_seed_dance25_image_to_video\nPOST {{host}}/v2/video/generate/seedance-2-5-image-to-video?dry_run=false\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image_asset_identifier\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image\u0022; filename=\u0022image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022end_image_asset_identifier\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022end_image\u0022; filename=\u0022end_image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./end_image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\nThe camera slowly pans right as the waves roll in.\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022resolution\u0022\n\n720p\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022duration\u0022\n\n5\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022generate_audio\u0022\n\nfalse\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022webhook_url\u0022\n\nhttps://api.example.com/webhooks/ideogram\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022private\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022target_collection_id\u0022\n\nstring\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: An acknowledgement to poll with \u0060GET /v2/generations/{generation_id}\u0060.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Unauthorized.\n# 402\n# Description: Insufficient credits or quota.\n# Content-Type: application/json\n# 403\n# Description: This account does not have access to this model.\n# 404\n# Description: The first-frame image was not found.\n# 422\n# Description: The prompt did not pass safety checks.\n# 429\n# Description: Too many requests.\n# Content-Type: application/json\n# 500\n# Description: Internal server error.\n# 503\n# Description: The endpoint is temporarily unavailable.", - "Format": "http", - "OperationId": "post_generate_video_seed_dance25_image_to_video", - "Setup": null - }, - { - "Order": 187, - "Title": "Reference to video with Seedance 2.5", - "Slug": "post-generate-video-seed-dance25-reference-to-video", - "Description": "Generate a video from a text prompt and reference media with\nSeedance 2.5. Upload at least one image in \u0060reference_images\u0060, plus optional\n\u0060reference_audios\u0060, using \u0060multipart/form-data\u0060.\nReturns a \u0060generation_id\u0060; poll \u0060GET /v2/generations/{generation_id}\u0060\nor supply a \u0060webhook_url\u0060.", - "Language": "http", - "Code": "### Reference to video with Seedance 2.5\n# @name post_generate_video_seed_dance25_reference_to_video\nPOST {{host}}/v2/video/generate/seedance-2-5-reference-to-video?dry_run=false\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\n[Image1] walks through the snowy forest at dawn.\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022reference_image_asset_identifiers\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022reference_images\u0022; filename=\u0022reference_images.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./reference_images.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022reference_video_asset_identifiers\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022reference_audios\u0022; filename=\u0022reference_audios.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./reference_audios.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022aspect_ratio\u0022\n\nauto\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022resolution\u0022\n\n720p\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022duration\u0022\n\n5\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022generate_audio\u0022\n\nfalse\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022webhook_url\u0022\n\nhttps://api.example.com/webhooks/ideogram\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022private\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022target_collection_id\u0022\n\nstring\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: An acknowledgement to poll with \u0060GET /v2/generations/{generation_id}\u0060.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Unauthorized.\n# 402\n# Description: Insufficient credits or quota.\n# Content-Type: application/json\n# 403\n# Description: This account does not have access to this model.\n# 404\n# Description: A reference was not found.\n# 422\n# Description: The prompt did not pass safety checks.\n# 429\n# Description: Too many requests.\n# Content-Type: application/json\n# 500\n# Description: Internal server error.\n# 503\n# Description: The endpoint is temporarily unavailable.", - "Format": "http", - "OperationId": "post_generate_video_seed_dance25_reference_to_video", - "Setup": null - }, - { - "Order": 188, - "Title": "Text to video with Seedance 2.5", - "Slug": "post-generate-video-seed-dance25-text-to-video", - "Description": "Generate a video from a text prompt with Seedance 2.5, at up to 1080p and\n30 seconds. Returns a \u0060generation_id\u0060; poll \u0060GET /v2/generations/{generation_id}\u0060\nor supply a \u0060webhook_url\u0060.", - "Language": "csharp", - "Code": "using var client = new IdeogramClient(apiKey);\n\nvar request = global::System.Text.Json.JsonSerializer.Deserialize\u003Cglobal::Ideogram.GenerateVideoSeedDance25TextToVideoRequest\u003E(\n @\u0022{\n \u0022\u0022duration\u0022\u0022: 5,\n \u0022\u0022aspect_ratio\u0022\u0022: null,\n \u0022\u0022private\u0022\u0022: true,\n \u0022\u0022webhook_url\u0022\u0022: \u0022\u0022https://api.example.com/webhooks/ideogram\u0022\u0022,\n \u0022\u0022target_collection_id\u0022\u0022: \u0022\u0022target_collection_id\u0022\u0022,\n \u0022\u0022generate_audio\u0022\u0022: false,\n \u0022\u0022prompt\u0022\u0022: \u0022\u0022A red fox running through a snowy forest at dawn.\u0022\u0022,\n \u0022\u0022resolution\u0022\u0022: null\n}\u0022)!;\n\nvar response = await client.VideoGenerate.PostGenerateVideoSeedDance25TextToVideoAsync(\n request: request\n);\n\n// Example response:\n// {\n// \u0022generation_id\u0022: \u0022generation_id\u0022,\n// \u0022created\u0022: \u00222000-01-23T04:56:07\\u002B00:00\u0022\n// }", - "Format": "sdk", - "OperationId": "post_generate_video_seed_dance25_text_to_video", - "Setup": "This example assumes \u0060using Ideogram;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." - }, - { - "Order": 189, - "Title": "Image to video with Seedance 2.0", - "Slug": "post-generate-video-seed-dance2-image-to-video", - "Description": "Generate one or more videos from a first-frame image and a text prompt\nwith Seedance 2.0. Upload the first frame as \u0060image\u0060, and optionally a final\nframe as \u0060end_image\u0060, using \u0060multipart/form-data\u0060.\nReturns a \u0060generation_id\u0060; poll \u0060GET /v2/generations/{generation_id}\u0060\nor supply a \u0060webhook_url\u0060.", - "Language": "http", - "Code": "### Image to video with Seedance 2.0\n# @name post_generate_video_seed_dance2_image_to_video\nPOST {{host}}/v2/video/generate/seedance-2-image-to-video?dry_run=false\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image_asset_identifier\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image\u0022; filename=\u0022image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022end_image_asset_identifier\u0022\n\nstring\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022end_image\u0022; filename=\u0022end_image.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./end_image.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\nThe camera slowly pans right as the waves roll in.\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022aspect_ratio\u0022\n\nauto\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022resolution\u0022\n\n720p\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022duration\u0022\n\n5\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022generate_audio\u0022\n\nfalse\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022webhook_url\u0022\n\nhttps://api.example.com/webhooks/ideogram\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022private\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022target_collection_id\u0022\n\nstring\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: An acknowledgement to poll with \u0060GET /v2/generations/{generation_id}\u0060.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Unauthorized.\n# 402\n# Description: Insufficient credits or quota.\n# Content-Type: application/json\n# 403\n# Description: This account does not have access to this model.\n# 404\n# Description: The first-frame image was not found.\n# 422\n# Description: The prompt did not pass safety checks.\n# 429\n# Description: Too many requests.\n# Content-Type: application/json\n# 500\n# Description: Internal server error.\n# 503\n# Description: The endpoint is temporarily unavailable.", - "Format": "http", - "OperationId": "post_generate_video_seed_dance2_image_to_video", - "Setup": null - }, - { - "Order": 190, - "Title": "Reference to video with Seedance 2.0", - "Slug": "post-generate-video-seed-dance2-reference-to-video", - "Description": "Generate a video from a text prompt and reference media with\nSeedance 2.0. Upload at least one image in \u0060reference_images\u0060, plus optional\n\u0060reference_audios\u0060, using \u0060multipart/form-data\u0060.\nReturns a \u0060generation_id\u0060; poll \u0060GET /v2/generations/{generation_id}\u0060\nor supply a \u0060webhook_url\u0060.", - "Language": "http", - "Code": "### Reference to video with Seedance 2.0\n# @name post_generate_video_seed_dance2_reference_to_video\nPOST {{host}}/v2/video/generate/seedance-2-reference-to-video?dry_run=false\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022prompt\u0022\n\n@Image1 walks through the snowy forest at dawn.\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022reference_image_asset_identifiers\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022reference_images\u0022; filename=\u0022reference_images.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./reference_images.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022reference_video_asset_identifiers\u0022\n\n{\u0022asset_type\u0022:\u0022RESPONSE\u0022,\u0022asset_id\u0022:\u00227uS_VESkRI6O3-sVgHQp_A\u0022}\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022reference_audios\u0022; filename=\u0022reference_audios.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./reference_audios.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022aspect_ratio\u0022\n\nauto\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022resolution\u0022\n\n720p\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022duration\u0022\n\n5\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022generate_audio\u0022\n\nfalse\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022webhook_url\u0022\n\nhttps://api.example.com/webhooks/ideogram\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022private\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022target_collection_id\u0022\n\nstring\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: An acknowledgement to poll with \u0060GET /v2/generations/{generation_id}\u0060.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 401\n# Description: Unauthorized.\n# 402\n# Description: Insufficient credits or quota.\n# Content-Type: application/json\n# 403\n# Description: This account does not have access to this model.\n# 404\n# Description: A reference was not found.\n# 422\n# Description: The prompt did not pass safety checks.\n# 429\n# Description: Too many requests.\n# Content-Type: application/json\n# 500\n# Description: Internal server error.\n# 503\n# Description: The endpoint is temporarily unavailable.", - "Format": "http", - "OperationId": "post_generate_video_seed_dance2_reference_to_video", - "Setup": null - }, - { - "Order": 191, - "Title": "Text to video with Seedance 2.0", - "Slug": "post-generate-video-seed-dance2-text-to-video", - "Description": "Generate one or more videos from a text prompt with Seedance 2.0.\nReturns a \u0060generation_id\u0060; poll \u0060GET /v2/generations/{generation_id}\u0060\nor supply a \u0060webhook_url\u0060.", - "Language": "csharp", - "Code": "using var client = new IdeogramClient(apiKey);\n\nvar request = global::System.Text.Json.JsonSerializer.Deserialize\u003Cglobal::Ideogram.GenerateVideoSeedDance2TextToVideoRequest\u003E(\n @\u0022{\n \u0022\u0022duration\u0022\u0022: 5,\n \u0022\u0022aspect_ratio\u0022\u0022: null,\n \u0022\u0022private\u0022\u0022: true,\n \u0022\u0022webhook_url\u0022\u0022: \u0022\u0022https://api.example.com/webhooks/ideogram\u0022\u0022,\n \u0022\u0022target_collection_id\u0022\u0022: \u0022\u0022target_collection_id\u0022\u0022,\n \u0022\u0022generate_audio\u0022\u0022: false,\n \u0022\u0022prompt\u0022\u0022: \u0022\u0022A red fox running through a snowy forest at dawn.\u0022\u0022,\n \u0022\u0022resolution\u0022\u0022: null\n}\u0022)!;\n\nvar response = await client.VideoGenerate.PostGenerateVideoSeedDance2TextToVideoAsync(\n request: request\n);\n\n// Example response:\n// {\n// \u0022generation_id\u0022: \u0022generation_id\u0022,\n// \u0022created\u0022: \u00222000-01-23T04:56:07\\u002B00:00\u0022\n// }", - "Format": "sdk", - "OperationId": "post_generate_video_seed_dance2_text_to_video", - "Setup": "This example assumes \u0060using Ideogram;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." - }, - { - "Order": 192, - "Title": "Turn a still image into a subtle looping video", - "Slug": "post-living-image", - "Description": "Animates one image into a short, loop-ready clip for use as a living background. The camera stays fixed and only the parts of the scene that would move in real life move: water, light, mist, particles, fabric, creatures. Ideogram inspects the image and writes the motion prompt, so the request needs only the image.\nVideo generation runs asynchronously. Poll \u0060GET /v1/generations/{generation_id}\u0060 with the returned \u0060generation_id\u0060 until the generation completes or fails.", - "Language": "csharp", - "Code": "using var client = new IdeogramClient(apiKey);\n\nvar request = global::System.Text.Json.JsonSerializer.Deserialize\u003Cglobal::Ideogram.LivingImageRequest\u003E(\n @\u0022{\n \u0022\u0022duration\u0022\u0022: 8,\n \u0022\u0022target_collection_id\u0022\u0022: \u0022\u0022target_collection_id\u0022\u0022,\n \u0022\u0022image_asset_identifier\u0022\u0022: {\n \u0022\u0022asset_type\u0022\u0022: \u0022\u0022RESPONSE\u0022\u0022,\n \u0022\u0022asset_id\u0022\u0022: \u0022\u00227uS_VESkRI6O3-sVgHQp_A\u0022\u0022\n },\n \u0022\u0022quality\u0022\u0022: null\n}\u0022)!;\n\nvar response = await client.VideoGenerate.PostLivingImageAsync(\n request: request\n);\n\n// Example response:\n// {\n// \u0022generation_id\u0022: \u0022generation_id\u0022,\n// \u0022created\u0022: \u00222000-01-23T04:56:07\\u002B00:00\u0022\n// }", - "Format": "sdk", - "OperationId": "post_living_image", - "Setup": "This example assumes \u0060using Ideogram;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." - }, - { - "Order": 193, - "Title": "Product 360 Video", - "Slug": "post-product360-video", - "Description": "Animates one product image through a complete turntable revolution and returns to the starting pose so the result loops cleanly.\nVideo generation runs asynchronously. Poll \u0060GET /v2/generations/{generation_id}\u0060 with the returned \u0060generation_id\u0060 until the generation completes or fails.", - "Language": "csharp", - "Code": "using var client = new IdeogramClient(apiKey);\n\nvar request = global::System.Text.Json.JsonSerializer.Deserialize\u003Cglobal::Ideogram.Product360VideoRequest\u003E(\n @\u0022{\n \u0022\u0022duration\u0022\u0022: 5,\n \u0022\u0022target_collection_id\u0022\u0022: \u0022\u0022target_collection_id\u0022\u0022,\n \u0022\u0022image_asset_identifier\u0022\u0022: {\n \u0022\u0022asset_type\u0022\u0022: \u0022\u0022RESPONSE\u0022\u0022,\n \u0022\u0022asset_id\u0022\u0022: \u0022\u00227uS_VESkRI6O3-sVgHQp_A\u0022\u0022\n },\n \u0022\u0022product_description\u0022\u0022: \u0022\u0022product_description\u0022\u0022,\n \u0022\u0022resolution\u0022\u0022: null,\n \u0022\u0022direction\u0022\u0022: null\n}\u0022)!;\n\nvar response = await client.VideoGenerate.PostProduct360VideoAsync(\n request: request\n);\n\n// Example response:\n// {\n// \u0022generation_id\u0022: \u0022generation_id\u0022,\n// \u0022created\u0022: \u00222000-01-23T04:56:07\\u002B00:00\u0022\n// }", - "Format": "sdk", - "OperationId": "post_product360_video", - "Setup": "This example assumes \u0060using Ideogram;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." - }, - { - "Order": 194, - "Title": "Describe", - "Slug": "post-describe", - "Description": "Describe an image.\n\nSupported image formats include JPEG, PNG, and WebP.", - "Language": "http", - "Code": "### Describe\n# @name post_describe\nPOST {{host}}/describe\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image_file\u0022; filename=\u0022image_file.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./image_file.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022describe_model_version\u0022\n\nV_3\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Description(s) created successfully.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 422\n# Description: Image failed the safety check.\n# Content-Type: application/json\n# 429\n# Description: Too many requests.", - "Format": "http", - "OperationId": "post_describe", - "Setup": null - }, - { - "Order": 195, - "Title": "Describe with Ideogram 4.0", - "Slug": "post-describe-v4", - "Description": "Describe an image with Ideogram 4.0 and return a structured\n\u0060V4JsonPrompt\u0060. The returned \u0060json_prompt\u0060 is a working JSON prompt\nthat can be passed directly as \u0060json_prompt\u0060 to the\n\u0060/v1/ideogram-v4/generate\u0060 family of endpoints.\n\nSupported image formats include JPEG, PNG, and WebP.", - "Language": "http", - "Code": "### Describe with Ideogram 4.0\n# @name post_describe_v4\nPOST {{host}}/v1/ideogram-v4/describe\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022image_file\u0022; filename=\u0022image_file.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./image_file.bin\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022include_bbox\u0022\n\ntrue\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022include_style_descriptions\u0022\n\nfalse\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022include_tags\u0022\n\nfalse\n--AutoSDKBoundary--\n\n## Responses\n# 200\n# Description: Structured V4 prompt generated successfully.\n# Content-Type: application/json\n# 400\n# Description: Invalid input provided.\n# 422\n# Description: Image failed the safety check.\n# Content-Type: application/json\n# 429\n# Description: Too many requests.\n# 503\n# Description: Took too long to finish.", - "Format": "http", - "OperationId": "post_describe_v4", - "Setup": null - }, - { - "Order": 196, - "Title": "Get the public keys used to verify webhook signatures", - "Slug": "get-webhook-signing-jwks", - "Description": "Returns the set of Ed25519 public keys Ideogram uses to sign outbound\nwebhook payloads. Customers verify incoming webhooks by recomputing the\ncanonical signed message (\u0060request_id\\nuser_id\\ntimestamp\\nsha256_hex(body)\u0060)\nand checking the \u0060X-Ideogram-Webhook-Signature\u0060 header against any key\nin this document.\n\nThe document includes the current signing key plus any keys recently\nrotated out, so signatures already in flight remain verifiable across\nrotations. Cache for up to 24 hours; refresh sooner if a signature\nfails to verify against the cached set.\n\nThis endpoint is public and unauthenticated \u2014 no API key is required.", - "Language": "csharp", - "Code": "using var client = new IdeogramClient(apiKey);\nvar response = await client.Webhooks.GetWebhookSigningJwksAsync();\n\n// Example response:\n// {\n// \u0022keys\u0022: [\n// {\n// \u0022kty\u0022: \u0022OKP\u0022,\n// \u0022crv\u0022: \u0022Ed25519\u0022,\n// \u0022use\u0022: \u0022sig\u0022,\n// \u0022kid\u0022: \u0022v1\u0022,\n// \u0022x\u0022: \u002211qYAYKxCrfVS_7TyWQHOg7hcvPapiMlrwIaaPcHURo\u0022,\n// \u0022alg\u0022: \u0022EdDSA\u0022\n// },\n// {\n// \u0022kty\u0022: \u0022OKP\u0022,\n// \u0022crv\u0022: \u0022Ed25519\u0022,\n// \u0022use\u0022: \u0022sig\u0022,\n// \u0022kid\u0022: \u0022v1\u0022,\n// \u0022x\u0022: \u002211qYAYKxCrfVS_7TyWQHOg7hcvPapiMlrwIaaPcHURo\u0022,\n// \u0022alg\u0022: \u0022EdDSA\u0022\n// }\n// ]\n// }", - "Format": "sdk", - "OperationId": "get_webhook_signing_jwks", - "Setup": "This example assumes \u0060using Ideogram;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." - } - ] -} \ No newline at end of file diff --git a/src/libs/Ideogram/openapi.json b/src/libs/Ideogram/openapi.json index 635284bf..1e53fa13 100644 --- a/src/libs/Ideogram/openapi.json +++ b/src/libs/Ideogram/openapi.json @@ -1,39026 +1,15279 @@ { - "openapi": "3.0.2", + "openapi": "3.1.0", "info": { - "description": "This is the API definition for Ideogram AI.", - "title": "Ideogram - OpenAPI 3.0", + "title": "Ideogram API v2", "version": "1.0.0" }, - "servers": [ - { - "url": "" - } - ], - "security": [ - { - "ApiKeyAuth": [] - }, - { - "BearerAuth": [] - } - ], - "tags": [ - { - "description": "All things related to generating content.", - "externalDocs": { - "description": "Find out more", - "url": "https://docs.ideogram.ai" - }, - "name": "generate" - }, - { - "description": "Content related to managing API account and API access", - "externalDocs": { - "description": "Find out more", - "url": "https://docs.ideogram.ai" - }, - "name": "manage" - }, - { - "description": "Operations related to understanding visual content", - "externalDocs": { - "description": "Find out more", - "url": "https://docs.ideogram.ai" - }, - "name": "vision" - }, - { - "description": "Operations and endpoints designed for doing internal testing. Not intended to be called outside a test environment.", - "externalDocs": { - "description": "Find out more", - "url": "https://docs.ideogram.ai" - }, - "name": "internal-testing" - }, - { - "description": "Operations related to managing datasets", - "externalDocs": { - "description": "Find out more", - "url": "https://docs.ideogram.ai" - }, - "name": "datasets" - }, - { - "description": "Operations related to managing custom models", - "externalDocs": { - "description": "Find out more", - "url": "https://docs.ideogram.ai" - }, - "name": "models" - }, - { - "description": "Operations related to Ideogram 4.0 image generation", - "externalDocs": { - "description": "Find out more", - "url": "https://docs.ideogram.ai" - }, - "name": "v4-generation" - }, - { - "description": "Endpoints related to webhook delivery and verification. The JWKS\nendpoint publishes the Ed25519 public keys customers use to verify\nthat an inbound webhook genuinely originated from Ideogram.\n", - "externalDocs": { - "description": "Find out more", - "url": "https://docs.ideogram.ai" - }, - "name": "webhooks" - }, - { - "description": "Operations related to publishing mini-apps into the catalog.", - "externalDocs": { - "description": "Find out more", - "url": "https://docs.ideogram.ai" - }, - "name": "mini-apps" - }, - { - "description": "Organization-scoped external asset integrations.", - "name": "integrations" - }, - { - "description": "Remove unwanted objects from an image. Requests return a generation id\nto poll with `GET /v2/generations/{generation_id}`.\n", - "externalDocs": { - "description": "Find out more", - "url": "https://docs.ideogram.ai" - }, - "name": "object-removal" - }, - { - "description": "Edit images from a plain-language instruction. Requests return a\ngeneration id to poll with `GET /v2/generations/{generation_id}`.\n", - "externalDocs": { - "description": "Find out more", - "url": "https://docs.ideogram.ai" - }, - "name": "images-edit" - }, - { - "description": "Asynchronous image-editing workflows that return results through generation polling.", - "externalDocs": { - "description": "Find out more", - "url": "https://docs.ideogram.ai" - }, - "name": "edit-workflow" - }, - { - "description": "Create styled fashion product imagery from product references.", - "externalDocs": { - "description": "Find out more", - "url": "https://docs.ideogram.ai" - }, - "name": "lookbook" - }, - { - "description": "Edit a masked region while preserving the rest of the source image.", - "externalDocs": { - "description": "Find out more", - "url": "https://docs.ideogram.ai" - }, - "name": "precise-masked-edit" - }, - { - "description": "Generate images with a specific model contract. Requests are JSON\n(Ideogram 3.0 also accepts multipart for style reference bytes) and\nreturn a generation id that can be polled via\n`GET /v2/generations/{generation_id}`.\n", - "externalDocs": { - "description": "Find out more", - "url": "https://docs.ideogram.ai" - }, - "name": "images-generate" - }, - { - "description": "Transform an image with a specific model, guided by a prompt.\n", - "externalDocs": { - "description": "Find out more", - "url": "https://docs.ideogram.ai" - }, - "name": "images-remix" - }, - { - "description": "Edit source images at the source's own width and height. These endpoints never reframe: the output always matches the image you sent.", - "name": "images-precise-edit" - }, - { - "description": "Repaint a masked region of an image with a specific model.\n", - "externalDocs": { - "description": "Find out more", - "url": "https://docs.ideogram.ai" - }, - "name": "images-inpaint" - }, - { - "description": "Outcome-focused image tools with implementation details managed by Ideogram.", - "externalDocs": { - "description": "Find out more", - "url": "https://docs.ideogram.ai" - }, - "name": "tool" - }, - { - "description": "Model-agnostic endpoints where the server selects the model for each\nrequest. Requests are JSON and return a generation id that can be\npolled via `GET /v2/generations/{generation_id}`.\n", - "externalDocs": { - "description": "Find out more", - "url": "https://docs.ideogram.ai" - }, - "name": "auto-model" - }, - { - "description": "Expand an existing image to a new model-specific output shape while\npreserving the source content and filling the new area.\n", - "externalDocs": { - "description": "Find out more", - "url": "https://docs.ideogram.ai" - }, - "name": "images-reframe" - } - ], "paths": { - "/datasets": { - "get": { - "description": "Lists datasets for the authenticated user, most recently updated first. Supports an optional case-insensitive name search.\n", - "operationId": "list_datasets", + "/v2/image/precise-edit/ideogram-4-5": { + "post": { + "operationId": "imagesPreciseEdit_post_precise_edit_image_v2_ideogram45", + "summary": "Precise edit with Ideogram 4.5", + "description": "Edit an image with Ideogram 4.5 and get the result back at that image's\nexact width and height. Upload the image as `image` using\n`multipart/form-data`, with optional `reference_images` and a `mask`.\nReturns results directly by default; set `async` or supply a\n`webhook_url` to get a `generation_id` and poll\n`GET /v2/generations/{generation_id}`.\n\n`context_window` confines the edit to one region of the image, so a\nlarge image keeps its detail: pass `y_min,x_min,y_max,x_max`, or `auto`\ntogether with a `mask`. The result always keeps the image's own width\nand height.\n", + "tags": [ + "images-precise-edit" + ], "parameters": [ { - "description": "Case-insensitive substring to match against dataset names. When omitted, datasets are not filtered by name.\n", + "name": "dry_run", "in": "query", - "name": "search", + "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", "required": false, "schema": { - "maxLength": 64, - "type": "string" + "type": "boolean", + "default": false } } ], "responses": { "200": { + "description": "The edited images (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests).", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ListDatasetsResponse" + "$ref": "#/components/schemas/PreciseEditImageIdeogram45Response" } } - }, - "description": "Datasets retrieved successfully" - }, - "401": { - "description": "Unauthorized" - } - }, - "summary": "List datasets", - "tags": [ - "datasets" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.datasets_controller" - }, - "post": { - "description": "Creates a new dataset", - "operationId": "create_dataset", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateDatasetRequest" - } } }, - "description": "Request to create a new dataset", - "required": true, - "x-body-name": "create_dataset_request" - }, - "responses": { - "200": { + "400": { + "description": "Invalid input provided.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Dataset" + "description": "Any type" } } - }, - "description": "Dataset created successfully" - }, - "400": { - "description": "Bad request" + } }, "401": { - "description": "Unauthorized" - } - }, - "summary": "Create a new dataset", - "tags": [ - "datasets" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.datasets_controller" - } - }, - "/datasets/{dataset_id}": { - "get": { - "description": "Returns a dataset by ID, including the total number of files and a list of each file's name and size in bytes.\n", - "operationId": "get_dataset", - "parameters": [ - { - "in": "path", - "name": "dataset_id", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { + "description": "Unauthorized.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetDatasetResponse" + "description": "Any type" } } - }, - "description": "Dataset retrieved successfully" - }, - "401": { - "description": "Unauthorized" - }, - "404": { - "description": "Dataset not found" - } - }, - "summary": "Get a dataset", - "tags": [ - "datasets" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.datasets_controller" - } - }, - "/datasets/{dataset_id}/train_model": { - "post": { - "description": "Start training a custom model from a dataset. The dataset must contain at least 15 images and a maximum of 100 images. Returns the model ID and training status.\n", - "operationId": "train_dataset_model", - "parameters": [ - { - "in": "path", - "name": "dataset_id", - "required": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TrainDatasetModelRequest" - } } }, - "description": "Training configuration", - "required": true, - "x-body-name": "train_dataset_model_request" - }, - "responses": { - "200": { + "402": { + "description": "Insufficient credits or quota.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TrainDatasetModelResponse" + "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Training started successfully" - }, - "400": { - "description": "Bad request" - }, - "401": { - "description": "Unauthorized" - }, - "404": { - "description": "Dataset not found" - } - }, - "summary": "Train a model from a dataset", - "tags": [ - "datasets" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.datasets_controller" - } - }, - "/datasets/{dataset_id}/upload_assets": { - "post": { - "description": "Upload image assets to a dataset for model training. Accepts individual images (JPEG, PNG, WebP), optional .txt caption sidecar files, and/or ZIP archives containing images and captions. A dataset can contain up to 100 images.\n", - "operationId": "upload_dataset_assets", - "parameters": [ - { - "in": "path", - "name": "dataset_id", - "required": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "multipart/form-data": { - "schema": { - "$ref": "#/components/schemas/UploadDatasetAssetsRequest" - } } }, - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { + "422": { + "description": "The prompt did not pass safety checks.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UploadDatasetAssetsResponse" + "description": "Any type" } } - }, - "description": "Upload summary" - }, - "400": { - "description": "Bad request" - }, - "401": { - "description": "Unauthorized" + } }, - "404": { - "description": "Dataset not found" - } - }, - "summary": "Upload assets to a dataset", - "tags": [ - "datasets" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.datasets_controller" - } - }, - "/describe": { - "post": { - "description": "Describe an image.\n\nSupported image formats include JPEG, PNG, and WebP.\n", - "operationId": "post_describe", - "requestBody": { - "content": { - "multipart/form-data": { - "schema": { - "$ref": "#/components/schemas/DescribeRequest" + "429": { + "description": "Too many requests.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerationErrorResponse" + } } } }, - "required": true - }, - "responses": { - "200": { + "500": { + "description": "Internal server error.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DescribeResponse" + "description": "Any type" } } - }, - "description": "Description(s) created successfully." - }, - "400": { - "description": "Invalid input provided." + } }, - "422": { + "503": { + "description": "The endpoint is temporarily unavailable.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ImageSafetyError" + "description": "Any type" } } - }, - "description": "Image failed the safety check." - }, - "429": { - "description": "Too many requests." + } } }, - "summary": "Describe", - "tags": [ - "vision" - ], - "x-fern-examples": [ - { - "code-samples": [ - { - "sdk": "curl", - "code": "curl -X POST https://api.ideogram.ai/describe \\\n -H \"Api-Key: \" \\\n -H \"Content-Type: multipart/form-data\" \\\n -F image_file=@\n" - } - ] - } - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.vision_controller" - } - }, - "/edit": { - "post": { - "description": "Edit a given image synchronously using the provided mask. The mask indicates which part of the image\nshould be edited, while the prompt and chosen style type can further guide the edit.\n\nSupported image formats include JPEG, PNG, and WebP.\n\nImages links are available for a limited period of time; if you would like to keep the image, you must download it.\n", - "operationId": "post_edit_image", "requestBody": { + "description": "A request to edit an image with Ideogram 4.5 at that image's own size. Send it as `multipart/form-data` with the `image` to edit and any `reference_images` and `mask`.", "content": { "multipart/form-data": { - "encoding": { - "prompt": { - "contentType": "text/plain", - "style": "form" - }, - "model": { - "contentType": "text/plain", - "style": "form" - }, - "magic_prompt_option": { - "contentType": "text/plain", - "style": "form" - }, - "seed": { - "contentType": "text/plain", - "style": "form" - }, - "style_type": { - "contentType": "text/plain", - "style": "form" - } - }, "schema": { - "$ref": "#/components/schemas/EditImageRequest" - } + "type": "object", + "properties": { + "prompt": { + "type": "string", + "minLength": 1, + "maxLength": 10000, + "description": "The edit instruction, in natural language or as a structured JSON\nprompt. Natural language is automatically converted into a\nstructured prompt; valid structured JSON is used as is.\n" + }, + "image": { + "type": "string", + "format": "binary", + "description": "The image to edit, as raw bytes (max 50MB; JPEG, PNG, or WEBP). Multipart requests only; ignored if `image_asset_identifier` is also supplied. The output always matches this image's width and height, and pixels the edit did not meaningfully change are copied exactly from it." + }, + "reference_images": { + "type": "array", + "items": { + "type": "string", + "format": "binary" + }, + "description": "Optional images to guide the edit (max 4, max 50MB each; JPEG, PNG, or WEBP). They are never edited themselves; only `image` is. Multipart requests only; ignored if `reference_image_asset_identifiers` is also supplied. A request with a `mask` can include at most three, because the mask takes up one reference slot." + }, + "mask": { + "type": "string", + "format": "binary", + "description": "An optional mask that limits the edit to part of `image` (max 50MB; JPEG, PNG, or WEBP). Multipart requests only. Black marks the area to edit and white the area to keep; values in between are rounded to the nearer of the two. The mask must have the same width and height as the image being edited and contain both black and white areas. A masked request can include at most three reference images." + }, + "context_window": { + "type": "string", + "pattern": "^(none|auto|[0-9]+,[0-9]+,[0-9]+,[0-9]+)$", + "default": "none", + "description": "Which region of the image to edit.\n`none`, the default, edits the whole image. A large image may come back smaller than it was sent.\n`auto` requires a `mask` and automatically selects an appropriate context region around the masked area.\n`y_min,x_min,y_max,x_max` names the region explicitly, by its corners. Rows come first, matching the `bbox` ordering used elsewhere in this API, and the values are the edited image's own pixels with the origin at its top-left corner. For example `512,1024,2048,3072` is the region 2048 pixels wide and 1536 tall whose top-left corner is 1024 across and 512 down. The maximum edges are exclusive, so the region measures `x_max - x_min` by `y_max - y_min`. It must lie inside the image, measure at least 256px on each side, have an aspect ratio between 1:6 and 6:1, and cover no more than 4194304 pixels. A `mask` may select only pixels inside it.\nWith `auto` or an explicit region, only that region changes and the output keeps the image's own width and height." + }, + "quality": { + "$ref": "#/components/schemas/V2ImagePreciseEditIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality", + "default": "medium", + "description": "The rendering quality to use. `very_low` is the fastest and cheapest, and `high` takes longer and is priced higher." + }, + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." + }, + "num_images": { + "type": "integer", + "minimum": 1, + "maximum": 8, + "default": 1, + "description": "The number of images to generate." + }, + "enable_copyright_detection": { + "type": [ + "boolean", + "null" + ], + "description": "Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`." + }, + "async": { + "type": "boolean", + "default": false, + "description": "When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result." + }, + "webhook_url": { + "type": "string", + "format": "uri", + "maxLength": 2048, + "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n" + } + }, + "required": [ + "prompt", + "image" + ] + } } - }, - "description": "A request to edit an image with Ideogram.", - "required": true, - "x-body-name": "body" + } }, + "security": [ + { + "ApiKeyAuth": [] + } + ] + } + }, + "/v2/image/generate/auto": { + "post": { + "operationId": "autoModel_post_generate_image_v2_auto", + "summary": "Generate with automatic model selection", + "description": "Generate images with the model Ideogram picks as best suited to each\nrequest. Optionally upload source images as `images` using\n`multipart/form-data` to edit them with the prompt. Returns results\ndirectly by default; set `async` to get a `generation_id` and poll\n`GET /v2/generations/{generation_id}`.\n", + "tags": [ + "auto-model" + ], + "parameters": [ + { + "name": "dry_run", + "in": "query", + "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", + "required": false, + "schema": { + "type": "boolean", + "default": false + } + } + ], "responses": { "200": { + "description": "The generated images (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests).", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageResponse" + "$ref": "#/components/schemas/GenerateImageV2AutoResponse" } } - }, - "description": "Image edits generated successfully." + } }, "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Not authorized to generate an image." - }, - "422": { + "description": "Invalid input provided.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageSafetyError" + "description": "Any type" } } - }, - "description": "Prompt or Initial Image failed the safety checks." + } }, - "429": { - "description": "Too many requests." - } - }, - "summary": "Edit (legacy)", - "tags": [ - "generate" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.generate_controller" - } - }, - "/generate": { - "post": { - "description": "Generates images synchronously based on a given prompt and optional parameters.\n\nImages links are available for a limited period of time; if you would like to keep the image, you must download it.\n", - "operationId": "post_generate_image", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateImageRequest" + "401": { + "description": "Unauthorized.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } } } }, - "description": "A request to generate an image with Ideogram.", - "required": true, - "x-body-name": "generate_image_request" - }, - "responses": { - "200": { + "402": { + "description": "Insufficient credits or quota.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageResponse" + "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Image(s) generated successfully." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Not authorized to generate an image." + } }, - "422": { + "404": { + "description": "A source image was not found.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageSafetyError" + "description": "Any type" } } - }, - "description": "Prompt failed the safety check." - }, - "429": { - "description": "Too many requests." - } - }, - "summary": "Generate (legacy)", - "tags": [ - "generate" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.generate_controller" - } - }, - "/integration-assets/{external_ref}": { - "get": { - "description": "Redeems the short-lived signed delivery reference returned by an integration asset search and streams the asset's media bytes. The signed reference is the sole authorization for this endpoint; it is rejected once it expires or when the integration it names has changed.", - "operationId": "get_integration_asset_delivery", - "parameters": [ - { - "description": "Signed delivery reference from a search response.", - "in": "path", - "name": "external_ref", - "required": true, - "schema": { - "minLength": 1, - "type": "string" } - } - ], - "responses": { - "200": { + }, + "422": { + "description": "The prompt did not pass safety checks, or the request combined source images with text-to-image-only fields.", "content": { - "application/octet-stream": { + "application/json": { "schema": { - "format": "binary", - "type": "string" + "description": "Any type" } } - }, - "description": "The asset's media bytes. The Content-Type header carries the asset's media type, and the response is never cacheable by shared caches." + } }, - "404": { + "429": { + "description": "Too many requests.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/IntegrationErrorResponse" + "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "The delivery reference is invalid or has expired." + } }, - "409": { + "500": { + "description": "Internal server error.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/IntegrationErrorResponse" + "description": "Any type" } } - }, - "description": "The referenced integration changed after the search." + } }, "503": { + "description": "The endpoint is temporarily unavailable.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/IntegrationErrorResponse" + "description": "Any type" } } - }, - "description": "Integration delivery is not available." + } } }, - "security": [], - "summary": "Fetch the media bytes for an integration asset", - "tags": [ - "integrations" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.integrations_controller" + "requestBody": { + "description": "A request to generate images with an automatically selected model. Send it as `application/json`, or as `multipart/form-data` to include source `images`.", + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "prompt": { + "type": "string", + "minLength": 1, + "maxLength": 10000, + "description": "The prompt to generate images from or, when source images are supplied, the change to make to them." + }, + "images": { + "type": "array", + "items": { + "type": "string", + "format": "binary" + }, + "description": "Optional source images to edit (max 10, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only." + }, + "negative_prompt": { + "type": "string", + "maxLength": 10000, + "description": "Description of what to exclude from the images. The prompt takes precedence over the negative prompt. Not every model uses it. Cannot be combined with source images." + }, + "aspect_ratio": { + "type": "string", + "pattern": "^(auto|[1-9][0-9]{0,4}x[1-9][0-9]{0,4})$", + "default": "auto", + "description": "The output aspect ratio. `auto` (the default) picks the most suitable ratio for the request. Without source images the value must be a supported ratio (for example \"16x9\" or \"1x1\"); with source images any \"WIDTHxHEIGHT\" value is accepted and the output uses the closest supported shape. Omit `resolution` when supplying a non-`auto` value." + }, + "resolution": { + "type": "string", + "pattern": "^[1-9][0-9]{1,4}x[1-9][0-9]{1,4}$", + "description": "The requested output resolution, formatted as \"WIDTHxHEIGHT\" (for example \"1280x800\"). The output is served at the closest resolution the selected model supports. Omit `aspect_ratio` (or leave it `auto`) when supplying a resolution." + }, + "resolution_tier": { + "$ref": "#/components/schemas/V2ImageGenerateAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier", + "description": "The output resolution tier. Affects which model serves the request, since not every model offers every tier. When omitted, the selected model's default tier is used." + }, + "magic_prompt": { + "$ref": "#/components/schemas/MagicPromptMode", + "default": "auto", + "description": "Controls magic prompt (automatic prompt rewriting). Defaults to `auto`." + }, + "num_images": { + "type": "integer", + "minimum": 1, + "maximum": 8, + "default": 1, + "description": "The number of images to generate." + }, + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." + }, + "private": { + "type": "boolean", + "description": "Whether the generated images should be kept private. When omitted, the default follows the caller's plan; some plans always generate privately." + }, + "async": { + "type": "boolean", + "default": false, + "description": "When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result." + } + }, + "required": [ + "prompt" + ] + } + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + } + ] } }, - "/internal-testing": { + "/v2/image/generate/ideogram-4-5": { "post": { - "description": "Just a testing endpoint\n", - "operationId": "post_internal_testing", + "operationId": "imagesGenerate_post_generate_image_v2_ideogram45", + "summary": "Generate with Ideogram 4.5", + "description": "Generate images with Ideogram 4.5 from a natural-language or structured\nJSON prompt. Optionally upload source images as `images` using\n`multipart/form-data` to edit them with the prompt. Returns results\ndirectly by default; set `async` or supply a `webhook_url` to get a\n`generation_id` and poll `GET /v2/generations/{generation_id}`.\n", + "tags": [ + "images-generate" + ], "parameters": [ { - "description": "Test header", - "explode": false, - "in": "header", - "name": "X-Test-Header", - "required": false, - "schema": { - "type": "string" - }, - "style": "simple" - }, - { - "description": "Test header", - "explode": false, - "in": "header", - "name": "X-Test-Header-2", + "name": "dry_run", + "in": "query", + "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", "required": false, "schema": { - "type": "string" - }, - "style": "simple" + "type": "boolean", + "default": false + } } ], - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "x_position": { - "contentType": "text/plain", - "style": "form" - }, - "some_text": { - "contentType": "text/plain", - "style": "form" - }, - "nested_object": { - "contentType": "application/json", - "style": "form" - }, - "repeated_complex_field": { - "contentType": "application/json", - "style": "form" - } - }, - "schema": { - "$ref": "#/components/schemas/InternalTestingRequest" - } - } - }, - "description": "A request for testing.", - "required": true - }, "responses": { "200": { + "description": "The generated images (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests).", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/postInternalTesting_200_response" + "$ref": "#/components/schemas/GenerateImageIdeogram45Response" } } - }, - "description": "Success" - } - }, - "security": [], - "summary": "Testing", - "tags": [ - "internal-testing" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.internal_testing_controller" - } - }, - "/internal/batch": { - "post": { - "description": "Runs automated evaluation of multiple LLM models and system prompts for magic prompt generation. \nGenerates images using large batches of user prompt inputs. Internal use only (feature flagged).\n", - "operationId": "post_batch", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InternalBatchRequest" - } } }, - "description": "A request for batch magic prompt evalution.", - "required": true, - "x-body-name": "internal_batch_request" - }, - "responses": { - "200": { + "400": { + "description": "Invalid input provided.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/InternalBatchResponse" + "description": "Any type" } } - }, - "description": "Batch magic prompt evalution completed successfully." - }, - "400": { - "description": "Invalid input provided." + } }, "401": { - "description": "Not authorized for batch magic prompt evalution." - }, - "429": { - "description": "Too many requests." - }, - "500": { - "description": "Internal server error." - } - }, - "summary": "Initiate Batch Magic Prompt Evalution", - "tags": [ - "batch" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.batch_controller" - } - }, - "/internal/batch/get-maybe-batch-results/{job_id}": { - "get": { - "description": "Gets the results of a batch magic prompt job if available.\n", - "operationId": "get_maybe_batch_results", - "parameters": [ - { - "description": "The ID of the batch job to check results for", - "explode": false, - "in": "path", - "name": "job_id", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - } - ], - "responses": { - "200": { + "description": "Unauthorized.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/InternalBatchResultsResponse" + "description": "Any type" } } - }, - "description": "Batch magic prompt job results if available." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Not authorized for batch magic prompt job results request." - }, - "429": { - "description": "Too many requests." + } }, - "500": { - "description": "Internal server error." - } - }, - "summary": "Get Batch Magic Prompt Job Results if available.", - "tags": [ - "batch" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.batch_controller" - } - }, - "/magic-prompt": { - "post": { - "description": "Transforms basic prompts into a magic prompt. Internal use only (feature flagged). TODO: update description if enabled externally.\n", - "operationId": "post_magic_prompt", - "requestBody": { - "content": { - "multipart/form-data": { - "schema": { - "$ref": "#/components/schemas/MagicPromptRequest" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/MagicPromptRequest" + "402": { + "description": "Insufficient credits or quota.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerationErrorResponse" + } } } }, - "description": "A request to generate a magic prompt", - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { + "422": { + "description": "The prompt did not pass safety checks.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MagicPromptResponse" + "description": "Any type" } } - }, - "description": "Magic prompt generated successfully." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Not authorized to generate magic prompts." + } }, "429": { - "description": "Too many requests." + "description": "Too many requests.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerationErrorResponse" + } + } + } }, "500": { - "description": "Internal server error." + "description": "Internal server error.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } + }, + "503": { + "description": "The endpoint is temporarily unavailable.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } } }, - "summary": "Generate Magic Prompt", - "tags": [ - "prompt" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.prompt_controller" + "requestBody": { + "description": "A request to generate images with Ideogram 4.5. Send it as `application/json`, or as `multipart/form-data` to include source `images`.", + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "prompt": { + "type": "string", + "minLength": 1, + "maxLength": 10000, + "description": "The prompt to generate images from, or the edit instruction when\nsource images are supplied. Natural language or a structured\nIdeogram 4.0 JSON prompt.\n" + }, + "magic_prompt": { + "$ref": "#/components/schemas/MagicPromptMode", + "default": "auto", + "description": "Controls how a natural-language prompt is prepared. `auto` (the\ndefault) and `on` rewrite and expand the prompt before generation.\n`off` keeps your wording and only converts it into a structured\nprompt. A valid structured JSON prompt skips magic prompt unless\n`magic_prompt` is `on`. With source images, every mode converts\nthe edit instruction into a structured edit prompt.\n" + }, + "images": { + "type": "array", + "items": { + "type": "string", + "format": "binary" + }, + "description": "Optional source images to edit (max 5, max 25MB each; JPEG, PNG, or WEBP). The first image is the one being edited; any others are extra references. Multipart requests only." + }, + "mask": { + "type": "string", + "format": "binary", + "description": "An optional mask that limits the edit to part of the first source image (max 25MB; JPEG, PNG, or WEBP). Multipart requests only. Black marks the area to edit and white the area to keep; values in between are rounded to the nearer of the two. The mask must have the same width and height as the first source image and contain both black and white areas. A masked request can include at most three other source images. With a mask, the output is always the first source image's own size, so `size` cannot be set." + }, + "size": { + "type": [ + "string", + "null" + ], + "default": "auto", + "description": "The output size: \"auto\", \"source\" or an exact \"WIDTHxHEIGHT\".\n\nWithout source images, an exact size must be one of the supported\n1K/2K presets (for example 1024x1024, 2048x2048 or 1440x2880);\n\"auto\" or omitted picks a supported size based on the prompt.\n\"source\" is rejected.\n\nWith source images, \"auto\" (the default) picks a supported 2K size\nbased on the source images and the prompt, and \"source\" returns the\noutput at the first source image's own width and height (scaled\ndown, keeping its proportions, if it is too large for the model).\nEvery source image's aspect ratio must be between 1:6 and 6:1.\n\nAn exact size must have both sides a multiple of 32 and at least\n256px, a total of at most 2048x2048 pixels, and an aspect ratio of\nat most 6:1. With source images, an exact size reshapes the source\nto it.\n\nPricing is tiered by the resolved output pixels: up to 1024x1024\nbills as 1K, above that as 2K. An \"auto\" size bills as 2K.\n" + }, + "background": { + "$ref": "#/components/schemas/V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaBackground", + "default": "auto", + "description": "The output background. `transparent` returns images with an alpha channel, `opaque` returns a solid one, and `auto` decides for you." + }, + "quality": { + "$ref": "#/components/schemas/V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality", + "description": "The rendering quality to use. Higher quality takes longer and costs more. Defaults to `medium` with source images and `high` without. `very_low`, the fastest and cheapest, requires source images." + }, + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." + }, + "num_images": { + "type": "integer", + "minimum": 1, + "maximum": 8, + "default": 1, + "description": "The number of images to generate." + }, + "enable_copyright_detection": { + "type": [ + "boolean", + "null" + ], + "description": "Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`." + }, + "async": { + "type": "boolean", + "default": false, + "description": "When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result." + }, + "webhook_url": { + "type": "string", + "format": "uri", + "maxLength": 2048, + "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n" + } + }, + "required": [ + "prompt" + ] + } + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + } + ] } }, - "/manage/api/add_credits": { + "/v2/image/generate/ideogram-4": { "post": { - "operationId": "post_add_credits_for_api", + "operationId": "imagesGenerate_post_generate_image_v2_ideogram_v4", + "summary": "Generate with Ideogram 4.0", + "description": "Generate images with Ideogram 4.0 from a natural-language or structured\nJSON prompt. Returns results directly by default; set `async` or supply\na `webhook_url` to get a `generation_id` and poll\n`GET /v2/generations/{generation_id}`.\n", + "tags": [ + "images-generate" + ], "parameters": [ { - "description": "Workspace to add credits to. The charge goes against the org's Stripe customer + Metronome customer.", + "name": "dry_run", "in": "query", - "name": "organization_id", - "required": true, + "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", + "required": false, "schema": { - "type": "string" + "type": "boolean", + "default": false } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PostAddCreditsRequest" - } - } - }, - "description": "A request to add credits to an API user's account.", - "required": true, - "x-body-name": "post_add_credits_request" - }, "responses": { "200": { + "description": "The generated images (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests).", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PostAddCreditsResponse" + "$ref": "#/components/schemas/GenerateImageIdeogramV4Response" } } - }, - "description": "API subscription content" + } }, "400": { + "description": "Invalid input provided.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PostAddCreditsError" + "description": "Any type" } } - }, - "description": "Bad request" + } }, "401": { - "description": "Not authorized" - }, - "403": { - "description": "Not authorized" - } - }, - "security": [ - { - "BearerAuth": [] - } - ], - "summary": "Add credits to an API user's account.", - "tags": [ - "manage" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.manage_controller" - } - }, - "/manage/api/api_keys": { - "get": { - "operationId": "get_api_keys", - "responses": { - "200": { + "description": "Unauthorized.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetApiKeysResponse" + "description": "Any type" } } - }, - "description": "API keys the user currently manages" - }, - "401": { - "description": "Not authorized" + } }, - "403": { - "description": "Not authorized" - } - }, - "security": [ - { - "BearerAuth": [] - } - ], - "summary": "Retrieve current API keys and their respective data.", - "tags": [ - "manage" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.manage_controller" - }, - "post": { - "operationId": "create_api_key", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateApiKeyRequest" + "402": { + "description": "Insufficient credits or quota.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerationErrorResponse" + } } } }, - "description": "Optional fields supplied when creating an API key.", - "required": false, - "x-body-name": "create_api_key_request" - }, - "responses": { - "200": { + "422": { + "description": "The prompt did not pass safety checks.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PostApiKeyResponse" + "description": "Any type" } } - }, - "description": "The newly created API key" - }, - "401": { - "description": "Not authorized" - }, - "402": { - "description": "Payment is required; did you create a subscription?" - } - }, - "security": [ - { - "BearerAuth": [] - } - ], - "summary": "Creates an API key.", - "tags": [ - "manage" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.manage_controller" - } - }, - "/manage/api/api_keys/{api_key_id}": { - "delete": { - "operationId": "delete_single_api_key", - "parameters": [ - { - "description": "The ID of API key to operate on. Expected to be a URL safe Base64 encoded UUID.", - "example": "d7abd0cd4ae94db78676e986a4ebd8dc", - "in": "path", - "name": "api_key_id", - "required": true, - "schema": { - "type": "string" } - } - ], - "responses": { - "204": { - "description": "Success" - }, - "400": { - "description": "Something went wrong" }, - "401": { - "description": "Not authorized" - } - }, - "security": [ - { - "BearerAuth": [] - } - ], - "summary": "Delete an API key.", - "tags": [ - "manage" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.manage_controller" - }, - "patch": { - "operationId": "update_single_api_key", - "parameters": [ - { - "description": "The ID of API key to operate on. Expected to be a URL safe Base64 encoded UUID.", - "example": "d7abd0cd4ae94db78676e986a4ebd8dc", - "in": "path", - "name": "api_key_id", - "required": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PatchApiKeyRequest" + "429": { + "description": "Too many requests.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerationErrorResponse" + } } } }, - "description": "New label value for the API key.", - "required": true, - "x-body-name": "patch_api_key_request" - }, - "responses": { - "200": { + "500": { + "description": "Internal server error.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ApiProfileApiKey" + "description": "Any type" } } - }, - "description": "The updated API key." - }, - "400": { - "description": "Invalid request." - }, - "401": { - "description": "Not authorized." + } }, - "404": { - "description": "API key not found." - } - }, - "security": [ - { - "BearerAuth": [] - } - ], - "summary": "Update an API key's user-supplied label.", - "tags": [ - "manage" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.manage_controller" - } - }, - "/manage/api/api_keys_v2": { - "post": { - "operationId": "create_api_key_v2", - "parameters": [ - { - "description": "Base64 encoded organization ID to create the API key for", - "in": "query", - "name": "organization_id", - "required": true, - "schema": { - "type": "string" + "503": { + "description": "The endpoint is temporarily unavailable.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } } } - ], + }, "requestBody": { + "description": "A request to generate images with Ideogram 4.0.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateApiKeyRequest" + "$ref": "#/components/schemas/GenerateImageIdeogramV4Request" } } - }, - "description": "Optional fields supplied when creating an API key.", - "required": false, - "x-body-name": "create_api_key_request" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateApiKeyResponse" - } - } - }, - "description": "API key created successfully" - }, - "401": { - "description": "Not authorized" - }, - "402": { - "description": "Payment is required before creating an API key." - }, - "403": { - "description": "Not authorized" } }, "security": [ { - "BearerAuth": [] + "ApiKeyAuth": [] } - ], - "summary": "Create an API key for a specific organization", - "tags": [ - "manage" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.manage_controller" + ] } }, - "/manage/api/credit_summary": { - "get": { - "description": "Returns the lifetime credit KPIs (consumed, expired, issued) used to\nrender the API credit dashboard strip. All values default to $0 when\nMetronome is unavailable so the FE can always render.\n", - "operationId": "get_api_credit_summary", + "/v2/image/generate/ideogram-4-custom-model": { + "post": { + "operationId": "imagesGenerate_post_generate_image_v2_ideogram_v4_custom_model", + "summary": "Generate with a custom Ideogram 4.0 model", + "description": "Generate images with a custom Ideogram 4.0 model that you or your\norganization can access, selected by `custom_model_uri`. Returns results\ndirectly by default; set `async` or supply a `webhook_url` to get a\n`generation_id` and poll `GET /v2/generations/{generation_id}`.\n", + "tags": [ + "images-generate" + ], "parameters": [ { - "description": "Workspace to summarize credits for. The caller must be OWNER, ADMIN, or MEMBER of the org.", + "name": "dry_run", "in": "query", - "name": "organization_id", - "required": true, + "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", + "required": false, "schema": { - "type": "string" + "type": "boolean", + "default": false } } ], "responses": { "200": { + "description": "The generated images (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests).", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ManageApiCreditSummaryResponse" + "$ref": "#/components/schemas/GenerateImageIdeogramV4CustomModelResponse" } } - }, - "description": "API credit summary content" + } }, - "401": { - "description": "Not authorized" - }, - "403": { - "description": "Not authorized" - } - }, - "security": [ - { - "BearerAuth": [] - } - ], - "summary": "Lifetime credit totals for the API user's account.", - "tags": [ - "manage" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.manage_controller" - } - }, - "/manage/api/credits": { - "get": { - "operationId": "get_user_credits", - "parameters": [ - { - "description": "Base64 encoded organization ID to filter credit information for a specific organization", - "in": "query", - "name": "organization_id", - "required": true, - "schema": { - "type": "string" + "400": { + "description": "Invalid input or an unsupported model option.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } } }, - { - "description": "Start time to look back for calculating average daily spend and other metrics", - "in": "query", - "name": "start_time", - "required": true, - "schema": { - "format": "date-time", - "type": "string" + "401": { + "description": "Unauthorized.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } } }, - { - "description": "Inclusive end time to look back for calculating average daily spend and other metrics. If not provided, the current time will be used.", - "in": "query", - "name": "end_time", - "required": false, - "schema": { - "format": "date-time", - "type": "string" - } - } - ], - "responses": { - "200": { + "402": { + "description": "Insufficient credits or quota.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetUserCreditsResponse" + "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "User credit information retrieved successfully" - }, - "401": { - "description": "Not authorized" + } }, "403": { - "description": "Not authorized" - } - }, - "security": [ - { - "BearerAuth": [] - } - ], - "summary": "Retrieve user credit information and spending metrics", - "tags": [ - "manage" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.manage_controller" - } - }, - "/manage/api/organization/add_members": { - "post": { - "operationId": "add_organization_members", - "parameters": [ - { - "description": "Base64 encoded organization ID to add members to", - "in": "query", - "name": "organization_id", - "required": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AddOrganizationMembersRequest" + "description": "The custom model does not exist or is not accessible to this user or organization.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } } } }, - "description": "A request to add members to an organization.", - "required": true, - "x-body-name": "add_organization_members_request" - }, - "responses": { - "200": { + "422": { + "description": "The prompt did not pass safety checks.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/OrganizationMemberOperationResponse" + "description": "Any type" } } - }, - "description": "Results of adding members to the organization" - }, - "400": { - "description": "Bad Request" + } }, - "401": { - "description": "Not authorized" + "429": { + "description": "Too many requests.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerationErrorResponse" + } + } + } }, - "403": { - "description": "Not authorized - must be an organization owner" + "500": { + "description": "Internal server error.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, - "404": { - "description": "Organization not found" + "503": { + "description": "The endpoint is temporarily unavailable.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } + } + }, + "requestBody": { + "description": "A request to generate images with an accessible custom Ideogram 4.0 model.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerateImageIdeogramV4CustomModelRequest" + } + } } }, "security": [ { - "BearerAuth": [] + "ApiKeyAuth": [] } - ], - "summary": "Add members to a specific organization", - "tags": [ - "manage" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.manage_controller" + ] } }, - "/manage/api/organization/api_keys": { - "get": { - "operationId": "get_api_keys_v2", + "/v2/image/generate/ideogram-4-transparent": { + "post": { + "operationId": "imagesGenerate_post_generate_image_v2_ideogram_v4_transparent", + "summary": "Generate transparent images with Ideogram 4.0", + "description": "Generate images on a transparent background with Ideogram 4.0, delivered\nas PNGs with alpha. Returns results directly by default; set `async` or\nsupply a `webhook_url` to get a `generation_id` and poll\n`GET /v2/generations/{generation_id}`.\n", + "tags": [ + "images-generate" + ], "parameters": [ { - "description": "Base64 encoded organization ID to retrieve API keys for", + "name": "dry_run", "in": "query", - "name": "organization_id", - "required": true, + "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", + "required": false, "schema": { - "type": "string" + "type": "boolean", + "default": false } } ], "responses": { "200": { + "description": "The generated images (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests).", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerateImageIdeogramV4TransparentResponse" + } + } + } + }, + "400": { + "description": "Invalid input provided.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetApiKeysV2Response" + "description": "Any type" } } - }, - "description": "API keys retrieved successfully" + } }, "401": { - "description": "Not authorized" - }, - "403": { - "description": "Not authorized" + "description": "Unauthorized.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, - "404": { - "description": "Organization not found" - } - }, - "security": [ - { - "BearerAuth": [] - } - ], - "summary": "Retrieve API keys for a specific organization", - "tags": [ - "manage" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.manage_controller" - } - }, - "/manage/api/organization/billing_portal": { - "get": { - "operationId": "get_organization_billing_portal", - "parameters": [ - { - "description": "Base64 encoded organization ID to retrieve the billing portal for", - "in": "query", - "name": "organization_id", - "required": true, - "schema": { - "type": "string" + "402": { + "description": "Insufficient credits or quota.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerationErrorResponse" + } + } } - } - ], - "responses": { - "200": { + }, + "422": { + "description": "The prompt did not pass safety checks.", "content": { "application/json": { - "example": { - "has_stripe_setup": true, - "stripe_billing_url": "https://billing.stripe.com/p/session/test_123" - }, "schema": { - "$ref": "#/components/schemas/GetOrganizationBillingPortalResponse" + "description": "Any type" } } - }, - "description": "Billing portal URL retrieved successfully" + } }, - "401": { - "description": "Not authorized" + "429": { + "description": "Too many requests.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerationErrorResponse" + } + } + } }, - "403": { - "description": "Not authorized" + "500": { + "description": "Internal server error.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, - "404": { - "description": "Organization not found" + "503": { + "description": "The endpoint is temporarily unavailable.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } + } + }, + "requestBody": { + "description": "A request to generate transparent-background images with Ideogram 4.0.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerateImageIdeogramV4TransparentRequest" + } + } } }, "security": [ { - "BearerAuth": [] + "ApiKeyAuth": [] } - ], - "summary": "Retrieve the Stripe billing portal URL for a specific organization", - "tags": [ - "manage" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.manage_controller" + ] } }, - "/manage/api/organization/cancel_invite": { + "/v2/image/generate/ideogram-3": { "post": { - "operationId": "cancel_organization_invite", + "operationId": "imagesGenerate_post_generate_image_v2_ideogram_v3", + "summary": "Generate with Ideogram 3.0", + "description": "Generate images from a text prompt with Ideogram 3.0. Optional style\ncontrols include style codes, a style preset, a color palette, and style\nreferences (uploaded `style_reference_images`). Returns\nresults directly by default; set `async` or supply a `webhook_url` to\nget a `generation_id` and poll `GET /v2/generations/{generation_id}`.", + "tags": [ + "images-generate" + ], "parameters": [ { - "description": "Base64 encoded organization ID the invite belongs to", + "name": "dry_run", "in": "query", - "name": "organization_id", - "required": true, + "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", + "required": false, "schema": { - "type": "string" + "type": "boolean", + "default": false } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CancelOrganizationInviteRequest" - } - } - }, - "description": "A request to cancel a pending organization invite.", - "required": true, - "x-body-name": "cancel_organization_invite_request" - }, "responses": { "200": { + "description": "The generated images (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests).", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/OrganizationMemberOperationResult" + "$ref": "#/components/schemas/GenerateImageIdeogramV3Response" } } - }, - "description": "Result of cancelling the invite" + } }, "400": { - "description": "Bad Request" + "description": "Invalid input provided.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "401": { - "description": "Not authorized" + "description": "Unauthorized.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, - "403": { - "description": "Not authorized - must be an organization owner or admin" + "402": { + "description": "Insufficient credits or quota.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerationErrorResponse" + } + } + } }, "404": { - "description": "Organization or invite not found" - } - }, - "security": [ - { - "BearerAuth": [] - } - ], - "summary": "Cancel a pending invite for an organization", - "tags": [ - "manage" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.manage_controller" - } - }, - "/manage/api/organization/deactivate_api_key": { - "post": { - "operationId": "deactivate_organization_api_key", - "parameters": [ - { - "description": "Base64 encoded API key ID to deactivate", - "in": "query", - "name": "api_key_id", - "required": true, - "schema": { - "type": "string" + "description": "A referenced resource was not found.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } } - } - ], - "responses": { - "204": { - "description": "Success; no content." }, - "400": { - "description": "Bad Request" + "422": { + "description": "The prompt did not pass safety checks.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, - "401": { - "description": "Not authorized" + "429": { + "description": "Too many requests.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerationErrorResponse" + } + } + } }, - "403": { - "description": "Not authorized - must be an organization owner" + "500": { + "description": "Internal server error.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, - "404": { - "description": "API key not found" + "503": { + "description": "The endpoint is temporarily unavailable.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } + } + }, + "requestBody": { + "description": "A request to generate images with Ideogram 3.0. Send it as `application/json`, or as `multipart/form-data` to include `style_reference_images`.", + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "prompt": { + "type": "string", + "minLength": 1, + "maxLength": 10000, + "description": "The prompt to generate images from." + }, + "negative_prompt": { + "type": "string", + "maxLength": 10000, + "description": "Description of what to exclude from the images. The prompt takes precedence over the negative prompt." + }, + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." + }, + "resolution": { + "$ref": "#/components/schemas/ResolutionV3" + }, + "aspect_ratio": { + "$ref": "#/components/schemas/IdeogramV3AspectRatio" + }, + "rendering_speed": { + "$ref": "#/components/schemas/V2ImageGenerateIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed", + "default": "default", + "description": "The rendering speed to use." + }, + "magic_prompt": { + "$ref": "#/components/schemas/MagicPromptMode", + "default": "auto", + "description": "Controls magic prompt (automatic prompt rewriting). Defaults to `auto`." + }, + "num_images": { + "type": "integer", + "minimum": 1, + "maximum": 8, + "default": 1, + "description": "The number of images to generate." + }, + "color_palette": { + "$ref": "#/components/schemas/IdeogramColorPalette" + }, + "style_codes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/StyleCode" + }, + "description": "A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images." + }, + "style_type": { + "$ref": "#/components/schemas/IdeogramV3StyleType", + "default": "general" + }, + "style_preset": { + "$ref": "#/components/schemas/IdeogramV3StylePreset", + "description": "A predefined style preset to apply to the generated images. Cannot be combined with style codes or style references." + }, + "style_reference_images": { + "type": "array", + "items": { + "type": "string", + "format": "binary" + }, + "description": "Images to use as style references (max 10, max 25MB each; JPEG, PNG, or WEBP)." + }, + "enable_copyright_detection": { + "type": [ + "boolean", + "null" + ], + "description": "Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`." + }, + "async": { + "type": "boolean", + "default": false, + "description": "When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result." + }, + "webhook_url": { + "type": "string", + "format": "uri", + "maxLength": 2048, + "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n" + } + }, + "required": [ + "prompt" + ] + } + } } }, "security": [ { - "BearerAuth": [] + "ApiKeyAuth": [] } - ], - "summary": "Deactivate an API key for a specific organization", - "tags": [ - "manage" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.manage_controller" + ] } }, - "/manage/api/organization/demote_admins": { + "/v2/image/generate/ideogram-3-character": { "post": { - "operationId": "demote_organization_admins", + "operationId": "imagesGenerate_post_generate_image_v2_ideogram_v3_character", + "summary": "Generate a consistent character with Ideogram 3.0", + "description": "Generate images featuring a consistent character with Ideogram 3.0.\nUpload the character as `character_reference_images` using\n`multipart/form-data`. Returns\nresults directly by default; set `async` or supply a `webhook_url` to\nget a `generation_id` and poll `GET /v2/generations/{generation_id}`.\n", + "tags": [ + "images-generate" + ], "parameters": [ { - "description": "Base64 encoded organization ID. Must be an ENTERPRISE_PREPAID or ENTERPRISE_API workspace.", + "name": "dry_run", "in": "query", - "name": "organization_id", - "required": true, + "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", + "required": false, "schema": { - "type": "string" + "type": "boolean", + "default": false } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DemoteOrganizationAdminsRequest" - } - } - }, - "description": "A request to demote admins back to MEMBER role in an ENTERPRISE_PREPAID or ENTERPRISE_API organization. Caller must be OWNER — admins cannot demote other admins.", - "required": true, - "x-body-name": "demote_organization_admins_request" - }, "responses": { "200": { + "description": "The generated images (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests).", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/OrganizationMemberOperationResponse" + "$ref": "#/components/schemas/GenerateImageIdeogramV3CharacterResponse" } } - }, - "description": "Results of demoting admins" + } }, "400": { - "description": "Bad Request" + "description": "Invalid input provided.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "401": { - "description": "Not authorized" + "description": "Unauthorized.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, - "403": { - "description": "Not authorized - must be an organization owner" + "402": { + "description": "Insufficient credits or quota.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerationErrorResponse" + } + } + } }, "404": { - "description": "Organization not found" + "description": "A referenced resource was not found.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } + }, + "422": { + "description": "The prompt did not pass safety checks.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } + }, + "429": { + "description": "Too many requests.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerationErrorResponse" + } + } + } + }, + "500": { + "description": "Internal server error.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } + }, + "503": { + "description": "The endpoint is temporarily unavailable.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } + } + }, + "requestBody": { + "description": "A request to generate images of a consistent character with Ideogram 3.0. Send it as `multipart/form-data` to upload `character_reference_images` and any `style_reference_images`.", + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "prompt": { + "type": "string", + "minLength": 1, + "maxLength": 10000, + "description": "The prompt to generate images from." + }, + "negative_prompt": { + "type": "string", + "maxLength": 10000, + "description": "Description of what to exclude from the images. The prompt takes precedence over the negative prompt." + }, + "character_reference_images": { + "type": "array", + "items": { + "type": "string", + "format": "binary" + }, + "description": "An image of the character to feature (max 25MB; JPEG, PNG, or WEBP)." + }, + "character_reference_mask": { + "type": "string", + "format": "binary", + "description": "Optional grayscale mask marking where the character is in the character reference image, at the same size as that image (JPEG, PNG, or WEBP). Multipart requests only." + }, + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." + }, + "resolution": { + "$ref": "#/components/schemas/ResolutionV3" + }, + "aspect_ratio": { + "$ref": "#/components/schemas/IdeogramV3AspectRatio" + }, + "rendering_speed": { + "$ref": "#/components/schemas/V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed", + "default": "default", + "description": "The rendering speed to use." + }, + "magic_prompt": { + "$ref": "#/components/schemas/MagicPromptMode", + "default": "auto", + "description": "Controls magic prompt (automatic prompt rewriting). Defaults to `auto`." + }, + "num_images": { + "type": "integer", + "minimum": 1, + "maximum": 8, + "default": 1, + "description": "The number of images to generate." + }, + "style_type": { + "$ref": "#/components/schemas/V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType", + "default": "auto", + "description": "The style type to generate the character with. Defaults to `auto`." + }, + "style_reference_images": { + "type": "array", + "items": { + "type": "string", + "format": "binary" + }, + "description": "Images to use as style references (max 10, max 25MB each; JPEG, PNG, or WEBP)." + }, + "enable_copyright_detection": { + "type": [ + "boolean", + "null" + ], + "description": "Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`." + }, + "async": { + "type": "boolean", + "default": false, + "description": "When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result." + }, + "webhook_url": { + "type": "string", + "format": "uri", + "maxLength": 2048, + "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n" + } + }, + "required": [ + "prompt", + "character_reference_images" + ] + } + } } }, "security": [ { - "BearerAuth": [] + "ApiKeyAuth": [] } - ], - "summary": "Demote admins back to member role in an ENTERPRISE_PREPAID or ENTERPRISE_API organization", - "tags": [ - "manage" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.manage_controller" + ] } }, - "/manage/api/organization/list_invoices": { - "get": { - "operationId": "list_organization_invoices", + "/v2/image/generate/ideogram-3-custom-model": { + "post": { + "operationId": "imagesGenerate_post_generate_image_v2_ideogram_v3_custom_model", + "summary": "Generate with a custom Ideogram 3.0 model", + "description": "Generate images with a custom Ideogram 3.0 model that you or your\norganization can access, selected by `custom_model_uri`. Returns results\ndirectly by default; set `async` or supply a `webhook_url` to get a\n`generation_id` and poll `GET /v2/generations/{generation_id}`.\n", + "tags": [ + "images-generate" + ], "parameters": [ { - "description": "Base64 encoded organization ID to retrieve invoices for", + "name": "dry_run", "in": "query", - "name": "organization_id", - "required": true, + "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", + "required": false, "schema": { - "type": "string" + "type": "boolean", + "default": false } } ], "responses": { "200": { + "description": "The generated images (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests).", "content": { "application/json": { - "example": { - "invoices": [ - { - "start_time": "2024-01-01T00:00:00+00:00", - "end_time": "2024-01-31T23:59:59+00:00", - "total_spend": { - "currency_code": "USD", - "amount": 15000 - }, - "status": "PAID", - "issued_time": "2024-02-01T00:00:00+00:00", - "invoice_paid_date": "2024-02-05T10:30:00+00:00", - "line_items": [ - { - "charge_name": "Image Generation - V3", - "quantity": 1000, - "unit_price": { - "currency_code": "USD", - "amount": 10 - }, - "total": { - "currency_code": "USD", - "amount": 10000 - } - }, - { - "charge_name": "Upscale Image - V1", - "quantity": 500, - "unit_price": { - "currency_code": "USD", - "amount": 10 - }, - "total": { - "currency_code": "USD", - "amount": 5000 - } - } - ] - } - ] - }, "schema": { - "$ref": "#/components/schemas/ListOrganizationInvoicesResponse" + "$ref": "#/components/schemas/GenerateImageIdeogramV3CustomModelResponse" } } - }, - "description": "Invoices retrieved successfully" + } }, - "401": { - "description": "Not authorized" + "400": { + "description": "Invalid input or an unsupported model option.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, - "403": { - "description": "Not authorized" - }, - "404": { - "description": "Organization not found" - } - }, - "security": [ - { - "BearerAuth": [] - } - ], - "summary": "Retrieve invoices for a specific organization", - "tags": [ - "manage" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.manage_controller" - } - }, - "/manage/api/organization/members": { - "get": { - "description": "Returns both active members and pending invites for the organization. A pending invite is identified by a non-null invite_status (e.g. PENDING); active members have a null invite_status.", - "operationId": "get_organization_members", - "parameters": [ - { - "description": "Base64 encoded organization ID to retrieve members for", - "in": "query", - "name": "organization_id", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { + "401": { + "description": "Unauthorized.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetOrganizationMembersResponse" + "description": "Any type" } } - }, - "description": "Organization members retrieved successfully" + } }, - "401": { - "description": "Not authorized" + "402": { + "description": "Insufficient credits or quota.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerationErrorResponse" + } + } + } }, "403": { - "description": "Not authorized" + "description": "The custom model does not exist or is not accessible to this user or organization.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "404": { - "description": "Organization not found" - } - }, - "security": [ - { - "BearerAuth": [] - } - ], - "summary": "Retrieve members of a specific organization", - "tags": [ - "manage" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.manage_controller" - } - }, - "/manage/api/organization/promote_admins": { - "post": { - "operationId": "promote_organization_admins", - "parameters": [ - { - "description": "Base64 encoded organization ID. Must be an ENTERPRISE_PREPAID or ENTERPRISE_API workspace.", - "in": "query", - "name": "organization_id", - "required": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PromoteOrganizationAdminsRequest" + "description": "A requested resource was not found.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } } } }, - "description": "A request to promote members to ADMIN role in an ENTERPRISE_PREPAID or ENTERPRISE_API organization. Caller must be OWNER or ADMIN.", - "required": true, - "x-body-name": "promote_organization_admins_request" - }, - "responses": { - "200": { + "422": { + "description": "The prompt did not pass safety checks.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/OrganizationMemberOperationResponse" + "description": "Any type" } } - }, - "description": "Results of promoting members to admin" - }, - "400": { - "description": "Bad Request" + } }, - "401": { - "description": "Not authorized" + "429": { + "description": "Too many requests.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerationErrorResponse" + } + } + } }, - "403": { - "description": "Not authorized - must be an organization owner or admin" + "500": { + "description": "Internal server error.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, - "404": { - "description": "Organization not found" + "503": { + "description": "The endpoint is temporarily unavailable.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } + } + }, + "requestBody": { + "description": "A request to generate images with an accessible custom Ideogram 3.0 model. Send it as `application/json`, or as `multipart/form-data` to include `style_reference_images`.", + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "prompt": { + "type": "string", + "minLength": 1, + "maxLength": 10000, + "description": "The prompt to generate images from." + }, + "custom_model_uri": { + "type": "string", + "pattern": "^model/[^/]+/version/[^/]+$", + "minLength": 1, + "maxLength": 512, + "description": "The custom model URI, in the form `model//version/`. You or your organization must have access to the model. The model determines which rendering speeds are supported and whether backgrounds are removed automatically." + }, + "transparent_background": { + "type": "boolean", + "default": false, + "description": "Remove the background after generation and return transparent PNG images. Included in the custom model generation price at no extra charge. When false, the model's automatic background removal behavior still applies." + }, + "negative_prompt": { + "type": "string", + "maxLength": 10000, + "description": "Description of what to exclude from the images. The prompt takes precedence over the negative prompt." + }, + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." + }, + "resolution": { + "$ref": "#/components/schemas/ResolutionV3" + }, + "aspect_ratio": { + "$ref": "#/components/schemas/IdeogramV3AspectRatio" + }, + "rendering_speed": { + "$ref": "#/components/schemas/V2ImageGenerateIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed", + "description": "The rendering speed to use. When omitted, a speed supported by the custom model is used." + }, + "magic_prompt": { + "$ref": "#/components/schemas/MagicPromptMode", + "default": "auto", + "description": "Controls magic prompt (automatic prompt rewriting). Defaults to `auto`." + }, + "num_images": { + "type": "integer", + "minimum": 1, + "maximum": 8, + "default": 1, + "description": "The number of images to generate." + }, + "color_palette": { + "$ref": "#/components/schemas/IdeogramColorPalette" + }, + "style_codes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/StyleCode" + }, + "description": "A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images." + }, + "style_preset": { + "$ref": "#/components/schemas/IdeogramV3StylePreset", + "description": "A predefined style preset to apply to the generated images. Cannot be combined with style codes or style references." + }, + "style_reference_images": { + "type": "array", + "items": { + "type": "string", + "format": "binary" + }, + "description": "Images to use as style references (max 10, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only." + }, + "enable_copyright_detection": { + "type": [ + "boolean", + "null" + ], + "description": "Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`." + }, + "async": { + "type": "boolean", + "default": false, + "description": "When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result." + }, + "webhook_url": { + "type": "string", + "format": "uri", + "maxLength": 2048, + "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n" + } + }, + "required": [ + "prompt", + "custom_model_uri" + ] + } + } } }, "security": [ { - "BearerAuth": [] + "ApiKeyAuth": [] } - ], - "summary": "Promote members to ADMIN role in an ENTERPRISE_PREPAID or ENTERPRISE_API organization", - "tags": [ - "manage" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.manage_controller" + ] } }, - "/manage/api/organization/remove_members": { + "/v2/image/generate/ideogram-3-transparent": { "post": { - "operationId": "remove_organization_members", + "operationId": "imagesGenerate_post_generate_image_v2_ideogram_v3_transparent", + "summary": "Generate transparent images with Ideogram 3.0", + "description": "Generate images on a transparent background with Ideogram 3.0, delivered\nas PNGs with alpha. Returns results directly by default; set `async` or\nsupply a `webhook_url` to get a `generation_id` and poll\n`GET /v2/generations/{generation_id}`.\n", + "tags": [ + "images-generate" + ], "parameters": [ { - "description": "Base64 encoded organization ID to remove members from", + "name": "dry_run", "in": "query", - "name": "organization_id", - "required": true, + "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", + "required": false, "schema": { - "type": "string" + "type": "boolean", + "default": false } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RemoveOrganizationMembersRequest" - } - } - }, - "description": "A request to remove members from an organization.", - "required": true, - "x-body-name": "remove_organization_members_request" - }, "responses": { "200": { + "description": "The generated images (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests).", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/OrganizationMemberOperationResponse" + "$ref": "#/components/schemas/GenerateImageIdeogramV3TransparentResponse" } } - }, - "description": "Results of removing members from the organization" + } }, "400": { - "description": "Bad Request" + "description": "Invalid input provided.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "401": { - "description": "Not authorized" + "description": "Unauthorized.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, - "403": { - "description": "Not authorized - must be an organization owner" + "402": { + "description": "Insufficient credits or quota.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerationErrorResponse" + } + } + } }, - "404": { - "description": "Organization not found" + "422": { + "description": "The prompt did not pass safety checks.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } + }, + "429": { + "description": "Too many requests.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerationErrorResponse" + } + } + } + }, + "500": { + "description": "Internal server error.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } + }, + "503": { + "description": "The endpoint is temporarily unavailable.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } + } + }, + "requestBody": { + "description": "A request to generate transparent-background images with Ideogram 3.0.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerateImageIdeogramV3TransparentRequest" + } + } } }, "security": [ { - "BearerAuth": [] + "ApiKeyAuth": [] } - ], - "summary": "Remove members from a specific organization", - "tags": [ - "manage" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.manage_controller" + ] } }, - "/manage/api/organization/resend_invite": { + "/v2/image/generate/ideogram-2a": { "post": { - "operationId": "resend_organization_invite", + "operationId": "imagesGenerate_post_generate_image_v2_ideogram_v2_a", + "summary": "Generate with Ideogram 2a", + "description": "Generate images from a text prompt with Ideogram 2a, a fast, lower-cost\nmodel. Returns results directly by default; set `async` or supply a\n`webhook_url` to get a `generation_id` and poll\n`GET /v2/generations/{generation_id}`.\n", + "tags": [ + "images-generate" + ], "parameters": [ { - "description": "Base64 encoded organization ID the invite belongs to", + "name": "dry_run", "in": "query", - "name": "organization_id", - "required": true, + "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", + "required": false, "schema": { - "type": "string" + "type": "boolean", + "default": false } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ResendOrganizationInviteRequest" - } - } - }, - "description": "A request to resend a pending organization invite. Cancels the previous invite and emails a fresh one.", - "required": true, - "x-body-name": "resend_organization_invite_request" - }, "responses": { "200": { + "description": "The generated images (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests).", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/OrganizationMemberOperationResult" + "$ref": "#/components/schemas/GenerateImageIdeogramV2AResponse" } } - }, - "description": "Result of resending the invite" + } }, "400": { - "description": "Bad Request" - }, - "401": { - "description": "Not authorized" - }, - "403": { - "description": "Not authorized - must be an organization owner or admin" - }, - "404": { - "description": "Organization or invite not found" - } - }, - "security": [ - { - "BearerAuth": [] - } - ], - "summary": "Resend a pending invite for an organization", - "tags": [ - "manage" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.manage_controller" - } - }, - "/manage/api/organization/user_suggestions": { - "get": { - "operationId": "get_api_organization_user_suggestions", - "parameters": [ - { - "description": "Base64 encoded organization ID to get user suggestions for", - "in": "query", - "name": "organization_id", - "required": true, - "schema": { - "type": "string" + "description": "Invalid input provided.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } } }, - { - "description": "The prefix of the user handle to search for", - "example": "sar", - "in": "query", - "name": "user_handle_prefix", - "schema": { - "type": "string" + "401": { + "description": "Unauthorized.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } } }, - { - "description": "The maximum number of items to return", - "in": "query", - "name": "maxItems", - "schema": { - "default": 3, - "type": "integer" + "402": { + "description": "Insufficient credits or quota.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerationErrorResponse" + } + } } - } - ], - "responses": { - "200": { + }, + "422": { + "description": "The prompt did not pass safety checks.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetApiOrganizationUserSuggestionsResponse" + "description": "Any type" } } - }, - "description": "A list of the top responses in alphabetical order by user handle + whether the user has joined the current organization already." + } }, - "401": { - "description": "Not authorized" + "429": { + "description": "Too many requests.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerationErrorResponse" + } + } + } }, - "403": { - "description": "Not authorized" + "500": { + "description": "Internal server error.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, - "404": { - "description": "Organization not found" - } - }, - "security": [ - { - "BearerAuth": [] - } - ], - "summary": "Get search results for user handles with suggestions for a particular organization.", - "tags": [ - "manage" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.manage_controller" - } - }, - "/manage/api/organization/{organization_id}/api_properties": { - "patch": { - "description": "Lets an organization owner toggle API-only settings such as\ncopyright_detection_enabled. Updates only the fields explicitly present\nin the request body; absent fields are left unchanged.\n", - "operationId": "update_organization_api_properties", - "parameters": [ - { - "description": "Base64 encoded organization ID to update.", - "in": "path", - "name": "organization_id", - "required": true, - "schema": { - "type": "string" + "503": { + "description": "The endpoint is temporarily unavailable.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } } } - ], + }, "requestBody": { + "description": "A request to generate images with Ideogram 2a.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpdateOrganizationApiPropertiesRequest" + "$ref": "#/components/schemas/GenerateImageIdeogramV2ARequest" } } - }, - "required": true, - "x-body-name": "update_organization_api_properties_request" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpdateOrganizationApiPropertiesResponse" - } - } - }, - "description": "Updated API properties." - }, - "401": { - "description": "Not authorized" - }, - "403": { - "description": "Not authorized — must be an organization owner" - }, - "404": { - "description": "Organization not found" } }, "security": [ { - "BearerAuth": [] + "ApiKeyAuth": [] } - ], - "summary": "Update a single field on an organization's API properties.", - "tags": [ - "manage" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.manage_controller" + ] } }, - "/manage/api/payment": { + "/v2/image/generate/ideogram-2": { "post": { - "description": "Returns a client_secret for the org's payment customer so the inline payment\nmodal can save a card without leaving the app.\n\nSoft-deprecated: the inline Elements flow was removed in the Stripe.js\neager-bundle incident (2026-05-20). New clients should use the\nstripe_payment_setup_url field on ManageApiStripeSubscriptionResponse, which\nreturns a hosted Stripe Checkout URL instead. This endpoint will be formally\ndeprecated and then removed once no callers reference it.\n", - "operationId": "create_api_payment", + "operationId": "imagesGenerate_post_generate_image_v2_ideogram_v2", + "summary": "Generate with Ideogram 2.0", + "description": "Generate images from a text prompt with Ideogram 2.0. Returns results\ndirectly by default; set `async` or supply a `webhook_url` to get a\n`generation_id` and poll `GET /v2/generations/{generation_id}`.\n", + "tags": [ + "images-generate" + ], "parameters": [ { - "description": "Workspace to create the SetupIntent for. The payment method attaches to this org's Stripe customer.", + "name": "dry_run", "in": "query", - "name": "organization_id", - "required": true, + "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", + "required": false, "schema": { - "type": "string" + "type": "boolean", + "default": false } } ], "responses": { "200": { + "description": "The generated images (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests).", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ManageApiPaymentResponse" + "$ref": "#/components/schemas/GenerateImageIdeogramV2Response" } } - }, - "description": "client_secret for inline card collection." - }, - "401": { - "description": "Not authorized" + } }, - "403": { - "description": "Not authorized" - } - }, - "security": [ - { - "BearerAuth": [] - } - ], - "summary": "Create a payment setup session for inline card collection.", - "tags": [ - "manage" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.manage_controller" - } - }, - "/manage/api/profiles": { - "get": { - "operationId": "get_api_profiles", - "responses": { - "200": { + "400": { + "description": "Invalid input provided.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetApiProfilesResponse" + "description": "Any type" } } - }, - "description": "User API profiles retrieved successfully" + } }, "401": { - "description": "Not authorized" + "description": "Unauthorized.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, - "403": { - "description": "Not authorized" - } - }, - "security": [ - { - "BearerAuth": [] - } - ], - "summary": "Retrieve the user's current API profiles", - "tags": [ - "manage" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.manage_controller" - } - }, - "/manage/api/spend_commit": { - "get": { - "operationId": "get_user_spend_commit_info", - "parameters": [ - { - "description": "Base64 encoded organization ID to filter spend commit information for a specific organization", - "in": "query", - "name": "organization_id", - "required": true, - "schema": { - "type": "string" + "402": { + "description": "Insufficient credits or quota.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerationErrorResponse" + } + } } }, - { - "description": "Whether to only return postpaid commits. Defaults to true.", - "in": "query", - "name": "postpaid_only", - "required": false, - "schema": { - "type": "boolean" + "422": { + "description": "The prompt did not pass safety checks.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } } - } - ], - "responses": { - "200": { + }, + "429": { + "description": "Too many requests.", "content": { "application/json": { - "example": { - "commits": [ - { - "commit_spend_balance": { - "currency_code": "USD", - "amount": 7500 - }, - "commit_amount": { - "currency_code": "USD", - "amount": 10000 - }, - "commit_start_time": "2025-01-01T00:00:00+00:00", - "commit_end_time": "2025-12-31T23:59:59+00:00" - } - ] - }, "schema": { - "$ref": "#/components/schemas/SpendCommitInfoResponse" + "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "User spend commit information retrieved successfully" + } }, - "401": { - "description": "Not authorized" + "500": { + "description": "Internal server error.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, - "403": { - "description": "Not authorized" + "503": { + "description": "The endpoint is temporarily unavailable.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } + } + }, + "requestBody": { + "description": "A request to generate images with Ideogram 2.0.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerateImageIdeogramV2Request" + } + } } }, "security": [ { - "BearerAuth": [] + "ApiKeyAuth": [] } - ], - "summary": "Retrieve user spend commit information", - "tags": [ - "manage" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.manage_controller" + ] } }, - "/manage/api/stripe_subscription": { - "get": { - "operationId": "get_api_stripe_subscription", + "/v2/image/generate/gpt-image-2-5-flare": { + "post": { + "operationId": "imagesGenerate_post_generate_image_v2_gpt_image25_flare", + "summary": "Generate with GPT Image 2.5 Flare", + "description": "Generate images with GPT Image 2.5 Flare, the fast variant of GPT Image\n2.5. Optionally upload source images as `images` using\n`multipart/form-data` to edit them with the prompt. Returns results\ndirectly by default; set `async` or supply a `webhook_url` to get a\n`generation_id` and poll `GET /v2/generations/{generation_id}`.\n", + "tags": [ + "images-generate" + ], "parameters": [ { - "description": "Workspace to set up Stripe for. Caller must be OWNER, ADMIN, or MEMBER of the org.", - "in": "query", - "name": "organization_id", - "required": true, - "schema": { - "type": "string" - } - }, - { - "description": "Whether the subscription is intended to be used for business or personal use.", + "name": "dry_run", "in": "query", - "name": "isBusiness", + "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", + "required": false, "schema": { - "type": "boolean" + "type": "boolean", + "default": false } } ], "responses": { "200": { + "description": "The generated images (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests).", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ManageApiStripeSubscriptionResponse" + "$ref": "#/components/schemas/GenerateImageGptImage25FlareResponse" } } - }, - "description": "API subscription content related to connecting to Stripe" - }, - "401": { - "description": "Not authorized" + } }, - "403": { - "description": "Not authorized" - } - }, - "security": [ - { - "BearerAuth": [] - } - ], - "summary": "Retrieve data relevant to connecting to Stripe.", - "tags": [ - "manage" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.manage_controller" - } - }, - "/manage/api/subscription": { - "get": { - "operationId": "get_api_subscription", - "parameters": [ - { - "description": "Workspace to load the subscription for. The caller must be OWNER, ADMIN, or MEMBER of the org. The response shape branches on the org's type (PRIVATE / ENTERPRISE_PREPAID get recharge settings; ENTERPRISE_API does not).", - "in": "query", - "name": "organization_id", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { + "400": { + "description": "Invalid input provided.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ManageApiSubscriptionResponse" + "description": "Any type" } } - }, - "description": "API subscription content" + } }, "401": { - "description": "Not authorized" - }, - "403": { - "description": "Not authorized" - } - }, - "security": [ - { - "BearerAuth": [] - } - ], - "summary": "Retrieve data relevant to creating an API subscription.", - "tags": [ - "manage" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.manage_controller" - }, - "post": { - "operationId": "post_api_subscription", - "parameters": [ - { - "description": "Workspace whose subscription settings to update. Caller must be OWNER, ADMIN, or MEMBER of the org.", - "in": "query", - "name": "organization_id", - "required": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PostApiSubscriptionRequest" + "description": "Unauthorized.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } } } }, - "description": "A request to update the API subscription properties. This should only be called after terms have been accepted.", - "required": true, - "x-body-name": "post_api_subscription_request" - }, - "responses": { - "200": { + "402": { + "description": "Insufficient credits or quota.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PostApiSubscriptionResponse" + "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "API subscription content" + } }, - "400": { + "422": { + "description": "The prompt did not pass safety checks.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PostApiSubscriptionError" + "description": "Any type" } } - }, - "description": "Bad request" - }, - "401": { - "description": "Not authorized" + } }, - "403": { - "description": "Not authorized" - } - }, - "security": [ - { - "BearerAuth": [] - } - ], - "summary": "Update API subscription settings", - "tags": [ - "manage" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.manage_controller" - } - }, - "/manage/api/terms": { - "get": { - "operationId": "get_api_terms", - "responses": { - "200": { + "429": { + "description": "Too many requests.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetApiTermsResponse" + "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Retrieves the latest API terms" + } }, - "401": { - "description": "Not authorized" + "500": { + "description": "Internal server error.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, - "403": { - "description": "Not authorized" + "503": { + "description": "The endpoint is temporarily unavailable.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } } }, - "security": [ - { - "BearerAuth": [] - } - ], - "summary": "Retrieve the latest terms of service for API usage.", - "tags": [ - "manage" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.manage_controller" - }, - "post": { - "operationId": "post_api_terms", "requestBody": { + "description": "A request to generate images with GPT Image 2.5 Flare. Send it as `application/json`, or as `multipart/form-data` to include source `images`.", "content": { - "application/json": { + "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/PostApiTermsRequest" + "type": "object", + "properties": { + "prompt": { + "type": "string", + "minLength": 1, + "maxLength": 10000, + "description": "The prompt to generate images from, or the edit instruction to apply when source images are supplied. It is passed to the model as written." + }, + "images": { + "type": "array", + "items": { + "type": "string", + "format": "binary" + }, + "description": "Optional source images to edit (max 16, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only." + }, + "mask": { + "type": "string", + "format": "binary", + "description": "An optional mask for the first source image (max 25MB; JPEG, PNG, or WEBP). Multipart requests only. Fully transparent pixels mark the areas to edit. The mask must have the same dimensions as the first source image, and requires source images in the same request." + }, + "background": { + "$ref": "#/components/schemas/V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaBackground", + "default": "auto", + "description": "The output background. `transparent` returns images with an alpha channel, `opaque` forces a solid background, and `auto` lets the model decide from the prompt." + }, + "quality": { + "$ref": "#/components/schemas/V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaQuality", + "default": "auto", + "description": "How much rendering effort the model spends. Lower tiers return sooner and cost less; `auto` lets the model choose, which it currently renders at `high`." + }, + "num_images": { + "type": "integer", + "minimum": 1, + "maximum": 8, + "default": 1, + "description": "The number of images to generate." + }, + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." + }, + "aspect_ratio": { + "type": "string", + "description": "The requested output aspect ratio, for example \"1:1\", \"16:9\", or \"9:16\". Ignored when `resolution` is provided. Defaults to \"1:1\"." + }, + "resolution": { + "type": "string", + "description": "Exact output resolution, formatted as \"WIDTHxHEIGHT\", for example\n\"2048x2048\" or \"1920x1088\". When provided, this takes precedence\nover `aspect_ratio`. The dimensions must satisfy GPT Image 2.5 Flare\nconstraints: each side is a multiple of 16, the largest side is at\nmost 3840px, the long:short ratio is at most 3:1, and total pixels\nare between 655360 and 8294400 inclusive.\n" + }, + "async": { + "type": "boolean", + "default": false, + "description": "When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result." + }, + "webhook_url": { + "type": "string", + "format": "uri", + "maxLength": 2048, + "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n" + } + }, + "required": [ + "prompt" + ] } } - }, - "description": "A request to accept the API terms.", - "required": true, - "x-body-name": "post_api_terms_request" - }, - "responses": { - "204": { - "description": "Success; no content." - }, - "400": { - "description": "Bad Request" - }, - "401": { - "description": "Not authorized" - }, - "403": { - "description": "Not authorized" } }, "security": [ { - "BearerAuth": [] + "ApiKeyAuth": [] } - ], - "summary": "Accept terms", - "tags": [ - "manage" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.manage_controller" + ] } }, - "/manage/api/usage": { - "get": { - "operationId": "get_usage_info", + "/v2/image/generate/gpt-image-2-5-sunburst": { + "post": { + "operationId": "imagesGenerate_post_generate_image_v2_gpt_image25_sunburst", + "summary": "Generate with GPT Image 2.5 Sunburst", + "description": "Generate images with GPT Image 2.5 Sunburst, the quality variant of GPT\nImage 2.5, with finer detail at higher latency than Flare. Optionally\nupload source images as `images` using `multipart/form-data` to edit\nthem with the prompt. Returns results directly by default; set `async`\nor supply a `webhook_url` to get a `generation_id` and poll\n`GET /v2/generations/{generation_id}`.\n", + "tags": [ + "images-generate" + ], "parameters": [ { - "description": "Base64 encoded organization ID to filter usage information for a specific organization", - "in": "query", - "name": "organization_id", - "required": true, - "schema": { - "type": "string" - } - }, - { - "description": "Time segment granularity for usage breakdown", - "in": "query", - "name": "segment_by", - "required": true, - "schema": { - "$ref": "#/components/schemas/SegmentBy" - } - }, - { - "description": "Start time for usage information", - "in": "query", - "name": "start_time", - "required": true, - "schema": { - "format": "date-time", - "type": "string" - } - }, - { - "description": "Inclusive end time for usage information. If not provided, the current time will be used.", - "in": "query", - "name": "end_time", - "required": false, - "schema": { - "format": "date-time", - "type": "string" - } - }, - { - "description": "Filter usage information by specific model versions", - "explode": true, - "in": "query", - "name": "model_versions", - "required": false, - "schema": { - "default": [], - "items": { - "$ref": "#/components/schemas/ModelVersion" - }, - "type": "array" - }, - "style": "form" - }, - { - "description": "Filter usage information by specific tool types", - "explode": true, - "in": "query", - "name": "tools", - "required": false, - "schema": { - "default": [], - "items": { - "$ref": "#/components/schemas/ToolType" - }, - "type": "array" - }, - "style": "form" - }, - { - "description": "Filter usage information by specific API key IDs", - "explode": true, - "in": "query", - "name": "api_key_ids", - "required": false, - "schema": { - "default": [], - "items": { - "description": "Base64 encoded API key ID", - "type": "string" - }, - "type": "array" - }, - "style": "form" - }, - { - "description": "Filter usage information by specific user email addresses (for web app usage)", - "explode": true, - "in": "query", - "name": "user_emails", - "required": false, - "schema": { - "default": [], - "items": { - "description": "User email address", - "type": "string" - }, - "type": "array" - }, - "style": "form" - }, - { - "description": "Filter usage by source - API for programmatic API usage, APP for web application usage. Defaults to API.", + "name": "dry_run", "in": "query", - "name": "source", + "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", "required": false, "schema": { - "$ref": "#/components/schemas/UsageSource" + "type": "boolean", + "default": false } } ], "responses": { "200": { + "description": "The generated images (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests).", "content": { "application/json": { - "example": { - "usage_segments": [ - { - "segment_start": "2023-08-09T00:00:00+00:00", - "segment_end": "2023-08-09T23:59:59+00:00", - "tool_usage": [ - { - "full_tool_name": "Turbo Image Generation V3", - "amount": { - "currency_code": "USD", - "amount": 1250 - } - }, - { - "full_tool_name": "Upscale Image V1", - "amount": { - "currency_code": "USD", - "amount": 750 - } - }, - { - "full_tool_name": "Balanced Edit Image V2", - "amount": { - "currency_code": "USD", - "amount": 500 - } - } - ] - }, - { - "segment_start": "2023-08-10T00:00:00+00:00", - "segment_end": "2023-08-10T23:59:59+00:00", - "tool_usage": [ - { - "full_tool_name": "generate", - "amount": { - "currency_code": "USD", - "amount": 2000 - } - } - ] - } - ] - }, "schema": { - "$ref": "#/components/schemas/GetUsageInfoResponse" + "$ref": "#/components/schemas/GenerateImageGptImage25SunburstResponse" } } - }, - "description": "Usage information retrieved successfully" - }, - "401": { - "description": "Not authorized" + } }, - "403": { - "description": "Not authorized" - } - }, - "security": [ - { - "BearerAuth": [] - } - ], - "summary": "Retrieve usage information segmented by time period with tool-specific breakdowns", - "tags": [ - "manage" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.manage_controller" - } - }, - "/mini-apps/marketing-projection": { - "get": { - "description": "Returns the public-safe mini-app metadata used to build marketing pages. The response includes only active marketing entries that have website metadata and can be published unchanged as the marketing registry.", - "operationId": "get_mini_app_marketing_projection", - "responses": { - "200": { + "400": { + "description": "Invalid input provided.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MiniAppMarketingProjectionResponse" + "description": "Any type" } } - }, - "description": "Mini-app marketing projection retrieved successfully" + } }, "401": { - "description": "Unauthorized" + "description": "Unauthorized.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, - "403": { - "description": "Forbidden" + "402": { + "description": "Insufficient credits or quota.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerationErrorResponse" + } + } + } }, - "503": { - "description": "Service unavailable" - } - }, - "security": [ - { - "ApiKeyAuth": [] - } - ], - "summary": "Get the public mini-app marketing projection", - "tags": [ - "mini-apps" - ], - "x-root-array-response": true, - "x-openapi-router-controller": "external_api.generated.openapi.controllers.mini_apps_controller" - } - }, - "/mini-apps/publish": { - "post": { - "description": "Publishes a mini-app's catalog entry. Called by the mini-apps deploy pipeline after a deploy to register or refresh a single app, keyed by its unique slug. Re-publishing an existing app refreshes the deploy-managed fields (label, description, embed mode, scopes, image-input support, deployment details, and website) while leaving administrator-managed settings and artwork untouched. Artwork from the request is used only when creating a new app.", - "operationId": "publish_mini_app", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PublishMiniAppRequest" + "422": { + "description": "The prompt did not pass safety checks.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } } } }, - "description": "The mini-app catalog entry to publish.", - "required": true, - "x-body-name": "publish_mini_app_request" - }, - "responses": { - "200": { + "429": { + "description": "Too many requests.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PublishMiniAppResponse" + "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Mini-app published successfully" - }, - "400": { - "description": "Bad request" - }, - "401": { - "description": "Unauthorized" + } }, - "403": { - "description": "Forbidden" + "500": { + "description": "Internal server error.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "503": { - "description": "Service unavailable" + "description": "The endpoint is temporarily unavailable.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } } }, - "security": [ - { - "ApiKeyAuth": [] - } - ], - "summary": "Publish a mini-app catalog entry", - "tags": [ - "mini-apps" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.mini_apps_controller" - } - }, - "/mini-apps/publish-preview": { - "post": { - "description": "Publishes a mini-app preview entry. Called by the mini-apps preview deploy pipeline to register a throwaway preview deploy, keyed by its unique preview id. Re-publishing an existing preview id refreshes every deploy-managed field. Preview entries are independent from the main catalog: they carry no slug, owner, or membership gating, and anyone with the preview link can access the app.", - "operationId": "publish_preview_mini_app", "requestBody": { + "description": "A request to generate images with GPT Image 2.5 Sunburst. Send it as `application/json`, or as `multipart/form-data` to include source `images`.", "content": { - "application/json": { + "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/PublishMiniAppPreviewRequest" + "type": "object", + "properties": { + "prompt": { + "type": "string", + "minLength": 1, + "maxLength": 10000, + "description": "The prompt to generate images from, or the edit instruction to apply when source images are supplied. It is passed to the model as written." + }, + "images": { + "type": "array", + "items": { + "type": "string", + "format": "binary" + }, + "description": "Optional source images to edit (max 16, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only." + }, + "mask": { + "type": "string", + "format": "binary", + "description": "An optional mask for the first source image (max 25MB; JPEG, PNG, or WEBP). Multipart requests only. Fully transparent pixels mark the areas to edit. The mask must have the same dimensions as the first source image, and requires source images in the same request." + }, + "background": { + "$ref": "#/components/schemas/V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaBackground", + "default": "auto", + "description": "The output background. `transparent` returns images with an alpha channel, `opaque` forces a solid background, and `auto` lets the model decide from the prompt." + }, + "quality": { + "$ref": "#/components/schemas/V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaQuality", + "default": "auto", + "description": "How much rendering effort the model spends. Lower tiers return sooner and cost less; `auto` lets the model choose, which it currently renders at `high`." + }, + "num_images": { + "type": "integer", + "minimum": 1, + "maximum": 8, + "default": 1, + "description": "The number of images to generate." + }, + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." + }, + "aspect_ratio": { + "type": "string", + "description": "The requested output aspect ratio, for example \"1:1\", \"16:9\", or \"9:16\". Ignored when `resolution` is provided. Defaults to \"1:1\"." + }, + "resolution": { + "type": "string", + "description": "Exact output resolution, formatted as \"WIDTHxHEIGHT\", for example\n\"2048x2048\" or \"1920x1088\". When provided, this takes precedence\nover `aspect_ratio`. The dimensions must satisfy GPT Image 2.5 Sunburst\nconstraints: each side is a multiple of 16, the largest side is at\nmost 3840px, the long:short ratio is at most 3:1, and total pixels\nare between 655360 and 8294400 inclusive.\n" + }, + "async": { + "type": "boolean", + "default": false, + "description": "When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result." + }, + "webhook_url": { + "type": "string", + "format": "uri", + "maxLength": 2048, + "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n" + } + }, + "required": [ + "prompt" + ] } } - }, - "description": "The mini-app preview entry to publish.", - "required": true, - "x-body-name": "publish_mini_app_preview_request" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PublishMiniAppPreviewResponse" - } - } - }, - "description": "Mini-app preview published successfully" - }, - "400": { - "description": "Bad request" - }, - "401": { - "description": "Unauthorized" - }, - "403": { - "description": "Forbidden" - }, - "503": { - "description": "Service unavailable" } }, "security": [ { "ApiKeyAuth": [] } - ], - "summary": "Publish a mini-app preview entry", - "tags": [ - "mini-apps" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.mini_apps_controller" + ] } }, - "/mini-apps/stale-previews": { - "get": { - "description": "Returns preview ids whose most recent successful publish is older than the cutoff. This read-only endpoint does not delete preview entries.", - "operationId": "get_stale_preview_mini_apps", + "/v2/image/generate/gpt-image-2": { + "post": { + "operationId": "imagesGenerate_post_generate_image_v2_gpt_image2", + "summary": "Generate with GPT Image 2", + "description": "Generate images with GPT Image 2. Optionally upload source images as\n`images` using `multipart/form-data` to edit them with the prompt.\nReturns results directly by default; set `async` or supply a\n`webhook_url` to get a `generation_id` and poll\n`GET /v2/generations/{generation_id}`.\n", + "tags": [ + "images-generate" + ], "parameters": [ { - "description": "Return preview entries last published before this timestamp.", + "name": "dry_run", "in": "query", - "name": "cutoff", - "required": true, + "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", + "required": false, "schema": { - "format": "date-time", - "type": "string" + "type": "boolean", + "default": false } } ], "responses": { "200": { + "description": "The generated images (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests).", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetStaleMiniAppPreviewsResponse" + "$ref": "#/components/schemas/GenerateImageGptImage2Response" } } - }, - "description": "Stale mini-app previews retrieved successfully" + } }, "400": { - "description": "Bad request" + "description": "Invalid input provided.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "401": { - "description": "Unauthorized" - }, - "403": { - "description": "Forbidden" + "description": "Unauthorized.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, - "503": { - "description": "Service unavailable" - } - }, - "security": [ - { - "ApiKeyAuth": [] - } - ], - "summary": "Get stale mini-app preview entries", - "tags": [ - "mini-apps" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.mini_apps_controller" - } - }, - "/mini-apps/unpublish-preview/{preview_id}": { - "post": { - "description": "Deletes a mini-app preview entry by its preview id. Repeated requests succeed when the entry is already absent, so preview teardown can retry safely.", - "operationId": "unpublish_preview_mini_app", - "parameters": [ - { - "description": "Unique identifier of the preview entry to delete.", - "in": "path", - "name": "preview_id", - "required": true, - "schema": { - "$ref": "#/components/schemas/MiniAppPreviewId" + "402": { + "description": "Insufficient credits or quota.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerationErrorResponse" + } + } } - } - ], - "responses": { - "200": { + }, + "422": { + "description": "The prompt did not pass safety checks.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UnpublishMiniAppPreviewResponse" + "description": "Any type" } } - }, - "description": "Mini-app preview unpublished successfully" + } }, - "400": { - "description": "Bad request" + "429": { + "description": "Too many requests.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerationErrorResponse" + } + } + } }, - "401": { - "description": "Unauthorized" + "500": { + "description": "Internal server error.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, - "403": { - "description": "Forbidden" + "503": { + "description": "The endpoint is temporarily unavailable.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } } }, - "security": [ - { - "ApiKeyAuth": [] - } - ], - "summary": "Unpublish a mini-app preview entry", - "tags": [ - "mini-apps" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.mini_apps_controller" - } - }, - "/mini-apps/unpublish/{slug}": { - "post": { - "description": "Archives a mini-app by slug while preserving its deployment details and administrator-managed settings. Publishing the same slug again does not reactivate it; only an administrator can restore an archived app.", - "operationId": "unpublish_mini_app", - "parameters": [ - { - "description": "Unique slug of the mini-app to archive.", - "in": "path", - "name": "slug", - "required": true, - "schema": { - "$ref": "#/components/schemas/MiniAppSlug" + "requestBody": { + "description": "A request to generate images with GPT Image 2. Send it as `application/json`, or as `multipart/form-data` to include source `images`.", + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "prompt": { + "type": "string", + "minLength": 1, + "maxLength": 10000, + "description": "The prompt to generate images from, or the edit instruction to apply when source images are supplied. It is passed to the model as written." + }, + "images": { + "type": "array", + "items": { + "type": "string", + "format": "binary" + }, + "description": "Optional source images to edit (max 16, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only." + }, + "num_images": { + "type": "integer", + "minimum": 1, + "maximum": 8, + "default": 1, + "description": "The number of images to generate." + }, + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." + }, + "aspect_ratio": { + "type": "string", + "description": "The requested output aspect ratio, for example \"1:1\", \"16:9\", or \"9:16\". Ignored when `resolution` is provided. Defaults to \"1:1\"." + }, + "resolution": { + "type": "string", + "description": "Exact output resolution, formatted as \"WIDTHxHEIGHT\", for example\n\"2048x2048\" or \"1920x1088\". When provided, this takes precedence\nover `aspect_ratio`. The dimensions must satisfy GPT Image 2\nconstraints: each side is a multiple of 16, the largest side is at\nmost 3840px, the long:short ratio is at most 3:1, and total pixels\nare between 655360 and 8294400 inclusive.\n" + }, + "async": { + "type": "boolean", + "default": false, + "description": "When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result." + }, + "webhook_url": { + "type": "string", + "format": "uri", + "maxLength": 2048, + "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n" + } + }, + "required": [ + "prompt" + ] + } } } - ], - "responses": { - "204": { - "description": "Mini-app unpublished successfully" - }, - "400": { - "description": "Bad request" - }, - "401": { - "description": "Unauthorized" - }, - "403": { - "description": "Forbidden" - }, - "404": { - "description": "Mini-app not found" - } }, "security": [ { "ApiKeyAuth": [] } - ], - "summary": "Unpublish a mini-app catalog entry", - "tags": [ - "mini-apps" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.mini_apps_controller" + ] } }, - "/models": { - "get": { - "description": "Lists custom models for the authenticated user. Use the `scope` parameter to control which models are returned. If omitted, returns both owned models and models shared with the user's organization via the model registry. `owned` returns only models created by the user. `shared` returns only models shared via the model registry, excluding the user's own models.\n", - "operationId": "list_custom_models", + "/v2/image/generate/nano-banana-2": { + "post": { + "operationId": "imagesGenerate_post_generate_image_v2_nano_banana2", + "summary": "Generate with Nano Banana 2", + "description": "Generate images with Nano Banana 2. Optionally upload source images as\n`images` using `multipart/form-data` to edit them with the prompt.\nReturns results directly by default; set `async` or supply a\n`webhook_url` to get a `generation_id` and poll\n`GET /v2/generations/{generation_id}`.\n", + "tags": [ + "images-generate" + ], "parameters": [ { - "description": "Controls which models are returned. Omit to return both owned and shared models combined. `owned` returns only models created by the authenticated user. `shared` returns only models shared with the user's organization via the model registry.\n", - "in": "query", - "name": "scope", - "required": false, - "schema": { - "enum": [ - "owned", - "shared" - ], - "type": "string" - }, - "x-tool-description": "Omit for owned and organization-shared models; `owned` returns yours, `shared` returns organization-shared models excluding yours." - }, - { - "description": "Filter by model status. Applied to owned models only; shared models in the model registry are already filtered to available versions. Example: `?status=TRAINING&status=COMPLETED`\n", - "explode": true, + "name": "dry_run", "in": "query", - "name": "status", + "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", "required": false, "schema": { - "items": { - "$ref": "#/components/schemas/ModelStatus" - }, - "type": "array" - }, - "style": "form" + "type": "boolean", + "default": false + } } ], "responses": { "200": { + "description": "The generated images (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests).", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ListModelsResponse" + "$ref": "#/components/schemas/GenerateImageNanoBanana2Response" } } - }, - "description": "Models retrieved successfully" + } + }, + "400": { + "description": "Invalid input provided.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "401": { - "description": "Unauthorized" - } - }, - "summary": "List models", - "tags": [ - "models" - ], - "x-tool-description": "List custom models.", - "x-openapi-router-controller": "external_api.generated.openapi.controllers.models_controller" - } - }, - "/models/{model_id}": { - "get": { - "description": "Get detailed information about a specific custom model. The user must either own the model or the model must be shared with the user's organization via the model registry. Returns 404 if the model is not found or not accessible.\n", - "operationId": "get_custom_model", - "parameters": [ - { - "in": "path", - "name": "model_id", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { + "description": "Unauthorized.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetModelResponse" + "description": "Any type" } } - }, - "description": "Model retrieved successfully" - }, - "401": { - "description": "Unauthorized" - }, - "404": { - "description": "Model not found" - } - }, - "summary": "Get model details", - "tags": [ - "models" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.models_controller" - } - }, - "/reframe": { - "post": { - "description": "Reframe a square image to a chosen resolution. The supported image formats include JPEG, PNG, and WebP.\n\nImage links are available for a limited period of time; if you would like to keep the image, you must download it.\n", - "operationId": "post_reframe_image", - "requestBody": { - "content": { - "multipart/form-data": { - "schema": { - "$ref": "#/components/schemas/ReframeImageRequest" - } } }, - "description": "A request to reframe an image in a new resolution.", - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { + "402": { + "description": "Insufficient credits or quota.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageResponse" + "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Image re-frames generated successfully." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Not authorized to generate an image." + } }, "422": { + "description": "The prompt did not pass safety checks.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageSafetyError" + "description": "Any type" } } - }, - "description": "Prompt or Image failed the safety checks." + } }, "429": { - "description": "Too many requests." - } - }, - "summary": "Reframe (legacy)", - "tags": [ - "generate" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.generate_controller" - } - }, - "/remix": { - "post": { - "description": "Remix provided images synchronously based on a given prompt and optional parameters.\n\nInput images are cropped to the chosen aspect ratio before being remixed.\n\nSupported image formats include JPEG, PNG, and WebP.\n\nImages links are available for a limited period of time; if you would like to keep the image, you must download it.\n", - "operationId": "post_remix_image", - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "image_request": { - "contentType": "application/json", - "style": "form" + "description": "Too many requests.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerationErrorResponse" } - }, - "schema": { - "$ref": "#/components/schemas/RemixImageRequest" } } }, - "description": "A request to remix a provided image with Ideogram. Input images are cropped to the chosen aspect ratio before being remixed.", - "required": true - }, - "responses": { - "200": { + "500": { + "description": "Internal server error.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageResponse" + "description": "Any type" } } - }, - "description": "Image(s) generated successfully." - }, - "400": { - "description": "Invalid input provided." - }, - "403": { - "description": "Not authorized to generate an image." + } }, - "422": { + "503": { + "description": "The endpoint is temporarily unavailable.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageSafetyError" + "description": "Any type" } } - }, - "description": "Prompt or provided image failed safety check." - }, - "429": { - "description": "Too many requests." + } } }, - "summary": "Remix (legacy)", - "tags": [ - "generate" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.generate_controller" - } - }, - "/upscale": { - "post": { - "description": "Upscale provided images synchronously with an optional prompt.\n\nSupported image formats include JPEG, PNG, and WebP.\n\nImages links are available for a limited period of time; if you would like to keep the image, you must download it.\n", - "operationId": "post_upscale_image", "requestBody": { + "description": "A request to generate images with Nano Banana 2. Send it as `application/json`, or as `multipart/form-data` to include source `images`.", "content": { "multipart/form-data": { - "encoding": { - "image_request": { - "contentType": "application/json", - "style": "form" - } - }, "schema": { - "$ref": "#/components/schemas/UpscaleImageRequest" + "type": "object", + "properties": { + "prompt": { + "type": "string", + "minLength": 1, + "maxLength": 10000, + "description": "The prompt to generate images from, or the edit instruction to apply when source images are supplied. It is passed to the model as written." + }, + "images": { + "type": "array", + "items": { + "type": "string", + "format": "binary" + }, + "description": "Optional source images to edit (max 10, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only." + }, + "aspect_ratio": { + "$ref": "#/components/schemas/NanoBanana2AspectRatio", + "default": "auto" + }, + "resolution_tier": { + "$ref": "#/components/schemas/V2ImageGenerateNanoBanana2PostRequestBodyContentMultipartFormDataSchemaResolutionTier", + "default": "1K", + "description": "The output resolution tier." + }, + "num_images": { + "type": "integer", + "minimum": 1, + "maximum": 8, + "default": 1, + "description": "The number of images to generate." + }, + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." + }, + "async": { + "type": "boolean", + "default": false, + "description": "When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result." + }, + "webhook_url": { + "type": "string", + "format": "uri", + "maxLength": 2048, + "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n" + } + }, + "required": [ + "prompt" + ] } } - }, - "description": "A request to upscale a provided image with Ideogram.", - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateImageResponse" - } - } - }, - "description": "Image(s) generated successfully." - }, - "400": { - "description": "Invalid input provided." - }, - "403": { - "description": "Not authorized to generate an image." - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateImageSafetyError" - } - } - }, - "description": "Prompt or provided image failed safety check." - }, - "429": { - "description": "Too many requests." } }, - "summary": "Upscale", - "tags": [ - "generate" - ], - "x-fern-examples": [ + "security": [ { - "request": { - "image_request": { - "resemblance": 55, - "detail": 90 - } - }, - "response": { - "body": { - "created": "2000-01-23T04:56:07+00:00", - "data": [ - { - "prompt": "A photo of a cat", - "resolution": "1280x800", - "is_image_safe": true, - "seed": 12345, - "url": "https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89", - "style_type": "GENERAL" - } - ] - } - }, - "code-samples": [ - { - "sdk": "curl", - "code": "curl -X POST https://api.ideogram.ai/upscale \\\n -H \"Api-Key: \" \\\n -H \"Content-Type: multipart/form-data\" \\\n -F image_file=@ \\\n -F image_request='{\n \"resemblance\": 55,\n \"detail\": 90\n }'\n" - }, - { - "sdk": "python", - "code": "import requests\nimport json\n\nresponse = requests.post(\n \"https://api.ideogram.ai/upscale\",\n headers={\n \"Api-Key\": \"\"\n },\n data={\n \"image_request\": json.dumps({\n \"resemblance\": 55,\n \"detail\": 90\n })\n },\n files={\n \"image_file\": open(\"\", \"rb\")\n }\n)\nprint(response.json())\nwith open('output.png', 'wb') as f:\n f.write(requests.get(response.json()['data'][0]['url']).content)\n" - }, - { - "sdk": "typescript", - "code": "const formData = new FormData();\nformData.append('image_request', JSON.stringify({\n resemblance: 55,\n detail: 90\n}));\nformData.append('image_file', new Blob([fs.readFileSync(\"\")], {\n type: 'image/png'\n}));\nconst response = await fetch('https://api.ideogram.ai/upscale', {\n method: 'POST',\n headers: { 'Api-Key': '' },\n body: formData\n});\nconst data = await response.json();\nconsole.log(data);\n" - } - ] + "ApiKeyAuth": [] } - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.generate_controller" + ] } }, - "/v1/.well-known/jwks.json": { - "get": { - "description": "Returns the set of Ed25519 public keys Ideogram uses to sign outbound\nwebhook payloads. Customers verify incoming webhooks by recomputing the\ncanonical signed message (`request_id\\nuser_id\\ntimestamp\\nsha256_hex(body)`)\nand checking the `X-Ideogram-Webhook-Signature` header against any key\nin this document.\n\nThe document includes the current signing key plus any keys recently\nrotated out, so signatures already in flight remain verifiable across\nrotations. Cache for up to 24 hours; refresh sooner if a signature\nfails to verify against the cached set.\n\nThis endpoint is public and unauthenticated — no API key is required.\n", - "operationId": "get_webhook_signing_jwks", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/WebhookSigningJwks" - } - } - }, - "description": "JSON Web Key Set with the active webhook-signing keys." - } - }, - "security": [], - "summary": "Get the public keys used to verify webhook signatures", + "/v2/image/generate/nano-banana-2-1": { + "post": { + "operationId": "imagesGenerate_post_generate_image_v2_nano_banana21", + "summary": "Generate with Nano Banana 2.1", + "description": "Generate images with Nano Banana 2.1. Optionally upload source images as\n`images` using `multipart/form-data` to edit them with the prompt.\nReturns results directly by default; set `async` or supply a\n`webhook_url` to get a `generation_id` and poll\n`GET /v2/generations/{generation_id}`.\n", "tags": [ - "webhooks" + "images-generate" ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.webhooks_controller" - } - }, - "/v1/async/ad-resizer": { - "post": { - "description": "Resizes an advertisement image to the exact target size. Supply `prompt`\nto provide specific instructions for how the advertisement should look\nafter resizing.\n\nThe request is processed asynchronously and immediately returns a\n`generation_id`. Poll `GET /v1/generations/{generation_id}` until `status`\nis `completed` or `failed`. The completed polling response contains the\nfinal resized image(s) in `data` and the amount charged for variable\nusage-based pricing in `usage_cost_usd_micros`. If a `webhook_url` is\nsupplied, the completed result is also POSTed to that URL.\n\nSupply the advertisement image as raw `image` bytes via\n`multipart/form-data`.\n\nThe required `resolution` (`WIDTHxHEIGHT`) sets the exact output\ndimensions.\n\nThe model is fixed by the route, so no `model` field is accepted.\n", - "operationId": "post_resize_image_async", "parameters": [ { - "explode": true, + "name": "dry_run", "in": "query", - "name": "webhook_url", + "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", "required": false, "schema": { - "$ref": "#/components/schemas/WebhookUrl" - }, - "style": "form" + "type": "boolean", + "default": false + } } ], - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "image_asset_identifier": { - "contentType": "application/json", - "style": "form" - } - }, - "schema": { - "$ref": "#/components/schemas/ResizeAdImageRequest" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/ResizeAdImageRequest" - } - } - }, - "description": "A request to resize a source image.", - "required": true, - "x-body-name": "body" - }, "responses": { "200": { + "description": "The generated images (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests).", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AsyncImageGenerationResponseV4" + "$ref": "#/components/schemas/GenerateImageNanoBanana21Response" } } - }, - "description": "Request accepted for asynchronous processing." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Unauthorized." - }, - "402": { - "description": "Insufficient credits or quota." - }, - "403": { - "description": "Not authorized to edit an image." - }, - "404": { - "description": "Source asset not found." - }, - "429": { - "description": "Too many requests." - } - }, - "summary": "Advertisement Resizer", - "tags": [ - "generate" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.generate_controller" - } - }, - "/v1/async/text-to-image/p-image-ideogram": { - "post": { - "description": "Accepts a P-Image Ideogram generation request for asynchronous processing\nand returns immediately with a generation_id. Poll\n`GET /v1/generations/{generation_id}` to retrieve the result. If a\n`webhook_url` is supplied, the generated images are additionally POSTed\nto it once ready, in a payload that mirrors the synchronous response with\nan added generation_id for correlation.\n\nSee [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures.\n", - "operationId": "post_generate_image_p_image_ideogram_async", - "parameters": [ - { - "explode": true, - "in": "query", - "name": "webhook_url", - "required": false, - "schema": { - "$ref": "#/components/schemas/WebhookUrl" - }, - "style": "form" - } - ], - "requestBody": { - "content": { - "multipart/form-data": { - "schema": { - "$ref": "#/components/schemas/GenerateImageRequestPImageIdeogram" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateImageRequestPImageIdeogram" - } } }, - "description": "A request to generate an image with P-Image Ideogram.", - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { + "400": { + "description": "Invalid input provided.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AsyncImageGenerationResponseV4" + "description": "Any type" } } - }, - "description": "Request accepted for asynchronous delivery." - }, - "400": { - "description": "Invalid input provided." + } }, "401": { - "description": "Not authorized." - }, - "422": { + "description": "Unauthorized.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageSafetyError" + "description": "Any type" } } - }, - "description": "Prompt failed the safety check." - }, - "429": { - "description": "Too many requests." - } - }, - "summary": "Generate with P-Image Ideogram asynchronously", - "tags": [ - "generate" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.generate_controller" - } - }, - "/v1/edit": { - "post": { - "description": "Edit one or more images using a text prompt. Provide images via file upload\nor Ideogram image URLs, and describe the desired edit in your prompt.\n\nSupported image formats include JPEG, PNG, and WebP.\n\nImages links are available for a limited period of time; if you would like to keep the image, you must download it.\n", - "operationId": "post_v1_edit_image", - "requestBody": { - "content": { - "multipart/form-data": { - "schema": { - "$ref": "#/components/schemas/V1EditImagesRequest" - } } }, - "description": "A request to edit images.", - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { + "402": { + "description": "Insufficient credits or quota.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/V1EditImagesResponse" + "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Image edits generated successfully." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Not authorized to generate an image." - }, - "402": { - "description": "Insufficient credits or quota." + } }, "422": { + "description": "The prompt did not pass safety checks.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageSafetyError" + "description": "Any type" } } - }, - "description": "Prompt or provided image failed safety checks." + } }, "429": { - "description": "Too many requests." - }, - "503": { - "description": "Image generation service temporarily unavailable." - } - }, - "summary": "Edit images with a prompt", - "tags": [ - "generate" - ], - "x-fern-examples": [ - { - "request": { - "prompt": "Change the background to a beach sunset." - }, - "response": { - "body": { - "created": "2000-01-23T04:56:07+00:00", - "data": [ - { - "prompt": "Change the background to a beach sunset.", - "resolution": "1024x1024", - "is_image_safe": true, - "seed": 12345, - "url": "https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89" - } - ] - } - }, - "code-samples": [ - { - "sdk": "curl", - "code": "curl -X POST https://api.ideogram.ai/v1/edit \\\n -H \"Api-Key: \" \\\n -H \"Content-Type: multipart/form-data\" \\\n -F images=@ \\\n -F prompt=\"Change the background to a beach sunset.\"\n" - }, - { - "sdk": "python", - "code": "import requests\n\nresponse = requests.post(\n \"https://api.ideogram.ai/v1/edit\",\n headers={\n \"Api-Key\": \"\"\n },\n data={\n \"prompt\": \"Change the background to a beach sunset.\"\n },\n files={\n \"images\": open(\"\", \"rb\"),\n }\n)\nprint(response.json())\nwith open('output.png', 'wb') as f:\n f.write(requests.get(response.json()['data'][0]['url']).content)\n" - }, - { - "sdk": "typescript", - "code": "const formData = new FormData();\nformData.append('prompt', 'Change the background to a beach sunset.');\nformData.append('images', '');\nconst response = await fetch('https://api.ideogram.ai/v1/edit', {\n method: 'POST',\n headers: { 'Api-Key': '' },\n body: formData\n});\nconst data = await response.json();\nconsole.log(data);\n" - } - ] - } - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.generate_controller" - } - }, - "/v1/edit-lite": { - "post": { - "description": "Edit an image using a text prompt, optimized for lower cost and\nlatency. Upload the image being edited via the `image` field. Up to 9\nadditional `reference_images` may be supplied to guide the edit.\n\nOutput is always generated at 1K resolution. Input images larger than\n1024px on their long edge are downscaled before processing. The\n`aspect_ratio` field controls the output aspect ratio only; when\nomitted, the output follows the aspect ratio of the image being\nedited.\n\nSupported image formats include JPEG, PNG, and WebP.\n\nImages links are available for a limited period of time; if you would like to keep the image, you must download it.\n", - "operationId": "post_v1_edit_lite_image", - "requestBody": { - "content": { - "multipart/form-data": { - "schema": { - "$ref": "#/components/schemas/V1EditLiteImagesRequest" + "description": "Too many requests.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerationErrorResponse" + } } } }, - "description": "A request to edit an image at lower cost and latency.", - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { + "500": { + "description": "Internal server error.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/V1EditImagesResponse" + "description": "Any type" } } - }, - "description": "Image edits generated successfully." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Not authorized to generate an image." - }, - "402": { - "description": "Insufficient credits or quota." + } }, - "422": { + "503": { + "description": "The endpoint is temporarily unavailable.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageSafetyError" + "description": "Any type" } } - }, - "description": "Prompt or provided image failed safety checks." - }, - "429": { - "description": "Too many requests." - }, - "503": { - "description": "Image generation service temporarily unavailable." + } } }, - "summary": "Edit an image with a prompt at lower cost and latency", - "tags": [ - "generate" - ], - "x-fern-examples": [ - { - "request": { - "prompt": "Remove the person from the photo." - }, - "response": { - "body": { - "created": "2000-01-23T04:56:07+00:00", - "data": [ - { - "prompt": "Remove the person from the photo.", - "resolution": "1024x1024", - "is_image_safe": true, - "seed": 12345, - "url": "https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89" + "requestBody": { + "description": "A request to generate images with Nano Banana 2.1. Send it as `application/json`, or as `multipart/form-data` to include source `images`.", + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "prompt": { + "type": "string", + "minLength": 1, + "maxLength": 10000, + "description": "The prompt to generate images from, or the edit instruction to apply when source images are supplied. It is passed to the model as written." + }, + "images": { + "type": "array", + "items": { + "type": "string", + "format": "binary" + }, + "description": "Optional source images to edit (max 10, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only." + }, + "aspect_ratio": { + "$ref": "#/components/schemas/NanoBanana21AspectRatio", + "default": "auto" + }, + "resolution_tier": { + "$ref": "#/components/schemas/V2ImageGenerateNanoBanana21PostRequestBodyContentMultipartFormDataSchemaResolutionTier", + "default": "1K", + "description": "The output resolution tier." + }, + "num_images": { + "type": "integer", + "minimum": 1, + "maximum": 8, + "default": 1, + "description": "The number of images to generate." + }, + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." + }, + "async": { + "type": "boolean", + "default": false, + "description": "When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result." + }, + "webhook_url": { + "type": "string", + "format": "uri", + "maxLength": 2048, + "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n" } + }, + "required": [ + "prompt" ] } - }, - "code-samples": [ - { - "sdk": "curl", - "code": "curl -X POST https://api.ideogram.ai/v1/edit-lite \\\n -H \"Api-Key: \" \\\n -H \"Content-Type: multipart/form-data\" \\\n -F image=@ \\\n -F prompt=\"Remove the person from the photo.\"\n" - }, - { - "sdk": "python", - "code": "import requests\n\nresponse = requests.post(\n \"https://api.ideogram.ai/v1/edit-lite\",\n headers={\n \"Api-Key\": \"\"\n },\n data={\n \"prompt\": \"Remove the person from the photo.\"\n },\n files={\n \"image\": open(\"\", \"rb\"),\n }\n)\nprint(response.json())\nwith open('output.png', 'wb') as f:\n f.write(requests.get(response.json()['data'][0]['url']).content)\n" - }, - { - "sdk": "typescript", - "code": "const formData = new FormData();\nformData.append('prompt', 'Remove the person from the photo.');\nformData.append('image', '');\nconst response = await fetch('https://api.ideogram.ai/v1/edit-lite', {\n method: 'POST',\n headers: { 'Api-Key': '' },\n body: formData\n});\nconst data = await response.json();\nconsole.log(data);\n" - } - ] + } } - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.generate_controller" + }, + "security": [ + { + "ApiKeyAuth": [] + } + ] } }, - "/v1/ernie/async/generate": { + "/v2/image/generate/nano-banana-pro": { "post": { - "description": "Accepts an ERNIE-Image-Turbo generation request for asynchronous\nprocessing and returns immediately with a generation_id. The generated\nimages are POSTed to the supplied `webhook_url` once ready, in a payload\nthat mirrors the synchronous response with an added generation_id for\ncorrelation.\n\nSee [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures.\n", - "operationId": "post_generate_image_ernie_async", + "operationId": "imagesGenerate_post_generate_image_v2_nano_banana_pro", + "summary": "Generate with Nano Banana Pro", + "description": "Generate images with Nano Banana Pro. Optionally upload source images as\n`images` using `multipart/form-data` to edit them with the prompt.\nReturns results directly by default; set `async` or supply a\n`webhook_url` to get a `generation_id` and poll\n`GET /v2/generations/{generation_id}`.\n", + "tags": [ + "images-generate" + ], "parameters": [ { - "explode": true, + "name": "dry_run", "in": "query", - "name": "webhook_url", - "required": true, + "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", + "required": false, "schema": { - "$ref": "#/components/schemas/WebhookUrl" - }, - "style": "form" + "type": "boolean", + "default": false + } } ], - "requestBody": { - "content": { - "multipart/form-data": { - "schema": { - "$ref": "#/components/schemas/GenerateImageRequestErnie" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateImageRequestErnie" - } - } - }, - "description": "A request to generate an image with ERNIE-Image-Turbo.", - "required": true, - "x-body-name": "body" - }, "responses": { "200": { + "description": "The generated images (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests).", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AsyncImageGenerationResponseV4" + "$ref": "#/components/schemas/GenerateImageNanoBananaProResponse" } } - }, - "description": "Request accepted for asynchronous delivery." + } }, "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Not authorized." - }, - "422": { + "description": "Invalid input provided.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageSafetyError" + "description": "Any type" } } - }, - "description": "Prompt failed the safety check." + } }, - "429": { - "description": "Too many requests." - } - }, - "summary": "Generate with ERNIE-Image-Turbo asynchronously via webhook", - "tags": [ - "generate" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.generate_controller" - } - }, - "/v1/ernie/generate": { - "post": { - "description": "Generates images synchronously using the ERNIE-Image-Turbo model. Width\nand height must each be a positive multiple of 16 and the total area\nmust not exceed 1,075,200 pixels (896×1200); the server validates these\nagainst the model's resolution constraints.\n\nImages links are available for a limited period of time; if you would like to keep the image, you must download it.\n", - "operationId": "post_generate_image_ernie", - "requestBody": { - "content": { - "multipart/form-data": { - "schema": { - "$ref": "#/components/schemas/GenerateImageRequestErnie" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateImageRequestErnie" + "401": { + "description": "Unauthorized.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } } } }, - "description": "A request to generate an image with ERNIE-Image-Turbo.", - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { + "402": { + "description": "Insufficient credits or quota.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ImageGenerationResponse" + "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Image(s) generated successfully." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Not authorized." + } }, "422": { + "description": "The prompt did not pass safety checks.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageSafetyError" + "description": "Any type" } } - }, - "description": "Prompt failed the safety check." + } }, "429": { - "description": "Too many requests." - } - }, - "summary": "Generate with ERNIE-Image-Turbo", - "tags": [ - "generate" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.generate_controller" - } - }, - "/v1/flux-2-klein-base/async/generate": { - "post": { - "description": "Accepts an undistilled-base FLUX.2-Klein generation request for asynchronous processing and\nreturns immediately with a generation_id. The generated images are POSTed to\nthe supplied `webhook_url` once ready, in a payload that mirrors the\nsynchronous response with an added generation_id for correlation.\n\nSee [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures.\n", - "operationId": "post_generate_image_flux2_klein_base_async", - "parameters": [ - { - "explode": true, - "in": "query", - "name": "webhook_url", - "required": true, - "schema": { - "$ref": "#/components/schemas/WebhookUrl" - }, - "style": "form" - } - ], - "requestBody": { - "content": { - "multipart/form-data": { - "schema": { - "$ref": "#/components/schemas/GenerateImageRequestFlux2KleinBase" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateImageRequestFlux2KleinBase" + "description": "Too many requests.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerationErrorResponse" + } } } }, - "description": "A request to generate an image with the undistilled FLUX.2-Klein base.", - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { + "500": { + "description": "Internal server error.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AsyncImageGenerationResponseV4" + "description": "Any type" } } - }, - "description": "Request accepted for asynchronous delivery." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Not authorized." + } }, - "422": { + "503": { + "description": "The endpoint is temporarily unavailable.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageSafetyError" + "description": "Any type" } } - }, - "description": "Prompt failed the safety check." - }, - "429": { - "description": "Too many requests." + } } }, - "summary": "Generate with FLUX.2-Klein (undistilled base) asynchronously via webhook", - "tags": [ - "generate" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.generate_controller" - } - }, - "/v1/flux-2-klein-base/generate": { - "post": { - "description": "Generates images synchronously using the UNDISTILLED FLUX.2-Klein base — the 50-step quality tier (vs the distilled /v1/flux-2-klein fast tier). Width and\nheight must each be a positive multiple of 16 and the total area must\nnot exceed 1,048,576 pixels (1024×1024); the server validates these\nagainst the model's resolution constraints.\n\nImages links are available for a limited period of time; if you would like to keep the image, you must download it.\n", - "operationId": "post_generate_image_flux2_klein_base", "requestBody": { + "description": "A request to generate images with Nano Banana Pro. Send it as `application/json`, or as `multipart/form-data` to include source `images`.", "content": { "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/GenerateImageRequestFlux2KleinBase" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateImageRequestFlux2KleinBase" + "type": "object", + "properties": { + "prompt": { + "type": "string", + "minLength": 1, + "maxLength": 10000, + "description": "The prompt to generate images from, or the edit instruction to apply when source images are supplied. It is passed to the model as written." + }, + "images": { + "type": "array", + "items": { + "type": "string", + "format": "binary" + }, + "description": "Optional source images to edit (max 10, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only." + }, + "aspect_ratio": { + "$ref": "#/components/schemas/NanoBananaProAspectRatio", + "default": "auto" + }, + "resolution_tier": { + "$ref": "#/components/schemas/V2ImageGenerateNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier", + "default": "1K", + "description": "The output resolution tier." + }, + "num_images": { + "type": "integer", + "minimum": 1, + "maximum": 8, + "default": 1, + "description": "The number of images to generate." + }, + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." + }, + "async": { + "type": "boolean", + "default": false, + "description": "When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result." + }, + "webhook_url": { + "type": "string", + "format": "uri", + "maxLength": 2048, + "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n" + } + }, + "required": [ + "prompt" + ] } } - }, - "description": "A request to generate an image with the undistilled FLUX.2-Klein base.", - "required": true, - "x-body-name": "body" + } }, + "security": [ + { + "ApiKeyAuth": [] + } + ] + } + }, + "/v2/image/generate/p-image-ideogram": { + "post": { + "operationId": "imagesGenerate_post_generate_image_v2_p_image_ideogram", + "summary": "Generate with P-Image Ideogram", + "description": "Generate images with P-Image Ideogram, a fast model with selectable\nquality and resolution tiers. Returns results directly by default; set\n`async` or supply a `webhook_url` to get a `generation_id` and poll\n`GET /v2/generations/{generation_id}`.\n", + "tags": [ + "images-generate" + ], + "parameters": [ + { + "name": "dry_run", + "in": "query", + "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", + "required": false, + "schema": { + "type": "boolean", + "default": false + } + } + ], "responses": { "200": { + "description": "The generated images (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests).", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ImageGenerationResponse" + "$ref": "#/components/schemas/GenerateImagePImageIdeogramResponse" } } - }, - "description": "Image(s) generated successfully." + } }, "400": { - "description": "Invalid input provided." + "description": "Invalid input provided.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "401": { - "description": "Not authorized." - }, - "422": { + "description": "Unauthorized.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageSafetyError" + "description": "Any type" } } - }, - "description": "Prompt failed the safety check." + } }, - "429": { - "description": "Too many requests." - } - }, - "summary": "Generate with FLUX.2-Klein (undistilled base)", - "tags": [ - "generate" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.generate_controller" - } - }, - "/v1/flux-2-klein/async/generate": { - "post": { - "description": "Accepts a FLUX.2-Klein generation request for asynchronous processing and\nreturns immediately with a generation_id. The generated images are POSTed to\nthe supplied `webhook_url` once ready, in a payload that mirrors the\nsynchronous response with an added generation_id for correlation.\n\nSee [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures.\n", - "operationId": "post_generate_image_flux2_klein_async", - "parameters": [ - { - "explode": true, - "in": "query", - "name": "webhook_url", - "required": true, - "schema": { - "$ref": "#/components/schemas/WebhookUrl" - }, - "style": "form" - } - ], - "requestBody": { - "content": { - "multipart/form-data": { - "schema": { - "$ref": "#/components/schemas/GenerateImageRequestFlux2Klein" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateImageRequestFlux2Klein" - } - } - }, - "description": "A request to generate an image with FLUX.2-Klein.", - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { + "402": { + "description": "Insufficient credits or quota.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AsyncImageGenerationResponseV4" + "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Request accepted for asynchronous delivery." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Not authorized." + } }, "422": { + "description": "The prompt did not pass safety checks.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageSafetyError" + "description": "Any type" } } - }, - "description": "Prompt failed the safety check." + } }, "429": { - "description": "Too many requests." - } - }, - "summary": "Generate with FLUX.2-Klein asynchronously via webhook", - "tags": [ - "generate" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.generate_controller" - } - }, - "/v1/flux-2-klein/generate": { - "post": { - "description": "Generates images synchronously using the FLUX.2-Klein model. Width and\nheight must each be a positive multiple of 16 and the total area must\nnot exceed 1,048,576 pixels (1024×1024); the server validates these\nagainst the model's resolution constraints.\n\nImages links are available for a limited period of time; if you would like to keep the image, you must download it.\n", - "operationId": "post_generate_image_flux2_klein", - "requestBody": { - "content": { - "multipart/form-data": { - "schema": { - "$ref": "#/components/schemas/GenerateImageRequestFlux2Klein" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateImageRequestFlux2Klein" + "description": "Too many requests.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerationErrorResponse" + } } } }, - "description": "A request to generate an image with FLUX.2-Klein.", - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { + "500": { + "description": "Internal server error.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ImageGenerationResponse" + "description": "Any type" } } - }, - "description": "Image(s) generated successfully." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Not authorized." + } }, - "422": { + "503": { + "description": "The endpoint is temporarily unavailable.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageSafetyError" + "description": "Any type" } } - }, - "description": "Prompt failed the safety check." - }, - "429": { - "description": "Too many requests." + } } }, - "summary": "Generate with FLUX.2-Klein", - "tags": [ - "generate" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.generate_controller" + "requestBody": { + "description": "A request to generate images with P-Image Ideogram.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerateImagePImageIdeogramRequest" + } + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + } + ] } }, - "/v1/generations/{generation_id}": { - "get": { - "description": "Retrieves the current status of an asynchronous generation, and its results once complete. Use the `generation_id` returned by the async generation endpoint. While the generation is `pending` or has `failed`, the response contains only `generation_id`, `status`, and `created`. Once `status` is `completed`, the response includes `response_type` and `data`, and may include `usage_cost_usd_micros` when the request uses variable usage-based pricing.", - "operationId": "get_generation", + "/v2/image/generate/z-image": { + "post": { + "operationId": "imagesGenerate_post_generate_image_v2_z_image", + "summary": "Generate with Z-Image", + "description": "Generate images from a text prompt with Z-Image. Returns results\ndirectly by default; set `async` or supply a `webhook_url` to get a\n`generation_id` and poll `GET /v2/generations/{generation_id}`.\n", + "tags": [ + "images-generate" + ], "parameters": [ { - "description": "URL-safe base64 ID of the generation returned by the async generation endpoint.", - "explode": false, - "in": "path", - "name": "generation_id", - "required": true, + "name": "dry_run", + "in": "query", + "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", + "required": false, "schema": { - "type": "string" - }, - "style": "simple" + "type": "boolean", + "default": false + } } ], "responses": { "200": { + "description": "The generated images (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests).", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerationResponse" - } - } - }, - "description": "Generation status retrieved successfully." - }, - "400": { - "description": "Invalid request ID provided." - }, - "401": { - "description": "Not authorized." - }, - "404": { - "description": "Request not found." - }, - "429": { - "description": "Too many requests." - } - }, - "summary": "Poll a generation", - "tags": [ - "generate" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.generate_controller" - } - }, - "/v1/ideogram-v3/edit": { - "post": { - "deprecated": true, - "description": "Deprecated: use [`POST /v1/ideogram-v3/inpaint`](/api-reference/api-reference/inpaint-v3) instead. This endpoint will be removed in a future release.\n\nEdit a given image synchronously using the provided mask with Ideogram 3.0. The mask indicates which part of the image\nshould be edited, while the prompt and chosen style can further guide the edit.\n\nSupported image formats include JPEG, PNG, and WebP.\n\nImages links are available for a limited period of time; if you would like to keep the image, you must download it.\n", - "operationId": "post_edit_image_v3", - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "color_palette": { - "contentType": "application/json", - "style": "form" + "$ref": "#/components/schemas/GenerateImageZImageResponse" } - }, - "schema": { - "$ref": "#/components/schemas/EditImageRequestV3" } } }, - "description": "A request to edit an image with Ideogram 3.0.", - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { + "400": { + "description": "Invalid input provided.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ImageGenerationResponseV3" + "description": "Any type" } } - }, - "description": "Image edits generated successfully." - }, - "400": { - "description": "Invalid input provided." + } }, "401": { - "description": "Not authorized to generate an image." - }, - "422": { + "description": "Unauthorized.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageSafetyError" - } - } - }, - "description": "Prompt or Initial Image failed the safety checks." - }, - "429": { - "description": "Too many requests." - } - }, - "summary": "Edit with Ideogram 3.0", - "tags": [ - "generate" - ], - "x-fern-examples": [ - { - "request": { - "prompt": "A photo of a cat wearing a hat.", - "style_type": "AUTO" - }, - "response": { - "body": { - "created": "2000-01-23T04:56:07+00:00", - "data": [ - { - "prompt": "A photo of a cat wearing a hat.", - "resolution": "1024x1024", - "is_image_safe": true, - "seed": 12345, - "url": "https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89", - "style_type": "AUTO" - } - ] - } - }, - "code-samples": [ - { - "sdk": "curl", - "code": "curl -X POST https://api.ideogram.ai/v1/ideogram-v3/edit \\\n -H \"Api-Key: \" \\\n -H \"Content-Type: multipart/form-data\" \\\n -F image=@ \\\n -F mask=@ \\\n -F prompt=\"A photo of a cat wearing a hat.\" \\\n -F rendering_speed=\"DEFAULT\"\n" - }, - { - "sdk": "python", - "code": "import requests\n\nresponse = requests.post(\n \"https://api.ideogram.ai/v1/ideogram-v3/edit\",\n headers={\n \"Api-Key\": \"\"\n },\n data={\n \"prompt\": \"A photo of a cat wearing a hat.\",\n \"rendering_speed\": \"DEFAULT\"\n },\n files={\n \"image\": open(\"\", \"rb\"),\n \"mask\": open(\"\", \"rb\"),\n }\n)\nprint(response.json())\nwith open('output.png', 'wb') as f:\n f.write(requests.get(response.json()['data'][0]['url']).content)\n" - }, - { - "sdk": "typescript", - "code": "const formData = new FormData();\nformData.append('prompt', 'A photo of a cat');\nformData.append('rendering_speed', 'TURBO');\nconst response = await fetch('https://api.ideogram.ai/v1/ideogram-v3/edit', {\n method: 'POST',\n headers: { 'Api-Key': '' },\n body: formData\n});\nconst data = await response.json();\nconsole.log(data);\n" - } - ] - } - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.generate_controller" - } - }, - "/v1/ideogram-v3/generate": { - "post": { - "description": "Generates images synchronously based on a given prompt and optional parameters using the Ideogram 3.0 model.\n\nImages links are available for a limited period of time; if you would like to keep the image, you must download it.\n", - "operationId": "post_generate_image_v3", - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "color_palette": { - "contentType": "application/json", - "style": "form" + "description": "Any type" } - }, - "schema": { - "$ref": "#/components/schemas/GenerateImageRequestV3" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateImageRequestV3" } } }, - "description": "A request to generate an image with Ideogram 3.0.", - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { + "402": { + "description": "Insufficient credits or quota.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ImageGenerationResponseV3" + "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Image(s) generated successfully." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Not authorized to generate an image." + } }, "422": { + "description": "The prompt did not pass safety checks.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageSafetyError" + "description": "Any type" } } - }, - "description": "Prompt failed the safety check." + } }, "429": { - "description": "Too many requests." - } - }, - "summary": "Generate with Ideogram 3.0", - "tags": [ - "generate" - ], - "x-fern-examples": [ - { - "request": { - "prompt": "A photo of a cat sleeping on a couch.", - "rendering_speed": "TURBO", - "aspect_ratio": "1x1", - "style_type": "AUTO" - }, - "response": { - "body": { - "created": "2000-01-23T04:56:07+00:00", - "data": [ - { - "prompt": "A photo of a cat sleeping on a couch.", - "resolution": "1024x1024", - "is_image_safe": true, - "seed": 12345, - "url": "https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89", - "style_type": "GENERAL" - } - ] - } - }, - "code-samples": [ - { - "sdk": "curl", - "code": "curl -X POST https://api.ideogram.ai/v1/ideogram-v3/generate \\\n -H \"Api-Key: \" \\\n -H \"Content-Type: multipart/form-data\" \\\n -F prompt=\"A photo of a cat sleeping on a couch.\" \\\n -F rendering_speed=\"TURBO\"\n" - }, - { - "sdk": "python", - "code": "import requests\n\n# Generate with Ideogram 3.0 (POST /v1/ideogram-v3/generate)\nresponse = requests.post(\n \"https://api.ideogram.ai/v1/ideogram-v3/generate\",\n headers={\n \"Api-Key\": \"\"\n },\n json={\n \"prompt\": \"A picture of a cat\",\n \"rendering_speed\": \"TURBO\"\n }\n)\nprint(response.json())\nwith open('output.png', 'wb') as f:\n f.write(requests.get(response.json()['data'][0]['url']).content)\n\n# Generate with style reference images\nresponse = requests.post(\n \"https://api.ideogram.ai/v1/ideogram-v3/generate\",\n headers={\n \"Api-Key\": \"\"\n },\n data={\n \"prompt\": \"A picture of a cat\",\n \"aspect_ratio\": \"3x1\"\n },\n files=[\n (\"style_reference_images\", open(\"style_reference_image_1.png\", \"rb\")),\n (\"style_reference_images\", open(\"style_reference_image_2.png\", \"rb\")),\n ]\n)\nprint(response.json())\nwith open('output.png', 'wb') as f:\n f.write(requests.get(response.json()['data'][0]['url']).content)\n" - }, - { - "sdk": "typescript", - "code": "const formData = new FormData();\nformData.append('prompt', 'A photo of a cat');\nformData.append('rendering_speed', 'TURBO');\n// To add style reference images, uncomment the following lines\n// formData.append('style_reference_images', '');\n// formData.append('style_reference_images', '');\nconst response = await fetch('https://api.ideogram.ai/v1/ideogram-v3/generate', {\n method: 'POST',\n headers: { 'Api-Key': '' },\n body: formData\n});\nconst data = await response.json();\nconsole.log(data);\n" - } - ] - } - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.generate_controller" - } - }, - "/v1/ideogram-v3/generate-design": { - "post": { - "description": "Generates a design synchronously from a text prompt using the Ideogram 3.0 model, then detects and corrects text layers within the generated image.\n\nThe response includes the generated image URL along with detected text layers (with font, size, color, position) and image asset layers.\n\nImages links are available for a limited period of time; if you would like to keep the image, you must download it.\n", - "operationId": "post_generate_design_v3", - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "color_palette": { - "contentType": "application/json", - "style": "form" + "description": "Too many requests.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerationErrorResponse" } - }, - "schema": { - "$ref": "#/components/schemas/GenerateDesignRequestV3" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateDesignRequestV3" } } }, - "description": "A request to generate a design with Ideogram 3.0.", - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { + "500": { + "description": "Internal server error.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/LayeredImageGenerationResponseV3" + "description": "Any type" } } - }, - "description": "Design(s) generated successfully with text correction." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Not authorized to generate an image." + } }, - "422": { + "503": { + "description": "The endpoint is temporarily unavailable.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageSafetyError" + "description": "Any type" } } - }, - "description": "Prompt failed the safety check." - }, - "429": { - "description": "Too many requests." + } } }, - "summary": "Generate a design from a text prompt with text detection and correction", - "tags": [ - "generate" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.generate_controller" - } - }, - "/v1/ideogram-v3/generate-transparent": { - "post": { - "description": "Generates images with transparent background synchronously based on a given prompt and optional parameters using\nthe Ideogram 3.0 model. Images will be generated using maximum supported resolution at the specified aspect ratio\nto allow best results with upscaler. The selected resolution is written to the response, not the upscaled final\nresolution.\n\n`rendering_speed=FLASH` is not supported for transparent-background generation; the request will return a 400.\nUse `TURBO`, `DEFAULT`, or `QUALITY` instead.\n\nImages links are available for a limited period of time; if you would like to keep the image, you must download it.\n", - "operationId": "post_generate_image_v3_transparent", "requestBody": { + "description": "A request to generate images with Z-Image.", "content": { - "multipart/form-data": { - "schema": { - "$ref": "#/components/schemas/GenerateTransparentImageRequestV3" - } - }, "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateTransparentImageRequestV3" + "$ref": "#/components/schemas/GenerateImageZImageRequest" } } - }, - "description": "A request to generate an image with transparent background using Ideogram 3.0, with optional upscaling.", - "required": true, - "x-body-name": "body" + } }, + "security": [ + { + "ApiKeyAuth": [] + } + ] + } + }, + "/v2/image/remix/auto": { + "post": { + "operationId": "autoModel_post_tool_remix", + "summary": "Remix with automatic model selection", + "description": "Remix an image guided by a text prompt, with Ideogram choosing the\nmodel. Upload the source image as `image` using `multipart/form-data`.\nReturns results directly by default; set `async` or supply a\n`webhook_url` to get a `generation_id` and poll\n`GET /v2/generations/{generation_id}`.", + "tags": [ + "auto-model" + ], + "parameters": [ + { + "name": "dry_run", + "in": "query", + "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", + "required": false, + "schema": { + "type": "boolean", + "default": false + } + } + ], "responses": { "200": { + "description": "The remixed images (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests).", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ImageGenerationResponseV3" + "$ref": "#/components/schemas/ToolRemixResponse" } } - }, - "description": "Image(s) generated successfully." + } }, "400": { - "description": "Invalid input provided." + "description": "Invalid input provided.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "401": { - "description": "Not authorized to generate an image." - }, - "422": { + "description": "Unauthorized.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageSafetyError" + "description": "Any type" } } - }, - "description": "Prompt failed the safety check." + } }, - "429": { - "description": "Too many requests." - } - }, - "summary": "Generate with Ideogram 3.0 (Transparent Background)", - "tags": [ - "generate" - ], - "x-fern-examples": [ - { - "request": { - "prompt": "A logo for Ideogram Coffee.", - "rendering_speed": "TURBO", - "aspect_ratio": "1x1", - "upscale_factor": "X2" - }, - "response": { - "body": { - "created": "2000-01-23T04:56:07+00:00", - "data": [ - { - "prompt": "A logo for Ideogram Coffee.", - "resolution": "1024x1024", - "upscaled_resolution": "2048x2028", - "is_image_safe": true, - "seed": 12345, - "url": "https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89" - } - ] - } - }, - "code-samples": [ - { - "sdk": "curl", - "code": "curl -X POST https://api.ideogram.ai/v1/ideogram-v3/generate-transparent \\\n -H \"Api-Key: \" \\\n -H \"Content-Type: multipart/form-data\" \\\n -F prompt=\"A logo for Ideogram Coffee.\" \\\n -F rendering_speed=\"TURBO\"\n" - }, - { - "sdk": "python", - "code": "import requests\n\n# Generate with Ideogram 3.0 (POST /v1/ideogram-v3/generate-transparent)\nresponse = requests.post(\n \"https://api.ideogram.ai/v1/ideogram-v3/generate-transparent\",\n headers={\n \"Api-Key\": \"\"\n },\n json={\n \"prompt\": \"A logo for Ideogram Coffee.\",\n \"rendering_speed\": \"TURBO\"\n }\n)\nprint(response.json())\nwith open('output.png', 'wb') as f:\n f.write(requests.get(response.json()['data'][0]['url']).content)\n" - }, - { - "sdk": "typescript", - "code": "const formData = new FormData();\nformData.append('prompt', 'A logo for Ideogram Coffee.');\nformData.append('rendering_speed', 'TURBO');\nconst response = await fetch('https://api.ideogram.ai/v1/ideogram-v3/generate-transparent', {\n method: 'POST',\n headers: { 'Api-Key': '' },\n body: formData\n});\nconst data = await response.json();\nconsole.log(data);\n" - } - ] - } - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.generate_controller" - } - }, - "/v1/ideogram-v3/graphic": { - "post": { - "deprecated": true, - "description": "Deprecated: Use /v1/ideogram-v3/generate-design for text-to-design or /v1/ideogram-v3/layerize-design for image-to-design.\n\nGenerates graphics synchronously based on a given prompt and optional parameters using the Ideogram 3.0 model, with text detection and correction capabilities.\n\nImages links are available for a limited period of time; if you would like to keep the image, you must download it.\n", - "operationId": "post_generate_graphic_v3", - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "color_palette": { - "contentType": "application/json", - "style": "form" + "402": { + "description": "Insufficient credits or quota.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerationErrorResponse" } - }, - "schema": { - "$ref": "#/components/schemas/GenerateGraphicRequestV3" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateGraphicRequestV3" } } }, - "description": "A request to generate a graphic with Ideogram 3.0.", - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { + "404": { + "description": "A referenced resource was not found.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/LayeredImageGenerationResponseV3" + "description": "Any type" } } - }, - "description": "Graphic(s) generated successfully with text correction." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Not authorized to generate an image." + } }, "422": { + "description": "The prompt did not pass safety checks.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageSafetyError" + "description": "Any type" } } - }, - "description": "Prompt failed the safety check." + } }, "429": { - "description": "Too many requests." - } - }, - "summary": "Generate graphics with Ideogram 3.0 and text correction", - "tags": [ - "generate" - ], - "x-fern-examples": [ - { - "request": { - "prompt": "A birthday card saying 'Happy Birthday'", - "rendering_speed": "TURBO", - "aspect_ratio": "1x1", - "style_type": "AUTO" - }, - "response": { - "body": { - "created": "2000-01-23T04:56:07+00:00", - "data": [ - { - "prompt": "A birthday card saying 'Happy Birthday'", - "resolution": "1024x1024", - "is_image_safe": true, - "seed": 12345, - "url": "https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89", - "style_type": "GENERAL" - } - ] - } - }, - "code-samples": [ - { - "sdk": "curl", - "code": "curl -X POST https://api.ideogram.ai/v1/ideogram-v3/graphic \\\n -H \"Api-Key: \" \\\n -H \"Content-Type: multipart/form-data\" \\\n -F prompt=\"A birthday card saying 'Happy Birthday'\" \\\n -F rendering_speed=\"TURBO\"\n" - }, - { - "sdk": "python", - "code": "import requests\n\nresponse = requests.post(\n \"https://api.ideogram.ai/v1/ideogram-v3/graphic\",\n headers={\n \"Api-Key\": \"\"\n },\n json={\n \"prompt\": \"A birthday card saying 'Happy Birthday'\",\n \"rendering_speed\": \"TURBO\"\n }\n)\nprint(response.json())\nwith open('output.png', 'wb') as f:\n f.write(requests.get(response.json()['data'][0]['url']).content)\n" - }, - { - "sdk": "typescript", - "code": "const formData = new FormData();\nformData.append('prompt', 'A birthday card saying Happy Birthday');\nformData.append('rendering_speed', 'TURBO');\nconst response = await fetch('https://api.ideogram.ai/v1/ideogram-v3/graphic', {\n method: 'POST',\n headers: { 'Api-Key': '' },\n body: formData\n});\nconst data = await response.json();\nconsole.log(data);\n" - } - ] - } - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.generate_controller" - } - }, - "/v1/ideogram-v3/inpaint": { - "post": { - "description": "Inpaint a given image synchronously using the provided mask with Ideogram 3.0. The mask indicates which part of the image\nshould be edited, while the prompt and chosen style can further guide the edit.\n\nSupported image formats include JPEG, PNG, and WebP.\n\nImages links are available for a limited period of time; if you would like to keep the image, you must download it.\n", - "operationId": "post_inpaint_image_v3", - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "color_palette": { - "contentType": "application/json", - "style": "form" + "description": "Too many requests.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerationErrorResponse" } - }, - "schema": { - "$ref": "#/components/schemas/EditImageRequestV3" } } }, - "description": "A request to inpaint an image with Ideogram 3.0.", - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { + "500": { + "description": "Internal server error.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ImageGenerationResponseV3" + "description": "Any type" } } - }, - "description": "Image edits generated successfully." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Not authorized to generate an image." + } }, - "422": { + "503": { + "description": "The endpoint is temporarily unavailable.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageSafetyError" + "description": "Any type" } } - }, - "description": "Prompt or Initial Image failed the safety checks." - }, - "429": { - "description": "Too many requests." + } } }, - "summary": "Inpaint with Ideogram 3.0", - "tags": [ - "generate" - ], - "x-fern-examples": [ - { - "request": { - "prompt": "A photo of a cat wearing a hat.", - "style_type": "AUTO" - }, - "response": { - "body": { - "created": "2000-01-23T04:56:07+00:00", - "data": [ - { - "prompt": "A photo of a cat wearing a hat.", - "resolution": "1024x1024", - "is_image_safe": true, - "seed": 12345, - "url": "https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89", - "style_type": "AUTO" - } - ] - } - }, - "code-samples": [ - { - "sdk": "curl", - "code": "curl -X POST https://api.ideogram.ai/v1/ideogram-v3/inpaint \\\n -H \"Api-Key: \" \\\n -H \"Content-Type: multipart/form-data\" \\\n -F image=@ \\\n -F mask=@ \\\n -F prompt=\"A photo of a cat wearing a hat.\" \\\n -F rendering_speed=\"DEFAULT\"\n" - }, - { - "sdk": "python", - "code": "import requests\n\nresponse = requests.post(\n \"https://api.ideogram.ai/v1/ideogram-v3/inpaint\",\n headers={\n \"Api-Key\": \"\"\n },\n data={\n \"prompt\": \"A photo of a cat wearing a hat.\",\n \"rendering_speed\": \"DEFAULT\"\n },\n files={\n \"image\": open(\"\", \"rb\"),\n \"mask\": open(\"\", \"rb\"),\n }\n)\nprint(response.json())\nwith open('output.png', 'wb') as f:\n f.write(requests.get(response.json()['data'][0]['url']).content)\n" - }, - { - "sdk": "typescript", - "code": "const formData = new FormData();\nformData.append('prompt', 'A photo of a cat');\nformData.append('rendering_speed', 'TURBO');\nconst response = await fetch('https://api.ideogram.ai/v1/ideogram-v3/inpaint', {\n method: 'POST',\n headers: { 'Api-Key': '' },\n body: formData\n});\nconst data = await response.json();\nconsole.log(data);\n" - } - ] - } - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.generate_controller" - } - }, - "/v1/ideogram-v3/layerize-design": { - "post": { - "description": "Processes an existing flat graphic image to detect and correct text layers without generating a new image from scratch.\n\nThe uploaded image is analyzed for text content, which is then removed and returned as structured text layers with font matching, sizing, and color information.\n\nSupported image formats include JPEG, PNG, and WebP (max size 25MB).\n\nImages links are available for a limited period of time; if you would like to keep the image, you must download it.\n", - "operationId": "post_layerize_design_v3", "requestBody": { + "description": "A request to remix one image with an automatically selected model. Send it as `multipart/form-data` with the source `image`.", "content": { "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/LayerizeDesignRequestV3" + "type": "object", + "properties": { + "prompt": { + "type": "string", + "minLength": 1, + "maxLength": 10000, + "description": "The prompt that guides the remix." + }, + "image": { + "type": "string", + "format": "binary", + "description": "The image to remix (max 50MB; JPEG, PNG, or WEBP). Multipart requests only. The image is used only for this request and is not saved to your account." + }, + "image_weight": { + "type": "integer", + "minimum": 1, + "maximum": 100, + "description": "Optional. How closely the result should follow the source image, from 1 to 100. When omitted the selected model chooses its usual strength. Combining a weight with a `resolution` or `aspect_ratio` that changes the source's aspect ratio crops the source to the new shape; this is only available at the 1K tier and is rejected at 2K." + }, + "negative_prompt": { + "type": "string", + "maxLength": 10000, + "description": "Description of what to exclude from the images. The prompt takes precedence over the negative prompt. Not every model uses it." + }, + "resolution": { + "type": "string", + "pattern": "^[1-9][0-9]{1,4}x[1-9][0-9]{1,4}$", + "description": "The requested output resolution, formatted as \"WIDTHxHEIGHT\" (for example \"1280x800\"). The output uses the closest supported resolution in the matching 1K or 2K tier. Omit `aspect_ratio` when supplying a resolution. If `resolution_tier` is also supplied, it must match the tier these dimensions fall in. Combining a shape-changing value with `image_weight` requires the 1K tier." + }, + "aspect_ratio": { + "$ref": "#/components/schemas/IdeogramV4AspectRatio", + "description": "The requested output aspect ratio. Omit it to keep the source image's shape. `auto` also keeps the source shape. Omit `resolution` when supplying a concrete value. Combining a shape-changing value with `image_weight` requires the 1K tier." + }, + "resolution_tier": { + "$ref": "#/components/schemas/V2ImageRemixAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier", + "description": "The output resolution tier. When omitted, the tier is inferred from `resolution`, or defaults to 1k. A color palette, style codes, style preset, or non-`auto` style type are only supported at 1k." + }, + "magic_prompt": { + "$ref": "#/components/schemas/MagicPromptMode", + "default": "auto", + "description": "Controls magic prompt (automatic prompt rewriting). Defaults to `auto`. The selected model decides how to interpret it." + }, + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Optional. Only honored when the request uses a model that supports reproducible remixes; results from the default model are not reproducible. The response reports the seed used." + }, + "style_preset": { + "$ref": "#/components/schemas/IdeogramV3StylePreset", + "description": "A predefined style preset to apply. Limits the request to a model that supports it and requires the 1K resolution tier. Cannot be combined with style codes." + }, + "color_palette": { + "$ref": "#/components/schemas/IdeogramColorPalette", + "description": "A color palette to apply. Limits the request to a model that supports palettes and requires the 1K resolution tier." + }, + "style_codes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/StyleCode" + }, + "description": "A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images." + }, + "style_type": { + "$ref": "#/components/schemas/IdeogramV3StyleType", + "description": "The style type to generate with. A value other than `auto` limits the request to a model that supports it and requires the 1K resolution tier." + }, + "num_images": { + "type": "integer", + "minimum": 1, + "maximum": 8, + "default": 1, + "description": "The number of images to generate." + }, + "enable_copyright_detection": { + "type": [ + "boolean", + "null" + ], + "description": "Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`." + }, + "async": { + "type": "boolean", + "default": false, + "description": "When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result." + }, + "webhook_url": { + "type": "string", + "format": "uri", + "maxLength": 2048, + "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n" + } + }, + "required": [ + "prompt", + "image" + ] } } - }, - "description": "A request to layerize an existing flat graphic image.", - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/LayeredImageGenerationResponseV3" - } - } - }, - "description": "Design layerized successfully with text correction." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Not authorized to generate an image." - }, - "429": { - "description": "Too many requests." } }, - "summary": "Layerize an existing flat graphic image with text detection and correction", - "tags": [ - "generate" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.generate_controller" + "security": [ + { + "ApiKeyAuth": [] + } + ] } }, - "/v1/ideogram-v3/layerize-text": { + "/v2/image/remix/ideogram-4": { "post": { - "description": "Analyzes an image to detect text regions, then returns each detected text block with its position, content, font information, and styling.\n\nThe response includes a text-erased base image (background with all text removed) and a flat list of detected text blocks.\n\nSupported image formats include JPEG, PNG, and WebP (max size 25MB).\n\nImage links are available for a limited period of time; if you would like to keep the image, you must download it.\n", - "operationId": "post_layerize_text_v3", - "requestBody": { - "content": { - "multipart/form-data": { - "schema": { - "$ref": "#/components/schemas/LayerizeTextRequest" - } + "operationId": "imagesRemix_post_remix_image_v2_ideogram_v4", + "summary": "Remix with Ideogram 4.0", + "description": "Transform an existing image with Ideogram 4.0, guided by a text\nprompt. Upload the source `image` using `multipart/form-data`.\nReturns results directly by default; set `async` or supply a\n`webhook_url` to get a `generation_id` and poll\n`GET /v2/generations/{generation_id}`.\n", + "tags": [ + "images-remix" + ], + "parameters": [ + { + "name": "dry_run", + "in": "query", + "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", + "required": false, + "schema": { + "type": "boolean", + "default": false } - }, - "description": "A request to detect and extract text layers from an image.", - "required": true, - "x-body-name": "body" - }, + } + ], "responses": { "200": { + "description": "The remixed images (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests).", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/LayerizeTextResponse" + "$ref": "#/components/schemas/RemixImageIdeogramV4Response" } } - }, - "description": "Text layers detected and extracted successfully." + } }, "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Not authorized." - }, - "429": { - "description": "Too many requests." - } - }, - "summary": "Layerize Text", - "tags": [ - "generate" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.generate_controller" - } - }, - "/v1/ideogram-v3/reframe": { - "post": { - "description": "Reframe a square image to a chosen resolution with Ideogram 3.0. The supported image formats include JPEG, PNG, and WebP.\n\nImage links are available for a limited period of time; if you would like to keep the image, you must download it.\n", - "operationId": "post_reframe_image_v3", - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "color_palette": { - "contentType": "application/json", - "style": "form" + "description": "Invalid input provided.", + "content": { + "application/json": { + "schema": { + "description": "Any type" } - }, - "schema": { - "$ref": "#/components/schemas/ReframeImageRequestV3" } } }, - "description": "A request to reframe an image in a new resolution.", - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { + "401": { + "description": "Unauthorized.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ImageGenerationResponseV3" + "description": "Any type" } } - }, - "description": "Image re-frames generated successfully." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Not authorized to generate an image." + } }, - "422": { + "402": { + "description": "Insufficient credits or quota.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageSafetyError" + "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Prompt or Image failed the safety checks." - }, - "429": { - "description": "Too many requests." - } - }, - "summary": "Reframe with Ideogram 3.0", - "tags": [ - "generate" - ], - "x-fern-examples": [ - { - "request": { - "resolution": "512x1536" - }, - "response": { - "body": { - "created": "2000-01-23T04:56:07+00:00", - "data": [ - { - "prompt": "A photo of a cat", - "resolution": "1280x800", - "is_image_safe": true, - "seed": 12345, - "url": "https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89", - "style_type": "GENERAL" - } - ] - } - }, - "code-samples": [ - { - "sdk": "curl", - "code": "curl -X POST https://api.ideogram.ai/v1/ideogram-v3/reframe \\\n -H \"Api-Key: \" \\\n -H \"Content-Type: multipart/form-data\" \\\n -F image=@ \\\n -F resolution=\"512x1536\"\n" - }, - { - "sdk": "python", - "code": "import requests\n\nresponse = requests.post(\n \"https://api.ideogram.ai/v1/ideogram-v3/reframe\",\n headers={\n \"Api-Key\": \"\"\n },\n data={\n \"resolution\": \"512x1536\"\n },\n files={\n \"image\": open(\"\", \"rb\"),\n }\n)\nprint(response.json())\nwith open('output.png', 'wb') as f:\n f.write(requests.get(response.json()['data'][0]['url']).content)\n" - }, - { - "sdk": "typescript", - "code": "const formData = new FormData();\nformData.append('resolution', '512x1536');\nformData.append('image', '');\nconst response = await fetch('https://api.ideogram.ai/v1/ideogram-v3/reframe', {\n method: 'POST',\n headers: { 'Api-Key': '' },\n body: formData\n});\nconst data = await response.json();\nconsole.log(data);\n" - } - ] - } - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.generate_controller" - } - }, - "/v1/ideogram-v3/remix": { - "post": { - "description": "Remix provided images synchronously based on a given prompt and optional parameters with the Ideogram 3.0 model.\n\nInput images are cropped to the chosen aspect ratio before being remixed.\n\nSupported image formats include JPEG, PNG, and WebP.\n\nImages links are available for a limited period of time; if you would like to keep the image, you must download it.\n", - "operationId": "post_remix_image_v3", - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "color_palette": { - "contentType": "application/json", - "style": "form" - } - }, - "schema": { - "$ref": "#/components/schemas/RemixImageRequestV3" - } } }, - "description": "A request to remix an image with Ideogram 3.0.", - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { + "404": { + "description": "A referenced resource was not found.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ImageGenerationResponseV3" + "description": "Any type" } } - }, - "description": "Image(s) generated successfully." - }, - "400": { - "description": "Invalid input provided." - }, - "403": { - "description": "Not authorized to generate an image." + } }, "422": { + "description": "The prompt did not pass safety checks.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageSafetyError" + "description": "Any type" } } - }, - "description": "Prompt or provided image failed safety check." + } }, "429": { - "description": "Too many requests." - } - }, - "summary": "Remix with Ideogram 3.0", - "tags": [ - "generate" - ], - "x-fern-examples": [ - { - "request": { - "prompt": "A photo of a cat", - "rendering_speed": "DEFAULT", - "image_weight": 50, - "aspect_ratio": "1x2", - "style_type": "AUTO" - }, - "response": { - "body": { - "created": "2000-01-23T04:56:07+00:00", - "data": [ - { - "prompt": "A photo of a cat", - "resolution": "1280x800", - "is_image_safe": true, - "seed": 12345, - "url": "https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89", - "style_type": "GENERAL" - } - ] - } - }, - "code-samples": [ - { - "sdk": "curl", - "code": "curl -X POST https://api.ideogram.ai/v1/ideogram-v3/remix \\\n -H \"Api-Key: \" \\\n -H \"Content-Type: multipart/form-data\" \\\n -F image=@ \\\n -F prompt=\"A photo of a cat\" \\\n -F rendering_speed=\"TURBO\"\n" - }, - { - "sdk": "python", - "code": "import requests\n\nresponse = requests.post(\n \"https://api.ideogram.ai/v1/ideogram-v3/remix\",\n headers={\n \"Api-Key\": \"\"\n },\n data={\n \"prompt\": \"A photo of a cat\",\n \"rendering_speed\": \"TURBO\"\n },\n files={\n \"image\": open(\"\", \"rb\"),\n }\n)\nprint(response.json())\nwith open('output.png', 'wb') as f:\n f.write(requests.get(response.json()['data'][0]['url']).content)\n" - }, - { - "sdk": "typescript", - "code": "const formData = new FormData();\nformData.append('prompt', 'A photo of a cat');\nformData.append('rendering_speed', 'TURBO');\nformData.append('image', '');\nconst response = await fetch('https://api.ideogram.ai/v1/ideogram-v3/remix', {\n method: 'POST',\n headers: { 'Api-Key': '' },\n body: formData\n});\nconst data = await response.json();\nconsole.log(data);\n" - } - ] - } - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.generate_controller" - } - }, - "/v1/ideogram-v3/replace-background": { - "post": { - "description": "Replace the background of a given image synchronously using a prompt with Ideogram 3.0. The foreground subject\nwill be identified and kept, while the background is replaced based on the prompt and chosen style.\nSupported image formats include JPEG, PNG, and WebP.\nImages links are available for a limited period of time; if you would like to keep the image, you must download it.\n", - "operationId": "post_replace_background_v3", - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "color_palette": { - "contentType": "application/json", - "style": "form" + "description": "Too many requests.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerationErrorResponse" } - }, - "schema": { - "$ref": "#/components/schemas/ReplaceBackgroundRequestV3" } } }, - "description": "A request to replace the background of an image with Ideogram 3.0.", - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { + "500": { + "description": "Internal server error.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ImageGenerationResponseV3" + "description": "Any type" } } - }, - "description": "Background replacement generated successfully." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Not authorized to generate an image." + } }, - "422": { + "503": { + "description": "The endpoint is temporarily unavailable.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageSafetyError" + "description": "Any type" } } - }, - "description": "Prompt or Initial Image failed the safety checks." - }, - "429": { - "description": "Too many requests." + } } }, - "summary": "Replace Background with Ideogram 3.0", - "tags": [ - "generate" - ], - "x-fern-examples": [ - { - "request": { - "prompt": "Add a forest in the background", - "magic_prompt": "ON", - "rendering_speed": "QUALITY" - }, - "response": { - "body": { - "created": "2000-01-23T04:56:07+00:00", - "data": [ - { - "prompt": "Add a forest in the background", - "resolution": "1280x800", - "is_image_safe": true, - "seed": 12345, - "url": "https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89", - "style_type": "GENERAL" + "requestBody": { + "description": "Use `multipart/form-data` to upload the source `image`.", + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "prompt": { + "type": "string", + "minLength": 1, + "maxLength": 10000, + "description": "The prompt that guides the remix. It is always read as an editing instruction, so there is no `magic_prompt` option." + }, + "image": { + "type": "string", + "format": "binary", + "description": "The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` to keep its shape." + }, + "image_weight": { + "type": "integer", + "minimum": 1, + "maximum": 100, + "description": "Optional. How closely the result should follow the source image, from 1 to 100. When omitted the server chooses a value from your prompt, which is the usual case. Only accepted when the output keeps the source image's shape: combining `image_weight` with a `resolution` whose aspect ratio differs from the source's is rejected with a 400." + }, + "num_images": { + "type": "integer", + "minimum": 1, + "maximum": 8, + "default": 1, + "description": "The number of images to generate." + }, + "resolution": { + "$ref": "#/components/schemas/ResolutionV4", + "description": "Optional. When supplied, the images are generated at this\nresolution. When omitted, the source image's shape is kept. A\nresolution whose aspect ratio differs from the source's cannot\nbe combined with `image_weight`.\n" + }, + "rendering_speed": { + "$ref": "#/components/schemas/V2ImageRemixIdeogram4PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed", + "default": "default", + "description": "The rendering speed to use." + }, + "enable_copyright_detection": { + "type": [ + "boolean", + "null" + ], + "description": "Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`." + }, + "async": { + "type": "boolean", + "default": false, + "description": "When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`." + }, + "webhook_url": { + "type": "string", + "format": "uri", + "maxLength": 2048, + "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n" } + }, + "required": [ + "prompt", + "image" ] } - }, - "code-samples": [ - { - "sdk": "curl", - "code": "curl -X POST https://api.ideogram.ai/v1/ideogram-v3/replace-background \\\n -H \"Api-Key: \" \\\n -H \"Content-Type: multipart/form-data\" \\\n -F image=@ \\\n -F prompt=\"Add a forest in the background\"\n" - }, - { - "sdk": "python", - "code": "import requests\n\nresponse = requests.post(\n \"https://api.ideogram.ai/v1/ideogram-v3/replace-background\",\n headers={\n \"Api-Key\": \"\" \n },\n data={\n \"prompt\": \"Add a forest in the background\",\n \"magic_prompt\": \"ON\"\n },\n files={\n \"image\": open(\"\", \"rb\"),\n }\n)\nprint(response.json())\nwith open('output.png', 'wb') as f:\n f.write(requests.get(response.json()['data'][0]['url']).content)\n" - }, - { - "sdk": "typescript", - "code": "const formData = new FormData();\nformData.append('prompt', 'Add a forest in the background');\nformData.append('image', '');\nconst response = await fetch('https://api.ideogram.ai/v1/ideogram-v3/replace-background', {\n method: 'POST',\n headers: { 'Api-Key': '' },\n body: formData\n});\nconst data = await response.json();\nconsole.log(data);\n" - } - ] + } } - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.generate_controller" + }, + "security": [ + { + "ApiKeyAuth": [] + } + ] } }, - "/v1/ideogram-v3/train-model": { + "/v2/image/remix/ideogram-3": { "post": { - "description": "Start training a custom Ideogram v3 model from a dataset using default hyperparameters. The dataset must contain at least 15 images and a maximum of 100 images.\n", - "operationId": "train_model_v3", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TrainModelV3Request" - } + "operationId": "imagesRemix_post_remix_image_v2_ideogram_v3", + "summary": "Remix with Ideogram 3.0", + "description": "Transform an existing image with Ideogram 3.0, guided by a text\nprompt. Upload the source `image` using `multipart/form-data`.\nReturns results directly by default; set `async` or supply a\n`webhook_url` to get a `generation_id` and poll\n`GET /v2/generations/{generation_id}`.\n", + "tags": [ + "images-remix" + ], + "parameters": [ + { + "name": "dry_run", + "in": "query", + "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", + "required": false, + "schema": { + "type": "boolean", + "default": false } - }, - "description": "Training configuration", - "required": true, - "x-body-name": "train_model_v3_request" - }, + } + ], "responses": { "200": { + "description": "The remixed images (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests).", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TrainDatasetModelResponse" + "$ref": "#/components/schemas/RemixImageIdeogramV3Response" } } - }, - "description": "Training started successfully" + } }, "400": { - "description": "Bad request" - }, - "401": { - "description": "Unauthorized" - }, - "404": { - "description": "Dataset not found" - } - }, - "summary": "Train a custom Ideogram v3 model", - "tags": [ - "models" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.models_controller" - } - }, - "/v1/ideogram-v3/train-model-advanced": { - "post": { - "description": "Start training a custom Ideogram v3 model from a dataset with caller-supplied hyperparameters (training steps, LoRA rank, EMA decay, learning rate). All hyperparameters are optional and fall back to defaults when omitted. The dataset must contain at least 15 images and a maximum of 100 images. Returns the model ID and training status.\n", - "operationId": "train_model_v3_advanced", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TrainModelV3AdvancedRequest" + "description": "Invalid input provided.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } } } }, - "description": "Advanced training configuration", - "required": true, - "x-body-name": "train_model_v3_advanced_request" - }, - "responses": { - "200": { + "401": { + "description": "Unauthorized.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TrainDatasetModelResponse" + "description": "Any type" } } - }, - "description": "Training started successfully" - }, - "400": { - "description": "Bad request" - }, - "401": { - "description": "Unauthorized" + } }, - "404": { - "description": "Dataset not found" - } - }, - "summary": "Train a custom Ideogram v3 model with advanced hyperparameters", - "tags": [ - "models" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.models_controller" - } - }, - "/v1/ideogram-v3/try-on": { - "post": { - "description": "Performs virtual clothing try-on by automatically segmenting the clothing in the provided image\nand replacing it based on the prompt. The user provides an image and an optional prompt describing\nthe desired clothing change (e.g., \"change his shirt to a pink shirt\").\n\nSupported image formats include JPEG, PNG, and WebP.\n\nImages links are available for a limited period of time; if you would like to keep the image, you must download it.\n", - "operationId": "post_try_on_v3", - "requestBody": { - "content": { - "multipart/form-data": { - "schema": { - "$ref": "#/components/schemas/TryOnRequestV3" + "402": { + "description": "Insufficient credits or quota.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerationErrorResponse" + } } } }, - "description": "A request to perform virtual try-on with Ideogram 3.0.", - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { + "404": { + "description": "A referenced resource was not found.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ImageGenerationResponseV3" + "description": "Any type" } } - }, - "description": "Try-on completed successfully." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Not authorized to generate an image." + } }, "422": { + "description": "The prompt did not pass safety checks.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageSafetyError" + "description": "Any type" } } - }, - "description": "Prompt or provided image failed safety check, or clothing segmentation failed." + } }, "429": { - "description": "Too many requests." - } - }, - "summary": "Virtual Try-On with Ideogram 3.0", - "tags": [ - "generate" - ], - "x-fern-examples": [ - { - "request": { - "prompt": "Change his shirt to a pink shirt", - "rendering_speed": "DEFAULT" - }, - "response": { - "body": { - "created": "2000-01-23T04:56:07+00:00", - "data": [ - { - "prompt": "Change his shirt to a pink shirt", - "resolution": "1024x1024", - "is_image_safe": true, - "seed": 12345, - "url": "https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89", - "style_type": "AUTO" - } - ] - } - }, - "code-samples": [ - { - "sdk": "curl", - "code": "curl -X POST https://api.ideogram.ai/v1/ideogram-v3/try-on \\\n -H \"Api-Key: \" \\\n -H \"Content-Type: multipart/form-data\" \\\n -F image=@ \\\n -F prompt=\"Change his shirt to a pink shirt\" \\\n -F rendering_speed=\"DEFAULT\"\n" - }, - { - "sdk": "python", - "code": "import requests\n\nresponse = requests.post(\n \"https://api.ideogram.ai/v1/ideogram-v3/try-on\",\n headers={\n \"Api-Key\": \"\"\n },\n data={\n \"prompt\": \"Change his shirt to a pink shirt\",\n \"rendering_speed\": \"DEFAULT\"\n },\n files={\n \"image\": open(\"\", \"rb\"),\n }\n)\nprint(response.json())\nwith open('output.png', 'wb') as f:\n f.write(requests.get(response.json()['data'][0]['url']).content)\n" - }, - { - "sdk": "typescript", - "code": "const formData = new FormData();\nformData.append('prompt', 'Change his shirt to a pink shirt');\nformData.append('rendering_speed', 'DEFAULT');\nformData.append('image', '');\nconst response = await fetch('https://api.ideogram.ai/v1/ideogram-v3/try-on', {\n method: 'POST',\n headers: { 'Api-Key': '' },\n body: formData\n});\nconst data = await response.json();\nconsole.log(data);\n" - } - ] - } - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.generate_controller" - } - }, - "/v1/ideogram-v4-cfg-distilled/async/generate": { - "post": { - "description": "Accepts a CFG-distilled Ideogram 4.0 generation request for asynchronous\nprocessing and returns immediately with a generation_id. The generated\nimages are POSTed to the supplied `webhook_url` once ready, in a payload\nthat mirrors the synchronous response with an added generation_id for\ncorrelation.\n\nSee [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures.\n", - "operationId": "post_generate_image_v4_cfg_distilled_async", - "parameters": [ - { - "explode": true, - "in": "query", - "name": "webhook_url", - "required": true, - "schema": { - "$ref": "#/components/schemas/WebhookUrl" - }, - "style": "form" - } - ], - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "json_prompt": { - "contentType": "application/json", - "style": "form" + "description": "Too many requests.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerationErrorResponse" } - }, - "schema": { - "$ref": "#/components/schemas/GenerateImageRequestV4CfgDistilled" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateImageRequestV4CfgDistilled" } } }, - "description": "A request to generate an image with the CFG-distilled Ideogram 4.0 model.", - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { + "500": { + "description": "Internal server error.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AsyncImageGenerationResponseV4" + "description": "Any type" } } - }, - "description": "Request accepted for asynchronous delivery." + } }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Not authorized." - }, - "422": { + "503": { + "description": "The endpoint is temporarily unavailable.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageSafetyError" + "description": "Any type" } } - }, - "description": "Prompt failed the safety check." - }, - "429": { - "description": "Too many requests." + } } }, - "summary": "Generate with the CFG-distilled Ideogram 4.0 model asynchronously via webhook", - "tags": [ - "generate" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.generate_controller" - } - }, - "/v1/ideogram-v4-cfg-distilled/generate": { - "post": { - "description": "Generates images synchronously using the CFG/guidance-distilled Ideogram\n4.0 model, served guidance-free.\n\nImages links are available for a limited period of time; if you would like to keep the image, you must download it.\n", - "operationId": "post_generate_image_v4_cfg_distilled", "requestBody": { + "description": "Use `multipart/form-data` to upload the source `image` and any `style_reference_images`.", "content": { "multipart/form-data": { - "encoding": { - "json_prompt": { - "contentType": "application/json", - "style": "form" - } - }, - "schema": { - "$ref": "#/components/schemas/GenerateImageRequestV4CfgDistilled" - } - }, - "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageRequestV4CfgDistilled" + "type": "object", + "properties": { + "prompt": { + "type": "string", + "minLength": 1, + "maxLength": 10000, + "description": "The prompt that guides the remix." + }, + "image": { + "type": "string", + "format": "binary", + "description": "The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first." + }, + "image_weight": { + "type": "integer", + "minimum": 1, + "maximum": 100, + "description": "Optional. How closely the result should follow the source image, from 1 to 100. When omitted the server chooses a value from your prompt, which is the usual case." + }, + "negative_prompt": { + "type": "string", + "maxLength": 10000, + "description": "Description of what to exclude from the images. Descriptions in the prompt take precedence over descriptions in the negative prompt." + }, + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." + }, + "resolution": { + "$ref": "#/components/schemas/ResolutionV3" + }, + "aspect_ratio": { + "$ref": "#/components/schemas/AspectRatioV3" + }, + "rendering_speed": { + "$ref": "#/components/schemas/V2ImageRemixIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed", + "default": "default", + "description": "The rendering speed to use." + }, + "magic_prompt": { + "$ref": "#/components/schemas/MagicPromptMode", + "default": "auto", + "description": "Controls magic prompt (automatic prompt rewriting). Defaults to `auto`." + }, + "num_images": { + "type": "integer", + "minimum": 1, + "maximum": 8, + "default": 1, + "description": "The number of images to generate." + }, + "color_palette": { + "$ref": "#/components/schemas/IdeogramColorPalette" + }, + "style_codes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/StyleCode" + }, + "description": "A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images." + }, + "style_type": { + "$ref": "#/components/schemas/IdeogramV3StyleType", + "default": "general" + }, + "style_preset": { + "$ref": "#/components/schemas/IdeogramV3StylePreset", + "description": "A predefined style preset to apply to the remixed images. Cannot be combined with style codes or style references." + }, + "style_reference_images": { + "type": "array", + "items": { + "type": "string", + "format": "binary" + }, + "description": "Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported." + }, + "enable_copyright_detection": { + "type": [ + "boolean", + "null" + ], + "description": "Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`." + }, + "async": { + "type": "boolean", + "default": false, + "description": "When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`." + }, + "webhook_url": { + "type": "string", + "format": "uri", + "maxLength": 2048, + "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n" + } + }, + "required": [ + "prompt", + "image" + ] } } - }, - "description": "A request to generate an image with the CFG-distilled Ideogram 4.0 model.", - "required": true, - "x-body-name": "body" + } }, + "security": [ + { + "ApiKeyAuth": [] + } + ] + } + }, + "/v2/image/remix/ideogram-3-character": { + "post": { + "operationId": "imagesRemix_post_remix_image_v2_ideogram_v3_character", + "summary": "Remix a consistent character with Ideogram 3.0", + "description": "Transform an existing image with Ideogram 3.0 so it features a\nconsistent character, guided by a text prompt. Upload the source\n`image` and a `character_reference_images` image (or use a saved\ncharacter) using `multipart/form-data`.\nReturns results directly by default; set `async` or supply a\n`webhook_url` to get a `generation_id` and poll\n`GET /v2/generations/{generation_id}`.\n", + "tags": [ + "images-remix" + ], + "parameters": [ + { + "name": "dry_run", + "in": "query", + "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", + "required": false, + "schema": { + "type": "boolean", + "default": false + } + } + ], "responses": { "200": { + "description": "The remixed images (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests).", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ImageGenerationResponseV4" + "$ref": "#/components/schemas/RemixImageIdeogramV3CharacterResponse" } } - }, - "description": "Image(s) generated successfully." + } }, "400": { - "description": "Invalid input provided." + "description": "Invalid input provided.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "401": { - "description": "Not authorized." - }, - "422": { + "description": "Unauthorized.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageSafetyError" + "description": "Any type" } } - }, - "description": "Prompt failed the safety check." + } }, - "429": { - "description": "Too many requests." - } - }, - "summary": "Generate with the CFG-distilled Ideogram 4.0 model", - "tags": [ - "generate" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.generate_controller" - } - }, - "/v1/ideogram-v4-fp8/generate": { - "post": { - "description": "Generates images synchronously using the fp8-quantized Ideogram 4.0 model.\nA LoRA checkpoint can be layered on the base via the\n`X-Ideogram-Positive-Lora-Ckpt-Path` header.\n\nImages links are available for a limited period of time; if you would like to keep the image, you must download it.\n", - "operationId": "post_generate_image_v4_fp8", - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "json_prompt": { - "contentType": "application/json", - "style": "form" + "402": { + "description": "Insufficient credits or quota.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerationErrorResponse" } - }, - "schema": { - "$ref": "#/components/schemas/GenerateImageRequestV4Fp8" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateImageRequestV4Fp8" } } }, - "description": "A request to generate an image with the fp8-quantized Ideogram 4.0 model.", - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { + "404": { + "description": "A referenced resource was not found.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ImageGenerationResponseV4" + "description": "Any type" } } - }, - "description": "Image(s) generated successfully." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Not authorized." + } }, "422": { + "description": "The prompt did not pass safety checks.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageSafetyError" + "description": "Any type" } } - }, - "description": "Prompt failed the safety check." + } }, "429": { - "description": "Too many requests." - } - }, - "summary": "Generate with the fp8-quantized Ideogram 4.0 model", - "tags": [ - "generate" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.generate_controller" - } - }, - "/v1/ideogram-v4/async/generate": { - "post": { - "description": "Accepts an Ideogram 4.0 generation request for asynchronous processing and\nreturns immediately with a generation_id. Poll `GET /v1/generations/{generation_id}`\nto retrieve the result. If a `webhook_url` is supplied, the generated images are\nadditionally POSTed to it once ready, in a payload that mirrors the synchronous\nresponse with an added generation_id for correlation.\n\nSee [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures.\n", - "operationId": "post_generate_image_v4_async", - "parameters": [ - { - "explode": true, - "in": "query", - "name": "webhook_url", - "required": false, - "schema": { - "$ref": "#/components/schemas/WebhookUrl" - }, - "style": "form" - } - ], - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "json_prompt": { - "contentType": "application/json", - "style": "form" + "description": "Too many requests.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerationErrorResponse" } - }, - "schema": { - "$ref": "#/components/schemas/GenerateImageRequestV4" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateImageRequestV4" } } }, - "description": "A request to generate an image with Ideogram 4.0.", - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { + "500": { + "description": "Internal server error.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AsyncImageGenerationResponseV4" + "description": "Any type" } } - }, - "description": "Request accepted for asynchronous delivery." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Not authorized." + } }, - "422": { + "503": { + "description": "The endpoint is temporarily unavailable.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageSafetyError" + "description": "Any type" } } - }, - "description": "Prompt failed the safety check." - }, - "429": { - "description": "Too many requests." + } } }, - "summary": "Generate with Ideogram 4.0 asynchronously", - "tags": [ - "generate" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.generate_controller" + "requestBody": { + "description": "Use `multipart/form-data` to upload the source `image` and any `character_reference_images` or `style_reference_images`.", + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "prompt": { + "type": "string", + "minLength": 1, + "maxLength": 10000, + "description": "The prompt that guides the remix." + }, + "image": { + "type": "string", + "format": "binary", + "description": "The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first." + }, + "image_weight": { + "type": "integer", + "minimum": 1, + "maximum": 100, + "description": "Optional. How closely the result should follow the source image, from 1 to 100. When omitted the server chooses a value from your prompt, which is the usual case." + }, + "negative_prompt": { + "type": "string", + "maxLength": 10000, + "description": "Description of what to exclude from the images. Descriptions in the prompt take precedence over descriptions in the negative prompt." + }, + "character_reference_images": { + "type": "array", + "items": { + "type": "string", + "format": "binary" + }, + "description": "An image to use as the character reference (max 25MB). JPEG, PNG, and WEBP are supported." + }, + "character_reference_mask": { + "type": "string", + "format": "binary", + "description": "Optional grayscale mask for the character reference image, the same size as that image, marking where the character is. Only JPEG, PNG, and WEBP formats are supported. Multipart requests only; cannot be combined with `character_reference_collection_id`." + }, + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." + }, + "resolution": { + "$ref": "#/components/schemas/ResolutionV3" + }, + "aspect_ratio": { + "$ref": "#/components/schemas/AspectRatioV3" + }, + "rendering_speed": { + "$ref": "#/components/schemas/V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed", + "default": "default", + "description": "The rendering speed to use." + }, + "magic_prompt": { + "$ref": "#/components/schemas/MagicPromptMode", + "default": "auto", + "description": "Controls magic prompt (automatic prompt rewriting). Defaults to `auto`." + }, + "num_images": { + "type": "integer", + "minimum": 1, + "maximum": 8, + "default": 1, + "description": "The number of images to generate." + }, + "style_type": { + "$ref": "#/components/schemas/V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType", + "default": "auto", + "description": "The style type to remix the character with. Defaults to `auto`." + }, + "style_reference_images": { + "type": "array", + "items": { + "type": "string", + "format": "binary" + }, + "description": "Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported." + }, + "enable_copyright_detection": { + "type": [ + "boolean", + "null" + ], + "description": "Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`." + }, + "async": { + "type": "boolean", + "default": false, + "description": "When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`." + }, + "webhook_url": { + "type": "string", + "format": "uri", + "maxLength": 2048, + "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n" + } + }, + "required": [ + "prompt", + "image", + "character_reference_images" + ] + } + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + } + ] } }, - "/v1/ideogram-v4/async/generate-design": { + "/v2/image/remix/ideogram-3-custom-model": { "post": { - "description": "Accepts an Ideogram 4.0 HTML design request for asynchronous processing and\nreturns immediately with a request_id. The generated design is POSTed to the\nsupplied `webhook_url` once ready.\n", - "operationId": "post_generate_design_v4_async", + "operationId": "imagesRemix_post_remix_image_v2_ideogram_v3_custom_model", + "summary": "Remix with a custom Ideogram 3.0 model", + "description": "Transform an existing image with a custom Ideogram 3.0 model that your\nuser or organization can access, guided by a text prompt. Upload the\nsource `image` using `multipart/form-data`.\nReturns results directly by default; set `async` or supply a\n`webhook_url` to get a `generation_id` and poll\n`GET /v2/generations/{generation_id}`.\n", + "tags": [ + "images-remix" + ], "parameters": [ { - "explode": true, + "name": "dry_run", "in": "query", - "name": "webhook_url", - "required": true, + "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", + "required": false, "schema": { - "$ref": "#/components/schemas/WebhookUrl" - }, - "style": "form" + "type": "boolean", + "default": false + } } ], - "requestBody": { - "content": { - "multipart/form-data": { - "schema": { - "$ref": "#/components/schemas/GenerateDesignRequestV4" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateDesignRequestV4" - } - } - }, - "description": "A request to generate an editable design with Ideogram 4.0 HTML.", - "required": true, - "x-body-name": "body" - }, "responses": { "200": { + "description": "The remixed images (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests).", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AsyncImageGenerationResponseV4" + "$ref": "#/components/schemas/RemixImageIdeogramV3CustomModelResponse" } } - }, - "description": "Request accepted for asynchronous delivery." + } }, "400": { - "description": "Invalid input provided." + "description": "Invalid input or an unsupported model option.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "401": { - "description": "Not authorized." + "description": "Unauthorized.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, - "422": { + "402": { + "description": "Insufficient credits or quota.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageSafetyError" + "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Prompt failed the safety check." + } }, - "429": { - "description": "Too many requests." - } - }, - "summary": "Generate an editable V4 HTML design asynchronously via webhook", - "tags": [ - "generate" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.generate_controller" - } - }, - "/v1/ideogram-v4/async/generate-transparent": { - "post": { - "description": "Accepts an Ideogram 4.0 transparent-background generation request for\nasynchronous processing and returns immediately with a generation_id.\nPoll `GET /v1/generations/{generation_id}` to retrieve the result. If a\n`webhook_url` is supplied, the generated images are additionally POSTed\nto it once ready, in a payload that mirrors the synchronous response\nwith an added generation_id for correlation.\n\nSee the synchronous `/v1/ideogram-v4/generate-transparent` endpoint for\nthe request semantics, including `output_resolution` tiers.\n\nSee [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures.\n", - "operationId": "post_generate_image_v4_transparent_async", - "parameters": [ - { - "explode": true, - "in": "query", - "name": "webhook_url", - "required": false, - "schema": { - "$ref": "#/components/schemas/WebhookUrl" - }, - "style": "form" - } - ], - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "json_prompt": { - "contentType": "application/json", - "style": "form" + "403": { + "description": "The custom model does not exist or is not accessible to this user or organization.", + "content": { + "application/json": { + "schema": { + "description": "Any type" } - }, - "schema": { - "$ref": "#/components/schemas/GenerateTransparentImageRequestV4" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateTransparentImageRequestV4" } } }, - "description": "A request to generate a transparent-background image with Ideogram 4.0.", - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { + "404": { + "description": "A referenced resource was not found.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AsyncImageGenerationResponseV4" + "description": "Any type" } } - }, - "description": "Request accepted for asynchronous delivery." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Not authorized." + } }, "422": { + "description": "The prompt did not pass safety checks.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageSafetyError" + "description": "Any type" } } - }, - "description": "Prompt failed the safety check." + } }, "429": { - "description": "Too many requests." - } - }, - "summary": "Generate with Ideogram 4.0 (Transparent Background) asynchronously", - "tags": [ - "generate" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.generate_controller" - } - }, - "/v1/ideogram-v4/async/image-to-image": { - "post": { - "description": "Accepts an Ideogram 4.0 image-to-image request for asynchronous processing\nand returns immediately with a request_id. The generated images are POSTed\nto the supplied `webhook_url` once ready.\n", - "operationId": "post_generate_image_v4_im2_im_async", - "parameters": [ - { - "explode": true, - "in": "query", - "name": "webhook_url", - "required": true, - "schema": { - "$ref": "#/components/schemas/WebhookUrl" - }, - "style": "form" - } - ], - "requestBody": { - "content": { - "multipart/form-data": { - "schema": { - "$ref": "#/components/schemas/GenerateImageRequestV4Im2Im" + "description": "Too many requests.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerationErrorResponse" + } } } }, - "description": "A request to generate an image with Ideogram 4.0 using an initial image.", - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { + "500": { + "description": "Internal server error.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AsyncImageGenerationResponseV4" + "description": "Any type" } } - }, - "description": "Request accepted for asynchronous delivery." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Not authorized." + } }, - "422": { + "503": { + "description": "The endpoint is temporarily unavailable.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageSafetyError" + "description": "Any type" } } - }, - "description": "Prompt failed the safety check." - }, - "429": { - "description": "Too many requests." + } } }, - "summary": "Image-to-image with Ideogram 4.0 asynchronously via webhook", - "tags": [ - "generate" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.generate_controller" + "requestBody": { + "description": "Use `multipart/form-data` to upload the source `image` and any `style_reference_images`.", + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "prompt": { + "type": "string", + "minLength": 1, + "maxLength": 10000, + "description": "The prompt that guides the remix." + }, + "custom_model_uri": { + "type": "string", + "pattern": "^model/[^/]+/version/[^/]+$", + "minLength": 1, + "maxLength": 512, + "description": "The custom model URI returned by the custom-model API, in the form `model//version/`. The authenticated user or organization must have access to the model." + }, + "image": { + "type": "string", + "format": "binary", + "description": "The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first." + }, + "image_weight": { + "type": "integer", + "minimum": 1, + "maximum": 100, + "description": "Optional. How closely the result should follow the source image, from 1 to 100. When omitted the server chooses a value from your prompt, which is the usual case." + }, + "negative_prompt": { + "type": "string", + "maxLength": 10000, + "description": "Description of what to exclude from the images. Descriptions in the prompt take precedence over descriptions in the negative prompt." + }, + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." + }, + "resolution": { + "$ref": "#/components/schemas/ResolutionV3" + }, + "aspect_ratio": { + "$ref": "#/components/schemas/AspectRatioV3" + }, + "rendering_speed": { + "$ref": "#/components/schemas/V2ImageRemixIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed", + "description": "The rendering speed to use. When omitted, the server chooses a speed supported by the selected custom model." + }, + "magic_prompt": { + "$ref": "#/components/schemas/MagicPromptMode", + "default": "auto", + "description": "Controls magic prompt (automatic prompt rewriting). Defaults to `auto`." + }, + "num_images": { + "type": "integer", + "minimum": 1, + "maximum": 8, + "default": 1, + "description": "The number of images to generate." + }, + "color_palette": { + "$ref": "#/components/schemas/IdeogramColorPalette" + }, + "style_codes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/StyleCode" + }, + "description": "A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images." + }, + "style_preset": { + "$ref": "#/components/schemas/IdeogramV3StylePreset", + "description": "A predefined style preset to apply to the remixed images. Cannot be combined with style codes or style references." + }, + "style_reference_images": { + "type": "array", + "items": { + "type": "string", + "format": "binary" + }, + "description": "Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported. Multipart requests only." + }, + "enable_copyright_detection": { + "type": [ + "boolean", + "null" + ], + "description": "Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`." + }, + "async": { + "type": "boolean", + "default": false, + "description": "When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`." + }, + "webhook_url": { + "type": "string", + "format": "uri", + "maxLength": 2048, + "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n" + } + }, + "required": [ + "prompt", + "custom_model_uri", + "image" + ] + } + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + } + ] } }, - "/v1/ideogram-v4/async/remix": { + "/v2/image/inpaint/ideogram-3": { "post": { - "description": "Accepts an Ideogram 4.0 remix request for asynchronous processing and returns\nimmediately with a `generation_id`. Poll `GET /v1/generations/{generation_id}`\nto retrieve the result. If a `webhook_url` is supplied, the generated images\nare additionally POSTed to it once ready.\n", - "operationId": "post_remix_image_v4_async", + "operationId": "imagesInpaint_post_inpaint_image_v2_ideogram_v3", + "summary": "Inpaint with Ideogram 3.0", + "description": "Repaint the masked region of a source image with Ideogram 3.0, guided\nby a text prompt. Upload the source `image` and its `mask` using\n`multipart/form-data`.\nReturns results directly by default; set `async` or supply a\n`webhook_url` to get a `generation_id` and poll\n`GET /v2/generations/{generation_id}`.", + "tags": [ + "images-inpaint" + ], "parameters": [ { - "explode": true, + "name": "dry_run", "in": "query", - "name": "webhook_url", + "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", "required": false, "schema": { - "$ref": "#/components/schemas/WebhookUrl" - }, - "style": "form" + "type": "boolean", + "default": false + } } ], - "requestBody": { - "content": { - "multipart/form-data": { - "schema": { - "$ref": "#/components/schemas/RemixImageRequestV4" - } - } - }, - "description": "A request to remix an image with Ideogram 4.0.", - "required": true, - "x-body-name": "body" - }, "responses": { "200": { + "description": "The repainted images (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests).", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AsyncImageGenerationResponseV4" + "$ref": "#/components/schemas/InpaintImageIdeogramV3Response" } } - }, - "description": "Request accepted for asynchronous processing." + } }, "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Not authorized." - }, - "422": { + "description": "Invalid input provided.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageSafetyError" + "description": "Any type" } } - }, - "description": "Prompt failed the safety check." - }, - "429": { - "description": "Too many requests." - } - }, - "summary": "Remix with Ideogram 4.0 asynchronously", - "tags": [ - "generate" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.generate_controller" - } - }, - "/v1/ideogram-v4/describe": { - "post": { - "description": "Describe an image with Ideogram 4.0 and return a structured\n`V4JsonPrompt`. The returned `json_prompt` is a working JSON prompt\nthat can be passed directly as `json_prompt` to the\n`/v1/ideogram-v4/generate` family of endpoints.\n\nSupported image formats include JPEG, PNG, and WebP.\n", - "operationId": "post_describe_v4", - "requestBody": { - "content": { - "multipart/form-data": { - "schema": { - "$ref": "#/components/schemas/DescribeRequestV4" - } } }, - "required": true - }, - "responses": { - "200": { + "401": { + "description": "Unauthorized.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DescribeResponseV4" + "description": "Any type" } } - }, - "description": "Structured V4 prompt generated successfully." - }, - "400": { - "description": "Invalid input provided." + } }, - "422": { + "402": { + "description": "Insufficient credits or quota.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ImageSafetyError" - } - } - }, - "description": "Image failed the safety check." - }, - "429": { - "description": "Too many requests." - }, - "503": { - "description": "Took too long to finish." - } - }, - "summary": "Describe with Ideogram 4.0", - "tags": [ - "vision" - ], - "x-fern-examples": [ - { - "code-samples": [ - { - "sdk": "curl", - "code": "curl -X POST https://api.ideogram.ai/v1/ideogram-v4/describe \\\n -H \"Api-Key: \" \\\n -H \"Content-Type: multipart/form-data\" \\\n -F image_file=@\n" - } - ] - } - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.vision_controller" - } - }, - "/v1/ideogram-v4/generate": { - "post": { - "description": "Generates images synchronously using the Ideogram 4.0 model.\n\nImages links are available for a limited period of time; if you would like to keep the image, you must download it.\n", - "operationId": "post_generate_image_v4", - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "json_prompt": { - "contentType": "application/json", - "style": "form" + "$ref": "#/components/schemas/GenerationErrorResponse" } - }, - "schema": { - "$ref": "#/components/schemas/GenerateImageRequestV4" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateImageRequestV4" } } }, - "description": "A request to generate an image with Ideogram 4.0.", - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { + "404": { + "description": "A referenced resource was not found.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ImageGenerationResponseV4" + "description": "Any type" } } - }, - "description": "Image(s) generated successfully." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Not authorized." + } }, "422": { + "description": "The prompt did not pass safety checks.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageSafetyError" + "description": "Any type" } } - }, - "description": "Prompt failed the safety check." + } }, "429": { - "description": "Too many requests." - } - }, - "summary": "Generate with Ideogram 4.0", - "tags": [ - "generate" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.generate_controller" - } - }, - "/v1/ideogram-v4/generate-design": { - "post": { - "description": "Experimental prototype endpoint for generating an editable V4 HTML design from a prompt.\n\nOptionally accepts inspiration reference images to guide transferable visual style. Inspiration images are design/style references only and are not edit targets.\n\nImages links are available for a limited period of time; if you would like to keep the image, you must download it.\n", - "operationId": "post_generate_design_v4", - "requestBody": { - "content": { - "multipart/form-data": { - "schema": { - "$ref": "#/components/schemas/GenerateDesignRequestV4" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateDesignRequestV4" + "description": "Too many requests.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerationErrorResponse" + } } } }, - "description": "A request to generate an editable design with Ideogram 4.0 HTML.", - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { + "500": { + "description": "Internal server error.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/postGenerateDesignV4_200_response" - } - }, - "image/png": { - "schema": { - "format": "binary", - "type": "string" - } - }, - "text/html": { - "schema": { - "type": "string" + "description": "Any type" } } - }, - "description": "Design(s) generated successfully." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Not authorized." + } }, - "422": { + "503": { + "description": "The endpoint is temporarily unavailable.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageSafetyError" + "description": "Any type" } } - }, - "description": "Prompt failed the safety check." - }, - "429": { - "description": "Too many requests." + } } }, - "summary": "Generate an editable design with Ideogram 4.0 HTML", - "tags": [ - "generate" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.generate_controller" - } - }, - "/v1/ideogram-v4/generate-transparent": { - "post": { - "description": "Generates images with a transparent background synchronously using the\nIdeogram 4.0 model. The result is delivered as a PNG with an alpha\nchannel.\n\nAll Ideogram 4.0 aspect ratios are supported, including `AUTO`, which\nlets the model select the most suitable ratio from the prompt.\n\n`output_resolution` selects the delivered resolution tier. Tiers are\ntotal-pixel budgets: wide and tall aspect ratios keep the same pixel\nbudget as the square of the named size, so a single dimension may\nexceed it. The response reports the final delivered resolution.\n\nImage links are available for a limited period of time; if you would\nlike to keep the image, you must download it.\n", - "operationId": "post_generate_image_v4_transparent", "requestBody": { + "description": "Use `multipart/form-data` to upload the source `image`, its `mask`, and any `style_reference_images`.", "content": { "multipart/form-data": { - "encoding": { - "json_prompt": { - "contentType": "application/json", - "style": "form" - } - }, "schema": { - "$ref": "#/components/schemas/GenerateTransparentImageRequestV4" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateTransparentImageRequestV4" - } - } - }, - "description": "A request to generate a transparent-background image with Ideogram 4.0.", - "required": true, - "x-body-name": "body" - }, + "type": "object", + "properties": { + "prompt": { + "type": "string", + "minLength": 1, + "maxLength": 10000, + "description": "The prompt describing the repainted result." + }, + "image": { + "type": "string", + "format": "binary", + "description": "The source image to repaint (max 25MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The output matches its size, snapped to the nearest supported resolution." + }, + "mask": { + "type": "string", + "format": "binary", + "description": "A black-and-white mask the same size as the source image. Black marks the region to repaint. JPEG, PNG, and WEBP are supported. Multipart requests only." + }, + "magic_prompt": { + "$ref": "#/components/schemas/MagicPromptMode", + "default": "auto", + "description": "Controls magic prompt (automatic prompt rewriting). Defaults to `auto`." + }, + "num_images": { + "type": "integer", + "minimum": 1, + "maximum": 8, + "default": 1, + "description": "The number of images to generate." + }, + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." + }, + "rendering_speed": { + "$ref": "#/components/schemas/V2ImageInpaintIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed", + "default": "default", + "description": "The rendering speed to use." + }, + "style_type": { + "$ref": "#/components/schemas/IdeogramV3StyleType", + "default": "general" + }, + "style_preset": { + "$ref": "#/components/schemas/IdeogramV3StylePreset", + "description": "A predefined style preset to apply to the repainted images. Cannot be combined with style codes or style references." + }, + "style_codes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/StyleCode" + }, + "description": "A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images." + }, + "style_reference_images": { + "type": "array", + "items": { + "type": "string", + "format": "binary" + }, + "description": "Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported." + }, + "enable_copyright_detection": { + "type": [ + "boolean", + "null" + ], + "description": "Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`." + }, + "async": { + "type": "boolean", + "default": false, + "description": "When false (the default), the request waits until the repainted images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`." + }, + "webhook_url": { + "type": "string", + "format": "uri", + "maxLength": 2048, + "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n" + } + }, + "required": [ + "prompt", + "image", + "mask" + ] + } + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + } + ] + } + }, + "/v2/image/inpaint/ideogram-3-character": { + "post": { + "operationId": "imagesInpaint_post_inpaint_image_v2_ideogram_v3_character", + "summary": "Inpaint a consistent character with Ideogram 3.0", + "description": "Repaint the masked region of a source image with Ideogram 3.0 so it\nfeatures a consistent character. Upload the source `image`, its\n`mask`, and a `character_reference_images` image (or use a saved\ncharacter) using `multipart/form-data`.\nReturns results directly by default; set `async` or supply a\n`webhook_url` to get a `generation_id` and poll\n`GET /v2/generations/{generation_id}`.", + "tags": [ + "images-inpaint" + ], + "parameters": [ + { + "name": "dry_run", + "in": "query", + "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", + "required": false, + "schema": { + "type": "boolean", + "default": false + } + } + ], "responses": { "200": { + "description": "The repainted images (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests).", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ImageGenerationResponseV4" + "$ref": "#/components/schemas/InpaintImageIdeogramV3CharacterResponse" } } - }, - "description": "Image generated successfully." + } }, "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Not authorized." - }, - "422": { + "description": "Invalid input provided.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageSafetyError" + "description": "Any type" } } - }, - "description": "Prompt failed the safety check." + } }, - "429": { - "description": "Too many requests." - } - }, - "summary": "Generate with Ideogram 4.0 (Transparent Background)", - "tags": [ - "generate" - ], - "x-fern-examples": [ - { - "request": { - "text_prompt": "A logo for Ideogram Coffee.", - "rendering_speed": "TURBO", - "aspect_ratio": "1x1", - "output_resolution": "4K" - }, - "response": { - "body": { - "created": "2000-01-23T04:56:07+00:00", - "data": [ - { - "prompt": "A logo for Ideogram Coffee.", - "resolution": "4096x4096", - "is_image_safe": true, - "seed": 12345, - "url": "https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89" - } - ] + "401": { + "description": "Unauthorized.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } } } - } - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.generate_controller" - } - }, - "/v1/ideogram-v4/generate/stable": { - "post": { - "description": "Generates images synchronously using a pinned stable build of the\nIdeogram 4.0 model. This endpoint is intentionally minimal: it accepts\nonly a prompt (and optional seed), pins the underlying model URI, and\nlets the server pick the output resolution automatically.\n\nImages links are available for a limited period of time; if you would\nlike to keep the image, you must download it.\n", - "operationId": "post_generate_image_v4_stable", - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "json_prompt": { - "contentType": "application/json", - "style": "form" + }, + "402": { + "description": "Insufficient credits or quota.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerationErrorResponse" } - }, - "schema": { - "$ref": "#/components/schemas/GenerateImageRequestV4Stable" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateImageRequestV4Stable" } } }, - "description": "A request to generate an image with the stable Ideogram 4.0 build.", - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { + "404": { + "description": "A referenced resource was not found.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ImageGenerationResponseV4" + "description": "Any type" } } - }, - "description": "Image(s) generated successfully." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Not authorized." + } }, "422": { + "description": "The prompt did not pass safety checks.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageSafetyError" + "description": "Any type" } } - }, - "description": "Prompt failed the safety check." + } }, "429": { - "description": "Too many requests." - } - }, - "summary": "Generate with Ideogram 4.0 (stable model)", - "tags": [ - "generate" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.generate_controller" - } - }, - "/v1/ideogram-v4/image-to-image": { - "post": { - "description": "Generates images synchronously using the Ideogram 4.0 model with an initial image as input.\n\nImages links are available for a limited period of time; if you would like to keep the image, you must download it.\n", - "operationId": "post_generate_image_v4_im2_im", - "requestBody": { - "content": { - "multipart/form-data": { - "schema": { - "$ref": "#/components/schemas/GenerateImageRequestV4Im2Im" + "description": "Too many requests.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerationErrorResponse" + } } } }, - "description": "A request to generate an image with Ideogram 4.0 using an initial image.", - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { + "500": { + "description": "Internal server error.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ImageGenerationResponseV4ImageToImage" + "description": "Any type" } } - }, - "description": "Image(s) generated successfully." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Not authorized." + } }, - "422": { + "503": { + "description": "The endpoint is temporarily unavailable.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageSafetyError" + "description": "Any type" } } - }, - "description": "Prompt failed the safety check." - }, - "429": { - "description": "Too many requests." + } } }, - "summary": "Image-to-image with Ideogram 4.0", - "tags": [ - "generate" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.generate_controller" - } - }, - "/v1/ideogram-v4/magic-prompt": { - "post": { - "description": "Transforms a basic prompt into an enhanced Ideogram 4.0 magic prompt.\nThe magic prompt model version is fixed; callers cannot select it.\nWhen `aspect_ratio` is `AUTO` (the default), the model selects the most\nsuitable aspect ratio for the prompt and returns it in the response.\n", - "operationId": "post_magic_prompt_v4", "requestBody": { + "description": "Use `multipart/form-data` to upload the source `image`, its `mask`, and any `character_reference_images` or `style_reference_images`.", "content": { - "application/json": { + "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/MagicPromptV4Request" + "type": "object", + "properties": { + "prompt": { + "type": "string", + "minLength": 1, + "maxLength": 10000, + "description": "The prompt describing the repainted result." + }, + "image": { + "type": "string", + "format": "binary", + "description": "The source image to repaint (max 25MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The output matches its size, snapped to the nearest supported resolution." + }, + "mask": { + "type": "string", + "format": "binary", + "description": "A black-and-white mask the same size as the source image. Black marks the region to repaint. JPEG, PNG, and WEBP are supported. Multipart requests only." + }, + "character_reference_images": { + "type": "array", + "items": { + "type": "string", + "format": "binary" + }, + "description": "An image to use as the character reference (max 25MB). JPEG, PNG, and WEBP are supported." + }, + "character_reference_mask": { + "type": "string", + "format": "binary", + "description": "Optional grayscale mask for the character reference image, the same size as that image, marking where the character is. Only JPEG, PNG, and WEBP formats are supported. Multipart requests only; cannot be combined with `character_reference_collection_id`." + }, + "magic_prompt": { + "$ref": "#/components/schemas/MagicPromptMode", + "default": "auto", + "description": "Controls magic prompt (automatic prompt rewriting). Defaults to `auto`." + }, + "num_images": { + "type": "integer", + "minimum": 1, + "maximum": 8, + "default": 1, + "description": "The number of images to generate." + }, + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." + }, + "rendering_speed": { + "$ref": "#/components/schemas/V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed", + "default": "default", + "description": "The rendering speed to use." + }, + "style_type": { + "$ref": "#/components/schemas/V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType", + "default": "auto", + "description": "The style type to repaint the character with. Defaults to `auto`. `realistic` and `fiction` are supported for character-only requests; style codes or style references (not both) require `auto`. For API-key callers, combining a style with a character requires that feature to be enabled for their account." + }, + "style_codes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/StyleCode" + }, + "description": "A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images." + }, + "style_reference_images": { + "type": "array", + "items": { + "type": "string", + "format": "binary" + }, + "description": "Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported. Cannot be combined with `style_codes`." + }, + "enable_copyright_detection": { + "type": [ + "boolean", + "null" + ], + "description": "Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`." + }, + "async": { + "type": "boolean", + "default": false, + "description": "When false (the default), the request waits until the repainted images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`." + }, + "webhook_url": { + "type": "string", + "format": "uri", + "maxLength": 2048, + "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n" + } + }, + "required": [ + "prompt", + "image", + "mask", + "character_reference_images" + ] } } - }, - "description": "A request to generate an Ideogram 4.0 magic prompt.", - "required": true, - "x-body-name": "magic_prompt_v4_request" + } }, + "security": [ + { + "ApiKeyAuth": [] + } + ] + } + }, + "/v2/image/inpaint/ideogram-3-custom-model": { + "post": { + "operationId": "imagesInpaint_post_inpaint_image_v2_ideogram_v3_custom_model", + "summary": "Inpaint with a custom Ideogram 3.0 model", + "description": "Repaint the masked region of a source image with a custom Ideogram 3.0\nmodel, passed as `custom_model_uri`. Upload the source `image` and its\n`mask` using `multipart/form-data`. Returns results directly by\ndefault; set `async` to get a `generation_id` and poll\n`GET /v2/generations/{generation_id}`.", + "tags": [ + "images-inpaint" + ], + "parameters": [ + { + "name": "dry_run", + "in": "query", + "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", + "required": false, + "schema": { + "type": "boolean", + "default": false + } + } + ], "responses": { "200": { + "description": "The repainted images, or an acknowledgement for an asynchronous request.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MagicPromptV4Response" + "$ref": "#/components/schemas/InpaintImageIdeogramV3CustomModelResponse" } } - }, - "description": "Magic prompt generated successfully." + } }, "400": { - "description": "Invalid input provided." + "description": "Invalid input provided.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "401": { - "description": "Not authorized to generate magic prompts." - }, - "429": { - "description": "Too many requests." - }, - "500": { - "description": "Internal server error." - } - }, - "summary": "Generate a Magic Prompt with Ideogram 4.0", - "tags": [ - "prompt" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.prompt_controller" - } - }, - "/v1/ideogram-v4/remix": { - "post": { - "description": "Remix an image synchronously using the Ideogram 4.0 model with an initial image and a prompt.\n\nMirrors `/v1/ideogram-v3/remix` semantics (including `image_weight` for how strongly the\noutput should resemble the input image) but routes the request through the V_4_0 model.\n\nImages links are available for a limited period of time; if you would like to keep the image, you must download it.\n", - "operationId": "post_remix_image_v4", - "requestBody": { - "content": { - "multipart/form-data": { - "schema": { - "$ref": "#/components/schemas/RemixImageRequestV4" + "description": "Unauthorized.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } } } }, - "description": "A request to remix an image with Ideogram 4.0.", - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { + "402": { + "description": "Insufficient credits or quota.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ImageGenerationResponseV4" + "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Image(s) generated successfully." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Not authorized." + } }, - "422": { + "403": { + "description": "The caller cannot use the requested custom model.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageSafetyError" + "description": "Any type" } } - }, - "description": "Prompt failed the safety check." + } }, - "429": { - "description": "Too many requests." - } - }, - "summary": "Remix with Ideogram 4.0", - "tags": [ - "generate" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.generate_controller" - } - }, - "/v1/ideogram-v4/train-model": { - "post": { - "description": "Start training a custom Ideogram v4 model from a dataset using default hyperparameters. The dataset must contain at least 15 images and a maximum of 100 images.\n", - "operationId": "train_model_v4", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TrainModelV4Request" + "404": { + "description": "A referenced resource was not found.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } } } }, - "description": "Training configuration", - "required": true, - "x-body-name": "train_model_v4_request" - }, - "responses": { - "200": { + "422": { + "description": "The prompt did not pass safety checks.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TrainDatasetModelResponse" + "description": "Any type" } } - }, - "description": "Training started successfully" + } }, - "400": { - "description": "Bad request" - }, - "401": { - "description": "Unauthorized" - }, - "404": { - "description": "Dataset not found" - } - }, - "summary": "Train a custom Ideogram v4 model", - "tags": [ - "models" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.models_controller" - } - }, - "/v1/ideogram-v4/train-model-advanced": { - "post": { - "description": "Start training a custom Ideogram v4 model from a dataset with caller-supplied hyperparameters (training steps, LoRA rank, EMA decay, learning rate). All hyperparameters are optional and fall back to defaults when omitted. The dataset must contain at least 15 images and a maximum of 100 images. Returns the model ID and training status.\n", - "operationId": "train_model_v4_advanced", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TrainModelV4AdvancedRequest" + "429": { + "description": "Too many requests.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerationErrorResponse" + } } } }, - "description": "Advanced training configuration", - "required": true, - "x-body-name": "train_model_v4_advanced_request" - }, - "responses": { - "200": { + "500": { + "description": "Internal server error.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TrainDatasetModelResponse" + "description": "Any type" } } - }, - "description": "Training started successfully" - }, - "400": { - "description": "Bad request" - }, - "401": { - "description": "Unauthorized" + } }, - "404": { - "description": "Dataset not found" + "503": { + "description": "The endpoint is temporarily unavailable.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } } }, - "summary": "Train a custom Ideogram v4 model with advanced hyperparameters", - "tags": [ - "models" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.models_controller" + "requestBody": { + "description": "Use `multipart/form-data` to upload the source `image`, its `mask`, and any `style_reference_images`.", + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "prompt": { + "type": "string", + "minLength": 1, + "maxLength": 10000, + "description": "The prompt describing the repainted result." + }, + "custom_model_uri": { + "type": "string", + "pattern": "^model/[^/]+/version/[^/]+$", + "minLength": 1, + "maxLength": 512, + "description": "The custom model URI returned by the custom-model API, in the form `model//version/`. The authenticated user or organization must have access to the model." + }, + "image": { + "type": "string", + "format": "binary", + "description": "The source image to repaint (max 25MB), as JPEG, PNG, or WEBP. Multipart requests only." + }, + "mask": { + "type": "string", + "format": "binary", + "description": "A black-and-white mask the same size as the source image, as JPEG, PNG, or WEBP. Black marks the region to repaint. Multipart requests only." + }, + "magic_prompt": { + "$ref": "#/components/schemas/MagicPromptMode", + "default": "auto", + "description": "Controls magic prompt (automatic prompt rewriting). Defaults to `auto`." + }, + "num_images": { + "type": "integer", + "minimum": 1, + "maximum": 8, + "default": 1, + "description": "The number of images to generate." + }, + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." + }, + "rendering_speed": { + "$ref": "#/components/schemas/V2ImageInpaintIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed", + "description": "The rendering speed to use. When omitted, the server chooses a speed supported by the selected custom model." + }, + "style_preset": { + "$ref": "#/components/schemas/IdeogramV3StylePreset", + "description": "A predefined style preset. Cannot be combined with style codes or style references." + }, + "style_codes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/StyleCode" + }, + "description": "A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images." + }, + "style_reference_images": { + "type": "array", + "items": { + "type": "string", + "format": "binary" + }, + "description": "Images to use as style references (max 10, max 25MB each), as JPEG, PNG, or WEBP." + }, + "enable_copyright_detection": { + "type": [ + "boolean", + "null" + ], + "description": "Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images return `is_image_safe: false`." + }, + "async": { + "type": "boolean", + "default": false, + "description": "When false, wait until the images are ready. When true, return as soon as the request is accepted and poll `GET /v2/generations/{generation_id}`." + } + }, + "required": [ + "prompt", + "custom_model_uri", + "image", + "mask" + ] + } + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + } + ] } }, - "/v1/ideogram-v45/async/generate": { + "/v2/image/reframe/ideogram-3": { "post": { - "description": "Accepts an Ideogram 4.5 generation request for asynchronous processing and\nreturns immediately with a generation_id. The generated images are POSTed to\nthe supplied `webhook_url` once ready, in a payload that mirrors the\nsynchronous response with an added generation_id for correlation.\n\nSee [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures.\n", - "operationId": "post_generate_image_v45_async", + "operationId": "reframe_ideogramV3", + "summary": "Reframe with Ideogram 3.0", + "description": "Expand an image to a new Ideogram 3.0 resolution, keeping the source\npixels in the center and filling the new area. Upload the source\n`image` using `multipart/form-data`. Returns results directly by\ndefault; set `async` to get a `generation_id` and poll\n`GET /v2/generations/{generation_id}`.\n", + "tags": [ + "reframe" + ], "parameters": [ { - "explode": true, + "name": "dry_run", "in": "query", - "name": "webhook_url", - "required": true, + "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", + "required": false, "schema": { - "$ref": "#/components/schemas/WebhookUrl" - }, - "style": "form" + "type": "boolean", + "default": false + } } ], - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "json_prompt": { - "contentType": "application/json", - "style": "form" - } - }, - "schema": { - "$ref": "#/components/schemas/GenerateImageRequestV4" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateImageRequestV4" - } - } - }, - "description": "A request to generate an image with Ideogram 4.5.", - "required": true, - "x-body-name": "body" - }, "responses": { "200": { + "description": "The reframed images, or an acknowledgement for an asynchronous request.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AsyncImageGenerationResponseV4" + "$ref": "#/components/schemas/ReframeImageIdeogramV3Response" } } - }, - "description": "Request accepted for asynchronous delivery." + } }, "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Not authorized." - }, - "422": { + "description": "Invalid input provided.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageSafetyError" + "description": "Any type" } } - }, - "description": "Prompt failed the safety check." + } }, - "429": { - "description": "Too many requests." - } - }, - "summary": "Generate with Ideogram 4.5 asynchronously via webhook", - "tags": [ - "generate" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.generate_controller" - } - }, - "/v1/ideogram-v45/generate": { - "post": { - "description": "Generates images synchronously using the Ideogram 4.5 multimodal model.\n\nImages links are available for a limited period of time; if you would like to keep the image, you must download it.\n", - "operationId": "post_generate_image_v45", - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "json_prompt": { - "contentType": "application/json", - "style": "form" + "401": { + "description": "Unauthorized.", + "content": { + "application/json": { + "schema": { + "description": "Any type" } - }, - "schema": { - "$ref": "#/components/schemas/GenerateImageRequestV4" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateImageRequestV4" } } }, - "description": "A request to generate an image with Ideogram 4.5.", - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { + "402": { + "description": "Insufficient credits or quota.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ImageGenerationResponseV4" + "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Image(s) generated successfully." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Not authorized." + } }, - "422": { + "404": { + "description": "A referenced resource was not found.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageSafetyError" + "description": "Any type" } } - }, - "description": "Prompt failed the safety check." + } }, "429": { - "description": "Too many requests." - } - }, - "summary": "Generate with Ideogram 4.5", - "tags": [ - "generate" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.generate_controller" - } - }, - "/v1/layerize-logos": { - "post": { - "description": "Detects caller-supplied reference logos in a flat design image, inpaints\nthem out, and returns the cleaned image together with the matched\nbounding boxes (each tagged with the matching reference's `REF_`).\n", - "operationId": "post_layerize_logos", - "requestBody": { - "content": { - "multipart/form-data": { - "schema": { - "$ref": "#/components/schemas/LayerizeLogosRequest" + "description": "Too many requests.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerationErrorResponse" + } } } }, - "description": "A request to detect image-reference matches in a flat design image.", - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { + "500": { + "description": "Internal server error.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/LayerizeLogosResponse" + "description": "Any type" } } - }, - "description": "Detection completed (may contain zero matches)." - }, - "400": { - "description": "Invalid input provided." + } }, - "429": { - "description": "Too many requests." + "503": { + "description": "The endpoint is temporarily unavailable.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } } }, - "summary": "Detect and remove reference logos from an image", - "tags": [ - "generate" - ], - "x-fern-examples": [ - { - "response": { - "body": { - "base_image_url": "https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89", - "layers": [ - { - "ref_id": "REF_0", - "x": 832, - "y": 96, - "width": 220, - "height": 88 + "requestBody": { + "description": "Use `multipart/form-data` to upload the source `image` and any `style_reference_images`.", + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "image": { + "type": "string", + "format": "binary", + "description": "The JPEG, PNG, or WEBP image to reframe (max 25MB). Multipart requests only." + }, + "resolution": { + "$ref": "#/components/schemas/ResolutionV3" + }, + "num_images": { + "type": "integer", + "minimum": 1, + "maximum": 8, + "default": 1, + "description": "The number of images to generate." + }, + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." + }, + "rendering_speed": { + "$ref": "#/components/schemas/V2ImageReframeIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed", + "default": "default" + }, + "style_preset": { + "$ref": "#/components/schemas/IdeogramV3StylePreset" + }, + "color_palette": { + "$ref": "#/components/schemas/IdeogramColorPalette" + }, + "style_codes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/StyleCode" + }, + "description": "A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images." + }, + "style_reference_images": { + "type": "array", + "items": { + "type": "string", + "format": "binary" + }, + "description": "JPEG, PNG, or WEBP style reference images (max 10, max 25MB each). Multipart requests only. Cannot be combined with `style_preset` or `style_codes`." + }, + "async": { + "type": "boolean", + "default": false, + "description": "Return immediately instead of waiting for reframed images." } + }, + "required": [ + "image", + "resolution" ] } - }, - "code-samples": [ - { - "sdk": "curl", - "code": "curl -X POST https://api.ideogram.ai/v1/layerize-logos \\\n -H \"Api-Key: \" \\\n -H \"Content-Type: multipart/form-data\" \\\n -F design_image=@ \\\n -F reference_images=@ \\\n -F reference_images=@\n" - }, - { - "sdk": "python", - "code": "import requests\n\nresponse = requests.post(\n \"https://api.ideogram.ai/v1/layerize-logos\",\n headers={\n \"Api-Key\": \"\"\n },\n files=[\n (\"design_image\", open(\"\", \"rb\")),\n (\"reference_images\", open(\"\", \"rb\")),\n (\"reference_images\", open(\"\", \"rb\")),\n ]\n)\nprint(response.json())\n" - } - ] + } } - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.generate_controller" + }, + "security": [ + { + "ApiKeyAuth": [] + } + ] } }, - "/v1/p-image-ideogram/high/generate": { + "/v2/image/reframe/nano-banana-2": { "post": { - "description": "Generates images synchronously using the distilled few-step Ideogram\nmodel at the high speed tier — the highest quality, at the highest cost.\nThe speed tier controls the number of diffusion steps and the per-image\nprice.\n\nImages links are available for a limited period of time; if you would like to keep the image, you must download it.\n", - "operationId": "post_generate_image_p_image_high", - "requestBody": { - "content": { - "multipart/form-data": { - "schema": { - "$ref": "#/components/schemas/GenerateImageRequestPImage" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateImageRequestPImage" - } + "operationId": "reframe_nanoBanana2", + "summary": "Reframe with Nano Banana 2", + "description": "Expand an image to a new aspect ratio with Nano Banana 2. Upload the\nsource `image` using `multipart/form-data`. Always asynchronous:\nreturns a `generation_id`; poll `GET /v2/generations/{generation_id}`\nfor results.\n", + "tags": [ + "reframe" + ], + "parameters": [ + { + "name": "dry_run", + "in": "query", + "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", + "required": false, + "schema": { + "type": "boolean", + "default": false } - }, - "description": "A request to generate an image with the distilled few-step Ideogram model.", - "required": true, - "x-body-name": "body" - }, + } + ], "responses": { "200": { + "description": "An acknowledgement to poll with `GET /v2/generations/{generation_id}`.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ImageGenerationResponseV4" + "$ref": "#/components/schemas/ReframeImageNanoBanana2Response" } } - }, - "description": "Image(s) generated successfully." + } }, "400": { - "description": "Invalid input provided." + "description": "Invalid input provided.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "401": { - "description": "Not authorized." + "description": "Unauthorized.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, - "422": { + "402": { + "description": "Insufficient credits or quota.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageSafetyError" + "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Prompt failed the safety check." + } }, - "429": { - "description": "Too many requests." - } - }, - "summary": "Generate with the distilled few-step Ideogram model (high speed tier)", - "tags": [ - "generate" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.generate_controller" - } - }, - "/v1/p-image-ideogram/low/generate": { - "post": { - "description": "Generates images synchronously using the distilled few-step Ideogram\nmodel at the low speed tier — fast and low-cost, with a modest quality\ntrade-off. The speed tier controls the number of diffusion steps and the\nper-image price.\n\nImages links are available for a limited period of time; if you would like to keep the image, you must download it.\n", - "operationId": "post_generate_image_p_image_low", - "requestBody": { - "content": { - "multipart/form-data": { - "schema": { - "$ref": "#/components/schemas/GenerateImageRequestPImage" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateImageRequestPImage" + "404": { + "description": "A referenced resource was not found.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } } } }, - "description": "A request to generate an image with the distilled few-step Ideogram model.", - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { + "429": { + "description": "Too many requests.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ImageGenerationResponseV4" + "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Image(s) generated successfully." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Not authorized." + } }, - "422": { + "500": { + "description": "Internal server error.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageSafetyError" + "description": "Any type" } } - }, - "description": "Prompt failed the safety check." + } }, - "429": { - "description": "Too many requests." + "503": { + "description": "The endpoint is temporarily unavailable.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } } }, - "summary": "Generate with the distilled few-step Ideogram model (low speed tier)", - "tags": [ - "generate" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.generate_controller" - } - }, - "/v1/p-image-ideogram/medium/generate": { - "post": { - "description": "Generates images synchronously using the distilled few-step Ideogram\nmodel at the medium speed tier — the balanced default of speed, cost, and\nquality. The speed tier controls the number of diffusion steps and the\nper-image price.\n\nImages links are available for a limited period of time; if you would like to keep the image, you must download it.\n", - "operationId": "post_generate_image_p_image_medium", "requestBody": { "content": { "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/GenerateImageRequestPImage" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateImageRequestPImage" + "type": "object", + "properties": { + "image": { + "type": "string", + "format": "binary", + "description": "The JPEG, PNG, or WEBP image to reframe (max 50MB)." + }, + "aspect_ratio": { + "$ref": "#/components/schemas/NanoBanana2ReframeAspectRatio" + }, + "private": { + "type": "boolean", + "description": "API-key requests are always private. For bearer-authenticated\nrequests, this controls whether the result is private; when\nomitted, it follows the caller's plan entitlement. Enterprise\ngenerations are always private.\n" + }, + "num_images": { + "type": "integer", + "minimum": 1, + "maximum": 4, + "default": 1, + "description": "The number of output images to generate." + }, + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." + } + }, + "required": [ + "image", + "aspect_ratio" + ] } } - }, - "description": "A request to generate an image with the distilled few-step Ideogram model.", - "required": true, - "x-body-name": "body" + } }, + "security": [ + { + "ApiKeyAuth": [] + } + ] + } + }, + "/v2/image/upscale/auto": { + "post": { + "operationId": "tools_post_upscale", + "summary": "Upscale with automatic model selection", + "description": "Upscale an image to 2x, 4x, or 8x its original resolution with a model\nIdeogram picks per request; the choice may change over time. Upload the\nsource `image` using `multipart/form-data`.\nReturns results directly by default; set `async` or supply a\n`webhook_url` to get a `generation_id` and poll\n`GET /v2/generations/{generation_id}`.\n", + "tags": [ + "tools" + ], + "parameters": [ + { + "name": "dry_run", + "in": "query", + "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", + "required": false, + "schema": { + "type": "boolean", + "default": false + } + } + ], "responses": { "200": { + "description": "The upscaled image (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests).", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ImageGenerationResponseV4" + "$ref": "#/components/schemas/UpscaleToolResponse" } } - }, - "description": "Image(s) generated successfully." + } }, "400": { - "description": "Invalid input provided." + "description": "Invalid input provided, or the output would exceed the 8K limit.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "401": { - "description": "Not authorized." - }, - "422": { + "description": "Unauthorized.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageSafetyError" + "description": "Any type" } } - }, - "description": "Prompt failed the safety check." + } }, - "429": { - "description": "Too many requests." - } - }, - "summary": "Generate with the distilled few-step Ideogram model (medium speed tier)", - "tags": [ - "generate" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.generate_controller" - } - }, - "/v1/p-image-ideogram/very-low/generate": { - "post": { - "description": "Generates images synchronously using the distilled few-step Ideogram\nmodel at the very-low speed tier — the fastest and lowest-cost option.\nThe speed tier controls the number of diffusion steps and the per-image\nprice.\n\nImages links are available for a limited period of time; if you would like to keep the image, you must download it.\n", - "operationId": "post_generate_image_p_image_very_low", - "requestBody": { - "content": { - "multipart/form-data": { - "schema": { - "$ref": "#/components/schemas/GenerateImageRequestPImage" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateImageRequestPImage" + "402": { + "description": "Insufficient credits or quota.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerationErrorResponse" + } } } }, - "description": "A request to generate an image with the distilled few-step Ideogram model.", - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { + "403": { + "description": "Not authorized to upscale images.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ImageGenerationResponseV4" + "description": "Any type" } } - }, - "description": "Image(s) generated successfully." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Not authorized." + } }, - "422": { + "404": { + "description": "The source image was not found.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageSafetyError" + "description": "Any type" } } - }, - "description": "Prompt failed the safety check." + } }, "429": { - "description": "Too many requests." - } - }, - "summary": "Generate with the distilled few-step Ideogram model (very-low speed tier)", - "tags": [ - "generate" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.generate_controller" - } - }, - "/v1/provenance/verify": { - "post": { - "description": "Checks image content for an Ideogram provenance manifest (C2PA Content\nCredentials) and returns the disclosure it carries: the provider name,\nthe generating system and its version, the creation time, and the\ncontent's unique identifier.\n\nUpload the image to verify as the `content` part.\n\nThis endpoint is public and unauthenticated — no API key is required.\nSubmitted content is analyzed in memory and never stored.\n", - "operationId": "post_provenance_verify", - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "content": { - "contentType": "application/octet-stream" + "description": "Too many requests.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerationErrorResponse" } - }, - "schema": { - "$ref": "#/components/schemas/ProvenanceVerifyRequest" } } }, - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { + "500": { + "description": "Internal server error.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProvenanceVerifyResponse" + "description": "Any type" } } - }, - "description": "The verification result." - }, - "400": { - "description": "Invalid input, such as missing or unreadable content." - }, - "413": { - "description": "The uploaded content is too large." + } }, - "429": { - "description": "Too many requests." + "503": { + "description": "The endpoint is temporarily unavailable.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } } }, - "security": [], - "summary": "Check whether content was created by Ideogram", - "tags": [ - "provenance" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.provenance_controller" - } - }, - "/v1/remove-background": { - "post": { - "description": "Remove the background of a given image synchronously. The foreground subject\nis identified and returned on a transparent background. Supported image formats include JPEG,\nPNG, and WebP.\nImage links are available for a limited period of time; if you would like to keep the image,\nyou must download it.\n", - "operationId": "post_remove_background", "requestBody": { + "description": "A request to upscale one image. Upload the source `image` using `multipart/form-data`.", "content": { "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/RemoveBackgroundRequest" + "type": "object", + "properties": { + "image": { + "type": "string", + "format": "binary", + "description": "The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored." + }, + "upscale_factor": { + "$ref": "#/components/schemas/V2ImageUpscaleAutoPostRequestBodyContentMultipartFormDataSchemaUpscaleFactor", + "default": "x2", + "description": "How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side." + }, + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." + }, + "async": { + "type": "boolean", + "default": false, + "description": "When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result." + }, + "webhook_url": { + "type": "string", + "format": "uri", + "maxLength": 2048, + "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n" + } + }, + "required": [ + "image" + ] } } - }, - "description": "A request to remove the background of an image.", - "required": true, - "x-body-name": "body" + } }, + "security": [ + { + "ApiKeyAuth": [] + } + ] + } + }, + "/v2/image/upscale/nano-banana-pro": { + "post": { + "operationId": "imagesUpscale_post_upscale_image_nano_banana_pro", + "summary": "Upscale with Nano Banana Pro", + "description": "Regenerate an image at a higher `resolution_tier` (1K, 2K, or 4K) while\npreserving its content, composition, and style. Upload the source\n`image` using `multipart/form-data`.\nReturns results directly by default; set `async` or supply a\n`webhook_url` to get a `generation_id` and poll\n`GET /v2/generations/{generation_id}`.\n", + "tags": [ + "images-upscale" + ], + "parameters": [ + { + "name": "dry_run", + "in": "query", + "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", + "required": false, + "schema": { + "type": "boolean", + "default": false + } + } + ], "responses": { "200": { + "description": "The upscaled image (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests).", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RemoveBackgroundResponse" + "$ref": "#/components/schemas/UpscaleImageNanoBananaProResponse" } } - }, - "description": "Background removed successfully." + } }, "400": { - "description": "Invalid input provided." + "description": "Invalid input provided.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "401": { - "description": "Not authorized to remove background." - }, - "422": { + "description": "Unauthorized.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageSafetyError" + "description": "Any type" } } - }, - "description": "Initial image failed the safety checks." + } }, - "429": { - "description": "Too many requests." - } - }, - "summary": "Remove Background", - "tags": [ - "generate" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.generate_controller" - } - }, - "/v1/remove-object": { - "post": { - "description": "Remove a masked object from a given image synchronously. Supply the image and a binary mask marking the region to remove (white = remove); the masked region is regenerated to blend with the surrounding scene. Supported image formats include JPEG, PNG, and WebP. Image links are available for a limited period of time; if you would like to keep the image, you must download it.", - "operationId": "post_remove_object", - "requestBody": { - "content": { - "multipart/form-data": { - "schema": { - "$ref": "#/components/schemas/RemoveObjectRequest" + "402": { + "description": "Insufficient credits or quota.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerationErrorResponse" + } } } }, - "description": "A request to remove a masked object from an image.", - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { + "404": { + "description": "The source image was not found.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RemoveObjectResponse" + "description": "Any type" } } - }, - "description": "Object removed successfully." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Not authorized to remove object." + } }, "422": { + "description": "The prompt did not pass safety checks.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageSafetyError" + "description": "Any type" } } - }, - "description": "Initial image failed the safety checks." + } }, "429": { - "description": "Too many requests." - } - }, - "summary": "Remove Object", - "tags": [ - "generate" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.generate_controller" - } - }, - "/v1/snap-mask": { - "post": { - "description": "Refine a hand-drawn binary mask to the object it marks. Supply the source image and a mask with the same dimensions; white (>= 128) marks the object. The response is a binary PNG mask with white pixels marking the snapped object.", - "operationId": "post_snap_mask", - "requestBody": { - "content": { - "multipart/form-data": { - "schema": { - "$ref": "#/components/schemas/SnapMaskRequest" + "description": "Too many requests.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerationErrorResponse" + } } } }, - "description": "A source image and its hand-drawn object mask.", - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { + "500": { + "description": "Internal server error.", "content": { - "image/png": { + "application/json": { "schema": { - "format": "binary", - "type": "string" + "description": "Any type" } } - }, - "description": "The snapped binary object mask as a PNG image." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Not authorized to snap a mask." + } }, - "429": { - "description": "Too many requests." + "503": { + "description": "The endpoint is temporarily unavailable.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } } }, - "summary": "Snap a hand-drawn mask to the selected object", - "tags": [ - "generate" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.generate_controller" - } - }, - "/v1/text-to-image/p-image-ideogram": { - "post": { - "description": "Generates images synchronously using P-Image Ideogram. `quality` selects\nthe generation quality level and `resolution` selects the output-size\ntier. Both parameters have defaults.\n\nImages links are available for a limited period of time; if you would like to keep the image, you must download them.\n", - "operationId": "post_generate_image_p_image_ideogram", "requestBody": { + "description": "A request to upscale one image with Nano Banana Pro. Upload the source `image` using `multipart/form-data`.", "content": { "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/GenerateImageRequestPImageIdeogram" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateImageRequestPImageIdeogram" + "type": "object", + "properties": { + "image": { + "type": "string", + "format": "binary", + "description": "The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored." + }, + "prompt": { + "type": "string", + "maxLength": 2000, + "description": "Optional short guidance for the enhancement, appended to the model's upscaling instruction. When omitted, the image is upscaled as-is." + }, + "resolution_tier": { + "$ref": "#/components/schemas/V2ImageUpscaleNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier", + "default": "2K", + "description": "The output resolution tier. The model sizes its output by tier at the source image's aspect ratio; exact pixel dimensions cannot be requested. Rejected when the source is already at or above the requested tier. Defaults to \"2K\"." + }, + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." + }, + "async": { + "type": "boolean", + "default": false, + "description": "When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result." + }, + "webhook_url": { + "type": "string", + "format": "uri", + "maxLength": 2048, + "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n" + } + }, + "required": [ + "image" + ] } } - }, - "description": "A request to generate an image with P-Image Ideogram.", - "required": true, - "x-body-name": "body" + } }, + "security": [ + { + "ApiKeyAuth": [] + } + ] + } + }, + "/v2/image/upscale/topaz-bloom-2": { + "post": { + "operationId": "imagesUpscale_post_upscale_image_topaz_bloom2", + "summary": "Upscale with Topaz Bloom 2", + "description": "Creatively upscale an image to 2x, 4x, or 8x its original resolution,\noptionally guided by a `prompt`. Upload the source `image` using\n`multipart/form-data`.\nReturns results directly by default; set `async` or supply a\n`webhook_url` to get a `generation_id` and poll\n`GET /v2/generations/{generation_id}`.\n", + "tags": [ + "images-upscale" + ], + "parameters": [ + { + "name": "dry_run", + "in": "query", + "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", + "required": false, + "schema": { + "type": "boolean", + "default": false + } + } + ], "responses": { "200": { + "description": "The upscaled image (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests).", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ImageGenerationResponseV4" + "$ref": "#/components/schemas/UpscaleImageTopazBloom2Response" } } - }, - "description": "Image(s) generated successfully." + } }, "400": { - "description": "Invalid input provided." + "description": "Invalid input provided, or the output would exceed the 8K limit.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "401": { - "description": "Not authorized." - }, - "422": { + "description": "Unauthorized.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageSafetyError" + "description": "Any type" } } - }, - "description": "Prompt failed the safety check." + } }, - "429": { - "description": "Too many requests." - } - }, - "summary": "Generate with P-Image Ideogram", - "tags": [ - "generate" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.generate_controller" - } - }, - "/v1/z-image/async/generate": { - "post": { - "description": "Accepts a Z-Image generation request for asynchronous processing and\nreturns immediately with a generation_id. The generated images are POSTed to\nthe supplied `webhook_url` once ready, in a payload that mirrors the\nsynchronous response with an added generation_id for correlation.\n\nSee [Webhooks](/ideogram-api/webhooks) for the delivery payload and how to verify webhook signatures.\n", - "operationId": "post_generate_image_z_image_async", - "parameters": [ - { - "explode": true, - "in": "query", - "name": "webhook_url", - "required": true, - "schema": { - "$ref": "#/components/schemas/WebhookUrl" - }, - "style": "form" - } - ], - "requestBody": { - "content": { - "multipart/form-data": { - "schema": { - "$ref": "#/components/schemas/GenerateImageRequestZImage" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateImageRequestZImage" + "402": { + "description": "Insufficient credits or quota.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerationErrorResponse" + } } } }, - "description": "A request to generate an image with Z-Image.", - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { + "404": { + "description": "The source image was not found.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AsyncImageGenerationResponseV4" + "description": "Any type" } } - }, - "description": "Request accepted for asynchronous delivery." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Not authorized." + } }, "422": { + "description": "The prompt did not pass safety checks.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageSafetyError" + "description": "Any type" } } - }, - "description": "Prompt failed the safety check." + } }, "429": { - "description": "Too many requests." + "description": "Too many requests.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerationErrorResponse" + } + } + } + }, + "500": { + "description": "Internal server error.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } + }, + "503": { + "description": "The endpoint is temporarily unavailable.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } } }, - "summary": "Generate with Z-Image asynchronously via webhook", - "tags": [ - "generate" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.generate_controller" - } - }, - "/v1/z-image/generate": { - "post": { - "description": "Generates images synchronously using the Z-Image model. Width and height\nmust each be a positive multiple of 16 and the total area must not exceed\n1,048,576 pixels (1024×1024); the server validates these against the\nmodel's resolution constraints.\n\nImages links are available for a limited period of time; if you would like to keep the image, you must download it.\n", - "operationId": "post_generate_image_z_image", "requestBody": { + "description": "A request to upscale one image with Topaz Bloom 2. Upload the source `image` using `multipart/form-data`.", "content": { "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/GenerateImageRequestZImage" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateImageRequestZImage" + "type": "object", + "properties": { + "image": { + "type": "string", + "format": "binary", + "description": "The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored." + }, + "upscale_factor": { + "$ref": "#/components/schemas/V2ImageUpscaleTopazBloom2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor", + "default": "x2", + "description": "How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side." + }, + "prompt": { + "type": "string", + "maxLength": 1024, + "default": "", + "description": "An optional prompt guiding the detail the model regenerates while enlarging the image. Leave empty to enhance the source image as-is." + }, + "creativity": { + "type": "integer", + "minimum": 1, + "maximum": 9, + "default": 3, + "description": "How strongly the model reinterprets the source while enlarging it, from 1 (most faithful) to 9 (most creative)." + }, + "color_preservation": { + "type": "boolean", + "default": true, + "description": "When true (the default), the output keeps the source image's colors. Set to false to let the model adjust colors while enhancing." + }, + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." + }, + "async": { + "type": "boolean", + "default": false, + "description": "When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result." + }, + "webhook_url": { + "type": "string", + "format": "uri", + "maxLength": 2048, + "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n" + } + }, + "required": [ + "image" + ] } } - }, - "description": "A request to generate an image with Z-Image.", - "required": true, - "x-body-name": "body" + } }, + "security": [ + { + "ApiKeyAuth": [] + } + ] + } + }, + "/v2/image/upscale/topaz-redefine": { + "post": { + "operationId": "imagesUpscale_post_upscale_image_topaz_redefine", + "summary": "Upscale with Topaz Redefine", + "description": "Creatively upscale an image to 2x, 4x, or 8x its original resolution,\nguided by an optional `prompt` or `autoprompt`. Upload the source\n`image` using `multipart/form-data`.\nReturns results directly by default; set `async` or supply a\n`webhook_url` to get a `generation_id` and poll\n`GET /v2/generations/{generation_id}`.\n", + "tags": [ + "images-upscale" + ], + "parameters": [ + { + "name": "dry_run", + "in": "query", + "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", + "required": false, + "schema": { + "type": "boolean", + "default": false + } + } + ], "responses": { "200": { + "description": "The upscaled image (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests).", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ImageGenerationResponse" + "$ref": "#/components/schemas/UpscaleImageTopazRedefineResponse" } } - }, - "description": "Image(s) generated successfully." + } }, "400": { - "description": "Invalid input provided." + "description": "Invalid input provided, or the output would exceed the 8K limit.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "401": { - "description": "Not authorized." - }, - "422": { + "description": "Unauthorized.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageSafetyError" + "description": "Any type" } } - }, - "description": "Prompt failed the safety check." + } }, - "429": { - "description": "Too many requests." - } - }, - "summary": "Generate with Z-Image", - "tags": [ - "generate" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.generate_controller" - } - }, - "/v2/account/api-keys": { - "get": { - "description": "Lists the API keys in your organization. Key material is redacted —\nthe full key is only shown once, when it is created. Disabled and\narchived keys are included (see each key's `status`) so historical\nusage can always be matched to the key that generated it.\n\nRequires an API key whose owner is an organization admin. Keys owned\nby other members receive a 404.\n", - "operationId": "get_account_api_keys", - "responses": { - "200": { + "402": { + "description": "Insufficient credits or quota.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ListAccountApiKeysResponse" + "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "The organization's API keys, redacted." - }, - "401": { - "description": "Unauthorized." + } }, "404": { - "description": "No organization with billing access was found for this credential." - } - }, - "summary": "List API keys", - "tags": [ - "account" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.account_controller" - } - }, - "/v2/account/invoices": { - "get": { - "description": "Returns your organization's invoices with their line items — the\nbilling record your usage reports reconcile against. Amounts are\ndecimal strings in the invoice's currency.\n\nRequires an API key whose owner is an organization admin. Keys owned\nby other members receive a 404.\n", - "operationId": "get_account_invoices", - "responses": { - "200": { + "description": "The source image was not found.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ListAccountInvoicesResponse" + "description": "Any type" } } - }, - "description": "The organization's invoices. Empty when no billing history exists yet." + } }, - "401": { - "description": "Unauthorized." + "422": { + "description": "The prompt did not pass safety checks.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, - "404": { - "description": "No organization with billing access was found for this credential." - } - }, - "summary": "List invoices", - "tags": [ - "account" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.account_controller" - } - }, - "/v2/account/usage": { - "get": { - "description": "Returns your organization's billed API usage as dense time buckets of\nline items. Every line item carries the billed dollar amount; products\nbilled per item also carry `billed_units` (unit, quantity, and unit\nprice, where `quantity × unit_price = cost_total`). Usage-priced\nproducts (billed by metered provider usage) report `cost_total` only.\n\nBuckets cover the requested range completely — a bucket with no line\nitems means no billed usage in that window. Line items are unique per\nbucket on (`product`, `dimensions`, `api_key.id`, unit price). Usage\nbilled without an API key (requests authenticated as a user session)\nis included with `api_key` absent, so totals always reconcile with\nyour invoices.\n`product` and `endpoint` are stable identifiers safe to aggregate on;\n`description` is display text and may be reworded at any time.\n\nUsage data may lag live traffic by a few minutes, and responses may be\ncached briefly, so this endpoint is for reporting rather than\nreal-time monitoring.\n\nRequires an API key whose owner is an organization admin. Keys owned\nby other members receive a 404.\n", - "operationId": "get_account_usage", - "parameters": [ - { - "description": "Start of the reporting range (RFC 3339). Snapped down to the containing bucket boundary (UTC).", - "in": "query", - "name": "start_time", - "required": true, - "schema": { - "format": "date-time", - "type": "string" - } - }, - { - "description": "End of the reporting range (RFC 3339), exclusive. Snapped up to the next bucket boundary (UTC). Defaults to now.", - "in": "query", - "name": "end_time", - "required": false, - "schema": { - "format": "date-time", - "type": "string" + "429": { + "description": "Too many requests.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerationErrorResponse" + } + } } }, - { - "description": "Bucket granularity. `1d` allows ranges up to 92 days per request; `1h` allows up to 168 hours. Page through longer histories by moving `start_time` back across successive requests.", - "in": "query", - "name": "bucket_width", - "required": false, - "schema": { - "default": "1d", - "enum": [ - "1d", - "1h" - ], - "type": "string" + "500": { + "description": "Internal server error.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } } }, - { - "description": "Which billing sources to include. `api` is usage from API requests; `app` is web-app usage, attributed to the member who generated it. Defaults to both, so report totals reconcile with invoices.", - "explode": true, - "in": "query", - "name": "sources", - "required": false, - "schema": { - "default": [ - "api", - "app" - ], - "items": { - "enum": [ - "api", - "app" - ], - "type": "string" - }, - "type": "array" - }, - "style": "form" - } - ], - "responses": { - "200": { + "503": { + "description": "The endpoint is temporarily unavailable.", "content": { "application/json": { - "example": { - "buckets": [ - { - "start_time": "2026-09-01T00:00:00+00:00", - "end_time": "2026-09-02T00:00:00+00:00", - "line_items": [ - { - "product": "ideogram_v4_generation", - "endpoint": "/v2/image/generate/ideogram-4", - "description": "Ideogram v4 Generation", - "dimensions": { - "rendering_speed": "TURBO" - }, - "cost_total": "84.00", - "currency_code": "USD", - "billed_units": { - "unit": "image", - "quantity": "2100", - "unit_price": "0.04" - }, - "api_key": { - "id": "JRPVD7jWR1aTBYiJ0UFVOg", - "redacted_key": "ATG5•••••••••••••", - "label": "Live production environment" - } - }, - { - "product": "gpt_image_2_edit", - "endpoint": "/v2/image/generate/gpt-image-2", - "description": "GPT Image 2 Edit", - "cost_total": "3.47", - "currency_code": "USD", - "api_key": { - "id": "JRPVD7jWR1aTBYiJ0UFVOg", - "redacted_key": "ATG5•••••••••••••", - "label": "Live production environment" - } - } - ] - } - ] - }, "schema": { - "$ref": "#/components/schemas/GetAccountUsageResponse" + "description": "Any type" } } - }, - "description": "Bucketed usage for the requested range." - }, - "400": { - "description": "Invalid time range, bucket width, or filters." - }, - "401": { - "description": "Unauthorized." - }, - "404": { - "description": "No organization with billing access was found for this credential." - }, - "429": { - "description": "Too many requests." + } } }, - "summary": "Get usage and spend", - "tags": [ - "account" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.account_controller" + "requestBody": { + "description": "A request to upscale one image with Topaz Redefine. Upload the source `image` using `multipart/form-data`.", + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "image": { + "type": "string", + "format": "binary", + "description": "The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored." + }, + "upscale_factor": { + "$ref": "#/components/schemas/V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor", + "default": "x2", + "description": "How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side." + }, + "prompt": { + "type": "string", + "maxLength": 1024, + "default": "", + "description": "An optional prompt guiding the detail the model regenerates while enlarging the image. Leave empty to enhance the source image as-is." + }, + "creativity": { + "type": "integer", + "minimum": 1, + "maximum": 9, + "default": 3, + "description": "How strongly the model reinterprets the source while enlarging it, from 1 (most faithful) to 9 (most creative)." + }, + "autoprompt": { + "type": "boolean", + "default": false, + "description": "When true, the model describes the image itself and any `prompt` is ignored." + }, + "texture": { + "type": "integer", + "minimum": 1, + "maximum": 5, + "default": 1, + "description": "How much fine texture the model adds, from 1 to 5. Keep it low at low creativity." + }, + "detail": { + "type": "boolean", + "default": false, + "description": "Apply a detail adjustment after rendering. When true, `detail_strength` sets how much." + }, + "detail_strength": { + "type": "string", + "title": "float", + "description": "Detail adjustment intensity, from 0 to 10." + }, + "sharpen": { + "type": "string", + "title": "float", + "description": "Edge sharpening applied after enlarging, from 0 to 1. Omit to let the model choose per image." + }, + "denoise": { + "type": "string", + "title": "float", + "description": "Noise and grain reduction, from 0 to 1. Omit to let the model choose per image." + }, + "face_enhancement": { + "type": "boolean", + "description": "Recover detail in faces. When true, `face_enhancement_strength` and `face_enhancement_creativity` are required." + }, + "face_enhancement_strength": { + "type": "string", + "title": "float", + "description": "How strongly faces are recovered, from 0 to 1." + }, + "face_enhancement_creativity": { + "type": "string", + "title": "float", + "description": "How freely face recovery may reinterpret features, from 0 (faithful) to 1 (creative)." + }, + "subject_detection": { + "$ref": "#/components/schemas/V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection", + "description": "Where enhancements apply. Omit to let the model choose per image." + }, + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." + }, + "async": { + "type": "boolean", + "default": false, + "description": "When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result." + }, + "webhook_url": { + "type": "string", + "format": "uri", + "maxLength": 2048, + "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n" + } + }, + "required": [ + "image" + ] + } + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + } + ] } }, - "/v2/assets/reference-usage": { - "get": { - "description": "Counts completed requests made by the authenticated organization that used each existing asset as an edit input during the UTC date range. Direct file uploads without saved asset identifiers are excluded. Results are independent of current asset ownership, collection membership, and sharing. Returning an identifier does not grant access to its image. Tracking begins when enabled; earlier history is not included. Returns 50 assets per page by default, up to 100 with limit. Rankings may change between pages when daily counts are updated; cursors do not pin a historical snapshot.", - "operationId": "get_asset_reference_usage", + "/v2/image/upscale/topaz-standard-2": { + "post": { + "operationId": "imagesUpscale_post_upscale_image_topaz_standard_v2", + "summary": "Upscale with Topaz Standard V2", + "description": "Upscale an image to 2x, 4x, or 8x its original resolution; no prompt is\nneeded. Upload the source `image` using `multipart/form-data`.\nReturns results directly by default; set `async` or supply a\n`webhook_url` to get a `generation_id` and poll\n`GET /v2/generations/{generation_id}`.\n", + "tags": [ + "images-upscale" + ], "parameters": [ { - "description": "Maximum number of returned entries per page.", - "in": "query", - "name": "limit", - "schema": { - "default": 50, - "maximum": 100, - "minimum": 1, - "type": "integer" - } - }, - { - "description": "Exact collections to rank within; requires include_collections=true. Includes direct members only, not descendants. Every collection must be accessible. Counts include only completed requests that explicitly selected the asset from that collection. Keep the same selection on every cursor page.", - "explode": true, - "in": "query", - "name": "collection_ids", - "schema": { - "items": { - "maxLength": 22, - "minLength": 22, - "type": "string" - }, - "minItems": 1, - "type": "array", - "uniqueItems": true - }, - "style": "form" - }, - { - "description": "Return one entry per explicitly referenced collection asset, with its collection-specific usage count and current filename and attributes. Only currently accessible members are returned. Pages may be short or empty; follow next_cursor until null.", - "in": "query", - "name": "include_collections", - "schema": { - "default": false, - "type": "boolean" - } - }, - { - "description": "Inclusive UTC usage date.", - "in": "query", - "name": "start_date", - "required": true, - "schema": { - "format": "date", - "type": "string" - } - }, - { - "description": "Exclusive UTC usage date, later than start_date.", - "in": "query", - "name": "end_date", - "required": true, - "schema": { - "format": "date", - "type": "string" - } - }, - { - "description": "Opaque next-page cursor. Keep the same date range on every page.", + "name": "dry_run", "in": "query", - "name": "cursor", + "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", "required": false, "schema": { - "maxLength": 2048, - "type": "string" + "type": "boolean", + "default": false } } ], "responses": { "200": { + "description": "The upscaled image (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests).", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AssetReferenceUsageResponse" + "$ref": "#/components/schemas/UpscaleImageTopazStandardV2Response" } } - }, - "description": "Ranked edit reference assets" + } }, "400": { - "description": "Invalid date range or cursor, or missing organization context" - }, - "401": { - "description": "Unauthorized" - }, - "503": { - "description": "Usage data temporarily unavailable" - } - }, - "summary": "Rank edit reference assets used by organization requests", - "tags": [ - "asset-reference-usage" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.asset_reference_usage_controller" - } - }, - "/v2/design/layerize/ideogram-3": { - "post": { - "description": "Turn a flat image into an editable design: detected text is returned as\npositioned text blocks with matched fonts, sizes, and colors, alongside\na text-free base image. Upload the image as `image` using\n`multipart/form-data`. Returns results directly by default; set `async`\nor supply a `webhook_url` to get a `generation_id` and poll\n`GET /v2/generations/{generation_id}`.\n", - "operationId": "post_layerize_design_ideogram_v3", - "parameters": [ - { - "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", - "in": "query", - "name": "dry_run", - "required": false, - "schema": { - "default": false, - "type": "boolean" - }, - "x-tool-description": "Validate and quote only; no generation, storage, billing, or safety review." - } - ], - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "image_asset_identifier": { - "contentType": "application/json" + "description": "Invalid input provided, or the output would exceed the 8K limit.", + "content": { + "application/json": { + "schema": { + "description": "Any type" } - }, - "schema": { - "$ref": "#/components/schemas/LayerizeDesignIdeogramV3Request" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/LayerizeDesignIdeogramV3Request" } } }, - "description": "A request to layerize the text in one image. Send it as `multipart/form-data` with the source `image`.", - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { + "401": { + "description": "Unauthorized.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/LayerizeDesignIdeogramV3Response" + "description": "Any type" } } - }, - "description": "The layerized design (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests)." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Unauthorized." + } }, "402": { + "description": "Insufficient credits or quota.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Insufficient credits or quota." - }, - "403": { - "description": "Not authorized to layerize images." + } }, "404": { - "description": "The source image was not found." + "description": "The source image was not found.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "429": { + "description": "Too many requests.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Too many requests." + } }, "500": { - "description": "Internal server error." + "description": "Internal server error.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "503": { - "description": "The endpoint is temporarily unavailable." - } - }, - "summary": "Layerize text with Ideogram 3.0", - "tags": [ - "design" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.design_controller" - } - }, - "/v2/generations/{generation_id}": { - "get": { - "description": "Retrieves the current status of an asynchronous generation, and its\nresults once complete. Use the `generation_id` returned by any `/v2`\nendpoint that runs asynchronously: every video and tool endpoint, and\nany image endpoint called with `async` or a `webhook_url`.\n\nWhile the generation is `pending` or has `failed`, the response\ncontains only `generation_id`, `status`, and `created` (plus\n`failure_reason` once failed). Once `status` is `completed`, the\nresponse includes `response_type` and `data`. Each `data` item carries\nan `object_type` that identifies its shape, so image and video results\ncan be told apart. `usage_cost_usd_micros` reports the amount billed\nwhen the request uses variable usage-based pricing.\n\nPolling is rate limited per organization; a 429 response carries a\n`Retry-After` header with the number of seconds to wait.", - "operationId": "get_generation_v2", - "parameters": [ - { - "description": "URL-safe base64 ID of the generation, as returned when the request was accepted.", - "explode": false, - "in": "path", - "name": "generation_id", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - } - ], - "responses": { - "200": { + "description": "The endpoint is temporarily unavailable.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerationResponse" + "description": "Any type" } } - }, - "description": "Generation status retrieved successfully." - }, - "400": { - "description": "The generation ID is not a valid URL-safe base64 ID." - }, - "401": { - "description": "Not authorized." - }, - "404": { - "description": "Generation not found." - }, - "429": { - "description": "Too many requests." + } } }, - "summary": "Poll a generation", - "tags": [ - "generations" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.generations_controller" - } - }, - "/v2/image/describe/ideogram-3": { - "post": { - "description": "Generate a natural-language description of an image with Ideogram's 3.0\nimage captioner (a fine-tune of the Qwen2-VL vision-language model).\nUpload the image as `image` using `multipart/form-data`; the description\nis returned directly.\n", - "operationId": "post_describe_image_ideogram_v3", "requestBody": { + "description": "A request to upscale one image with Topaz Standard V2. Upload the source `image` using `multipart/form-data`.", "content": { "multipart/form-data": { - "encoding": { - "image_asset_identifier": { - "contentType": "application/json" - } - }, - "schema": { - "$ref": "#/components/schemas/DescribeImageIdeogramV3Request" - } - }, - "application/json": { "schema": { - "$ref": "#/components/schemas/DescribeImageIdeogramV3Request" + "type": "object", + "properties": { + "image": { + "type": "string", + "format": "binary", + "description": "The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored." + }, + "upscale_factor": { + "$ref": "#/components/schemas/V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor", + "default": "x2", + "description": "How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side." + }, + "strength": { + "type": "string", + "title": "float", + "description": "Overall intensity of the enhancement model, from 0.01 to 1. Higher values look crisper but can turn unrealistic. Omit to let the model choose per image." + }, + "sharpen": { + "type": "string", + "title": "float", + "description": "Edge sharpening applied after enlarging, from 0 to 1. Omit to let the model choose per image." + }, + "denoise": { + "type": "string", + "title": "float", + "description": "Noise and grain reduction, from 0 to 1. Omit to let the model choose per image." + }, + "fix_compression": { + "type": "string", + "title": "float", + "description": "Compression artifact removal, from 0 to 1. Omit to let the model choose per image." + }, + "face_enhancement": { + "type": "boolean", + "description": "Recover detail in faces. When true, `face_enhancement_strength` and `face_enhancement_creativity` are required." + }, + "face_enhancement_strength": { + "type": "string", + "title": "float", + "description": "How strongly faces are recovered, from 0 to 1." + }, + "face_enhancement_creativity": { + "type": "string", + "title": "float", + "description": "How freely face recovery may reinterpret features, from 0 (faithful) to 1 (creative)." + }, + "subject_detection": { + "$ref": "#/components/schemas/V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaSubjectDetection", + "description": "Where enhancements apply. Omit to let the model choose per image." + }, + "async": { + "type": "boolean", + "default": false, + "description": "When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result." + }, + "webhook_url": { + "type": "string", + "format": "uri", + "maxLength": 2048, + "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n" + } + }, + "required": [ + "image" + ] } } - }, - "description": "A request to describe one image. Send it as `multipart/form-data` with the `image` to describe.", - "required": true, - "x-body-name": "body" + } }, + "security": [ + { + "ApiKeyAuth": [] + } + ] + } + }, + "/v2/image/upscale/topaz-text-refine": { + "post": { + "operationId": "imagesUpscale_post_upscale_image_topaz_text_refine", + "summary": "Upscale with Topaz Text Refine", + "description": "Upscale an image to 2x, 4x, or 8x its original resolution; no prompt is\nneeded. Upload the source `image` using `multipart/form-data`.\nReturns results directly by default; set `async` or supply a\n`webhook_url` to get a `generation_id` and poll\n`GET /v2/generations/{generation_id}`.\n", + "tags": [ + "images-upscale" + ], + "parameters": [ + { + "name": "dry_run", + "in": "query", + "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", + "required": false, + "schema": { + "type": "boolean", + "default": false + } + } + ], "responses": { "200": { + "description": "The upscaled image (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests).", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DescribeImageIdeogramV3Response" + "$ref": "#/components/schemas/UpscaleImageTopazTextRefineResponse" } } - }, - "description": "Description(s) generated successfully." + } }, "400": { - "description": "Invalid input provided." + "description": "Invalid input provided, or the output would exceed the 8K limit.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "401": { - "description": "Unauthorized." + "description": "Unauthorized.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "402": { + "description": "Insufficient credits or quota.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Insufficient credits or quota." + } }, "404": { - "description": "The source image was not found." - }, - "422": { + "description": "The source image was not found.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ImageSafetyError" + "description": "Any type" } } - }, - "description": "Image failed the safety check." + } }, "429": { + "description": "Too many requests.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Too many requests." + } }, "500": { - "description": "Internal server error." + "description": "Internal server error.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "503": { - "description": "The endpoint is temporarily unavailable." + "description": "The endpoint is temporarily unavailable.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } } }, - "summary": "Describe with Ideogram 3.0", - "tags": [ - "image-describe" - ], - "x-tool-description": "Describe an existing image asset in natural language with the Ideogram 3.0 captioner.", - "x-openapi-router-controller": "external_api.generated.openapi.controllers.image_describe_controller" - } - }, - "/v2/image/describe/ideogram-4": { - "post": { - "description": "Describe an image as a structured `V4JsonPrompt` with Ideogram's 4.0\nimage captioner (a fine-tune of the Qwen3-VL vision-language model).\nUpload the image as `image` using `multipart/form-data`; the\n`json_prompt` is returned directly and can be passed to the\n`/v1/ideogram-v4/generate` endpoints.\n", - "operationId": "post_describe_image_ideogram_v4", "requestBody": { + "description": "A request to upscale one image with Topaz Text Refine. Upload the source `image` using `multipart/form-data`.", "content": { "multipart/form-data": { - "encoding": { - "image_asset_identifier": { - "contentType": "application/json" - } - }, "schema": { - "$ref": "#/components/schemas/DescribeImageIdeogramV4Request" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/DescribeImageIdeogramV4Request" + "type": "object", + "properties": { + "image": { + "type": "string", + "format": "binary", + "description": "The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored." + }, + "upscale_factor": { + "$ref": "#/components/schemas/V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor", + "default": "x2", + "description": "How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side." + }, + "strength": { + "type": "string", + "title": "float", + "description": "Overall intensity of the enhancement model, from 0.01 to 1. Higher values look crisper but can turn unrealistic. Omit to let the model choose per image." + }, + "sharpen": { + "type": "string", + "title": "float", + "description": "Edge sharpening applied after enlarging, from 0 to 1. Omit to let the model choose per image." + }, + "denoise": { + "type": "string", + "title": "float", + "description": "Noise and grain reduction, from 0 to 1. Omit to let the model choose per image." + }, + "fix_compression": { + "type": "string", + "title": "float", + "description": "Compression artifact removal, from 0 to 1. Omit to let the model choose per image." + }, + "face_enhancement": { + "type": "boolean", + "description": "Recover detail in faces. When true, `face_enhancement_strength` and `face_enhancement_creativity` are required." + }, + "face_enhancement_strength": { + "type": "string", + "title": "float", + "description": "How strongly faces are recovered, from 0 to 1." + }, + "face_enhancement_creativity": { + "type": "string", + "title": "float", + "description": "How freely face recovery may reinterpret features, from 0 (faithful) to 1 (creative)." + }, + "subject_detection": { + "$ref": "#/components/schemas/V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection", + "description": "Where enhancements apply. Omit to let the model choose per image." + }, + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." + }, + "async": { + "type": "boolean", + "default": false, + "description": "When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result." + }, + "webhook_url": { + "type": "string", + "format": "uri", + "maxLength": 2048, + "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n" + } + }, + "required": [ + "image" + ] } } - }, - "description": "A request to describe one image. Send it as `multipart/form-data` with the `image` to describe.", - "required": true, - "x-body-name": "body" + } }, + "security": [ + { + "ApiKeyAuth": [] + } + ] + } + }, + "/v2/image/upscale/topaz-wonder-3-5": { + "post": { + "operationId": "imagesUpscale_post_upscale_image_topaz_wonder35", + "summary": "Upscale with Topaz Wonder 3.5", + "description": "Upscale an image to 2x, 4x, or 8x its original resolution, with\n`enhancement_strength` controlling how strongly detail is reconstructed.\nUpload the source `image` using `multipart/form-data`.\nReturns results directly by default; set `async` or supply a\n`webhook_url` to get a `generation_id` and poll\n`GET /v2/generations/{generation_id}`.\n", + "tags": [ + "images-upscale" + ], + "parameters": [ + { + "name": "dry_run", + "in": "query", + "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", + "required": false, + "schema": { + "type": "boolean", + "default": false + } + } + ], "responses": { "200": { + "description": "The upscaled image (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests).", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DescribeImageIdeogramV4Response" + "$ref": "#/components/schemas/UpscaleImageTopazWonder35Response" } } - }, - "description": "Structured prompt generated successfully." + } }, "400": { - "description": "Invalid input provided." + "description": "Invalid input provided, or the output would exceed the 8K limit.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "401": { - "description": "Unauthorized." + "description": "Unauthorized.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "402": { + "description": "Insufficient credits or quota.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Insufficient credits or quota." + } }, "404": { - "description": "The source image was not found." - }, - "422": { + "description": "The source image was not found.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ImageSafetyError" + "description": "Any type" } } - }, - "description": "Image failed the safety check." + } }, "429": { + "description": "Too many requests.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Too many requests." + } }, "500": { - "description": "Internal server error." + "description": "Internal server error.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "503": { - "description": "The endpoint is temporarily unavailable." + "description": "The endpoint is temporarily unavailable.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } } }, - "summary": "Describe with Ideogram 4.0", - "tags": [ - "image-describe" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.image_describe_controller" + "requestBody": { + "description": "A request to upscale one image with Topaz Wonder 3.5. Upload the source `image` using `multipart/form-data`.", + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "image": { + "type": "string", + "format": "binary", + "description": "The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored." + }, + "upscale_factor": { + "$ref": "#/components/schemas/V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor", + "default": "x2", + "description": "How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side." + }, + "enhancement_strength": { + "$ref": "#/components/schemas/V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaEnhancementStrength", + "default": "high", + "description": "How strongly the generative model reconstructs detail while upscaling. Lower values stay closer to the source image; higher values produce a more enhanced result." + }, + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." + }, + "async": { + "type": "boolean", + "default": false, + "description": "When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result." + }, + "webhook_url": { + "type": "string", + "format": "uri", + "maxLength": 2048, + "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n" + } + }, + "required": [ + "image" + ] + } + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + } + ] } }, - "/v2/image/generate/auto": { + "/v2/image/replace-background/ideogram-3": { "post": { - "description": "Generate images with the model Ideogram picks as best suited to each\nrequest. Optionally upload source images as `images` using\n`multipart/form-data` to edit them with the prompt. Returns results\ndirectly by default; set `async` to get a `generation_id` and poll\n`GET /v2/generations/{generation_id}`.\n", - "operationId": "post_generate_image_v2_auto", + "operationId": "tool_replaceBackgroundIdeogramV3", + "summary": "Replace background with Ideogram 3.0", + "description": "Replace the background of an image from a text prompt with Ideogram 3.0,\nkeeping the automatically detected foreground subject; no mask is\nneeded. Upload the source `image` using `multipart/form-data`.\nReturns a `generation_id`; poll `GET /v2/generations/{generation_id}`\nor supply a `webhook_url`.\n", + "tags": [ + "tool" + ], "parameters": [ { - "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", - "in": "query", "name": "dry_run", + "in": "query", + "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", "required": false, "schema": { - "default": false, - "type": "boolean" - }, - "x-tool-description": "Validate and quote only; no generation, storage, billing, or safety review." + "type": "boolean", + "default": false + } } ], - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "image_asset_identifiers": { - "contentType": "application/json" - }, - "style_reference_asset_identifiers": { - "contentType": "application/json" - } - }, - "schema": { - "$ref": "#/components/schemas/GenerateImageV2AutoRequest" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateImageV2AutoRequest" - } - } - }, - "description": "A request to generate images with an automatically selected model. Send it as `application/json`, or as `multipart/form-data` to include source `images`.", - "required": true, - "x-body-name": "body" - }, "responses": { "200": { + "description": "Background replacement accepted for asynchronous processing.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageV2AutoResponse" + "$ref": "#/components/schemas/ReplaceBackgroundResponse" } } - }, - "description": "The generated images (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests)." + } }, "400": { - "description": "Invalid input provided." - }, + "description": "Invalid input provided.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } + }, "401": { - "description": "Unauthorized." + "description": "Unauthorized.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "402": { + "description": "Insufficient credits or quota.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Insufficient credits or quota." + } + }, + "403": { + "description": "Not authorized to replace backgrounds.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "404": { - "description": "A source image was not found." + "description": "The source image was not found or is not readable.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "422": { - "description": "The prompt did not pass safety checks, or the request combined source images with text-to-image-only fields." + "description": "The prompt did not pass safety checks.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "429": { + "description": "Too many requests.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Too many requests." - }, - "500": { - "description": "Internal server error." + } }, "503": { - "description": "The endpoint is temporarily unavailable." + "description": "Background replacement is temporarily unavailable.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } } }, - "summary": "Generate with automatic model selection", - "tags": [ - "auto-model" - ], - "x-tool-description": "Generate from text or edit supplied image assets with a server-selected model. Source images cannot be combined with negative_prompt or style_reference_asset_identifiers.", - "x-openapi-router-controller": "external_api.generated.openapi.controllers.auto_model_controller" + "requestBody": { + "description": "The source image and a prompt describing its new background.", + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "image": { + "type": "string", + "format": "binary", + "description": "The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and\nMPO are supported, up to 50 MB. Multipart requests only.\nThe longer side must be at most 3 times the shorter side; wider\naspect ratios are rejected with a 400.\n" + }, + "prompt": { + "type": "string", + "pattern": "\\S", + "minLength": 1, + "maxLength": 4000, + "description": "Plain-language description of the desired new background." + }, + "rendering_speed": { + "$ref": "#/components/schemas/V2ImageReplaceBackgroundIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed", + "default": "default", + "description": "The rendering speed to use." + }, + "num_images": { + "type": "integer", + "minimum": 1, + "maximum": 8, + "default": 1, + "description": "The number of images to generate." + }, + "private": { + "type": "boolean", + "description": "Whether to keep the result private. When omitted, defaults to your\nplan's setting. Enterprise generations are always private.\n" + }, + "webhook_url": { + "type": "string", + "format": "uri", + "maxLength": 2048, + "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n" + } + }, + "required": [ + "image", + "prompt" + ] + } + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + } + ] } }, - "/v2/image/generate/gpt-image-2": { + "/v2/image/replace-background/gpt-image-2": { "post": { - "description": "Generate images with GPT Image 2. Optionally upload source images as\n`images` using `multipart/form-data` to edit them with the prompt.\nReturns results directly by default; set `async` or supply a\n`webhook_url` to get a `generation_id` and poll\n`GET /v2/generations/{generation_id}`.\n", - "operationId": "post_generate_image_v2_gpt_image2", + "operationId": "tool_replaceBackground", + "summary": "Replace background with GPT Image 2", + "description": "Replace the background of an image from a text prompt while keeping the\nautomatically detected foreground subject; no mask is needed. Upload\nthe source `image` using `multipart/form-data`.\nReturns a `generation_id`; poll `GET /v2/generations/{generation_id}`\nor supply a `webhook_url`.\n", + "tags": [ + "tool" + ], "parameters": [ { - "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", - "in": "query", "name": "dry_run", + "in": "query", + "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", "required": false, "schema": { - "default": false, - "type": "boolean" - }, - "x-tool-description": "Validate and quote only; no generation, storage, billing, or safety review." + "type": "boolean", + "default": false + } } ], - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "image_asset_identifiers": { - "contentType": "application/json" - } - }, - "schema": { - "$ref": "#/components/schemas/GenerateImageGptImage2Request" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateImageGptImage2Request" - } - } - }, - "description": "A request to generate images with GPT Image 2. Send it as `application/json`, or as `multipart/form-data` to include source `images`.", - "required": true, - "x-body-name": "body" - }, "responses": { "200": { + "description": "Background replacement accepted for asynchronous processing.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageGptImage2Response" + "$ref": "#/components/schemas/ReplaceBackgroundResponse" } } - }, - "description": "The generated images (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests)." + } }, "400": { - "description": "Invalid input provided." + "description": "Invalid input provided.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "401": { - "description": "Unauthorized." + "description": "Unauthorized.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "402": { + "description": "Insufficient credits or quota.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Insufficient credits or quota." + } + }, + "403": { + "description": "Not authorized to replace backgrounds.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } + }, + "404": { + "description": "The source image was not found or is not readable.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "422": { - "description": "The prompt did not pass safety checks." + "description": "The prompt did not pass safety checks.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "429": { + "description": "Too many requests.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Too many requests." - }, - "500": { - "description": "Internal server error." + } }, "503": { - "description": "The endpoint is temporarily unavailable." + "description": "Background replacement is temporarily unavailable.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } } }, - "summary": "Generate with GPT Image 2", - "tags": [ - "images-generate" - ], - "x-tool-description": "Generate from text or edit supplied image assets with GPT Image 2. The prompt is used without rewriting.", - "x-openapi-router-controller": "external_api.generated.openapi.controllers.images_generate_controller" + "requestBody": { + "description": "The source image and a prompt describing its new background.", + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "image": { + "type": "string", + "format": "binary", + "description": "The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and\nMPO are supported, up to 50 MB. Multipart requests only.\n" + }, + "prompt": { + "type": "string", + "pattern": "\\S", + "minLength": 1, + "maxLength": 4000, + "description": "Plain-language description of the desired new background." + }, + "quality": { + "$ref": "#/components/schemas/ReplaceBackgroundQuality", + "default": "high", + "description": "The generation quality level. Defaults to `high`." + }, + "num_images": { + "type": "integer", + "minimum": 1, + "maximum": 8, + "default": 1, + "description": "The number of images to generate." + }, + "private": { + "type": "boolean", + "description": "Whether to keep the result private. When omitted, defaults to your\nplan's setting. Enterprise generations are always private.\n" + }, + "webhook_url": { + "type": "string", + "format": "uri", + "maxLength": 2048, + "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n" + } + }, + "required": [ + "image", + "prompt" + ] + } + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + } + ] } }, - "/v2/image/generate/gpt-image-2-5-flare": { + "/v2/image/remove-background/ideogram-1": { "post": { - "description": "Generate images with GPT Image 2.5 Flare, the fast variant of GPT Image\n2.5. Optionally upload source images as `images` using\n`multipart/form-data` to edit them with the prompt. Returns results\ndirectly by default; set `async` or supply a `webhook_url` to get a\n`generation_id` and poll `GET /v2/generations/{generation_id}`.\n", - "operationId": "post_generate_image_v2_gpt_image25_flare", + "operationId": "tool_removeBackground", + "summary": "Remove background", + "description": "Remove the background from an image and return the foreground as a\ntransparent PNG. Upload the source `image` using `multipart/form-data`.\nReturns the result directly by default; set `async` to get a\n`generation_id` and poll `GET /v2/generations/{generation_id}`.\n", + "tags": [ + "tool" + ], "parameters": [ { - "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", - "in": "query", "name": "dry_run", + "in": "query", + "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", "required": false, "schema": { - "default": false, - "type": "boolean" - }, - "x-tool-description": "Validate and quote only; no generation, storage, billing, or safety review." + "type": "boolean", + "default": false + } } ], - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "image_asset_identifiers": { - "contentType": "application/json" - }, - "mask_asset_identifier": { - "contentType": "application/json" - } - }, - "schema": { - "$ref": "#/components/schemas/GenerateImageGptImage25FlareRequest" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateImageGptImage25FlareRequest" - } - } - }, - "description": "A request to generate images with GPT Image 2.5 Flare. Send it as `application/json`, or as `multipart/form-data` to include source `images`.", - "required": true, - "x-body-name": "body" - }, "responses": { "200": { + "description": "The foreground image (synchronous requests), or an acknowledgement to poll (`async` requests). If a synchronous request fails after the response has started streaming, the HTTP status is already 200; the body contains `error` and `status_code` instead.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageGptImage25FlareResponse" + "$ref": "#/components/schemas/RemoveBackgroundV2Response" } } - }, - "description": "The generated images (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests)." + } }, "400": { - "description": "Invalid input provided." + "description": "Invalid input provided.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "401": { - "description": "Unauthorized." + "description": "Unauthorized.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "402": { + "description": "Insufficient credits or quota.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Insufficient credits or quota." + } }, - "422": { - "description": "The prompt did not pass safety checks." + "403": { + "description": "Not authorized to remove backgrounds.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } + }, + "404": { + "description": "The source image was not found or is not readable.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "429": { + "description": "Too many requests.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Too many requests." + } }, "500": { - "description": "Internal server error." + "description": "The background-removal request failed.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "503": { - "description": "The endpoint is temporarily unavailable." + "description": "Background removal is temporarily unavailable.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } } }, - "summary": "Generate with GPT Image 2.5 Flare", - "tags": [ - "images-generate" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.images_generate_controller" + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "image": { + "type": "string", + "format": "binary", + "description": "The source image. JPEG, PNG, or WebP, up to 25MB. Multipart requests only." + }, + "private": { + "type": "boolean", + "description": "Whether to keep the result out of the public gallery. When omitted,\ndefaults to your plan's setting, or public if your plan has none.\nEnterprise generations are always private.\n" + }, + "async": { + "type": "boolean", + "default": false, + "description": "When false (the default), wait for and return the foreground image. When true, return as soon as the request is accepted; poll `GET /v2/generations/{generation_id}` for the result." + } + }, + "required": [ + "image" + ] + } + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + } + ] } }, - "/v2/image/generate/gpt-image-2-5-sunburst": { + "/v2/image/remove-object/ideogram-1": { "post": { - "description": "Generate images with GPT Image 2.5 Sunburst, the quality variant of GPT\nImage 2.5, with finer detail at higher latency than Flare. Optionally\nupload source images as `images` using `multipart/form-data` to edit\nthem with the prompt. Returns results directly by default; set `async`\nor supply a `webhook_url` to get a `generation_id` and poll\n`GET /v2/generations/{generation_id}`.\n", - "operationId": "post_generate_image_v2_gpt_image25_sunburst", + "operationId": "objectRemoval_post_remove_object_from_v2_assets", + "summary": "Remove an object", + "description": "Remove a masked object from an image. Upload the source `image` and a\n`mask` of the same size using `multipart/form-data`. Returns a\n`generation_id`; poll `GET /v2/generations/{generation_id}` for the\nresult.\n", + "tags": [ + "object-removal" + ], "parameters": [ { - "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", - "in": "query", "name": "dry_run", + "in": "query", + "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", "required": false, "schema": { - "default": false, - "type": "boolean" - }, - "x-tool-description": "Validate and quote only; no generation, storage, billing, or safety review." + "type": "boolean", + "default": false + } } ], - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "image_asset_identifiers": { - "contentType": "application/json" - }, - "mask_asset_identifier": { - "contentType": "application/json" - } - }, - "schema": { - "$ref": "#/components/schemas/GenerateImageGptImage25SunburstRequest" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateImageGptImage25SunburstRequest" - } - } - }, - "description": "A request to generate images with GPT Image 2.5 Sunburst. Send it as `application/json`, or as `multipart/form-data` to include source `images`.", - "required": true, - "x-body-name": "body" - }, "responses": { "200": { + "description": "Object removal request accepted; poll for completion with `GET /v2/generations/{generation_id}`.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageGptImage25SunburstResponse" + "$ref": "#/components/schemas/RemoveObjectFromV2AssetsResponse" } } - }, - "description": "The generated images (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests)." + } }, "400": { - "description": "Invalid input provided." + "description": "Invalid input provided.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "401": { - "description": "Unauthorized." + "description": "Unauthorized.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "402": { + "description": "Insufficient credits or quota.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Insufficient credits or quota." + } }, - "422": { - "description": "The prompt did not pass safety checks." + "403": { + "description": "Not authorized to remove an object.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } + }, + "404": { + "description": "The source image or mask was not found.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } + }, + "413": { + "description": "An uploaded source or mask image is too large.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "429": { + "description": "Too many requests.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Too many requests." - }, - "500": { - "description": "Internal server error." + } }, "503": { - "description": "The endpoint is temporarily unavailable." + "description": "The endpoint is temporarily unavailable.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } } }, - "summary": "Generate with GPT Image 2.5 Sunburst", - "tags": [ - "images-generate" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.images_generate_controller" - } - }, - "/v2/image/generate/ideogram-2": { - "post": { - "description": "Generate images from a text prompt with Ideogram 2.0. Returns results\ndirectly by default; set `async` or supply a `webhook_url` to get a\n`generation_id` and poll `GET /v2/generations/{generation_id}`.\n", - "operationId": "post_generate_image_v2_ideogram_v2", - "parameters": [ - { - "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", - "in": "query", - "name": "dry_run", - "required": false, - "schema": { - "default": false, - "type": "boolean" - }, - "x-tool-description": "Validate and quote only; no generation, storage, billing, or safety review." - } - ], "requestBody": { + "description": "The source `image` and `mask`, uploaded using `multipart/form-data`.", "content": { - "application/json": { + "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/GenerateImageIdeogramV2Request" + "type": "object", + "properties": { + "image": { + "type": "string", + "format": "binary", + "description": "The source image to remove an object from. JPEG, PNG, or WEBP, up to 50MB. Multipart requests only." + }, + "mask": { + "type": "string", + "format": "binary", + "description": "A black-and-white mask the same size as the image; white (>= 128) marks the region to remove. JPEG, PNG, or WEBP, up to 50MB. Multipart requests only." + }, + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." + } + }, + "required": [ + "image", + "mask" + ] } } - }, - "description": "A request to generate images with Ideogram 2.0.", - "required": true, - "x-body-name": "generate_image_ideogram_v2_request" + } }, + "security": [ + { + "ApiKeyAuth": [] + } + ] + } + }, + "/v2/image/describe/ideogram-4": { + "post": { + "operationId": "imageDescribe_post_describe_image_ideogram_v4", + "summary": "Describe with Ideogram 4.0", + "description": "Describe an image as a structured `V4JsonPrompt` with Ideogram's 4.0\nimage captioner (a fine-tune of the Qwen3-VL vision-language model).\nUpload the image as `image` using `multipart/form-data`; the\n`json_prompt` is returned directly and can be passed to the\n`/v1/ideogram-v4/generate` endpoints.\n", + "tags": [ + "image-describe" + ], "responses": { "200": { + "description": "Structured prompt generated successfully.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageIdeogramV2Response" + "$ref": "#/components/schemas/DescribeImageIdeogramV4Response" } } - }, - "description": "The generated images (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests)." + } }, "400": { - "description": "Invalid input provided." + "description": "Invalid input provided.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "401": { - "description": "Unauthorized." + "description": "Unauthorized.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "402": { + "description": "Insufficient credits or quota.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Insufficient credits or quota." + } + }, + "404": { + "description": "The source image was not found.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "422": { - "description": "The prompt did not pass safety checks." + "description": "Image failed the safety check.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ImageSafetyError" + } + } + } }, "429": { + "description": "Too many requests.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Too many requests." + } }, "500": { - "description": "Internal server error." + "description": "Internal server error.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "503": { - "description": "The endpoint is temporarily unavailable." + "description": "The endpoint is temporarily unavailable.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } } }, - "summary": "Generate with Ideogram 2.0", - "tags": [ - "images-generate" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.images_generate_controller" - } - }, - "/v2/image/generate/ideogram-2a": { - "post": { - "description": "Generate images from a text prompt with Ideogram 2a, a fast, lower-cost\nmodel. Returns results directly by default; set `async` or supply a\n`webhook_url` to get a `generation_id` and poll\n`GET /v2/generations/{generation_id}`.\n", - "operationId": "post_generate_image_v2_ideogram_v2_a", - "parameters": [ - { - "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", - "in": "query", - "name": "dry_run", - "required": false, - "schema": { - "default": false, - "type": "boolean" - }, - "x-tool-description": "Validate and quote only; no generation, storage, billing, or safety review." - } - ], "requestBody": { + "description": "A request to describe one image. Send it as `multipart/form-data` with the `image` to describe.", "content": { - "application/json": { + "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/GenerateImageIdeogramV2ARequest" + "type": "object", + "properties": { + "image": { + "type": "string", + "format": "binary", + "description": "The image to describe (max 10MB). JPEG, PNG, and WebP are supported. Multipart requests only." + }, + "include_bbox": { + "type": "boolean", + "default": true, + "description": "Whether to include bounding boxes for the subjects and text in the returned `json_prompt`. Defaults to true, so the prompt preserves the layout of the described image." + }, + "include_style_descriptions": { + "type": "boolean", + "default": false, + "description": "Whether to include a free-form style description in the returned `json_prompt`. Defaults to false." + }, + "include_tags": { + "type": "boolean", + "default": false, + "description": "Whether to include free-form tags in the returned `json_prompt`. Defaults to false." + } + }, + "required": [ + "image" + ] } } - }, - "description": "A request to generate images with Ideogram 2a.", - "required": true, - "x-body-name": "generate_image_ideogram_v2_a_request" + } }, + "security": [ + { + "ApiKeyAuth": [] + } + ] + } + }, + "/v2/image/describe/ideogram-3": { + "post": { + "operationId": "imageDescribe_post_describe_image_ideogram_v3", + "summary": "Describe with Ideogram 3.0", + "description": "Generate a natural-language description of an image with Ideogram's 3.0\nimage captioner (a fine-tune of the Qwen2-VL vision-language model).\nUpload the image as `image` using `multipart/form-data`; the description\nis returned directly.\n", + "tags": [ + "image-describe" + ], "responses": { "200": { + "description": "Description(s) generated successfully.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageIdeogramV2AResponse" + "$ref": "#/components/schemas/DescribeImageIdeogramV3Response" } } - }, - "description": "The generated images (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests)." + } }, "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Unauthorized." - }, - "402": { + "description": "Invalid input provided.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" + "description": "Any type" } } - }, - "description": "Insufficient credits or quota." - }, - "422": { - "description": "The prompt did not pass safety checks." + } }, - "429": { + "401": { + "description": "Unauthorized.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" + "description": "Any type" } } - }, - "description": "Too many requests." + } }, - "500": { - "description": "Internal server error." - }, - "503": { - "description": "The endpoint is temporarily unavailable." - } - }, - "summary": "Generate with Ideogram 2a", - "tags": [ - "images-generate" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.images_generate_controller" - } - }, - "/v2/image/generate/ideogram-3": { - "post": { - "description": "Generate images from a text prompt with Ideogram 3.0. Optional style\ncontrols include style codes, a style preset, a color palette, and style\nreferences (uploaded `style_reference_images`). Returns\nresults directly by default; set `async` or supply a `webhook_url` to\nget a `generation_id` and poll `GET /v2/generations/{generation_id}`.", - "operationId": "post_generate_image_v2_ideogram_v3", - "parameters": [ - { - "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", - "in": "query", - "name": "dry_run", - "required": false, - "schema": { - "default": false, - "type": "boolean" - }, - "x-tool-description": "Validate and quote only; no generation, storage, billing, or safety review." - } - ], - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "color_palette": { - "contentType": "application/json" - }, - "style_reference_asset_identifiers": { - "contentType": "application/json" + "402": { + "description": "Insufficient credits or quota.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerationErrorResponse" } - }, - "schema": { - "$ref": "#/components/schemas/GenerateImageIdeogramV3Request" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateImageIdeogramV3Request" } } }, - "description": "A request to generate images with Ideogram 3.0. Send it as `application/json`, or as `multipart/form-data` to include `style_reference_images`.", - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { + "404": { + "description": "The source image was not found.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageIdeogramV3Response" + "description": "Any type" } } - }, - "description": "The generated images (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests)." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Unauthorized." + } }, - "402": { + "422": { + "description": "Image failed the safety check.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" + "$ref": "#/components/schemas/ImageSafetyError" } } - }, - "description": "Insufficient credits or quota." - }, - "404": { - "description": "A referenced resource was not found." - }, - "422": { - "description": "The prompt did not pass safety checks." + } }, "429": { + "description": "Too many requests.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Too many requests." + } }, "500": { - "description": "Internal server error." + "description": "Internal server error.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "503": { - "description": "The endpoint is temporarily unavailable." + "description": "The endpoint is temporarily unavailable.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } } }, - "summary": "Generate with Ideogram 3.0", - "tags": [ - "images-generate" - ], - "x-tool-description": "Generate from text with Ideogram 3.0. Use at most one style reference source: a saved collection or asset identifiers.", - "x-openapi-router-controller": "external_api.generated.openapi.controllers.images_generate_controller" + "requestBody": { + "description": "A request to describe one image. Send it as `multipart/form-data` with the `image` to describe.", + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "image": { + "type": "string", + "format": "binary", + "description": "The image to describe (max 10MB). JPEG, PNG, and WebP are supported. Multipart requests only." + } + }, + "required": [ + "image" + ] + } + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + } + ] } }, - "/v2/image/generate/ideogram-3-character": { + "/v2/design/layerize/ideogram-3": { "post": { - "description": "Generate images featuring a consistent character with Ideogram 3.0.\nUpload the character as `character_reference_images` using\n`multipart/form-data`. Returns\nresults directly by default; set `async` or supply a `webhook_url` to\nget a `generation_id` and poll `GET /v2/generations/{generation_id}`.\n", - "operationId": "post_generate_image_v2_ideogram_v3_character", + "operationId": "design_post_layerize_design_ideogram_v3", + "summary": "Layerize text with Ideogram 3.0", + "description": "Turn a flat image into an editable design: detected text is returned as\npositioned text blocks with matched fonts, sizes, and colors, alongside\na text-free base image. Upload the image as `image` using\n`multipart/form-data`. Returns results directly by default; set `async`\nor supply a `webhook_url` to get a `generation_id` and poll\n`GET /v2/generations/{generation_id}`.\n", + "tags": [ + "design" + ], "parameters": [ { - "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", - "in": "query", "name": "dry_run", + "in": "query", + "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", "required": false, "schema": { - "default": false, - "type": "boolean" - }, - "x-tool-description": "Validate and quote only; no generation, storage, billing, or safety review." + "type": "boolean", + "default": false + } } ], - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "character_reference_asset_identifiers": { - "contentType": "application/json" - }, - "character_reference_mask_asset_identifier": { - "contentType": "application/json" - }, - "style_reference_asset_identifiers": { - "contentType": "application/json" - } - }, - "schema": { - "$ref": "#/components/schemas/GenerateImageIdeogramV3CharacterRequest" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateImageIdeogramV3CharacterRequest" - } - } - }, - "description": "A request to generate images of a consistent character with Ideogram 3.0. Send it as `multipart/form-data` to upload `character_reference_images` and any `style_reference_images`.", - "required": true, - "x-body-name": "body" - }, "responses": { "200": { + "description": "The layerized design (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests).", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageIdeogramV3CharacterResponse" + "$ref": "#/components/schemas/LayerizeDesignIdeogramV3Response" } } - }, - "description": "The generated images (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests)." + } }, "400": { - "description": "Invalid input provided." + "description": "Invalid input provided.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "401": { - "description": "Unauthorized." + "description": "Unauthorized.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "402": { + "description": "Insufficient credits or quota.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Insufficient credits or quota." + } }, - "404": { - "description": "A referenced resource was not found." + "403": { + "description": "Not authorized to layerize images.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, - "422": { - "description": "The prompt did not pass safety checks." + "404": { + "description": "The source image was not found.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "429": { + "description": "Too many requests.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Too many requests." + } }, "500": { - "description": "Internal server error." + "description": "Internal server error.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "503": { - "description": "The endpoint is temporarily unavailable." + "description": "The endpoint is temporarily unavailable.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } } }, - "summary": "Generate a consistent character with Ideogram 3.0", - "tags": [ - "images-generate" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.images_generate_controller" + "requestBody": { + "description": "A request to layerize the text in one image. Send it as `multipart/form-data` with the source `image`.", + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "image": { + "type": "string", + "format": "binary", + "description": "The source image to layerize (max 50MB). Common image formats such as JPEG, PNG, and WEBP are supported. Multipart requests only." + }, + "prompt": { + "type": [ + "string", + "null" + ], + "maxLength": 10000, + "description": "A description of the image, used to guide text detection. When omitted, detection runs on the image alone." + }, + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." + }, + "font_candidate_files": { + "type": "array", + "items": { + "type": "string", + "format": "binary" + }, + "description": "Candidate font files to make available for text style matching. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB each, maximum 5 files). Multipart requests only." + }, + "async": { + "type": "boolean", + "default": false, + "description": "When false (the default), the request waits until layerization is complete and returns the result in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result." + }, + "webhook_url": { + "type": "string", + "format": "uri", + "maxLength": 2048, + "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n" + } + }, + "required": [ + "image" + ] + } + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + } + ] } }, - "/v2/image/generate/ideogram-3-custom-model": { + "/v2/video/generate/kling-3-standard-image-to-video": { "post": { - "description": "Generate images with a custom Ideogram 3.0 model that you or your\norganization can access, selected by `custom_model_uri`. Returns results\ndirectly by default; set `async` or supply a `webhook_url` to get a\n`generation_id` and poll `GET /v2/generations/{generation_id}`.\n", - "operationId": "post_generate_image_v2_ideogram_v3_custom_model", + "operationId": "videoGenerate_post_generate_video_kling_v3_standard_image_to_video", + "summary": "Image to video with Kling v3 Standard", + "description": "Generate a video from a first-frame image and a text prompt with Kling\nv3 Standard. Upload the first frame as `image`, and optionally a final\nframe as `end_image`, using `multipart/form-data`.\nReturns a `generation_id`; poll `GET /v2/generations/{generation_id}`\nor supply a `webhook_url`.\n", + "tags": [ + "video-generate" + ], "parameters": [ { - "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", - "in": "query", "name": "dry_run", + "in": "query", + "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", "required": false, "schema": { - "default": false, - "type": "boolean" - }, - "x-tool-description": "Validate and quote only; no generation, storage, billing, or safety review." + "type": "boolean", + "default": false + } } ], - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "color_palette": { - "contentType": "application/json" - }, - "style_reference_asset_identifiers": { - "contentType": "application/json" - } - }, - "schema": { - "$ref": "#/components/schemas/GenerateImageIdeogramV3CustomModelRequest" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateImageIdeogramV3CustomModelRequest" - } - } - }, - "description": "A request to generate images with an accessible custom Ideogram 3.0 model. Send it as `application/json`, or as `multipart/form-data` to include `style_reference_images`.", - "required": true, - "x-body-name": "body" - }, "responses": { "200": { + "description": "An acknowledgement to poll with `GET /v2/generations/{generation_id}`.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageIdeogramV3CustomModelResponse" + "$ref": "#/components/schemas/GenerateVideoKlingV3Response" } } - }, - "description": "The generated images (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests)." + } }, "400": { - "description": "Invalid input or an unsupported model option." + "description": "Invalid input provided.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "401": { - "description": "Unauthorized." + "description": "Unauthorized.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "402": { + "description": "Insufficient credits or quota.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Insufficient credits or quota." + } }, "403": { - "description": "The custom model does not exist or is not accessible to this user or organization." - }, - "404": { - "description": "A requested resource was not found." - }, - "422": { - "description": "The prompt did not pass safety checks." - }, - "429": { + "description": "This account does not have access to this model.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" + "description": "Any type" } } - }, - "description": "Too many requests." - }, - "500": { - "description": "Internal server error." - }, - "503": { - "description": "The endpoint is temporarily unavailable." - } - }, - "summary": "Generate with a custom Ideogram 3.0 model", - "tags": [ - "images-generate" - ], - "x-tool-description": "Generate with an accessible custom Ideogram 3.0 model. The model controls available rendering speeds. Set transparent_background to remove the background after generation.", - "x-openapi-router-controller": "external_api.generated.openapi.controllers.images_generate_controller" - } - }, - "/v2/image/generate/ideogram-3-transparent": { - "post": { - "description": "Generate images on a transparent background with Ideogram 3.0, delivered\nas PNGs with alpha. Returns results directly by default; set `async` or\nsupply a `webhook_url` to get a `generation_id` and poll\n`GET /v2/generations/{generation_id}`.\n", - "operationId": "post_generate_image_v2_ideogram_v3_transparent", - "parameters": [ - { - "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", - "in": "query", - "name": "dry_run", - "required": false, - "schema": { - "default": false, - "type": "boolean" - }, - "x-tool-description": "Validate and quote only; no generation, storage, billing, or safety review." - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateImageIdeogramV3TransparentRequest" - } } }, - "description": "A request to generate transparent-background images with Ideogram 3.0.", - "required": true, - "x-body-name": "generate_image_ideogram_v3_transparent_request" - }, - "responses": { - "200": { + "404": { + "description": "The first-frame image was not found.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageIdeogramV3TransparentResponse" + "description": "Any type" } } - }, - "description": "The generated images (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests)." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Unauthorized." + } }, - "402": { + "422": { + "description": "The prompt did not pass safety checks.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" + "description": "Any type" } } - }, - "description": "Insufficient credits or quota." - }, - "422": { - "description": "The prompt did not pass safety checks." + } }, "429": { + "description": "Too many requests.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Too many requests." + } }, "500": { - "description": "Internal server error." + "description": "Internal server error.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "503": { - "description": "The endpoint is temporarily unavailable." + "description": "The endpoint is temporarily unavailable.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } } }, - "summary": "Generate transparent images with Ideogram 3.0", - "tags": [ - "images-generate" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.images_generate_controller" + "requestBody": { + "description": "A request to generate a video from a first-frame image with Kling v3 Standard. Upload the first frame as `image` using `multipart/form-data`.", + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "image": { + "type": "string", + "format": "binary", + "description": "The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored." + }, + "end_image": { + "type": "string", + "format": "binary", + "description": "An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one." + }, + "prompt": { + "type": "string", + "minLength": 1, + "maxLength": 2000, + "description": "A natural-language prompt describing how the first frame should animate." + }, + "negative_prompt": { + "type": "string", + "maxLength": 2000, + "description": "Description of what to keep out of the video. Descriptions in the prompt take precedence over descriptions in the negative prompt." + }, + "duration": { + "type": "integer", + "minimum": 3, + "maximum": 15, + "description": "The length of the generated video in seconds. Defaults to 5 seconds\nwhen omitted.\n" + }, + "generate_audio": { + "type": "boolean", + "default": false, + "description": "Whether to generate an audio track for the video. Audio roughly\ndoubles the provider cost and is subject to stricter output moderation.\n" + }, + "shot_type": { + "$ref": "#/components/schemas/KlingV3ShotType", + "default": "customize" + }, + "cfg_scale": { + "type": "string", + "title": "float", + "description": "How closely the video follows the prompt, from 0 to 1. Lower values\nleave the model more freedom. Defaults to 0.5 when omitted.\n" + }, + "webhook_url": { + "type": "string", + "format": "uri", + "maxLength": 2048, + "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n" + } + }, + "required": [ + "image", + "prompt" + ] + } + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + } + ] } }, - "/v2/image/generate/ideogram-4": { + "/v2/video/generate/kling-3-standard-text-to-video": { "post": { - "description": "Generate images with Ideogram 4.0 from a natural-language or structured\nJSON prompt. Returns results directly by default; set `async` or supply\na `webhook_url` to get a `generation_id` and poll\n`GET /v2/generations/{generation_id}`.\n", - "operationId": "post_generate_image_v2_ideogram_v4", + "operationId": "videoGenerate_post_generate_video_kling_v3_standard_text_to_video", + "summary": "Text to video with Kling v3 Standard", + "description": "Generate a video from a text prompt with Kling v3 Standard.\nReturns a `generation_id`; poll `GET /v2/generations/{generation_id}`\nor supply a `webhook_url`.\n", + "tags": [ + "video-generate" + ], "parameters": [ { - "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", - "in": "query", "name": "dry_run", + "in": "query", + "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", "required": false, "schema": { - "default": false, - "type": "boolean" - }, - "x-tool-description": "Validate and quote only; no generation, storage, billing, or safety review." + "type": "boolean", + "default": false + } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateImageIdeogramV4Request" - } - } - }, - "description": "A request to generate images with Ideogram 4.0.", - "required": true, - "x-body-name": "generate_image_ideogram_v4_request" - }, "responses": { "200": { + "description": "An acknowledgement to poll with `GET /v2/generations/{generation_id}`.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageIdeogramV4Response" + "$ref": "#/components/schemas/GenerateVideoKlingV3Response" } } - }, - "description": "The generated images (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests)." + } }, "400": { - "description": "Invalid input provided." + "description": "Invalid input provided.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "401": { - "description": "Unauthorized." + "description": "Unauthorized.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "402": { + "description": "Insufficient credits or quota.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Insufficient credits or quota." + } + }, + "403": { + "description": "This account does not have access to this model.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "422": { - "description": "The prompt did not pass safety checks." + "description": "The prompt did not pass safety checks.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "429": { + "description": "Too many requests.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Too many requests." + } }, "500": { - "description": "Internal server error." + "description": "Internal server error.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "503": { - "description": "The endpoint is temporarily unavailable." + "description": "The endpoint is temporarily unavailable.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } } }, - "summary": "Generate with Ideogram 4.0", - "tags": [ - "images-generate" - ], - "x-playground-endpoint": { - "id": "generate-v4", - "label": "Generate 4.0", - "order": 1 + "requestBody": { + "description": "A request to generate a video from a text prompt with Kling v3 Standard.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerateVideoKlingV3StandardTextToVideoRequest" + } + } + } }, - "x-tool-description": "Generate with Ideogram 4.0 from natural language or a structured JSON prompt. Omit resolution to let the prompt determine the shape.", - "x-openapi-router-controller": "external_api.generated.openapi.controllers.images_generate_controller" + "security": [ + { + "ApiKeyAuth": [] + } + ] } }, - "/v2/image/generate/ideogram-4-5": { + "/v2/video/generate/minimax-h3-image-to-video": { "post": { - "description": "Generate images with Ideogram 4.5 from a natural-language or structured\nJSON prompt. Optionally upload source images as `images` using\n`multipart/form-data` to edit them with the prompt. Returns results\ndirectly by default; set `async` or supply a `webhook_url` to get a\n`generation_id` and poll `GET /v2/generations/{generation_id}`.\n", - "operationId": "post_generate_image_v2_ideogram45", + "operationId": "videoGenerate_post_generate_video_minimax_h3_image_to_video", + "summary": "Image to video with MiniMax H3", + "description": "Generate a video from a first-frame image and a text prompt with\nMiniMax H3. Upload the first frame as `image`, and optionally a final\nframe as `end_image`, using `multipart/form-data`.\nReturns a `generation_id`; poll `GET /v2/generations/{generation_id}`\nor supply a `webhook_url`.\n", + "tags": [ + "video-generate" + ], "parameters": [ { - "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", - "in": "query", "name": "dry_run", + "in": "query", + "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", "required": false, "schema": { - "default": false, - "type": "boolean" - }, - "x-tool-description": "Validate and quote only; no generation, storage, billing, or safety review." + "type": "boolean", + "default": false + } } ], - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "image_asset_identifiers": { - "contentType": "application/json" - }, - "mask_asset_identifier": { - "contentType": "application/json" - } - }, - "schema": { - "$ref": "#/components/schemas/GenerateImageIdeogram45Request" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateImageIdeogram45Request" - } - } - }, - "description": "A request to generate images with Ideogram 4.5. Send it as `application/json`, or as `multipart/form-data` to include source `images`.", - "required": true, - "x-body-name": "body" - }, "responses": { "200": { + "description": "An acknowledgement to poll with `GET /v2/generations/{generation_id}`.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageIdeogram45Response" + "$ref": "#/components/schemas/GenerateVideoMinimaxH3Response" } } - }, - "description": "The generated images (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests)." + } }, "400": { - "description": "Invalid input provided." + "description": "Invalid input provided.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "401": { - "description": "Unauthorized." + "description": "Unauthorized.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "402": { + "description": "Insufficient credits or quota.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Insufficient credits or quota." + } + }, + "403": { + "description": "This account does not have access to this model.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } + }, + "404": { + "description": "The first-frame image was not found.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "422": { - "description": "The prompt did not pass safety checks." + "description": "The prompt did not pass safety checks.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "429": { + "description": "Too many requests.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Too many requests." + } }, "500": { - "description": "Internal server error." - }, + "description": "Internal server error.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } + }, "503": { - "description": "The endpoint is temporarily unavailable." + "description": "The endpoint is temporarily unavailable.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } } }, - "summary": "Generate with Ideogram 4.5", - "tags": [ - "images-generate" - ], - "x-tool-description": "Generate from text, or edit and recompose supplied image assets with Ideogram 4.5, optionally guided by reference images.", - "x-playground-endpoint": { - "id": "generate-v45", - "label": "Generate 4.5", - "order": 1, - "feature_flag": "access_to_v45" + "requestBody": { + "description": "A request to generate a video from a first-frame image with MiniMax H3. Upload the first frame as `image` using `multipart/form-data`.", + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "image": { + "type": "string", + "format": "binary", + "description": "The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored." + }, + "end_image": { + "type": "string", + "format": "binary", + "description": "An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one." + }, + "prompt": { + "type": "string", + "minLength": 1, + "maxLength": 2000, + "description": "A natural-language prompt describing how the first frame should animate." + }, + "resolution": { + "$ref": "#/components/schemas/MinimaxH3Resolution", + "default": "2K" + }, + "duration": { + "type": "integer", + "minimum": 5, + "maximum": 15, + "default": 5, + "description": "The length of the generated video in seconds." + }, + "webhook_url": { + "type": "string", + "format": "uri", + "maxLength": 2048, + "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n" + } + }, + "required": [ + "image", + "prompt" + ] + } + } + } }, - "x-openapi-router-controller": "external_api.generated.openapi.controllers.images_generate_controller" + "security": [ + { + "ApiKeyAuth": [] + } + ] } }, - "/v2/image/generate/ideogram-4-custom-model": { + "/v2/video/generate/minimax-h3-reference-to-video": { "post": { - "description": "Generate images with a custom Ideogram 4.0 model that you or your\norganization can access, selected by `custom_model_uri`. Returns results\ndirectly by default; set `async` or supply a `webhook_url` to get a\n`generation_id` and poll `GET /v2/generations/{generation_id}`.\n", - "operationId": "post_generate_image_v2_ideogram_v4_custom_model", + "operationId": "videoEdit_post_edit_video_minimax_h3_reference_to_video", + "summary": "Reference to video with MiniMax H3", + "description": "Produce a video from a text prompt and optional reference media with\nMiniMax H3. Upload `reference_images` and `reference_audios` using\n`multipart/form-data`, and address them in the prompt by position\n(`Image 1`, `Audio 1`, …). Returns a `generation_id`; poll\n`GET /v2/generations/{generation_id}` or supply a `webhook_url`.\n", + "tags": [ + "video-edit" + ], "parameters": [ { - "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", - "in": "query", "name": "dry_run", + "in": "query", + "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", "required": false, "schema": { - "default": false, - "type": "boolean" - }, - "x-tool-description": "Validate and quote only; no generation, storage, billing, or safety review." + "type": "boolean", + "default": false + } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateImageIdeogramV4CustomModelRequest" - } - } - }, - "description": "A request to generate images with an accessible custom Ideogram 4.0 model.", - "required": true, - "x-body-name": "generate_image_ideogram_v4_custom_model_request" - }, "responses": { "200": { + "description": "An acknowledgement to poll with `GET /v2/generations/{generation_id}`.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageIdeogramV4CustomModelResponse" + "$ref": "#/components/schemas/GenerateVideoMinimaxH3Response" } } - }, - "description": "The generated images (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests)." + } }, "400": { - "description": "Invalid input or an unsupported model option." + "description": "Invalid input provided.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "401": { - "description": "Unauthorized." + "description": "Unauthorized.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "402": { + "description": "Insufficient credits or quota.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Insufficient credits or quota." + } }, "403": { - "description": "The custom model does not exist or is not accessible to this user or organization." - }, - "422": { - "description": "The prompt did not pass safety checks." - }, - "429": { + "description": "This account does not have access to this model.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" + "description": "Any type" } } - }, - "description": "Too many requests." - }, - "500": { - "description": "Internal server error." - }, - "503": { - "description": "The endpoint is temporarily unavailable." - } - }, - "summary": "Generate with a custom Ideogram 4.0 model", - "tags": [ - "images-generate" - ], - "x-tool-description": "Generate with an accessible custom Ideogram 4.0 model from natural language or a structured JSON prompt.", - "x-openapi-router-controller": "external_api.generated.openapi.controllers.images_generate_controller" - } - }, - "/v2/image/generate/ideogram-4-transparent": { - "post": { - "description": "Generate images on a transparent background with Ideogram 4.0, delivered\nas PNGs with alpha. Returns results directly by default; set `async` or\nsupply a `webhook_url` to get a `generation_id` and poll\n`GET /v2/generations/{generation_id}`.\n", - "operationId": "post_generate_image_v2_ideogram_v4_transparent", - "parameters": [ - { - "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", - "in": "query", - "name": "dry_run", - "required": false, - "schema": { - "default": false, - "type": "boolean" - }, - "x-tool-description": "Validate and quote only; no generation, storage, billing, or safety review." - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateImageIdeogramV4TransparentRequest" - } } }, - "description": "A request to generate transparent-background images with Ideogram 4.0.", - "required": true, - "x-body-name": "generate_image_ideogram_v4_transparent_request" - }, - "responses": { - "200": { + "404": { + "description": "A referenced asset was not found.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageIdeogramV4TransparentResponse" + "description": "Any type" } } - }, - "description": "The generated images (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests)." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Unauthorized." + } }, - "402": { + "422": { + "description": "The prompt did not pass safety checks.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" + "description": "Any type" } } - }, - "description": "Insufficient credits or quota." - }, - "422": { - "description": "The prompt did not pass safety checks." + } }, "429": { + "description": "Too many requests.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Too many requests." + } }, "500": { - "description": "Internal server error." + "description": "Internal server error.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "503": { - "description": "The endpoint is temporarily unavailable." + "description": "The endpoint is temporarily unavailable.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } } }, - "summary": "Generate transparent images with Ideogram 4.0", - "tags": [ - "images-generate" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.images_generate_controller" + "requestBody": { + "description": "A request to produce a video from reference media with MiniMax H3. Use `multipart/form-data` to upload reference media.", + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "prompt": { + "type": "string", + "minLength": 1, + "maxLength": 2000, + "description": "A natural-language prompt describing the video to produce. Reference media is addressed by position, as in \"Image 1 walks toward the camera with the motion of Video 1\"." + }, + "reference_images": { + "type": "array", + "items": { + "type": "string", + "format": "binary" + }, + "description": "Images to use as references (max size 50MB each), as raw bytes, in prompt order; only common image formats such as JPEG, PNG, and WEBP are supported. Uploaded images are used for this request only and are not stored." + }, + "reference_audios": { + "type": "array", + "items": { + "type": "string", + "format": "binary" + }, + "description": "MP3 or WAV audio references, in prompt order as Audio 1, Audio 2, and Audio 3. Multipart uploads only; up to 15 MB per file and 2–15 seconds each. Audio and video references must total no more than 15 seconds. Requires a reference image or video. At most 12 references across images, videos, and audio. Used only for this request and not saved as assets." + }, + "aspect_ratio": { + "$ref": "#/components/schemas/MinimaxH3AspectRatio", + "default": "16x9" + }, + "resolution": { + "$ref": "#/components/schemas/MinimaxH3Resolution", + "default": "2K" + }, + "duration": { + "type": "integer", + "minimum": 5, + "maximum": 15, + "default": 5, + "description": "The length of the generated video in seconds." + }, + "prompt_expansion_mode": { + "$ref": "#/components/schemas/MinimaxH3PromptExpansionMode", + "default": "balanced" + }, + "webhook_url": { + "type": "string", + "format": "uri", + "maxLength": 2048, + "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n" + } + }, + "required": [ + "prompt" + ] + } + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + } + ] } }, - "/v2/image/generate/nano-banana-2": { + "/v2/video/generate/minimax-h3-text-to-video": { "post": { - "description": "Generate images with Nano Banana 2. Optionally upload source images as\n`images` using `multipart/form-data` to edit them with the prompt.\nReturns results directly by default; set `async` or supply a\n`webhook_url` to get a `generation_id` and poll\n`GET /v2/generations/{generation_id}`.\n", - "operationId": "post_generate_image_v2_nano_banana2", + "operationId": "videoGenerate_post_generate_video_minimax_h3_text_to_video", + "summary": "Text to video with MiniMax H3", + "description": "Generate a video from a text prompt with MiniMax H3.\nReturns a `generation_id`; poll `GET /v2/generations/{generation_id}`\nor supply a `webhook_url`.\n", + "tags": [ + "video-generate" + ], "parameters": [ { - "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", - "in": "query", "name": "dry_run", + "in": "query", + "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", "required": false, "schema": { - "default": false, - "type": "boolean" - }, - "x-tool-description": "Validate and quote only; no generation, storage, billing, or safety review." + "type": "boolean", + "default": false + } } ], - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "image_asset_identifiers": { - "contentType": "application/json" - } - }, - "schema": { - "$ref": "#/components/schemas/GenerateImageNanoBanana2Request" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateImageNanoBanana2Request" - } - } - }, - "description": "A request to generate images with Nano Banana 2. Send it as `application/json`, or as `multipart/form-data` to include source `images`.", - "required": true, - "x-body-name": "body" - }, "responses": { "200": { + "description": "An acknowledgement to poll with `GET /v2/generations/{generation_id}`.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageNanoBanana2Response" + "$ref": "#/components/schemas/GenerateVideoMinimaxH3Response" } } - }, - "description": "The generated images (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests)." + } }, "400": { - "description": "Invalid input provided." + "description": "Invalid input provided.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "401": { - "description": "Unauthorized." + "description": "Unauthorized.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "402": { + "description": "Insufficient credits or quota.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Insufficient credits or quota." + } + }, + "403": { + "description": "This account does not have access to this model.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "422": { - "description": "The prompt did not pass safety checks." + "description": "The prompt did not pass safety checks.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "429": { + "description": "Too many requests.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Too many requests." + } }, "500": { - "description": "Internal server error." + "description": "Internal server error.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "503": { - "description": "The endpoint is temporarily unavailable." + "description": "The endpoint is temporarily unavailable.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } } }, - "summary": "Generate with Nano Banana 2", - "tags": [ - "images-generate" - ], - "x-tool-description": "Generate from text or edit supplied image assets with Nano Banana 2. The prompt is used without rewriting.", - "x-openapi-router-controller": "external_api.generated.openapi.controllers.images_generate_controller" + "requestBody": { + "description": "A request to generate a video from a text prompt with MiniMax H3.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerateVideoMinimaxH3TextToVideoRequest" + } + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + } + ] } }, - "/v2/image/generate/nano-banana-2-1": { + "/v2/video/generate/seedance-2-5-image-to-video": { "post": { - "description": "Generate images with Nano Banana 2.1. Optionally upload source images as\n`images` using `multipart/form-data` to edit them with the prompt.\nReturns results directly by default; set `async` or supply a\n`webhook_url` to get a `generation_id` and poll\n`GET /v2/generations/{generation_id}`.\n", - "operationId": "post_generate_image_v2_nano_banana21", + "operationId": "videoGenerate_post_generate_video_seed_dance25_image_to_video", + "summary": "Image to video with Seedance 2.5", + "description": "Generate a video from a first-frame image and a text prompt with\nSeedance 2.5. Upload the first frame as `image`, and optionally a final\nframe as `end_image`, using `multipart/form-data`.\nReturns a `generation_id`; poll `GET /v2/generations/{generation_id}`\nor supply a `webhook_url`.\n", + "tags": [ + "video-generate" + ], "parameters": [ { - "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", - "in": "query", "name": "dry_run", + "in": "query", + "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", "required": false, "schema": { - "default": false, - "type": "boolean" - }, - "x-tool-description": "Validate and quote only; no generation, storage, billing, or safety review." + "type": "boolean", + "default": false + } } ], - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "image_asset_identifiers": { - "contentType": "application/json" - } - }, - "schema": { - "$ref": "#/components/schemas/GenerateImageNanoBanana21Request" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateImageNanoBanana21Request" - } - } - }, - "description": "A request to generate images with Nano Banana 2.1. Send it as `application/json`, or as `multipart/form-data` to include source `images`.", - "required": true, - "x-body-name": "body" - }, "responses": { "200": { + "description": "An acknowledgement to poll with `GET /v2/generations/{generation_id}`.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageNanoBanana21Response" + "$ref": "#/components/schemas/GenerateVideoSeedDance25Response" } } - }, - "description": "The generated images (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests)." + } }, "400": { - "description": "Invalid input provided." + "description": "Invalid input provided.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "401": { - "description": "Unauthorized." - }, - "402": { + "description": "Unauthorized.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" + "description": "Any type" } } - }, - "description": "Insufficient credits or quota." - }, - "422": { - "description": "The prompt did not pass safety checks." + } }, - "429": { + "402": { + "description": "Insufficient credits or quota.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Too many requests." - }, - "500": { - "description": "Internal server error." + } }, - "503": { - "description": "The endpoint is temporarily unavailable." - } - }, - "summary": "Generate with Nano Banana 2.1", - "tags": [ - "images-generate" - ], - "x-tool-description": "Generate from text or edit supplied image assets with Nano Banana 2.1. The prompt is used without rewriting.", - "x-openapi-router-controller": "external_api.generated.openapi.controllers.images_generate_controller" - } - }, - "/v2/image/generate/nano-banana-pro": { - "post": { - "description": "Generate images with Nano Banana Pro. Optionally upload source images as\n`images` using `multipart/form-data` to edit them with the prompt.\nReturns results directly by default; set `async` or supply a\n`webhook_url` to get a `generation_id` and poll\n`GET /v2/generations/{generation_id}`.\n", - "operationId": "post_generate_image_v2_nano_banana_pro", - "parameters": [ - { - "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", - "in": "query", - "name": "dry_run", - "required": false, - "schema": { - "default": false, - "type": "boolean" - }, - "x-tool-description": "Validate and quote only; no generation, storage, billing, or safety review." - } - ], - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "image_asset_identifiers": { - "contentType": "application/json" + "403": { + "description": "This account does not have access to this model.", + "content": { + "application/json": { + "schema": { + "description": "Any type" } - }, - "schema": { - "$ref": "#/components/schemas/GenerateImageNanoBananaProRequest" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateImageNanoBananaProRequest" } } }, - "description": "A request to generate images with Nano Banana Pro. Send it as `application/json`, or as `multipart/form-data` to include source `images`.", - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { + "404": { + "description": "The first-frame image was not found.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageNanoBananaProResponse" + "description": "Any type" } } - }, - "description": "The generated images (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests)." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Unauthorized." + } }, - "402": { + "422": { + "description": "The prompt did not pass safety checks.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" + "description": "Any type" } } - }, - "description": "Insufficient credits or quota." - }, - "422": { - "description": "The prompt did not pass safety checks." + } }, "429": { + "description": "Too many requests.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Too many requests." + } }, "500": { - "description": "Internal server error." + "description": "Internal server error.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "503": { - "description": "The endpoint is temporarily unavailable." + "description": "The endpoint is temporarily unavailable.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } } }, - "summary": "Generate with Nano Banana Pro", - "tags": [ - "images-generate" - ], - "x-tool-description": "Generate from text or edit supplied image assets with Nano Banana Pro. The prompt is used without rewriting.", - "x-openapi-router-controller": "external_api.generated.openapi.controllers.images_generate_controller" + "requestBody": { + "description": "A request to generate a video from a first-frame image with Seedance 2.5. Upload the first frame as `image` using `multipart/form-data`.", + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "image": { + "type": "string", + "format": "binary", + "description": "The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored." + }, + "end_image": { + "type": "string", + "format": "binary", + "description": "An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one." + }, + "prompt": { + "type": "string", + "minLength": 1, + "maxLength": 2000, + "description": "A natural-language prompt describing how the first frame should animate." + }, + "resolution": { + "$ref": "#/components/schemas/SeedDance25Resolution", + "default": "720p" + }, + "duration": { + "type": "integer", + "minimum": 4, + "maximum": 30, + "description": "The length of the generated video in seconds. When omitted, the model\npicks the best duration for the prompt (\"auto\").\n" + }, + "generate_audio": { + "type": "boolean", + "default": false, + "description": "Whether to generate an audio track for the video. Audio roughly\ndoubles the provider cost and is subject to stricter output moderation.\n" + }, + "webhook_url": { + "type": "string", + "format": "uri", + "maxLength": 2048, + "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n" + } + }, + "required": [ + "image", + "prompt" + ] + } + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + } + ] } }, - "/v2/image/generate/p-image-ideogram": { + "/v2/video/generate/seedance-2-5-reference-to-video": { "post": { - "description": "Generate images with P-Image Ideogram, a fast model with selectable\nquality and resolution tiers. Returns results directly by default; set\n`async` or supply a `webhook_url` to get a `generation_id` and poll\n`GET /v2/generations/{generation_id}`.\n", - "operationId": "post_generate_image_v2_p_image_ideogram", + "operationId": "videoGenerate_post_generate_video_seed_dance25_reference_to_video", + "summary": "Reference to video with Seedance 2.5", + "description": "Generate a video from a text prompt and reference media with\nSeedance 2.5. Upload at least one image in `reference_images`, plus optional\n`reference_audios`, using `multipart/form-data`.\nReturns a `generation_id`; poll `GET /v2/generations/{generation_id}`\nor supply a `webhook_url`.\n", + "tags": [ + "video-generate" + ], "parameters": [ { - "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", - "in": "query", "name": "dry_run", + "in": "query", + "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", "required": false, "schema": { - "default": false, - "type": "boolean" - }, - "x-tool-description": "Validate and quote only; no generation, storage, billing, or safety review." + "type": "boolean", + "default": false + } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateImagePImageIdeogramRequest" - } - } - }, - "description": "A request to generate images with P-Image Ideogram.", - "required": true, - "x-body-name": "generate_image_p_image_ideogram_request" - }, "responses": { "200": { + "description": "An acknowledgement to poll with `GET /v2/generations/{generation_id}`.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImagePImageIdeogramResponse" + "$ref": "#/components/schemas/GenerateVideoSeedDance25Response" } } - }, - "description": "The generated images (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests)." + } }, "400": { - "description": "Invalid input provided." + "description": "Invalid input provided.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "401": { - "description": "Unauthorized." - }, - "402": { + "description": "Unauthorized.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" + "description": "Any type" } } - }, - "description": "Insufficient credits or quota." - }, - "422": { - "description": "The prompt did not pass safety checks." + } }, - "429": { + "402": { + "description": "Insufficient credits or quota.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Too many requests." - }, - "500": { - "description": "Internal server error." - }, - "503": { - "description": "The endpoint is temporarily unavailable." - } - }, - "summary": "Generate with P-Image Ideogram", - "tags": [ - "images-generate" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.images_generate_controller" - } - }, - "/v2/image/generate/z-image": { - "post": { - "description": "Generate images from a text prompt with Z-Image. Returns results\ndirectly by default; set `async` or supply a `webhook_url` to get a\n`generation_id` and poll `GET /v2/generations/{generation_id}`.\n", - "operationId": "post_generate_image_v2_z_image", - "parameters": [ - { - "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", - "in": "query", - "name": "dry_run", - "required": false, - "schema": { - "default": false, - "type": "boolean" - }, - "x-tool-description": "Validate and quote only; no generation, storage, billing, or safety review." - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateImageZImageRequest" - } } }, - "description": "A request to generate images with Z-Image.", - "required": true, - "x-body-name": "generate_image_z_image_request" - }, - "responses": { - "200": { + "403": { + "description": "This account does not have access to this model.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateImageZImageResponse" + "description": "Any type" } } - }, - "description": "The generated images (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests)." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Unauthorized." + } }, - "402": { + "404": { + "description": "A reference was not found.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" + "description": "Any type" } } - }, - "description": "Insufficient credits or quota." + } }, "422": { - "description": "The prompt did not pass safety checks." + "description": "The prompt did not pass safety checks.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "429": { + "description": "Too many requests.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Too many requests." + } }, "500": { - "description": "Internal server error." + "description": "Internal server error.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "503": { - "description": "The endpoint is temporarily unavailable." + "description": "The endpoint is temporarily unavailable.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } } }, - "summary": "Generate with Z-Image", - "tags": [ - "images-generate" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.images_generate_controller" + "requestBody": { + "description": "A request to produce a video from reference media with Seedance 2.5. Upload the references using `multipart/form-data`.", + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "prompt": { + "type": "string", + "minLength": 1, + "maxLength": 2000, + "description": "A natural-language prompt describing the video to produce. Refer to references by position, as in \"[Image1] walks toward the camera\"." + }, + "reference_images": { + "type": "array", + "items": { + "type": "string", + "format": "binary" + }, + "description": "Reference images, in prompt order. Common formats such as JPEG, PNG, and WEBP are supported, up to 50MB each. Multipart requests only. Uploaded images are used for this request only and are not stored." + }, + "reference_audios": { + "type": "array", + "items": { + "type": "string", + "format": "binary" + }, + "description": "MP3 or WAV audio references, in prompt order. Multipart requests only. Each file must be at most 15 MB and between 2 and 30 seconds long, with a combined duration of at most 30 seconds. Requires at least one reference image. Audio is used for this request only and is not saved to your library." + }, + "aspect_ratio": { + "$ref": "#/components/schemas/SeedDance2AspectRatio", + "default": "auto" + }, + "resolution": { + "$ref": "#/components/schemas/SeedDance25Resolution", + "default": "720p" + }, + "duration": { + "type": "integer", + "minimum": 4, + "maximum": 30, + "description": "The length of the generated video in seconds. When omitted, the model\npicks the best duration for the prompt (\"auto\").\n" + }, + "generate_audio": { + "type": "boolean", + "default": false, + "description": "Whether to generate an audio track for the video. Audio roughly\ndoubles the provider cost and is subject to stricter output moderation.\n" + }, + "webhook_url": { + "type": "string", + "format": "uri", + "maxLength": 2048, + "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n" + } + }, + "required": [ + "prompt" + ] + } + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + } + ] } }, - "/v2/image/inpaint/ideogram-3": { + "/v2/video/generate/seedance-2-5-text-to-video": { "post": { - "description": "Repaint the masked region of a source image with Ideogram 3.0, guided\nby a text prompt. Upload the source `image` and its `mask` using\n`multipart/form-data`.\nReturns results directly by default; set `async` or supply a\n`webhook_url` to get a `generation_id` and poll\n`GET /v2/generations/{generation_id}`.", - "operationId": "post_inpaint_image_v2_ideogram_v3", + "operationId": "videoGenerate_post_generate_video_seed_dance25_text_to_video", + "summary": "Text to video with Seedance 2.5", + "description": "Generate a video from a text prompt with Seedance 2.5, at up to 1080p and\n30 seconds. Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`\nor supply a `webhook_url`.\n", + "tags": [ + "video-generate" + ], "parameters": [ { - "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", - "in": "query", "name": "dry_run", + "in": "query", + "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", "required": false, "schema": { - "default": false, - "type": "boolean" - }, - "x-tool-description": "Validate and quote only; no generation, storage, billing, or safety review." + "type": "boolean", + "default": false + } } ], - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "image_asset_identifier": { - "contentType": "application/json" - }, - "mask_asset_identifier": { - "contentType": "application/json" - }, - "style_reference_asset_identifiers": { - "contentType": "application/json" - } - }, - "schema": { - "$ref": "#/components/schemas/InpaintImageIdeogramV3Request" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/InpaintImageIdeogramV3Request" - } - } - }, - "description": "Use `multipart/form-data` to upload the source `image`, its `mask`, and any `style_reference_images`.", - "required": true, - "x-body-name": "body" - }, "responses": { "200": { + "description": "An acknowledgement to poll with `GET /v2/generations/{generation_id}`.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/InpaintImageIdeogramV3Response" + "$ref": "#/components/schemas/GenerateVideoSeedDance25Response" } } - }, - "description": "The repainted images (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests)." + } }, "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Unauthorized." - }, - "402": { + "description": "Invalid input provided.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" + "description": "Any type" } } - }, - "description": "Insufficient credits or quota." - }, - "404": { - "description": "A referenced resource was not found." - }, - "422": { - "description": "The prompt did not pass safety checks." + } }, - "429": { + "401": { + "description": "Unauthorized.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" + "description": "Any type" } } - }, - "description": "Too many requests." - }, - "500": { - "description": "Internal server error." + } }, - "503": { - "description": "The endpoint is temporarily unavailable." - } - }, - "summary": "Inpaint with Ideogram 3.0", - "tags": [ - "images-inpaint" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.images_inpaint_controller" - } - }, - "/v2/image/inpaint/ideogram-3-character": { - "post": { - "description": "Repaint the masked region of a source image with Ideogram 3.0 so it\nfeatures a consistent character. Upload the source `image`, its\n`mask`, and a `character_reference_images` image (or use a saved\ncharacter) using `multipart/form-data`.\nReturns results directly by default; set `async` or supply a\n`webhook_url` to get a `generation_id` and poll\n`GET /v2/generations/{generation_id}`.", - "operationId": "post_inpaint_image_v2_ideogram_v3_character", - "parameters": [ - { - "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", - "in": "query", - "name": "dry_run", - "required": false, - "schema": { - "default": false, - "type": "boolean" - }, - "x-tool-description": "Validate and quote only; no generation, storage, billing, or safety review." - } - ], - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "image_asset_identifier": { - "contentType": "application/json" - }, - "mask_asset_identifier": { - "contentType": "application/json" - }, - "character_reference_asset_identifiers": { - "contentType": "application/json" - }, - "character_reference_mask_asset_identifier": { - "contentType": "application/json" - }, - "style_reference_asset_identifiers": { - "contentType": "application/json" + "402": { + "description": "Insufficient credits or quota.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerationErrorResponse" } - }, - "schema": { - "$ref": "#/components/schemas/InpaintImageIdeogramV3CharacterRequest" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/InpaintImageIdeogramV3CharacterRequest" } } }, - "description": "Use `multipart/form-data` to upload the source `image`, its `mask`, and any `character_reference_images` or `style_reference_images`.", - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { + "403": { + "description": "This account does not have access to this model.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/InpaintImageIdeogramV3CharacterResponse" + "description": "Any type" } } - }, - "description": "The repainted images (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests)." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Unauthorized." + } }, - "402": { + "422": { + "description": "The prompt did not pass safety checks.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" + "description": "Any type" } } - }, - "description": "Insufficient credits or quota." - }, - "404": { - "description": "A referenced resource was not found." - }, - "422": { - "description": "The prompt did not pass safety checks." + } }, "429": { + "description": "Too many requests.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Too many requests." + } }, "500": { - "description": "Internal server error." + "description": "Internal server error.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "503": { - "description": "The endpoint is temporarily unavailable." + "description": "The endpoint is temporarily unavailable.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } } }, - "summary": "Inpaint a consistent character with Ideogram 3.0", - "tags": [ - "images-inpaint" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.images_inpaint_controller" + "requestBody": { + "description": "A request to generate a video from a text prompt with Seedance 2.5.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerateVideoSeedDance25TextToVideoRequest" + } + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + } + ] } }, - "/v2/image/inpaint/ideogram-3-custom-model": { + "/v2/video/generate/seedance-2-image-to-video": { "post": { - "description": "Repaint the masked region of a source image with a custom Ideogram 3.0\nmodel, passed as `custom_model_uri`. Upload the source `image` and its\n`mask` using `multipart/form-data`. Returns results directly by\ndefault; set `async` to get a `generation_id` and poll\n`GET /v2/generations/{generation_id}`.", - "operationId": "post_inpaint_image_v2_ideogram_v3_custom_model", + "operationId": "videoGenerate_post_generate_video_seed_dance2_image_to_video", + "summary": "Image to video with Seedance 2.0", + "description": "Generate one or more videos from a first-frame image and a text prompt\nwith Seedance 2.0. Upload the first frame as `image`, and optionally a final\nframe as `end_image`, using `multipart/form-data`.\nReturns a `generation_id`; poll `GET /v2/generations/{generation_id}`\nor supply a `webhook_url`.\n", + "tags": [ + "video-generate" + ], "parameters": [ { - "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", - "in": "query", "name": "dry_run", + "in": "query", + "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", "required": false, "schema": { - "default": false, - "type": "boolean" - }, - "x-tool-description": "Validate and quote only; no generation, storage, billing, or safety review." + "type": "boolean", + "default": false + } } ], - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "image_asset_identifier": { - "contentType": "application/json" - }, - "mask_asset_identifier": { - "contentType": "application/json" - }, - "style_reference_asset_identifiers": { - "contentType": "application/json" - } - }, - "schema": { - "$ref": "#/components/schemas/InpaintImageIdeogramV3CustomModelRequest" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/InpaintImageIdeogramV3CustomModelRequest" - } - } - }, - "description": "Use `multipart/form-data` to upload the source `image`, its `mask`, and any `style_reference_images`.", - "required": true, - "x-body-name": "body" - }, "responses": { "200": { + "description": "An acknowledgement to poll with `GET /v2/generations/{generation_id}`.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/InpaintImageIdeogramV3CustomModelResponse" + "$ref": "#/components/schemas/GenerateVideoSeedDance2Response" } } - }, - "description": "The repainted images, or an acknowledgement for an asynchronous request." + } }, "400": { - "description": "Invalid input provided." + "description": "Invalid input provided.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "401": { - "description": "Unauthorized." + "description": "Unauthorized.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "402": { + "description": "Insufficient credits or quota.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Insufficient credits or quota." + } }, "403": { - "description": "The caller cannot use the requested custom model." - }, - "404": { - "description": "A referenced resource was not found." - }, - "422": { - "description": "The prompt did not pass safety checks." - }, - "429": { + "description": "This account does not have access to this model.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" + "description": "Any type" } } - }, - "description": "Too many requests." + } }, - "500": { - "description": "Internal server error." - }, - "503": { - "description": "The endpoint is temporarily unavailable." - } - }, - "summary": "Inpaint with a custom Ideogram 3.0 model", - "tags": [ - "images-inpaint" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.images_inpaint_controller" - } - }, - "/v2/image/precise-edit/ideogram-4-5": { - "post": { - "description": "Edit an image with Ideogram 4.5 and get the result back at that image's\nexact width and height. Upload the image as `image` using\n`multipart/form-data`, with optional `reference_images` and a `mask`.\nReturns results directly by default; set `async` or supply a\n`webhook_url` to get a `generation_id` and poll\n`GET /v2/generations/{generation_id}`.\n\n`context_window` confines the edit to one region of the image, so a\nlarge image keeps its detail: pass `y_min,x_min,y_max,x_max`, or `auto`\ntogether with a `mask`. The result always keeps the image's own width\nand height.\n", - "operationId": "post_precise_edit_image_v2_ideogram45", - "parameters": [ - { - "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", - "in": "query", - "name": "dry_run", - "required": false, - "schema": { - "default": false, - "type": "boolean" - }, - "x-tool-description": "Validate and quote only; no generation, storage, billing, or safety review." - } - ], - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "image_asset_identifier": { - "contentType": "application/json" - }, - "reference_image_asset_identifiers": { - "contentType": "application/json" - }, - "mask_asset_identifier": { - "contentType": "application/json" + "404": { + "description": "The first-frame image was not found.", + "content": { + "application/json": { + "schema": { + "description": "Any type" } - }, - "schema": { - "$ref": "#/components/schemas/PreciseEditImageIdeogram45Request" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/PreciseEditImageIdeogram45Request" } } }, - "description": "A request to edit an image with Ideogram 4.5 at that image's own size. Send it as `multipart/form-data` with the `image` to edit and any `reference_images` and `mask`.", - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { + "422": { + "description": "The prompt did not pass safety checks.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PreciseEditImageIdeogram45Response" + "description": "Any type" } } - }, - "description": "The edited images (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests)." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Unauthorized." + } }, - "402": { + "429": { + "description": "Too many requests.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Insufficient credits or quota." - }, - "422": { - "description": "The prompt did not pass safety checks." + } }, - "429": { + "500": { + "description": "Internal server error.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" + "description": "Any type" } } - }, - "description": "Too many requests." - }, - "500": { - "description": "Internal server error." + } }, "503": { - "description": "The endpoint is temporarily unavailable." + "description": "The endpoint is temporarily unavailable.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } } }, - "summary": "Precise edit with Ideogram 4.5", - "tags": [ - "images-precise-edit" - ], - "x-tool-description": "Targeted edit of one image with Ideogram 4.5; everything the instruction does not mention is kept, and the output keeps the source's exact width and height.", - "x-openapi-router-controller": "external_api.generated.openapi.controllers.images_precise_edit_controller" + "requestBody": { + "description": "A request to generate videos from a first-frame image with Seedance 2.0. Upload the first frame as `image` using `multipart/form-data`.", + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "image": { + "type": "string", + "format": "binary", + "description": "The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored." + }, + "end_image": { + "type": "string", + "format": "binary", + "description": "An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one." + }, + "prompt": { + "type": "string", + "minLength": 1, + "maxLength": 2000, + "description": "A natural-language prompt describing how the first frame should animate." + }, + "aspect_ratio": { + "$ref": "#/components/schemas/SeedDance2AspectRatio", + "default": "auto" + }, + "resolution": { + "$ref": "#/components/schemas/SeedDance2Resolution", + "default": "720p" + }, + "duration": { + "type": "integer", + "minimum": 4, + "maximum": 15, + "description": "The length of the generated video in seconds. When omitted, the model\npicks the best duration for the prompt (\"auto\").\n" + }, + "generate_audio": { + "type": "boolean", + "default": false, + "description": "Whether to generate an audio track for the video. Audio roughly\ndoubles the provider cost and is subject to stricter output moderation.\n" + }, + "webhook_url": { + "type": "string", + "format": "uri", + "maxLength": 2048, + "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n" + } + }, + "required": [ + "image", + "prompt" + ] + } + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + } + ] } }, - "/v2/image/reframe/auto": { + "/v2/video/generate/seedance-2-reference-to-video": { "post": { - "description": "Reframe one image to a new aspect ratio without choosing a model.\nIdeogram selects the model best suited to the source and may route\ndifferent requests to different models; the request is billed at the\nchosen model's price. Supply either an existing Ideogram image asset\nor raw image bytes, but not both.\n\nThis operation is asynchronous. It returns as soon as the request is\naccepted; poll `GET /v2/generations/{generation_id}` for completion\nand results.\n", - "operationId": "post_reframe_image_auto", + "operationId": "videoGenerate_post_generate_video_seed_dance2_reference_to_video", + "summary": "Reference to video with Seedance 2.0", + "description": "Generate a video from a text prompt and reference media with\nSeedance 2.0. Upload at least one image in `reference_images`, plus optional\n`reference_audios`, using `multipart/form-data`.\nReturns a `generation_id`; poll `GET /v2/generations/{generation_id}`\nor supply a `webhook_url`.\n", + "tags": [ + "video-generate" + ], "parameters": [ { - "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", - "in": "query", "name": "dry_run", + "in": "query", + "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", "required": false, "schema": { - "default": false, - "type": "boolean" - }, - "x-tool-description": "Validate and quote only; no generation, storage, billing, or safety review." + "type": "boolean", + "default": false + } } ], - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "image_asset_identifier": { - "contentType": "application/json" - } - }, - "schema": { - "$ref": "#/components/schemas/ReframeImageAutoRequest" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/ReframeImageAutoRequest" - } - } - }, - "required": true, - "x-body-name": "body" - }, "responses": { "200": { + "description": "An acknowledgement to poll with `GET /v2/generations/{generation_id}`.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ReframeImageAutoResponse" + "$ref": "#/components/schemas/GenerateVideoSeedDance2Response" } } - }, - "description": "An acknowledgement to poll with `GET /v2/generations/{generation_id}`." + } }, "400": { - "description": "Invalid input provided." + "description": "Invalid input provided.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "401": { - "description": "Unauthorized." + "description": "Unauthorized.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "402": { + "description": "Insufficient credits or quota.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Insufficient credits or quota." + } + }, + "403": { + "description": "This account does not have access to this model.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "404": { - "description": "The referenced source asset was not found." + "description": "A reference was not found.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } + }, + "422": { + "description": "The prompt did not pass safety checks.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "429": { + "description": "Too many requests.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Too many requests." + } }, "500": { - "description": "Internal server error." + "description": "Internal server error.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "503": { - "description": "The endpoint is temporarily unavailable." + "description": "The endpoint is temporarily unavailable.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } } }, - "summary": "Reframe an image, letting Ideogram pick the model", - "tags": [ - "images-reframe" - ], - "x-tool-description": "Change one image's aspect ratio while keeping its content, extending the scene to fill the new frame. For several ratios, make one call per ratio.", - "x-fern-sdk-group-name": [ - "image", - "reframe" - ], - "x-fern-sdk-method-name": "auto", - "x-openapi-router-controller": "external_api.generated.openapi.controllers.images_reframe_controller" + "requestBody": { + "description": "A request to produce a video from reference media with Seedance 2.0. Upload the references using `multipart/form-data`.", + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "prompt": { + "type": "string", + "minLength": 1, + "maxLength": 2000, + "description": "A natural-language prompt describing the video to produce. Refer to references by position, as in \"@Image1 walks toward the camera\"." + }, + "reference_images": { + "type": "array", + "items": { + "type": "string", + "format": "binary" + }, + "description": "Reference images, in prompt order. Common formats such as JPEG, PNG, and WEBP are supported, up to 50MB each. Multipart requests only. Uploaded images are used for this request only and are not stored." + }, + "reference_audios": { + "type": "array", + "items": { + "type": "string", + "format": "binary" + }, + "description": "MP3 or WAV audio references, in prompt order. Multipart requests only. Each file must be at most 15 MB and between 2 and 15 seconds long, with a combined duration of at most 15 seconds. Requires at least one reference image. Audio is used for this request only and is not saved to your library." + }, + "aspect_ratio": { + "$ref": "#/components/schemas/SeedDance2AspectRatio", + "default": "auto" + }, + "resolution": { + "$ref": "#/components/schemas/SeedDance2Resolution", + "default": "720p" + }, + "duration": { + "type": "integer", + "minimum": 4, + "maximum": 15, + "description": "The length of the generated video in seconds. When omitted, the model\npicks the best duration for the prompt (\"auto\").\n" + }, + "generate_audio": { + "type": "boolean", + "default": false, + "description": "Whether to generate an audio track for the video. Audio roughly\ndoubles the provider cost and is subject to stricter output moderation.\n" + }, + "webhook_url": { + "type": "string", + "format": "uri", + "maxLength": 2048, + "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n" + } + }, + "required": [ + "prompt" + ] + } + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + } + ] } }, - "/v2/image/reframe/bria-expand": { + "/v2/video/generate/seedance-2-text-to-video": { "post": { - "description": "Extend one image to a new aspect ratio with Bria Expand. The source\npixels are kept exactly as they are, centered on the new canvas, and\nthe model paints only the added area. Supply either an existing\nIdeogram image asset or raw image bytes, but not both. The canvas is\nsized from the source so that the whole source fits.\n\nThis operation is asynchronous. It returns as soon as the request is\naccepted; poll `GET /v2/generations/{generation_id}` for completion\nand results.\n", - "operationId": "post_reframe_image_bria_expand", + "operationId": "videoGenerate_post_generate_video_seed_dance2_text_to_video", + "summary": "Text to video with Seedance 2.0", + "description": "Generate one or more videos from a text prompt with Seedance 2.0.\nReturns a `generation_id`; poll `GET /v2/generations/{generation_id}`\nor supply a `webhook_url`.\n", + "tags": [ + "video-generate" + ], "parameters": [ { - "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", - "in": "query", "name": "dry_run", + "in": "query", + "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", "required": false, "schema": { - "default": false, - "type": "boolean" - }, - "x-tool-description": "Validate and quote only; no generation, storage, billing, or safety review." + "type": "boolean", + "default": false + } } ], - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "image_asset_identifier": { - "contentType": "application/json" - } - }, - "schema": { - "$ref": "#/components/schemas/ReframeImageBriaExpandRequest" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/ReframeImageBriaExpandRequest" - } - } - }, - "required": true, - "x-body-name": "body" - }, "responses": { "200": { + "description": "An acknowledgement to poll with `GET /v2/generations/{generation_id}`.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ReframeImageBriaExpandResponse" + "$ref": "#/components/schemas/GenerateVideoSeedDance2Response" } } - }, - "description": "An acknowledgement to poll with `GET /v2/generations/{generation_id}`." + } }, "400": { - "description": "Invalid input provided." + "description": "Invalid input provided.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "401": { - "description": "Unauthorized." + "description": "Unauthorized.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "402": { + "description": "Insufficient credits or quota.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Insufficient credits or quota." - }, - "404": { - "description": "The referenced source asset was not found." + } }, - "429": { + "403": { + "description": "This account does not have access to this model.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" + "description": "Any type" } } - }, - "description": "Too many requests." - }, - "500": { - "description": "Internal server error." - }, - "503": { - "description": "The endpoint is temporarily unavailable." - } - }, - "summary": "Reframe an image with Bria Expand", - "tags": [ - "images-reframe" - ], - "x-fern-sdk-group-name": [ - "image", - "reframe" - ], - "x-fern-sdk-method-name": "briaExpand", - "x-openapi-router-controller": "external_api.generated.openapi.controllers.images_reframe_controller" - } - }, - "/v2/image/reframe/gpt-image-2-5-flare": { - "post": { - "description": "Recompose one image for a new aspect ratio with GPT Image 2.5 Flare.\nSupply either an existing Ideogram image asset or raw image bytes, but\nnot both. The requested aspect ratio is resolved to the closest output\nsize the model supports.\n\nThis operation is asynchronous. It returns as soon as the request is\naccepted; poll `GET /v2/generations/{generation_id}` for completion\nand results.\n", - "operationId": "post_reframe_image_gpt_image25_flare", - "parameters": [ - { - "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", - "in": "query", - "name": "dry_run", - "required": false, - "schema": { - "default": false, - "type": "boolean" - }, - "x-tool-description": "Validate and quote only; no generation, storage, billing, or safety review." - } - ], - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "image_asset_identifier": { - "contentType": "application/json" - } - }, - "schema": { - "$ref": "#/components/schemas/ReframeImageGptImage25FlareRequest" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/ReframeImageGptImage25FlareRequest" - } } }, - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { + "422": { + "description": "The prompt did not pass safety checks.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ReframeImageGptImage25FlareResponse" + "description": "Any type" } } - }, - "description": "An acknowledgement to poll with `GET /v2/generations/{generation_id}`." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Unauthorized." + } }, - "402": { + "429": { + "description": "Too many requests.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Insufficient credits or quota." - }, - "404": { - "description": "The referenced source asset was not found." + } }, - "429": { + "500": { + "description": "Internal server error.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" + "description": "Any type" } } - }, - "description": "Too many requests." - }, - "500": { - "description": "Internal server error." + } }, "503": { - "description": "The endpoint is temporarily unavailable." + "description": "The endpoint is temporarily unavailable.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } } }, - "summary": "Reframe an image with GPT Image 2.5 Flare", - "tags": [ - "images-reframe" - ], - "x-fern-sdk-group-name": [ - "image", - "reframe" - ], - "x-fern-sdk-method-name": "gptImage25Flare", - "x-openapi-router-controller": "external_api.generated.openapi.controllers.images_reframe_controller" + "requestBody": { + "description": "A request to generate videos from a text prompt with Seedance 2.0.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerateVideoSeedDance2TextToVideoRequest" + } + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + } + ] } }, - "/v2/image/reframe/ideogram-3": { + "/v2/tool/ad-localizer": { "post": { - "description": "Expand an image to a new Ideogram 3.0 resolution, keeping the source\npixels in the center and filling the new area. Upload the source\n`image` using `multipart/form-data`. Returns results directly by\ndefault; set `async` to get a `generation_id` and poll\n`GET /v2/generations/{generation_id}`.\n", - "operationId": "post_reframe_image_v2_ideogram_v3", + "operationId": "editWorkflow_post_ad_localizer", + "summary": "Ad Localizer", + "description": "Rebuilds an ad in one target language, preserving its layout, logos,\nbrand type, and product so only the visible marketing copy changes.\nUpload the source ad as `image` using `multipart/form-data`; the copy\nis translated unless you supply `exact_copy`.\nReturns a `generation_id`; poll `GET /v2/generations/{generation_id}` or\nsupply a `webhook_url`.\n", + "tags": [ + "edit-workflow" + ], "parameters": [ { - "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", - "in": "query", "name": "dry_run", + "in": "query", + "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", "required": false, "schema": { - "default": false, - "type": "boolean" - }, - "x-tool-description": "Validate and quote only; no generation, storage, billing, or safety review." + "type": "boolean", + "default": false + } } ], - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "image_asset_identifier": { - "contentType": "application/json" - }, - "style_reference_asset_identifiers": { - "contentType": "application/json" - }, - "color_palette": { - "contentType": "application/json" - } - }, - "schema": { - "$ref": "#/components/schemas/ReframeImageIdeogramV3Request" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/ReframeImageIdeogramV3Request" - } - } - }, - "description": "Use `multipart/form-data` to upload the source `image` and any `style_reference_images`.", - "required": true, - "x-body-name": "body" - }, "responses": { "200": { + "description": "Ad localization accepted for asynchronous processing.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ReframeImageIdeogramV3Response" + "$ref": "#/components/schemas/AdLocalizerResponse" } } - }, - "description": "The reframed images, or an acknowledgement for an asynchronous request." + } }, "400": { - "description": "Invalid input provided." + "description": "Invalid input provided.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "401": { - "description": "Unauthorized." + "description": "Unauthorized.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "402": { + "description": "Insufficient credits or quota.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Insufficient credits or quota." + } + }, + "403": { + "description": "Not authorized to use Ad Localizer.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "404": { - "description": "A referenced resource was not found." + "description": "An input asset was not found or is not readable.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } + }, + "422": { + "description": "The instruction did not pass prompt safety checks.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "429": { + "description": "Too many requests.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Too many requests." - }, - "500": { - "description": "Internal server error." - }, - "503": { - "description": "The endpoint is temporarily unavailable." + } } }, - "summary": "Reframe with Ideogram 3.0", - "tags": [ - "images-reframe" - ], - "x-fern-sdk-group-name": [ - "image", - "reframe" - ], - "x-fern-sdk-method-name": "ideogramV3", - "x-tool-description": "Expand an image asset with Ideogram 3.0, preserving source pixels in the center. Use at most one style control: style_preset, style_codes, or style_reference_asset_identifiers.", - "x-openapi-router-controller": "external_api.generated.openapi.controllers.images_reframe_controller" + "requestBody": { + "description": "The source ad and the target language.", + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "image": { + "type": "string", + "format": "binary", + "description": "The source ad to localize (max size 25MB). Its layout, logos, brand\ntype, and product are preserved, and the output keeps its shape, so\nno size or aspect ratio is needed. JPEG, PNG, and WEBP formats are\nsupported. Multipart requests only.\n" + }, + "language": { + "$ref": "#/components/schemas/V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage", + "description": "The target language for the copy. Arabic is rendered right-to-left. Each request covers one language; send one request per language." + }, + "exact_copy": { + "type": "string", + "maxLength": 4000, + "description": "Pre-approved wording, one `original => replacement` mapping per line. Each mapping names the text element showing `original` and sets it to `replacement`, placed character for character rather than translated. Any text element not listed is left as it is in the source. When omitted, all visible marketing copy is translated." + }, + "prompt": { + "type": "string", + "maxLength": 2000, + "description": "Optional additional direction for the localization, for example \"keep the badge in English\". Anything it explicitly asks to change takes priority over the preservation rules." + }, + "quality": { + "$ref": "#/components/schemas/AdLocalizerQuality" + }, + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." + }, + "num_images": { + "type": "integer", + "minimum": 1, + "maximum": 4, + "default": 1, + "description": "Number of localized variations to create for this language." + }, + "webhook_url": { + "type": "string", + "format": "uri", + "maxLength": 2048, + "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n" + } + }, + "required": [ + "image", + "language" + ] + } + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + } + ] } }, - "/v2/image/reframe/nano-banana-2": { + "/v2/tool/ad-resizer": { "post": { - "description": "Expand an image to a new aspect ratio with Nano Banana 2. Upload the\nsource `image` using `multipart/form-data`. Always asynchronous:\nreturns a `generation_id`; poll `GET /v2/generations/{generation_id}`\nfor results.\n", - "operationId": "post_reframe_image_nano_banana2", + "operationId": "editWorkflow_post_ad_resizer", + "summary": "Ad Resizer", + "description": "Reframes an ad creative to an exact ad resolution, regenerating the\nlayout so text and key elements stay legible at the new size. Upload\nthe source creative as `image` using `multipart/form-data`, and supply\n`platform` to keep the ad inside that platform's safe zone.\nReturns a `generation_id`; poll `GET /v2/generations/{generation_id}` or\nsupply a `webhook_url`.", + "tags": [ + "edit-workflow" + ], "parameters": [ { - "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", - "in": "query", "name": "dry_run", + "in": "query", + "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", "required": false, "schema": { - "default": false, - "type": "boolean" - }, - "x-tool-description": "Validate and quote only; no generation, storage, billing, or safety review." + "type": "boolean", + "default": false + } } ], - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "image_asset_identifier": { - "contentType": "application/json" - } - }, - "schema": { - "$ref": "#/components/schemas/ReframeImageNanoBanana2Request" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/ReframeImageNanoBanana2Request" - } - } - }, - "required": true, - "x-body-name": "body" - }, "responses": { "200": { + "description": "Ad resize accepted for asynchronous processing.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ReframeImageNanoBanana2Response" + "$ref": "#/components/schemas/AdResizerResponse" } } - }, - "description": "An acknowledgement to poll with `GET /v2/generations/{generation_id}`." + } }, "400": { - "description": "Invalid input provided." + "description": "Invalid input provided.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "401": { - "description": "Unauthorized." + "description": "Unauthorized.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "402": { + "description": "Insufficient credits or quota.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Insufficient credits or quota." + } + }, + "403": { + "description": "Not authorized to resize an ad.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "404": { - "description": "A referenced resource was not found." + "description": "Source asset not found.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } + }, + "422": { + "description": "The prompt was rejected by safety checks.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "429": { + "description": "Too many requests.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Too many requests." - }, - "500": { - "description": "Internal server error." - }, - "503": { - "description": "The endpoint is temporarily unavailable." + } } }, - "summary": "Reframe with Nano Banana 2", - "tags": [ - "images-reframe" - ], - "x-fern-sdk-group-name": [ - "image", - "reframe" - ], - "x-fern-sdk-method-name": "nanoBanana2", - "x-tool-description": "Expand an image asset to a new aspect ratio with Nano Banana 2, using the closest supported 1K dimensions.", - "x-openapi-router-controller": "external_api.generated.openapi.controllers.images_reframe_controller" - } - }, - "/v2/image/reframe/nano-banana-pro": { - "post": { - "description": "Recompose one image for a new aspect ratio with Nano Banana Pro, at a\n1K, 2K, or 4K output tier. Supply either an existing Ideogram image\nasset or raw image bytes, but not both. The requested aspect ratio is\nresolved to the closest dimensions the model supports at that tier.\n\nThis operation is asynchronous. It returns as soon as the request is\naccepted; poll `GET /v2/generations/{generation_id}` for completion\nand results.\n", - "operationId": "post_reframe_image_nano_banana_pro", - "parameters": [ - { - "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", - "in": "query", - "name": "dry_run", - "required": false, - "schema": { - "default": false, - "type": "boolean" - }, - "x-tool-description": "Validate and quote only; no generation, storage, billing, or safety review." - } - ], "requestBody": { + "description": "The source creative, the target ad resolution, and optionally the platform whose safe zone the ad must stay inside.", "content": { "multipart/form-data": { - "encoding": { - "image_asset_identifier": { - "contentType": "application/json" - } - }, - "schema": { - "$ref": "#/components/schemas/ReframeImageNanoBananaProRequest" - } - }, - "application/json": { "schema": { - "$ref": "#/components/schemas/ReframeImageNanoBananaProRequest" + "type": "object", + "properties": { + "image": { + "type": "string", + "format": "binary", + "description": "The source creative to reframe (max size 25MB). JPEG, PNG, and\nWEBP formats are supported. Multipart requests only.\n" + }, + "resolution": { + "$ref": "#/components/schemas/V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution", + "description": "Target ad resolution, formatted as `WIDTHxHEIGHT`. Any value not in\nthe list is rejected with a 400. Each output image has exactly these\npixel dimensions, with or without a `platform`.\n" + }, + "platform": { + "$ref": "#/components/schemas/V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaPlatform", + "description": "The ad platform whose published safe zone the ad must stay inside.\nThe ad is generated inside the largest rectangle that fits the\nplatform's safe zone for the requested aspect ratio, and the space\naround it is filled in so the output is still exactly the requested\n`resolution`. `google` covers YouTube and Google Ads placements.\nUse `meta_stories` or `meta_reels` for Meta placements; Reels uses\nthe largest rectangle inside its notched safe zone. The legacy\n`meta` value is still supported and uses a more conservative safe\nzone. When omitted, the ad fills the whole frame and every\nsupported `resolution` is accepted. Any other value is rejected\nwith a 400.\n\nEach platform accepts only the resolutions for which it publishes a\nsafe zone; any other `resolution` is rejected with a 400:\n\n| Platform | Accepted resolutions |\n| --- | --- |\n| `google` | `1920x1080`, `3840x2160`, `1080x1080`, `2400x2400`, `2880x2880`, `1080x1920`, `2160x3840` |\n| `tiktok` | `1920x1080`, `3840x2160`, `1080x1080`, `2400x2400`, `2880x2880`, `1080x1920`, `2160x3840` |\n| `meta_stories` | `1080x1920`, `2160x3840` |\n| `meta_reels` | `1080x1920`, `2160x3840` |\n| `meta` (legacy) | `1080x1920`, `2160x3840` |\n| `snapchat` | `1080x1920`, `2160x3840` |\n" + }, + "prompt": { + "type": "string", + "description": "Optional edit instruction to apply while reframing, for example \"remove the logo\" or \"put the price bottom-right\"." + }, + "quality": { + "$ref": "#/components/schemas/AdResizerQuality" + }, + "num_images": { + "type": "integer", + "minimum": 1, + "maximum": 4, + "default": 1, + "description": "The number of reframed variations to generate." + }, + "webhook_url": { + "type": "string", + "format": "uri", + "maxLength": 2048, + "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n" + } + }, + "required": [ + "image", + "resolution" + ] } } - }, - "required": true, - "x-body-name": "body" + } }, + "security": [ + { + "ApiKeyAuth": [] + } + ] + } + }, + "/v2/tool/ad-variations": { + "post": { + "operationId": "editWorkflow_post_ad_variations", + "summary": "Ad Variations", + "description": "Creates on-brand variations of an ad along one axis, preserving logos,\nbrand colors, the product, and all on-image text. Upload the source\ncreative as `image` using `multipart/form-data` and choose a\n`variation_type`.\nReturns a `generation_id`; poll `GET /v2/generations/{generation_id}` or\nsupply a `webhook_url`.\n", + "tags": [ + "edit-workflow" + ], "responses": { "200": { + "description": "Ad variation accepted for asynchronous processing.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ReframeImageNanoBananaProResponse" + "$ref": "#/components/schemas/AdVariationsResponse" } } - }, - "description": "An acknowledgement to poll with `GET /v2/generations/{generation_id}`." + } }, "400": { - "description": "Invalid input provided." + "description": "Invalid input provided.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "401": { - "description": "Unauthorized." - }, - "402": { + "description": "Unauthorized.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" + "description": "Any type" } } - }, - "description": "Insufficient credits or quota." - }, - "404": { - "description": "The referenced source asset was not found." + } }, - "429": { + "402": { + "description": "Insufficient credits or quota.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Too many requests." - }, - "500": { - "description": "Internal server error." + } }, - "503": { - "description": "The endpoint is temporarily unavailable." - } - }, - "summary": "Reframe an image with Nano Banana Pro", - "tags": [ - "images-reframe" - ], - "x-fern-sdk-group-name": [ - "image", - "reframe" - ], - "x-fern-sdk-method-name": "nanoBananaPro", - "x-openapi-router-controller": "external_api.generated.openapi.controllers.images_reframe_controller" - } - }, - "/v2/image/remix/auto": { - "post": { - "description": "Remix an image guided by a text prompt, with Ideogram choosing the\nmodel. Upload the source image as `image` using `multipart/form-data`.\nReturns results directly by default; set `async` or supply a\n`webhook_url` to get a `generation_id` and poll\n`GET /v2/generations/{generation_id}`.", - "operationId": "post_tool_remix", - "parameters": [ - { - "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", - "in": "query", - "name": "dry_run", - "required": false, - "schema": { - "default": false, - "type": "boolean" - }, - "x-tool-description": "Validate and quote only; no generation, storage, billing, or safety review." - } - ], - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "image_asset_identifier": { - "contentType": "application/json" - }, - "style_reference_asset_identifiers": { - "contentType": "application/json" - }, - "color_palette": { - "contentType": "application/json" + "403": { + "description": "Not authorized to generate ad variations.", + "content": { + "application/json": { + "schema": { + "description": "Any type" } - }, - "schema": { - "$ref": "#/components/schemas/ToolRemixRequest" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/ToolRemixRequest" } } }, - "description": "A request to remix one image with an automatically selected model. Send it as `multipart/form-data` with the source `image`.", - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { + "404": { + "description": "Source asset not found.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ToolRemixResponse" + "description": "Any type" } } - }, - "description": "The remixed images (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests)." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Unauthorized." + } }, - "402": { + "422": { + "description": "The prompt was rejected by safety checks.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" + "description": "Any type" } } - }, - "description": "Insufficient credits or quota." - }, - "404": { - "description": "A referenced resource was not found." - }, - "422": { - "description": "The prompt did not pass safety checks." + } }, "429": { + "description": "Too many requests.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Too many requests." - }, - "500": { - "description": "Internal server error." - }, - "503": { - "description": "The endpoint is temporarily unavailable." + } } }, - "summary": "Remix with automatic model selection", - "tags": [ - "auto-model" - ], - "x-tool-description": "Remix an image asset with a server-selected model. Omit resolution and aspect_ratio to preserve the source shape. Style controls and shape changes combined with image_weight require the 1K tier; seed reproducibility depends on the selected model.", - "x-openapi-router-controller": "external_api.generated.openapi.controllers.auto_model_controller" + "requestBody": { + "description": "The source creative and the variation axis.", + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "image": { + "type": "string", + "format": "binary", + "description": "The source creative to vary (max size 25MB). JPEG, PNG, and WEBP\nformats are supported. Multipart requests only. Each output keeps\nthe source's aspect ratio, capped at 3:1 between the long and short\nsides.\n" + }, + "variation_type": { + "$ref": "#/components/schemas/V2ToolAdVariationsPostRequestBodyContentMultipartFormDataSchemaVariationType", + "description": "The axis to vary. `people`\nreplaces the people in the ad with different talent. `setting`\nmoves the same subject and product to a different environment.\n`group_size` changes how many people appear. `scene` shifts the\nmoment or occasion (time of day, season, or activity).\n" + }, + "prompt": { + "type": "string", + "description": "Optional direction to steer the variation, for example \"set it on a beach\" or \"make the models older\". Anything it explicitly asks to change takes priority over the default preservation rules." + }, + "quality": { + "$ref": "#/components/schemas/AdVariationsQuality" + }, + "num_images": { + "type": "integer", + "minimum": 1, + "maximum": 4, + "default": 1, + "description": "The number of variations to generate along the requested axis." + }, + "webhook_url": { + "type": "string", + "format": "uri", + "maxLength": 2048, + "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n" + } + }, + "required": [ + "image", + "variation_type" + ] + } + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + } + ] } }, - "/v2/image/remix/ideogram-3": { + "/v2/tool/colorways": { "post": { - "description": "Transform an existing image with Ideogram 3.0, guided by a text\nprompt. Upload the source `image` using `multipart/form-data`.\nReturns results directly by default; set `async` or supply a\n`webhook_url` to get a `generation_id` and poll\n`GET /v2/generations/{generation_id}`.\n", - "operationId": "post_remix_image_v2_ideogram_v3", + "operationId": "editWorkflow_post_colorways", + "summary": "Colorways", + "description": "Recolors masked regions of a product photo, each to its own target\ncolor, preserving the product's geometry, materials, prints, logos, and\neverything outside the masks. Upload the `image` and up to 4 `masks`\nusing `multipart/form-data`, with one entry in `colors` per mask.\nReturns a `generation_id`; poll `GET /v2/generations/{generation_id}` or\nsupply a `webhook_url`.\n", + "tags": [ + "edit-workflow" + ], "parameters": [ { - "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", - "in": "query", "name": "dry_run", + "in": "query", + "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", "required": false, "schema": { - "default": false, - "type": "boolean" - }, - "x-tool-description": "Validate and quote only; no generation, storage, billing, or safety review." + "type": "boolean", + "default": false + } } ], - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "image_asset_identifier": { - "contentType": "application/json" - }, - "color_palette": { - "contentType": "application/json" - }, - "style_reference_asset_identifiers": { - "contentType": "application/json" - } - }, - "schema": { - "$ref": "#/components/schemas/RemixImageIdeogramV3Request" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/RemixImageIdeogramV3Request" - } - } - }, - "description": "Use `multipart/form-data` to upload the source `image` and any `style_reference_images`.", - "required": true, - "x-body-name": "body" - }, "responses": { "200": { + "description": "Colorway accepted for asynchronous processing.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RemixImageIdeogramV3Response" + "$ref": "#/components/schemas/ColorwaysResponse" } } - }, - "description": "The remixed images (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests)." + } }, "400": { - "description": "Invalid input provided." + "description": "Invalid input provided.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "401": { - "description": "Unauthorized." + "description": "Unauthorized.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "402": { + "description": "Insufficient credits or quota.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Insufficient credits or quota." - }, - "404": { - "description": "A referenced resource was not found." + } }, - "422": { - "description": "The prompt did not pass safety checks." + "403": { + "description": "Not authorized to create a colorway.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "429": { + "description": "Too many requests.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Too many requests." - }, - "500": { - "description": "Internal server error." - }, - "503": { - "description": "The endpoint is temporarily unavailable." + } } }, - "summary": "Remix with Ideogram 3.0", - "tags": [ - "images-remix" - ], - "x-tool-description": "Remix an image asset with Ideogram 3.0. Omit resolution and aspect_ratio to preserve its shape; changing shape center-crops the source.", - "x-openapi-router-controller": "external_api.generated.openapi.controllers.images_remix_controller" - } - }, - "/v2/image/remix/ideogram-3-character": { - "post": { - "description": "Transform an existing image with Ideogram 3.0 so it features a\nconsistent character, guided by a text prompt. Upload the source\n`image` and a `character_reference_images` image (or use a saved\ncharacter) using `multipart/form-data`.\nReturns results directly by default; set `async` or supply a\n`webhook_url` to get a `generation_id` and poll\n`GET /v2/generations/{generation_id}`.\n", - "operationId": "post_remix_image_v2_ideogram_v3_character", - "parameters": [ - { - "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", - "in": "query", - "name": "dry_run", - "required": false, - "schema": { - "default": false, - "type": "boolean" - }, - "x-tool-description": "Validate and quote only; no generation, storage, billing, or safety review." - } - ], "requestBody": { + "description": "The product photo, one mask or several masks marking the regions to recolor, and one target color per mask.", "content": { "multipart/form-data": { - "encoding": { - "image_asset_identifier": { - "contentType": "application/json" - }, - "character_reference_asset_identifiers": { - "contentType": "application/json" - }, - "character_reference_mask_asset_identifier": { - "contentType": "application/json" - }, - "style_reference_asset_identifiers": { - "contentType": "application/json" - } - }, - "schema": { - "$ref": "#/components/schemas/RemixImageIdeogramV3CharacterRequest" - } - }, - "application/json": { "schema": { - "$ref": "#/components/schemas/RemixImageIdeogramV3CharacterRequest" + "type": "object", + "properties": { + "image": { + "type": "string", + "format": "binary", + "description": "The product photo to recolor (max size 25MB). JPEG, PNG, and WEBP\nformats are supported.\n" + }, + "masks": { + "type": "array", + "items": { + "type": "string", + "format": "binary" + }, + "description": "Masks marking the regions to recolor (max 4, max size 25MB each),\npaired by position with `colors`. JPEG, PNG, and WEBP formats are\nsupported. Every mask must have the same pixel dimensions as the\nproduct photo. White pixels mark the region to recolor and black\npixels are preserved; alpha-only masks also work (opaque =\nrecolor, transparent = preserve).\n" + }, + "colors": { + "type": "array", + "items": { + "type": "string", + "pattern": "^#[0-9a-fA-F]{6}$" + }, + "description": "One target color per mask in `masks`, as six-digit hex codes like\n`#B3202C`, paired by position. The product's shape, construction,\nmaterials, prints, and logos are always preserved.\n" + }, + "aspect_ratio": { + "type": "string", + "pattern": "^(1:1|3:4|4:3|16:9|9:16)$", + "description": "Output aspect ratio. Defaults to the product photo's aspect ratio,\nwhich keeps the original framing. A different ratio extends the\nscene to fill the new shape rather than cropping, so part of the\nframe is newly generated. Supported values are `1:1`, `3:4`,\n`4:3`, `16:9`, and `9:16`.\n" + }, + "quality": { + "$ref": "#/components/schemas/ColorwaysQuality" + }, + "webhook_url": { + "type": "string", + "format": "uri", + "maxLength": 2048, + "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n" + } + }, + "required": [ + "image", + "colors" + ] } } - }, - "description": "Use `multipart/form-data` to upload the source `image` and any `character_reference_images` or `style_reference_images`.", - "required": true, - "x-body-name": "body" + } }, + "security": [ + { + "ApiKeyAuth": [] + } + ] + } + }, + "/v2/tool/ghost-mannequin": { + "post": { + "operationId": "editWorkflow_post_ghost_mannequin", + "summary": "Ghost Mannequin", + "description": "Turns photos of one garment into a ghost-mannequin product image on a\nclean white studio background, removing the person, mannequin, hanger,\nand other clothing. Upload the photos using `multipart/form-data`, in\nthe directional fields (such as `front_image`) when the camera\ndirection is known and in `garment_images` otherwise.\nReturns a `generation_id`; poll `GET /v2/generations/{generation_id}` or\nsupply a `webhook_url`.\n", + "tags": [ + "edit-workflow" + ], + "parameters": [ + { + "name": "dry_run", + "in": "query", + "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", + "required": false, + "schema": { + "type": "boolean", + "default": false + } + } + ], "responses": { "200": { + "description": "Ghost-mannequin generation accepted for asynchronous processing.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RemixImageIdeogramV3CharacterResponse" + "$ref": "#/components/schemas/GhostMannequinResponse" } } - }, - "description": "The remixed images (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests)." + } }, "400": { - "description": "Invalid input provided." + "description": "Invalid input provided.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "401": { - "description": "Unauthorized." + "description": "Unauthorized.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "402": { + "description": "Insufficient credits or quota.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Insufficient credits or quota." + } + }, + "403": { + "description": "Not authorized to create ghost-mannequin images.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "404": { - "description": "A referenced resource was not found." + "description": "An input asset was not found or is not readable.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } + }, + "413": { + "description": "The combined raw image uploads exceed 100 MB.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "422": { - "description": "The prompt did not pass safety checks." + "description": "The instruction did not pass prompt safety validation.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "429": { + "description": "Too many requests.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Too many requests." - }, - "500": { - "description": "Internal server error." - }, - "503": { - "description": "The endpoint is temporarily unavailable." + } } }, - "summary": "Remix a consistent character with Ideogram 3.0", - "tags": [ - "images-remix" - ], - "x-tool-description": "Remix an image asset with Ideogram 3.0 and one character reference. Saved character/style collections take priority over their asset references. Changing shape center-crops the source.", - "x-openapi-router-controller": "external_api.generated.openapi.controllers.images_remix_controller" + "requestBody": { + "description": "The garment photos and the requested output view.", + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "garment_images": { + "type": "array", + "items": { + "type": "string", + "format": "binary" + }, + "description": "Additional photos of the same garment, up to 50 MB each. JPEG,\nPNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and MPO are supported.\nMultipart requests only.\n" + }, + "front_image": { + "type": "string", + "format": "binary", + "description": "Optional front-view garment photo, up to 50 MB. Multipart requests\nonly.\n" + }, + "back_image": { + "type": "string", + "format": "binary", + "description": "Optional back-view garment photo, up to 50 MB. Multipart requests\nonly.\n" + }, + "left_image": { + "type": "string", + "format": "binary", + "description": "Optional left-view garment photo, up to 50 MB. Multipart requests\nonly.\n" + }, + "right_image": { + "type": "string", + "format": "binary", + "description": "Optional right-view garment photo, up to 50 MB. Multipart requests\nonly.\n" + }, + "top_image": { + "type": "string", + "format": "binary", + "description": "Optional top-view garment photo, up to 50 MB. Multipart requests\nonly.\n" + }, + "bottom_image": { + "type": "string", + "format": "binary", + "description": "Optional bottom-view garment photo, up to 50 MB. Multipart\nrequests only.\n" + }, + "output_reference_asset_identifier": { + "$ref": "#/components/schemas/AssetIdentifier" + }, + "output_reference_image": { + "type": "string", + "format": "binary", + "description": "Optional presentation example, up to 50 MB. Multipart requests only.\nGuides pose, framing, and lighting without copying its garment,\ncolors, text, or branding. Garment photos remain authoritative for\nproduct identity; view and aspect_ratio take precedence, and the\nbackground remains white. Does not replace a required garment photo.\nMutually exclusive with `output_reference_asset_identifier`.\n" + }, + "view": { + "$ref": "#/components/schemas/V2ToolGhostMannequinPostRequestBodyContentMultipartFormDataSchemaView", + "description": "Camera view for the output garment." + }, + "instruction": { + "type": "string", + "maxLength": 2000, + "description": "Optional reconstruction guidance or identity-critical garment\ndetails to check against the photos. The output always uses a clean\nwhite studio background.\n" + }, + "metadata": { + "type": "string", + "maxLength": 8000, + "description": "Optional JSON object serialized as a string containing factual\nproduct context, such as title, brand, category, color, material,\nitem code, and exact printed text. Metadata helps disambiguate the\ngarment photos but does not add features they do not show.\n" + }, + "aspect_ratio": { + "type": "string", + "pattern": "^(1:1|3:4|4:3|16:9|9:16)$", + "description": "Output aspect ratio. Defaults to `1:1` when omitted. Supported\nvalues are `1:1`, `3:4`, `4:3`, `16:9`, and `9:16`.\n" + }, + "quality": { + "$ref": "#/components/schemas/GhostMannequinQuality" + }, + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Optional seed for repeatable results." + }, + "webhook_url": { + "type": "string", + "format": "uri", + "maxLength": 2048, + "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n" + } + }, + "required": [ + "view" + ] + } + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + } + ] } }, - "/v2/image/remix/ideogram-3-custom-model": { + "/v2/tool/material-swap": { "post": { - "description": "Transform an existing image with a custom Ideogram 3.0 model that your\nuser or organization can access, guided by a text prompt. Upload the\nsource `image` using `multipart/form-data`.\nReturns results directly by default; set `async` or supply a\n`webhook_url` to get a `generation_id` and poll\n`GET /v2/generations/{generation_id}`.\n", - "operationId": "post_remix_image_v2_ideogram_v3_custom_model", + "operationId": "editWorkflow_post_material_swap", + "summary": "Material Swap", + "description": "Re-renders masked regions of a product photo in the materials shown in\nreference images, preserving the product's construction and everything\noutside the masks. Upload the `image`, up to 4 `masks`, and the\n`materials` using `multipart/form-data`.\nReturns a `generation_id`; poll `GET /v2/generations/{generation_id}` or\nsupply a `webhook_url`.\n", + "tags": [ + "edit-workflow" + ], "parameters": [ { - "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", - "in": "query", "name": "dry_run", + "in": "query", + "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", "required": false, "schema": { - "default": false, - "type": "boolean" - }, - "x-tool-description": "Validate and quote only; no generation, storage, billing, or safety review." + "type": "boolean", + "default": false + } } ], - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "image_asset_identifier": { - "contentType": "application/json" - }, - "color_palette": { - "contentType": "application/json" - }, - "style_reference_asset_identifiers": { - "contentType": "application/json" - } - }, - "schema": { - "$ref": "#/components/schemas/RemixImageIdeogramV3CustomModelRequest" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/RemixImageIdeogramV3CustomModelRequest" - } - } - }, - "description": "Use `multipart/form-data` to upload the source `image` and any `style_reference_images`.", - "required": true, - "x-body-name": "body" - }, "responses": { "200": { + "description": "Material swap accepted for asynchronous processing.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RemixImageIdeogramV3CustomModelResponse" + "$ref": "#/components/schemas/MaterialSwapResponse" } } - }, - "description": "The remixed images (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests)." + } }, "400": { - "description": "Invalid input or an unsupported model option." + "description": "Invalid input provided.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "401": { - "description": "Unauthorized." + "description": "Unauthorized.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "402": { + "description": "Insufficient credits or quota.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Insufficient credits or quota." + } }, "403": { - "description": "The custom model does not exist or is not accessible to this user or organization." - }, - "404": { - "description": "A referenced resource was not found." - }, - "422": { - "description": "The prompt did not pass safety checks." + "description": "Not authorized to create a material swap.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "429": { + "description": "Too many requests.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Too many requests." - }, - "500": { - "description": "Internal server error." - }, - "503": { - "description": "The endpoint is temporarily unavailable." + } } }, - "summary": "Remix with a custom Ideogram 3.0 model", - "tags": [ - "images-remix" - ], - "x-tool-description": "Remix an image asset with an accessible custom Ideogram 3.0 model. Omit resolution and aspect_ratio to preserve its shape; changing shape center-crops the source.", - "x-openapi-router-controller": "external_api.generated.openapi.controllers.images_remix_controller" - } - }, - "/v2/image/remix/ideogram-4": { - "post": { - "description": "Transform an existing image with Ideogram 4.0, guided by a text\nprompt. Upload the source `image` using `multipart/form-data`.\nReturns results directly by default; set `async` or supply a\n`webhook_url` to get a `generation_id` and poll\n`GET /v2/generations/{generation_id}`.\n", - "operationId": "post_remix_image_v2_ideogram_v4", - "parameters": [ - { - "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", - "in": "query", - "name": "dry_run", - "required": false, - "schema": { - "default": false, - "type": "boolean" - }, - "x-tool-description": "Validate and quote only; no generation, storage, billing, or safety review." - } - ], "requestBody": { + "description": "The product photo, one mask or several masks marking the regions to change, and either one shared material reference or one per mask.", "content": { "multipart/form-data": { - "encoding": { - "image_asset_identifier": { - "contentType": "application/json" - } - }, - "schema": { - "$ref": "#/components/schemas/RemixImageIdeogramV4Request" - } - }, - "application/json": { "schema": { - "$ref": "#/components/schemas/RemixImageIdeogramV4Request" + "type": "object", + "properties": { + "image": { + "type": "string", + "format": "binary", + "description": "The product photo to edit (max size 25MB). JPEG, PNG, and WEBP\nformats are supported.\n" + }, + "masks": { + "type": "array", + "items": { + "type": "string", + "format": "binary" + }, + "description": "Masks marking the regions to change (max 4, max size 25MB each).\nJPEG, PNG, and WEBP formats are supported. Every mask must have the\nsame pixel dimensions as the product photo. White pixels mark the\nregion to change and black pixels are preserved; alpha-only masks\nalso work (opaque = change, transparent = preserve).\n" + }, + "materials": { + "type": "array", + "items": { + "type": "string", + "format": "binary" + }, + "description": "Material reference images (max size 25MB each). JPEG, PNG, and WEBP\nformats are supported. Only their material (color, texture, pattern\nscale, and orientation) is applied to the masked regions. Send one\nmaterial for every mask, or exactly one per mask, paired by\nposition.\n" + }, + "aspect_ratio": { + "type": "string", + "pattern": "^(1:1|3:4|4:3|16:9|9:16)$", + "description": "Output aspect ratio. Defaults to the product photo's aspect ratio,\nwhich keeps the original framing. A different ratio extends the\nscene to fill the new shape rather than cropping, so part of the\nframe is newly generated. Supported values are `1:1`, `3:4`,\n`4:3`, `16:9`, and `9:16`.\n" + }, + "quality": { + "$ref": "#/components/schemas/MaterialSwapQuality" + }, + "webhook_url": { + "type": "string", + "format": "uri", + "maxLength": 2048, + "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n" + } + }, + "required": [ + "image" + ] } } - }, - "description": "Use `multipart/form-data` to upload the source `image`.", - "required": true, - "x-body-name": "body" + } }, + "security": [ + { + "ApiKeyAuth": [] + } + ] + } + }, + "/v2/tool/model-pose-variants": { + "post": { + "operationId": "editWorkflow_post_model_pose_variants", + "summary": "Model Pose Variants", + "description": "Changes the model's pose or camera angle in a fashion image while\npreserving the model, garment, styling, and scene. Upload the\n`source_image` using `multipart/form-data` and describe the new pose in\n`instruction`.\nReturns a `generation_id`; poll `GET /v2/generations/{generation_id}` or\nsupply a `webhook_url`.\n", + "tags": [ + "edit-workflow" + ], "responses": { "200": { + "description": "Pose-variant generation accepted for asynchronous processing.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RemixImageIdeogramV4Response" + "$ref": "#/components/schemas/ModelPoseVariantsResponse" } } - }, - "description": "The remixed images (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests)." + } }, "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Unauthorized." - }, - "402": { + "description": "Invalid input provided.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" + "description": "Any type" } } - }, - "description": "Insufficient credits or quota." - }, - "404": { - "description": "A referenced resource was not found." + } }, - "422": { - "description": "The prompt did not pass safety checks." + "401": { + "description": "Unauthorized.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, - "429": { + "402": { + "description": "Insufficient credits or quota.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Too many requests." - }, - "500": { - "description": "Internal server error." + } }, - "503": { - "description": "The endpoint is temporarily unavailable." - } - }, - "summary": "Remix with Ideogram 4.0", - "tags": [ - "images-remix" - ], - "x-playground-endpoint": { - "id": "remix-v4", - "label": "Remix", - "order": 2 - }, - "x-tool-description": "Remix an image asset with Ideogram 4.0. Omit resolution to preserve its shape; shape changes cannot be combined with image_weight. No prompt rewriting or reproducible seed.", - "x-openapi-router-controller": "external_api.generated.openapi.controllers.images_remix_controller" - } - }, - "/v2/image/remove-background/ideogram-1": { - "post": { - "description": "Remove the background from an image and return the foreground as a\ntransparent PNG. Upload the source `image` using `multipart/form-data`.\nReturns the result directly by default; set `async` to get a\n`generation_id` and poll `GET /v2/generations/{generation_id}`.\n", - "operationId": "post_remove_background_v2", - "parameters": [ - { - "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", - "in": "query", - "name": "dry_run", - "required": false, - "schema": { - "default": false, - "type": "boolean" - }, - "x-tool-description": "Validate and quote only; no generation, storage, billing, or safety review." - } - ], - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "image_asset_identifier": { - "contentType": "application/json" + "403": { + "description": "Not authorized to generate pose variants.", + "content": { + "application/json": { + "schema": { + "description": "Any type" } - }, - "schema": { - "$ref": "#/components/schemas/RemoveBackgroundV2Request" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/RemoveBackgroundV2AssetRequest" } } }, - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { + "404": { + "description": "An input asset was not found or is not readable.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RemoveBackgroundV2Response" + "description": "Any type" } } - }, - "description": "The foreground image (synchronous requests), or an acknowledgement to poll (`async` requests). If a synchronous request fails after the response has started streaming, the HTTP status is already 200; the body contains `error` and `status_code` instead." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Unauthorized." + } }, - "402": { + "422": { + "description": "The instruction did not pass prompt safety checks.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" + "description": "Any type" } } - }, - "description": "Insufficient credits or quota." - }, - "403": { - "description": "Not authorized to remove backgrounds." - }, - "404": { - "description": "The source image was not found or is not readable." + } }, "429": { + "description": "Too many requests.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Too many requests." - }, - "500": { - "description": "The background-removal request failed." - }, - "503": { - "description": "Background removal is temporarily unavailable." + } } }, - "summary": "Remove background", - "tags": [ - "tool" - ], - "x-fern-sdk-group-name": "tool", - "x-fern-sdk-method-name": "removeBackground", - "x-playground-endpoint": { - "id": "remove-background", - "label": "Remove background", - "order": 3 - }, - "x-tool-description": "Remove an image asset’s background and return a foreground PNG with transparency, at the source's size. Use it for logos, stickers and merch that need a transparent file.", - "x-openapi-router-controller": "external_api.generated.openapi.controllers.tool_controller" - } - }, - "/v2/image/remove-object/ideogram-1": { - "post": { - "description": "Remove a masked object from an image. Upload the source `image` and a\n`mask` of the same size using `multipart/form-data`. Returns a\n`generation_id`; poll `GET /v2/generations/{generation_id}` for the\nresult.\n", - "operationId": "post_remove_object_from_v2_assets", - "parameters": [ - { - "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", - "in": "query", - "name": "dry_run", - "required": false, - "schema": { - "default": false, - "type": "boolean" - }, - "x-tool-description": "Validate and quote only; no generation, storage, billing, or safety review." - } - ], "requestBody": { + "description": "The fashion image to edit and the pose direction.", "content": { "multipart/form-data": { - "encoding": { - "image_asset_identifier": { - "contentType": "application/json" - }, - "mask_asset_identifier": { - "contentType": "application/json" - } - }, - "schema": { - "$ref": "#/components/schemas/RemoveObjectFromV2AssetsRequest" - } - }, - "application/json": { "schema": { - "$ref": "#/components/schemas/RemoveObjectFromV2AssetsRequest" + "type": "object", + "properties": { + "source_image": { + "type": "string", + "format": "binary", + "description": "Fashion image to edit (max size 50MB). JPEG, PNG, WEBP, HEIF,\nAVIF, GIF, BMP, TIFF, and MPO formats are supported. Multipart\nrequests only.\n" + }, + "instruction": { + "type": "string", + "minLength": 1, + "maxLength": 4000, + "description": "Plain-language pose or camera direction, such as a front-facing\ncatalog stance or right-facing walking profile.\n" + }, + "aspect_ratio": { + "type": "string", + "pattern": "^(1:1|3:4|4:3|16:9|9:16)$", + "description": "Output aspect ratio. When omitted, the nearest supported ratio is\nderived from the source image. Supported values are `1:1`, `3:4`,\n`4:3`, `16:9`, and `9:16`.\n" + }, + "quality": { + "$ref": "#/components/schemas/ModelPoseVariantsQuality" + }, + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Optional seed for repeatable results." + }, + "num_images": { + "type": "integer", + "minimum": 1, + "maximum": 8, + "default": 1, + "description": "Number of pose variants to create." + }, + "webhook_url": { + "type": "string", + "format": "uri", + "maxLength": 2048, + "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n" + } + }, + "required": [ + "source_image", + "instruction" + ] } } - }, - "description": "The source `image` and `mask`, uploaded using `multipart/form-data`.", - "required": true, - "x-body-name": "body" + } }, + "security": [ + { + "ApiKeyAuth": [] + } + ] + } + }, + "/v2/tool/sketch-to-render": { + "post": { + "operationId": "editWorkflow_post_sketch_to_render", + "summary": "Sketch to Render", + "description": "Turns a fashion sketch into photorealistic garment or product imagery,\npreserving its silhouette, construction, colors, and design details.\nUpload the `sketch_image` using `multipart/form-data` and describe\nmaterials and rendering in `instruction`.\nReturns a `generation_id`; poll `GET /v2/generations/{generation_id}` or\nsupply a `webhook_url`.\n", + "tags": [ + "edit-workflow" + ], "responses": { "200": { + "description": "Sketch rendering accepted for asynchronous processing.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RemoveObjectFromV2AssetsResponse" + "$ref": "#/components/schemas/SketchToRenderResponse" } } - }, - "description": "Object removal request accepted; poll for completion with `GET /v2/generations/{generation_id}`." + } }, "400": { - "description": "Invalid input provided." + "description": "Invalid input provided.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "401": { - "description": "Unauthorized." + "description": "Unauthorized.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "402": { + "description": "Insufficient credits or quota.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Insufficient credits or quota." + } }, "403": { - "description": "Not authorized to remove an object." + "description": "Not authorized to render sketches.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "404": { - "description": "The source image or mask was not found." + "description": "The referenced sketch was not found or is not readable.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, - "413": { - "description": "An uploaded source or mask image is too large." + "422": { + "description": "The instruction did not pass prompt safety validation.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "429": { + "description": "Too many requests.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Too many requests." - }, - "503": { - "description": "The endpoint is temporarily unavailable." + } } }, - "summary": "Remove an object", - "tags": [ - "object-removal" - ], - "x-tool-description": "Remove the masked object from an image asset and fill the area to match its surroundings. Returns a generation reference.", - "x-openapi-router-controller": "external_api.generated.openapi.controllers.object_removal_controller" - } - }, - "/v2/image/replace-background/gpt-image-2": { - "post": { - "description": "Replace the background of an image from a text prompt while keeping the\nautomatically detected foreground subject; no mask is needed. Upload\nthe source `image` using `multipart/form-data`.\nReturns a `generation_id`; poll `GET /v2/generations/{generation_id}`\nor supply a `webhook_url`.\n", - "operationId": "post_replace_background", - "parameters": [ - { - "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", - "in": "query", - "name": "dry_run", - "required": false, - "schema": { - "default": false, - "type": "boolean" - }, - "x-tool-description": "Validate and quote only; no generation, storage, billing, or safety review." - } - ], "requestBody": { + "description": "The source sketch and the material and rendering direction to apply.", "content": { "multipart/form-data": { - "encoding": { - "image_asset_identifier": { - "contentType": "application/json" - } - }, - "schema": { - "$ref": "#/components/schemas/ReplaceBackgroundRequest" - } - }, - "application/json": { "schema": { - "$ref": "#/components/schemas/ReplaceBackgroundRequest" + "type": "object", + "properties": { + "sketch_image": { + "type": "string", + "format": "binary", + "description": "The fashion sketch to render, up to 50 MB. JPEG, PNG, WEBP, HEIF,\nAVIF, GIF, BMP, TIFF, and MPO are supported. Multipart requests\nonly.\n" + }, + "instruction": { + "type": "string", + "minLength": 1, + "maxLength": 4000, + "description": "Material and rendering direction, plus any construction or design\ndetails that are not legible in the sketch.\n" + }, + "aspect_ratio": { + "type": "string", + "pattern": "^(1:1|3:4|4:3|16:9|9:16)$", + "description": "Aspect ratio of each output image. Defaults to `1:1` when omitted." + }, + "quality": { + "$ref": "#/components/schemas/SketchToRenderQuality" + }, + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Optional seed for repeatable results." + }, + "num_images": { + "type": "integer", + "minimum": 1, + "maximum": 8, + "default": 1, + "description": "Number of product renders to create." + }, + "webhook_url": { + "type": "string", + "format": "uri", + "maxLength": 2048, + "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n" + } + }, + "required": [ + "sketch_image", + "instruction" + ] } } - }, - "description": "The source image and a prompt describing its new background.", - "required": true, - "x-body-name": "body" + } }, + "security": [ + { + "ApiKeyAuth": [] + } + ] + } + }, + "/v2/generations/{generation_id}": { + "get": { + "operationId": "generations_get_generation_v2", + "summary": "Poll a generation", + "description": "Retrieves the current status of an asynchronous generation, and its\nresults once complete. Use the `generation_id` returned by any `/v2`\nendpoint that runs asynchronously: every video and tool endpoint, and\nany image endpoint called with `async` or a `webhook_url`.\n\nWhile the generation is `pending` or has `failed`, the response\ncontains only `generation_id`, `status`, and `created` (plus\n`failure_reason` once failed). Once `status` is `completed`, the\nresponse includes `response_type` and `data`. Each `data` item carries\nan `object_type` that identifies its shape, so image and video results\ncan be told apart. `usage_cost_usd_micros` reports the amount billed\nwhen the request uses variable usage-based pricing.\n\nPolling is rate limited per organization; a 429 response carries a\n`Retry-After` header with the number of seconds to wait.", + "tags": [ + "generations" + ], + "parameters": [ + { + "name": "generation_id", + "in": "path", + "description": "URL-safe base64 ID of the generation, as returned when the request was accepted.", + "required": true, + "schema": { + "type": "string" + } + } + ], "responses": { "200": { + "description": "Generation status retrieved successfully.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ReplaceBackgroundResponse" + "$ref": "#/components/schemas/GenerationResponse" } } - }, - "description": "Background replacement accepted for asynchronous processing." + } }, "400": { - "description": "Invalid input provided." + "description": "The generation ID is not a valid URL-safe base64 ID.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "401": { - "description": "Unauthorized." - }, - "402": { + "description": "Not authorized.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" + "description": "Any type" } } - }, - "description": "Insufficient credits or quota." - }, - "403": { - "description": "Not authorized to replace backgrounds." + } }, "404": { - "description": "The source image was not found or is not readable." - }, - "422": { - "description": "The prompt did not pass safety checks." + "description": "Generation not found.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "429": { + "description": "Too many requests.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" + "description": "Any type" } } - }, - "description": "Too many requests." - }, - "503": { - "description": "Background replacement is temporarily unavailable." + } } }, - "summary": "Replace background with GPT Image 2", - "tags": [ - "edit-workflow" - ], - "x-fern-sdk-group-name": "tool", - "x-fern-sdk-method-name": "replaceBackground", - "x-tool-description": "Replace an image asset’s background from a prompt, preserving the foreground subject automatically. No mask needed.", - "x-openapi-router-controller": "external_api.generated.openapi.controllers.edit_workflow_controller" - } - }, - "/v2/image/replace-background/ideogram-3": { - "post": { - "description": "Replace the background of an image from a text prompt with Ideogram 3.0,\nkeeping the automatically detected foreground subject; no mask is\nneeded. Upload the source `image` using `multipart/form-data`.\nReturns a `generation_id`; poll `GET /v2/generations/{generation_id}`\nor supply a `webhook_url`.\n", - "operationId": "post_replace_background_ideogram_v3", - "parameters": [ + "security": [ { - "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", - "in": "query", - "name": "dry_run", - "required": false, - "schema": { - "default": false, - "type": "boolean" - }, - "x-tool-description": "Validate and quote only; no generation, storage, billing, or safety review." + "ApiKeyAuth": [] } + ] + } + }, + "/v2/account/api-keys": { + "get": { + "operationId": "account_get_account_api_keys", + "summary": "List API keys", + "description": "Lists the API keys in your organization. Key material is redacted —\nthe full key is only shown once, when it is created. Disabled and\narchived keys are included (see each key's `status`) so historical\nusage can always be matched to the key that generated it.\n\nRequires an API key whose owner is an organization admin. Keys owned\nby other members receive a 404.\n", + "tags": [ + "account" ], - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "image_asset_identifier": { - "contentType": "application/json" + "responses": { + "200": { + "description": "The organization's API keys, redacted.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListAccountApiKeysResponse" } - }, - "schema": { - "$ref": "#/components/schemas/ReplaceBackgroundIdeogramV3Request" } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/ReplaceBackgroundIdeogramV3Request" + } + }, + "401": { + "description": "Unauthorized.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } } } }, - "description": "The source image and a prompt describing its new background.", - "required": true, - "x-body-name": "body" + "404": { + "description": "No organization with billing access was found for this credential.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } + } }, + "security": [ + { + "ApiKeyAuth": [] + } + ] + } + }, + "/v2/account/invoices": { + "get": { + "operationId": "account_get_account_invoices", + "summary": "List invoices", + "description": "Returns your organization's invoices with their line items — the\nbilling record your usage reports reconcile against. Amounts are\ndecimal strings in the invoice's currency.\n\nRequires an API key whose owner is an organization admin. Keys owned\nby other members receive a 404.\n", + "tags": [ + "account" + ], "responses": { "200": { + "description": "The organization's invoices. Empty when no billing history exists yet.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ReplaceBackgroundResponse" + "$ref": "#/components/schemas/ListAccountInvoicesResponse" } } - }, - "description": "Background replacement accepted for asynchronous processing." - }, - "400": { - "description": "Invalid input provided." + } }, "401": { - "description": "Unauthorized." - }, - "402": { + "description": "Unauthorized.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" + "description": "Any type" } } - }, - "description": "Insufficient credits or quota." - }, - "403": { - "description": "Not authorized to replace backgrounds." + } }, "404": { - "description": "The source image was not found or is not readable." - }, - "422": { - "description": "The prompt did not pass safety checks." - }, - "429": { + "description": "No organization with billing access was found for this credential.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" + "description": "Any type" } } - }, - "description": "Too many requests." - }, - "503": { - "description": "Background replacement is temporarily unavailable." + } } }, - "summary": "Replace background with Ideogram 3.0", - "tags": [ - "edit-workflow" - ], - "x-fern-sdk-group-name": "tool", - "x-fern-sdk-method-name": "replaceBackgroundIdeogramV3", - "x-openapi-router-controller": "external_api.generated.openapi.controllers.edit_workflow_controller" + "security": [ + { + "ApiKeyAuth": [] + } + ] } }, - "/v2/image/replace-background/ideogram-4-5": { - "post": { - "description": "Rebuild the background of an image as the setting shown in a\n`background_reference` image, with Ideogram 4.5 at its highest\nquality. The people in the source image are kept, people in the\nreference are left out, and results keep the source image's aspect\nratio. Returns a `generation_id`; poll\n`GET /v2/generations/{generation_id}` or supply a `webhook_url`.\n", - "operationId": "post_replace_background_ideogram45", + "/v2/account/usage": { + "get": { + "operationId": "account_get_account_usage", + "summary": "Get usage and spend", + "description": "Returns your organization's billed API usage as dense time buckets of\nline items. Every line item carries the billed dollar amount; products\nbilled per item also carry `billed_units` (unit, quantity, and unit\nprice, where `quantity × unit_price = cost_total`). Usage-priced\nproducts (billed by metered provider usage) report `cost_total` only.\n\nBuckets cover the requested range completely — a bucket with no line\nitems means no billed usage in that window. Line items are unique per\nbucket on (`product`, `dimensions`, `api_key.id`, unit price). Usage\nbilled without an API key (requests authenticated as a user session)\nis included with `api_key` absent, so totals always reconcile with\nyour invoices.\n`product` and `endpoint` are stable identifiers safe to aggregate on;\n`description` is display text and may be reworded at any time.\n\nUsage data may lag live traffic by a few minutes, and responses may be\ncached briefly, so this endpoint is for reporting rather than\nreal-time monitoring.\n\nRequires an API key whose owner is an organization admin. Keys owned\nby other members receive a 404.\n", + "tags": [ + "account" + ], "parameters": [ { - "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", + "name": "start_time", "in": "query", - "name": "dry_run", + "description": "Start of the reporting range (RFC 3339). Snapped down to the containing bucket boundary (UTC).", + "required": true, + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "end_time", + "in": "query", + "description": "End of the reporting range (RFC 3339), exclusive. Snapped up to the next bucket boundary (UTC). Defaults to now.", "required": false, "schema": { - "default": false, - "type": "boolean" - }, - "x-tool-description": "Validate and quote only; no generation, storage, billing, or safety review." - } - ], - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "image_asset_identifier": { - "contentType": "application/json" - }, - "background_reference_asset_identifier": { - "contentType": "application/json" - } - }, - "schema": { - "$ref": "#/components/schemas/ReplaceBackgroundIdeogram45Request" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/ReplaceBackgroundIdeogram45Request" - } + "type": "string", + "format": "date-time" } }, - "description": "The source image and the background reference.", - "required": true, - "x-body-name": "body" - }, + { + "name": "bucket_width", + "in": "query", + "description": "Bucket granularity. `1d` allows ranges up to 92 days per request; `1h` allows up to 168 hours. Page through longer histories by moving `start_time` back across successive requests.", + "required": false, + "schema": { + "$ref": "#/components/schemas/V2AccountUsageGetParametersBucketWidth", + "default": "1d" + } + }, + { + "name": "sources", + "in": "query", + "description": "Which billing sources to include. `api` is usage from API requests; `app` is web-app usage, attributed to the member who generated it. Defaults to both, so report totals reconcile with invoices.", + "required": false, + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/V2AccountUsageGetParametersSourcesSchemaItems" + }, + "default": [ + "api", + "app" + ] + } + } + ], "responses": { "200": { + "description": "Bucketed usage for the requested range.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ReplaceBackgroundResponse" + "$ref": "#/components/schemas/GetAccountUsageResponse" } } - }, - "description": "Background replacement accepted for asynchronous processing." + } }, "400": { - "description": "Invalid input provided." + "description": "Invalid time range, bucket width, or filters.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "401": { - "description": "Unauthorized." - }, - "402": { + "description": "Unauthorized.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" + "description": "Any type" } } - }, - "description": "Insufficient credits or quota." - }, - "403": { - "description": "Not authorized to replace backgrounds." + } }, "404": { - "description": "An image was not found or is not readable." + "description": "No organization with billing access was found for this credential.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "429": { + "description": "Too many requests.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" + "description": "Any type" } } - }, - "description": "Too many requests." - }, - "503": { - "description": "Background replacement is temporarily unavailable." + } } }, - "summary": "Replace background with Ideogram 4.5", - "tags": [ - "edit-workflow" - ], - "x-fern-sdk-group-name": "tool", - "x-fern-sdk-method-name": "replaceBackgroundIdeogram45", - "x-openapi-router-controller": "external_api.generated.openapi.controllers.edit_workflow_controller" + "security": [ + { + "ApiKeyAuth": [] + } + ] } }, - "/v2/image/upscale/auto": { + "/v2/image/replace-background/ideogram-4-5": { "post": { - "description": "Upscale an image to 2x, 4x, or 8x its original resolution with a model\nIdeogram picks per request; the choice may change over time. Upload the\nsource `image` using `multipart/form-data`.\nReturns results directly by default; set `async` or supply a\n`webhook_url` to get a `generation_id` and poll\n`GET /v2/generations/{generation_id}`.\n", - "operationId": "post_upscale", + "operationId": "tool_replaceBackgroundIdeogram45", + "summary": "Replace background with Ideogram 4.5", + "description": "Rebuild the background of an image as the setting shown in a\n`background_reference` image, with Ideogram 4.5 at its highest\nquality. The people in the source image are kept, people in the\nreference are left out, and results keep the source image's aspect\nratio. Returns a `generation_id`; poll\n`GET /v2/generations/{generation_id}` or supply a `webhook_url`.\n", + "tags": [ + "tool" + ], "parameters": [ { - "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", - "in": "query", "name": "dry_run", + "in": "query", + "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", "required": false, "schema": { - "default": false, - "type": "boolean" - }, - "x-tool-description": "Validate and quote only; no generation, storage, billing, or safety review." + "type": "boolean", + "default": false + } } ], - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "image_asset_identifier": { - "contentType": "application/json" - } - }, - "schema": { - "$ref": "#/components/schemas/UpscaleToolRequest" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpscaleToolRequest" - } - } - }, - "description": "A request to upscale one image. Upload the source `image` using `multipart/form-data`.", - "required": true, - "x-body-name": "body" - }, "responses": { "200": { + "description": "Background replacement accepted for asynchronous processing.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpscaleToolResponse" + "$ref": "#/components/schemas/ReplaceBackgroundResponse" } } - }, - "description": "The upscaled image (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests)." + } }, "400": { - "description": "Invalid input provided, or the output would exceed the 8K limit." + "description": "Invalid input provided.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "401": { - "description": "Unauthorized." + "description": "Unauthorized.", + "content": { + "application/json": { + "schema": { + "description": "Any type" + } + } + } }, "402": { + "description": "Insufficient credits or quota.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Insufficient credits or quota." + } }, "403": { - "description": "Not authorized to upscale images." - }, - "404": { - "description": "The source image was not found." - }, - "429": { + "description": "Not authorized to replace backgrounds.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Too many requests." - }, - "500": { - "description": "Internal server error." - }, - "503": { - "description": "The endpoint is temporarily unavailable." - } - }, - "summary": "Upscale with automatic model selection", - "tags": [ - "tools" - ], - "x-tool-description": "Upscale an image asset with a server-selected model; the default choice for upscaling. No prompt; output is limited to 8192 pixels per side.", - "x-openapi-router-controller": "external_api.generated.openapi.controllers.tools_controller" - } - }, - "/v2/image/upscale/nano-banana-pro": { - "post": { - "description": "Regenerate an image at a higher `resolution_tier` (1K, 2K, or 4K) while\npreserving its content, composition, and style. Upload the source\n`image` using `multipart/form-data`.\nReturns results directly by default; set `async` or supply a\n`webhook_url` to get a `generation_id` and poll\n`GET /v2/generations/{generation_id}`.\n", - "operationId": "post_upscale_image_nano_banana_pro", - "parameters": [ - { - "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", - "in": "query", - "name": "dry_run", - "required": false, - "schema": { - "default": false, - "type": "boolean" - }, - "x-tool-description": "Validate and quote only; no generation, storage, billing, or safety review." - } - ], - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "image_asset_identifier": { - "contentType": "application/json" + "description": "Any type" } - }, - "schema": { - "$ref": "#/components/schemas/UpscaleImageNanoBananaProRequest" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpscaleImageNanoBananaProRequest" } } }, - "description": "A request to upscale one image with Nano Banana Pro. Upload the source `image` using `multipart/form-data`.", - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { + "404": { + "description": "An image was not found or is not readable.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpscaleImageNanoBananaProResponse" + "description": "Any type" } } - }, - "description": "The upscaled image (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests)." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Unauthorized." + } }, - "402": { + "429": { + "description": "Too many requests.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerationErrorResponse" } } - }, - "description": "Insufficient credits or quota." - }, - "404": { - "description": "The source image was not found." - }, - "422": { - "description": "The prompt did not pass safety checks." + } }, - "429": { + "503": { + "description": "Background replacement is temporarily unavailable.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" + "description": "Any type" } } - }, - "description": "Too many requests." - }, - "500": { - "description": "Internal server error." - }, - "503": { - "description": "The endpoint is temporarily unavailable." + } } }, - "summary": "Upscale with Nano Banana Pro", - "tags": [ - "images-upscale" - ], - "x-tool-description": "Upscale an image asset with Nano Banana Pro, preserving content, composition, and style. The source must be smaller than the requested resolution tier. An optional prompt guides enhancement.", - "x-openapi-router-controller": "external_api.generated.openapi.controllers.images_upscale_controller" - } - }, - "/v2/image/upscale/topaz-bloom-2": { - "post": { - "description": "Creatively upscale an image to 2x, 4x, or 8x its original resolution,\noptionally guided by a `prompt`. Upload the source `image` using\n`multipart/form-data`.\nReturns results directly by default; set `async` or supply a\n`webhook_url` to get a `generation_id` and poll\n`GET /v2/generations/{generation_id}`.\n", - "operationId": "post_upscale_image_topaz_bloom2", - "parameters": [ - { - "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", - "in": "query", - "name": "dry_run", - "required": false, - "schema": { - "default": false, - "type": "boolean" - }, - "x-tool-description": "Validate and quote only; no generation, storage, billing, or safety review." - } - ], "requestBody": { + "description": "The source image and the background reference.", "content": { "multipart/form-data": { - "encoding": { - "image_asset_identifier": { - "contentType": "application/json" - } - }, - "schema": { - "$ref": "#/components/schemas/UpscaleImageTopazBloom2Request" - } - }, - "application/json": { "schema": { - "$ref": "#/components/schemas/UpscaleImageTopazBloom2Request" + "type": "object", + "properties": { + "image": { + "type": "string", + "format": "binary", + "description": "The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and\nMPO are supported, up to 50 MB. Its longer side may be at most the\nmodel's maximum aspect ratio times its shorter side; a more extreme\nproportion is rejected with a 400 that states the allowed range.\nMultipart requests only.\n" + }, + "background_reference": { + "type": "string", + "format": "binary", + "description": "A photo of the setting the new background should match. Its people\nare not copied. It is held to the same aspect-ratio limit as\n`image`. Multipart requests only.\n" + }, + "num_images": { + "type": "integer", + "minimum": 1, + "maximum": 4, + "default": 1, + "description": "The number of images to generate." + }, + "private": { + "type": "boolean", + "description": "Whether to keep the result private. When omitted, the result is\nprivate. Enterprise generations are always private.\n" + }, + "webhook_url": { + "type": "string", + "format": "uri", + "maxLength": 2048, + "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n" + } + }, + "required": [ + "image", + "background_reference" + ] } } - }, - "description": "A request to upscale one image with Topaz Bloom 2. Upload the source `image` using `multipart/form-data`.", - "required": true, - "x-body-name": "body" + } }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpscaleImageTopazBloom2Response" - } - } - }, - "description": "The upscaled image (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests)." + "security": [ + { + "ApiKeyAuth": [] + } + ] + } + } + }, + "tags": [ + { + "name": "images-precise-edit" + }, + { + "name": "auto-model" + }, + { + "name": "images-generate" + }, + { + "name": "images-remix" + }, + { + "name": "images-inpaint" + }, + { + "name": "reframe" + }, + { + "name": "tools" + }, + { + "name": "images-upscale" + }, + { + "name": "tool" + }, + { + "name": "object-removal" + }, + { + "name": "image-describe" + }, + { + "name": "design" + }, + { + "name": "video-generate" + }, + { + "name": "video-edit" + }, + { + "name": "edit-workflow" + }, + { + "name": "generations" + }, + { + "name": "account" + } + ], + "servers": [ + { + "url": "https://api.ideogram.ai", + "description": "https://api.ideogram.ai" + } + ], + "components": { + "schemas": { + "V2ImagePreciseEditIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality": { + "type": "string", + "enum": [ + "very_low", + "low", + "medium", + "high" + ], + "default": "medium", + "description": "The rendering quality to use. `very_low` is the fastest and cheapest, and `high` takes longer and is priced higher.", + "title": "V2ImagePreciseEditIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality" + }, + "GenerationKind": { + "type": "string", + "enum": [ + "sampling", + "workflow" + ], + "description": "The kind of generation identified by generation_id. Both kinds can be polled through GET /v2/generations/{generation_id}.", + "title": "GenerationKind" + }, + "GeneratedImageObject": { + "type": "object", + "properties": { + "url": { + "type": [ + "string", + "null" + ], + "format": "uri", + "description": "The direct link to the generated image. Empty when the image did not pass safety checks." }, - "400": { - "description": "Invalid input provided, or the output would exceed the 8K limit." + "prompt": { + "type": "string", + "description": "The final prompt the image was generated from." }, - "401": { - "description": "Unauthorized." + "resolution": { + "type": "string", + "description": "The resolution of the generated image, formatted as \"WIDTHxHEIGHT\"." }, - "402": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Insufficient credits or quota." + "is_image_safe": { + "type": "boolean", + "description": "Whether the image passed safety checks. If false, `url` is empty." }, - "404": { - "description": "The source image was not found." + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." + } + }, + "required": [ + "prompt", + "resolution", + "is_image_safe", + "seed" + ], + "description": "One generated output image.", + "title": "GeneratedImageObject" + }, + "PreciseEditImageIdeogram45Response": { + "type": "object", + "properties": { + "generation_kind": { + "$ref": "#/components/schemas/GenerationKind" }, - "422": { - "description": "The prompt did not pass safety checks." + "generation_id": { + "type": "string", + "description": "URL-safe base64 ID of the generation. Use it to poll\n`GET /v2/generations/{generation_id}`.\n" }, - "429": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GeneratedImageObject" }, - "description": "Too many requests." - }, - "500": { - "description": "Internal server error." + "description": "The edited images, in generation order. Present only for synchronous requests (`async` omitted or false)." }, - "503": { - "description": "The endpoint is temporarily unavailable." + "seed": { + "type": "integer", + "description": "The seed that was used, including when you did not set one." } }, - "summary": "Upscale with Topaz Bloom 2", - "tags": [ - "images-upscale" - ], - "x-tool-description": "Creatively upscale an image asset with Topaz Bloom 2, which may reinterpret detail; use it only when the user wants added detail rather than a faithful enlargement. An optional prompt guides detail; creativity controls reinterpretation. Output is limited to 8192 pixels per side.", - "x-openapi-router-controller": "external_api.generated.openapi.controllers.images_upscale_controller" - } - }, - "/v2/image/upscale/topaz-redefine": { - "post": { - "description": "Creatively upscale an image to 2x, 4x, or 8x its original resolution,\nguided by an optional `prompt` or `autoprompt`. Upload the source\n`image` using `multipart/form-data`.\nReturns results directly by default; set `async` or supply a\n`webhook_url` to get a `generation_id` and poll\n`GET /v2/generations/{generation_id}`.\n", - "operationId": "post_upscale_image_topaz_redefine", - "parameters": [ - { - "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", - "in": "query", - "name": "dry_run", - "required": false, - "schema": { - "default": false, - "type": "boolean" - }, - "x-tool-description": "Validate and quote only; no generation, storage, billing, or safety review." - } + "required": [ + "generation_kind" ], - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "image_asset_identifier": { - "contentType": "application/json" - } - }, - "schema": { - "$ref": "#/components/schemas/UpscaleImageTopazRedefineRequest" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpscaleImageTopazRedefineRequest" - } - } - }, - "description": "A request to upscale one image with Topaz Redefine. Upload the source `image` using `multipart/form-data`.", - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpscaleImageTopazRedefineResponse" - } - } - }, - "description": "The upscaled image (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests)." - }, - "400": { - "description": "Invalid input provided, or the output would exceed the 8K limit." - }, - "401": { - "description": "Unauthorized." - }, - "402": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Insufficient credits or quota." - }, - "404": { - "description": "The source image was not found." - }, - "422": { - "description": "The prompt did not pass safety checks." + "description": "Response returned by `POST /v2/image/precise-edit/ideogram-4-5`.\nSynchronous requests (the default) include the edited images in `data`.\nAsynchronous requests omit `data`; poll\n`GET /v2/generations/{generation_id}` with the returned\n`generation_id`.\n", + "title": "PreciseEditImageIdeogram45Response" + }, + "GenerationRejectReason": { + "type": "string", + "enum": [ + "insufficient_funds", + "subscription_required", + "daily_limit", + "priority_credit_required", + "inflight_limit", + "feature_limit" + ], + "description": "The account or usage limit that rejected a generation request.", + "title": "GenerationRejectReason" + }, + "GenerationErrorResponseTaskCompletionSpeed": { + "type": "string", + "enum": [ + "fast", + "slow" + ], + "description": "The queue this request resolved to. Present when `reject_reason`\nis `inflight_limit`.\n", + "title": "GenerationErrorResponseTaskCompletionSpeed" + }, + "GenerationErrorResponse": { + "type": "object", + "properties": { + "error": { + "type": "string", + "description": "A message describing why the generation request was rejected." }, - "429": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Too many requests." + "reject_reason": { + "$ref": "#/components/schemas/GenerationRejectReason" }, - "500": { - "description": "Internal server error." + "max_inflight_requests": { + "type": "integer", + "minimum": 1, + "description": "How many generations the account may have in progress at once on\nthe queue this request resolved to. Present when `reject_reason`\nis `inflight_limit`.\n" }, - "503": { - "description": "The endpoint is temporarily unavailable." + "task_completion_speed": { + "$ref": "#/components/schemas/GenerationErrorResponseTaskCompletionSpeed", + "description": "The queue this request resolved to. Present when `reject_reason`\nis `inflight_limit`.\n" } }, - "summary": "Upscale with Topaz Redefine", - "tags": [ - "images-upscale" + "required": [ + "error", + "reject_reason" ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.images_upscale_controller" - } - }, - "/v2/image/upscale/topaz-standard-2": { - "post": { - "description": "Upscale an image to 2x, 4x, or 8x its original resolution; no prompt is\nneeded. Upload the source `image` using `multipart/form-data`.\nReturns results directly by default; set `async` or supply a\n`webhook_url` to get a `generation_id` and poll\n`GET /v2/generations/{generation_id}`.\n", - "operationId": "post_upscale_image_topaz_standard_v2", - "parameters": [ - { - "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", - "in": "query", - "name": "dry_run", - "required": false, - "schema": { - "default": false, - "type": "boolean" - }, - "x-tool-description": "Validate and quote only; no generation, storage, billing, or safety review." - } + "description": "A generation request rejected by an account or usage limit.", + "title": "GenerationErrorResponse" + }, + "V2ImageGenerateAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier": { + "type": "string", + "enum": [ + "1k", + "2k", + "4k" ], - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "image_asset_identifier": { - "contentType": "application/json" - } - }, - "schema": { - "$ref": "#/components/schemas/UpscaleImageTopazStandardV2Request" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpscaleImageTopazStandardV2Request" - } - } + "description": "The output resolution tier. Affects which model serves the request, since not every model offers every tier. When omitted, the selected model's default tier is used.", + "title": "V2ImageGenerateAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier" + }, + "MagicPromptMode": { + "type": "string", + "enum": [ + "auto", + "on", + "off" + ], + "description": "Determine if MagicPrompt should be used in generating the request or not.", + "title": "MagicPromptMode" + }, + "GenerateImageV2AutoResponse": { + "type": "object", + "properties": { + "generation_id": { + "type": "string", + "description": "URL-safe base64 ID of the generation. Use it to poll\n`GET /v2/generations/{generation_id}`.\n" }, - "description": "A request to upscale one image with Topaz Standard V2. Upload the source `image` using `multipart/form-data`.", - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpscaleImageTopazStandardV2Response" - } - } + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GeneratedImageObject" }, - "description": "The upscaled image (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests)." - }, - "400": { - "description": "Invalid input provided, or the output would exceed the 8K limit." + "description": "The generated images, in generation order. Present only for synchronous requests (`async` omitted or false)." }, - "401": { - "description": "Unauthorized." - }, - "402": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Insufficient credits or quota." + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." + } + }, + "required": [ + "generation_id", + "seed" + ], + "description": "Response returned by `POST /v2/image/generate/auto`. Synchronous\nrequests (the default) include the generated images in `data`.\nAsynchronous requests omit `data`; poll\n`GET /v2/generations/{generation_id}` with the returned\n`generation_id`. `seed` is the seed that was used, including when you\ndid not set one.\n", + "title": "GenerateImageV2AutoResponse" + }, + "V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaBackground": { + "type": "string", + "enum": [ + "auto", + "transparent", + "opaque" + ], + "default": "auto", + "description": "The output background. `transparent` returns images with an alpha channel, `opaque` returns a solid one, and `auto` decides for you.", + "title": "V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaBackground" + }, + "V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality": { + "type": "string", + "enum": [ + "very_low", + "low", + "medium", + "high" + ], + "description": "The rendering quality to use. Higher quality takes longer and costs more. Defaults to `medium` with source images and `high` without. `very_low`, the fastest and cheapest, requires source images.", + "title": "V2ImageGenerateIdeogram45PostRequestBodyContentMultipartFormDataSchemaQuality" + }, + "GenerateImageIdeogram45Response": { + "type": "object", + "properties": { + "generation_kind": { + "$ref": "#/components/schemas/GenerationKind" }, - "404": { - "description": "The source image was not found." + "generation_id": { + "type": "string", + "description": "URL-safe base64 ID of the generation. Use it to poll\n`GET /v2/generations/{generation_id}`.\n" }, - "429": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GeneratedImageObject" }, - "description": "Too many requests." - }, - "500": { - "description": "Internal server error." + "description": "The generated images, in generation order. Present only for synchronous requests (`async` omitted or false)." }, - "503": { - "description": "The endpoint is temporarily unavailable." + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." } }, - "summary": "Upscale with Topaz Standard V2", - "tags": [ - "images-upscale" - ], - "x-tool-description": "Upscale an image asset with Topaz Standard V2. No prompt; output is limited to 8192 pixels per side.", - "x-openapi-router-controller": "external_api.generated.openapi.controllers.images_upscale_controller" - } - }, - "/v2/image/upscale/topaz-text-refine": { - "post": { - "description": "Upscale an image to 2x, 4x, or 8x its original resolution; no prompt is\nneeded. Upload the source `image` using `multipart/form-data`.\nReturns results directly by default; set `async` or supply a\n`webhook_url` to get a `generation_id` and poll\n`GET /v2/generations/{generation_id}`.\n", - "operationId": "post_upscale_image_topaz_text_refine", - "parameters": [ - { - "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", - "in": "query", - "name": "dry_run", - "required": false, - "schema": { - "default": false, - "type": "boolean" - }, - "x-tool-description": "Validate and quote only; no generation, storage, billing, or safety review." - } + "required": [ + "generation_kind", + "generation_id", + "seed" ], - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "image_asset_identifier": { - "contentType": "application/json" - } - }, - "schema": { - "$ref": "#/components/schemas/UpscaleImageTopazTextRefineRequest" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpscaleImageTopazTextRefineRequest" - } - } + "description": "Response returned by `POST /v2/image/generate/ideogram-4-5`.\nSynchronous requests (the default) include the generated images in\n`data`. Asynchronous requests omit `data`; poll\n`GET /v2/generations/{generation_id}` with the returned\n`generation_id`. `seed` is the seed that was used, including when you\ndid not set one.\n", + "title": "GenerateImageIdeogram45Response" + }, + "ResolutionV4": { + "type": "string", + "enum": [ + "2048x2048", + "1440x2880", + "2880x1440", + "1664x2496", + "2496x1664", + "1792x2240", + "2240x1792", + "1440x2560", + "2560x1440", + "1600x2560", + "2560x1600", + "1728x2304", + "2304x1728", + "1296x3168", + "3168x1296", + "1152x2944", + "2944x1152", + "1248x3328", + "3328x1248", + "1280x3072", + "3072x1280", + "1024x3072", + "3072x1024", + "1024x1024", + "896x1120", + "1120x896", + "864x1152", + "1152x864", + "832x1248", + "1248x832", + "800x1280", + "1280x800", + "720x1280", + "1280x720", + "720x1440", + "1440x720", + "512x1536", + "1536x512" + ], + "description": "The 1K and 2K resolutions supported for Ideogram 4.0 image generation.", + "title": "ResolutionV4" + }, + "GenerateImageIdeogramV4RequestRenderingSpeed": { + "type": "string", + "enum": [ + "turbo", + "default", + "quality" + ], + "default": "default", + "description": "The rendering speed to use.", + "title": "GenerateImageIdeogramV4RequestRenderingSpeed" + }, + "GenerateImageIdeogramV4Request": { + "type": "object", + "properties": { + "prompt": { + "type": "string", + "minLength": 1, + "maxLength": 10000, + "description": "The prompt to generate images from, in natural language or as a\nstructured Ideogram 4.0 JSON prompt. A structured JSON prompt is\nused as is and skips magic prompt unless `magic_prompt` is `on`.\n" }, - "description": "A request to upscale one image with Topaz Text Refine. Upload the source `image` using `multipart/form-data`.", - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpscaleImageTopazTextRefineResponse" - } - } - }, - "description": "The upscaled image (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests)." + "magic_prompt": { + "$ref": "#/components/schemas/MagicPromptMode", + "default": "auto", + "description": "Controls how a natural-language prompt is prepared. `auto` (the\ndefault) and `on` rewrite and expand the prompt before generation.\n`off` keeps your wording and only converts it into a structured\nprompt. A valid structured JSON prompt skips magic prompt unless\n`magic_prompt` is `on`.\n" }, - "400": { - "description": "Invalid input provided, or the output would exceed the 8K limit." + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." }, - "401": { - "description": "Unauthorized." + "num_images": { + "type": "integer", + "minimum": 1, + "maximum": 8, + "default": 1, + "description": "The number of images to generate." }, - "402": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Insufficient credits or quota." + "resolution": { + "$ref": "#/components/schemas/ResolutionV4", + "description": "Optional. When supplied, the images are generated at this\nresolution. When omitted, an aspect ratio is picked automatically\nbased on the prompt.\n" }, - "404": { - "description": "The source image was not found." + "rendering_speed": { + "$ref": "#/components/schemas/GenerateImageIdeogramV4RequestRenderingSpeed", + "default": "default", + "description": "The rendering speed to use." }, - "429": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Too many requests." + "enable_copyright_detection": { + "type": [ + "boolean", + "null" + ], + "description": "Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`." }, - "500": { - "description": "Internal server error." + "async": { + "type": "boolean", + "default": false, + "description": "When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result." }, - "503": { - "description": "The endpoint is temporarily unavailable." + "webhook_url": { + "type": "string", + "format": "uri", + "maxLength": 2048, + "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n" } }, - "summary": "Upscale with Topaz Text Refine", - "tags": [ - "images-upscale" + "required": [ + "prompt" ], - "x-tool-description": "Upscale an image asset with Topaz Text Refine; prefer it for images where text or fine lettering must stay crisp. No prompt; output is limited to 8192 pixels per side.", - "x-openapi-router-controller": "external_api.generated.openapi.controllers.images_upscale_controller" - } - }, - "/v2/image/upscale/topaz-wonder-3-5": { - "post": { - "description": "Upscale an image to 2x, 4x, or 8x its original resolution, with\n`enhancement_strength` controlling how strongly detail is reconstructed.\nUpload the source `image` using `multipart/form-data`.\nReturns results directly by default; set `async` or supply a\n`webhook_url` to get a `generation_id` and poll\n`GET /v2/generations/{generation_id}`.\n", - "operationId": "post_upscale_image_topaz_wonder35", - "parameters": [ - { - "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", - "in": "query", - "name": "dry_run", - "required": false, - "schema": { - "default": false, - "type": "boolean" + "title": "GenerateImageIdeogramV4Request" + }, + "GenerateImageIdeogramV4Response": { + "type": "object", + "properties": { + "generation_id": { + "type": "string", + "description": "URL-safe base64 ID of the generation. Use it to poll\n`GET /v2/generations/{generation_id}`.\n" + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GeneratedImageObject" }, - "x-tool-description": "Validate and quote only; no generation, storage, billing, or safety review." + "description": "The generated images, in generation order. Present only for synchronous requests (`async` omitted or false)." + }, + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." } + }, + "required": [ + "generation_id", + "seed" ], - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "image_asset_identifier": { - "contentType": "application/json" - } - }, - "schema": { - "$ref": "#/components/schemas/UpscaleImageTopazWonder35Request" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpscaleImageTopazWonder35Request" - } - } + "description": "Response returned by `POST /v2/image/generate/ideogram-4`.\nSynchronous requests (the default) include the generated images in\n`data`. Asynchronous requests omit `data`; poll\n`GET /v2/generations/{generation_id}` with the returned\n`generation_id`. `seed` is the seed that was used, including when you\ndid not set one.\n", + "title": "GenerateImageIdeogramV4Response" + }, + "GenerateImageIdeogramV4CustomModelRequestRenderingSpeed": { + "type": "string", + "enum": [ + "turbo", + "default", + "quality" + ], + "description": "The rendering speed to use. When omitted, a speed supported by the custom model is used.", + "title": "GenerateImageIdeogramV4CustomModelRequestRenderingSpeed" + }, + "GenerateImageIdeogramV4CustomModelRequest": { + "type": "object", + "properties": { + "prompt": { + "type": "string", + "minLength": 1, + "maxLength": 10000, + "description": "The prompt to generate images from, in natural language or as a\nstructured Ideogram 4.0 JSON prompt. A structured JSON prompt is\nused as is and skips magic prompt unless `magic_prompt` is `on`.\n" }, - "description": "A request to upscale one image with Topaz Wonder 3.5. Upload the source `image` using `multipart/form-data`.", - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpscaleImageTopazWonder35Response" - } - } - }, - "description": "The upscaled image (synchronous requests), or an acknowledgement to poll with `GET /v2/generations/{generation_id}` (`async` requests)." + "custom_model_uri": { + "type": "string", + "pattern": "^model/[^/]+/version/[^/]+$", + "minLength": 1, + "maxLength": 512, + "description": "The custom model URI, in the form `model//version/`. You or your organization must have access to the model. The model determines which rendering speeds are supported." }, - "400": { - "description": "Invalid input provided, or the output would exceed the 8K limit." + "transparent_background": { + "type": "boolean", + "default": false, + "description": "Remove the background after generation and return transparent PNG images. Included in the custom model generation price at no extra charge. When false, the model's automatic background removal behavior still applies." }, - "401": { - "description": "Unauthorized." + "magic_prompt": { + "$ref": "#/components/schemas/MagicPromptMode", + "default": "auto", + "description": "Controls how a natural-language prompt is prepared. `auto` (the\ndefault) and `on` rewrite and expand the prompt before generation.\n`off` keeps your wording and only converts it into a structured\nprompt. A valid structured JSON prompt skips magic prompt unless\n`magic_prompt` is `on`.\n" }, - "402": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Insufficient credits or quota." + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." }, - "404": { - "description": "The source image was not found." + "num_images": { + "type": "integer", + "minimum": 1, + "maximum": 8, + "default": 1, + "description": "The number of images to generate." }, - "429": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Too many requests." + "resolution": { + "$ref": "#/components/schemas/ResolutionV4", + "description": "Optional. When supplied, the images are generated at this\nresolution. When omitted, an aspect ratio is picked automatically\nbased on the prompt.\n" }, - "500": { - "description": "Internal server error." + "rendering_speed": { + "$ref": "#/components/schemas/GenerateImageIdeogramV4CustomModelRequestRenderingSpeed", + "description": "The rendering speed to use. When omitted, a speed supported by the custom model is used." }, - "503": { - "description": "The endpoint is temporarily unavailable." + "enable_copyright_detection": { + "type": [ + "boolean", + "null" + ], + "description": "Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`." + }, + "async": { + "type": "boolean", + "default": false, + "description": "When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result." + }, + "webhook_url": { + "type": "string", + "format": "uri", + "maxLength": 2048, + "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n" } }, - "summary": "Upscale with Topaz Wonder 3.5", - "tags": [ - "images-upscale" + "required": [ + "prompt", + "custom_model_uri" ], - "x-tool-description": "Upscale an image asset with Topaz Wonder 3.5. enhancement_strength controls detail reconstruction. No prompt; output is limited to 8192 pixels per side.", - "x-openapi-router-controller": "external_api.generated.openapi.controllers.images_upscale_controller" - } - }, - "/v2/integrations": { - "get": { - "description": "Lists the distinct integration types enabled for the authenticated organization. The response does not expose configured integration rows, provider details, configuration, or credentials.", - "operationId": "get_integrations", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GetIntegrationsResponse" - } - } - }, - "description": "Enabled integration types for the authenticated organization." - }, - "401": { - "description": "Authentication is required." + "title": "GenerateImageIdeogramV4CustomModelRequest" + }, + "GenerateImageIdeogramV4CustomModelResponse": { + "type": "object", + "properties": { + "generation_id": { + "type": "string", + "description": "URL-safe base64 ID of the generation. Use it to poll\n`GET /v2/generations/{generation_id}`.\n" }, - "403": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/IntegrationErrorResponse" - } - } + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GeneratedImageObject" }, - "description": "The caller is not allowed to discover integrations or the mini-app token lacks the required existing asset-browsing scope." + "description": "The generated images, in generation order. Present only for synchronous requests (`async` omitted or false)." + }, + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." } }, - "security": [ - { - "BearerAuth": [] - } + "required": [ + "generation_id", + "seed" ], - "summary": "List enabled integration types", - "tags": [ - "integrations" + "description": "Response returned by `POST /v2/image/generate/ideogram-4-custom-model`.\nSynchronous requests (the default) include the generated images in\n`data`. Asynchronous requests omit `data`; poll\n`GET /v2/generations/{generation_id}` with the returned\n`generation_id`. `seed` is the seed that was used, including when you\ndid not set one.\n", + "title": "GenerateImageIdeogramV4CustomModelResponse" + }, + "IdeogramV4AspectRatio": { + "type": "string", + "enum": [ + "auto", + "1x4", + "1x3", + "1x2", + "9x16", + "10x16", + "2x3", + "3x4", + "4x5", + "1x1", + "5x4", + "4x3", + "3x2", + "16x10", + "16x9", + "2x1", + "3x1", + "4x1" ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.integrations_controller" - } - }, - "/v2/integrations/{integration_type}/assets/search": { - "post": { - "operationId": "post_integration_assets_search", - "parameters": [ - { - "description": "The integration operation family to search.", - "in": "path", - "name": "integration_type", - "required": true, - "schema": { - "$ref": "#/components/schemas/IntegrationType" - } - } + "default": "auto", + "description": "Supported output aspect ratios. The operation defines whether `auto`\npreserves the source shape or selects a shape from the prompt.\n", + "title": "IdeogramV4AspectRatio" + }, + "GenerateImageIdeogramV4TransparentRequestOutputResolution": { + "type": "string", + "enum": [ + "1k", + "2k", + "4k", + "8k" ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/IntegrationAssetSearchRequest" - } - } + "default": "1k", + "description": "The output resolution tier. Each tier is a total pixel budget equal\nto a square of the named size (for example, `8k` delivers at most\n8192x8192 pixels in total). Wide and tall aspect ratios keep the\nsame budget, so one side may exceed the named size. Tiers above\n2k are produced by upscaling after generation. Defaults to 1k.\n", + "title": "GenerateImageIdeogramV4TransparentRequestOutputResolution" + }, + "GenerateImageIdeogramV4TransparentRequestRenderingSpeed": { + "type": "string", + "enum": [ + "turbo", + "default", + "quality" + ], + "default": "default", + "description": "The rendering speed to use.", + "title": "GenerateImageIdeogramV4TransparentRequestRenderingSpeed" + }, + "GenerateImageIdeogramV4TransparentRequest": { + "type": "object", + "properties": { + "prompt": { + "type": "string", + "minLength": 1, + "maxLength": 10000, + "description": "The prompt to generate images from, in natural language or as a\nstructured Ideogram 4.0 JSON prompt. A structured JSON prompt is\nused as is and skips magic prompt, except that its background\ndescription is replaced with a transparent background.\n" }, - "required": true, - "x-body-name": "integration_asset_search_request" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/IntegrationAssetSearchResponse" - } - } - }, - "description": "A normalized, bounded set of assets from configured integrations." + "magic_prompt": { + "$ref": "#/components/schemas/MagicPromptMode", + "default": "auto", + "description": "Controls how a natural-language prompt is prepared. `auto` (the\ndefault) and `on` rewrite and expand the prompt before generation.\n`off` keeps your wording and only converts it into a structured\nprompt. A valid structured JSON prompt skips magic prompt unless\n`magic_prompt` is `on`.\n" }, - "400": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/IntegrationErrorResponse" - } - } - }, - "description": "The integration type or search request is invalid." + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." }, - "401": { - "description": "Authentication is required." + "num_images": { + "type": "integer", + "minimum": 1, + "maximum": 8, + "default": 1, + "description": "The number of images to generate." }, - "403": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/IntegrationErrorResponse" - } - } - }, - "description": "The caller is not allowed to search integrations or the mini-app token lacks the required existing asset-browsing scope." + "aspect_ratio": { + "$ref": "#/components/schemas/IdeogramV4AspectRatio", + "default": "auto" }, - "404": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/IntegrationErrorResponse" - } - } - }, - "description": "The requested integration type is not configured." + "output_resolution": { + "$ref": "#/components/schemas/GenerateImageIdeogramV4TransparentRequestOutputResolution", + "default": "1k", + "description": "The output resolution tier. Each tier is a total pixel budget equal\nto a square of the named size (for example, `8k` delivers at most\n8192x8192 pixels in total). Wide and tall aspect ratios keep the\nsame budget, so one side may exceed the named size. Tiers above\n2k are produced by upscaling after generation. Defaults to 1k.\n" }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/IntegrationErrorResponse" - } - } - }, - "description": "Integration search is not available." - } - }, - "security": [ - { - "BearerAuth": [] - } - ], - "summary": "Search assets from an enabled integration type", - "tags": [ - "integrations" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.integrations_controller" - } - }, - "/v2/tool/ad-localizer": { - "post": { - "description": "Rebuilds an ad in one target language, preserving its layout, logos,\nbrand type, and product so only the visible marketing copy changes.\nUpload the source ad as `image` using `multipart/form-data`; the copy\nis translated unless you supply `exact_copy`.\nReturns a `generation_id`; poll `GET /v2/generations/{generation_id}` or\nsupply a `webhook_url`.\n", - "operationId": "post_ad_localizer", - "parameters": [ - { - "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", - "in": "query", - "name": "dry_run", - "required": false, - "schema": { - "default": false, - "type": "boolean" - }, - "x-tool-description": "Validate and quote only; no generation, storage, billing, or safety review." - } - ], - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "image_asset_identifier": { - "contentType": "application/json" - } - }, - "schema": { - "$ref": "#/components/schemas/AdLocalizerRequest" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/AdLocalizerRequest" - } - } + "rendering_speed": { + "$ref": "#/components/schemas/GenerateImageIdeogramV4TransparentRequestRenderingSpeed", + "default": "default", + "description": "The rendering speed to use." }, - "description": "The source ad and the target language.", - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AdLocalizerResponse" - } - } - }, - "description": "Ad localization accepted for asynchronous processing." + "enable_copyright_detection": { + "type": [ + "boolean", + "null" + ], + "description": "Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`." }, - "400": { - "description": "Invalid input provided." + "async": { + "type": "boolean", + "default": false, + "description": "When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result." }, - "401": { - "description": "Unauthorized." + "webhook_url": { + "type": "string", + "format": "uri", + "maxLength": 2048, + "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n" + } + }, + "required": [ + "prompt" + ], + "title": "GenerateImageIdeogramV4TransparentRequest" + }, + "GenerateImageIdeogramV4TransparentResponse": { + "type": "object", + "properties": { + "generation_id": { + "type": "string", + "description": "URL-safe base64 ID of the generation. Use it to poll\n`GET /v2/generations/{generation_id}`.\n" }, - "402": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GeneratedImageObject" }, - "description": "Insufficient credits or quota." - }, - "403": { - "description": "Not authorized to use Ad Localizer." - }, - "404": { - "description": "An input asset was not found or is not readable." - }, - "422": { - "description": "The instruction did not pass prompt safety checks." + "description": "The generated images, in generation order. Present only for synchronous requests (`async` omitted or false)." }, - "429": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Too many requests." + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." } }, - "summary": "Ad Localizer", - "tags": [ - "edit-workflow" + "required": [ + "generation_id", + "seed" ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.edit_workflow_controller" - } - }, - "/v2/tool/ad-resizer": { - "post": { - "description": "Reframes an ad creative to an exact ad resolution, regenerating the\nlayout so text and key elements stay legible at the new size. Upload\nthe source creative as `image` using `multipart/form-data`, and supply\n`platform` to keep the ad inside that platform's safe zone.\nReturns a `generation_id`; poll `GET /v2/generations/{generation_id}` or\nsupply a `webhook_url`.", - "operationId": "post_ad_resizer", - "parameters": [ - { - "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", - "in": "query", - "name": "dry_run", - "required": false, - "schema": { - "default": false, - "type": "boolean" - }, - "x-tool-description": "Validate and quote only; no generation, storage, billing, or safety review." - } - ], - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "image_asset_identifier": { - "contentType": "application/json" - } - }, - "schema": { - "$ref": "#/components/schemas/AdResizerRequest" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/AdResizerRequest" - } - } - }, - "description": "The source creative, the target ad resolution, and optionally the platform whose safe zone the ad must stay inside.", - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AdResizerResponse" - } - } - }, - "description": "Ad resize accepted for asynchronous processing." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Unauthorized." - }, - "402": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Insufficient credits or quota." - }, - "403": { - "description": "Not authorized to resize an ad." - }, - "404": { - "description": "Source asset not found." - }, - "422": { - "description": "The prompt was rejected by safety checks." - }, - "429": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Too many requests." - } - }, - "summary": "Ad Resizer", - "tags": [ - "edit-workflow" - ], - "x-tool-description": "Adapt an ad or social creative to an exact placement size (feed, story, banner, display), relaying out text and key elements so they stay legible instead of cropping; set `platform` to keep it inside that platform's safe zone. One call per size.", - "x-fern-examples": [ - { - "request": { - "resolution": "1080x1920", - "platform": "tiktok", - "quality": "high", - "num_images": 1 - }, - "response": { - "body": { - "generation_id": "ZGVtb19nZW5lcmF0aW9uX2lk" - } - }, - "code-samples": [ - { - "sdk": "curl", - "code": "curl -X POST https://api.ideogram.ai/v2/tool/ad-resizer \\\n -H \"Api-Key: \" \\\n -H \"Content-Type: multipart/form-data\" \\\n -F image=@ \\\n -F resolution=1080x1920 \\\n -F platform=tiktok \\\n -F quality=high \\\n -F num_images=1\n" - }, - { - "sdk": "python", - "code": "import requests\n\nresponse = requests.post(\n \"https://api.ideogram.ai/v2/tool/ad-resizer\",\n headers={\"Api-Key\": \"\"},\n data={\n \"resolution\": \"1080x1920\",\n \"platform\": \"tiktok\",\n \"quality\": \"high\",\n \"num_images\": 1,\n },\n files={\"image\": open(\"\", \"rb\")},\n)\nprint(response.json())\n" - } - ] - } - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.edit_workflow_controller" - } - }, - "/v2/tool/ad-variations": { - "post": { - "description": "Creates on-brand variations of an ad along one axis, preserving logos,\nbrand colors, the product, and all on-image text. Upload the source\ncreative as `image` using `multipart/form-data` and choose a\n`variation_type`.\nReturns a `generation_id`; poll `GET /v2/generations/{generation_id}` or\nsupply a `webhook_url`.\n", - "operationId": "post_ad_variations", - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "image_asset_identifier": { - "contentType": "application/json" - } - }, - "schema": { - "$ref": "#/components/schemas/AdVariationsRequest" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/AdVariationsRequest" - } - } - }, - "description": "The source creative and the variation axis.", - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AdVariationsResponse" - } - } - }, - "description": "Ad variation accepted for asynchronous processing." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Unauthorized." - }, - "402": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Insufficient credits or quota." - }, - "403": { - "description": "Not authorized to generate ad variations." - }, - "404": { - "description": "Source asset not found." - }, - "422": { - "description": "The prompt was rejected by safety checks." - }, - "429": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Too many requests." - } - }, - "summary": "Ad Variations", - "tags": [ - "edit-workflow" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.edit_workflow_controller" - } - }, - "/v2/tool/colorways": { - "post": { - "description": "Recolors masked regions of a product photo, each to its own target\ncolor, preserving the product's geometry, materials, prints, logos, and\neverything outside the masks. Upload the `image` and up to 4 `masks`\nusing `multipart/form-data`, with one entry in `colors` per mask.\nReturns a `generation_id`; poll `GET /v2/generations/{generation_id}` or\nsupply a `webhook_url`.\n", - "operationId": "post_colorways", - "parameters": [ - { - "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", - "in": "query", - "name": "dry_run", - "required": false, - "schema": { - "default": false, - "type": "boolean" - }, - "x-tool-description": "Validate and quote only; no generation, storage, billing, or safety review." - } - ], - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "image_asset_identifier": { - "contentType": "application/json" - }, - "mask_asset_identifiers": { - "contentType": "application/json" - } - }, - "schema": { - "$ref": "#/components/schemas/ColorwaysRequest" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/ColorwaysRequest" - } - } - }, - "description": "The product photo, one mask or several masks marking the regions to recolor, and one target color per mask.", - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ColorwaysResponse" - } - } - }, - "description": "Colorway accepted for asynchronous processing." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Unauthorized." - }, - "402": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Insufficient credits or quota." - }, - "403": { - "description": "Not authorized to create a colorway." - }, - "429": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Too many requests." - } - }, - "summary": "Colorways", - "tags": [ - "edit-workflow" - ], - "x-tool-description": "Recolor masked regions of a product photo asset, each to its own target color, preserving geometry, materials, prints, logos, and everything outside the masks. Returns a generation reference.", - "x-openapi-router-controller": "external_api.generated.openapi.controllers.edit_workflow_controller" - } - }, - "/v2/tool/ghost-mannequin": { - "post": { - "description": "Turns photos of one garment into a ghost-mannequin product image on a\nclean white studio background, removing the person, mannequin, hanger,\nand other clothing. Upload the photos using `multipart/form-data`, in\nthe directional fields (such as `front_image`) when the camera\ndirection is known and in `garment_images` otherwise.\nReturns a `generation_id`; poll `GET /v2/generations/{generation_id}` or\nsupply a `webhook_url`.\n", - "operationId": "post_ghost_mannequin", - "parameters": [ - { - "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", - "in": "query", - "name": "dry_run", - "required": false, - "schema": { - "default": false, - "type": "boolean" - }, - "x-tool-description": "Validate and quote only; no generation, storage, billing, or safety review." - } - ], - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "garment_asset_identifiers": { - "contentType": "application/json" - }, - "front_asset_identifier": { - "contentType": "application/json" - }, - "back_asset_identifier": { - "contentType": "application/json" - }, - "left_asset_identifier": { - "contentType": "application/json" - }, - "right_asset_identifier": { - "contentType": "application/json" - }, - "top_asset_identifier": { - "contentType": "application/json" - }, - "bottom_asset_identifier": { - "contentType": "application/json" - }, - "output_reference_asset_identifier": { - "contentType": "application/json" - } - }, - "schema": { - "$ref": "#/components/schemas/GhostMannequinRequest" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/GhostMannequinRequest" - } - } - }, - "description": "The garment photos and the requested output view.", - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GhostMannequinResponse" - } - } - }, - "description": "Ghost-mannequin generation accepted for asynchronous processing." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Unauthorized." - }, - "402": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Insufficient credits or quota." - }, - "403": { - "description": "Not authorized to create ghost-mannequin images." - }, - "404": { - "description": "An input asset was not found or is not readable." - }, - "413": { - "description": "The combined raw image uploads exceed 100 MB." - }, - "422": { - "description": "The instruction did not pass prompt safety validation." - }, - "429": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Too many requests." - } - }, - "summary": "Ghost Mannequin", - "tags": [ - "edit-workflow" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.edit_workflow_controller" - } - }, - "/v2/tool/living-image": { - "post": { - "description": "Animates one image into a short, loop-ready clip for use as a living background. The camera stays fixed and only the parts of the scene that would move in real life move: water, light, mist, particles, fabric, creatures. Ideogram inspects the image and writes the motion prompt, so the request needs only the image.\nVideo generation runs asynchronously. Poll `GET /v1/generations/{generation_id}` with the returned `generation_id` until the generation completes or fails.", - "operationId": "post_living_image", - "parameters": [ - { - "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", - "in": "query", - "name": "dry_run", - "required": false, - "schema": { - "default": false, - "type": "boolean" - }, - "x-tool-description": "Validate and quote only; no generation, storage, billing, or safety review." - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/LivingImageRequest" - } - } - }, - "description": "The image to bring to life and the output options.", - "required": true, - "x-body-name": "living_image_request" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/LivingImageResponse" - } - } - }, - "description": "Living image accepted for asynchronous processing." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Unauthorized." - }, - "402": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Insufficient credits or quota." - }, - "403": { - "description": "This account does not have access to video generation." - }, - "404": { - "description": "The image was not found or is not readable." - }, - "429": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Too many requests." - }, - "503": { - "description": "The endpoint is temporarily unavailable." - } - }, - "summary": "Turn a still image into a subtle looping video", - "tags": [ - "video-generate" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.video_generate_controller" - } - }, - "/v2/tool/material-swap": { - "post": { - "description": "Re-renders masked regions of a product photo in the materials shown in\nreference images, preserving the product's construction and everything\noutside the masks. Upload the `image`, up to 4 `masks`, and the\n`materials` using `multipart/form-data`.\nReturns a `generation_id`; poll `GET /v2/generations/{generation_id}` or\nsupply a `webhook_url`.\n", - "operationId": "post_material_swap", - "parameters": [ - { - "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", - "in": "query", - "name": "dry_run", - "required": false, - "schema": { - "default": false, - "type": "boolean" - }, - "x-tool-description": "Validate and quote only; no generation, storage, billing, or safety review." - } - ], - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "image_asset_identifier": { - "contentType": "application/json" - }, - "mask_asset_identifiers": { - "contentType": "application/json" - }, - "material_asset_identifiers": { - "contentType": "application/json" - } - }, - "schema": { - "$ref": "#/components/schemas/MaterialSwapRequest" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/MaterialSwapRequest" - } - } - }, - "description": "The product photo, one mask or several masks marking the regions to change, and either one shared material reference or one per mask.", - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MaterialSwapResponse" - } - } - }, - "description": "Material swap accepted for asynchronous processing." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Unauthorized." - }, - "402": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Insufficient credits or quota." - }, - "403": { - "description": "Not authorized to create a material swap." - }, - "429": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Too many requests." - } - }, - "summary": "Material Swap", - "tags": [ - "edit-workflow" - ], - "x-tool-description": "Re-render masked regions of a product photo asset in the materials shown in reference image assets, preserving the product's construction and everything outside the masks. Returns a generation reference.", - "x-openapi-router-controller": "external_api.generated.openapi.controllers.edit_workflow_controller" - } - }, - "/v2/tool/model-pose-variants": { - "post": { - "description": "Changes the model's pose or camera angle in a fashion image while\npreserving the model, garment, styling, and scene. Upload the\n`source_image` using `multipart/form-data` and describe the new pose in\n`instruction`.\nReturns a `generation_id`; poll `GET /v2/generations/{generation_id}` or\nsupply a `webhook_url`.\n", - "operationId": "post_model_pose_variants", - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "source_asset_identifier": { - "contentType": "application/json" - }, - "pose_reference_asset_identifier": { - "contentType": "application/json" - } - }, - "schema": { - "$ref": "#/components/schemas/ModelPoseVariantsRequest" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/ModelPoseVariantsRequest" - } - } - }, - "description": "The fashion image to edit and the pose direction.", - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ModelPoseVariantsResponse" - } - } - }, - "description": "Pose-variant generation accepted for asynchronous processing." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Unauthorized." - }, - "402": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Insufficient credits or quota." - }, - "403": { - "description": "Not authorized to generate pose variants." - }, - "404": { - "description": "An input asset was not found or is not readable." - }, - "422": { - "description": "The instruction did not pass prompt safety checks." - }, - "429": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Too many requests." - } - }, - "summary": "Model Pose Variants", - "tags": [ - "edit-workflow" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.edit_workflow_controller" - } - }, - "/v2/tool/model-swap": { - "post": { - "description": "Replaces the model in a fashion image with the person shown in one to\nfour target-model references, keeping the product, pose, scene,\nlighting, and framing. Upload the working image as `source_image` using\n`multipart/form-data`.\nReturns a `generation_id`; poll `GET /v2/generations/{generation_id}` or\nsupply a `webhook_url`.\n", - "operationId": "post_model_swap", - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "source_asset_identifier": { - "contentType": "application/json" - }, - "model_asset_identifiers": { - "contentType": "application/json" - } - }, - "schema": { - "$ref": "#/components/schemas/ModelSwapRequest" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/ModelSwapRequest" - } - } - }, - "description": "The working image and one to four ordered target-model references.", - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ModelSwapResponse" - } - } - }, - "description": "Model swap accepted for asynchronous processing." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Unauthorized." - }, - "402": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Insufficient credits or quota." - }, - "403": { - "description": "Not authorized to use model swap." - }, - "404": { - "description": "An input asset was not found or is not readable." - }, - "422": { - "description": "The instruction did not pass prompt safety checks." - }, - "429": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Too many requests." - } - }, - "summary": "Model Swap", - "tags": [ - "edit-workflow" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.edit_workflow_controller" - } - }, - "/v2/tool/packshots": { - "post": { - "description": "Creates one polished product photograph from one or more ordered product\nreferences. An optional style reference may guide framing, crop,\nbackground, and lighting without changing the product's identity.\n\nThe request is processed asynchronously. Poll\n`GET /v2/generations/{generation_id}` with the returned `generation_id`\nuntil the generation is completed or failed. Product fidelity is\nbest-effort and details absent from every reference may be reconstructed.\n", - "operationId": "post_packshots", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PackshotsRequest" - } - } - }, - "description": "Product references, one requested view, and studio art direction.", - "required": true, - "x-body-name": "packshots_request" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PackshotsResponse" - } - } - }, - "description": "Packshot accepted for asynchronous processing." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Unauthorized." - }, - "402": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Insufficient credits or quota." - }, - "403": { - "description": "Not authorized to create packshots." - }, - "429": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Too many requests." - } - }, - "summary": "Packshots", - "tags": [ - "edit-workflow" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.edit_workflow_controller" - } - }, - "/v2/tool/product-360-video": { - "post": { - "description": "Animates one product image through a complete turntable revolution and returns to the starting pose so the result loops cleanly.\nVideo generation runs asynchronously. Poll `GET /v2/generations/{generation_id}` with the returned `generation_id` until the generation completes or fails.", - "operationId": "post_product360_video", - "parameters": [ - { - "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", - "in": "query", - "name": "dry_run", - "required": false, - "schema": { - "default": false, - "type": "boolean" - }, - "x-tool-description": "Validate and quote only; no generation, storage, billing, or safety review." - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Product360VideoRequest" - } - } - }, - "description": "The product image and requested turntable motion.", - "required": true, - "x-body-name": "product360_video_request" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateVideoSeedDance25Response" - } - } - }, - "description": "Product video accepted for asynchronous processing." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Unauthorized." - }, - "402": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Insufficient credits or quota." - }, - "403": { - "description": "This account does not have access to product video generation." - }, - "404": { - "description": "The product image was not found or is not readable." - }, - "422": { - "description": "The product description did not pass safety checks." - }, - "429": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Too many requests." - }, - "503": { - "description": "The endpoint is temporarily unavailable." - } - }, - "summary": "Product 360 Video", - "tags": [ - "video-generate" - ], - "x-tool-description": "Animate a product image through one complete turntable revolution, returning to the starting pose for a seamless loop.", - "x-openapi-router-controller": "external_api.generated.openapi.controllers.video_generate_controller" - } - }, - "/v2/tool/skechers-style-editor": { - "post": { - "description": "Edits the base image while preserving details the instruction does not\nchange. Image 1 is the base; reference images are numbered from image 2\nin the supplied order. Resolve image mentions to these numbers before\nsubmitting. Descriptions identify the selected view or reference.\n\nPoll GET /v2/generations/{generation_id} with the returned generation_id\nuntil the workflow completes or fails.\n", - "operationId": "post_skechers_style_edit", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SkechersStyleEditRequest" - } - } - }, - "required": true, - "x-body-name": "skechers_style_edit_request" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SkechersStyleEditResponse" - } - } - }, - "description": "Style edit accepted for asynchronous processing." - }, - "400": { - "description": "Invalid instruction, references, or output settings." - }, - "401": { - "description": "Unauthorized." - }, - "402": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Insufficient credits or quota." - }, - "403": { - "description": "This account or mini app is not authorized to use Style Editor." - }, - "404": { - "description": "An input asset was not found or is not readable." - }, - "422": { - "description": "The instruction or image descriptions did not pass prompt safety checks." - }, - "429": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Too many requests." - } - }, - "summary": "Edit a product image using an instruction and ordered references", - "tags": [ - "edit-workflow" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.edit_workflow_controller" - } - }, - "/v2/tool/sketch-to-render": { - "post": { - "description": "Turns a fashion sketch into photorealistic garment or product imagery,\npreserving its silhouette, construction, colors, and design details.\nUpload the `sketch_image` using `multipart/form-data` and describe\nmaterials and rendering in `instruction`.\nReturns a `generation_id`; poll `GET /v2/generations/{generation_id}` or\nsupply a `webhook_url`.\n", - "operationId": "post_sketch_to_render", - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "sketch_asset_identifier": { - "contentType": "application/json" - } - }, - "schema": { - "$ref": "#/components/schemas/SketchToRenderRequest" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/SketchToRenderRequest" - } - } - }, - "description": "The source sketch and the material and rendering direction to apply.", - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SketchToRenderResponse" - } - } - }, - "description": "Sketch rendering accepted for asynchronous processing." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Unauthorized." - }, - "402": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Insufficient credits or quota." - }, - "403": { - "description": "Not authorized to render sketches." - }, - "404": { - "description": "The referenced sketch was not found or is not readable." - }, - "422": { - "description": "The instruction did not pass prompt safety validation." - }, - "429": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Too many requests." - } - }, - "summary": "Sketch to Render", - "tags": [ - "edit-workflow" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.edit_workflow_controller" - } - }, - "/v2/tool/sole-swap": { - "post": { - "description": "Uses the sole-donor shoe as the output canvas, preserving its sole, camera,\nbackground, and lighting while transferring the upper from ordered references.\n\nThe request is processed asynchronously. Poll\n`GET /v2/generations/{generation_id}` with the returned\n`generation_id` until the generation is completed or failed.\n", - "operationId": "post_sole_swap", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SoleSwapRequest" - } - } - }, - "required": true, - "x-body-name": "sole_swap_request" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SoleSwapResponse" - } - } - }, - "description": "Sole swap accepted for asynchronous processing." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Unauthorized." - }, - "402": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Insufficient credits or quota." - }, - "403": { - "description": "This account or mini app is not authorized to use Sole Swap." - }, - "404": { - "description": "An input asset was not found or is not readable." - }, - "422": { - "description": "The instruction did not pass prompt safety checks." - }, - "429": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Too many requests." - } - }, - "summary": "Sole Swap", - "tags": [ - "edit-workflow" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.edit_workflow_controller" - } - }, - "/v2/tool/swan-s-logo-design": { - "post": { - "description": "Creates one isolated logo candidate using either a shoe swatch or a supplied style reference. For 3D reference designs, choose split or full coverage with design_variant. Send a separate request for each candidate; each request completes and is billed independently. Processing is asynchronous. Poll GET /v2/generations/{generation_id} until completed or failed.", - "operationId": "post_swan_s_logo_design", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SwanSLogoDesignRequest" - } - } - }, - "required": true, - "x-body-name": "swan_s_logo_design_request" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SwanSLogoDesignResponse" - } - } - }, - "description": "Accepted for asynchronous processing." - }, - "400": { - "description": "Invalid asset roles, count, or options." - }, - "401": { - "description": "Authentication required." - }, - "403": { - "description": "This account or app is not authorized." - }, - "404": { - "description": "An input asset was not found or is not readable." - }, - "402": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Insufficient credits or quota." - }, - "429": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Too many requests." - } - }, - "summary": "Design one Swan S logo candidate", - "tags": [ - "edit-workflow" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.edit_workflow_controller" - } - }, - "/v2/tool/swan-s-logo-install": { - "post": { - "description": "Installs the selected logo onto the ordered shoe views, preserving the shoe and chosen camera framing. Processing is asynchronous. Poll GET /v2/generations/{generation_id} until completed or failed.", - "operationId": "post_swan_s_logo_install", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SwanSLogoInstallRequest" - } - } - }, - "required": true, - "x-body-name": "swan_s_logo_install_request" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SwanSLogoInstallResponse" - } - } - }, - "description": "Accepted for asynchronous processing." - }, - "400": { - "description": "Invalid asset roles, count, or options." - }, - "401": { - "description": "Authentication required." - }, - "403": { - "description": "This account or app is not authorized." - }, - "404": { - "description": "An input asset was not found or is not readable." - }, - "402": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Insufficient credits or quota." - }, - "429": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Too many requests." - } - }, - "summary": "Install a Swan S logo on a shoe", - "tags": [ - "edit-workflow" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.edit_workflow_controller" - } - }, - "/v2/tool/swap-product": { - "post": { - "description": "Edits the footwear in a source advertisement using ordered product references.\nPoll `GET /v2/generations/{generation_id}` for status and image results.\n", - "operationId": "post_swap_product", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SwapProductRequest" - } - } - }, - "required": true, - "x-body-name": "swap_product_request" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SwapProductResponse" - } - } - }, - "description": "Footwear edit accepted for asynchronous processing." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Unauthorized." - }, - "403": { - "description": "Not authorized to use this workflow." - }, - "404": { - "description": "An input image was not found or is not readable." - }, - "422": { - "description": "The instruction did not pass safety checks." - }, - "402": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Insufficient credits or quota." - }, - "429": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Too many requests." - } - }, - "summary": "Swap Product", - "tags": [ - "edit-workflow" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.edit_workflow_controller" - } - }, - "/v2/tool/text-layerizer": { - "post": { - "description": "Turns a flat image into an editable design asynchronously: detected text\nis returned as positioned text blocks with matched fonts, sizes, and\ncolors, alongside a text-free base image and a standalone HTML page of\nthe editable design. Returns a `generation_id`; poll\n`GET /v2/generations/{generation_id}` or supply a `webhook_url`.", - "operationId": "post_text_layerizer", - "parameters": [ - { - "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", - "in": "query", - "name": "dry_run", - "required": false, - "schema": { - "default": false, - "type": "boolean" - }, - "x-tool-description": "Validate and quote only; no generation, storage, billing, or safety review." - } - ], - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "image_asset_identifier": { - "contentType": "application/json" - } - }, - "schema": { - "$ref": "#/components/schemas/TextLayerizerRequest" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/TextLayerizerRequest" - } - } - }, - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TextLayerizerResponse" - } - } - }, - "description": "Layerization accepted; dry runs return the shared PriceQuote response." - }, - "400": { - "description": "Invalid source image, font file, or input combination." - }, - "401": { - "description": "Authentication required." - }, - "402": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Insufficient credits." - }, - "403": { - "description": "Access denied." - }, - "404": { - "description": "Source not found." - }, - "429": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Too many requests." - }, - "503": { - "description": "Layerization is unavailable." - } - }, - "summary": "Text Layerizer", - "tags": [ - "edit-workflow" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.edit_workflow_controller" - } - }, - "/v2/tool/vectorizer": { - "post": { - "description": "Converts an image to SVG asynchronously.", - "operationId": "post_vectorizer", - "parameters": [ - { - "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", - "in": "query", - "name": "dry_run", - "required": false, - "schema": { - "default": false, - "type": "boolean" - }, - "x-tool-description": "Validate and quote only; no generation, storage, billing, or safety review." - } - ], - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "image_asset_identifier": { - "contentType": "application/json" - } - }, - "schema": { - "$ref": "#/components/schemas/VectorizerRequest" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/VectorizerRequest" - } - } - }, - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VectorizerResponse" - } - } - }, - "description": "Conversion accepted; dry runs return the shared PriceQuote response." - }, - "400": { - "description": "Invalid source image or input combination." - }, - "401": { - "description": "Authentication required." - }, - "402": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Insufficient credits." - }, - "403": { - "description": "Access denied." - }, - "404": { - "description": "Source not found." - }, - "429": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Too many requests." - }, - "503": { - "description": "Conversion is unavailable." - } - }, - "summary": "Vectorizer", - "tags": [ - "edit-workflow" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.edit_workflow_controller" - } - }, - "/v2/video/edit/seedance-2": { - "post": { - "description": "Edit a video you already have stored with Ideogram by replacing part of\nit. Reference the source video with `video_asset_identifier` and mark the\nspan to replace with `start_frame_time` and `end_frame_time`, in seconds.\nSeedance 2.0 generates a new clip for that span from your prompt, and the\nresult is the source video with the generated clip spliced in over the\nspan: everything before `start_frame_time`, then the generated clip, then\neverything from `end_frame_time` on. That edited video is the asset the\nrequest produces.\n\n`is_start_frame_included` and `is_end_frame_included` anchor the generated\nclip on the span's own end frames, so it joins the surrounding footage\ninstead of cutting to something unrelated. Anchoring the start opens the\nclip on the frame already at `start_frame_time`; anchoring the end lands\nit on the frame at `end_frame_time`; anchoring both joins at each seam. At\nleast one must be anchored.\n\nThe generated clip is used at its own length, which the model rarely makes\nexactly the span's, so the edited video is usually a different length from\nthe source. Request a `duration` close to the span to keep them near each\nother. The clip is scaled and cropped to fill the source's frame and\nconformed to its frame rate, so resolution and aspect ratio follow the\nsource rather than being requested.\n\nVideo generation always runs asynchronously: the response returns as\nsoon as the request is accepted and carries only a `generation_id`.\nPoll for completion and results with\n`GET /v2/generations/{generation_id}` using that id, or supply a\n`webhook_url` to have the finished result POSTed to your server\ninstead.\n\nVideo links are available for a limited period of time; download the\nvideo if you want to keep it.\n", - "operationId": "post_edit_video_seed_dance2", - "parameters": [ - { - "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", - "in": "query", - "name": "dry_run", - "required": false, - "schema": { - "default": false, - "type": "boolean" - }, - "x-tool-description": "Validate and quote only; no generation, storage, billing, or safety review." - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EditVideoSeedDance2Request" - } - } - }, - "description": "A request to edit a video with Seedance 2.0, regenerating it from frames of the source video.", - "required": true, - "x-body-name": "edit_video_seed_dance2_request" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateVideoSeedDance2Response" - } - } - }, - "description": "An acknowledgement to poll with `GET /v2/generations/{generation_id}`." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Unauthorized." - }, - "402": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Insufficient credits or quota." - }, - "403": { - "description": "This account does not have access to this model." - }, - "404": { - "description": "The referenced source video was not found." - }, - "422": { - "description": "The prompt did not pass safety checks." - }, - "429": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Too many requests." - }, - "500": { - "description": "Internal server error." - }, - "503": { - "description": "The endpoint is temporarily unavailable." - } - }, - "summary": "Edit video with Seedance 2.0", - "tags": [ - "video-edit" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.video_edit_controller" - } - }, - "/v2/video/generate/kling-3-standard-image-to-video": { - "post": { - "description": "Generate a video from a first-frame image and a text prompt with Kling\nv3 Standard. Upload the first frame as `image`, and optionally a final\nframe as `end_image`, using `multipart/form-data`.\nReturns a `generation_id`; poll `GET /v2/generations/{generation_id}`\nor supply a `webhook_url`.\n", - "operationId": "post_generate_video_kling_v3_standard_image_to_video", - "parameters": [ - { - "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", - "in": "query", - "name": "dry_run", - "required": false, - "schema": { - "default": false, - "type": "boolean" - }, - "x-tool-description": "Validate and quote only; no generation, storage, billing, or safety review." - } - ], - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "image_asset_identifier": { - "contentType": "application/json" - }, - "end_image_asset_identifier": { - "contentType": "application/json" - } - }, - "schema": { - "$ref": "#/components/schemas/GenerateVideoKlingV3StandardImageToVideoRequest" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateVideoKlingV3StandardImageToVideoRequest" - } - } - }, - "description": "A request to generate a video from a first-frame image with Kling v3 Standard. Upload the first frame as `image` using `multipart/form-data`.", - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateVideoKlingV3Response" - } - } - }, - "description": "An acknowledgement to poll with `GET /v2/generations/{generation_id}`." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Unauthorized." - }, - "402": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Insufficient credits or quota." - }, - "403": { - "description": "This account does not have access to this model." - }, - "404": { - "description": "The first-frame image was not found." - }, - "422": { - "description": "The prompt did not pass safety checks." - }, - "429": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Too many requests." - }, - "500": { - "description": "Internal server error." - }, - "503": { - "description": "The endpoint is temporarily unavailable." - } - }, - "summary": "Image to video with Kling v3 Standard", - "tags": [ - "video-generate" - ], - "x-tool-description": "Animate a first-frame image asset with Kling v3 Standard. Supply end_image_asset_identifier for a transition to a final frame. Video download links expire.", - "x-openapi-router-controller": "external_api.generated.openapi.controllers.video_generate_controller" - } - }, - "/v2/video/generate/kling-3-standard-text-to-video": { - "post": { - "description": "Generate a video from a text prompt with Kling v3 Standard.\nReturns a `generation_id`; poll `GET /v2/generations/{generation_id}`\nor supply a `webhook_url`.\n", - "operationId": "post_generate_video_kling_v3_standard_text_to_video", - "parameters": [ - { - "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", - "in": "query", - "name": "dry_run", - "required": false, - "schema": { - "default": false, - "type": "boolean" - }, - "x-tool-description": "Validate and quote only; no generation, storage, billing, or safety review." - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateVideoKlingV3StandardTextToVideoRequest" - } - } - }, - "description": "A request to generate a video from a text prompt with Kling v3 Standard.", - "required": true, - "x-body-name": "generate_video_kling_v3_standard_text_to_video_request" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateVideoKlingV3Response" - } - } - }, - "description": "An acknowledgement to poll with `GET /v2/generations/{generation_id}`." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Unauthorized." - }, - "402": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Insufficient credits or quota." - }, - "403": { - "description": "This account does not have access to this model." - }, - "422": { - "description": "The prompt did not pass safety checks." - }, - "429": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Too many requests." - }, - "500": { - "description": "Internal server error." - }, - "503": { - "description": "The endpoint is temporarily unavailable." - } - }, - "summary": "Text to video with Kling v3 Standard", - "tags": [ - "video-generate" - ], - "x-tool-description": "Generate a video from text with Kling v3 Standard. Video download links expire.", - "x-openapi-router-controller": "external_api.generated.openapi.controllers.video_generate_controller" - } - }, - "/v2/video/generate/minimax-h3-image-to-video": { - "post": { - "description": "Generate a video from a first-frame image and a text prompt with\nMiniMax H3. Upload the first frame as `image`, and optionally a final\nframe as `end_image`, using `multipart/form-data`.\nReturns a `generation_id`; poll `GET /v2/generations/{generation_id}`\nor supply a `webhook_url`.\n", - "operationId": "post_generate_video_minimax_h3_image_to_video", - "parameters": [ - { - "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", - "in": "query", - "name": "dry_run", - "required": false, - "schema": { - "default": false, - "type": "boolean" - }, - "x-tool-description": "Validate and quote only; no generation, storage, billing, or safety review." - } - ], - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "image_asset_identifier": { - "contentType": "application/json" - }, - "end_image_asset_identifier": { - "contentType": "application/json" - } - }, - "schema": { - "$ref": "#/components/schemas/GenerateVideoMinimaxH3ImageToVideoRequest" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateVideoMinimaxH3ImageToVideoRequest" - } - } - }, - "description": "A request to generate a video from a first-frame image with MiniMax H3. Upload the first frame as `image` using `multipart/form-data`.", - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateVideoMinimaxH3Response" - } - } - }, - "description": "An acknowledgement to poll with `GET /v2/generations/{generation_id}`." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Unauthorized." - }, - "402": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Insufficient credits or quota." - }, - "403": { - "description": "This account does not have access to this model." - }, - "404": { - "description": "The first-frame image was not found." - }, - "422": { - "description": "The prompt did not pass safety checks." - }, - "429": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Too many requests." - }, - "500": { - "description": "Internal server error." - }, - "503": { - "description": "The endpoint is temporarily unavailable." - } - }, - "summary": "Image to video with MiniMax H3", - "tags": [ - "video-generate" - ], - "x-tool-description": "Animate a first-frame image asset with MiniMax H3. Supply end_image_asset_identifier for a transition to a final frame. Video download links expire.", - "x-openapi-router-controller": "external_api.generated.openapi.controllers.video_generate_controller" - } - }, - "/v2/video/generate/minimax-h3-reference-to-video": { - "post": { - "description": "Produce a video from a text prompt and optional reference media with\nMiniMax H3. Upload `reference_images` and `reference_audios` using\n`multipart/form-data`, and address them in the prompt by position\n(`Image 1`, `Audio 1`, …). Returns a `generation_id`; poll\n`GET /v2/generations/{generation_id}` or supply a `webhook_url`.\n", - "operationId": "post_edit_video_minimax_h3_reference_to_video", - "parameters": [ - { - "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", - "in": "query", - "name": "dry_run", - "required": false, - "schema": { - "default": false, - "type": "boolean" - }, - "x-tool-description": "Validate and quote only; no generation, storage, billing, or safety review." - } - ], - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "reference_image_asset_identifiers": { - "contentType": "application/json" - }, - "reference_video_asset_identifiers": { - "contentType": "application/json" - } - }, - "schema": { - "$ref": "#/components/schemas/EditVideoMinimaxH3ReferenceToVideoRequest" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/EditVideoMinimaxH3ReferenceToVideoRequest" - } - } - }, - "description": "A request to produce a video from reference media with MiniMax H3. Use `multipart/form-data` to upload reference media.", - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateVideoMinimaxH3Response" - } - } - }, - "description": "An acknowledgement to poll with `GET /v2/generations/{generation_id}`." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Unauthorized." - }, - "402": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Insufficient credits or quota." - }, - "403": { - "description": "This account does not have access to this model." - }, - "404": { - "description": "A referenced asset was not found." - }, - "422": { - "description": "The prompt did not pass safety checks." - }, - "429": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Too many requests." - }, - "500": { - "description": "Internal server error." - }, - "503": { - "description": "The endpoint is temporarily unavailable." - } - }, - "summary": "Reference to video with MiniMax H3", - "tags": [ - "video-edit" - ], - "x-tool-description": "Generate a video with MiniMax H3 from text and optional reference image/video assets. Address references as Image 1 and Video 1 in prompt order. Video download links expire.", - "x-openapi-router-controller": "external_api.generated.openapi.controllers.video_edit_controller" - } - }, - "/v2/video/generate/minimax-h3-text-to-video": { - "post": { - "description": "Generate a video from a text prompt with MiniMax H3.\nReturns a `generation_id`; poll `GET /v2/generations/{generation_id}`\nor supply a `webhook_url`.\n", - "operationId": "post_generate_video_minimax_h3_text_to_video", - "parameters": [ - { - "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", - "in": "query", - "name": "dry_run", - "required": false, - "schema": { - "default": false, - "type": "boolean" - }, - "x-tool-description": "Validate and quote only; no generation, storage, billing, or safety review." - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateVideoMinimaxH3TextToVideoRequest" - } - } - }, - "description": "A request to generate a video from a text prompt with MiniMax H3.", - "required": true, - "x-body-name": "generate_video_minimax_h3_text_to_video_request" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateVideoMinimaxH3Response" - } - } - }, - "description": "An acknowledgement to poll with `GET /v2/generations/{generation_id}`." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Unauthorized." - }, - "402": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Insufficient credits or quota." - }, - "403": { - "description": "This account does not have access to this model." - }, - "422": { - "description": "The prompt did not pass safety checks." - }, - "429": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Too many requests." - }, - "500": { - "description": "Internal server error." - }, - "503": { - "description": "The endpoint is temporarily unavailable." - } - }, - "summary": "Text to video with MiniMax H3", - "tags": [ - "video-generate" - ], - "x-tool-description": "Generate a video from text with MiniMax H3. Video download links expire.", - "x-openapi-router-controller": "external_api.generated.openapi.controllers.video_generate_controller" - } - }, - "/v2/video/generate/seedance-2-5-image-to-video": { - "post": { - "description": "Generate a video from a first-frame image and a text prompt with\nSeedance 2.5. Upload the first frame as `image`, and optionally a final\nframe as `end_image`, using `multipart/form-data`.\nReturns a `generation_id`; poll `GET /v2/generations/{generation_id}`\nor supply a `webhook_url`.\n", - "operationId": "post_generate_video_seed_dance25_image_to_video", - "parameters": [ - { - "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", - "in": "query", - "name": "dry_run", - "required": false, - "schema": { - "default": false, - "type": "boolean" - }, - "x-tool-description": "Validate and quote only; no generation, storage, billing, or safety review." - } - ], - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "image_asset_identifier": { - "contentType": "application/json" - }, - "end_image_asset_identifier": { - "contentType": "application/json" - } - }, - "schema": { - "$ref": "#/components/schemas/GenerateVideoSeedDance25ImageToVideoRequest" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateVideoSeedDance25ImageToVideoRequest" - } - } - }, - "description": "A request to generate a video from a first-frame image with Seedance 2.5. Upload the first frame as `image` using `multipart/form-data`.", - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateVideoSeedDance25Response" - } - } - }, - "description": "An acknowledgement to poll with `GET /v2/generations/{generation_id}`." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Unauthorized." - }, - "402": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Insufficient credits or quota." - }, - "403": { - "description": "This account does not have access to this model." - }, - "404": { - "description": "The first-frame image was not found." - }, - "422": { - "description": "The prompt did not pass safety checks." - }, - "429": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Too many requests." - }, - "500": { - "description": "Internal server error." - }, - "503": { - "description": "The endpoint is temporarily unavailable." - } - }, - "summary": "Image to video with Seedance 2.5", - "tags": [ - "video-generate" - ], - "x-tool-description": "Animate a first-frame image asset with Seedance 2.5. Supply end_image_asset_identifier for a transition to a final frame. Video download links expire.", - "x-openapi-router-controller": "external_api.generated.openapi.controllers.video_generate_controller" - } - }, - "/v2/video/generate/seedance-2-5-reference-to-video": { - "post": { - "description": "Generate a video from a text prompt and reference media with\nSeedance 2.5. Upload at least one image in `reference_images`, plus optional\n`reference_audios`, using `multipart/form-data`.\nReturns a `generation_id`; poll `GET /v2/generations/{generation_id}`\nor supply a `webhook_url`.\n", - "operationId": "post_generate_video_seed_dance25_reference_to_video", - "parameters": [ - { - "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", - "in": "query", - "name": "dry_run", - "required": false, - "schema": { - "default": false, - "type": "boolean" - }, - "x-tool-description": "Validate and quote only; no generation, storage, billing, or safety review." - } - ], - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "reference_image_asset_identifiers": { - "contentType": "application/json" - }, - "reference_video_asset_identifiers": { - "contentType": "application/json" - } - }, - "schema": { - "$ref": "#/components/schemas/GenerateVideoSeedDance25ReferenceToVideoRequest" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateVideoSeedDance25ReferenceToVideoRequest" - } - } - }, - "description": "A request to produce a video from reference media with Seedance 2.5. Upload the references using `multipart/form-data`.", - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateVideoSeedDance25Response" - } - } - }, - "description": "An acknowledgement to poll with `GET /v2/generations/{generation_id}`." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Unauthorized." - }, - "402": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Insufficient credits or quota." - }, - "403": { - "description": "This account does not have access to this model." - }, - "404": { - "description": "A reference was not found." - }, - "422": { - "description": "The prompt did not pass safety checks." - }, - "429": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Too many requests." - }, - "500": { - "description": "Internal server error." - }, - "503": { - "description": "The endpoint is temporarily unavailable." - } - }, - "summary": "Reference to video with Seedance 2.5", - "tags": [ - "video-generate" - ], - "x-tool-description": "Generate a video with Seedance 2.5 using at least one reference image or video asset. Address references as [Image1] and [Video1] in prompt order. Video download links expire.", - "x-openapi-router-controller": "external_api.generated.openapi.controllers.video_generate_controller" - } - }, - "/v2/video/generate/seedance-2-5-text-to-video": { - "post": { - "description": "Generate a video from a text prompt with Seedance 2.5, at up to 1080p and\n30 seconds. Returns a `generation_id`; poll `GET /v2/generations/{generation_id}`\nor supply a `webhook_url`.\n", - "operationId": "post_generate_video_seed_dance25_text_to_video", - "parameters": [ - { - "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", - "in": "query", - "name": "dry_run", - "required": false, - "schema": { - "default": false, - "type": "boolean" - }, - "x-tool-description": "Validate and quote only; no generation, storage, billing, or safety review." - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateVideoSeedDance25TextToVideoRequest" - } - } - }, - "description": "A request to generate a video from a text prompt with Seedance 2.5.", - "required": true, - "x-body-name": "generate_video_seed_dance25_text_to_video_request" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateVideoSeedDance25Response" - } - } - }, - "description": "An acknowledgement to poll with `GET /v2/generations/{generation_id}`." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Unauthorized." - }, - "402": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Insufficient credits or quota." - }, - "403": { - "description": "This account does not have access to this model." - }, - "422": { - "description": "The prompt did not pass safety checks." - }, - "429": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Too many requests." - }, - "500": { - "description": "Internal server error." - }, - "503": { - "description": "The endpoint is temporarily unavailable." - } - }, - "summary": "Text to video with Seedance 2.5", - "tags": [ - "video-generate" - ], - "x-tool-description": "Generate a video from text with Seedance 2.5. Video download links expire.", - "x-openapi-router-controller": "external_api.generated.openapi.controllers.video_generate_controller" - } - }, - "/v2/video/generate/seedance-2-image-to-video": { - "post": { - "description": "Generate one or more videos from a first-frame image and a text prompt\nwith Seedance 2.0. Upload the first frame as `image`, and optionally a final\nframe as `end_image`, using `multipart/form-data`.\nReturns a `generation_id`; poll `GET /v2/generations/{generation_id}`\nor supply a `webhook_url`.\n", - "operationId": "post_generate_video_seed_dance2_image_to_video", - "parameters": [ - { - "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", - "in": "query", - "name": "dry_run", - "required": false, - "schema": { - "default": false, - "type": "boolean" - }, - "x-tool-description": "Validate and quote only; no generation, storage, billing, or safety review." - } - ], - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "image_asset_identifier": { - "contentType": "application/json" - }, - "end_image_asset_identifier": { - "contentType": "application/json" - } - }, - "schema": { - "$ref": "#/components/schemas/GenerateVideoSeedDance2ImageToVideoRequest" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateVideoSeedDance2ImageToVideoRequest" - } - } - }, - "description": "A request to generate videos from a first-frame image with Seedance 2.0. Upload the first frame as `image` using `multipart/form-data`.", - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateVideoSeedDance2Response" - } - } - }, - "description": "An acknowledgement to poll with `GET /v2/generations/{generation_id}`." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Unauthorized." - }, - "402": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Insufficient credits or quota." - }, - "403": { - "description": "This account does not have access to this model." - }, - "404": { - "description": "The first-frame image was not found." - }, - "422": { - "description": "The prompt did not pass safety checks." - }, - "429": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Too many requests." - }, - "500": { - "description": "Internal server error." - }, - "503": { - "description": "The endpoint is temporarily unavailable." - } - }, - "summary": "Image to video with Seedance 2.0", - "tags": [ - "video-generate" - ], - "x-tool-description": "Animate a first-frame image asset with Seedance 2.0. Supply end_image_asset_identifier for a transition to a final frame. Video download links expire.", - "x-openapi-router-controller": "external_api.generated.openapi.controllers.video_generate_controller" - } - }, - "/v2/video/generate/seedance-2-reference-to-video": { - "post": { - "description": "Generate a video from a text prompt and reference media with\nSeedance 2.0. Upload at least one image in `reference_images`, plus optional\n`reference_audios`, using `multipart/form-data`.\nReturns a `generation_id`; poll `GET /v2/generations/{generation_id}`\nor supply a `webhook_url`.\n", - "operationId": "post_generate_video_seed_dance2_reference_to_video", - "parameters": [ - { - "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", - "in": "query", - "name": "dry_run", - "required": false, - "schema": { - "default": false, - "type": "boolean" - }, - "x-tool-description": "Validate and quote only; no generation, storage, billing, or safety review." - } - ], - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "reference_image_asset_identifiers": { - "contentType": "application/json" - }, - "reference_video_asset_identifiers": { - "contentType": "application/json" - } - }, - "schema": { - "$ref": "#/components/schemas/GenerateVideoSeedDance2ReferenceToVideoRequest" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateVideoSeedDance2ReferenceToVideoRequest" - } - } - }, - "description": "A request to produce a video from reference media with Seedance 2.0. Upload the references using `multipart/form-data`.", - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateVideoSeedDance2Response" - } - } - }, - "description": "An acknowledgement to poll with `GET /v2/generations/{generation_id}`." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Unauthorized." - }, - "402": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Insufficient credits or quota." - }, - "403": { - "description": "This account does not have access to this model." - }, - "404": { - "description": "A reference was not found." - }, - "422": { - "description": "The prompt did not pass safety checks." - }, - "429": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Too many requests." - }, - "500": { - "description": "Internal server error." - }, - "503": { - "description": "The endpoint is temporarily unavailable." - } - }, - "summary": "Reference to video with Seedance 2.0", - "tags": [ - "video-generate" - ], - "x-tool-description": "Generate a video with Seedance 2.0 using at least one reference image or video asset. Address references as @Image1 and @Video1 in prompt order. Video download links expire.", - "x-openapi-router-controller": "external_api.generated.openapi.controllers.video_generate_controller" - } - }, - "/v2/video/generate/seedance-2-text-to-video": { - "post": { - "description": "Generate one or more videos from a text prompt with Seedance 2.0.\nReturns a `generation_id`; poll `GET /v2/generations/{generation_id}`\nor supply a `webhook_url`.\n", - "operationId": "post_generate_video_seed_dance2_text_to_video", - "parameters": [ - { - "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", - "in": "query", - "name": "dry_run", - "required": false, - "schema": { - "default": false, - "type": "boolean" - }, - "x-tool-description": "Validate and quote only; no generation, storage, billing, or safety review." - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateVideoSeedDance2TextToVideoRequest" - } - } - }, - "description": "A request to generate videos from a text prompt with Seedance 2.0.", - "required": true, - "x-body-name": "generate_video_seed_dance2_text_to_video_request" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateVideoSeedDance2Response" - } - } - }, - "description": "An acknowledgement to poll with `GET /v2/generations/{generation_id}`." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Unauthorized." - }, - "402": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Insufficient credits or quota." - }, - "403": { - "description": "This account does not have access to this model." - }, - "422": { - "description": "The prompt did not pass safety checks." - }, - "429": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Too many requests." - }, - "500": { - "description": "Internal server error." - }, - "503": { - "description": "The endpoint is temporarily unavailable." - } - }, - "summary": "Text to video with Seedance 2.0", - "tags": [ - "video-generate" - ], - "x-tool-description": "Generate a video from text with Seedance 2.0. Video download links expire.", - "x-openapi-router-controller": "external_api.generated.openapi.controllers.video_generate_controller" - } - }, - "/v2/workflow/lookbook": { - "post": { - "description": "Creates polished fashion product imagery from one or more product\nreferences and an aesthetic reference. Each generated shoot is returned\nas four individual lookbook images.\n\nThe request is processed asynchronously. Poll\n`GET /v2/generations/{generation_id}` with the returned `generation_id`\nuntil the generation is completed or failed.\n", - "operationId": "post_lookbook", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/LookbookRequest" - } - } - }, - "description": "Product references and presentation options for the lookbook.", - "required": true, - "x-body-name": "lookbook_request" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/LookbookResponse" - } - } - }, - "description": "Lookbook accepted for asynchronous processing." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Unauthorized." - }, - "402": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Insufficient credits or quota." - }, - "403": { - "description": "Not authorized to create a lookbook." - }, - "429": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Too many requests." - } - }, - "summary": "Create a fashion lookbook", - "tags": [ - "edit-workflow" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.edit_workflow_controller" - } - }, - "/v2/workflow/precise-masked-edit": { - "post": { - "description": "Applies an instruction to an image. When a mask is supplied, it identifies\nthe primary edit region. Without a mask, the model edits the full image.\nOptional reference images can guide the requested appearance. Set\n`preserve_unmasked_pixels` to keep decoded pixels outside a supplied mask\nunchanged in the final image.\n\nThe request runs asynchronously. Poll\n`GET /v2/generations/{generation_id}` with the returned `generation_id`\nuntil the generation is completed or failed.\n", - "operationId": "post_precise_masked_edit", - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "source_asset_identifier": { - "contentType": "application/json" - }, - "mask_asset_identifier": { - "contentType": "application/json" - }, - "reference_asset_identifiers": { - "contentType": "application/json" - } - }, - "schema": { - "$ref": "#/components/schemas/PreciseMaskedEditRequest" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/PreciseMaskedEditRequest" - } - } - }, - "description": "Supply `source_asset_identifier` to reuse an existing Ideogram asset, or send `source_image` bytes using `multipart/form-data`. If both are supplied, the asset identifier takes precedence.", - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PreciseMaskedEditResponse" - } - } - }, - "description": "Precise masked edit accepted for asynchronous processing." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Unauthorized." - }, - "402": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Insufficient credits or quota." - }, - "403": { - "description": "Not authorized to use precise masked editing." - }, - "404": { - "description": "An input asset was not found or is not readable." - }, - "429": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Too many requests." - }, - "503": { - "description": "Precise masked editing is temporarily unavailable." - } - }, - "summary": "Edit an image, optionally using a mask", - "tags": [ - "edit-workflow" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.edit_workflow_controller" - } - }, - "/v2/workflow/virtual-try-on": { - "post": { - "description": "Generates a photorealistic image of the person in the supplied photo\nwearing the supplied garments, preserving their face, body, and\nbackground.\n\nThe request is processed asynchronously. Poll\n`GET /v2/generations/{generation_id}` with the returned `generation_id`\nuntil the generation is completed or failed.\n\nSupply the person as either an `AssetIdentifier` reference\n(`person_asset_identifier`) or the raw image bytes directly\n(`person_image`, multipart requests only), and likewise the garments as\neither `garment_asset_identifiers` or `garment_images`. For each of the\ntwo sources, provide exactly one of the two forms; supplying both, or\nneither, is rejected with a 400.\n", - "operationId": "post_virtual_try_on", - "requestBody": { - "content": { - "multipart/form-data": { - "encoding": { - "person_asset_identifier": { - "contentType": "application/json" - }, - "garment_asset_identifiers": { - "contentType": "application/json" - } - }, - "schema": { - "$ref": "#/components/schemas/VirtualTryOnRequest" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/VirtualTryOnRequest" - } - } - }, - "description": "The person to dress, the garments to put on them, and how to present them. Use `multipart/form-data` to upload `person_image` / `garment_images` bytes directly, or `application/json` (or multipart with the asset-identifier fields) to reference existing assets instead.", - "required": true, - "x-body-name": "body" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VirtualTryOnResponse" - } - } - }, - "description": "Try-on accepted for asynchronous processing." - }, - "400": { - "description": "Invalid input provided." - }, - "401": { - "description": "Unauthorized." - }, - "402": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Insufficient credits or quota." - }, - "403": { - "description": "Not authorized to create a try-on." - }, - "429": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationErrorResponse" - } - } - }, - "description": "Too many requests." - } - }, - "summary": "Dress a person in one or more garments", - "tags": [ - "edit-workflow" - ], - "x-openapi-router-controller": "external_api.generated.openapi.controllers.edit_workflow_controller" - } - } - }, - "components": { - "parameters": { - "DryRun": { - "description": "When true, the request is validated and priced but not run: nothing is\ngenerated, stored, or billed, and no safety review is performed. The\nresponse is a `PriceQuote` object instead of the usual response for this\nendpoint. Send exactly the request you would send to generate, so the\nquote reflects the same options.\n", - "in": "query", - "name": "dry_run", - "required": false, - "schema": { - "default": false, - "type": "boolean" - }, - "x-tool-description": "Validate and quote only; no generation, storage, billing, or safety review." - } - }, - "schemas": { - "PriceQuote": { - "description": "The price a request would cost, returned in place of the endpoint's\nusual response when `dry_run=true`. Money is in millionths of a US\ndollar and credits in thousandths of a credit, so a quote can be\ncompared against `usage_cost_usd_micros` and credit balances without\nrounding.\n", - "properties": { - "object": { - "description": "Always \"price_quote\".", - "enum": [ - "price_quote" - ], - "type": "string" - }, - "billing_identifier": { - "description": "The catalog product the request would bill.", - "example": "ideogram_v3_generation", - "type": "string" - }, - "quantity": { - "description": "Billable units the request would consume, usually the image count.", - "example": 2, - "type": "integer" - }, - "usd_micros": { - "description": "The price in millionths of a US dollar.", - "example": 60000, - "format": "int64", - "minimum": 0, - "type": "integer" - }, - "credit_millis": { - "description": "The credit charge for callers funded from credits, in thousandths\nof a credit at the caller's own credit rate.\n", - "example": 3000, - "format": "int64", - "minimum": 0, - "type": "integer" - }, - "qualifier": { - "$ref": "#/components/schemas/PriceQualifier" - }, - "upper_bound_usd_micros": { - "description": "The most the request can cost, in millionths of a US dollar.\nPresent only on estimates.\n", - "example": 84000, - "format": "int64", - "minimum": 0, - "type": "integer" - } - }, - "required": [ - "billing_identifier", - "credit_millis", - "object", - "qualifier", - "quantity", - "usd_micros" - ], - "title": "PriceQuote", - "type": "object", - "x-drop-nulls": true - }, - "PriceQualifier": { - "description": "Whether a quoted price is what the request would bill (`exact`) or a\ncomputed estimate for a product priced from provider cost after\ninference (`estimate`).\n", - "enum": [ - "exact", - "estimate" - ], - "title": "PriceQualifier", - "type": "string" - }, - "LayerizedTextBlock": { - "allOf": [ - { - "$ref": "#/components/schemas/DetectedTextBlock" - }, - { - "properties": { - "layer_id": { - "description": "Identifier of this block's layer in the page at `html_url`; pass it to the page's editing API.", - "example": "text-0", - "type": "string" - }, - "spans": { - "description": "The block's colour runs in reading order. Present, with at least one\nrun, whenever `color` is set; concatenating the runs' `text` reproduces\nthe block's `text`. `color` reports the dominant colour.\n", - "items": { - "$ref": "#/components/schemas/TextColorSpan" - }, - "nullable": true, - "type": "array" - } - }, - "required": [ - "layer_id" - ], - "type": "object" - } - ], - "title": "LayerizedTextBlock" - }, - "GenerateImageRequestV4": { - "description": "Request body for Ideogram 4.0 image generation. Supply exactly one of\n`text_prompt` or `json_prompt`. When `text_prompt` is supplied,\nmagic-prompt is applied automatically. When `json_prompt` is supplied,\nmagic-prompt is skipped and the structured prompt is consumed\ndirectly.\n", - "properties": { - "text_prompt": { - "description": "A natural-language prompt for image generation. When supplied,\nmagic-prompt is enabled automatically. Mutually exclusive with\n`json_prompt`.\n", - "type": "string" - }, - "json_prompt": { - "allOf": [ - { - "$ref": "#/components/schemas/V4JsonPrompt" - } - ], - "description": "A structured prompt that conforms to the Ideogram 4.0 JSON\ncontract. When supplied, magic-prompt is disabled and the\nstructured prompt is consumed by the diffusion model directly.\nMutually exclusive with `text_prompt`.\n" - }, - "seed": { - "description": "Random seed for reproducibility.", - "nullable": true, - "type": "integer" - }, - "magic_prompt_system_prompt_config_id": { - "description": "A base64url-encoded magic prompt system prompt config ID to use\nfor this request. Honored when `text_prompt` is supplied. Ignored\nwhen `json_prompt` is supplied.\n", - "type": "string" - }, - "custom_model_uri": { - "description": "A custom model URI in the format model//version/.\nWhen provided, the model version and style will be resolved from this URI.\n", - "example": "model/my-custom-model/version/0", - "type": "string" - }, - "resolution": { - "$ref": "#/components/schemas/ResolutionV4" - }, - "rendering_speed": { - "allOf": [ - { - "$ref": "#/components/schemas/RenderingSpeed" - } - ], - "description": "The rendering speed to use. For Ideogram V4, `rendering_speed=FLASH`\nis coming soon; requests with `rendering_speed=FLASH` currently\nreturn a 400.\n" - }, - "enable_copyright_detection": { - "description": "Optional. Opt this request into post-generation copyright detection (Hive likeness + logo\nchecks). The effective gate is the OR of this field and the organization's\n`copyright_detection_enabled` setting on `/api`. See GenerateImageRequestV3 for details.\n", - "nullable": true, - "type": "boolean" - } - }, - "type": "object" - }, - "OutputResolution": { - "default": "1K", - "description": "The output resolution tier for the generated image. Tiers are\ntotal-pixel budgets matching a square of the named size (for example,\n`8K` delivers at most 8192x8192 total pixels); wide and tall aspect\nratios keep the same pixel budget, so a single dimension may exceed\nthe named size. Defaults to 1K.\n", - "enum": [ - "1K", - "2K", - "4K", - "8K" - ], - "title": "OutputResolution", - "type": "string" - }, - "RenderingSpeedV4": { - "default": "DEFAULT", - "description": "The rendering speed to use. Defaults to DEFAULT.", - "enum": [ - "TURBO", - "DEFAULT", - "QUALITY" - ], - "title": "RenderingSpeedV4", - "type": "string" - }, - "GenerateTransparentImageRequestV4": { - "description": "Request body for Ideogram 4.0 transparent-background image generation.\nSupply exactly one of `text_prompt` or `json_prompt`. When\n`text_prompt` is supplied, magic-prompt is applied automatically. When\n`json_prompt` is supplied, magic-prompt is skipped and the structured\nprompt is consumed directly; its `compositional_deconstruction.background`\nis replaced with a transparent-background directive.\n", - "properties": { - "text_prompt": { - "description": "A natural-language prompt for image generation. When supplied,\nmagic-prompt is enabled automatically. Mutually exclusive with\n`json_prompt`.\n", - "type": "string" - }, - "json_prompt": { - "allOf": [ - { - "$ref": "#/components/schemas/V4JsonPrompt" - } - ], - "description": "A structured prompt that conforms to the Ideogram 4.0 JSON\ncontract. When supplied, magic-prompt is disabled and the\nstructured prompt is consumed by the diffusion model directly,\nexcept that `compositional_deconstruction.background` is replaced\nwith a transparent-background directive. Mutually exclusive with\n`text_prompt`.\n" - }, - "seed": { - "description": "Random seed for reproducibility.", - "nullable": true, - "type": "integer" - }, - "magic_prompt_system_prompt_config_id": { - "description": "A base64url-encoded magic prompt system prompt config ID to use\nfor this request. Honored when `text_prompt` is supplied. Ignored\nwhen `json_prompt` is supplied.\n", - "type": "string" - }, - "aspect_ratio": { - "$ref": "#/components/schemas/AspectRatioV4" - }, - "output_resolution": { - "$ref": "#/components/schemas/OutputResolution" - }, - "rendering_speed": { - "$ref": "#/components/schemas/RenderingSpeedV4" - }, - "enable_copyright_detection": { - "description": "Optional. Opt this request into post-generation copyright detection (Hive likeness + logo\nchecks). The effective gate is the OR of this field and the organization's\n`copyright_detection_enabled` setting on `/api`. See GenerateImageRequestV3 for details.\n", - "nullable": true, - "type": "boolean" - } - }, - "type": "object" - }, - "GenerateImageRequestV4Fp8": { - "description": "Request body for the fp8-quantized Ideogram 4.0 generate endpoint.\nSupply exactly one of `text_prompt` or `json_prompt`. The base model is\nalways the fp8-quantized Ideogram 4.0; a custom registry model cannot be\nselected on this endpoint.\n", - "properties": { - "text_prompt": { - "description": "A natural-language prompt for image generation. When supplied,\nmagic-prompt is enabled automatically. Mutually exclusive with\n`json_prompt`.\n", - "type": "string" - }, - "json_prompt": { - "allOf": [ - { - "$ref": "#/components/schemas/V4JsonPrompt" - } - ], - "description": "A structured prompt that conforms to the Ideogram 4.0 JSON\ncontract. When supplied, magic-prompt is disabled and the\nstructured prompt is consumed by the diffusion model directly.\nMutually exclusive with `text_prompt`.\n" - }, - "seed": { - "description": "Random seed for reproducibility.", - "nullable": true, - "type": "integer" - }, - "magic_prompt_system_prompt_config_id": { - "description": "A base64url-encoded magic prompt system prompt config ID to use\nfor this request. Honored when `text_prompt` is supplied. Ignored\nwhen `json_prompt` is supplied.\n", - "type": "string" - }, - "resolution": { - "$ref": "#/components/schemas/ResolutionV4" - }, - "rendering_speed": { - "allOf": [ - { - "$ref": "#/components/schemas/RenderingSpeed" - } - ], - "description": "The rendering speed to use. For Ideogram V4, `rendering_speed=FLASH`\nis coming soon; requests with `rendering_speed=FLASH` currently\nreturn a 400.\n" - }, - "enable_copyright_detection": { - "description": "Optional. Opt this request into post-generation copyright detection (Hive likeness + logo\nchecks). The effective gate is the OR of this field and the organization's\n`copyright_detection_enabled` setting on `/api`. See GenerateImageRequestV3 for details.\n", - "nullable": true, - "type": "boolean" - } - }, - "type": "object" - }, - "GenerateImageRequestV4CfgDistilled": { - "description": "Request body for the CFG/guidance-distilled Ideogram 4.0 generate\nendpoint. Supply exactly one of `text_prompt` or `json_prompt`. The base\nmodel is always the CFG-distilled Ideogram 4.0; a custom registry model\ncannot be selected on this endpoint.\n", - "properties": { - "text_prompt": { - "description": "A natural-language prompt for image generation. When supplied,\nmagic-prompt is enabled automatically. Mutually exclusive with\n`json_prompt`.\n", - "type": "string" - }, - "json_prompt": { - "allOf": [ - { - "$ref": "#/components/schemas/V4JsonPrompt" - } - ], - "description": "A structured prompt that conforms to the Ideogram 4.0 JSON\ncontract. When supplied, magic-prompt is disabled and the\nstructured prompt is consumed by the diffusion model directly.\nMutually exclusive with `text_prompt`.\n" - }, - "seed": { - "description": "Random seed for reproducibility.", - "nullable": true, - "type": "integer" - }, - "magic_prompt_system_prompt_config_id": { - "description": "A base64url-encoded magic prompt system prompt config ID to use\nfor this request. Honored when `text_prompt` is supplied. Ignored\nwhen `json_prompt` is supplied.\n", - "type": "string" - }, - "resolution": { - "$ref": "#/components/schemas/ResolutionV4" - }, - "rendering_speed": { - "allOf": [ - { - "$ref": "#/components/schemas/RenderingSpeed" - } - ], - "description": "The rendering speed to use. For Ideogram V4, `rendering_speed=FLASH`\nis coming soon; requests with `rendering_speed=FLASH` currently\nreturn a 400.\n" - }, - "enable_copyright_detection": { - "description": "Optional. Opt this request into post-generation copyright detection (Hive likeness + logo\nchecks). The effective gate is the OR of this field and the organization's\n`copyright_detection_enabled` setting on `/api`. See GenerateImageRequestV3 for details.\n", - "nullable": true, - "type": "boolean" - } - }, - "type": "object" - }, - "GenerateImageRequestPImage": { - "description": "Request body for the distilled few-step Ideogram generate endpoints. The\nspeed/quality tier is selected by the URL path, not this body. Supply a\n`prompt`: either natural language or a structured Ideogram 4.0 JSON prompt\n(the server detects which). The base model is always the distilled\nfew-step Ideogram model; a custom registry model cannot be selected on\nthese endpoints.\n", - "properties": { - "prompt": { - "description": "The prompt for image generation. Accepts either natural language or\na structured prompt that conforms to the Ideogram 4.0 JSON contract;\nthe server detects which was supplied. See `prompt_upsampling` for\nhow magic-prompt is applied.\n", - "type": "string" - }, - "prompt_upsampling": { - "allOf": [ - { - "$ref": "#/components/schemas/MagicPromptOption" - } - ], - "description": "Controls magic-prompt (prompt upsampling). `AUTO` (default) applies\nmagic-prompt to a natural-language `prompt` or a non-Ideogram 4.0 JSON\n`prompt`, and skips it when `prompt` is already a structured Ideogram\n4.0 JSON prompt. `ON` always applies magic-prompt, even to an Ideogram\n4.0 JSON prompt; `OFF` never applies it. Defaults to `AUTO`.\n" - }, - "seed": { - "description": "Random seed for reproducibility.", - "nullable": true, - "type": "integer" - }, - "magic_prompt_system_prompt_config_id": { - "description": "A base64url-encoded magic prompt system prompt config ID to use\nfor this request. Honored only when magic-prompt runs (a\nnatural-language `prompt` with `prompt_upsampling` AUTO or ON).\n", - "type": "string" - }, - "resolution": { - "$ref": "#/components/schemas/ResolutionV4" - }, - "enable_copyright_detection": { - "description": "Optional. Opt this request into post-generation copyright detection (Hive likeness + logo\nchecks). The effective gate is the OR of this field and the organization's\n`copyright_detection_enabled` setting on `/api`. See GenerateImageRequestV3 for details.\n", - "nullable": true, - "type": "boolean" - } - }, - "required": [ - "prompt" - ], - "type": "object" - }, - "PImageResolution": { - "description": "The output-size tier for P-Image Ideogram.", - "enum": [ - "1K", - "2K" - ], - "title": "PImageResolution", - "type": "string" - }, - "GenerateImageRequestPImageIdeogram": { - "description": "Request body for P-Image Ideogram. The model's quality and resolution\ntier are supplied as request parameters. The server selects the matching\nP-Image model variant; custom registry models cannot be selected.\n", - "properties": { - "prompt": { - "description": "The prompt for image generation. Accepts either natural language or\na structured Ideogram 4.0 JSON prompt; the server detects which was supplied.\n", - "type": "string" - }, - "prompt_upsampling": { - "allOf": [ - { - "$ref": "#/components/schemas/MagicPromptOption" - } - ], - "default": "AUTO", - "description": "Controls magic-prompt (prompt upsampling). Defaults to `AUTO`.\n" - }, - "seed": { - "description": "Random seed for reproducibility.", - "nullable": true, - "type": "integer" - }, - "magic_prompt_system_prompt_config_id": { - "description": "A base64url-encoded magic prompt system prompt config ID to use\nfor this request.\n", - "type": "string" - }, - "quality": { - "allOf": [ - { - "$ref": "#/components/schemas/Quality" - } - ], - "default": "MEDIUM", - "description": "The generation quality level. Defaults to `MEDIUM`." - }, - "resolution": { - "allOf": [ - { - "$ref": "#/components/schemas/PImageResolution" - } - ], - "default": "1K", - "description": "The output-size tier. Defaults to `1K`." - }, - "aspect_ratio": { - "allOf": [ - { - "$ref": "#/components/schemas/AspectRatioV3" - } - ], - "default": "1x1", - "description": "The output aspect ratio. Defaults to `1x1`." - }, - "custom_width": { - "description": "Optional. An exact output width in pixels, used together with\n`custom_height` for output sizes outside the preset tiers. Must be\na positive multiple of 16 between 16 and 4096, and\n`custom_width` × `custom_height` must not exceed 4,194,304 pixels\n(2048×2048). Cannot be combined with `resolution` or\n`aspect_ratio`; the request is billed at the resolution tier\nmatching its total pixel count.\n", - "nullable": true, - "type": "integer" - }, - "custom_height": { - "description": "Optional. An exact output height in pixels, used together with\n`custom_width`. See `custom_width` for the accepted range and\nbilling behavior.\n", - "nullable": true, - "type": "integer" - }, - "enable_copyright_detection": { - "description": "Optional. Opt this request into post-generation copyright detection.\n", - "nullable": true, - "type": "boolean" - } - }, - "required": [ - "prompt" - ], - "type": "object" - }, - "GenerateImageRequestV4Stable": { - "description": "Request body for the stable Ideogram 4.0 endpoint. Supply exactly one\nof `text_prompt` or `json_prompt`. The model URI is pinned\nserver-side. When `resolution` is omitted, the server chooses an\naspect ratio automatically.\n", - "properties": { - "text_prompt": { - "description": "A natural-language prompt for image generation. When supplied,\nmagic-prompt is enabled automatically. Mutually exclusive with\n`json_prompt`.\n", - "type": "string" - }, - "json_prompt": { - "allOf": [ - { - "$ref": "#/components/schemas/V4JsonPrompt" - } - ], - "description": "A structured prompt that conforms to the Ideogram 4.0 JSON\ncontract. When supplied, magic-prompt is disabled and the\nstructured prompt is consumed by the diffusion model directly.\nMutually exclusive with `text_prompt`.\n" - }, - "seed": { - "description": "Random seed for reproducibility.", - "nullable": true, - "type": "integer" - }, - "resolution": { - "allOf": [ - { - "$ref": "#/components/schemas/ResolutionV4" - } - ], - "description": "Optional. When supplied, the image is generated at this\nresolution. When omitted, the server picks an aspect ratio\nautomatically based on the prompt.\n" - }, - "version": { - "description": "Optional. Selects a specific pinned stable build. When omitted,\nthe default stable model URI is used. When set to `stable_may29`,\nthe request is routed to the May 29th stable build.\n", - "enum": [ - "stable_may29" - ], - "nullable": true, - "type": "string" - } - }, - "type": "object" - }, - "GenerateImageRequestZImage": { - "description": "Request body for the Z-Image generate endpoint. The base model is\npinned server-side; supply `custom_model_uri` to layer a registered\nZ-Image LoRA finetune on the base.\n\nWidth and height must each be a positive multiple of 16; the total\narea must not exceed 1,048,576 pixels (1024×1024). When `width` and\n`height` are omitted, the server uses the model's default 1024×1024.\n", - "properties": { - "prompt": { - "description": "A natural-language prompt for image generation.", - "example": "A futuristic cityscape at golden hour, highly detailed.", - "type": "string" - }, - "system_prompt": { - "description": "An optional system prompt applied alongside the prompt — use it for\nstanding instructions such as style constraints or \"do not render\ntext\". When omitted, no system prompt is applied. If you trained a\nLoRA with a system prompt, supply the same one here for best results.\n", - "example": "Do not include any text in the image.", - "maxLength": 2000, - "nullable": true, - "type": "string" - }, - "width": { - "description": "Output width in pixels; must be a positive multiple of 16.", - "example": 1024, - "nullable": true, - "type": "integer" - }, - "height": { - "description": "Output height in pixels; must be a positive multiple of 16.", - "example": 1024, - "nullable": true, - "type": "integer" - }, - "num_inference_steps": { - "description": "Optional diffusion step count. When omitted, the server uses the\nmodel's default. Higher values trade latency for quality.\n", - "example": 8, - "maximum": 128, - "minimum": 1, - "nullable": true, - "type": "integer" - }, - "seed": { - "description": "Random seed for reproducibility.", - "nullable": true, - "type": "integer" - }, - "num_images": { - "default": 1, - "description": "Number of images to generate.", - "maximum": 8, - "minimum": 1, - "nullable": true, - "type": "integer" - }, - "custom_model_uri": { - "description": "A custom model URI in the format model//version/.\nWhen provided, the URI must resolve to a registered fine-tune of the\nZ-Image base model; the fine-tune's LoRA checkpoint is layered on\nthe base. When omitted, the Z-Image base is used with no LoRA.\n", - "example": "model/my-z-image-lora/version/0", - "nullable": true, - "type": "string" - } - }, - "required": [ - "prompt" - ], - "type": "object" - }, - "GenerateImageRequestFlux2Klein": { - "description": "Request body for the FLUX.2-Klein generate endpoint. The base model is\npinned server-side; supply `custom_model_uri` to layer a registered\nFLUX.2-Klein LoRA finetune on the base.\n\nWidth and height must each be a positive multiple of 16; the total\narea must not exceed 1,048,576 pixels (1024×1024). When `width` and\n`height` are omitted, the server uses the model's default 1024×1024.\n", - "properties": { - "prompt": { - "description": "A natural-language prompt for image generation.", - "example": "A photo of a tabby cat sleeping on a couch, soft daylight.", - "type": "string" - }, - "system_prompt": { - "description": "An optional system prompt applied alongside the prompt — use it for\nstanding instructions such as style constraints or \"do not render\ntext\". When omitted, no system prompt is applied. If you trained a\nLoRA with a system prompt, supply the same one here for best results.\n", - "example": "Do not include any text in the image.", - "maxLength": 2000, - "nullable": true, - "type": "string" - }, - "width": { - "description": "Output width in pixels; must be a positive multiple of 16.", - "example": 1024, - "nullable": true, - "type": "integer" - }, - "height": { - "description": "Output height in pixels; must be a positive multiple of 16.", - "example": 1024, - "nullable": true, - "type": "integer" - }, - "num_inference_steps": { - "description": "Optional diffusion step count. When omitted, the server uses the\nmodel's default. Higher values trade latency for quality.\n", - "example": 4, - "maximum": 128, - "minimum": 1, - "nullable": true, - "type": "integer" - }, - "seed": { - "description": "Random seed for reproducibility.", - "nullable": true, - "type": "integer" - }, - "num_images": { - "default": 1, - "description": "Number of images to generate.", - "maximum": 8, - "minimum": 1, - "nullable": true, - "type": "integer" - }, - "custom_model_uri": { - "description": "A custom model URI in the format model//version/.\nWhen provided, the URI must resolve to a registered fine-tune of the\nFLUX.2-Klein base model; the fine-tune's LoRA checkpoint is layered\non the base. When omitted, the FLUX.2-Klein base is used with no LoRA.\n", - "example": "model/my-flux-klein-lora/version/0", - "nullable": true, - "type": "string" - } - }, - "required": [ - "prompt" - ], - "type": "object" - }, - "GenerateImageRequestFlux2KleinBase": { - "description": "Request body for the undistilled FLUX.2-Klein base generate endpoint (50-step quality tier). The base model is\npinned server-side; supply `custom_model_uri` to layer a registered\nFLUX.2-Klein LoRA finetune on the base.\n\nWidth and height must each be a positive multiple of 16; the total\narea must not exceed 1,048,576 pixels (1024×1024). When `width` and\n`height` are omitted, the server uses the model's default 1024×1024.\n", - "properties": { - "prompt": { - "description": "A natural-language prompt for image generation.", - "example": "A photo of a tabby cat sleeping on a couch, soft daylight.", - "type": "string" - }, - "system_prompt": { - "description": "An optional system prompt applied alongside the prompt — use it for\nstanding instructions such as style constraints or \"do not render\ntext\". When omitted, no system prompt is applied. If you trained a\nLoRA with a system prompt, supply the same one here for best results.\n", - "example": "Do not include any text in the image.", - "maxLength": 2000, - "nullable": true, - "type": "string" - }, - "width": { - "description": "Output width in pixels; must be a positive multiple of 16.", - "example": 1024, - "nullable": true, - "type": "integer" - }, - "height": { - "description": "Output height in pixels; must be a positive multiple of 16.", - "example": 1024, - "nullable": true, - "type": "integer" - }, - "num_inference_steps": { - "description": "Optional diffusion step count. When omitted, the server uses the\nmodel's default. Higher values trade latency for quality.\n", - "example": 50, - "maximum": 128, - "minimum": 1, - "nullable": true, - "type": "integer" - }, - "seed": { - "description": "Random seed for reproducibility.", - "nullable": true, - "type": "integer" - }, - "num_images": { - "default": 1, - "description": "Number of images to generate.", - "maximum": 8, - "minimum": 1, - "nullable": true, - "type": "integer" - }, - "custom_model_uri": { - "description": "A custom model URI in the format model//version/.\nWhen provided, the URI must resolve to a registered fine-tune of the\nFLUX.2-Klein base model; the fine-tune's LoRA checkpoint is layered\non the base. When omitted, the FLUX.2-Klein base is used with no LoRA.\n", - "example": "model/my-flux-klein-base-lora/version/0", - "nullable": true, - "type": "string" - } - }, - "required": [ - "prompt" - ], - "type": "object" - }, - "GenerateImageRequestErnie": { - "description": "Request body for the ERNIE-Image-Turbo generate endpoint. The base\nmodel is pinned server-side; supply `custom_model_uri` to layer a\nregistered ERNIE LoRA finetune on the base.\n\nWidth and height must each be a positive multiple of 16; the total\narea must not exceed 1,075,200 pixels (896×1200). When `width` and\n`height` are omitted, the server uses the model's default 1024×1024.\n", - "properties": { - "prompt": { - "description": "A natural-language prompt for image generation.", - "example": "A poster with bold typography reading \"GRAND OPENING\", art deco style.", - "type": "string" - }, - "system_prompt": { - "description": "An optional system prompt applied alongside the prompt — use it for\nstanding instructions such as style constraints or \"do not render\ntext\". When omitted, no system prompt is applied. If you trained a\nLoRA with a system prompt, supply the same one here for best results.\n", - "example": "Do not include any text in the image.", - "maxLength": 2000, - "nullable": true, - "type": "string" - }, - "width": { - "description": "Output width in pixels; must be a positive multiple of 16.", - "example": 1024, - "nullable": true, - "type": "integer" - }, - "height": { - "description": "Output height in pixels; must be a positive multiple of 16.", - "example": 1024, - "nullable": true, - "type": "integer" - }, - "num_inference_steps": { - "description": "Optional diffusion step count. When omitted, the server uses the\nmodel's default. Higher values trade latency for quality.\n", - "example": 8, - "maximum": 128, - "minimum": 1, - "nullable": true, - "type": "integer" - }, - "seed": { - "description": "Random seed for reproducibility.", - "nullable": true, - "type": "integer" - }, - "num_images": { - "default": 1, - "description": "Number of images to generate.", - "maximum": 8, - "minimum": 1, - "nullable": true, - "type": "integer" - }, - "custom_model_uri": { - "description": "A custom model URI in the format model//version/.\nWhen provided, the URI must resolve to a registered fine-tune of the\nERNIE base model; the fine-tune's LoRA checkpoint is layered on the\nbase. When omitted, the ERNIE base is used with no LoRA.\n", - "example": "model/my-ernie-lora/version/0", - "nullable": true, - "type": "string" - } - }, - "required": [ - "prompt" - ], - "type": "object" - }, - "GenerateImageRequestV4Im2Im": { - "properties": { - "image": { - "description": "The initial image binary (max 25MB); only JPEG, WebP and PNG formats are supported.", - "format": "binary", - "type": "string" - }, - "additional_images": { - "description": "Optional. Up to 4 additional reference images used together with `image` to condition\nthe generation, for a maximum of 5 reference images total. Each image may be up to 25MB;\nonly JPEG, WebP and PNG formats are supported.\n", - "items": { - "format": "binary", - "type": "string" - }, - "maxItems": 4, - "type": "array" - }, - "prompt": { - "description": "An optional text prompt to guide the generation.", - "type": "string" - }, - "seed": { - "$ref": "#/components/schemas/Seed" - }, - "magic_prompt_option": { - "$ref": "#/components/schemas/MagicPromptOption" - }, - "magic_prompt_system_prompt_config_id": { - "description": "A base64url-encoded magic prompt system prompt config ID to use for this request.", - "type": "string" - }, - "resolution": { - "$ref": "#/components/schemas/ResolutionV4ImageToImage" - }, - "rendering_speed": { - "allOf": [ - { - "$ref": "#/components/schemas/RenderingSpeed" - } - ], - "description": "The rendering speed to use. For Ideogram V4, `rendering_speed=FLASH`\nis coming soon; requests with `rendering_speed=FLASH` currently\nreturn a 400.\n" - }, - "enable_copyright_detection": { - "description": "Optional. Opt this request into post-generation copyright detection (Hive likeness + logo\nchecks). See GenerateImageRequestV3 for details.\n", - "nullable": true, - "type": "boolean" - } - }, - "required": [ - "image" - ], - "type": "object" - }, - "RemixImageRequestV4": { - "properties": { - "image": { - "description": "The initial image binary (max 25MB); only JPEG, WebP and PNG formats are supported.", - "format": "binary", - "type": "string" - }, - "text_prompt": { - "description": "The text prompt that guides the remix.", - "type": "string" - }, - "image_weight": { - "description": "Optional. How strongly the output should resemble the input image. Higher values keep\nthe input image's structure; lower values allow the prompt to drive the output more.\nWhen omitted, the weight is chosen automatically from the edit instruction; supplying\na value overrides that automatic choice. Only accepted when the output keeps the input\nimage's shape: combining image_weight with a resolution whose aspect ratio differs\nfrom the input image's is rejected with a 400.\n", - "maximum": 100, - "minimum": 1, - "type": "integer" - }, - "resolution": { - "allOf": [ - { - "$ref": "#/components/schemas/ResolutionV4" - } - ], - "description": "Optional. When supplied, the images are generated at this resolution. When omitted,\nthe input image's shape is kept. A resolution whose aspect ratio differs from the\ninput image's cannot be combined with image_weight.\n" - }, - "rendering_speed": { - "$ref": "#/components/schemas/RenderingSpeed" - }, - "enable_copyright_detection": { - "description": "Optional. Opt this request into post-generation copyright detection (Hive likeness + logo\nchecks). See GenerateImageRequestV3 for details.\n", - "nullable": true, - "type": "boolean" - } - }, - "required": [ - "image", - "text_prompt" - ], - "type": "object" - }, - "GenerateDesignRequestV4": { - "properties": { - "prompt": { - "description": "The text prompt for editable design generation.", - "type": "string" - }, - "seed": { - "description": "Random seed for reproducibility.", - "nullable": true, - "type": "integer" - }, - "magic_prompt_option": { - "$ref": "#/components/schemas/MagicPromptOption" - }, - "magic_prompt_system_prompt_config_id": { - "description": "A base64url-encoded magic prompt system prompt config ID to use for this request.", - "type": "string" - }, - "resolution": { - "$ref": "#/components/schemas/ResolutionV4Layout" - }, - "rendering_speed": { - "allOf": [ - { - "$ref": "#/components/schemas/RenderingSpeed" - } - ], - "description": "The rendering speed to use. For Ideogram V4, `rendering_speed=FLASH`\nis coming soon; requests with `rendering_speed=FLASH` currently\nreturn a 400.\n" - }, - "inspiration_reference_images": { - "description": "Experimental. Up to 4 static inspiration images used as transferable visual style references for V4 layout-to-image design. Images are not edit targets and are not inserted into the generated HTML layout. Supported formats are JPEG, PNG, and WebP (max size 25MB each). Animated images are not supported.\n", - "items": { - "format": "binary", - "type": "string" - }, - "maxItems": 4, - "type": "array" - }, - "inspiration_reference_model": { - "default": "claude-sonnet-4-6", - "description": "Experimental. Model to use for the inspiration vision prepass.", - "enum": [ - "claude-sonnet-4-6", - "claude-opus-4-6", - "claude-opus-4-7" - ], - "nullable": true, - "type": "string" - }, - "artifact_generation_model": { - "default": "claude-sonnet-4-6", - "description": "Experimental. Model to use for the HTML/layout and base-plate handoff generation call.", - "enum": [ - "claude-sonnet-4-6", - "claude-opus-4-6", - "claude-opus-4-7" - ], - "nullable": true, - "type": "string" - }, - "layout2image_variant": { - "description": "Experimental. Staging only. Select a v4 layout-to-image pipeline variant.\nOmit for the default v4l2i path. Rejected on production.\n", - "enum": [ - "opus_4_7", - "separate_image_layer", - "bbox_aware" - ], - "nullable": true, - "type": "string" - }, - "response_type": { - "default": "layered", - "description": "layered (default): full editable design payload with text layers and HTML.\nurl: JSON with an expiring link to the final composited cover image.\nbinary: raw PNG bytes of the final composited cover image (Content-Type image/png).\nhtml: raw HTML document of the generated layout (Content-Type text/html).\n", - "enum": [ - "layered", - "url", - "binary", - "html" - ], - "nullable": true, - "type": "string" - } - }, - "required": [ - "prompt" - ], - "type": "object" - }, - "DescribeResponse": { - "description": "The response for a describe request encapsulates a list of descriptions.", - "example": { - "descriptions": [ - { - "text": "A meticulously illustrated cat with striped patterns, sitting upright. The cat's eyes are a captivating shade of yellow, and it appears to be gazing intently at something. The background consists of abstract, swirling patterns in shades of black, white, and beige, creating an almost fluid or wavy appearance. The cat is positioned in the foreground, with the background elements fading into the distance, giving a sense of depth to the image." - } - ] - }, - "properties": { - "descriptions": { - "description": "A collection of descriptions for given content.", - "items": { - "$ref": "#/components/schemas/Description" - }, - "type": "array" - } - }, - "title": "DescribeResponse", - "type": "object" - }, - "DescribeRequest": { - "properties": { - "image_file": { - "description": "An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time.", - "format": "binary", - "type": "string" - }, - "describe_model_version": { - "$ref": "#/components/schemas/DescribeModelVersion" - } - }, - "required": [ - "image_file" - ], - "type": "object" - }, - "DescribeRequestV4": { - "properties": { - "image_file": { - "description": "An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time.", - "format": "binary", - "type": "string" - }, - "include_bbox": { - "default": true, - "description": "When true (default), the response preserves bounding boxes on each\nelement so the prompt can be pasted into `/v1/ideogram-v4/generate`\nas `json_prompt` and reproduce the source layout. Set to false to\ndrop bounding boxes and let the sampler place elements freely.\n", - "type": "boolean" - }, - "include_style_descriptions": { - "default": false, - "description": "When false (default), the response omits `json_prompt.style_description`\nto match the contract used by `/v1/ideogram-v4/generate`'s `json_prompt`\ninput. Set to true to surface the captioner's source-image style\ndescription in the response.\n", - "type": "boolean" - }, - "include_tags": { - "default": false, - "description": "When false (default), the response omits `json_prompt.tags` to match\nthe contract used by `/v1/ideogram-v4/generate`'s `json_prompt`\ninput. Set to true to surface the captioner's free-form tags on the\nresponse.\n", - "type": "boolean" - } - }, - "required": [ - "image_file" - ], - "type": "object" - }, - "DescribeResponseV4": { - "description": "The response for an Ideogram 4.0 describe request. The `json_prompt`\nfield is a structured `V4JsonPrompt` that can be passed back as\n`json_prompt` to the `/v1/ideogram-v4/generate` family of endpoints.\n", - "example": { - "json_prompt": { - "high_level_description": "high_level_description", - "style_description": { - "photo": "photo", - "art_style": "art_style", - "medium": "medium", - "aesthetics": "aesthetics", - "lighting": "lighting", - "color_palette": [ - "#FFD700", - "#FFD700" - ] - }, - "compositional_deconstruction": { - "background": "background", - "elements": [ - { - "bbox": [ - 0, - 0, - 1000, - 1000 - ], - "type": "obj", - "desc": "desc", - "color_palette": [ - "#FFD700", - "#FFD700" - ] - }, - { - "bbox": [ - 0, - 0, - 1000, - 1000 - ], - "type": "obj", - "desc": "desc", - "color_palette": [ - "#FFD700", - "#FFD700" - ] - } - ] - }, - "tags": [ - "tags", - "tags" - ] - } - }, - "properties": { - "json_prompt": { - "$ref": "#/components/schemas/V4JsonPrompt" - } - }, - "required": [ - "json_prompt" - ], - "title": "DescribeResponseV4", - "type": "object" - }, - "EditImageRequest": { - "properties": { - "image_file": { - "description": "An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time.", - "format": "binary", - "type": "string" - }, - "mask": { - "description": "A black and white image of the same size as the image being edited (max size 25MB). Black regions in the mask should match up with the regions of the image that you would like to edit; only JPEG, WebP and PNG formats are supported at this time.", - "format": "binary", - "type": "string" - }, - "prompt": { - "description": "The prompt used to describe the edited result.", - "example": "A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there is an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset.", - "type": "string" - }, - "model": { - "$ref": "#/components/schemas/ModelEnum" - }, - "magic_prompt_option": { - "$ref": "#/components/schemas/MagicPromptOption" - }, - "magic_prompt_system_prompt_config_id": { - "description": "A base64url-encoded magic prompt system prompt config ID to use for this request.", - "type": "string" - }, - "num_images": { - "$ref": "#/components/schemas/NumImages" - }, - "seed": { - "$ref": "#/components/schemas/Seed" - }, - "style_type": { - "$ref": "#/components/schemas/StyleType" - } - }, - "required": [ - "image_file", - "mask", - "model", - "prompt" - ], - "type": "object" - }, - "GenerateImageRequest": { - "example": { - "image_request": { - "aspect_ratio": "ASPECT_10_16", - "magic_prompt_option": "AUTO", - "model": "V_2", - "prompt": "A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there is an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset." - } - }, - "properties": { - "image_request": { - "$ref": "#/components/schemas/ImageRequest" - } - }, - "required": [ - "image_request" - ], - "title": "GenerateImageRequest", - "type": "object" - }, - "GenerateImageRequestV3": { - "properties": { - "prompt": { - "description": "The prompt to use to generate the image.", - "example": "A photo of a cat", - "type": "string" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - }, - "resolution": { - "$ref": "#/components/schemas/ResolutionV3" - }, - "aspect_ratio": { - "$ref": "#/components/schemas/AspectRatioV3" - }, - "rendering_speed": { - "$ref": "#/components/schemas/RenderingSpeed" - }, - "magic_prompt": { - "$ref": "#/components/schemas/MagicPromptOption" - }, - "magic_prompt_system_prompt_config_id": { - "description": "A base64url-encoded magic prompt system prompt config ID to use for this request.", - "type": "string" - }, - "negative_prompt": { - "description": "Description of what to exclude from an image. Descriptions in the prompt take precedence\nto descriptions in the negative prompt.\n", - "example": "brush strokes, painting", - "type": "string" - }, - "num_images": { - "default": 1, - "description": "Number of images to generate.", - "maximum": 8, - "minimum": 1, - "type": "integer" - }, - "color_palette": { - "$ref": "#/components/schemas/ColorPaletteWithPresetNameOrMembers" - }, - "style_codes": { - "description": "A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.", - "example": [ - "AAFF5733", - "0133FF57", - "DE3357FF" - ], - "items": { - "$ref": "#/components/schemas/StyleCode" - }, - "type": "array", - "x-tool-description": "8-character hex style codes. Allowed combinations with other style controls depend on the operation." - }, - "style_type": { - "$ref": "#/components/schemas/StyleTypeV3" - }, - "style_preset": { - "$ref": "#/components/schemas/StylePresetV3" - }, - "custom_model_uri": { - "description": "A custom model URI in the format model//version/. \nWhen provided, the model version and style will be resolved from this URI, and style_type is not required.\n", - "example": "model/my-custom-model/version/1", - "type": "string" - }, - "style_reference_images": { - "description": "A set of images to use as style references (max size 25MB per image; the whole request must stay under 50MB). The images should be in JPEG, PNG or WebP format.", - "items": { - "format": "binary", - "type": "string" - }, - "type": "array" - }, - "character_reference_images": { - "description": "Generations with character reference are subject to the character reference pricing. A set of images to use as character references (max size 25MB per image; the whole request must stay under 50MB), currently only supports 1 character reference image. The images should be in JPEG, PNG or WebP format.", - "items": { - "format": "binary", - "type": "string" - }, - "type": "array" - }, - "character_reference_images_mask": { - "description": "Optional masks for character reference images. When provided, must match the number of character_reference_images. Each mask should be a grayscale image of the same dimensions as the corresponding character reference image. The images should be in JPEG, PNG or WebP format.", - "items": { - "format": "binary", - "type": "string" - }, - "type": "array" - }, - "enable_copyright_detection": { - "description": "Optional. Opt this request into post-generation copyright detection (Hive likeness + logo\nchecks). The effective gate is the OR of this field and the organization's\n`copyright_detection_enabled` setting on `/api`: if the org has it on, this is ignored;\nif the org has it off, setting this `true` enables detection for this request only.\nAdds detection latency. Flagged images come back with `is_image_safe: false`.\n", - "nullable": true, - "type": "boolean" - } - }, - "required": [ - "prompt" - ], - "type": "object" - }, - "GenerateGraphicRequestV3": { - "properties": { - "prompt": { - "description": "The prompt to use to generate the graphic.", - "example": "A birthday card saying 'Happy Birthday'", - "type": "string" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - }, - "resolution": { - "$ref": "#/components/schemas/ResolutionV3" - }, - "aspect_ratio": { - "$ref": "#/components/schemas/AspectRatioV3" - }, - "rendering_speed": { - "$ref": "#/components/schemas/RenderingSpeed" - }, - "magic_prompt": { - "$ref": "#/components/schemas/MagicPromptOption" - }, - "magic_prompt_system_prompt_config_id": { - "description": "A base64url-encoded magic prompt system prompt config ID to use for this request.", - "type": "string" - }, - "negative_prompt": { - "description": "Description of what to exclude from a graphic. Descriptions in the prompt take precedence\nto descriptions in the negative prompt.\n", - "example": "brush strokes, painting", - "type": "string" - }, - "num_images": { - "default": 1, - "description": "Number of graphics to generate.", - "maximum": 8, - "minimum": 1, - "type": "integer" - }, - "color_palette": { - "$ref": "#/components/schemas/ColorPaletteWithPresetNameOrMembers" - }, - "style_codes": { - "description": "A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.", - "example": [ - "AAFF5733", - "0133FF57", - "DE3357FF" - ], - "items": { - "$ref": "#/components/schemas/StyleCode" - }, - "type": "array", - "x-tool-description": "8-character hex style codes. Allowed combinations with other style controls depend on the operation." - }, - "style_type": { - "$ref": "#/components/schemas/StyleTypeV3" - }, - "style_preset": { - "$ref": "#/components/schemas/StylePresetV3" - }, - "custom_model_uri": { - "description": "A custom model URI in the format model//version/. \nWhen provided, the model version and style will be resolved from this URI, and style_type is not required.\n", - "example": "model/my-custom-model/version/1", - "type": "string" - }, - "flat_graphic_image": { - "description": "An existing flat graphic image to process for text detection and correction without generating a new image. When provided, image generation is bypassed. The image should be in JPEG, PNG or WebP format (max size 25MB).", - "format": "binary", - "type": "string" - }, - "font_file_h1": { - "description": "Custom font file for H1 (heading) text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_h1.", - "format": "binary", - "type": "string" - }, - "font_name_h1": { - "description": "Font name from the available font library for H1 text. Ignored if font_file_h1 is provided.", - "example": "Ubuntu-Bold.ttf", - "type": "string" - }, - "font_file_h2": { - "description": "Custom font file for H2 (subheading) text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_h2.", - "format": "binary", - "type": "string" - }, - "font_name_h2": { - "description": "Font name from the available font library for H2 text. Ignored if font_file_h2 is provided.", - "type": "string" - }, - "font_file_body": { - "description": "Custom font file for body text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_body.", - "format": "binary", - "type": "string" - }, - "font_name_body": { - "description": "Font name from the available font library for body text. Ignored if font_file_body is provided.", - "type": "string" - }, - "font_file_small": { - "description": "Custom font file for small/caption text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_small.", - "format": "binary", - "type": "string" - }, - "font_name_small": { - "description": "Font name from the available font library for small text. Ignored if font_file_small is provided.", - "type": "string" - }, - "style_reference_images": { - "description": "A set of images to use as style references (max size 25MB per image; the whole request must stay under 50MB). The images should be in JPEG, PNG or WebP format.", - "items": { - "format": "binary", - "type": "string" - }, - "type": "array" - }, - "reference_asset_images": { - "description": "A set of asset images (e.g., logos, icons) to use as references for detection and replacement (maximum 10 images). The images should be in JPEG, PNG or WebP format.", - "items": { - "format": "binary", - "type": "string" - }, - "type": "array" - } - }, - "type": "object" - }, - "GenerateDesignRequestV3": { - "properties": { - "prompt": { - "description": "The prompt to use to generate the design.", - "example": "A birthday card saying 'Happy Birthday'", - "type": "string" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - }, - "resolution": { - "$ref": "#/components/schemas/ResolutionV3" - }, - "aspect_ratio": { - "$ref": "#/components/schemas/AspectRatioV3" - }, - "rendering_speed": { - "$ref": "#/components/schemas/RenderingSpeed" - }, - "magic_prompt": { - "$ref": "#/components/schemas/MagicPromptOption" - }, - "magic_prompt_system_prompt_config_id": { - "description": "A base64url-encoded magic prompt system prompt config ID to use for this request.", - "type": "string" - }, - "negative_prompt": { - "description": "Description of what to exclude from a design. Descriptions in the prompt take precedence\nto descriptions in the negative prompt.\n", - "example": "brush strokes, painting", - "type": "string" - }, - "num_images": { - "default": 1, - "description": "Number of designs to generate.", - "maximum": 8, - "minimum": 1, - "type": "integer" - }, - "color_palette": { - "$ref": "#/components/schemas/ColorPaletteWithPresetNameOrMembers" - }, - "style_codes": { - "description": "A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.", - "example": [ - "AAFF5733", - "0133FF57", - "DE3357FF" - ], - "items": { - "$ref": "#/components/schemas/StyleCode" - }, - "type": "array", - "x-tool-description": "8-character hex style codes. Allowed combinations with other style controls depend on the operation." - }, - "style_type": { - "$ref": "#/components/schemas/StyleTypeV3" - }, - "style_preset": { - "$ref": "#/components/schemas/StylePresetV3" - }, - "custom_model_uri": { - "description": "A custom model URI in the format model//version/. \nWhen provided, the model version and style will be resolved from this URI, and style_type is not required.\n", - "example": "model/my-custom-model/version/1", - "type": "string" - }, - "font_file_h1": { - "description": "Custom font file for H1 (heading) text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_h1.", - "format": "binary", - "type": "string" - }, - "font_name_h1": { - "description": "Font name from the available font library for H1 text. Ignored if font_file_h1 is provided.", - "example": "Ubuntu-Bold.ttf", - "type": "string" - }, - "font_file_h2": { - "description": "Custom font file for H2 (subheading) text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_h2.", - "format": "binary", - "type": "string" - }, - "font_name_h2": { - "description": "Font name from the available font library for H2 text. Ignored if font_file_h2 is provided.", - "type": "string" - }, - "font_file_body": { - "description": "Custom font file for body text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_body.", - "format": "binary", - "type": "string" - }, - "font_name_body": { - "description": "Font name from the available font library for body text. Ignored if font_file_body is provided.", - "type": "string" - }, - "font_file_small": { - "description": "Custom font file for small/caption text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_small.", - "format": "binary", - "type": "string" - }, - "font_name_small": { - "description": "Font name from the available font library for small text. Ignored if font_file_small is provided.", - "type": "string" - }, - "style_reference_images": { - "description": "A set of images to use as style references (max size 25MB per image; the whole request must stay under 50MB). The images should be in JPEG, PNG or WebP format.", - "items": { - "format": "binary", - "type": "string" - }, - "type": "array" - }, - "reference_asset_images": { - "description": "A set of asset images (e.g., logos, icons) to use as references for detection and replacement (maximum 10 images). The images should be in JPEG, PNG or WebP format.", - "items": { - "format": "binary", - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "prompt" - ], - "type": "object" - }, - "LayerizeDesignRequestV3": { - "properties": { - "flat_graphic_image": { - "description": "The flat graphic image to process for text detection and correction. The image should be in JPEG, PNG or WebP format (max size 25MB).", - "format": "binary", - "type": "string" - }, - "prompt": { - "description": "An optional prompt to describe the image. If not provided, a prompt will be auto-generated from the image via captioning.", - "type": "string" - }, - "seed": { - "$ref": "#/components/schemas/Seed" - }, - "font_file_h1": { - "description": "Custom font file for H1 (heading) text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_h1.", - "format": "binary", - "type": "string" - }, - "font_name_h1": { - "description": "Font name from the available font library for H1 text. Ignored if font_file_h1 is provided.", - "example": "Ubuntu-Bold.ttf", - "type": "string" - }, - "font_file_h2": { - "description": "Custom font file for H2 (subheading) text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_h2.", - "format": "binary", - "type": "string" - }, - "font_name_h2": { - "description": "Font name from the available font library for H2 text. Ignored if font_file_h2 is provided.", - "type": "string" - }, - "font_file_body": { - "description": "Custom font file for body text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_body.", - "format": "binary", - "type": "string" - }, - "font_name_body": { - "description": "Font name from the available font library for body text. Ignored if font_file_body is provided.", - "type": "string" - }, - "font_file_small": { - "description": "Custom font file for small/caption text. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB). Takes priority over font_name_small.", - "format": "binary", - "type": "string" - }, - "font_name_small": { - "description": "Font name from the available font library for small text. Ignored if font_file_small is provided.", - "type": "string" - }, - "reference_asset_images": { - "description": "A set of asset images (e.g., logos, icons) to use as references for detection and replacement (maximum 10 images). The images should be in JPEG, PNG or WebP format.", - "items": { - "format": "binary", - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "flat_graphic_image" - ], - "type": "object" - }, - "GenerateTransparentImageRequestV3": { - "properties": { - "prompt": { - "description": "The prompt to use to generate the image.", - "example": "A photo of a cat", - "type": "string" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - }, - "upscale_factor": { - "$ref": "#/components/schemas/UpscaleFactor" - }, - "aspect_ratio": { - "$ref": "#/components/schemas/AspectRatioV3" - }, - "rendering_speed": { - "$ref": "#/components/schemas/RenderingSpeed" - }, - "magic_prompt": { - "$ref": "#/components/schemas/MagicPromptOption" - }, - "magic_prompt_system_prompt_config_id": { - "description": "A base64url-encoded magic prompt system prompt config ID to use for this request.", - "type": "string" - }, - "negative_prompt": { - "description": "Description of what to exclude from an image. Descriptions in the prompt take precedence\nto descriptions in the negative prompt.\n", - "example": "brush strokes, painting", - "type": "string" - }, - "num_images": { - "default": 1, - "description": "Number of images to generate.", - "maximum": 8, - "minimum": 1, - "type": "integer" - }, - "custom_model_uri": { - "description": "A custom model URI in the format model//version/. \nWhen provided, the model version and style will be resolved from this URI, and style_type is not required.\nA model must be able to generate transparent background to be used for this endpoint.\n", - "example": "model/my-custom-model/version/1", - "type": "string" - }, - "enable_copyright_detection": { - "description": "Optional. Opt this request into post-generation copyright detection (Hive likeness + logo\nchecks). The effective gate is the OR of this field and the organization's\n`copyright_detection_enabled` setting on `/api`: if the org has it on, this is ignored;\nif the org has it off, setting this `true` enables detection for this request only.\nAdds detection latency. Flagged images come back with `is_image_safe: false`.\n", - "nullable": true, - "type": "boolean" - } - }, - "required": [ - "prompt" - ], - "type": "object" - }, - "RemixImageRequestV3": { - "properties": { - "image": { - "description": "The image to remix binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time.", - "format": "binary", - "type": "string" - }, - "prompt": { - "description": "The prompt to use to generate the image.", - "example": "A photo of a cat", - "type": "string" - }, - "image_weight": { - "default": 50, - "example": 50, - "maximum": 100, - "minimum": 1, - "type": "integer" - }, - "seed": { - "$ref": "#/components/schemas/Seed" - }, - "resolution": { - "$ref": "#/components/schemas/ResolutionV3" - }, - "aspect_ratio": { - "$ref": "#/components/schemas/AspectRatioV3" - }, - "rendering_speed": { - "$ref": "#/components/schemas/RenderingSpeed" - }, - "magic_prompt": { - "$ref": "#/components/schemas/MagicPromptOption" - }, - "magic_prompt_system_prompt_config_id": { - "description": "A base64url-encoded magic prompt system prompt config ID to use for this request.", - "type": "string" - }, - "negative_prompt": { - "description": "Description of what to exclude from an image. Descriptions in the prompt take precedence\nto descriptions in the negative prompt.\n", - "example": "brush strokes, painting", - "type": "string" - }, - "num_images": { - "default": 1, - "description": "Number of images to generate.", - "maximum": 8, - "minimum": 1, - "type": "integer" - }, - "color_palette": { - "$ref": "#/components/schemas/ColorPaletteWithPresetNameOrMembers" - }, - "style_codes": { - "$ref": "#/components/schemas/StyleCodes" - }, - "style_type": { - "$ref": "#/components/schemas/StyleTypeV3" - }, - "style_preset": { - "$ref": "#/components/schemas/StylePresetV3" - }, - "custom_model_uri": { - "description": "A custom model URI in the format model//version/. \nWhen provided, the model version and style will be resolved from this URI, and style_type is not required.\n", - "example": "model/my-custom-model/version/1", - "type": "string" - }, - "style_reference_images": { - "description": "A set of images to use as style references (max size 25MB per image; the whole request must stay under 50MB). The images should be in JPEG, PNG or WebP format.", - "items": { - "format": "binary", - "type": "string" - }, - "type": "array" - }, - "character_reference_images": { - "description": "Generations with character reference are subject to the character reference pricing. A set of images to use as character references (max size 25MB per image; the whole request must stay under 50MB), currently only supports 1 character reference image. The images should be in JPEG, PNG or WebP format.", - "items": { - "format": "binary", - "type": "string" - }, - "type": "array" - }, - "character_reference_images_mask": { - "description": "Optional masks for character reference images. When provided, must match the number of character_reference_images. Each mask should be a grayscale image of the same dimensions as the corresponding character reference image. The images should be in JPEG, PNG or WebP format.", - "items": { - "format": "binary", - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "image", - "prompt" - ], - "type": "object" - }, - "EditImageRequestV3": { - "properties": { - "image": { - "description": "The image being edited (max size 25MB); only JPEG, WebP and PNG formats are supported at this time.", - "format": "binary", - "type": "string" - }, - "mask": { - "description": "A black and white image of the same size as the image being edited (max size 25MB). Black regions in the mask should match up with the regions of the image that you would like to edit; only JPEG, WebP and PNG formats are supported at this time.", - "format": "binary", - "type": "string" - }, - "prompt": { - "description": "The prompt used to describe the edited result.", - "example": "A photo of a cat.", - "type": "string" - }, - "magic_prompt": { - "$ref": "#/components/schemas/MagicPromptOption" - }, - "magic_prompt_system_prompt_config_id": { - "description": "A base64url-encoded magic prompt system prompt config ID to use for this request.", - "type": "string" - }, - "num_images": { - "$ref": "#/components/schemas/NumImages" - }, - "seed": { - "$ref": "#/components/schemas/Seed" - }, - "rendering_speed": { - "$ref": "#/components/schemas/RenderingSpeed" - }, - "style_type": { - "$ref": "#/components/schemas/StyleTypeV3" - }, - "style_preset": { - "$ref": "#/components/schemas/StylePresetV3" - }, - "custom_model_uri": { - "description": "A custom model URI in the format model//version/. \nWhen provided, the model version and style will be resolved from this URI, and style_type is not required.\n", - "example": "model/my-custom-model/version/1", - "type": "string" - }, - "color_palette": { - "$ref": "#/components/schemas/ColorPaletteWithPresetNameOrMembers" - }, - "style_codes": { - "$ref": "#/components/schemas/StyleCodes" - }, - "style_reference_images": { - "description": "A set of images to use as style references (max size 25MB per image; the whole request must stay under 50MB). The images should be in JPEG, PNG or WebP format.", - "items": { - "format": "binary", - "type": "string" - }, - "type": "array" - }, - "character_reference_images": { - "description": "Generations with character reference are subject to the character reference pricing. A set of images to use as character references (max size 25MB per image; the whole request must stay under 50MB), currently only supports 1 character reference image. The images should be in JPEG, PNG or WebP format.", - "items": { - "format": "binary", - "type": "string" - }, - "type": "array" - }, - "character_reference_images_mask": { - "description": "Optional masks for character reference images. When provided, must match the number of character_reference_images. Each mask should be a grayscale image of the same dimensions as the corresponding character reference image. The images should be in JPEG, PNG or WebP format.", - "items": { - "format": "binary", - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "image", - "mask", - "prompt" - ], - "type": "object" - }, - "V1EditImagesRequest": { - "properties": { - "prompt": { - "description": "The prompt describing the desired edit.", - "example": "Change the background to a beach sunset.", - "type": "string" - }, - "images": { - "description": "Images to edit (max 10 images, max size 25MB each); JPEG, WebP and PNG formats are supported.", - "items": { - "format": "binary", - "type": "string" - }, - "maxItems": 10, - "type": "array" - }, - "image_urls": { - "description": "URLs to Ideogram images to use as references (max 10). Supports URLs from generation responses and image uploads. Alternative to uploading via the images field.", - "items": { - "type": "string" - }, - "maxItems": 10, - "type": "array" - }, - "num_images": { - "$ref": "#/components/schemas/NumImages" - }, - "seed": { - "$ref": "#/components/schemas/Seed" - }, - "magic_prompt": { - "$ref": "#/components/schemas/MagicPromptOption" - }, - "magic_prompt_system_prompt_config_id": { - "description": "A base64url-encoded magic prompt system prompt config ID to use for this request.", - "type": "string" - }, - "resolution": { - "$ref": "#/components/schemas/ResolutionV3" - }, - "aspect_ratio": { - "$ref": "#/components/schemas/AspectRatioV3" - }, - "transparent_background": { - "default": false, - "description": "Whether the output should have a transparent background. Default false.\n\nWhen more than one image is supplied, the first image is treated as\nthe image being edited and drives the transparency decision.\n", - "type": "boolean" - } - }, - "required": [ - "prompt" - ], - "type": "object" - }, - "TransparencyOption": { - "default": "AUTO", - "description": "Controls whether the edited output has a transparent background.\n\n- `TRANSPARENT`: the output is produced with a transparent background.\n- `OPAQUE`: the output is produced with an opaque background.\n- `AUTO`: the server decides based on the prompt and the image being\n edited (e.g. whether it already has a transparent background). This is\n the default. When the prompt asks only for background removal, the\n output may be the edited image with its background removed.\n", - "enum": [ - "AUTO", - "TRANSPARENT", - "OPAQUE" - ], - "title": "TransparencyOption", - "type": "string" - }, - "AspectRatioEditLite": { - "description": "The aspect ratio of the edited output. When omitted, the output\nfollows the aspect ratio of the image being edited.\n", - "enum": [ - "1x1", - "2x3", - "3x2", - "3x4", - "4x3", - "4x5", - "5x4", - "9x16", - "16x9", - "21x9" - ], - "example": "16x9", - "title": "AspectRatioEditLite", - "type": "string" - }, - "V1EditLiteImagesRequest": { - "description": "Request to edit an image with a prompt.\n\nThe `image` field identifies the image being edited; it drives the\noutput aspect ratio and transparency decisions. Up to 9 additional\nreference images may be supplied via `reference_images`, for a total of\n10 images.\n", - "properties": { - "prompt": { - "description": "The prompt describing the desired edit.", - "example": "Remove the person from the photo.", - "type": "string" - }, - "image": { - "description": "The image being edited (max size 25MB); JPEG, WebP and PNG formats are supported.", - "format": "binary", - "type": "string" - }, - "reference_images": { - "description": "Optional additional reference images to guide the edit (max 9, max size 25MB each); JPEG, WebP and PNG formats are supported.", - "items": { - "format": "binary", - "type": "string" - }, - "maxItems": 9, - "type": "array" - }, - "num_images": { - "$ref": "#/components/schemas/NumImages" - }, - "seed": { - "$ref": "#/components/schemas/Seed" - }, - "magic_prompt": { - "$ref": "#/components/schemas/MagicPromptOption" - }, - "magic_prompt_system_prompt_config_id": { - "description": "A base64url-encoded magic prompt system prompt config ID to use for this request.", - "type": "string" - }, - "aspect_ratio": { - "$ref": "#/components/schemas/AspectRatioEditLite" - }, - "transparency": { - "$ref": "#/components/schemas/TransparencyOption" - } - }, - "required": [ - "image", - "prompt" - ], - "type": "object" - }, - "TryOnRequestV3": { - "properties": { - "image": { - "description": "The image containing a person wearing clothing to be modified (max size 25MB); only JPEG, WebP and PNG formats are supported at this time.", - "format": "binary", - "type": "string" - }, - "prompt": { - "default": "Person wearing this piece of clothing", - "description": "The prompt describing the desired clothing change. Defaults to \"Person wearing this piece of clothing\" if omitted or empty.", - "example": "Change his shirt to a pink shirt", - "type": "string" - }, - "magic_prompt": { - "$ref": "#/components/schemas/MagicPromptOption" - }, - "magic_prompt_system_prompt_config_id": { - "description": "A base64url-encoded magic prompt system prompt config ID to use for this request.", - "type": "string" - }, - "num_images": { - "$ref": "#/components/schemas/NumImages" - }, - "seed": { - "$ref": "#/components/schemas/Seed" - }, - "rendering_speed": { - "$ref": "#/components/schemas/RenderingSpeed" - }, - "style_type": { - "$ref": "#/components/schemas/StyleTypeV3" - }, - "style_preset": { - "$ref": "#/components/schemas/StylePresetV3" - }, - "product_reference_images": { - "description": "An image to use as the product reference for the try-on (exactly 1 image required). The image should be in JPEG, PNG or WebP format.", - "items": { - "format": "binary", - "type": "string" - }, - "maxItems": 1, - "minItems": 1, - "type": "array" - } - }, - "required": [ - "image", - "product_reference_images" - ], - "type": "object" - }, - "ReframeImageRequestV3": { - "properties": { - "image": { - "description": "The image being reframed (max size 25MB); only JPEG, WebP and PNG formats are supported at this time.", - "format": "binary", - "type": "string" - }, - "resolution": { - "$ref": "#/components/schemas/ResolutionV3" - }, - "num_images": { - "$ref": "#/components/schemas/NumImages" - }, - "seed": { - "$ref": "#/components/schemas/Seed" - }, - "rendering_speed": { - "$ref": "#/components/schemas/RenderingSpeed" - }, - "style_preset": { - "$ref": "#/components/schemas/StylePresetV3" - }, - "color_palette": { - "$ref": "#/components/schemas/ColorPaletteWithPresetNameOrMembers" - }, - "style_codes": { - "$ref": "#/components/schemas/StyleCodes" - }, - "style_reference_images": { - "description": "A set of images to use as style references (max size 25MB per image; the whole request must stay under 50MB). The images should be in JPEG, PNG or WebP format.", - "items": { - "format": "binary", - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "image", - "resolution" - ], - "type": "object" - }, - "ReplaceBackgroundRequestV3": { - "properties": { - "image": { - "description": "The image whose background is being replaced (max size 25MB); only JPEG, WebP and PNG formats are supported at this time.", - "format": "binary", - "type": "string" - }, - "prompt": { - "description": "The prompt describing the desired new background.", - "example": "A vibrant cityscape at night.", - "type": "string" - }, - "magic_prompt": { - "$ref": "#/components/schemas/MagicPromptOption" - }, - "magic_prompt_system_prompt_config_id": { - "description": "A base64url-encoded magic prompt system prompt config ID to use for this request.", - "type": "string" - }, - "num_images": { - "$ref": "#/components/schemas/NumImages" - }, - "seed": { - "$ref": "#/components/schemas/Seed" - }, - "rendering_speed": { - "$ref": "#/components/schemas/RenderingSpeed" - }, - "style_preset": { - "$ref": "#/components/schemas/StylePresetV3" - }, - "color_palette": { - "$ref": "#/components/schemas/ColorPaletteWithPresetNameOrMembers" - }, - "style_codes": { - "$ref": "#/components/schemas/StyleCodes" - }, - "style_reference_images": { - "description": "A set of images to use as style references (max size 25MB per image; the whole request must stay under 50MB). The images should be in JPEG, PNG or WebP format.", - "items": { - "format": "binary", - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "image", - "prompt" - ], - "type": "object" - }, - "RemoveBackgroundRequest": { - "properties": { - "image": { - "description": "The image whose background is being removed (max size 25MB); only JPEG, WebP and PNG formats are supported at this time.", - "format": "binary", - "type": "string" - } - }, - "required": [ - "image" - ], - "type": "object" - }, - "RemoveBackgroundResponse": { - "description": "The response containing the foreground image with the background removed.\nImage links are available for a limited period of time; if you would like to keep the image, you must download it.", - "example": { - "created": "2000-01-23T04:56:07+00:00", - "data": [ - { - "url": "https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89", - "is_image_safe": true - } - ] - }, - "properties": { - "created": { - "description": "The time the request was created.", - "format": "date-time", - "type": "string" - }, - "data": { - "description": "A list containing the single foreground image. The endpoint always returns exactly one entry.", - "items": { - "$ref": "#/components/schemas/RemoveBackgroundImageObject" - }, - "type": "array" - } - }, - "required": [ - "created", - "data" - ], - "title": "RemoveBackgroundResponse", - "type": "object" - }, - "RemoveBackgroundImageObject": { - "properties": { - "url": { - "description": "The direct link to the foreground image. Empty when the image fails safety checks.", - "example": "https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89", - "format": "uri", - "nullable": true, - "title": "url", - "type": "string" - }, - "is_image_safe": { - "description": "Whether the foreground image passes safety checks. If false, the url field will be empty.", - "title": "is_image_safe", - "type": "boolean" - } - }, - "required": [ - "is_image_safe" - ], - "title": "RemoveBackgroundImageObject", - "type": "object" - }, - "RemoveObjectRequest": { - "properties": { - "image": { - "description": "The image to remove an object from (max size 25MB); only JPEG, WebP and PNG formats are supported at this time.", - "format": "binary", - "type": "string" - }, - "mask": { - "description": "A binary mask the same size as the image; white (>= 128) marks the region to remove. Only JPEG, WebP and PNG formats are supported.", - "format": "binary", - "type": "string" - }, - "seed": { - "description": "Optional random seed for reproducible output. When omitted, a random seed is chosen.", - "maximum": 2147483647, - "minimum": 0, - "nullable": true, - "type": "integer" - }, - "num_inference_steps": { - "description": "Optional number of diffusion steps. Higher is slower but can improve quality; values are clamped to [1, 128]. When omitted, the model default is used.", - "maximum": 128, - "minimum": 1, - "nullable": true, - "type": "integer" - }, - "guidance_scale": { - "description": "Optional classifier-free guidance (CFG) scale. Higher follows the removal instruction more strongly; values are clamped to [1, 10]. When omitted, the model default is used.", - "format": "float", - "maximum": 10, - "minimum": 1, - "nullable": true, - "type": "number" - }, - "rendering_speed": { - "$ref": "#/components/schemas/RenderingSpeed" - } - }, - "required": [ - "image", - "mask" - ], - "type": "object" - }, - "SnapMaskRequest": { - "properties": { - "image": { - "description": "The source image containing the object (max size 25MB); only JPEG, WebP and PNG formats are supported at this time.", - "format": "binary", - "type": "string" - }, - "mask": { - "description": "A hand-drawn binary mask the same size as the image; white (>= 128) marks the object to snap. Only JPEG, WebP and PNG formats are supported.", - "format": "binary", - "type": "string" - } - }, - "required": [ - "image", - "mask" - ], - "type": "object" - }, - "RemoveObjectResponse": { - "description": "The response containing the image with the masked object removed.\nImage links are available for a limited period of time; if you would like to keep the image, you must download it.", - "example": { - "created": "2000-01-23T04:56:07+00:00", - "data": [ - { - "url": "https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89", - "is_image_safe": true - } - ] - }, - "properties": { - "created": { - "description": "The time the request was created.", - "format": "date-time", - "type": "string" - }, - "data": { - "description": "A list containing the single edited image. The endpoint always returns exactly one entry.", - "items": { - "$ref": "#/components/schemas/RemoveObjectImageObject" - }, - "type": "array" - } - }, - "required": [ - "created", - "data" - ], - "title": "RemoveObjectResponse", - "type": "object" - }, - "RemoveObjectImageObject": { - "properties": { - "url": { - "description": "The direct link to the edited image. Empty when the image fails safety checks.", - "example": "https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89", - "format": "uri", - "nullable": true, - "title": "url", - "type": "string" - }, - "is_image_safe": { - "description": "Whether the edited image passes safety checks. If false, the url field will be empty.", - "title": "is_image_safe", - "type": "boolean" - } - }, - "required": [ - "is_image_safe" - ], - "title": "RemoveObjectImageObject", - "type": "object" - }, - "InternalTestingRequest": { - "properties": { - "x_position": { - "nullable": true, - "type": "integer" - }, - "image_file": { - "description": "An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time.", - "format": "binary", - "type": "string" - }, - "another_image_file": { - "description": "An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time.", - "format": "binary", - "type": "string" - }, - "some_text": { - "type": "string" - }, - "nested_object": { - "$ref": "#/components/schemas/InternalTestingNestedObject" - }, - "nested_object_required_fields": { - "$ref": "#/components/schemas/InternalTestingNestedObjectRequiredFields" - }, - "date_type_field": { - "format": "date", - "type": "string" - }, - "required_date_type_field": { - "format": "date", - "type": "string" - }, - "date_time_type_field": { - "format": "date-time", - "type": "string" - }, - "repeated_primitive_field": { - "items": { - "type": "string" - }, - "type": "array" - }, - "repeated_complex_field": { - "items": { - "$ref": "#/components/schemas/InternalTestingNestedObject" - }, - "type": "array" - }, - "enum_type_field": { - "$ref": "#/components/schemas/InternalTestingEnumField" - } - }, - "required": [ - "required_date_type_field" - ], - "type": "object" - }, - "InternalTestingEnumField": { - "enum": [ - "EIN", - "ZWEI", - "DREI" - ], - "title": "InternalTestingEnumField", - "type": "string" - }, - "InternalTestingNestedObject": { - "properties": { - "prop_one": { - "title": "prop_one", - "type": "string" - }, - "prop_two": { - "title": "prop_two", - "type": "string" - } - }, - "title": "InternalTestingNestedObject", - "type": "object" - }, - "InternalTestingNestedObjectRequiredFields": { - "properties": { - "prop_one": { - "title": "prop_one", - "type": "string" - }, - "prop_two": { - "title": "prop_two", - "type": "string" - } - }, - "required": [ - "prop_one", - "prop_two" - ], - "title": "InternalTestingNestedObjectRequiredFields", - "type": "object" - }, - "RemixImageRequest": { - "description": "A request to generate an image from a source image and a provided caption, provided images are cropped to match the chosen output aspect ratio.", - "properties": { - "image_request": { - "$ref": "#/components/schemas/InitialImageRequest" - }, - "image_file": { - "description": "An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time.", - "format": "binary", - "type": "string" - } - }, - "required": [ - "image_file", - "image_request" - ], - "type": "object" - }, - "ReframeImageRequest": { - "properties": { - "image_file": { - "description": "The image being reframed (max size 25MB); only JPEG, WebP and PNG formats are supported at this time.", - "format": "binary", - "type": "string" - }, - "resolution": { - "$ref": "#/components/schemas/Resolution" - }, - "model": { - "$ref": "#/components/schemas/ModelEnum" - }, - "num_images": { - "$ref": "#/components/schemas/NumImages" - }, - "seed": { - "$ref": "#/components/schemas/Seed" - }, - "style_type": { - "$ref": "#/components/schemas/StyleType" - } - }, - "required": [ - "image_file", - "model", - "resolution" - ], - "type": "object" - }, - "UpscaleImageRequest": { - "properties": { - "image_request": { - "$ref": "#/components/schemas/UpscaleInitialImageRequest" - }, - "image_file": { - "description": "An image binary (max size 25MB); only JPEG, WebP and PNG formats are supported at this time.", - "format": "binary", - "type": "string" - } - }, - "required": [ - "image_file", - "image_request" - ], - "type": "object" - }, - "ImageRequest": { - "example": { - "aspect_ratio": "ASPECT_10_16", - "magic_prompt_option": "AUTO", - "model": "V_2", - "prompt": "A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there is an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset." - }, - "properties": { - "prompt": { - "description": "The prompt to use to generate the image.", - "example": "A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there is an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset.", - "type": "string" - }, - "aspect_ratio": { - "$ref": "#/components/schemas/AspectRatio" - }, - "model": { - "$ref": "#/components/schemas/ModelEnum" - }, - "magic_prompt_option": { - "$ref": "#/components/schemas/MagicPromptOption" - }, - "magic_prompt_system_prompt_config_id": { - "description": "A base64url-encoded magic prompt system prompt config ID to use for this request.", - "type": "string" - }, - "magic_prompt_version": { - "allOf": [ - { - "$ref": "#/components/schemas/MagicPromptVersionEnum" - } - ] - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - }, - "style_type": { - "$ref": "#/components/schemas/StyleType" - }, - "negative_prompt": { - "description": "Only available for model versions V_1, V_1_TURBO, V_2 and V_2_TURBO. Description of what to exclude from an image. Descriptions in the prompt take precedence to descriptions in the negative prompt.", - "example": "brush strokes, painting", - "type": "string" - }, - "num_images": { - "default": 1, - "description": "The number of images to generate.", - "maximum": 8, - "minimum": 1, - "title": "NumImages", - "type": "integer", - "x-tool-description": "Number of variations of this one prompt. For different subjects, make separate calls instead of listing them in one prompt." - }, - "resolution": { - "$ref": "#/components/schemas/Resolution" - }, - "color_palette": { - "$ref": "#/components/schemas/ColorPaletteWithPresetNameOrMembers" - } - }, - "required": [ - "prompt" - ], - "title": "ImageRequest", - "type": "object" - }, - "InitialImageRequest": { - "allOf": [ - { - "$ref": "#/components/schemas/ImageRequest" - } - ], - "description": "A request to generate a new image using a provided image and a prompt.", - "example": { - "aspect_ratio": "ASPECT_10_16", - "magic_prompt_option": "ON", - "model": "V_2", - "prompt": "A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there is an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset.", - "image_weight": 50 - }, - "properties": { - "image_weight": { - "default": 50, - "example": 50, - "maximum": 100, - "minimum": 1, - "type": "integer" - } - }, - "title": "InitialImageRequest", - "type": "object" - }, - "UpscaleInitialImageRequest": { - "description": "A request to upscale a provided image with the help of an optional prompt.", - "properties": { - "prompt": { - "description": "An optional prompt to guide the upscale", - "example": "A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there is an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset.", - "title": "prompt", - "type": "string" - }, - "resemblance": { - "default": 50, - "example": 50, - "maximum": 100, - "minimum": 1, - "title": "resemblance", - "type": "integer" - }, - "detail": { - "default": 50, - "example": 50, - "maximum": 100, - "minimum": 1, - "title": "detail", - "type": "integer" - }, - "magic_prompt_option": { - "$ref": "#/components/schemas/MagicPromptOption" - }, - "magic_prompt_system_prompt_config_id": { - "description": "A base64url-encoded magic prompt system prompt config ID to use for this request.", - "title": "magic_prompt_system_prompt_config_id", - "type": "string" - }, - "magic_prompt_version": { - "allOf": [ - { - "$ref": "#/components/schemas/MagicPromptVersionEnum" - } - ], - "title": "magic_prompt_version" - }, - "num_images": { - "default": 1, - "description": "The number of images to generate.", - "maximum": 8, - "minimum": 1, - "title": "NumImages", - "type": "integer", - "x-tool-description": "Number of variations of this one prompt. For different subjects, make separate calls instead of listing them in one prompt." - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - } - }, - "title": "UpscaleInitialImageRequest", - "type": "object" - }, - "GenerateImageResponse": { - "description": "The response which contains information about the generated image, including the download link.\nImages links are available for a limited period of time; if you would like to keep the image, you must download it.", - "example": { - "data": [ - { - "style_type": "REALISTIC", - "seed": 12345, - "upscaled_resolution": "4096x4096", - "prompt": "A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there's an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset.", - "resolution": "1024x1024", - "url": "https://ideogram.ai/api/images/direct/8YEpFzHuS-S6xXEGmCsf7g", - "is_image_safe": true - }, - { - "style_type": "REALISTIC", - "seed": 12345, - "upscaled_resolution": "4096x4096", - "prompt": "A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there's an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset.", - "resolution": "1024x1024", - "url": "https://ideogram.ai/api/images/direct/8YEpFzHuS-S6xXEGmCsf7g", - "is_image_safe": true - } - ], - "created": "2000-01-23T04:56:07+00:00", - "request_id": "request_id" - }, - "properties": { - "request_id": { - "description": "URL-safe base64 ID of the sampling request. Present when the caller\nsupplied `webhook_url` and the request was accepted for async\ndelivery; in that case `data` is omitted and the generated images\nwill be POSTed to the customer's `webhook_url` when ready.\n", - "title": "request_id", - "type": "string" - }, - "created": { - "description": "The time the request was created.", - "format": "date-time", - "title": "created", - "type": "string" - }, - "data": { - "description": "A list of ImageObjects that contain the generated image(s).", - "items": { - "$ref": "#/components/schemas/ImageObject" - }, - "title": "data", - "type": "array" - } - }, - "required": [ - "created" - ], - "title": "GenerateImageResponse", - "type": "object" - }, - "ImageGenerationResponseV3": { - "description": "The response which contains information about the generated image, including the download link.\nImages links are available for a limited period of time; if you would like to keep the image, you must download it.", - "example": { - "data": [ - { - "style_type": "GENERAL", - "seed": 12345, - "upscaled_resolution": "4096x4096", - "prompt": "A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there's an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset.", - "resolution": "1280x800", - "url": "https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89", - "is_image_safe": true - }, - { - "style_type": "GENERAL", - "seed": 12345, - "upscaled_resolution": "4096x4096", - "prompt": "A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there's an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset.", - "resolution": "1280x800", - "url": "https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89", - "is_image_safe": true - } - ], - "created": "2000-01-23T04:56:07+00:00" - }, - "properties": { - "created": { - "description": "The time the request was created.", - "format": "date-time", - "title": "created", - "type": "string" - }, - "data": { - "description": "A list of ImageObjects that contain the generated image(s).", - "items": { - "$ref": "#/components/schemas/ImageGenerationObjectV3" - }, - "title": "data", - "type": "array" - } - }, - "required": [ - "created", - "data" - ], - "title": "ImageGenerationResponseV3", - "type": "object" - }, - "ImageGenerationObjectV3": { - "example": { - "style_type": "GENERAL", - "seed": 12345, - "upscaled_resolution": "4096x4096", - "prompt": "A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there's an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset.", - "resolution": "1280x800", - "url": "https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89", - "is_image_safe": true - }, - "properties": { - "url": { - "description": "The direct link to the image generated.", - "example": "https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89", - "format": "uri", - "nullable": true, - "title": "url", - "type": "string" - }, - "prompt": { - "description": "The prompt used for the generation. This may be different from the original prompt.", - "example": "A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there's an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset.", - "title": "prompt", - "type": "string" - }, - "resolution": { - "$ref": "#/components/schemas/ResolutionV3" - }, - "upscaled_resolution": { - "description": "Output resolution, only used if operations alters image dimensions, such as upscale, crop etc.", - "example": "4096x4096", - "pattern": "^\\d{2,5}x\\d{2,5}$", - "title": "FreeformResolution", - "type": "string" - }, - "is_image_safe": { - "description": "Whether this request passes safety checks. If false, the url field will be empty.", - "title": "is_image_safe", - "type": "boolean" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - }, - "style_type": { - "$ref": "#/components/schemas/StyleTypeV3" - } - }, - "required": [ - "is_image_safe", - "prompt", - "resolution", - "seed" - ], - "title": "ImageGenerationObjectV3", - "type": "object" - }, - "V1EditImagesResponse": { - "description": "The response which contains information about the edited image, including the download link.\nImages links are available for a limited period of time; if you would like to keep the image, you must download it.", - "example": { - "data": [ - { - "style_type": "GENERAL", - "seed": 12345, - "upscaled_resolution": "4096x4096", - "prompt": "A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there's an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset.", - "resolution": "4096x4096", - "url": "https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89", - "is_image_safe": true - }, - { - "style_type": "GENERAL", - "seed": 12345, - "upscaled_resolution": "4096x4096", - "prompt": "A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there's an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset.", - "resolution": "4096x4096", - "url": "https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89", - "is_image_safe": true - } - ], - "created": "2000-01-23T04:56:07+00:00" - }, - "properties": { - "created": { - "description": "The time the request was created.", - "format": "date-time", - "title": "created", - "type": "string" - }, - "data": { - "description": "A list of ImageObjects that contain the edited image(s).", - "items": { - "$ref": "#/components/schemas/V1EditImageObject" - }, - "title": "data", - "type": "array" - } - }, - "required": [ - "created", - "data" - ], - "title": "V1EditImagesResponse", - "type": "object" - }, - "V1EditImageObject": { - "example": { - "style_type": "GENERAL", - "seed": 12345, - "upscaled_resolution": "4096x4096", - "prompt": "A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there's an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset.", - "resolution": "4096x4096", - "url": "https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89", - "is_image_safe": true - }, - "properties": { - "url": { - "description": "The direct link to the image generated.", - "example": "https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89", - "format": "uri", - "nullable": true, - "title": "url", - "type": "string" - }, - "prompt": { - "description": "The prompt used for the generation. This may be different from the original prompt.", - "example": "A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there's an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset.", - "title": "prompt", - "type": "string" - }, - "resolution": { - "description": "Output resolution, only used if operations alters image dimensions, such as upscale, crop etc.", - "example": "4096x4096", - "pattern": "^\\d{2,5}x\\d{2,5}$", - "title": "FreeformResolution", - "type": "string" - }, - "upscaled_resolution": { - "description": "Output resolution, only used if operations alters image dimensions, such as upscale, crop etc.", - "example": "4096x4096", - "pattern": "^\\d{2,5}x\\d{2,5}$", - "title": "FreeformResolution", - "type": "string" - }, - "is_image_safe": { - "description": "Whether this request passes safety checks. If false, the url field will be empty.", - "title": "is_image_safe", - "type": "boolean" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - }, - "style_type": { - "$ref": "#/components/schemas/StyleTypeV3" - } - }, - "required": [ - "is_image_safe", - "prompt", - "resolution", - "seed" - ], - "title": "V1EditImageObject", - "type": "object" - }, - "ImageObject": { - "example": { - "style_type": "REALISTIC", - "seed": 12345, - "upscaled_resolution": "4096x4096", - "prompt": "A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there's an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset.", - "resolution": "1024x1024", - "url": "https://ideogram.ai/api/images/direct/8YEpFzHuS-S6xXEGmCsf7g", - "is_image_safe": true - }, - "properties": { - "url": { - "description": "The direct link to the image generated.", - "example": "https://ideogram.ai/api/images/direct/8YEpFzHuS-S6xXEGmCsf7g", - "format": "uri", - "nullable": true, - "title": "url", - "type": "string" - }, - "prompt": { - "description": "The prompt used for the generation. This may be different from the original prompt.", - "example": "A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there's an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset.", - "title": "prompt", - "type": "string" - }, - "resolution": { - "description": "The resolution of the final image.", - "example": "1024x1024", - "title": "resolution", - "type": "string" - }, - "upscaled_resolution": { - "description": "Output resolution, only used if operations alters image dimensions, such as upscale, crop etc.", - "example": "4096x4096", - "pattern": "^\\d{2,5}x\\d{2,5}$", - "title": "FreeformResolution", - "type": "string" - }, - "is_image_safe": { - "description": "Whether this request passes safety checks. If false, the url field will be empty.", - "title": "is_image_safe", - "type": "boolean" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - }, - "style_type": { - "$ref": "#/components/schemas/StyleType" - } - }, - "required": [ - "is_image_safe", - "prompt", - "resolution", - "seed" - ], - "title": "ImageObject", - "type": "object" - }, - "ImageGenerationResponseV4": { - "description": "The response which contains information about the generated image, including the download link.\nImages links are available for a limited period of time; if you would like to keep the image, you must download it.", - "example": { - "data": [ - { - "seed": 12345, - "prompt": "prompt", - "resolution": "1024x1024", - "url": "https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89", - "is_image_safe": true - }, - { - "seed": 12345, - "prompt": "prompt", - "resolution": "1024x1024", - "url": "https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89", - "is_image_safe": true - } - ], - "created": "2000-01-23T04:56:07+00:00", - "response_type": "url" - }, - "properties": { - "response_type": { - "description": "Discriminator for the postGenerateDesignV4 oneOf response. Always \"url\" for this shape.", - "enum": [ - "url" - ], - "title": "response_type", - "type": "string" - }, - "created": { - "description": "The time the request was created.", - "format": "date-time", - "title": "created", - "type": "string" - }, - "data": { - "description": "A list of ImageObjects that contain the generated image(s).", - "items": { - "$ref": "#/components/schemas/ImageGenerationObjectV4" - }, - "title": "data", - "type": "array" - } - }, - "required": [ - "created", - "data" - ], - "title": "ImageGenerationResponseV4", - "type": "object" - }, - "AsyncImageGenerationResponseV4": { - "description": "Acknowledgement returned by the async (webhook) generation endpoints. The\nrequest is accepted for asynchronous processing and the generated images\nare POSTed to the supplied `webhook_url` once ready; this body carries only\nthe generation_id so the caller can correlate the eventual webhook delivery.\n", - "example": { - "generation_id": "generation_id" - }, - "properties": { - "generation_id": { - "description": "URL-safe base64 ID of the accepted generation. Matches the\n`generation_id` field delivered in the webhook payload, and the\n`generation_id` accepted by the generation polling endpoint.\n", - "title": "generation_id", - "type": "string" - } - }, - "required": [ - "generation_id" - ], - "title": "AsyncImageGenerationResponseV4", - "type": "object" - }, - "GenerationResponse": { - "description": "The current status and, when complete, result data for an asynchronous generation.", - "example": { - "generation_id": "bzue-VZtSlSMAneIbfCo2A", - "status": "completed", - "created": "2000-01-23T04:56:07+00:00", - "response_type": "url", - "data": [ - { - "prompt": "prompt", - "resolution": "2048x2048", - "seed": 12345, - "is_image_safe": true, - "url": "https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89" - } - ] - }, - "properties": { - "generation_id": { - "description": "URL-safe base64 ID of the generation.", - "type": "string" - }, - "status": { - "description": "Current status of the generation. `pending`: still in progress; the response contains only `generation_id`, `status`, and `created`. `completed`: finished successfully; the response includes `response_type` and `data`, and may include `usage_cost_usd_micros` when the request uses variable usage-based pricing. `failed`: generation did not succeed; the response contains only `generation_id`, `status`, and `created`.", - "enum": [ - "pending", - "completed", - "failed" - ], - "type": "string" - }, - "created": { - "description": "The time the generation was created.", - "format": "date-time", - "type": "string" - }, - "response_type": { - "description": "Present when `status` is `completed`; always \"url\" for this shape.", - "enum": [ - "url" - ], - "type": "string" - }, - "usage_cost_usd_micros": { - "description": "The total variable usage-based cost charged for the completed request, in millionths of a US dollar. Present only when `status` is `completed` and the request uses variable usage-based pricing; omitted otherwise.", - "example": 130000, - "format": "int64", - "minimum": 0, - "type": "integer" - }, - "failure_reason": { - "description": "A short machine-readable reason the generation failed, for example\n`content_policy_violation`. Present only when `status` is `failed`.\n", - "example": "content_policy_violation", - "type": "string" - }, - "data": { - "description": "A list of generated images or videos. Present when `status` is\n`completed`. Video entries carry an `object_type` of\n`video.generation`; layerized designs carry `layerized_image`;\nentries without an `object_type` are images.\n", - "items": { - "$ref": "#/components/schemas/GenerationResponse_data_inner" - }, - "type": "array" - } - }, - "required": [ - "created", - "generation_id", - "status" - ], - "title": "GenerationResponse", - "type": "object", - "x-drop-nulls": true - }, - "ImageObjectWithoutPromptOrSeed": { - "description": "An image result that does not expose its prompt or seed.", - "properties": { - "object_type": { - "description": "Discriminator marking this entry as an image result without prompt or seed.", - "enum": [ - "image.without-prompt-or-seed" - ], - "title": "object_type", - "type": "string" - }, - "url": { - "description": "The direct link to the reframed image.", - "format": "uri", - "nullable": true, - "title": "url", - "type": "string" - }, - "asset_id": { - "description": "The base64url-encoded identifier of the generated image asset. Present for safe workflow-owned outputs.", - "nullable": true, - "title": "asset_id", - "type": "string" - }, - "resolution": { - "description": "The exact dimensions of the reframed image, formatted as \"{width}x{height}\".", - "example": "1920x1080", - "title": "resolution", - "type": "string" - }, - "is_image_safe": { - "description": "Whether this image passes safety checks. If false, the url field is empty.", - "title": "is_image_safe", - "type": "boolean" - } - }, - "required": [ - "is_image_safe", - "object_type", - "resolution" - ], - "title": "ImageObjectWithoutPromptOrSeed", - "type": "object" - }, - "ImageGenerationObject": { - "description": "A single generated image. Model-agnostic shape returned by the generation polling endpoint.", - "example": { - "seed": 12345, - "object_type": "image.generation", - "asset_id": "asset_id", - "prompt": "prompt", - "resolution": "2048x2048", - "url": "https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89", - "is_image_safe": true - }, - "properties": { - "object_type": { - "description": "Discriminator marking this entry as a generated image in the polling endpoint's mixed data array.", - "enum": [ - "image.generation" - ], - "title": "object_type", - "type": "string" - }, - "url": { - "description": "The direct link to the image generated.", - "example": "https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89", - "format": "uri", - "nullable": true, - "title": "url", - "type": "string" - }, - "asset_id": { - "description": "The base64url-encoded identifier of the generated image asset. Present for safe workflow-owned outputs.", - "nullable": true, - "title": "asset_id", - "type": "string" - }, - "prompt": { - "description": "The prompt used for the generation. This may be different from the original prompt.", - "title": "prompt", - "type": "string" - }, - "resolution": { - "description": "The resolution of the generated image, formatted as \"{width}x{height}\".", - "example": "2048x2048", - "title": "resolution", - "type": "string" - }, - "is_image_safe": { - "description": "Whether this image passes safety checks. If false, the url field will be empty.", - "title": "is_image_safe", - "type": "boolean" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - } - }, - "required": [ - "is_image_safe", - "prompt", - "resolution", - "seed" - ], - "title": "ImageGenerationObject", - "type": "object" - }, - "ImageGenerationObjectV4": { - "example": { - "seed": 12345, - "prompt": "prompt", - "resolution": "1024x1024", - "url": "https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89", - "is_image_safe": true - }, - "properties": { - "url": { - "description": "The direct link to the image generated.", - "example": "https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89", - "format": "uri", - "nullable": true, - "title": "url", - "type": "string" - }, - "prompt": { - "description": "The prompt used for the generation. This may be different from the original prompt.", - "title": "prompt", - "type": "string" - }, - "resolution": { - "description": "The output resolution of the image, in the format\nWIDTHxHEIGHT (e.g. 1024x1024). Not limited to the request\nresolution presets, since some endpoints accept custom output\nsizes.\n", - "example": "1024x1024", - "title": "resolution", - "type": "string" - }, - "is_image_safe": { - "description": "Whether this request passes safety checks. If false, the url field will be empty.", - "title": "is_image_safe", - "type": "boolean" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - } - }, - "required": [ - "is_image_safe", - "prompt", - "resolution", - "seed" - ], - "title": "ImageGenerationObjectV4", - "type": "object" - }, - "ImageGenerationResponse": { - "description": "The response for self-hosted open-source model generation endpoints. Uses a free-form resolution string (not a grid enum) because these models accept arbitrary dimensions.", - "example": { - "data": [ - { - "seed": 12345, - "object_type": "image.generation", - "asset_id": "asset_id", - "prompt": "prompt", - "resolution": "2048x2048", - "url": "https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89", - "is_image_safe": true - }, - { - "seed": 12345, - "object_type": "image.generation", - "asset_id": "asset_id", - "prompt": "prompt", - "resolution": "2048x2048", - "url": "https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89", - "is_image_safe": true - } - ], - "created": "2000-01-23T04:56:07+00:00" - }, - "properties": { - "created": { - "description": "The time the request was created.", - "format": "date-time", - "title": "created", - "type": "string" - }, - "data": { - "description": "A list of ImageObjects that contain the generated image(s).", - "items": { - "$ref": "#/components/schemas/ImageGenerationObject" - }, - "title": "data", - "type": "array" - } - }, - "required": [ - "created", - "data" - ], - "title": "ImageGenerationResponse", - "type": "object" - }, - "ImageGenerationResponseV4ImageToImage": { - "description": "The response which contains information about the generated image-to-image output, including the download link.\nImages links are available for a limited period of time; if you would like to keep the image, you must download it.", - "example": { - "data": [ - { - "seed": 12345, - "prompt": "prompt", - "resolution": "1024x1024", - "url": "https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89", - "is_image_safe": true - }, - { - "seed": 12345, - "prompt": "prompt", - "resolution": "1024x1024", - "url": "https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89", - "is_image_safe": true - } - ], - "created": "2000-01-23T04:56:07+00:00", - "response_type": "url" - }, - "properties": { - "response_type": { - "description": "Always \"url\" for this shape.", - "enum": [ - "url" - ], - "title": "response_type", - "type": "string" - }, - "created": { - "description": "The time the request was created.", - "format": "date-time", - "title": "created", - "type": "string" - }, - "data": { - "description": "A list of ImageObjects that contain the generated image(s).", - "items": { - "$ref": "#/components/schemas/ImageGenerationObjectV4ImageToImage" - }, - "title": "data", - "type": "array" - } - }, - "required": [ - "created", - "data" - ], - "title": "ImageGenerationResponseV4ImageToImage", - "type": "object" - }, - "ImageGenerationObjectV4ImageToImage": { - "example": { - "seed": 12345, - "prompt": "prompt", - "resolution": "1024x1024", - "url": "https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89", - "is_image_safe": true - }, - "properties": { - "url": { - "description": "The direct link to the image generated.", - "example": "https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89", - "format": "uri", - "nullable": true, - "title": "url", - "type": "string" - }, - "prompt": { - "description": "The prompt used for the generation. This may be different from the original prompt.", - "title": "prompt", - "type": "string" - }, - "resolution": { - "$ref": "#/components/schemas/ResolutionV4ImageToImage" - }, - "is_image_safe": { - "description": "Whether this request passes safety checks. If false, the url field will be empty.", - "title": "is_image_safe", - "type": "boolean" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - } - }, - "required": [ - "is_image_safe", - "prompt", - "resolution", - "seed" - ], - "title": "ImageGenerationObjectV4ImageToImage", - "type": "object" - }, - "ImageGenerationResponseV4Layout": { - "description": "The response which contains information about the generated layout-to-image output, including the download link.\nImages links are available for a limited period of time; if you would like to keep the image, you must download it.", - "properties": { - "response_type": { - "description": "Discriminator for the postGenerateDesignV4 oneOf response. Always \"url\" for this shape.", - "enum": [ - "url" - ], - "title": "response_type", - "type": "string" - }, - "created": { - "description": "The time the request was created.", - "format": "date-time", - "title": "created", - "type": "string" - }, - "data": { - "description": "A list of ImageObjects that contain the generated image(s).", - "items": { - "$ref": "#/components/schemas/ImageGenerationObjectV4Layout" - }, - "title": "data", - "type": "array" - } - }, - "required": [ - "created", - "data" - ], - "title": "ImageGenerationResponseV4Layout", - "type": "object" - }, - "ImageGenerationObjectV4Layout": { - "properties": { - "url": { - "description": "The direct link to the image generated.", - "example": "https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89", - "format": "uri", - "nullable": true, - "title": "url", - "type": "string" - }, - "prompt": { - "description": "The prompt used for the generation. This may be different from the original prompt.", - "title": "prompt", - "type": "string" - }, - "resolution": { - "$ref": "#/components/schemas/ResolutionV4Layout" - }, - "is_image_safe": { - "description": "Whether this request passes safety checks. If false, the url field will be empty.", - "title": "is_image_safe", - "type": "boolean" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - } - }, - "required": [ - "is_image_safe", - "prompt", - "resolution", - "seed" - ], - "title": "ImageGenerationObjectV4Layout", - "type": "object" - }, - "LayeredImageGenerationObjectV3": { - "allOf": [ - { - "$ref": "#/components/schemas/ImageGenerationObjectV3" - } - ], - "example": { - "text_containers": [ - { - "id": "id", - "items": [ - { - "font_candidates": [ - "font_candidates", - "font_candidates" - ], - "spans": [ - { - "color": "#212121", - "text": "text", - "font_fx": [ - "bold", - "italic" - ] - }, - { - "color": "#212121", - "text": "text", - "font_fx": [ - "bold", - "italic" - ] - } - ], - "text_shadows": [ - { - "color": "color", - "blur": 0.2027123, - "offset_x": 9.301444, - "offset_y": 3.6160767 - }, - { - "color": "color", - "blur": 0.2027123, - "offset_x": 9.301444, - "offset_y": 3.6160767 - } - ], - "font_size": 5, - "vertical_alignment": "top", - "text_transform": "none", - "glyph_type": "bullet", - "line_height": 2.302136, - "x": 0, - "width": 1, - "style_class": "body", - "y": 6, - "angle": 0, - "alignment": "center", - "font_file": "font_file", - "letter_spacing": 7.0614014, - "height": 5 - }, - { - "font_candidates": [ - "font_candidates", - "font_candidates" - ], - "spans": [ - { - "color": "#212121", - "text": "text", - "font_fx": [ - "bold", - "italic" - ] - }, - { - "color": "#212121", - "text": "text", - "font_fx": [ - "bold", - "italic" - ] - } - ], - "text_shadows": [ - { - "color": "color", - "blur": 0.2027123, - "offset_x": 9.301444, - "offset_y": 3.6160767 - }, - { - "color": "color", - "blur": 0.2027123, - "offset_x": 9.301444, - "offset_y": 3.6160767 - } - ], - "font_size": 5, - "vertical_alignment": "top", - "text_transform": "none", - "glyph_type": "bullet", - "line_height": 2.302136, - "x": 0, - "width": 1, - "style_class": "body", - "y": 6, - "angle": 0, - "alignment": "center", - "font_file": "font_file", - "letter_spacing": 7.0614014, - "height": 5 - } - ] - }, - { - "id": "id", - "items": [ - { - "font_candidates": [ - "font_candidates", - "font_candidates" - ], - "spans": [ - { - "color": "#212121", - "text": "text", - "font_fx": [ - "bold", - "italic" - ] - }, - { - "color": "#212121", - "text": "text", - "font_fx": [ - "bold", - "italic" - ] - } - ], - "text_shadows": [ - { - "color": "color", - "blur": 0.2027123, - "offset_x": 9.301444, - "offset_y": 3.6160767 - }, - { - "color": "color", - "blur": 0.2027123, - "offset_x": 9.301444, - "offset_y": 3.6160767 - } - ], - "font_size": 5, - "vertical_alignment": "top", - "text_transform": "none", - "glyph_type": "bullet", - "line_height": 2.302136, - "x": 0, - "width": 1, - "style_class": "body", - "y": 6, - "angle": 0, - "alignment": "center", - "font_file": "font_file", - "letter_spacing": 7.0614014, - "height": 5 - }, - { - "font_candidates": [ - "font_candidates", - "font_candidates" - ], - "spans": [ - { - "color": "#212121", - "text": "text", - "font_fx": [ - "bold", - "italic" - ] - }, - { - "color": "#212121", - "text": "text", - "font_fx": [ - "bold", - "italic" - ] - } - ], - "text_shadows": [ - { - "color": "color", - "blur": 0.2027123, - "offset_x": 9.301444, - "offset_y": 3.6160767 - }, - { - "color": "color", - "blur": 0.2027123, - "offset_x": 9.301444, - "offset_y": 3.6160767 - } - ], - "font_size": 5, - "vertical_alignment": "top", - "text_transform": "none", - "glyph_type": "bullet", - "line_height": 2.302136, - "x": 0, - "width": 1, - "style_class": "body", - "y": 6, - "angle": 0, - "alignment": "center", - "font_file": "font_file", - "letter_spacing": 7.0614014, - "height": 5 - } - ] - } - ], - "image_layers": [ - { - "ref_id": "REF_0", - "x": 4, - "width": 1, - "y": 7, - "height": 1 - }, - { - "ref_id": "REF_0", - "x": 4, - "width": 1, - "y": 7, - "height": 1 - } - ], - "url": "https://openapi-generator.tech", - "text_html": "text_html" - }, - "properties": { - "url": { - "description": "The direct link to the text-erased base image. This is the background image with text removed, suitable for re-compositing with the text layers. Falls back to the cover image if the text-erased image is unavailable.", - "format": "uri", - "nullable": true, - "title": "url", - "type": "string" - }, - "text_containers": { - "description": "Hierarchical text container data as a list of TextContainerV3 objects.", - "items": { - "$ref": "#/components/schemas/TextContainerV3" - }, - "nullable": true, - "title": "text_containers", - "type": "array" - }, - "text_html": { - "description": "Rendered HTML string for text overlays with inline CSS for absolute positioning.", - "nullable": true, - "title": "text_html", - "type": "string" - }, - "image_layers": { - "items": { - "$ref": "#/components/schemas/ImageLayerV3" - }, - "title": "image_layers", - "type": "array" - } - }, - "title": "LayeredImageGenerationObjectV3", - "type": "object" - }, - "LayeredImageGenerationResponseV3": { - "description": "The response which contains information about the generated image, including the download link and other text layeres.\nImages links are available for a limited period of time; if you would like to keep the image, you must download it.", - "example": { - "data": [ - { - "text_containers": [ - { - "id": "id", - "items": [ - { - "font_candidates": [ - "font_candidates", - "font_candidates" - ], - "spans": [ - { - "color": "#212121", - "text": "text", - "font_fx": [ - "bold", - "italic" - ] - }, - { - "color": "#212121", - "text": "text", - "font_fx": [ - "bold", - "italic" - ] - } - ], - "text_shadows": [ - { - "color": "color", - "blur": 0.2027123, - "offset_x": 9.301444, - "offset_y": 3.6160767 - }, - { - "color": "color", - "blur": 0.2027123, - "offset_x": 9.301444, - "offset_y": 3.6160767 - } - ], - "font_size": 5, - "vertical_alignment": "top", - "text_transform": "none", - "glyph_type": "bullet", - "line_height": 2.302136, - "x": 0, - "width": 1, - "style_class": "body", - "y": 6, - "angle": 0, - "alignment": "center", - "font_file": "font_file", - "letter_spacing": 7.0614014, - "height": 5 - }, - { - "font_candidates": [ - "font_candidates", - "font_candidates" - ], - "spans": [ - { - "color": "#212121", - "text": "text", - "font_fx": [ - "bold", - "italic" - ] - }, - { - "color": "#212121", - "text": "text", - "font_fx": [ - "bold", - "italic" - ] - } - ], - "text_shadows": [ - { - "color": "color", - "blur": 0.2027123, - "offset_x": 9.301444, - "offset_y": 3.6160767 - }, - { - "color": "color", - "blur": 0.2027123, - "offset_x": 9.301444, - "offset_y": 3.6160767 - } - ], - "font_size": 5, - "vertical_alignment": "top", - "text_transform": "none", - "glyph_type": "bullet", - "line_height": 2.302136, - "x": 0, - "width": 1, - "style_class": "body", - "y": 6, - "angle": 0, - "alignment": "center", - "font_file": "font_file", - "letter_spacing": 7.0614014, - "height": 5 - } - ] - }, - { - "id": "id", - "items": [ - { - "font_candidates": [ - "font_candidates", - "font_candidates" - ], - "spans": [ - { - "color": "#212121", - "text": "text", - "font_fx": [ - "bold", - "italic" - ] - }, - { - "color": "#212121", - "text": "text", - "font_fx": [ - "bold", - "italic" - ] - } - ], - "text_shadows": [ - { - "color": "color", - "blur": 0.2027123, - "offset_x": 9.301444, - "offset_y": 3.6160767 - }, - { - "color": "color", - "blur": 0.2027123, - "offset_x": 9.301444, - "offset_y": 3.6160767 - } - ], - "font_size": 5, - "vertical_alignment": "top", - "text_transform": "none", - "glyph_type": "bullet", - "line_height": 2.302136, - "x": 0, - "width": 1, - "style_class": "body", - "y": 6, - "angle": 0, - "alignment": "center", - "font_file": "font_file", - "letter_spacing": 7.0614014, - "height": 5 - }, - { - "font_candidates": [ - "font_candidates", - "font_candidates" - ], - "spans": [ - { - "color": "#212121", - "text": "text", - "font_fx": [ - "bold", - "italic" - ] - }, - { - "color": "#212121", - "text": "text", - "font_fx": [ - "bold", - "italic" - ] - } - ], - "text_shadows": [ - { - "color": "color", - "blur": 0.2027123, - "offset_x": 9.301444, - "offset_y": 3.6160767 - }, - { - "color": "color", - "blur": 0.2027123, - "offset_x": 9.301444, - "offset_y": 3.6160767 - } - ], - "font_size": 5, - "vertical_alignment": "top", - "text_transform": "none", - "glyph_type": "bullet", - "line_height": 2.302136, - "x": 0, - "width": 1, - "style_class": "body", - "y": 6, - "angle": 0, - "alignment": "center", - "font_file": "font_file", - "letter_spacing": 7.0614014, - "height": 5 - } - ] - } - ], - "image_layers": [ - { - "ref_id": "REF_0", - "x": 4, - "width": 1, - "y": 7, - "height": 1 - }, - { - "ref_id": "REF_0", - "x": 4, - "width": 1, - "y": 7, - "height": 1 - } - ], - "url": "https://openapi-generator.tech", - "text_html": "text_html" - }, - { - "text_containers": [ - { - "id": "id", - "items": [ - { - "font_candidates": [ - "font_candidates", - "font_candidates" - ], - "spans": [ - { - "color": "#212121", - "text": "text", - "font_fx": [ - "bold", - "italic" - ] - }, - { - "color": "#212121", - "text": "text", - "font_fx": [ - "bold", - "italic" - ] - } - ], - "text_shadows": [ - { - "color": "color", - "blur": 0.2027123, - "offset_x": 9.301444, - "offset_y": 3.6160767 - }, - { - "color": "color", - "blur": 0.2027123, - "offset_x": 9.301444, - "offset_y": 3.6160767 - } - ], - "font_size": 5, - "vertical_alignment": "top", - "text_transform": "none", - "glyph_type": "bullet", - "line_height": 2.302136, - "x": 0, - "width": 1, - "style_class": "body", - "y": 6, - "angle": 0, - "alignment": "center", - "font_file": "font_file", - "letter_spacing": 7.0614014, - "height": 5 - }, - { - "font_candidates": [ - "font_candidates", - "font_candidates" - ], - "spans": [ - { - "color": "#212121", - "text": "text", - "font_fx": [ - "bold", - "italic" - ] - }, - { - "color": "#212121", - "text": "text", - "font_fx": [ - "bold", - "italic" - ] - } - ], - "text_shadows": [ - { - "color": "color", - "blur": 0.2027123, - "offset_x": 9.301444, - "offset_y": 3.6160767 - }, - { - "color": "color", - "blur": 0.2027123, - "offset_x": 9.301444, - "offset_y": 3.6160767 - } - ], - "font_size": 5, - "vertical_alignment": "top", - "text_transform": "none", - "glyph_type": "bullet", - "line_height": 2.302136, - "x": 0, - "width": 1, - "style_class": "body", - "y": 6, - "angle": 0, - "alignment": "center", - "font_file": "font_file", - "letter_spacing": 7.0614014, - "height": 5 - } - ] - }, - { - "id": "id", - "items": [ - { - "font_candidates": [ - "font_candidates", - "font_candidates" - ], - "spans": [ - { - "color": "#212121", - "text": "text", - "font_fx": [ - "bold", - "italic" - ] - }, - { - "color": "#212121", - "text": "text", - "font_fx": [ - "bold", - "italic" - ] - } - ], - "text_shadows": [ - { - "color": "color", - "blur": 0.2027123, - "offset_x": 9.301444, - "offset_y": 3.6160767 - }, - { - "color": "color", - "blur": 0.2027123, - "offset_x": 9.301444, - "offset_y": 3.6160767 - } - ], - "font_size": 5, - "vertical_alignment": "top", - "text_transform": "none", - "glyph_type": "bullet", - "line_height": 2.302136, - "x": 0, - "width": 1, - "style_class": "body", - "y": 6, - "angle": 0, - "alignment": "center", - "font_file": "font_file", - "letter_spacing": 7.0614014, - "height": 5 - }, - { - "font_candidates": [ - "font_candidates", - "font_candidates" - ], - "spans": [ - { - "color": "#212121", - "text": "text", - "font_fx": [ - "bold", - "italic" - ] - }, - { - "color": "#212121", - "text": "text", - "font_fx": [ - "bold", - "italic" - ] - } - ], - "text_shadows": [ - { - "color": "color", - "blur": 0.2027123, - "offset_x": 9.301444, - "offset_y": 3.6160767 - }, - { - "color": "color", - "blur": 0.2027123, - "offset_x": 9.301444, - "offset_y": 3.6160767 - } - ], - "font_size": 5, - "vertical_alignment": "top", - "text_transform": "none", - "glyph_type": "bullet", - "line_height": 2.302136, - "x": 0, - "width": 1, - "style_class": "body", - "y": 6, - "angle": 0, - "alignment": "center", - "font_file": "font_file", - "letter_spacing": 7.0614014, - "height": 5 - } - ] - } - ], - "image_layers": [ - { - "ref_id": "REF_0", - "x": 4, - "width": 1, - "y": 7, - "height": 1 - }, - { - "ref_id": "REF_0", - "x": 4, - "width": 1, - "y": 7, - "height": 1 - } - ], - "url": "https://openapi-generator.tech", - "text_html": "text_html" - } - ], - "created": "2000-01-23T04:56:07+00:00", - "response_type": "layered" - }, - "properties": { - "response_type": { - "description": "Discriminator for the postGenerateDesignV4 oneOf response. Always \"layered\" for this shape; absent on the legacy postGenerateDesignV3 endpoint.", - "enum": [ - "layered" - ], - "title": "response_type", - "type": "string" - }, - "created": { - "description": "The time the request was created.", - "format": "date-time", - "title": "created", - "type": "string" - }, - "data": { - "description": "A list of ImageObjects that contain the generated image(s).", - "items": { - "$ref": "#/components/schemas/LayeredImageGenerationObjectV3" - }, - "title": "data", - "type": "array" - } - }, - "required": [ - "created", - "data" - ], - "title": "LayeredImageGenerationResponseV3", - "type": "object" - }, - "ModelEnum": { - "default": "V_2", - "description": "The model used to generate an image or edit one. /generate and /remix supports all model types, however, /edit is only supported for V_2 and V_2_TURBO.", - "enum": [ - "V_1", - "V_1_TURBO", - "V_2", - "V_2_TURBO", - "V_2A", - "V_2A_TURBO", - "V_3", - "AUTO" - ], - "example": "V_2_TURBO", - "title": "ModelEnum", - "type": "string" - }, - "GenerateImageSafetyError": { - "example": { - "error": "Prompt provided failed safety check due to the inclusion of prohibited content." - }, - "properties": { - "error": { - "example": "Prompt provided failed safety check due to the inclusion of prohibited content.", - "title": "error", - "type": "string" - } - }, - "required": [ - "error" - ], - "title": "GenerateImageSafetyError", - "type": "object" - }, - "MagicPromptRequest": { - "description": "A request to generate a magic prompt", - "example": { - "prompt": "a cat", - "magic_prompt_version": "V_0_4", - "classify_prompt_category": true, - "style_type": "AUTO", - "seed": 12345 - }, - "properties": { - "prompt": { - "description": "The prompt to enhance with a magic prompt. Mutually\nexclusive with `messages`; one of the two must be set.\n", - "example": "a cat", - "type": "string" - }, - "magic_prompt_version": { - "$ref": "#/components/schemas/MagicPromptVersionEnum" - }, - "classify_prompt_category": { - "default": true, - "description": "Whether to classify the prompt into a use case category.", - "example": false, - "type": "boolean" - }, - "style_type": { - "$ref": "#/components/schemas/StyleTypeV3" - }, - "seed": { - "description": "Random seed for reproducible generation", - "example": 12345, - "type": "integer" - }, - "character_reference_images": { - "description": "Generations with character reference are subject to the character reference pricing. A set of images to use as character references (max size 25MB per image; the whole request must stay under 50MB), currently only supports 1 character reference image. The images should be in JPEG, PNG or WebP format.", - "items": { - "format": "binary", - "type": "string" - }, - "type": "array" - }, - "system_prompt": { - "description": "A system prompt to use for the magic prompt.", - "example": "You are a helpful assistant that generates magic prompts for images.", - "type": "string" - }, - "aspect_ratio": { - "allOf": [ - { - "$ref": "#/components/schemas/AspectRatioV3" - } - ], - "description": "Optional target aspect ratio used to condition the generated\nmagic prompt's framing. Forwarded to the autoprompt pipeline\nso registry-driven system prompts that interpolate\n`{{aspect_ratio}}` see the bucket the caller intends.\n" - }, - "temperature": { - "description": "Sampling temperature override. Defaults to the trainer-conditioned\nvalue when omitted (0.7 for V4_QWEN_3_5_27B). Only honored with\nV4 magic-prompt versions; supplying it with another version\nreturns 400.\n", - "format": "float", - "maximum": 2, - "minimum": 0, - "type": "number" - }, - "top_p": { - "description": "Nucleus-sampling top_p override. Only honored with V4 versions.\n", - "exclusiveMinimum": true, - "format": "float", - "maximum": 1, - "minimum": 0, - "type": "number" - }, - "top_k": { - "description": "Top-k sampling override. Only honored with V4 versions.\n", - "minimum": 0, - "type": "integer" - }, - "min_p": { - "description": "min_p sampling override. Only honored with V4 versions.\n", - "format": "float", - "maximum": 1, - "minimum": 0, - "type": "number" - }, - "max_tokens": { - "description": "Cap on the number of tokens the model may generate. Defaults to\n4096 (the trainer's reference cap) when omitted. Only honored\nwith V4 versions.\n", - "maximum": 4096, - "minimum": 1, - "type": "integer" - }, - "presence_penalty": { - "description": "Presence-penalty override. Only honored with V4 versions.\n", - "format": "float", - "maximum": 2, - "minimum": -2, - "type": "number" - }, - "frequency_penalty": { - "description": "Frequency-penalty override. Only honored with V4 versions.\n", - "format": "float", - "maximum": 2, - "minimum": -2, - "type": "number" - }, - "repetition_penalty": { - "description": "Repetition-penalty override. Only honored with V4 versions.\n", - "format": "float", - "maximum": 2, - "minimum": 0, - "type": "number" - }, - "checkpoint": { - "description": "Optional override of the LoRA adapter the V4 magic-prompt\nwrapper downloads and runs. Pass a `gs://` URI pointing at a\ncheckpoint directory containing `adapter_config.json`. When\nomitted, the wrapper-preloaded production checkpoint is used.\nHonored with the wrapper-routed LoRA versions\n`V4_QWEN_3_5_27B` and `V4_QWEN_3_5_27B_FULL_FINETUNE_LORA`;\nsupplying it with `V4_QWEN_3_5_27B_PREFUSED` or\n`V4_QWEN_3_5_27B_FULL_FINETUNE` (which serve fixed weights and\ncannot swap adapters per request) or any other version returns\n400.\n", - "pattern": "^gs://", - "type": "string" - }, - "messages": { - "description": "Pre-formed chat messages forwarded verbatim to V4. Mutually\nexclusive with `prompt`; exactly one must be set. V4 only.\n", - "items": { - "$ref": "#/components/schemas/MagicPromptRequest_messages_inner" - }, - "minItems": 1, - "type": "array" - } - }, - "required": [ - "classify_prompt_category", - "magic_prompt_version" - ], - "title": "MagicPromptRequest", - "type": "object" - }, - "MagicPromptResponse": { - "description": "The response containing generated magic prompt", - "example": { - "magic_prompt": "A photorealistic cat with striking green eyes, sitting gracefully on a vintage wooden chair. The cat's fur has beautiful orange and white markings, and soft natural lighting illuminates the scene from a nearby window.", - "magic_prompt_version": "V4_QWEN_3_5_27B_EXPERIMENTAL_SLOT_01", - "served_model_name": "qwen35-27b-magic-prompt-experimental-2026-06-17" - }, - "properties": { - "magic_prompt": { - "description": "The generated magic prompt", - "type": "string" - }, - "magic_prompt_version": { - "allOf": [ - { - "$ref": "#/components/schemas/MagicPromptVersionEnum" - } - ], - "description": "The magic prompt version that produced this response." - }, - "served_model_name": { - "description": "Identifier of the underlying model that produced this prompt. For\nexperimental versions, whose backing model can change over time,\nthis reports the model that actually served the request. Null when\nnot applicable.\n", - "nullable": true, - "type": "string" - } - }, - "required": [ - "magic_prompt" - ], - "title": "MagicPromptResponse", - "type": "object" - }, - "MagicPromptV4Request": { - "description": "A request to generate an Ideogram 4.0 magic prompt.", - "example": { - "text_prompt": "a cat", - "aspect_ratio": "AUTO" - }, - "properties": { - "text_prompt": { - "description": "The natural-language prompt to enhance into an Ideogram 4.0 magic\nprompt. Named `text_prompt` to match the Ideogram 4.0 generate\nrequest surface.\n", - "example": "a cat", - "type": "string" - }, - "aspect_ratio": { - "allOf": [ - { - "$ref": "#/components/schemas/AspectRatioV4" - } - ], - "description": "Target aspect ratio. Defaults to `AUTO`, which lets the model\nselect the most suitable ratio and return it in the response.\n" - } - }, - "required": [ - "text_prompt" - ], - "title": "MagicPromptV4Request", - "type": "object" - }, - "MagicPromptV4Response": { - "description": "The response containing the generated Ideogram 4.0 magic prompt.", - "example": { - "json_prompt": { - "high_level_description": "A photorealistic ginger cat perched on a vintage wooden chair by a sunlit window.", - "style_description": { - "aesthetics": "warm, cozy, nostalgic", - "lighting": "soft natural window light", - "medium": "photograph" - }, - "compositional_deconstruction": { - "background": "A dim room with a bright window casting warm light.", - "elements": [ - { - "type": "obj", - "desc": "ginger cat with green eyes sitting upright on a vintage wooden chair" - } - ] - } - }, - "aspect_ratio": "1x1" - }, - "properties": { - "json_prompt": { - "allOf": [ - { - "$ref": "#/components/schemas/V4JsonPrompt" - } - ], - "description": "The enhanced prompt as an Ideogram 4.0 structured JSON prompt. This\nconforms to the same contract as `json_prompt` on\n`/v1/ideogram-v4/generate`, so it can be passed straight back to\nthat endpoint.\n" - }, - "aspect_ratio": { - "allOf": [ - { - "$ref": "#/components/schemas/AspectRatioV4" - } - ], - "description": "The resolved aspect ratio. When the request used `AUTO`, this is\nthe ratio the model selected; otherwise it echoes the request.\n" - } - }, - "required": [ - "aspect_ratio", - "json_prompt" - ], - "title": "MagicPromptV4Response", - "type": "object" - }, - "InternalBatchRequest": { - "description": "A request for batch magic prompt evalution.", - "example": { - "user_prompts": [ - "a cat", - "a dog" - ], - "sampling_request_params": { - "magic_prompt_system_prompt_config_id": "magic_prompt_system_prompt_config_id", - "aspect_ratio": "1x1", - "style_type": "GENERAL", - "magic_prompt_version": "V_0", - "seed": 12345, - "negative_prompt": "brush strokes, painting", - "magic_prompt_option": "ON", - "model": "V_2_TURBO", - "resolution": "1280x800", - "num_images": 1, - "color_palette": { - "name": "PASTEL" - } - }, - "experiment_variant": "MAGIC_PROMPT_NO_TEXT" - }, - "properties": { - "user_prompts": { - "description": "The prompts to enhance with a magic prompt.", - "example": [ - "a cat", - "a dog" - ], - "items": { - "type": "string" - }, - "title": "user_prompts", - "type": "array" - }, - "experiment_variant": { - "description": "The experiment variant used for template selection for the magic prompts.", - "example": "MAGIC_PROMPT_NO_TEXT", - "title": "experiment_variant", - "type": "string" - }, - "sampling_request_params": { - "$ref": "#/components/schemas/SamplingRequestParams" - } - }, - "required": [ - "user_prompts" - ], - "title": "InternalBatchRequest", - "type": "object" - }, - "InternalBatchResponse": { - "description": "A response for batch magic prompt evalution containing relavent information for /internal/batch/status GET request to find out if the batch generation has completed.", - "example": { - "job_id": "job_id" - }, - "properties": { - "job_id": { - "description": "The job id for the batch generation.", - "title": "job_id", - "type": "string" - } - }, - "required": [ - "job_id" - ], - "title": "InternalBatchResponse", - "type": "object" - }, - "SamplingRequestParams": { - "example": { - "magic_prompt_system_prompt_config_id": "magic_prompt_system_prompt_config_id", - "aspect_ratio": "1x1", - "style_type": "GENERAL", - "magic_prompt_version": "V_0", - "seed": 12345, - "negative_prompt": "brush strokes, painting", - "magic_prompt_option": "ON", - "model": "V_2_TURBO", - "resolution": "1280x800", - "num_images": 1, - "color_palette": { - "name": "PASTEL" - } - }, - "properties": { - "aspect_ratio": { - "allOf": [ - { - "$ref": "#/components/schemas/AspectRatioV3" - } - ], - "example": "1x1", - "title": "aspect_ratio" - }, - "model": { - "$ref": "#/components/schemas/ModelEnum" - }, - "magic_prompt_option": { - "$ref": "#/components/schemas/MagicPromptOption" - }, - "magic_prompt_system_prompt_config_id": { - "description": "A base64url-encoded magic prompt system prompt config ID to use for this request.", - "title": "magic_prompt_system_prompt_config_id", - "type": "string" - }, - "magic_prompt_version": { - "$ref": "#/components/schemas/MagicPromptVersionEnum" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - }, - "style_type": { - "$ref": "#/components/schemas/StyleTypeV3" - }, - "negative_prompt": { - "description": "Only available for model versions V_1, V_1_TURBO, V_2 and V_2_TURBO. Description of what to exclude from an image. Descriptions in the prompt take precedence to descriptions in the negative prompt.", - "example": "brush strokes, painting", - "title": "negative_prompt", - "type": "string" - }, - "num_images": { - "default": 1, - "description": "The number of images to generate.", - "maximum": 8, - "minimum": 1, - "title": "NumImages", - "type": "integer", - "x-tool-description": "Number of variations of this one prompt. For different subjects, make separate calls instead of listing them in one prompt." - }, - "resolution": { - "$ref": "#/components/schemas/ResolutionV3" - }, - "color_palette": { - "$ref": "#/components/schemas/ColorPaletteWithPresetNameOrMembers" - } - }, - "title": "SamplingRequestParams", - "type": "object" - }, - "TextSpanV3": { - "description": "An atomic text segment within a text item, carrying text content and visual styling.", - "example": { - "color": "#212121", - "text": "text", - "font_fx": [ - "bold", - "italic" - ] - }, - "properties": { - "text": { - "description": "The text content for this segment. Line breaks within the span are represented as \\n.", - "title": "text", - "type": "string" - }, - "font_fx": { - "description": "Ordered list of style effects applied to this text span.\nThis is the primary style field for layered text.\n", - "example": [ - "bold", - "italic" - ], - "items": { - "enum": [ - "bold", - "italic", - "underline", - "strikethrough", - "all_caps", - "small_caps", - "superscript", - "subscript" - ], - "type": "string" - }, - "title": "font_fx", - "type": "array" - }, - "color": { - "description": "The hex color of the text (e.g. \"#FF0000\" for red).", - "example": "#212121", - "pattern": "^#[0-9A-Fa-f]{6}$", - "title": "color", - "type": "string" - } - }, - "required": [ - "color", - "font_fx", - "text" - ], - "title": "TextSpanV3", - "type": "object" - }, - "TextItemV3": { - "description": "A single text block within a container, representing one logical unit of text (e.g., a headline, a paragraph, a list entry).", - "example": { - "font_candidates": [ - "font_candidates", - "font_candidates" - ], - "spans": [ - { - "color": "#212121", - "text": "text", - "font_fx": [ - "bold", - "italic" - ] - }, - { - "color": "#212121", - "text": "text", - "font_fx": [ - "bold", - "italic" - ] - } - ], - "text_shadows": [ - { - "color": "color", - "blur": 0.2027123, - "offset_x": 9.301444, - "offset_y": 3.6160767 - }, - { - "color": "color", - "blur": 0.2027123, - "offset_x": 9.301444, - "offset_y": 3.6160767 - } - ], - "font_size": 5, - "vertical_alignment": "top", - "text_transform": "none", - "glyph_type": "bullet", - "line_height": 2.302136, - "x": 0, - "width": 1, - "style_class": "body", - "y": 6, - "angle": 0, - "alignment": "center", - "font_file": "font_file", - "letter_spacing": 7.0614014, - "height": 5 - }, - "properties": { - "x": { - "description": "The x coordinate of the item in pixels.", - "title": "x", - "type": "integer" - }, - "y": { - "description": "The y coordinate of the item in pixels.", - "title": "y", - "type": "integer" - }, - "width": { - "description": "The width of the item in pixels.", - "title": "width", - "type": "integer" - }, - "height": { - "description": "The height of the item in pixels.", - "title": "height", - "type": "integer" - }, - "alignment": { - "description": "The text alignment of the item.", - "enum": [ - "left", - "center", - "right" - ], - "example": "center", - "title": "alignment", - "type": "string" - }, - "angle": { - "description": "The angle rotation of the text, measured clockwise in degrees.", - "example": 0, - "format": "float", - "title": "angle", - "type": "number" - }, - "style_class": { - "description": "Typographic classification of the text.", - "enum": [ - "h1", - "h2", - "body", - "small" - ], - "example": "body", - "title": "style_class", - "type": "string" - }, - "glyph_type": { - "description": "The type of list marker glyph, if any. Null for non-list items.", - "enum": [ - "bullet", - "number", - "icon", - "other" - ], - "nullable": true, - "title": "glyph_type", - "type": "string", - "example": null - }, - "font_file": { - "description": "The matched font file for this item.", - "nullable": true, - "title": "font_file", - "type": "string" - }, - "font_candidates": { - "description": "A list of alternate matching font files for this item.", - "items": { - "type": "string" - }, - "nullable": true, - "title": "font_candidates", - "type": "array" - }, - "font_size": { - "description": "The font size in points. Null for non-editable items.", - "nullable": true, - "title": "font_size", - "type": "integer" - }, - "line_height": { - "description": "The line height multiplier (e.g., 1.2). Null for non-editable items.", - "format": "float", - "nullable": true, - "title": "line_height", - "type": "number" - }, - "letter_spacing": { - "description": "Letter spacing in em units (e.g. 0.05 = 5% of em). V4 vector-text only.", - "format": "float", - "nullable": true, - "title": "letter_spacing", - "type": "number" - }, - "text_transform": { - "description": "Case folding applied at render time. V4 vector-text only.", - "enum": [ - "none", - "uppercase", - "lowercase" - ], - "nullable": true, - "title": "text_transform", - "type": "string" - }, - "vertical_alignment": { - "description": "Vertical anchor (top|middle|bottom) for the rendered text within\nits bounding box. Maps to SVG `dominant-baseline`. V4 vector-text\nonly. Distinct from horizontal `alignment` (left|center|right).\n", - "enum": [ - "top", - "middle", - "bottom" - ], - "nullable": true, - "title": "vertical_alignment", - "type": "string" - }, - "text_shadows": { - "description": "Stacked CSS text shadows, composed back-to-front. Phase-1 ships at\nmost one entry; phase-2 unlocks multi-stack. V4 vector-text only.\n", - "items": { - "$ref": "#/components/schemas/LayeredAssetTextShadow" - }, - "nullable": true, - "title": "text_shadows", - "type": "array" - }, - "spans": { - "description": "Ordered list of text spans. Concatenating span text values produces the full item text.", - "items": { - "$ref": "#/components/schemas/TextSpanV3" - }, - "title": "spans", - "type": "array" - } - }, - "required": [ - "alignment", - "height", - "spans", - "style_class", - "width", - "x", - "y" - ], - "title": "TextItemV3", - "type": "object" - }, - "TextContainerV3": { - "description": "A spatial grouping of related text items that form a cohesive visual unit (e.g., a title group, a list, a card).", - "example": { - "id": "id", - "items": [ - { - "font_candidates": [ - "font_candidates", - "font_candidates" - ], - "spans": [ - { - "color": "#212121", - "text": "text", - "font_fx": [ - "bold", - "italic" - ] - }, - { - "color": "#212121", - "text": "text", - "font_fx": [ - "bold", - "italic" - ] - } - ], - "text_shadows": [ - { - "color": "color", - "blur": 0.2027123, - "offset_x": 9.301444, - "offset_y": 3.6160767 - }, - { - "color": "color", - "blur": 0.2027123, - "offset_x": 9.301444, - "offset_y": 3.6160767 - } - ], - "font_size": 5, - "vertical_alignment": "top", - "text_transform": "none", - "glyph_type": "bullet", - "line_height": 2.302136, - "x": 0, - "width": 1, - "style_class": "body", - "y": 6, - "angle": 0, - "alignment": "center", - "font_file": "font_file", - "letter_spacing": 7.0614014, - "height": 5 - }, - { - "font_candidates": [ - "font_candidates", - "font_candidates" - ], - "spans": [ - { - "color": "#212121", - "text": "text", - "font_fx": [ - "bold", - "italic" - ] - }, - { - "color": "#212121", - "text": "text", - "font_fx": [ - "bold", - "italic" - ] - } - ], - "text_shadows": [ - { - "color": "color", - "blur": 0.2027123, - "offset_x": 9.301444, - "offset_y": 3.6160767 - }, - { - "color": "color", - "blur": 0.2027123, - "offset_x": 9.301444, - "offset_y": 3.6160767 - } - ], - "font_size": 5, - "vertical_alignment": "top", - "text_transform": "none", - "glyph_type": "bullet", - "line_height": 2.302136, - "x": 0, - "width": 1, - "style_class": "body", - "y": 6, - "angle": 0, - "alignment": "center", - "font_file": "font_file", - "letter_spacing": 7.0614014, - "height": 5 - } - ] - }, - "properties": { - "id": { - "description": "Unique container identifier (e.g., \"container_01\").", - "title": "id", - "type": "string" - }, - "items": { - "description": "Ordered list of text items in this container.", - "items": { - "$ref": "#/components/schemas/TextItemV3" - }, - "title": "items", - "type": "array" - } - }, - "required": [ - "id", - "items" - ], - "title": "TextContainerV3", - "type": "object" - }, - "ImageLayerV3": { - "description": "An image layer (logo, brand asset, icon) for a layered image generation.", - "example": { - "ref_id": "REF_0", - "x": 4, - "width": 1, - "y": 7, - "height": 1 - }, - "properties": { - "x": { - "description": "The x coordinate of the layer.", - "title": "x", - "type": "integer" - }, - "y": { - "description": "The y coordinate of the layer.", - "title": "y", - "type": "integer" - }, - "width": { - "description": "The width of the layer.", - "title": "width", - "type": "integer" - }, - "height": { - "description": "The height of the layer.", - "title": "height", - "type": "integer" - }, - "ref_id": { - "description": "Reference ID matching a provided reference image (e.g., \"REF_0\"), or -1 if no match.", - "example": "REF_0", - "title": "ref_id", - "type": "string" - } - }, - "required": [ - "height", - "width", - "x", - "y" - ], - "title": "ImageLayerV3", - "type": "object" - }, - "LayerizeLogosRequest": { - "properties": { - "design_image": { - "description": "The flat design image to analyze. The image should be in JPEG, PNG, or WebP format (max size 25MB).", - "format": "binary", - "type": "string" - }, - "reference_images": { - "description": "Reference image assets to match against logos and image elements detected in\n`design_image`. Each entry is assigned a `ref_id` of `REF_0`, `REF_1`, ...\nin the order it appears in the request (maximum 10 images). The images\nshould be in JPEG, PNG, or WebP format.\n", - "items": { - "format": "binary", - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "design_image", - "reference_images" - ], - "type": "object" - }, - "LayerizeLogosResponse": { - "description": "Results of image-reference recognition. The `base_image_url` points at the design\nwith the detected reference images inpainted out. The `layers` array lists each\nmatched reference and its bounding box on the original image; it is empty when\nno reference image was matched.\n\nImage links are available for a limited period of time; if you would like to keep\nthe image, you must download it.\n", - "example": { - "layers": [ - { - "ref_id": "REF_0", - "x": 4, - "width": 1, - "y": 7, - "height": 1 - }, - { - "ref_id": "REF_0", - "x": 4, - "width": 1, - "y": 7, - "height": 1 - } - ], - "base_image_url": "https://openapi-generator.tech" - }, - "properties": { - "base_image_url": { - "description": "URL of the design image with all detected reference images inpainted out.", - "format": "uri", - "title": "base_image_url", - "type": "string" - }, - "layers": { - "description": "Matched reference images, each with its bounding box on the original design.", - "items": { - "$ref": "#/components/schemas/ImageLayerV3" - }, - "title": "layers", - "type": "array" - } - }, - "required": [ - "base_image_url", - "layers" - ], - "title": "LayerizeLogosResponse", - "type": "object" - }, - "LayerizeTextRequest": { - "properties": { - "image": { - "description": "The image to analyze for text detection. The image should be in JPEG, PNG, or WebP format (max size 25MB).", - "format": "binary", - "type": "string" - }, - "prompt": { - "description": "An optional text description of the image. If not provided, a description will be auto-generated from the image.", - "type": "string" - }, - "seed": { - "$ref": "#/components/schemas/Seed" - }, - "font_candidate_files": { - "description": "Candidate font files to make available for text style matching. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB each, maximum 5 files).", - "items": { - "format": "binary", - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "image" - ], - "type": "object" - }, - "LayerizeTextResponse": { - "description": "The response containing detected text blocks and a text-erased base image.\n\nImage links are available for a limited period of time; if you would like to keep the image, you must download it.\n", - "example": { - "original_image_url": "https://openapi-generator.tech", - "seed": 12345, - "base_image_url": "https://openapi-generator.tech", - "text_blocks": [ - { - "role": "heading", - "color": "#212121", - "font_alternatives": [ - "font_alternatives", - "font_alternatives" - ], - "font_size": 2, - "font_name": "font_name", - "line_height": 7.0614014, - "x": 0, - "width": 1, - "y": 6, - "angle": 5.637377, - "text": "Hello World", - "alignment": "left", - "formatting": [ - "bold", - "bold" - ], - "height": 5 - }, - { - "role": "heading", - "color": "#212121", - "font_alternatives": [ - "font_alternatives", - "font_alternatives" - ], - "font_size": 2, - "font_name": "font_name", - "line_height": 7.0614014, - "x": 0, - "width": 1, - "y": 6, - "angle": 5.637377, - "text": "Hello World", - "alignment": "left", - "formatting": [ - "bold", - "bold" - ], - "height": 5 - } - ] - }, - "properties": { - "base_image_url": { - "description": "URL of the image with all detected text removed.", - "format": "uri", - "title": "base_image_url", - "type": "string" - }, - "original_image_url": { - "description": "URL of the original image with text intact.", - "format": "uri", - "nullable": true, - "title": "original_image_url", - "type": "string" - }, - "text_blocks": { - "description": "Flat list of detected text regions in the image.", - "items": { - "$ref": "#/components/schemas/DetectedTextBlock" - }, - "title": "text_blocks", - "type": "array" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - } - }, - "required": [ - "base_image_url", - "seed", - "text_blocks" - ], - "title": "LayerizeTextResponse", - "type": "object" - }, - "InternalBatchResultsResponse": { - "description": "A response for batch magic prompt job results.", - "example": { - "job_status": "COMPLETE", - "results": [ - { - "image_url": "image_url", - "prompt": "a cat" - }, - { - "image_url": "image_url", - "prompt": "a cat" - } - ] - }, - "properties": { - "job_status": { - "description": "The status of the batch generation job.", - "example": "COMPLETE", - "title": "job_status", - "type": "string" - }, - "results": { - "description": "The batch generation results, with each entry containing a prompt and its corresponding image URL.", - "items": { - "$ref": "#/components/schemas/InternalBatchResultsResponse_results_inner" - }, - "title": "results", - "type": "array" - } - }, - "required": [ - "job_status" - ], - "title": "InternalBatchResultsResponse", - "type": "object" - }, - "AssetReferenceUsageResponse": { - "example": { - "next_cursor": "next_cursor", - "assets": [ - { - "collection_id": "collection_id", - "collection_path": "collection_path", - "asset_identifier": { - "asset_type": "RESPONSE", - "asset_id": "7uS_VESkRI6O3-sVgHQp_A" - }, - "file_name": "file_name", - "download_url": "download_url", - "attributes": [ - { - "creation_time": "2000-01-23T04:56:07+00:00", - "value_type": null, - "attribute_key": "attribute_key", - "value": "value" - }, - { - "creation_time": "2000-01-23T04:56:07+00:00", - "value_type": null, - "attribute_key": "attribute_key", - "value": "value" - } - ], - "collection_name": "collection_name", - "request_count": 1 - }, - { - "collection_id": "collection_id", - "collection_path": "collection_path", - "asset_identifier": { - "asset_type": "RESPONSE", - "asset_id": "7uS_VESkRI6O3-sVgHQp_A" - }, - "file_name": "file_name", - "download_url": "download_url", - "attributes": [ - { - "creation_time": "2000-01-23T04:56:07+00:00", - "value_type": null, - "attribute_key": "attribute_key", - "value": "value" - }, - { - "creation_time": "2000-01-23T04:56:07+00:00", - "value_type": null, - "attribute_key": "attribute_key", - "value": "value" - } - ], - "collection_name": "collection_name", - "request_count": 1 - } - ] - }, - "properties": { - "assets": { - "items": { - "$ref": "#/components/schemas/AssetReferenceUsageItem" - }, - "title": "assets", - "type": "array" - }, - "next_cursor": { - "nullable": true, - "title": "next_cursor", - "type": "string" - } - }, - "required": [ - "assets", - "next_cursor" - ], - "title": "AssetReferenceUsageResponse", - "type": "object" - }, - "AssetReferenceUsageItem": { - "example": { - "collection_id": "collection_id", - "collection_path": "collection_path", - "asset_identifier": { - "asset_type": "RESPONSE", - "asset_id": "7uS_VESkRI6O3-sVgHQp_A" - }, - "file_name": "file_name", - "download_url": "download_url", - "attributes": [ - { - "creation_time": "2000-01-23T04:56:07+00:00", - "value_type": null, - "attribute_key": "attribute_key", - "value": "value" - }, - { - "creation_time": "2000-01-23T04:56:07+00:00", - "value_type": null, - "attribute_key": "attribute_key", - "value": "value" - } - ], - "collection_name": "collection_name", - "request_count": 1 - }, - "properties": { - "asset_identifier": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "collection_id": { - "description": "Present when include_collections is true.", - "nullable": true, - "title": "collection_id", - "type": "string" - }, - "collection_name": { - "nullable": true, - "title": "collection_name", - "type": "string" - }, - "collection_path": { - "description": "Readable collection names from accessible ancestors through this collection, separated by \" / \".", - "nullable": true, - "title": "collection_path", - "type": "string" - }, - "file_name": { - "nullable": true, - "title": "file_name", - "type": "string" - }, - "attributes": { - "description": "Current attributes of this collection asset, present when include_collections is true.", - "items": { - "$ref": "#/components/schemas/AttributeInfo" - }, - "title": "attributes", - "type": "array" - }, - "download_url": { - "description": "Signed image URL valid for 24 hours, issued only when the caller can read the asset. Refresh the listing to obtain a fresh URL.", - "nullable": true, - "title": "download_url", - "type": "string" - }, - "request_count": { - "description": "Completed organization requests using the asset as an edit input within the requested range.", - "format": "int64", - "minimum": 1, - "title": "request_count", - "type": "integer" - } - }, - "required": [ - "asset_identifier", - "request_count" - ], - "title": "AssetReferenceUsageItem", - "type": "object" - }, - "WebhookUrl": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - }, - "GenerateVideoSeedDance2Response": { - "description": "Acknowledgement that the request was accepted. The generated video is not\npart of this response: poll `GET /v2/generations/{generation_id}` with\nthe returned `generation_id`, or receive it at your `webhook_url`.\nVideo links expire after a limited time, so download any video you\nwant to keep.\n", - "example": { - "generation_id": "generation_id", - "created": "2000-01-23T04:56:07+00:00" - }, - "properties": { - "generation_id": { - "description": "The generation ID to poll with `GET /v2/generations/{generation_id}`.\n", - "title": "generation_id", - "type": "string" - }, - "created": { - "description": "The time the request was accepted.", - "format": "date-time", - "title": "created", - "type": "string" - } - }, - "required": [ - "created", - "generation_id" - ], - "title": "GenerateVideoSeedDance2Response", - "type": "object" - }, - "GenerateVideoSeedDance2TextToVideoRequest": { - "description": "Request body for Seedance 2.0 text-to-video generation.", - "example": { - "duration": 5, - "aspect_ratio": null, - "private": true, - "webhook_url": "https://api.example.com/webhooks/ideogram", - "target_collection_id": "target_collection_id", - "generate_audio": false, - "prompt": "A red fox running through a snowy forest at dawn.", - "resolution": null - }, - "properties": { - "prompt": { - "description": "A natural-language prompt describing the video to generate.", - "example": "A red fox running through a snowy forest at dawn.", - "maxLength": 2000, - "minLength": 1, - "title": "prompt", - "type": "string", - "x-tool-description": "Describe the video to generate." - }, - "aspect_ratio": { - "$ref": "#/components/schemas/SeedDance2AspectRatio" - }, - "resolution": { - "$ref": "#/components/schemas/SeedDance2Resolution" - }, - "duration": { - "description": "The length of the generated video in seconds. When omitted, the model\npicks the best duration for the prompt (\"auto\").\n", - "example": 5, - "maximum": 15, - "minimum": 4, - "title": "duration", - "type": "integer", - "x-tool-description": "Seconds; omit to let the model choose." - }, - "generate_audio": { - "default": false, - "description": "Whether to generate an audio track for the video. Audio roughly\ndoubles the provider cost and is subject to stricter output moderation.\n", - "title": "generate_audio", - "type": "boolean", - "x-tool-description": "Audio roughly doubles provider cost and tightens output moderation." - }, - "webhook_url": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - }, - "private": { - "description": "When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately.", - "nullable": true, - "title": "private", - "type": "boolean", - "x-tool-description": "true keeps the output private; false publishes it. Enterprise output is always private." - }, - "target_collection_id": { - "description": "A collection you can write to, by its URL-safe base64 collection id. The output videos are added to it when the request completes.", - "title": "target_collection_id", - "type": "string", - "x-tool-description": "Destination collection ID (URL-safe base64); must be writable." - } - }, - "required": [ - "prompt" - ], - "title": "GenerateVideoSeedDance2TextToVideoRequest", - "type": "object" - }, - "GenerationErrorResponse": { - "description": "A generation request rejected by an account or usage limit.", - "example": { - "max_inflight_requests": 8, - "task_completion_speed": "fast", - "reject_reason": null, - "error": "error" - }, - "properties": { - "error": { - "description": "A message describing why the generation request was rejected.", - "title": "error", - "type": "string" - }, - "reject_reason": { - "$ref": "#/components/schemas/GenerationRejectReason" - }, - "max_inflight_requests": { - "description": "How many generations the account may have in progress at once on\nthe queue this request resolved to. Present when `reject_reason`\nis `inflight_limit`.\n", - "example": 8, - "minimum": 1, - "title": "max_inflight_requests", - "type": "integer" - }, - "task_completion_speed": { - "description": "The queue this request resolved to. Present when `reject_reason`\nis `inflight_limit`.\n", - "enum": [ - "fast", - "slow" - ], - "title": "task_completion_speed", - "type": "string" - } - }, - "required": [ - "error", - "reject_reason" - ], - "title": "GenerationErrorResponse", - "type": "object" - }, - "GenerationRejectReason": { - "description": "The account or usage limit that rejected a generation request.", - "enum": [ - "insufficient_funds", - "subscription_required", - "daily_limit", - "priority_credit_required", - "inflight_limit", - "feature_limit" - ], - "title": "GenerationRejectReason", - "type": "string" - }, - "GenerateVideoSeedDance2ImageToVideoRequest": { - "description": "Request body for Seedance 2.0 image-to-video generation.\nUpload the first frame as `image`, and optionally a final frame as\n`end_image`, using `multipart/form-data`.\n", - "properties": { - "image_asset_identifier": { - "allOf": [ - { - "$ref": "#/components/schemas/AssetIdentifier" - } - ], - "description": "A reference to an image already stored with Ideogram to use as the first frame, in place of uploading `image`. Only image assets are accepted.", - "x-tool-description": "Stored image asset for the first frame." - }, - "image": { - "description": "The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored.", - "format": "binary", - "type": "string", - "x-tool-description": "First frame (JPEG/PNG/WEBP, max 50MB). Multipart only; used for this request, not stored." - }, - "end_image_asset_identifier": { - "allOf": [ - { - "$ref": "#/components/schemas/AssetIdentifier" - } - ], - "description": "An optional final frame, as a reference to an image already stored with Ideogram. When supplied, the generated video transitions from the first frame to this one. Only image assets are accepted.", - "x-tool-description": "Stored image asset for the final frame; the video transitions from the first frame to it." - }, - "end_image": { - "description": "An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one.", - "format": "binary", - "type": "string", - "x-tool-description": "Final frame (JPEG/PNG/WEBP, max 50MB). Multipart only; the video transitions from the first frame to it." - }, - "prompt": { - "description": "A natural-language prompt describing how the first frame should animate.", - "example": "The camera slowly pans right as the waves roll in.", - "maxLength": 2000, - "minLength": 1, - "type": "string", - "x-tool-description": "Describe how to animate the first frame." - }, - "aspect_ratio": { - "$ref": "#/components/schemas/SeedDance2AspectRatio" - }, - "resolution": { - "$ref": "#/components/schemas/SeedDance2Resolution" - }, - "duration": { - "description": "The length of the generated video in seconds. When omitted, the model\npicks the best duration for the prompt (\"auto\").\n", - "example": 5, - "maximum": 15, - "minimum": 4, - "title": "duration", - "type": "integer", - "x-tool-description": "Seconds; omit to let the model choose." - }, - "generate_audio": { - "default": false, - "description": "Whether to generate an audio track for the video. Audio roughly\ndoubles the provider cost and is subject to stricter output moderation.\n", - "title": "generate_audio", - "type": "boolean", - "x-tool-description": "Audio roughly doubles provider cost and tightens output moderation." - }, - "webhook_url": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - }, - "private": { - "description": "When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately.", - "nullable": true, - "type": "boolean", - "x-tool-description": "true keeps the output private; false publishes it. Enterprise output is always private." - }, - "target_collection_id": { - "description": "A collection you can write to, by its URL-safe base64 collection id. The output videos are added to it when the request completes.", - "type": "string", - "x-tool-description": "Destination collection ID (URL-safe base64); must be writable." - } - }, - "required": [ - "prompt" - ], - "type": "object", - "x-tool-description": "First frame: image_asset_identifier (required). Final frame: end_image_asset_identifier (optional)." - }, - "GenerateVideoSeedDance25Response": { - "description": "Acknowledgement that the request was accepted. The generated video is not\npart of this response: poll `GET /v2/generations/{generation_id}` with\nthe returned `generation_id`, or receive it at your `webhook_url`.\nVideo links expire after a limited time, so download any video you\nwant to keep.\n", - "example": { - "generation_id": "generation_id", - "created": "2000-01-23T04:56:07+00:00" - }, - "properties": { - "generation_id": { - "description": "The generation ID to poll with `GET /v2/generations/{generation_id}`.\n", - "title": "generation_id", - "type": "string" - }, - "created": { - "description": "The time the request was accepted.", - "format": "date-time", - "title": "created", - "type": "string" - } - }, - "required": [ - "created", - "generation_id" - ], - "title": "GenerateVideoSeedDance25Response", - "type": "object" - }, - "GenerateVideoSeedDance25TextToVideoRequest": { - "description": "Request body for Seedance 2.5 text-to-video generation.", - "example": { - "duration": 5, - "aspect_ratio": null, - "private": true, - "webhook_url": "https://api.example.com/webhooks/ideogram", - "target_collection_id": "target_collection_id", - "generate_audio": false, - "prompt": "A red fox running through a snowy forest at dawn.", - "resolution": null - }, - "properties": { - "prompt": { - "description": "A natural-language prompt describing the video to generate.", - "example": "A red fox running through a snowy forest at dawn.", - "maxLength": 2000, - "minLength": 1, - "title": "prompt", - "type": "string", - "x-tool-description": "Describe the video to generate." - }, - "aspect_ratio": { - "$ref": "#/components/schemas/SeedDance2AspectRatio" - }, - "resolution": { - "$ref": "#/components/schemas/SeedDance25Resolution" - }, - "duration": { - "description": "The length of the generated video in seconds. When omitted, the model\npicks the best duration for the prompt (\"auto\").\n", - "example": 5, - "maximum": 30, - "minimum": 4, - "title": "duration", - "type": "integer", - "x-tool-description": "Seconds; omit to let the model choose." - }, - "generate_audio": { - "default": false, - "description": "Whether to generate an audio track for the video. Audio roughly\ndoubles the provider cost and is subject to stricter output moderation.\n", - "title": "generate_audio", - "type": "boolean", - "x-tool-description": "Audio roughly doubles provider cost and tightens output moderation." - }, - "webhook_url": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - }, - "private": { - "description": "When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately.", - "nullable": true, - "title": "private", - "type": "boolean", - "x-tool-description": "true keeps the output private; false publishes it. Enterprise output is always private." - }, - "target_collection_id": { - "description": "A collection you can write to, by its URL-safe base64 collection id. The output video is added to it when the request completes.", - "title": "target_collection_id", - "type": "string", - "x-tool-description": "Destination collection ID (URL-safe base64); must be writable." - } - }, - "required": [ - "prompt" - ], - "title": "GenerateVideoSeedDance25TextToVideoRequest", - "type": "object" - }, - "SeedDance25Resolution": { - "default": "720p", - "description": "The resolution tier of the generated video.", - "enum": [ - "480p", - "720p", - "1080p" - ], - "title": "SeedDance25Resolution", - "type": "string", - "x-tool-description": "Output resolution tier." - }, - "SeedDance25DurationSeconds": { - "description": "The length of the generated video in seconds. When omitted, the model\npicks the best duration for the prompt (\"auto\").\n", - "example": 5, - "maximum": 30, - "minimum": 4, - "title": "duration", - "type": "integer", - "x-tool-description": "Seconds; omit to let the model choose." - }, - "GenerateVideoSeedDance25ImageToVideoRequest": { - "description": "Request body for Seedance 2.5 image-to-video generation.\nUpload the first frame as `image`, and optionally a final frame as\n`end_image`, using `multipart/form-data`. The video takes its aspect\nratio from the first frame, so there is no `aspect_ratio` field.\n", - "properties": { - "image_asset_identifier": { - "allOf": [ - { - "$ref": "#/components/schemas/AssetIdentifier" - } - ], - "description": "A reference to an image already stored with Ideogram to use as the first frame, in place of uploading `image`. Only image assets are accepted.", - "x-tool-description": "Stored image asset for the first frame." - }, - "image": { - "description": "The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored.", - "format": "binary", - "type": "string", - "x-tool-description": "First frame (JPEG/PNG/WEBP, max 50MB). Multipart only; used for this request, not stored." - }, - "end_image_asset_identifier": { - "allOf": [ - { - "$ref": "#/components/schemas/AssetIdentifier" - } - ], - "description": "An optional final frame, as a reference to an image already stored with Ideogram. When supplied, the generated video transitions from the first frame to this one. Only image assets are accepted.", - "x-tool-description": "Stored image asset for the final frame; the video transitions from the first frame to it." - }, - "end_image": { - "description": "An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one.", - "format": "binary", - "type": "string", - "x-tool-description": "Final frame (JPEG/PNG/WEBP, max 50MB). Multipart only; the video transitions from the first frame to it." - }, - "prompt": { - "description": "A natural-language prompt describing how the first frame should animate.", - "example": "The camera slowly pans right as the waves roll in.", - "maxLength": 2000, - "minLength": 1, - "type": "string", - "x-tool-description": "Describe how to animate the first frame." - }, - "resolution": { - "$ref": "#/components/schemas/SeedDance25Resolution" - }, - "duration": { - "description": "The length of the generated video in seconds. When omitted, the model\npicks the best duration for the prompt (\"auto\").\n", - "example": 5, - "maximum": 30, - "minimum": 4, - "title": "duration", - "type": "integer", - "x-tool-description": "Seconds; omit to let the model choose." - }, - "generate_audio": { - "default": false, - "description": "Whether to generate an audio track for the video. Audio roughly\ndoubles the provider cost and is subject to stricter output moderation.\n", - "title": "generate_audio", - "type": "boolean", - "x-tool-description": "Audio roughly doubles provider cost and tightens output moderation." - }, - "webhook_url": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - }, - "private": { - "description": "When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately.", - "nullable": true, - "type": "boolean", - "x-tool-description": "true keeps the output private; false publishes it. Enterprise output is always private." - }, - "target_collection_id": { - "description": "A collection you can write to, by its URL-safe base64 collection id. The output video is added to it when the request completes.", - "type": "string", - "x-tool-description": "Destination collection ID (URL-safe base64); must be writable." - } - }, - "required": [ - "prompt" - ], - "type": "object", - "x-tool-description": "First frame: image_asset_identifier (required). Final frame: end_image_asset_identifier (optional)." - }, - "GenerateVideoMinimaxH3TextToVideoRequest": { - "description": "Request body for MiniMax H3 text-to-video generation.", - "example": { - "duration": 5, - "aspect_ratio": null, - "private": true, - "webhook_url": "https://api.example.com/webhooks/ideogram", - "target_collection_id": "target_collection_id", - "prompt": "A red fox running through a snowy forest at dawn.", - "resolution": null - }, - "properties": { - "prompt": { - "description": "A natural-language prompt describing the video to generate.", - "example": "A red fox running through a snowy forest at dawn.", - "maxLength": 2000, - "minLength": 1, - "title": "prompt", - "type": "string", - "x-tool-description": "Describe the video to generate." - }, - "aspect_ratio": { - "$ref": "#/components/schemas/MinimaxH3AspectRatio" - }, - "resolution": { - "$ref": "#/components/schemas/MinimaxH3Resolution" - }, - "duration": { - "default": 5, - "description": "The length of the generated video in seconds.", - "example": 5, - "maximum": 15, - "minimum": 5, - "title": "duration", - "type": "integer" - }, - "webhook_url": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - }, - "private": { - "description": "When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately.", - "nullable": true, - "title": "private", - "type": "boolean", - "x-tool-description": "true keeps the output private; false publishes it. Enterprise output is always private." - }, - "target_collection_id": { - "description": "A collection you can write to, by its URL-safe base64 collection id. The output video is added to it when the request completes.", - "title": "target_collection_id", - "type": "string", - "x-tool-description": "Destination collection ID (URL-safe base64); must be writable." - } - }, - "required": [ - "prompt" - ], - "title": "GenerateVideoMinimaxH3TextToVideoRequest", - "type": "object" - }, - "GenerateVideoMinimaxH3Response": { - "description": "Acknowledgement that the video request was accepted. The video is not\nincluded in this response: poll `GET /v2/generations/{generation_id}`\nwith the returned `generation_id`, or receive it at the `webhook_url`\nyou supplied. Video links expire after a limited time, so download any\nvideo you want to keep.\n", - "example": { - "generation_id": "generation_id", - "created": "2000-01-23T04:56:07+00:00" - }, - "properties": { - "generation_id": { - "description": "URL-safe base64 ID of the accepted generation. Accepted by the\n`GET /v2/generations/{generation_id}` polling endpoint.\n", - "title": "generation_id", - "type": "string" - }, - "created": { - "description": "The time the request was accepted.", - "format": "date-time", - "title": "created", - "type": "string" - } - }, - "required": [ - "created", - "generation_id" - ], - "title": "GenerateVideoMinimaxH3Response", - "type": "object" - }, - "GenerateVideoMinimaxH3ImageToVideoRequest": { - "description": "Request body for MiniMax H3 image-to-video generation.\nUpload the first frame as `image`, and optionally a final frame as\n`end_image`, using `multipart/form-data`. The video takes its aspect\nratio from the first frame, so there is no `aspect_ratio` field.\n", - "properties": { - "image_asset_identifier": { - "allOf": [ - { - "$ref": "#/components/schemas/AssetIdentifier" - } - ], - "description": "A reference to an image already stored with Ideogram to use as the first frame, in place of uploading `image`. Only image assets are accepted.", - "x-tool-description": "Stored image asset for the first frame." - }, - "image": { - "description": "The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored.", - "format": "binary", - "type": "string", - "x-tool-description": "First frame (JPEG/PNG/WEBP, max 50MB). Multipart only; used for this request, not stored." - }, - "end_image_asset_identifier": { - "allOf": [ - { - "$ref": "#/components/schemas/AssetIdentifier" - } - ], - "description": "An optional final frame, as a reference to an image already stored with Ideogram. When supplied, the generated video transitions from the first frame to this one. Only image assets are accepted.", - "x-tool-description": "Stored image asset for the final frame; the video transitions from the first frame to it." - }, - "end_image": { - "description": "An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one.", - "format": "binary", - "type": "string", - "x-tool-description": "Final frame (JPEG/PNG/WEBP, max 50MB). Multipart only; the video transitions from the first frame to it." - }, - "prompt": { - "description": "A natural-language prompt describing how the first frame should animate.", - "example": "The camera slowly pans right as the waves roll in.", - "maxLength": 2000, - "minLength": 1, - "type": "string", - "x-tool-description": "Describe how to animate the first frame." - }, - "resolution": { - "$ref": "#/components/schemas/MinimaxH3Resolution" - }, - "duration": { - "default": 5, - "description": "The length of the generated video in seconds.", - "example": 5, - "maximum": 15, - "minimum": 5, - "title": "duration", - "type": "integer" - }, - "webhook_url": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - }, - "private": { - "description": "When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately.", - "nullable": true, - "type": "boolean", - "x-tool-description": "true keeps the output private; false publishes it. Enterprise output is always private." - }, - "target_collection_id": { - "description": "A collection you can write to, by its URL-safe base64 collection id. The output video is added to it when the request completes.", - "type": "string", - "x-tool-description": "Destination collection ID (URL-safe base64); must be writable." - } - }, - "required": [ - "prompt" - ], - "type": "object", - "x-tool-description": "First frame: image_asset_identifier (required). Final frame: end_image_asset_identifier (optional)." - }, - "GenerateVideoKlingV3Response": { - "description": "Acknowledgement that the request was accepted. The generated video is not\npart of this response: poll `GET /v2/generations/{generation_id}` with\nthe returned `generation_id`, or receive it at your `webhook_url`.\nVideo links expire after a limited time, so download any video you\nwant to keep.\n", - "example": { - "generation_id": "generation_id", - "created": "2000-01-23T04:56:07+00:00" - }, - "properties": { - "generation_id": { - "description": "The generation ID to poll with `GET /v2/generations/{generation_id}`.\n", - "title": "generation_id", - "type": "string" - }, - "created": { - "description": "The time the request was accepted.", - "format": "date-time", - "title": "created", - "type": "string" - } - }, - "required": [ - "created", - "generation_id" - ], - "title": "GenerateVideoKlingV3Response", - "type": "object" - }, - "GenerateVideoKlingV3StandardTextToVideoRequest": { - "description": "Request body for Kling v3 Standard text-to-video generation.", - "example": { - "duration": 5, - "shot_type": null, - "aspect_ratio": null, - "private": true, - "webhook_url": "https://api.example.com/webhooks/ideogram", - "negative_prompt": "negative_prompt", - "target_collection_id": "target_collection_id", - "generate_audio": false, - "prompt": "A red fox running through a snowy forest at dawn.", - "cfg_scale": 0.5 - }, - "properties": { - "prompt": { - "description": "A natural-language prompt describing the video to generate.", - "example": "A red fox running through a snowy forest at dawn.", - "maxLength": 2000, - "minLength": 1, - "title": "prompt", - "type": "string", - "x-tool-description": "Describe the video to generate." - }, - "negative_prompt": { - "description": "Description of what to keep out of the video. Descriptions in the prompt take precedence over descriptions in the negative prompt.", - "maxLength": 2000, - "title": "negative_prompt", - "type": "string", - "x-tool-description": "What to exclude; prompt takes precedence." - }, - "aspect_ratio": { - "$ref": "#/components/schemas/KlingV3AspectRatio" - }, - "duration": { - "description": "The length of the generated video in seconds. Defaults to 5 seconds\nwhen omitted.\n", - "example": 5, - "maximum": 15, - "minimum": 3, - "title": "duration", - "type": "integer" - }, - "generate_audio": { - "default": false, - "description": "Whether to generate an audio track for the video. Audio roughly\ndoubles the provider cost and is subject to stricter output moderation.\n", - "title": "generate_audio", - "type": "boolean", - "x-tool-description": "Audio roughly doubles provider cost and tightens output moderation." - }, - "shot_type": { - "$ref": "#/components/schemas/KlingV3ShotType" - }, - "cfg_scale": { - "description": "How closely the video follows the prompt, from 0 to 1. Lower values\nleave the model more freedom. Defaults to 0.5 when omitted.\n", - "example": 0.5, - "format": "float", - "maximum": 1, - "minimum": 0, - "title": "cfg_scale", - "type": "number", - "x-tool-description": "Prompt fidelity (0–1, default 0.5); lower allows more freedom." - }, - "webhook_url": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - }, - "private": { - "description": "When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately.", - "nullable": true, - "title": "private", - "type": "boolean", - "x-tool-description": "true keeps the output private; false publishes it. Enterprise output is always private." - }, - "target_collection_id": { - "description": "A collection you can write to, by its URL-safe base64 collection id. The output videos are added to it when the request completes.", - "title": "target_collection_id", - "type": "string", - "x-tool-description": "Destination collection ID (URL-safe base64); must be writable." - } - }, - "required": [ - "prompt" - ], - "title": "GenerateVideoKlingV3StandardTextToVideoRequest", - "type": "object" - }, - "GenerateVideoKlingV3StandardImageToVideoRequest": { - "description": "Request body for Kling v3 Standard image-to-video generation.\nUpload the first frame as `image`, and optionally a final frame as\n`end_image`, using `multipart/form-data`. The video takes its aspect\nratio from the first frame, so there is no `aspect_ratio` field.\n", - "properties": { - "image_asset_identifier": { - "allOf": [ - { - "$ref": "#/components/schemas/AssetIdentifier" - } - ], - "description": "A reference to an image already stored with Ideogram to use as the first frame, in place of uploading `image`. Only image assets are accepted.", - "x-tool-description": "Stored image asset for the first frame." - }, - "image": { - "description": "The first-frame image to animate, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored.", - "format": "binary", - "type": "string", - "x-tool-description": "First frame (JPEG/PNG/WEBP, max 50MB). Multipart only; used for this request, not stored." - }, - "end_image_asset_identifier": { - "allOf": [ - { - "$ref": "#/components/schemas/AssetIdentifier" - } - ], - "description": "An optional final frame, as a reference to an image already stored with Ideogram. When supplied, the generated video transitions from the first frame to this one. Only image assets are accepted.", - "x-tool-description": "Stored image asset for the final frame; the video transitions from the first frame to it." - }, - "end_image": { - "description": "An optional final frame, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. When supplied, the video transitions from the first frame to this one.", - "format": "binary", - "type": "string", - "x-tool-description": "Final frame (JPEG/PNG/WEBP, max 50MB). Multipart only; the video transitions from the first frame to it." - }, - "prompt": { - "description": "A natural-language prompt describing how the first frame should animate.", - "example": "The camera slowly pans right as the waves roll in.", - "maxLength": 2000, - "minLength": 1, - "type": "string", - "x-tool-description": "Describe how to animate the first frame." - }, - "negative_prompt": { - "description": "Description of what to keep out of the video. Descriptions in the prompt take precedence over descriptions in the negative prompt.", - "maxLength": 2000, - "type": "string", - "x-tool-description": "What to exclude; prompt takes precedence." - }, - "duration": { - "description": "The length of the generated video in seconds. Defaults to 5 seconds\nwhen omitted.\n", - "example": 5, - "maximum": 15, - "minimum": 3, - "title": "duration", - "type": "integer" - }, - "generate_audio": { - "default": false, - "description": "Whether to generate an audio track for the video. Audio roughly\ndoubles the provider cost and is subject to stricter output moderation.\n", - "title": "generate_audio", - "type": "boolean", - "x-tool-description": "Audio roughly doubles provider cost and tightens output moderation." - }, - "shot_type": { - "$ref": "#/components/schemas/KlingV3ShotType" - }, - "cfg_scale": { - "description": "How closely the video follows the prompt, from 0 to 1. Lower values\nleave the model more freedom. Defaults to 0.5 when omitted.\n", - "example": 0.5, - "format": "float", - "maximum": 1, - "minimum": 0, - "title": "cfg_scale", - "type": "number", - "x-tool-description": "Prompt fidelity (0–1, default 0.5); lower allows more freedom." - }, - "webhook_url": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - }, - "private": { - "description": "When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately.", - "nullable": true, - "type": "boolean", - "x-tool-description": "true keeps the output private; false publishes it. Enterprise output is always private." - }, - "target_collection_id": { - "description": "A collection you can write to, by its URL-safe base64 collection id. The output videos are added to it when the request completes.", - "type": "string", - "x-tool-description": "Destination collection ID (URL-safe base64); must be writable." - } - }, - "required": [ - "prompt" - ], - "type": "object", - "x-tool-description": "First frame: image_asset_identifier (required). Final frame: end_image_asset_identifier (optional)." - }, - "GenerateVideoSeedDance2ReferenceToVideoRequest": { - "description": "Request body for Seedance 2.0 reference-to-video. Upload\n`reference_images` (at least one is required) and optional\n`reference_audios` using `multipart/form-data`. The prompt refers to\nthem by position: `@Image1`, `@Audio1`, and so on.\n", - "properties": { - "prompt": { - "description": "A natural-language prompt describing the video to produce. Refer to references by position, as in \"@Image1 walks toward the camera\".", - "example": "@Image1 walks through the snowy forest at dawn.", - "maxLength": 2000, - "minLength": 1, - "type": "string" - }, - "reference_image_asset_identifiers": { - "description": "Images already stored with Ideogram to use as references, by reference, in prompt order. Cannot be combined with `reference_images`. Only image assets are accepted.", - "items": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "maxItems": 9, - "minItems": 1, - "type": "array", - "x-tool-description": "Stored image assets in prompt order." - }, - "reference_images": { - "description": "Reference images, in prompt order. Common formats such as JPEG, PNG, and WEBP are supported, up to 50MB each. Multipart requests only. Uploaded images are used for this request only and are not stored.", - "items": { - "format": "binary", - "type": "string" - }, - "maxItems": 9, - "minItems": 1, - "type": "array", - "x-tool-description": "Reference images in prompt order (JPEG/PNG/WEBP, max 50MB each). Multipart only; used for this request, not stored." - }, - "reference_video_asset_identifiers": { - "description": "Uploaded or generated videos to use as references, by reference, in prompt order. Each clip must be between 2 and 15 seconds long, and the clips must total no more than 15 seconds. Upload video files first and pass their asset identifiers.", - "items": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "maxItems": 3, - "minItems": 1, - "type": "array" - }, - "reference_audios": { - "description": "MP3 or WAV audio references, in prompt order. Multipart requests only. Each file must be at most 15 MB and between 2 and 15 seconds long, with a combined duration of at most 15 seconds. Requires at least one reference image. Audio is used for this request only and is not saved to your library.", - "items": { - "format": "binary", - "type": "string" - }, - "maxItems": 3, - "minItems": 1, - "type": "array", - "x-tool-description": "MP3/WAV in prompt order. Multipart only; max 15MB/file, 2–15s each, total <=15s. Requires a reference image. Used for this request, not stored." - }, - "aspect_ratio": { - "$ref": "#/components/schemas/SeedDance2AspectRatio" - }, - "resolution": { - "$ref": "#/components/schemas/SeedDance2Resolution" - }, - "duration": { - "description": "The length of the generated video in seconds. When omitted, the model\npicks the best duration for the prompt (\"auto\").\n", - "example": 5, - "maximum": 15, - "minimum": 4, - "title": "duration", - "type": "integer", - "x-tool-description": "Seconds; omit to let the model choose." - }, - "generate_audio": { - "default": false, - "description": "Whether to generate an audio track for the video. Audio roughly\ndoubles the provider cost and is subject to stricter output moderation.\n", - "title": "generate_audio", - "type": "boolean", - "x-tool-description": "Audio roughly doubles provider cost and tightens output moderation." - }, - "webhook_url": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - }, - "private": { - "description": "When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately.", - "nullable": true, - "type": "boolean", - "x-tool-description": "true keeps the output private; false publishes it. Enterprise output is always private." - }, - "target_collection_id": { - "description": "A collection you can write to, by its URL-safe base64 collection id. The output videos are added to it when the request completes.", - "type": "string", - "x-tool-description": "Destination collection ID (URL-safe base64); must be writable." - } - }, - "required": [ - "prompt" - ], - "type": "object", - "x-tool-description": "Use at least one image or video asset reference, addressed as @Image1 and @Video1 in prompt order." - }, - "GenerateVideoSeedDance25ReferenceToVideoRequest": { - "description": "Request body for Seedance 2.5 reference-to-video. Upload\n`reference_images` (at least one is required) and optional\n`reference_audios` using `multipart/form-data`. The prompt refers to\nthem by position: `[Image1]`, `[Audio1]`, and so on.\n", - "properties": { - "prompt": { - "description": "A natural-language prompt describing the video to produce. Refer to references by position, as in \"[Image1] walks toward the camera\".", - "example": "[Image1] walks through the snowy forest at dawn.", - "maxLength": 2000, - "minLength": 1, - "type": "string" - }, - "reference_image_asset_identifiers": { - "description": "Images already stored with Ideogram to use as references, by reference, in prompt order. Cannot be combined with `reference_images`. Only image assets are accepted.", - "items": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "maxItems": 9, - "minItems": 1, - "type": "array", - "x-tool-description": "Stored image assets in prompt order." - }, - "reference_images": { - "description": "Reference images, in prompt order. Common formats such as JPEG, PNG, and WEBP are supported, up to 50MB each. Multipart requests only. Uploaded images are used for this request only and are not stored.", - "items": { - "format": "binary", - "type": "string" - }, - "maxItems": 9, - "minItems": 1, - "type": "array", - "x-tool-description": "Reference images in prompt order (JPEG/PNG/WEBP, max 50MB each). Multipart only; used for this request, not stored." - }, - "reference_video_asset_identifiers": { - "description": "Uploaded or generated videos to use as references, by reference, in prompt order. Each clip must be between 2 and 30 seconds long, and the clips must total no more than 30 seconds. Upload video files first and pass their asset identifiers.", - "items": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "maxItems": 10, - "minItems": 1, - "type": "array" - }, - "reference_audios": { - "description": "MP3 or WAV audio references, in prompt order. Multipart requests only. Each file must be at most 15 MB and between 2 and 30 seconds long, with a combined duration of at most 30 seconds. Requires at least one reference image. Audio is used for this request only and is not saved to your library.", - "items": { - "format": "binary", - "type": "string" - }, - "maxItems": 10, - "minItems": 1, - "type": "array", - "x-tool-description": "MP3/WAV in prompt order. Multipart only; max 15MB/file, 2–30s each, total <=30s. Requires a reference image. Used for this request, not stored." - }, - "aspect_ratio": { - "$ref": "#/components/schemas/SeedDance2AspectRatio" - }, - "resolution": { - "$ref": "#/components/schemas/SeedDance25Resolution" - }, - "duration": { - "description": "The length of the generated video in seconds. When omitted, the model\npicks the best duration for the prompt (\"auto\").\n", - "example": 5, - "maximum": 30, - "minimum": 4, - "title": "duration", - "type": "integer", - "x-tool-description": "Seconds; omit to let the model choose." - }, - "generate_audio": { - "default": false, - "description": "Whether to generate an audio track for the video. Audio roughly\ndoubles the provider cost and is subject to stricter output moderation.\n", - "title": "generate_audio", - "type": "boolean", - "x-tool-description": "Audio roughly doubles provider cost and tightens output moderation." - }, - "webhook_url": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - }, - "private": { - "description": "When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately.", - "nullable": true, - "type": "boolean", - "x-tool-description": "true keeps the output private; false publishes it. Enterprise output is always private." - }, - "target_collection_id": { - "description": "A collection you can write to, by its URL-safe base64 collection id. The output videos are added to it when the request completes.", - "type": "string", - "x-tool-description": "Destination collection ID (URL-safe base64); must be writable." - } - }, - "required": [ - "prompt" - ], - "type": "object", - "x-tool-description": "Use at least one image or video asset reference, addressed as [Image1] and [Video1] in prompt order." - }, - "EditVideoMinimaxH3ReferenceToVideoRequest": { - "description": "Request body for MiniMax H3 reference-to-video. The prompt addresses\nreferences by position: `Image 1`, `Audio 1`, and so on. References\nare optional; with none, the video is produced from the prompt alone.\nAudio requires an image alongside it, and audio references must total\nat most 15 seconds.\n", - "properties": { - "prompt": { - "description": "A natural-language prompt describing the video to produce. Reference media is addressed by position, as in \"Image 1 walks toward the camera with the motion of Video 1\".", - "example": "Image 1 walks through the snowy forest at dawn.", - "maxLength": 2000, - "minLength": 1, - "type": "string" - }, - "reference_image_asset_identifiers": { - "description": "Images already stored with Ideogram to use as references, by reference, in prompt order. Cannot be combined with `reference_images`. Only image assets are accepted.", - "items": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "maxItems": 9, - "minItems": 1, - "type": "array", - "x-tool-description": "Stored image assets in prompt order." - }, - "reference_images": { - "description": "Images to use as references (max size 50MB each), as raw bytes, in prompt order; only common image formats such as JPEG, PNG, and WEBP are supported. Uploaded images are used for this request only and are not stored.", - "items": { - "format": "binary", - "type": "string" - }, - "maxItems": 9, - "minItems": 1, - "type": "array", - "x-tool-description": "Reference images in prompt order (JPEG/PNG/WEBP, max 50MB each); used for this request, not stored." - }, - "reference_video_asset_identifiers": { - "description": "Videos generated or uploaded with Ideogram to use as motion references, by reference, in prompt order. Each clip must be between 2 and 15 seconds long, and the clips must total no more than 15 seconds. Raw video uploads are not accepted.", - "items": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "maxItems": 3, - "minItems": 1, - "type": "array" - }, - "reference_audios": { - "description": "MP3 or WAV audio references, in prompt order as Audio 1, Audio 2, and Audio 3. Multipart uploads only; up to 15 MB per file and 2–15 seconds each. Audio and video references must total no more than 15 seconds. Requires a reference image or video. At most 12 references across images, videos, and audio. Used only for this request and not saved as assets.", - "items": { - "format": "binary", - "type": "string" - }, - "maxItems": 3, - "minItems": 1, - "type": "array", - "x-tool-description": "MP3/WAV, prompt order: Audio 1–3. Multipart only; max 15MB/file, 2–15s each; audio+video total <=15s. Requires an image/video reference; max 12 references total. Used for this request, not stored." - }, - "aspect_ratio": { - "$ref": "#/components/schemas/MinimaxH3AspectRatio" - }, - "resolution": { - "$ref": "#/components/schemas/MinimaxH3Resolution" - }, - "duration": { - "default": 5, - "description": "The length of the generated video in seconds.", - "example": 5, - "maximum": 15, - "minimum": 5, - "title": "duration", - "type": "integer" - }, - "prompt_expansion_mode": { - "$ref": "#/components/schemas/MinimaxH3PromptExpansionMode" - }, - "webhook_url": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - }, - "private": { - "description": "When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately.", - "nullable": true, - "type": "boolean", - "x-tool-description": "true keeps the output private; false publishes it. Enterprise output is always private." - }, - "target_collection_id": { - "description": "A collection you can write to, by its URL-safe base64 collection id. The output videos are added to it when the request completes.", - "type": "string", - "x-tool-description": "Destination collection ID (URL-safe base64); must be writable." - } - }, - "required": [ - "prompt" - ], - "type": "object", - "x-tool-description": "Optional image/video asset references, addressed as Image 1 and Video 1 in prompt order." - }, - "EditVideoSeedDance2Request": { - "description": "Request body for a Seedance 2.0 video edit. `video_asset_identifier`\nnames the video being edited and `start_frame_time`/`end_frame_time` mark\nthe span of it the generated clip replaces. The two `is_*_included` flags\nanchor the generated clip on the span's own end frames; at least one must\nbe anchored.\n", - "example": { - "duration": 5, - "private": true, - "end_frame_time": "", - "is_end_frame_included": false, - "webhook_url": "https://api.example.com/webhooks/ideogram", - "video_asset_identifier": "", - "target_collection_id": "target_collection_id", - "generate_audio": false, - "is_start_frame_included": true, - "prompt": "The camera pushes in as the dancer turns towards the light.", - "resolution": "", - "start_frame_time": "" - }, - "properties": { - "video_asset_identifier": { - "allOf": [ - { - "$ref": "#/components/schemas/AssetIdentifier" - } - ], - "description": "A reference to a video already stored with Ideogram to take the frames from. Only video assets are accepted.", - "title": "video_asset_identifier" - }, - "start_frame_time": { - "allOf": [ - { - "$ref": "#/components/schemas/VideoFrameTimeSeconds" - } - ], - "description": "Where the replaced span of the source video begins. Everything before it is kept as-is.", - "title": "start_frame_time" - }, - "is_start_frame_included": { - "default": true, - "description": "Whether the generated clip is anchored on the frame already at `start_frame_time`, so it opens on the footage it replaces. Set it to false to anchor on the end frame alone, in which case `is_end_frame_included` must be true.", - "title": "is_start_frame_included", - "type": "boolean" - }, - "end_frame_time": { - "allOf": [ - { - "$ref": "#/components/schemas/VideoFrameTimeSeconds" - } - ], - "description": "Where the replaced span of the source video ends; must come after `start_frame_time`. Everything from here on is kept as-is.", - "title": "end_frame_time" - }, - "is_end_frame_included": { - "default": false, - "description": "Whether the generated clip is anchored on the frame at `end_frame_time`, so it lands on the footage that follows the span.", - "title": "is_end_frame_included", - "type": "boolean" - }, - "prompt": { - "description": "A natural-language prompt describing what the replaced span should show.", - "example": "The camera pushes in as the dancer turns towards the light.", - "maxLength": 2000, - "minLength": 1, - "title": "prompt", - "type": "string" - }, - "resolution": { - "allOf": [ - { - "$ref": "#/components/schemas/SeedDance2Resolution" - } - ], - "description": "The resolution tier the replaced span is generated at. The clip is then scaled to the source video's own frame, so this affects the detail generated rather than the edited video's dimensions.", - "title": "resolution" - }, - "duration": { - "description": "The length of the generated video in seconds. When omitted, the model\npicks the best duration for the prompt (\"auto\").\n", - "example": 5, - "maximum": 15, - "minimum": 4, - "title": "duration", - "type": "integer", - "x-tool-description": "Seconds; omit to let the model choose." - }, - "generate_audio": { - "default": false, - "description": "Whether to generate an audio track for the video. Audio roughly\ndoubles the provider cost and is subject to stricter output moderation.\n", - "title": "generate_audio", - "type": "boolean", - "x-tool-description": "Audio roughly doubles provider cost and tightens output moderation." - }, - "webhook_url": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - }, - "private": { - "description": "When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately.", - "nullable": true, - "title": "private", - "type": "boolean", - "x-tool-description": "true keeps the output private; false publishes it. Enterprise output is always private." - }, - "target_collection_id": { - "description": "A collection you can write to, by its URL-safe base64 collection id. The output videos are added to it when the request completes.", - "title": "target_collection_id", - "type": "string", - "x-tool-description": "Destination collection ID (URL-safe base64); must be writable." - } - }, - "required": [ - "end_frame_time", - "prompt", - "start_frame_time", - "video_asset_identifier" - ], - "title": "EditVideoSeedDance2Request", - "type": "object" - }, - "RemoveObjectFromV2AssetsResponse": { - "description": "Acknowledgement that the request was accepted. Poll\n`GET /v2/generations/{generation_id}` with the returned `generation_id`\nfor the result.\n", - "example": { - "generation_id": "generation_id" - }, - "properties": { - "generation_id": { - "description": "URL-safe base64 ID of the accepted generation. Accepted by the\n`GET /v2/generations/{generation_id}` polling endpoint.\n", - "title": "generation_id", - "type": "string" - } - }, - "required": [ - "generation_id" - ], - "title": "RemoveObjectFromV2AssetsResponse", - "type": "object" - }, - "RemoveObjectFromV2AssetsRequest": { - "description": "Upload both the source `image` and the `mask` using `multipart/form-data`.\n", - "properties": { - "image_asset_identifier": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "image": { - "description": "The source image to remove an object from. JPEG, PNG, or WEBP, up to 50MB. Multipart requests only.", - "format": "binary", - "type": "string" - }, - "mask_asset_identifier": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "mask": { - "description": "A black-and-white mask the same size as the image; white (>= 128) marks the region to remove. JPEG, PNG, or WEBP, up to 50MB. Multipart requests only.", - "format": "binary", - "type": "string" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - }, - "target_collection_id": { - "description": "A collection you can write to, by its URL-safe base64 collection id. Completed outputs are added to it automatically.", - "type": "string" - }, - "store_assets": { - "default": false, - "description": "Whether to store the resulting images on Ideogram. Defaults to `false`.\nCurrently accepted but not yet enforced.\n", - "type": "boolean" - } - }, - "type": "object", - "x-tool-description": "The source image and a same-size black-and-white mask, as asset identifiers; white marks the region to remove." - }, - "RemoveBackgroundV2Response": { - "description": "Synchronous requests include exactly one foreground image in `data`.\nAsync requests omit `data`; poll with `generation_id` for the result.\nIf a synchronous request fails after the response has started\nstreaming, the body contains `error` and `status_code` instead of\n`generation_id`.\n", - "example": { - "generation_id": "zm6IqQd4RPGnwA8gQYEL5Q", - "data": [ - { - "url": "https://ideogram.ai/assets/foreground.png", - "is_image_safe": true - } - ] - }, - "properties": { - "generation_id": { - "description": "The generation ID to poll with `GET /v2/generations/{generation_id}`.", - "type": "string" - }, - "data": { - "description": "The single foreground image. Present only for synchronous requests.", - "items": { - "$ref": "#/components/schemas/BackgroundRemovedImageObject" - }, - "maxItems": 1, - "minItems": 1, - "type": "array" - }, - "error": { - "description": "Error message for a failure after the response started streaming.", - "type": "string" - }, - "status_code": { - "description": "The HTTP status the failure would have returned before streaming began.", - "type": "integer" - } - }, - "title": "RemoveBackgroundV2Response", - "type": "object", - "x-drop-nulls": true - }, - "BackgroundRemovedImageObject": { - "properties": { - "url": { - "description": "Direct link to the foreground PNG. Empty when the output fails safety checks.", - "format": "uri", - "nullable": true, - "title": "url", - "type": "string" - }, - "is_image_safe": { - "description": "Whether the foreground image passed safety checks.", - "title": "is_image_safe", - "type": "boolean" - } - }, - "required": [ - "is_image_safe" - ], - "title": "BackgroundRemovedImageObject", - "type": "object" - }, - "RemoveBackgroundV2Request": { - "description": "Upload the source `image` using `multipart/form-data`.", - "properties": { - "image": { - "description": "The source image. JPEG, PNG, or WebP, up to 25MB. Multipart requests only.", - "format": "binary", - "type": "string", - "x-playground-field": { - "label": "Image upload", - "order": 1, - "group": "source" - } - }, - "image_asset_identifier": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "target_collection_id": { - "description": "A collection you can write to, by its URL-safe base64 collection id. Completed outputs are added to it automatically.", - "type": "string", - "x-tool-description": "Destination collection ID (URL-safe base64); must be writable." - }, - "private": { - "description": "Whether to keep the result out of the public gallery. When omitted,\ndefaults to your plan's setting, or public if your plan has none.\nEnterprise generations are always private.\n", - "type": "boolean", - "x-playground-field": { - "label": "Visibility", - "control": "select", - "order": 2, - "default": "", - "enum_subset": [ - "", - "true", - "false" - ], - "labels": { - "": "Default (plan setting)", - "true": "Private", - "false": "Public" - } - } - }, - "async": { - "default": false, - "description": "When false (the default), wait for and return the foreground image. When true, return as soon as the request is accepted; poll `GET /v2/generations/{generation_id}` for the result.", - "type": "boolean", - "x-tool-description": "Always overridden to true; tools run asynchronously.", - "x-playground-field": { - "label": "Async", - "order": 3, - "default": false - } - } - }, - "type": "object" - }, - "RemoveBackgroundV2AssetRequest": { - "additionalProperties": false, - "description": "JSON request body. To upload an image, use `multipart/form-data`.", - "properties": { - "image_asset_identifier": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "target_collection_id": { - "description": "A collection you can write to, by its URL-safe base64 collection id. Completed outputs are added to it automatically.", - "type": "string", - "x-tool-description": "Destination collection ID (URL-safe base64); must be writable." - }, - "private": { - "description": "Whether to keep the result out of the public gallery. Enterprise generations are always private.", - "type": "boolean" - }, - "async": { - "default": false, - "description": "When true, return as soon as the request is accepted; poll `GET /v2/generations/{generation_id}` for the result.", - "type": "boolean" - } - }, - "required": [ - "image_asset_identifier" - ], - "type": "object", - "x-tool-description": "Requires image_asset_identifier (uploaded or generated image)." - }, - "ReplaceBackgroundResponse": { - "description": "Acknowledgement that the request was accepted.", - "example": { - "generation_id": "generation_id" - }, - "properties": { - "generation_id": { - "description": "The generation ID to poll with `GET /v2/generations/{generation_id}`.", - "title": "generation_id", - "type": "string" - } - }, - "required": [ - "generation_id" - ], - "title": "ReplaceBackgroundResponse", - "type": "object" - }, - "ReplaceBackgroundRequest": { - "description": "Upload the source `image` using `multipart/form-data`. The prompt\ndescribes only the new background; the foreground subject is detected\nand kept automatically.\n", - "properties": { - "image_asset_identifier": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "image": { - "description": "The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and\nMPO are supported, up to 50 MB. Multipart requests only.\n", - "format": "binary", - "type": "string" - }, - "prompt": { - "description": "Plain-language description of the desired new background.", - "maxLength": 4000, - "minLength": 1, - "pattern": "\\S", - "type": "string" - }, - "quality": { - "allOf": [ - { - "$ref": "#/components/schemas/ReplaceBackgroundQuality" - } - ], - "default": "high", - "description": "The generation quality level. Defaults to `high`." - }, - "num_images": { - "default": 1, - "description": "The number of images to generate.", - "maximum": 8, - "minimum": 1, - "title": "NumImages", - "type": "integer", - "x-tool-description": "Number of variations of this one prompt. For different subjects, make separate calls instead of listing them in one prompt." - }, - "private": { - "description": "Whether to keep the result private. When omitted, defaults to your\nplan's setting. Enterprise generations are always private.\n", - "type": "boolean" - }, - "webhook_url": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - } - }, - "required": [ - "prompt" - ], - "type": "object", - "x-tool-description": "Requires image_asset_identifier. The prompt describes the new background; the foreground is preserved automatically." - }, - "ReplaceBackgroundQuality": { - "description": "The quality tier for the edit. Higher tiers may improve detail and\ntake longer to complete.\n", - "enum": [ - "low", - "medium", - "high" - ], - "title": "ReplaceBackgroundQuality", - "type": "string" - }, - "ReplaceBackgroundIdeogramV3Request": { - "description": "Upload the source `image` using `multipart/form-data`. The prompt\ndescribes only the new background; the foreground subject is detected\nand kept automatically.\n", - "properties": { - "image_asset_identifier": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "image": { - "description": "The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and\nMPO are supported, up to 50 MB. Multipart requests only.\nThe longer side must be at most 3 times the shorter side; wider\naspect ratios are rejected with a 400.\n", - "format": "binary", - "type": "string" - }, - "prompt": { - "description": "Plain-language description of the desired new background.", - "maxLength": 4000, - "minLength": 1, - "pattern": "\\S", - "type": "string" - }, - "rendering_speed": { - "default": "default", - "description": "The rendering speed to use.", - "enum": [ - "turbo", - "default", - "quality" - ], - "type": "string" - }, - "num_images": { - "default": 1, - "description": "The number of images to generate.", - "maximum": 8, - "minimum": 1, - "title": "NumImages", - "type": "integer", - "x-tool-description": "Number of variations of this one prompt. For different subjects, make separate calls instead of listing them in one prompt." - }, - "private": { - "description": "Whether to keep the result private. When omitted, defaults to your\nplan's setting. Enterprise generations are always private.\n", - "type": "boolean" - }, - "webhook_url": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - } - }, - "required": [ - "prompt" - ], - "type": "object" - }, - "ReplaceBackgroundIdeogram45Request": { - "description": "Upload the source `image` and a `background_reference` using\n`multipart/form-data`. The people in `image` are kept.\n", - "properties": { - "image_asset_identifier": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "image": { - "description": "The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and\nMPO are supported, up to 50 MB. Its longer side may be at most the\nmodel's maximum aspect ratio times its shorter side; a more extreme\nproportion is rejected with a 400 that states the allowed range.\nMultipart requests only.\n", - "format": "binary", - "type": "string" - }, - "background_reference_asset_identifier": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "background_reference": { - "description": "A photo of the setting the new background should match. Its people\nare not copied. It is held to the same aspect-ratio limit as\n`image`. Multipart requests only.\n", - "format": "binary", - "type": "string" - }, - "num_images": { - "default": 1, - "description": "The number of images to generate.", - "maximum": 4, - "minimum": 1, - "type": "integer" - }, - "private": { - "description": "Whether to keep the result private. When omitted, the result is\nprivate. Enterprise generations are always private.\n", - "type": "boolean" - }, - "webhook_url": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - } - }, - "type": "object" - }, - "ListAccountApiKeysResponse": { - "example": { - "api_keys": [ - { - "creation_time": "2000-01-23T04:56:07+00:00", - "label": "Live production environment", - "redacted_api_key": "ATG56•••••••••••••", - "api_key_id": "JRPVD7jWR1aTBYiJ0UFVOg", - "creator_display_label": "John Doe", - "status": null - }, - { - "creation_time": "2000-01-23T04:56:07+00:00", - "label": "Live production environment", - "redacted_api_key": "ATG56•••••••••••••", - "api_key_id": "JRPVD7jWR1aTBYiJ0UFVOg", - "creator_display_label": "John Doe", - "status": null - } - ] - }, - "properties": { - "api_keys": { - "description": "All API keys in the organization, newest first.", - "items": { - "$ref": "#/components/schemas/AccountApiKey" - }, - "title": "api_keys", - "type": "array" - } - }, - "required": [ - "api_keys" - ], - "title": "ListAccountApiKeysResponse", - "type": "object" - }, - "AccountApiKey": { - "example": { - "creation_time": "2000-01-23T04:56:07+00:00", - "label": "Live production environment", - "redacted_api_key": "ATG56•••••••••••••", - "api_key_id": "JRPVD7jWR1aTBYiJ0UFVOg", - "creator_display_label": "John Doe", - "status": null - }, - "properties": { - "api_key_id": { - "description": "Base64 encoded API key ID", - "example": "JRPVD7jWR1aTBYiJ0UFVOg", - "title": "api_key_id", - "type": "string" - }, - "redacted_api_key": { - "description": "A redacted text snippet of the API key. Contains the first 4 characters of the API key", - "example": "ATG56•••••••••••••", - "title": "redacted_api_key", - "type": "string" - }, - "creation_time": { - "description": "The date at which the API key was created", - "format": "date-time", - "title": "creation_time", - "type": "string" - }, - "status": { - "$ref": "#/components/schemas/AccountApiKeyStatus" - }, - "label": { - "description": "An optional user-supplied label for managing the API key", - "example": "Live production environment", - "nullable": true, - "title": "label", - "type": "string" - }, - "creator_display_label": { - "description": "Name of the member who created the key, falling back to their display handle when no name is set. Null on keys created before creators were recorded, and on workspace types whose keys are shared rather than owned by one member.", - "example": "John Doe", - "nullable": true, - "title": "creator_display_label", - "type": "string" - } - }, - "required": [ - "api_key_id", - "creation_time", - "redacted_api_key", - "status" - ], - "title": "AccountApiKey", - "type": "object" - }, - "AccountApiKeyStatus": { - "enum": [ - "active", - "disabled", - "archived" - ], - "title": "AccountApiKeyStatus", - "type": "string" - }, - "GetAccountUsageResponse": { - "example": { - "buckets": [ - { - "start_time": "2000-01-23T04:56:07+00:00", - "end_time": "2000-01-23T04:56:07+00:00", - "line_items": [ - { - "product": "ideogram_v4_generation", - "endpoint": "/v2/image/generate/ideogram-4", - "cost_total": "84.00", - "user_email": "user_email", - "api_key": { - "redacted_key": "ATG5•••••••••••••", - "id": "JRPVD7jWR1aTBYiJ0UFVOg", - "label": "Live production environment" - }, - "description": "Ideogram v4 Generation", - "billed_units": { - "unit": "image", - "quantity": "2100", - "unit_price": "0.04" - }, - "source": "api", - "currency_code": "USD", - "dimensions": { - "key": "dimensions" - } - }, - { - "product": "ideogram_v4_generation", - "endpoint": "/v2/image/generate/ideogram-4", - "cost_total": "84.00", - "user_email": "user_email", - "api_key": { - "redacted_key": "ATG5•••••••••••••", - "id": "JRPVD7jWR1aTBYiJ0UFVOg", - "label": "Live production environment" - }, - "description": "Ideogram v4 Generation", - "billed_units": { - "unit": "image", - "quantity": "2100", - "unit_price": "0.04" - }, - "source": "api", - "currency_code": "USD", - "dimensions": { - "key": "dimensions" - } - } - ] - }, - { - "start_time": "2000-01-23T04:56:07+00:00", - "end_time": "2000-01-23T04:56:07+00:00", - "line_items": [ - { - "product": "ideogram_v4_generation", - "endpoint": "/v2/image/generate/ideogram-4", - "cost_total": "84.00", - "user_email": "user_email", - "api_key": { - "redacted_key": "ATG5•••••••••••••", - "id": "JRPVD7jWR1aTBYiJ0UFVOg", - "label": "Live production environment" - }, - "description": "Ideogram v4 Generation", - "billed_units": { - "unit": "image", - "quantity": "2100", - "unit_price": "0.04" - }, - "source": "api", - "currency_code": "USD", - "dimensions": { - "key": "dimensions" - } - }, - { - "product": "ideogram_v4_generation", - "endpoint": "/v2/image/generate/ideogram-4", - "cost_total": "84.00", - "user_email": "user_email", - "api_key": { - "redacted_key": "ATG5•••••••••••••", - "id": "JRPVD7jWR1aTBYiJ0UFVOg", - "label": "Live production environment" - }, - "description": "Ideogram v4 Generation", - "billed_units": { - "unit": "image", - "quantity": "2100", - "unit_price": "0.04" - }, - "source": "api", - "currency_code": "USD", - "dimensions": { - "key": "dimensions" - } - } - ] - } - ] - }, - "properties": { - "buckets": { - "description": "Dense, chronological buckets covering the requested range.", - "items": { - "$ref": "#/components/schemas/AccountUsageBucket" - }, - "title": "buckets", - "type": "array" - } - }, - "required": [ - "buckets" - ], - "title": "GetAccountUsageResponse", - "type": "object" - }, - "AccountUsageBucket": { - "example": { - "start_time": "2000-01-23T04:56:07+00:00", - "end_time": "2000-01-23T04:56:07+00:00", - "line_items": [ - { - "product": "ideogram_v4_generation", - "endpoint": "/v2/image/generate/ideogram-4", - "cost_total": "84.00", - "user_email": "user_email", - "api_key": { - "redacted_key": "ATG5•••••••••••••", - "id": "JRPVD7jWR1aTBYiJ0UFVOg", - "label": "Live production environment" - }, - "description": "Ideogram v4 Generation", - "billed_units": { - "unit": "image", - "quantity": "2100", - "unit_price": "0.04" - }, - "source": "api", - "currency_code": "USD", - "dimensions": { - "key": "dimensions" - } - }, - { - "product": "ideogram_v4_generation", - "endpoint": "/v2/image/generate/ideogram-4", - "cost_total": "84.00", - "user_email": "user_email", - "api_key": { - "redacted_key": "ATG5•••••••••••••", - "id": "JRPVD7jWR1aTBYiJ0UFVOg", - "label": "Live production environment" - }, - "description": "Ideogram v4 Generation", - "billed_units": { - "unit": "image", - "quantity": "2100", - "unit_price": "0.04" - }, - "source": "api", - "currency_code": "USD", - "dimensions": { - "key": "dimensions" - } - } - ] - }, - "properties": { - "start_time": { - "description": "Start of the bucket window (inclusive, UTC).", - "format": "date-time", - "title": "start_time", - "type": "string" - }, - "end_time": { - "description": "End of the bucket window (exclusive, UTC).", - "format": "date-time", - "title": "end_time", - "type": "string" - }, - "line_items": { - "description": "Usage billed in this window. Empty when nothing was billed.", - "items": { - "$ref": "#/components/schemas/AccountUsageLineItem" - }, - "title": "line_items", - "type": "array" - } - }, - "required": [ - "end_time", - "line_items", - "start_time" - ], - "title": "AccountUsageBucket", - "type": "object" - }, - "AccountUsageLineItem": { - "description": "One billed rate for one billing actor within one time bucket.", - "example": { - "product": "ideogram_v4_generation", - "endpoint": "/v2/image/generate/ideogram-4", - "cost_total": "84.00", - "user_email": "user_email", - "api_key": { - "redacted_key": "ATG5•••••••••••••", - "id": "JRPVD7jWR1aTBYiJ0UFVOg", - "label": "Live production environment" - }, - "description": "Ideogram v4 Generation", - "billed_units": { - "unit": "image", - "quantity": "2100", - "unit_price": "0.04" - }, - "source": "api", - "currency_code": "USD", - "dimensions": { - "key": "dimensions" - } - }, - "properties": { - "product": { - "description": "Stable identifier of the public pricing catalog entry this charge was billed under, at the granularity the pricing page prices it (for example one entry per quality and resolution). `unknown` when a historical charge can no longer be attributed; its cost is still included.", - "example": "ideogram_v4_generation", - "title": "product", - "type": "string" - }, - "endpoint": { - "description": "The API endpoint path this product belongs to.", - "example": "/v2/image/generate/ideogram-4", - "title": "endpoint", - "type": "string" - }, - "description": { - "description": "Name of the public pricing catalog entry, as shown on the pricing page. Not an identifier.", - "example": "Ideogram v4 Generation", - "title": "description", - "type": "string" - }, - "dimensions": { - "additionalProperties": { - "type": "string" - }, - "description": "Pricing dimensions this line item was billed under, for products priced per dimension (for example rendering speed).", - "title": "dimensions", - "type": "object" - }, - "cost_total": { - "description": "Total billed amount in `currency_code`, as a decimal string.", - "example": "84.00", - "title": "cost_total", - "type": "string" - }, - "currency_code": { - "description": "ISO 4217 currency code of the amounts on this line item.", - "example": "USD", - "title": "currency_code", - "type": "string" - }, - "source": { - "description": "Which billing surface the usage came through. `api` usage is attributed to an API key when one was used; `app` usage is attributed to the member who generated it.", - "enum": [ - "api", - "app" - ], - "title": "source", - "type": "string" - }, - "api_key": { - "$ref": "#/components/schemas/AccountUsageApiKey" - }, - "user_email": { - "description": "Email address of the member who generated the usage. Only present on `app` usage.", - "nullable": true, - "title": "user_email", - "type": "string" - }, - "billed_units": { - "$ref": "#/components/schemas/AccountUsageBilledUnits" - } - }, - "required": [ - "cost_total", - "currency_code", - "description", - "endpoint", - "product", - "source" - ], - "title": "AccountUsageLineItem", - "type": "object" - }, - "AccountUsageApiKey": { - "description": "The API key the usage was billed to, in redacted form.", - "example": { - "redacted_key": "ATG5•••••••••••••", - "id": "JRPVD7jWR1aTBYiJ0UFVOg", - "label": "Live production environment" - }, - "properties": { - "id": { - "description": "The API key's id, as listed by `GET /v2/account/api-keys`.", - "example": "JRPVD7jWR1aTBYiJ0UFVOg", - "title": "id", - "type": "string" - }, - "redacted_key": { - "description": "The first characters of the key followed by bullets.", - "example": "ATG5•••••••••••••", - "nullable": true, - "title": "redacted_key", - "type": "string" - }, - "label": { - "description": "The key's user-supplied label, when one is set.", - "example": "Live production environment", - "nullable": true, - "title": "label", - "type": "string" - } - }, - "required": [ - "id" - ], - "title": "AccountUsageApiKey", - "type": "object" - }, - "AccountUsageBilledUnits": { - "description": "Per-unit detail for products billed per item. `quantity × unit_price` always equals the line item's `cost_total`.", - "example": { - "unit": "image", - "quantity": "2100", - "unit_price": "0.04" - }, - "properties": { - "unit": { - "description": "What one billed unit is (for example `image`).", - "example": "image", - "title": "unit", - "type": "string" - }, - "quantity": { - "description": "Number of units billed, as a decimal string.", - "example": "2100", - "title": "quantity", - "type": "string" - }, - "unit_price": { - "description": "Price per unit in `currency_code`, as a decimal string.", - "example": "0.04", - "title": "unit_price", - "type": "string" - } - }, - "required": [ - "quantity", - "unit", - "unit_price" - ], - "title": "AccountUsageBilledUnits", - "type": "object" - }, - "ListAccountInvoicesResponse": { - "example": { - "invoices": [ - { - "start_time": "2000-01-23T04:56:07+00:00", - "total": "150.00", - "paid_time": "2000-01-23T04:56:07+00:00", - "end_time": "2000-01-23T04:56:07+00:00", - "line_items": [ - { - "cost_total": "84.00", - "quantity": "2100", - "api_key": { - "redacted_key": "ATG5•••••••••••••", - "id": "JRPVD7jWR1aTBYiJ0UFVOg", - "label": "Live production environment" - }, - "description": "Ideogram v4 Generation", - "unit_price": "0.04", - "currency_code": "USD" - }, - { - "cost_total": "84.00", - "quantity": "2100", - "api_key": { - "redacted_key": "ATG5•••••••••••••", - "id": "JRPVD7jWR1aTBYiJ0UFVOg", - "label": "Live production environment" - }, - "description": "Ideogram v4 Generation", - "unit_price": "0.04", - "currency_code": "USD" - } - ], - "issued_time": "2000-01-23T04:56:07+00:00", - "currency_code": "USD", - "status": "paid" - }, - { - "start_time": "2000-01-23T04:56:07+00:00", - "total": "150.00", - "paid_time": "2000-01-23T04:56:07+00:00", - "end_time": "2000-01-23T04:56:07+00:00", - "line_items": [ - { - "cost_total": "84.00", - "quantity": "2100", - "api_key": { - "redacted_key": "ATG5•••••••••••••", - "id": "JRPVD7jWR1aTBYiJ0UFVOg", - "label": "Live production environment" - }, - "description": "Ideogram v4 Generation", - "unit_price": "0.04", - "currency_code": "USD" - }, - { - "cost_total": "84.00", - "quantity": "2100", - "api_key": { - "redacted_key": "ATG5•••••••••••••", - "id": "JRPVD7jWR1aTBYiJ0UFVOg", - "label": "Live production environment" - }, - "description": "Ideogram v4 Generation", - "unit_price": "0.04", - "currency_code": "USD" - } - ], - "issued_time": "2000-01-23T04:56:07+00:00", - "currency_code": "USD", - "status": "paid" - } - ] - }, - "properties": { - "invoices": { - "description": "The organization's invoices.", - "items": { - "$ref": "#/components/schemas/AccountInvoice" - }, - "title": "invoices", - "type": "array" - } - }, - "required": [ - "invoices" - ], - "title": "ListAccountInvoicesResponse", - "type": "object" - }, - "AccountInvoice": { - "example": { - "start_time": "2000-01-23T04:56:07+00:00", - "total": "150.00", - "paid_time": "2000-01-23T04:56:07+00:00", - "end_time": "2000-01-23T04:56:07+00:00", - "line_items": [ - { - "cost_total": "84.00", - "quantity": "2100", - "api_key": { - "redacted_key": "ATG5•••••••••••••", - "id": "JRPVD7jWR1aTBYiJ0UFVOg", - "label": "Live production environment" - }, - "description": "Ideogram v4 Generation", - "unit_price": "0.04", - "currency_code": "USD" - }, - { - "cost_total": "84.00", - "quantity": "2100", - "api_key": { - "redacted_key": "ATG5•••••••••••••", - "id": "JRPVD7jWR1aTBYiJ0UFVOg", - "label": "Live production environment" - }, - "description": "Ideogram v4 Generation", - "unit_price": "0.04", - "currency_code": "USD" - } - ], - "issued_time": "2000-01-23T04:56:07+00:00", - "currency_code": "USD", - "status": "paid" - }, - "properties": { - "start_time": { - "description": "Start of the invoice period.", - "format": "date-time", - "title": "start_time", - "type": "string" - }, - "end_time": { - "description": "End of the invoice period.", - "format": "date-time", - "title": "end_time", - "type": "string" - }, - "issued_time": { - "description": "When the invoice was issued, when it has been.", - "format": "date-time", - "nullable": true, - "title": "issued_time", - "type": "string" - }, - "paid_time": { - "description": "When the invoice was paid, when it has been.", - "format": "date-time", - "nullable": true, - "title": "paid_time", - "type": "string" - }, - "status": { - "$ref": "#/components/schemas/AccountInvoiceStatus" - }, - "total": { - "description": "Invoice total in `currency_code`, as a decimal string.", - "example": "150.00", - "title": "total", - "type": "string" - }, - "currency_code": { - "description": "ISO 4217 currency code of the amounts on this invoice.", - "example": "USD", - "title": "currency_code", - "type": "string" - }, - "line_items": { - "description": "The invoice's charges.", - "items": { - "$ref": "#/components/schemas/AccountInvoiceLineItem" - }, - "title": "line_items", - "type": "array" - } - }, - "required": [ - "currency_code", - "end_time", - "line_items", - "start_time", - "status", - "total" - ], - "title": "AccountInvoice", - "type": "object" - }, - "AccountInvoiceStatus": { - "description": "Status of the invoice", - "enum": [ - "draft", - "pending_payment", - "paid", - "voided" - ], - "example": "paid", - "title": "AccountInvoiceStatus", - "type": "string" - }, - "AccountInvoiceLineItem": { - "description": "One charged product on an invoice.", - "example": { - "cost_total": "84.00", - "quantity": "2100", - "api_key": { - "redacted_key": "ATG5•••••••••••••", - "id": "JRPVD7jWR1aTBYiJ0UFVOg", - "label": "Live production environment" - }, - "description": "Ideogram v4 Generation", - "unit_price": "0.04", - "currency_code": "USD" - }, - "properties": { - "description": { - "description": "Display name of the charged product. Not an identifier.", - "example": "Ideogram v4 Generation", - "title": "description", - "type": "string" - }, - "quantity": { - "description": "Number of billed units, as a decimal string.", - "example": "2100", - "title": "quantity", - "type": "string" - }, - "unit_price": { - "description": "Price per unit in `currency_code`, as a decimal string.", - "example": "0.04", - "title": "unit_price", - "type": "string" - }, - "cost_total": { - "description": "Total charged amount in `currency_code`, as a decimal string.", - "example": "84.00", - "title": "cost_total", - "type": "string" - }, - "currency_code": { - "description": "ISO 4217 currency code of the amounts on this line item.", - "example": "USD", - "title": "currency_code", - "type": "string" - }, - "api_key": { - "$ref": "#/components/schemas/AccountUsageApiKey" - } - }, - "required": [ - "cost_total", - "currency_code", - "description", - "quantity", - "unit_price" - ], - "title": "AccountInvoiceLineItem", - "type": "object" - }, - "UpscaleImageTopazTextRefineResponse": { - "description": "Synchronous requests (the default) include the upscaled image in `data`.\nAsync requests omit `data`; poll `GET /v2/generations/{generation_id}`\nwith the returned `generation_id`. `seed` is the seed actually used,\nand `width` and `height` are the output dimensions.\n", - "example": { - "data": [ - { - "seed": 12345, - "resolution": "2048x2048", - "url": "https://openapi-generator.tech", - "is_image_safe": true - }, - { - "seed": 12345, - "resolution": "2048x2048", - "url": "https://openapi-generator.tech", - "is_image_safe": true - } - ], - "seed": 12345, - "generation_id": "generation_id", - "width": 0, - "height": 6 - }, - "properties": { - "generation_id": { - "description": "The generation ID to poll with `GET /v2/generations/{generation_id}`.\n", - "title": "generation_id", - "type": "string" - }, - "data": { - "description": "The upscaled image. Present only for synchronous requests (`async` omitted or false).", - "items": { - "$ref": "#/components/schemas/UpscaleImageObject" - }, - "title": "data", - "type": "array" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - }, - "width": { - "description": "The output width in pixels.", - "title": "width", - "type": "integer" - }, - "height": { - "description": "The output height in pixels.", - "title": "height", - "type": "integer" - } - }, - "required": [ - "generation_id", - "height", - "seed", - "width" - ], - "title": "UpscaleImageTopazTextRefineResponse", - "type": "object" - }, - "UpscaleImageObject": { - "description": "One upscaled output image.", - "example": { - "seed": 12345, - "resolution": "2048x2048", - "url": "https://openapi-generator.tech", - "is_image_safe": true - }, - "properties": { - "url": { - "description": "The direct link to the upscaled image. Empty when the image did not pass safety checks.", - "format": "uri", - "nullable": true, - "title": "url", - "type": "string" - }, - "resolution": { - "description": "The resolution of the upscaled image, formatted as \"WIDTHxHEIGHT\".", - "example": "2048x2048", - "title": "resolution", - "type": "string" - }, - "is_image_safe": { - "description": "Whether the image passed safety checks. If false, `url` is empty.", - "title": "is_image_safe", - "type": "boolean" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - } - }, - "required": [ - "is_image_safe", - "resolution", - "seed" - ], - "title": "UpscaleImageObject", - "type": "object" - }, - "UpscaleImageTopazTextRefineRequest": { - "description": "Upload the source `image` using `multipart/form-data`.\n", - "properties": { - "image_asset_identifier": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "image": { - "description": "The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored.", - "format": "binary", - "type": "string", - "x-tool-description": "Source image (JPEG/PNG/WEBP, max 50MB). Multipart only; used for this request, not stored." - }, - "upscale_factor": { - "default": "x2", - "description": "How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.", - "enum": [ - "x2", - "x4", - "x8" - ], - "type": "string", - "x-tool-description": "String scale (e.g. x2 doubles both dimensions); output max 8192px/side." - }, - "strength": { - "description": "Overall intensity of the enhancement model, from 0.01 to 1. Higher values look crisper but can turn unrealistic. Omit to let the model choose per image.", - "format": "float", - "maximum": 1, - "minimum": 0.01, - "type": "number", - "x-tool-description": "Enhancement intensity (0.01–1). Higher: crisper, less realistic. Omit for model-selected strength." - }, - "sharpen": { - "description": "Edge sharpening applied after enlarging, from 0 to 1. Omit to let the model choose per image.", - "format": "float", - "maximum": 1, - "minimum": 0, - "type": "number" - }, - "denoise": { - "description": "Noise and grain reduction, from 0 to 1. Omit to let the model choose per image.", - "format": "float", - "maximum": 1, - "minimum": 0, - "type": "number" - }, - "fix_compression": { - "description": "Compression artifact removal, from 0 to 1. Omit to let the model choose per image.", - "format": "float", - "maximum": 1, - "minimum": 0, - "type": "number" - }, - "face_enhancement": { - "description": "Recover detail in faces. When true, `face_enhancement_strength` and `face_enhancement_creativity` are required.", - "type": "boolean" - }, - "face_enhancement_strength": { - "description": "How strongly faces are recovered, from 0 to 1.", - "format": "float", - "maximum": 1, - "minimum": 0, - "type": "number" - }, - "face_enhancement_creativity": { - "description": "How freely face recovery may reinterpret features, from 0 (faithful) to 1 (creative).", - "format": "float", - "maximum": 1, - "minimum": 0, - "type": "number" - }, - "subject_detection": { - "description": "Where enhancements apply. Omit to let the model choose per image.", - "enum": [ - "all", - "foreground", - "background" - ], - "type": "string" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - }, - "async": { - "default": false, - "description": "When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.", - "type": "boolean", - "x-tool-description": "Always overridden to true; tools run asynchronously." - }, - "webhook_url": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - }, - "private": { - "description": "When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately.", - "nullable": true, - "type": "boolean", - "x-tool-description": "true keeps the output private; false publishes it. Enterprise output is always private." - }, - "target_collection_id": { - "description": "A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes.", - "type": "string", - "x-tool-description": "Destination collection ID (URL-safe base64); must be writable." - } - }, - "type": "object", - "x-tool-description": "Requires image_asset_identifier (uploaded or generated image)." - }, - "UpscaleImageTopazWonder35Response": { - "description": "Synchronous requests (the default) include the upscaled image in `data`.\nAsync requests omit `data`; poll `GET /v2/generations/{generation_id}`\nwith the returned `generation_id`. `seed` is the seed actually used,\nand `width` and `height` are the output dimensions.\n", - "example": { - "data": [ - { - "seed": 12345, - "resolution": "2048x2048", - "url": "https://openapi-generator.tech", - "is_image_safe": true - }, - { - "seed": 12345, - "resolution": "2048x2048", - "url": "https://openapi-generator.tech", - "is_image_safe": true - } - ], - "seed": 12345, - "generation_id": "generation_id", - "width": 0, - "height": 6 - }, - "properties": { - "generation_id": { - "description": "The generation ID to poll with `GET /v2/generations/{generation_id}`.\n", - "title": "generation_id", - "type": "string" - }, - "data": { - "description": "The upscaled image. Present only for synchronous requests (`async` omitted or false).", - "items": { - "$ref": "#/components/schemas/UpscaleImageObject" - }, - "title": "data", - "type": "array" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - }, - "width": { - "description": "The output width in pixels.", - "title": "width", - "type": "integer" - }, - "height": { - "description": "The output height in pixels.", - "title": "height", - "type": "integer" - } - }, - "required": [ - "generation_id", - "height", - "seed", - "width" - ], - "title": "UpscaleImageTopazWonder35Response", - "type": "object" - }, - "UpscaleImageTopazWonder35Request": { - "description": "Upload the source `image` using `multipart/form-data`.\n", - "properties": { - "image_asset_identifier": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "image": { - "description": "The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored.", - "format": "binary", - "type": "string", - "x-tool-description": "Source image (JPEG/PNG/WEBP, max 50MB). Multipart only; used for this request, not stored." - }, - "upscale_factor": { - "default": "x2", - "description": "How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.", - "enum": [ - "x2", - "x4", - "x8" - ], - "type": "string", - "x-tool-description": "String scale (e.g. x2 doubles both dimensions); output max 8192px/side." - }, - "enhancement_strength": { - "default": "high", - "description": "How strongly the generative model reconstructs detail while upscaling. Lower values stay closer to the source image; higher values produce a more enhanced result.", - "enum": [ - "low", - "medium", - "high" - ], - "type": "string" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - }, - "async": { - "default": false, - "description": "When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.", - "type": "boolean", - "x-tool-description": "Always overridden to true; tools run asynchronously." - }, - "webhook_url": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - }, - "private": { - "description": "When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately.", - "nullable": true, - "type": "boolean", - "x-tool-description": "true keeps the output private; false publishes it. Enterprise output is always private." - }, - "target_collection_id": { - "description": "A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes.", - "type": "string", - "x-tool-description": "Destination collection ID (URL-safe base64); must be writable." - } - }, - "type": "object", - "x-tool-description": "Requires image_asset_identifier (uploaded or generated image)." - }, - "UpscaleImageTopazStandardV2Response": { - "description": "Synchronous requests (the default) include the upscaled image in `data`.\nAsync requests omit `data`; poll `GET /v2/generations/{generation_id}`\nwith the returned `generation_id`. `seed` is the seed actually used,\nand `width` and `height` are the output dimensions.\n", - "example": { - "data": [ - { - "seed": 12345, - "resolution": "2048x2048", - "url": "https://openapi-generator.tech", - "is_image_safe": true - }, - { - "seed": 12345, - "resolution": "2048x2048", - "url": "https://openapi-generator.tech", - "is_image_safe": true - } - ], - "seed": 12345, - "generation_id": "generation_id", - "width": 0, - "height": 6 - }, - "properties": { - "generation_id": { - "description": "The generation ID to poll with `GET /v2/generations/{generation_id}`.\n", - "title": "generation_id", - "type": "string" - }, - "data": { - "description": "The upscaled image. Present only for synchronous requests (`async` omitted or false).", - "items": { - "$ref": "#/components/schemas/UpscaleImageObject" - }, - "title": "data", - "type": "array" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - }, - "width": { - "description": "The output width in pixels.", - "title": "width", - "type": "integer" - }, - "height": { - "description": "The output height in pixels.", - "title": "height", - "type": "integer" - } - }, - "required": [ - "generation_id", - "height", - "seed", - "width" - ], - "title": "UpscaleImageTopazStandardV2Response", - "type": "object" - }, - "UpscaleImageTopazStandardV2Request": { - "description": "Upload the source `image` using `multipart/form-data`.\n", - "properties": { - "image_asset_identifier": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "image": { - "description": "The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored.", - "format": "binary", - "type": "string", - "x-tool-description": "Source image (JPEG/PNG/WEBP, max 50MB). Multipart only; used for this request, not stored." - }, - "upscale_factor": { - "default": "x2", - "description": "How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.", - "enum": [ - "x2", - "x4", - "x8" - ], - "type": "string", - "x-tool-description": "String scale (e.g. x2 doubles both dimensions); output max 8192px/side." - }, - "strength": { - "description": "Overall intensity of the enhancement model, from 0.01 to 1. Higher values look crisper but can turn unrealistic. Omit to let the model choose per image.", - "format": "float", - "maximum": 1, - "minimum": 0.01, - "type": "number", - "x-tool-description": "Enhancement intensity (0.01–1). Higher: crisper, less realistic. Omit for model-selected strength." - }, - "sharpen": { - "description": "Edge sharpening applied after enlarging, from 0 to 1. Omit to let the model choose per image.", - "format": "float", - "maximum": 1, - "minimum": 0, - "type": "number" - }, - "denoise": { - "description": "Noise and grain reduction, from 0 to 1. Omit to let the model choose per image.", - "format": "float", - "maximum": 1, - "minimum": 0, - "type": "number" - }, - "fix_compression": { - "description": "Compression artifact removal, from 0 to 1. Omit to let the model choose per image.", - "format": "float", - "maximum": 1, - "minimum": 0, - "type": "number" - }, - "face_enhancement": { - "description": "Recover detail in faces. When true, `face_enhancement_strength` and `face_enhancement_creativity` are required.", - "type": "boolean" - }, - "face_enhancement_strength": { - "description": "How strongly faces are recovered, from 0 to 1.", - "format": "float", - "maximum": 1, - "minimum": 0, - "type": "number" - }, - "face_enhancement_creativity": { - "description": "How freely face recovery may reinterpret features, from 0 (faithful) to 1 (creative).", - "format": "float", - "maximum": 1, - "minimum": 0, - "type": "number" - }, - "subject_detection": { - "description": "Where enhancements apply. Omit to let the model choose per image.", - "enum": [ - "all", - "foreground", - "background" - ], - "type": "string" - }, - "async": { - "default": false, - "description": "When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.", - "type": "boolean", - "x-tool-description": "Always overridden to true; tools run asynchronously." - }, - "webhook_url": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - }, - "private": { - "description": "When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately.", - "nullable": true, - "type": "boolean", - "x-tool-description": "true keeps the output private; false publishes it. Enterprise output is always private." - }, - "target_collection_id": { - "description": "A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes.", - "type": "string", - "x-tool-description": "Destination collection ID (URL-safe base64); must be writable." - } - }, - "type": "object", - "x-tool-description": "Requires image_asset_identifier (uploaded or generated image)." - }, - "UpscaleImageTopazBloom2Response": { - "description": "Synchronous requests (the default) include the upscaled image in `data`.\nAsync requests omit `data`; poll `GET /v2/generations/{generation_id}`\nwith the returned `generation_id`. `seed` is the seed actually used,\nand `width` and `height` are the output dimensions.\n", - "example": { - "data": [ - { - "seed": 12345, - "resolution": "2048x2048", - "url": "https://openapi-generator.tech", - "is_image_safe": true - }, - { - "seed": 12345, - "resolution": "2048x2048", - "url": "https://openapi-generator.tech", - "is_image_safe": true - } - ], - "seed": 12345, - "generation_id": "generation_id", - "width": 0, - "height": 6 - }, - "properties": { - "generation_id": { - "description": "The generation ID to poll with `GET /v2/generations/{generation_id}`.\n", - "title": "generation_id", - "type": "string" - }, - "data": { - "description": "The upscaled image. Present only for synchronous requests (`async` omitted or false).", - "items": { - "$ref": "#/components/schemas/UpscaleImageObject" - }, - "title": "data", - "type": "array" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - }, - "width": { - "description": "The output width in pixels.", - "title": "width", - "type": "integer" - }, - "height": { - "description": "The output height in pixels.", - "title": "height", - "type": "integer" - } - }, - "required": [ - "generation_id", - "height", - "seed", - "width" - ], - "title": "UpscaleImageTopazBloom2Response", - "type": "object" - }, - "UpscaleImageTopazBloom2Request": { - "description": "Upload the source `image` using `multipart/form-data`.\n", - "properties": { - "image_asset_identifier": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "image": { - "description": "The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored.", - "format": "binary", - "type": "string", - "x-tool-description": "Source image (JPEG/PNG/WEBP, max 50MB). Multipart only; used for this request, not stored." - }, - "upscale_factor": { - "default": "x2", - "description": "How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.", - "enum": [ - "x2", - "x4", - "x8" - ], - "type": "string", - "x-tool-description": "String scale (e.g. x2 doubles both dimensions); output max 8192px/side." - }, - "prompt": { - "default": "", - "description": "An optional prompt guiding the detail the model regenerates while enlarging the image. Leave empty to enhance the source image as-is.", - "maxLength": 1024, - "type": "string" - }, - "creativity": { - "default": 3, - "description": "How strongly the model reinterprets the source while enlarging it, from 1 (most faithful) to 9 (most creative).", - "maximum": 9, - "minimum": 1, - "type": "integer" - }, - "color_preservation": { - "default": true, - "description": "When true (the default), the output keeps the source image's colors. Set to false to let the model adjust colors while enhancing.", - "type": "boolean" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - }, - "async": { - "default": false, - "description": "When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.", - "type": "boolean", - "x-tool-description": "Always overridden to true; tools run asynchronously." - }, - "webhook_url": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - }, - "private": { - "description": "When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately.", - "nullable": true, - "type": "boolean", - "x-tool-description": "true keeps the output private; false publishes it. Enterprise output is always private." - }, - "target_collection_id": { - "description": "A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes.", - "type": "string", - "x-tool-description": "Destination collection ID (URL-safe base64); must be writable." - } - }, - "type": "object", - "x-tool-description": "Requires image_asset_identifier (uploaded or generated image)." - }, - "UpscaleImageTopazRedefineResponse": { - "description": "Synchronous requests (the default) include the upscaled image in `data`.\nAsync requests omit `data`; poll `GET /v2/generations/{generation_id}`\nwith the returned `generation_id`. `seed` is the seed actually used,\nand `width` and `height` are the output dimensions.\n", - "example": { - "data": [ - { - "seed": 12345, - "resolution": "2048x2048", - "url": "https://openapi-generator.tech", - "is_image_safe": true - }, - { - "seed": 12345, - "resolution": "2048x2048", - "url": "https://openapi-generator.tech", - "is_image_safe": true - } - ], - "seed": 12345, - "generation_id": "generation_id", - "width": 0, - "height": 6 - }, - "properties": { - "generation_id": { - "description": "The generation ID to poll with `GET /v2/generations/{generation_id}`.\n", - "title": "generation_id", - "type": "string" - }, - "data": { - "description": "The upscaled image. Present only for synchronous requests (`async` omitted or false).", - "items": { - "$ref": "#/components/schemas/UpscaleImageObject" - }, - "title": "data", - "type": "array" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - }, - "width": { - "description": "The output width in pixels.", - "title": "width", - "type": "integer" - }, - "height": { - "description": "The output height in pixels.", - "title": "height", - "type": "integer" - } - }, - "required": [ - "generation_id", - "height", - "seed", - "width" - ], - "title": "UpscaleImageTopazRedefineResponse", - "type": "object" - }, - "UpscaleImageTopazRedefineRequest": { - "description": "Upload the source `image` using `multipart/form-data`.\n", - "properties": { - "image_asset_identifier": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "image": { - "description": "The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored.", - "format": "binary", - "type": "string", - "x-tool-description": "Source image (JPEG/PNG/WEBP, max 50MB). Multipart only; used for this request, not stored." - }, - "upscale_factor": { - "default": "x2", - "description": "How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.", - "enum": [ - "x2", - "x4", - "x8" - ], - "type": "string", - "x-tool-description": "String scale (e.g. x2 doubles both dimensions); output max 8192px/side." - }, - "prompt": { - "default": "", - "description": "An optional prompt guiding the detail the model regenerates while enlarging the image. Leave empty to enhance the source image as-is.", - "maxLength": 1024, - "type": "string" - }, - "creativity": { - "default": 3, - "description": "How strongly the model reinterprets the source while enlarging it, from 1 (most faithful) to 9 (most creative).", - "maximum": 9, - "minimum": 1, - "type": "integer" - }, - "autoprompt": { - "default": false, - "description": "When true, the model describes the image itself and any `prompt` is ignored.", - "type": "boolean" - }, - "texture": { - "default": 1, - "description": "How much fine texture the model adds, from 1 to 5. Keep it low at low creativity.", - "maximum": 5, - "minimum": 1, - "type": "integer" - }, - "detail": { - "default": false, - "description": "Apply a detail adjustment after rendering. When true, `detail_strength` sets how much.", - "type": "boolean" - }, - "detail_strength": { - "description": "Detail adjustment intensity, from 0 to 10.", - "format": "float", - "maximum": 10, - "minimum": 0, - "type": "number" - }, - "sharpen": { - "description": "Edge sharpening applied after enlarging, from 0 to 1. Omit to let the model choose per image.", - "format": "float", - "maximum": 1, - "minimum": 0, - "type": "number" - }, - "denoise": { - "description": "Noise and grain reduction, from 0 to 1. Omit to let the model choose per image.", - "format": "float", - "maximum": 1, - "minimum": 0, - "type": "number" - }, - "face_enhancement": { - "description": "Recover detail in faces. When true, `face_enhancement_strength` and `face_enhancement_creativity` are required.", - "type": "boolean" - }, - "face_enhancement_strength": { - "description": "How strongly faces are recovered, from 0 to 1.", - "format": "float", - "maximum": 1, - "minimum": 0, - "type": "number" - }, - "face_enhancement_creativity": { - "description": "How freely face recovery may reinterpret features, from 0 (faithful) to 1 (creative).", - "format": "float", - "maximum": 1, - "minimum": 0, - "type": "number" - }, - "subject_detection": { - "description": "Where enhancements apply. Omit to let the model choose per image.", - "enum": [ - "all", - "foreground", - "background" - ], - "type": "string" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - }, - "async": { - "default": false, - "description": "When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.", - "type": "boolean", - "x-tool-description": "Always overridden to true; tools run asynchronously." - }, - "webhook_url": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - }, - "private": { - "description": "When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately.", - "nullable": true, - "type": "boolean", - "x-tool-description": "true keeps the output private; false publishes it. Enterprise output is always private." - }, - "target_collection_id": { - "description": "A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes.", - "type": "string", - "x-tool-description": "Destination collection ID (URL-safe base64); must be writable." - } - }, - "type": "object" - }, - "UpscaleImageNanoBananaProResponse": { - "description": "Synchronous requests (the default) include the upscaled image in `data`.\nAsync requests omit `data`; poll `GET /v2/generations/{generation_id}`\nwith the returned `generation_id`. `seed` is the seed actually used,\nand `width` and `height` are the output dimensions.\n", - "example": { - "data": [ - { - "seed": 12345, - "resolution": "2048x2048", - "url": "https://openapi-generator.tech", - "is_image_safe": true - }, - { - "seed": 12345, - "resolution": "2048x2048", - "url": "https://openapi-generator.tech", - "is_image_safe": true - } - ], - "seed": 12345, - "generation_id": "generation_id", - "width": 0, - "height": 6 - }, - "properties": { - "generation_id": { - "description": "The generation ID to poll with `GET /v2/generations/{generation_id}`.\n", - "title": "generation_id", - "type": "string" - }, - "data": { - "description": "The upscaled image. Present only for synchronous requests (`async` omitted or false).", - "items": { - "$ref": "#/components/schemas/UpscaleImageObject" - }, - "title": "data", - "type": "array" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - }, - "width": { - "description": "The output width in pixels.", - "title": "width", - "type": "integer" - }, - "height": { - "description": "The output height in pixels.", - "title": "height", - "type": "integer" - } - }, - "required": [ - "generation_id", - "height", - "seed", - "width" - ], - "title": "UpscaleImageNanoBananaProResponse", - "type": "object" - }, - "UpscaleImageNanoBananaProRequest": { - "description": "Upload the source `image` using `multipart/form-data`.\n", - "properties": { - "image_asset_identifier": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "image": { - "description": "The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored.", - "format": "binary", - "type": "string", - "x-tool-description": "Source image (JPEG/PNG/WEBP, max 50MB). Multipart only; used for this request, not stored." - }, - "prompt": { - "description": "Optional short guidance for the enhancement, appended to the model's upscaling instruction. When omitted, the image is upscaled as-is.", - "maxLength": 2000, - "type": "string" - }, - "resolution_tier": { - "default": "2K", - "description": "The output resolution tier. The model sizes its output by tier at the source image's aspect ratio; exact pixel dimensions cannot be requested. Rejected when the source is already at or above the requested tier. Defaults to \"2K\".", - "enum": [ - "1K", - "2K", - "4K" - ], - "type": "string" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - }, - "async": { - "default": false, - "description": "When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.", - "type": "boolean", - "x-tool-description": "Always overridden to true; tools run asynchronously." - }, - "webhook_url": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - }, - "private": { - "description": "When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately.", - "nullable": true, - "type": "boolean", - "x-tool-description": "true keeps the output private; false publishes it. Enterprise output is always private." - }, - "target_collection_id": { - "description": "A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes.", - "type": "string", - "x-tool-description": "Destination collection ID (URL-safe base64); must be writable." - } - }, - "type": "object", - "x-tool-description": "Requires image_asset_identifier (uploaded or generated image)." - }, - "LookbookResponse": { - "description": "Acknowledgement that the Lookbook workflow was accepted. Poll\n`GET /v2/generations/{generation_id}` for status and results.\n", - "example": { - "generation_id": "generation_id" - }, - "properties": { - "generation_id": { - "description": "URL-safe base64 ID accepted by the generation polling endpoint.", - "title": "generation_id", - "type": "string" - } - }, - "required": [ - "generation_id" - ], - "title": "LookbookResponse", - "type": "object" - }, - "LookbookRequest": { - "example": { - "aspect_ratio": "aspect_ratio", - "private": true, - "webhook_url": "https://api.example.com/webhooks/ideogram", - "category": "dresses", - "num_shoots": 1, - "product_asset_identifiers": [ - { - "asset_type": "RESPONSE", - "asset_id": "7uS_VESkRI6O3-sVgHQp_A" - }, - { - "asset_type": "RESPONSE", - "asset_id": "7uS_VESkRI6O3-sVgHQp_A" - }, - { - "asset_type": "RESPONSE", - "asset_id": "7uS_VESkRI6O3-sVgHQp_A" - }, - { - "asset_type": "RESPONSE", - "asset_id": "7uS_VESkRI6O3-sVgHQp_A" - }, - { - "asset_type": "RESPONSE", - "asset_id": "7uS_VESkRI6O3-sVgHQp_A" - } - ] - }, - "properties": { - "product_asset_identifiers": { - "description": "Product images whose appearance must be preserved in the generated looks.", - "items": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "maxItems": 7, - "minItems": 1, - "title": "product_asset_identifiers", - "type": "array" - }, - "category": { - "description": "Selects the category-specific Lookbook presentation reference.", - "enum": [ - "dresses", - "jeans", - "pants", - "tops" - ], - "title": "category", - "type": "string" - }, - "aspect_ratio": { - "description": "The aspect ratio of each generated 2x2 composite before it is split into images. Defaults to `1:1` when omitted. Supported values are `1:1`, `3:4`, and `9:16`.", - "pattern": "^(1:1|3:4|9:16)$", - "title": "aspect_ratio", - "type": "string" - }, - "num_shoots": { - "default": 3, - "description": "Number of four-image lookbook shoots to create.", - "maximum": 4, - "minimum": 1, - "title": "num_shoots", - "type": "integer" - }, - "private": { - "description": "When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately.", - "title": "private", - "type": "boolean" - }, - "webhook_url": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - } - }, - "required": [ - "category", - "product_asset_identifiers" - ], - "title": "LookbookRequest", - "type": "object" - }, - "ModelPoseVariantsResponse": { - "description": "Acknowledgement that pose-variant generation was accepted. Poll\n`GET /v2/generations/{generation_id}` for status and results.\n", - "example": { - "generation_id": "generation_id" - }, - "properties": { - "generation_id": { - "description": "URL-safe base64 ID accepted by the generation polling endpoint.", - "title": "generation_id", - "type": "string" - } - }, - "required": [ - "generation_id" - ], - "title": "ModelPoseVariantsResponse", - "type": "object" - }, - "ModelPoseVariantsRequest": { - "description": "The edit is full-frame; scene preservation is best effort.\n", - "properties": { - "source_asset_identifier": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "source_image": { - "description": "Fashion image to edit (max size 50MB). JPEG, PNG, WEBP, HEIF,\nAVIF, GIF, BMP, TIFF, and MPO formats are supported. Multipart\nrequests only.\n", - "format": "binary", - "type": "string" - }, - "pose_reference_asset_identifier": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "instruction": { - "description": "Plain-language pose or camera direction, such as a front-facing\ncatalog stance or right-facing walking profile.\n", - "maxLength": 4000, - "minLength": 1, - "type": "string" - }, - "aspect_ratio": { - "description": "Output aspect ratio. When omitted, the nearest supported ratio is\nderived from the source image. Supported values are `1:1`, `3:4`,\n`4:3`, `16:9`, and `9:16`.\n", - "pattern": "^(1:1|3:4|4:3|16:9|9:16)$", - "type": "string" - }, - "quality": { - "$ref": "#/components/schemas/ModelPoseVariantsQuality" - }, - "seed": { - "description": "Optional seed for repeatable results.", - "maximum": 2147483647, - "minimum": 0, - "type": "integer" - }, - "num_images": { - "default": 1, - "description": "Number of pose variants to create.", - "maximum": 8, - "minimum": 1, - "type": "integer" - }, - "private": { - "description": "When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately.", - "type": "boolean" - }, - "webhook_url": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - } - }, - "required": [ - "instruction" - ], - "type": "object" - }, - "ModelPoseVariantsQuality": { - "description": "The quality tier for the edit. Higher tiers may improve detail and\ntake longer to complete.\n", - "enum": [ - "low", - "medium", - "high" - ], - "title": "ModelPoseVariantsQuality", - "type": "string" - }, - "PackshotsResponse": { - "description": "Acknowledgement that the packshots workflow was accepted. Poll\n`GET /v2/generations/{generation_id}` for status and results.\n", - "example": { - "generation_id": "generation_id" - }, - "properties": { - "generation_id": { - "description": "URL-safe base64 ID accepted by the generation polling endpoint.", - "title": "generation_id", - "type": "string" - } - }, - "required": [ - "generation_id" - ], - "title": "PackshotsResponse", - "type": "object" - }, - "PackshotsRequest": { - "example": { - "product_asset_identifiers": [ - { - "asset_type": "RESPONSE", - "asset_id": "7uS_VESkRI6O3-sVgHQp_A" - } - ], - "view": "front" - }, - "properties": { - "product_asset_identifiers": { - "description": "Ordered uploaded or generated product images. Their product color,\nconstruction, materials, logos, proportions, and distinguishing\ndetails guide every output.\n", - "items": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "maxItems": 15, - "minItems": 1, - "type": "array" - }, - "style_reference_asset_identifier": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "view": { - "$ref": "#/components/schemas/PackshotView" - }, - "instruction": { - "description": "Optional art direction for the studio background, lighting,\nframing, and presentation. Product fidelity rules always take\nprecedence.\n", - "maxLength": 2000, - "type": "string" - }, - "aspect_ratio": { - "description": "Aspect ratio for every generated image. Supported values are\n`1:1`, `3:4`, `4:3`, `16:9`, and `9:16`.\n", - "pattern": "^(1:1|3:4|4:3|16:9|9:16)$", - "type": "string" - }, - "quality": { - "$ref": "#/components/schemas/PackshotsQuality" - }, - "private": { - "description": "When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately.", - "type": "boolean" - }, - "webhook_url": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - } - }, - "required": [ - "product_asset_identifiers", - "view" - ], - "title": "PackshotsRequest", - "type": "object" - }, - "PackshotView": { - "description": "Product view to generate.", - "enum": [ - "detail", - "three_quarter", - "front", - "back" - ], - "title": "PackshotView", - "type": "string" - }, - "PackshotsQuality": { - "description": "The quality tier for the edit. Higher tiers may improve detail and\ntake longer to complete.\n", - "enum": [ - "low", - "medium", - "high" - ], - "title": "PackshotsQuality", - "type": "string" - }, - "GhostMannequinResponse": { - "description": "Acknowledgement that the ghost-mannequin request was accepted. Poll\n`GET /v2/generations/{generation_id}` for status and results.\n", - "example": { - "generation_id": "generation_id" - }, - "properties": { - "generation_id": { - "description": "URL-safe base64 ID accepted by the generation polling endpoint.", - "title": "generation_id", - "type": "string" - } - }, - "required": [ - "generation_id" - ], - "title": "GhostMannequinResponse", - "type": "object" - }, - "GhostMannequinRequest": { - "description": "Supply at least one garment image. Every image must show the same\nprimary garment. At most 15 garment images are accepted, plus one optional\noutput reference for presentation only. All uploads combined must not\nexceed 100 MB.\n", - "properties": { - "garment_asset_identifiers": { - "description": "Ordered uploaded or generated images of the same garment. Use\nmultiple angles when available so obscured construction can be\nreconstructed conservatively. Mutually exclusive with\n`garment_images`.\n", - "items": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "maxItems": 15, - "minItems": 1, - "type": "array" - }, - "garment_images": { - "description": "Additional photos of the same garment, up to 50 MB each. JPEG,\nPNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and MPO are supported.\nMultipart requests only.\n", - "items": { - "format": "binary", - "type": "string" - }, - "maxItems": 15, - "minItems": 1, - "type": "array" - }, - "front_asset_identifier": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "front_image": { - "description": "Optional front-view garment photo, up to 50 MB. Multipart requests\nonly.\n", - "format": "binary", - "type": "string" - }, - "back_asset_identifier": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "back_image": { - "description": "Optional back-view garment photo, up to 50 MB. Multipart requests\nonly.\n", - "format": "binary", - "type": "string" - }, - "left_asset_identifier": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "left_image": { - "description": "Optional left-view garment photo, up to 50 MB. Multipart requests\nonly.\n", - "format": "binary", - "type": "string" - }, - "right_asset_identifier": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "right_image": { - "description": "Optional right-view garment photo, up to 50 MB. Multipart requests\nonly.\n", - "format": "binary", - "type": "string" - }, - "top_asset_identifier": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "top_image": { - "description": "Optional top-view garment photo, up to 50 MB. Multipart requests\nonly.\n", - "format": "binary", - "type": "string" - }, - "bottom_asset_identifier": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "bottom_image": { - "description": "Optional bottom-view garment photo, up to 50 MB. Multipart\nrequests only.\n", - "format": "binary", - "type": "string" - }, - "output_reference_asset_identifier": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "output_reference_image": { - "description": "Optional presentation example, up to 50 MB. Multipart requests only.\nGuides pose, framing, and lighting without copying its garment,\ncolors, text, or branding. Garment photos remain authoritative for\nproduct identity; view and aspect_ratio take precedence, and the\nbackground remains white. Does not replace a required garment photo.\nMutually exclusive with `output_reference_asset_identifier`.\n", - "format": "binary", - "type": "string" - }, - "view": { - "description": "Camera view for the output garment.", - "enum": [ - "front", - "three_quarter", - "back" - ], - "type": "string" - }, - "instruction": { - "description": "Optional reconstruction guidance or identity-critical garment\ndetails to check against the photos. The output always uses a clean\nwhite studio background.\n", - "maxLength": 2000, - "type": "string" - }, - "metadata": { - "description": "Optional JSON object serialized as a string containing factual\nproduct context, such as title, brand, category, color, material,\nitem code, and exact printed text. Metadata helps disambiguate the\ngarment photos but does not add features they do not show.\n", - "maxLength": 8000, - "type": "string" - }, - "aspect_ratio": { - "description": "Output aspect ratio. Defaults to `1:1` when omitted. Supported\nvalues are `1:1`, `3:4`, `4:3`, `16:9`, and `9:16`.\n", - "pattern": "^(1:1|3:4|4:3|16:9|9:16)$", - "type": "string" - }, - "quality": { - "$ref": "#/components/schemas/GhostMannequinQuality" - }, - "seed": { - "description": "Optional seed for repeatable results.", - "maximum": 2147483647, - "minimum": 0, - "type": "integer" - }, - "target_collection_id": { - "description": "A collection you can write to, by its URL-safe base64 collection id. Completed outputs are added to it automatically.", - "type": "string" - }, - "private": { - "description": "When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately.", - "type": "boolean" - }, - "webhook_url": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - } - }, - "required": [ - "view" - ], - "type": "object" - }, - "GhostMannequinQuality": { - "description": "The quality tier for the edit. Higher tiers may improve detail and\ntake longer to complete.\n", - "enum": [ - "low", - "medium", - "high" - ], - "title": "GhostMannequinQuality", - "type": "string" - }, - "Product360VideoRequest": { - "example": { - "duration": 5, - "target_collection_id": "target_collection_id", - "image_asset_identifier": { - "asset_type": "RESPONSE", - "asset_id": "7uS_VESkRI6O3-sVgHQp_A" - }, - "product_description": "product_description", - "resolution": null, - "direction": null - }, - "properties": { - "image_asset_identifier": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "direction": { - "$ref": "#/components/schemas/Product360VideoDirection" - }, - "product_description": { - "description": "Optional factual description of the product in the source image.", - "maxLength": 200, - "title": "product_description", - "type": "string" - }, - "resolution": { - "$ref": "#/components/schemas/SeedDance25Resolution" - }, - "duration": { - "description": "The length of the generated video in seconds. When omitted, the model\npicks the best duration for the prompt (\"auto\").\n", - "example": 5, - "maximum": 30, - "minimum": 4, - "title": "duration", - "type": "integer", - "x-tool-description": "Seconds; omit to let the model choose." - }, - "target_collection_id": { - "description": "A collection you can write to, by its URL-safe base64 collection id. The output video is added to it when the request completes.", - "title": "target_collection_id", - "type": "string", - "x-tool-description": "Destination collection ID (URL-safe base64); must be writable." - } - }, - "required": [ - "direction", - "image_asset_identifier" - ], - "title": "Product360VideoRequest", - "type": "object", - "x-tool-description": "image_asset_identifier is the product image to spin; it works best on one product on a plain background." - }, - "Product360VideoDirection": { - "description": "Direction the product rotates around its vertical axis.", - "enum": [ - "clockwise", - "counter-clockwise" - ], - "title": "Product360VideoDirection", - "type": "string" - }, - "LivingImageResponse": { - "description": "Acknowledgement that the living image was accepted. Video generation always runs asynchronously, so the video is never part of this response: poll for it with `GET /v1/generations/{generation_id}` using the returned `generation_id`.", - "example": { - "generation_id": "generation_id", - "created": "2000-01-23T04:56:07+00:00" - }, - "properties": { - "generation_id": { - "description": "URL-safe base64 ID of the accepted generation. Accepted by the\n`GET /v1/generations/{generation_id}` polling endpoint.\n", - "title": "generation_id", - "type": "string" - }, - "created": { - "description": "The time the request was accepted.", - "format": "date-time", - "title": "created", - "type": "string" - } - }, - "required": [ - "created", - "generation_id" - ], - "title": "LivingImageResponse", - "type": "object" - }, - "LivingImageRequest": { - "example": { - "duration": 8, - "target_collection_id": "target_collection_id", - "image_asset_identifier": { - "asset_type": "RESPONSE", - "asset_id": "7uS_VESkRI6O3-sVgHQp_A" - }, - "quality": null - }, - "properties": { - "image_asset_identifier": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "quality": { - "$ref": "#/components/schemas/LivingImageQuality" - }, - "duration": { - "default": 8, - "description": "The length of the generated video in seconds.", - "example": 8, - "maximum": 15, - "minimum": 5, - "title": "duration", - "type": "integer" - }, - "target_collection_id": { - "description": "A collection you can write to, by its URL-safe base64 collection id. The output video is added to it when the request completes.", - "title": "target_collection_id", - "type": "string" - } - }, - "required": [ - "image_asset_identifier" - ], - "title": "LivingImageRequest", - "type": "object" - }, - "LivingImageQuality": { - "default": "standard", - "description": "The output resolution tier. `standard` renders at 768P; `high` renders at 2K. Higher tiers cost more.", - "enum": [ - "standard", - "high" - ], - "title": "LivingImageQuality", - "type": "string" - }, - "LivingImageDurationSeconds": { - "default": 8, - "description": "The length of the generated video in seconds.", - "example": 8, - "maximum": 15, - "minimum": 5, - "title": "duration", - "type": "integer" - }, - "PreciseMaskedEditResponse": { - "description": "Acknowledgement that the workflow was accepted.", - "example": { - "generation_id": "generation_id" - }, - "properties": { - "generation_id": { - "description": "URL-safe base64 ID accepted by the generation polling endpoint.", - "title": "generation_id", - "type": "string" - } - }, - "required": [ - "generation_id" - ], - "title": "PreciseMaskedEditResponse", - "type": "object" - }, - "PreciseMaskedEditRequest": { - "description": "Exactly one source is normally supplied. Use `source_asset_identifier` for an existing asset or multipart `source_image` bytes. When both are present, `source_asset_identifier` takes precedence.", - "properties": { - "model": { - "allOf": [ - { - "$ref": "#/components/schemas/PreciseMaskedEditModel" - } - ], - "description": "The model used to apply the masked edit." - }, - "quality": { - "allOf": [ - { - "$ref": "#/components/schemas/PreciseMaskedEditQuality" - } - ], - "default": "high", - "description": "The generation quality level. Defaults to `high`." - }, - "source_asset_identifier": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "source_image": { - "description": "Raw source image bytes. Supported formats and the 50 MB limit match the image upload API. Available only with `multipart/form-data`.", - "format": "binary", - "type": "string" - }, - "mask_asset_identifier": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "reference_asset_identifiers": { - "description": "Optional assets that show the desired appearance of the edit. GPT Image 2 accepts up to 15. Ideogram 4.5 accepts up to 4 without a mask, or 3 when a mask is supplied.", - "items": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "maxItems": 15, - "type": "array" - }, - "instruction": { - "description": "Plain-language description of the desired change.", - "maxLength": 4000, - "minLength": 1, - "type": "string" - }, - "seed": { - "description": "Optional seed for repeatable results.", - "maximum": 2147483647, - "minimum": 0, - "type": "integer" - }, - "num_images": { - "default": 1, - "description": "Number of edited images to create.", - "maximum": 8, - "minimum": 1, - "type": "integer" - }, - "target_collection_id": { - "description": "A collection you can write to, by its URL-safe base64 collection id. Completed outputs are added to it automatically.", - "type": "string" - }, - "private": { - "description": "When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately.", - "type": "boolean" - }, - "preserve_unmasked_pixels": { - "default": false, - "description": "When true, decoded pixels outside the mask are copied from the\nsource image into the final result. Requires `mask_asset_identifier`.\nWhen false, the final result is the model's full edited image.\n", - "type": "boolean" - }, - "webhook_url": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - } - }, - "required": [ - "instruction" - ], - "type": "object" - }, - "PreciseMaskedEditModel": { - "default": "gpt-image-2", - "description": "The model used to apply the edit. For Ideogram 4.5, an optional mask is sent as one of the model's five image inputs and therefore reduces the reference-image limit by one.", - "enum": [ - "gpt-image-2", - "ideogram-4-5" - ], - "title": "PreciseMaskedEditModel", - "type": "string" - }, - "PreciseMaskedEditQuality": { - "description": "The quality tier for the edit. Higher tiers may improve detail and\ntake longer to complete.\n", - "enum": [ - "low", - "medium", - "high" - ], - "title": "PreciseMaskedEditQuality", - "type": "string" - }, - "VirtualTryOnResponse": { - "description": "Acknowledgement that the try-on was accepted. Poll\n`GET /v2/generations/{generation_id}` for status and results.\n", - "example": { - "generation_id": "generation_id" - }, - "properties": { - "generation_id": { - "description": "URL-safe base64 ID accepted by the generation polling endpoint.", - "title": "generation_id", - "type": "string" - } - }, - "required": [ - "generation_id" - ], - "title": "VirtualTryOnResponse", - "type": "object" - }, - "VirtualTryOnRequest": { - "description": "Supply the person as either an `AssetIdentifier` reference or\n(multipart requests only) raw image bytes, and the garments likewise;\nfor each source provide exactly one of the two forms. Supplying both\nforms of a source, or neither, is rejected with a 400.\n", - "properties": { - "person_asset_identifier": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "person_image": { - "description": "Photo of the person to dress (max size 25MB), as raw bytes; only\nJPEG, PNG, and WEBP formats are supported. Multipart requests only.\nProvide exactly one of `person_asset_identifier` or `person_image`.\n", - "format": "binary", - "type": "string" - }, - "garment_asset_identifiers": { - "description": "Photos of the clothing items to put on the person, by reference.\nMultiple garments are layered into one coherent outfit. Provide\nexactly one of `garment_asset_identifiers` or `garment_images`.\n", - "items": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "maxItems": 7, - "minItems": 1, - "type": "array" - }, - "garment_images": { - "description": "Photos of the clothing items to put on the person (max 7, max size\n25MB per image), as raw bytes; only JPEG, PNG, and WEBP formats are\nsupported. Multipart requests only. Provide exactly one of\n`garment_asset_identifiers` or `garment_images`.\n", - "items": { - "format": "binary", - "type": "string" - }, - "maxItems": 7, - "type": "array" - }, - "aspect_ratio": { - "description": "The aspect ratio of the generated image. Defaults to the aspect\nratio of the person's photo when omitted. Supported values are\n`1:1`, `3:4`, `4:3`, `16:9`, and `9:16`.\n", - "pattern": "^(1:1|3:4|4:3|16:9|9:16)$", - "type": "string" - }, - "instruction": { - "description": "Free-text art direction, for example which garments to name, how to\npose the person, and what background to place them in. The person's\nidentity and each garment's exact appearance are always preserved,\nwhatever this says. When omitted, the person keeps the pose and\nbackground from their photo.\n", - "maxLength": 2000, - "type": "string" - }, - "private": { - "description": "When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately.", - "type": "boolean" - }, - "webhook_url": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - } - }, - "type": "object" - }, - "ColorwaysResponse": { - "description": "Acknowledgement that the colorway was accepted. Poll\n`GET /v2/generations/{generation_id}` for status and results.\n", - "example": { - "generation_id": "generation_id" - }, - "properties": { - "generation_id": { - "description": "URL-safe base64 ID accepted by the generation polling endpoint.", - "title": "generation_id", - "type": "string" - } - }, - "required": [ - "generation_id" - ], - "title": "ColorwaysResponse", - "type": "object" - }, - "ColorwaysRequest": { - "description": "Upload the product photo as `image` and up to 4 `masks`, with one\nentry in `colors` per mask. For a single region, send one mask and one\ncolor.\n", - "properties": { - "image_asset_identifier": { - "allOf": [ - { - "$ref": "#/components/schemas/AssetIdentifier" - } - ], - "description": "The product photo to recolor, by reference. Everything outside\nthe masked region is preserved. Provide exactly one of\n`image_asset_identifier` or `image`.\n" - }, - "image": { - "description": "The product photo to recolor (max size 25MB). JPEG, PNG, and WEBP\nformats are supported.\n", - "format": "binary", - "type": "string" - }, - "mask_asset_identifiers": { - "description": "The masks marking the regions of the product photo to recolor, by\nreference, paired by position with `colors` (max 4). Every mask\nmust have the same pixel dimensions as the product photo. White\npixels mark the region to recolor; black pixels are preserved.\nAlpha-only masks are also supported: opaque pixels mark the\nregion to recolor and transparent pixels are preserved. Provide\nexactly one of `mask_asset_identifiers` or `masks`.\n", - "items": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "maxItems": 4, - "minItems": 1, - "type": "array" - }, - "masks": { - "description": "Masks marking the regions to recolor (max 4, max size 25MB each),\npaired by position with `colors`. JPEG, PNG, and WEBP formats are\nsupported. Every mask must have the same pixel dimensions as the\nproduct photo. White pixels mark the region to recolor and black\npixels are preserved; alpha-only masks also work (opaque =\nrecolor, transparent = preserve).\n", - "items": { - "format": "binary", - "type": "string" - }, - "maxItems": 4, - "minItems": 1, - "type": "array" - }, - "colors": { - "description": "One target color per mask in `masks`, as six-digit hex codes like\n`#B3202C`, paired by position. The product's shape, construction,\nmaterials, prints, and logos are always preserved.\n", - "items": { - "pattern": "^#[0-9a-fA-F]{6}$", - "type": "string" - }, - "maxItems": 4, - "minItems": 1, - "type": "array" - }, - "aspect_ratio": { - "description": "Output aspect ratio. Defaults to the product photo's aspect ratio,\nwhich keeps the original framing. A different ratio extends the\nscene to fill the new shape rather than cropping, so part of the\nframe is newly generated. Supported values are `1:1`, `3:4`,\n`4:3`, `16:9`, and `9:16`.\n", - "pattern": "^(1:1|3:4|4:3|16:9|9:16)$", - "type": "string" - }, - "quality": { - "$ref": "#/components/schemas/ColorwaysQuality" - }, - "target_collection_id": { - "description": "A collection you can write to, by its URL-safe base64 collection id. Completed outputs are added to it automatically.", - "type": "string" - }, - "private": { - "description": "When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately.", - "type": "boolean" - }, - "webhook_url": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - } - }, - "required": [ - "colors" - ], - "type": "object", - "x-tool-description": "The product photo as `image_asset_identifier`, up to 4 masks as `mask_asset_identifiers`, and one entry in `colors` per mask." - }, - "ColorwaysQuality": { - "description": "The quality tier for the edit. Higher tiers may improve detail and\ntake longer to complete.\n", - "enum": [ - "low", - "medium", - "high" - ], - "title": "ColorwaysQuality", - "type": "string" - }, - "AdLocalizerResponse": { - "description": "Acknowledgement that the ad localization was accepted. Poll\n`GET /v2/generations/{generation_id}` for status and results.\n", - "example": { - "generation_id": "generation_id" - }, - "properties": { - "generation_id": { - "description": "URL-safe base64 ID accepted by the generation polling endpoint.", - "title": "generation_id", - "type": "string" - } - }, - "required": [ - "generation_id" - ], - "title": "AdLocalizerResponse", - "type": "object" - }, - "AdLocalizerRequest": { - "description": "Upload the source ad as `image` and choose a target `language`.\n", - "properties": { - "image_asset_identifier": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "image": { - "description": "The source ad to localize (max size 25MB). Its layout, logos, brand\ntype, and product are preserved, and the output keeps its shape, so\nno size or aspect ratio is needed. JPEG, PNG, and WEBP formats are\nsupported. Multipart requests only.\n", - "format": "binary", - "type": "string" - }, - "language": { - "description": "The target language for the copy. Arabic is rendered right-to-left. Each request covers one language; send one request per language.", - "enum": [ - "ar", - "cs", - "da", - "de", - "en", - "es", - "fi", - "fr", - "fr-ca", - "hu", - "it", - "ja", - "nl", - "no", - "pl", - "pt", - "sv" - ], - "type": "string" - }, - "exact_copy": { - "description": "Pre-approved wording, one `original => replacement` mapping per line. Each mapping names the text element showing `original` and sets it to `replacement`, placed character for character rather than translated. Any text element not listed is left as it is in the source. When omitted, all visible marketing copy is translated.", - "maxLength": 4000, - "type": "string" - }, - "prompt": { - "description": "Optional additional direction for the localization, for example \"keep the badge in English\". Anything it explicitly asks to change takes priority over the preservation rules.", - "maxLength": 2000, - "type": "string" - }, - "quality": { - "$ref": "#/components/schemas/AdLocalizerQuality" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - }, - "num_images": { - "default": 1, - "description": "Number of localized variations to create for this language.", - "maximum": 4, - "minimum": 1, - "type": "integer" - }, - "target_collection_id": { - "description": "A collection you can write to, by its URL-safe base64 collection id. Completed outputs are added to it automatically.", - "type": "string" - }, - "private": { - "description": "When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately.", - "type": "boolean" - }, - "webhook_url": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - } - }, - "required": [ - "language" - ], - "type": "object" - }, - "AdLocalizerQuality": { - "description": "The quality tier for the edit. Higher tiers may improve detail and\ntake longer to complete.\n", - "enum": [ - "low", - "medium", - "high" - ], - "title": "AdLocalizerQuality", - "type": "string" - }, - "VectorizerResponse": { - "example": { - "generation_id": "generation_id" - }, - "properties": { - "generation_id": { - "description": "URL-safe base64 generation ID.", - "title": "generation_id", - "type": "string" - } - }, - "required": [ - "generation_id" - ], - "title": "VectorizerResponse", - "type": "object" - }, - "VectorizerRequest": { - "properties": { - "image": { - "description": "JPEG, PNG or WEBP source; at most 50 MB. Multipart only.", - "format": "binary", - "type": "string" - }, - "image_asset_identifier": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "mode": { - "default": "default", - "description": "Default draws fewer, simpler shapes; detailed preserves more fine detail.", - "enum": [ - "default", - "detailed" - ], - "type": "string" - }, - "group": { - "default": false, - "description": "Request grouping of shapes into layers. Grouping is not yet available.", - "type": "boolean" - }, - "private": { - "description": "Outputs are private by default. Enterprise outputs are always private.", - "type": "boolean" - }, - "target_collection_id": { - "description": "URL-safe base64 ID of a writable destination collection.", - "type": "string" - }, - "webhook_url": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - } - }, - "type": "object" - }, - "TextLayerizerResponse": { - "example": { - "generation_id": "generation_id" - }, - "properties": { - "generation_id": { - "description": "URL-safe base64 generation ID.", - "title": "generation_id", - "type": "string" - } - }, - "required": [ - "generation_id" - ], - "title": "TextLayerizerResponse", - "type": "object" - }, - "TextLayerizerRequest": { - "description": "A request to layerize the text in one image. Provide exactly one of\n`image` or `image_asset_identifier`.\n", - "properties": { - "image": { - "description": "JPEG, PNG or WEBP source; at most 50 MB. Multipart only.", - "format": "binary", - "type": "string" - }, - "image_asset_identifier": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "prompt": { - "description": "A description of the image, used to guide text detection. When omitted, detection runs on the image alone.", - "maxLength": 10000, - "nullable": true, - "type": "string" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - }, - "font_candidate_files": { - "description": "Candidate font files to make available for text style matching and to embed in the standalone HTML page. Supported formats .ttf, .otf, .woff, .woff2 (max 5 MB each, at most 5 files). Multipart only. You are responsible for holding the rights to embed and redistribute the fonts you upload.", - "items": { - "format": "binary", - "type": "string" - }, - "maxItems": 5, - "type": "array" - }, - "private": { - "description": "Outputs are private by default. Enterprise outputs are always private.", - "type": "boolean" - }, - "target_collection_id": { - "description": "URL-safe base64 ID of a writable destination collection.", - "type": "string" - }, - "webhook_url": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - } - }, - "type": "object" - }, - "AdResizerResponse": { - "description": "Acknowledgement that the ad resize was accepted. Poll\n`GET /v2/generations/{generation_id}` for status and results.\n", - "example": { - "generation_id": "generation_id" - }, - "properties": { - "generation_id": { - "description": "URL-safe base64 ID accepted by the generation polling endpoint.", - "title": "generation_id", - "type": "string" - } - }, - "required": [ - "generation_id" - ], - "title": "AdResizerResponse", - "type": "object" - }, - "AdResizerRequest": { - "description": "Upload the source creative as `image` and choose a target `resolution`.\n", - "properties": { - "image_asset_identifier": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "image": { - "description": "The source creative to reframe (max size 25MB). JPEG, PNG, and\nWEBP formats are supported. Multipart requests only.\n", - "format": "binary", - "type": "string" - }, - "resolution": { - "description": "Target ad resolution, formatted as `WIDTHxHEIGHT`. Any value not in\nthe list is rejected with a 400. Each output image has exactly these\npixel dimensions, with or without a `platform`.\n", - "enum": [ - "300x250", - "336x280", - "300x600", - "1080x1080", - "1080x1350", - "1080x1920", - "1920x1080", - "728x90", - "160x600", - "970x250", - "320x50", - "300x50", - "320x100", - "1800x900", - "2400x2400", - "1200x3500", - "2880x2880", - "2560x3200", - "3200x2560", - "2448x3264", - "3264x2448", - "2336x3504", - "3504x2336", - "2240x3584", - "3584x2240", - "2160x3840", - "3840x2160", - "1920x3840", - "3840x1920", - "1280x3840", - "3840x1280" - ], - "type": "string" - }, - "platform": { - "description": "The ad platform whose published safe zone the ad must stay inside.\nThe ad is generated inside the largest rectangle that fits the\nplatform's safe zone for the requested aspect ratio, and the space\naround it is filled in so the output is still exactly the requested\n`resolution`. `google` covers YouTube and Google Ads placements.\nUse `meta_stories` or `meta_reels` for Meta placements; Reels uses\nthe largest rectangle inside its notched safe zone. The legacy\n`meta` value is still supported and uses a more conservative safe\nzone. When omitted, the ad fills the whole frame and every\nsupported `resolution` is accepted. Any other value is rejected\nwith a 400.\n\nEach platform accepts only the resolutions for which it publishes a\nsafe zone; any other `resolution` is rejected with a 400:\n\n| Platform | Accepted resolutions |\n| --- | --- |\n| `google` | `1920x1080`, `3840x2160`, `1080x1080`, `2400x2400`, `2880x2880`, `1080x1920`, `2160x3840` |\n| `tiktok` | `1920x1080`, `3840x2160`, `1080x1080`, `2400x2400`, `2880x2880`, `1080x1920`, `2160x3840` |\n| `meta_stories` | `1080x1920`, `2160x3840` |\n| `meta_reels` | `1080x1920`, `2160x3840` |\n| `meta` (legacy) | `1080x1920`, `2160x3840` |\n| `snapchat` | `1080x1920`, `2160x3840` |\n", - "enum": [ - "google", - "meta", - "meta_reels", - "meta_stories", - "snapchat", - "tiktok" - ], - "type": "string" - }, - "prompt": { - "description": "Optional edit instruction to apply while reframing, for example \"remove the logo\" or \"put the price bottom-right\".", - "type": "string" - }, - "quality": { - "$ref": "#/components/schemas/AdResizerQuality" - }, - "num_images": { - "default": 1, - "description": "The number of reframed variations to generate.", - "maximum": 4, - "minimum": 1, - "type": "integer" - }, - "target_collection_id": { - "description": "A collection you can write to, by its URL-safe base64 collection id. Completed outputs are added to it automatically.", - "type": "string" - }, - "private": { - "description": "When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately.", - "type": "boolean" - }, - "webhook_url": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - } - }, - "required": [ - "resolution" - ], - "type": "object", - "x-tool-description": "The source creative as `image_asset_identifier` and the target `resolution`." - }, - "AdResizerQuality": { - "description": "The quality tier for the reframe. Higher tiers may improve detail and\ntake longer to complete.\n", - "enum": [ - "low", - "medium", - "high" - ], - "title": "AdResizerQuality", - "type": "string" - }, - "AdVariationsResponse": { - "description": "Acknowledgement that the ad variation was accepted. Poll\n`GET /v2/generations/{generation_id}` for status and results.\n", - "example": { - "generation_id": "generation_id" - }, - "properties": { - "generation_id": { - "description": "URL-safe base64 ID accepted by the generation polling endpoint.", - "title": "generation_id", - "type": "string" - } - }, - "required": [ - "generation_id" - ], - "title": "AdVariationsResponse", - "type": "object" - }, - "AdVariationsRequest": { - "description": "Upload the source creative as `image` and choose a `variation_type`.\n", - "properties": { - "image_asset_identifier": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "image": { - "description": "The source creative to vary (max size 25MB). JPEG, PNG, and WEBP\nformats are supported. Multipart requests only. Each output keeps\nthe source's aspect ratio, capped at 3:1 between the long and short\nsides.\n", - "format": "binary", - "type": "string" - }, - "variation_type": { - "description": "The axis to vary. `people`\nreplaces the people in the ad with different talent. `setting`\nmoves the same subject and product to a different environment.\n`group_size` changes how many people appear. `scene` shifts the\nmoment or occasion (time of day, season, or activity).\n", - "enum": [ - "people", - "setting", - "group_size", - "scene" - ], - "type": "string" - }, - "prompt": { - "description": "Optional direction to steer the variation, for example \"set it on a beach\" or \"make the models older\". Anything it explicitly asks to change takes priority over the default preservation rules.", - "type": "string" - }, - "quality": { - "$ref": "#/components/schemas/AdVariationsQuality" - }, - "num_images": { - "default": 1, - "description": "The number of variations to generate along the requested axis.", - "maximum": 4, - "minimum": 1, - "type": "integer" - }, - "private": { - "description": "When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately.", - "type": "boolean" - }, - "webhook_url": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - } - }, - "required": [ - "variation_type" - ], - "type": "object" - }, - "AdVariationsQuality": { - "description": "The quality tier for the edit. Higher tiers may improve detail and\ntake longer to complete.\n", - "enum": [ - "low", - "medium", - "high" - ], - "title": "AdVariationsQuality", - "type": "string" - }, - "SketchToRenderResponse": { - "description": "Acknowledgement that the sketch rendering was accepted. Poll\n`GET /v2/generations/{generation_id}` for status and results.\n", - "example": { - "generation_id": "generation_id" - }, - "properties": { - "generation_id": { - "description": "URL-safe base64 ID accepted by the generation polling endpoint.", - "title": "generation_id", - "type": "string" - } - }, - "required": [ - "generation_id" - ], - "title": "SketchToRenderResponse", - "type": "object" - }, - "SketchToRenderRequest": { - "description": "The whole sketch is transformed from an illustration into a\nphotograph; masks are not accepted.\n", - "properties": { - "sketch_asset_identifier": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "sketch_image": { - "description": "The fashion sketch to render, up to 50 MB. JPEG, PNG, WEBP, HEIF,\nAVIF, GIF, BMP, TIFF, and MPO are supported. Multipart requests\nonly.\n", - "format": "binary", - "type": "string" - }, - "instruction": { - "description": "Material and rendering direction, plus any construction or design\ndetails that are not legible in the sketch.\n", - "maxLength": 4000, - "minLength": 1, - "type": "string" - }, - "aspect_ratio": { - "description": "Aspect ratio of each output image. Defaults to `1:1` when omitted.", - "pattern": "^(1:1|3:4|4:3|16:9|9:16)$", - "type": "string" - }, - "quality": { - "$ref": "#/components/schemas/SketchToRenderQuality" - }, - "seed": { - "description": "Optional seed for repeatable results.", - "maximum": 2147483647, - "minimum": 0, - "type": "integer" - }, - "num_images": { - "default": 1, - "description": "Number of product renders to create.", - "maximum": 8, - "minimum": 1, - "type": "integer" - }, - "private": { - "description": "When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately.", - "type": "boolean" - }, - "webhook_url": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - } - }, - "required": [ - "instruction" - ], - "type": "object" - }, - "SketchToRenderQuality": { - "description": "The quality tier for the edit. Higher tiers may improve detail and\ntake longer to complete.\n", - "enum": [ - "low", - "medium", - "high" - ], - "title": "SketchToRenderQuality", - "type": "string" - }, - "SoleSwapResponse": { - "description": "Acknowledgement that the workflow was accepted.", - "example": { - "generation_id": "generation_id" - }, - "properties": { - "generation_id": { - "description": "URL-safe base64 ID accepted by the generation polling endpoint.", - "title": "generation_id", - "type": "string" - } - }, - "required": [ - "generation_id" - ], - "title": "SoleSwapResponse", - "type": "object" - }, - "SoleSwapRequest": { - "example": { - "aspect_ratio": "aspect_ratio", - "private": true, - "seed": 12345, - "webhook_url": "https://api.example.com/webhooks/ideogram", - "base_generation_size": "2k", - "base_asset_identifier": { - "asset_type": "RESPONSE", - "asset_id": "7uS_VESkRI6O3-sVgHQp_A" - }, - "instruction": "instruction", - "num_images": 0, - "upper_asset_identifiers": [ - { - "asset_type": "RESPONSE", - "asset_id": "7uS_VESkRI6O3-sVgHQp_A" - }, - { - "asset_type": "RESPONSE", - "asset_id": "7uS_VESkRI6O3-sVgHQp_A" - }, - { - "asset_type": "RESPONSE", - "asset_id": "7uS_VESkRI6O3-sVgHQp_A" - }, - { - "asset_type": "RESPONSE", - "asset_id": "7uS_VESkRI6O3-sVgHQp_A" - }, - { - "asset_type": "RESPONSE", - "asset_id": "7uS_VESkRI6O3-sVgHQp_A" - } - ], - "quality": null - }, - "properties": { - "base_asset_identifier": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "upper_asset_identifiers": { - "description": "Ordered upper-donor references. Put the primary upper view first, then additional angles of the same upper to transfer.", - "items": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "maxItems": 7, - "minItems": 1, - "title": "upper_asset_identifiers", - "type": "array" - }, - "instruction": { - "description": "Optional additional direction for the sole swap.", - "maxLength": 2000, - "title": "instruction", - "type": "string" - }, - "aspect_ratio": { - "description": "Output aspect ratio. When omitted, the closest supported ratio is derived from the sole-donor base image.", - "pattern": "^(1:1|3:4|4:3|16:9|9:16)$", - "title": "aspect_ratio", - "type": "string" - }, - "base_generation_size": { - "default": "2k", - "description": "Output resolution tier. Defaults to 2k.", - "enum": [ - "1k", - "2k", - "4k" - ], - "title": "base_generation_size", - "type": "string" - }, - "quality": { - "$ref": "#/components/schemas/SoleSwapQuality" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - }, - "num_images": { - "default": 1, - "description": "Number of sole-swap images to create.", - "enum": [ - 1, - 2, - 4 - ], - "title": "num_images", - "type": "integer" - }, - "private": { - "description": "When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately.", - "title": "private", - "type": "boolean" - }, - "webhook_url": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - } - }, - "required": [ - "base_asset_identifier", - "upper_asset_identifiers" - ], - "title": "SoleSwapRequest", - "type": "object" - }, - "SoleSwapQuality": { - "description": "The quality tier for the edit. Higher tiers may improve detail and\ntake longer to complete.\n", - "enum": [ - "low", - "medium", - "high" - ], - "title": "SoleSwapQuality", - "type": "string" - }, - "SwapProductResponse": { - "example": { - "generation_id": "generation_id" - }, - "properties": { - "generation_id": { - "description": "URL-safe base64 ID accepted by the generation polling endpoint.", - "title": "generation_id", - "type": "string" - } - }, - "required": [ - "generation_id" - ], - "title": "SwapProductResponse", - "type": "object" - }, - "SwapProductRequest": { - "example": { - "mode": null, - "aspect_ratio": "aspect_ratio", - "private": true, - "webhook_url": "https://api.example.com/webhooks/ideogram", - "instruction": "instruction", - "source_asset_identifier": { - "asset_type": "RESPONSE", - "asset_id": "7uS_VESkRI6O3-sVgHQp_A" - }, - "num_images": 0, - "product_asset_identifiers": [ - { - "asset_type": "RESPONSE", - "asset_id": "7uS_VESkRI6O3-sVgHQp_A" - }, - { - "asset_type": "RESPONSE", - "asset_id": "7uS_VESkRI6O3-sVgHQp_A" - }, - { - "asset_type": "RESPONSE", - "asset_id": "7uS_VESkRI6O3-sVgHQp_A" - }, - { - "asset_type": "RESPONSE", - "asset_id": "7uS_VESkRI6O3-sVgHQp_A" - }, - { - "asset_type": "RESPONSE", - "asset_id": "7uS_VESkRI6O3-sVgHQp_A" - } - ], - "quality": null - }, - "properties": { - "source_asset_identifier": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "product_asset_identifiers": { - "description": "Ordered footwear references, following the source advertisement.", - "items": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "maxItems": 7, - "minItems": 1, - "title": "product_asset_identifiers", - "type": "array" - }, - "mode": { - "$ref": "#/components/schemas/SwapProductMode" - }, - "instruction": { - "description": "Optional edits that take precedence over the default preservation guidance.", - "maxLength": 2000, - "title": "instruction", - "type": "string" - }, - "aspect_ratio": { - "description": "Output aspect ratio. Defaults to the closest supported ratio to the source.", - "pattern": "^(1:1|4:3|16:9|3:4|9:16)$", - "title": "aspect_ratio", - "type": "string" - }, - "num_images": { - "default": 1, - "description": "Number of images to generate.", - "enum": [ - 1, - 2, - 3, - 4, - 6, - 8 - ], - "title": "num_images", - "type": "integer" - }, - "quality": { - "$ref": "#/components/schemas/SwapProductQuality" - }, - "private": { - "description": "Results are private by default. Set false to request public results.\nEnterprise accounts always generate privately.\n", - "title": "private", - "type": "boolean" - }, - "webhook_url": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - } - }, - "required": [ - "mode", - "product_asset_identifiers", - "source_asset_identifier" - ], - "title": "SwapProductRequest", - "type": "object" - }, - "SwapProductMode": { - "description": "Replace the footwear or match its colorway to the references.", - "enum": [ - "replace", - "recolor" - ], - "title": "SwapProductMode", - "type": "string" - }, - "SwapProductQuality": { - "description": "The quality tier for the edit. Higher tiers may improve detail and\ntake longer to complete.\n", - "enum": [ - "low", - "medium", - "high" - ], - "title": "SwapProductQuality", - "type": "string" - }, - "SkechersStyleEditResponse": { - "example": { - "generation_id": "generation_id" - }, - "properties": { - "generation_id": { - "description": "URL-safe base64 ID accepted by the generation polling endpoint.", - "title": "generation_id", - "type": "string" - } - }, - "required": [ - "generation_id" - ], - "title": "SkechersStyleEditResponse", - "type": "object" - }, - "SkechersStyleEditRequest": { - "example": { - "base_description": "base_description", - "aspect_ratio": "1:1", - "private": true, - "reference_asset_identifiers": [ - { - "asset_type": "RESPONSE", - "asset_id": "7uS_VESkRI6O3-sVgHQp_A" - }, - { - "asset_type": "RESPONSE", - "asset_id": "7uS_VESkRI6O3-sVgHQp_A" - }, - { - "asset_type": "RESPONSE", - "asset_id": "7uS_VESkRI6O3-sVgHQp_A" - }, - { - "asset_type": "RESPONSE", - "asset_id": "7uS_VESkRI6O3-sVgHQp_A" - }, - { - "asset_type": "RESPONSE", - "asset_id": "7uS_VESkRI6O3-sVgHQp_A" - } - ], - "webhook_url": "https://api.example.com/webhooks/ideogram", - "base_generation_size": "2k", - "base_asset_identifier": "", - "reference_descriptions": [ - "reference_descriptions", - "reference_descriptions", - "reference_descriptions", - "reference_descriptions", - "reference_descriptions" - ], - "resolved_instruction": "resolved_instruction", - "num_images": 0, - "quality": null - }, - "properties": { - "base_asset_identifier": { - "allOf": [ - { - "$ref": "#/components/schemas/AssetIdentifier" - } - ], - "description": "Image to edit, used as image 1 and the output canvas.", - "title": "base_asset_identifier" - }, - "reference_asset_identifiers": { - "description": "Ordered reference images, numbered from image 2.", - "items": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "maxItems": 7, - "title": "reference_asset_identifiers", - "type": "array" - }, - "resolved_instruction": { - "description": "Edit instructions with known image mentions resolved to image numbers.", - "maxLength": 4000, - "minLength": 1, - "title": "resolved_instruction", - "type": "string" - }, - "base_description": { - "description": "Optional description of the selected base image or named view.", - "maxLength": 1000, - "title": "base_description", - "type": "string" - }, - "reference_descriptions": { - "description": "One nonempty description per reference image, in the same order.", - "items": { - "maxLength": 1000, - "minLength": 1, - "type": "string" - }, - "maxItems": 7, - "title": "reference_descriptions", - "type": "array" - }, - "aspect_ratio": { - "description": "Output ratio. When omitted, derive the nearest supported ratio from the base.", - "enum": [ - "1:1", - "4:3", - "16:9", - "3:4", - "9:16" - ], - "title": "aspect_ratio", - "type": "string" - }, - "base_generation_size": { - "default": "2k", - "description": "Output resolution tier; corresponds to the app's low, medium, and high settings.", - "enum": [ - "1k", - "2k", - "4k" - ], - "title": "base_generation_size", - "type": "string" - }, - "quality": { - "$ref": "#/components/schemas/SkechersStyleEditQuality" - }, - "num_images": { - "default": 1, - "description": "Number of edited images to create.", - "enum": [ - 1, - 2, - 4 - ], - "title": "num_images", - "type": "integer" - }, - "private": { - "description": "When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately.", - "title": "private", - "type": "boolean" - }, - "webhook_url": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - } - }, - "required": [ - "base_asset_identifier", - "resolved_instruction" - ], - "title": "SkechersStyleEditRequest", - "type": "object" - }, - "SkechersStyleEditQuality": { - "description": "The quality tier for the edit. Higher tiers may improve detail and\ntake longer to complete.\n", - "enum": [ - "low", - "medium", - "high" - ], - "title": "SkechersStyleEditQuality", - "type": "string" - }, - "SwanSLogoDesignResponse": { - "example": { - "generation_id": "generation_id" - }, - "properties": { - "generation_id": { - "description": "URL-safe base64 ID accepted by GET /v2/generations/{generation_id}.", - "title": "generation_id", - "type": "string" - } - }, - "required": [ - "generation_id" - ], - "title": "SwanSLogoDesignResponse", - "type": "object" - }, - "SwanSLogoDesignRequest": { - "example": { - "logo_style": "3d", - "flat_silhouette_asset_identifier": { - "asset_type": "RESPONSE", - "asset_id": "7uS_VESkRI6O3-sVgHQp_A" - }, - "private": true, - "webhook_url": "https://api.example.com/webhooks/ideogram", - "source_mode": "shoe_swatch", - "logo_specification_asset_identifier": { - "asset_type": "RESPONSE", - "asset_id": "7uS_VESkRI6O3-sVgHQp_A" - }, - "design_variant": "split_coverage", - "style_source_asset_identifier": { - "asset_type": "RESPONSE", - "asset_id": "7uS_VESkRI6O3-sVgHQp_A" - }, - "geometry_hero_asset_identifier": { - "asset_type": "RESPONSE", - "asset_id": "7uS_VESkRI6O3-sVgHQp_A" - }, - "quality": null - }, - "properties": { - "logo_style": { - "enum": [ - "3d", - "flat" - ], - "title": "logo_style", - "type": "string" - }, - "source_mode": { - "description": "Use a shoe color swatch or an uploaded logo reference as the style source.", - "enum": [ - "shoe_swatch", - "user_reference" - ], - "title": "source_mode", - "type": "string" - }, - "design_variant": { - "description": "Required for 3D user_reference designs. Omit for other designs.", - "enum": [ - "split_coverage", - "full_coverage" - ], - "title": "design_variant", - "type": "string" - }, - "style_source_asset_identifier": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "geometry_hero_asset_identifier": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "logo_specification_asset_identifier": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "flat_silhouette_asset_identifier": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "quality": { - "$ref": "#/components/schemas/SwanSLogoQuality" - }, - "private": { - "description": "When true or omitted, keep outputs private. Enterprise accounts always generate privately.", - "title": "private", - "type": "boolean" - }, - "webhook_url": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - } - }, - "required": [ - "logo_style", - "source_mode", - "style_source_asset_identifier" - ], - "title": "SwanSLogoDesignRequest", - "type": "object" - }, - "SwanSLogoQuality": { - "description": "The quality tier for the edit. Higher tiers may improve detail and\ntake longer to complete.\n", - "enum": [ - "low", - "medium", - "high" - ], - "title": "SwanSLogoQuality", - "type": "string" - }, - "SwanSLogoInstallResponse": { - "example": { - "generation_id": "generation_id" - }, - "properties": { - "generation_id": { - "description": "URL-safe base64 ID accepted by GET /v2/generations/{generation_id}.", - "title": "generation_id", - "type": "string" - } - }, - "required": [ - "generation_id" - ], - "title": "SwanSLogoInstallResponse", - "type": "object" - }, - "SwanSLogoInstallRequest": { - "example": { - "logo_style": "3d", - "aspect_ratio": "aspect_ratio", - "private": true, - "webhook_url": "https://api.example.com/webhooks/ideogram", - "logo_asset_identifier": { - "asset_type": "RESPONSE", - "asset_id": "7uS_VESkRI6O3-sVgHQp_A" - }, - "logo_specification_asset_identifier": { - "asset_type": "RESPONSE", - "asset_id": "7uS_VESkRI6O3-sVgHQp_A" - }, - "shoe_asset_identifiers": [ - { - "asset_type": "RESPONSE", - "asset_id": "7uS_VESkRI6O3-sVgHQp_A" - }, - { - "asset_type": "RESPONSE", - "asset_id": "7uS_VESkRI6O3-sVgHQp_A" - }, - { - "asset_type": "RESPONSE", - "asset_id": "7uS_VESkRI6O3-sVgHQp_A" - }, - { - "asset_type": "RESPONSE", - "asset_id": "7uS_VESkRI6O3-sVgHQp_A" - }, - { - "asset_type": "RESPONSE", - "asset_id": "7uS_VESkRI6O3-sVgHQp_A" - } - ], - "num_images": 0, - "quality": null - }, - "properties": { - "logo_style": { - "enum": [ - "3d", - "flat" - ], - "title": "logo_style", - "type": "string" - }, - "shoe_asset_identifiers": { - "description": "Ordered shoe views, primary view first.", - "items": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "maxItems": 6, - "minItems": 1, - "title": "shoe_asset_identifiers", - "type": "array" - }, - "logo_asset_identifier": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "logo_specification_asset_identifier": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "aspect_ratio": { - "pattern": "^(1:1|3:4|9:16)$", - "title": "aspect_ratio", - "type": "string" - }, - "num_images": { - "default": 4, - "description": "Number of images to create.", - "enum": [ - 1, - 2, - 4 - ], - "title": "num_images", - "type": "integer" - }, - "quality": { - "$ref": "#/components/schemas/SwanSLogoQuality" - }, - "private": { - "description": "When true or omitted, keep outputs private. Enterprise accounts always generate privately.", - "title": "private", - "type": "boolean" - }, - "webhook_url": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - } - }, - "required": [ - "aspect_ratio", - "logo_asset_identifier", - "logo_style", - "shoe_asset_identifiers" - ], - "title": "SwanSLogoInstallRequest", - "type": "object" - }, - "ModelSwapResponse": { - "description": "Acknowledgement that the model swap was accepted. Poll\n`GET /v2/generations/{generation_id}` for status and results.\n", - "example": { - "generation_id": "generation_id" - }, - "properties": { - "generation_id": { - "description": "URL-safe base64 ID accepted by the generation polling endpoint.", - "title": "generation_id", - "type": "string" - } - }, - "required": [ - "generation_id" - ], - "title": "ModelSwapResponse", - "type": "object" - }, - "ModelSwapRequest": { - "description": "The working image (`source_image`) plus one to four ordered target-model references. Results are full-frame edits, so exact pixel preservation is not guaranteed.", - "properties": { - "source_asset_identifier": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "source_image": { - "description": "The working image whose product, pose, scene, lighting, framing, and camera are preserved. Supported formats and the 50 MB limit match the image upload API. Multipart requests only.", - "format": "binary", - "type": "string" - }, - "model_asset_identifiers": { - "description": "Ordered target-model identity and angle references. These images supply only identity, hair, skin tone, and body proportions.", - "items": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "maxItems": 4, - "minItems": 1, - "type": "array" - }, - "instruction": { - "description": "Optional identity details that are not visible in the target-model references. This cannot override the source roles described above.", - "maxLength": 2000, - "type": "string" - }, - "aspect_ratio": { - "description": "Output aspect ratio. When omitted, the closest supported ratio is derived from the working image.", - "pattern": "^(1:1|3:4|4:3|16:9|9:16)$", - "type": "string" - }, - "quality": { - "$ref": "#/components/schemas/ModelSwapQuality" - }, - "seed": { - "description": "Optional seed for repeatable results.", - "maximum": 2147483647, - "minimum": 0, - "type": "integer" - }, - "num_images": { - "default": 1, - "description": "Number of model-swap images to create.", - "maximum": 8, - "minimum": 1, - "type": "integer" - }, - "private": { - "description": "When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately.", - "type": "boolean" - }, - "webhook_url": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - } - }, - "required": [ - "model_asset_identifiers" - ], - "type": "object" - }, - "ModelSwapQuality": { - "description": "The quality tier for the edit. Higher tiers may improve detail and\ntake longer to complete.\n", - "enum": [ - "low", - "medium", - "high" - ], - "title": "ModelSwapQuality", - "type": "string" - }, - "MaterialSwapResponse": { - "description": "Acknowledgement that the material swap was accepted. Poll\n`GET /v2/generations/{generation_id}` for status and results.\n", - "example": { - "generation_id": "generation_id" - }, - "properties": { - "generation_id": { - "description": "URL-safe base64 ID accepted by the generation polling endpoint.", - "title": "generation_id", - "type": "string" - } - }, - "required": [ - "generation_id" - ], - "title": "MaterialSwapResponse", - "type": "object" - }, - "MaterialSwapRequest": { - "description": "Upload the product photo as `image`, up to 4 `masks`, and either one\nentry in `materials` for all masks or one per mask, paired by\nposition. For a single region, send one mask and one material.\n", - "properties": { - "image_asset_identifier": { - "allOf": [ - { - "$ref": "#/components/schemas/AssetIdentifier" - } - ], - "description": "The product photo to edit, by reference. Everything outside the\nmasked region is preserved. Provide exactly one of\n`image_asset_identifier` or `image`.\n" - }, - "image": { - "description": "The product photo to edit (max size 25MB). JPEG, PNG, and WEBP\nformats are supported.\n", - "format": "binary", - "type": "string" - }, - "mask_asset_identifiers": { - "description": "The masks marking the regions of the product photo to change, by\nreference (max 4). Every mask must have the same pixel dimensions\nas the product photo. White pixels mark the region to change; black\npixels are preserved. Alpha-only masks are also supported: opaque\npixels mark the region to change and transparent pixels are\npreserved. Provide exactly one of `mask_asset_identifiers` or\n`masks`.\n", - "items": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "maxItems": 4, - "minItems": 1, - "type": "array" - }, - "masks": { - "description": "Masks marking the regions to change (max 4, max size 25MB each).\nJPEG, PNG, and WEBP formats are supported. Every mask must have the\nsame pixel dimensions as the product photo. White pixels mark the\nregion to change and black pixels are preserved; alpha-only masks\nalso work (opaque = change, transparent = preserve).\n", - "items": { - "format": "binary", - "type": "string" - }, - "maxItems": 4, - "minItems": 1, - "type": "array" - }, - "material_asset_identifiers": { - "description": "The material reference images, by reference. Only their material —\ncolor, texture, pattern scale, and orientation — is applied to the\nmasked regions. Send one material, which every mask takes, or\nexactly one per mask paired by position. Provide exactly one of\n`material_asset_identifiers` or `materials`.\n", - "items": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "maxItems": 4, - "minItems": 1, - "type": "array" - }, - "materials": { - "description": "Material reference images (max size 25MB each). JPEG, PNG, and WEBP\nformats are supported. Only their material (color, texture, pattern\nscale, and orientation) is applied to the masked regions. Send one\nmaterial for every mask, or exactly one per mask, paired by\nposition.\n", - "items": { - "format": "binary", - "type": "string" - }, - "maxItems": 4, - "minItems": 1, - "type": "array" - }, - "aspect_ratio": { - "description": "Output aspect ratio. Defaults to the product photo's aspect ratio,\nwhich keeps the original framing. A different ratio extends the\nscene to fill the new shape rather than cropping, so part of the\nframe is newly generated. Supported values are `1:1`, `3:4`,\n`4:3`, `16:9`, and `9:16`.\n", - "pattern": "^(1:1|3:4|4:3|16:9|9:16)$", - "type": "string" - }, - "quality": { - "$ref": "#/components/schemas/MaterialSwapQuality" - }, - "target_collection_id": { - "description": "A collection you can write to, by its URL-safe base64 collection id. Completed outputs are added to it automatically.", - "type": "string" - }, - "private": { - "description": "When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately.", - "type": "boolean" - }, - "webhook_url": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - } - }, - "type": "object", - "x-tool-description": "The product photo as `image_asset_identifier`, up to 4 masks as `mask_asset_identifiers`, and either one entry in `material_asset_identifiers` for all masks or one per mask, paired by position." - }, - "MaterialSwapQuality": { - "description": "The quality tier for the edit. Higher tiers may improve detail and\ntake longer to complete.\n", - "enum": [ - "low", - "medium", - "high" - ], - "title": "MaterialSwapQuality", - "type": "string" - }, - "UpscaleToolResponse": { - "description": "Synchronous requests (the default) include the upscaled image in `data`.\nAsync requests omit `data`; poll `GET /v2/generations/{generation_id}`\nwith the returned `generation_id`. `seed` is the seed actually used,\nand `width` and `height` are the output dimensions.\n", - "example": { - "data": [ - { - "seed": 12345, - "resolution": "2048x2048", - "url": "https://openapi-generator.tech", - "is_image_safe": true - }, - { - "seed": 12345, - "resolution": "2048x2048", - "url": "https://openapi-generator.tech", - "is_image_safe": true - } - ], - "seed": 12345, - "generation_id": "generation_id", - "width": 0, - "height": 6 - }, - "properties": { - "generation_id": { - "description": "The generation ID to poll with `GET /v2/generations/{generation_id}`.\n", - "title": "generation_id", - "type": "string" - }, - "data": { - "description": "The upscaled image. Present only for synchronous requests (`async` omitted or false).", - "items": { - "$ref": "#/components/schemas/UpscaleImageObject" - }, - "title": "data", - "type": "array" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - }, - "width": { - "description": "The output width in pixels.", - "title": "width", - "type": "integer" - }, - "height": { - "description": "The output height in pixels.", - "title": "height", - "type": "integer" - } - }, - "required": [ - "generation_id", - "height", - "seed", - "width" - ], - "title": "UpscaleToolResponse", - "type": "object" - }, - "UpscaleToolRequest": { - "description": "Upload the source `image` using `multipart/form-data`.\n", - "properties": { - "image_asset_identifier": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "image": { - "description": "The source image to upscale, in a common format such as JPEG, PNG, or WEBP, up to 50MB. Multipart requests only. The uploaded image is used for this request only and is not stored.", - "format": "binary", - "type": "string", - "x-tool-description": "Source image (JPEG/PNG/WEBP, max 50MB). Multipart only; used for this request, not stored." - }, - "upscale_factor": { - "default": "x2", - "description": "How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.", - "enum": [ - "x2", - "x4", - "x8" - ], - "type": "string", - "x-tool-description": "String scale (e.g. x2 doubles both dimensions); output max 8192px/side." - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - }, - "internal": { - "default": false, - "description": "When true, the upscale is excluded from the user's gallery and feeds.", - "type": "boolean" - }, - "async": { - "default": false, - "description": "When false (the default), the request blocks until the upscaled image is ready and returns it in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` for the result.", - "type": "boolean", - "x-tool-description": "Always overridden to true; tools run asynchronously." - }, - "webhook_url": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - }, - "private": { - "description": "When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately.", - "nullable": true, - "type": "boolean", - "x-tool-description": "true keeps the output private; false publishes it. Enterprise output is always private." - }, - "target_collection_id": { - "description": "A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes.", - "type": "string", - "x-tool-description": "Destination collection ID (URL-safe base64); must be writable." - } - }, - "type": "object", - "x-tool-description": "Requires image_asset_identifier (uploaded or generated image)." - }, - "LayerizeDesignIdeogramV3Response": { - "description": "Response returned by `POST /v2/design/layerize/ideogram-3`.\nSynchronous requests (the default) include the layerized design in\n`data`. Asynchronous requests omit `data`; poll\n`GET /v2/generations/{generation_id}` with the returned\n`generation_id`. `seed` is the seed that was used, including when you\ndid not set one.\n", - "example": { - "data": [ - { - "seed": 12345, - "object_type": "layerized_image", - "resolution": "1024x1024", - "url": "https://openapi-generator.tech", - "base_image_url": "https://openapi-generator.tech", - "is_image_safe": true, - "text_blocks": [ - { - "role": "heading", - "color": "#212121", - "font_alternatives": [ - "font_alternatives", - "font_alternatives" - ], - "font_size": 2, - "font_name": "font_name", - "line_height": 7.0614014, - "x": 0, - "width": 1, - "y": 6, - "angle": 5.637377, - "text": "Hello World", - "alignment": "left", - "formatting": [ - "bold", - "bold" - ], - "height": 5 - }, - { - "role": "heading", - "color": "#212121", - "font_alternatives": [ - "font_alternatives", - "font_alternatives" - ], - "font_size": 2, - "font_name": "font_name", - "line_height": 7.0614014, - "x": 0, - "width": 1, - "y": 6, - "angle": 5.637377, - "text": "Hello World", - "alignment": "left", - "formatting": [ - "bold", - "bold" - ], - "height": 5 - } - ] - }, - { - "seed": 12345, - "object_type": "layerized_image", - "resolution": "1024x1024", - "url": "https://openapi-generator.tech", - "base_image_url": "https://openapi-generator.tech", - "is_image_safe": true, - "text_blocks": [ - { - "role": "heading", - "color": "#212121", - "font_alternatives": [ - "font_alternatives", - "font_alternatives" - ], - "font_size": 2, - "font_name": "font_name", - "line_height": 7.0614014, - "x": 0, - "width": 1, - "y": 6, - "angle": 5.637377, - "text": "Hello World", - "alignment": "left", - "formatting": [ - "bold", - "bold" - ], - "height": 5 - }, - { - "role": "heading", - "color": "#212121", - "font_alternatives": [ - "font_alternatives", - "font_alternatives" - ], - "font_size": 2, - "font_name": "font_name", - "line_height": 7.0614014, - "x": 0, - "width": 1, - "y": 6, - "angle": 5.637377, - "text": "Hello World", - "alignment": "left", - "formatting": [ - "bold", - "bold" - ], - "height": 5 - } - ] - } - ], - "seed": 12345, - "generation_id": "generation_id" - }, - "properties": { - "generation_id": { - "description": "URL-safe base64 ID of the generation. Use it to poll\n`GET /v2/generations/{generation_id}`.\n", - "title": "generation_id", - "type": "string" - }, - "data": { - "description": "The layerized design. Present only for synchronous requests (`async` omitted or false).", - "items": { - "$ref": "#/components/schemas/LayerizedImageObject" - }, - "title": "data", - "type": "array" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - } - }, - "required": [ - "generation_id", - "seed" - ], - "title": "LayerizeDesignIdeogramV3Response", - "type": "object" - }, - "LayerizedImageObject": { - "description": "One layerized design. Image links are available for a limited period\nof time; if you would like to keep an image, you must download it.\n", - "example": { - "seed": 12345, - "object_type": "layerized_image", - "resolution": "1024x1024", - "url": "https://openapi-generator.tech", - "base_image_url": "https://openapi-generator.tech", - "is_image_safe": true, - "text_blocks": [ - { - "role": "heading", - "color": "#212121", - "font_alternatives": [ - "font_alternatives", - "font_alternatives" - ], - "font_size": 2, - "font_name": "font_name", - "line_height": 7.0614014, - "x": 0, - "width": 1, - "y": 6, - "angle": 5.637377, - "text": "Hello World", - "alignment": "left", - "formatting": [ - "bold", - "bold" - ], - "height": 5 - }, - { - "role": "heading", - "color": "#212121", - "font_alternatives": [ - "font_alternatives", - "font_alternatives" - ], - "font_size": 2, - "font_name": "font_name", - "line_height": 7.0614014, - "x": 0, - "width": 1, - "y": 6, - "angle": 5.637377, - "text": "Hello World", - "alignment": "left", - "formatting": [ - "bold", - "bold" - ], - "height": 5 - } - ] - }, - "properties": { - "object_type": { - "description": "Discriminates layerized results from other generation output types.", - "enum": [ - "layerized_image" - ], - "title": "object_type", - "type": "string" - }, - "url": { - "description": "The direct link to the design image with its text intact. Empty when the image did not pass safety checks.", - "format": "uri", - "nullable": true, - "title": "url", - "type": "string" - }, - "base_image_url": { - "description": "The direct link to the base image with all detected text removed. Empty when the image did not pass safety checks.", - "format": "uri", - "nullable": true, - "title": "base_image_url", - "type": "string" - }, - "resolution": { - "description": "The resolution of the design, formatted as \"WIDTHxHEIGHT\".", - "example": "1024x1024", - "title": "resolution", - "type": "string" - }, - "is_image_safe": { - "description": "Whether the image passed safety checks. If false, the image links are empty.", - "title": "is_image_safe", - "type": "boolean" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - }, - "text_blocks": { - "description": "Flat list of detected text regions in the design.", - "items": { - "$ref": "#/components/schemas/DetectedTextBlock" - }, - "title": "text_blocks", - "type": "array" - } - }, - "required": [ - "is_image_safe", - "object_type", - "resolution", - "seed", - "text_blocks" - ], - "title": "LayerizedImageObject", - "type": "object" - }, - "LayerizeDesignIdeogramV3Request": { - "description": "A request to layerize the text in one image. Upload the source image\nas `image` using `multipart/form-data`.\n", - "properties": { - "image_asset_identifier": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "image": { - "description": "The source image to layerize (max 50MB). Common image formats such as JPEG, PNG, and WEBP are supported. Multipart requests only.", - "format": "binary", - "type": "string" - }, - "prompt": { - "description": "A description of the image, used to guide text detection. When omitted, detection runs on the image alone.", - "maxLength": 10000, - "nullable": true, - "type": "string" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - }, - "font_candidate_files": { - "description": "Candidate font files to make available for text style matching. Supported formats .ttf, .otf, .woff, .woff2 (max 5MB each, maximum 5 files). Multipart requests only.", - "items": { - "format": "binary", - "type": "string" - }, - "type": "array" - }, - "async": { - "default": false, - "description": "When false (the default), the request waits until layerization is complete and returns the result in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.", - "type": "boolean" - }, - "webhook_url": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - }, - "private": { - "description": "When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately.", - "nullable": true, - "type": "boolean" - }, - "target_collection_id": { - "description": "A collection you can write to, by its URL-safe base64 collection id. The output is added to it when the request completes.", - "type": "string" - } - }, - "type": "object" - }, - "DescribeImageIdeogramV3Response": { - "description": "Response returned by `POST /v2/image/describe/ideogram-3`.", - "example": { - "description_id": "description_id", - "created": "2000-01-23T04:56:07+00:00", - "descriptions": [ - { - "text": "text" - }, - { - "text": "text" - } - ] - }, - "properties": { - "description_id": { - "description": "URL-safe base64 ID of the description that was created.", - "title": "description_id", - "type": "string" - }, - "created": { - "description": "The time the request was created.", - "format": "date-time", - "title": "created", - "type": "string" - }, - "descriptions": { - "description": "The generated description(s) for the provided image.", - "items": { - "$ref": "#/components/schemas/GeneratedDescription" - }, - "title": "descriptions", - "type": "array" - } - }, - "required": [ - "created", - "description_id", - "descriptions" - ], - "title": "DescribeImageIdeogramV3Response", - "type": "object" - }, - "GeneratedDescription": { - "example": { - "text": "text" - }, - "properties": { - "text": { - "description": "The generated description for the provided image.", - "title": "text", - "type": "string" - } - }, - "required": [ - "text" - ], - "title": "GeneratedDescription", - "type": "object" - }, - "DescribeImageIdeogramV3Request": { - "description": "A request to describe one image. Upload the image as `image` using\n`multipart/form-data`.\n", - "properties": { - "image_asset_identifier": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "image": { - "description": "The image to describe (max 10MB). JPEG, PNG, and WebP are supported. Multipart requests only.", - "format": "binary", - "type": "string", - "x-tool-description": "The image to describe (max size 10MB), as raw bytes; only JPEG, PNG, and WebP formats are supported. Multipart requests only." - } - }, - "type": "object", - "x-tool-description": "Requires image_asset_identifier (uploaded or generated image)." - }, - "ImageSafetyError": { - "example": { - "error": "Image provided failed safety check due to the inclusion of prohibited content." - }, - "properties": { - "error": { - "example": "Image provided failed safety check due to the inclusion of prohibited content.", - "title": "error", - "type": "string" - } - }, - "required": [ - "error" - ], - "title": "ImageSafetyError", - "type": "object" - }, - "DescribeImageIdeogramV4Response": { - "description": "Response returned by `POST /v2/image/describe/ideogram-4`.\nThe `json_prompt` field is a structured `V4JsonPrompt` that can be\npassed back as `json_prompt` to the `/v1/ideogram-v4/generate` family\nof endpoints.\n", - "example": { - "description_id": "description_id", - "created": "2000-01-23T04:56:07+00:00", - "json_prompt": { - "high_level_description": "high_level_description", - "style_description": { - "photo": "photo", - "art_style": "art_style", - "medium": "medium", - "aesthetics": "aesthetics", - "lighting": "lighting", - "color_palette": [ - "#FFD700", - "#FFD700" - ] - }, - "compositional_deconstruction": { - "background": "background", - "elements": [ - { - "bbox": [ - 0, - 0, - 1000, - 1000 - ], - "type": "obj", - "desc": "desc", - "color_palette": [ - "#FFD700", - "#FFD700" - ] - }, - { - "bbox": [ - 0, - 0, - 1000, - 1000 - ], - "type": "obj", - "desc": "desc", - "color_palette": [ - "#FFD700", - "#FFD700" - ] - } - ] - }, - "tags": [ - "tags", - "tags" - ] - } - }, - "properties": { - "description_id": { - "description": "URL-safe base64 ID of the description that was created.", - "title": "description_id", - "type": "string" - }, - "created": { - "description": "The time the request was created.", - "format": "date-time", - "title": "created", - "type": "string" - }, - "json_prompt": { - "$ref": "#/components/schemas/V4JsonPrompt" - } - }, - "required": [ - "created", - "description_id", - "json_prompt" - ], - "title": "DescribeImageIdeogramV4Response", - "type": "object" - }, - "DescribeImageIdeogramV4Request": { - "description": "A request to describe one image. Upload the image as `image` using\n`multipart/form-data`.\n", - "properties": { - "image_asset_identifier": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "image": { - "description": "The image to describe (max 10MB). JPEG, PNG, and WebP are supported. Multipart requests only.", - "format": "binary", - "type": "string" - }, - "include_bbox": { - "default": true, - "description": "Whether to include bounding boxes for the subjects and text in the returned `json_prompt`. Defaults to true, so the prompt preserves the layout of the described image.", - "type": "boolean" - }, - "include_style_descriptions": { - "default": false, - "description": "Whether to include a free-form style description in the returned `json_prompt`. Defaults to false.", - "type": "boolean" - }, - "include_tags": { - "default": false, - "description": "Whether to include free-form tags in the returned `json_prompt`. Defaults to false.", - "type": "boolean" - } - }, - "type": "object" - }, - "GenerateImageIdeogramV3Response": { - "description": "Response returned by `POST /v2/image/generate/ideogram-3`.\nSynchronous requests (the default) include the generated images in\n`data`. Asynchronous requests omit `data`; poll\n`GET /v2/generations/{generation_id}` with the returned\n`generation_id`. `seed` is the seed that was used, including when you\ndid not set one.\n", - "example": { - "data": [ - { - "seed": 12345, - "prompt": "prompt", - "resolution": "1024x1024", - "url": "https://openapi-generator.tech", - "is_image_safe": true - }, - { - "seed": 12345, - "prompt": "prompt", - "resolution": "1024x1024", - "url": "https://openapi-generator.tech", - "is_image_safe": true - } - ], - "seed": 12345, - "generation_id": "generation_id" - }, - "properties": { - "generation_id": { - "description": "URL-safe base64 ID of the generation. Use it to poll\n`GET /v2/generations/{generation_id}`.\n", - "title": "generation_id", - "type": "string" - }, - "data": { - "description": "The generated images, in generation order. Present only for synchronous requests (`async` omitted or false).", - "items": { - "$ref": "#/components/schemas/GeneratedImageObject" - }, - "title": "data", - "type": "array" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - } - }, - "required": [ - "generation_id", - "seed" - ], - "title": "GenerateImageIdeogramV3Response", - "type": "object" - }, - "GeneratedImageObject": { - "description": "One generated output image.", - "example": { - "seed": 12345, - "prompt": "prompt", - "resolution": "1024x1024", - "url": "https://openapi-generator.tech", - "is_image_safe": true - }, - "properties": { - "url": { - "description": "The direct link to the generated image. Empty when the image did not pass safety checks.", - "format": "uri", - "nullable": true, - "title": "url", - "type": "string" - }, - "prompt": { - "description": "The final prompt the image was generated from.", - "title": "prompt", - "type": "string" - }, - "resolution": { - "description": "The resolution of the generated image, formatted as \"WIDTHxHEIGHT\".", - "example": "1024x1024", - "title": "resolution", - "type": "string" - }, - "is_image_safe": { - "description": "Whether the image passed safety checks. If false, `url` is empty.", - "title": "is_image_safe", - "type": "boolean" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - } - }, - "required": [ - "is_image_safe", - "prompt", - "resolution", - "seed" - ], - "title": "GeneratedImageObject", - "type": "object" - }, - "GenerateImageIdeogramV3Request": { - "properties": { - "prompt": { - "description": "The prompt to generate images from.", - "maxLength": 10000, - "minLength": 1, - "type": "string" - }, - "negative_prompt": { - "description": "Description of what to exclude from the images. The prompt takes precedence over the negative prompt.", - "maxLength": 10000, - "type": "string", - "x-tool-description": "What to exclude; prompt takes precedence." - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - }, - "resolution": { - "$ref": "#/components/schemas/ResolutionV3" - }, - "aspect_ratio": { - "$ref": "#/components/schemas/IdeogramV3AspectRatio" - }, - "rendering_speed": { - "default": "default", - "description": "The rendering speed to use.", - "enum": [ - "turbo", - "default", - "quality" - ], - "type": "string" - }, - "magic_prompt": { - "allOf": [ - { - "$ref": "#/components/schemas/MagicPromptMode" - } - ], - "default": "auto", - "description": "Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.", - "x-tool-description": "Automatic prompt rewriting; default auto." - }, - "num_images": { - "default": 1, - "description": "The number of images to generate.", - "maximum": 8, - "minimum": 1, - "type": "integer", - "x-tool-description": "Number of variations of this one prompt. For different subjects, make separate calls instead of listing them in one prompt." - }, - "color_palette": { - "$ref": "#/components/schemas/IdeogramColorPalette" - }, - "style_codes": { - "description": "A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.", - "example": [ - "AAFF5733", - "0133FF57", - "DE3357FF" - ], - "items": { - "$ref": "#/components/schemas/StyleCode" - }, - "type": "array", - "x-tool-description": "8-character hex style codes. Allowed combinations with other style controls depend on the operation." - }, - "style_type": { - "$ref": "#/components/schemas/IdeogramV3StyleType" - }, - "style_preset": { - "allOf": [ - { - "$ref": "#/components/schemas/IdeogramV3StylePreset" - } - ], - "description": "A predefined style preset to apply to the generated images. Cannot be combined with style codes or style references.", - "x-tool-description": "Style preset; excludes style codes and style references." - }, - "style_reference_collection_id": { - "description": "A saved style to apply, by its URL-safe base64 collection id. Cannot be combined with `style_reference_images`.", - "type": "string", - "x-tool-description": "Saved-style collection ID (URL-safe base64); excludes style_reference_asset_identifiers." - }, - "style_reference_collection_version_id": { - "description": "Optional URL-safe base64 version id of the saved style in `style_reference_collection_id`. Ignored without it.", - "type": "string", - "x-tool-description": "URL-safe base64 version ID of style_reference_collection_id; ignored without it." - }, - "style_reference_asset_identifiers": { - "description": "Existing upload or generated image assets to use as style references, by reference. Cannot be combined with `style_reference_collection_id` or `style_reference_images`.", - "items": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "maxItems": 10, - "minItems": 1, - "type": "array", - "x-tool-description": "Style-reference image assets; cannot combine with style_reference_collection_id." - }, - "style_reference_images": { - "description": "Images to use as style references (max 10, max 25MB each; JPEG, PNG, or WEBP).", - "items": { - "format": "binary", - "type": "string" - }, - "maxItems": 10, - "type": "array" - }, - "enable_copyright_detection": { - "description": "Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`.", - "nullable": true, - "type": "boolean", - "x-tool-description": "Check outputs for copyright; adds latency. Flagged images have is_image_safe: false." - }, - "async": { - "default": false, - "description": "When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.", - "type": "boolean", - "x-tool-description": "Always overridden to true; tools run asynchronously." - }, - "webhook_url": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - }, - "private": { - "description": "When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately.", - "nullable": true, - "type": "boolean", - "x-tool-description": "true keeps the output private; false publishes it. Enterprise output is always private." - }, - "target_collection_id": { - "description": "A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes.", - "type": "string", - "x-tool-description": "Destination collection ID (URL-safe base64); must be writable." - } - }, - "required": [ - "prompt" - ], - "type": "object" - }, - "GenerateImageIdeogramV3CustomModelResponse": { - "description": "Response returned by `POST /v2/image/generate/ideogram-3-custom-model`.\nSynchronous requests (the default) include the generated images in\n`data`. Asynchronous requests omit `data`; poll\n`GET /v2/generations/{generation_id}` with the returned\n`generation_id`. `seed` is the seed that was used, including when you\ndid not set one.\n", - "example": { - "data": [ - { - "seed": 12345, - "prompt": "prompt", - "resolution": "1024x1024", - "url": "https://openapi-generator.tech", - "is_image_safe": true - }, - { - "seed": 12345, - "prompt": "prompt", - "resolution": "1024x1024", - "url": "https://openapi-generator.tech", - "is_image_safe": true - } - ], - "seed": 12345, - "generation_id": "generation_id" - }, - "properties": { - "generation_id": { - "description": "URL-safe base64 ID of the generation. Use it to poll\n`GET /v2/generations/{generation_id}`.\n", - "title": "generation_id", - "type": "string" - }, - "data": { - "description": "The generated images, in generation order. Present only for synchronous requests (`async` omitted or false).", - "items": { - "$ref": "#/components/schemas/GeneratedImageObject" - }, - "title": "data", - "type": "array" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - } - }, - "required": [ - "generation_id", - "seed" - ], - "title": "GenerateImageIdeogramV3CustomModelResponse", - "type": "object" - }, - "GenerateImageIdeogramV3CustomModelRequest": { - "properties": { - "prompt": { - "description": "The prompt to generate images from.", - "maxLength": 10000, - "minLength": 1, - "type": "string" - }, - "custom_model_uri": { - "description": "The custom model URI, in the form `model//version/`. You or your organization must have access to the model. The model determines which rendering speeds are supported and whether backgrounds are removed automatically.", - "example": "model/my-custom-model/version/1", - "maxLength": 512, - "minLength": 1, - "pattern": "^model/[^/]+/version/[^/]+$", - "type": "string" - }, - "transparent_background": { - "default": false, - "description": "Remove the background after generation and return transparent PNG images. Included in the custom model generation price at no extra charge. When false, the model's automatic background removal behavior still applies.", - "type": "boolean" - }, - "negative_prompt": { - "description": "Description of what to exclude from the images. The prompt takes precedence over the negative prompt.", - "maxLength": 10000, - "type": "string", - "x-tool-description": "What to exclude; prompt takes precedence." - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - }, - "resolution": { - "$ref": "#/components/schemas/ResolutionV3" - }, - "aspect_ratio": { - "$ref": "#/components/schemas/IdeogramV3AspectRatio" - }, - "rendering_speed": { - "description": "The rendering speed to use. When omitted, a speed supported by the custom model is used.", - "enum": [ - "turbo", - "default", - "quality" - ], - "type": "string" - }, - "magic_prompt": { - "allOf": [ - { - "$ref": "#/components/schemas/MagicPromptMode" - } - ], - "default": "auto", - "description": "Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.", - "x-tool-description": "Automatic prompt rewriting; default auto." - }, - "num_images": { - "default": 1, - "description": "The number of images to generate.", - "maximum": 8, - "minimum": 1, - "type": "integer", - "x-tool-description": "Number of variations of this one prompt. For different subjects, make separate calls instead of listing them in one prompt." - }, - "color_palette": { - "$ref": "#/components/schemas/IdeogramColorPalette" - }, - "style_codes": { - "description": "A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.", - "example": [ - "AAFF5733", - "0133FF57", - "DE3357FF" - ], - "items": { - "$ref": "#/components/schemas/StyleCode" - }, - "type": "array", - "x-tool-description": "8-character hex style codes. Allowed combinations with other style controls depend on the operation." - }, - "style_preset": { - "allOf": [ - { - "$ref": "#/components/schemas/IdeogramV3StylePreset" - } - ], - "description": "A predefined style preset to apply to the generated images. Cannot be combined with style codes or style references.", - "x-tool-description": "Style preset; excludes style codes and style references." - }, - "style_reference_asset_identifiers": { - "description": "Existing upload or generated image assets to use as style references, by reference. Cannot be combined with `style_reference_images`.", - "items": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "maxItems": 10, - "minItems": 1, - "type": "array", - "x-tool-description": "Style-reference image assets." - }, - "style_reference_images": { - "description": "Images to use as style references (max 10, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only.", - "items": { - "format": "binary", - "type": "string" - }, - "maxItems": 10, - "type": "array" - }, - "enable_copyright_detection": { - "description": "Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`.", - "nullable": true, - "type": "boolean", - "x-tool-description": "Check outputs for copyright; adds latency. Flagged images have is_image_safe: false." - }, - "async": { - "default": false, - "description": "When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.", - "type": "boolean", - "x-tool-description": "Always overridden to true; tools run asynchronously." - }, - "webhook_url": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - }, - "private": { - "description": "When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately.", - "nullable": true, - "type": "boolean", - "x-tool-description": "true keeps the output private; false publishes it. Enterprise output is always private." - }, - "target_collection_id": { - "description": "A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes.", - "type": "string", - "x-tool-description": "Destination collection ID (URL-safe base64); must be writable." - } - }, - "required": [ - "custom_model_uri", - "prompt" - ], - "type": "object" - }, - "GenerateImageIdeogramV4Response": { - "description": "Response returned by `POST /v2/image/generate/ideogram-4`.\nSynchronous requests (the default) include the generated images in\n`data`. Asynchronous requests omit `data`; poll\n`GET /v2/generations/{generation_id}` with the returned\n`generation_id`. `seed` is the seed that was used, including when you\ndid not set one.\n", - "example": { - "data": [ - { - "seed": 12345, - "prompt": "prompt", - "resolution": "1024x1024", - "url": "https://openapi-generator.tech", - "is_image_safe": true - }, - { - "seed": 12345, - "prompt": "prompt", - "resolution": "1024x1024", - "url": "https://openapi-generator.tech", - "is_image_safe": true - } - ], - "seed": 12345, - "generation_id": "generation_id" - }, - "properties": { - "generation_id": { - "description": "URL-safe base64 ID of the generation. Use it to poll\n`GET /v2/generations/{generation_id}`.\n", - "title": "generation_id", - "type": "string" - }, - "data": { - "description": "The generated images, in generation order. Present only for synchronous requests (`async` omitted or false).", - "items": { - "$ref": "#/components/schemas/GeneratedImageObject" - }, - "title": "data", - "type": "array" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - } - }, - "required": [ - "generation_id", - "seed" - ], - "title": "GenerateImageIdeogramV4Response", - "type": "object" - }, - "GenerateImageIdeogramV4Request": { - "example": { - "magic_prompt": "", - "async": false, - "private": true, - "seed": 12345, - "rendering_speed": "default", - "webhook_url": "https://api.example.com/webhooks/ideogram", - "enable_copyright_detection": true, - "target_collection_id": "target_collection_id", - "prompt": "prompt", - "resolution": "", - "num_images": 1 - }, - "properties": { - "prompt": { - "description": "The prompt to generate images from, in natural language or as a\nstructured Ideogram 4.0 JSON prompt. A structured JSON prompt is\nused as is and skips magic prompt unless `magic_prompt` is `on`.\n", - "maxLength": 10000, - "minLength": 1, - "title": "prompt", - "type": "string", - "x-tool-description": "Natural language or Ideogram 4.0 JSON. JSON is used unchanged, skipping rewriting unless magic_prompt is on.", - "x-playground-field": { - "label": "Prompt", - "control": "textarea", - "order": 1, - "default": "A cinematic product shot of a tabby cat sleeping on a modern couch, soft daylight, rich texture, highly detailed.", - "placeholder": "Describe the image you want to generate." - } - }, - "magic_prompt": { - "allOf": [ - { - "$ref": "#/components/schemas/MagicPromptMode" - } - ], - "default": "auto", - "description": "Controls how a natural-language prompt is prepared. `auto` (the\ndefault) and `on` rewrite and expand the prompt before generation.\n`off` keeps your wording and only converts it into a structured\nprompt. A valid structured JSON prompt skips magic prompt unless\n`magic_prompt` is `on`.\n", - "title": "magic_prompt", - "x-tool-description": "For natural language, `auto` and `on` rewrite; `off` only converts to structured format. Structured JSON bypasses rewriting unless `on`." - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - }, - "num_images": { - "default": 1, - "description": "The number of images to generate.", - "maximum": 8, - "minimum": 1, - "title": "num_images", - "type": "integer", - "x-tool-description": "Number of variations of this one prompt. For different subjects, make separate calls instead of listing them in one prompt." - }, - "resolution": { - "allOf": [ - { - "$ref": "#/components/schemas/ResolutionV4" - } - ], - "description": "Optional. When supplied, the images are generated at this\nresolution. When omitted, an aspect ratio is picked automatically\nbased on the prompt.\n", - "title": "resolution", - "x-tool-description": "Output resolution; omit to choose an aspect ratio from the prompt.", - "x-playground-field": { - "label": "Resolution", - "order": 2, - "default": "2048x2048", - "enum_subset": [ - "2048x2048", - "1440x2880", - "2880x1440", - "1664x2496" - ] - } - }, - "rendering_speed": { - "default": "default", - "description": "The rendering speed to use.", - "enum": [ - "turbo", - "default", - "quality" - ], - "title": "rendering_speed", - "type": "string", - "x-playground-field": { - "label": "Rendering speed", - "order": 3, - "default": "default", - "enum_subset": [ - "default", - "turbo", - "quality" - ], - "labels": { - "default": "Default", - "turbo": "Turbo", - "quality": "Quality" - } - } - }, - "enable_copyright_detection": { - "description": "Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`.", - "nullable": true, - "title": "enable_copyright_detection", - "type": "boolean", - "x-tool-description": "Check outputs for copyright; adds latency. Flagged images have is_image_safe: false.", - "x-playground-field": { - "label": "Copyright detection", - "order": 4, - "default": false - } - }, - "async": { - "default": false, - "description": "When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.", - "title": "async", - "type": "boolean", - "x-tool-description": "Always overridden to true; tools run asynchronously." - }, - "webhook_url": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - }, - "private": { - "description": "When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately.", - "nullable": true, - "title": "private", - "type": "boolean", - "x-tool-description": "true keeps the output private; false publishes it. Enterprise output is always private." - }, - "target_collection_id": { - "description": "A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes.", - "title": "target_collection_id", - "type": "string", - "x-tool-description": "Destination collection ID (URL-safe base64); must be writable." - } - }, - "required": [ - "prompt" - ], - "title": "GenerateImageIdeogramV4Request", - "type": "object" - }, - "GenerateImageIdeogramV4CustomModelResponse": { - "description": "Response returned by `POST /v2/image/generate/ideogram-4-custom-model`.\nSynchronous requests (the default) include the generated images in\n`data`. Asynchronous requests omit `data`; poll\n`GET /v2/generations/{generation_id}` with the returned\n`generation_id`. `seed` is the seed that was used, including when you\ndid not set one.\n", - "example": { - "data": [ - { - "seed": 12345, - "prompt": "prompt", - "resolution": "1024x1024", - "url": "https://openapi-generator.tech", - "is_image_safe": true - }, - { - "seed": 12345, - "prompt": "prompt", - "resolution": "1024x1024", - "url": "https://openapi-generator.tech", - "is_image_safe": true - } - ], - "seed": 12345, - "generation_id": "generation_id" - }, - "properties": { - "generation_id": { - "description": "URL-safe base64 ID of the generation. Use it to poll\n`GET /v2/generations/{generation_id}`.\n", - "title": "generation_id", - "type": "string" - }, - "data": { - "description": "The generated images, in generation order. Present only for synchronous requests (`async` omitted or false).", - "items": { - "$ref": "#/components/schemas/GeneratedImageObject" - }, - "title": "data", - "type": "array" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - } - }, - "required": [ - "generation_id", - "seed" - ], - "title": "GenerateImageIdeogramV4CustomModelResponse", - "type": "object" - }, - "GenerateImageIdeogramV4CustomModelRequest": { - "example": { - "private": true, - "seed": 12345, - "rendering_speed": "turbo", - "webhook_url": "https://api.example.com/webhooks/ideogram", - "target_collection_id": "target_collection_id", - "custom_model_uri": "model/my-custom-v4-model/version/1", - "resolution": "", - "transparent_background": false, - "num_images": 1, - "magic_prompt": "", - "async": false, - "enable_copyright_detection": true, - "stacked_custom_models": [ - { - "custom_model_uri": "model/my-base-plora/version/1", - "weight": 0.5 - } - ], - "prompt": "prompt" - }, - "properties": { - "prompt": { - "description": "The prompt to generate images from, in natural language or as a\nstructured Ideogram 4.0 JSON prompt. A structured JSON prompt is\nused as is and skips magic prompt unless `magic_prompt` is `on`.\n", - "maxLength": 10000, - "minLength": 1, - "title": "prompt", - "type": "string", - "x-tool-description": "Natural language or Ideogram 4.0 JSON. JSON is used unchanged, skipping rewriting unless magic_prompt is on." - }, - "custom_model_uri": { - "description": "The custom model URI, in the form `model//version/`. You or your organization must have access to the model. The model determines which rendering speeds are supported.", - "example": "model/my-custom-v4-model/version/1", - "maxLength": 512, - "minLength": 1, - "pattern": "^model/[^/]+/version/[^/]+$", - "title": "custom_model_uri", - "type": "string" - }, - "transparent_background": { - "default": false, - "description": "Remove the background after generation and return transparent PNG images. Included in the custom model generation price at no extra charge. When false, the model's automatic background removal behavior still applies.", - "title": "transparent_background", - "type": "boolean" - }, - "stacked_custom_models": { - "description": "Custom models whose pLoRA checkpoints are fused beneath the `custom_model_uri` model, in list order: the first entry is applied first and `custom_model_uri` last. Every entry must be an accessible Ideogram 4.0 LoRA with a registered checkpoint and must not repeat `custom_model_uri`.", - "example": [ - { - "custom_model_uri": "model/my-base-plora/version/1", - "weight": 0.5 - } - ], - "items": { - "$ref": "#/components/schemas/StackedCustomModel" - }, - "maxItems": 4, - "minItems": 1, - "title": "stacked_custom_models", - "type": "array" - }, - "magic_prompt": { - "allOf": [ - { - "$ref": "#/components/schemas/MagicPromptMode" - } - ], - "default": "auto", - "description": "Controls how a natural-language prompt is prepared. `auto` (the\ndefault) and `on` rewrite and expand the prompt before generation.\n`off` keeps your wording and only converts it into a structured\nprompt. A valid structured JSON prompt skips magic prompt unless\n`magic_prompt` is `on`.\n", - "title": "magic_prompt", - "x-tool-description": "For natural language, `auto` and `on` rewrite; `off` only converts to structured format. Structured JSON bypasses rewriting unless `on`." - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - }, - "num_images": { - "default": 1, - "description": "The number of images to generate.", - "maximum": 8, - "minimum": 1, - "title": "num_images", - "type": "integer", - "x-tool-description": "Number of variations of this one prompt. For different subjects, make separate calls instead of listing them in one prompt." - }, - "resolution": { - "allOf": [ - { - "$ref": "#/components/schemas/ResolutionV4" - } - ], - "description": "Optional. When supplied, the images are generated at this\nresolution. When omitted, an aspect ratio is picked automatically\nbased on the prompt.\n", - "title": "resolution", - "x-tool-description": "Output resolution; omit to choose an aspect ratio from the prompt." - }, - "rendering_speed": { - "description": "The rendering speed to use. When omitted, a speed supported by the custom model is used.", - "enum": [ - "turbo", - "default", - "quality" - ], - "title": "rendering_speed", - "type": "string" - }, - "enable_copyright_detection": { - "description": "Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`.", - "nullable": true, - "title": "enable_copyright_detection", - "type": "boolean", - "x-tool-description": "Check outputs for copyright; adds latency. Flagged images have is_image_safe: false." - }, - "async": { - "default": false, - "description": "When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.", - "title": "async", - "type": "boolean", - "x-tool-description": "Always overridden to true; tools run asynchronously." - }, - "webhook_url": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - }, - "private": { - "description": "When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately.", - "nullable": true, - "title": "private", - "type": "boolean", - "x-tool-description": "true keeps the output private; false publishes it. Enterprise output is always private." - }, - "target_collection_id": { - "description": "A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes.", - "title": "target_collection_id", - "type": "string", - "x-tool-description": "Destination collection ID (URL-safe base64); must be writable." - } - }, - "required": [ - "custom_model_uri", - "prompt" - ], - "title": "GenerateImageIdeogramV4CustomModelRequest", - "type": "object" - }, - "StackedCustomModel": { - "properties": { - "custom_model_uri": { - "description": "Custom model URI of one stacked layer, in the form `model//version/`.", - "example": "model/my-base-plora/version/1", - "maxLength": 512, - "minLength": 1, - "pattern": "^model/[^/]+/version/[^/]+$", - "title": "custom_model_uri", - "type": "string" - }, - "weight": { - "default": 1.0, - "description": "Scale applied to this layer's pLoRA, multiplied with any weight already registered on its checkpoint(s).", - "example": 0.5, - "exclusiveMinimum": true, - "format": "double", - "minimum": 0, - "title": "weight", - "type": "number" - } - }, - "required": [ - "custom_model_uri" - ], - "title": "StackedCustomModel", - "type": "object" - }, - "RemixImageIdeogramV3Response": { - "description": "Response returned by `POST /v2/image/remix/ideogram-3`.\nSynchronous requests (the default) include the remixed images in\n`data`. Requests with `async` set to true omit `data`; poll for\ncompletion and results with `GET /v2/generations/{generation_id}`\nusing the returned `generation_id`. The seed reports the value the\nrequest resolved to when the caller left it unset.\n", - "example": { - "data": [ - { - "seed": 12345, - "prompt": "prompt", - "resolution": "1024x1024", - "url": "https://openapi-generator.tech", - "is_image_safe": true - }, - { - "seed": 12345, - "prompt": "prompt", - "resolution": "1024x1024", - "url": "https://openapi-generator.tech", - "is_image_safe": true - } - ], - "seed": 12345, - "generation_id": "generation_id" - }, - "properties": { - "generation_id": { - "description": "URL-safe base64 ID of the accepted generation. Accepted by the\n`GET /v2/generations/{generation_id}` polling endpoint.\n", - "title": "generation_id", - "type": "string" - }, - "data": { - "description": "The remixed images, in generation order. Present only for synchronous requests (`async` omitted or false).", - "items": { - "$ref": "#/components/schemas/RemixedImageObject" - }, - "title": "data", - "type": "array" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - } - }, - "required": [ - "generation_id", - "seed" - ], - "title": "RemixImageIdeogramV3Response", - "type": "object" - }, - "RemixedImageObject": { - "description": "One remixed output image.", - "example": { - "seed": 12345, - "prompt": "prompt", - "resolution": "1024x1024", - "url": "https://openapi-generator.tech", - "is_image_safe": true - }, - "properties": { - "url": { - "description": "The direct link to the remixed image. Empty when the image did not pass safety checks.", - "format": "uri", - "nullable": true, - "title": "url", - "type": "string" - }, - "prompt": { - "description": "The final prompt the image was generated from.", - "title": "prompt", - "type": "string" - }, - "resolution": { - "description": "The resolution of the remixed image, formatted as \"WIDTHxHEIGHT\".", - "example": "1024x1024", - "title": "resolution", - "type": "string" - }, - "is_image_safe": { - "description": "Whether the image passed safety checks. If false, `url` is empty.", - "title": "is_image_safe", - "type": "boolean" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - } - }, - "required": [ - "is_image_safe", - "prompt", - "resolution", - "seed" - ], - "title": "RemixedImageObject", - "type": "object" - }, - "RemixImageIdeogramV3Request": { - "properties": { - "prompt": { - "description": "The prompt that guides the remix.", - "maxLength": 10000, - "minLength": 1, - "type": "string" - }, - "image_asset_identifier": { - "allOf": [ - { - "$ref": "#/components/schemas/AssetIdentifier" - } - ], - "description": "The existing upload or generated image to transform. Supply this or `image`, never both. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first.", - "x-tool-description": "Source image asset. Omit resolution and aspect_ratio to keep its shape; shape changes center-crop it first." - }, - "image": { - "description": "The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first.", - "format": "binary", - "type": "string", - "x-tool-description": "Source image (JPEG/PNG/WEBP, max 50MB). Multipart only; saved to your account. Omit resolution and aspect_ratio to keep its shape; shape changes center-crop it first." - }, - "image_weight": { - "description": "Optional. How closely the result should follow the source image, from 1 to 100. When omitted the server chooses a value from your prompt, which is the usual case.", - "maximum": 100, - "minimum": 1, - "type": "integer", - "x-tool-description": "Source fidelity (1–100); omit for prompt-based strength." - }, - "negative_prompt": { - "description": "Description of what to exclude from the images. Descriptions in the prompt take precedence over descriptions in the negative prompt.", - "maxLength": 10000, - "type": "string", - "x-tool-description": "What to exclude; prompt takes precedence." - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - }, - "resolution": { - "$ref": "#/components/schemas/ResolutionV3" - }, - "aspect_ratio": { - "$ref": "#/components/schemas/AspectRatioV3" - }, - "rendering_speed": { - "default": "default", - "description": "The rendering speed to use.", - "enum": [ - "turbo", - "default", - "quality" - ], - "type": "string" - }, - "magic_prompt": { - "allOf": [ - { - "$ref": "#/components/schemas/MagicPromptMode" - } - ], - "default": "auto", - "description": "Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.", - "x-tool-description": "Automatic prompt rewriting; default auto." - }, - "num_images": { - "default": 1, - "description": "The number of images to generate.", - "maximum": 8, - "minimum": 1, - "type": "integer", - "x-tool-description": "Number of variations of this one prompt. For different subjects, make separate calls instead of listing them in one prompt." - }, - "color_palette": { - "$ref": "#/components/schemas/IdeogramColorPalette" - }, - "style_codes": { - "description": "A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.", - "example": [ - "AAFF5733", - "0133FF57", - "DE3357FF" - ], - "items": { - "$ref": "#/components/schemas/StyleCode" - }, - "type": "array", - "x-tool-description": "8-character hex style codes. Allowed combinations with other style controls depend on the operation." - }, - "style_type": { - "$ref": "#/components/schemas/IdeogramV3StyleType" - }, - "style_preset": { - "allOf": [ - { - "$ref": "#/components/schemas/IdeogramV3StylePreset" - } - ], - "description": "A predefined style preset to apply to the remixed images. Cannot be combined with style codes or style references.", - "x-tool-description": "Style preset; excludes style codes and style references." - }, - "style_reference_collection_id": { - "description": "A saved style to apply, by its URL-safe base64 collection id. Cannot be combined with `style_reference_images`.", - "type": "string", - "x-tool-description": "Saved-style collection ID (URL-safe base64); excludes style_reference_asset_identifiers." - }, - "style_reference_collection_version_id": { - "description": "Optional URL-safe base64 version id pinning a specific version of the `style_reference_collection_id` collection. Ignored without it.", - "type": "string", - "x-tool-description": "URL-safe base64 version ID of style_reference_collection_id; ignored without it." - }, - "style_reference_asset_identifiers": { - "description": "Existing upload or generated image assets to use as style references, by reference. Cannot be combined with `style_reference_collection_id` or `style_reference_images`.", - "items": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "maxItems": 10, - "minItems": 1, - "type": "array", - "x-tool-description": "Style-reference image assets; cannot combine with style_reference_collection_id." - }, - "style_reference_images": { - "description": "Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported.", - "items": { - "format": "binary", - "type": "string" - }, - "maxItems": 10, - "type": "array" - }, - "enable_copyright_detection": { - "description": "Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`.", - "nullable": true, - "type": "boolean", - "x-tool-description": "Check outputs for copyright; adds latency. Flagged images have is_image_safe: false." - }, - "async": { - "default": false, - "description": "When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.", - "type": "boolean", - "x-tool-description": "Always overridden to true; tools run asynchronously." - }, - "webhook_url": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - }, - "private": { - "description": "When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately.", - "nullable": true, - "type": "boolean", - "x-tool-description": "true keeps the output private; false publishes it. Enterprise output is always private." - }, - "target_collection_id": { - "description": "A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes.", - "type": "string", - "x-tool-description": "Destination collection ID (URL-safe base64); must be writable." - } - }, - "required": [ - "prompt" - ], - "type": "object" - }, - "RemixImageIdeogramV3CustomModelResponse": { - "description": "Response returned by `POST /v2/image/remix/ideogram-3-custom-model`.\nSynchronous requests (the default) include the remixed images in\n`data`. Requests with `async` set to true omit `data`; poll for\ncompletion and results with `GET /v2/generations/{generation_id}`\nusing the returned `generation_id`. The seed reports the value the\nrequest resolved to when the caller left it unset.\n", - "example": { - "data": [ - { - "seed": 12345, - "prompt": "prompt", - "resolution": "1024x1024", - "url": "https://openapi-generator.tech", - "is_image_safe": true - }, - { - "seed": 12345, - "prompt": "prompt", - "resolution": "1024x1024", - "url": "https://openapi-generator.tech", - "is_image_safe": true - } - ], - "seed": 12345, - "generation_id": "generation_id" - }, - "properties": { - "generation_id": { - "description": "URL-safe base64 ID of the accepted generation. Accepted by the\n`GET /v2/generations/{generation_id}` polling endpoint.\n", - "title": "generation_id", - "type": "string" - }, - "data": { - "description": "The remixed images, in generation order. Present only for synchronous requests (`async` omitted or false).", - "items": { - "$ref": "#/components/schemas/RemixedImageObject" - }, - "title": "data", - "type": "array" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - } - }, - "required": [ - "generation_id", - "seed" - ], - "title": "RemixImageIdeogramV3CustomModelResponse", - "type": "object" - }, - "RemixImageIdeogramV3CustomModelRequest": { - "properties": { - "prompt": { - "description": "The prompt that guides the remix.", - "maxLength": 10000, - "minLength": 1, - "type": "string" - }, - "custom_model_uri": { - "description": "The custom model URI returned by the custom-model API, in the form `model//version/`. The authenticated user or organization must have access to the model.", - "example": "model/my-custom-model/version/1", - "maxLength": 512, - "minLength": 1, - "pattern": "^model/[^/]+/version/[^/]+$", - "type": "string" - }, - "image_asset_identifier": { - "allOf": [ - { - "$ref": "#/components/schemas/AssetIdentifier" - } - ], - "description": "The existing upload or generated image to transform. Supply this or `image`, never both. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first.", - "x-tool-description": "Source image asset. Omit resolution and aspect_ratio to keep its shape; shape changes center-crop it first." - }, - "image": { - "description": "The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first.", - "format": "binary", - "type": "string", - "x-tool-description": "Source image (JPEG/PNG/WEBP, max 50MB). Multipart only; saved to your account. Omit resolution and aspect_ratio to keep its shape; shape changes center-crop it first." - }, - "image_weight": { - "description": "Optional. How closely the result should follow the source image, from 1 to 100. When omitted the server chooses a value from your prompt, which is the usual case.", - "maximum": 100, - "minimum": 1, - "type": "integer", - "x-tool-description": "Source fidelity (1–100); omit for prompt-based strength." - }, - "negative_prompt": { - "description": "Description of what to exclude from the images. Descriptions in the prompt take precedence over descriptions in the negative prompt.", - "maxLength": 10000, - "type": "string", - "x-tool-description": "What to exclude; prompt takes precedence." - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - }, - "resolution": { - "$ref": "#/components/schemas/ResolutionV3" - }, - "aspect_ratio": { - "$ref": "#/components/schemas/AspectRatioV3" - }, - "rendering_speed": { - "description": "The rendering speed to use. When omitted, the server chooses a speed supported by the selected custom model.", - "enum": [ - "turbo", - "default", - "quality" - ], - "type": "string" - }, - "magic_prompt": { - "allOf": [ - { - "$ref": "#/components/schemas/MagicPromptMode" - } - ], - "default": "auto", - "description": "Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.", - "x-tool-description": "Automatic prompt rewriting; default auto." - }, - "num_images": { - "default": 1, - "description": "The number of images to generate.", - "maximum": 8, - "minimum": 1, - "type": "integer", - "x-tool-description": "Number of variations of this one prompt. For different subjects, make separate calls instead of listing them in one prompt." - }, - "color_palette": { - "$ref": "#/components/schemas/IdeogramColorPalette" - }, - "style_codes": { - "description": "A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.", - "example": [ - "AAFF5733", - "0133FF57", - "DE3357FF" - ], - "items": { - "$ref": "#/components/schemas/StyleCode" - }, - "type": "array", - "x-tool-description": "8-character hex style codes. Allowed combinations with other style controls depend on the operation." - }, - "style_preset": { - "allOf": [ - { - "$ref": "#/components/schemas/IdeogramV3StylePreset" - } - ], - "description": "A predefined style preset to apply to the remixed images. Cannot be combined with style codes or style references.", - "x-tool-description": "Style preset; excludes style codes and style references." - }, - "style_reference_asset_identifiers": { - "description": "Existing upload or generated image assets to use as style references, by reference. Takes priority over `style_reference_images` if both are supplied.", - "items": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "maxItems": 10, - "minItems": 1, - "type": "array", - "x-tool-description": "Style-reference image assets." - }, - "style_reference_images": { - "description": "Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported. Multipart requests only.", - "items": { - "format": "binary", - "type": "string" - }, - "maxItems": 10, - "type": "array" - }, - "enable_copyright_detection": { - "description": "Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`.", - "nullable": true, - "type": "boolean", - "x-tool-description": "Check outputs for copyright; adds latency. Flagged images have is_image_safe: false." - }, - "async": { - "default": false, - "description": "When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.", - "type": "boolean", - "x-tool-description": "Always overridden to true; tools run asynchronously." - }, - "webhook_url": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - }, - "private": { - "description": "When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately.", - "nullable": true, - "type": "boolean", - "x-tool-description": "true keeps the output private; false publishes it. Enterprise output is always private." - }, - "target_collection_id": { - "description": "A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes.", - "type": "string", - "x-tool-description": "Destination collection ID (URL-safe base64); must be writable." - } - }, - "required": [ - "custom_model_uri", - "prompt" - ], - "type": "object" - }, - "RemixImageIdeogramV4Response": { - "description": "Response returned by `POST /v2/image/remix/ideogram-4`.\nSynchronous requests (the default) include the remixed images in\n`data`. Requests with `async` set to true omit `data`; poll for\ncompletion and results with `GET /v2/generations/{generation_id}`\nusing the returned `generation_id`. The seed reports the value the\nrequest resolved to.\n", - "example": { - "data": [ - { - "seed": 12345, - "prompt": "prompt", - "resolution": "1024x1024", - "url": "https://openapi-generator.tech", - "is_image_safe": true - }, - { - "seed": 12345, - "prompt": "prompt", - "resolution": "1024x1024", - "url": "https://openapi-generator.tech", - "is_image_safe": true - } - ], - "seed": 12345, - "generation_id": "generation_id" - }, - "properties": { - "generation_id": { - "description": "URL-safe base64 ID of the accepted generation. Accepted by the\n`GET /v2/generations/{generation_id}` polling endpoint.\n", - "title": "generation_id", - "type": "string" - }, - "data": { - "description": "The remixed images, in generation order. Present only for synchronous requests (`async` omitted or false).", - "items": { - "$ref": "#/components/schemas/RemixedImageObject" - }, - "title": "data", - "type": "array" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - } - }, - "required": [ - "generation_id", - "seed" - ], - "title": "RemixImageIdeogramV4Response", - "type": "object" - }, - "RemixImageIdeogramV4Request": { - "description": "Remixes are not reproducible, so no `seed` is accepted; the response\nreports the seed that was used.\n", - "properties": { - "prompt": { - "description": "The prompt that guides the remix. It is always read as an editing instruction, so there is no `magic_prompt` option.", - "maxLength": 10000, - "minLength": 1, - "type": "string", - "x-playground-field": { - "label": "Prompt", - "control": "textarea", - "order": 3, - "default": "Restyle this image as a vibrant watercolor painting.", - "placeholder": "Describe how to remix the image." - } - }, - "image_asset_identifier": { - "allOf": [ - { - "$ref": "#/components/schemas/AssetIdentifier" - } - ], - "description": "The existing upload or generated image to transform. Supply this or `image`, never both. Omit `resolution` to keep its shape.", - "x-tool-description": "The existing upload or generated image to transform. Omit `resolution` to keep its shape.", - "x-playground-field": { - "label": "Image asset identifier", - "control": "json", - "order": 2, - "group": "source", - "placeholder": "{\"asset_type\":\"UPLOAD\",\"asset_id\":\"...\"}" - } - }, - "image": { - "description": "The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` to keep its shape.", - "format": "binary", - "type": "string", - "x-tool-description": "Source image (JPEG/PNG/WEBP, max 50MB). Multipart only; saved to your account. Omit resolution to keep its shape.", - "x-playground-field": { - "label": "Image upload", - "order": 1, - "group": "source" - } - }, - "image_weight": { - "description": "Optional. How closely the result should follow the source image, from 1 to 100. When omitted the server chooses a value from your prompt, which is the usual case. Only accepted when the output keeps the source image's shape: combining `image_weight` with a `resolution` whose aspect ratio differs from the source's is rejected with a 400.", - "maximum": 100, - "minimum": 1, - "type": "integer", - "x-tool-description": "Source fidelity (1–100); omit for prompt-based strength. Combining with a resolution that changes the source aspect ratio returns 400.", - "x-playground-field": { - "label": "Image weight", - "control": "slider", - "order": 4, - "step": 1 - } - }, - "num_images": { - "default": 1, - "description": "The number of images to generate.", - "maximum": 8, - "minimum": 1, - "type": "integer", - "x-tool-description": "Number of variations of this one prompt. For different subjects, make separate calls instead of listing them in one prompt." - }, - "resolution": { - "allOf": [ - { - "$ref": "#/components/schemas/ResolutionV4" - } - ], - "description": "Optional. When supplied, the images are generated at this\nresolution. When omitted, the source image's shape is kept. A\nresolution whose aspect ratio differs from the source's cannot\nbe combined with `image_weight`.\n", - "x-tool-description": "Output resolution; omit to keep the source shape. Aspect-ratio changes cannot combine with image_weight." - }, - "rendering_speed": { - "default": "default", - "description": "The rendering speed to use.", - "enum": [ - "turbo", - "default", - "quality" - ], - "type": "string", - "x-playground-field": { - "label": "Rendering speed", - "order": 5, - "default": "default", - "enum_subset": [ - "default", - "turbo", - "quality" - ], - "labels": { - "default": "Default", - "turbo": "Turbo", - "quality": "Quality" - } - } - }, - "enable_copyright_detection": { - "description": "Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`.", - "nullable": true, - "type": "boolean", - "x-tool-description": "Check outputs for copyright; adds latency. Flagged images have is_image_safe: false.", - "x-playground-field": { - "label": "Copyright detection", - "order": 6, - "default": false - } - }, - "async": { - "default": false, - "description": "When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.", - "type": "boolean", - "x-tool-description": "Always overridden to true; tools run asynchronously." - }, - "webhook_url": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - }, - "private": { - "description": "When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately.", - "nullable": true, - "type": "boolean", - "x-tool-description": "true keeps the output private; false publishes it. Enterprise output is always private." - }, - "target_collection_id": { - "description": "A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes.", - "type": "string", - "x-tool-description": "Destination collection ID (URL-safe base64); must be writable." - } - }, - "required": [ - "prompt" - ], - "type": "object" - }, - "RemixImageIdeogramV3CharacterResponse": { - "description": "Response returned by `POST /v2/image/remix/ideogram-3-character`.\nSynchronous requests (the default) include the remixed images in\n`data`. Requests with `async` set to true omit `data`; poll for\ncompletion and results with `GET /v2/generations/{generation_id}`\nusing the returned `generation_id`. The seed reports the value the\nrequest resolved to when the caller left it unset.\n", - "example": { - "data": [ - { - "seed": 12345, - "prompt": "prompt", - "resolution": "1024x1024", - "url": "https://openapi-generator.tech", - "is_image_safe": true - }, - { - "seed": 12345, - "prompt": "prompt", - "resolution": "1024x1024", - "url": "https://openapi-generator.tech", - "is_image_safe": true - } - ], - "seed": 12345, - "generation_id": "generation_id" - }, - "properties": { - "generation_id": { - "description": "URL-safe base64 ID of the accepted generation. Accepted by the\n`GET /v2/generations/{generation_id}` polling endpoint.\n", - "title": "generation_id", - "type": "string" - }, - "data": { - "description": "The remixed images, in generation order. Present only for synchronous requests (`async` omitted or false).", - "items": { - "$ref": "#/components/schemas/RemixedImageObject" - }, - "title": "data", - "type": "array" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - } - }, - "required": [ - "generation_id", - "seed" - ], - "title": "RemixImageIdeogramV3CharacterResponse", - "type": "object" - }, - "RemixImageIdeogramV3CharacterRequest": { - "description": "Upload one character reference as `character_reference_images` using\n`multipart/form-data`.\n", - "properties": { - "prompt": { - "description": "The prompt that guides the remix.", - "maxLength": 10000, - "minLength": 1, - "type": "string" - }, - "image_asset_identifier": { - "allOf": [ - { - "$ref": "#/components/schemas/AssetIdentifier" - } - ], - "description": "The existing upload or generated image to transform. Supply this or `image`, never both. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first.", - "x-tool-description": "Source image asset. Omit resolution and aspect_ratio to keep its shape; shape changes center-crop it first." - }, - "image": { - "description": "The image to transform (max 50MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The uploaded image is saved to your account as the remix's source. Omit `resolution` and `aspect_ratio` to keep its shape; a different requested shape center-crops the source to fit first.", - "format": "binary", - "type": "string", - "x-tool-description": "Source image (JPEG/PNG/WEBP, max 50MB). Multipart only; saved to your account. Omit resolution and aspect_ratio to keep its shape; shape changes center-crop it first." - }, - "image_weight": { - "description": "Optional. How closely the result should follow the source image, from 1 to 100. When omitted the server chooses a value from your prompt, which is the usual case.", - "maximum": 100, - "minimum": 1, - "type": "integer", - "x-tool-description": "Source fidelity (1–100); omit for prompt-based strength." - }, - "negative_prompt": { - "description": "Description of what to exclude from the images. Descriptions in the prompt take precedence over descriptions in the negative prompt.", - "maxLength": 10000, - "type": "string", - "x-tool-description": "What to exclude; prompt takes precedence." - }, - "character_reference_collection_id": { - "description": "A saved character to feature, by its URL-safe base64 collection id. Takes priority over `character_reference_images` if both are supplied.", - "type": "string", - "x-tool-description": "A saved character to feature, by its URL-safe base64 collection id. Takes priority over `character_reference_asset_identifiers` if more than one is supplied." - }, - "character_reference_collection_version_id": { - "description": "Optional URL-safe base64 version id pinning a specific version of the `character_reference_collection_id` collection. Ignored without it.", - "type": "string" - }, - "character_reference_asset_identifiers": { - "description": "An existing upload or generated image asset to use as the character reference, by reference. Takes priority over `character_reference_images` if both are supplied.", - "items": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "maxItems": 1, - "minItems": 1, - "type": "array", - "x-tool-description": "An existing upload or generated image asset to use as the character reference, by reference." - }, - "character_reference_images": { - "description": "An image to use as the character reference (max 25MB). JPEG, PNG, and WEBP are supported.", - "items": { - "format": "binary", - "type": "string" - }, - "maxItems": 1, - "type": "array" - }, - "character_reference_mask_asset_identifier": { - "allOf": [ - { - "$ref": "#/components/schemas/AssetIdentifier" - } - ], - "description": "An existing upload or generated image asset to use as the character reference mask, by reference. The same rules as `character_reference_mask` apply. Takes priority over `character_reference_mask` if both are supplied.", - "x-tool-description": "Omit." - }, - "character_reference_mask": { - "description": "Optional grayscale mask for the character reference image, the same size as that image, marking where the character is. Only JPEG, PNG, and WEBP formats are supported. Multipart requests only; cannot be combined with `character_reference_collection_id`.", - "format": "binary", - "type": "string" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - }, - "resolution": { - "$ref": "#/components/schemas/ResolutionV3" - }, - "aspect_ratio": { - "$ref": "#/components/schemas/AspectRatioV3" - }, - "rendering_speed": { - "default": "default", - "description": "The rendering speed to use.", - "enum": [ - "turbo", - "default", - "quality" - ], - "type": "string" - }, - "magic_prompt": { - "allOf": [ - { - "$ref": "#/components/schemas/MagicPromptMode" - } - ], - "default": "auto", - "description": "Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.", - "x-tool-description": "Automatic prompt rewriting; default auto." - }, - "num_images": { - "default": 1, - "description": "The number of images to generate.", - "maximum": 8, - "minimum": 1, - "type": "integer", - "x-tool-description": "Number of variations of this one prompt. For different subjects, make separate calls instead of listing them in one prompt." - }, - "style_type": { - "default": "auto", - "description": "The style type to remix the character with. Defaults to `auto`.", - "enum": [ - "auto", - "realistic", - "fiction" - ], - "type": "string" - }, - "style_reference_collection_id": { - "description": "A saved style to apply, by its URL-safe base64 collection id. Takes priority over `style_reference_images` if both are supplied.", - "type": "string", - "x-tool-description": "A saved style to apply, by its URL-safe base64 collection id. Takes priority over `style_reference_asset_identifiers` if more than one is supplied." - }, - "style_reference_collection_version_id": { - "description": "Optional URL-safe base64 version id pinning a specific version of the `style_reference_collection_id` collection. Ignored without it.", - "type": "string", - "x-tool-description": "URL-safe base64 version ID of style_reference_collection_id; ignored without it." - }, - "style_reference_asset_identifiers": { - "description": "Existing upload or generated image assets to use as style references, by reference. Takes priority over `style_reference_images` if both are supplied.", - "items": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "maxItems": 10, - "minItems": 1, - "type": "array", - "x-tool-description": "Style-reference image assets." - }, - "style_reference_images": { - "description": "Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported.", - "items": { - "format": "binary", - "type": "string" - }, - "maxItems": 10, - "type": "array" - }, - "enable_copyright_detection": { - "description": "Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`.", - "nullable": true, - "type": "boolean", - "x-tool-description": "Check outputs for copyright; adds latency. Flagged images have is_image_safe: false." - }, - "async": { - "default": false, - "description": "When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.", - "type": "boolean", - "x-tool-description": "Always overridden to true; tools run asynchronously." - }, - "webhook_url": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - }, - "private": { - "description": "When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately.", - "nullable": true, - "type": "boolean", - "x-tool-description": "true keeps the output private; false publishes it. Enterprise output is always private." - }, - "target_collection_id": { - "description": "A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes.", - "type": "string", - "x-tool-description": "Destination collection ID (URL-safe base64); must be writable." - } - }, - "required": [ - "prompt" - ], - "type": "object", - "x-tool-description": "Supply one character as a saved collection or asset reference. The collection takes priority." - }, - "GenerateImageIdeogramV3TransparentResponse": { - "description": "Response returned by\n`POST /v2/image/generate/ideogram-3-transparent`. Synchronous\nrequests (the default) include the generated images in `data`.\nAsynchronous requests omit `data`; poll\n`GET /v2/generations/{generation_id}` with the returned\n`generation_id`. `seed` is the seed that was used, including when you\ndid not set one.\n", - "example": { - "data": [ - { - "seed": 12345, - "prompt": "prompt", - "resolution": "1024x1024", - "url": "https://openapi-generator.tech", - "is_image_safe": true - }, - { - "seed": 12345, - "prompt": "prompt", - "resolution": "1024x1024", - "url": "https://openapi-generator.tech", - "is_image_safe": true - } - ], - "seed": 12345, - "generation_id": "generation_id" - }, - "properties": { - "generation_id": { - "description": "URL-safe base64 ID of the generation. Use it to poll\n`GET /v2/generations/{generation_id}`.\n", - "title": "generation_id", - "type": "string" - }, - "data": { - "description": "The generated images, in generation order. Present only for synchronous requests (`async` omitted or false).", - "items": { - "$ref": "#/components/schemas/GeneratedImageObject" - }, - "title": "data", - "type": "array" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - } - }, - "required": [ - "generation_id", - "seed" - ], - "title": "GenerateImageIdeogramV3TransparentResponse", - "type": "object" - }, - "GenerateImageIdeogramV3TransparentRequest": { - "example": { - "aspect_ratio": null, - "private": true, - "seed": 12345, - "upscale_factor": "x1", - "rendering_speed": "default", - "webhook_url": "https://api.example.com/webhooks/ideogram", - "target_collection_id": "target_collection_id", - "num_images": 1, - "magic_prompt": "", - "async": false, - "negative_prompt": "negative_prompt", - "enable_copyright_detection": true, - "prompt": "prompt" - }, - "properties": { - "prompt": { - "description": "The prompt to generate images from.", - "maxLength": 10000, - "minLength": 1, - "title": "prompt", - "type": "string" - }, - "negative_prompt": { - "description": "Description of what to exclude from the images. The prompt takes precedence over the negative prompt.", - "maxLength": 10000, - "title": "negative_prompt", - "type": "string", - "x-tool-description": "What to exclude; prompt takes precedence." - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - }, - "upscale_factor": { - "default": "x1", - "description": "Optional enhancement factor applied after generation. `x1` (the default) delivers the base render.", - "enum": [ - "x1", - "x2", - "x4" - ], - "title": "upscale_factor", - "type": "string" - }, - "aspect_ratio": { - "$ref": "#/components/schemas/IdeogramV3AspectRatio" - }, - "rendering_speed": { - "default": "default", - "description": "The rendering speed to use.", - "enum": [ - "turbo", - "default", - "quality" - ], - "title": "rendering_speed", - "type": "string" - }, - "magic_prompt": { - "allOf": [ - { - "$ref": "#/components/schemas/MagicPromptMode" - } - ], - "default": "auto", - "description": "Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.", - "title": "magic_prompt", - "x-tool-description": "Automatic prompt rewriting; default auto." - }, - "num_images": { - "default": 1, - "description": "The number of images to generate.", - "maximum": 8, - "minimum": 1, - "title": "num_images", - "type": "integer", - "x-tool-description": "Number of variations of this one prompt. For different subjects, make separate calls instead of listing them in one prompt." - }, - "enable_copyright_detection": { - "description": "Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`.", - "nullable": true, - "title": "enable_copyright_detection", - "type": "boolean", - "x-tool-description": "Check outputs for copyright; adds latency. Flagged images have is_image_safe: false." - }, - "async": { - "default": false, - "description": "When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.", - "title": "async", - "type": "boolean", - "x-tool-description": "Always overridden to true; tools run asynchronously." - }, - "webhook_url": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - }, - "private": { - "description": "When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately.", - "nullable": true, - "title": "private", - "type": "boolean", - "x-tool-description": "true keeps the output private; false publishes it. Enterprise output is always private." - }, - "target_collection_id": { - "description": "A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes.", - "title": "target_collection_id", - "type": "string", - "x-tool-description": "Destination collection ID (URL-safe base64); must be writable." - } - }, - "required": [ - "prompt" - ], - "title": "GenerateImageIdeogramV3TransparentRequest", - "type": "object" - }, - "GenerateImageIdeogramV4TransparentResponse": { - "description": "Response returned by\n`POST /v2/image/generate/ideogram-4-transparent`. Synchronous\nrequests (the default) include the generated images in `data`.\nAsynchronous requests omit `data`; poll\n`GET /v2/generations/{generation_id}` with the returned\n`generation_id`. `seed` is the seed that was used, including when you\ndid not set one.\n", - "example": { - "data": [ - { - "seed": 12345, - "prompt": "prompt", - "resolution": "1024x1024", - "url": "https://openapi-generator.tech", - "is_image_safe": true - }, - { - "seed": 12345, - "prompt": "prompt", - "resolution": "1024x1024", - "url": "https://openapi-generator.tech", - "is_image_safe": true - } - ], - "seed": 12345, - "generation_id": "generation_id" - }, - "properties": { - "generation_id": { - "description": "URL-safe base64 ID of the generation. Use it to poll\n`GET /v2/generations/{generation_id}`.\n", - "title": "generation_id", - "type": "string" - }, - "data": { - "description": "The generated images, in generation order. Present only for synchronous requests (`async` omitted or false).", - "items": { - "$ref": "#/components/schemas/GeneratedImageObject" - }, - "title": "data", - "type": "array" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - } - }, - "required": [ - "generation_id", - "seed" - ], - "title": "GenerateImageIdeogramV4TransparentResponse", - "type": "object" - }, - "GenerateImageIdeogramV4TransparentRequest": { - "example": { - "magic_prompt": "", - "aspect_ratio": null, - "async": false, - "private": true, - "seed": 12345, - "rendering_speed": "default", - "webhook_url": "https://api.example.com/webhooks/ideogram", - "enable_copyright_detection": true, - "target_collection_id": "target_collection_id", - "output_resolution": "1k", - "prompt": "prompt", - "num_images": 1 - }, - "properties": { - "prompt": { - "description": "The prompt to generate images from, in natural language or as a\nstructured Ideogram 4.0 JSON prompt. A structured JSON prompt is\nused as is and skips magic prompt, except that its background\ndescription is replaced with a transparent background.\n", - "maxLength": 10000, - "minLength": 1, - "title": "prompt", - "type": "string" - }, - "magic_prompt": { - "allOf": [ - { - "$ref": "#/components/schemas/MagicPromptMode" - } - ], - "default": "auto", - "description": "Controls how a natural-language prompt is prepared. `auto` (the\ndefault) and `on` rewrite and expand the prompt before generation.\n`off` keeps your wording and only converts it into a structured\nprompt. A valid structured JSON prompt skips magic prompt unless\n`magic_prompt` is `on`.\n", - "title": "magic_prompt" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - }, - "num_images": { - "default": 1, - "description": "The number of images to generate.", - "maximum": 8, - "minimum": 1, - "title": "num_images", - "type": "integer", - "x-tool-description": "Number of variations of this one prompt. For different subjects, make separate calls instead of listing them in one prompt." - }, - "aspect_ratio": { - "$ref": "#/components/schemas/IdeogramV4AspectRatio" - }, - "output_resolution": { - "default": "1k", - "description": "The output resolution tier. Each tier is a total pixel budget equal\nto a square of the named size (for example, `8k` delivers at most\n8192x8192 pixels in total). Wide and tall aspect ratios keep the\nsame budget, so one side may exceed the named size. Tiers above\n2k are produced by upscaling after generation. Defaults to 1k.\n", - "enum": [ - "1k", - "2k", - "4k", - "8k" - ], - "title": "output_resolution", - "type": "string" - }, - "rendering_speed": { - "default": "default", - "description": "The rendering speed to use.", - "enum": [ - "turbo", - "default", - "quality" - ], - "title": "rendering_speed", - "type": "string" - }, - "enable_copyright_detection": { - "description": "Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`.", - "nullable": true, - "title": "enable_copyright_detection", - "type": "boolean", - "x-tool-description": "Check outputs for copyright; adds latency. Flagged images have is_image_safe: false." - }, - "async": { - "default": false, - "description": "When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.", - "title": "async", - "type": "boolean", - "x-tool-description": "Always overridden to true; tools run asynchronously." - }, - "webhook_url": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - }, - "private": { - "description": "When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately.", - "nullable": true, - "title": "private", - "type": "boolean", - "x-tool-description": "true keeps the output private; false publishes it. Enterprise output is always private." - }, - "target_collection_id": { - "description": "A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes.", - "title": "target_collection_id", - "type": "string", - "x-tool-description": "Destination collection ID (URL-safe base64); must be writable." - } - }, - "required": [ - "prompt" - ], - "title": "GenerateImageIdeogramV4TransparentRequest", - "type": "object" - }, - "GenerateImagePImageIdeogramResponse": { - "description": "Response returned by `POST /v2/image/generate/p-image-ideogram`.\nSynchronous requests (the default) include the generated images in\n`data`. Asynchronous requests omit `data`; poll\n`GET /v2/generations/{generation_id}` with the returned\n`generation_id`. `seed` is the seed that was used, including when you\ndid not set one.\n", - "example": { - "data": [ - { - "seed": 12345, - "prompt": "prompt", - "resolution": "1024x1024", - "url": "https://openapi-generator.tech", - "is_image_safe": true - }, - { - "seed": 12345, - "prompt": "prompt", - "resolution": "1024x1024", - "url": "https://openapi-generator.tech", - "is_image_safe": true - } - ], - "seed": 12345, - "generation_id": "generation_id" - }, - "properties": { - "generation_id": { - "description": "URL-safe base64 ID of the generation. Use it to poll\n`GET /v2/generations/{generation_id}`.\n", - "title": "generation_id", - "type": "string" - }, - "data": { - "description": "The generated images, in generation order. Present only for synchronous requests (`async` omitted or false).", - "items": { - "$ref": "#/components/schemas/GeneratedImageObject" - }, - "title": "data", - "type": "array" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - } - }, - "required": [ - "generation_id", - "seed" - ], - "title": "GenerateImagePImageIdeogramResponse", - "type": "object" - }, - "GenerateImagePImageIdeogramRequest": { - "example": { - "aspect_ratio": "", - "custom_height": 1, - "private": true, - "seed": 12345, - "webhook_url": "https://api.example.com/webhooks/ideogram", - "custom_width": 6, - "target_collection_id": "target_collection_id", - "resolution": "1k", - "num_images": 1, - "quality": "", - "magic_prompt": "", - "async": false, - "enable_copyright_detection": true, - "prompt": "prompt" - }, - "properties": { - "prompt": { - "description": "The prompt to generate images from, in natural language or as a\nstructured Ideogram 4.0 JSON prompt.\n", - "maxLength": 10000, - "minLength": 1, - "title": "prompt", - "type": "string" - }, - "magic_prompt": { - "allOf": [ - { - "$ref": "#/components/schemas/MagicPromptMode" - } - ], - "default": "auto", - "description": "Controls magic prompt (automatic prompt rewriting). `off` disables magic prompt entirely. Defaults to `auto`.", - "title": "magic_prompt" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - }, - "num_images": { - "default": 1, - "description": "The number of images to generate.", - "maximum": 8, - "minimum": 1, - "title": "num_images", - "type": "integer", - "x-tool-description": "Number of variations of this one prompt. For different subjects, make separate calls instead of listing them in one prompt." - }, - "quality": { - "allOf": [ - { - "$ref": "#/components/schemas/GenerationQuality" - } - ], - "default": "medium", - "description": "The generation quality level. Defaults to `medium`.", - "title": "quality" - }, - "resolution": { - "description": "The output size tier. Defaults to `1k`. Cannot be combined with `custom_width`/`custom_height`.", - "enum": [ - "1k", - "2k" - ], - "nullable": true, - "title": "resolution", - "type": "string" - }, - "aspect_ratio": { - "allOf": [ - { - "$ref": "#/components/schemas/AspectRatioV3" - } - ], - "default": "1x1", - "description": "The output aspect ratio. Defaults to `1x1`.", - "title": "aspect_ratio" - }, - "custom_width": { - "description": "Optional. An exact output width in pixels, used together with\n`custom_height` for output sizes outside the preset tiers. Must\nbe a positive multiple of 16 between 16 and 4096, and\n`custom_width` × `custom_height` must not exceed 4,194,304 pixels\n(2048×2048). Cannot be combined with `resolution` or\n`aspect_ratio`; the request is billed at the resolution tier\nmatching its total pixel count.\n", - "nullable": true, - "title": "custom_width", - "type": "integer" - }, - "custom_height": { - "description": "Optional. An exact output height in pixels, used together with\n`custom_width`. See `custom_width` for the accepted range and\nbilling behavior.\n", - "nullable": true, - "title": "custom_height", - "type": "integer" - }, - "enable_copyright_detection": { - "description": "Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`.", - "nullable": true, - "title": "enable_copyright_detection", - "type": "boolean", - "x-tool-description": "Check outputs for copyright; adds latency. Flagged images have is_image_safe: false." - }, - "async": { - "default": false, - "description": "When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.", - "title": "async", - "type": "boolean", - "x-tool-description": "Always overridden to true; tools run asynchronously." - }, - "webhook_url": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - }, - "private": { - "description": "When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately.", - "nullable": true, - "title": "private", - "type": "boolean", - "x-tool-description": "true keeps the output private; false publishes it. Enterprise output is always private." - }, - "target_collection_id": { - "description": "A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes.", - "title": "target_collection_id", - "type": "string", - "x-tool-description": "Destination collection ID (URL-safe base64); must be writable." - } - }, - "required": [ - "prompt" - ], - "title": "GenerateImagePImageIdeogramRequest", - "type": "object" - }, - "GenerateImageZImageResponse": { - "description": "Response returned by `POST /v2/image/generate/z-image`. Synchronous\nrequests (the default) include the generated images in `data`.\nAsynchronous requests omit `data`; poll\n`GET /v2/generations/{generation_id}` with the returned\n`generation_id`. `seed` is the seed that was used, including when you\ndid not set one.\n", - "example": { - "data": [ - { - "seed": 12345, - "prompt": "prompt", - "resolution": "1024x1024", - "url": "https://openapi-generator.tech", - "is_image_safe": true - }, - { - "seed": 12345, - "prompt": "prompt", - "resolution": "1024x1024", - "url": "https://openapi-generator.tech", - "is_image_safe": true - } - ], - "seed": 12345, - "generation_id": "generation_id" - }, - "properties": { - "generation_id": { - "description": "URL-safe base64 ID of the generation. Use it to poll\n`GET /v2/generations/{generation_id}`.\n", - "title": "generation_id", - "type": "string" - }, - "data": { - "description": "The generated images, in generation order. Present only for synchronous requests (`async` omitted or false).", - "items": { - "$ref": "#/components/schemas/GeneratedImageObject" - }, - "title": "data", - "type": "array" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - } - }, - "required": [ - "generation_id", - "seed" - ], - "title": "GenerateImageZImageResponse", - "type": "object" - }, - "GenerateImageZImageRequest": { - "example": { - "async": false, - "private": true, - "seed": 12345, - "webhook_url": "https://api.example.com/webhooks/ideogram", - "target_collection_id": "target_collection_id", - "prompt": "A futuristic cityscape at golden hour, highly detailed.", - "resolution": "1024x1024", - "num_images": 1, - "num_inference_steps": 8 - }, - "properties": { - "prompt": { - "description": "The prompt to generate images from.", - "example": "A futuristic cityscape at golden hour, highly detailed.", - "maxLength": 10000, - "minLength": 1, - "title": "prompt", - "type": "string" - }, - "resolution": { - "description": "Exact output resolution, formatted as \"WIDTHxHEIGHT\". Each side must be a positive multiple of 16 and the total area must not exceed 1,048,576 pixels (1024×1024). When omitted, the model's default 1024×1024 is used.", - "example": "1024x1024", - "nullable": true, - "title": "resolution", - "type": "string" - }, - "num_inference_steps": { - "description": "Optional number of diffusion steps. When omitted, the model's\ndefault is used. Higher values improve quality but take longer.\n", - "example": 8, - "maximum": 128, - "minimum": 1, - "nullable": true, - "title": "num_inference_steps", - "type": "integer" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - }, - "num_images": { - "default": 1, - "description": "The number of images to generate.", - "maximum": 8, - "minimum": 1, - "title": "num_images", - "type": "integer", - "x-tool-description": "Number of variations of this one prompt. For different subjects, make separate calls instead of listing them in one prompt." - }, - "async": { - "default": false, - "description": "When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.", - "title": "async", - "type": "boolean", - "x-tool-description": "Always overridden to true; tools run asynchronously." - }, - "webhook_url": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - }, - "private": { - "description": "When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately.", - "nullable": true, - "title": "private", - "type": "boolean", - "x-tool-description": "true keeps the output private; false publishes it. Enterprise output is always private." - }, - "target_collection_id": { - "description": "A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes.", - "title": "target_collection_id", - "type": "string", - "x-tool-description": "Destination collection ID (URL-safe base64); must be writable." - } - }, - "required": [ - "prompt" - ], - "title": "GenerateImageZImageRequest", - "type": "object" - }, - "GenerateImageIdeogram45Response": { - "description": "Response returned by `POST /v2/image/generate/ideogram-4-5`.\nSynchronous requests (the default) include the generated images in\n`data`. Asynchronous requests omit `data`; poll\n`GET /v2/generations/{generation_id}` with the returned\n`generation_id`. `seed` is the seed that was used, including when you\ndid not set one.\n", - "example": { - "generation_kind": null, - "data": [ - { - "seed": 12345, - "prompt": "prompt", - "resolution": "1024x1024", - "url": "https://openapi-generator.tech", - "is_image_safe": true - }, - { - "seed": 12345, - "prompt": "prompt", - "resolution": "1024x1024", - "url": "https://openapi-generator.tech", - "is_image_safe": true - } - ], - "seed": 12345, - "generation_id": "generation_id" - }, - "properties": { - "generation_kind": { - "$ref": "#/components/schemas/GenerationKind" - }, - "generation_id": { - "description": "URL-safe base64 ID of the generation. Use it to poll\n`GET /v2/generations/{generation_id}`.\n", - "title": "generation_id", - "type": "string" - }, - "data": { - "description": "The generated images, in generation order. Present only for synchronous requests (`async` omitted or false).", - "items": { - "$ref": "#/components/schemas/GeneratedImageObject" - }, - "title": "data", - "type": "array" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - } - }, - "required": [ - "generation_id", - "generation_kind", - "seed" - ], - "title": "GenerateImageIdeogram45Response", - "type": "object" - }, - "GenerateImageIdeogram45Request": { - "description": "Source `images` are optional. When supplied, the request edits them\nand `size` defaults to \"auto\". A prompt is required either way.\n", - "properties": { - "prompt": { - "description": "The prompt to generate images from, or the edit instruction when\nsource images are supplied. Natural language or a structured\nIdeogram 4.0 JSON prompt.\n", - "maxLength": 10000, - "minLength": 1, - "type": "string", - "x-tool-description": "Generation prompt, or the edit instruction when image_asset_identifiers are supplied.", - "x-playground-field": { - "label": "Prompt", - "control": "textarea", - "order": 1, - "default": "A cinematic product shot of a tabby cat sleeping on a modern couch, soft daylight, rich texture, highly detailed.", - "placeholder": "Describe the image you want to generate." - } - }, - "magic_prompt": { - "allOf": [ - { - "$ref": "#/components/schemas/MagicPromptMode" - } - ], - "default": "auto", - "description": "Controls how a natural-language prompt is prepared. `auto` (the\ndefault) and `on` rewrite and expand the prompt before generation.\n`off` keeps your wording and only converts it into a structured\nprompt. A valid structured JSON prompt skips magic prompt unless\n`magic_prompt` is `on`. With source images, every mode converts\nthe edit instruction into a structured edit prompt.\n" - }, - "image_asset_identifiers": { - "description": "Existing upload or generated image assets to transform, by reference. Takes priority over `images` if both are supplied. The first source is the primary image; any further sources are additional references. Supplying sources turns the request into an image-to-image transform.", - "items": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "maxItems": 5, - "minItems": 1, - "type": "array", - "x-tool-description": "Up to 5 image assets. The first is the image being edited; any others are references (e.g. a product, logo, or style to bring in)." - }, - "images": { - "description": "Optional source images to edit (max 5, max 25MB each; JPEG, PNG, or WEBP). The first image is the one being edited; any others are extra references. Multipart requests only.", - "items": { - "format": "binary", - "type": "string" - }, - "maxItems": 5, - "type": "array", - "x-tool-description": "File upload only; tools cannot send it. Use image_asset_identifiers." - }, - "mask_asset_identifier": { - "allOf": [ - { - "$ref": "#/components/schemas/AssetIdentifier" - } - ], - "description": "An existing upload or generated image asset to use as the mask, by reference. The same rules as `mask` apply. Takes priority over `mask` if both are supplied.", - "x-tool-description": "Omit. Use precise_edit_ideogram_4_5 for targeted edits." - }, - "mask": { - "description": "An optional mask that limits the edit to part of the first source image (max 25MB; JPEG, PNG, or WEBP). Multipart requests only. Black marks the area to edit and white the area to keep; values in between are rounded to the nearer of the two. The mask must have the same width and height as the first source image and contain both black and white areas. A masked request can include at most three other source images. With a mask, the output is always the first source image's own size, so `size` cannot be set.", - "format": "binary", - "type": "string", - "x-tool-description": "File upload only; tools cannot send it. Use precise_edit_ideogram_4_5 for targeted edits." - }, - "size": { - "default": "auto", - "description": "The output size: \"auto\", \"source\" or an exact \"WIDTHxHEIGHT\".\n\nWithout source images, an exact size must be one of the supported\n1K/2K presets (for example 1024x1024, 2048x2048 or 1440x2880);\n\"auto\" or omitted picks a supported size based on the prompt.\n\"source\" is rejected.\n\nWith source images, \"auto\" (the default) picks a supported 2K size\nbased on the source images and the prompt, and \"source\" returns the\noutput at the first source image's own width and height (scaled\ndown, keeping its proportions, if it is too large for the model).\nEvery source image's aspect ratio must be between 1:6 and 6:1.\n\nAn exact size must have both sides a multiple of 32 and at least\n256px, a total of at most 2048x2048 pixels, and an aspect ratio of\nat most 6:1. With source images, an exact size reshapes the source\nto it.\n\nPricing is tiered by the resolved output pixels: up to 1024x1024\nbills as 1K, above that as 2K. An \"auto\" size bills as 2K.\n", - "example": "2048x2048", - "nullable": true, - "type": "string", - "x-tool-description": "The output shape; this operation has no resolution or aspect_ratio field. Omit for auto, which renders at 2K. Without image_asset_identifiers, use the 2K size closest to the requested aspect ratio: 2048x2048 (1:1), 1792x2240 (4:5), 2240x1792 (5:4), 1728x2304 (3:4), 2304x1728 (4:3), 1664x2496 (2:3), 2496x1664 (3:2), 1440x2560 (9:16), 2560x1440 (16:9), 1600x2560 (5:8), 2560x1600 (8:5), 1440x2880 (1:2), 2880x1440 (2:1), 1280x3072 (5:12), 3072x1280 (12:5), 1248x3328 (3:8), 3328x1248 (8:3), 1152x2944 (9:23), 2944x1152 (23:9), 1296x3168 (9:22), 3168x1296 (22:9), 1024x3072 (1:3), 3072x1024 (3:1). Use a 1K size (1024x1024, 896x1120, 1120x896, 864x1152, 1152x864, 832x1248, 1248x832, 800x1280, 1280x800, 720x1280, 1280x720, 720x1440, 1440x720) only when the user asks for a smaller image. With image_asset_identifiers, \"source\" keeps the first image's size, and an exact WIDTHxHEIGHT (sides multiples of 32 and at least 256px, at most 2048x2048 total pixels, ratio up to 6:1) reshapes it; the 720-pixel 1K sizes are not multiples of 32, so use 1344x768 or 768x1344 for 16:9 or 9:16 edits.", - "x-playground-field": { - "label": "Size", - "control": "select", - "order": 2, - "default": "auto", - "enum_subset": [ - "auto", - "1024x1024", - "2048x2048", - "2560x1440", - "1440x2560", - "2496x1664", - "1664x2496" - ], - "labels": { - "auto": "Auto (from the prompt)" - } - } - }, - "background": { - "default": "auto", - "description": "The output background. `transparent` returns images with an alpha channel, `opaque` returns a solid one, and `auto` decides for you.", - "enum": [ - "auto", - "transparent", - "opaque" - ], - "type": "string", - "x-tool-description": "Leave unset unless the user explicitly asks for a transparent or a solid background.", - "x-playground-field": { - "label": "Background", - "order": 5, - "default": "auto", - "labels": { - "auto": "Auto", - "transparent": "Transparent", - "opaque": "Opaque" - } - } - }, - "quality": { - "description": "The rendering quality to use. Higher quality takes longer and costs more. Defaults to `medium` with source images and `high` without. `very_low`, the fastest and cheapest, requires source images.", - "enum": [ - "very_low", - "low", - "medium", - "high" - ], - "type": "string", - "x-tool-description": "Always set to medium. Do not choose high, low, or very_low, even for final or print output.", - "x-playground-field": { - "label": "Quality", - "order": 3, - "default": "high", - "enum_subset": [ - "high", - "medium", - "low" - ], - "labels": { - "high": "High", - "medium": "Medium", - "low": "Low" - } - } - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - }, - "num_images": { - "default": 1, - "description": "The number of images to generate.", - "maximum": 8, - "minimum": 1, - "type": "integer", - "x-tool-description": "Number of variations of this one prompt. For different subjects, make separate calls instead of listing them in one prompt." - }, - "enable_copyright_detection": { - "description": "Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`.", - "nullable": true, - "type": "boolean", - "x-tool-description": "Check outputs for copyright; adds latency. Flagged images have is_image_safe: false.", - "x-playground-field": { - "label": "Copyright detection", - "order": 4, - "default": false - } - }, - "async": { - "default": false, - "description": "When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.", - "type": "boolean", - "x-tool-description": "Always overridden to true; tools run asynchronously." - }, - "webhook_url": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - }, - "private": { - "description": "When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately.", - "nullable": true, - "type": "boolean", - "x-tool-description": "true keeps the output private; false publishes it. Enterprise output is always private." - }, - "target_collection_id": { - "description": "A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes.", - "type": "string", - "x-tool-description": "Destination collection ID (URL-safe base64); must be writable." - } - }, - "required": [ - "prompt" - ], - "type": "object", - "x-tool-constraints": { - "anyOf": [ - { - "properties": { - "quality": { - "enum": [ - "low", - "medium", - "high" - ] - } - } - }, - { - "required": [ - "image_asset_identifiers" - ] - } - ] - }, - "x-tool-description": "Supply image_asset_identifiers to edit existing images; omit them to generate from text. Never send images or mask." - }, - "PreciseEditImageIdeogram45Response": { - "description": "Response returned by `POST /v2/image/precise-edit/ideogram-4-5`.\nSynchronous requests (the default) include the edited images in `data`.\nAsynchronous requests omit `data`; poll\n`GET /v2/generations/{generation_id}` with the returned\n`generation_id`.\n", - "example": { - "generation_kind": null, - "data": [ - { - "seed": 12345, - "prompt": "prompt", - "resolution": "1024x1024", - "url": "https://openapi-generator.tech", - "is_image_safe": true - }, - { - "seed": 12345, - "prompt": "prompt", - "resolution": "1024x1024", - "url": "https://openapi-generator.tech", - "is_image_safe": true - } - ], - "seed": 0, - "generation_id": "generation_id" - }, - "properties": { - "generation_kind": { - "$ref": "#/components/schemas/GenerationKind" - }, - "generation_id": { - "description": "URL-safe base64 ID of the generation. Use it to poll\n`GET /v2/generations/{generation_id}`.\n", - "title": "generation_id", - "type": "string" - }, - "data": { - "description": "The edited images, in generation order. Present only for synchronous requests (`async` omitted or false).", - "items": { - "$ref": "#/components/schemas/GeneratedImageObject" - }, - "title": "data", - "type": "array" - }, - "seed": { - "description": "The seed that was used, including when you did not set one.", - "title": "seed", - "type": "integer" - } - }, - "required": [ - "generation_kind" - ], - "title": "PreciseEditImageIdeogram45Response", - "type": "object" - }, - "PreciseEditImageIdeogram45Request": { - "description": "A request to edit one image. The `image` to edit is required. The\noutput is always returned at that image's exact width and height, so\nthis request takes no output size.\n", - "properties": { - "prompt": { - "description": "The edit instruction, in natural language or as a structured JSON\nprompt. Natural language is automatically converted into a\nstructured prompt; valid structured JSON is used as is.\n", - "maxLength": 10000, - "minLength": 1, - "type": "string", - "x-tool-description": "Edit instruction naming only what changes; say what must stay unchanged if it matters." - }, - "image_asset_identifier": { - "allOf": [ - { - "$ref": "#/components/schemas/AssetIdentifier" - } - ], - "description": "The image to edit, as an existing upload or generated image asset. Supply this or `image`, never both. Takes priority over `image` if both are supplied.", - "x-tool-description": "Required. The image asset to edit; copy asset_id and asset_type from the result or upload." - }, - "image": { - "description": "The image to edit, as raw bytes (max 50MB; JPEG, PNG, or WEBP). Multipart requests only; ignored if `image_asset_identifier` is also supplied. The output always matches this image's width and height, and pixels the edit did not meaningfully change are copied exactly from it.", - "format": "binary", - "type": "string", - "x-tool-description": "File upload only; tools cannot send it. Use image_asset_identifier." - }, - "reference_image_asset_identifiers": { - "description": "Optional additional images to guide the edit, by reference. These are never edited themselves; only `image_asset_identifier` or `image` is. Requires the image being edited to be supplied by reference too. A request with a mask can include at most three.", - "items": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "maxItems": 4, - "minItems": 1, - "type": "array", - "x-tool-description": "Up to 4 image assets that guide the edit (e.g. an object or logo to insert). Never edited themselves." - }, - "reference_images": { - "description": "Optional images to guide the edit (max 4, max 50MB each; JPEG, PNG, or WEBP). They are never edited themselves; only `image` is. Multipart requests only; ignored if `reference_image_asset_identifiers` is also supplied. A request with a `mask` can include at most three, because the mask takes up one reference slot.", - "items": { - "format": "binary", - "type": "string" - }, - "maxItems": 4, - "type": "array", - "x-tool-description": "File upload only; tools cannot send it. Use reference_image_asset_identifiers." - }, - "mask_asset_identifier": { - "allOf": [ - { - "$ref": "#/components/schemas/AssetIdentifier" - } - ], - "description": "An existing upload or generated image asset to use as the mask, by reference. The same rules as `mask` apply. Takes priority over `mask` if both are supplied.", - "x-tool-description": "Omit. Describe the region in the prompt instead." - }, - "mask": { - "description": "An optional mask that limits the edit to part of `image` (max 50MB; JPEG, PNG, or WEBP). Multipart requests only. Black marks the area to edit and white the area to keep; values in between are rounded to the nearer of the two. The mask must have the same width and height as the image being edited and contain both black and white areas. A masked request can include at most three reference images.", - "format": "binary", - "type": "string", - "x-tool-description": "File upload only; tools cannot send it. Describe the region in the prompt instead." - }, - "context_window": { - "default": "none", - "description": "Which region of the image to edit.\n`none`, the default, edits the whole image. A large image may come back smaller than it was sent.\n`auto` requires a `mask` and automatically selects an appropriate context region around the masked area.\n`y_min,x_min,y_max,x_max` names the region explicitly, by its corners. Rows come first, matching the `bbox` ordering used elsewhere in this API, and the values are the edited image's own pixels with the origin at its top-left corner. For example `512,1024,2048,3072` is the region 2048 pixels wide and 1536 tall whose top-left corner is 1024 across and 512 down. The maximum edges are exclusive, so the region measures `x_max - x_min` by `y_max - y_min`. It must lie inside the image, measure at least 256px on each side, have an aspect ratio between 1:6 and 6:1, and cover no more than 4194304 pixels. A `mask` may select only pixels inside it.\nWith `auto` or an explicit region, only that region changes and the output keeps the image's own width and height.", - "pattern": "^(none|auto|[0-9]+,[0-9]+,[0-9]+,[0-9]+)$", - "type": "string", - "x-tool-description": "Omit." - }, - "quality": { - "default": "medium", - "description": "The rendering quality to use. `very_low` is the fastest and cheapest, and `high` takes longer and is priced higher.", - "enum": [ - "very_low", - "low", - "medium", - "high" - ], - "type": "string", - "x-tool-description": "Always set to medium. Do not choose high, low, or very_low, even for final or print output." - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - }, - "num_images": { - "default": 1, - "description": "The number of images to generate.", - "maximum": 8, - "minimum": 1, - "type": "integer" - }, - "enable_copyright_detection": { - "description": "Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`.", - "nullable": true, - "type": "boolean" - }, - "async": { - "default": false, - "description": "When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.", - "type": "boolean", - "x-tool-description": "Always overridden to true; tools run asynchronously." - }, - "webhook_url": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - }, - "private": { - "description": "When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately.", - "nullable": true, - "type": "boolean", - "x-tool-description": "true keeps the output private; false publishes it. Enterprise output is always private." - }, - "target_collection_id": { - "description": "A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes.", - "type": "string", - "x-tool-description": "Destination collection ID (URL-safe base64); must be writable." - } - }, - "required": [ - "prompt" - ], - "type": "object", - "x-tool-description": "Send prompt and image_asset_identifier, plus optional reference_image_asset_identifiers. Never send image, reference_images, mask, mask_asset_identifier, or context_window." - }, - "GenerateImageNanoBanana2Response": { - "description": "Response returned by `POST /v2/image/generate/nano-banana-2`.\nSynchronous requests (the default) include the generated images in\n`data`. Asynchronous requests omit `data`; poll\n`GET /v2/generations/{generation_id}` with the returned\n`generation_id`. `seed` is the seed that was used, including when you\ndid not set one.\n", - "example": { - "data": [ - { - "seed": 12345, - "prompt": "prompt", - "resolution": "1024x1024", - "url": "https://openapi-generator.tech", - "is_image_safe": true - }, - { - "seed": 12345, - "prompt": "prompt", - "resolution": "1024x1024", - "url": "https://openapi-generator.tech", - "is_image_safe": true - } - ], - "seed": 12345, - "generation_id": "generation_id" - }, - "properties": { - "generation_id": { - "description": "URL-safe base64 ID of the generation. Use it to poll\n`GET /v2/generations/{generation_id}`.\n", - "title": "generation_id", - "type": "string" - }, - "data": { - "description": "The generated images, in generation order. Present only for synchronous requests (`async` omitted or false).", - "items": { - "$ref": "#/components/schemas/GeneratedImageObject" - }, - "title": "data", - "type": "array" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - } - }, - "required": [ - "generation_id", - "seed" - ], - "title": "GenerateImageNanoBanana2Response", - "type": "object" - }, - "GenerateImageNanoBanana2Request": { - "description": "Source `images` are optional. When supplied, the prompt is applied to\nthem as an edit. Without source images, the output is generated from\nthe prompt alone.\n", - "properties": { - "prompt": { - "description": "The prompt to generate images from, or the edit instruction to apply when source images are supplied. It is passed to the model as written.", - "maxLength": 10000, - "minLength": 1, - "type": "string", - "x-tool-description": "Generation prompt or edit instruction, passed to the model unchanged." - }, - "image_asset_identifiers": { - "description": "Existing upload or generated image assets to edit, by reference. Takes priority over `images` if both are supplied.", - "items": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "maxItems": 10, - "minItems": 1, - "type": "array", - "x-tool-description": "Image assets to edit." - }, - "images": { - "description": "Optional source images to edit (max 10, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only.", - "items": { - "format": "binary", - "type": "string" - }, - "maxItems": 10, - "type": "array", - "x-tool-description": "Images to edit (max 10; JPEG/PNG/WEBP, max 25MB each). Multipart only." - }, - "aspect_ratio": { - "$ref": "#/components/schemas/NanoBanana2AspectRatio" - }, - "resolution_tier": { - "default": "1K", - "description": "The output resolution tier.", - "enum": [ - "1K", - "2K", - "4K" - ], - "type": "string" - }, - "num_images": { - "default": 1, - "description": "The number of images to generate.", - "maximum": 8, - "minimum": 1, - "type": "integer", - "x-tool-description": "Number of variations of this one prompt. For different subjects, make separate calls instead of listing them in one prompt." - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - }, - "async": { - "default": false, - "description": "When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.", - "type": "boolean", - "x-tool-description": "Always overridden to true; tools run asynchronously." - }, - "webhook_url": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - }, - "private": { - "description": "When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately.", - "nullable": true, - "type": "boolean", - "x-tool-description": "true keeps the output private; false publishes it. Enterprise output is always private." - }, - "target_collection_id": { - "description": "A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes.", - "type": "string", - "x-tool-description": "Destination collection ID (URL-safe base64); must be writable." - } - }, - "required": [ - "prompt" - ], - "type": "object", - "x-tool-description": "Supply image_asset_identifiers to edit existing images; omit them to generate from text." - }, - "GenerateImageNanoBanana21Response": { - "description": "Response returned by `POST /v2/image/generate/nano-banana-2-1`.\nSynchronous requests (the default) include the generated images in\n`data`. Asynchronous requests omit `data`; poll\n`GET /v2/generations/{generation_id}` with the returned\n`generation_id`. `seed` is the seed that was used, including when you\ndid not set one.\n", - "example": { - "data": [ - { - "seed": 12345, - "prompt": "prompt", - "resolution": "1024x1024", - "url": "https://openapi-generator.tech", - "is_image_safe": true - }, - { - "seed": 12345, - "prompt": "prompt", - "resolution": "1024x1024", - "url": "https://openapi-generator.tech", - "is_image_safe": true - } - ], - "seed": 12345, - "generation_id": "generation_id" - }, - "properties": { - "generation_id": { - "description": "URL-safe base64 ID of the generation. Use it to poll\n`GET /v2/generations/{generation_id}`.\n", - "title": "generation_id", - "type": "string" - }, - "data": { - "description": "The generated images, in generation order. Present only for synchronous requests (`async` omitted or false).", - "items": { - "$ref": "#/components/schemas/GeneratedImageObject" - }, - "title": "data", - "type": "array" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - } - }, - "required": [ - "generation_id", - "seed" - ], - "title": "GenerateImageNanoBanana21Response", - "type": "object" - }, - "GenerateImageNanoBanana21Request": { - "description": "Source `images` are optional. When supplied, the prompt is applied to\nthem as an edit. Without source images, the output is generated from\nthe prompt alone.\n", - "properties": { - "prompt": { - "description": "The prompt to generate images from, or the edit instruction to apply when source images are supplied. It is passed to the model as written.", - "maxLength": 10000, - "minLength": 1, - "type": "string", - "x-tool-description": "Generation prompt or edit instruction, passed to the model unchanged." - }, - "image_asset_identifiers": { - "description": "Existing upload or generated image assets to edit, by reference. Takes priority over `images` if both are supplied.", - "items": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "maxItems": 10, - "minItems": 1, - "type": "array", - "x-tool-description": "Image assets to edit." - }, - "images": { - "description": "Optional source images to edit (max 10, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only.", - "items": { - "format": "binary", - "type": "string" - }, - "maxItems": 10, - "type": "array", - "x-tool-description": "Images to edit (max 10; JPEG/PNG/WEBP, max 25MB each). Multipart only." - }, - "aspect_ratio": { - "$ref": "#/components/schemas/NanoBanana21AspectRatio" - }, - "resolution_tier": { - "default": "1K", - "description": "The output resolution tier.", - "enum": [ - "1K", - "2K", - "4K" - ], - "type": "string" - }, - "num_images": { - "default": 1, - "description": "The number of images to generate.", - "maximum": 8, - "minimum": 1, - "type": "integer", - "x-tool-description": "Number of variations of this one prompt. For different subjects, make separate calls instead of listing them in one prompt." - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - }, - "async": { - "default": false, - "description": "When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.", - "type": "boolean", - "x-tool-description": "Always overridden to true; tools run asynchronously." - }, - "webhook_url": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - }, - "private": { - "description": "When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately.", - "nullable": true, - "type": "boolean", - "x-tool-description": "true keeps the output private; false publishes it. Enterprise output is always private." - }, - "target_collection_id": { - "description": "A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes.", - "type": "string", - "x-tool-description": "Destination collection ID (URL-safe base64); must be writable." - } - }, - "required": [ - "prompt" - ], - "type": "object", - "x-tool-description": "Supply image_asset_identifiers to edit existing images; omit them to generate from text." - }, - "GenerateImageNanoBananaProResponse": { - "description": "Response returned by `POST /v2/image/generate/nano-banana-pro`.\nSynchronous requests (the default) include the generated images in\n`data`. Asynchronous requests omit `data`; poll\n`GET /v2/generations/{generation_id}` with the returned\n`generation_id`. `seed` is the seed that was used, including when you\ndid not set one.\n", - "example": { - "data": [ - { - "seed": 12345, - "prompt": "prompt", - "resolution": "1024x1024", - "url": "https://openapi-generator.tech", - "is_image_safe": true - }, - { - "seed": 12345, - "prompt": "prompt", - "resolution": "1024x1024", - "url": "https://openapi-generator.tech", - "is_image_safe": true - } - ], - "seed": 12345, - "generation_id": "generation_id" - }, - "properties": { - "generation_id": { - "description": "URL-safe base64 ID of the generation. Use it to poll\n`GET /v2/generations/{generation_id}`.\n", - "title": "generation_id", - "type": "string" - }, - "data": { - "description": "The generated images, in generation order. Present only for synchronous requests (`async` omitted or false).", - "items": { - "$ref": "#/components/schemas/GeneratedImageObject" - }, - "title": "data", - "type": "array" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - } - }, - "required": [ - "generation_id", - "seed" - ], - "title": "GenerateImageNanoBananaProResponse", - "type": "object" - }, - "GenerateImageNanoBananaProRequest": { - "description": "Source `images` are optional. When supplied, the prompt is applied to\nthem as an edit. Without source images, the output is generated from\nthe prompt alone.\n", - "properties": { - "prompt": { - "description": "The prompt to generate images from, or the edit instruction to apply when source images are supplied. It is passed to the model as written.", - "maxLength": 10000, - "minLength": 1, - "type": "string", - "x-tool-description": "Generation prompt or edit instruction, passed to the model unchanged." - }, - "image_asset_identifiers": { - "description": "Existing upload or generated image assets to edit, by reference. Takes priority over `images` if both are supplied.", - "items": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "maxItems": 10, - "minItems": 1, - "type": "array", - "x-tool-description": "Image assets to edit." - }, - "images": { - "description": "Optional source images to edit (max 10, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only.", - "items": { - "format": "binary", - "type": "string" - }, - "maxItems": 10, - "type": "array", - "x-tool-description": "Images to edit (max 10; JPEG/PNG/WEBP, max 25MB each). Multipart only." - }, - "aspect_ratio": { - "$ref": "#/components/schemas/NanoBananaProAspectRatio" - }, - "resolution_tier": { - "default": "1K", - "description": "The output resolution tier.", - "enum": [ - "1K", - "2K", - "4K" - ], - "type": "string" - }, - "num_images": { - "default": 1, - "description": "The number of images to generate.", - "maximum": 8, - "minimum": 1, - "type": "integer", - "x-tool-description": "Number of variations of this one prompt. For different subjects, make separate calls instead of listing them in one prompt." - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - }, - "async": { - "default": false, - "description": "When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.", - "type": "boolean", - "x-tool-description": "Always overridden to true; tools run asynchronously." - }, - "webhook_url": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - }, - "private": { - "description": "When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately.", - "nullable": true, - "type": "boolean", - "x-tool-description": "true keeps the output private; false publishes it. Enterprise output is always private." - }, - "target_collection_id": { - "description": "A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes.", - "type": "string", - "x-tool-description": "Destination collection ID (URL-safe base64); must be writable." - } - }, - "required": [ - "prompt" - ], - "type": "object", - "x-tool-description": "Supply image_asset_identifiers to edit existing images; omit them to generate from text." - }, - "GenerateImageGptImage2Response": { - "description": "Response returned by `POST /v2/image/generate/gpt-image-2`.\nSynchronous requests (the default) include the generated images in\n`data`. Asynchronous requests omit `data`; poll\n`GET /v2/generations/{generation_id}` with the returned\n`generation_id`. `seed` is the seed that was used, including when you\ndid not set one.\n", - "example": { - "data": [ - { - "seed": 12345, - "prompt": "prompt", - "resolution": "1024x1024", - "url": "https://openapi-generator.tech", - "is_image_safe": true - }, - { - "seed": 12345, - "prompt": "prompt", - "resolution": "1024x1024", - "url": "https://openapi-generator.tech", - "is_image_safe": true - } - ], - "seed": 12345, - "generation_id": "generation_id" - }, - "properties": { - "generation_id": { - "description": "URL-safe base64 ID of the generation. Use it to poll\n`GET /v2/generations/{generation_id}`.\n", - "title": "generation_id", - "type": "string" - }, - "data": { - "description": "The generated images, in generation order. Present only for synchronous requests (`async` omitted or false).", - "items": { - "$ref": "#/components/schemas/GeneratedImageObject" - }, - "title": "data", - "type": "array" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - } - }, - "required": [ - "generation_id", - "seed" - ], - "title": "GenerateImageGptImage2Response", - "type": "object" - }, - "GenerateImageGptImage2Request": { - "description": "Source `images` are optional. When supplied, the prompt is applied to\nthem as an edit. Without source images, the output is generated from\nthe prompt alone.\n", - "properties": { - "prompt": { - "description": "The prompt to generate images from, or the edit instruction to apply when source images are supplied. It is passed to the model as written.", - "maxLength": 10000, - "minLength": 1, - "type": "string", - "x-tool-description": "Generation prompt or edit instruction, passed to the model unchanged." - }, - "image_asset_identifiers": { - "description": "Existing upload or generated image assets to edit, by reference. Takes priority over `images` if both are supplied.", - "items": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "maxItems": 16, - "minItems": 1, - "type": "array", - "x-tool-description": "Image assets to edit." - }, - "images": { - "description": "Optional source images to edit (max 16, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only.", - "items": { - "format": "binary", - "type": "string" - }, - "maxItems": 16, - "type": "array" - }, - "num_images": { - "default": 1, - "description": "The number of images to generate.", - "maximum": 8, - "minimum": 1, - "type": "integer", - "x-tool-description": "Number of variations of this one prompt. For different subjects, make separate calls instead of listing them in one prompt." - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - }, - "aspect_ratio": { - "description": "The requested output aspect ratio, for example \"1:1\", \"16:9\", or \"9:16\". Ignored when `resolution` is provided. Defaults to \"1:1\".", - "type": "string" - }, - "resolution": { - "description": "Exact output resolution, formatted as \"WIDTHxHEIGHT\", for example\n\"2048x2048\" or \"1920x1088\". When provided, this takes precedence\nover `aspect_ratio`. The dimensions must satisfy GPT Image 2\nconstraints: each side is a multiple of 16, the largest side is at\nmost 3840px, the long:short ratio is at most 3:1, and total pixels\nare between 655360 and 8294400 inclusive.\n", - "type": "string", - "x-tool-description": "Exact WIDTHxHEIGHT (e.g. 1920x1088); overrides aspect_ratio. Each side: multiple of 16, max 3840px. Long:short ratio <=3:1; total pixels 655360–8294400 inclusive." - }, - "async": { - "default": false, - "description": "When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.", - "type": "boolean", - "x-tool-description": "Always overridden to true; tools run asynchronously." - }, - "webhook_url": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - }, - "private": { - "description": "When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately.", - "nullable": true, - "type": "boolean", - "x-tool-description": "true keeps the output private; false publishes it. Enterprise output is always private." - }, - "target_collection_id": { - "description": "A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes.", - "type": "string", - "x-tool-description": "Destination collection ID (URL-safe base64); must be writable." - } - }, - "required": [ - "prompt" - ], - "type": "object", - "x-tool-description": "Supply image_asset_identifiers to edit existing images; omit them to generate from text." - }, - "GenerateImageGptImage25FlareResponse": { - "description": "Response returned by `POST /v2/image/generate/gpt-image-2-5-flare`.\nSynchronous requests (the default) include the generated images in\n`data`. Asynchronous requests omit `data`; poll\n`GET /v2/generations/{generation_id}` with the returned\n`generation_id`. `seed` is the seed that was used, including when you\ndid not set one.\n", - "example": { - "data": [ - { - "seed": 12345, - "prompt": "prompt", - "resolution": "1024x1024", - "url": "https://openapi-generator.tech", - "is_image_safe": true - }, - { - "seed": 12345, - "prompt": "prompt", - "resolution": "1024x1024", - "url": "https://openapi-generator.tech", - "is_image_safe": true - } - ], - "seed": 12345, - "generation_id": "generation_id" - }, - "properties": { - "generation_id": { - "description": "URL-safe base64 ID of the generation. Use it to poll\n`GET /v2/generations/{generation_id}`.\n", - "title": "generation_id", - "type": "string" - }, - "data": { - "description": "The generated images, in generation order. Present only for synchronous requests (`async` omitted or false).", - "items": { - "$ref": "#/components/schemas/GeneratedImageObject" - }, - "title": "data", - "type": "array" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - } - }, - "required": [ - "generation_id", - "seed" - ], - "title": "GenerateImageGptImage25FlareResponse", - "type": "object" - }, - "GenerateImageGptImage25FlareRequest": { - "description": "Source `images` are optional. When supplied, the prompt is applied to\nthem as an edit. Without source images, the output is generated from\nthe prompt alone.\n", - "properties": { - "prompt": { - "description": "The prompt to generate images from, or the edit instruction to apply when source images are supplied. It is passed to the model as written.", - "maxLength": 10000, - "minLength": 1, - "type": "string", - "x-tool-description": "Generation prompt or edit instruction, passed to the model unchanged." - }, - "image_asset_identifiers": { - "description": "Existing upload or generated image assets to edit, by reference. Takes priority over `images` if both are supplied.", - "items": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "maxItems": 16, - "minItems": 1, - "type": "array" - }, - "images": { - "description": "Optional source images to edit (max 16, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only.", - "items": { - "format": "binary", - "type": "string" - }, - "maxItems": 16, - "type": "array" - }, - "mask_asset_identifier": { - "allOf": [ - { - "$ref": "#/components/schemas/AssetIdentifier" - } - ], - "description": "An existing upload or generated image asset to use as the mask, by reference. The same rules as `mask` apply. Takes priority over `mask` if both are supplied." - }, - "mask": { - "description": "An optional mask for the first source image (max 25MB; JPEG, PNG, or WEBP). Multipart requests only. Fully transparent pixels mark the areas to edit. The mask must have the same dimensions as the first source image, and requires source images in the same request.", - "format": "binary", - "type": "string" - }, - "background": { - "default": "auto", - "description": "The output background. `transparent` returns images with an alpha channel, `opaque` forces a solid background, and `auto` lets the model decide from the prompt.", - "enum": [ - "auto", - "transparent", - "opaque" - ], - "type": "string" - }, - "quality": { - "default": "auto", - "description": "How much rendering effort the model spends. Lower tiers return sooner and cost less; `auto` lets the model choose, which it currently renders at `high`.", - "enum": [ - "auto", - "low", - "medium", - "high" - ], - "type": "string" - }, - "num_images": { - "default": 1, - "description": "The number of images to generate.", - "maximum": 8, - "minimum": 1, - "type": "integer", - "x-tool-description": "Number of variations of this one prompt. For different subjects, make separate calls instead of listing them in one prompt." - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - }, - "aspect_ratio": { - "description": "The requested output aspect ratio, for example \"1:1\", \"16:9\", or \"9:16\". Ignored when `resolution` is provided. Defaults to \"1:1\".", - "type": "string" - }, - "resolution": { - "description": "Exact output resolution, formatted as \"WIDTHxHEIGHT\", for example\n\"2048x2048\" or \"1920x1088\". When provided, this takes precedence\nover `aspect_ratio`. The dimensions must satisfy GPT Image 2.5 Flare\nconstraints: each side is a multiple of 16, the largest side is at\nmost 3840px, the long:short ratio is at most 3:1, and total pixels\nare between 655360 and 8294400 inclusive.\n", - "type": "string" - }, - "async": { - "default": false, - "description": "When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.", - "type": "boolean", - "x-tool-description": "Always overridden to true; tools run asynchronously." - }, - "webhook_url": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - }, - "private": { - "description": "When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately.", - "nullable": true, - "type": "boolean", - "x-tool-description": "true keeps the output private; false publishes it. Enterprise output is always private." - }, - "target_collection_id": { - "description": "A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes.", - "type": "string", - "x-tool-description": "Destination collection ID (URL-safe base64); must be writable." - } - }, - "required": [ - "prompt" - ], - "type": "object" - }, - "GenerateImageGptImage25SunburstResponse": { - "description": "Response returned by `POST /v2/image/generate/gpt-image-2-5-sunburst`.\nSynchronous requests (the default) include the generated images in\n`data`. Asynchronous requests omit `data`; poll\n`GET /v2/generations/{generation_id}` with the returned\n`generation_id`. `seed` is the seed that was used, including when you\ndid not set one.\n", - "example": { - "data": [ - { - "seed": 12345, - "prompt": "prompt", - "resolution": "1024x1024", - "url": "https://openapi-generator.tech", - "is_image_safe": true - }, - { - "seed": 12345, - "prompt": "prompt", - "resolution": "1024x1024", - "url": "https://openapi-generator.tech", - "is_image_safe": true - } - ], - "seed": 12345, - "generation_id": "generation_id" - }, - "properties": { - "generation_id": { - "description": "URL-safe base64 ID of the generation. Use it to poll\n`GET /v2/generations/{generation_id}`.\n", - "title": "generation_id", - "type": "string" - }, - "data": { - "description": "The generated images, in generation order. Present only for synchronous requests (`async` omitted or false).", - "items": { - "$ref": "#/components/schemas/GeneratedImageObject" - }, - "title": "data", - "type": "array" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - } - }, - "required": [ - "generation_id", - "seed" - ], - "title": "GenerateImageGptImage25SunburstResponse", - "type": "object" - }, - "GenerateImageGptImage25SunburstRequest": { - "description": "Source `images` are optional. When supplied, the prompt is applied to\nthem as an edit. Without source images, the output is generated from\nthe prompt alone.\n", - "properties": { - "prompt": { - "description": "The prompt to generate images from, or the edit instruction to apply when source images are supplied. It is passed to the model as written.", - "maxLength": 10000, - "minLength": 1, - "type": "string", - "x-tool-description": "Generation prompt or edit instruction, passed to the model unchanged." - }, - "image_asset_identifiers": { - "description": "Existing upload or generated image assets to edit, by reference. Takes priority over `images` if both are supplied.", - "items": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "maxItems": 16, - "minItems": 1, - "type": "array" - }, - "images": { - "description": "Optional source images to edit (max 16, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only.", - "items": { - "format": "binary", - "type": "string" - }, - "maxItems": 16, - "type": "array" - }, - "mask_asset_identifier": { - "allOf": [ - { - "$ref": "#/components/schemas/AssetIdentifier" - } - ], - "description": "An existing upload or generated image asset to use as the mask, by reference. The same rules as `mask` apply. Takes priority over `mask` if both are supplied." - }, - "mask": { - "description": "An optional mask for the first source image (max 25MB; JPEG, PNG, or WEBP). Multipart requests only. Fully transparent pixels mark the areas to edit. The mask must have the same dimensions as the first source image, and requires source images in the same request.", - "format": "binary", - "type": "string" - }, - "background": { - "default": "auto", - "description": "The output background. `transparent` returns images with an alpha channel, `opaque` forces a solid background, and `auto` lets the model decide from the prompt.", - "enum": [ - "auto", - "transparent", - "opaque" - ], - "type": "string" - }, - "quality": { - "default": "auto", - "description": "How much rendering effort the model spends. Lower tiers return sooner and cost less; `auto` lets the model choose, which it currently renders at `high`.", - "enum": [ - "auto", - "low", - "medium", - "high" - ], - "type": "string" - }, - "num_images": { - "default": 1, - "description": "The number of images to generate.", - "maximum": 8, - "minimum": 1, - "type": "integer", - "x-tool-description": "Number of variations of this one prompt. For different subjects, make separate calls instead of listing them in one prompt." - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - }, - "aspect_ratio": { - "description": "The requested output aspect ratio, for example \"1:1\", \"16:9\", or \"9:16\". Ignored when `resolution` is provided. Defaults to \"1:1\".", - "type": "string" - }, - "resolution": { - "description": "Exact output resolution, formatted as \"WIDTHxHEIGHT\", for example\n\"2048x2048\" or \"1920x1088\". When provided, this takes precedence\nover `aspect_ratio`. The dimensions must satisfy GPT Image 2.5 Sunburst\nconstraints: each side is a multiple of 16, the largest side is at\nmost 3840px, the long:short ratio is at most 3:1, and total pixels\nare between 655360 and 8294400 inclusive.\n", - "type": "string" - }, - "async": { - "default": false, - "description": "When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.", - "type": "boolean", - "x-tool-description": "Always overridden to true; tools run asynchronously." - }, - "webhook_url": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - }, - "private": { - "description": "When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately.", - "nullable": true, - "type": "boolean", - "x-tool-description": "true keeps the output private; false publishes it. Enterprise output is always private." - }, - "target_collection_id": { - "description": "A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes.", - "type": "string", - "x-tool-description": "Destination collection ID (URL-safe base64); must be writable." - } - }, - "required": [ - "prompt" - ], - "type": "object" - }, - "GenerateImageIdeogramV2Response": { - "description": "Response returned by `POST /v2/image/generate/ideogram-2`.\nSynchronous requests (the default) include the generated images in\n`data`. Asynchronous requests omit `data`; poll\n`GET /v2/generations/{generation_id}` with the returned\n`generation_id`. `seed` is the seed that was used, including when you\ndid not set one.\n", - "example": { - "data": [ - { - "seed": 12345, - "prompt": "prompt", - "resolution": "1024x1024", - "url": "https://openapi-generator.tech", - "is_image_safe": true - }, - { - "seed": 12345, - "prompt": "prompt", - "resolution": "1024x1024", - "url": "https://openapi-generator.tech", - "is_image_safe": true - } - ], - "seed": 12345, - "generation_id": "generation_id" - }, - "properties": { - "generation_id": { - "description": "URL-safe base64 ID of the generation. Use it to poll\n`GET /v2/generations/{generation_id}`.\n", - "title": "generation_id", - "type": "string" - }, - "data": { - "description": "The generated images, in generation order. Present only for synchronous requests (`async` omitted or false).", - "items": { - "$ref": "#/components/schemas/GeneratedImageObject" - }, - "title": "data", - "type": "array" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - } - }, - "required": [ - "generation_id", - "seed" - ], - "title": "GenerateImageIdeogramV2Response", - "type": "object" - }, - "GenerateImageIdeogramV2Request": { - "example": { - "aspect_ratio": null, - "private": true, - "seed": 12345, - "rendering_speed": "default", - "webhook_url": "https://api.example.com/webhooks/ideogram", - "target_collection_id": "target_collection_id", - "num_images": 1, - "magic_prompt": "", - "async": false, - "style_type": "realistic", - "negative_prompt": "negative_prompt", - "enable_copyright_detection": true, - "prompt": "prompt" - }, - "properties": { - "prompt": { - "description": "The prompt to generate images from.", - "maxLength": 10000, - "minLength": 1, - "title": "prompt", - "type": "string" - }, - "negative_prompt": { - "description": "Description of what to exclude from the images. The prompt takes precedence over the negative prompt.", - "maxLength": 10000, - "title": "negative_prompt", - "type": "string", - "x-tool-description": "What to exclude; prompt takes precedence." - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - }, - "aspect_ratio": { - "$ref": "#/components/schemas/IdeogramV3AspectRatio" - }, - "rendering_speed": { - "default": "default", - "description": "The rendering speed to use. `turbo` generates faster at a lower cost, while `quality` prioritizes the highest-quality result.", - "enum": [ - "turbo", - "default", - "quality" - ], - "title": "rendering_speed", - "type": "string" - }, - "magic_prompt": { - "allOf": [ - { - "$ref": "#/components/schemas/MagicPromptMode" - } - ], - "default": "auto", - "description": "Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.", - "title": "magic_prompt", - "x-tool-description": "Automatic prompt rewriting; default auto." - }, - "num_images": { - "default": 1, - "description": "The number of images to generate.", - "maximum": 8, - "minimum": 1, - "title": "num_images", - "type": "integer", - "x-tool-description": "Number of variations of this one prompt. For different subjects, make separate calls instead of listing them in one prompt." - }, - "style_type": { - "$ref": "#/components/schemas/IdeogramV2StyleType" - }, - "enable_copyright_detection": { - "description": "Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`.", - "nullable": true, - "title": "enable_copyright_detection", - "type": "boolean", - "x-tool-description": "Check outputs for copyright; adds latency. Flagged images have is_image_safe: false." - }, - "async": { - "default": false, - "description": "When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.", - "title": "async", - "type": "boolean", - "x-tool-description": "Always overridden to true; tools run asynchronously." - }, - "webhook_url": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - }, - "private": { - "description": "When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately.", - "nullable": true, - "title": "private", - "type": "boolean", - "x-tool-description": "true keeps the output private; false publishes it. Enterprise output is always private." - }, - "target_collection_id": { - "description": "A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes.", - "title": "target_collection_id", - "type": "string", - "x-tool-description": "Destination collection ID (URL-safe base64); must be writable." - } - }, - "required": [ - "prompt" - ], - "title": "GenerateImageIdeogramV2Request", - "type": "object" - }, - "GenerateImageIdeogramV2AResponse": { - "description": "Response returned by `POST /v2/image/generate/ideogram-2a`.\nSynchronous requests (the default) include the generated images in\n`data`. Asynchronous requests omit `data`; poll\n`GET /v2/generations/{generation_id}` with the returned\n`generation_id`. `seed` is the seed that was used, including when you\ndid not set one.\n", - "example": { - "data": [ - { - "seed": 12345, - "prompt": "prompt", - "resolution": "1024x1024", - "url": "https://openapi-generator.tech", - "is_image_safe": true - }, - { - "seed": 12345, - "prompt": "prompt", - "resolution": "1024x1024", - "url": "https://openapi-generator.tech", - "is_image_safe": true - } - ], - "seed": 12345, - "generation_id": "generation_id" - }, - "properties": { - "generation_id": { - "description": "URL-safe base64 ID of the generation. Use it to poll\n`GET /v2/generations/{generation_id}`.\n", - "title": "generation_id", - "type": "string" - }, - "data": { - "description": "The generated images, in generation order. Present only for synchronous requests (`async` omitted or false).", - "items": { - "$ref": "#/components/schemas/GeneratedImageObject" - }, - "title": "data", - "type": "array" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - } - }, - "required": [ - "generation_id", - "seed" - ], - "title": "GenerateImageIdeogramV2AResponse", - "type": "object" - }, - "GenerateImageIdeogramV2ARequest": { - "example": { - "magic_prompt": "", - "aspect_ratio": null, - "async": false, - "style_type": "realistic", - "private": true, - "seed": 12345, - "rendering_speed": "default", - "webhook_url": "https://api.example.com/webhooks/ideogram", - "enable_copyright_detection": true, - "target_collection_id": "target_collection_id", - "prompt": "prompt", - "num_images": 1 - }, - "properties": { - "prompt": { - "description": "The prompt to generate images from.", - "maxLength": 10000, - "minLength": 1, - "title": "prompt", - "type": "string" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - }, - "aspect_ratio": { - "$ref": "#/components/schemas/IdeogramV3AspectRatio" - }, - "rendering_speed": { - "default": "default", - "description": "The rendering speed to use. `turbo` generates faster at a lower cost, while `quality` prioritizes the highest-quality result.", - "enum": [ - "turbo", - "default", - "quality" - ], - "title": "rendering_speed", - "type": "string" - }, - "magic_prompt": { - "allOf": [ - { - "$ref": "#/components/schemas/MagicPromptMode" - } - ], - "default": "auto", - "description": "Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.", - "title": "magic_prompt", - "x-tool-description": "Automatic prompt rewriting; default auto." - }, - "num_images": { - "default": 1, - "description": "The number of images to generate.", - "maximum": 8, - "minimum": 1, - "title": "num_images", - "type": "integer", - "x-tool-description": "Number of variations of this one prompt. For different subjects, make separate calls instead of listing them in one prompt." - }, - "style_type": { - "$ref": "#/components/schemas/IdeogramV2StyleType" - }, - "enable_copyright_detection": { - "description": "Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`.", - "nullable": true, - "title": "enable_copyright_detection", - "type": "boolean", - "x-tool-description": "Check outputs for copyright; adds latency. Flagged images have is_image_safe: false." - }, - "async": { - "default": false, - "description": "When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.", - "title": "async", - "type": "boolean", - "x-tool-description": "Always overridden to true; tools run asynchronously." - }, - "webhook_url": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - }, - "private": { - "description": "When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately.", - "nullable": true, - "title": "private", - "type": "boolean", - "x-tool-description": "true keeps the output private; false publishes it. Enterprise output is always private." - }, - "target_collection_id": { - "description": "A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes.", - "title": "target_collection_id", - "type": "string", - "x-tool-description": "Destination collection ID (URL-safe base64); must be writable." - } - }, - "required": [ - "prompt" - ], - "title": "GenerateImageIdeogramV2ARequest", - "type": "object" - }, - "InpaintImageIdeogramV3Response": { - "description": "Response returned by `POST /v2/image/inpaint/ideogram-3`.\nSynchronous requests (the default) include the repainted images in\n`data`. Requests with `async` set to true omit `data`; poll for\ncompletion and results with `GET /v2/generations/{generation_id}`\nusing the returned `generation_id`. The seed, width, and height report\nthe values the request resolved to when the caller left them unset.\n", - "example": { - "data": [ - { - "seed": 12345, - "prompt": "prompt", - "resolution": "1024x1024", - "url": "https://openapi-generator.tech", - "is_image_safe": true - }, - { - "seed": 12345, - "prompt": "prompt", - "resolution": "1024x1024", - "url": "https://openapi-generator.tech", - "is_image_safe": true - } - ], - "seed": 12345, - "generation_id": "generation_id", - "width": 0, - "height": 6 - }, - "properties": { - "generation_id": { - "description": "URL-safe base64 ID of the accepted generation. Accepted by the\n`GET /v2/generations/{generation_id}` polling endpoint.\n", - "title": "generation_id", - "type": "string" - }, - "data": { - "description": "The repainted images, in generation order. Present only for synchronous requests (`async` omitted or false).", - "items": { - "$ref": "#/components/schemas/InpaintedImageObject" - }, - "title": "data", - "type": "array" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - }, - "width": { - "description": "The output width in pixels this request resolved to.", - "title": "width", - "type": "integer" - }, - "height": { - "description": "The output height in pixels this request resolved to.", - "title": "height", - "type": "integer" - } - }, - "required": [ - "generation_id", - "height", - "seed", - "width" - ], - "title": "InpaintImageIdeogramV3Response", - "type": "object" - }, - "InpaintedImageObject": { - "description": "One repainted output image.", - "example": { - "seed": 12345, - "prompt": "prompt", - "resolution": "1024x1024", - "url": "https://openapi-generator.tech", - "is_image_safe": true - }, - "properties": { - "url": { - "description": "The direct link to the repainted image. Empty when the image did not pass safety checks.", - "format": "uri", - "nullable": true, - "title": "url", - "type": "string" - }, - "prompt": { - "description": "The final prompt the image was generated from.", - "title": "prompt", - "type": "string" - }, - "resolution": { - "description": "The resolution of the repainted image, formatted as \"WIDTHxHEIGHT\".", - "example": "1024x1024", - "title": "resolution", - "type": "string" - }, - "is_image_safe": { - "description": "Whether the image passed safety checks. If false, `url` is empty.", - "title": "is_image_safe", - "type": "boolean" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - } - }, - "required": [ - "is_image_safe", - "prompt", - "resolution", - "seed" - ], - "title": "InpaintedImageObject", - "type": "object" - }, - "InpaintImageIdeogramV3Request": { - "description": "The source `image` and its `mask` are both required and must be\nuploaded in a multipart request.\n", - "properties": { - "prompt": { - "description": "The prompt describing the repainted result.", - "maxLength": 10000, - "minLength": 1, - "type": "string" - }, - "image_asset_identifier": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "image": { - "description": "The source image to repaint (max 25MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The output matches its size, snapped to the nearest supported resolution.", - "format": "binary", - "type": "string" - }, - "mask_asset_identifier": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "mask": { - "description": "A black-and-white mask the same size as the source image. Black marks the region to repaint. JPEG, PNG, and WEBP are supported. Multipart requests only.", - "format": "binary", - "type": "string" - }, - "magic_prompt": { - "allOf": [ - { - "$ref": "#/components/schemas/MagicPromptMode" - } - ], - "default": "auto", - "description": "Controls magic prompt (automatic prompt rewriting). Defaults to `auto`." - }, - "num_images": { - "default": 1, - "description": "The number of images to generate.", - "maximum": 8, - "minimum": 1, - "type": "integer" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - }, - "rendering_speed": { - "default": "default", - "description": "The rendering speed to use.", - "enum": [ - "turbo", - "default", - "quality" - ], - "type": "string" - }, - "style_type": { - "$ref": "#/components/schemas/IdeogramV3StyleType" - }, - "style_preset": { - "allOf": [ - { - "$ref": "#/components/schemas/IdeogramV3StylePreset" - } - ], - "description": "A predefined style preset to apply to the repainted images. Cannot be combined with style codes or style references." - }, - "style_codes": { - "description": "A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.", - "example": [ - "AAFF5733", - "0133FF57", - "DE3357FF" - ], - "items": { - "$ref": "#/components/schemas/StyleCode" - }, - "type": "array", - "x-tool-description": "8-character hex style codes. Allowed combinations with other style controls depend on the operation." - }, - "style_reference_collection_id": { - "description": "A saved style to apply, by its URL-safe base64 collection id. Takes priority over `style_reference_images` if both are supplied.", - "type": "string" - }, - "style_reference_collection_version_id": { - "description": "Optional URL-safe base64 version id pinning a specific version of the `style_reference_collection_id` collection. Ignored without it.", - "type": "string" - }, - "style_reference_asset_identifiers": { - "description": "Existing upload or generated image assets to use as style references, by reference. Takes priority over `style_reference_images` if both are supplied.", - "items": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "maxItems": 10, - "minItems": 1, - "type": "array" - }, - "style_reference_images": { - "description": "Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported.", - "items": { - "format": "binary", - "type": "string" - }, - "maxItems": 10, - "type": "array" - }, - "enable_copyright_detection": { - "description": "Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`.", - "nullable": true, - "type": "boolean" - }, - "async": { - "default": false, - "description": "When false (the default), the request waits until the repainted images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.", - "type": "boolean" - }, - "webhook_url": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - }, - "private": { - "description": "When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately.", - "nullable": true, - "type": "boolean" - }, - "target_collection_id": { - "description": "A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes.", - "type": "string" - } - }, - "required": [ - "prompt" - ], - "type": "object" - }, - "InpaintImageIdeogramV3CustomModelResponse": { - "description": "Response returned by\n`POST /v2/image/inpaint/ideogram-3-custom-model`. Synchronous\nrequests include the repainted images in `data`; asynchronous requests\nomit `data` and can be polled with\n`GET /v2/generations/{generation_id}`.\n", - "example": { - "data": [ - { - "seed": 12345, - "prompt": "prompt", - "resolution": "1024x1024", - "url": "https://openapi-generator.tech", - "is_image_safe": true - }, - { - "seed": 12345, - "prompt": "prompt", - "resolution": "1024x1024", - "url": "https://openapi-generator.tech", - "is_image_safe": true - } - ], - "seed": 12345, - "generation_id": "generation_id", - "width": 0, - "height": 6 - }, - "properties": { - "generation_id": { - "description": "URL-safe base64 ID accepted by the generation polling endpoint.", - "title": "generation_id", - "type": "string" - }, - "data": { - "description": "The repainted images, in generation order. Present only for synchronous requests.", - "items": { - "$ref": "#/components/schemas/InpaintedImageObject" - }, - "title": "data", - "type": "array" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - }, - "width": { - "description": "The output width in pixels.", - "title": "width", - "type": "integer" - }, - "height": { - "description": "The output height in pixels.", - "title": "height", - "type": "integer" - } - }, - "required": [ - "generation_id", - "height", - "seed", - "width" - ], - "title": "InpaintImageIdeogramV3CustomModelResponse", - "type": "object" - }, - "InpaintImageIdeogramV3CustomModelRequest": { - "description": "The source `image` and its `mask` are both required and must be\nuploaded in a multipart request.\n", - "properties": { - "prompt": { - "description": "The prompt describing the repainted result.", - "maxLength": 10000, - "minLength": 1, - "type": "string" - }, - "custom_model_uri": { - "description": "The custom model URI returned by the custom-model API, in the form `model//version/`. The authenticated user or organization must have access to the model.", - "example": "model/my-custom-model/version/1", - "maxLength": 512, - "minLength": 1, - "pattern": "^model/[^/]+/version/[^/]+$", - "type": "string" - }, - "image_asset_identifier": { - "allOf": [ - { - "$ref": "#/components/schemas/AssetIdentifier" - } - ], - "description": "The source image asset to repaint. Takes priority over `image`." - }, - "image": { - "description": "The source image to repaint (max 25MB), as JPEG, PNG, or WEBP. Multipart requests only.", - "format": "binary", - "type": "string" - }, - "mask_asset_identifier": { - "allOf": [ - { - "$ref": "#/components/schemas/AssetIdentifier" - } - ], - "description": "A black-and-white mask asset the same size as the source image. Black marks the region to repaint. Takes priority over `mask`." - }, - "mask": { - "description": "A black-and-white mask the same size as the source image, as JPEG, PNG, or WEBP. Black marks the region to repaint. Multipart requests only.", - "format": "binary", - "type": "string" - }, - "magic_prompt": { - "allOf": [ - { - "$ref": "#/components/schemas/MagicPromptMode" - } - ], - "default": "auto", - "description": "Controls magic prompt (automatic prompt rewriting). Defaults to `auto`." - }, - "num_images": { - "default": 1, - "description": "The number of images to generate.", - "maximum": 8, - "minimum": 1, - "type": "integer" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - }, - "rendering_speed": { - "description": "The rendering speed to use. When omitted, the server chooses a speed supported by the selected custom model.", - "enum": [ - "turbo", - "default", - "quality" - ], - "type": "string" - }, - "style_preset": { - "allOf": [ - { - "$ref": "#/components/schemas/IdeogramV3StylePreset" - } - ], - "description": "A predefined style preset. Cannot be combined with style codes or style references." - }, - "style_codes": { - "description": "A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.", - "example": [ - "AAFF5733", - "0133FF57", - "DE3357FF" - ], - "items": { - "$ref": "#/components/schemas/StyleCode" - }, - "type": "array", - "x-tool-description": "8-character hex style codes. Allowed combinations with other style controls depend on the operation." - }, - "style_reference_collection_id": { - "description": "A saved style, by its URL-safe base64 collection id. Takes priority over `style_reference_images` if both are supplied.", - "type": "string" - }, - "style_reference_collection_version_id": { - "description": "Optional URL-safe base64 version id for the saved style. Ignored without `style_reference_collection_id`.", - "type": "string" - }, - "style_reference_asset_identifiers": { - "description": "Existing upload or generated image assets to use as style references. Takes priority over raw style reference images.", - "items": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "maxItems": 10, - "minItems": 1, - "type": "array" - }, - "style_reference_images": { - "description": "Images to use as style references (max 10, max 25MB each), as JPEG, PNG, or WEBP.", - "items": { - "format": "binary", - "type": "string" - }, - "maxItems": 10, - "type": "array" - }, - "enable_copyright_detection": { - "description": "Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images return `is_image_safe: false`.", - "nullable": true, - "type": "boolean" - }, - "async": { - "default": false, - "description": "When false, wait until the images are ready. When true, return as soon as the request is accepted and poll `GET /v2/generations/{generation_id}`.", - "type": "boolean" - }, - "private": { - "description": "When true or omitted, the output is kept private to your account. Set to false to publish it. Enterprise accounts always generate privately.", - "nullable": true, - "type": "boolean" - }, - "target_collection_id": { - "description": "A collection you can write to, by its URL-safe base64 collection id. Completed images are added to it.", - "type": "string" - } - }, - "required": [ - "custom_model_uri", - "prompt" - ], - "type": "object" - }, - "ReframeImageIdeogramV3Response": { - "description": "Synchronous requests (the default) include the reframed images in\n`data`. Requests with `async` set to true omit `data`; poll for\ncompletion and results with `GET /v2/generations/{generation_id}`.\nThe seed reports the value the request resolved to when the caller\nleft it unset.\n", - "example": { - "data": [ - { - "seed": 12345, - "prompt": "prompt", - "resolution": "1024x1024", - "url": "https://openapi-generator.tech", - "is_image_safe": true - }, - { - "seed": 12345, - "prompt": "prompt", - "resolution": "1024x1024", - "url": "https://openapi-generator.tech", - "is_image_safe": true - } - ], - "seed": 12345, - "generation_id": "generation_id" - }, - "properties": { - "generation_id": { - "description": "URL-safe base64 ID of the accepted generation. Accepted by the\n`GET /v2/generations/{generation_id}` polling endpoint.\n", - "title": "generation_id", - "type": "string" - }, - "data": { - "description": "The reframed images, in generation order. Present only for synchronous requests (`async` omitted or false).", - "items": { - "$ref": "#/components/schemas/GeneratedImageObject" - }, - "title": "data", - "type": "array" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - } - }, - "required": [ - "generation_id", - "seed" - ], - "title": "ReframeImageIdeogramV3Response", - "type": "object" - }, - "ReframeImageIdeogramV3Request": { - "additionalProperties": false, - "description": "Upload the source `image`. Style controls are optional; when used,\nsupply only one of `style_preset`, `style_codes`, or\n`style_reference_images`.\n", - "properties": { - "image_asset_identifier": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "image": { - "description": "The JPEG, PNG, or WEBP image to reframe (max 25MB). Multipart requests only.", - "format": "binary", - "type": "string", - "x-tool-description": "The JPEG, PNG, or WEBP image to reframe (max 25MB), as raw bytes. Multipart requests only." - }, - "resolution": { - "$ref": "#/components/schemas/ResolutionV3" - }, - "num_images": { - "default": 1, - "description": "The number of images to generate.", - "maximum": 8, - "minimum": 1, - "title": "NumImages", - "type": "integer", - "x-tool-description": "Number of variations of this one prompt. For different subjects, make separate calls instead of listing them in one prompt." - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - }, - "rendering_speed": { - "default": "default", - "enum": [ - "turbo", - "default", - "quality" - ], - "type": "string" - }, - "style_preset": { - "$ref": "#/components/schemas/IdeogramV3StylePreset" - }, - "color_palette": { - "$ref": "#/components/schemas/IdeogramColorPalette" - }, - "style_codes": { - "description": "A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.", - "example": [ - "AAFF5733", - "0133FF57", - "DE3357FF" - ], - "items": { - "$ref": "#/components/schemas/StyleCode" - }, - "type": "array", - "x-tool-description": "8-character hex style codes. Allowed combinations with other style controls depend on the operation." - }, - "style_reference_asset_identifiers": { - "description": "Existing upload or generated image assets to use as style references. Cannot be combined with a style preset, style codes, or uploaded style reference images.", - "items": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "maxItems": 10, - "minItems": 1, - "type": "array", - "x-tool-description": "Existing upload or generated image assets to use as style references. Cannot be combined with a style preset or style codes." - }, - "style_reference_images": { - "description": "JPEG, PNG, or WEBP style reference images (max 10, max 25MB each). Multipart requests only. Cannot be combined with `style_preset` or `style_codes`.", - "items": { - "format": "binary", - "type": "string" - }, - "maxItems": 10, - "minItems": 1, - "type": "array" - }, - "async": { - "default": false, - "description": "Return immediately instead of waiting for reframed images.", - "type": "boolean" - } - }, - "required": [ - "resolution" - ], - "type": "object", - "x-tool-description": "Requires image_asset_identifier. Use at most one of style_preset, style_codes, or style_reference_asset_identifiers." - }, - "ReframeImageNanoBanana2Response": { - "description": "Acknowledges an accepted asynchronous Reframe request. Poll\n`GET /v2/generations/{generation_id}` for completion and output\nimages. The seed, width, and height report the values the request\nresolved to when the caller left them unset.\n", - "example": { - "seed": 12345, - "generation_id": "generation_id", - "width": 0, - "height": 6 - }, - "properties": { - "generation_id": { - "description": "URL-safe base64 ID of the accepted generation. Accepted by the\n`GET /v2/generations/{generation_id}` polling endpoint.\n", - "title": "generation_id", - "type": "string" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - }, - "width": { - "description": "The resolved 1K output width in pixels.", - "title": "width", - "type": "integer" - }, - "height": { - "description": "The resolved 1K output height in pixels.", - "title": "height", - "type": "integer" - } - }, - "required": [ - "generation_id", - "height", - "seed", - "width" - ], - "title": "ReframeImageNanoBanana2Response", - "type": "object" - }, - "ReframeImageNanoBanana2Request": { - "additionalProperties": false, - "description": "Upload the source `image`. Requests without a source image are\nrejected with a 400.\n", - "properties": { - "image_asset_identifier": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "image": { - "description": "The JPEG, PNG, or WEBP image to reframe (max 50MB).", - "format": "binary", - "type": "string" - }, - "aspect_ratio": { - "$ref": "#/components/schemas/NanoBanana2ReframeAspectRatio" - }, - "private": { - "description": "API-key requests are always private. For bearer-authenticated\nrequests, this controls whether the result is private; when\nomitted, it follows the caller's plan entitlement. Enterprise\ngenerations are always private.\n", - "type": "boolean" - }, - "num_images": { - "default": 1, - "description": "The number of output images to generate.", - "maximum": 4, - "minimum": 1, - "type": "integer" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - } - }, - "required": [ - "aspect_ratio" - ], - "type": "object", - "x-tool-description": "Requires image_asset_identifier for the source image." - }, - "ReframeImageNanoBananaProResponse": { - "description": "Acknowledges an accepted asynchronous Reframe request. Poll\n`GET /v2/generations/{generation_id}` for completion and output\nimages. The seed, width, and height report the values the request resolved to when the caller left them unset.\n", - "example": { - "seed": 12345, - "generation_id": "generation_id", - "width": 0, - "height": 6 - }, - "properties": { - "generation_id": { - "description": "URL-safe base64 ID of the accepted generation. Accepted by the\n`GET /v2/generations/{generation_id}` polling endpoint.\n", - "title": "generation_id", - "type": "string" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - }, - "width": { - "description": "The resolved output width in pixels.", - "title": "width", - "type": "integer" - }, - "height": { - "description": "The resolved output height in pixels.", - "title": "height", - "type": "integer" - } - }, - "required": [ - "generation_id", - "height", - "seed", - "width" - ], - "title": "ReframeImageNanoBananaProResponse", - "type": "object" - }, - "ReframeImageNanoBananaProRequest": { - "additionalProperties": false, - "description": "Supply exactly one source: `image_asset_identifier` for an existing\nIdeogram asset, or `image` for a raw upload. Supplying both or neither\nis rejected with a 400.\n", - "properties": { - "image_asset_identifier": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "image": { - "description": "The JPEG, PNG, or WEBP image to reframe (max 50MB).", - "format": "binary", - "type": "string" - }, - "aspect_ratio": { - "$ref": "#/components/schemas/NanoBananaProReframeAspectRatio" - }, - "resolution_tier": { - "default": "1K", - "description": "The output resolution tier. The model sizes its output by tier at the requested aspect ratio; exact pixel dimensions cannot be requested.", - "enum": [ - "1K", - "2K", - "4K" - ], - "type": "string" - }, - "private": { - "description": "API-key requests are always private. For bearer-authenticated\nrequests, this controls whether the result is private; when\nomitted, it follows the caller's plan entitlement. Enterprise\ngenerations are always private.\n", - "type": "boolean" - }, - "num_images": { - "default": 1, - "description": "The number of output images to generate.", - "maximum": 4, - "minimum": 1, - "type": "integer" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - } - }, - "required": [ - "aspect_ratio" - ], - "type": "object" - }, - "ReframeImageGptImage25FlareResponse": { - "description": "Acknowledges an accepted asynchronous Reframe request. Poll\n`GET /v2/generations/{generation_id}` for completion and output\nimages. The seed, width, and height report the values the request resolved to when the caller left them unset.\n", - "example": { - "seed": 12345, - "generation_id": "generation_id", - "width": 0, - "height": 6 - }, - "properties": { - "generation_id": { - "description": "URL-safe base64 ID of the accepted generation. Accepted by the\n`GET /v2/generations/{generation_id}` polling endpoint.\n", - "title": "generation_id", - "type": "string" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - }, - "width": { - "description": "The resolved output width in pixels.", - "title": "width", - "type": "integer" - }, - "height": { - "description": "The resolved output height in pixels.", - "title": "height", - "type": "integer" - } - }, - "required": [ - "generation_id", - "height", - "seed", - "width" - ], - "title": "ReframeImageGptImage25FlareResponse", - "type": "object" - }, - "ReframeImageGptImage25FlareRequest": { - "additionalProperties": false, - "description": "Supply exactly one source: `image_asset_identifier` for an existing\nIdeogram asset, or `image` for a raw upload. Supplying both or neither\nis rejected with a 400.\n", - "properties": { - "image_asset_identifier": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "image": { - "description": "The JPEG, PNG, or WEBP image to reframe (max 50MB).", - "format": "binary", - "type": "string" - }, - "aspect_ratio": { - "description": "The requested output aspect ratio, as `width:height`.", - "example": "16:9", - "maxLength": 21, - "minLength": 3, - "pattern": "^[1-9][0-9]*:[1-9][0-9]*$", - "type": "string" - }, - "quality": { - "default": "auto", - "description": "How much rendering effort the model spends. Lower tiers return sooner and cost less; `auto` lets the model choose.", - "enum": [ - "auto", - "low", - "medium", - "high" - ], - "type": "string" - }, - "private": { - "description": "API-key requests are always private. For bearer-authenticated\nrequests, this controls whether the result is private; when\nomitted, it follows the caller's plan entitlement. Enterprise\ngenerations are always private.\n", - "type": "boolean" - }, - "num_images": { - "default": 1, - "description": "The number of output images to generate.", - "maximum": 4, - "minimum": 1, - "type": "integer" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - } - }, - "required": [ - "aspect_ratio" - ], - "type": "object" - }, - "ReframeAspectRatio": { - "description": "The requested output aspect ratio, as `width:height`.", - "example": "16:9", - "maxLength": 21, - "minLength": 3, - "pattern": "^[1-9][0-9]*:[1-9][0-9]*$", - "type": "string" - }, - "ReframeImageBriaExpandResponse": { - "description": "Acknowledges an accepted asynchronous Reframe request. Poll\n`GET /v2/generations/{generation_id}` for completion and output\nimages. The width and height are the canvas the source was placed on.\n", - "example": { - "seed": 12345, - "generation_id": "generation_id", - "width": 0, - "height": 6 - }, - "properties": { - "generation_id": { - "description": "URL-safe base64 ID of the accepted generation. Accepted by the\n`GET /v2/generations/{generation_id}` polling endpoint.\n", - "title": "generation_id", - "type": "string" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - }, - "width": { - "description": "The resolved output width in pixels.", - "title": "width", - "type": "integer" - }, - "height": { - "description": "The resolved output height in pixels.", - "title": "height", - "type": "integer" - } - }, - "required": [ - "generation_id", - "height", - "seed", - "width" - ], - "title": "ReframeImageBriaExpandResponse", - "type": "object" - }, - "ReframeImageBriaExpandRequest": { - "additionalProperties": false, - "description": "Supply exactly one source: `image_asset_identifier` for an existing\nIdeogram asset, or `image` for a raw upload. Supplying both or neither\nis rejected with a 400.\n", - "properties": { - "image_asset_identifier": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "image": { - "description": "The JPEG, PNG, or WEBP image to reframe (max 50MB).", - "format": "binary", - "type": "string" - }, - "aspect_ratio": { - "description": "The requested output aspect ratio, as `width:height`.", - "example": "16:9", - "maxLength": 21, - "minLength": 3, - "pattern": "^[1-9][0-9]*:[1-9][0-9]*$", - "type": "string" - }, - "private": { - "description": "API-key requests are always private. For bearer-authenticated\nrequests, this controls whether the result is private; when\nomitted, it follows the caller's plan entitlement. Enterprise\ngenerations are always private.\n", - "type": "boolean" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - } - }, - "required": [ - "aspect_ratio" - ], - "type": "object" - }, - "ReframeImageAutoResponse": { - "description": "Acknowledges an accepted asynchronous Reframe request. Poll\n`GET /v2/generations/{generation_id}` for completion and output\nimages. The seed, width, and height report the values the request resolved to when the caller left them unset.\n", - "example": { - "seed": 12345, - "generation_id": "generation_id", - "width": 0, - "height": 6 - }, - "properties": { - "generation_id": { - "description": "URL-safe base64 ID of the accepted generation. Accepted by the\n`GET /v2/generations/{generation_id}` polling endpoint.\n", - "title": "generation_id", - "type": "string" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - }, - "width": { - "description": "The resolved output width in pixels.", - "title": "width", - "type": "integer" - }, - "height": { - "description": "The resolved output height in pixels.", - "title": "height", - "type": "integer" - } - }, - "required": [ - "generation_id", - "height", - "seed", - "width" - ], - "title": "ReframeImageAutoResponse", - "type": "object" - }, - "ReframeImageAutoRequest": { - "additionalProperties": false, - "description": "Supply exactly one source: `image_asset_identifier` for an existing\nIdeogram asset, or `image` for a raw upload. Supplying both or neither\nis rejected with a 400.\n", - "properties": { - "image_asset_identifier": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "image": { - "description": "The JPEG, PNG, or WEBP image to reframe (max 50MB).", - "format": "binary", - "type": "string", - "x-tool-description": "File upload only; tools cannot send it. Use image_asset_identifier." - }, - "aspect_ratio": { - "description": "The requested output aspect ratio, as `width:height`.", - "example": "16:9", - "maxLength": 21, - "minLength": 3, - "pattern": "^[1-9][0-9]*:[1-9][0-9]*$", - "type": "string" - }, - "private": { - "description": "API-key requests are always private. For bearer-authenticated\nrequests, this controls whether the result is private; when\nomitted, it follows the caller's plan entitlement. Enterprise\ngenerations are always private.\n", - "type": "boolean" - }, - "num_images": { - "default": 1, - "description": "The number of output images to generate.", - "maximum": 4, - "minimum": 1, - "type": "integer" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - } - }, - "required": [ - "aspect_ratio" - ], - "type": "object", - "x-tool-description": "Send image_asset_identifier and aspect_ratio. Never send image." - }, - "GenerateImageIdeogramV3CharacterResponse": { - "description": "Response returned by `POST /v2/image/generate/ideogram-3-character`.\nSynchronous requests (the default) include the generated images in\n`data`. Asynchronous requests omit `data`; poll\n`GET /v2/generations/{generation_id}` with the returned\n`generation_id`. `seed` is the seed that was used, including when you\ndid not set one.\n", - "example": { - "data": [ - { - "seed": 12345, - "prompt": "prompt", - "resolution": "1024x1024", - "url": "https://openapi-generator.tech", - "is_image_safe": true - }, - { - "seed": 12345, - "prompt": "prompt", - "resolution": "1024x1024", - "url": "https://openapi-generator.tech", - "is_image_safe": true - } - ], - "seed": 12345, - "generation_id": "generation_id" - }, - "properties": { - "generation_id": { - "description": "URL-safe base64 ID of the generation. Use it to poll\n`GET /v2/generations/{generation_id}`.\n", - "title": "generation_id", - "type": "string" - }, - "data": { - "description": "The generated images, in generation order. Present only for synchronous requests (`async` omitted or false).", - "items": { - "$ref": "#/components/schemas/GeneratedImageObject" - }, - "title": "data", - "type": "array" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - } - }, - "required": [ - "generation_id", - "seed" - ], - "title": "GenerateImageIdeogramV3CharacterResponse", - "type": "object" - }, - "GenerateImageIdeogramV3CharacterRequest": { - "description": "Upload one character reference per request as\n`character_reference_images`. Style references can be\nadded only on accounts with access; otherwise combining them with a\ncharacter returns a 400.\n", - "properties": { - "prompt": { - "description": "The prompt to generate images from.", - "maxLength": 10000, - "minLength": 1, - "type": "string" - }, - "negative_prompt": { - "description": "Description of what to exclude from the images. The prompt takes precedence over the negative prompt.", - "maxLength": 10000, - "type": "string", - "x-tool-description": "What to exclude; prompt takes precedence." - }, - "character_reference_collection_id": { - "description": "A saved character to feature, by its URL-safe base64 collection id. Takes priority over `character_reference_images` if both are supplied.", - "type": "string" - }, - "character_reference_collection_version_id": { - "description": "Optional URL-safe base64 version id of the saved character in `character_reference_collection_id`. Ignored without it.", - "type": "string" - }, - "character_reference_asset_identifiers": { - "description": "An existing upload or generated image asset to use as the character reference, by reference. Takes priority over `character_reference_images` if both are supplied.", - "items": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "maxItems": 1, - "minItems": 1, - "type": "array" - }, - "character_reference_images": { - "description": "An image of the character to feature (max 25MB; JPEG, PNG, or WEBP).", - "items": { - "format": "binary", - "type": "string" - }, - "maxItems": 1, - "type": "array" - }, - "character_reference_mask_asset_identifier": { - "allOf": [ - { - "$ref": "#/components/schemas/AssetIdentifier" - } - ], - "description": "An existing upload or generated image asset to use as the character reference mask, by reference. The same rules as `character_reference_mask` apply. Takes priority over `character_reference_mask` if both are supplied." - }, - "character_reference_mask": { - "description": "Optional grayscale mask marking where the character is in the character reference image, at the same size as that image (JPEG, PNG, or WEBP). Multipart requests only.", - "format": "binary", - "type": "string" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - }, - "resolution": { - "$ref": "#/components/schemas/ResolutionV3" - }, - "aspect_ratio": { - "$ref": "#/components/schemas/IdeogramV3AspectRatio" - }, - "rendering_speed": { - "default": "default", - "description": "The rendering speed to use.", - "enum": [ - "turbo", - "default", - "quality" - ], - "type": "string" - }, - "magic_prompt": { - "allOf": [ - { - "$ref": "#/components/schemas/MagicPromptMode" - } - ], - "default": "auto", - "description": "Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.", - "x-tool-description": "Automatic prompt rewriting; default auto." - }, - "num_images": { - "default": 1, - "description": "The number of images to generate.", - "maximum": 8, - "minimum": 1, - "type": "integer", - "x-tool-description": "Number of variations of this one prompt. For different subjects, make separate calls instead of listing them in one prompt." - }, - "style_type": { - "default": "auto", - "description": "The style type to generate the character with. Defaults to `auto`.", - "enum": [ - "auto", - "realistic", - "fiction" - ], - "type": "string" - }, - "style_reference_collection_id": { - "description": "A saved style to apply, by its URL-safe base64 collection id. Takes priority over `style_reference_images` if both are supplied.", - "type": "string" - }, - "style_reference_collection_version_id": { - "description": "Optional URL-safe base64 version id of the saved style in `style_reference_collection_id`. Ignored without it.", - "type": "string", - "x-tool-description": "URL-safe base64 version ID of style_reference_collection_id; ignored without it." - }, - "style_reference_asset_identifiers": { - "description": "Existing upload or generated image assets to use as style references, by reference. Takes priority over `style_reference_images` if both are supplied.", - "items": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "maxItems": 10, - "minItems": 1, - "type": "array" - }, - "style_reference_images": { - "description": "Images to use as style references (max 10, max 25MB each; JPEG, PNG, or WEBP).", - "items": { - "format": "binary", - "type": "string" - }, - "maxItems": 10, - "type": "array" - }, - "enable_copyright_detection": { - "description": "Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`.", - "nullable": true, - "type": "boolean", - "x-tool-description": "Check outputs for copyright; adds latency. Flagged images have is_image_safe: false." - }, - "async": { - "default": false, - "description": "When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.", - "type": "boolean", - "x-tool-description": "Always overridden to true; tools run asynchronously." - }, - "webhook_url": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - }, - "private": { - "description": "When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately.", - "nullable": true, - "type": "boolean", - "x-tool-description": "true keeps the output private; false publishes it. Enterprise output is always private." - }, - "target_collection_id": { - "description": "A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes.", - "type": "string", - "x-tool-description": "Destination collection ID (URL-safe base64); must be writable." - } - }, - "required": [ - "prompt" - ], - "type": "object" - }, - "InpaintImageIdeogramV3CharacterResponse": { - "description": "Response returned by `POST /v2/image/inpaint/ideogram-3-character`.\nSynchronous requests (the default) include the repainted images in\n`data`. Requests with `async` set to true omit `data`; poll for\ncompletion and results with `GET /v2/generations/{generation_id}`\nusing the returned `generation_id`. The seed, width, and height report\nthe values the request resolved to when the caller left them unset.\n", - "example": { - "data": [ - { - "seed": 12345, - "prompt": "prompt", - "resolution": "1024x1024", - "url": "https://openapi-generator.tech", - "is_image_safe": true - }, - { - "seed": 12345, - "prompt": "prompt", - "resolution": "1024x1024", - "url": "https://openapi-generator.tech", - "is_image_safe": true - } - ], - "seed": 12345, - "generation_id": "generation_id", - "width": 0, - "height": 6 - }, - "properties": { - "generation_id": { - "description": "URL-safe base64 ID of the accepted generation. Accepted by the\n`GET /v2/generations/{generation_id}` polling endpoint.\n", - "title": "generation_id", - "type": "string" - }, - "data": { - "description": "The repainted images, in generation order. Present only for synchronous requests (`async` omitted or false).", - "items": { - "$ref": "#/components/schemas/InpaintedImageObject" - }, - "title": "data", - "type": "array" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - }, - "width": { - "description": "The output width in pixels this request resolved to.", - "title": "width", - "type": "integer" - }, - "height": { - "description": "The output height in pixels this request resolved to.", - "title": "height", - "type": "integer" - } - }, - "required": [ - "generation_id", - "height", - "seed", - "width" - ], - "title": "InpaintImageIdeogramV3CharacterResponse", - "type": "object" - }, - "InpaintImageIdeogramV3CharacterRequest": { - "description": "The source `image` and its `mask` are both required and must be\nuploaded in a multipart request. Upload one character reference as\n`character_reference_images`.\n", - "properties": { - "prompt": { - "description": "The prompt describing the repainted result.", - "maxLength": 10000, - "minLength": 1, - "type": "string" - }, - "image_asset_identifier": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "image": { - "description": "The source image to repaint (max 25MB). JPEG, PNG, and WEBP are supported. Multipart requests only. The output matches its size, snapped to the nearest supported resolution.", - "format": "binary", - "type": "string" - }, - "mask_asset_identifier": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "mask": { - "description": "A black-and-white mask the same size as the source image. Black marks the region to repaint. JPEG, PNG, and WEBP are supported. Multipart requests only.", - "format": "binary", - "type": "string" - }, - "character_reference_collection_id": { - "description": "A saved character to feature, by its URL-safe base64 collection id. Takes priority over `character_reference_images` if both are supplied.", - "type": "string" - }, - "character_reference_collection_version_id": { - "description": "Optional URL-safe base64 version id pinning a specific version of the `character_reference_collection_id` collection. Ignored without it.", - "type": "string" - }, - "character_reference_asset_identifiers": { - "description": "An existing upload or generated image asset to use as the character reference, by reference. Takes priority over `character_reference_images` if both are supplied.", - "items": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "maxItems": 1, - "minItems": 1, - "type": "array" - }, - "character_reference_images": { - "description": "An image to use as the character reference (max 25MB). JPEG, PNG, and WEBP are supported.", - "items": { - "format": "binary", - "type": "string" - }, - "maxItems": 1, - "type": "array" - }, - "character_reference_mask_asset_identifier": { - "allOf": [ - { - "$ref": "#/components/schemas/AssetIdentifier" - } - ], - "description": "An existing upload or generated image asset to use as the character reference mask, by reference. The same rules as `character_reference_mask` apply. Takes priority over `character_reference_mask` if both are supplied." - }, - "character_reference_mask": { - "description": "Optional grayscale mask for the character reference image, the same size as that image, marking where the character is. Only JPEG, PNG, and WEBP formats are supported. Multipart requests only; cannot be combined with `character_reference_collection_id`.", - "format": "binary", - "type": "string" - }, - "magic_prompt": { - "allOf": [ - { - "$ref": "#/components/schemas/MagicPromptMode" - } - ], - "default": "auto", - "description": "Controls magic prompt (automatic prompt rewriting). Defaults to `auto`." - }, - "num_images": { - "default": 1, - "description": "The number of images to generate.", - "maximum": 8, - "minimum": 1, - "type": "integer" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - }, - "rendering_speed": { - "default": "default", - "description": "The rendering speed to use.", - "enum": [ - "turbo", - "default", - "quality" - ], - "type": "string" - }, - "style_type": { - "default": "auto", - "description": "The style type to repaint the character with. Defaults to `auto`. `realistic` and `fiction` are supported for character-only requests; style codes or style references (not both) require `auto`. For API-key callers, combining a style with a character requires that feature to be enabled for their account.", - "enum": [ - "auto", - "realistic", - "fiction" - ], - "type": "string" - }, - "style_codes": { - "description": "A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.", - "example": [ - "AAFF5733", - "0133FF57", - "DE3357FF" - ], - "items": { - "$ref": "#/components/schemas/StyleCode" - }, - "type": "array", - "x-tool-description": "8-character hex style codes. Allowed combinations with other style controls depend on the operation." - }, - "style_reference_collection_id": { - "description": "A saved style to apply, by its URL-safe base64 collection id. Takes priority over `style_reference_images` if both are supplied. Cannot be combined with `style_codes`.", - "type": "string" - }, - "style_reference_collection_version_id": { - "description": "Optional URL-safe base64 version id pinning a specific version of the `style_reference_collection_id` collection. Ignored without it.", - "type": "string" - }, - "style_reference_asset_identifiers": { - "description": "Existing upload or generated image assets to use as style references, by reference. Takes priority over `style_reference_images` if both are supplied. Cannot be combined with `style_codes`.", - "items": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "maxItems": 10, - "minItems": 1, - "type": "array" - }, - "style_reference_images": { - "description": "Images to use as style references (max 10, max 25MB each). JPEG, PNG, and WEBP are supported. Cannot be combined with `style_codes`.", - "items": { - "format": "binary", - "type": "string" - }, - "maxItems": 10, - "type": "array" - }, - "enable_copyright_detection": { - "description": "Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with `is_image_safe: false`.", - "nullable": true, - "type": "boolean" - }, - "async": { - "default": false, - "description": "When false (the default), the request waits until the repainted images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll for completion and results with `GET /v2/generations/{generation_id}` using the returned `generation_id`.", - "type": "boolean" - }, - "webhook_url": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - }, - "private": { - "description": "When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately.", - "nullable": true, - "type": "boolean" - }, - "target_collection_id": { - "description": "A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes.", - "type": "string" - } - }, - "required": [ - "prompt" - ], - "type": "object" - }, - "GenerateImageV2AutoResponse": { - "description": "Response returned by `POST /v2/image/generate/auto`. Synchronous\nrequests (the default) include the generated images in `data`.\nAsynchronous requests omit `data`; poll\n`GET /v2/generations/{generation_id}` with the returned\n`generation_id`. `seed` is the seed that was used, including when you\ndid not set one.\n", - "example": { - "data": [ - { - "seed": 12345, - "prompt": "prompt", - "resolution": "1024x1024", - "url": "https://openapi-generator.tech", - "is_image_safe": true - }, - { - "seed": 12345, - "prompt": "prompt", - "resolution": "1024x1024", - "url": "https://openapi-generator.tech", - "is_image_safe": true - } - ], - "seed": 12345, - "generation_id": "generation_id" - }, - "properties": { - "generation_id": { - "description": "URL-safe base64 ID of the generation. Use it to poll\n`GET /v2/generations/{generation_id}`.\n", - "title": "generation_id", - "type": "string" - }, - "data": { - "description": "The generated images, in generation order. Present only for synchronous requests (`async` omitted or false).", - "items": { - "$ref": "#/components/schemas/GeneratedImageObject" - }, - "title": "data", - "type": "array" - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - } - }, - "required": [ - "generation_id", - "seed" - ], - "title": "GenerateImageV2AutoResponse", - "type": "object" - }, - "GenerateImageV2AutoRequest": { - "description": "Source `images` are optional. When supplied, Ideogram picks a model\nthat can edit them and the prompt describes the change.\n`negative_prompt` cannot be combined with source images.\n", - "properties": { - "prompt": { - "description": "The prompt to generate images from or, when source images are supplied, the change to make to them.", - "maxLength": 10000, - "minLength": 1, - "type": "string" - }, - "image_asset_identifiers": { - "description": "Existing upload or generated image assets to transform, by reference. Takes priority over `images` if both are supplied. Supplying sources turns the request into a transform.", - "items": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "maxItems": 10, - "minItems": 1, - "type": "array", - "x-tool-description": "Existing upload or generated image assets to transform, by reference. Supplying sources turns the request into a transform." - }, - "images": { - "description": "Optional source images to edit (max 10, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only.", - "items": { - "format": "binary", - "type": "string" - }, - "maxItems": 10, - "type": "array", - "x-tool-description": "Images to edit (max 10; JPEG/PNG/WEBP, max 25MB each). Multipart only." - }, - "negative_prompt": { - "description": "Description of what to exclude from the images. The prompt takes precedence over the negative prompt. Not every model uses it. Cannot be combined with source images.", - "maxLength": 10000, - "type": "string" - }, - "style_reference_asset_identifiers": { - "description": "Existing upload or generated image assets whose style should guide the generation, by reference. Cannot be combined with source images.", - "items": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "maxItems": 10, - "minItems": 1, - "type": "array" - }, - "aspect_ratio": { - "default": "auto", - "description": "The output aspect ratio. `auto` (the default) picks the most suitable ratio for the request. Without source images the value must be a supported ratio (for example \"16x9\" or \"1x1\"); with source images any \"WIDTHxHEIGHT\" value is accepted and the output uses the closest supported shape. Omit `resolution` when supplying a non-`auto` value.", - "pattern": "^(auto|[1-9][0-9]{0,4}x[1-9][0-9]{0,4})$", - "type": "string", - "x-tool-description": "Default auto chooses a ratio. Text-only: use a supported ratio (e.g. 16x9). With source images: any WIDTHxHEIGHT, mapped to the nearest supported shape. Non-auto excludes resolution." - }, - "resolution": { - "description": "The requested output resolution, formatted as \"WIDTHxHEIGHT\" (for example \"1280x800\"). The output is served at the closest resolution the selected model supports. Omit `aspect_ratio` (or leave it `auto`) when supplying a resolution.", - "pattern": "^[1-9][0-9]{1,4}x[1-9][0-9]{1,4}$", - "type": "string" - }, - "resolution_tier": { - "description": "The output resolution tier. Affects which model serves the request, since not every model offers every tier. When omitted, the selected model's default tier is used.", - "enum": [ - "1k", - "2k", - "4k" - ], - "type": "string" - }, - "magic_prompt": { - "allOf": [ - { - "$ref": "#/components/schemas/MagicPromptMode" - } - ], - "default": "auto", - "description": "Controls magic prompt (automatic prompt rewriting). Defaults to `auto`.", - "x-tool-description": "Automatic prompt rewriting; default auto." - }, - "num_images": { - "default": 1, - "description": "The number of images to generate.", - "maximum": 8, - "minimum": 1, - "type": "integer", - "x-tool-description": "Number of variations of this one prompt. For different subjects, make separate calls instead of listing them in one prompt." - }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." - }, - "private": { - "description": "Whether the generated images should be kept private. When omitted, the default follows the caller's plan; some plans always generate privately.", - "type": "boolean" - }, - "target_collection_id": { - "description": "A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes.", - "type": "string", - "x-tool-description": "Destination collection ID (URL-safe base64); must be writable." - }, - "category_id": { - "description": "The internal generation category to attribute to the output, as a URL-safe base64 UUID without padding. Only applies when source images are supplied.", - "maxLength": 22, - "minLength": 22, - "pattern": "^[A-Za-z0-9_-]{22}$", - "type": "string" - }, - "async": { - "default": false, - "description": "When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.", - "type": "boolean", - "x-tool-description": "Always overridden to true; tools run asynchronously." - } - }, - "required": [ - "prompt" - ], - "type": "object", - "x-tool-description": "Supply image_asset_identifiers to edit existing images; omit them to generate from text. Source images cannot be combined with negative_prompt or style_reference_asset_identifiers." - }, - "ToolRemixResponse": { - "description": "Response returned by `POST /v2/image/remix/auto`. Synchronous\nrequests (the default) include the remixed images in `data`.\nAsynchronous requests omit `data`; poll\n`GET /v2/generations/{generation_id}` with the returned\n`generation_id`.\n", - "example": { - "data": [ - { - "seed": 12345, - "prompt": "prompt", - "resolution": "1024x1024", - "url": "https://openapi-generator.tech", - "is_image_safe": true - }, - { - "seed": 12345, - "prompt": "prompt", - "resolution": "1024x1024", - "url": "https://openapi-generator.tech", - "is_image_safe": true - } - ], - "seed": "", - "generation_id": "generation_id" - }, - "properties": { - "generation_id": { - "description": "URL-safe base64 ID of the generation. Use it to poll\n`GET /v2/generations/{generation_id}`.\n", - "title": "generation_id", - "type": "string" - }, - "data": { - "description": "The remixed images, in generation order. Present only for synchronous requests (`async` omitted or false).", - "items": { - "$ref": "#/components/schemas/GeneratedImageObject" - }, - "title": "data", - "type": "array" - }, - "seed": { - "allOf": [ - { - "$ref": "#/components/schemas/Seed" - } - ], - "description": "The seed attached to the request. Reusing it does not guarantee a reproducible result, because the selected model may not honor seeds.", - "title": "seed" - } - }, - "required": [ - "generation_id", - "seed" - ], - "title": "ToolRemixResponse", - "type": "object" - }, - "ToolRemixRequest": { - "properties": { - "prompt": { - "description": "The prompt that guides the remix.", - "maxLength": 10000, - "minLength": 1, - "type": "string" - }, - "image_asset_identifier": { - "allOf": [ - { - "$ref": "#/components/schemas/AssetIdentifier" - } - ], - "description": "The existing upload or generated image to transform. Supply this or `image`, never both. Omit `resolution` and `aspect_ratio` to keep its shape.", - "x-tool-description": "The existing upload or generated image to transform. Omit `resolution` and `aspect_ratio` to keep its shape." - }, - "image": { - "description": "The image to remix (max 50MB; JPEG, PNG, or WEBP). Multipart requests only. The image is used only for this request and is not saved to your account.", - "format": "binary", - "type": "string" - }, - "image_weight": { - "description": "Optional. How closely the result should follow the source image, from 1 to 100. When omitted the selected model chooses its usual strength. Combining a weight with a `resolution` or `aspect_ratio` that changes the source's aspect ratio crops the source to the new shape; this is only available at the 1K tier and is rejected at 2K.", - "maximum": 100, - "minimum": 1, - "type": "integer", - "x-tool-description": "Source fidelity (1–100); omit for model-default strength. Shape changes via resolution/aspect_ratio crop the source and require 1K; rejected at 2K." - }, - "negative_prompt": { - "description": "Description of what to exclude from the images. The prompt takes precedence over the negative prompt. Not every model uses it.", - "maxLength": 10000, - "type": "string" - }, - "resolution": { - "description": "The requested output resolution, formatted as \"WIDTHxHEIGHT\" (for example \"1280x800\"). The output uses the closest supported resolution in the matching 1K or 2K tier. Omit `aspect_ratio` when supplying a resolution. If `resolution_tier` is also supplied, it must match the tier these dimensions fall in. Combining a shape-changing value with `image_weight` requires the 1K tier.", - "pattern": "^[1-9][0-9]{1,4}x[1-9][0-9]{1,4}$", - "type": "string", - "x-tool-description": "WIDTHxHEIGHT (e.g. 1280x800); uses the closest supported size in its 1K/2K tier. Omit aspect_ratio; resolution_tier must match if set. Shape changes with image_weight require 1K." - }, - "aspect_ratio": { - "allOf": [ - { - "$ref": "#/components/schemas/IdeogramV4AspectRatio" - } - ], - "description": "The requested output aspect ratio. Omit it to keep the source image's shape. `auto` also keeps the source shape. Omit `resolution` when supplying a concrete value. Combining a shape-changing value with `image_weight` requires the 1K tier." - }, - "resolution_tier": { - "description": "The output resolution tier. When omitted, the tier is inferred from `resolution`, or defaults to 1k. A color palette, style codes, style preset, or non-`auto` style type are only supported at 1k.", - "enum": [ - "1k", - "2k" - ], - "type": "string" - }, - "magic_prompt": { - "allOf": [ - { - "$ref": "#/components/schemas/MagicPromptMode" - } - ], - "default": "auto", - "description": "Controls magic prompt (automatic prompt rewriting). Defaults to `auto`. The selected model decides how to interpret it." - }, - "seed": { - "description": "Optional. Only honored when the request uses a model that supports reproducible remixes; results from the default model are not reproducible. The response reports the seed used.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "type": "integer" - }, - "style_reference_asset_identifiers": { - "description": "Existing upload or generated image assets whose style should guide the remix, by reference. Supplying style references restricts the server to a model that supports them and requires the 1K resolution tier. Ignored if `style_reference_collection_id` is also supplied.", - "items": { - "$ref": "#/components/schemas/AssetIdentifier" - }, - "maxItems": 10, - "minItems": 1, - "type": "array" - }, - "style_reference_collection_id": { - "description": "A saved style to apply, by its URL-safe base64 collection id. Limits the request to a model that supports style references and requires the 1K resolution tier.", - "type": "string" - }, - "style_reference_collection_version_id": { - "description": "Optional URL-safe base64 version id of the saved style in `style_reference_collection_id`. Ignored without it.", - "type": "string", - "x-tool-description": "URL-safe base64 version ID of style_reference_collection_id; ignored without it." - }, - "style_preset": { - "allOf": [ - { - "$ref": "#/components/schemas/IdeogramV3StylePreset" - } - ], - "description": "A predefined style preset to apply. Limits the request to a model that supports it and requires the 1K resolution tier. Cannot be combined with style codes." - }, - "color_palette": { - "allOf": [ - { - "$ref": "#/components/schemas/IdeogramColorPalette" - } - ], - "description": "A color palette to apply. Limits the request to a model that supports palettes and requires the 1K resolution tier." - }, - "style_codes": { - "description": "A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.", - "example": [ - "AAFF5733", - "0133FF57", - "DE3357FF" - ], - "items": { - "$ref": "#/components/schemas/StyleCode" - }, - "type": "array", - "x-tool-description": "8-character hex style codes. Allowed combinations with other style controls depend on the operation." - }, - "style_type": { - "allOf": [ - { - "$ref": "#/components/schemas/IdeogramV3StyleType" - } - ], - "description": "The style type to generate with. A value other than `auto` limits the request to a model that supports it and requires the 1K resolution tier." - }, - "num_images": { - "default": 1, - "description": "The number of images to generate.", - "maximum": 8, - "minimum": 1, - "type": "integer", - "x-tool-description": "Number of variations of this one prompt. For different subjects, make separate calls instead of listing them in one prompt." - }, - "enable_copyright_detection": { - "description": "Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`.", - "nullable": true, - "type": "boolean", - "x-tool-description": "Check outputs for copyright; adds latency. Flagged images have is_image_safe: false." - }, - "async": { - "default": false, - "description": "When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result.", - "type": "boolean", - "x-tool-description": "Always overridden to true; tools run asynchronously." - }, - "webhook_url": { - "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n", - "example": "https://api.example.com/webhooks/ideogram", - "format": "uri", - "maxLength": 2048, - "title": "webhook_url", - "type": "string", - "x-tool-description": "Signed completion callback; public HTTPS only (no private/internal hosts)." - }, - "private": { - "description": "Whether the generated images should be kept private. Omitted or true keeps them private. False publishes them unless the caller's plan always generates privately.", - "nullable": true, - "type": "boolean" - }, - "target_collection_id": { - "description": "A collection you can write to, by its URL-safe base64 collection id. The output images are added to it when the request completes.", - "type": "string", - "x-tool-description": "Destination collection ID (URL-safe base64); must be writable." - } - }, - "required": [ - "prompt" - ], - "type": "object" - }, - "ResizeAdImageRequest": { - "description": "Supply the source image as raw `image` bytes and the target ad\n`resolution`.\n", - "properties": { - "image_asset_identifier": { - "allOf": [ - { - "$ref": "#/components/schemas/AssetIdentifier" - } - ], - "description": "The source image asset to reframe, by reference. Provide exactly one of `image_asset_identifier` or `image`." - }, - "image": { - "description": "The source image to reframe (max size 25MB), as raw bytes; only JPEG, PNG, and WEBP formats are supported.", - "format": "binary", - "type": "string" - }, - "resolution": { - "description": "Target ad resolution, formatted as `WIDTHxHEIGHT`. Must be one of\nthe supported ad resolutions listed above; any other value is\nrejected with a 400. Each returned image has exactly these pixel\ndimensions.\n", - "enum": [ - "300x250", - "336x280", - "300x600", - "1080x1080", - "1080x1350", - "1080x1920", - "1920x1080", - "728x90", - "160x600", - "970x250", - "320x50", - "300x50", - "320x100", - "1800x900", - "2400x2400", - "1200x3500", - "2880x2880", - "2560x3200", - "3200x2560", - "2448x3264", - "3264x2448", - "2336x3504", - "3504x2336", - "2240x3584", - "3584x2240", - "2160x3840", - "3840x2160", - "1920x3840", - "3840x1920", - "1280x3840", - "3840x1280" - ], - "type": "string" - }, - "prompt": { - "description": "Optional edit instruction to apply while reframing, for example \"remove the logo\" or \"put the price bottom-right\".", - "type": "string" - }, - "quality": { - "allOf": [ - { - "$ref": "#/components/schemas/ResizeAdImageQuality" - } - ], - "default": "HIGH", - "description": "Output quality tier. Higher tiers generally improve detail and may take longer to complete. Supported values are LOW, MEDIUM, and HIGH." - }, - "num_images": { - "default": 1, - "description": "The number of reframed variations to generate.", - "maximum": 4, - "minimum": 1, - "type": "integer" - }, - "store_assets": { - "default": false, - "description": "Reserved for a future release: accepted for forward compatibility but not yet applied. Resulting assets are not stored to your account regardless of this value.", - "type": "boolean" - } - }, - "required": [ - "resolution" - ], - "type": "object" - }, - "ResizeAdImageQuality": { - "enum": [ - "LOW", - "MEDIUM", - "HIGH" - ], - "title": "ResizeAdImageQuality", - "type": "string" - }, - "WebhookSigningJwks": { - "description": "JSON Web Key Set listing the Ed25519 public keys Ideogram uses to sign\nwebhook payloads. Each entry follows RFC 7517 conventions for OKP keys.\n", - "example": { - "keys": [ - { - "kty": "OKP", - "crv": "Ed25519", - "use": "sig", - "kid": "v1", - "x": "11qYAYKxCrfVS_7TyWQHOg7hcvPapiMlrwIaaPcHURo", - "alg": "EdDSA" - }, - { - "kty": "OKP", - "crv": "Ed25519", - "use": "sig", - "kid": "v1", - "x": "11qYAYKxCrfVS_7TyWQHOg7hcvPapiMlrwIaaPcHURo", - "alg": "EdDSA" - } - ] - }, - "properties": { - "keys": { - "description": "Active and recently-rotated signing keys. A webhook is authentic if\nits signature verifies against any key in this list.\n", - "items": { - "$ref": "#/components/schemas/WebhookSigningJwk" - }, - "title": "keys", - "type": "array" - } - }, - "required": [ - "keys" - ], - "title": "WebhookSigningJwks", - "type": "object" - }, - "WebhookSigningJwk": { - "description": "A single Ed25519 public key. The `x` field carries the 32-byte public\nkey as base64url without padding; `kid` matches the\n`X-Ideogram-Webhook-Key-Id` header on outbound webhooks for cache hints,\nbut verifiers SHOULD try every key in the set rather than relying on\n`kid` alone.\n", - "example": { - "kty": "OKP", - "crv": "Ed25519", - "use": "sig", - "kid": "v1", - "x": "11qYAYKxCrfVS_7TyWQHOg7hcvPapiMlrwIaaPcHURo", - "alg": "EdDSA" - }, - "properties": { - "kty": { - "description": "Key type. Always `\"OKP\"` for Ed25519.", - "example": "OKP", - "title": "kty", - "type": "string" - }, - "crv": { - "description": "Curve. Always `\"Ed25519\"`.", - "example": "Ed25519", - "title": "crv", - "type": "string" - }, - "x": { - "description": "The 32-byte public key, base64url-encoded without padding.", - "example": "11qYAYKxCrfVS_7TyWQHOg7hcvPapiMlrwIaaPcHURo", - "title": "x", - "type": "string" - }, - "kid": { - "description": "Opaque key identifier; stable across rotations of the same key.", - "example": "v1", - "title": "kid", - "type": "string" - }, - "alg": { - "description": "Always `\"EdDSA\"`.", - "example": "EdDSA", - "title": "alg", - "type": "string" - }, - "use": { - "description": "Always `\"sig\"` (signing-only).", - "example": "sig", - "title": "use", - "type": "string" - } - }, - "required": [ - "alg", - "crv", - "kid", - "kty", - "use", - "x" - ], - "title": "WebhookSigningJwk", - "type": "object" - }, - "ProvenanceVerifyResponse": { - "example": { - "validation_state": "TRUSTED", - "provider": "provider", - "generation_id": "generation_id", - "system_version": "system_version", - "provenance_detected": true, - "created_at": "created_at" - }, - "properties": { - "provenance_detected": { - "description": "Whether an Ideogram provenance manifest was found in the content.", - "title": "provenance_detected", - "type": "boolean" - }, - "validation_state": { - "description": "Validation outcome for the detected manifest. `VALID` and `TRUSTED`\nboth mean the content is unmodified since it was signed; `INVALID`\nmeans the content or its manifest was altered after signing.\n", - "enum": [ - "TRUSTED", - "VALID", - "INVALID" - ], - "title": "validation_state", - "type": "string" - }, - "provider": { - "description": "Name of the provider that created the content.", - "title": "provider", - "type": "string" - }, - "system_version": { - "description": "Version of the generation system that created the content.", - "title": "system_version", - "type": "string" - }, - "created_at": { - "description": "Creation time of the content, as an ISO 8601 timestamp.", - "title": "created_at", - "type": "string" - }, - "generation_id": { - "description": "Unique identifier of the generation, as a base64 URL-safe string.", - "title": "generation_id", - "type": "string" - } - }, - "required": [ - "provenance_detected" - ], - "title": "ProvenanceVerifyResponse", - "type": "object", - "x-drop-nulls": true - }, - "ProvenanceVerifyRequest": { - "properties": { - "content": { - "description": "The image file to verify.", - "format": "binary", - "type": "string" - } - }, - "required": [ - "content" - ], - "type": "object" - }, - "ManageApiSubscriptionResponse": { - "example": { - "recharge_settings": { - "is_active": true - }, - "has_stripe_setup": true, - "metronome_dashboard_dark_mode_url": "metronome_dashboard_dark_mode_url", - "stripe_billing_url": "stripe_billing_url", - "current_balance": { - "amount": 1050, - "currency_code": "USD" - }, - "has_accepted_terms": true, - "metronome_dashboard_url": "metronome_dashboard_url", - "metronome_links": { - "usage_iframe_url": "usage_iframe_url", - "usage_iframe_dark_mode_url": "usage_iframe_dark_mode_url", - "credits_iframe_dark_mode_url": "credits_iframe_dark_mode_url", - "invoices_iframe_dark_mode_url": "invoices_iframe_dark_mode_url", - "invoices_iframe_url": "invoices_iframe_url", - "credits_iframe_url": "credits_iframe_url" - } - }, - "properties": { - "has_accepted_terms": { - "description": "Whether or not the latest required terms have been accepted.", - "title": "has_accepted_terms", - "type": "boolean" - }, - "has_stripe_setup": { - "description": "Whether or not Stripe is setup for API usage.", - "title": "has_stripe_setup", - "type": "boolean" - }, - "metronome_dashboard_url": { - "deprecated": true, - "description": "The URL to display the customer usage dashboard.", - "title": "metronome_dashboard_url", - "type": "string" - }, - "metronome_dashboard_dark_mode_url": { - "deprecated": true, - "description": "The URL to display the customer usage dashboard, in dark mode.", - "title": "metronome_dashboard_dark_mode_url", - "type": "string" - }, - "metronome_links": { - "$ref": "#/components/schemas/MetronomeLinks" - }, - "recharge_settings": { - "$ref": "#/components/schemas/RechargeSettingsResponse" - }, - "stripe_billing_url": { - "description": "The URL for the user to manage the existing Stripe subscription plan.", - "title": "stripe_billing_url", - "type": "string" - }, - "current_balance": { - "$ref": "#/components/schemas/Price" - } - }, - "required": [ - "current_balance", - "has_accepted_terms", - "has_stripe_setup" - ], - "title": "ManageApiSubscriptionResponse", - "type": "object" - }, - "MetronomeLinks": { - "example": { - "usage_iframe_url": "usage_iframe_url", - "usage_iframe_dark_mode_url": "usage_iframe_dark_mode_url", - "credits_iframe_dark_mode_url": "credits_iframe_dark_mode_url", - "invoices_iframe_dark_mode_url": "invoices_iframe_dark_mode_url", - "invoices_iframe_url": "invoices_iframe_url", - "credits_iframe_url": "credits_iframe_url" - }, - "properties": { - "invoices_iframe_url": { - "description": "The URL to display the customer invoice and API usage.", - "title": "invoices_iframe_url", - "type": "string" - }, - "invoices_iframe_dark_mode_url": { - "description": "The URL to display the customer invoice and API usage.", - "title": "invoices_iframe_dark_mode_url", - "type": "string" - }, - "credits_iframe_url": { - "description": "The URL to display the customer invoice and API usage.", - "title": "credits_iframe_url", - "type": "string" - }, - "credits_iframe_dark_mode_url": { - "description": "The URL to display the customer invoice and API usage.", - "title": "credits_iframe_dark_mode_url", - "type": "string" - }, - "usage_iframe_url": { - "description": "The URL to display the customer usage dashboard.", - "title": "usage_iframe_url", - "type": "string" - }, - "usage_iframe_dark_mode_url": { - "description": "The URL to display the customer usage dashboard, in dark mode.", - "title": "usage_iframe_dark_mode_url", - "type": "string" - } - }, - "title": "MetronomeLinks", - "type": "object" - }, - "RechargeSettingsResponse": { - "allOf": [ - { - "$ref": "#/components/schemas/RechargeSettings" - } - ], - "example": { - "is_active": true - }, - "properties": { - "is_active": { - "description": "Whether or not the recharge setting is currently active.", - "title": "is_active", - "type": "boolean" - } - }, - "required": [ - "is_active" - ], - "title": "RechargeSettingsResponse" - }, - "RechargeSettings": { - "description": "The current recharge settings for the API subscription.", - "example": { - "minimum_balance_threshold": { - "amount": 1050, - "currency_code": "USD" - }, - "top_up_balance": { - "amount": 1050, - "currency_code": "USD" - } - }, - "properties": { - "top_up_balance": { - "$ref": "#/components/schemas/Price" - }, - "minimum_balance_threshold": { - "$ref": "#/components/schemas/Price" - } - }, - "required": [ - "minimum_balance_threshold", - "top_up_balance" - ], - "title": "RechargeSettings", - "type": "object" - }, - "PostApiSubscriptionResponse": { - "description": "The updated API subscription.", - "example": { - "recharge_settings": { - "is_active": true - } - }, - "properties": { - "recharge_settings": { - "$ref": "#/components/schemas/RechargeSettingsResponse" - } - }, - "title": "PostApiSubscriptionResponse", - "type": "object" - }, - "PostApiSubscriptionError": { - "description": "Represents an error when attempting to update the API subscription.", - "example": { - "messages": [ - "messages", - "messages" - ] - }, - "properties": { - "messages": { - "description": "Error messages about what the error could be.", - "items": { - "description": "An error message, indicating what went wrong.", - "type": "string" - }, - "title": "messages", - "type": "array" - } - }, - "title": "PostApiSubscriptionError", - "type": "object" - }, - "PostApiSubscriptionRequest": { - "description": "Request to update API settings. Fields which are omitted will be ignored.", - "example": { - "recharge_settings": { - "minimum_balance_threshold": { - "amount": 1050, - "currency_code": "USD" - }, - "top_up_balance": { - "amount": 1050, - "currency_code": "USD" - } - }, - "is_active": true - }, - "properties": { - "recharge_settings": { - "$ref": "#/components/schemas/RechargeSettings" - }, - "is_active": { - "description": "Whether to enable or disable auto recharge.", - "title": "is_active", - "type": "boolean" - } - }, - "title": "PostApiSubscriptionRequest", - "type": "object" - }, - "ManageApiCreditSummaryResponse": { - "example": { - "total_issued": { - "amount": 1050, - "currency_code": "USD" - }, - "total_expired": { - "amount": 1050, - "currency_code": "USD" - }, - "total_consumed": { - "amount": 1050, - "currency_code": "USD" - }, - "credit_grants": [ - { - "effective_at": "effective_at", - "amount_consumed": { - "amount": 1050, - "currency_code": "USD" - }, - "expires_at": "expires_at", - "amount_available": { - "amount": 1050, - "currency_code": "USD" - }, - "grant_id": "grant_id", - "name": "name", - "amount_issued": { - "amount": 1050, - "currency_code": "USD" - } - }, - { - "effective_at": "effective_at", - "amount_consumed": { - "amount": 1050, - "currency_code": "USD" - }, - "expires_at": "expires_at", - "amount_available": { - "amount": 1050, - "currency_code": "USD" - }, - "grant_id": "grant_id", - "name": "name", - "amount_issued": { - "amount": 1050, - "currency_code": "USD" - } - } - ] - }, - "properties": { - "total_consumed": { - "$ref": "#/components/schemas/Price" - }, - "total_expired": { - "$ref": "#/components/schemas/Price" - }, - "total_issued": { - "$ref": "#/components/schemas/Price" - }, - "credit_grants": { - "description": "Per-grant breakdown of the user's credit grants. Empty if Metronome is unavailable.", - "items": { - "$ref": "#/components/schemas/CreditGrant" - }, - "title": "credit_grants", - "type": "array" - } - }, - "required": [ - "credit_grants", - "total_consumed", - "total_expired", - "total_issued" - ], - "title": "ManageApiCreditSummaryResponse", - "type": "object" - }, - "CreditGrant": { - "example": { - "effective_at": "effective_at", - "amount_consumed": { - "amount": 1050, - "currency_code": "USD" - }, - "expires_at": "expires_at", - "amount_available": { - "amount": 1050, - "currency_code": "USD" - }, - "grant_id": "grant_id", - "name": "name", - "amount_issued": { - "amount": 1050, - "currency_code": "USD" - } - }, - "properties": { - "grant_id": { - "description": "The Metronome grant identifier.", - "title": "grant_id", - "type": "string" - }, - "name": { - "description": "The grant name as shown in Metronome (e.g. \"Ideogram API Usage\").", - "title": "name", - "type": "string" - }, - "amount_issued": { - "$ref": "#/components/schemas/Price" - }, - "amount_consumed": { - "$ref": "#/components/schemas/Price" - }, - "amount_available": { - "$ref": "#/components/schemas/Price" - }, - "effective_at": { - "description": "ISO-8601 timestamp when the grant becomes effective.", - "title": "effective_at", - "type": "string" - }, - "expires_at": { - "description": "ISO-8601 timestamp when the grant expires. Omitted if the grant has no expiration.", - "title": "expires_at", - "type": "string" - } - }, - "required": [ - "amount_available", - "amount_consumed", - "amount_issued", - "effective_at", - "grant_id", - "name" - ], - "title": "CreditGrant", - "type": "object" - }, - "GetApiKeysResponse": { - "example": { - "current_api_keys": [ - { - "creation_time": "2000-01-23T04:56:07+00:00", - "redacted_api_key": "vkpDja", - "api_key_id": "JRPVD7jWR1aTBYiJ0UFVOg==" - }, - { - "creation_time": "2000-01-23T04:56:07+00:00", - "redacted_api_key": "vkpDja", - "api_key_id": "JRPVD7jWR1aTBYiJ0UFVOg==" - } - ] - }, - "properties": { - "current_api_keys": { - "default": [], - "description": "The current API keys that are active. Only returns redacted keys.", - "items": { - "$ref": "#/components/schemas/RedactedApiKey" - }, - "title": "current_api_keys", - "type": "array" - } - }, - "title": "GetApiKeysResponse", - "type": "object" - }, - "RedactedApiKey": { - "description": "A representation of an API key that does not contain the full key.", - "example": { - "creation_time": "2000-01-23T04:56:07+00:00", - "redacted_api_key": "vkpDja", - "api_key_id": "JRPVD7jWR1aTBYiJ0UFVOg==" - }, - "properties": { - "redacted_api_key": { - "description": "A redacted text snippet of the API key. Contains the first 4 characters of the API key", - "example": "vkpDja", - "title": "redacted_api_key", - "type": "string" - }, - "creation_time": { - "description": "The time at which the key was created", - "format": "date-time", - "title": "creation_time", - "type": "string" - }, - "api_key_id": { - "description": "A URL safe base64 encoded UUID", - "example": "JRPVD7jWR1aTBYiJ0UFVOg==", - "title": "api_key_id", - "type": "string" - } - }, - "required": [ - "api_key_id", - "creation_time", - "redacted_api_key" - ], - "title": "RedactedApiKey", - "type": "object" - }, - "PostApiKeyResponse": { - "example": { - "api_key": "example_api_key_replace_with_your_actual_key", - "api_key_id": "JRPVD7jWR1aTBYiJ0UFVOg==" - }, - "properties": { - "api_key": { - "description": "The API key to use when making authenticated requests with the API. This key will only be shown once.", - "example": "example_api_key_replace_with_your_actual_key", - "title": "api_key", - "type": "string" - }, - "api_key_id": { - "description": "The ID of the API key. A URL safe base64 encoded UUID", - "example": "JRPVD7jWR1aTBYiJ0UFVOg==", - "title": "api_key_id", - "type": "string" - } - }, - "required": [ - "api_key", - "api_key_id" - ], - "title": "PostApiKeyResponse", - "type": "object" - }, - "CreateApiKeyRequest": { - "example": { - "label": "label" - }, - "nullable": true, - "properties": { - "label": { - "description": "User-supplied label shown alongside the key in the management UI.", - "maxLength": 64, - "title": "label", - "type": "string" - } - }, - "title": "CreateApiKeyRequest", - "type": "object" - }, - "ApiProfileApiKey": { - "example": { - "creation_time": "2000-01-23T04:56:07+00:00", - "label": "Live production environment", - "redacted_api_key": "ATG56•••••••••••••", - "api_key_id": "JRPVD7jWR1aTBYiJ0UFVOg", - "creator_display_label": "John Doe", - "status": null - }, - "properties": { - "api_key_id": { - "description": "Base64 encoded API key ID", - "example": "JRPVD7jWR1aTBYiJ0UFVOg", - "title": "api_key_id", - "type": "string" - }, - "redacted_api_key": { - "description": "A redacted text snippet of the API key. Contains the first 4 characters of the API key", - "example": "ATG56•••••••••••••", - "title": "redacted_api_key", - "type": "string" - }, - "creation_time": { - "description": "The date at which the API key was created", - "format": "date-time", - "title": "creation_time", - "type": "string" - }, - "status": { - "$ref": "#/components/schemas/ApiKeyStatus" - }, - "label": { - "description": "An optional user-supplied label for managing the API key", - "example": "Live production environment", - "nullable": true, - "title": "label", - "type": "string" - }, - "creator_display_label": { - "description": "Name of the member who created the key, falling back to their display handle when no name is set. Null on keys created before creators were recorded, and on workspace types whose keys are shared rather than owned by one member.", - "example": "John Doe", - "nullable": true, - "title": "creator_display_label", - "type": "string" - } - }, - "required": [ - "api_key_id", - "creation_time", - "redacted_api_key", - "status" - ], - "title": "ApiProfileApiKey", - "type": "object" + "description": "Response returned by\n`POST /v2/image/generate/ideogram-4-transparent`. Synchronous\nrequests (the default) include the generated images in `data`.\nAsynchronous requests omit `data`; poll\n`GET /v2/generations/{generation_id}` with the returned\n`generation_id`. `seed` is the seed that was used, including when you\ndid not set one.\n", + "title": "GenerateImageIdeogramV4TransparentResponse" }, - "ApiKeyStatus": { - "description": "Status of the API key", + "ResolutionV3": { + "type": "string", "enum": [ - "ACTIVE", - "DISABLED", - "ARCHIVED" - ], - "title": "ApiKeyStatus", - "type": "string" - }, - "PatchApiKeyRequest": { - "example": { - "label": "Live production environment" - }, - "properties": { - "label": { - "description": "New label for the API key. Pass null (or omit) to clear the existing label.", - "example": "Live production environment", - "maxLength": 64, - "nullable": true, - "title": "label", - "type": "string" - } - }, - "title": "PatchApiKeyRequest", - "type": "object" - }, - "ManageApiStripeSubscriptionResponse": { - "example": { - "stripe_subscription_url": "stripe_subscription_url", - "stripe_billing_url": "stripe_billing_url", - "stripe_payment_setup_url": "stripe_payment_setup_url" - }, - "properties": { - "stripe_subscription_url": { - "description": "The URL for the user to checkout the Stripe subscription plan. Soft-deprecated — this is the legacy $0-subscription flow; new clients use stripe_payment_setup_url instead. Removed once no callers reference it.", - "title": "stripe_subscription_url", - "type": "string" - }, - "stripe_payment_setup_url": { - "description": "The URL for the user to capture a payment method via hosted Stripe Checkout (mode='setup'). No charge happens during this flow; the captured payment method is attached to the org's Stripe Customer via the checkout.session.completed webhook.", - "title": "stripe_payment_setup_url", - "type": "string" - }, - "stripe_billing_url": { - "deprecated": true, - "description": "DEPRECATED. The URL for the user to manage the existing Stripe subscription plan. Get this from ManageApiSubscriptionResponse instead.", - "title": "stripe_billing_url", - "type": "string" - } - }, - "title": "ManageApiStripeSubscriptionResponse", - "type": "object" - }, - "ManageApiPaymentResponse": { - "example": { - "client_secret": "client_secret" - }, - "properties": { - "client_secret": { - "description": "client_secret to be passed to the inline payment Elements on the client. Soft-deprecated — new clients use stripe_payment_setup_url on ManageApiStripeSubscriptionResponse for the hosted Checkout flow.", - "title": "client_secret", - "type": "string" - } - }, - "required": [ - "client_secret" - ], - "title": "ManageApiPaymentResponse", - "type": "object" - }, - "GetApiTermsResponse": { - "example": { - "has_accepted_terms": true, - "api_terms": { - "terms_url": "terms_url", - "terms_id": "terms_id" - } - }, - "properties": { - "api_terms": { - "$ref": "#/components/schemas/ApiTerms" - }, - "has_accepted_terms": { - "description": "Whether the requesting user has accepted the latest API terms.", - "title": "has_accepted_terms", - "type": "boolean" - } - }, - "required": [ - "api_terms", - "has_accepted_terms" - ], - "title": "GetApiTermsResponse", - "type": "object" - }, - "ApiTerms": { - "example": { - "terms_url": "terms_url", - "terms_id": "terms_id" - }, - "properties": { - "terms_id": { - "description": "The ID of the terms.", - "title": "terms_id", - "type": "string" - }, - "terms_url": { - "description": "The URL where the terms are hosted.", - "title": "terms_url", - "type": "string" - } - }, - "required": [ - "terms_id", - "terms_url" - ], - "title": "ApiTerms", - "type": "object" - }, - "PostApiTermsRequest": { - "example": { - "terms_id": "TOS_2024_04_20" - }, - "properties": { - "terms_id": { - "description": "The ID of the terms which are being accepted.", - "example": "TOS_2024_04_20", - "title": "terms_id", - "type": "string" - } - }, - "required": [ - "terms_id" + "512x1536", + "576x1408", + "576x1472", + "576x1536", + "640x1344", + "640x1408", + "640x1472", + "640x1536", + "704x1152", + "704x1216", + "704x1280", + "704x1344", + "704x1408", + "704x1472", + "736x1312", + "768x1088", + "768x1216", + "768x1280", + "768x1344", + "800x1280", + "832x960", + "832x1024", + "832x1088", + "832x1152", + "832x1216", + "832x1248", + "864x1152", + "896x960", + "896x1024", + "896x1088", + "896x1120", + "896x1152", + "960x832", + "960x896", + "960x1024", + "960x1088", + "1024x832", + "1024x896", + "1024x960", + "1024x1024", + "1088x768", + "1088x832", + "1088x896", + "1088x960", + "1120x896", + "1152x704", + "1152x832", + "1152x864", + "1152x896", + "1216x704", + "1216x768", + "1216x832", + "1248x832", + "1280x704", + "1280x768", + "1280x800", + "1312x736", + "1344x640", + "1344x704", + "1344x768", + "1408x576", + "1408x640", + "1408x704", + "1472x576", + "1472x640", + "1472x704", + "1536x512", + "1536x576", + "1536x640" ], - "title": "PostApiTermsRequest", - "type": "object" + "description": "The resolutions supported for Ideogram 3.0.", + "title": "ResolutionV3" }, - "PostAddCreditsResponse": { - "example": { - "amount": { - "amount": 1050, - "currency_code": "USD" - } - }, - "properties": { - "amount": { - "$ref": "#/components/schemas/Price" - } - }, - "required": [ - "amount" + "IdeogramV3AspectRatio": { + "type": "string", + "enum": [ + "auto", + "1x3", + "3x1", + "1x2", + "2x1", + "9x16", + "16x9", + "10x16", + "16x10", + "2x3", + "3x2", + "3x4", + "4x3", + "4x5", + "5x4", + "1x1" ], - "title": "PostAddCreditsResponse", - "type": "object" - }, - "PostAddCreditsError": { - "description": "Represents an error when attempting to add credits to an API user's account.", - "example": { - "messages": [ - "messages", - "messages" - ] - }, - "properties": { - "messages": { - "description": "Error messages about what the error could be.", - "items": { - "description": "An error message, indicating what went wrong.", - "type": "string" - }, - "title": "messages", - "type": "array" - } - }, - "title": "PostAddCreditsError", - "type": "object" - }, - "PostAddCreditsRequest": { - "example": { - "amount": { - "amount": 1050, - "currency_code": "USD" - } - }, - "properties": { - "amount": { - "$ref": "#/components/schemas/Price" - } - }, - "required": [ - "amount" + "description": "The aspect ratio for an Ideogram 3.x or 2.x generation. `auto` lets the\nmodel select a ratio from the prompt; any other value pins the ratio.\nCannot be combined with `resolution`. Omitting the field is not `auto`:\nit uses `1x1`.\n", + "title": "IdeogramV3AspectRatio" + }, + "V2ImageGenerateIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed": { + "type": "string", + "enum": [ + "turbo", + "default", + "quality" ], - "title": "PostAddCreditsRequest", - "type": "object" + "default": "default", + "description": "The rendering speed to use.", + "title": "V2ImageGenerateIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed" }, - "GetUserCreditsResponse": { - "example": { - "total_spend": { - "amount": 1050, - "currency_code": "USD" - }, - "average_daily_spend": { - "amount": 1050, - "currency_code": "USD" - }, - "available_credits": { - "amount": 1050, - "currency_code": "USD" - } - }, - "properties": { - "available_credits": { - "$ref": "#/components/schemas/Price" - }, - "total_spend": { - "$ref": "#/components/schemas/Price" - }, - "average_daily_spend": { - "$ref": "#/components/schemas/Price" - } - }, - "required": [ - "average_daily_spend", - "total_spend" + "IdeogramColorPalettePresetName": { + "type": "string", + "enum": [ + "ember", + "fresh", + "jungle", + "magic", + "melon", + "mosaic", + "pastel", + "ultramarine" ], - "title": "GetUserCreditsResponse", - "type": "object" + "description": "A color palette preset value.", + "title": "IdeogramColorPalettePresetName" }, - "SpendCommitInfoResponse": { - "example": { - "commits": [ - { - "commit_start_time": "2000-01-23T04:56:07+00:00", - "is_postpaid_commit": true, - "commit_amount_spent": { - "amount": 1050, - "currency_code": "USD" - }, - "commit_amount": { - "amount": 1050, - "currency_code": "USD" - }, - "commit_end_time": "2000-01-23T04:56:07+00:00" - }, - { - "commit_start_time": "2000-01-23T04:56:07+00:00", - "is_postpaid_commit": true, - "commit_amount_spent": { - "amount": 1050, - "currency_code": "USD" - }, - "commit_amount": { - "amount": 1050, - "currency_code": "USD" - }, - "commit_end_time": "2000-01-23T04:56:07+00:00" - } - ] - }, + "IdeogramColorPaletteWithPresetName": { + "type": "object", "properties": { - "commits": { - "description": "A list of spend commit information", - "items": { - "$ref": "#/components/schemas/SpendCommitInfo" - }, - "title": "commits", - "type": "array" + "name": { + "$ref": "#/components/schemas/IdeogramColorPalettePresetName" } }, "required": [ - "commits" + "name" ], - "title": "SpendCommitInfoResponse", - "type": "object" + "description": "A color palette specified only via its name. Cannot be used in conjunction with members.", + "title": "IdeogramColorPaletteWithPresetName" }, - "SpendCommitInfo": { - "example": { - "commit_start_time": "2000-01-23T04:56:07+00:00", - "is_postpaid_commit": true, - "commit_amount_spent": { - "amount": 1050, - "currency_code": "USD" - }, - "commit_amount": { - "amount": 1050, - "currency_code": "USD" - }, - "commit_end_time": "2000-01-23T04:56:07+00:00" - }, + "ColorPaletteMember": { + "type": "object", "properties": { - "commit_amount_spent": { - "$ref": "#/components/schemas/Price" - }, - "commit_amount": { - "$ref": "#/components/schemas/Price" - }, - "commit_start_time": { - "description": "The start time of the commit period", - "format": "date-time", - "title": "commit_start_time", - "type": "string" - }, - "commit_end_time": { - "description": "The end time of the commit period", - "format": "date-time", - "title": "commit_end_time", - "type": "string" + "color_hex": { + "type": "string", + "pattern": "^#(?:[0-9a-fA-F]{3}){1,2}$", + "description": "The hexadecimal representation of the color with an optional chosen weight." }, - "is_postpaid_commit": { - "description": "Whether the commit is postpaid (true) or prepaid (false)", - "title": "is_postpaid_commit", - "type": "boolean" - } - }, - "required": [ - "commit_amount", - "commit_amount_spent", - "commit_end_time", - "commit_start_time", - "is_postpaid_commit" - ], - "title": "SpendCommitInfo", - "type": "object" - }, - "GetUsageInfoResponse": { - "example": { - "usage_segments": [ - { - "segment_start": "2023-08-09T00:00:00+00:00", - "tool_usage": [ - { - "user_email_address": "user@company.com", - "model_version": "V_0_3", - "full_tool_name": "Turbo Image Generation V3", - "amount": { - "amount": 1050, - "currency_code": "USD" - }, - "tool_type": "GENERATE", - "api_key_id": "JRPVD7jWR1aTBYiJ0UFVOg" - }, - { - "user_email_address": "user@company.com", - "model_version": "V_0_3", - "full_tool_name": "Turbo Image Generation V3", - "amount": { - "amount": 1050, - "currency_code": "USD" - }, - "tool_type": "GENERATE", - "api_key_id": "JRPVD7jWR1aTBYiJ0UFVOg" - } - ], - "segment_end": "2023-08-09T23:59:59+00:00" - }, - { - "segment_start": "2023-08-09T00:00:00+00:00", - "tool_usage": [ - { - "user_email_address": "user@company.com", - "model_version": "V_0_3", - "full_tool_name": "Turbo Image Generation V3", - "amount": { - "amount": 1050, - "currency_code": "USD" - }, - "tool_type": "GENERATE", - "api_key_id": "JRPVD7jWR1aTBYiJ0UFVOg" - }, - { - "user_email_address": "user@company.com", - "model_version": "V_0_3", - "full_tool_name": "Turbo Image Generation V3", - "amount": { - "amount": 1050, - "currency_code": "USD" - }, - "tool_type": "GENERATE", - "api_key_id": "JRPVD7jWR1aTBYiJ0UFVOg" - } - ], - "segment_end": "2023-08-09T23:59:59+00:00" - } - ] - }, - "properties": { - "usage_segments": { - "description": "List of usage segments with tool-specific breakdowns", - "items": { - "$ref": "#/components/schemas/UsageSegment" - }, - "title": "usage_segments", - "type": "array" + "color_weight": { + "type": "number", + "format": "double", + "minimum": 0.05, + "maximum": 1, + "description": "The weight of the color in the color palette." } }, "required": [ - "usage_segments" + "color_hex" ], - "title": "GetUsageInfoResponse", - "type": "object" + "description": "A member of a color palette.", + "title": "ColorPaletteMember" }, - "UsageSegment": { - "example": { - "segment_start": "2023-08-09T00:00:00+00:00", - "tool_usage": [ - { - "user_email_address": "user@company.com", - "model_version": "V_0_3", - "full_tool_name": "Turbo Image Generation V3", - "amount": { - "amount": 1050, - "currency_code": "USD" - }, - "tool_type": "GENERATE", - "api_key_id": "JRPVD7jWR1aTBYiJ0UFVOg" - }, - { - "user_email_address": "user@company.com", - "model_version": "V_0_3", - "full_tool_name": "Turbo Image Generation V3", - "amount": { - "amount": 1050, - "currency_code": "USD" - }, - "tool_type": "GENERATE", - "api_key_id": "JRPVD7jWR1aTBYiJ0UFVOg" - } - ], - "segment_end": "2023-08-09T23:59:59+00:00" - }, + "ColorPaletteWithMembers": { + "type": "object", "properties": { - "segment_start": { - "description": "Start time of the usage segment", - "example": "2023-08-09T00:00:00+00:00", - "format": "date-time", - "title": "segment_start", - "type": "string" - }, - "segment_end": { - "description": "End time of the usage segment", - "example": "2023-08-09T23:59:59+00:00", - "format": "date-time", - "title": "segment_end", - "type": "string" - }, - "tool_usage": { - "description": "Tool-specific usage breakdown within this segment", + "members": { + "type": "array", "items": { - "$ref": "#/components/schemas/ToolUsage" + "$ref": "#/components/schemas/ColorPaletteMember" }, - "title": "tool_usage", - "type": "array" + "description": "A list of ColorPaletteMembers that define the color palette. Each color palette member\nconsists of a required color hex and an optional weight between 0.05 and 1.0 (inclusive).\nIt is recommended that these weights descend from highest to lowest for the color hexes provided.\n" } }, "required": [ - "segment_end", - "segment_start", - "tool_usage" + "members" ], - "title": "UsageSegment", - "type": "object" + "description": "A color palette represented only via its members. Cannot be used in conjunction with preset name.", + "title": "ColorPaletteWithMembers" }, - "ToolUsage": { - "example": { - "user_email_address": "user@company.com", - "model_version": "V_0_3", - "full_tool_name": "Turbo Image Generation V3", - "amount": { - "amount": 1050, - "currency_code": "USD" - }, - "tool_type": "GENERATE", - "api_key_id": "JRPVD7jWR1aTBYiJ0UFVOg" - }, - "properties": { - "full_tool_name": { - "description": "Name of the tool used", - "example": "Turbo Image Generation V3", - "title": "full_tool_name", - "type": "string" - }, - "amount": { - "$ref": "#/components/schemas/Price" - }, - "api_key_id": { - "description": "Base64 encoded API key ID (for API usage)", - "example": "JRPVD7jWR1aTBYiJ0UFVOg", - "title": "api_key_id", - "type": "string" - }, - "user_email_address": { - "description": "User email address (for web app usage)", - "example": "user@company.com", - "title": "user_email_address", - "type": "string" - }, - "tool_type": { - "$ref": "#/components/schemas/ToolType" + "IdeogramColorPalette": { + "oneOf": [ + { + "$ref": "#/components/schemas/IdeogramColorPaletteWithPresetName" }, - "model_version": { - "$ref": "#/components/schemas/ModelVersion" + { + "$ref": "#/components/schemas/ColorPaletteWithMembers" } - }, - "required": [ - "amount", - "full_tool_name", - "tool_type" ], - "title": "ToolUsage", - "type": "object" - }, - "ToolType": { - "description": "Tool type for filtering usage information", - "enum": [ - "GENERATE", - "REMIX", - "EDIT", - "UPSCALE", - "DESCRIBE", - "OTHER" - ], - "example": "GENERATE", - "title": "ToolType", - "type": "string" + "description": "A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members).", + "title": "IdeogramColorPalette" }, - "SegmentBy": { - "description": "Time segment granularity for usage breakdown", - "enum": [ - "DAY", - "HOUR" - ], - "example": "DAY", - "title": "SegmentBy", - "type": "string" + "StyleCode": { + "type": "string", + "pattern": "^[0-9a-fA-F]{8}$", + "description": "The 8 character hexadecimal representation of the style code.", + "title": "StyleCode" }, - "UsageSource": { - "default": "API", - "description": "Filter usage by source - API for programmatic API usage, APP for web application usage", + "IdeogramV3StyleType": { + "type": "string", "enum": [ - "API", - "APP" + "auto", + "general", + "realistic", + "design", + "custom", + "fiction", + "stylized" ], - "title": "UsageSource", - "type": "string" + "default": "general", + "description": "The style type to generate with.", + "title": "IdeogramV3StyleType" }, - "ModelVersion": { - "description": "The model_version to use.\n- V_0_3: Model 1.0\n- V_1_1: Model 1.1\n- V_1_5: Model 2.0\n- V_2_1: Model 2a\n- V_3_0: Model 3.0 March 26\n- V_3_1: Model 3.0 Latest\n- V_4_0: Model 4.0\n- V_4_D: Model 4.0 Layered Design (vector-text path; gated by the access_to_v4_experimental feature flag)\n- V_4_LAYOUT2IMAGE: Model 4.0 Layout to Image (HTML layout rasterized as IMAGE_TO_IMAGE conditioning; gated by the access_to_v4_experimental feature flag)\n- AUTO: Automatically select the best model version based on the request.\n", - "enum": [ - "V_0_1", - "V_0_2", - "V_0_3", - "V_1_1", - "V_1_5", - "V_2_1", - "V_3_0", - "V_3_1", - "V_4_0", - "V_4_D", - "V_4_LAYOUT2IMAGE", - "EXTERNAL_GOOGLE_VEO_3_0", - "EXTERNAL_BYTEDANCE_SEEDANCE_1_0_PRO", - "EXTERNAL_MINIMAX_HAILUO_02", - "EXTERNAL_MODEL", - "AUTO" - ], - "example": "V_0_3", - "title": "ModelVersion", + "IdeogramV3StylePreset": { "type": "string", - "x-tool-description": "Model to use: V_1_1 (1.1), V_1_5 (2.0), V_2_1 (2a), V_3_1 (3.0), V_4_0 (4.0), V_4_D (layered design), V_4_LAYOUT2IMAGE (layout to image), or AUTO (server-selected). Experimental models require account access. V_0_3 and V_3_0 are retired and rejected." - }, - "GetApiProfilesResponse": { - "example": { - "profiles": [ - { - "is_metronome_2_user": true, - "copyright_detection_enabled": true, - "role": "OWNER", - "avatar_url": "https://example.com/avatar.jpg", - "organization_id": "b3JnYW5pemF0aW9uXzEyMw", - "name": "Gamma", - "type": "INDIVIDUAL", - "api_keys": [ - { - "creation_time": "2000-01-23T04:56:07+00:00", - "label": "Live production environment", - "redacted_api_key": "ATG56•••••••••••••", - "api_key_id": "JRPVD7jWR1aTBYiJ0UFVOg", - "creator_display_label": "John Doe", - "status": null - }, - { - "creation_time": "2000-01-23T04:56:07+00:00", - "label": "Live production environment", - "redacted_api_key": "ATG56•••••••••••••", - "api_key_id": "JRPVD7jWR1aTBYiJ0UFVOg", - "creator_display_label": "John Doe", - "status": null - } - ], - "max_num_inflight_requests_permitted": 10 - }, - { - "is_metronome_2_user": true, - "copyright_detection_enabled": true, - "role": "OWNER", - "avatar_url": "https://example.com/avatar.jpg", - "organization_id": "b3JnYW5pemF0aW9uXzEyMw", - "name": "Gamma", - "type": "INDIVIDUAL", - "api_keys": [ - { - "creation_time": "2000-01-23T04:56:07+00:00", - "label": "Live production environment", - "redacted_api_key": "ATG56•••••••••••••", - "api_key_id": "JRPVD7jWR1aTBYiJ0UFVOg", - "creator_display_label": "John Doe", - "status": null - }, - { - "creation_time": "2000-01-23T04:56:07+00:00", - "label": "Live production environment", - "redacted_api_key": "ATG56•••••••••••••", - "api_key_id": "JRPVD7jWR1aTBYiJ0UFVOg", - "creator_display_label": "John Doe", - "status": null - } - ], - "max_num_inflight_requests_permitted": 10 - } - ] - }, - "properties": { - "profiles": { - "default": [], - "description": "List of user's API profiles", - "items": { - "$ref": "#/components/schemas/ApiProfile" - }, - "title": "profiles", - "type": "array" - } - }, - "required": [ - "profiles" + "enum": [ + "80s_illustration", + "90s_nostalgia", + "abstract_organic", + "analog_nostalgia", + "art_brut", + "art_deco", + "art_poster", + "aura", + "avant_garde", + "bauhaus", + "blueprint", + "blurry_motion", + "bright_art", + "c4d_cartoon", + "childrens_book", + "collage", + "coloring_book_i", + "coloring_book_ii", + "cubism", + "dark_aura", + "doodle", + "double_exposure", + "dramatic_cinema", + "editorial", + "emotional_minimal", + "ethereal_party", + "expired_film", + "flat_art", + "flat_vector", + "forest_reverie", + "geo_minimalist", + "glass_prism", + "golden_hour", + "graffiti_i", + "graffiti_ii", + "halftone_print", + "high_contrast", + "hippie_era", + "iconic", + "japandi_fusion", + "jazzy", + "long_exposure", + "magazine_editorial", + "minimal_illustration", + "mixed_media", + "monochrome", + "nightlife", + "oil_painting", + "old_cartoons", + "paint_gesture", + "pop_art", + "retro_etching", + "riviera_pop", + "spotlight_80s", + "stylized_red", + "surreal_collage", + "travel_poster", + "vintage_geo", + "vintage_poster", + "watercolor", + "weird", + "woodblock_print" ], - "title": "GetApiProfilesResponse", - "type": "object" + "description": "A predefined style preset that applies a specific artistic style to the generated image.", + "title": "IdeogramV3StylePreset" }, - "ApiProfile": { - "example": { - "is_metronome_2_user": true, - "copyright_detection_enabled": true, - "role": "OWNER", - "avatar_url": "https://example.com/avatar.jpg", - "organization_id": "b3JnYW5pemF0aW9uXzEyMw", - "name": "Gamma", - "type": "INDIVIDUAL", - "api_keys": [ - { - "creation_time": "2000-01-23T04:56:07+00:00", - "label": "Live production environment", - "redacted_api_key": "ATG56•••••••••••••", - "api_key_id": "JRPVD7jWR1aTBYiJ0UFVOg", - "creator_display_label": "John Doe", - "status": null - }, - { - "creation_time": "2000-01-23T04:56:07+00:00", - "label": "Live production environment", - "redacted_api_key": "ATG56•••••••••••••", - "api_key_id": "JRPVD7jWR1aTBYiJ0UFVOg", - "creator_display_label": "John Doe", - "status": null - } - ], - "max_num_inflight_requests_permitted": 10 - }, + "GenerateImageIdeogramV3Response": { + "type": "object", "properties": { - "type": { - "$ref": "#/components/schemas/ApiProfileType" - }, - "name": { - "description": "The display name of the profile", - "example": "Gamma", - "title": "name", - "type": "string" - }, - "avatar_url": { - "description": "URL to the profile avatar", - "example": "https://example.com/avatar.jpg", - "title": "avatar_url", - "type": "string" - }, - "organization_id": { - "description": "Base64 encoded organization ID (only for ENTERPRISE profiles)", - "example": "b3JnYW5pemF0aW9uXzEyMw", - "title": "organization_id", - "type": "string" - }, - "role": { - "$ref": "#/components/schemas/ApiProfileRole" + "generation_id": { + "type": "string", + "description": "URL-safe base64 ID of the generation. Use it to poll\n`GET /v2/generations/{generation_id}`.\n" }, - "api_keys": { - "default": [], - "description": "List of API keys associated with this profile", + "data": { + "type": "array", "items": { - "$ref": "#/components/schemas/ApiProfileApiKey" + "$ref": "#/components/schemas/GeneratedImageObject" }, - "title": "api_keys", - "type": "array" - }, - "is_metronome_2_user": { - "description": "Whether the user is on Metronome 2.0", - "title": "is_metronome_2_user", - "type": "boolean" - }, - "max_num_inflight_requests_permitted": { - "description": "The maximum number of inflight requests permitted for the profile", - "example": 10, - "title": "max_num_inflight_requests_permitted", - "type": "integer" - }, - "copyright_detection_enabled": { - "description": "Whether post-generation copyright detection (Hive likeness + logo) is enabled for this organization's API generations. When true, every successful generation is run through Hive IP scoring after the asset is saved; images that cross the likeness or logo thresholds come back with `is_image_safe = false`. Only populated for ENTERPRISE profiles.", - "nullable": true, - "title": "copyright_detection_enabled", - "type": "boolean" + "description": "The generated images, in generation order. Present only for synchronous requests (`async` omitted or false)." + }, + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." } }, "required": [ - "api_keys", - "is_metronome_2_user", - "max_num_inflight_requests_permitted", - "name", - "organization_id", - "role", - "type" - ], - "title": "ApiProfile", - "type": "object" + "generation_id", + "seed" + ], + "description": "Response returned by `POST /v2/image/generate/ideogram-3`.\nSynchronous requests (the default) include the generated images in\n`data`. Asynchronous requests omit `data`; poll\n`GET /v2/generations/{generation_id}` with the returned\n`generation_id`. `seed` is the seed that was used, including when you\ndid not set one.\n", + "title": "GenerateImageIdeogramV3Response" }, - "ApiProfileType": { - "description": "Type of API profile. TEAM is a seat-based team workspace, where each key belongs to the member who created it and spends that member's seat credits; the other types share their keys across the whole workspace.", + "V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed": { + "type": "string", "enum": [ - "INDIVIDUAL", - "ENTERPRISE", - "ENTERPRISE_PREPAID", - "TEAM" - ], - "example": "INDIVIDUAL", - "title": "ApiProfileType", - "type": "string" + "turbo", + "default", + "quality" + ], + "default": "default", + "description": "The rendering speed to use.", + "title": "V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed" }, - "ApiProfileRole": { - "description": "Role within an organization profile. ADMIN only exists for ENTERPRISE_PREPAID organizations.", + "V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType": { + "type": "string", "enum": [ - "OWNER", - "ADMIN", - "MEMBER" + "auto", + "realistic", + "fiction" ], - "example": "OWNER", - "title": "ApiProfileRole", - "type": "string" + "default": "auto", + "description": "The style type to generate the character with. Defaults to `auto`.", + "title": "V2ImageGenerateIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType" }, - "UpdateOrganizationApiPropertiesResponse": { - "example": { - "copyright_detection_enabled": true - }, + "GenerateImageIdeogramV3CharacterResponse": { + "type": "object", "properties": { - "copyright_detection_enabled": { - "description": "The setting after the update.", - "title": "copyright_detection_enabled", - "type": "boolean" + "generation_id": { + "type": "string", + "description": "URL-safe base64 ID of the generation. Use it to poll\n`GET /v2/generations/{generation_id}`.\n" + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GeneratedImageObject" + }, + "description": "The generated images, in generation order. Present only for synchronous requests (`async` omitted or false)." + }, + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." } }, "required": [ - "copyright_detection_enabled" + "generation_id", + "seed" ], - "title": "UpdateOrganizationApiPropertiesResponse", - "type": "object" + "description": "Response returned by `POST /v2/image/generate/ideogram-3-character`.\nSynchronous requests (the default) include the generated images in\n`data`. Asynchronous requests omit `data`; poll\n`GET /v2/generations/{generation_id}` with the returned\n`generation_id`. `seed` is the seed that was used, including when you\ndid not set one.\n", + "title": "GenerateImageIdeogramV3CharacterResponse" }, - "UpdateOrganizationApiPropertiesRequest": { - "description": "Partial update for an organization's API-only properties. Only fields explicitly present are written; unset fields preserve their current value.", - "example": { - "copyright_detection_enabled": true - }, - "properties": { - "copyright_detection_enabled": { - "description": "Toggle post-generation Hive likeness + logo detection for this organization. See ApiProfile.copyright_detection_enabled for behavior.", - "nullable": true, - "title": "copyright_detection_enabled", - "type": "boolean" - } - }, - "title": "UpdateOrganizationApiPropertiesRequest", - "type": "object" + "V2ImageGenerateIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed": { + "type": "string", + "enum": [ + "turbo", + "default", + "quality" + ], + "description": "The rendering speed to use. When omitted, a speed supported by the custom model is used.", + "title": "V2ImageGenerateIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed" }, - "GetApiOrganizationUserSuggestionsResponse": { - "example": { - "user_suggestions": [ - { - "display_handle": "john_doe", - "joined": false, - "profile_pic": "https://example.com/avatars/user123.jpg", - "name": "John Doe" - }, - { - "display_handle": "john_doe", - "joined": false, - "profile_pic": "https://example.com/avatars/user123.jpg", - "name": "John Doe" - } - ] - }, + "GenerateImageIdeogramV3CustomModelResponse": { + "type": "object", "properties": { - "user_suggestions": { - "default": [], - "description": "List of user suggestions for the organization", + "generation_id": { + "type": "string", + "description": "URL-safe base64 ID of the generation. Use it to poll\n`GET /v2/generations/{generation_id}`.\n" + }, + "data": { + "type": "array", "items": { - "$ref": "#/components/schemas/ApiOrganizationUserSuggestion" + "$ref": "#/components/schemas/GeneratedImageObject" }, - "title": "user_suggestions", - "type": "array" + "description": "The generated images, in generation order. Present only for synchronous requests (`async` omitted or false)." + }, + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." } }, "required": [ - "user_suggestions" + "generation_id", + "seed" ], - "title": "GetApiOrganizationUserSuggestionsResponse", - "type": "object" + "description": "Response returned by `POST /v2/image/generate/ideogram-3-custom-model`.\nSynchronous requests (the default) include the generated images in\n`data`. Asynchronous requests omit `data`; poll\n`GET /v2/generations/{generation_id}` with the returned\n`generation_id`. `seed` is the seed that was used, including when you\ndid not set one.\n", + "title": "GenerateImageIdeogramV3CustomModelResponse" }, - "ApiOrganizationUserSuggestion": { - "example": { - "display_handle": "john_doe", - "joined": false, - "profile_pic": "https://example.com/avatars/user123.jpg", - "name": "John Doe" - }, + "GenerateImageIdeogramV3TransparentRequestUpscaleFactor": { + "type": "string", + "enum": [ + "x1", + "x2", + "x4" + ], + "default": "x1", + "description": "Optional enhancement factor applied after generation. `x1` (the default) delivers the base render.", + "title": "GenerateImageIdeogramV3TransparentRequestUpscaleFactor" + }, + "GenerateImageIdeogramV3TransparentRequestRenderingSpeed": { + "type": "string", + "enum": [ + "turbo", + "default", + "quality" + ], + "default": "default", + "description": "The rendering speed to use.", + "title": "GenerateImageIdeogramV3TransparentRequestRenderingSpeed" + }, + "GenerateImageIdeogramV3TransparentRequest": { + "type": "object", "properties": { - "display_handle": { - "description": "The display handle of the user", - "example": "john_doe", - "title": "display_handle", - "type": "string" + "prompt": { + "type": "string", + "minLength": 1, + "maxLength": 10000, + "description": "The prompt to generate images from." }, - "joined": { - "description": "Whether the user has already joined the organization", - "example": false, - "title": "joined", - "type": "boolean" + "negative_prompt": { + "type": "string", + "maxLength": 10000, + "description": "Description of what to exclude from the images. The prompt takes precedence over the negative prompt." }, - "profile_pic": { - "description": "URL to the user's profile picture", - "example": "https://example.com/avatars/user123.jpg", - "format": "uri", - "title": "profile_pic", - "type": "string" + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." }, - "name": { - "description": "The full name of the user", - "example": "John Doe", - "title": "name", - "type": "string" + "upscale_factor": { + "$ref": "#/components/schemas/GenerateImageIdeogramV3TransparentRequestUpscaleFactor", + "default": "x1", + "description": "Optional enhancement factor applied after generation. `x1` (the default) delivers the base render." + }, + "aspect_ratio": { + "$ref": "#/components/schemas/IdeogramV3AspectRatio" + }, + "rendering_speed": { + "$ref": "#/components/schemas/GenerateImageIdeogramV3TransparentRequestRenderingSpeed", + "default": "default", + "description": "The rendering speed to use." + }, + "magic_prompt": { + "$ref": "#/components/schemas/MagicPromptMode", + "default": "auto", + "description": "Controls magic prompt (automatic prompt rewriting). Defaults to `auto`." + }, + "num_images": { + "type": "integer", + "minimum": 1, + "maximum": 8, + "default": 1, + "description": "The number of images to generate." + }, + "enable_copyright_detection": { + "type": [ + "boolean", + "null" + ], + "description": "Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`." + }, + "async": { + "type": "boolean", + "default": false, + "description": "When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result." + }, + "webhook_url": { + "type": "string", + "format": "uri", + "maxLength": 2048, + "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n" } }, "required": [ - "display_handle", - "joined" + "prompt" ], - "title": "ApiOrganizationUserSuggestion", - "type": "object" + "title": "GenerateImageIdeogramV3TransparentRequest" }, - "GetOrganizationMembersResponse": { - "example": { - "members": [ - { - "invite_id": "invite_id", - "display_handle": "john_doe", - "email_address": "john.doe@example.com", - "role": "OWNER", - "full_name": "full_name", - "invite_expiry_time": "2000-01-23T04:56:07+00:00", - "avatar_url": "https://example.com/avatars/user123.jpg", - "user_id": "dXNlcl8xMjM", - "invite_status": "PENDING" - }, - { - "invite_id": "invite_id", - "display_handle": "john_doe", - "email_address": "john.doe@example.com", - "role": "OWNER", - "full_name": "full_name", - "invite_expiry_time": "2000-01-23T04:56:07+00:00", - "avatar_url": "https://example.com/avatars/user123.jpg", - "user_id": "dXNlcl8xMjM", - "invite_status": "PENDING" - } - ] - }, + "GenerateImageIdeogramV3TransparentResponse": { + "type": "object", "properties": { - "members": { - "default": [], - "description": "List of organization members", + "generation_id": { + "type": "string", + "description": "URL-safe base64 ID of the generation. Use it to poll\n`GET /v2/generations/{generation_id}`.\n" + }, + "data": { + "type": "array", "items": { - "$ref": "#/components/schemas/OrganizationMember" + "$ref": "#/components/schemas/GeneratedImageObject" }, - "title": "members", - "type": "array" + "description": "The generated images, in generation order. Present only for synchronous requests (`async` omitted or false)." + }, + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." } }, "required": [ - "members" + "generation_id", + "seed" ], - "title": "GetOrganizationMembersResponse", - "type": "object" + "description": "Response returned by\n`POST /v2/image/generate/ideogram-3-transparent`. Synchronous\nrequests (the default) include the generated images in `data`.\nAsynchronous requests omit `data`; poll\n`GET /v2/generations/{generation_id}` with the returned\n`generation_id`. `seed` is the seed that was used, including when you\ndid not set one.\n", + "title": "GenerateImageIdeogramV3TransparentResponse" }, - "OrganizationMember": { - "example": { - "invite_id": "invite_id", - "display_handle": "john_doe", - "email_address": "john.doe@example.com", - "role": "OWNER", - "full_name": "full_name", - "invite_expiry_time": "2000-01-23T04:56:07+00:00", - "avatar_url": "https://example.com/avatars/user123.jpg", - "user_id": "dXNlcl8xMjM", - "invite_status": "PENDING" - }, + "GenerateImageIdeogramV2ARequestRenderingSpeed": { + "type": "string", + "enum": [ + "turbo", + "default", + "quality" + ], + "default": "default", + "description": "The rendering speed to use. `turbo` generates faster at a lower cost, while `quality` prioritizes the highest-quality result.", + "title": "GenerateImageIdeogramV2ARequestRenderingSpeed" + }, + "IdeogramV2StyleType": { + "type": "string", + "enum": [ + "auto", + "general", + "realistic", + "design", + "render_3d", + "anime" + ], + "description": "The style type to generate with. When omitted, the model's default styling is used; pass `auto` to have a style selected automatically from the prompt.", + "title": "IdeogramV2StyleType" + }, + "GenerateImageIdeogramV2ARequest": { + "type": "object", "properties": { - "user_id": { - "description": "Base64 encoded user ID. Null for a pending invite to an email that has no account yet.", - "example": "dXNlcl8xMjM", - "nullable": true, - "title": "user_id", - "type": "string" + "prompt": { + "type": "string", + "minLength": 1, + "maxLength": 10000, + "description": "The prompt to generate images from." }, - "display_handle": { - "description": "The display handle/username of the member. Null for a pending invite to an email that has no account yet.", - "example": "john_doe", - "nullable": true, - "title": "display_handle", - "type": "string" + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." }, - "email_address": { - "description": "The email address of the member", - "example": "john.doe@example.com", - "title": "email_address", - "type": "string" + "aspect_ratio": { + "$ref": "#/components/schemas/IdeogramV3AspectRatio" }, - "avatar_url": { - "description": "URL to the member's avatar image. Null for a pending invite to an email that has no account yet.", - "example": "https://example.com/avatars/user123.jpg", - "format": "uri", - "nullable": true, - "title": "avatar_url", - "type": "string" + "rendering_speed": { + "$ref": "#/components/schemas/GenerateImageIdeogramV2ARequestRenderingSpeed", + "default": "default", + "description": "The rendering speed to use. `turbo` generates faster at a lower cost, while `quality` prioritizes the highest-quality result." }, - "role": { - "$ref": "#/components/schemas/ApiProfileRole" + "magic_prompt": { + "$ref": "#/components/schemas/MagicPromptMode", + "default": "auto", + "description": "Controls magic prompt (automatic prompt rewriting). Defaults to `auto`." }, - "full_name": { - "description": "User's full name if entered through user profile.", - "nullable": true, - "title": "full_name", - "type": "string" + "num_images": { + "type": "integer", + "minimum": 1, + "maximum": 8, + "default": 1, + "description": "The number of images to generate." }, - "invite_status": { - "description": "Invite status, e.g. PENDING. Only populated while the member is still a pending invite; null for active members.", - "example": "PENDING", - "nullable": true, - "title": "invite_status", - "type": "string" + "style_type": { + "$ref": "#/components/schemas/IdeogramV2StyleType" }, - "invite_id": { - "description": "Base64 encoded invite ID. Only populated while the member is still a pending invite; null for active members.", - "nullable": true, - "title": "invite_id", - "type": "string" + "enable_copyright_detection": { + "type": [ + "boolean", + "null" + ], + "description": "Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`." }, - "invite_expiry_time": { - "description": "When the pending invite expires. Only populated while the member is still a pending invite; null for active members.", - "format": "date-time", - "nullable": true, - "title": "invite_expiry_time", - "type": "string" + "async": { + "type": "boolean", + "default": false, + "description": "When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result." + }, + "webhook_url": { + "type": "string", + "format": "uri", + "maxLength": 2048, + "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n" } }, "required": [ - "email_address", - "role" + "prompt" ], - "title": "OrganizationMember", - "type": "object" + "title": "GenerateImageIdeogramV2ARequest" }, - "CreateApiKeyResponse": { - "example": { - "creation_time": "2024-05-25T02:00:30+00:00", - "api_key": "example_api_key_replace_with_your_actual_key", - "api_key_id": "JRPVD7jWR1aTBYiJ0UFVOg==" - }, + "GenerateImageIdeogramV2AResponse": { + "type": "object", "properties": { - "api_key": { - "description": "The API key to use when making authenticated requests with the API. This key will only be shown once.", - "example": "example_api_key_replace_with_your_actual_key", - "title": "api_key", - "type": "string" + "generation_id": { + "type": "string", + "description": "URL-safe base64 ID of the generation. Use it to poll\n`GET /v2/generations/{generation_id}`.\n" }, - "api_key_id": { - "description": "The ID of the API key. A URL safe base64 encoded UUID", - "example": "JRPVD7jWR1aTBYiJ0UFVOg==", - "title": "api_key_id", - "type": "string" + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GeneratedImageObject" + }, + "description": "The generated images, in generation order. Present only for synchronous requests (`async` omitted or false)." }, - "creation_time": { - "description": "The time at which the API key was created", - "example": "2024-05-25T02:00:30+00:00", - "format": "date-time", - "title": "creation_time", - "type": "string" + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." } }, "required": [ - "api_key", - "api_key_id", - "creation_time" + "generation_id", + "seed" ], - "title": "CreateApiKeyResponse", - "type": "object" + "description": "Response returned by `POST /v2/image/generate/ideogram-2a`.\nSynchronous requests (the default) include the generated images in\n`data`. Asynchronous requests omit `data`; poll\n`GET /v2/generations/{generation_id}` with the returned\n`generation_id`. `seed` is the seed that was used, including when you\ndid not set one.\n", + "title": "GenerateImageIdeogramV2AResponse" }, - "GetApiKeysV2Response": { - "example": { - "api_keys": [ - { - "creation_time": "2000-01-23T04:56:07+00:00", - "label": "Live production environment", - "redacted_api_key": "ATG56•••••••••••••", - "api_key_id": "JRPVD7jWR1aTBYiJ0UFVOg", - "creator_display_label": "John Doe", - "status": null - }, - { - "creation_time": "2000-01-23T04:56:07+00:00", - "label": "Live production environment", - "redacted_api_key": "ATG56•••••••••••••", - "api_key_id": "JRPVD7jWR1aTBYiJ0UFVOg", - "creator_display_label": "John Doe", - "status": null - } - ] - }, + "GenerateImageIdeogramV2RequestRenderingSpeed": { + "type": "string", + "enum": [ + "turbo", + "default", + "quality" + ], + "default": "default", + "description": "The rendering speed to use. `turbo` generates faster at a lower cost, while `quality` prioritizes the highest-quality result.", + "title": "GenerateImageIdeogramV2RequestRenderingSpeed" + }, + "GenerateImageIdeogramV2Request": { + "type": "object", "properties": { - "api_keys": { - "default": [], - "description": "List of API keys associated with the organization", - "items": { - "$ref": "#/components/schemas/ApiProfileApiKey" - }, - "title": "api_keys", - "type": "array" + "prompt": { + "type": "string", + "minLength": 1, + "maxLength": 10000, + "description": "The prompt to generate images from." + }, + "negative_prompt": { + "type": "string", + "maxLength": 10000, + "description": "Description of what to exclude from the images. The prompt takes precedence over the negative prompt." + }, + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." + }, + "aspect_ratio": { + "$ref": "#/components/schemas/IdeogramV3AspectRatio" + }, + "rendering_speed": { + "$ref": "#/components/schemas/GenerateImageIdeogramV2RequestRenderingSpeed", + "default": "default", + "description": "The rendering speed to use. `turbo` generates faster at a lower cost, while `quality` prioritizes the highest-quality result." + }, + "magic_prompt": { + "$ref": "#/components/schemas/MagicPromptMode", + "default": "auto", + "description": "Controls magic prompt (automatic prompt rewriting). Defaults to `auto`." + }, + "num_images": { + "type": "integer", + "minimum": 1, + "maximum": 8, + "default": 1, + "description": "The number of images to generate." + }, + "style_type": { + "$ref": "#/components/schemas/IdeogramV2StyleType" + }, + "enable_copyright_detection": { + "type": [ + "boolean", + "null" + ], + "description": "Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`." + }, + "async": { + "type": "boolean", + "default": false, + "description": "When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result." + }, + "webhook_url": { + "type": "string", + "format": "uri", + "maxLength": 2048, + "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n" } }, "required": [ - "api_keys" + "prompt" ], - "title": "GetApiKeysV2Response", - "type": "object" + "title": "GenerateImageIdeogramV2Request" }, - "OrganizationMemberOperationResponse": { - "example": { - "results": [ - { - "success": true, - "message": "message" - }, - { - "success": true, - "message": "message" - } - ] - }, + "GenerateImageIdeogramV2Response": { + "type": "object", "properties": { - "results": { - "description": "List of results for each member operation", + "generation_id": { + "type": "string", + "description": "URL-safe base64 ID of the generation. Use it to poll\n`GET /v2/generations/{generation_id}`.\n" + }, + "data": { + "type": "array", "items": { - "$ref": "#/components/schemas/OrganizationMemberOperationResult" + "$ref": "#/components/schemas/GeneratedImageObject" }, - "title": "results", - "type": "array" + "description": "The generated images, in generation order. Present only for synchronous requests (`async` omitted or false)." + }, + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." } }, "required": [ - "results" + "generation_id", + "seed" ], - "title": "OrganizationMemberOperationResponse", - "type": "object" + "description": "Response returned by `POST /v2/image/generate/ideogram-2`.\nSynchronous requests (the default) include the generated images in\n`data`. Asynchronous requests omit `data`; poll\n`GET /v2/generations/{generation_id}` with the returned\n`generation_id`. `seed` is the seed that was used, including when you\ndid not set one.\n", + "title": "GenerateImageIdeogramV2Response" }, - "OrganizationMemberOperationResult": { - "example": { - "success": true, - "message": "message" - }, - "properties": { - "success": { - "description": "Whether the operation was successful for this member", - "title": "success", - "type": "boolean" - }, - "message": { - "description": "A message describing the outcome of the operation for this member", - "title": "message", - "type": "string" - } - }, - "required": [ - "success" + "V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaBackground": { + "type": "string", + "enum": [ + "auto", + "transparent", + "opaque" ], - "title": "OrganizationMemberOperationResult", - "type": "object" + "default": "auto", + "description": "The output background. `transparent` returns images with an alpha channel, `opaque` forces a solid background, and `auto` lets the model decide from the prompt.", + "title": "V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaBackground" }, - "AddOrganizationMembersRequest": { - "example": { - "members": [ - { - "display_handle": "john_doe", - "email_address": "john.doe@example.com", - "user_id": "dXNlcl8xMjM" - }, - { - "display_handle": "john_doe", - "email_address": "john.doe@example.com", - "user_id": "dXNlcl8xMjM" - } - ] - }, - "properties": { - "members": { - "default": [], - "description": "List of organization members to add", - "items": { - "$ref": "#/components/schemas/LiteOrganizationMember" - }, - "title": "members", - "type": "array" - } - }, - "required": [ - "members" + "V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaQuality": { + "type": "string", + "enum": [ + "auto", + "low", + "medium", + "high" ], - "title": "AddOrganizationMembersRequest", - "type": "object" + "default": "auto", + "description": "How much rendering effort the model spends. Lower tiers return sooner and cost less; `auto` lets the model choose, which it currently renders at `high`.", + "title": "V2ImageGenerateGptImage25FlarePostRequestBodyContentMultipartFormDataSchemaQuality" }, - "LiteOrganizationMember": { - "description": "A lite representation of an organization member with optional fields for identification", - "example": { - "display_handle": "john_doe", - "email_address": "john.doe@example.com", - "user_id": "dXNlcl8xMjM" - }, + "GenerateImageGptImage25FlareResponse": { + "type": "object", "properties": { - "user_id": { - "description": "Base64 encoded user ID", - "example": "dXNlcl8xMjM", - "title": "user_id", - "type": "string" - }, - "display_handle": { - "description": "The display handle/username of the member", - "example": "john_doe", - "title": "display_handle", - "type": "string" + "generation_id": { + "type": "string", + "description": "URL-safe base64 ID of the generation. Use it to poll\n`GET /v2/generations/{generation_id}`.\n" }, - "email_address": { - "description": "The email address of the member", - "example": "john.doe@example.com", - "title": "email_address", - "type": "string" - } - }, - "title": "LiteOrganizationMember", - "type": "object" - }, - "RemoveOrganizationMembersRequest": { - "example": { - "members": [ - { - "display_handle": "john_doe", - "email_address": "john.doe@example.com", - "user_id": "dXNlcl8xMjM" - }, - { - "display_handle": "john_doe", - "email_address": "john.doe@example.com", - "user_id": "dXNlcl8xMjM" - } - ] - }, - "properties": { - "members": { - "default": [], - "description": "List of organization members to remove", + "data": { + "type": "array", "items": { - "$ref": "#/components/schemas/LiteOrganizationMember" + "$ref": "#/components/schemas/GeneratedImageObject" }, - "title": "members", - "type": "array" + "description": "The generated images, in generation order. Present only for synchronous requests (`async` omitted or false)." + }, + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." } }, "required": [ - "members" + "generation_id", + "seed" ], - "title": "RemoveOrganizationMembersRequest", - "type": "object" + "description": "Response returned by `POST /v2/image/generate/gpt-image-2-5-flare`.\nSynchronous requests (the default) include the generated images in\n`data`. Asynchronous requests omit `data`; poll\n`GET /v2/generations/{generation_id}` with the returned\n`generation_id`. `seed` is the seed that was used, including when you\ndid not set one.\n", + "title": "GenerateImageGptImage25FlareResponse" }, - "PromoteOrganizationAdminsRequest": { - "example": { - "members": [ - { - "display_handle": "john_doe", - "email_address": "john.doe@example.com", - "user_id": "dXNlcl8xMjM" - }, - { - "display_handle": "john_doe", - "email_address": "john.doe@example.com", - "user_id": "dXNlcl8xMjM" - } - ] - }, + "V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaBackground": { + "type": "string", + "enum": [ + "auto", + "transparent", + "opaque" + ], + "default": "auto", + "description": "The output background. `transparent` returns images with an alpha channel, `opaque` forces a solid background, and `auto` lets the model decide from the prompt.", + "title": "V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaBackground" + }, + "V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaQuality": { + "type": "string", + "enum": [ + "auto", + "low", + "medium", + "high" + ], + "default": "auto", + "description": "How much rendering effort the model spends. Lower tiers return sooner and cost less; `auto` lets the model choose, which it currently renders at `high`.", + "title": "V2ImageGenerateGptImage25SunburstPostRequestBodyContentMultipartFormDataSchemaQuality" + }, + "GenerateImageGptImage25SunburstResponse": { + "type": "object", "properties": { - "members": { - "default": [], - "description": "List of organization members to promote to ADMIN role", + "generation_id": { + "type": "string", + "description": "URL-safe base64 ID of the generation. Use it to poll\n`GET /v2/generations/{generation_id}`.\n" + }, + "data": { + "type": "array", "items": { - "$ref": "#/components/schemas/LiteOrganizationMember" + "$ref": "#/components/schemas/GeneratedImageObject" }, - "title": "members", - "type": "array" + "description": "The generated images, in generation order. Present only for synchronous requests (`async` omitted or false)." + }, + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." } }, "required": [ - "members" + "generation_id", + "seed" ], - "title": "PromoteOrganizationAdminsRequest", - "type": "object" + "description": "Response returned by `POST /v2/image/generate/gpt-image-2-5-sunburst`.\nSynchronous requests (the default) include the generated images in\n`data`. Asynchronous requests omit `data`; poll\n`GET /v2/generations/{generation_id}` with the returned\n`generation_id`. `seed` is the seed that was used, including when you\ndid not set one.\n", + "title": "GenerateImageGptImage25SunburstResponse" }, - "DemoteOrganizationAdminsRequest": { - "example": { - "members": [ - { - "display_handle": "john_doe", - "email_address": "john.doe@example.com", - "user_id": "dXNlcl8xMjM" - }, - { - "display_handle": "john_doe", - "email_address": "john.doe@example.com", - "user_id": "dXNlcl8xMjM" - } - ] - }, + "GenerateImageGptImage2Response": { + "type": "object", "properties": { - "members": { - "default": [], - "description": "List of admins to demote back to MEMBER role", + "generation_id": { + "type": "string", + "description": "URL-safe base64 ID of the generation. Use it to poll\n`GET /v2/generations/{generation_id}`.\n" + }, + "data": { + "type": "array", "items": { - "$ref": "#/components/schemas/LiteOrganizationMember" + "$ref": "#/components/schemas/GeneratedImageObject" }, - "title": "members", - "type": "array" + "description": "The generated images, in generation order. Present only for synchronous requests (`async` omitted or false)." + }, + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." } }, "required": [ - "members" + "generation_id", + "seed" ], - "title": "DemoteOrganizationAdminsRequest", - "type": "object" + "description": "Response returned by `POST /v2/image/generate/gpt-image-2`.\nSynchronous requests (the default) include the generated images in\n`data`. Asynchronous requests omit `data`; poll\n`GET /v2/generations/{generation_id}` with the returned\n`generation_id`. `seed` is the seed that was used, including when you\ndid not set one.\n", + "title": "GenerateImageGptImage2Response" }, - "CancelOrganizationInviteRequest": { - "example": { - "invite_id": "invite_id" - }, - "properties": { - "invite_id": { - "description": "Base64 URL-safe encoded ID of the invite to cancel", - "title": "invite_id", - "type": "string" - } - }, - "required": [ - "invite_id" + "NanoBanana2AspectRatio": { + "type": "string", + "enum": [ + "auto", + "1:1", + "3:2", + "2:3", + "4:3", + "3:4", + "5:4", + "4:5", + "16:9", + "9:16", + "21:9", + "4:1", + "1:4", + "8:1", + "1:8" ], - "title": "CancelOrganizationInviteRequest", - "type": "object" + "default": "auto", + "description": "Output aspect ratios Nano Banana 2 serves. `auto` lets the model choose the shape; an edit keeps its source image's shape.", + "title": "NanoBanana2AspectRatio" }, - "ResendOrganizationInviteRequest": { - "example": { - "invite_id": "invite_id" - }, - "properties": { - "invite_id": { - "description": "Base64 URL-safe encoded ID of the invite to resend", - "title": "invite_id", - "type": "string" - } - }, - "required": [ - "invite_id" + "V2ImageGenerateNanoBanana2PostRequestBodyContentMultipartFormDataSchemaResolutionTier": { + "type": "string", + "enum": [ + "1K", + "2K", + "4K" ], - "title": "ResendOrganizationInviteRequest", - "type": "object" + "default": "1K", + "description": "The output resolution tier.", + "title": "V2ImageGenerateNanoBanana2PostRequestBodyContentMultipartFormDataSchemaResolutionTier" }, - "ListOrganizationInvoicesResponse": { - "example": { - "invoices": [ - { - "total_spend": { - "amount": 1050, - "currency_code": "USD" - }, - "start_time": "2024-01-01T00:00:00+00:00", - "end_time": "2024-01-31T23:59:59+00:00", - "invoice_id": "invoice_123", - "line_items": [ - { - "charge_name": "Image Generation - V3", - "total": { - "amount": 1050, - "currency_code": "USD" - }, - "quantity": 1000, - "unit_price": { - "amount": 1050, - "currency_code": "USD" - }, - "api_key_id": "api_key_id" - }, - { - "charge_name": "Image Generation - V3", - "total": { - "amount": 1050, - "currency_code": "USD" - }, - "quantity": 1000, - "unit_price": { - "amount": 1050, - "currency_code": "USD" - }, - "api_key_id": "api_key_id" - } - ], - "issued_time": "2024-01-01T00:00:00+00:00", - "paid_date": "2024-02-01T00:00:00+00:00", - "invoice_status": "PAID" - }, - { - "total_spend": { - "amount": 1050, - "currency_code": "USD" - }, - "start_time": "2024-01-01T00:00:00+00:00", - "end_time": "2024-01-31T23:59:59+00:00", - "invoice_id": "invoice_123", - "line_items": [ - { - "charge_name": "Image Generation - V3", - "total": { - "amount": 1050, - "currency_code": "USD" - }, - "quantity": 1000, - "unit_price": { - "amount": 1050, - "currency_code": "USD" - }, - "api_key_id": "api_key_id" - }, - { - "charge_name": "Image Generation - V3", - "total": { - "amount": 1050, - "currency_code": "USD" - }, - "quantity": 1000, - "unit_price": { - "amount": 1050, - "currency_code": "USD" - }, - "api_key_id": "api_key_id" - } - ], - "issued_time": "2024-01-01T00:00:00+00:00", - "paid_date": "2024-02-01T00:00:00+00:00", - "invoice_status": "PAID" - } - ], - "billing_configured": true - }, + "GenerateImageNanoBanana2Response": { + "type": "object", "properties": { - "invoices": { - "default": [], - "description": "List of invoices", + "generation_id": { + "type": "string", + "description": "URL-safe base64 ID of the generation. Use it to poll\n`GET /v2/generations/{generation_id}`.\n" + }, + "data": { + "type": "array", "items": { - "$ref": "#/components/schemas/Invoice" + "$ref": "#/components/schemas/GeneratedImageObject" }, - "title": "invoices", - "type": "array" + "description": "The generated images, in generation order. Present only for synchronous requests (`async` omitted or false)." }, - "billing_configured": { - "description": "Whether the organization has a billing account that invoices can be issued against. When false, the list is empty because nothing is billed yet, not because nothing was used.", - "title": "billing_configured", - "type": "boolean" + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." } }, "required": [ - "billing_configured", - "invoices" + "generation_id", + "seed" ], - "title": "ListOrganizationInvoicesResponse", - "type": "object" + "description": "Response returned by `POST /v2/image/generate/nano-banana-2`.\nSynchronous requests (the default) include the generated images in\n`data`. Asynchronous requests omit `data`; poll\n`GET /v2/generations/{generation_id}` with the returned\n`generation_id`. `seed` is the seed that was used, including when you\ndid not set one.\n", + "title": "GenerateImageNanoBanana2Response" }, - "Invoice": { - "example": { - "total_spend": { - "amount": 1050, - "currency_code": "USD" - }, - "start_time": "2024-01-01T00:00:00+00:00", - "end_time": "2024-01-31T23:59:59+00:00", - "invoice_id": "invoice_123", - "line_items": [ - { - "charge_name": "Image Generation - V3", - "total": { - "amount": 1050, - "currency_code": "USD" - }, - "quantity": 1000, - "unit_price": { - "amount": 1050, - "currency_code": "USD" - }, - "api_key_id": "api_key_id" - }, - { - "charge_name": "Image Generation - V3", - "total": { - "amount": 1050, - "currency_code": "USD" - }, - "quantity": 1000, - "unit_price": { - "amount": 1050, - "currency_code": "USD" - }, - "api_key_id": "api_key_id" - } - ], - "issued_time": "2024-01-01T00:00:00+00:00", - "paid_date": "2024-02-01T00:00:00+00:00", - "invoice_status": "PAID" - }, - "properties": { - "invoice_id": { - "description": "The invoice ID in Metronome", - "example": "invoice_123", - "nullable": true, - "title": "invoice_id", - "type": "string" - }, - "start_time": { - "description": "The start time of the invoice period", - "example": "2024-01-01T00:00:00+00:00", - "format": "date-time", - "title": "start_time", - "type": "string" - }, - "end_time": { - "description": "The end time of the invoice period", - "example": "2024-01-31T23:59:59+00:00", - "format": "date-time", - "title": "end_time", - "type": "string" - }, - "issued_time": { - "description": "The date when the invoice was issued", - "example": "2024-01-01T00:00:00+00:00", - "format": "date-time", - "nullable": true, - "title": "issued_time", - "type": "string" - }, - "paid_date": { - "description": "The date when the invoice was marked paid in Metronome", - "example": "2024-02-01T00:00:00+00:00", - "format": "date-time", - "nullable": true, - "title": "paid_date", - "type": "string" - }, - "total_spend": { - "$ref": "#/components/schemas/Price" - }, - "invoice_status": { - "$ref": "#/components/schemas/InvoiceStatus" + "NanoBanana21AspectRatio": { + "type": "string", + "enum": [ + "auto", + "1:1", + "3:2", + "2:3", + "4:3", + "3:4", + "5:4", + "4:5", + "16:9", + "9:16", + "21:9", + "4:1", + "1:4", + "8:1", + "1:8" + ], + "default": "auto", + "description": "Output aspect ratios Nano Banana 2.1 serves. `auto` lets the model choose the shape; an edit keeps its source image's shape.", + "title": "NanoBanana21AspectRatio" + }, + "V2ImageGenerateNanoBanana21PostRequestBodyContentMultipartFormDataSchemaResolutionTier": { + "type": "string", + "enum": [ + "1K", + "2K", + "4K" + ], + "default": "1K", + "description": "The output resolution tier.", + "title": "V2ImageGenerateNanoBanana21PostRequestBodyContentMultipartFormDataSchemaResolutionTier" + }, + "GenerateImageNanoBanana21Response": { + "type": "object", + "properties": { + "generation_id": { + "type": "string", + "description": "URL-safe base64 ID of the generation. Use it to poll\n`GET /v2/generations/{generation_id}`.\n" }, - "line_items": { - "default": [], - "description": "A list of line items within the invoice", + "data": { + "type": "array", "items": { - "$ref": "#/components/schemas/InvoiceLineItem" + "$ref": "#/components/schemas/GeneratedImageObject" }, - "title": "line_items", - "type": "array" + "description": "The generated images, in generation order. Present only for synchronous requests (`async` omitted or false)." + }, + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." } }, "required": [ - "end_time", - "invoice_status", - "line_items", - "start_time", - "total_spend" + "generation_id", + "seed" ], - "title": "Invoice", - "type": "object" + "description": "Response returned by `POST /v2/image/generate/nano-banana-2-1`.\nSynchronous requests (the default) include the generated images in\n`data`. Asynchronous requests omit `data`; poll\n`GET /v2/generations/{generation_id}` with the returned\n`generation_id`. `seed` is the seed that was used, including when you\ndid not set one.\n", + "title": "GenerateImageNanoBanana21Response" }, - "InvoiceStatus": { - "description": "Status of the invoice", + "NanoBananaProAspectRatio": { + "type": "string", + "enum": [ + "auto", + "1:1", + "3:2", + "2:3", + "4:3", + "3:4", + "5:4", + "4:5", + "16:9", + "9:16", + "21:9" + ], + "default": "auto", + "description": "Output aspect ratios Nano Banana Pro serves. `auto` lets the model choose the shape; an edit keeps its source image's shape.", + "title": "NanoBananaProAspectRatio" + }, + "V2ImageGenerateNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier": { + "type": "string", "enum": [ - "DRAFT", - "PENDING_PAYMENT", - "PAID", - "VOIDED" - ], - "example": "PAID", - "title": "InvoiceStatus", - "type": "string" + "1K", + "2K", + "4K" + ], + "default": "1K", + "description": "The output resolution tier.", + "title": "V2ImageGenerateNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier" }, - "InvoiceLineItem": { - "example": { - "charge_name": "Image Generation - V3", - "total": { - "amount": 1050, - "currency_code": "USD" - }, - "quantity": 1000, - "unit_price": { - "amount": 1050, - "currency_code": "USD" - }, - "api_key_id": "api_key_id" - }, + "GenerateImageNanoBananaProResponse": { + "type": "object", "properties": { - "charge_name": { - "description": "The name of the charge", - "example": "Image Generation - V3", - "title": "charge_name", - "type": "string" - }, - "api_key_id": { - "description": "The API key associated with the usage, when available", - "nullable": true, - "title": "api_key_id", - "type": "string" - }, - "quantity": { - "description": "The quantity of the charge", - "example": 1000, - "title": "quantity", - "type": "integer" + "generation_id": { + "type": "string", + "description": "URL-safe base64 ID of the generation. Use it to poll\n`GET /v2/generations/{generation_id}`.\n" }, - "unit_price": { - "$ref": "#/components/schemas/Price" + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GeneratedImageObject" + }, + "description": "The generated images, in generation order. Present only for synchronous requests (`async` omitted or false)." }, - "total": { - "$ref": "#/components/schemas/Price" + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." } }, "required": [ - "charge_name", - "quantity", - "total", - "unit_price" + "generation_id", + "seed" ], - "title": "InvoiceLineItem", - "type": "object" + "description": "Response returned by `POST /v2/image/generate/nano-banana-pro`.\nSynchronous requests (the default) include the generated images in\n`data`. Asynchronous requests omit `data`; poll\n`GET /v2/generations/{generation_id}` with the returned\n`generation_id`. `seed` is the seed that was used, including when you\ndid not set one.\n", + "title": "GenerateImageNanoBananaProResponse" }, - "GetOrganizationBillingPortalResponse": { - "example": { - "has_stripe_setup": true, - "stripe_billing_url": "stripe_billing_url" - }, - "properties": { - "has_stripe_setup": { - "description": "Whether or not Stripe billing is set up for the organization's API usage.", - "title": "has_stripe_setup", - "type": "boolean" - }, - "stripe_billing_url": { - "description": "The URL for an organization admin to manage the organization's Stripe billing, including adding or removing payment methods. Absent when no Stripe customer exists for the organization.", - "title": "stripe_billing_url", - "type": "string" - } - }, - "required": [ - "has_stripe_setup" + "GenerationQuality": { + "type": "string", + "enum": [ + "very_low", + "low", + "medium", + "high", + "very_high" ], - "title": "GetOrganizationBillingPortalResponse", - "type": "object" + "description": "The generation quality level. Higher levels may use more inference steps\nor additional prompt processing. `very_high` has noticeably higher latency\nand cost than the other levels.\n", + "title": "GenerationQuality" }, - "ListDatasetsResponse": { - "example": { - "datasets": [ - { - "creation_time": "2000-01-23T04:56:07+00:00", - "user_id": "user_id", - "dataset_id": "dataset_id", - "name": "name", - "cover_asset_identifier": { - "collection_id": "collection_id", - "asset_type": null, - "asset_id": "asset_id" - } - }, - { - "creation_time": "2000-01-23T04:56:07+00:00", - "user_id": "user_id", - "dataset_id": "dataset_id", - "name": "name", - "cover_asset_identifier": { - "collection_id": "collection_id", - "asset_type": null, - "asset_id": "asset_id" - } - } - ] - }, - "properties": { - "datasets": { - "default": [], - "description": "Matching datasets, most recently updated first.\n", - "items": { - "$ref": "#/components/schemas/Dataset" - }, - "title": "datasets", - "type": "array" - } - }, - "required": [ - "datasets" + "GenerateImagePImageIdeogramRequestResolution": { + "type": "string", + "enum": [ + "1k", + "2k" ], - "title": "ListDatasetsResponse", - "type": "object" + "description": "The output size tier. Defaults to `1k`. Cannot be combined with `custom_width`/`custom_height`.", + "title": "GenerateImagePImageIdeogramRequestResolution" }, - "Dataset": { - "description": "A dataset for organizing training images.", - "example": { - "creation_time": "2000-01-23T04:56:07+00:00", - "user_id": "user_id", - "dataset_id": "dataset_id", - "name": "name", - "cover_asset_identifier": { - "collection_id": "collection_id", - "asset_type": null, - "asset_id": "asset_id" - } - }, + "AspectRatioV3": { + "type": "string", + "enum": [ + "1x3", + "3x1", + "1x2", + "2x1", + "9x16", + "16x9", + "10x16", + "16x10", + "2x3", + "3x2", + "3x4", + "4x3", + "4x5", + "5x4", + "1x1" + ], + "description": "Output aspect ratio. Cannot be combined with resolution. Generation defaults to 1x1; remix keeps the source ratio when both fields are omitted.", + "title": "AspectRatioV3" + }, + "GenerateImagePImageIdeogramRequest": { + "type": "object", "properties": { - "dataset_id": { - "description": "Unique identifier for the dataset.", - "title": "dataset_id", - "type": "string" + "prompt": { + "type": "string", + "minLength": 1, + "maxLength": 10000, + "description": "The prompt to generate images from, in natural language or as a\nstructured Ideogram 4.0 JSON prompt.\n" }, - "name": { - "description": "Display name of the dataset.", - "title": "name", - "type": "string" + "magic_prompt": { + "$ref": "#/components/schemas/MagicPromptMode", + "default": "auto", + "description": "Controls magic prompt (automatic prompt rewriting). `off` disables magic prompt entirely. Defaults to `auto`." }, - "user_id": { - "description": "ID of the user who owns this dataset.", - "title": "user_id", - "type": "string" + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." }, - "creation_time": { - "description": "When the dataset was created.", - "format": "date-time", - "title": "creation_time", - "type": "string" + "num_images": { + "type": "integer", + "minimum": 1, + "maximum": 8, + "default": 1, + "description": "The number of images to generate." }, - "cover_asset_identifier": { - "$ref": "#/components/schemas/Dataset_cover_asset_identifier" - } - }, - "required": [ - "creation_time", - "dataset_id", - "name", - "user_id" - ], - "title": "Dataset", - "type": "object" - }, - "CreateDatasetRequest": { - "example": { - "name": "name" - }, - "properties": { - "name": { - "description": "Name of the dataset.", - "title": "name", - "type": "string" - } - }, - "required": [ - "name" - ], - "title": "CreateDatasetRequest", - "type": "object" - }, - "GetDatasetResponse": { - "description": "Detailed view of a dataset, including its files.", - "example": { - "file_count": 0, - "custom_model_ids": [ - "custom_model_ids", - "custom_model_ids" - ], - "files": [ - { - "file_name": "file_name", - "caption": "caption", - "file_size_bytes": 6 - }, - { - "file_name": "file_name", - "caption": "caption", - "file_size_bytes": 6 - } - ], - "dataset": { - "creation_time": "2000-01-23T04:56:07+00:00", - "user_id": "user_id", - "dataset_id": "dataset_id", - "name": "name", - "cover_asset_identifier": { - "collection_id": "collection_id", - "asset_type": null, - "asset_id": "asset_id" - } - } - }, - "properties": { - "dataset": { - "$ref": "#/components/schemas/Dataset" + "quality": { + "$ref": "#/components/schemas/GenerationQuality", + "default": "medium", + "description": "The generation quality level. Defaults to `medium`." }, - "file_count": { - "description": "Total number of files in the dataset.", - "title": "file_count", - "type": "integer" + "resolution": { + "oneOf": [ + { + "$ref": "#/components/schemas/GenerateImagePImageIdeogramRequestResolution" + }, + { + "type": "null" + } + ], + "description": "The output size tier. Defaults to `1k`. Cannot be combined with `custom_width`/`custom_height`." }, - "files": { - "default": [], - "description": "List of files in the dataset.", - "items": { - "$ref": "#/components/schemas/DatasetFile" - }, - "title": "files", - "type": "array" + "aspect_ratio": { + "$ref": "#/components/schemas/AspectRatioV3", + "default": "1x1", + "description": "The output aspect ratio. Defaults to `1x1`." }, - "custom_model_ids": { - "default": [], - "description": "IDs of all custom models trained from this dataset. Empty array if no model has been trained yet.\n", - "items": { - "type": "string" - }, - "title": "custom_model_ids", - "type": "array" - } - }, - "required": [ - "custom_model_ids", - "dataset", - "file_count", - "files" - ], - "title": "GetDatasetResponse", - "type": "object" - }, - "DatasetFile": { - "description": "A file in a dataset.", - "example": { - "file_name": "file_name", - "caption": "caption", - "file_size_bytes": 6 - }, - "properties": { - "file_name": { - "description": "Filename of the file in the dataset.", - "nullable": true, - "title": "file_name", - "type": "string" + "custom_width": { + "type": [ + "integer", + "null" + ], + "description": "Optional. An exact output width in pixels, used together with\n`custom_height` for output sizes outside the preset tiers. Must\nbe a positive multiple of 16 between 16 and 4096, and\n`custom_width` × `custom_height` must not exceed 4,194,304 pixels\n(2048×2048). Cannot be combined with `resolution` or\n`aspect_ratio`; the request is billed at the resolution tier\nmatching its total pixel count.\n" }, - "file_size_bytes": { - "description": "Size of the file in bytes, if available.", - "nullable": true, - "title": "file_size_bytes", - "type": "integer" + "custom_height": { + "type": [ + "integer", + "null" + ], + "description": "Optional. An exact output height in pixels, used together with\n`custom_width`. See `custom_width` for the accepted range and\nbilling behavior.\n" }, - "caption": { - "description": "Caption applied to the file, if any. A v4 structured caption is returned as a JSON-encoded string; a plain-text caption (from a .txt sidecar) is returned unchanged. Only present when the file has a caption.\n", - "nullable": true, - "title": "caption", - "type": "string" + "enable_copyright_detection": { + "type": [ + "boolean", + "null" + ], + "description": "Optional. Run copyright detection on the generated images. Adds latency; flagged images are returned with `is_image_safe: false`." + }, + "async": { + "type": "boolean", + "default": false, + "description": "When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result." + }, + "webhook_url": { + "type": "string", + "format": "uri", + "maxLength": 2048, + "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n" } }, "required": [ - "file_name" + "prompt" ], - "title": "DatasetFile", - "type": "object", - "x-drop-nulls": true + "title": "GenerateImagePImageIdeogramRequest" }, - "UploadDatasetAssetsResponse": { - "example": { - "successful_assets": [ - { - "asset_identifier": "", - "file_name": "file_name" - }, - { - "asset_identifier": "", - "file_name": "file_name" - } - ], - "total_count": 0, - "failed_assets": [ - { - "file_name": "file_name", - "failure_reason": null - }, - { - "file_name": "file_name", - "failure_reason": null - } - ], - "success_count": 6, - "failure_count": 1 - }, + "GenerateImagePImageIdeogramResponse": { + "type": "object", "properties": { - "total_count": { - "description": "Total number of images processed.", - "title": "total_count", - "type": "integer" - }, - "success_count": { - "description": "Number of images successfully uploaded.", - "title": "success_count", - "type": "integer" - }, - "failure_count": { - "description": "Number of images that failed to upload.", - "title": "failure_count", - "type": "integer" - }, - "successful_assets": { - "default": [], - "description": "Details of successfully uploaded assets.", - "items": { - "$ref": "#/components/schemas/DatasetUploadSucceededAsset" - }, - "title": "successful_assets", - "type": "array" + "generation_id": { + "type": "string", + "description": "URL-safe base64 ID of the generation. Use it to poll\n`GET /v2/generations/{generation_id}`.\n" }, - "failed_assets": { - "default": [], - "description": "Details of assets that failed to upload.", + "data": { + "type": "array", "items": { - "$ref": "#/components/schemas/DatasetUploadFailedAsset" + "$ref": "#/components/schemas/GeneratedImageObject" }, - "title": "failed_assets", - "type": "array" + "description": "The generated images, in generation order. Present only for synchronous requests (`async` omitted or false)." + }, + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." } }, "required": [ - "failure_count", - "success_count", - "total_count" + "generation_id", + "seed" ], - "title": "UploadDatasetAssetsResponse", - "type": "object" + "description": "Response returned by `POST /v2/image/generate/p-image-ideogram`.\nSynchronous requests (the default) include the generated images in\n`data`. Asynchronous requests omit `data`; poll\n`GET /v2/generations/{generation_id}` with the returned\n`generation_id`. `seed` is the seed that was used, including when you\ndid not set one.\n", + "title": "GenerateImagePImageIdeogramResponse" }, - "DatasetUploadSucceededAsset": { - "example": { - "asset_identifier": "", - "file_name": "file_name" - }, + "GenerateImageZImageRequest": { + "type": "object", "properties": { - "asset_identifier": { - "allOf": [ - { - "$ref": "#/components/schemas/AssetIdentifier" - } + "prompt": { + "type": "string", + "minLength": 1, + "maxLength": 10000, + "description": "The prompt to generate images from." + }, + "resolution": { + "type": [ + "string", + "null" + ], + "description": "Exact output resolution, formatted as \"WIDTHxHEIGHT\". Each side must be a positive multiple of 16 and the total area must not exceed 1,048,576 pixels (1024×1024). When omitted, the model's default 1024×1024 is used." + }, + "num_inference_steps": { + "type": [ + "integer", + "null" ], - "description": "The uploaded image's asset identifier. For a caption sidecar entry, points to the image the caption was applied to.\n", - "title": "asset_identifier" + "minimum": 1, + "maximum": 128, + "description": "Optional number of diffusion steps. When omitted, the model's\ndefault is used. Higher values improve quality but take longer.\n" + }, + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." + }, + "num_images": { + "type": "integer", + "minimum": 1, + "maximum": 8, + "default": 1, + "description": "The number of images to generate." }, - "file_name": { - "description": "Original filename of the uploaded file. For a caption sidecar (.txt or .json) this is the sidecar's filename. A single image therefore yields one entry for the image plus one per caption file.\n", - "nullable": true, - "title": "file_name", - "type": "string" + "async": { + "type": "boolean", + "default": false, + "description": "When false (the default), the request waits until the images are ready and returns them in `data`. When true, the request returns as soon as it is accepted; poll `GET /v2/generations/{generation_id}` with the returned `generation_id` for the result." + }, + "webhook_url": { + "type": "string", + "format": "uri", + "maxLength": 2048, + "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n" } }, "required": [ - "asset_identifier" + "prompt" ], - "title": "DatasetUploadSucceededAsset", - "type": "object" + "title": "GenerateImageZImageRequest" }, - "DatasetUploadFailedAsset": { - "example": { - "file_name": "file_name", - "failure_reason": null - }, + "GenerateImageZImageResponse": { + "type": "object", "properties": { - "file_name": { - "description": "Original filename of the failed image.", - "nullable": true, - "title": "file_name", - "type": "string" + "generation_id": { + "type": "string", + "description": "URL-safe base64 ID of the generation. Use it to poll\n`GET /v2/generations/{generation_id}`.\n" }, - "failure_reason": { - "$ref": "#/components/schemas/DatasetAssetFailureReason" + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GeneratedImageObject" + }, + "description": "The generated images, in generation order. Present only for synchronous requests (`async` omitted or false)." + }, + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." } }, "required": [ - "failure_reason" + "generation_id", + "seed" ], - "title": "DatasetUploadFailedAsset", - "type": "object" + "description": "Response returned by `POST /v2/image/generate/z-image`. Synchronous\nrequests (the default) include the generated images in `data`.\nAsynchronous requests omit `data`; poll\n`GET /v2/generations/{generation_id}` with the returned\n`generation_id`. `seed` is the seed that was used, including when you\ndid not set one.\n", + "title": "GenerateImageZImageResponse" }, - "DatasetAssetFailureReason": { - "description": "Reason why an asset failed to upload.", + "V2ImageRemixAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier": { + "type": "string", "enum": [ - "FAILED_SAFETY_CHECK", - "FILE_TOO_LARGE", - "INTERNAL_ERROR", - "INVALID_CAPTION", - "INVALID_CAPTION_JSON", - "INVALID_IMAGE", - "INVALID_ZIP", - "TOO_MANY_IMAGES" - ], - "title": "DatasetAssetFailureReason", - "type": "string" - }, - "UploadDatasetAssetsRequest": { - "properties": { - "files": { - "description": "Image files (JPEG, PNG, WebP), .txt caption sidecar files, and/or ZIP archives containing images and captions. Caption .txt files are matched to images by filename stem (e.g. sunset.txt provides the caption for sunset.jpg). Captions are optional!\n", - "items": { - "format": "binary", - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "files" + "1k", + "2k" ], - "type": "object" + "description": "The output resolution tier. When omitted, the tier is inferred from `resolution`, or defaults to 1k. A color palette, style codes, style preset, or non-`auto` style type are only supported at 1k.", + "title": "V2ImageRemixAutoPostRequestBodyContentMultipartFormDataSchemaResolutionTier" }, - "TrainDatasetModelResponse": { - "example": { - "training_status": "training_status", - "model_name": "model_name", - "dataset_id": "dataset_id", - "model_id": "model_id" - }, + "Seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation.", + "title": "Seed" + }, + "ToolRemixResponse": { + "type": "object", "properties": { - "model_id": { - "description": "Unique identifier of the created model.", - "title": "model_id", - "type": "string" - }, - "dataset_id": { - "description": "Identifier of the dataset used for training.", - "title": "dataset_id", - "type": "string" + "generation_id": { + "type": "string", + "description": "URL-safe base64 ID of the generation. Use it to poll\n`GET /v2/generations/{generation_id}`.\n" }, - "training_status": { - "description": "Current training status of the model.", - "title": "training_status", - "type": "string" + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GeneratedImageObject" + }, + "description": "The remixed images, in generation order. Present only for synchronous requests (`async` omitted or false)." }, - "model_name": { - "description": "Name of the model.", - "title": "model_name", - "type": "string" + "seed": { + "$ref": "#/components/schemas/Seed", + "description": "The seed attached to the request. Reusing it does not guarantee a reproducible result, because the selected model may not honor seeds." } }, "required": [ - "dataset_id", - "model_id", - "model_name", - "training_status" + "generation_id", + "seed" ], - "title": "TrainDatasetModelResponse", - "type": "object" + "description": "Response returned by `POST /v2/image/remix/auto`. Synchronous\nrequests (the default) include the remixed images in `data`.\nAsynchronous requests omit `data`; poll\n`GET /v2/generations/{generation_id}` with the returned\n`generation_id`.\n", + "title": "ToolRemixResponse" }, - "TrainDatasetModelRequest": { - "description": "Custom Model training request.", - "example": { - "model_name": "my-custom-model" - }, - "properties": { - "model_name": { - "description": "Name after trimming surrounding whitespace: 5–30 Unicode letters, numbers, spaces, underscores, parentheses, periods, or hyphens.", - "example": "my-custom-model", - "title": "model_name", - "type": "string" - } - }, - "required": [ - "model_name" + "V2ImageRemixIdeogram4PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed": { + "type": "string", + "enum": [ + "turbo", + "default", + "quality" ], - "title": "TrainDatasetModelRequest", - "type": "object" + "default": "default", + "description": "The rendering speed to use.", + "title": "V2ImageRemixIdeogram4PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed" }, - "ListModelsResponse": { - "example": { - "models": [ - { - "creation_time": "2000-01-23T04:56:07+00:00", - "last_update_time": "2000-01-23T04:56:07+00:00", - "is_available_for_generation": true, - "dataset_id": "dataset_id", - "name": "name", - "is_owned": true, - "training_runs": [ - { - "creation_time": "2000-01-23T04:56:07+00:00", - "last_update_time": "2000-01-23T04:56:07+00:00", - "lora_rank": 6, - "num_chips": 1, - "training_run_id": "training_run_id", - "ema": 5.962133916683182, - "training_steps": 0, - "learning_rate": 5.637376656633329, - "status": null - }, - { - "creation_time": "2000-01-23T04:56:07+00:00", - "last_update_time": "2000-01-23T04:56:07+00:00", - "lora_rank": 6, - "num_chips": 1, - "training_run_id": "training_run_id", - "ema": 5.962133916683182, - "training_steps": 0, - "learning_rate": 5.637376656633329, - "status": null - } - ], - "model_id": "model_id", - "custom_model_uri": "model/my-custom-model/version/1", - "status": null - }, - { - "creation_time": "2000-01-23T04:56:07+00:00", - "last_update_time": "2000-01-23T04:56:07+00:00", - "is_available_for_generation": true, - "dataset_id": "dataset_id", - "name": "name", - "is_owned": true, - "training_runs": [ - { - "creation_time": "2000-01-23T04:56:07+00:00", - "last_update_time": "2000-01-23T04:56:07+00:00", - "lora_rank": 6, - "num_chips": 1, - "training_run_id": "training_run_id", - "ema": 5.962133916683182, - "training_steps": 0, - "learning_rate": 5.637376656633329, - "status": null - }, - { - "creation_time": "2000-01-23T04:56:07+00:00", - "last_update_time": "2000-01-23T04:56:07+00:00", - "lora_rank": 6, - "num_chips": 1, - "training_run_id": "training_run_id", - "ema": 5.962133916683182, - "training_steps": 0, - "learning_rate": 5.637376656633329, - "status": null - } - ], - "model_id": "model_id", - "custom_model_uri": "model/my-custom-model/version/1", - "status": null - } - ] - }, + "RemixedImageObject": { + "type": "object", "properties": { - "models": { - "default": [], - "description": "List of models.", - "items": { - "$ref": "#/components/schemas/CustomModel" - }, - "title": "models", - "type": "array" + "url": { + "type": [ + "string", + "null" + ], + "format": "uri", + "description": "The direct link to the remixed image. Empty when the image did not pass safety checks." + }, + "prompt": { + "type": "string", + "description": "The final prompt the image was generated from." + }, + "resolution": { + "type": "string", + "description": "The resolution of the remixed image, formatted as \"WIDTHxHEIGHT\"." + }, + "is_image_safe": { + "type": "boolean", + "description": "Whether the image passed safety checks. If false, `url` is empty." + }, + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." } }, "required": [ - "models" + "prompt", + "resolution", + "is_image_safe", + "seed" ], - "title": "ListModelsResponse", - "type": "object" + "description": "One remixed output image.", + "title": "RemixedImageObject" }, - "CustomModel": { - "description": "A custom model.", - "example": { - "creation_time": "2000-01-23T04:56:07+00:00", - "last_update_time": "2000-01-23T04:56:07+00:00", - "is_available_for_generation": true, - "dataset_id": "dataset_id", - "name": "name", - "is_owned": true, - "training_runs": [ - { - "creation_time": "2000-01-23T04:56:07+00:00", - "last_update_time": "2000-01-23T04:56:07+00:00", - "lora_rank": 6, - "num_chips": 1, - "training_run_id": "training_run_id", - "ema": 5.962133916683182, - "training_steps": 0, - "learning_rate": 5.637376656633329, - "status": null - }, - { - "creation_time": "2000-01-23T04:56:07+00:00", - "last_update_time": "2000-01-23T04:56:07+00:00", - "lora_rank": 6, - "num_chips": 1, - "training_run_id": "training_run_id", - "ema": 5.962133916683182, - "training_steps": 0, - "learning_rate": 5.637376656633329, - "status": null - } - ], - "model_id": "model_id", - "custom_model_uri": "model/my-custom-model/version/1", - "status": null - }, + "RemixImageIdeogramV4Response": { + "type": "object", "properties": { - "model_id": { - "description": "Unique identifier for the model (base64 URL-safe encoded UUID).", - "title": "model_id", - "type": "string" - }, - "custom_model_uri": { - "description": "A custom model URI in the format model//version/.\nUse this URI when generating images with this model. Only present for models\nthat have been registered in the model registry.\n", - "example": "model/my-custom-model/version/1", - "nullable": true, - "title": "custom_model_uri", - "type": "string" - }, - "name": { - "description": "Display name of the model.", - "title": "name", - "type": "string" - }, - "status": { - "$ref": "#/components/schemas/ModelStatus" - }, - "dataset_id": { - "description": "ID of the dataset (collection) the model was trained from.", - "nullable": true, - "title": "dataset_id", - "type": "string" - }, - "creation_time": { - "description": "When the model was created.", - "format": "date-time", - "title": "creation_time", - "type": "string" - }, - "last_update_time": { - "description": "When the model was last updated.", - "format": "date-time", - "nullable": true, - "title": "last_update_time", - "type": "string" - }, - "is_available_for_generation": { - "description": "Whether the model is available for image generation.", - "title": "is_available_for_generation", - "type": "boolean" - }, - "is_owned": { - "description": "Whether the authenticated user owns this model.", - "title": "is_owned", - "type": "boolean" + "generation_id": { + "type": "string", + "description": "URL-safe base64 ID of the accepted generation. Accepted by the\n`GET /v2/generations/{generation_id}` polling endpoint.\n" }, - "training_runs": { - "default": [], - "description": "Training run history. Only populated on the get-by-ID endpoint and only for owned models.\n", + "data": { + "type": "array", "items": { - "$ref": "#/components/schemas/TrainingRun" + "$ref": "#/components/schemas/RemixedImageObject" }, - "title": "training_runs", - "type": "array" + "description": "The remixed images, in generation order. Present only for synchronous requests (`async` omitted or false)." + }, + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." } }, "required": [ - "creation_time", - "is_available_for_generation", - "is_owned", - "model_id", - "name", - "status" + "generation_id", + "seed" ], - "title": "CustomModel", - "type": "object" + "description": "Response returned by `POST /v2/image/remix/ideogram-4`.\nSynchronous requests (the default) include the remixed images in\n`data`. Requests with `async` set to true omit `data`; poll for\ncompletion and results with `GET /v2/generations/{generation_id}`\nusing the returned `generation_id`. The seed reports the value the\nrequest resolved to.\n", + "title": "RemixImageIdeogramV4Response" }, - "ModelStatus": { - "description": "The status of a custom model.", + "V2ImageRemixIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed": { + "type": "string", "enum": [ - "CREATING", - "DRAFT", - "TRAINING", - "COMPLETED", - "ERRORED", - "ARCHIVED" - ], - "title": "ModelStatus", - "type": "string" + "turbo", + "default", + "quality" + ], + "default": "default", + "description": "The rendering speed to use.", + "title": "V2ImageRemixIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed" }, - "TrainingRun": { - "description": "A training run for a custom model.", - "example": { - "creation_time": "2000-01-23T04:56:07+00:00", - "last_update_time": "2000-01-23T04:56:07+00:00", - "lora_rank": 6, - "num_chips": 1, - "training_run_id": "training_run_id", - "ema": 5.962133916683182, - "training_steps": 0, - "learning_rate": 5.637376656633329, - "status": null - }, + "RemixImageIdeogramV3Response": { + "type": "object", "properties": { - "training_run_id": { - "description": "Unique identifier for the training run.", - "title": "training_run_id", - "type": "string" - }, - "status": { - "$ref": "#/components/schemas/TrainingRunStatus" - }, - "training_steps": { - "description": "Number of training steps configured.", - "nullable": true, - "title": "training_steps", - "type": "integer" - }, - "lora_rank": { - "description": "LoRA rank used for training.", - "nullable": true, - "title": "lora_rank", - "type": "integer" - }, - "num_chips": { - "description": "Number of TPU chips used.", - "nullable": true, - "title": "num_chips", - "type": "integer" - }, - "ema": { - "description": "Exponential moving average decay rate.", - "nullable": true, - "title": "ema", - "type": "number" - }, - "learning_rate": { - "description": "Learning rate for the optimizer.", - "nullable": true, - "title": "learning_rate", - "type": "number" + "generation_id": { + "type": "string", + "description": "URL-safe base64 ID of the accepted generation. Accepted by the\n`GET /v2/generations/{generation_id}` polling endpoint.\n" }, - "creation_time": { - "description": "When the training run was created.", - "format": "date-time", - "title": "creation_time", - "type": "string" + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemixedImageObject" + }, + "description": "The remixed images, in generation order. Present only for synchronous requests (`async` omitted or false)." }, - "last_update_time": { - "description": "When the training run was last updated.", - "format": "date-time", - "nullable": true, - "title": "last_update_time", - "type": "string" + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." } }, "required": [ - "creation_time", - "status", - "training_run_id" + "generation_id", + "seed" ], - "title": "TrainingRun", - "type": "object" + "description": "Response returned by `POST /v2/image/remix/ideogram-3`.\nSynchronous requests (the default) include the remixed images in\n`data`. Requests with `async` set to true omit `data`; poll for\ncompletion and results with `GET /v2/generations/{generation_id}`\nusing the returned `generation_id`. The seed reports the value the\nrequest resolved to when the caller left it unset.\n", + "title": "RemixImageIdeogramV3Response" }, - "TrainingRunStatus": { - "description": "The status of a training run.", + "V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed": { + "type": "string", "enum": [ - "PREPARING_DATA", - "QUEUED", - "TRAINING", - "FINALIZING", - "COMPLETED", - "FAILED" - ], - "title": "TrainingRunStatus", - "type": "string" + "turbo", + "default", + "quality" + ], + "default": "default", + "description": "The rendering speed to use.", + "title": "V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed" }, - "GetModelResponse": { - "example": { - "model": { - "creation_time": "2000-01-23T04:56:07+00:00", - "last_update_time": "2000-01-23T04:56:07+00:00", - "is_available_for_generation": true, - "dataset_id": "dataset_id", - "name": "name", - "is_owned": true, - "training_runs": [ - { - "creation_time": "2000-01-23T04:56:07+00:00", - "last_update_time": "2000-01-23T04:56:07+00:00", - "lora_rank": 6, - "num_chips": 1, - "training_run_id": "training_run_id", - "ema": 5.962133916683182, - "training_steps": 0, - "learning_rate": 5.637376656633329, - "status": null - }, - { - "creation_time": "2000-01-23T04:56:07+00:00", - "last_update_time": "2000-01-23T04:56:07+00:00", - "lora_rank": 6, - "num_chips": 1, - "training_run_id": "training_run_id", - "ema": 5.962133916683182, - "training_steps": 0, - "learning_rate": 5.637376656633329, - "status": null - } - ], - "model_id": "model_id", - "custom_model_uri": "model/my-custom-model/version/1", - "status": null - } - }, - "properties": { - "model": { - "$ref": "#/components/schemas/CustomModel" - } - }, - "required": [ - "model" + "V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType": { + "type": "string", + "enum": [ + "auto", + "realistic", + "fiction" ], - "title": "GetModelResponse", - "type": "object" + "default": "auto", + "description": "The style type to remix the character with. Defaults to `auto`.", + "title": "V2ImageRemixIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType" }, - "TrainModelV3Request": { - "description": "Training request for a custom Ideogram v3 model using default hyperparameters.\n", - "example": { - "model_name": "my-custom-model", - "dataset_id": "abc123" - }, + "RemixImageIdeogramV3CharacterResponse": { + "type": "object", "properties": { - "dataset_id": { - "description": "ID of the dataset to train the model from.", - "example": "abc123", - "title": "dataset_id", - "type": "string" + "generation_id": { + "type": "string", + "description": "URL-safe base64 ID of the accepted generation. Accepted by the\n`GET /v2/generations/{generation_id}` polling endpoint.\n" }, - "model_name": { - "description": "Name for the trained model. Must be 5-30 characters, alphanumeric with spaces and hyphens allowed.\n", - "example": "my-custom-model", - "title": "model_name", - "type": "string" + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemixedImageObject" + }, + "description": "The remixed images, in generation order. Present only for synchronous requests (`async` omitted or false)." + }, + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." } }, "required": [ - "dataset_id", - "model_name" + "generation_id", + "seed" ], - "title": "TrainModelV3Request", - "type": "object" + "description": "Response returned by `POST /v2/image/remix/ideogram-3-character`.\nSynchronous requests (the default) include the remixed images in\n`data`. Requests with `async` set to true omit `data`; poll for\ncompletion and results with `GET /v2/generations/{generation_id}`\nusing the returned `generation_id`. The seed reports the value the\nrequest resolved to when the caller left it unset.\n", + "title": "RemixImageIdeogramV3CharacterResponse" }, - "TrainModelV3AdvancedRequest": { - "description": "Advanced training request for a custom Ideogram v3 model. Hyperparameters are optional and fall back to defaults when omitted.\n", - "example": { - "model_name": "my-custom-model", - "lora_rank": 64, - "dataset_id": "abc123", - "ema": 0.999, - "training_steps": 1000, - "learning_rate": 0.0001 - }, + "V2ImageRemixIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed": { + "type": "string", + "enum": [ + "turbo", + "default", + "quality" + ], + "description": "The rendering speed to use. When omitted, the server chooses a speed supported by the selected custom model.", + "title": "V2ImageRemixIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed" + }, + "RemixImageIdeogramV3CustomModelResponse": { + "type": "object", "properties": { - "dataset_id": { - "description": "ID of the dataset to train the model from.", - "example": "abc123", - "title": "dataset_id", - "type": "string" + "generation_id": { + "type": "string", + "description": "URL-safe base64 ID of the accepted generation. Accepted by the\n`GET /v2/generations/{generation_id}` polling endpoint.\n" }, - "model_name": { - "description": "Name for the trained model. Must be 5-30 characters, alphanumeric with spaces and hyphens allowed.\n", - "example": "my-custom-model", - "title": "model_name", - "type": "string" + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemixedImageObject" + }, + "description": "The remixed images, in generation order. Present only for synchronous requests (`async` omitted or false)." }, - "training_steps": { - "description": "Number of training steps. Must be between 100 and 10000 and a multiple of 100. Defaults to 1000.\n", - "example": 1000, - "title": "training_steps", - "type": "integer" - }, - "lora_rank": { - "description": "LoRA rank for model training. Must be one of 64 or 128. Defaults to 128. Higher rank increases model capacity at the cost of longer training and larger weights.\n", - "example": 64, - "title": "lora_rank", - "type": "integer" - }, - "ema": { - "description": "Exponential moving average decay rate for the model weights. Must be between 0 and 1 (exclusive). Typical values are 0.99-0.9999; higher values produce smoother weight averages but respond more slowly to training updates.\n", - "example": 0.999, - "title": "ema", - "type": "number" - }, - "learning_rate": { - "description": "Learning rate for the optimizer. Must be greater than 0. Typical values for LoRA fine-tuning are 1e-5 to 1e-4; larger values train faster but risk instability.\n", - "example": 0.0001, - "title": "learning_rate", - "type": "number" + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." } }, "required": [ - "dataset_id", - "model_name" + "generation_id", + "seed" ], - "title": "TrainModelV3AdvancedRequest", - "type": "object" + "description": "Response returned by `POST /v2/image/remix/ideogram-3-custom-model`.\nSynchronous requests (the default) include the remixed images in\n`data`. Requests with `async` set to true omit `data`; poll for\ncompletion and results with `GET /v2/generations/{generation_id}`\nusing the returned `generation_id`. The seed reports the value the\nrequest resolved to when the caller left it unset.\n", + "title": "RemixImageIdeogramV3CustomModelResponse" }, - "TrainModelV4Request": { - "description": "Training request for a custom Ideogram v4 model using default hyperparameters.\n", - "example": { - "model_name": "my-custom-model", - "dataset_id": "abc123" - }, - "properties": { - "dataset_id": { - "description": "ID of the dataset to train the model from.", - "example": "abc123", - "title": "dataset_id", - "type": "string" - }, - "model_name": { - "description": "Name for the trained model. Must be 5-30 characters, alphanumeric with spaces and hyphens allowed.\n", - "example": "my-custom-model", - "title": "model_name", - "type": "string" - } - }, - "required": [ - "dataset_id", - "model_name" + "V2ImageInpaintIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed": { + "type": "string", + "enum": [ + "turbo", + "default", + "quality" ], - "title": "TrainModelV4Request", - "type": "object" + "default": "default", + "description": "The rendering speed to use.", + "title": "V2ImageInpaintIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed" }, - "TrainModelV4AdvancedRequest": { - "description": "Advanced training request for a custom Ideogram v4 model. Hyperparameters are optional and fall back to defaults when omitted.\n", - "example": { - "batch_size": 8, - "wandb_project": "my-wandb-project", - "model_name": "my-custom-model", - "lora_rank": 64, - "base_variant": "distilled_gd", - "dataset_id": "abc123", - "ema": 0.999, - "training_steps": 1000, - "learning_rate": 0.0001 - }, + "InpaintedImageObject": { + "type": "object", "properties": { - "dataset_id": { - "description": "ID of the dataset to train the model from.", - "example": "abc123", - "title": "dataset_id", - "type": "string" + "url": { + "type": [ + "string", + "null" + ], + "format": "uri", + "description": "The direct link to the repainted image. Empty when the image did not pass safety checks." }, - "model_name": { - "description": "Name for the trained model. Must be 5-30 characters, alphanumeric with spaces and hyphens allowed.\n", - "example": "my-custom-model", - "title": "model_name", - "type": "string" + "prompt": { + "type": "string", + "description": "The final prompt the image was generated from." }, - "training_steps": { - "description": "Number of training steps. Must be between 100 and 10000 and a multiple of 100. Defaults to 1000.\n", - "example": 1000, - "title": "training_steps", - "type": "integer" - }, - "lora_rank": { - "description": "LoRA rank for model training. Must be one of 64 or 128. Defaults to 128. Higher rank increases model capacity at the cost of longer training and larger weights.\n", - "example": 64, - "title": "lora_rank", - "type": "integer" - }, - "ema": { - "description": "Exponential moving average decay rate for the model weights. Must be between 0 and 1 (exclusive). Typical values are 0.99-0.9999; higher values produce smoother weight averages but respond more slowly to training updates.\n", - "example": 0.999, - "title": "ema", - "type": "number" - }, - "learning_rate": { - "description": "Learning rate for the optimizer. Must be greater than 0. Typical values for LoRA fine-tuning are 1e-5 to 1e-4; larger values train faster but risk instability.\n", - "example": 0.0001, - "title": "learning_rate", - "type": "number" - }, - "batch_size": { - "description": "Per-step training batch size. Must be one of 1, 2, 4, 8, 16, or 32. Defaults to a trainer-side value when omitted. Larger batches can improve throughput at the cost of more memory.\n", - "example": 8, - "title": "batch_size", - "type": "integer" - }, - "wandb_project": { - "description": "Weights & Biases project to log this training run to. When set, the run streams metrics to this W&B project; when omitted, no W&B logging happens.\n", - "example": "my-wandb-project", - "title": "wandb_project", - "type": "string" + "resolution": { + "type": "string", + "description": "The resolution of the repainted image, formatted as \"WIDTHxHEIGHT\"." }, - "base_variant": { - "description": "Frozen v4 backbone the custom LoRA is trained on. Must be one of `distilled_gd` (the guidance-distilled base, default) or `oldbase_farzad_fused` (the fused non-distilled base). Omit to use the default.\n", - "example": "distilled_gd", - "title": "base_variant", - "type": "string" + "is_image_safe": { + "type": "boolean", + "description": "Whether the image passed safety checks. If false, `url` is empty." + }, + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." } }, "required": [ - "dataset_id", - "model_name" + "prompt", + "resolution", + "is_image_safe", + "seed" ], - "title": "TrainModelV4AdvancedRequest", - "type": "object" + "description": "One repainted output image.", + "title": "InpaintedImageObject" }, - "PublishMiniAppResponse": { - "description": "Confirmation of a published mini-app catalog entry.", - "example": { - "archived": true, - "mini_app_id": "mini_app_id", - "requires_membership": true, - "slug": "slug" - }, + "InpaintImageIdeogramV3Response": { + "type": "object", "properties": { - "mini_app_id": { - "description": "Unique identifier of the published mini-app.", - "title": "mini_app_id", - "type": "string" + "generation_id": { + "type": "string", + "description": "URL-safe base64 ID of the accepted generation. Accepted by the\n`GET /v2/generations/{generation_id}` polling endpoint.\n" }, - "slug": { - "description": "Unique, stable, URL-safe mini-app identifier.", - "maxLength": 128, - "minLength": 1, - "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$", - "title": "slug", - "type": "string" + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/InpaintedImageObject" + }, + "description": "The repainted images, in generation order. Present only for synchronous requests (`async` omitted or false)." + }, + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." }, - "requires_membership": { - "description": "Whether the mini-app requires a membership to access.", - "title": "requires_membership", - "type": "boolean" + "width": { + "type": "integer", + "description": "The output width in pixels this request resolved to." }, - "archived": { - "description": "Whether the mini-app is currently archived (hidden from the catalog).", - "title": "archived", - "type": "boolean" + "height": { + "type": "integer", + "description": "The output height in pixels this request resolved to." } }, "required": [ - "archived", - "mini_app_id", - "requires_membership", - "slug" + "generation_id", + "seed", + "width", + "height" ], - "title": "PublishMiniAppResponse", - "type": "object" + "description": "Response returned by `POST /v2/image/inpaint/ideogram-3`.\nSynchronous requests (the default) include the repainted images in\n`data`. Requests with `async` set to true omit `data`; poll for\ncompletion and results with `GET /v2/generations/{generation_id}`\nusing the returned `generation_id`. The seed, width, and height report\nthe values the request resolved to when the caller left them unset.\n", + "title": "InpaintImageIdeogramV3Response" }, - "MiniAppSlug": { - "description": "Unique, stable, URL-safe mini-app identifier.", - "maxLength": 128, - "minLength": 1, - "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$", - "title": "slug", - "type": "string" + "V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed": { + "type": "string", + "enum": [ + "turbo", + "default", + "quality" + ], + "default": "default", + "description": "The rendering speed to use.", + "title": "V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed" }, - "PublishMiniAppRequest": { - "allOf": [ - { - "$ref": "#/components/schemas/MiniAppArtwork" - } - ], - "description": "The mini-app catalog entry to publish. Artwork initializes a new app; re-publishing an existing slug preserves its current artwork. Optional nullable fields preserve their current values when omitted or null.", - "example": { - "accepts_image_input": true, - "deployment_time": "2000-01-23T04:56:07+00:00", - "website": { - "key": "" - }, - "deployment_url": "https://openapi-generator.tech", - "deployment_commit": "deployment_commit", - "description": "description", - "label": "label", - "embed": "iframe", - "scopes": [ - "scopes", - "scopes" - ], - "slug": "slug" - }, + "V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType": { + "type": "string", + "enum": [ + "auto", + "realistic", + "fiction" + ], + "default": "auto", + "description": "The style type to repaint the character with. Defaults to `auto`. `realistic` and `fiction` are supported for character-only requests; style codes or style references (not both) require `auto`. For API-key callers, combining a style with a character requires that feature to be enabled for their account.", + "title": "V2ImageInpaintIdeogram3CharacterPostRequestBodyContentMultipartFormDataSchemaStyleType" + }, + "InpaintImageIdeogramV3CharacterResponse": { + "type": "object", "properties": { - "slug": { - "description": "Unique, stable, URL-safe mini-app identifier.", - "maxLength": 128, - "minLength": 1, - "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$", - "title": "slug", - "type": "string" - }, - "label": { - "description": "Human-readable display name shown in the catalog.", - "maxLength": 256, - "minLength": 1, - "title": "label", - "type": "string" - }, - "description": { - "description": "Short description of what the mini-app does.", - "nullable": true, - "title": "description", - "type": "string" - }, - "embed": { - "description": "How the mini-app is embedded. `iframe` loads the app in a sandboxed frame.\n", - "enum": [ - "iframe" - ], - "title": "embed", - "type": "string" + "generation_id": { + "type": "string", + "description": "URL-safe base64 ID of the accepted generation. Accepted by the\n`GET /v2/generations/{generation_id}` polling endpoint.\n" }, - "scopes": { - "description": "Permission scopes the mini-app requests.", + "data": { + "type": "array", "items": { - "type": "string" + "$ref": "#/components/schemas/InpaintedImageObject" }, - "title": "scopes", - "type": "array" - }, - "accepts_image_input": { - "description": "Optional on publish. Whether the app can receive an existing image as its initial input. Omit this field to preserve the current value when re-publishing an existing app; new apps default to false. Catalog responses always include the resolved boolean.", - "title": "accepts_image_input", - "type": "boolean" - }, - "deployment_url": { - "description": "Absolute HTTPS URL where the deployed mini-app is served from.", - "format": "uri", - "nullable": true, - "title": "deployment_url", - "type": "string" + "description": "The repainted images, in generation order. Present only for synchronous requests (`async` omitted or false)." }, - "deployment_commit": { - "description": "Source commit hash of the deployed build.", - "maxLength": 64, - "nullable": true, - "title": "deployment_commit", - "type": "string" + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." }, - "deployment_time": { - "description": "When the deployment that produced this build completed.", - "format": "date-time", - "nullable": true, - "title": "deployment_time", - "type": "string" + "width": { + "type": "integer", + "description": "The output width in pixels this request resolved to." }, - "website": { - "additionalProperties": true, - "description": "Structured website metadata for the mini-app.", - "nullable": true, - "title": "website", - "type": "object" + "height": { + "type": "integer", + "description": "The output height in pixels this request resolved to." } }, "required": [ - "embed", - "label", - "scopes", - "slug" + "generation_id", + "seed", + "width", + "height" ], - "title": "PublishMiniAppRequest", - "type": "object" + "description": "Response returned by `POST /v2/image/inpaint/ideogram-3-character`.\nSynchronous requests (the default) include the repainted images in\n`data`. Requests with `async` set to true omit `data`; poll for\ncompletion and results with `GET /v2/generations/{generation_id}`\nusing the returned `generation_id`. The seed, width, and height report\nthe values the request resolved to when the caller left them unset.\n", + "title": "InpaintImageIdeogramV3CharacterResponse" }, - "PublishMiniAppPreviewResponse": { - "description": "Confirmation of a published mini-app preview entry.", - "example": { - "preview_id": "preview_id" - }, - "properties": { - "preview_id": { - "description": "Unique, URL-safe preview identifier composed by the deploy pipeline.", - "maxLength": 255, - "minLength": 1, - "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$", - "title": "MiniAppPreviewId", - "type": "string" - } - }, - "required": [ - "preview_id" + "V2ImageInpaintIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed": { + "type": "string", + "enum": [ + "turbo", + "default", + "quality" ], - "title": "PublishMiniAppPreviewResponse", - "type": "object" + "description": "The rendering speed to use. When omitted, the server chooses a speed supported by the selected custom model.", + "title": "V2ImageInpaintIdeogram3CustomModelPostRequestBodyContentMultipartFormDataSchemaRenderingSpeed" }, - "MiniAppPreviewId": { - "description": "Unique, URL-safe preview identifier composed by the deploy pipeline.", - "maxLength": 255, - "minLength": 1, - "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$", - "title": "MiniAppPreviewId", - "type": "string" - }, - "PublishMiniAppPreviewRequest": { - "allOf": [ - { - "$ref": "#/components/schemas/MiniAppArtwork" - } - ], - "description": "The mini-app preview entry to publish. Supply `slug` when the preview is a build of a catalog app so that work created through the preview is credited to that app; omit it for a preview of an app that is not in the catalog.", - "example": { - "accepts_image_input": true, - "deployment_time": "2000-01-23T04:56:07+00:00", - "website": { - "key": "" - }, - "preview_id": "preview_id", - "deployment_url": "deployment_url", - "deployment_commit": "deployment_commit", - "description": "description", - "label": "label", - "embed": "iframe", - "scopes": [ - "scopes", - "scopes" - ], - "slug": "slug" - }, + "InpaintImageIdeogramV3CustomModelResponse": { + "type": "object", "properties": { - "preview_id": { - "description": "Unique, URL-safe preview identifier composed by the deploy pipeline.", - "maxLength": 255, - "minLength": 1, - "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$", - "title": "MiniAppPreviewId", - "type": "string" - }, - "slug": { - "description": "Unique, stable, URL-safe mini-app identifier.", - "maxLength": 128, - "minLength": 1, - "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$", - "title": "slug", - "type": "string" - }, - "label": { - "description": "Human-readable display name shown for the preview.", - "maxLength": 256, - "minLength": 1, - "title": "label", - "type": "string" - }, - "description": { - "description": "Short description of what the mini-app does.", - "nullable": true, - "title": "description", - "type": "string" - }, - "embed": { - "description": "How the mini-app is embedded. `iframe` loads the app in a sandboxed frame.\n", - "enum": [ - "iframe" - ], - "title": "embed", - "type": "string" + "generation_id": { + "type": "string", + "description": "URL-safe base64 ID accepted by the generation polling endpoint." }, - "scopes": { - "description": "Permission scopes the mini-app preview requests.", + "data": { + "type": "array", "items": { - "type": "string" + "$ref": "#/components/schemas/InpaintedImageObject" }, - "title": "scopes", - "type": "array" + "description": "The repainted images, in generation order. Present only for synchronous requests." }, - "accepts_image_input": { - "description": "Optional on publish. Whether the app can receive an existing image as its initial input. Omit this field to preserve the current value when re-publishing an existing preview; new previews default to false.", - "title": "accepts_image_input", - "type": "boolean" - }, - "deployment_url": { - "description": "URL where the preview mini-app is served. Must be an `https://*.run.app` Cloud Run URL.\n", - "title": "deployment_url", - "type": "string" - }, - "deployment_commit": { - "description": "Source commit hash of the deployed build.", - "maxLength": 64, - "nullable": true, - "title": "deployment_commit", - "type": "string" + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." }, - "deployment_time": { - "description": "When the deployment that produced this build completed.", - "format": "date-time", - "nullable": true, - "title": "deployment_time", - "type": "string" + "width": { + "type": "integer", + "description": "The output width in pixels." }, - "website": { - "additionalProperties": true, - "description": "Structured website metadata for the mini-app.", - "nullable": true, - "title": "website", - "type": "object" + "height": { + "type": "integer", + "description": "The output height in pixels." } }, "required": [ - "deployment_url", - "embed", - "label", - "preview_id", - "scopes" - ], - "title": "PublishMiniAppPreviewRequest", - "type": "object" + "generation_id", + "seed", + "width", + "height" + ], + "description": "Response returned by\n`POST /v2/image/inpaint/ideogram-3-custom-model`. Synchronous\nrequests include the repainted images in `data`; asynchronous requests\nomit `data` and can be polled with\n`GET /v2/generations/{generation_id}`.\n", + "title": "InpaintImageIdeogramV3CustomModelResponse" }, - "UnpublishMiniAppPreviewResponse": { - "description": "Confirmation of an unpublished mini-app preview entry.", - "example": { - "preview_id": "preview_id" - }, - "properties": { - "preview_id": { - "description": "Unique, URL-safe preview identifier composed by the deploy pipeline.", - "maxLength": 255, - "minLength": 1, - "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$", - "title": "MiniAppPreviewId", - "type": "string" - } - }, - "required": [ - "preview_id" + "V2ImageReframeIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed": { + "type": "string", + "enum": [ + "turbo", + "default", + "quality" ], - "title": "UnpublishMiniAppPreviewResponse", - "type": "object" + "default": "default", + "title": "V2ImageReframeIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed" }, - "GetStaleMiniAppPreviewsResponse": { - "description": "Preview entries older than the requested cutoff.", - "example": { - "preview_ids": [ - null, - null - ] - }, + "ReframeImageIdeogramV3Response": { + "type": "object", "properties": { - "preview_ids": { - "description": "Unique identifiers of the stale preview entries, sorted lexicographically.", + "generation_id": { + "type": "string", + "description": "URL-safe base64 ID of the accepted generation. Accepted by the\n`GET /v2/generations/{generation_id}` polling endpoint.\n" + }, + "data": { + "type": "array", "items": { - "$ref": "#/components/schemas/MiniAppPreviewId" + "$ref": "#/components/schemas/GeneratedImageObject" }, - "title": "preview_ids", - "type": "array" + "description": "The reframed images, in generation order. Present only for synchronous requests (`async` omitted or false)." + }, + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." } }, "required": [ - "preview_ids" + "generation_id", + "seed" ], - "title": "GetStaleMiniAppPreviewsResponse", - "type": "object" + "description": "Synchronous requests (the default) include the reframed images in\n`data`. Requests with `async` set to true omit `data`; poll for\ncompletion and results with `GET /v2/generations/{generation_id}`.\nThe seed reports the value the request resolved to when the caller\nleft it unset.\n", + "title": "ReframeImageIdeogramV3Response" }, - "MiniAppMarketingProjectionResponse": { - "description": "Public-safe active mini-app entries selected for marketing pages.", - "items": { - "$ref": "#/components/schemas/MiniAppMarketingProjectionEntry" - }, - "type": "array" + "NanoBanana2ReframeAspectRatio": { + "type": "string", + "enum": [ + "1:1", + "3:2", + "2:3", + "4:3", + "3:4", + "5:4", + "4:5", + "16:9", + "9:16", + "21:9", + "4:1", + "1:4", + "8:1", + "1:8" + ], + "description": "Aspect ratios Nano Banana 2 can reframe an image to.", + "title": "NanoBanana2ReframeAspectRatio" }, - "MiniAppMarketingProjectionEntry": { - "description": "Public-safe metadata for a mini-app marketing page.", - "example": { - "is_marketing": true, - "website": { - "key": "" - }, - "deployment_time": "2000-01-23T04:56:07+00:00", - "archived_at": "2000-01-23T04:56:07+00:00", - "deployment_url": "https://openapi-generator.tech", - "deployment_commit": "deployment_commit", - "icon": "icon", - "description": "description", - "label": "label", - "cover": "cover", - "embed": "iframe", - "slug": "slug", - "card": "card" - }, + "ReframeImageNanoBanana2Response": { + "type": "object", "properties": { - "slug": { - "description": "Unique, stable, URL-safe mini-app identifier.", - "maxLength": 128, - "minLength": 1, - "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$", - "title": "slug", - "type": "string" - }, - "label": { - "description": "Human-readable mini-app name.", - "title": "label", - "type": "string" - }, - "description": { - "description": "Short description of what the mini-app does.", - "nullable": true, - "title": "description", - "type": "string" - }, - "embed": { - "description": "How the mini-app runs. Iframe apps use hosted deployments; native apps are bundled into the Ideogram frontend.", - "enum": [ - "iframe", - "native" - ], - "title": "embed", - "type": "string" - }, - "icon": { - "description": "Public URL for the mini-app icon.", - "nullable": true, - "title": "icon", - "type": "string" - }, - "cover": { - "description": "Public URL for the mini-app cover image.", - "nullable": true, - "title": "cover", - "type": "string" - }, - "card": { - "description": "Public URL for the mini-app card image.", - "nullable": true, - "title": "card", - "type": "string" - }, - "website": { - "additionalProperties": true, - "description": "Structured metadata used to build the mini-app marketing page.", - "title": "website", - "type": "object" - }, - "archived_at": { - "description": "Archive timestamp; active projection entries omit this field.", - "format": "date-time", - "nullable": true, - "title": "archived_at", - "type": "string" - }, - "is_marketing": { - "description": "Whether the entry is selected for public marketing pages.", - "title": "is_marketing", - "type": "boolean" + "generation_id": { + "type": "string", + "description": "URL-safe base64 ID of the accepted generation. Accepted by the\n`GET /v2/generations/{generation_id}` polling endpoint.\n" }, - "deployment_url": { - "description": "Public URL where a hosted mini-app is served. Native apps omit this field.", - "format": "uri", - "nullable": true, - "title": "deployment_url", - "type": "string" + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." }, - "deployment_commit": { - "description": "Source commit hash of the deployed build.", - "nullable": true, - "title": "deployment_commit", - "type": "string" + "width": { + "type": "integer", + "description": "The resolved 1K output width in pixels." }, - "deployment_time": { - "description": "When the deployment that produced this build completed.", - "format": "date-time", - "nullable": true, - "title": "deployment_time", - "type": "string" - } - }, - "required": [ - "embed", - "is_marketing", - "label", - "slug", - "website" - ], - "title": "MiniAppMarketingProjectionEntry", - "type": "object", - "x-drop-nulls": true - }, - "GetIntegrationsResponse": { - "additionalProperties": false, - "example": { - "integration_types": [ - null, - null - ] - }, - "properties": { - "integration_types": { - "description": "Distinct enabled integration types for the active organization.", - "items": { - "$ref": "#/components/schemas/IntegrationType" - }, - "title": "integration_types", - "type": "array", - "uniqueItems": true + "height": { + "type": "integer", + "description": "The resolved 1K output height in pixels." } }, "required": [ - "integration_types" + "generation_id", + "seed", + "width", + "height" ], - "title": "GetIntegrationsResponse", - "type": "object" + "description": "Acknowledges an accepted asynchronous Reframe request. Poll\n`GET /v2/generations/{generation_id}` for completion and output\nimages. The seed, width, and height report the values the request\nresolved to when the caller left them unset.\n", + "title": "ReframeImageNanoBanana2Response" }, - "IntegrationType": { - "description": "A provider-neutral integration operation family.", + "V2ImageUpscaleAutoPostRequestBodyContentMultipartFormDataSchemaUpscaleFactor": { + "type": "string", "enum": [ - "DIGITAL_ASSET_MANAGEMENT" + "x2", + "x4", + "x8" ], - "title": "IntegrationType", - "type": "string" + "default": "x2", + "description": "How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.", + "title": "V2ImageUpscaleAutoPostRequestBodyContentMultipartFormDataSchemaUpscaleFactor" }, - "IntegrationErrorResponse": { - "additionalProperties": false, - "example": { - "token_scopes": [ - "token_scopes", - "token_scopes" - ], - "required_scopes": [ - "required_scopes", - "required_scopes" - ], - "error": "INTEGRATION_ACCESS_DENIED", - "message": "message" - }, + "UpscaleImageObject": { + "type": "object", "properties": { - "error": { - "description": "Stable machine-readable integration error code. `INTEGRATION_ACCESS_DENIED` (403): the caller or organization is not allowed to use integrations. `MINI_APP_TOKEN_MISSING_SCOPES` (403): emitted by the shared mini-app token middleware. `INTEGRATION_REQUEST_INVALID` (400): malformed search request or an integration type that does not implement the operation. `INTEGRATION_NOT_CONFIGURED` (404): the organization has no enabled integration of the requested type. `INTEGRATION_STATE_CHANGED` (409): the integration mutated after the signed reference was issued; run a new search. `INTEGRATION_REFERENCE_INVALID` (404): the signed delivery reference is forged, tampered, malformed, or expired; obtain a fresh reference from a new search. `INTEGRATION_SERVER_ERROR` (503): server-side failure (adapter or runtime unavailable, credential unusable, or a malformed upstream response); retry later.", - "enum": [ - "INTEGRATION_ACCESS_DENIED", - "MINI_APP_TOKEN_MISSING_SCOPES", - "INTEGRATION_REQUEST_INVALID", - "INTEGRATION_NOT_CONFIGURED", - "INTEGRATION_STATE_CHANGED", - "INTEGRATION_REFERENCE_INVALID", - "INTEGRATION_SERVER_ERROR" + "url": { + "type": [ + "string", + "null" ], - "title": "error", - "type": "string" + "format": "uri", + "description": "The direct link to the upscaled image. Empty when the image did not pass safety checks." }, - "message": { - "description": "Stable human-readable explanation of the error.", - "title": "message", - "type": "string" + "resolution": { + "type": "string", + "description": "The resolution of the upscaled image, formatted as \"WIDTHxHEIGHT\"." }, - "required_scopes": { - "description": "Required mini-app scopes when scope authorization fails.", - "items": { - "type": "string" - }, - "title": "required_scopes", - "type": "array" + "is_image_safe": { + "type": "boolean", + "description": "Whether the image passed safety checks. If false, `url` is empty." }, - "token_scopes": { - "description": "Scopes present in the mini-app token when authorization fails.", - "items": { - "type": "string" - }, - "title": "token_scopes", - "type": "array" + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." } }, "required": [ - "error", - "message" + "resolution", + "is_image_safe", + "seed" ], - "title": "IntegrationErrorResponse", - "type": "object" + "description": "One upscaled output image.", + "title": "UpscaleImageObject" }, - "IntegrationAssetSearchResponse": { - "additionalProperties": false, - "example": { - "assets": [ - { - "delivery": "", - "metadata": { - "key": "metadata" - }, - "media_type": "media_type", - "external_ref": "external_ref", - "width": 1, - "label": "label", - "height": 1 - }, - { - "delivery": "", - "metadata": { - "key": "metadata" - }, - "media_type": "media_type", - "external_ref": "external_ref", - "width": 1, - "label": "label", - "height": 1 - } - ] - }, + "UpscaleToolResponse": { + "type": "object", "properties": { - "assets": { + "generation_id": { + "type": "string", + "description": "The generation ID to poll with `GET /v2/generations/{generation_id}`.\n" + }, + "data": { + "type": "array", "items": { - "$ref": "#/components/schemas/IntegrationAsset" + "$ref": "#/components/schemas/UpscaleImageObject" }, - "title": "assets", - "type": "array" - } - }, - "required": [ - "assets" - ], - "title": "IntegrationAssetSearchResponse", - "type": "object" - }, - "IntegrationAsset": { - "additionalProperties": false, - "example": { - "delivery": "", - "metadata": { - "key": "metadata" - }, - "media_type": "media_type", - "external_ref": "external_ref", - "width": 1, - "label": "label", - "height": 1 - }, - "properties": { - "external_ref": { - "description": "Opaque signed reference to this external asset.", - "title": "external_ref", - "type": "string" - }, - "delivery": { - "allOf": [ - { - "$ref": "#/components/schemas/IntegrationAssetDelivery" - } - ], - "description": "Short-lived link for fetching this asset's media bytes.", - "title": "delivery" - }, - "label": { - "description": "Human-readable asset label supplied by the integration.", - "title": "label", - "type": "string" + "description": "The upscaled image. Present only for synchronous requests (`async` omitted or false)." }, - "media_type": { - "description": "Asset media type.", - "title": "media_type", - "type": "string" + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." }, "width": { - "description": "Pixel width when supplied by the integration.", - "minimum": 1, - "title": "width", - "type": "integer" + "type": "integer", + "description": "The output width in pixels." }, "height": { - "description": "Pixel height when supplied by the integration.", - "minimum": 1, - "title": "height", - "type": "integer" - }, - "metadata": { - "additionalProperties": { - "type": "string" - }, - "description": "Adapter-specific identifiers needed to organize the asset.", - "title": "metadata", - "type": "object" + "type": "integer", + "description": "The output height in pixels." } }, "required": [ - "delivery", - "external_ref", - "label", - "media_type" + "generation_id", + "seed", + "width", + "height" ], - "title": "IntegrationAsset", - "type": "object" + "description": "Synchronous requests (the default) include the upscaled image in `data`.\nAsync requests omit `data`; poll `GET /v2/generations/{generation_id}`\nwith the returned `generation_id`. `seed` is the seed actually used,\nand `width` and `height` are the output dimensions.\n", + "title": "UpscaleToolResponse" }, - "IntegrationAssetDelivery": { - "additionalProperties": false, - "properties": { - "url": { - "description": "Short-lived URL that streams this asset's media bytes.", - "title": "url", - "type": "string" - }, - "expires_at": { - "description": "Instant after which the delivery URL stops working.", - "format": "date-time", - "title": "expires_at", - "type": "string" - } - }, - "required": [ - "expires_at", - "url" + "V2ImageUpscaleNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier": { + "type": "string", + "enum": [ + "1K", + "2K", + "4K" ], - "title": "IntegrationAssetDelivery", - "type": "object" + "default": "2K", + "description": "The output resolution tier. The model sizes its output by tier at the source image's aspect ratio; exact pixel dimensions cannot be requested. Rejected when the source is already at or above the requested tier. Defaults to \"2K\".", + "title": "V2ImageUpscaleNanoBananaProPostRequestBodyContentMultipartFormDataSchemaResolutionTier" }, - "IntegrationAssetSearchRequest": { - "additionalProperties": false, - "example": { - "query": "query", - "limit": 1 - }, + "UpscaleImageNanoBananaProResponse": { + "type": "object", "properties": { - "limit": { - "description": "Maximum number of assets to return, bounded by the configured runtime policy. The operation returns a single bounded result; pagination is a future extension that adds optional fields additively.", - "minimum": 1, - "title": "limit", - "type": "integer" - }, - "query": { - "description": "Optional keyed lookup. For integrations whose upstream is a keyed catalog, this is the item key (for example a product style code); integrations without keyed lookup ignore it. Omitted means browse.", - "maxLength": 64, - "minLength": 1, - "title": "query", - "type": "string" - } - }, - "required": [ - "limit" - ], - "title": "IntegrationAssetSearchRequest", - "type": "object" - }, - "V4JsonPrompt": { - "description": "Structured prompt for Ideogram 4.0 generation. When `json_prompt` is\nsupplied, magic-prompt is disabled and the diffusion model consumes\nthe JSON contract directly. Mutually exclusive with `text_prompt`\nand the legacy `prompt` field.\n", - "example": { - "high_level_description": "high_level_description", - "style_description": { - "photo": "photo", - "art_style": "art_style", - "medium": "medium", - "aesthetics": "aesthetics", - "lighting": "lighting", - "color_palette": [ - "#FFD700", - "#FFD700" - ] - }, - "compositional_deconstruction": { - "background": "background", - "elements": [ - { - "bbox": [ - 0, - 0, - 1000, - 1000 - ], - "type": "obj", - "desc": "desc", - "color_palette": [ - "#FFD700", - "#FFD700" - ] - }, - { - "bbox": [ - 0, - 0, - 1000, - 1000 - ], - "type": "obj", - "desc": "desc", - "color_palette": [ - "#FFD700", - "#FFD700" - ] - } - ] + "generation_id": { + "type": "string", + "description": "The generation ID to poll with `GET /v2/generations/{generation_id}`.\n" }, - "tags": [ - "tags", - "tags" - ] - }, - "properties": { - "high_level_description": { - "description": "One- or two-sentence overall description of the desired image.", - "title": "high_level_description", - "type": "string" + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UpscaleImageObject" + }, + "description": "The upscaled image. Present only for synchronous requests (`async` omitted or false)." }, - "style_description": { - "$ref": "#/components/schemas/V4StyleDescription" + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." }, - "compositional_deconstruction": { - "$ref": "#/components/schemas/V4CompositionalDeconstruction" + "width": { + "type": "integer", + "description": "The output width in pixels." }, - "tags": { - "description": "Round-trip metadata surfaced by the describe endpoint when\n`strip_tags=false`. Ignored by the v4 sampler on generate input.\n", - "items": { - "type": "string" - }, - "title": "tags", - "type": "array" + "height": { + "type": "integer", + "description": "The output height in pixels." } }, "required": [ - "compositional_deconstruction", - "high_level_description" + "generation_id", + "seed", + "width", + "height" ], - "title": "V4JsonPrompt", - "type": "object", - "x-drop-nulls": true + "description": "Synchronous requests (the default) include the upscaled image in `data`.\nAsync requests omit `data`; poll `GET /v2/generations/{generation_id}`\nwith the returned `generation_id`. `seed` is the seed actually used,\nand `width` and `height` are the output dimensions.\n", + "title": "UpscaleImageNanoBananaProResponse" }, - "V4StyleDescription": { - "description": "Optional style description supplied alongside a V4 JSON prompt.", - "example": { - "photo": "photo", - "art_style": "art_style", - "medium": "medium", - "aesthetics": "aesthetics", - "lighting": "lighting", - "color_palette": [ - "#FFD700", - "#FFD700" - ] - }, + "V2ImageUpscaleTopazBloom2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor": { + "type": "string", + "enum": [ + "x2", + "x4", + "x8" + ], + "default": "x2", + "description": "How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.", + "title": "V2ImageUpscaleTopazBloom2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor" + }, + "UpscaleImageTopazBloom2Response": { + "type": "object", "properties": { - "aesthetics": { - "description": "Aesthetic notes (mood, vibe, references).", - "title": "aesthetics", - "type": "string" - }, - "art_style": { - "description": "Optional art-style hint (e.g., illustration, oil painting).", - "title": "art_style", - "type": "string" + "generation_id": { + "type": "string", + "description": "The generation ID to poll with `GET /v2/generations/{generation_id}`.\n" }, - "lighting": { - "description": "Lighting description.", - "title": "lighting", - "type": "string" + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UpscaleImageObject" + }, + "description": "The upscaled image. Present only for synchronous requests (`async` omitted or false)." }, - "medium": { - "description": "Medium description (e.g., photograph, digital art).", - "title": "medium", - "type": "string" + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." }, - "photo": { - "description": "Optional photographic style notes (e.g., lens, film stock).", - "title": "photo", - "type": "string" + "width": { + "type": "integer", + "description": "The output width in pixels." }, - "color_palette": { - "description": "Optional list of hex color strings (e.g. \"#FFD700\") that bias the\nIdeogram 4.0 output toward this palette. Applied as a soft color bias,\nnot an exact per-pixel lock.\n", - "items": { - "example": "#FFD700", - "pattern": "^#[0-9a-fA-F]{6}$", - "type": "string" - }, - "title": "V4ColorPalette", - "type": "array" + "height": { + "type": "integer", + "description": "The output height in pixels." } }, - "title": "V4StyleDescription", - "type": "object", - "x-drop-nulls": true + "required": [ + "generation_id", + "seed", + "width", + "height" + ], + "description": "Synchronous requests (the default) include the upscaled image in `data`.\nAsync requests omit `data`; poll `GET /v2/generations/{generation_id}`\nwith the returned `generation_id`. `seed` is the seed actually used,\nand `width` and `height` are the output dimensions.\n", + "title": "UpscaleImageTopazBloom2Response" }, - "V4ColorPalette": { - "description": "Optional list of hex color strings (e.g. \"#FFD700\") that bias the\nIdeogram 4.0 output toward this palette. Applied as a soft color bias,\nnot an exact per-pixel lock.\n", - "items": { - "example": "#FFD700", - "pattern": "^#[0-9a-fA-F]{6}$", - "type": "string" - }, - "title": "V4ColorPalette", - "type": "array" + "V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor": { + "type": "string", + "enum": [ + "x2", + "x4", + "x8" + ], + "default": "x2", + "description": "How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.", + "title": "V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor" }, - "V4CompositionalDeconstruction": { - "description": "The compositional breakdown of a V4 prompt — background plus an ordered list of elements.", - "example": { - "background": "background", - "elements": [ - { - "bbox": [ - 0, - 0, - 1000, - 1000 - ], - "type": "obj", - "desc": "desc", - "color_palette": [ - "#FFD700", - "#FFD700" - ] - }, - { - "bbox": [ - 0, - 0, - 1000, - 1000 - ], - "type": "obj", - "desc": "desc", - "color_palette": [ - "#FFD700", - "#FFD700" - ] - } - ] - }, + "V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection": { + "type": "string", + "enum": [ + "all", + "foreground", + "background" + ], + "description": "Where enhancements apply. Omit to let the model choose per image.", + "title": "V2ImageUpscaleTopazRedefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection" + }, + "UpscaleImageTopazRedefineResponse": { + "type": "object", "properties": { - "background": { - "description": "Description of the background of the scene.", - "title": "background", - "type": "string" + "generation_id": { + "type": "string", + "description": "The generation ID to poll with `GET /v2/generations/{generation_id}`.\n" }, - "elements": { - "description": "Ordered list of elements (objects and text) composing the scene.", + "data": { + "type": "array", "items": { - "$ref": "#/components/schemas/V4PromptElement" + "$ref": "#/components/schemas/UpscaleImageObject" }, - "title": "elements", - "type": "array" + "description": "The upscaled image. Present only for synchronous requests (`async` omitted or false)." + }, + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." + }, + "width": { + "type": "integer", + "description": "The output width in pixels." + }, + "height": { + "type": "integer", + "description": "The output height in pixels." } }, "required": [ - "background", - "elements" + "generation_id", + "seed", + "width", + "height" ], - "title": "V4CompositionalDeconstruction", - "type": "object" + "description": "Synchronous requests (the default) include the upscaled image in `data`.\nAsync requests omit `data`; poll `GET /v2/generations/{generation_id}`\nwith the returned `generation_id`. `seed` is the seed actually used,\nand `width` and `height` are the output dimensions.\n", + "title": "UpscaleImageTopazRedefineResponse" }, - "V4PromptElement": { - "description": "A single element in the V4 prompt's compositional deconstruction.\nDiscriminated by the `type` field.\n", - "discriminator": { - "mapping": { - "obj": "#/components/schemas/V4ObjPromptElement", - "text": "#/components/schemas/V4TextPromptElement" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/V4ObjPromptElement" - }, - { - "$ref": "#/components/schemas/V4TextPromptElement" - } + "V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor": { + "type": "string", + "enum": [ + "x2", + "x4", + "x8" + ], + "default": "x2", + "description": "How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.", + "title": "V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor" + }, + "V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaSubjectDetection": { + "type": "string", + "enum": [ + "all", + "foreground", + "background" ], - "title": "V4PromptElement", - "x-drop-nulls": true + "description": "Where enhancements apply. Omit to let the model choose per image.", + "title": "V2ImageUpscaleTopazStandard2PostRequestBodyContentMultipartFormDataSchemaSubjectDetection" }, - "V4ObjPromptElement": { - "description": "A non-text element (object, character, background detail) in the V4 prompt layout.", - "example": { - "bbox": [ - 0, - 0, - 1000, - 1000 - ], - "type": "obj", - "desc": "desc", - "color_palette": [ - "#FFD700", - "#FFD700" - ] - }, + "UpscaleImageTopazStandardV2Response": { + "type": "object", "properties": { - "type": { - "description": "Discriminator. Must be `obj`.", - "enum": [ - "obj" - ], - "title": "type", - "type": "string" + "generation_id": { + "type": "string", + "description": "The generation ID to poll with `GET /v2/generations/{generation_id}`.\n" }, - "bbox": { - "description": "Bounding box for an element, expressed as four integers in `[0, 1000]`\nwith `[y_min, x_min, y_max, x_max]` semantics (row-first). Values are\nnormalized so the canvas is `1000 x 1000` regardless of the final\nresolution.\n", - "example": [ - 0, - 0, - 1000, - 1000 - ], + "data": { + "type": "array", "items": { - "maximum": 1000, - "minimum": 0, - "type": "integer" + "$ref": "#/components/schemas/UpscaleImageObject" }, - "maxItems": 4, - "minItems": 4, - "title": "V4PromptBbox", - "type": "array" - }, - "desc": { - "description": "Description of the object element.", - "title": "desc", - "type": "string" + "description": "The upscaled image. Present only for synchronous requests (`async` omitted or false)." }, - "color_palette": { - "description": "Optional list of hex color strings (e.g. \"#FFD700\") that bias the\nIdeogram 4.0 output toward this palette. Applied as a soft color bias,\nnot an exact per-pixel lock.\n", - "items": { - "example": "#FFD700", - "pattern": "^#[0-9a-fA-F]{6}$", - "type": "string" - }, - "title": "V4ColorPalette", - "type": "array" + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." + }, + "width": { + "type": "integer", + "description": "The output width in pixels." + }, + "height": { + "type": "integer", + "description": "The output height in pixels." } }, "required": [ - "desc", - "type" + "generation_id", + "seed", + "width", + "height" ], - "title": "V4ObjPromptElement", - "type": "object" + "description": "Synchronous requests (the default) include the upscaled image in `data`.\nAsync requests omit `data`; poll `GET /v2/generations/{generation_id}`\nwith the returned `generation_id`. `seed` is the seed actually used,\nand `width` and `height` are the output dimensions.\n", + "title": "UpscaleImageTopazStandardV2Response" }, - "V4PromptBbox": { - "description": "Bounding box for an element, expressed as four integers in `[0, 1000]`\nwith `[y_min, x_min, y_max, x_max]` semantics (row-first). Values are\nnormalized so the canvas is `1000 x 1000` regardless of the final\nresolution.\n", - "example": [ - 0, - 0, - 1000, - 1000 - ], - "items": { - "maximum": 1000, - "minimum": 0, - "type": "integer" - }, - "maxItems": 4, - "minItems": 4, - "title": "V4PromptBbox", - "type": "array" + "V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor": { + "type": "string", + "enum": [ + "x2", + "x4", + "x8" + ], + "default": "x2", + "description": "How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.", + "title": "V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaUpscaleFactor" + }, + "V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection": { + "type": "string", + "enum": [ + "all", + "foreground", + "background" + ], + "description": "Where enhancements apply. Omit to let the model choose per image.", + "title": "V2ImageUpscaleTopazTextRefinePostRequestBodyContentMultipartFormDataSchemaSubjectDetection" }, - "V4TextPromptElement": { - "description": "A text element to render in the V4 prompt layout.", + "UpscaleImageTopazTextRefineResponse": { + "type": "object", "properties": { - "type": { - "description": "Discriminator. Must be `text`.", - "enum": [ - "text" - ], - "title": "type", - "type": "string" + "generation_id": { + "type": "string", + "description": "The generation ID to poll with `GET /v2/generations/{generation_id}`.\n" }, - "bbox": { - "description": "Bounding box for an element, expressed as four integers in `[0, 1000]`\nwith `[y_min, x_min, y_max, x_max]` semantics (row-first). Values are\nnormalized so the canvas is `1000 x 1000` regardless of the final\nresolution.\n", - "example": [ - 0, - 0, - 1000, - 1000 - ], + "data": { + "type": "array", "items": { - "maximum": 1000, - "minimum": 0, - "type": "integer" + "$ref": "#/components/schemas/UpscaleImageObject" }, - "maxItems": 4, - "minItems": 4, - "title": "V4PromptBbox", - "type": "array" + "description": "The upscaled image. Present only for synchronous requests (`async` omitted or false)." }, - "text": { - "description": "The literal text to render in the image.", - "title": "text", - "type": "string" + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." }, - "desc": { - "description": "Description of the text element (style, role, placement notes).", - "title": "desc", - "type": "string" + "width": { + "type": "integer", + "description": "The output width in pixels." }, - "color_palette": { - "description": "Optional list of hex color strings (e.g. \"#FFD700\") that bias the\nIdeogram 4.0 output toward this palette. Applied as a soft color bias,\nnot an exact per-pixel lock.\n", - "items": { - "example": "#FFD700", - "pattern": "^#[0-9a-fA-F]{6}$", - "type": "string" - }, - "title": "V4ColorPalette", - "type": "array" + "height": { + "type": "integer", + "description": "The output height in pixels." } }, "required": [ - "desc", - "text", - "type" + "generation_id", + "seed", + "width", + "height" ], - "title": "V4TextPromptElement", - "type": "object" + "description": "Synchronous requests (the default) include the upscaled image in `data`.\nAsync requests omit `data`; poll `GET /v2/generations/{generation_id}`\nwith the returned `generation_id`. `seed` is the seed actually used,\nand `width` and `height` are the output dimensions.\n", + "title": "UpscaleImageTopazTextRefineResponse" }, - "ResolutionV4": { - "description": "The 1K and 2K resolutions supported for Ideogram 4.0 image generation.", + "V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor": { + "type": "string", "enum": [ - "2048x2048", - "1440x2880", - "2880x1440", - "1664x2496", - "2496x1664", - "1792x2240", - "2240x1792", - "1440x2560", - "2560x1440", - "1600x2560", - "2560x1600", - "1728x2304", - "2304x1728", - "1296x3168", - "3168x1296", - "1152x2944", - "2944x1152", - "1248x3328", - "3328x1248", - "1280x3072", - "3072x1280", - "1024x3072", - "3072x1024", - "1024x1024", - "896x1120", - "1120x896", - "864x1152", - "1152x864", - "832x1248", - "1248x832", - "800x1280", - "1280x800", - "720x1280", - "1280x720", - "720x1440", - "1440x720", - "512x1536", - "1536x512" + "x2", + "x4", + "x8" ], - "example": "2048x2048", - "title": "ResolutionV4", - "type": "string" - }, - "RenderingSpeed": { - "default": "DEFAULT", - "description": "The rendering speed to use.", - "enum": [ - "FLASH", - "TURBO", - "BALANCED", - "DEFAULT", - "QUALITY" - ], - "title": "RenderingSpeed", - "type": "string" + "default": "x2", + "description": "How much to enlarge the source image: 2x, 4x, or 8x its original width and height. Rejected when the output would exceed 8192px on either side.", + "title": "V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaUpscaleFactor" }, - "AspectRatioV4": { - "default": "AUTO", - "description": "The aspect ratio for an Ideogram 4.0 magic prompt. `AUTO` lets the\nmodel select the most suitable ratio from the prompt; any other value\npins the ratio. The non-AUTO values are the buckets the 4.0 model\nsupports.\n", + "V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaEnhancementStrength": { + "type": "string", "enum": [ - "AUTO", - "1x4", - "1x3", - "1x2", - "9x16", - "10x16", - "2x3", - "3x4", - "4x5", - "1x1", - "5x4", - "4x3", - "3x2", - "16x10", - "16x9", - "2x1", - "3x1", - "4x1" + "low", + "medium", + "high" ], - "title": "AspectRatioV4", - "type": "string" + "default": "high", + "description": "How strongly the generative model reconstructs detail while upscaling. Lower values stay closer to the source image; higher values produce a more enhanced result.", + "title": "V2ImageUpscaleTopazWonder35PostRequestBodyContentMultipartFormDataSchemaEnhancementStrength" }, - "MagicPromptOption": { - "description": "Determine if MagicPrompt should be used in generating the request or not.", - "enum": [ - "AUTO", - "ON", - "OFF" - ], - "example": "ON", - "externalDocs": { - "url": "https://docs.ideogram.ai/using-ideogram/ideogram-features/magic-prompt" + "UpscaleImageTopazWonder35Response": { + "type": "object", + "properties": { + "generation_id": { + "type": "string", + "description": "The generation ID to poll with `GET /v2/generations/{generation_id}`.\n" + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UpscaleImageObject" + }, + "description": "The upscaled image. Present only for synchronous requests (`async` omitted or false)." + }, + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." + }, + "width": { + "type": "integer", + "description": "The output width in pixels." + }, + "height": { + "type": "integer", + "description": "The output height in pixels." + } }, - "title": "MagicPromptOption", - "type": "string", - "x-tool-description": "Automatic prompt rewriting." - }, - "Quality": { - "description": "The generation quality level. Higher levels may use more inference steps\nor additional prompt processing. `VERY_HIGH` has noticeably higher latency\nand cost than the other levels.\n", - "enum": [ - "VERY_LOW", - "LOW", - "MEDIUM", - "HIGH", - "VERY_HIGH" - ], - "title": "Quality", - "type": "string" + "required": [ + "generation_id", + "seed", + "width", + "height" + ], + "description": "Synchronous requests (the default) include the upscaled image in `data`.\nAsync requests omit `data`; poll `GET /v2/generations/{generation_id}`\nwith the returned `generation_id`. `seed` is the seed actually used,\nand `width` and `height` are the output dimensions.\n", + "title": "UpscaleImageTopazWonder35Response" }, - "AspectRatioV3": { - "description": "Output aspect ratio. Cannot be combined with resolution. Generation defaults to 1x1; remix keeps the source ratio when both fields are omitted.", + "V2ImageReplaceBackgroundIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed": { + "type": "string", "enum": [ - "1x3", - "3x1", - "1x2", - "2x1", - "9x16", - "16x9", - "10x16", - "16x10", - "2x3", - "3x2", - "3x4", - "4x3", - "4x5", - "5x4", - "1x1" + "turbo", + "default", + "quality" ], - "title": "AspectRatioV3", - "type": "string", - "x-tool-description": "Cannot combine with resolution. Omit both: generation uses 1x1; remix keeps the source ratio." - }, - "Seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", - "type": "integer", - "x-tool-description": "Set for reproducible generation." + "default": "default", + "description": "The rendering speed to use.", + "title": "V2ImageReplaceBackgroundIdeogram3PostRequestBodyContentMultipartFormDataSchemaRenderingSpeed" }, - "ResolutionV4ImageToImage": { - "description": "Output resolutions for Ideogram 4.0 image-to-image. Superset of ResolutionV4 (the 1K/2K t2im set) plus the small 512-tier (512x512, 768x384, 384x768).", - "enum": [ - "2048x2048", - "1440x2880", - "2880x1440", - "1664x2496", - "2496x1664", - "1792x2240", - "2240x1792", - "1440x2560", - "2560x1440", - "1600x2560", - "2560x1600", - "1728x2304", - "2304x1728", - "1296x3168", - "3168x1296", - "1152x2944", - "2944x1152", - "1248x3328", - "3328x1248", - "1280x3072", - "3072x1280", - "1024x3072", - "3072x1024", - "1024x1024", - "896x1120", - "1120x896", - "864x1152", - "1152x864", - "832x1248", - "1248x832", - "800x1280", - "1280x800", - "720x1280", - "1280x720", - "720x1440", - "1440x720", - "512x512", - "768x384", - "384x768" + "ReplaceBackgroundResponse": { + "type": "object", + "properties": { + "generation_id": { + "type": "string", + "description": "The generation ID to poll with `GET /v2/generations/{generation_id}`." + } + }, + "required": [ + "generation_id" ], - "example": "1024x1024", - "title": "ResolutionV4ImageToImage", - "type": "string" + "description": "Acknowledgement that the request was accepted.", + "title": "ReplaceBackgroundResponse" }, - "ResolutionV4Layout": { - "description": "The resolutions supported for Ideogram 4.0 layout-to-image and design generation.", + "ReplaceBackgroundQuality": { + "type": "string", "enum": [ - "1024x1024", - "896x1120", - "1120x896", - "864x1152", - "1152x864", - "832x1248", - "1248x832", - "800x1280", - "1280x800", - "720x1280", - "1280x720", - "720x1440", - "1440x720" + "low", + "medium", + "high" ], - "example": "1024x1024", - "title": "ResolutionV4Layout", - "type": "string" + "description": "The quality tier for the edit. Higher tiers may improve detail and\ntake longer to complete.\n", + "title": "ReplaceBackgroundQuality" }, - "Description": { + "BackgroundRemovedImageObject": { + "type": "object", "properties": { - "text": { - "description": "The generated description for the provided image.", - "example": "A meticulously illustrated cat with striped patterns, sitting upright. The cat's eyes are a captivating shade of yellow, and it appears to be gazing intently at something. The background consists of abstract, swirling patterns in shades of black, white, and beige, creating an almost fluid or wavy appearance. The cat is positioned in the foreground, with the background elements fading into the distance, giving a sense of depth to the image.", - "title": "text", - "type": "string" + "url": { + "type": [ + "string", + "null" + ], + "format": "uri", + "description": "Direct link to the foreground PNG. Empty when the output fails safety checks." + }, + "is_image_safe": { + "type": "boolean", + "description": "Whether the foreground image passed safety checks." } }, - "title": "Description", - "type": "object" + "required": [ + "is_image_safe" + ], + "title": "BackgroundRemovedImageObject" }, - "DescribeModelVersion": { - "default": "V_3", - "description": "The model version to use for describing images. Defaults to V_3.", - "enum": [ - "V_2", - "V_3", - "CUSTOM", - "V_4" + "RemoveBackgroundV2Response": { + "type": "object", + "properties": { + "generation_id": { + "type": "string", + "description": "The generation ID to poll with `GET /v2/generations/{generation_id}`." + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BackgroundRemovedImageObject" + }, + "description": "The single foreground image. Present only for synchronous requests." + }, + "error": { + "type": "string", + "description": "Error message for a failure after the response started streaming." + }, + "status_code": { + "type": "integer", + "description": "The HTTP status the failure would have returned before streaming began." + } + }, + "description": "Synchronous requests include exactly one foreground image in `data`.\nAsync requests omit `data`; poll with `generation_id` for the result.\nIf a synchronous request fails after the response has started\nstreaming, the body contains `error` and `status_code` instead of\n`generation_id`.\n", + "title": "RemoveBackgroundV2Response" + }, + "RemoveObjectFromV2AssetsResponse": { + "type": "object", + "properties": { + "generation_id": { + "type": "string", + "description": "URL-safe base64 ID of the accepted generation. Accepted by the\n`GET /v2/generations/{generation_id}` polling endpoint.\n" + } + }, + "required": [ + "generation_id" ], - "title": "DescribeModelVersion", - "type": "string" + "description": "Acknowledgement that the request was accepted. Poll\n`GET /v2/generations/{generation_id}` with the returned `generation_id`\nfor the result.\n", + "title": "RemoveObjectFromV2AssetsResponse" }, - "NumImages": { - "default": 1, - "description": "The number of images to generate.", - "maximum": 8, - "minimum": 1, - "title": "NumImages", - "type": "integer", - "x-tool-description": "Number of variations of this one prompt. For different subjects, make separate calls instead of listing them in one prompt." + "V4StyleDescription": { + "type": "object", + "properties": { + "aesthetics": { + "type": "string", + "description": "Aesthetic notes (mood, vibe, references)." + }, + "art_style": { + "type": "string", + "description": "Optional art-style hint (e.g., illustration, oil painting)." + }, + "lighting": { + "type": "string", + "description": "Lighting description." + }, + "medium": { + "type": "string", + "description": "Medium description (e.g., photograph, digital art)." + }, + "photo": { + "type": "string", + "description": "Optional photographic style notes (e.g., lens, film stock)." + }, + "color_palette": { + "type": "array", + "items": { + "type": "string", + "pattern": "^#[0-9a-fA-F]{6}$" + }, + "description": "Optional list of hex color strings (e.g. \"#FFD700\") that bias the\nIdeogram 4.0 output toward this palette. Applied as a soft color bias,\nnot an exact per-pixel lock.\n" + } + }, + "description": "Optional style description supplied alongside a V4 JSON prompt.", + "title": "V4StyleDescription" }, - "StyleType": { - "description": "The style type to generate with; this is only applicable for models V_2 and above and should not be specified for model versions V_1.", + "V4ObjPromptElementType": { + "type": "string", "enum": [ - "AUTO", - "GENERAL", - "FICTION", - "REALISTIC", - "DESIGN", - "RENDER_3D", - "ANIME", - "CUSTOM", - "STYLIZED" - ], - "example": "REALISTIC", - "title": "StyleType", - "type": "string" + "obj" + ], + "description": "Discriminator. Must be `obj`.", + "title": "V4ObjPromptElementType" }, - "ResolutionV3": { - "description": "The resolutions supported for Ideogram 3.0.", + "V4TextPromptElementType": { + "type": "string", "enum": [ - "512x1536", - "576x1408", - "576x1472", - "576x1536", - "640x1344", - "640x1408", - "640x1472", - "640x1536", - "704x1152", - "704x1216", - "704x1280", - "704x1344", - "704x1408", - "704x1472", - "736x1312", - "768x1088", - "768x1216", - "768x1280", - "768x1344", - "800x1280", - "832x960", - "832x1024", - "832x1088", - "832x1152", - "832x1216", - "832x1248", - "864x1152", - "896x960", - "896x1024", - "896x1088", - "896x1120", - "896x1152", - "960x832", - "960x896", - "960x1024", - "960x1088", - "1024x832", - "1024x896", - "1024x960", - "1024x1024", - "1088x768", - "1088x832", - "1088x896", - "1088x960", - "1120x896", - "1152x704", - "1152x832", - "1152x864", - "1152x896", - "1216x704", - "1216x768", - "1216x832", - "1248x832", - "1280x704", - "1280x768", - "1280x800", - "1312x736", - "1344x640", - "1344x704", - "1344x768", - "1408x576", - "1408x640", - "1408x704", - "1472x576", - "1472x640", - "1472x704", - "1536x512", - "1536x576", - "1536x640" + "text" ], - "example": "1280x800", - "title": "ResolutionV3", - "type": "string", - "x-tool-description": "Output resolution." + "description": "Discriminator. Must be `text`.", + "title": "V4TextPromptElementType" }, - "ColorPaletteWithPresetNameOrMembers": { - "description": "A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). Not supported by V_1, V_1_TURBO, V_2A and V_2A_TURBO models.", + "V4PromptElement": { "oneOf": [ { - "$ref": "#/components/schemas/ColorPaletteWithPresetName" + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/V4ObjPromptElementType", + "description": "Discriminator. Must be `obj`." + }, + "bbox": { + "type": "array", + "items": { + "type": "integer", + "minimum": 0, + "maximum": 1000 + }, + "description": "Bounding box for an element, expressed as four integers in `[0, 1000]`\nwith `[y_min, x_min, y_max, x_max]` semantics (row-first). Values are\nnormalized so the canvas is `1000 x 1000` regardless of the final\nresolution.\n" + }, + "desc": { + "type": "string", + "description": "Description of the object element." + }, + "color_palette": { + "type": "array", + "items": { + "type": "string", + "pattern": "^#[0-9a-fA-F]{6}$" + }, + "description": "Optional list of hex color strings (e.g. \"#FFD700\") that bias the\nIdeogram 4.0 output toward this palette. Applied as a soft color bias,\nnot an exact per-pixel lock.\n" + } + }, + "required": [ + "type", + "desc" + ], + "description": "A non-text element (object, character, background detail) in the V4 prompt layout." }, { - "$ref": "#/components/schemas/ColorPaletteWithMembers" + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/V4TextPromptElementType", + "description": "Discriminator. Must be `text`." + }, + "bbox": { + "type": "array", + "items": { + "type": "integer", + "minimum": 0, + "maximum": 1000 + }, + "description": "Bounding box for an element, expressed as four integers in `[0, 1000]`\nwith `[y_min, x_min, y_max, x_max]` semantics (row-first). Values are\nnormalized so the canvas is `1000 x 1000` regardless of the final\nresolution.\n" + }, + "text": { + "type": "string", + "description": "The literal text to render in the image." + }, + "desc": { + "type": "string", + "description": "Description of the text element (style, role, placement notes)." + }, + "color_palette": { + "type": "array", + "items": { + "type": "string", + "pattern": "^#[0-9a-fA-F]{6}$" + }, + "description": "Optional list of hex color strings (e.g. \"#FFD700\") that bias the\nIdeogram 4.0 output toward this palette. Applied as a soft color bias,\nnot an exact per-pixel lock.\n" + } + }, + "required": [ + "type", + "text", + "desc" + ], + "description": "A text element to render in the V4 prompt layout." + } + ], + "discriminator": { + "propertyName": "type" + }, + "description": "A single element in the V4 prompt's compositional deconstruction.\nDiscriminated by the `type` field.\n", + "title": "V4PromptElement" + }, + "V4CompositionalDeconstruction": { + "type": "object", + "properties": { + "background": { + "type": "string", + "description": "Description of the background of the scene." + }, + "elements": { + "type": "array", + "items": { + "$ref": "#/components/schemas/V4PromptElement" + }, + "description": "Ordered list of elements (objects and text) composing the scene." + } + }, + "required": [ + "background", + "elements" + ], + "description": "The compositional breakdown of a V4 prompt — background plus an ordered list of elements.", + "title": "V4CompositionalDeconstruction" + }, + "V4JsonPrompt": { + "type": "object", + "properties": { + "high_level_description": { + "type": "string", + "description": "One- or two-sentence overall description of the desired image." + }, + "style_description": { + "$ref": "#/components/schemas/V4StyleDescription" + }, + "compositional_deconstruction": { + "$ref": "#/components/schemas/V4CompositionalDeconstruction" + } + }, + "required": [ + "high_level_description", + "compositional_deconstruction" + ], + "description": "Structured prompt for Ideogram 4.0 generation. When `json_prompt` is\nsupplied, magic-prompt is disabled and the diffusion model consumes\nthe JSON contract directly. Mutually exclusive with `text_prompt`\nand the legacy `prompt` field.\n", + "title": "V4JsonPrompt" + }, + "DescribeImageIdeogramV4Response": { + "type": "object", + "properties": { + "description_id": { + "type": "string", + "description": "URL-safe base64 ID of the description that was created." + }, + "created": { + "type": "string", + "format": "date-time", + "description": "The time the request was created." + }, + "json_prompt": { + "$ref": "#/components/schemas/V4JsonPrompt" + } + }, + "required": [ + "description_id", + "created", + "json_prompt" + ], + "description": "Response returned by `POST /v2/image/describe/ideogram-4`.\nThe `json_prompt` field is a structured `V4JsonPrompt` that can be\npassed back as `json_prompt` to the `/v1/ideogram-v4/generate` family\nof endpoints.\n", + "title": "DescribeImageIdeogramV4Response" + }, + "ImageSafetyError": { + "type": "object", + "properties": { + "error": { + "type": "string" + } + }, + "required": [ + "error" + ], + "title": "ImageSafetyError" + }, + "GeneratedDescription": { + "type": "object", + "properties": { + "text": { + "type": "string", + "description": "The generated description for the provided image." } + }, + "required": [ + "text" ], - "title": "ColorPaletteWithPresetNameOrMembers" + "title": "GeneratedDescription" }, - "ColorPaletteWithPresetName": { - "example": { - "name": "PASTEL" - }, + "DescribeImageIdeogramV3Response": { + "type": "object", "properties": { - "name": { - "$ref": "#/components/schemas/ColorPalettePresetName" + "description_id": { + "type": "string", + "description": "URL-safe base64 ID of the description that was created." + }, + "created": { + "type": "string", + "format": "date-time", + "description": "The time the request was created." + }, + "descriptions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GeneratedDescription" + }, + "description": "The generated description(s) for the provided image." } }, "required": [ - "name" + "description_id", + "created", + "descriptions" ], - "title": "ColorPaletteWithPresetName", - "type": "object" + "description": "Response returned by `POST /v2/image/describe/ideogram-3`.", + "title": "DescribeImageIdeogramV3Response" }, - "ColorPalettePresetName": { - "description": "A color palette preset value.", + "DetectedTextBlockAlignment": { + "type": "string", "enum": [ - "EMBER", - "FRESH", - "JUNGLE", - "MAGIC", - "MELON", - "MOSAIC", - "PASTEL", - "ULTRAMARINE" - ], - "example": "PASTEL", - "title": "ColorPalettePresetName", - "type": "string" + "left", + "center", + "right" + ], + "description": "Detected text alignment.", + "title": "DetectedTextBlockAlignment" }, - "ColorPaletteWithMembers": { - "description": "A color palette represented only via its members. Cannot be used in conjunction with preset name.", + "DetectedTextBlockFormattingItems": { + "type": "string", + "enum": [ + "bold", + "italic", + "underline", + "strikethrough", + "all_caps", + "small_caps", + "superscript", + "subscript" + ], + "title": "DetectedTextBlockFormattingItems" + }, + "DetectedTextBlockRole": { + "type": "string", + "enum": [ + "heading", + "subheading", + "body", + "caption" + ], + "description": "Inferred typographic role of this text block.", + "title": "DetectedTextBlockRole" + }, + "DetectedTextBlock": { + "type": "object", "properties": { - "members": { - "description": "A list of ColorPaletteMembers that define the color palette. Each color palette member\nconsists of a required color hex and an optional weight between 0.05 and 1.0 (inclusive).\nIt is recommended that these weights descend from highest to lowest for the color hexes provided.\n", - "example": [ - { - "ColorPaletteMember": { - "color_hex": "#b470b3", - "color_weight": 0.49 - } - }, - { - "ColorPaletteMember": { - "color_hex": "#7a79e3", - "color_weight": 0.16 - } - }, - { - "ColorPaletteMember": { - "color_hex": "#a26563", - "color_weight": 0.1 - } - }, + "x": { + "type": "integer", + "description": "X coordinate in pixels from the top-left corner." + }, + "y": { + "type": "integer", + "description": "Y coordinate in pixels from the top-left corner." + }, + "width": { + "type": "integer", + "description": "Width of the text region in pixels." + }, + "height": { + "type": "integer", + "description": "Height of the text region in pixels." + }, + "text": { + "type": "string", + "description": "The detected text content. Line breaks are represented as \\n." + }, + "alignment": { + "$ref": "#/components/schemas/DetectedTextBlockAlignment", + "description": "Detected text alignment." + }, + "angle": { + "type": "string", + "title": "float", + "description": "Rotation angle in degrees (clockwise). Defaults to 0.", + "default": 0 + }, + "font_name": { + "type": [ + "string", + "null" + ], + "description": "Best-matching font name from the font library." + }, + "font_alternatives": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + }, + "description": "Alternative font matches, ranked by similarity." + }, + "font_size": { + "type": [ + "integer", + "null" + ], + "description": "Detected font size in points." + }, + "line_height": { + "type": [ + "string", + "null" + ], + "title": "float", + "description": "Line height multiplier (e.g., 1.2)." + }, + "color": { + "type": [ + "string", + "null" + ], + "pattern": "^#[0-9A-Fa-f]{6}$", + "description": "Detected text color in hex format." + }, + "formatting": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DetectedTextBlockFormattingItems" + }, + "description": "Detected text formatting effects." + }, + "role": { + "oneOf": [ { - "ColorPaletteMember": { - "color_hex": "#5c7d76", - "color_weight": 0.07 - } + "$ref": "#/components/schemas/DetectedTextBlockRole" }, { - "ColorPaletteMember": { - "color_hex": "#642a9c", - "color_weight": 0.05 - } + "type": "null" } ], + "description": "Inferred typographic role of this text block." + } + }, + "required": [ + "x", + "y", + "width", + "height", + "text", + "alignment", + "formatting" + ], + "description": "A single detected text region with its position, content, font information, and styling.", + "title": "DetectedTextBlock" + }, + "LayerizedImageObject": { + "type": "object", + "properties": { + "url": { + "type": [ + "string", + "null" + ], + "format": "uri", + "description": "The direct link to the design image with its text intact. Empty when the image did not pass safety checks." + }, + "base_image_url": { + "type": [ + "string", + "null" + ], + "format": "uri", + "description": "The direct link to the base image with all detected text removed. Empty when the image did not pass safety checks." + }, + "resolution": { + "type": "string", + "description": "The resolution of the design, formatted as \"WIDTHxHEIGHT\"." + }, + "is_image_safe": { + "type": "boolean", + "description": "Whether the image passed safety checks. If false, the image links are empty." + }, + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." + }, + "text_blocks": { + "type": "array", "items": { - "$ref": "#/components/schemas/ColorPaletteMember" + "$ref": "#/components/schemas/DetectedTextBlock" }, - "maxItems": 8, - "minItems": 1, - "title": "ColorPaletteMembers", + "description": "Flat list of detected text regions in the design." + } + }, + "required": [ + "resolution", + "is_image_safe", + "seed", + "text_blocks" + ], + "description": "One layerized design. Image links are available for a limited period\nof time; if you would like to keep an image, you must download it.\n", + "title": "LayerizedImageObject" + }, + "LayerizeDesignIdeogramV3Response": { + "type": "object", + "properties": { + "generation_id": { + "type": "string", + "description": "URL-safe base64 ID of the generation. Use it to poll\n`GET /v2/generations/{generation_id}`.\n" + }, + "data": { "type": "array", - "x-tool-description": "Palette colors; prefer descending weight order." + "items": { + "$ref": "#/components/schemas/LayerizedImageObject" + }, + "description": "The layerized design. Present only for synchronous requests (`async` omitted or false)." + }, + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." } }, "required": [ - "members" + "generation_id", + "seed" + ], + "description": "Response returned by `POST /v2/design/layerize/ideogram-3`.\nSynchronous requests (the default) include the layerized design in\n`data`. Asynchronous requests omit `data`; poll\n`GET /v2/generations/{generation_id}` with the returned\n`generation_id`. `seed` is the seed that was used, including when you\ndid not set one.\n", + "title": "LayerizeDesignIdeogramV3Response" + }, + "KlingV3ShotType": { + "type": "string", + "enum": [ + "customize", + "intelligent" ], - "title": "ColorPaletteWithMembers", + "default": "customize", + "description": "How the prompt is staged. `customize` follows the prompt as written;\n`intelligent` lets the model break the prompt into its own shots.\n", + "title": "KlingV3ShotType" + }, + "GenerateVideoKlingV3Response": { "type": "object", - "x-tool-description": "Palette members; cannot combine with a preset name." + "properties": { + "generation_id": { + "type": "string", + "description": "The generation ID to poll with `GET /v2/generations/{generation_id}`.\n" + }, + "created": { + "type": "string", + "format": "date-time", + "description": "The time the request was accepted." + } + }, + "required": [ + "generation_id", + "created" + ], + "description": "Acknowledgement that the request was accepted. The generated video is not\npart of this response: poll `GET /v2/generations/{generation_id}` with\nthe returned `generation_id`, or receive it at your `webhook_url`.\nVideo links expire after a limited time, so download any video you\nwant to keep.\n", + "title": "GenerateVideoKlingV3Response" }, - "ColorPaletteMembers": { - "description": "A list of ColorPaletteMembers that define the color palette. Each color palette member\nconsists of a required color hex and an optional weight between 0.05 and 1.0 (inclusive).\nIt is recommended that these weights descend from highest to lowest for the color hexes provided.\n", - "example": [ - { - "ColorPaletteMember": { - "color_hex": "#b470b3", - "color_weight": 0.49 - } + "KlingV3AspectRatio": { + "type": "string", + "enum": [ + "16x9", + "9x16", + "1x1" + ], + "default": "16x9", + "description": "The aspect ratio of the generated video.", + "title": "KlingV3AspectRatio" + }, + "GenerateVideoKlingV3StandardTextToVideoRequest": { + "type": "object", + "properties": { + "prompt": { + "type": "string", + "minLength": 1, + "maxLength": 2000, + "description": "A natural-language prompt describing the video to generate." }, - { - "ColorPaletteMember": { - "color_hex": "#7a79e3", - "color_weight": 0.16 - } + "negative_prompt": { + "type": "string", + "maxLength": 2000, + "description": "Description of what to keep out of the video. Descriptions in the prompt take precedence over descriptions in the negative prompt." }, - { - "ColorPaletteMember": { - "color_hex": "#a26563", - "color_weight": 0.1 - } + "aspect_ratio": { + "$ref": "#/components/schemas/KlingV3AspectRatio", + "default": "16x9" }, - { - "ColorPaletteMember": { - "color_hex": "#5c7d76", - "color_weight": 0.07 - } + "duration": { + "type": "integer", + "minimum": 3, + "maximum": 15, + "description": "The length of the generated video in seconds. Defaults to 5 seconds\nwhen omitted.\n" }, - { - "ColorPaletteMember": { - "color_hex": "#642a9c", - "color_weight": 0.05 - } + "generate_audio": { + "type": "boolean", + "default": false, + "description": "Whether to generate an audio track for the video. Audio roughly\ndoubles the provider cost and is subject to stricter output moderation.\n" + }, + "shot_type": { + "$ref": "#/components/schemas/KlingV3ShotType", + "default": "customize" + }, + "cfg_scale": { + "type": "string", + "title": "float", + "description": "How closely the video follows the prompt, from 0 to 1. Lower values\nleave the model more freedom. Defaults to 0.5 when omitted.\n" + }, + "webhook_url": { + "type": "string", + "format": "uri", + "maxLength": 2048, + "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n" } - ], - "items": { - "$ref": "#/components/schemas/ColorPaletteMember" }, - "maxItems": 8, - "minItems": 1, - "title": "ColorPaletteMembers", - "type": "array", - "x-tool-description": "Palette colors; prefer descending weight order." + "required": [ + "prompt" + ], + "description": "Request body for Kling v3 Standard text-to-video generation.", + "title": "GenerateVideoKlingV3StandardTextToVideoRequest" }, - "ColorPaletteMember": { - "description": "A member of a color palette.", + "MinimaxH3Resolution": { + "type": "string", + "enum": [ + "480P", + "768P", + "2K", + "4K" + ], + "default": "2K", + "description": "The resolution tier of the generated video, spelled the way MiniMax\nspells it. `480P` and `768P` are generated natively; `2K` and `4K` are\nupscaled from a `768P` result.\nHigher tiers cost more.\n", + "title": "MinimaxH3Resolution" + }, + "GenerateVideoMinimaxH3Response": { + "type": "object", "properties": { - "color_hex": { - "description": "The hexadecimal representation of the color with an optional chosen weight.", - "example": "#FFFFFF", - "pattern": "^#(?:[0-9a-fA-F]{3}){1,2}$", - "title": "color_hex", + "generation_id": { "type": "string", - "x-tool-description": "Hex color." + "description": "URL-safe base64 ID of the accepted generation. Accepted by the\n`GET /v2/generations/{generation_id}` polling endpoint.\n" }, - "color_weight": { - "description": "The weight of the color in the color palette.", - "example": 0.25, - "maximum": 1.0, - "minimum": 0.05, - "title": "color_weight", - "type": "number", - "x-tool-description": "Color weight." + "created": { + "type": "string", + "format": "date-time", + "description": "The time the request was accepted." } }, "required": [ - "color_hex" + "generation_id", + "created" ], - "title": "ColorPaletteMember", - "type": "object" - }, - "StyleCodes": { - "description": "A list of 8-character hexadecimal codes representing the style of the image. Refer to each endpoint for supported combinations with style types, presets, and reference images.", - "example": [ - "AAFF5733", - "0133FF57", - "DE3357FF" - ], - "items": { - "$ref": "#/components/schemas/StyleCode" - }, - "type": "array", - "x-tool-description": "8-character hex style codes. Allowed combinations with other style controls depend on the operation." + "description": "Acknowledgement that the video request was accepted. The video is not\nincluded in this response: poll `GET /v2/generations/{generation_id}`\nwith the returned `generation_id`, or receive it at the `webhook_url`\nyou supplied. Video links expire after a limited time, so download any\nvideo you want to keep.\n", + "title": "GenerateVideoMinimaxH3Response" }, - "StyleCode": { - "description": "The 8 character hexadecimal representation of the style code.", - "example": "ABCD1234", - "pattern": "^[0-9a-fA-F]{8}$", + "MinimaxH3AspectRatio": { "type": "string", - "x-tool-description": "8-character hex style code." - }, - "StyleTypeV3": { - "default": "GENERAL", - "description": "The style type to generate with.", "enum": [ - "AUTO", - "GENERAL", - "REALISTIC", - "DESIGN", - "CUSTOM", - "FICTION", - "STYLIZED" - ], - "example": "GENERAL", - "title": "StyleTypeV3", - "type": "string", - "x-tool-description": "The style type to generate with. With a style reference, saved style or style_preset, use auto; any type other than auto or general is rejected." + "21x9", + "16x9", + "4x3", + "1x1", + "3x4", + "9x16" + ], + "default": "16x9", + "description": "The aspect ratio of the generated video.", + "title": "MinimaxH3AspectRatio" }, - "StylePresetV3": { - "description": "A predefined style preset that applies a specific artistic style to the generated image.", - "enum": [ - "80S_ILLUSTRATION", - "90S_NOSTALGIA", - "ABSTRACT_ORGANIC", - "ANALOG_NOSTALGIA", - "ART_BRUT", - "ART_DECO", - "ART_POSTER", - "AURA", - "AVANT_GARDE", - "BAUHAUS", - "BLUEPRINT", - "BLURRY_MOTION", - "BRIGHT_ART", - "C4D_CARTOON", - "CHILDRENS_BOOK", - "COLLAGE", - "COLORING_BOOK_I", - "COLORING_BOOK_II", - "CUBISM", - "DARK_AURA", - "DOODLE", - "DOUBLE_EXPOSURE", - "DRAMATIC_CINEMA", - "EDITORIAL", - "EMOTIONAL_MINIMAL", - "ETHEREAL_PARTY", - "EXPIRED_FILM", - "FLAT_ART", - "FLAT_VECTOR", - "FOREST_REVERIE", - "GEO_MINIMALIST", - "GLASS_PRISM", - "GOLDEN_HOUR", - "GRAFFITI_I", - "GRAFFITI_II", - "HALFTONE_PRINT", - "HIGH_CONTRAST", - "HIPPIE_ERA", - "ICONIC", - "JAPANDI_FUSION", - "JAZZY", - "LONG_EXPOSURE", - "MAGAZINE_EDITORIAL", - "MINIMAL_ILLUSTRATION", - "MIXED_MEDIA", - "MONOCHROME", - "NIGHTLIFE", - "OIL_PAINTING", - "OLD_CARTOONS", - "PAINT_GESTURE", - "POP_ART", - "RETRO_ETCHING", - "RIVIERA_POP", - "SPOTLIGHT_80S", - "STYLIZED_RED", - "SURREAL_COLLAGE", - "TRAVEL_POSTER", - "VINTAGE_GEO", - "VINTAGE_POSTER", - "WATERCOLOR", - "WEIRD", - "WOODBLOCK_PRINT" - ], - "example": "BRIGHT_ART", - "title": "StylePresetV3", + "MinimaxH3PromptExpansionMode": { "type": "string", - "x-tool-description": "Artistic style preset." - }, - "UpscaleFactor": { - "default": "X1", - "description": "Upscale the initially generated image by the given factor. Upscale factors other than X1 will incur additional cost.", "enum": [ - "X1", - "X2", - "X4" + "disabled", + "fast", + "balanced", + "quality" ], - "example": "X2", - "title": "UpscaleFactor", - "type": "string" + "default": "balanced", + "description": "How much the model may rewrite the prompt before generating. `disabled`\nuses the prompt as written; the other modes trade latency for a richer\nrewrite.\n", + "title": "MinimaxH3PromptExpansionMode" }, - "Resolution": { - "description": "(For model_version for 2.0 only, cannot be used in conjunction with aspect_ratio) The resolution to use for image generation, represented in width x height. If not specified, defaults to using aspect_ratio.", - "enum": [ - "RESOLUTION_512_1536", - "RESOLUTION_576_1408", - "RESOLUTION_576_1472", - "RESOLUTION_576_1536", - "RESOLUTION_640_1024", - "RESOLUTION_640_1344", - "RESOLUTION_640_1408", - "RESOLUTION_640_1472", - "RESOLUTION_640_1536", - "RESOLUTION_704_1152", - "RESOLUTION_704_1216", - "RESOLUTION_704_1280", - "RESOLUTION_704_1344", - "RESOLUTION_704_1408", - "RESOLUTION_704_1472", - "RESOLUTION_720_1280", - "RESOLUTION_736_1312", - "RESOLUTION_768_1024", - "RESOLUTION_768_1088", - "RESOLUTION_768_1152", - "RESOLUTION_768_1216", - "RESOLUTION_768_1232", - "RESOLUTION_768_1280", - "RESOLUTION_768_1344", - "RESOLUTION_832_960", - "RESOLUTION_832_1024", - "RESOLUTION_832_1088", - "RESOLUTION_832_1152", - "RESOLUTION_832_1216", - "RESOLUTION_832_1248", - "RESOLUTION_864_1152", - "RESOLUTION_896_960", - "RESOLUTION_896_1024", - "RESOLUTION_896_1088", - "RESOLUTION_896_1120", - "RESOLUTION_896_1152", - "RESOLUTION_960_832", - "RESOLUTION_960_896", - "RESOLUTION_960_1024", - "RESOLUTION_960_1088", - "RESOLUTION_1024_640", - "RESOLUTION_1024_768", - "RESOLUTION_1024_832", - "RESOLUTION_1024_896", - "RESOLUTION_1024_960", - "RESOLUTION_1024_1024", - "RESOLUTION_1088_768", - "RESOLUTION_1088_832", - "RESOLUTION_1088_896", - "RESOLUTION_1088_960", - "RESOLUTION_1120_896", - "RESOLUTION_1152_704", - "RESOLUTION_1152_768", - "RESOLUTION_1152_832", - "RESOLUTION_1152_864", - "RESOLUTION_1152_896", - "RESOLUTION_1216_704", - "RESOLUTION_1216_768", - "RESOLUTION_1216_832", - "RESOLUTION_1232_768", - "RESOLUTION_1248_832", - "RESOLUTION_1280_704", - "RESOLUTION_1280_720", - "RESOLUTION_1280_768", - "RESOLUTION_1280_800", - "RESOLUTION_1312_736", - "RESOLUTION_1344_640", - "RESOLUTION_1344_704", - "RESOLUTION_1344_768", - "RESOLUTION_1408_576", - "RESOLUTION_1408_640", - "RESOLUTION_1408_704", - "RESOLUTION_1472_576", - "RESOLUTION_1472_640", - "RESOLUTION_1472_704", - "RESOLUTION_1536_512", - "RESOLUTION_1536_576", - "RESOLUTION_1536_640" - ], - "example": "RESOLUTION_1024_1024", - "title": "Resolution", - "type": "string" + "GenerateVideoMinimaxH3TextToVideoRequest": { + "type": "object", + "properties": { + "prompt": { + "type": "string", + "minLength": 1, + "maxLength": 2000, + "description": "A natural-language prompt describing the video to generate." + }, + "aspect_ratio": { + "$ref": "#/components/schemas/MinimaxH3AspectRatio", + "default": "16x9" + }, + "resolution": { + "$ref": "#/components/schemas/MinimaxH3Resolution", + "default": "2K" + }, + "duration": { + "type": "integer", + "minimum": 5, + "maximum": 15, + "default": 5, + "description": "The length of the generated video in seconds." + }, + "webhook_url": { + "type": "string", + "format": "uri", + "maxLength": 2048, + "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n" + } + }, + "required": [ + "prompt" + ], + "description": "Request body for MiniMax H3 text-to-video generation.", + "title": "GenerateVideoMinimaxH3TextToVideoRequest" }, - "AspectRatio": { - "description": "(Cannot be used in conjunction with resolution) The aspect ratio to use for image generation, which determines the image's resolution. Defaults to ASPECT_1_1.", + "SeedDance25Resolution": { + "type": "string", "enum": [ - "ASPECT_10_16", - "ASPECT_16_10", - "ASPECT_9_16", - "ASPECT_16_9", - "ASPECT_3_2", - "ASPECT_2_3", - "ASPECT_4_3", - "ASPECT_3_4", - "ASPECT_1_1", - "ASPECT_1_3", - "ASPECT_3_1" - ], - "example": "ASPECT_10_16", - "externalDocs": { - "url": "https://docs.ideogram.ai/usage/advanced-prompting/aspect-ratios" + "480p", + "720p", + "1080p" + ], + "default": "720p", + "description": "The resolution tier of the generated video.", + "title": "SeedDance25Resolution" + }, + "GenerateVideoSeedDance25Response": { + "type": "object", + "properties": { + "generation_id": { + "type": "string", + "description": "The generation ID to poll with `GET /v2/generations/{generation_id}`.\n" + }, + "created": { + "type": "string", + "format": "date-time", + "description": "The time the request was accepted." + } }, - "title": "AspectRatio", - "type": "string" + "required": [ + "generation_id", + "created" + ], + "description": "Acknowledgement that the request was accepted. The generated video is not\npart of this response: poll `GET /v2/generations/{generation_id}` with\nthe returned `generation_id`, or receive it at your `webhook_url`.\nVideo links expire after a limited time, so download any video you\nwant to keep.\n", + "title": "GenerateVideoSeedDance25Response" }, - "MagicPromptVersionEnum": { - "description": "The magic prompt version to use when magic prompt option is set to AUTO or ON.", + "SeedDance2AspectRatio": { + "type": "string", "enum": [ - "V_0", - "V_0_1", - "V_0_2", - "V_0_3", - "V_0_4", - "V_0_5", - "V_0_6", - "V_0_7", - "V_0_8", - "V4_QWEN_3_5_27B", - "V4_QWEN_3_5_27B_PREFUSED", - "V4_QWEN_3_5_27B_FULL_FINETUNE", - "V4_QWEN_3_5_27B_FULL_FINETUNE_LORA", - "V4_QWEN_3_5_27B_EXPERIMENTAL", - "V4_QWEN_3_5_27B_EXPERIMENTAL_Q36_2P5K", - "V4_QWEN_3_5_27B_EXPERIMENTAL_NONNAS_2P5K", - "V4_QWEN_3_5_27B_EXPERIMENTAL_NONNAS_5K", - "V4_QWEN_3_5_27B_EXPERIMENTAL_ALTCAP_BAL_9K", - "V4_QWEN_3_5_27B_EXPERIMENTAL_ALTCAP_BAL_10K", - "V4_QWEN_3_5_27B_SGLANG_EXPERIMENTAL_Q36_2P5K", - "V4_QWEN_3_5_27B_SGLANG_EXPERIMENTAL_Q36_2P5K_TP2", - "V4_QWEN_3_5_27B_PRUNA_FP8", - "V4_QWEN_3_5_27B_EXPERIMENTAL_SLOT_01", - "V4_QWEN_3_5_27B_EXPERIMENTAL_SLOT_02", - "V4_QWEN_3_5_27B_EXPERIMENTAL_SLOT_03", - "V4_QWEN_3_5_27B_EXPERIMENTAL_SLOT_04", - "V4_QWEN_3_5_27B_EXPERIMENTAL_SLOT_05", - "V4_QWEN_3_5_27B_EXPERIMENTAL_SLOT_06", - "V4_QWEN_3_5_27B_EXPERIMENTAL_SLOT_07", - "V4_QWEN_3_5_27B_EXPERIMENTAL_SLOT_08", - "V4_QWEN_3_5_27B_EXPERIMENTAL_SLOT_09", - "V4_QWEN_3_5_27B_EXPERIMENTAL_SLOT_10" - ], - "example": "V_0", - "title": "MagicPromptVersionEnum", - "type": "string" - }, - "FreeformResolution": { - "description": "Output resolution, only used if operations alters image dimensions, such as upscale, crop etc.", - "example": "4096x4096", - "pattern": "^\\d{2,5}x\\d{2,5}$", - "title": "FreeformResolution", - "type": "string" + "auto", + "21x9", + "16x9", + "4x3", + "1x1", + "3x4", + "9x16" + ], + "default": "auto", + "description": "The aspect ratio of the generated video. `auto` lets the model choose the\nmost suitable ratio from the prompt; any other value pins the ratio.\n", + "title": "SeedDance2AspectRatio" }, - "SvgGenerationObject": { + "GenerateVideoSeedDance25TextToVideoRequest": { + "type": "object", "properties": { - "object_type": { - "enum": [ - "svg.generation" - ], - "title": "object_type", - "type": "string" + "prompt": { + "type": "string", + "minLength": 1, + "maxLength": 2000, + "description": "A natural-language prompt describing the video to generate." }, - "asset_id": { - "description": "URL-safe base64 SVG asset ID.", - "title": "asset_id", - "type": "string" + "aspect_ratio": { + "$ref": "#/components/schemas/SeedDance2AspectRatio", + "default": "auto" }, - "url": { - "description": "Signed download URL for the original SVG.", - "format": "uri", - "title": "url", - "type": "string" + "resolution": { + "$ref": "#/components/schemas/SeedDance25Resolution", + "default": "720p" }, - "mime_type": { - "enum": [ - "image/svg+xml" - ], - "title": "mime_type", - "type": "string" + "duration": { + "type": "integer", + "minimum": 4, + "maximum": 30, + "description": "The length of the generated video in seconds. When omitted, the model\npicks the best duration for the prompt (\"auto\").\n" }, - "width": { - "description": "Width of the output SVG canvas in pixels.", - "minimum": 1, - "title": "width", - "type": "integer" + "generate_audio": { + "type": "boolean", + "default": false, + "description": "Whether to generate an audio track for the video. Audio roughly\ndoubles the provider cost and is subject to stricter output moderation.\n" }, - "height": { - "description": "Height of the output SVG canvas in pixels.", - "minimum": 1, - "title": "height", - "type": "integer" + "webhook_url": { + "type": "string", + "format": "uri", + "maxLength": 2048, + "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n" } }, "required": [ - "asset_id", - "height", - "mime_type", - "object_type", - "url", - "width" + "prompt" + ], + "description": "Request body for Seedance 2.5 text-to-video generation.", + "title": "GenerateVideoSeedDance25TextToVideoRequest" + }, + "SeedDance2Resolution": { + "type": "string", + "enum": [ + "480p", + "720p" ], - "title": "SvgGenerationObject", - "type": "object" + "default": "720p", + "description": "The resolution tier of the generated video.", + "title": "SeedDance2Resolution" }, - "VideoObject": { - "description": "A single generated video returned by the generation polling endpoint.", + "GenerateVideoSeedDance2Response": { + "type": "object", "properties": { - "asset_id": { - "description": "The generated video's asset ID. Use it with asset_type RESPONSE in video_asset_identifier for a follow-up video edit. This is distinct from the generation ID used for polling.", - "title": "asset_id", - "type": "string" - }, - "object_type": { - "description": "Discriminator marking this entry as a generated video in the polling endpoint's mixed data array.", - "enum": [ - "video.generation" - ], - "title": "object_type", - "type": "string" - }, - "url": { - "description": "The direct link to the generated video.", - "example": "https://ideogram.ai/assets/video/lossless/response/xtdZiqPwRxqY1Y7NExFmzB.mp4?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89", - "format": "uri", - "nullable": true, - "title": "url", - "type": "string" - }, - "prompt": { - "description": "The prompt used for the generation.", - "title": "prompt", - "type": "string" - }, - "resolution": { - "description": "The resolution tier of the generated video.", - "example": "720p", - "title": "resolution", - "type": "string" - }, - "aspect_ratio": { - "description": "The actual aspect ratio of the produced video, formatted as \"{width}:{height}\".", - "example": "16:9", - "title": "aspect_ratio", - "type": "string" + "generation_id": { + "type": "string", + "description": "The generation ID to poll with `GET /v2/generations/{generation_id}`.\n" }, - "duration": { - "description": "The actual measured length of the produced video in seconds.", - "example": 5, - "title": "duration", - "type": "integer" + "created": { + "type": "string", + "format": "date-time", + "description": "The time the request was accepted." } }, "required": [ - "aspect_ratio", - "duration", - "prompt", - "resolution" + "generation_id", + "created" ], - "title": "VideoObject", - "type": "object" + "description": "Acknowledgement that the request was accepted. The generated video is not\npart of this response: poll `GET /v2/generations/{generation_id}` with\nthe returned `generation_id`, or receive it at your `webhook_url`.\nVideo links expire after a limited time, so download any video you\nwant to keep.\n", + "title": "GenerateVideoSeedDance2Response" }, - "TextLayerizerResultObject": { - "description": "One layerized design. Links are available for a limited period of time;\nif you would like to keep a file, you must download it.\n", + "GenerateVideoSeedDance2TextToVideoRequest": { + "type": "object", "properties": { - "object_type": { - "enum": [ - "layerized_design.generation" - ], - "title": "object_type", - "type": "string" - }, - "url": { - "description": "Signed link to the design image with its text intact. Empty when the image did not pass safety checks.", - "format": "uri", - "nullable": true, - "title": "url", - "type": "string" + "prompt": { + "type": "string", + "minLength": 1, + "maxLength": 2000, + "description": "A natural-language prompt describing the video to generate." }, - "base_image_url": { - "description": "Signed link to the base image with all detected text removed. Empty when the image did not pass safety checks.", - "format": "uri", - "nullable": true, - "title": "base_image_url", - "type": "string" + "aspect_ratio": { + "$ref": "#/components/schemas/SeedDance2AspectRatio", + "default": "auto" }, "resolution": { - "description": "The resolution of the design, formatted as \"WIDTHxHEIGHT\".", - "example": "1024x1024", - "title": "resolution", - "type": "string" - }, - "is_image_safe": { - "description": "Whether the image passed safety checks. If false, the links are empty.", - "title": "is_image_safe", - "type": "boolean" + "$ref": "#/components/schemas/SeedDance2Resolution", + "default": "720p" }, - "seed": { - "description": "Random seed. Set for reproducible generation.", - "example": 12345, - "maximum": 2147483647, - "minimum": 0, - "title": "Seed", + "duration": { "type": "integer", - "x-tool-description": "Set for reproducible generation." + "minimum": 4, + "maximum": 15, + "description": "The length of the generated video in seconds. When omitted, the model\npicks the best duration for the prompt (\"auto\").\n" }, - "text_blocks": { - "description": "Flat list of detected text regions in the design.", - "items": { - "$ref": "#/components/schemas/LayerizedTextBlock" - }, - "title": "text_blocks", - "type": "array" + "generate_audio": { + "type": "boolean", + "default": false, + "description": "Whether to generate an audio track for the video. Audio roughly\ndoubles the provider cost and is subject to stricter output moderation.\n" }, - "html_url": { - "description": "Signed link to a self-contained HTML page displaying the editable\ndesign, including curved text, gradients, outlines, and shadows. The\nrenderer, images, and fonts are embedded in the page, so it keeps\nworking offline once downloaded; the link itself expires after 24\nhours. Uploaded `font_candidate_files` are embedded as supplied, so\nredistributing the page is subject to those fonts' licenses. Empty\nwhen the image did not pass safety checks or the page could not be\nbuilt.\n\nThe page exposes one editing API for every text layer, whether it\nis drawn as HTML or on a canvas. Each layer is addressed by its\n`text_blocks[].layer_id`. Scripts in the page can call\n`window.layerize` (`ready`, `getTextLayers()`, `setText(id, text)`,\n`update(id, patch)`, `toJSON()`, `toPNG()`); a parent page that\nembeds it in an iframe sends `postMessage` requests such as\n`{\"type\": \"layerize:set-text\", \"id\": \"text-0\", \"text\": \"Hello\"}`\nand receives `layerize:ready`, `layerize:updated`, and\n`layerize:error` replies. The page is served sandboxed with an\nopaque origin, so it cannot read cookies or storage of the site\nthat embeds it.\n", + "webhook_url": { + "type": "string", "format": "uri", - "nullable": true, - "title": "html_url", - "type": "string" + "maxLength": 2048, + "description": "HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a\nJSON POST to this URL once all images for the request have finished\ngenerating. The body mirrors the synchronous generate response:\n`request_id`, `created`, and a `data` array\ncontaining every generated image (`url`, `prompt`, `resolution`, `seed`,\n`is_image_safe`). Each delivery is signed with Ed25519 and verifiable\nagainst the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS;\nprivate and loopback hosts and the cloud metadata service are rejected.\n" } }, "required": [ - "is_image_safe", - "object_type", - "resolution", - "seed", - "text_blocks" + "prompt" + ], + "description": "Request body for Seedance 2.0 text-to-video generation.", + "title": "GenerateVideoSeedDance2TextToVideoRequest" + }, + "V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage": { + "type": "string", + "enum": [ + "ar", + "cs", + "da", + "de", + "en", + "es", + "fi", + "fr", + "fr-ca", + "hu", + "it", + "ja", + "nl", + "no", + "pl", + "pt", + "sv" + ], + "description": "The target language for the copy. Arabic is rendered right-to-left. Each request covers one language; send one request per language.", + "title": "V2ToolAdLocalizerPostRequestBodyContentMultipartFormDataSchemaLanguage" + }, + "AdLocalizerQuality": { + "type": "string", + "enum": [ + "low", + "medium", + "high" + ], + "description": "The quality tier for the edit. Higher tiers may improve detail and\ntake longer to complete.\n", + "title": "AdLocalizerQuality" + }, + "AdLocalizerResponse": { + "type": "object", + "properties": { + "generation_id": { + "type": "string", + "description": "URL-safe base64 ID accepted by the generation polling endpoint." + } + }, + "required": [ + "generation_id" + ], + "description": "Acknowledgement that the ad localization was accepted. Poll\n`GET /v2/generations/{generation_id}` for status and results.\n", + "title": "AdLocalizerResponse" + }, + "V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution": { + "type": "string", + "enum": [ + "300x250", + "336x280", + "300x600", + "1080x1080", + "1080x1350", + "1080x1920", + "1920x1080", + "728x90", + "160x600", + "970x250", + "320x50", + "300x50", + "320x100", + "1800x900", + "2400x2400", + "1200x3500", + "2880x2880", + "2560x3200", + "3200x2560", + "2448x3264", + "3264x2448", + "2336x3504", + "3504x2336", + "2240x3584", + "3584x2240", + "2160x3840", + "3840x2160", + "1920x3840", + "3840x1920", + "1280x3840", + "3840x1280" + ], + "description": "Target ad resolution, formatted as `WIDTHxHEIGHT`. Any value not in\nthe list is rejected with a 400. Each output image has exactly these\npixel dimensions, with or without a `platform`.\n", + "title": "V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaResolution" + }, + "V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaPlatform": { + "type": "string", + "enum": [ + "google", + "meta", + "meta_reels", + "meta_stories", + "snapchat", + "tiktok" + ], + "description": "The ad platform whose published safe zone the ad must stay inside.\nThe ad is generated inside the largest rectangle that fits the\nplatform's safe zone for the requested aspect ratio, and the space\naround it is filled in so the output is still exactly the requested\n`resolution`. `google` covers YouTube and Google Ads placements.\nUse `meta_stories` or `meta_reels` for Meta placements; Reels uses\nthe largest rectangle inside its notched safe zone. The legacy\n`meta` value is still supported and uses a more conservative safe\nzone. When omitted, the ad fills the whole frame and every\nsupported `resolution` is accepted. Any other value is rejected\nwith a 400.\n\nEach platform accepts only the resolutions for which it publishes a\nsafe zone; any other `resolution` is rejected with a 400:\n\n| Platform | Accepted resolutions |\n| --- | --- |\n| `google` | `1920x1080`, `3840x2160`, `1080x1080`, `2400x2400`, `2880x2880`, `1080x1920`, `2160x3840` |\n| `tiktok` | `1920x1080`, `3840x2160`, `1080x1080`, `2400x2400`, `2880x2880`, `1080x1920`, `2160x3840` |\n| `meta_stories` | `1080x1920`, `2160x3840` |\n| `meta_reels` | `1080x1920`, `2160x3840` |\n| `meta` (legacy) | `1080x1920`, `2160x3840` |\n| `snapchat` | `1080x1920`, `2160x3840` |\n", + "title": "V2ToolAdResizerPostRequestBodyContentMultipartFormDataSchemaPlatform" + }, + "AdResizerQuality": { + "type": "string", + "enum": [ + "low", + "medium", + "high" ], - "title": "TextLayerizerResultObject", - "type": "object" + "description": "The quality tier for the reframe. Higher tiers may improve detail and\ntake longer to complete.\n", + "title": "AdResizerQuality" }, - "LayeredAssetTextShadow": { - "description": "Single CSS shadow for V4 vector text. Used by text_shadows and box_shadow. offset_x, offset_y, and blur are in px.", - "example": { - "color": "color", - "blur": 0.2027123, - "offset_x": 9.301444, - "offset_y": 3.6160767 - }, + "AdResizerResponse": { + "type": "object", "properties": { - "color": { - "description": "Shadow hex color. Accepts both 6-hex (#RRGGBB) and 8-hex\n(#RRGGBBAA) — the layered-design extractor emits alpha-included\ncolors for semi-transparent shadows, and stripping alpha would\nlose real visual information. Aligned with the other text-layer\ncolor fields (stroke/border/gradient) which already accept 6,8.\n", - "pattern": "^#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$", - "title": "color", - "type": "string" - }, - "offset_x": { - "default": 0, - "description": "Horizontal shadow offset in px.", - "format": "float", - "title": "offset_x", - "type": "number" - }, - "offset_y": { - "default": 0, - "description": "Vertical shadow offset in px.", - "format": "float", - "title": "offset_y", - "type": "number" - }, - "blur": { - "default": 0, - "description": "Shadow blur radius in px.", - "format": "float", - "minimum": 0, - "title": "blur", - "type": "number" + "generation_id": { + "type": "string", + "description": "URL-safe base64 ID accepted by the generation polling endpoint." } }, "required": [ - "color" + "generation_id" ], - "title": "LayeredAssetTextShadow", - "type": "object" + "description": "Acknowledgement that the ad resize was accepted. Poll\n`GET /v2/generations/{generation_id}` for status and results.\n", + "title": "AdResizerResponse" }, - "DetectedTextBlock": { - "description": "A single detected text region with its position, content, font information, and styling.", - "example": { - "role": "heading", - "color": "#212121", - "font_alternatives": [ - "font_alternatives", - "font_alternatives" - ], - "font_size": 2, - "font_name": "font_name", - "line_height": 7.0614014, - "x": 0, - "width": 1, - "y": 6, - "angle": 5.637377, - "text": "Hello World", - "alignment": "left", - "formatting": [ - "bold", - "bold" - ], - "height": 5 - }, + "V2ToolAdVariationsPostRequestBodyContentMultipartFormDataSchemaVariationType": { + "type": "string", + "enum": [ + "people", + "setting", + "group_size", + "scene" + ], + "description": "The axis to vary. `people`\nreplaces the people in the ad with different talent. `setting`\nmoves the same subject and product to a different environment.\n`group_size` changes how many people appear. `scene` shifts the\nmoment or occasion (time of day, season, or activity).\n", + "title": "V2ToolAdVariationsPostRequestBodyContentMultipartFormDataSchemaVariationType" + }, + "AdVariationsQuality": { + "type": "string", + "enum": [ + "low", + "medium", + "high" + ], + "description": "The quality tier for the edit. Higher tiers may improve detail and\ntake longer to complete.\n", + "title": "AdVariationsQuality" + }, + "AdVariationsResponse": { + "type": "object", "properties": { - "x": { - "description": "X coordinate in pixels from the top-left corner.", - "title": "x", - "type": "integer" - }, - "y": { - "description": "Y coordinate in pixels from the top-left corner.", - "title": "y", - "type": "integer" - }, - "width": { - "description": "Width of the text region in pixels.", - "title": "width", - "type": "integer" - }, - "height": { - "description": "Height of the text region in pixels.", - "title": "height", - "type": "integer" - }, - "text": { - "description": "The detected text content. Line breaks are represented as \\n.", - "example": "Hello World", - "title": "text", - "type": "string" - }, - "alignment": { - "description": "Detected text alignment.", - "enum": [ - "left", - "center", - "right" - ], - "title": "alignment", - "type": "string" - }, - "angle": { - "default": 0, - "description": "Rotation angle in degrees (clockwise). Defaults to 0.", - "format": "float", - "title": "angle", - "type": "number" - }, - "font_name": { - "description": "Best-matching font name from the font library.", - "nullable": true, - "title": "font_name", - "type": "string" - }, - "font_alternatives": { - "description": "Alternative font matches, ranked by similarity.", - "items": { - "type": "string" - }, - "nullable": true, - "title": "font_alternatives", - "type": "array" - }, - "font_size": { - "description": "Detected font size in points.", - "nullable": true, - "title": "font_size", - "type": "integer" - }, - "line_height": { - "description": "Line height multiplier (e.g., 1.2).", - "format": "float", - "nullable": true, - "title": "line_height", - "type": "number" - }, - "color": { - "description": "Detected text color in hex format.", - "example": "#212121", - "nullable": true, - "pattern": "^#[0-9A-Fa-f]{6}$", - "title": "color", - "type": "string" - }, - "formatting": { - "description": "Detected text formatting effects.", - "items": { - "enum": [ - "bold", - "italic", - "underline", - "strikethrough", - "all_caps", - "small_caps", - "superscript", - "subscript" - ], - "type": "string" - }, - "title": "formatting", - "type": "array" - }, - "role": { - "description": "Inferred typographic role of this text block.", - "enum": [ - "heading", - "subheading", - "body", - "caption" - ], - "nullable": true, - "title": "role", - "type": "string" + "generation_id": { + "type": "string", + "description": "URL-safe base64 ID accepted by the generation polling endpoint." } }, "required": [ - "alignment", - "formatting", - "height", - "text", - "width", - "x", - "y" + "generation_id" ], - "title": "DetectedTextBlock", - "type": "object" + "description": "Acknowledgement that the ad variation was accepted. Poll\n`GET /v2/generations/{generation_id}` for status and results.\n", + "title": "AdVariationsResponse" }, - "AssetIdentifier": { - "description": "An identifier for an ideogram asset.", - "example": { - "asset_type": "RESPONSE", - "asset_id": "7uS_VESkRI6O3-sVgHQp_A" - }, + "ColorwaysQuality": { + "type": "string", + "enum": [ + "low", + "medium", + "high" + ], + "description": "The quality tier for the edit. Higher tiers may improve detail and\ntake longer to complete.\n", + "title": "ColorwaysQuality" + }, + "ColorwaysResponse": { + "type": "object", "properties": { - "asset_type": { - "$ref": "#/components/schemas/AssetType" - }, - "asset_id": { - "type": "string" - }, - "collection_id": { - "description": "Optional collection from which this asset was selected as a generation reference. Records usage attribution; does not grant access to the asset.", - "maxLength": 22, - "minLength": 22, - "pattern": "^[A-Za-z0-9_-]{22}$", + "generation_id": { "type": "string", - "x-omit-if-null": true + "description": "URL-safe base64 ID accepted by the generation polling endpoint." } }, "required": [ - "asset_id", - "asset_type" + "generation_id" ], - "title": "AssetIdentifier", - "type": "object", - "x-tool-description": "Existing Ideogram asset." + "description": "Acknowledgement that the colorway was accepted. Poll\n`GET /v2/generations/{generation_id}` for status and results.\n", + "title": "ColorwaysResponse" }, "AssetType": { + "type": "string", "enum": [ "ASSET", "CANVAS_ASSET", @@ -39028,742 +15281,1061 @@ "RESPONSE", "UPLOAD" ], - "title": "AssetType", - "type": "string" + "title": "AssetType" }, - "AttributeInfo": { - "example": { - "creation_time": "2000-01-23T04:56:07+00:00", - "value_type": null, - "attribute_key": "attribute_key", - "value": "value" - }, + "AssetIdentifier": { + "type": "object", "properties": { - "attribute_key": { - "title": "attribute_key", - "type": "string" + "asset_type": { + "$ref": "#/components/schemas/AssetType" }, - "value": { - "description": "The stored value. NUMBER values are returned in canonical form.", - "title": "value", + "asset_id": { "type": "string" }, - "value_type": { - "$ref": "#/components/schemas/AttributeValueType" - }, - "creation_time": { - "format": "date-time", - "title": "creation_time", - "type": "string" + "collection_id": { + "type": "string", + "pattern": "^[A-Za-z0-9_-]{22}$", + "minLength": 22, + "maxLength": 22, + "description": "Optional collection from which this asset was selected as a generation reference. Records usage attribution; does not grant access to the asset." } }, "required": [ - "attribute_key", - "value", - "value_type" - ], - "title": "AttributeInfo", - "type": "object" - }, - "SeedDance2AspectRatio": { - "default": "auto", - "description": "The aspect ratio of the generated video. `auto` lets the model choose the\nmost suitable ratio from the prompt; any other value pins the ratio.\n", - "enum": [ - "auto", - "21x9", - "16x9", - "4x3", - "1x1", - "3x4", - "9x16" + "asset_type", + "asset_id" ], - "title": "SeedDance2AspectRatio", - "type": "string", - "x-tool-description": "Output ratio; auto lets the model choose from the prompt." + "description": "An identifier for an ideogram asset.", + "title": "AssetIdentifier" }, - "SeedDance2Resolution": { - "default": "720p", - "description": "The resolution tier of the generated video.", - "enum": [ - "480p", - "720p" - ], - "title": "SeedDance2Resolution", + "V2ToolGhostMannequinPostRequestBodyContentMultipartFormDataSchemaView": { "type": "string", - "x-tool-description": "Output resolution tier." - }, - "VideoDurationSeconds": { - "description": "The length of the generated video in seconds. When omitted, the model\npicks the best duration for the prompt (\"auto\").\n", - "example": 5, - "maximum": 15, - "minimum": 4, - "title": "duration", - "type": "integer", - "x-tool-description": "Seconds; omit to let the model choose." - }, - "GenerateVideoAudio": { - "default": false, - "description": "Whether to generate an audio track for the video. Audio roughly\ndoubles the provider cost and is subject to stricter output moderation.\n", - "title": "generate_audio", - "type": "boolean", - "x-tool-description": "Audio roughly doubles provider cost and tightens output moderation." - }, - "MinimaxH3AspectRatio": { - "default": "16x9", - "description": "The aspect ratio of the generated video.", "enum": [ - "21x9", - "16x9", - "4x3", - "1x1", - "3x4", - "9x16" + "front", + "three_quarter", + "back" ], - "title": "MinimaxH3AspectRatio", - "type": "string" + "description": "Camera view for the output garment.", + "title": "V2ToolGhostMannequinPostRequestBodyContentMultipartFormDataSchemaView" }, - "MinimaxH3Resolution": { - "default": "2K", - "description": "The resolution tier of the generated video, spelled the way MiniMax\nspells it. `480P` and `768P` are generated natively; `2K` and `4K` are\nupscaled from a `768P` result.\nHigher tiers cost more.\n", - "enum": [ - "480P", - "768P", - "2K", - "4K" - ], - "title": "MinimaxH3Resolution", + "GhostMannequinQuality": { "type": "string", - "x-tool-description": "480P/768P: native; 2K/4K: upscaled from 768P. Higher tiers cost more." - }, - "MinimaxH3DurationSeconds": { - "default": 5, - "description": "The length of the generated video in seconds.", - "example": 5, - "maximum": 15, - "minimum": 5, - "title": "duration", - "type": "integer" - }, - "KlingV3AspectRatio": { - "default": "16x9", - "description": "The aspect ratio of the generated video.", "enum": [ - "16x9", - "9x16", - "1x1" + "low", + "medium", + "high" ], - "title": "KlingV3AspectRatio", - "type": "string" - }, - "KlingV3DurationSeconds": { - "description": "The length of the generated video in seconds. Defaults to 5 seconds\nwhen omitted.\n", - "example": 5, - "maximum": 15, - "minimum": 3, - "title": "duration", - "type": "integer" + "description": "The quality tier for the edit. Higher tiers may improve detail and\ntake longer to complete.\n", + "title": "GhostMannequinQuality" }, - "KlingV3ShotType": { - "default": "customize", - "description": "How the prompt is staged. `customize` follows the prompt as written;\n`intelligent` lets the model break the prompt into its own shots.\n", - "enum": [ - "customize", - "intelligent" + "GhostMannequinResponse": { + "type": "object", + "properties": { + "generation_id": { + "type": "string", + "description": "URL-safe base64 ID accepted by the generation polling endpoint." + } + }, + "required": [ + "generation_id" ], - "title": "KlingV3ShotType", - "type": "string", - "x-tool-description": "customize: follow the prompt; intelligent: let the model divide it into shots." - }, - "KlingV3CfgScale": { - "description": "How closely the video follows the prompt, from 0 to 1. Lower values\nleave the model more freedom. Defaults to 0.5 when omitted.\n", - "example": 0.5, - "format": "float", - "maximum": 1, - "minimum": 0, - "title": "cfg_scale", - "type": "number", - "x-tool-description": "Prompt fidelity (0–1, default 0.5); lower allows more freedom." + "description": "Acknowledgement that the ghost-mannequin request was accepted. Poll\n`GET /v2/generations/{generation_id}` for status and results.\n", + "title": "GhostMannequinResponse" }, - "MinimaxH3PromptExpansionMode": { - "default": "balanced", - "description": "How much the model may rewrite the prompt before generating. `disabled`\nuses the prompt as written; the other modes trade latency for a richer\nrewrite.\n", + "MaterialSwapQuality": { + "type": "string", "enum": [ - "disabled", - "fast", - "balanced", - "quality" + "low", + "medium", + "high" ], - "title": "MinimaxH3PromptExpansionMode", - "type": "string" - }, - "VideoFrameTimeSeconds": { - "description": "A position within a source video, in seconds from its start. The frame\nshown at that position is the one selected; a position past the end of\nthe video is rejected.\n", - "example": 1.5, - "format": "float", - "minimum": 0, - "type": "number" + "description": "The quality tier for the edit. Higher tiers may improve detail and\ntake longer to complete.\n", + "title": "MaterialSwapQuality" }, - "IdeogramV3AspectRatio": { - "description": "The aspect ratio for an Ideogram 3.x or 2.x generation. `auto` lets the\nmodel select a ratio from the prompt; any other value pins the ratio.\nCannot be combined with `resolution`. Omitting the field is not `auto`:\nit uses `1x1`.\n", - "enum": [ - "auto", - "1x3", - "3x1", - "1x2", - "2x1", - "9x16", - "16x9", - "10x16", - "16x10", - "2x3", - "3x2", - "3x4", - "4x3", - "4x5", - "5x4", - "1x1" + "MaterialSwapResponse": { + "type": "object", + "properties": { + "generation_id": { + "type": "string", + "description": "URL-safe base64 ID accepted by the generation polling endpoint." + } + }, + "required": [ + "generation_id" ], - "title": "IdeogramV3AspectRatio", - "type": "string", - "x-tool-description": "Output ratio; auto chooses from the prompt, omission uses 1x1. Cannot combine with resolution." + "description": "Acknowledgement that the material swap was accepted. Poll\n`GET /v2/generations/{generation_id}` for status and results.\n", + "title": "MaterialSwapResponse" }, - "MagicPromptMode": { - "description": "Determine if MagicPrompt should be used in generating the request or not.", + "ModelPoseVariantsQuality": { + "type": "string", "enum": [ - "auto", - "on", - "off" + "low", + "medium", + "high" ], - "example": "on", - "externalDocs": { - "url": "https://docs.ideogram.ai/using-ideogram/ideogram-features/magic-prompt" - }, - "title": "MagicPromptMode", - "type": "string", - "x-tool-description": "Automatic prompt rewriting." + "description": "The quality tier for the edit. Higher tiers may improve detail and\ntake longer to complete.\n", + "title": "ModelPoseVariantsQuality" }, - "IdeogramColorPalette": { - "description": "A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members).", - "oneOf": [ - { - "$ref": "#/components/schemas/IdeogramColorPaletteWithPresetName" - }, - { - "$ref": "#/components/schemas/ColorPaletteWithMembers" + "ModelPoseVariantsResponse": { + "type": "object", + "properties": { + "generation_id": { + "type": "string", + "description": "URL-safe base64 ID accepted by the generation polling endpoint." } + }, + "required": [ + "generation_id" + ], + "description": "Acknowledgement that pose-variant generation was accepted. Poll\n`GET /v2/generations/{generation_id}` for status and results.\n", + "title": "ModelPoseVariantsResponse" + }, + "SketchToRenderQuality": { + "type": "string", + "enum": [ + "low", + "medium", + "high" ], - "title": "IdeogramColorPalette", - "x-tool-description": "Use either a preset name or hex-color members with optional weights." + "description": "The quality tier for the edit. Higher tiers may improve detail and\ntake longer to complete.\n", + "title": "SketchToRenderQuality" }, - "IdeogramColorPaletteWithPresetName": { - "description": "A color palette specified only via its name. Cannot be used in conjunction with members.", + "SketchToRenderResponse": { + "type": "object", "properties": { - "name": { - "$ref": "#/components/schemas/IdeogramColorPalettePresetName" + "generation_id": { + "type": "string", + "description": "URL-safe base64 ID accepted by the generation polling endpoint." } }, "required": [ - "name" + "generation_id" ], - "title": "IdeogramColorPaletteWithPresetName", - "type": "object", - "x-tool-description": "Preset palette name; cannot combine with members." + "description": "Acknowledgement that the sketch rendering was accepted. Poll\n`GET /v2/generations/{generation_id}` for status and results.\n", + "title": "SketchToRenderResponse" }, - "IdeogramColorPalettePresetName": { - "description": "A color palette preset value.", + "GenerationResponseStatus": { + "type": "string", "enum": [ - "ember", - "fresh", - "jungle", - "magic", - "melon", - "mosaic", - "pastel", - "ultramarine" + "pending", + "completed", + "failed" ], - "example": "pastel", - "title": "IdeogramColorPalettePresetName", - "type": "string" + "description": "Current status of the generation. `pending`: still in progress; the response contains only `generation_id`, `status`, and `created`. `completed`: finished successfully; the response includes `response_type` and `data`, and may include `usage_cost_usd_micros` when the request uses variable usage-based pricing. `failed`: generation did not succeed; the response contains only `generation_id`, `status`, and `created`.", + "title": "GenerationResponseStatus" }, - "IdeogramV3StyleType": { - "default": "general", - "description": "The style type to generate with.", + "GenerationResponseResponseType": { + "type": "string", "enum": [ - "auto", - "general", - "realistic", - "design", - "custom", - "fiction", - "stylized" + "url" ], - "example": "general", - "title": "IdeogramV3StyleType", - "type": "string", - "x-tool-description": "The style type to generate with. With a style reference, saved style or style_preset, use auto; any type other than auto or general is rejected." + "description": "Present when `status` is `completed`; always \"url\" for this shape.", + "title": "GenerationResponseResponseType" }, - "IdeogramV3StylePreset": { - "description": "A predefined style preset that applies a specific artistic style to the generated image.", + "GenerationResponseDataInnerDiscriminatorMappingSvgGenerationMimeType": { + "type": "string", "enum": [ - "80s_illustration", - "90s_nostalgia", - "abstract_organic", - "analog_nostalgia", - "art_brut", - "art_deco", - "art_poster", - "aura", - "avant_garde", - "bauhaus", - "blueprint", - "blurry_motion", - "bright_art", - "c4d_cartoon", - "childrens_book", - "collage", - "coloring_book_i", - "coloring_book_ii", - "cubism", - "dark_aura", - "doodle", - "double_exposure", - "dramatic_cinema", - "editorial", - "emotional_minimal", - "ethereal_party", - "expired_film", - "flat_art", - "flat_vector", - "forest_reverie", - "geo_minimalist", - "glass_prism", - "golden_hour", - "graffiti_i", - "graffiti_ii", - "halftone_print", - "high_contrast", - "hippie_era", - "iconic", - "japandi_fusion", - "jazzy", - "long_exposure", - "magazine_editorial", - "minimal_illustration", - "mixed_media", - "monochrome", - "nightlife", - "oil_painting", - "old_cartoons", - "paint_gesture", - "pop_art", - "retro_etching", - "riviera_pop", - "spotlight_80s", - "stylized_red", - "surreal_collage", - "travel_poster", - "vintage_geo", - "vintage_poster", - "watercolor", - "weird", - "woodblock_print" + "image/svg+xml" ], - "example": "bright_art", - "title": "IdeogramV3StylePreset", - "type": "string", - "x-tool-description": "Artistic style preset." + "title": "GenerationResponseDataInnerDiscriminatorMappingSvgGenerationMimeType" }, - "IdeogramV4AspectRatio": { - "default": "auto", - "description": "Supported output aspect ratios. The operation defines whether `auto`\npreserves the source shape or selects a shape from the prompt.\n", + "LayerizedTextBlockAlignment": { + "type": "string", "enum": [ - "auto", - "1x4", - "1x3", - "1x2", - "9x16", - "10x16", - "2x3", - "3x4", - "4x5", - "1x1", - "5x4", - "4x3", - "3x2", - "16x10", - "16x9", - "2x1", - "3x1", - "4x1" + "left", + "center", + "right" ], - "title": "IdeogramV4AspectRatio", - "type": "string" + "description": "Detected text alignment.", + "title": "LayerizedTextBlockAlignment" }, - "GenerationQuality": { - "description": "The generation quality level. Higher levels may use more inference steps\nor additional prompt processing. `very_high` has noticeably higher latency\nand cost than the other levels.\n", + "LayerizedTextBlockFormattingItems": { + "type": "string", "enum": [ - "very_low", - "low", - "medium", - "high", - "very_high" + "bold", + "italic", + "underline", + "strikethrough", + "all_caps", + "small_caps", + "superscript", + "subscript" + ], + "title": "LayerizedTextBlockFormattingItems" + }, + "LayerizedTextBlockRole": { + "type": "string", + "enum": [ + "heading", + "subheading", + "body", + "caption" + ], + "description": "Inferred typographic role of this text block.", + "title": "LayerizedTextBlockRole" + }, + "TextColorSpan": { + "type": "object", + "properties": { + "text": { + "type": "string", + "description": "The characters in this run." + }, + "color": { + "type": "string", + "pattern": "^#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$", + "description": "Hex colour for this run." + } + }, + "required": [ + "text", + "color" + ], + "description": "One run of characters within a text block that shares a single colour. A block\nwhose letters are individually coloured returns one span per letter; a block in a\nsingle colour returns one span covering all of it. Concatenating `text` across a\nblock's spans in order reproduces the block's full text.\n", + "title": "TextColorSpan" + }, + "LayerizedTextBlock": { + "type": "object", + "properties": { + "x": { + "type": "integer", + "description": "X coordinate in pixels from the top-left corner." + }, + "y": { + "type": "integer", + "description": "Y coordinate in pixels from the top-left corner." + }, + "width": { + "type": "integer", + "description": "Width of the text region in pixels." + }, + "height": { + "type": "integer", + "description": "Height of the text region in pixels." + }, + "text": { + "type": "string", + "description": "The detected text content. Line breaks are represented as \\n." + }, + "alignment": { + "$ref": "#/components/schemas/LayerizedTextBlockAlignment", + "description": "Detected text alignment." + }, + "angle": { + "type": "string", + "title": "float", + "description": "Rotation angle in degrees (clockwise). Defaults to 0.", + "default": 0 + }, + "font_name": { + "type": [ + "string", + "null" + ], + "description": "Best-matching font name from the font library." + }, + "font_alternatives": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + }, + "description": "Alternative font matches, ranked by similarity." + }, + "font_size": { + "type": [ + "integer", + "null" + ], + "description": "Detected font size in points." + }, + "line_height": { + "type": [ + "string", + "null" + ], + "title": "float", + "description": "Line height multiplier (e.g., 1.2)." + }, + "color": { + "type": [ + "string", + "null" + ], + "pattern": "^#[0-9A-Fa-f]{6}$", + "description": "Detected text color in hex format." + }, + "formatting": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LayerizedTextBlockFormattingItems" + }, + "description": "Detected text formatting effects." + }, + "role": { + "oneOf": [ + { + "$ref": "#/components/schemas/LayerizedTextBlockRole" + }, + { + "type": "null" + } + ], + "description": "Inferred typographic role of this text block." + }, + "layer_id": { + "type": "string", + "description": "Identifier of this block's layer in the page at `html_url`; pass it to the page's editing API." + }, + "spans": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/components/schemas/TextColorSpan" + }, + "description": "The block's colour runs in reading order. Present, with at least one\nrun, whenever `color` is set; concatenating the runs' `text` reproduces\nthe block's `text`. `color` reports the dominant colour.\n" + } + }, + "required": [ + "x", + "y", + "width", + "height", + "text", + "alignment", + "formatting", + "layer_id" ], - "title": "GenerationQuality", - "type": "string" + "description": "A single detected text region with its position, content, font information, and styling.", + "title": "LayerizedTextBlock" }, - "GenerationKind": { - "description": "The kind of generation identified by generation_id. Both kinds can be polled through GET /v2/generations/{generation_id}.", - "enum": [ - "sampling", - "workflow" + "GenerationResponse_data_inner": { + "oneOf": [ + { + "type": "object", + "properties": { + "object_type": { + "type": "string", + "enum": [ + "image.without-prompt-or-seed" + ], + "description": "Discriminator value: image.without-prompt-or-seed" + }, + "url": { + "type": [ + "string", + "null" + ], + "format": "uri", + "description": "The direct link to the reframed image." + }, + "resolution": { + "type": "string", + "description": "The exact dimensions of the reframed image, formatted as \"{width}x{height}\"." + }, + "is_image_safe": { + "type": "boolean", + "description": "Whether this image passes safety checks. If false, the url field is empty." + } + }, + "required": [ + "object_type", + "resolution", + "is_image_safe" + ], + "description": "An image result that does not expose its prompt or seed." + }, + { + "type": "object", + "properties": { + "object_type": { + "type": "string", + "enum": [ + "svg.generation" + ], + "description": "Discriminator value: svg.generation" + }, + "asset_id": { + "type": "string", + "description": "URL-safe base64 SVG asset ID." + }, + "url": { + "type": "string", + "format": "uri", + "description": "Signed download URL for the original SVG." + }, + "mime_type": { + "$ref": "#/components/schemas/GenerationResponseDataInnerDiscriminatorMappingSvgGenerationMimeType" + }, + "width": { + "type": "integer", + "minimum": 1, + "description": "Width of the output SVG canvas in pixels." + }, + "height": { + "type": "integer", + "minimum": 1, + "description": "Height of the output SVG canvas in pixels." + } + }, + "required": [ + "object_type", + "asset_id", + "url", + "mime_type", + "width", + "height" + ], + "description": "SvgGenerationObject variant" + }, + { + "type": "object", + "properties": { + "object_type": { + "type": "string", + "enum": [ + "image.generation" + ], + "description": "Discriminator value: image.generation" + }, + "url": { + "type": [ + "string", + "null" + ], + "format": "uri", + "description": "The direct link to the image generated." + }, + "prompt": { + "type": "string", + "description": "The prompt used for the generation. This may be different from the original prompt." + }, + "resolution": { + "type": "string", + "description": "The resolution of the generated image, formatted as \"{width}x{height}\"." + }, + "is_image_safe": { + "type": "boolean", + "description": "Whether this image passes safety checks. If false, the url field will be empty." + }, + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." + } + }, + "required": [ + "object_type", + "prompt", + "resolution", + "is_image_safe", + "seed" + ], + "description": "A single generated image. Model-agnostic shape returned by the generation polling endpoint." + }, + { + "type": "object", + "properties": { + "object_type": { + "type": "string", + "enum": [ + "video.generation" + ], + "description": "Discriminator value: video.generation" + }, + "asset_id": { + "type": "string", + "description": "The generated video's asset ID. Use it with asset_type RESPONSE in video_asset_identifier for a follow-up video edit. This is distinct from the generation ID used for polling." + }, + "url": { + "type": [ + "string", + "null" + ], + "format": "uri", + "description": "The direct link to the generated video." + }, + "prompt": { + "type": "string", + "description": "The prompt used for the generation." + }, + "resolution": { + "type": "string", + "description": "The resolution tier of the generated video." + }, + "aspect_ratio": { + "type": "string", + "description": "The actual aspect ratio of the produced video, formatted as \"{width}:{height}\"." + }, + "duration": { + "type": "integer", + "description": "The actual measured length of the produced video in seconds." + } + }, + "required": [ + "object_type", + "prompt", + "resolution", + "aspect_ratio", + "duration" + ], + "description": "A single generated video returned by the generation polling endpoint." + }, + { + "type": "object", + "properties": { + "object_type": { + "type": "string", + "enum": [ + "layerized_image" + ], + "description": "Discriminator value: layerized_image" + }, + "url": { + "type": [ + "string", + "null" + ], + "format": "uri", + "description": "The direct link to the design image with its text intact. Empty when the image did not pass safety checks." + }, + "base_image_url": { + "type": [ + "string", + "null" + ], + "format": "uri", + "description": "The direct link to the base image with all detected text removed. Empty when the image did not pass safety checks." + }, + "resolution": { + "type": "string", + "description": "The resolution of the design, formatted as \"WIDTHxHEIGHT\"." + }, + "is_image_safe": { + "type": "boolean", + "description": "Whether the image passed safety checks. If false, the image links are empty." + }, + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." + }, + "text_blocks": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DetectedTextBlock" + }, + "description": "Flat list of detected text regions in the design." + } + }, + "required": [ + "object_type", + "resolution", + "is_image_safe", + "seed", + "text_blocks" + ], + "description": "One layerized design. Image links are available for a limited period\nof time; if you would like to keep an image, you must download it.\n" + }, + { + "type": "object", + "properties": { + "object_type": { + "type": "string", + "enum": [ + "layerized_design.generation" + ], + "description": "Discriminator value: layerized_design.generation" + }, + "url": { + "type": [ + "string", + "null" + ], + "format": "uri", + "description": "Signed link to the design image with its text intact. Empty when the image did not pass safety checks." + }, + "base_image_url": { + "type": [ + "string", + "null" + ], + "format": "uri", + "description": "Signed link to the base image with all detected text removed. Empty when the image did not pass safety checks." + }, + "resolution": { + "type": "string", + "description": "The resolution of the design, formatted as \"WIDTHxHEIGHT\"." + }, + "is_image_safe": { + "type": "boolean", + "description": "Whether the image passed safety checks. If false, the links are empty." + }, + "seed": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "description": "Random seed. Set for reproducible generation." + }, + "text_blocks": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LayerizedTextBlock" + }, + "description": "Flat list of detected text regions in the design." + }, + "html_url": { + "type": [ + "string", + "null" + ], + "format": "uri", + "description": "Signed link to a self-contained HTML page displaying the editable\ndesign, including curved text, gradients, outlines, and shadows. The\nrenderer, images, and fonts are embedded in the page, so it keeps\nworking offline once downloaded; the link itself expires after 24\nhours. Uploaded `font_candidate_files` are embedded as supplied, so\nredistributing the page is subject to those fonts' licenses. Empty\nwhen the image did not pass safety checks or the page could not be\nbuilt.\n\nThe page exposes one editing API for every text layer, whether it\nis drawn as HTML or on a canvas. Each layer is addressed by its\n`text_blocks[].layer_id`. Scripts in the page can call\n`window.layerize` (`ready`, `getTextLayers()`, `setText(id, text)`,\n`update(id, patch)`, `toJSON()`, `toPNG()`); a parent page that\nembeds it in an iframe sends `postMessage` requests such as\n`{\"type\": \"layerize:set-text\", \"id\": \"text-0\", \"text\": \"Hello\"}`\nand receives `layerize:ready`, `layerize:updated`, and\n`layerize:error` replies. The page is served sandboxed with an\nopaque origin, so it cannot read cookies or storage of the site\nthat embeds it.\n" + } + }, + "required": [ + "object_type", + "resolution", + "is_image_safe", + "seed", + "text_blocks" + ], + "description": "One layerized design. Links are available for a limited period of time;\nif you would like to keep a file, you must download it.\n" + } ], - "title": "GenerationKind", - "type": "string" + "discriminator": { + "propertyName": "object_type" + }, + "title": "GenerationResponse_data_inner" }, - "NanoBanana2AspectRatio": { - "default": "auto", - "description": "Output aspect ratios Nano Banana 2 serves. `auto` lets the model choose the shape; an edit keeps its source image's shape.", - "enum": [ - "auto", - "1:1", - "3:2", - "2:3", - "4:3", - "3:4", - "5:4", - "4:5", - "16:9", - "9:16", - "21:9", - "4:1", - "1:4", - "8:1", - "1:8" + "GenerationResponse": { + "type": "object", + "properties": { + "generation_id": { + "type": "string", + "description": "URL-safe base64 ID of the generation." + }, + "status": { + "$ref": "#/components/schemas/GenerationResponseStatus", + "description": "Current status of the generation. `pending`: still in progress; the response contains only `generation_id`, `status`, and `created`. `completed`: finished successfully; the response includes `response_type` and `data`, and may include `usage_cost_usd_micros` when the request uses variable usage-based pricing. `failed`: generation did not succeed; the response contains only `generation_id`, `status`, and `created`." + }, + "created": { + "type": "string", + "format": "date-time", + "description": "The time the generation was created." + }, + "response_type": { + "$ref": "#/components/schemas/GenerationResponseResponseType", + "description": "Present when `status` is `completed`; always \"url\" for this shape." + }, + "usage_cost_usd_micros": { + "type": "integer", + "format": "int64", + "minimum": 0, + "description": "The total variable usage-based cost charged for the completed request, in millionths of a US dollar. Present only when `status` is `completed` and the request uses variable usage-based pricing; omitted otherwise." + }, + "failure_reason": { + "type": "string", + "description": "A short machine-readable reason the generation failed, for example\n`content_policy_violation`. Present only when `status` is `failed`.\n" + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GenerationResponse_data_inner" + }, + "description": "A list of generated images or videos. Present when `status` is\n`completed`. Video entries carry an `object_type` of\n`video.generation`; layerized designs carry `layerized_image`;\nentries without an `object_type` are images.\n" + } + }, + "required": [ + "generation_id", + "status", + "created" ], - "title": "NanoBanana2AspectRatio", - "type": "string" + "description": "The current status and, when complete, result data for an asynchronous generation.", + "title": "GenerationResponse" }, - "NanoBanana21AspectRatio": { - "default": "auto", - "description": "Output aspect ratios Nano Banana 2.1 serves. `auto` lets the model choose the shape; an edit keeps its source image's shape.", + "AccountApiKeyStatus": { + "type": "string", "enum": [ - "auto", - "1:1", - "3:2", - "2:3", - "4:3", - "3:4", - "5:4", - "4:5", - "16:9", - "9:16", - "21:9", - "4:1", - "1:4", - "8:1", - "1:8" + "active", + "disabled", + "archived" ], - "title": "NanoBanana21AspectRatio", - "type": "string" + "title": "AccountApiKeyStatus" }, - "NanoBananaProAspectRatio": { - "default": "auto", - "description": "Output aspect ratios Nano Banana Pro serves. `auto` lets the model choose the shape; an edit keeps its source image's shape.", - "enum": [ - "auto", - "1:1", - "3:2", - "2:3", - "4:3", - "3:4", - "5:4", - "4:5", - "16:9", - "9:16", - "21:9" + "AccountApiKey": { + "type": "object", + "properties": { + "api_key_id": { + "type": "string", + "description": "Base64 encoded API key ID" + }, + "redacted_api_key": { + "type": "string", + "description": "A redacted text snippet of the API key. Contains the first 4 characters of the API key" + }, + "creation_time": { + "type": "string", + "format": "date-time", + "description": "The date at which the API key was created" + }, + "status": { + "$ref": "#/components/schemas/AccountApiKeyStatus" + }, + "label": { + "type": [ + "string", + "null" + ], + "description": "An optional user-supplied label for managing the API key" + }, + "creator_display_label": { + "type": [ + "string", + "null" + ], + "description": "Name of the member who created the key, falling back to their display handle when no name is set. Null on keys created before creators were recorded, and on workspace types whose keys are shared rather than owned by one member." + } + }, + "required": [ + "api_key_id", + "redacted_api_key", + "creation_time", + "status" ], - "title": "NanoBananaProAspectRatio", - "type": "string" + "title": "AccountApiKey" }, - "IdeogramV2StyleType": { - "description": "The style type to generate with. When omitted, the model's default styling is used; pass `auto` to have a style selected automatically from the prompt.", - "enum": [ - "auto", - "general", - "realistic", - "design", - "render_3d", - "anime" + "ListAccountApiKeysResponse": { + "type": "object", + "properties": { + "api_keys": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AccountApiKey" + }, + "description": "All API keys in the organization, newest first." + } + }, + "required": [ + "api_keys" ], - "example": "realistic", - "title": "IdeogramV2StyleType", - "type": "string" + "title": "ListAccountApiKeysResponse" }, - "NanoBanana2ReframeAspectRatio": { - "description": "Aspect ratios Nano Banana 2 can reframe an image to.", + "AccountInvoiceStatus": { + "type": "string", "enum": [ - "1:1", - "3:2", - "2:3", - "4:3", - "3:4", - "5:4", - "4:5", - "16:9", - "9:16", - "21:9", - "4:1", - "1:4", - "8:1", - "1:8" + "draft", + "pending_payment", + "paid", + "voided" ], - "title": "NanoBanana2ReframeAspectRatio", - "type": "string" + "description": "Status of the invoice", + "title": "AccountInvoiceStatus" }, - "NanoBananaProReframeAspectRatio": { - "description": "Aspect ratios Nano Banana Pro can reframe an image to.", - "enum": [ - "1:1", - "3:2", - "2:3", - "4:3", - "3:4", - "5:4", - "4:5", - "16:9", - "9:16", - "21:9" + "AccountUsageApiKey": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The API key's id, as listed by `GET /v2/account/api-keys`." + }, + "redacted_key": { + "type": [ + "string", + "null" + ], + "description": "The first characters of the key followed by bullets." + }, + "label": { + "type": [ + "string", + "null" + ], + "description": "The key's user-supplied label, when one is set." + } + }, + "required": [ + "id" ], - "title": "NanoBananaProReframeAspectRatio", - "type": "string" + "description": "The API key the usage was billed to, in redacted form.", + "title": "AccountUsageApiKey" }, - "Price": { - "description": "Represents a price.", - "example": { - "amount": 1050, - "currency_code": "USD" - }, + "AccountInvoiceLineItem": { + "type": "object", "properties": { + "description": { + "type": "string", + "description": "Display name of the charged product. Not an identifier." + }, + "quantity": { + "type": "string", + "description": "Number of billed units, as a decimal string." + }, + "unit_price": { + "type": "string", + "description": "Price per unit in `currency_code`, as a decimal string." + }, + "cost_total": { + "type": "string", + "description": "Total charged amount in `currency_code`, as a decimal string." + }, "currency_code": { - "description": "The ISO 4217 currency code for the price object.", - "example": "USD", - "title": "currency_code", - "type": "string" + "type": "string", + "description": "ISO 4217 currency code of the amounts on this line item." }, - "amount": { - "description": "The amount of the currency in the common denomination. For example, in USD this is cents.", - "example": 1050, - "title": "amount", - "type": "number" + "api_key": { + "$ref": "#/components/schemas/AccountUsageApiKey" } }, "required": [ - "amount", + "description", + "quantity", + "unit_price", + "cost_total", "currency_code" ], - "title": "Price", - "type": "object" + "description": "One charged product on an invoice.", + "title": "AccountInvoiceLineItem" }, - "MiniAppArtwork": { - "description": "Artwork URLs used to present a mini-app in the app catalog.", + "AccountInvoice": { + "type": "object", "properties": { - "icon": { - "description": "Square mini-app icon URL.", - "nullable": true, - "title": "icon", - "type": "string" + "start_time": { + "type": "string", + "format": "date-time", + "description": "Start of the invoice period." }, - "cover": { - "description": "Cover image or video URL used when no card artwork is available. Video URL paths must end in .mp4 or .webm.", - "nullable": true, - "title": "cover", - "type": "string" + "end_time": { + "type": "string", + "format": "date-time", + "description": "End of the invoice period." }, - "card": { - "description": "Preferred app catalog image or video thumbnail URL. Video URL paths must end in .mp4 or .webm.", - "nullable": true, - "title": "card", - "type": "string" + "issued_time": { + "type": [ + "string", + "null" + ], + "format": "date-time", + "description": "When the invoice was issued, when it has been." + }, + "paid_time": { + "type": [ + "string", + "null" + ], + "format": "date-time", + "description": "When the invoice was paid, when it has been." + }, + "status": { + "$ref": "#/components/schemas/AccountInvoiceStatus" + }, + "total": { + "type": "string", + "description": "Invoice total in `currency_code`, as a decimal string." + }, + "currency_code": { + "type": "string", + "description": "ISO 4217 currency code of the amounts on this invoice." + }, + "line_items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AccountInvoiceLineItem" + }, + "description": "The invoice's charges." } }, - "title": "MiniAppArtwork", - "type": "object" + "required": [ + "start_time", + "end_time", + "status", + "total", + "currency_code", + "line_items" + ], + "title": "AccountInvoice" }, - "TextColorSpan": { - "description": "One run of characters within a text block that shares a single colour. A block\nwhose letters are individually coloured returns one span per letter; a block in a\nsingle colour returns one span covering all of it. Concatenating `text` across a\nblock's spans in order reproduces the block's full text.\n", + "ListAccountInvoicesResponse": { + "type": "object", "properties": { - "text": { - "description": "The characters in this run.", - "example": "T", - "title": "text", - "type": "string" - }, - "color": { - "description": "Hex colour for this run.", - "example": "#F4ACC4", - "pattern": "^#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$", - "title": "color", - "type": "string" + "invoices": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AccountInvoice" + }, + "description": "The organization's invoices." } }, "required": [ - "color", - "text" + "invoices" ], - "title": "TextColorSpan", - "type": "object" + "title": "ListAccountInvoicesResponse" }, - "AttributeValueType": { - "description": "How the values of an attribute key are stored and filtered.", + "V2AccountUsageGetParametersBucketWidth": { + "type": "string", "enum": [ - "TEXT", - "NUMBER" + "1d", + "1h" ], - "title": "AttributeValueType", - "type": "string" + "default": "1d", + "title": "V2AccountUsageGetParametersBucketWidth" }, - "postGenerateDesignV4_200_response": { - "discriminator": { - "mapping": { - "layered": "#/components/schemas/LayeredImageGenerationResponseV3", - "url": "#/components/schemas/ImageGenerationResponseV4Layout" - }, - "propertyName": "response_type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/LayeredImageGenerationResponseV3" - }, - { - "$ref": "#/components/schemas/ImageGenerationResponseV4Layout" - } + "V2AccountUsageGetParametersSourcesSchemaItems": { + "type": "string", + "enum": [ + "api", + "app" ], - "title": "postGenerateDesignV4_200_response" + "title": "V2AccountUsageGetParametersSourcesSchemaItems" }, - "postInternalTesting_200_response": { - "example": { - "response_content": "response_content" - }, + "AccountUsageLineItemSource": { + "type": "string", + "enum": [ + "api", + "app" + ], + "description": "Which billing surface the usage came through. `api` usage is attributed to an API key when one was used; `app` usage is attributed to the member who generated it.", + "title": "AccountUsageLineItemSource" + }, + "AccountUsageBilledUnits": { + "type": "object", "properties": { - "response_content": { - "title": "response_content", - "type": "string" + "unit": { + "type": "string", + "description": "What one billed unit is (for example `image`)." + }, + "quantity": { + "type": "string", + "description": "Number of units billed, as a decimal string." + }, + "unit_price": { + "type": "string", + "description": "Price per unit in `currency_code`, as a decimal string." } }, - "title": "postInternalTesting_200_response", - "type": "object" + "required": [ + "unit", + "quantity", + "unit_price" + ], + "description": "Per-unit detail for products billed per item. `quantity × unit_price` always equals the line item's `cost_total`.", + "title": "AccountUsageBilledUnits" }, - "GenerationResponse_data_inner": { - "discriminator": { - "mapping": { - "image.without-prompt-or-seed": "#/components/schemas/ImageObjectWithoutPromptOrSeed", - "svg.generation": "#/components/schemas/SvgGenerationObject", - "image.generation": "#/components/schemas/ImageGenerationObject", - "video.generation": "#/components/schemas/VideoObject", - "layerized_image": "#/components/schemas/LayerizedImageObject", - "layerized_design.generation": "#/components/schemas/TextLayerizerResultObject" + "AccountUsageLineItem": { + "type": "object", + "properties": { + "product": { + "type": "string", + "description": "Stable identifier of the public pricing catalog entry this charge was billed under, at the granularity the pricing page prices it (for example one entry per quality and resolution). `unknown` when a historical charge can no longer be attributed; its cost is still included." }, - "propertyName": "object_type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/ImageObjectWithoutPromptOrSeed" + "endpoint": { + "type": "string", + "description": "The API endpoint path this product belongs to." }, - { - "$ref": "#/components/schemas/SvgGenerationObject" + "description": { + "type": "string", + "description": "Name of the public pricing catalog entry, as shown on the pricing page. Not an identifier." }, - { - "$ref": "#/components/schemas/ImageGenerationObject" + "dimensions": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Pricing dimensions this line item was billed under, for products priced per dimension (for example rendering speed)." }, - { - "$ref": "#/components/schemas/VideoObject" + "cost_total": { + "type": "string", + "description": "Total billed amount in `currency_code`, as a decimal string." }, - { - "$ref": "#/components/schemas/LayerizedImageObject" + "currency_code": { + "type": "string", + "description": "ISO 4217 currency code of the amounts on this line item." }, - { - "$ref": "#/components/schemas/TextLayerizerResultObject" - } - ], - "title": "GenerationResponse_data_inner" - }, - "MagicPromptRequest_messages_inner": { - "properties": { - "role": { - "enum": [ - "system", - "user", - "assistant" + "source": { + "$ref": "#/components/schemas/AccountUsageLineItemSource", + "description": "Which billing surface the usage came through. `api` usage is attributed to an API key when one was used; `app` usage is attributed to the member who generated it." + }, + "api_key": { + "$ref": "#/components/schemas/AccountUsageApiKey" + }, + "user_email": { + "type": [ + "string", + "null" ], - "title": "role", - "type": "string" + "description": "Email address of the member who generated the usage. Only present on `app` usage." }, - "content": { - "title": "content", - "type": "string" + "billed_units": { + "$ref": "#/components/schemas/AccountUsageBilledUnits" } }, "required": [ - "content", - "role" + "product", + "endpoint", + "description", + "cost_total", + "currency_code", + "source" ], - "title": "MagicPromptRequest_messages_inner", - "type": "object" + "description": "One billed rate for one billing actor within one time bucket.", + "title": "AccountUsageLineItem" }, - "InternalBatchResultsResponse_results_inner": { - "example": { - "image_url": "image_url", - "prompt": "a cat" - }, + "AccountUsageBucket": { + "type": "object", "properties": { - "prompt": { - "description": "The prompt used for generation.", - "example": "a cat", - "title": "prompt", - "type": "string" + "start_time": { + "type": "string", + "format": "date-time", + "description": "Start of the bucket window (inclusive, UTC)." }, - "image_url": { - "description": "The URL of the generated image.", - "title": "image_url", - "type": "string" + "end_time": { + "type": "string", + "format": "date-time", + "description": "End of the bucket window (exclusive, UTC)." + }, + "line_items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AccountUsageLineItem" + }, + "description": "Usage billed in this window. Empty when nothing was billed." } }, "required": [ - "image_url", - "prompt" + "start_time", + "end_time", + "line_items" ], - "title": "InternalBatchResultsResponse_results_inner", - "type": "object" + "title": "AccountUsageBucket" }, - "Dataset_cover_asset_identifier": { - "allOf": [ - { - "$ref": "#/components/schemas/AssetIdentifier" + "GetAccountUsageResponse": { + "type": "object", + "properties": { + "buckets": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AccountUsageBucket" + }, + "description": "Dense, chronological buckets covering the requested range." } - ], - "description": "Cover asset of the dataset, null if not set.", - "example": { - "collection_id": "collection_id", - "asset_type": null, - "asset_id": "asset_id" }, - "nullable": true, - "title": "Dataset_cover_asset_identifier" + "required": [ + "buckets" + ], + "title": "GetAccountUsageResponse" } }, "securitySchemes": { "ApiKeyAuth": { - "description": "API key for access control. Use in the header with the name \\\"Api-Key\\\"", + "type": "apiKey", "in": "header", "name": "Api-Key", - "type": "apiKey", - "x-apikeyInfoFunc": "external_api.generated.openapi.controllers.security_controller.info_from_ApiKeyAuth" - }, - "BearerAuth": { - "bearerFormat": "JWT", - "scheme": "bearer", - "type": "http", - "x-bearerInfoFunc": "external_api.generated.openapi.controllers.security_controller.info_from_BearerAuth" + "description": "API key for access control. Use in the header with the name \\\"Api-Key\\\"" } } }